/*!
 Stencil Compiler v2.22.3 | MIT Licensed | https://stenciljs.com
 */
(function(exports) {
'use strict';

if (typeof globalThis === 'undefined') {
  if (typeof self !== 'undefined') {
  self.globalThis = self;
  } else if (typeof window !== 'undefined') {
  window.globalThis = window;
  } else if (typeof global !== 'undefined') {
  global.globalThis = global;
  }
}

const Buffer = globalThis.Buffer || {};
const process = globalThis.process || {};
if (!process.argv) {
  process.argv = [''];
}
let __cwd = '/';
if (!process.cwd) {
  process.cwd = () => __cwd;
}
if (!process.chdir) {
  process.chdir = (v) => __cwd = v;
}
if (!process.nextTick) {
  const resolved = Promise.resolve();
  process.nextTick = (cb) => resolved.then(cb);
}
if (!process.platform) {
  process.platform = 'stencil';
}
if (!process.version) {
  process.version = 'v12.0.0';
}
process.browser = !!globalThis.location;


const IS_NODE_ENV = typeof global !== 'undefined' &&
  typeof require === 'function' &&
  !!global.process &&
  typeof __filename === 'string' &&
  (!global.origin || typeof global.origin !== 'string');
const OS_PLATFORM = IS_NODE_ENV ? process.platform : '';
const IS_WINDOWS_ENV = OS_PLATFORM === 'win32';
const IS_CASE_SENSITIVE_FILE_NAMES = !IS_WINDOWS_ENV;
const IS_BROWSER_ENV = typeof location !== 'undefined' && typeof navigator !== 'undefined' && typeof XMLHttpRequest !== 'undefined';
const IS_WEB_WORKER_ENV = IS_BROWSER_ENV && typeof self !== 'undefined' && typeof self.importScripts === 'function';
const HAS_WEB_WORKER = IS_BROWSER_ENV && typeof Worker === 'function';
const IS_FETCH_ENV = typeof fetch === 'function';
const requireFunc = IS_NODE_ENV ? require : () => { };
const getCurrentDirectory = IS_NODE_ENV ? process.cwd : () => '/';

process.browser=!IS_NODE_ENV;const t={};var r,n$4=undefined&&undefined.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},i$1=undefined&&undefined.__assign||function(){return i$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i$1.apply(this,arguments)},a=undefined&&undefined.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},o=undefined&&undefined.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o);}catch(e){s=[6,e],n=0;}finally{r=i=0;}if(5&s[0])throw s[1];return {value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},s=undefined&&undefined.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);}return r},c=undefined&&undefined.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e;}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n);});!function(e){var t,r;e.versionMajorMinor="4.9",e.version="".concat(e.versionMajorMinor,".4"),(r=e.Comparison||(e.Comparison={}))[r.LessThan=-1]="LessThan",r[r.EqualTo=0]="EqualTo",r[r.GreaterThan=1]="GreaterThan",function(e){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;e.tryGetNativeMap=function(){var e=null==t?void 0:t.Map,r=void 0!==e&&"entries"in e.prototype&&1===new e([[0,0]]).size?e:void 0;if(!r)throw new Error("No compatible Map implementation found.");return r},e.tryGetNativeSet=function(){var e=null==t?void 0:t.Set,r=void 0!==e&&"entries"in e.prototype&&1===new e([0]).size?e:void 0;if(!r)throw new Error("No compatible Set implementation found.");return r};}(t||(t={})),e.Map=t.tryGetNativeMap(),e.Set=t.tryGetNativeSet();}(t),function(e){function t(e,t,r){if(void 0===r&&(r=O),e)for(var n=0,i=e;n<i.length;n++)if(r(i[n],t))return !0;return !1}function r(e,t){if(e){if(!t)return e.length>0;for(var r=0,n=e;r<n.length;r++)if(t(n[r]))return !0}return !1}function i(e,t){return r(t)?r(e)?n$4(n$4([],e,!0),t,!0):t:e}function a(e,t){return t}function o(e){return e.map(a)}function s(e,t){return void 0===t?e:void 0===e?[t]:(e.push(t),e)}function c(e,t){return t<0?e.length+t:t}function l(e,t,r,n){if(void 0===t||0===t.length)return e;if(void 0===e)return t.slice(r,n);r=void 0===r?0:c(t,r),n=void 0===n?t.length:c(t,n);for(var i=r;i<n&&i<t.length;i++)void 0!==t[i]&&e.push(t[i]);return e}function u(e,r,n){return !t(e,r,n)&&(e.push(r),!0)}function _(e,t,r){t.sort((function(t,n){return r(e[t],e[n])||L(t,n)}));}function d(e,t){return 0===e.length?e:e.slice().sort(t)}function p(e){var t=0;return {next:function(){return t===e.length?{value:void 0,done:!0}:(t++,{value:e[t-1],done:!1})}}}function f(e){return e&&1===e.length?e[0]:void 0}function g(e,t,r,n,i){return m(e,r(t),r,n,i)}function m(e,t,n,i,a){if(!r(e))return -1;for(var o=a||0,s=e.length-1;o<=s;){var c=o+(s-o>>1);switch(i(n(e[c],c),t)){case-1:o=c+1;break;case 0:return c;case 1:s=c-1;}}return ~o}function y(e,t,r,n,i){if(e&&e.length>0){var a=e.length;if(a>0){var o=void 0===n||n<0?0:n,s=void 0===i||o+i>a-1?a-1:o+i,c=void 0;for(arguments.length<=2?(c=e[o],o++):c=r;o<=s;)c=t(c,e[o],o),o++;return c}}return r}e.getIterator=function(t){if(t){if(k(t))return p(t);if(t instanceof e.Map)return t.entries();if(t instanceof e.Set)return t.values();throw new Error("Iteration not supported.")}},e.emptyArray=[],e.emptyMap=new e.Map,e.emptySet=new e.Set,e.length=function(e){return e?e.length:0},e.forEach=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(n)return n}},e.forEachRight=function(e,t){if(e)for(var r=e.length-1;r>=0;r--){var n=t(e[r],r);if(n)return n}},e.firstDefined=function(e,t){if(void 0!==e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(void 0!==n)return n}},e.firstDefinedIterator=function(e,t){for(;;){var r=e.next();if(r.done)return;var n=t(r.value);if(void 0!==n)return n}},e.reduceLeftIterator=function(e,t,r){var n=r;if(e)for(var i=e.next(),a=0;!i.done;i=e.next(),a++)n=t(n,i.value,a);return n},e.zipWith=function(t,r,n){var i=[];e.Debug.assertEqual(t.length,r.length);for(var a=0;a<t.length;a++)i.push(n(t[a],r[a],a));return i},e.zipToIterator=function(t,r){e.Debug.assertEqual(t.length,r.length);var n=0;return {next:function(){return n===t.length?{value:void 0,done:!0}:(n++,{value:[t[n-1],r[n-1]],done:!1})}}},e.zipToMap=function(t,r){e.Debug.assert(t.length===r.length);for(var n=new e.Map,i=0;i<t.length;++i)n.set(t[i],r[i]);return n},e.intersperse=function(e,t){if(e.length<=1)return e;for(var r=[],n=0,i=e.length;n<i;n++)n&&r.push(t),r.push(e[n]);return r},e.every=function(e,t){if(e)for(var r=0;r<e.length;r++)if(!t(e[r],r))return !1;return !0},e.find=function(e,t,r){if(void 0!==e)for(var n=null!=r?r:0;n<e.length;n++){var i=e[n];if(t(i,n))return i}},e.findLast=function(e,t,r){if(void 0!==e)for(var n=null!=r?r:e.length-1;n>=0;n--){var i=e[n];if(t(i,n))return i}},e.findIndex=function(e,t,r){if(void 0===e)return -1;for(var n=null!=r?r:0;n<e.length;n++)if(t(e[n],n))return n;return -1},e.findLastIndex=function(e,t,r){if(void 0===e)return -1;for(var n=null!=r?r:e.length-1;n>=0;n--)if(t(e[n],n))return n;return -1},e.findMap=function(t,r){for(var n=0;n<t.length;n++){var i=r(t[n],n);if(i)return i}return e.Debug.fail()},e.contains=t,e.arraysEqual=function(e,t,r){return void 0===r&&(r=O),e.length===t.length&&e.every((function(e,n){return r(e,t[n])}))},e.indexOfAnyCharCode=function(e,r,n){for(var i=n||0;i<e.length;i++)if(t(r,e.charCodeAt(i)))return i;return -1},e.countWhere=function(e,t){var r=0;if(e)for(var n=0;n<e.length;n++)t(e[n],n)&&r++;return r},e.filter=function(e,t){if(e){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;if(n<r){var i=e.slice(0,n);for(n++;n<r;){var a=e[n];t(a)&&i.push(a),n++;}return i}}return e},e.filterMutate=function(e,t){for(var r=0,n=0;n<e.length;n++)t(e[n],n,e)&&(e[r]=e[n],r++);e.length=r;},e.clear=function(e){e.length=0;},e.map=function(e,t){var r;if(e){r=[];for(var n=0;n<e.length;n++)r.push(t(e[n],n));}return r},e.mapIterator=function(e,t){return {next:function(){var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}},e.sameMap=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=e[r],i=t(n,r);if(n!==i){var a=e.slice(0,r);for(a.push(i),r++;r<e.length;r++)a.push(t(e[r],r));return a}}return e},e.flatten=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];i&&(k(i)?l(t,i):t.push(i));}return t},e.flatMap=function(t,r){var n;if(t)for(var i=0;i<t.length;i++){var a=r(t[i],i);a&&(n=k(a)?l(n,a):s(n,a));}return n||e.emptyArray},e.flatMapToMutable=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);i&&(k(i)?l(r,i):r.push(i));}return r},e.flatMapIterator=function(t,r){var n=t.next();if(n.done)return e.emptyIterator;var i=a(n.value);return {next:function(){for(;;){var e=i.next();if(!e.done)return e;var r=t.next();if(r.done)return r;i=a(r.value);}}};function a(t){var n=r(t);return void 0===n?e.emptyIterator:k(n)?p(n):n}},e.sameFlatMap=function(e,t){var r;if(e)for(var n=0;n<e.length;n++){var i=e[n],a=t(i,n);(r||i!==a||k(a))&&(r||(r=e.slice(0,n)),k(a)?l(r,a):r.push(a));}return r||e},e.mapAllOrFail=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=t(e[n],n);if(void 0===i)return;r.push(i);}return r},e.mapDefined=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);void 0!==i&&r.push(i);}return r},e.mapDefinedIterator=function(e,t){return {next:function(){for(;;){var r=e.next();if(r.done)return r;var n=t(r.value);if(void 0!==n)return {value:n,done:!1}}}}},e.mapDefinedEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e);if(void 0!==i){var a=i[0],o=i[1];void 0!==a&&void 0!==o&&n.set(a,o);}})),n}},e.mapDefinedValues=function(t,r){if(t){var n=new e.Set;return t.forEach((function(e){var t=r(e);void 0!==t&&n.add(t);})),n}},e.getOrUpdate=function(e,t,r){if(e.has(t))return e.get(t);var n=r();return e.set(t,n),n},e.tryAddToSet=function(e,t){return !e.has(t)&&(e.add(t),!0)},e.emptyIterator={next:function(){return {value:void 0,done:!0}}},e.singleIterator=function(e){var t=!1;return {next:function(){var r=t;return t=!0,r?{value:void 0,done:!0}:{value:e,done:!1}}}},e.spanMap=function(e,t,r){var n;if(e){n=[];for(var i=e.length,a=void 0,o=void 0,s=0,c=0;s<i;){for(;c<i;){if(o=t(e[c],c),0===c)a=o;else if(o!==a)break;c++;}if(s<c){var l=r(e.slice(s,c),a,s,c);l&&n.push(l),s=c;}a=o,c++;}}return n},e.mapEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e),a=i[0],o=i[1];n.set(a,o);})),n}},e.some=r,e.getRangesWhere=function(e,t,r){for(var n,i=0;i<e.length;i++)t(e[i])?n=void 0===n?i:n:void 0!==n&&(r(n,i),n=void 0);void 0!==n&&r(n,e.length);},e.concatenate=i,e.indicesOf=o,e.deduplicate=function(e,t,r){return 0===e.length?[]:1===e.length?e.slice():r?function(e,t,r){var n=o(e);_(e,n,r);for(var i=e[n[0]],a=[n[0]],s=1;s<n.length;s++){var c=n[s],l=e[c];t(i,l)||(a.push(c),i=l);}return a.sort(),a.map((function(t){return e[t]}))}(e,t,r):function(e,t){for(var r=[],n=0,i=e;n<i.length;n++)u(r,i[n],t);return r}(e,t)},e.createSortedArray=function(){return []},e.insertSorted=function(e,t,r,n){if(0===e.length)return e.push(t),!0;var i=g(e,t,A,r);return i<0?(e.splice(~i,0,t),!0):!!n&&(e.splice(i,0,t),!0)},e.sortAndDeduplicate=function(t,r,n){return function(t,r){if(0===t.length)return e.emptyArray;for(var n=t[0],i=[n],a=1;a<t.length;a++){var o=t[a];switch(r(o,n)){case!0:case 0:continue;case-1:return e.Debug.fail("Array is unsorted.")}i.push(n=o);}return i}(d(t,r),n||r||B)},e.arrayIsSorted=function(e,t){if(e.length<2)return !0;for(var r=e[0],n=0,i=e.slice(1);n<i.length;n++){var a=i[n];if(1===t(r,a))return !1;r=a;}return !0},e.arrayIsEqualTo=function(e,t,r){if(void 0===r&&(r=O),!e||!t)return e===t;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!r(e[n],t[n],n))return !1;return !0},e.compact=function(e){var t;if(e)for(var r=0;r<e.length;r++){var n=e[r];!t&&n||(t||(t=e.slice(0,r)),n&&t.push(n));}return t||e},e.relativeComplement=function(t,r,n){if(!r||!t||0===r.length||0===t.length)return r;var i=[];e:for(var a=0,o=0;o<r.length;o++){o>0&&e.Debug.assertGreaterThanOrEqual(n(r[o],r[o-1]),0);t:for(var s=a;a<t.length;a++)switch(a>s&&e.Debug.assertGreaterThanOrEqual(n(t[a],t[a-1]),0),n(r[o],t[a])){case-1:i.push(r[o]);continue e;case 0:continue e;case 1:continue t}}return i},e.sum=function(e,t){for(var r=0,n=0,i=e;n<i.length;n++)r+=i[n][t];return r},e.append=s,e.combine=function(e,t){return void 0===e?t:void 0===t?e:k(e)?k(t)?i(e,t):s(e,t):k(t)?s(t,e):[e,t]},e.addRange=l,e.pushIfUnique=u,e.appendIfUnique=function(e,t,r){return e?(u(e,t,r),e):[t]},e.sort=d,e.arrayIterator=p,e.arrayReverseIterator=function(e){var t=e.length;return {next:function(){return 0===t?{value:void 0,done:!0}:(t--,{value:e[t],done:!1})}}},e.stableSort=function(e,t){var r=o(e);return _(e,r,t),r.map((function(t){return e[t]}))},e.rangeEquals=function(e,t,r,n){for(;r<n;){if(e[r]!==t[r])return !1;r++;}return !0},e.elementAt=function(e,t){if(e&&(t=c(e,t))<e.length)return e[t]},e.firstOrUndefined=function(e){return void 0===e||0===e.length?void 0:e[0]},e.first=function(t){return e.Debug.assert(0!==t.length),t[0]},e.lastOrUndefined=function(e){return void 0===e||0===e.length?void 0:e[e.length-1]},e.last=function(t){return e.Debug.assert(0!==t.length),t[t.length-1]},e.singleOrUndefined=f,e.single=function(t){return e.Debug.checkDefined(f(t))},e.singleOrMany=function(e){return e&&1===e.length?e[0]:e},e.replaceElement=function(e,t,r){var n=e.slice(0);return n[t]=r,n},e.binarySearch=g,e.binarySearchKey=m,e.reduceLeft=y;var v=Object.prototype.hasOwnProperty;function h(e,t){return v.call(e,t)}function b(e){var t=[];for(var r in e)v.call(e,r)&&t.push(r);return t}e.hasProperty=h,e.getProperty=function(e,t){return v.call(e,t)?e[t]:void 0},e.getOwnKeys=b,e.getAllKeys=function(e){var t=[];do{for(var r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++)u(t,n[r]);}while(e=Object.getPrototypeOf(e));return t},e.getOwnValues=function(e){var t=[];for(var r in e)v.call(e,r)&&t.push(e[r]);return t};var x=Object.entries||function(e){for(var t=b(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=[t[n],e[t[n]]];return r};function D(e,t){for(var r=[],n=e.next();!n.done;n=e.next())r.push(t?t(n.value):n.value);return r}function S(e,t,r){void 0===r&&(r=A);for(var n=T(),i=0,a=e;i<a.length;i++){var o=a[i];n.add(t(o),r(o));}return n}function T(){var t=new e.Map;return t.add=C,t.remove=E,t}function C(e,t){var r=this.get(e);return r?r.push(t):this.set(e,r=[t]),r}function E(e,t){var r=this.get(e);r&&(W(r,t),r.length||this.delete(e));}function k(e){return Array.isArray?Array.isArray(e):e instanceof Array}function N(e){}function A(e){return e}function F(e){return e.toLowerCase()}e.getEntries=function(e){return e?x(e):[]},e.arrayOf=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.arrayFrom=D,e.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0,i=t;n<i.length;n++){var a=i[n];if(void 0!==a)for(var o in a)h(a,o)&&(e[o]=a[o]);}return e},e.equalOwnProperties=function(e,t,r){if(void 0===r&&(r=O),e===t)return !0;if(!e||!t)return !1;for(var n in e)if(v.call(e,n)){if(!v.call(t,n))return !1;if(!r(e[n],t[n]))return !1}for(var n in t)if(v.call(t,n)&&!v.call(e,n))return !1;return !0},e.arrayToMap=function(t,r,n){void 0===n&&(n=A);for(var i=new e.Map,a=0,o=t;a<o.length;a++){var s=o[a],c=r(s);void 0!==c&&i.set(c,n(s));}return i},e.arrayToNumericMap=function(e,t,r){void 0===r&&(r=A);for(var n=[],i=0,a=e;i<a.length;i++){var o=a[i];n[t(o)]=r(o);}return n},e.arrayToMultiMap=S,e.group=function(e,t,r){return void 0===r&&(r=A),D(S(e,t).values(),r)},e.clone=function(e){var t={};for(var r in e)v.call(e,r)&&(t[r]=e[r]);return t},e.extend=function(e,t){var r={};for(var n in t)v.call(t,n)&&(r[n]=t[n]);for(var n in e)v.call(e,n)&&(r[n]=e[n]);return r},e.copyProperties=function(e,t){for(var r in t)v.call(t,r)&&(e[r]=t[r]);},e.maybeBind=function(e,t){return t?t.bind(e):void 0},e.createMultiMap=T,e.createUnderscoreEscapedMultiMap=function(){return T()},e.createQueue=function(e){var t=(null==e?void 0:e.slice())||[],r=0;function n(){return r===t.length}return {enqueue:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.push.apply(t,e);},dequeue:function(){if(n())throw new Error("Queue is empty");var e=t[r];if(t[r]=void 0,++r>100&&r>t.length>>1){var i=t.length-r;t.copyWithin(0,r),t.length=i,r=0;}return e},isEmpty:n}},e.createSet=function(r,n){var i=new e.Map,a=0;function o(){var e,t=i.values();return {next:function(){for(;;)if(e){if(!(r=e.next()).done)return {value:r.value};e=void 0;}else {var r;if((r=t.next()).done)return {value:void 0,done:!0};if(!k(r.value))return {value:r.value};e=p(r.value);}}}}return {has:function(e){var t=r(e);if(!i.has(t))return !1;var a=i.get(t);if(!k(a))return n(a,e);for(var o=0,s=a;o<s.length;o++){var c=s[o];if(n(c,e))return !0}return !1},add:function(e){var o=r(e);if(i.has(o)){var s=i.get(o);if(k(s))t(s,e,n)||(s.push(e),a++);else {var c=s;n(c,e)||(i.set(o,[c,e]),a++);}}else i.set(o,e),a++;return this},delete:function(e){var t=r(e);if(!i.has(t))return !1;var o=i.get(t);if(k(o)){for(var s=0;s<o.length;s++)if(n(o[s],e))return 1===o.length?i.delete(t):2===o.length?i.set(t,o[1-s]):q(o,s),a--,!0}else if(n(o,e))return i.delete(t),a--,!0;return !1},clear:function(){i.clear(),a=0;},get size(){return a},forEach:function(e){for(var t=0,r=D(i.values());t<r.length;t++){var n=r[t];if(k(n))for(var a=0,o=n;a<o.length;a++){var s;e(s=o[a],s);}else e(s=n,s);}},keys:function(){return o()},values:function(){return o()},entries:function(){var e=o();return {next:function(){var t=e.next();return t.done?t:{value:[t.value,t.value]}}}}}},e.isArray=k,e.toArray=function(e){return k(e)?e:[e]},e.isString=function(e){return "string"==typeof e},e.isNumber=function(e){return "number"==typeof e},e.tryCast=function(e,t){return void 0!==e&&t(e)?e:void 0},e.cast=function(t,r){return void 0!==t&&r(t)?t:e.Debug.fail("Invalid cast. The supplied value ".concat(t," did not pass the test '").concat(e.Debug.getFunctionName(r),"'."))},e.noop=N,e.noopPush={push:N,length:0},e.returnFalse=function(){return !1},e.returnTrue=function(){return !0},e.returnUndefined=function(){},e.identity=A,e.toLowerCase=F;var P,w=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;function I(e){return w.test(e)?e.replace(w,F):e}function O(e,t){return e===t}function M(e,t){return e===t?0:void 0===e?-1:void 0===t?1:e<t?-1:1}function L(e,t){return M(e,t)}function R(e,t){return e===t?0:void 0===e?-1:void 0===t?1:(e=e.toUpperCase())<(t=t.toUpperCase())?-1:e>t?1:0}function B(e,t){return M(e,t)}e.toFileNameLowerCase=I,e.notImplemented=function(){throw new Error("Not implemented")},e.memoize=function(e){var t;return function(){return e&&(t=e(),e=void 0),t}},e.memoizeOne=function(t){var r=new e.Map;return function(e){var n="".concat(typeof e,":").concat(e),i=r.get(n);return void 0!==i||r.has(n)||(i=t(e),r.set(n,i)),i}},e.compose=function(e,t,r,n,i){if(i){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return function(e){return y(a,(function(e,t){return t(e)}),e)}}return n?function(i){return n(r(t(e(i))))}:r?function(n){return r(t(e(n)))}:t?function(r){return t(e(r))}:e?function(t){return e(t)}:function(e){return e}},(P=e.AssertionLevel||(e.AssertionLevel={}))[P.None=0]="None",P[P.Normal=1]="Normal",P[P.Aggressive=2]="Aggressive",P[P.VeryAggressive=3]="VeryAggressive",e.equateValues=O,e.equateStringsCaseInsensitive=function(e,t){return e===t||void 0!==e&&void 0!==t&&e.toUpperCase()===t.toUpperCase()},e.equateStringsCaseSensitive=function(e,t){return O(e,t)},e.compareValues=L,e.compareTextSpans=function(e,t){return L(null==e?void 0:e.start,null==t?void 0:t.start)||L(null==e?void 0:e.length,null==t?void 0:t.length)},e.min=function(e,t){return y(e,(function(e,r){return -1===t(e,r)?e:r}))},e.compareStringsCaseInsensitive=R,e.compareStringsCaseSensitive=B,e.getStringComparer=function(e){return e?R:B};var j,J,z=function(){var e,t,r="object"==typeof Intl&&"function"==typeof Intl.Collator?i:"function"==typeof String.prototype.localeCompare&&"function"==typeof String.prototype.toLocaleUpperCase&&"a".localeCompare("B")<0?a:o;return function(n){return void 0===n?e||(e=r(n)):"en-US"===n?t||(t=r(n)):r(n)};function n(e,t,r){if(e===t)return 0;if(void 0===e)return -1;if(void 0===t)return 1;var n=r(e,t);return n<0?-1:n>0?1:0}function i(e){var t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant"}).compare;return function(e,r){return n(e,r,t)}}function a(e){return void 0!==e?o():function(e,r){return n(e,r,t)};function t(e,t){return e.localeCompare(t)}}function o(){return function(t,r){return n(t,r,e)};function e(e,r){return t(e.toUpperCase(),r.toUpperCase())||t(e,r)}function t(e,t){return e<t?-1:e>t?1:0}}}();function U(e,t,r){for(var n=new Array(t.length+1),i=new Array(t.length+1),a=r+.01,o=0;o<=t.length;o++)n[o]=o;for(o=1;o<=e.length;o++){var s=e.charCodeAt(o-1),c=Math.ceil(o>r?o-r:1),l=Math.floor(t.length>r+o?r+o:t.length);i[0]=o;for(var u=o,_=1;_<c;_++)i[_]=a;for(_=c;_<=l;_++){var d=e[o-1].toLowerCase()===t[_-1].toLowerCase()?n[_-1]+.1:n[_-1]+2,p=s===t.charCodeAt(_-1)?n[_-1]:Math.min(n[_]+1,i[_-1]+1,d);i[_]=p,u=Math.min(u,p);}for(_=l+1;_<=t.length;_++)i[_]=a;if(u>r)return;var f=n;n=i,i=f;}var g=n[t.length];return g>r?void 0:g}function K(e,t){var r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function V(e,t){for(var r=t;r<e.length-1;r++)e[r]=e[r+1];e.pop();}function q(e,t){e[t]=e[e.length-1],e.pop();}function W(e,t){return function(e,r){for(var n=0;n<e.length;n++)if(e[n]===t)return q(e,n),!0;return !1}(e)}function H(e,t){return 0===e.lastIndexOf(t,0)}function G(e,t){var r=e.prefix,n=e.suffix;return t.length>=r.length+n.length&&H(t,r)&&K(t,n)}function Q(e,t,r,n){for(var i=0,a=e[n];i<a.length;i++){var o=a[i],s=void 0;r?(s=r.slice()).push(o):s=[o],n===e.length-1?t.push(s):Q(e,t,s,n+1);}}e.getUILocale=function(){return J},e.setUILocale=function(e){J!==e&&(J=e,j=void 0);},e.compareStringsCaseSensitiveUI=function(e,t){return (j||(j=z(J)))(e,t)},e.compareProperties=function(e,t,r,n){return e===t?0:void 0===e?-1:void 0===t?1:n(e[r],t[r])},e.compareBooleans=function(e,t){return L(e?1:0,t?1:0)},e.getSpellingSuggestion=function(t,r,n){for(var i,a=Math.max(2,Math.floor(.34*t.length)),o=Math.floor(.4*t.length)+1,s=0,c=r;s<c.length;s++){var l=c[s],u=n(l);if(void 0!==u&&Math.abs(u.length-t.length)<=a){if(u===t)continue;if(u.length<3&&u.toLowerCase()!==t.toLowerCase())continue;var _=U(t,u,o-.1);if(void 0===_)continue;e.Debug.assert(_<o),o=_,i=l;}}return i},e.endsWith=K,e.removeSuffix=function(e,t){return K(e,t)?e.slice(0,e.length-t.length):e},e.tryRemoveSuffix=function(e,t){return K(e,t)?e.slice(0,e.length-t.length):void 0},e.stringContains=function(e,t){return -1!==e.indexOf(t)},e.removeMinAndVersionNumbers=function(e){for(var t=e.length,r=t-1;r>0;r--){var n=e.charCodeAt(r);if(n>=48&&n<=57)do{--r,n=e.charCodeAt(r);}while(r>0&&n>=48&&n<=57);else {if(!(r>4)||110!==n&&78!==n)break;if(--r,105!==(n=e.charCodeAt(r))&&73!==n)break;if(--r,109!==(n=e.charCodeAt(r))&&77!==n)break;--r,n=e.charCodeAt(r);}if(45!==n&&46!==n)break;t=r;}return t===e.length?e:e.slice(0,t)},e.orderedRemoveItem=function(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return V(e,r),!0;return !1},e.orderedRemoveItemAt=V,e.unorderedRemoveItemAt=q,e.unorderedRemoveItem=W,e.createGetCanonicalFileName=function(e){return e?A:I},e.patternText=function(e){var t=e.prefix,r=e.suffix;return "".concat(t,"*").concat(r)},e.matchedText=function(t,r){return e.Debug.assert(G(t,r)),r.substring(t.prefix.length,r.length-t.suffix.length)},e.findBestPatternMatch=function(e,t,r){for(var n,i=-1,a=0,o=e;a<o.length;a++){var s=o[a],c=t(s);G(c,r)&&c.prefix.length>i&&(i=c.prefix.length,n=s);}return n},e.startsWith=H,e.removePrefix=function(e,t){return H(e,t)?e.substr(t.length):e},e.tryRemovePrefix=function(e,t,r){return void 0===r&&(r=A),H(r(e),r(t))?e.substring(t.length):void 0},e.isPatternMatch=G,e.and=function(e,t){return function(r){return e(r)&&t(r)}},e.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var i=0,a=e;i<a.length;i++){var o=a[i];if(t=o.apply(void 0,r))return t}return t}},e.not=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return !e.apply(void 0,t)}},e.assertType=function(e){},e.singleElementArray=function(e){return void 0===e?void 0:[e]},e.enumerateInsertsAndDeletes=function(e,t,r,n,i,a){a=a||N;for(var o=0,s=0,c=e.length,l=t.length,u=!1;o<c&&s<l;){var _=e[o],d=t[s],p=r(_,d);-1===p?(n(_),o++,u=!0):1===p?(i(d),s++,u=!0):(a(d,_),o++,s++);}for(;o<c;)n(e[o++]),u=!0;for(;s<l;)i(t[s++]),u=!0;return u},e.fill=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.cartesianProduct=function(e){var t=[];return Q(e,t,void 0,0),t},e.padLeft=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:r.repeat(t-e.length)+e},e.padRight=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:e+r.repeat(t-e.length)},e.takeWhile=function(e,t){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;return e.slice(0,n)},e.trimString=String.prototype.trim?function(e){return e.trim()}:function(t){return e.trimStringEnd(e.trimStringStart(t))},e.trimStringEnd=String.prototype.trimEnd?function(e){return e.trimEnd()}:function(t){for(var r=t.length-1;r>=0&&e.isWhiteSpaceLike(t.charCodeAt(r));)r--;return t.slice(0,r+1)},e.trimStringStart=String.prototype.trimStart?function(e){return e.trimStart()}:function(e){return e.replace(/^\s+/g,"")};}(t),function(e){var t;!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose";}(t=e.LogLevel||(e.LogLevel={})),function(r){var n,i,a=0;function o(){return null!=n?n:n=new e.Version(e.version)}function s(e){return r.currentLogLevel<=e}function c(e,t){r.loggingHost&&s(e)&&r.loggingHost.log(e,t);}function l(e){c(t.Info,e);}r.currentLogLevel=t.Warning,r.isDebugging=!1,r.enableDeprecationWarnings=!0,r.getTypeScriptVersion=o,r.shouldLog=s,r.log=l,(i=l=r.log||(r.log={})).error=function(e){c(t.Error,e);},i.warn=function(e){c(t.Warning,e);},i.log=function(e){c(t.Info,e);},i.trace=function(e){c(t.Verbose,e);};var u={};function _(e){return a>=e}function d(t,n){return !!_(t)||(u[n]={level:t,assertion:r[n]},r[n]=e.noop,!1)}function p(e,t){var r=new Error(e?"Debug Failure. ".concat(e):"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(r,t||p),r}function f(e,t,r,n){e||(t=t?"False expression: ".concat(t):"False expression.",r&&(t+="\r\nVerbose Debug Information: "+("string"==typeof r?r:r())),p(t,n||f));}function g(e,t,r){null==e&&p(t,r||g);}function m(e,t,r){for(var n=0,i=e;n<i.length;n++)g(i[n],t,r||m);}function y(t,r,n){void 0===r&&(r="Illegal value:");var i="object"==typeof t&&e.hasProperty(t,"kind")&&e.hasProperty(t,"pos")?"SyntaxKind: "+x(t.kind):JSON.stringify(t);return p("".concat(r," ").concat(i),n||y)}function v(t){if("function"!=typeof t)return "";if(e.hasProperty(t,"name"))return t.name;var r=Function.prototype.toString.call(t),n=/^function\s+([\w\$]+)\s*\(/.exec(r);return n?n[1]:""}function h(t,r,n){void 0===t&&(t=0);var i=function(t){var r=b.get(t);if(r)return r;var n=[];for(var i in t){var a=t[i];"number"==typeof a&&n.push([a,i]);}var o=e.stableSort(n,(function(t,r){return e.compareValues(t[0],r[0])}));return b.set(t,o),o}(r);if(0===t)return i.length>0&&0===i[0][0]?i[0][1]:"0";if(n){for(var a=[],o=t,s=0,c=i;s<c.length;s++){var l=c[s],u=l[0],_=l[1];if(u>t)break;0!==u&&u&t&&(a.push(_),o&=~u);}if(0===o)return a.join("|")}else for(var d=0,p=i;d<p.length;d++){var f=p[d];if(u=f[0],_=f[1],u===t)return _}return t.toString()}r.getAssertionLevel=function(){return a},r.setAssertionLevel=function(t){var n=a;if(a=t,t>n)for(var i=0,o=e.getOwnKeys(u);i<o.length;i++){var s=o[i],c=u[s];void 0!==c&&r[s]!==c.assertion&&t>=c.level&&(r[s]=c,u[s]=void 0);}},r.shouldAssert=_,r.fail=p,r.failBadSyntaxKind=function e(t,r,n){return p("".concat(r||"Unexpected node.","\r\nNode ").concat(x(t.kind)," was unexpected."),n||e)},r.assert=f,r.assertEqual=function e(t,r,n,i,a){if(t!==r){var o=n?i?"".concat(n," ").concat(i):n:"";p("Expected ".concat(t," === ").concat(r,". ").concat(o),a||e);}},r.assertLessThan=function e(t,r,n,i){t>=r&&p("Expected ".concat(t," < ").concat(r,". ").concat(n||""),i||e);},r.assertLessThanOrEqual=function e(t,r,n){t>r&&p("Expected ".concat(t," <= ").concat(r),n||e);},r.assertGreaterThanOrEqual=function e(t,r,n){t<r&&p("Expected ".concat(t," >= ").concat(r),n||e);},r.assertIsDefined=g,r.checkDefined=function e(t,r,n){return g(t,r,n||e),t},r.assertEachIsDefined=m,r.checkEachDefined=function e(t,r,n){return m(t,r,n||e),t},r.assertNever=y,r.assertEachNode=function t(r,n,i,a){d(1,"assertEachNode")&&f(void 0===n||e.every(r,n),i||"Unexpected node.",(function(){return "Node array did not pass test '".concat(v(n),"'.")}),a||t);},r.assertNode=function e(t,r,n,i){d(1,"assertNode")&&f(void 0!==t&&(void 0===r||r(t)),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(v(r),"'.")}),i||e);},r.assertNotNode=function e(t,r,n,i){d(1,"assertNotNode")&&f(void 0===t||void 0===r||!r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," should not have passed test '").concat(v(r),"'.")}),i||e);},r.assertOptionalNode=function e(t,r,n,i){d(1,"assertOptionalNode")&&f(void 0===r||void 0===t||r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(v(r),"'.")}),i||e);},r.assertOptionalToken=function e(t,r,n,i){d(1,"assertOptionalToken")&&f(void 0===r||void 0===t||t.kind===r,n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," was not a '").concat(x(r),"' token.")}),i||e);},r.assertMissingNode=function e(t,r,n){d(1,"assertMissingNode")&&f(void 0===t,r||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," was unexpected'.")}),n||e);},r.type=function(e){},r.getFunctionName=v,r.formatSymbol=function(t){return "{ name: ".concat(e.unescapeLeadingUnderscores(t.escapedName),"; flags: ").concat(E(t.flags),"; declarations: ").concat(e.map(t.declarations,(function(e){return x(e.kind)}))," }")},r.formatEnum=h;var b=new e.Map;function x(t){return h(t,e.SyntaxKind,!1)}function D(t){return h(t,e.NodeFlags,!0)}function S(t){return h(t,e.ModifierFlags,!0)}function T(t){return h(t,e.TransformFlags,!0)}function C(t){return h(t,e.EmitFlags,!0)}function E(t){return h(t,e.SymbolFlags,!0)}function k(t){return h(t,e.TypeFlags,!0)}function N(t){return h(t,e.SignatureFlags,!0)}function A(t){return h(t,e.ObjectFlags,!0)}function F(t){return h(t,e.FlowFlags,!0)}r.formatSyntaxKind=x,r.formatSnippetKind=function(t){return h(t,e.SnippetKind,!1)},r.formatNodeFlags=D,r.formatModifierFlags=S,r.formatTransformFlags=T,r.formatEmitFlags=C,r.formatSymbolFlags=E,r.formatTypeFlags=k,r.formatSignatureFlags=N,r.formatObjectFlags=A,r.formatFlowFlags=F,r.formatRelationComparisonResult=function(t){return h(t,e.RelationComparisonResult,!0)},r.formatCheckMode=function(t){return h(t,e.CheckMode,!0)},r.formatSignatureCheckMode=function(t){return h(t,e.SignatureCheckMode,!0)},r.formatTypeFacts=function(t){return h(t,e.TypeFacts,!0)};var P,w,I,O=!1;function M(e){return function(){if(B(),!P)throw new Error("Debugging helpers could not be loaded.");return P}().formatControlFlowGraph(e)}function L(t){"__debugFlowFlags"in t||Object.defineProperties(t,{__tsDebuggerDisplay:{value:function(){var e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return "".concat(e).concat(t?" (".concat(F(t),")"):"")}},__debugFlowFlags:{get:function(){return h(this.flags,e.FlowFlags,!0)}},__debugToString:{value:function(){return M(this)}}});}function R(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:function(e){return e=String(e).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),"NodeArray ".concat(e)}}});}function B(){if(!O){var t,r;Object.defineProperties(e.objectAllocator.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=33554432&this.flags?"TransientSymbol":"Symbol",r=-33554433&this.flags;return "".concat(t," '").concat(e.symbolName(this),"'").concat(r?" (".concat(E(r),")"):"")}},__debugFlags:{get:function(){return E(this.flags)}}}),Object.defineProperties(e.objectAllocator.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=98304&this.flags?"NullableType":384&this.flags?"LiteralType ".concat(JSON.stringify(this.value)):2048&this.flags?"LiteralType ".concat(this.value.negative?"-":"").concat(this.value.base10Value,"n"):8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":67359327&this.flags?"IntrinsicType ".concat(this.intrinsicName):1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",r=524288&this.flags?-1344&this.objectFlags:0;return "".concat(t).concat(this.symbol?" '".concat(e.symbolName(this.symbol),"'"):"").concat(r?" (".concat(A(r),")"):"")}},__debugFlags:{get:function(){return k(this.flags)}},__debugObjectFlags:{get:function(){return 524288&this.flags?A(this.objectFlags):""}},__debugTypeToString:{value:function(){var e=(void 0===t&&"function"==typeof WeakMap&&(t=new WeakMap),t),r=null==e?void 0:e.get(this);return void 0===r&&(r=this.checker.typeToString(this),null==e||e.set(this,r)),r}}}),Object.defineProperties(e.objectAllocator.getSignatureConstructor().prototype,{__debugFlags:{get:function(){return N(this.flags)}},__debugSignatureToString:{value:function(){var e;return null===(e=this.checker)||void 0===e?void 0:e.signatureToString(this)}}});for(var n=0,i=[e.objectAllocator.getNodeConstructor(),e.objectAllocator.getIdentifierConstructor(),e.objectAllocator.getTokenConstructor(),e.objectAllocator.getSourceFileConstructor()];n<i.length;n++){var a=i[n];e.hasProperty(a.prototype,"__debugKind")||Object.defineProperties(a.prototype,{__tsDebuggerDisplay:{value:function(){var t=e.isGeneratedIdentifier(this)?"GeneratedIdentifier":e.isIdentifier(this)?"Identifier '".concat(e.idText(this),"'"):e.isPrivateIdentifier(this)?"PrivateIdentifier '".concat(e.idText(this),"'"):e.isStringLiteral(this)?"StringLiteral ".concat(JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")):e.isNumericLiteral(this)?"NumericLiteral ".concat(this.text):e.isBigIntLiteral(this)?"BigIntLiteral ".concat(this.text,"n"):e.isTypeParameterDeclaration(this)?"TypeParameterDeclaration":e.isParameter(this)?"ParameterDeclaration":e.isConstructorDeclaration(this)?"ConstructorDeclaration":e.isGetAccessorDeclaration(this)?"GetAccessorDeclaration":e.isSetAccessorDeclaration(this)?"SetAccessorDeclaration":e.isCallSignatureDeclaration(this)?"CallSignatureDeclaration":e.isConstructSignatureDeclaration(this)?"ConstructSignatureDeclaration":e.isIndexSignatureDeclaration(this)?"IndexSignatureDeclaration":e.isTypePredicateNode(this)?"TypePredicateNode":e.isTypeReferenceNode(this)?"TypeReferenceNode":e.isFunctionTypeNode(this)?"FunctionTypeNode":e.isConstructorTypeNode(this)?"ConstructorTypeNode":e.isTypeQueryNode(this)?"TypeQueryNode":e.isTypeLiteralNode(this)?"TypeLiteralNode":e.isArrayTypeNode(this)?"ArrayTypeNode":e.isTupleTypeNode(this)?"TupleTypeNode":e.isOptionalTypeNode(this)?"OptionalTypeNode":e.isRestTypeNode(this)?"RestTypeNode":e.isUnionTypeNode(this)?"UnionTypeNode":e.isIntersectionTypeNode(this)?"IntersectionTypeNode":e.isConditionalTypeNode(this)?"ConditionalTypeNode":e.isInferTypeNode(this)?"InferTypeNode":e.isParenthesizedTypeNode(this)?"ParenthesizedTypeNode":e.isThisTypeNode(this)?"ThisTypeNode":e.isTypeOperatorNode(this)?"TypeOperatorNode":e.isIndexedAccessTypeNode(this)?"IndexedAccessTypeNode":e.isMappedTypeNode(this)?"MappedTypeNode":e.isLiteralTypeNode(this)?"LiteralTypeNode":e.isNamedTupleMember(this)?"NamedTupleMember":e.isImportTypeNode(this)?"ImportTypeNode":x(this.kind);return "".concat(t).concat(this.flags?" (".concat(D(this.flags),")"):"")}},__debugKind:{get:function(){return x(this.kind)}},__debugNodeFlags:{get:function(){return D(this.flags)}},__debugModifierFlags:{get:function(){return S(e.getEffectiveModifierFlagsNoCache(this))}},__debugTransformFlags:{get:function(){return T(this.transformFlags)}},__debugIsParseTreeNode:{get:function(){return e.isParseTreeNode(this)}},__debugEmitFlags:{get:function(){return C(e.getEmitFlags(this))}},__debugGetText:{value:function(t){if(e.nodeIsSynthesized(this))return "";var n=(void 0===r&&"function"==typeof WeakMap&&(r=new WeakMap),r),i=null==n?void 0:n.get(this);if(void 0===i){var a=e.getParseTreeNode(this),o=a&&e.getSourceFileOfNode(a);i=o?e.getSourceTextOfNodeFromSourceFile(o,a,t):"",null==n||n.set(this,i);}return i}}});}try{if(e.sys&&e.sys.require){var o=e.getDirectoryPath(e.resolvePath(e.sys.getExecutingFilePath())),s=e.sys.require(o,"./compiler-debug");s.error||(s.module.init(e),P=s.module);}}catch(e){}O=!0;}}function j(t,r,n,i,a){var o=r?"DeprecationError: ":"DeprecationWarning: ";return o+="'".concat(t,"' "),o+=i?"has been deprecated since v".concat(i):"is deprecated",(o+=r?" and can no longer be used.":n?" and will no longer be usable after v".concat(n,"."):".")+(a?" ".concat(e.formatStringFromArgs(a,[t],0)):"")}function J(t,n){var i,a;void 0===n&&(n={});var s="string"==typeof n.typeScriptVersion?new e.Version(n.typeScriptVersion):null!==(i=n.typeScriptVersion)&&void 0!==i?i:o(),c="string"==typeof n.errorAfter?new e.Version(n.errorAfter):n.errorAfter,u="string"==typeof n.warnAfter?new e.Version(n.warnAfter):n.warnAfter,_="string"==typeof n.since?new e.Version(n.since):null!==(a=n.since)&&void 0!==a?a:u,d=n.error||c&&s.compareTo(c)<=0,p=!u||s.compareTo(u)>=0;return d?function(e,t,r,n){var i=j(e,!0,t,r,n);return function(){throw new TypeError(i)}}(t,c,_,n.message):p?function(e,t,n,i){var a=!1;return function(){r.enableDeprecationWarnings&&!a&&(l.warn(j(e,!1,t,n,i)),a=!0);}}(t,c,_,n.message):e.noop}r.printControlFlowGraph=function(e){return console.log(M(e))},r.formatControlFlowGraph=M,r.attachFlowNodeDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(w||L(w=Object.create(Object.prototype)),Object.setPrototypeOf(e,w)):L(e));},r.attachNodeArrayDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(I||R(I=Object.create(Array.prototype)),Object.setPrototypeOf(e,I)):R(e));},r.enableDebugInfo=B,r.createDeprecation=J,r.deprecate=function(e,t){var r;return function(e,t){return function(){return e(),t.apply(this,arguments)}}(J(null!==(r=null==t?void 0:t.name)&&void 0!==r?r:v(e),t),e)},r.formatVariance=function(e){var t=7&e,r=0===t?"in out":3===t?"[bivariant]":2===t?"in":1===t?"out":4===t?"[independent]":"";return 8&e?r+=" (unmeasurable)":16&e&&(r+=" (unreliable)"),r};var z=function(){function t(){}return t.prototype.__debugToString=function(){var t;switch(this.kind){case 3:return (null===(t=this.debugInfo)||void 0===t?void 0:t.call(this))||"(function mapper)";case 0:return "".concat(this.source.__debugTypeToString()," -> ").concat(this.target.__debugTypeToString());case 1:return e.zipWith(this.sources,this.targets||e.map(this.sources,(function(){return "any"})),(function(e,t){return "".concat(e.__debugTypeToString()," -> ").concat("string"==typeof t?t:t.__debugTypeToString())})).join(", ");case 2:return e.zipWith(this.sources,this.targets,(function(e,t){return "".concat(e.__debugTypeToString()," -> ").concat(t().__debugTypeToString())})).join(", ");case 5:case 4:return "m1: ".concat(this.mapper1.__debugToString().split("\n").join("\n  "),"\nm2: ").concat(this.mapper2.__debugToString().split("\n").join("\n  "));default:return y(this)}},t}();r.DebugTypeMapper=z,r.attachDebugPrototypeIfDebug=function(e){return r.isDebugging?Object.setPrototypeOf(e,z.prototype):e};}(e.Debug||(e.Debug={}));}(t),function(e){var t=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,r=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,n=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i,i=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,a=/^[a-z0-9-]+$/i,o=/^(0|[1-9]\d*)$/,s=function(){function t(t,r,i,o,s){if(void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=""),void 0===s&&(s=""),"string"==typeof t){var l=e.Debug.checkDefined(c(t),"Invalid version");t=l.major,r=l.minor,i=l.patch,o=l.prerelease,s=l.build;}e.Debug.assert(t>=0,"Invalid argument: major"),e.Debug.assert(r>=0,"Invalid argument: minor"),e.Debug.assert(i>=0,"Invalid argument: patch");var u=o?e.isArray(o)?o:o.split("."):e.emptyArray,_=s?e.isArray(s)?s:s.split("."):e.emptyArray;e.Debug.assert(e.every(u,(function(e){return n.test(e)})),"Invalid argument: prerelease"),e.Debug.assert(e.every(_,(function(e){return a.test(e)})),"Invalid argument: build"),this.major=t,this.minor=r,this.patch=i,this.prerelease=u,this.build=_;}return t.tryParse=function(e){var r=c(e);if(r)return new t(r.major,r.minor,r.patch,r.prerelease,r.build)},t.prototype.compareTo=function(t){return this===t?0:void 0===t?1:e.compareValues(this.major,t.major)||e.compareValues(this.minor,t.minor)||e.compareValues(this.patch,t.patch)||function(t,r){if(t===r)return 0;if(0===t.length)return 0===r.length?0:1;if(0===r.length)return -1;for(var n=Math.min(t.length,r.length),i=0;i<n;i++){var a=t[i],s=r[i];if(a!==s){var c=o.test(a),l=o.test(s);if(c||l){if(c!==l)return c?-1:1;if(u=e.compareValues(+a,+s))return u}else {var u;if(u=e.compareStringsCaseSensitive(a,s))return u}}}return e.compareValues(t.length,r.length)}(this.prerelease,t.prerelease)},t.prototype.increment=function(r){switch(r){case"major":return new t(this.major+1,0,0);case"minor":return new t(this.major,this.minor+1,0);case"patch":return new t(this.major,this.minor,this.patch+1);default:return e.Debug.assertNever(r)}},t.prototype.with=function(e){var r=e.major,n=void 0===r?this.major:r,i=e.minor,a=void 0===i?this.minor:i,o=e.patch,s=void 0===o?this.patch:o,c=e.prerelease,l=void 0===c?this.prerelease:c,u=e.build;return new t(n,a,s,l,void 0===u?this.build:u)},t.prototype.toString=function(){var t="".concat(this.major,".").concat(this.minor,".").concat(this.patch);return e.some(this.prerelease)&&(t+="-".concat(this.prerelease.join("."))),e.some(this.build)&&(t+="+".concat(this.build.join("."))),t},t.zero=new t(0,0,0,["0"]),t}();function c(e){var n=t.exec(e);if(n){var a=n[1],o=n[2],s=void 0===o?"0":o,c=n[3],l=void 0===c?"0":c,u=n[4],_=void 0===u?"":u,d=n[5],p=void 0===d?"":d;if((!_||r.test(_))&&(!p||i.test(p)))return {major:parseInt(a,10),minor:parseInt(s,10),patch:parseInt(l,10),prerelease:_,build:p}}}e.Version=s;var l=function(){function t(t){this._alternatives=t?e.Debug.checkDefined(g(t),"Invalid range spec."):e.emptyArray;}return t.tryParse=function(e){var r=g(e);if(r){var n=new t("");return n._alternatives=r,n}},t.prototype.test=function(e){return "string"==typeof e&&(e=new s(e)),function(e,t){if(0===t.length)return !0;for(var r=0,n=t;r<n.length;r++)if(x(e,n[r]))return !0;return !1}(e,this._alternatives)},t.prototype.toString=function(){return t=this._alternatives,e.map(t,S).join(" || ")||"*";var t;},t}();e.VersionRange=l;var u=/\|\|/g,_=/\s+/g,d=/^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,p=/^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i,f=/^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;function g(t){for(var r=[],n=0,i=e.trimString(t).split(u);n<i.length;n++){var a=i[n];if(a){var o=[];a=e.trimString(a);var s=p.exec(a);if(s){if(!y(s[1],s[2],o))return}else for(var c=0,l=a.split(_);c<l.length;c++){var d=l[c],g=f.exec(e.trimString(d));if(!g||!v(g[1],g[2],o))return}r.push(o);}}return r}function m(e){var t=d.exec(e);if(t){var r=t[1],n=t[2],i=void 0===n?"*":n,a=t[3],o=void 0===a?"*":a,c=t[4],l=t[5];return {version:new s(h(r)?0:parseInt(r,10),h(r)||h(i)?0:parseInt(i,10),h(r)||h(i)||h(o)?0:parseInt(o,10),c,l),major:r,minor:i,patch:o}}}function y(e,t,r){var n=m(e);if(!n)return !1;var i=m(t);return !!i&&(h(n.major)||r.push(b(">=",n.version)),h(i.major)||r.push(h(i.minor)?b("<",i.version.increment("major")):h(i.patch)?b("<",i.version.increment("minor")):b("<=",i.version)),!0)}function v(e,t,r){var n=m(t);if(!n)return !1;var i=n.version,a=n.major,o=n.minor,c=n.patch;if(h(a))"<"!==e&&">"!==e||r.push(b("<",s.zero));else switch(e){case"~":r.push(b(">=",i)),r.push(b("<",i.increment(h(o)?"major":"minor")));break;case"^":r.push(b(">=",i)),r.push(b("<",i.increment(i.major>0||h(o)?"major":i.minor>0||h(c)?"minor":"patch")));break;case"<":case">=":r.push(h(o)||h(c)?b(e,i.with({prerelease:"0"})):b(e,i));break;case"<=":case">":r.push(h(o)?b("<="===e?"<":">=",i.increment("major").with({prerelease:"0"})):h(c)?b("<="===e?"<":">=",i.increment("minor").with({prerelease:"0"})):b(e,i));break;case"=":case void 0:h(o)||h(c)?(r.push(b(">=",i.with({prerelease:"0"}))),r.push(b("<",i.increment(h(o)?"major":"minor").with({prerelease:"0"})))):r.push(b("=",i));break;default:return !1}return !0}function h(e){return "*"===e||"x"===e||"X"===e}function b(e,t){return {operator:e,operand:t}}function x(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!D(e,i.operator,i.operand))return !1}return !0}function D(t,r,n){var i=t.compareTo(n);switch(r){case"<":return i<0;case"<=":return i<=0;case">":return i>0;case">=":return i>=0;case"=":return 0===i;default:return e.Debug.assertNever(r)}}function S(t){return e.map(t,T).join(" ")}function T(e){return "".concat(e.operator).concat(e.operand)}}(t),function(e){function t(e,t){return "object"==typeof e&&"number"==typeof e.timeOrigin&&"function"==typeof e.mark&&"function"==typeof e.measure&&"function"==typeof e.now&&"function"==typeof e.clearMarks&&"function"==typeof e.clearMeasures&&"function"==typeof t}var r=function(){if("object"==typeof performance&&"function"==typeof PerformanceObserver&&t(performance,PerformanceObserver))return {shouldWriteNativeEvents:!0,performance,PerformanceObserver}}()||function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser&&"object"==typeof module&&"function"==typeof require)try{var r,n=require("perf_hooks"),i=n.performance,a=n.PerformanceObserver;if(t(i,a)){r=i;var o=new e.Version(process.versions.node);return new e.VersionRange("<12.16.3 || 13 <13.13").test(o)&&(r={get timeOrigin(){return i.timeOrigin},now:function(){return i.now()},mark:function(e){return i.mark(e)},measure:function(e,t,r){void 0===t&&(t="nodeStart"),void 0===r&&(r="__performance.measure-fix__",i.mark(r)),i.measure(e,t,r),"__performance.measure-fix__"===r&&i.clearMarks("__performance.measure-fix__");},clearMarks:function(e){return i.clearMarks(e)},clearMeasures:function(e){return i.clearMeasures(e)}}),{shouldWriteNativeEvents:!1,performance:r,PerformanceObserver:a}}}catch(e){}}(),n=null==r?void 0:r.performance;e.tryGetNativePerformanceHooks=function(){return r},e.timestamp=n?function(){return n.now()}:Date.now?Date.now:function(){return +new Date};}(t),function(e){!function(t){var r,n;function i(t,r,n){var i=0;return {enter:function(){1==++i&&u(r);},exit:function(){0==--i?(u(n),_(t,r,n)):i<0&&e.Debug.fail("enter/exit count does not match.");}}}t.createTimerIf=function(e,r,n,a){return e?i(r,n,a):t.nullTimer},t.createTimer=i,t.nullTimer={enter:e.noop,exit:e.noop};var a=!1,o=e.timestamp(),s=new e.Map,c=new e.Map,l=new e.Map;function u(t){var r;if(a){var i=null!==(r=c.get(t))&&void 0!==r?r:0;c.set(t,i+1),s.set(t,e.timestamp()),null==n||n.mark(t);}}function _(t,r,i){var c,u;if(a){var _=null!==(c=void 0!==i?s.get(i):void 0)&&void 0!==c?c:e.timestamp(),d=null!==(u=void 0!==r?s.get(r):void 0)&&void 0!==u?u:o,p=l.get(t)||0;l.set(t,p+(_-d)),null==n||n.measure(t,r,i);}}t.mark=u,t.measure=_,t.getCount=function(e){return c.get(e)||0},t.getDuration=function(e){return l.get(e)||0},t.forEachMeasure=function(e){l.forEach((function(t,r){return e(r,t)}));},t.forEachMark=function(e){s.forEach((function(t,r){return e(r)}));},t.clearMeasures=function(e){void 0!==e?l.delete(e):l.clear(),null==n||n.clearMeasures(e);},t.clearMarks=function(e){void 0!==e?(c.delete(e),s.delete(e)):(c.clear(),s.clear()),null==n||n.clearMarks(e);},t.isEnabled=function(){return a},t.enable=function(t){var i;return void 0===t&&(t=e.sys),a||(a=!0,r||(r=e.tryGetNativePerformanceHooks()),r&&(o=r.performance.timeOrigin,(r.shouldWriteNativeEvents||(null===(i=null==t?void 0:t.cpuProfilingEnabled)||void 0===i?void 0:i.call(t))||(null==t?void 0:t.debugMode))&&(n=r.performance))),!0},t.disable=function(){a&&(s.clear(),c.clear(),l.clear(),n=void 0,a=!1);};}(e.performance||(e.performance={}));}(t),function(e){var t,r,n={logEvent:e.noop,logErrEvent:e.noop,logPerfEvent:e.noop,logInfoEvent:e.noop,logStartCommand:e.noop,logStopCommand:e.noop,logStartUpdateProgram:e.noop,logStopUpdateProgram:e.noop,logStartUpdateGraph:e.noop,logStopUpdateGraph:e.noop,logStartResolveModule:e.noop,logStopResolveModule:e.noop,logStartParseSourceFile:e.noop,logStopParseSourceFile:e.noop,logStartReadFile:e.noop,logStopReadFile:e.noop,logStartBindFile:e.noop,logStopBindFile:e.noop,logStartScheduledOperation:e.noop,logStopScheduledOperation:e.noop};try{var i=null!==(t=process.env.TS_ETW_MODULE_PATH)&&void 0!==t?t:"./node_modules/@microsoft/typescript-etw";r=require(i);}catch(e){r=void 0;}e.perfLogger=r&&r.logEvent?r:n;}(t),function(e){var t;!function(t){var r,n,a,o,s=0,c=0,l=[],u=[];t.startTracing=function(o,_,d){if(e.Debug.assert(!e.tracing,"Tracing already started"),void 0===r)try{r=require("fs");}catch(e){throw new Error("tracing requires having fs\n(original error: ".concat(e.message||e,")"))}n=o,l.length=0,void 0===a&&(a=e.combinePaths(_,"legend.json")),r.existsSync(_)||r.mkdirSync(_,{recursive:!0});var p="build"===n?".".concat(process.pid,"-").concat(++s):"server"===n?".".concat(process.pid):"",f=e.combinePaths(_,"trace".concat(p,".json")),g=e.combinePaths(_,"types".concat(p,".json"));u.push({configFilePath:d,tracePath:f,typesPath:g}),c=r.openSync(f,"w"),e.tracing=t;var m={cat:"__metadata",ph:"M",ts:1e3*e.timestamp(),pid:1,tid:1};r.writeSync(c,"[\n"+[i$1({name:"process_name",args:{name:"tsc"}},m),i$1({name:"thread_name",args:{name:"Main"}},m),i$1(i$1({name:"TracingStartedInBrowser"},m),{cat:"disabled-by-default-devtools.timeline"})].map((function(e){return JSON.stringify(e)})).join(",\n"));},t.stopTracing=function(){e.Debug.assert(e.tracing,"Tracing is not in progress"),e.Debug.assert(!!l.length==("server"!==n)),r.writeSync(c,"\n]\n"),r.closeSync(c),e.tracing=void 0,l.length?function(t){var n,a,o,s,c,l,_,d,p,g,m,y,v,h,b,x,D,S,T,C,E,k;e.performance.mark("beginDumpTypes");var N=u[u.length-1].typesPath,A=r.openSync(N,"w"),F=new e.Map;r.writeSync(A,"[");for(var P=t.length,w=0;w<P;w++){var I=t[w],O=I.objectFlags,M=null!==(n=I.aliasSymbol)&&void 0!==n?n:I.symbol,L=void 0;if(16&O|2944&I.flags)try{L=null===(a=I.checker)||void 0===a?void 0:a.typeToString(I);}catch(e){L=void 0;}var R={};if(8388608&I.flags){var B=I;R={indexedAccessObjectType:null===(o=B.objectType)||void 0===o?void 0:o.id,indexedAccessIndexType:null===(s=B.indexType)||void 0===s?void 0:s.id};}var j={};if(4&O){var J=I;j={instantiatedType:null===(c=J.target)||void 0===c?void 0:c.id,typeArguments:null===(l=J.resolvedTypeArguments)||void 0===l?void 0:l.map((function(e){return e.id})),referenceLocation:f(J.node)};}var z={};if(16777216&I.flags){var U=I;z={conditionalCheckType:null===(_=U.checkType)||void 0===_?void 0:_.id,conditionalExtendsType:null===(d=U.extendsType)||void 0===d?void 0:d.id,conditionalTrueType:null!==(g=null===(p=U.resolvedTrueType)||void 0===p?void 0:p.id)&&void 0!==g?g:-1,conditionalFalseType:null!==(y=null===(m=U.resolvedFalseType)||void 0===m?void 0:m.id)&&void 0!==y?y:-1};}var K={};if(33554432&I.flags){var V=I;K={substitutionBaseType:null===(v=V.baseType)||void 0===v?void 0:v.id,constraintType:null===(h=V.constraint)||void 0===h?void 0:h.id};}var q={};if(1024&O){var W=I;q={reverseMappedSourceType:null===(b=W.source)||void 0===b?void 0:b.id,reverseMappedMappedType:null===(x=W.mappedType)||void 0===x?void 0:x.id,reverseMappedConstraintType:null===(D=W.constraintType)||void 0===D?void 0:D.id};}var H={};if(256&O){var G=I;H={evolvingArrayElementType:G.elementType.id,evolvingArrayFinalType:null===(S=G.finalArrayType)||void 0===S?void 0:S.id};}var Q=void 0,X=I.checker.getRecursionIdentity(I);X&&((Q=F.get(X))||(Q=F.size,F.set(X,Q)));var Y=i$1(i$1(i$1(i$1(i$1(i$1(i$1({id:I.id,intrinsicName:I.intrinsicName,symbolName:(null==M?void 0:M.escapedName)&&e.unescapeLeadingUnderscores(M.escapedName),recursionId:Q,isTuple:!!(8&O)||void 0,unionTypes:1048576&I.flags?null===(T=I.types)||void 0===T?void 0:T.map((function(e){return e.id})):void 0,intersectionTypes:2097152&I.flags?I.types.map((function(e){return e.id})):void 0,aliasTypeArguments:null===(C=I.aliasTypeArguments)||void 0===C?void 0:C.map((function(e){return e.id})),keyofType:4194304&I.flags?null===(E=I.type)||void 0===E?void 0:E.id:void 0},R),j),z),K),q),H),{destructuringPattern:f(I.pattern),firstDeclaration:f(null===(k=null==M?void 0:M.declarations)||void 0===k?void 0:k[0]),flags:e.Debug.formatTypeFlags(I.flags).split("|"),display:L});r.writeSync(A,JSON.stringify(Y)),w<P-1&&r.writeSync(A,",\n");}r.writeSync(A,"]\n"),r.closeSync(A),e.performance.mark("endDumpTypes"),e.performance.measure("Dump types","beginDumpTypes","endDumpTypes");}(l):u[u.length-1].typesPath=void 0;},t.recordType=function(e){"server"!==n&&l.push(e);},(o=t.Phase||(t.Phase={})).Parse="parse",o.Program="program",o.Bind="bind",o.Check="check",o.CheckTypes="checkTypes",o.Emit="emit",o.Session="session",t.instant=function(e,t,r){p("I",e,t,r,'"s":"g"');};var _=[];function d(t,r,n){var a=_[t],o=a.phase,s=a.name,c=a.args,l=a.time;a.separateBeginAndEnd?(e.Debug.assert(!n,"`results` are not supported for events with `separateBeginAndEnd`"),p("E",o,s,c,void 0,r)):1e4-l%1e4<=r-l&&p("X",o,s,i$1(i$1({},c),{results:n}),'"dur":'.concat(r-l),l);}function p(t,i,a,o,s,l){void 0===l&&(l=1e3*e.timestamp()),"server"===n&&"checkTypes"===i||(e.performance.mark("beginTracing"),r.writeSync(c,',\n{"pid":1,"tid":1,"ph":"'.concat(t,'","cat":"').concat(i,'","ts":').concat(l,',"name":"').concat(a,'"')),s&&r.writeSync(c,",".concat(s)),o&&r.writeSync(c,',"args":'.concat(JSON.stringify(o))),r.writeSync(c,"}"),e.performance.mark("endTracing"),e.performance.measure("Tracing","beginTracing","endTracing"));}function f(t){var r=e.getSourceFileOfNode(t);return r?{path:r.path,start:n(e.getLineAndCharacterOfPosition(r,t.pos)),end:n(e.getLineAndCharacterOfPosition(r,t.end))}:void 0;function n(e){return {line:e.line+1,character:e.character+1}}}t.push=function(t,r,n,i){void 0===i&&(i=!1),i&&p("B",t,r,n),_.push({phase:t,name:r,args:n,time:1e3*e.timestamp(),separateBeginAndEnd:i});},t.pop=function(t){e.Debug.assert(_.length>0),d(_.length-1,1e3*e.timestamp(),t),_.length--;},t.popAll=function(){for(var t=1e3*e.timestamp(),r=_.length-1;r>=0;r--)d(r,t);_.length=0;},t.dumpLegend=function(){a&&r.writeFileSync(a,JSON.stringify(u));};}(t||(t={})),e.startTracing=t.startTracing,e.dumpTracingLegend=t.dumpLegend;}(t),function(e){var t,r,n,i,a,o,s,c,l;(l=e.SyntaxKind||(e.SyntaxKind={}))[l.Unknown=0]="Unknown",l[l.EndOfFileToken=1]="EndOfFileToken",l[l.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",l[l.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",l[l.NewLineTrivia=4]="NewLineTrivia",l[l.WhitespaceTrivia=5]="WhitespaceTrivia",l[l.ShebangTrivia=6]="ShebangTrivia",l[l.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",l[l.NumericLiteral=8]="NumericLiteral",l[l.BigIntLiteral=9]="BigIntLiteral",l[l.StringLiteral=10]="StringLiteral",l[l.JsxText=11]="JsxText",l[l.JsxTextAllWhiteSpaces=12]="JsxTextAllWhiteSpaces",l[l.RegularExpressionLiteral=13]="RegularExpressionLiteral",l[l.NoSubstitutionTemplateLiteral=14]="NoSubstitutionTemplateLiteral",l[l.TemplateHead=15]="TemplateHead",l[l.TemplateMiddle=16]="TemplateMiddle",l[l.TemplateTail=17]="TemplateTail",l[l.OpenBraceToken=18]="OpenBraceToken",l[l.CloseBraceToken=19]="CloseBraceToken",l[l.OpenParenToken=20]="OpenParenToken",l[l.CloseParenToken=21]="CloseParenToken",l[l.OpenBracketToken=22]="OpenBracketToken",l[l.CloseBracketToken=23]="CloseBracketToken",l[l.DotToken=24]="DotToken",l[l.DotDotDotToken=25]="DotDotDotToken",l[l.SemicolonToken=26]="SemicolonToken",l[l.CommaToken=27]="CommaToken",l[l.QuestionDotToken=28]="QuestionDotToken",l[l.LessThanToken=29]="LessThanToken",l[l.LessThanSlashToken=30]="LessThanSlashToken",l[l.GreaterThanToken=31]="GreaterThanToken",l[l.LessThanEqualsToken=32]="LessThanEqualsToken",l[l.GreaterThanEqualsToken=33]="GreaterThanEqualsToken",l[l.EqualsEqualsToken=34]="EqualsEqualsToken",l[l.ExclamationEqualsToken=35]="ExclamationEqualsToken",l[l.EqualsEqualsEqualsToken=36]="EqualsEqualsEqualsToken",l[l.ExclamationEqualsEqualsToken=37]="ExclamationEqualsEqualsToken",l[l.EqualsGreaterThanToken=38]="EqualsGreaterThanToken",l[l.PlusToken=39]="PlusToken",l[l.MinusToken=40]="MinusToken",l[l.AsteriskToken=41]="AsteriskToken",l[l.AsteriskAsteriskToken=42]="AsteriskAsteriskToken",l[l.SlashToken=43]="SlashToken",l[l.PercentToken=44]="PercentToken",l[l.PlusPlusToken=45]="PlusPlusToken",l[l.MinusMinusToken=46]="MinusMinusToken",l[l.LessThanLessThanToken=47]="LessThanLessThanToken",l[l.GreaterThanGreaterThanToken=48]="GreaterThanGreaterThanToken",l[l.GreaterThanGreaterThanGreaterThanToken=49]="GreaterThanGreaterThanGreaterThanToken",l[l.AmpersandToken=50]="AmpersandToken",l[l.BarToken=51]="BarToken",l[l.CaretToken=52]="CaretToken",l[l.ExclamationToken=53]="ExclamationToken",l[l.TildeToken=54]="TildeToken",l[l.AmpersandAmpersandToken=55]="AmpersandAmpersandToken",l[l.BarBarToken=56]="BarBarToken",l[l.QuestionToken=57]="QuestionToken",l[l.ColonToken=58]="ColonToken",l[l.AtToken=59]="AtToken",l[l.QuestionQuestionToken=60]="QuestionQuestionToken",l[l.BacktickToken=61]="BacktickToken",l[l.HashToken=62]="HashToken",l[l.EqualsToken=63]="EqualsToken",l[l.PlusEqualsToken=64]="PlusEqualsToken",l[l.MinusEqualsToken=65]="MinusEqualsToken",l[l.AsteriskEqualsToken=66]="AsteriskEqualsToken",l[l.AsteriskAsteriskEqualsToken=67]="AsteriskAsteriskEqualsToken",l[l.SlashEqualsToken=68]="SlashEqualsToken",l[l.PercentEqualsToken=69]="PercentEqualsToken",l[l.LessThanLessThanEqualsToken=70]="LessThanLessThanEqualsToken",l[l.GreaterThanGreaterThanEqualsToken=71]="GreaterThanGreaterThanEqualsToken",l[l.GreaterThanGreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanGreaterThanEqualsToken",l[l.AmpersandEqualsToken=73]="AmpersandEqualsToken",l[l.BarEqualsToken=74]="BarEqualsToken",l[l.BarBarEqualsToken=75]="BarBarEqualsToken",l[l.AmpersandAmpersandEqualsToken=76]="AmpersandAmpersandEqualsToken",l[l.QuestionQuestionEqualsToken=77]="QuestionQuestionEqualsToken",l[l.CaretEqualsToken=78]="CaretEqualsToken",l[l.Identifier=79]="Identifier",l[l.PrivateIdentifier=80]="PrivateIdentifier",l[l.BreakKeyword=81]="BreakKeyword",l[l.CaseKeyword=82]="CaseKeyword",l[l.CatchKeyword=83]="CatchKeyword",l[l.ClassKeyword=84]="ClassKeyword",l[l.ConstKeyword=85]="ConstKeyword",l[l.ContinueKeyword=86]="ContinueKeyword",l[l.DebuggerKeyword=87]="DebuggerKeyword",l[l.DefaultKeyword=88]="DefaultKeyword",l[l.DeleteKeyword=89]="DeleteKeyword",l[l.DoKeyword=90]="DoKeyword",l[l.ElseKeyword=91]="ElseKeyword",l[l.EnumKeyword=92]="EnumKeyword",l[l.ExportKeyword=93]="ExportKeyword",l[l.ExtendsKeyword=94]="ExtendsKeyword",l[l.FalseKeyword=95]="FalseKeyword",l[l.FinallyKeyword=96]="FinallyKeyword",l[l.ForKeyword=97]="ForKeyword",l[l.FunctionKeyword=98]="FunctionKeyword",l[l.IfKeyword=99]="IfKeyword",l[l.ImportKeyword=100]="ImportKeyword",l[l.InKeyword=101]="InKeyword",l[l.InstanceOfKeyword=102]="InstanceOfKeyword",l[l.NewKeyword=103]="NewKeyword",l[l.NullKeyword=104]="NullKeyword",l[l.ReturnKeyword=105]="ReturnKeyword",l[l.SuperKeyword=106]="SuperKeyword",l[l.SwitchKeyword=107]="SwitchKeyword",l[l.ThisKeyword=108]="ThisKeyword",l[l.ThrowKeyword=109]="ThrowKeyword",l[l.TrueKeyword=110]="TrueKeyword",l[l.TryKeyword=111]="TryKeyword",l[l.TypeOfKeyword=112]="TypeOfKeyword",l[l.VarKeyword=113]="VarKeyword",l[l.VoidKeyword=114]="VoidKeyword",l[l.WhileKeyword=115]="WhileKeyword",l[l.WithKeyword=116]="WithKeyword",l[l.ImplementsKeyword=117]="ImplementsKeyword",l[l.InterfaceKeyword=118]="InterfaceKeyword",l[l.LetKeyword=119]="LetKeyword",l[l.PackageKeyword=120]="PackageKeyword",l[l.PrivateKeyword=121]="PrivateKeyword",l[l.ProtectedKeyword=122]="ProtectedKeyword",l[l.PublicKeyword=123]="PublicKeyword",l[l.StaticKeyword=124]="StaticKeyword",l[l.YieldKeyword=125]="YieldKeyword",l[l.AbstractKeyword=126]="AbstractKeyword",l[l.AccessorKeyword=127]="AccessorKeyword",l[l.AsKeyword=128]="AsKeyword",l[l.AssertsKeyword=129]="AssertsKeyword",l[l.AssertKeyword=130]="AssertKeyword",l[l.AnyKeyword=131]="AnyKeyword",l[l.AsyncKeyword=132]="AsyncKeyword",l[l.AwaitKeyword=133]="AwaitKeyword",l[l.BooleanKeyword=134]="BooleanKeyword",l[l.ConstructorKeyword=135]="ConstructorKeyword",l[l.DeclareKeyword=136]="DeclareKeyword",l[l.GetKeyword=137]="GetKeyword",l[l.InferKeyword=138]="InferKeyword",l[l.IntrinsicKeyword=139]="IntrinsicKeyword",l[l.IsKeyword=140]="IsKeyword",l[l.KeyOfKeyword=141]="KeyOfKeyword",l[l.ModuleKeyword=142]="ModuleKeyword",l[l.NamespaceKeyword=143]="NamespaceKeyword",l[l.NeverKeyword=144]="NeverKeyword",l[l.OutKeyword=145]="OutKeyword",l[l.ReadonlyKeyword=146]="ReadonlyKeyword",l[l.RequireKeyword=147]="RequireKeyword",l[l.NumberKeyword=148]="NumberKeyword",l[l.ObjectKeyword=149]="ObjectKeyword",l[l.SatisfiesKeyword=150]="SatisfiesKeyword",l[l.SetKeyword=151]="SetKeyword",l[l.StringKeyword=152]="StringKeyword",l[l.SymbolKeyword=153]="SymbolKeyword",l[l.TypeKeyword=154]="TypeKeyword",l[l.UndefinedKeyword=155]="UndefinedKeyword",l[l.UniqueKeyword=156]="UniqueKeyword",l[l.UnknownKeyword=157]="UnknownKeyword",l[l.FromKeyword=158]="FromKeyword",l[l.GlobalKeyword=159]="GlobalKeyword",l[l.BigIntKeyword=160]="BigIntKeyword",l[l.OverrideKeyword=161]="OverrideKeyword",l[l.OfKeyword=162]="OfKeyword",l[l.QualifiedName=163]="QualifiedName",l[l.ComputedPropertyName=164]="ComputedPropertyName",l[l.TypeParameter=165]="TypeParameter",l[l.Parameter=166]="Parameter",l[l.Decorator=167]="Decorator",l[l.PropertySignature=168]="PropertySignature",l[l.PropertyDeclaration=169]="PropertyDeclaration",l[l.MethodSignature=170]="MethodSignature",l[l.MethodDeclaration=171]="MethodDeclaration",l[l.ClassStaticBlockDeclaration=172]="ClassStaticBlockDeclaration",l[l.Constructor=173]="Constructor",l[l.GetAccessor=174]="GetAccessor",l[l.SetAccessor=175]="SetAccessor",l[l.CallSignature=176]="CallSignature",l[l.ConstructSignature=177]="ConstructSignature",l[l.IndexSignature=178]="IndexSignature",l[l.TypePredicate=179]="TypePredicate",l[l.TypeReference=180]="TypeReference",l[l.FunctionType=181]="FunctionType",l[l.ConstructorType=182]="ConstructorType",l[l.TypeQuery=183]="TypeQuery",l[l.TypeLiteral=184]="TypeLiteral",l[l.ArrayType=185]="ArrayType",l[l.TupleType=186]="TupleType",l[l.OptionalType=187]="OptionalType",l[l.RestType=188]="RestType",l[l.UnionType=189]="UnionType",l[l.IntersectionType=190]="IntersectionType",l[l.ConditionalType=191]="ConditionalType",l[l.InferType=192]="InferType",l[l.ParenthesizedType=193]="ParenthesizedType",l[l.ThisType=194]="ThisType",l[l.TypeOperator=195]="TypeOperator",l[l.IndexedAccessType=196]="IndexedAccessType",l[l.MappedType=197]="MappedType",l[l.LiteralType=198]="LiteralType",l[l.NamedTupleMember=199]="NamedTupleMember",l[l.TemplateLiteralType=200]="TemplateLiteralType",l[l.TemplateLiteralTypeSpan=201]="TemplateLiteralTypeSpan",l[l.ImportType=202]="ImportType",l[l.ObjectBindingPattern=203]="ObjectBindingPattern",l[l.ArrayBindingPattern=204]="ArrayBindingPattern",l[l.BindingElement=205]="BindingElement",l[l.ArrayLiteralExpression=206]="ArrayLiteralExpression",l[l.ObjectLiteralExpression=207]="ObjectLiteralExpression",l[l.PropertyAccessExpression=208]="PropertyAccessExpression",l[l.ElementAccessExpression=209]="ElementAccessExpression",l[l.CallExpression=210]="CallExpression",l[l.NewExpression=211]="NewExpression",l[l.TaggedTemplateExpression=212]="TaggedTemplateExpression",l[l.TypeAssertionExpression=213]="TypeAssertionExpression",l[l.ParenthesizedExpression=214]="ParenthesizedExpression",l[l.FunctionExpression=215]="FunctionExpression",l[l.ArrowFunction=216]="ArrowFunction",l[l.DeleteExpression=217]="DeleteExpression",l[l.TypeOfExpression=218]="TypeOfExpression",l[l.VoidExpression=219]="VoidExpression",l[l.AwaitExpression=220]="AwaitExpression",l[l.PrefixUnaryExpression=221]="PrefixUnaryExpression",l[l.PostfixUnaryExpression=222]="PostfixUnaryExpression",l[l.BinaryExpression=223]="BinaryExpression",l[l.ConditionalExpression=224]="ConditionalExpression",l[l.TemplateExpression=225]="TemplateExpression",l[l.YieldExpression=226]="YieldExpression",l[l.SpreadElement=227]="SpreadElement",l[l.ClassExpression=228]="ClassExpression",l[l.OmittedExpression=229]="OmittedExpression",l[l.ExpressionWithTypeArguments=230]="ExpressionWithTypeArguments",l[l.AsExpression=231]="AsExpression",l[l.NonNullExpression=232]="NonNullExpression",l[l.MetaProperty=233]="MetaProperty",l[l.SyntheticExpression=234]="SyntheticExpression",l[l.SatisfiesExpression=235]="SatisfiesExpression",l[l.TemplateSpan=236]="TemplateSpan",l[l.SemicolonClassElement=237]="SemicolonClassElement",l[l.Block=238]="Block",l[l.EmptyStatement=239]="EmptyStatement",l[l.VariableStatement=240]="VariableStatement",l[l.ExpressionStatement=241]="ExpressionStatement",l[l.IfStatement=242]="IfStatement",l[l.DoStatement=243]="DoStatement",l[l.WhileStatement=244]="WhileStatement",l[l.ForStatement=245]="ForStatement",l[l.ForInStatement=246]="ForInStatement",l[l.ForOfStatement=247]="ForOfStatement",l[l.ContinueStatement=248]="ContinueStatement",l[l.BreakStatement=249]="BreakStatement",l[l.ReturnStatement=250]="ReturnStatement",l[l.WithStatement=251]="WithStatement",l[l.SwitchStatement=252]="SwitchStatement",l[l.LabeledStatement=253]="LabeledStatement",l[l.ThrowStatement=254]="ThrowStatement",l[l.TryStatement=255]="TryStatement",l[l.DebuggerStatement=256]="DebuggerStatement",l[l.VariableDeclaration=257]="VariableDeclaration",l[l.VariableDeclarationList=258]="VariableDeclarationList",l[l.FunctionDeclaration=259]="FunctionDeclaration",l[l.ClassDeclaration=260]="ClassDeclaration",l[l.InterfaceDeclaration=261]="InterfaceDeclaration",l[l.TypeAliasDeclaration=262]="TypeAliasDeclaration",l[l.EnumDeclaration=263]="EnumDeclaration",l[l.ModuleDeclaration=264]="ModuleDeclaration",l[l.ModuleBlock=265]="ModuleBlock",l[l.CaseBlock=266]="CaseBlock",l[l.NamespaceExportDeclaration=267]="NamespaceExportDeclaration",l[l.ImportEqualsDeclaration=268]="ImportEqualsDeclaration",l[l.ImportDeclaration=269]="ImportDeclaration",l[l.ImportClause=270]="ImportClause",l[l.NamespaceImport=271]="NamespaceImport",l[l.NamedImports=272]="NamedImports",l[l.ImportSpecifier=273]="ImportSpecifier",l[l.ExportAssignment=274]="ExportAssignment",l[l.ExportDeclaration=275]="ExportDeclaration",l[l.NamedExports=276]="NamedExports",l[l.NamespaceExport=277]="NamespaceExport",l[l.ExportSpecifier=278]="ExportSpecifier",l[l.MissingDeclaration=279]="MissingDeclaration",l[l.ExternalModuleReference=280]="ExternalModuleReference",l[l.JsxElement=281]="JsxElement",l[l.JsxSelfClosingElement=282]="JsxSelfClosingElement",l[l.JsxOpeningElement=283]="JsxOpeningElement",l[l.JsxClosingElement=284]="JsxClosingElement",l[l.JsxFragment=285]="JsxFragment",l[l.JsxOpeningFragment=286]="JsxOpeningFragment",l[l.JsxClosingFragment=287]="JsxClosingFragment",l[l.JsxAttribute=288]="JsxAttribute",l[l.JsxAttributes=289]="JsxAttributes",l[l.JsxSpreadAttribute=290]="JsxSpreadAttribute",l[l.JsxExpression=291]="JsxExpression",l[l.CaseClause=292]="CaseClause",l[l.DefaultClause=293]="DefaultClause",l[l.HeritageClause=294]="HeritageClause",l[l.CatchClause=295]="CatchClause",l[l.AssertClause=296]="AssertClause",l[l.AssertEntry=297]="AssertEntry",l[l.ImportTypeAssertionContainer=298]="ImportTypeAssertionContainer",l[l.PropertyAssignment=299]="PropertyAssignment",l[l.ShorthandPropertyAssignment=300]="ShorthandPropertyAssignment",l[l.SpreadAssignment=301]="SpreadAssignment",l[l.EnumMember=302]="EnumMember",l[l.UnparsedPrologue=303]="UnparsedPrologue",l[l.UnparsedPrepend=304]="UnparsedPrepend",l[l.UnparsedText=305]="UnparsedText",l[l.UnparsedInternalText=306]="UnparsedInternalText",l[l.UnparsedSyntheticReference=307]="UnparsedSyntheticReference",l[l.SourceFile=308]="SourceFile",l[l.Bundle=309]="Bundle",l[l.UnparsedSource=310]="UnparsedSource",l[l.InputFiles=311]="InputFiles",l[l.JSDocTypeExpression=312]="JSDocTypeExpression",l[l.JSDocNameReference=313]="JSDocNameReference",l[l.JSDocMemberName=314]="JSDocMemberName",l[l.JSDocAllType=315]="JSDocAllType",l[l.JSDocUnknownType=316]="JSDocUnknownType",l[l.JSDocNullableType=317]="JSDocNullableType",l[l.JSDocNonNullableType=318]="JSDocNonNullableType",l[l.JSDocOptionalType=319]="JSDocOptionalType",l[l.JSDocFunctionType=320]="JSDocFunctionType",l[l.JSDocVariadicType=321]="JSDocVariadicType",l[l.JSDocNamepathType=322]="JSDocNamepathType",l[l.JSDoc=323]="JSDoc",l[l.JSDocComment=323]="JSDocComment",l[l.JSDocText=324]="JSDocText",l[l.JSDocTypeLiteral=325]="JSDocTypeLiteral",l[l.JSDocSignature=326]="JSDocSignature",l[l.JSDocLink=327]="JSDocLink",l[l.JSDocLinkCode=328]="JSDocLinkCode",l[l.JSDocLinkPlain=329]="JSDocLinkPlain",l[l.JSDocTag=330]="JSDocTag",l[l.JSDocAugmentsTag=331]="JSDocAugmentsTag",l[l.JSDocImplementsTag=332]="JSDocImplementsTag",l[l.JSDocAuthorTag=333]="JSDocAuthorTag",l[l.JSDocDeprecatedTag=334]="JSDocDeprecatedTag",l[l.JSDocClassTag=335]="JSDocClassTag",l[l.JSDocPublicTag=336]="JSDocPublicTag",l[l.JSDocPrivateTag=337]="JSDocPrivateTag",l[l.JSDocProtectedTag=338]="JSDocProtectedTag",l[l.JSDocReadonlyTag=339]="JSDocReadonlyTag",l[l.JSDocOverrideTag=340]="JSDocOverrideTag",l[l.JSDocCallbackTag=341]="JSDocCallbackTag",l[l.JSDocEnumTag=342]="JSDocEnumTag",l[l.JSDocParameterTag=343]="JSDocParameterTag",l[l.JSDocReturnTag=344]="JSDocReturnTag",l[l.JSDocThisTag=345]="JSDocThisTag",l[l.JSDocTypeTag=346]="JSDocTypeTag",l[l.JSDocTemplateTag=347]="JSDocTemplateTag",l[l.JSDocTypedefTag=348]="JSDocTypedefTag",l[l.JSDocSeeTag=349]="JSDocSeeTag",l[l.JSDocPropertyTag=350]="JSDocPropertyTag",l[l.SyntaxList=351]="SyntaxList",l[l.NotEmittedStatement=352]="NotEmittedStatement",l[l.PartiallyEmittedExpression=353]="PartiallyEmittedExpression",l[l.CommaListExpression=354]="CommaListExpression",l[l.MergeDeclarationMarker=355]="MergeDeclarationMarker",l[l.EndOfDeclarationMarker=356]="EndOfDeclarationMarker",l[l.SyntheticReferenceExpression=357]="SyntheticReferenceExpression",l[l.Count=358]="Count",l[l.FirstAssignment=63]="FirstAssignment",l[l.LastAssignment=78]="LastAssignment",l[l.FirstCompoundAssignment=64]="FirstCompoundAssignment",l[l.LastCompoundAssignment=78]="LastCompoundAssignment",l[l.FirstReservedWord=81]="FirstReservedWord",l[l.LastReservedWord=116]="LastReservedWord",l[l.FirstKeyword=81]="FirstKeyword",l[l.LastKeyword=162]="LastKeyword",l[l.FirstFutureReservedWord=117]="FirstFutureReservedWord",l[l.LastFutureReservedWord=125]="LastFutureReservedWord",l[l.FirstTypeNode=179]="FirstTypeNode",l[l.LastTypeNode=202]="LastTypeNode",l[l.FirstPunctuation=18]="FirstPunctuation",l[l.LastPunctuation=78]="LastPunctuation",l[l.FirstToken=0]="FirstToken",l[l.LastToken=162]="LastToken",l[l.FirstTriviaToken=2]="FirstTriviaToken",l[l.LastTriviaToken=7]="LastTriviaToken",l[l.FirstLiteralToken=8]="FirstLiteralToken",l[l.LastLiteralToken=14]="LastLiteralToken",l[l.FirstTemplateToken=14]="FirstTemplateToken",l[l.LastTemplateToken=17]="LastTemplateToken",l[l.FirstBinaryOperator=29]="FirstBinaryOperator",l[l.LastBinaryOperator=78]="LastBinaryOperator",l[l.FirstStatement=240]="FirstStatement",l[l.LastStatement=256]="LastStatement",l[l.FirstNode=163]="FirstNode",l[l.FirstJSDocNode=312]="FirstJSDocNode",l[l.LastJSDocNode=350]="LastJSDocNode",l[l.FirstJSDocTagNode=330]="FirstJSDocTagNode",l[l.LastJSDocTagNode=350]="LastJSDocTagNode",l[l.FirstContextualKeyword=126]="FirstContextualKeyword",l[l.LastContextualKeyword=162]="LastContextualKeyword",(c=e.NodeFlags||(e.NodeFlags={}))[c.None=0]="None",c[c.Let=1]="Let",c[c.Const=2]="Const",c[c.NestedNamespace=4]="NestedNamespace",c[c.Synthesized=8]="Synthesized",c[c.Namespace=16]="Namespace",c[c.OptionalChain=32]="OptionalChain",c[c.ExportContext=64]="ExportContext",c[c.ContainsThis=128]="ContainsThis",c[c.HasImplicitReturn=256]="HasImplicitReturn",c[c.HasExplicitReturn=512]="HasExplicitReturn",c[c.GlobalAugmentation=1024]="GlobalAugmentation",c[c.HasAsyncFunctions=2048]="HasAsyncFunctions",c[c.DisallowInContext=4096]="DisallowInContext",c[c.YieldContext=8192]="YieldContext",c[c.DecoratorContext=16384]="DecoratorContext",c[c.AwaitContext=32768]="AwaitContext",c[c.DisallowConditionalTypesContext=65536]="DisallowConditionalTypesContext",c[c.ThisNodeHasError=131072]="ThisNodeHasError",c[c.JavaScriptFile=262144]="JavaScriptFile",c[c.ThisNodeOrAnySubNodesHasError=524288]="ThisNodeOrAnySubNodesHasError",c[c.HasAggregatedChildData=1048576]="HasAggregatedChildData",c[c.PossiblyContainsDynamicImport=2097152]="PossiblyContainsDynamicImport",c[c.PossiblyContainsImportMeta=4194304]="PossiblyContainsImportMeta",c[c.JSDoc=8388608]="JSDoc",c[c.Ambient=16777216]="Ambient",c[c.InWithStatement=33554432]="InWithStatement",c[c.JsonFile=67108864]="JsonFile",c[c.TypeCached=134217728]="TypeCached",c[c.Deprecated=268435456]="Deprecated",c[c.BlockScoped=3]="BlockScoped",c[c.ReachabilityCheckFlags=768]="ReachabilityCheckFlags",c[c.ReachabilityAndEmitFlags=2816]="ReachabilityAndEmitFlags",c[c.ContextFlags=50720768]="ContextFlags",c[c.TypeExcludesFlags=40960]="TypeExcludesFlags",c[c.PermanentlySetIncrementalFlags=6291456]="PermanentlySetIncrementalFlags",(s=e.ModifierFlags||(e.ModifierFlags={}))[s.None=0]="None",s[s.Export=1]="Export",s[s.Ambient=2]="Ambient",s[s.Public=4]="Public",s[s.Private=8]="Private",s[s.Protected=16]="Protected",s[s.Static=32]="Static",s[s.Readonly=64]="Readonly",s[s.Accessor=128]="Accessor",s[s.Abstract=256]="Abstract",s[s.Async=512]="Async",s[s.Default=1024]="Default",s[s.Const=2048]="Const",s[s.HasComputedJSDocModifiers=4096]="HasComputedJSDocModifiers",s[s.Deprecated=8192]="Deprecated",s[s.Override=16384]="Override",s[s.In=32768]="In",s[s.Out=65536]="Out",s[s.Decorator=131072]="Decorator",s[s.HasComputedFlags=536870912]="HasComputedFlags",s[s.AccessibilityModifier=28]="AccessibilityModifier",s[s.ParameterPropertyModifier=16476]="ParameterPropertyModifier",s[s.NonPublicAccessibilityModifier=24]="NonPublicAccessibilityModifier",s[s.TypeScriptModifier=117086]="TypeScriptModifier",s[s.ExportDefault=1025]="ExportDefault",s[s.All=258047]="All",s[s.Modifier=126975]="Modifier",(o=e.JsxFlags||(e.JsxFlags={}))[o.None=0]="None",o[o.IntrinsicNamedElement=1]="IntrinsicNamedElement",o[o.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",o[o.IntrinsicElement=3]="IntrinsicElement",(a=e.RelationComparisonResult||(e.RelationComparisonResult={}))[a.Succeeded=1]="Succeeded",a[a.Failed=2]="Failed",a[a.Reported=4]="Reported",a[a.ReportsUnmeasurable=8]="ReportsUnmeasurable",a[a.ReportsUnreliable=16]="ReportsUnreliable",a[a.ReportsMask=24]="ReportsMask",(i=e.GeneratedIdentifierFlags||(e.GeneratedIdentifierFlags={}))[i.None=0]="None",i[i.Auto=1]="Auto",i[i.Loop=2]="Loop",i[i.Unique=3]="Unique",i[i.Node=4]="Node",i[i.KindMask=7]="KindMask",i[i.ReservedInNestedScopes=8]="ReservedInNestedScopes",i[i.Optimistic=16]="Optimistic",i[i.FileLevel=32]="FileLevel",i[i.AllowNameSubstitution=64]="AllowNameSubstitution",(n=e.TokenFlags||(e.TokenFlags={}))[n.None=0]="None",n[n.PrecedingLineBreak=1]="PrecedingLineBreak",n[n.PrecedingJSDocComment=2]="PrecedingJSDocComment",n[n.Unterminated=4]="Unterminated",n[n.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",n[n.Scientific=16]="Scientific",n[n.Octal=32]="Octal",n[n.HexSpecifier=64]="HexSpecifier",n[n.BinarySpecifier=128]="BinarySpecifier",n[n.OctalSpecifier=256]="OctalSpecifier",n[n.ContainsSeparator=512]="ContainsSeparator",n[n.UnicodeEscape=1024]="UnicodeEscape",n[n.ContainsInvalidEscape=2048]="ContainsInvalidEscape",n[n.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",n[n.NumericLiteralFlags=1008]="NumericLiteralFlags",n[n.TemplateLiteralLikeFlags=2048]="TemplateLiteralLikeFlags",(r=e.FlowFlags||(e.FlowFlags={}))[r.Unreachable=1]="Unreachable",r[r.Start=2]="Start",r[r.BranchLabel=4]="BranchLabel",r[r.LoopLabel=8]="LoopLabel",r[r.Assignment=16]="Assignment",r[r.TrueCondition=32]="TrueCondition",r[r.FalseCondition=64]="FalseCondition",r[r.SwitchClause=128]="SwitchClause",r[r.ArrayMutation=256]="ArrayMutation",r[r.Call=512]="Call",r[r.ReduceLabel=1024]="ReduceLabel",r[r.Referenced=2048]="Referenced",r[r.Shared=4096]="Shared",r[r.Label=12]="Label",r[r.Condition=96]="Condition",(t=e.CommentDirectiveType||(e.CommentDirectiveType={}))[t.ExpectError=0]="ExpectError",t[t.Ignore=1]="Ignore";var u,_,d,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,A,F,P,w,I,O,M,L,R,B,j,J,z,U,K,V,q,W,H,G,Q,X,Y,Z,$,ee,te,re,ne,ie,ae,oe,se,ce,le,ue,_e,de,pe,fe;e.OperationCanceledException=function(){},(fe=e.FileIncludeKind||(e.FileIncludeKind={}))[fe.RootFile=0]="RootFile",fe[fe.SourceFromProjectReference=1]="SourceFromProjectReference",fe[fe.OutputFromProjectReference=2]="OutputFromProjectReference",fe[fe.Import=3]="Import",fe[fe.ReferenceFile=4]="ReferenceFile",fe[fe.TypeReferenceDirective=5]="TypeReferenceDirective",fe[fe.LibFile=6]="LibFile",fe[fe.LibReferenceDirective=7]="LibReferenceDirective",fe[fe.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",(pe=e.FilePreprocessingDiagnosticsKind||(e.FilePreprocessingDiagnosticsKind={}))[pe.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",pe[pe.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",(de=e.StructureIsReused||(e.StructureIsReused={}))[de.Not=0]="Not",de[de.SafeModules=1]="SafeModules",de[de.Completely=2]="Completely",(_e=e.ExitStatus||(e.ExitStatus={}))[_e.Success=0]="Success",_e[_e.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",_e[_e.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",_e[_e.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",_e[_e.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",_e[_e.ProjectReferenceCycle_OutputsSkupped=4]="ProjectReferenceCycle_OutputsSkupped",(ue=e.MemberOverrideStatus||(e.MemberOverrideStatus={}))[ue.Ok=0]="Ok",ue[ue.NeedsOverride=1]="NeedsOverride",ue[ue.HasInvalidOverride=2]="HasInvalidOverride",(le=e.UnionReduction||(e.UnionReduction={}))[le.None=0]="None",le[le.Literal=1]="Literal",le[le.Subtype=2]="Subtype",(ce=e.ContextFlags||(e.ContextFlags={}))[ce.None=0]="None",ce[ce.Signature=1]="Signature",ce[ce.NoConstraints=2]="NoConstraints",ce[ce.Completions=4]="Completions",ce[ce.SkipBindingPatterns=8]="SkipBindingPatterns",(se=e.NodeBuilderFlags||(e.NodeBuilderFlags={}))[se.None=0]="None",se[se.NoTruncation=1]="NoTruncation",se[se.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",se[se.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",se[se.UseStructuralFallback=8]="UseStructuralFallback",se[se.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",se[se.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",se[se.UseFullyQualifiedType=64]="UseFullyQualifiedType",se[se.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",se[se.SuppressAnyReturnType=256]="SuppressAnyReturnType",se[se.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",se[se.MultilineObjectLiterals=1024]="MultilineObjectLiterals",se[se.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",se[se.UseTypeOfFunction=4096]="UseTypeOfFunction",se[se.OmitParameterModifiers=8192]="OmitParameterModifiers",se[se.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",se[se.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",se[se.NoTypeReduction=536870912]="NoTypeReduction",se[se.OmitThisParameter=33554432]="OmitThisParameter",se[se.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",se[se.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",se[se.AllowQualifedNameInPlaceOfIdentifier=65536]="AllowQualifedNameInPlaceOfIdentifier",se[se.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",se[se.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",se[se.AllowEmptyTuple=524288]="AllowEmptyTuple",se[se.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",se[se.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",se[se.WriteComputedProps=1073741824]="WriteComputedProps",se[se.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",se[se.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",se[se.IgnoreErrors=70221824]="IgnoreErrors",se[se.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",se[se.InTypeAlias=8388608]="InTypeAlias",se[se.InInitialEntityName=16777216]="InInitialEntityName",(oe=e.TypeFormatFlags||(e.TypeFormatFlags={}))[oe.None=0]="None",oe[oe.NoTruncation=1]="NoTruncation",oe[oe.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",oe[oe.UseStructuralFallback=8]="UseStructuralFallback",oe[oe.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",oe[oe.UseFullyQualifiedType=64]="UseFullyQualifiedType",oe[oe.SuppressAnyReturnType=256]="SuppressAnyReturnType",oe[oe.MultilineObjectLiterals=1024]="MultilineObjectLiterals",oe[oe.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",oe[oe.UseTypeOfFunction=4096]="UseTypeOfFunction",oe[oe.OmitParameterModifiers=8192]="OmitParameterModifiers",oe[oe.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",oe[oe.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",oe[oe.NoTypeReduction=536870912]="NoTypeReduction",oe[oe.OmitThisParameter=33554432]="OmitThisParameter",oe[oe.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",oe[oe.AddUndefined=131072]="AddUndefined",oe[oe.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",oe[oe.InArrayType=524288]="InArrayType",oe[oe.InElementType=2097152]="InElementType",oe[oe.InFirstTypeArgument=4194304]="InFirstTypeArgument",oe[oe.InTypeAlias=8388608]="InTypeAlias",oe[oe.WriteOwnNameForAnyLike=0]="WriteOwnNameForAnyLike",oe[oe.NodeBuilderFlagsMask=848330091]="NodeBuilderFlagsMask",(ae=e.SymbolFormatFlags||(e.SymbolFormatFlags={}))[ae.None=0]="None",ae[ae.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",ae[ae.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",ae[ae.AllowAnyNodeKind=4]="AllowAnyNodeKind",ae[ae.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",ae[ae.WriteComputedProps=16]="WriteComputedProps",ae[ae.DoNotIncludeSymbolChain=32]="DoNotIncludeSymbolChain",(ie=e.SymbolAccessibility||(e.SymbolAccessibility={}))[ie.Accessible=0]="Accessible",ie[ie.NotAccessible=1]="NotAccessible",ie[ie.CannotBeNamed=2]="CannotBeNamed",(ne=e.SyntheticSymbolKind||(e.SyntheticSymbolKind={}))[ne.UnionOrIntersection=0]="UnionOrIntersection",ne[ne.Spread=1]="Spread",(re=e.TypePredicateKind||(e.TypePredicateKind={}))[re.This=0]="This",re[re.Identifier=1]="Identifier",re[re.AssertsThis=2]="AssertsThis",re[re.AssertsIdentifier=3]="AssertsIdentifier",(te=e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}))[te.Unknown=0]="Unknown",te[te.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",te[te.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",te[te.NumberLikeType=3]="NumberLikeType",te[te.BigIntLikeType=4]="BigIntLikeType",te[te.StringLikeType=5]="StringLikeType",te[te.BooleanType=6]="BooleanType",te[te.ArrayLikeType=7]="ArrayLikeType",te[te.ESSymbolType=8]="ESSymbolType",te[te.Promise=9]="Promise",te[te.TypeWithCallSignature=10]="TypeWithCallSignature",te[te.ObjectType=11]="ObjectType",(ee=e.SymbolFlags||(e.SymbolFlags={}))[ee.None=0]="None",ee[ee.FunctionScopedVariable=1]="FunctionScopedVariable",ee[ee.BlockScopedVariable=2]="BlockScopedVariable",ee[ee.Property=4]="Property",ee[ee.EnumMember=8]="EnumMember",ee[ee.Function=16]="Function",ee[ee.Class=32]="Class",ee[ee.Interface=64]="Interface",ee[ee.ConstEnum=128]="ConstEnum",ee[ee.RegularEnum=256]="RegularEnum",ee[ee.ValueModule=512]="ValueModule",ee[ee.NamespaceModule=1024]="NamespaceModule",ee[ee.TypeLiteral=2048]="TypeLiteral",ee[ee.ObjectLiteral=4096]="ObjectLiteral",ee[ee.Method=8192]="Method",ee[ee.Constructor=16384]="Constructor",ee[ee.GetAccessor=32768]="GetAccessor",ee[ee.SetAccessor=65536]="SetAccessor",ee[ee.Signature=131072]="Signature",ee[ee.TypeParameter=262144]="TypeParameter",ee[ee.TypeAlias=524288]="TypeAlias",ee[ee.ExportValue=1048576]="ExportValue",ee[ee.Alias=2097152]="Alias",ee[ee.Prototype=4194304]="Prototype",ee[ee.ExportStar=8388608]="ExportStar",ee[ee.Optional=16777216]="Optional",ee[ee.Transient=33554432]="Transient",ee[ee.Assignment=67108864]="Assignment",ee[ee.ModuleExports=134217728]="ModuleExports",ee[ee.All=67108863]="All",ee[ee.Enum=384]="Enum",ee[ee.Variable=3]="Variable",ee[ee.Value=111551]="Value",ee[ee.Type=788968]="Type",ee[ee.Namespace=1920]="Namespace",ee[ee.Module=1536]="Module",ee[ee.Accessor=98304]="Accessor",ee[ee.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",ee[ee.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",ee[ee.ParameterExcludes=111551]="ParameterExcludes",ee[ee.PropertyExcludes=0]="PropertyExcludes",ee[ee.EnumMemberExcludes=900095]="EnumMemberExcludes",ee[ee.FunctionExcludes=110991]="FunctionExcludes",ee[ee.ClassExcludes=899503]="ClassExcludes",ee[ee.InterfaceExcludes=788872]="InterfaceExcludes",ee[ee.RegularEnumExcludes=899327]="RegularEnumExcludes",ee[ee.ConstEnumExcludes=899967]="ConstEnumExcludes",ee[ee.ValueModuleExcludes=110735]="ValueModuleExcludes",ee[ee.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",ee[ee.MethodExcludes=103359]="MethodExcludes",ee[ee.GetAccessorExcludes=46015]="GetAccessorExcludes",ee[ee.SetAccessorExcludes=78783]="SetAccessorExcludes",ee[ee.AccessorExcludes=13247]="AccessorExcludes",ee[ee.TypeParameterExcludes=526824]="TypeParameterExcludes",ee[ee.TypeAliasExcludes=788968]="TypeAliasExcludes",ee[ee.AliasExcludes=2097152]="AliasExcludes",ee[ee.ModuleMember=2623475]="ModuleMember",ee[ee.ExportHasLocal=944]="ExportHasLocal",ee[ee.BlockScoped=418]="BlockScoped",ee[ee.PropertyOrAccessor=98308]="PropertyOrAccessor",ee[ee.ClassMember=106500]="ClassMember",ee[ee.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",ee[ee.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",ee[ee.Classifiable=2885600]="Classifiable",ee[ee.LateBindingContainer=6256]="LateBindingContainer",($=e.EnumKind||(e.EnumKind={}))[$.Numeric=0]="Numeric",$[$.Literal=1]="Literal",(Z=e.CheckFlags||(e.CheckFlags={}))[Z.Instantiated=1]="Instantiated",Z[Z.SyntheticProperty=2]="SyntheticProperty",Z[Z.SyntheticMethod=4]="SyntheticMethod",Z[Z.Readonly=8]="Readonly",Z[Z.ReadPartial=16]="ReadPartial",Z[Z.WritePartial=32]="WritePartial",Z[Z.HasNonUniformType=64]="HasNonUniformType",Z[Z.HasLiteralType=128]="HasLiteralType",Z[Z.ContainsPublic=256]="ContainsPublic",Z[Z.ContainsProtected=512]="ContainsProtected",Z[Z.ContainsPrivate=1024]="ContainsPrivate",Z[Z.ContainsStatic=2048]="ContainsStatic",Z[Z.Late=4096]="Late",Z[Z.ReverseMapped=8192]="ReverseMapped",Z[Z.OptionalParameter=16384]="OptionalParameter",Z[Z.RestParameter=32768]="RestParameter",Z[Z.DeferredType=65536]="DeferredType",Z[Z.HasNeverType=131072]="HasNeverType",Z[Z.Mapped=262144]="Mapped",Z[Z.StripOptional=524288]="StripOptional",Z[Z.Unresolved=1048576]="Unresolved",Z[Z.Synthetic=6]="Synthetic",Z[Z.Discriminant=192]="Discriminant",Z[Z.Partial=48]="Partial",(Y=e.InternalSymbolName||(e.InternalSymbolName={})).Call="__call",Y.Constructor="__constructor",Y.New="__new",Y.Index="__index",Y.ExportStar="__export",Y.Global="__global",Y.Missing="__missing",Y.Type="__type",Y.Object="__object",Y.JSXAttributes="__jsxAttributes",Y.Class="__class",Y.Function="__function",Y.Computed="__computed",Y.Resolving="__resolving__",Y.ExportEquals="export=",Y.Default="default",Y.This="this",(X=e.NodeCheckFlags||(e.NodeCheckFlags={}))[X.TypeChecked=1]="TypeChecked",X[X.LexicalThis=2]="LexicalThis",X[X.CaptureThis=4]="CaptureThis",X[X.CaptureNewTarget=8]="CaptureNewTarget",X[X.SuperInstance=256]="SuperInstance",X[X.SuperStatic=512]="SuperStatic",X[X.ContextChecked=1024]="ContextChecked",X[X.MethodWithSuperPropertyAccessInAsync=2048]="MethodWithSuperPropertyAccessInAsync",X[X.MethodWithSuperPropertyAssignmentInAsync=4096]="MethodWithSuperPropertyAssignmentInAsync",X[X.CaptureArguments=8192]="CaptureArguments",X[X.EnumValuesComputed=16384]="EnumValuesComputed",X[X.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",X[X.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",X[X.ContainsCapturedBlockScopeBinding=131072]="ContainsCapturedBlockScopeBinding",X[X.CapturedBlockScopedBinding=262144]="CapturedBlockScopedBinding",X[X.BlockScopedBindingInLoop=524288]="BlockScopedBindingInLoop",X[X.ClassWithBodyScopedClassBinding=1048576]="ClassWithBodyScopedClassBinding",X[X.BodyScopedClassBinding=2097152]="BodyScopedClassBinding",X[X.NeedsLoopOutParameter=4194304]="NeedsLoopOutParameter",X[X.AssignmentsMarked=8388608]="AssignmentsMarked",X[X.ClassWithConstructorReference=16777216]="ClassWithConstructorReference",X[X.ConstructorReferenceInClass=33554432]="ConstructorReferenceInClass",X[X.ContainsClassWithPrivateIdentifiers=67108864]="ContainsClassWithPrivateIdentifiers",X[X.ContainsSuperPropertyInStaticInitializer=134217728]="ContainsSuperPropertyInStaticInitializer",X[X.InCheckIdentifier=268435456]="InCheckIdentifier",(Q=e.TypeFlags||(e.TypeFlags={}))[Q.Any=1]="Any",Q[Q.Unknown=2]="Unknown",Q[Q.String=4]="String",Q[Q.Number=8]="Number",Q[Q.Boolean=16]="Boolean",Q[Q.Enum=32]="Enum",Q[Q.BigInt=64]="BigInt",Q[Q.StringLiteral=128]="StringLiteral",Q[Q.NumberLiteral=256]="NumberLiteral",Q[Q.BooleanLiteral=512]="BooleanLiteral",Q[Q.EnumLiteral=1024]="EnumLiteral",Q[Q.BigIntLiteral=2048]="BigIntLiteral",Q[Q.ESSymbol=4096]="ESSymbol",Q[Q.UniqueESSymbol=8192]="UniqueESSymbol",Q[Q.Void=16384]="Void",Q[Q.Undefined=32768]="Undefined",Q[Q.Null=65536]="Null",Q[Q.Never=131072]="Never",Q[Q.TypeParameter=262144]="TypeParameter",Q[Q.Object=524288]="Object",Q[Q.Union=1048576]="Union",Q[Q.Intersection=2097152]="Intersection",Q[Q.Index=4194304]="Index",Q[Q.IndexedAccess=8388608]="IndexedAccess",Q[Q.Conditional=16777216]="Conditional",Q[Q.Substitution=33554432]="Substitution",Q[Q.NonPrimitive=67108864]="NonPrimitive",Q[Q.TemplateLiteral=134217728]="TemplateLiteral",Q[Q.StringMapping=268435456]="StringMapping",Q[Q.AnyOrUnknown=3]="AnyOrUnknown",Q[Q.Nullable=98304]="Nullable",Q[Q.Literal=2944]="Literal",Q[Q.Unit=109440]="Unit",Q[Q.StringOrNumberLiteral=384]="StringOrNumberLiteral",Q[Q.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",Q[Q.DefinitelyFalsy=117632]="DefinitelyFalsy",Q[Q.PossiblyFalsy=117724]="PossiblyFalsy",Q[Q.Intrinsic=67359327]="Intrinsic",Q[Q.Primitive=131068]="Primitive",Q[Q.StringLike=402653316]="StringLike",Q[Q.NumberLike=296]="NumberLike",Q[Q.BigIntLike=2112]="BigIntLike",Q[Q.BooleanLike=528]="BooleanLike",Q[Q.EnumLike=1056]="EnumLike",Q[Q.ESSymbolLike=12288]="ESSymbolLike",Q[Q.VoidLike=49152]="VoidLike",Q[Q.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",Q[Q.DisjointDomains=469892092]="DisjointDomains",Q[Q.UnionOrIntersection=3145728]="UnionOrIntersection",Q[Q.StructuredType=3670016]="StructuredType",Q[Q.TypeVariable=8650752]="TypeVariable",Q[Q.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",Q[Q.InstantiablePrimitive=406847488]="InstantiablePrimitive",Q[Q.Instantiable=465829888]="Instantiable",Q[Q.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",Q[Q.ObjectFlagsType=3899393]="ObjectFlagsType",Q[Q.Simplifiable=25165824]="Simplifiable",Q[Q.Singleton=67358815]="Singleton",Q[Q.Narrowable=536624127]="Narrowable",Q[Q.IncludesMask=205258751]="IncludesMask",Q[Q.IncludesMissingType=262144]="IncludesMissingType",Q[Q.IncludesNonWideningType=4194304]="IncludesNonWideningType",Q[Q.IncludesWildcard=8388608]="IncludesWildcard",Q[Q.IncludesEmptyObject=16777216]="IncludesEmptyObject",Q[Q.IncludesInstantiable=33554432]="IncludesInstantiable",Q[Q.NotPrimitiveUnion=36323363]="NotPrimitiveUnion",(G=e.ObjectFlags||(e.ObjectFlags={}))[G.Class=1]="Class",G[G.Interface=2]="Interface",G[G.Reference=4]="Reference",G[G.Tuple=8]="Tuple",G[G.Anonymous=16]="Anonymous",G[G.Mapped=32]="Mapped",G[G.Instantiated=64]="Instantiated",G[G.ObjectLiteral=128]="ObjectLiteral",G[G.EvolvingArray=256]="EvolvingArray",G[G.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",G[G.ReverseMapped=1024]="ReverseMapped",G[G.JsxAttributes=2048]="JsxAttributes",G[G.JSLiteral=4096]="JSLiteral",G[G.FreshLiteral=8192]="FreshLiteral",G[G.ArrayLiteral=16384]="ArrayLiteral",G[G.PrimitiveUnion=32768]="PrimitiveUnion",G[G.ContainsWideningType=65536]="ContainsWideningType",G[G.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",G[G.NonInferrableType=262144]="NonInferrableType",G[G.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",G[G.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",G[G.ClassOrInterface=3]="ClassOrInterface",G[G.RequiresWidening=196608]="RequiresWidening",G[G.PropagatingFlags=458752]="PropagatingFlags",G[G.ObjectTypeKindMask=1343]="ObjectTypeKindMask",G[G.ContainsSpread=2097152]="ContainsSpread",G[G.ObjectRestType=4194304]="ObjectRestType",G[G.InstantiationExpressionType=8388608]="InstantiationExpressionType",G[G.IsClassInstanceClone=16777216]="IsClassInstanceClone",G[G.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",G[G.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",G[G.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",G[G.IsGenericObjectType=4194304]="IsGenericObjectType",G[G.IsGenericIndexType=8388608]="IsGenericIndexType",G[G.IsGenericType=12582912]="IsGenericType",G[G.ContainsIntersections=16777216]="ContainsIntersections",G[G.IsUnknownLikeUnionComputed=33554432]="IsUnknownLikeUnionComputed",G[G.IsUnknownLikeUnion=67108864]="IsUnknownLikeUnion",G[G.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",G[G.IsNeverIntersection=33554432]="IsNeverIntersection",(H=e.VarianceFlags||(e.VarianceFlags={}))[H.Invariant=0]="Invariant",H[H.Covariant=1]="Covariant",H[H.Contravariant=2]="Contravariant",H[H.Bivariant=3]="Bivariant",H[H.Independent=4]="Independent",H[H.VarianceMask=7]="VarianceMask",H[H.Unmeasurable=8]="Unmeasurable",H[H.Unreliable=16]="Unreliable",H[H.AllowsStructuralFallback=24]="AllowsStructuralFallback",(W=e.ElementFlags||(e.ElementFlags={}))[W.Required=1]="Required",W[W.Optional=2]="Optional",W[W.Rest=4]="Rest",W[W.Variadic=8]="Variadic",W[W.Fixed=3]="Fixed",W[W.Variable=12]="Variable",W[W.NonRequired=14]="NonRequired",W[W.NonRest=11]="NonRest",(q=e.AccessFlags||(e.AccessFlags={}))[q.None=0]="None",q[q.IncludeUndefined=1]="IncludeUndefined",q[q.NoIndexSignatures=2]="NoIndexSignatures",q[q.Writing=4]="Writing",q[q.CacheSymbol=8]="CacheSymbol",q[q.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",q[q.ExpressionPosition=32]="ExpressionPosition",q[q.ReportDeprecated=64]="ReportDeprecated",q[q.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",q[q.Contextual=256]="Contextual",q[q.Persistent=1]="Persistent",(V=e.JsxReferenceKind||(e.JsxReferenceKind={}))[V.Component=0]="Component",V[V.Function=1]="Function",V[V.Mixed=2]="Mixed",(K=e.SignatureKind||(e.SignatureKind={}))[K.Call=0]="Call",K[K.Construct=1]="Construct",(U=e.SignatureFlags||(e.SignatureFlags={}))[U.None=0]="None",U[U.HasRestParameter=1]="HasRestParameter",U[U.HasLiteralTypes=2]="HasLiteralTypes",U[U.Abstract=4]="Abstract",U[U.IsInnerCallChain=8]="IsInnerCallChain",U[U.IsOuterCallChain=16]="IsOuterCallChain",U[U.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",U[U.PropagatingFlags=39]="PropagatingFlags",U[U.CallChainFlags=24]="CallChainFlags",(z=e.IndexKind||(e.IndexKind={}))[z.String=0]="String",z[z.Number=1]="Number",(J=e.TypeMapKind||(e.TypeMapKind={}))[J.Simple=0]="Simple",J[J.Array=1]="Array",J[J.Deferred=2]="Deferred",J[J.Function=3]="Function",J[J.Composite=4]="Composite",J[J.Merged=5]="Merged",(j=e.InferencePriority||(e.InferencePriority={}))[j.NakedTypeVariable=1]="NakedTypeVariable",j[j.SpeculativeTuple=2]="SpeculativeTuple",j[j.SubstituteSource=4]="SubstituteSource",j[j.HomomorphicMappedType=8]="HomomorphicMappedType",j[j.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",j[j.MappedTypeConstraint=32]="MappedTypeConstraint",j[j.ContravariantConditional=64]="ContravariantConditional",j[j.ReturnType=128]="ReturnType",j[j.LiteralKeyof=256]="LiteralKeyof",j[j.NoConstraints=512]="NoConstraints",j[j.AlwaysStrict=1024]="AlwaysStrict",j[j.MaxValue=2048]="MaxValue",j[j.PriorityImpliesCombination=416]="PriorityImpliesCombination",j[j.Circularity=-1]="Circularity",(B=e.InferenceFlags||(e.InferenceFlags={}))[B.None=0]="None",B[B.NoDefault=1]="NoDefault",B[B.AnyDefault=2]="AnyDefault",B[B.SkippedGenericFunction=4]="SkippedGenericFunction",(R=e.Ternary||(e.Ternary={}))[R.False=0]="False",R[R.Unknown=1]="Unknown",R[R.Maybe=3]="Maybe",R[R.True=-1]="True",(L=e.AssignmentDeclarationKind||(e.AssignmentDeclarationKind={}))[L.None=0]="None",L[L.ExportsProperty=1]="ExportsProperty",L[L.ModuleExports=2]="ModuleExports",L[L.PrototypeProperty=3]="PrototypeProperty",L[L.ThisProperty=4]="ThisProperty",L[L.Property=5]="Property",L[L.Prototype=6]="Prototype",L[L.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",L[L.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",L[L.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message";}(u=e.DiagnosticCategory||(e.DiagnosticCategory={})),e.diagnosticCategoryName=function(e,t){void 0===t&&(t=!0);var r=u[e.category];return t?r.toLowerCase():r},(M=e.ModuleResolutionKind||(e.ModuleResolutionKind={}))[M.Classic=1]="Classic",M[M.NodeJs=2]="NodeJs",M[M.Node16=3]="Node16",M[M.NodeNext=99]="NodeNext",(O=e.ModuleDetectionKind||(e.ModuleDetectionKind={}))[O.Legacy=1]="Legacy",O[O.Auto=2]="Auto",O[O.Force=3]="Force",(I=e.WatchFileKind||(e.WatchFileKind={}))[I.FixedPollingInterval=0]="FixedPollingInterval",I[I.PriorityPollingInterval=1]="PriorityPollingInterval",I[I.DynamicPriorityPolling=2]="DynamicPriorityPolling",I[I.FixedChunkSizePolling=3]="FixedChunkSizePolling",I[I.UseFsEvents=4]="UseFsEvents",I[I.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",(w=e.WatchDirectoryKind||(e.WatchDirectoryKind={}))[w.UseFsEvents=0]="UseFsEvents",w[w.FixedPollingInterval=1]="FixedPollingInterval",w[w.DynamicPriorityPolling=2]="DynamicPriorityPolling",w[w.FixedChunkSizePolling=3]="FixedChunkSizePolling",(P=e.PollingWatchKind||(e.PollingWatchKind={}))[P.FixedInterval=0]="FixedInterval",P[P.PriorityInterval=1]="PriorityInterval",P[P.DynamicPriority=2]="DynamicPriority",P[P.FixedChunkSize=3]="FixedChunkSize",(F=e.ModuleKind||(e.ModuleKind={}))[F.None=0]="None",F[F.CommonJS=1]="CommonJS",F[F.AMD=2]="AMD",F[F.UMD=3]="UMD",F[F.System=4]="System",F[F.ES2015=5]="ES2015",F[F.ES2020=6]="ES2020",F[F.ES2022=7]="ES2022",F[F.ESNext=99]="ESNext",F[F.Node16=100]="Node16",F[F.NodeNext=199]="NodeNext",(A=e.JsxEmit||(e.JsxEmit={}))[A.None=0]="None",A[A.Preserve=1]="Preserve",A[A.React=2]="React",A[A.ReactNative=3]="ReactNative",A[A.ReactJSX=4]="ReactJSX",A[A.ReactJSXDev=5]="ReactJSXDev",(N=e.ImportsNotUsedAsValues||(e.ImportsNotUsedAsValues={}))[N.Remove=0]="Remove",N[N.Preserve=1]="Preserve",N[N.Error=2]="Error",(k=e.NewLineKind||(e.NewLineKind={}))[k.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",k[k.LineFeed=1]="LineFeed",(E=e.ScriptKind||(e.ScriptKind={}))[E.Unknown=0]="Unknown",E[E.JS=1]="JS",E[E.JSX=2]="JSX",E[E.TS=3]="TS",E[E.TSX=4]="TSX",E[E.External=5]="External",E[E.JSON=6]="JSON",E[E.Deferred=7]="Deferred",(C=e.ScriptTarget||(e.ScriptTarget={}))[C.ES3=0]="ES3",C[C.ES5=1]="ES5",C[C.ES2015=2]="ES2015",C[C.ES2016=3]="ES2016",C[C.ES2017=4]="ES2017",C[C.ES2018=5]="ES2018",C[C.ES2019=6]="ES2019",C[C.ES2020=7]="ES2020",C[C.ES2021=8]="ES2021",C[C.ES2022=9]="ES2022",C[C.ESNext=99]="ESNext",C[C.JSON=100]="JSON",C[C.Latest=99]="Latest",(T=e.LanguageVariant||(e.LanguageVariant={}))[T.Standard=0]="Standard",T[T.JSX=1]="JSX",(S=e.WatchDirectoryFlags||(e.WatchDirectoryFlags={}))[S.None=0]="None",S[S.Recursive=1]="Recursive",(D=e.CharacterCodes||(e.CharacterCodes={}))[D.nullCharacter=0]="nullCharacter",D[D.maxAsciiCharacter=127]="maxAsciiCharacter",D[D.lineFeed=10]="lineFeed",D[D.carriageReturn=13]="carriageReturn",D[D.lineSeparator=8232]="lineSeparator",D[D.paragraphSeparator=8233]="paragraphSeparator",D[D.nextLine=133]="nextLine",D[D.space=32]="space",D[D.nonBreakingSpace=160]="nonBreakingSpace",D[D.enQuad=8192]="enQuad",D[D.emQuad=8193]="emQuad",D[D.enSpace=8194]="enSpace",D[D.emSpace=8195]="emSpace",D[D.threePerEmSpace=8196]="threePerEmSpace",D[D.fourPerEmSpace=8197]="fourPerEmSpace",D[D.sixPerEmSpace=8198]="sixPerEmSpace",D[D.figureSpace=8199]="figureSpace",D[D.punctuationSpace=8200]="punctuationSpace",D[D.thinSpace=8201]="thinSpace",D[D.hairSpace=8202]="hairSpace",D[D.zeroWidthSpace=8203]="zeroWidthSpace",D[D.narrowNoBreakSpace=8239]="narrowNoBreakSpace",D[D.ideographicSpace=12288]="ideographicSpace",D[D.mathematicalSpace=8287]="mathematicalSpace",D[D.ogham=5760]="ogham",D[D._=95]="_",D[D.$=36]="$",D[D._0=48]="_0",D[D._1=49]="_1",D[D._2=50]="_2",D[D._3=51]="_3",D[D._4=52]="_4",D[D._5=53]="_5",D[D._6=54]="_6",D[D._7=55]="_7",D[D._8=56]="_8",D[D._9=57]="_9",D[D.a=97]="a",D[D.b=98]="b",D[D.c=99]="c",D[D.d=100]="d",D[D.e=101]="e",D[D.f=102]="f",D[D.g=103]="g",D[D.h=104]="h",D[D.i=105]="i",D[D.j=106]="j",D[D.k=107]="k",D[D.l=108]="l",D[D.m=109]="m",D[D.n=110]="n",D[D.o=111]="o",D[D.p=112]="p",D[D.q=113]="q",D[D.r=114]="r",D[D.s=115]="s",D[D.t=116]="t",D[D.u=117]="u",D[D.v=118]="v",D[D.w=119]="w",D[D.x=120]="x",D[D.y=121]="y",D[D.z=122]="z",D[D.A=65]="A",D[D.B=66]="B",D[D.C=67]="C",D[D.D=68]="D",D[D.E=69]="E",D[D.F=70]="F",D[D.G=71]="G",D[D.H=72]="H",D[D.I=73]="I",D[D.J=74]="J",D[D.K=75]="K",D[D.L=76]="L",D[D.M=77]="M",D[D.N=78]="N",D[D.O=79]="O",D[D.P=80]="P",D[D.Q=81]="Q",D[D.R=82]="R",D[D.S=83]="S",D[D.T=84]="T",D[D.U=85]="U",D[D.V=86]="V",D[D.W=87]="W",D[D.X=88]="X",D[D.Y=89]="Y",D[D.Z=90]="Z",D[D.ampersand=38]="ampersand",D[D.asterisk=42]="asterisk",D[D.at=64]="at",D[D.backslash=92]="backslash",D[D.backtick=96]="backtick",D[D.bar=124]="bar",D[D.caret=94]="caret",D[D.closeBrace=125]="closeBrace",D[D.closeBracket=93]="closeBracket",D[D.closeParen=41]="closeParen",D[D.colon=58]="colon",D[D.comma=44]="comma",D[D.dot=46]="dot",D[D.doubleQuote=34]="doubleQuote",D[D.equals=61]="equals",D[D.exclamation=33]="exclamation",D[D.greaterThan=62]="greaterThan",D[D.hash=35]="hash",D[D.lessThan=60]="lessThan",D[D.minus=45]="minus",D[D.openBrace=123]="openBrace",D[D.openBracket=91]="openBracket",D[D.openParen=40]="openParen",D[D.percent=37]="percent",D[D.plus=43]="plus",D[D.question=63]="question",D[D.semicolon=59]="semicolon",D[D.singleQuote=39]="singleQuote",D[D.slash=47]="slash",D[D.tilde=126]="tilde",D[D.backspace=8]="backspace",D[D.formFeed=12]="formFeed",D[D.byteOrderMark=65279]="byteOrderMark",D[D.tab=9]="tab",D[D.verticalTab=11]="verticalTab",(x=e.Extension||(e.Extension={})).Ts=".ts",x.Tsx=".tsx",x.Dts=".d.ts",x.Js=".js",x.Jsx=".jsx",x.Json=".json",x.TsBuildInfo=".tsbuildinfo",x.Mjs=".mjs",x.Mts=".mts",x.Dmts=".d.mts",x.Cjs=".cjs",x.Cts=".cts",x.Dcts=".d.cts",(b=e.TransformFlags||(e.TransformFlags={}))[b.None=0]="None",b[b.ContainsTypeScript=1]="ContainsTypeScript",b[b.ContainsJsx=2]="ContainsJsx",b[b.ContainsESNext=4]="ContainsESNext",b[b.ContainsES2022=8]="ContainsES2022",b[b.ContainsES2021=16]="ContainsES2021",b[b.ContainsES2020=32]="ContainsES2020",b[b.ContainsES2019=64]="ContainsES2019",b[b.ContainsES2018=128]="ContainsES2018",b[b.ContainsES2017=256]="ContainsES2017",b[b.ContainsES2016=512]="ContainsES2016",b[b.ContainsES2015=1024]="ContainsES2015",b[b.ContainsGenerator=2048]="ContainsGenerator",b[b.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",b[b.ContainsTypeScriptClassSyntax=8192]="ContainsTypeScriptClassSyntax",b[b.ContainsLexicalThis=16384]="ContainsLexicalThis",b[b.ContainsRestOrSpread=32768]="ContainsRestOrSpread",b[b.ContainsObjectRestOrSpread=65536]="ContainsObjectRestOrSpread",b[b.ContainsComputedPropertyName=131072]="ContainsComputedPropertyName",b[b.ContainsBlockScopedBinding=262144]="ContainsBlockScopedBinding",b[b.ContainsBindingPattern=524288]="ContainsBindingPattern",b[b.ContainsYield=1048576]="ContainsYield",b[b.ContainsAwait=2097152]="ContainsAwait",b[b.ContainsHoistedDeclarationOrCompletion=4194304]="ContainsHoistedDeclarationOrCompletion",b[b.ContainsDynamicImport=8388608]="ContainsDynamicImport",b[b.ContainsClassFields=16777216]="ContainsClassFields",b[b.ContainsDecorators=33554432]="ContainsDecorators",b[b.ContainsPossibleTopLevelAwait=67108864]="ContainsPossibleTopLevelAwait",b[b.ContainsLexicalSuper=134217728]="ContainsLexicalSuper",b[b.ContainsUpdateExpressionForIdentifier=268435456]="ContainsUpdateExpressionForIdentifier",b[b.ContainsPrivateIdentifierInExpression=536870912]="ContainsPrivateIdentifierInExpression",b[b.HasComputedFlags=-2147483648]="HasComputedFlags",b[b.AssertTypeScript=1]="AssertTypeScript",b[b.AssertJsx=2]="AssertJsx",b[b.AssertESNext=4]="AssertESNext",b[b.AssertES2022=8]="AssertES2022",b[b.AssertES2021=16]="AssertES2021",b[b.AssertES2020=32]="AssertES2020",b[b.AssertES2019=64]="AssertES2019",b[b.AssertES2018=128]="AssertES2018",b[b.AssertES2017=256]="AssertES2017",b[b.AssertES2016=512]="AssertES2016",b[b.AssertES2015=1024]="AssertES2015",b[b.AssertGenerator=2048]="AssertGenerator",b[b.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",b[b.OuterExpressionExcludes=-2147483648]="OuterExpressionExcludes",b[b.PropertyAccessExcludes=-2147483648]="PropertyAccessExcludes",b[b.NodeExcludes=-2147483648]="NodeExcludes",b[b.ArrowFunctionExcludes=-2072174592]="ArrowFunctionExcludes",b[b.FunctionExcludes=-1937940480]="FunctionExcludes",b[b.ConstructorExcludes=-1937948672]="ConstructorExcludes",b[b.MethodOrAccessorExcludes=-2005057536]="MethodOrAccessorExcludes",b[b.PropertyExcludes=-2013249536]="PropertyExcludes",b[b.ClassExcludes=-2147344384]="ClassExcludes",b[b.ModuleExcludes=-1941676032]="ModuleExcludes",b[b.TypeExcludes=-2]="TypeExcludes",b[b.ObjectLiteralExcludes=-2147278848]="ObjectLiteralExcludes",b[b.ArrayLiteralOrCallOrNewExcludes=-2147450880]="ArrayLiteralOrCallOrNewExcludes",b[b.VariableDeclarationListExcludes=-2146893824]="VariableDeclarationListExcludes",b[b.ParameterExcludes=-2147483648]="ParameterExcludes",b[b.CatchClauseExcludes=-2147418112]="CatchClauseExcludes",b[b.BindingPatternExcludes=-2147450880]="BindingPatternExcludes",b[b.ContainsLexicalThisOrSuper=134234112]="ContainsLexicalThisOrSuper",b[b.PropertyNamePropagatingFlags=134234112]="PropertyNamePropagatingFlags",(h=e.SnippetKind||(e.SnippetKind={}))[h.TabStop=0]="TabStop",h[h.Placeholder=1]="Placeholder",h[h.Choice=2]="Choice",h[h.Variable=3]="Variable",(v=e.EmitFlags||(e.EmitFlags={}))[v.None=0]="None",v[v.SingleLine=1]="SingleLine",v[v.AdviseOnEmitNode=2]="AdviseOnEmitNode",v[v.NoSubstitution=4]="NoSubstitution",v[v.CapturesThis=8]="CapturesThis",v[v.NoLeadingSourceMap=16]="NoLeadingSourceMap",v[v.NoTrailingSourceMap=32]="NoTrailingSourceMap",v[v.NoSourceMap=48]="NoSourceMap",v[v.NoNestedSourceMaps=64]="NoNestedSourceMaps",v[v.NoTokenLeadingSourceMaps=128]="NoTokenLeadingSourceMaps",v[v.NoTokenTrailingSourceMaps=256]="NoTokenTrailingSourceMaps",v[v.NoTokenSourceMaps=384]="NoTokenSourceMaps",v[v.NoLeadingComments=512]="NoLeadingComments",v[v.NoTrailingComments=1024]="NoTrailingComments",v[v.NoComments=1536]="NoComments",v[v.NoNestedComments=2048]="NoNestedComments",v[v.HelperName=4096]="HelperName",v[v.ExportName=8192]="ExportName",v[v.LocalName=16384]="LocalName",v[v.InternalName=32768]="InternalName",v[v.Indented=65536]="Indented",v[v.NoIndentation=131072]="NoIndentation",v[v.AsyncFunctionBody=262144]="AsyncFunctionBody",v[v.ReuseTempVariableScope=524288]="ReuseTempVariableScope",v[v.CustomPrologue=1048576]="CustomPrologue",v[v.NoHoisting=2097152]="NoHoisting",v[v.HasEndOfDeclarationMarker=4194304]="HasEndOfDeclarationMarker",v[v.Iterator=8388608]="Iterator",v[v.NoAsciiEscaping=16777216]="NoAsciiEscaping",v[v.TypeScriptClassWrapper=33554432]="TypeScriptClassWrapper",v[v.NeverApplyImportHelper=67108864]="NeverApplyImportHelper",v[v.IgnoreSourceNewlines=134217728]="IgnoreSourceNewlines",v[v.Immutable=268435456]="Immutable",v[v.IndirectCall=536870912]="IndirectCall",(y=e.ExternalEmitHelpers||(e.ExternalEmitHelpers={}))[y.Extends=1]="Extends",y[y.Assign=2]="Assign",y[y.Rest=4]="Rest",y[y.Decorate=8]="Decorate",y[y.Metadata=16]="Metadata",y[y.Param=32]="Param",y[y.Awaiter=64]="Awaiter",y[y.Generator=128]="Generator",y[y.Values=256]="Values",y[y.Read=512]="Read",y[y.SpreadArray=1024]="SpreadArray",y[y.Await=2048]="Await",y[y.AsyncGenerator=4096]="AsyncGenerator",y[y.AsyncDelegator=8192]="AsyncDelegator",y[y.AsyncValues=16384]="AsyncValues",y[y.ExportStar=32768]="ExportStar",y[y.ImportStar=65536]="ImportStar",y[y.ImportDefault=131072]="ImportDefault",y[y.MakeTemplateObject=262144]="MakeTemplateObject",y[y.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",y[y.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",y[y.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",y[y.CreateBinding=4194304]="CreateBinding",y[y.FirstEmitHelper=1]="FirstEmitHelper",y[y.LastEmitHelper=4194304]="LastEmitHelper",y[y.ForOfIncludes=256]="ForOfIncludes",y[y.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",y[y.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",y[y.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",y[y.SpreadIncludes=1536]="SpreadIncludes",(m=e.EmitHint||(e.EmitHint={}))[m.SourceFile=0]="SourceFile",m[m.Expression=1]="Expression",m[m.IdentifierName=2]="IdentifierName",m[m.MappedTypeParameter=3]="MappedTypeParameter",m[m.Unspecified=4]="Unspecified",m[m.EmbeddedStatement=5]="EmbeddedStatement",m[m.JsxAttributeValue=6]="JsxAttributeValue",(g=e.OuterExpressionKinds||(e.OuterExpressionKinds={}))[g.Parentheses=1]="Parentheses",g[g.TypeAssertions=2]="TypeAssertions",g[g.NonNullAssertions=4]="NonNullAssertions",g[g.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",g[g.Assertions=6]="Assertions",g[g.All=15]="All",g[g.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",(f=e.LexicalEnvironmentFlags||(e.LexicalEnvironmentFlags={}))[f.None=0]="None",f[f.InParameters=1]="InParameters",f[f.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",(p=e.BundleFileSectionKind||(e.BundleFileSectionKind={})).Prologue="prologue",p.EmitHelpers="emitHelpers",p.NoDefaultLib="no-default-lib",p.Reference="reference",p.Type="type",p.TypeResolutionModeRequire="type-require",p.TypeResolutionModeImport="type-import",p.Lib="lib",p.Prepend="prepend",p.Text="text",p.Internal="internal",(d=e.ListFormat||(e.ListFormat={}))[d.None=0]="None",d[d.SingleLine=0]="SingleLine",d[d.MultiLine=1]="MultiLine",d[d.PreserveLines=2]="PreserveLines",d[d.LinesMask=3]="LinesMask",d[d.NotDelimited=0]="NotDelimited",d[d.BarDelimited=4]="BarDelimited",d[d.AmpersandDelimited=8]="AmpersandDelimited",d[d.CommaDelimited=16]="CommaDelimited",d[d.AsteriskDelimited=32]="AsteriskDelimited",d[d.DelimitersMask=60]="DelimitersMask",d[d.AllowTrailingComma=64]="AllowTrailingComma",d[d.Indented=128]="Indented",d[d.SpaceBetweenBraces=256]="SpaceBetweenBraces",d[d.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",d[d.Braces=1024]="Braces",d[d.Parenthesis=2048]="Parenthesis",d[d.AngleBrackets=4096]="AngleBrackets",d[d.SquareBrackets=8192]="SquareBrackets",d[d.BracketsMask=15360]="BracketsMask",d[d.OptionalIfUndefined=16384]="OptionalIfUndefined",d[d.OptionalIfEmpty=32768]="OptionalIfEmpty",d[d.Optional=49152]="Optional",d[d.PreferNewLine=65536]="PreferNewLine",d[d.NoTrailingNewLine=131072]="NoTrailingNewLine",d[d.NoInterveningComments=262144]="NoInterveningComments",d[d.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",d[d.SingleElement=1048576]="SingleElement",d[d.SpaceAfterList=2097152]="SpaceAfterList",d[d.Modifiers=2359808]="Modifiers",d[d.HeritageClauses=512]="HeritageClauses",d[d.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",d[d.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",d[d.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",d[d.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",d[d.UnionTypeConstituents=516]="UnionTypeConstituents",d[d.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",d[d.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",d[d.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",d[d.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",d[d.ImportClauseEntries=526226]="ImportClauseEntries",d[d.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",d[d.CommaListElements=528]="CommaListElements",d[d.CallExpressionArguments=2576]="CallExpressionArguments",d[d.NewExpressionArguments=18960]="NewExpressionArguments",d[d.TemplateExpressionSpans=262144]="TemplateExpressionSpans",d[d.SingleLineBlockStatements=768]="SingleLineBlockStatements",d[d.MultiLineBlockStatements=129]="MultiLineBlockStatements",d[d.VariableDeclarationList=528]="VariableDeclarationList",d[d.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",d[d.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",d[d.ClassHeritageClauses=0]="ClassHeritageClauses",d[d.ClassMembers=129]="ClassMembers",d[d.InterfaceMembers=129]="InterfaceMembers",d[d.EnumMembers=145]="EnumMembers",d[d.CaseBlockClauses=129]="CaseBlockClauses",d[d.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",d[d.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",d[d.JsxElementAttributes=262656]="JsxElementAttributes",d[d.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",d[d.HeritageClauseTypes=528]="HeritageClauseTypes",d[d.SourceFileStatements=131073]="SourceFileStatements",d[d.Decorators=2146305]="Decorators",d[d.TypeArguments=53776]="TypeArguments",d[d.TypeParameters=53776]="TypeParameters",d[d.Parameters=2576]="Parameters",d[d.IndexSignatureParameters=8848]="IndexSignatureParameters",d[d.JSDocComment=33]="JSDocComment",(_=e.PragmaKindFlags||(e.PragmaKindFlags={}))[_.None=0]="None",_[_.TripleSlashXML=1]="TripleSlashXML",_[_.SingleLine=2]="SingleLine",_[_.MultiLine=4]="MultiLine",_[_.All=7]="All",_[_.Default=7]="Default",e.commentPragmas={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}};}(t),function(e){function t(e){for(var t=5381,r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r);return t.toString()}var r,n;function a(t,r){return t.getModifiedTime(r)||e.missingFileModifiedTime}function o(e){var t;return (t={})[n.Low]=e.Low,t[n.Medium]=e.Medium,t[n.High]=e.High,t}e.generateDjb2Hash=t,e.setStackTraceLimit=function(){Error.stackTraceLimit<100&&(Error.stackTraceLimit=100);},function(e){e[e.Created=0]="Created",e[e.Changed=1]="Changed",e[e.Deleted=2]="Deleted";}(r=e.FileWatcherEventKind||(e.FileWatcherEventKind={})),function(e){e[e.High=2e3]="High",e[e.Medium=500]="Medium",e[e.Low=250]="Low";}(n=e.PollingInterval||(e.PollingInterval={})),e.missingFileModifiedTime=new Date(0),e.getModifiedTime=a;var s={Low:32,Medium:64,High:256},c=o(s);function l(e,t,r,n,i){for(var o=r,s=t.length;n&&s;++r===t.length&&(o<r&&(t.length=o),r=0,o=0),s--){var c=t[r];if(c)if(c.isClosed)t[r]=void 0;else {n--;var l=p(c,a(e,c.fileName));c.isClosed?t[r]=void 0:(null==i||i(c,r,l),t[r]&&(o<r&&(t[o]=c,t[r]=void 0),o++));}}return r}function u(t){var r=[],i=[],o=_(n.Low),s=_(n.Medium),u=_(n.High);return function(n,i,o){var s={fileName:n,callback:i,unchangedPolls:0,mtime:a(t,n)};return r.push(s),m(s,o),{close:function(){s.isClosed=!0,e.unorderedRemoveItem(r,s);}}};function _(e){var t=[];return t.pollingInterval=e,t.pollIndex=0,t.pollScheduled=!1,t}function d(t){t.pollIndex=f(t,t.pollingInterval,t.pollIndex,c[t.pollingInterval]),t.length?v(t.pollingInterval):(e.Debug.assert(0===t.pollIndex),t.pollScheduled=!1);}function p(e){f(i,n.Low,0,i.length),d(e),!e.pollScheduled&&i.length&&v(n.Low);}function f(r,a,o,s){return l(t,r,o,s,(function(t,o,s){var c;s?(t.unchangedPolls=0,r!==i&&(r[o]=void 0,c=t,i.push(c),y(n.Low))):t.unchangedPolls!==e.unchangedPollThresholds[a]?t.unchangedPolls++:r===i?(t.unchangedPolls=1,r[o]=void 0,m(t,n.Low)):a!==n.High&&(t.unchangedPolls++,r[o]=void 0,m(t,a===n.Low?n.Medium:n.High));}))}function g(e){switch(e){case n.Low:return o;case n.Medium:return s;case n.High:return u}}function m(e,t){g(t).push(e),y(t);}function y(e){g(e).pollScheduled||v(e);}function v(e){g(e).pollScheduled=t.setTimeout(e===n.Low?p:d,e,g(e));}}function _(t){var r,i=[],o=0;return function(r,n){var o={fileName:r,callback:n,mtime:a(t,r)};return i.push(o),u(),{close:function(){o.isClosed=!0,e.unorderedRemoveItem(i,o);}}};function s(){r=void 0,o=l(t,i,o,c[n.Low]),u();}function u(){i.length&&!r&&(r=t.setTimeout(s,n.High));}}function d(t,r,n,i,a){var o=e.createGetCanonicalFileName(r)(n),s=t.get(o);return s?s.callbacks.push(i):t.set(o,{watcher:a((function(e,r,n){var i;return null===(i=t.get(o))||void 0===i?void 0:i.callbacks.slice().forEach((function(t){return t(e,r,n)}))})),callbacks:[i]}),{close:function(){var r=t.get(o);r&&e.orderedRemoveItem(r.callbacks,i)&&!r.callbacks.length&&(t.delete(o),e.closeFileWatcherOf(r));}}}function p(e,t){var r=e.mtime.getTime(),n=t.getTime();return r!==n&&(e.mtime=t,e.callback(e.fileName,f(r,n),t),!0)}function f(e,t){return 0===e?r.Created:0===t?r.Deleted:r.Changed}e.unchangedPollThresholds=o(s),e.getFileWatcherEventKind=f,e.ignoredPaths=["/node_modules/.","/.git","/.#"];var g,m,y=e.noop;function v(e){return y(e)}function h(t){var r,n=t.watchDirectory,i=t.useCaseSensitiveFileNames,a=t.getCurrentDirectory,o=t.getAccessibleSortedChildDirectories,s=t.fileSystemEntryExists,c=t.realpath,l=t.setTimeout,u=t.clearTimeout,_=new e.Map,d=e.createMultiMap(),p=new e.Map,f=e.getStringComparer(!i),g=e.createGetCanonicalFileName(i);return function(e,t,r,i){return r?m(e,i,t):n(e,t,r,i)};function m(t,i,a){var o=g(t),c=_.get(o);c?c.refCount++:(c={watcher:n(t,(function(e){S(e,i)||((null==i?void 0:i.synchronousWatchDirectory)?(y(o,e),D(t,o,i)):function(e,t,n,i){var a=_.get(t);a&&s(e,1)?function(e,t,n,i){var a=p.get(t);a?a.fileNames.push(n):p.set(t,{dirName:e,options:i,fileNames:[n]}),r&&(u(r),r=void 0),r=l(h,1e3);}(e,t,n,i):(y(t,n),x(a));}(t,o,e,i));}),!1,i),refCount:1,childWatches:e.emptyArray},_.set(o,c),D(t,o,i));var f=a&&{dirName:t,callback:a};return f&&d.add(o,f),{dirName:t,close:function(){var t=e.Debug.checkDefined(_.get(o));f&&d.remove(o,f),t.refCount--,t.refCount||(_.delete(o),e.closeFileWatcherOf(t),t.childWatches.forEach(e.closeFileWatcher));}}}function y(t,r,n){var i,a;e.isString(r)?i=r:a=r,d.forEach((function(r,o){var s;if((!a||!0!==a.get(o))&&(o===t||e.startsWith(t,o)&&t[o.length]===e.directorySeparator))if(a)if(n){var c=a.get(o);c?(s=c).push.apply(s,n):a.set(o,n.slice());}else a.set(o,!0);else r.forEach((function(e){return (0, e.callback)(i)}));}));}function h(){r=void 0,v("sysLog:: onTimerToUpdateChildWatches:: ".concat(p.size));for(var t=e.timestamp(),n=new e.Map;!r&&p.size;){var i=p.entries().next();e.Debug.assert(!i.done);var a=i.value,o=a[0],s=a[1],c=s.dirName,l=s.options,u=s.fileNames;p.delete(o);var _=D(c,o,l);y(o,n,_?void 0:u);}v("sysLog:: invokingWatchers:: Elapsed:: ".concat(e.timestamp()-t,"ms:: ").concat(p.size)),d.forEach((function(t,r){var i=n.get(r);i&&t.forEach((function(t){var r=t.callback,n=t.dirName;e.isArray(i)?i.forEach(r):r(n);}));}));var f=e.timestamp()-t;v("sysLog:: Elapsed:: ".concat(f,"ms:: onTimerToUpdateChildWatches:: ").concat(p.size," ").concat(r));}function x(t){if(t){var r=t.childWatches;t.childWatches=e.emptyArray;for(var n=0,i=r;n<i.length;n++){var a=i[n];a.close(),x(_.get(g(a.dirName)));}}}function D(t,r,n){var i,a=_.get(r);if(!a)return !1;var l=e.enumerateInsertsAndDeletes(s(t,1)?e.mapDefined(o(t),(function(r){var i=e.getNormalizedAbsolutePath(r,t);return S(i,n)||0!==f(i,e.normalizePath(c(i)))?void 0:i})):e.emptyArray,a.childWatches,(function(e,t){return f(e,t.dirName)}),(function(e){u(m(e,n));}),e.closeFileWatcher,u);return a.childWatches=i||e.emptyArray,l;function u(e){(i||(i=[])).push(e);}}function S(t,r){return e.some(e.ignoredPaths,(function(r){return function(t,r){return !!e.stringContains(t,r)||!i&&e.stringContains(g(t),r)}(t,r)}))||b(t,r,i,a)}}function b(t,r,n,i){return ((null==r?void 0:r.excludeDirectories)||(null==r?void 0:r.excludeFiles))&&(e.matchesExclude(t,null==r?void 0:r.excludeFiles,n,i())||e.matchesExclude(t,null==r?void 0:r.excludeDirectories,n,i()))}function x(t,r,n,i,a){return function(o,s){if("rename"===o){var c=s?e.normalizePath(e.combinePaths(t,s)):t;s&&b(c,n,i,a)||r(c);}}}function D(t){var i,a,o,s,c=t.pollingWatchFileWorker,l=t.getModifiedTime,p=t.setTimeout,f=t.clearTimeout,g=t.fsWatchWorker,m=t.fileSystemEntryExists,y=t.useCaseSensitiveFileNames,v=t.getCurrentDirectory,b=t.fsSupportsRecursiveFsWatch,D=t.getAccessibleSortedChildDirectories,S=t.realpath,T=t.tscWatchFile,C=t.useNonPollingWatchers,E=t.tscWatchDirectory,k=t.inodeWatching,N=t.sysLog,A=new e.Map,F=new e.Map,P=new e.Map,w=!1;return {watchFile:I,watchDirectory:function(t,r,i,a){return b?j(t,1,x(t,r,a,y,v),i,n.Medium,e.getFallbackOptions(a)):(s||(s=h({useCaseSensitiveFileNames:y,getCurrentDirectory:v,fileSystemEntryExists:m,getAccessibleSortedChildDirectories:D,watchDirectory:R,realpath:S,setTimeout:p,clearTimeout:f})),s(t,r,i,a))}};function I(t,i,a,s){s=function(t,r){if(t&&void 0!==t.watchFile)return t;switch(T){case"PriorityPollingInterval":return {watchFile:e.WatchFileKind.PriorityPollingInterval};case"DynamicPriorityPolling":return {watchFile:e.WatchFileKind.DynamicPriorityPolling};case"UseFsEvents":return L(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.PriorityInterval,t);case"UseFsEventsWithFallbackDynamicPolling":return L(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.DynamicPriority,t);case"UseFsEventsOnParentDirectory":r=!0;default:return r?L(e.WatchFileKind.UseFsEventsOnParentDirectory,e.PollingWatchKind.PriorityInterval,t):{watchFile:e.WatchFileKind.UseFsEvents}}}(s,C);var c=e.Debug.checkDefined(s.watchFile);switch(c){case e.WatchFileKind.FixedPollingInterval:return B(t,i,n.Low,void 0);case e.WatchFileKind.PriorityPollingInterval:return B(t,i,a,void 0);case e.WatchFileKind.DynamicPriorityPolling:return O()(t,i,a,void 0);case e.WatchFileKind.FixedChunkSizePolling:return M()(t,i,void 0,void 0);case e.WatchFileKind.UseFsEvents:return j(t,0,function(t,n,i){return function(a,o,s){"rename"===a?(s||(s=i(t)||e.missingFileModifiedTime),n(t,s!==e.missingFileModifiedTime?r.Created:r.Deleted,s)):n(t,r.Changed,s);}}(t,i,l),!1,a,e.getFallbackOptions(s));case e.WatchFileKind.UseFsEventsOnParentDirectory:return o||(o=function(t,i){var a=e.createMultiMap(),o=new e.Map,s=e.createGetCanonicalFileName(i);return function(i,c,l,u){var _=s(i);a.add(_,c);var d=e.getDirectoryPath(_)||".",p=o.get(d)||function(i,c,l){var u=t(i,1,(function(t,n,o){if(e.isString(n)){var c=e.getNormalizedAbsolutePath(n,i),l=c&&a.get(s(c));if(l)for(var u=0,_=l;u<_.length;u++)(0, _[u])(c,r.Changed,o);}}),!1,n.Medium,l);return u.referenceCount=0,o.set(c,u),u}(e.getDirectoryPath(i)||".",d,u);return p.referenceCount++,{close:function(){1===p.referenceCount?(p.close(),o.delete(d)):p.referenceCount--,a.remove(_,c);}}}}(j,y)),o(t,i,a,e.getFallbackOptions(s));default:e.Debug.assertNever(c);}}function O(){return i||(i=u({getModifiedTime:l,setTimeout:p}))}function M(){return a||(a=_({getModifiedTime:l,setTimeout:p}))}function L(e,t,r){var n=null==r?void 0:r.fallbackPolling;return {watchFile:e,fallbackPolling:void 0===n?t:n}}function R(t,r,i,a){e.Debug.assert(!i);var o=function(t){if(t&&void 0!==t.watchDirectory)return t;switch(E){case"RecursiveDirectoryUsingFsWatchFile":return {watchDirectory:e.WatchDirectoryKind.FixedPollingInterval};case"RecursiveDirectoryUsingDynamicPriorityPolling":return {watchDirectory:e.WatchDirectoryKind.DynamicPriorityPolling};default:var r=null==t?void 0:t.fallbackPolling;return {watchDirectory:e.WatchDirectoryKind.UseFsEvents,fallbackPolling:void 0!==r?r:void 0}}}(a),s=e.Debug.checkDefined(o.watchDirectory);switch(s){case e.WatchDirectoryKind.FixedPollingInterval:return B(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.DynamicPriorityPolling:return O()(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.FixedChunkSizePolling:return M()(t,(function(){return r(t)}),void 0,void 0);case e.WatchDirectoryKind.UseFsEvents:return j(t,1,x(t,r,a,y,v),i,n.Medium,e.getFallbackOptions(o));default:e.Debug.assertNever(s);}}function B(e,t,r,n){return d(A,y,e,t,(function(t){return c(e,t,r,n)}))}function j(t,n,i,a,o,s){return d(a?P:F,y,t,i,(function(i){return function(t,n,i,a,o,s){var c,u;k&&(c=t.substring(t.lastIndexOf(e.directorySeparator)),u=c.slice(e.directorySeparator.length));var _=m(t,n)?p():v();return {close:function(){_&&(_.close(),_=void 0);}};function d(e){_&&(N("sysLog:: ".concat(t,":: Changing watcher to ").concat(e===p?"Present":"Missing","FileSystemEntryWatcher")),_.close(),_=e());}function p(){if(w)return N("sysLog:: ".concat(t,":: Defaulting to watchFile")),y();try{var e=g(t,a,k?f:i);return e.on("error",(function(){i("rename",""),d(v);})),e}catch(e){return w||(w="ENOSPC"===e.code),N("sysLog:: ".concat(t,":: Changing to watchFile")),y()}}function f(r,n){var a;if(n&&e.endsWith(n,"~")&&(a=n,n=n.slice(0,n.length-1)),"rename"!==r||n&&n!==u&&!e.endsWith(n,c))a&&i(r,a),i(r,n);else {var o=l(t)||e.missingFileModifiedTime;a&&i(r,a,o),i(r,n,o),k?d(o===e.missingFileModifiedTime?v:p):o===e.missingFileModifiedTime&&d(v);}}function y(){return I(t,function(e){return function(t,n,i){return e(n===r.Changed?"change":"rename","",i)}}(i),o,s)}function v(){return I(t,(function(n,a,o){a===r.Created&&(o||(o=l(t)||e.missingFileModifiedTime),o!==e.missingFileModifiedTime&&(i("rename","",o),d(p)));}),o,s)}}(t,n,i,a,o,s)}))}}function S(t){var r=t.writeFile;t.writeFile=function(n,i,a){return e.writeFileEnsuringDirectories(n,i,!!a,(function(e,n,i){return r.call(t,e,n,i)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)}))};}function T(){if("undefined"!=typeof process){var e=process.version;if(e){var t=e.indexOf(".");if(-1!==t)return parseInt(e.substring(1,t))}}}e.sysLog=v,e.setSysLog=function(e){y=e;},(m=e.FileSystemEntryKind||(e.FileSystemEntryKind={}))[m.File=0]="File",m[m.Directory=1]="Directory",e.createSystemWatchFunctions=D,e.patchWriteFileEnsuringDirectory=S,e.getNodeMajorVersion=T,e.sys=("undefined"!=typeof process&&process.nextTick&&!process.browser&&"undefined"!=typeof require&&(g=function(){var n,o=require("fs"),s=require("path"),c=require("os");try{n=require("crypto");}catch(e){n=void 0;}var l,_=require("buffer").Buffer,d=T()>=4,p="linux"===process.platform||"darwin"===process.platform,f=c.platform(),g="win32"!==f&&"win64"!==f&&!F((l=__filename,l.replace(/\w/g,(function(e){var t=e.toUpperCase();return e===t?e.toLowerCase():t})))),m=o.realpathSync.native?"win32"===process.platform?function(e){return e.length<260?o.realpathSync.native(e):o.realpathSync(e)}:o.realpathSync.native:o.realpathSync,y=d&&("win32"===process.platform||"darwin"===process.platform),h=e.memoize((function(){return process.cwd()})),b=D({pollingWatchFileWorker:function(e,t,n){var i;return o.watchFile(e,{persistent:!0,interval:n},a),{close:function(){return o.unwatchFile(e,a)}};function a(n,a){var o=0==+a.mtime||i===r.Deleted;if(0==+n.mtime){if(o)return;i=r.Deleted;}else if(o)i=r.Created;else {if(+n.mtime==+a.mtime)return;i=r.Changed;}t(e,i,n.mtime);}},getModifiedTime:w,setTimeout,clearTimeout,fsWatchWorker:function(e,t,r){return o.watch(e,y?{persistent:!0,recursive:!!t}:{persistent:!0},r)},useCaseSensitiveFileNames:g,getCurrentDirectory:h,fileSystemEntryExists:A,fsSupportsRecursiveFsWatch:y,getAccessibleSortedChildDirectories:function(e){return N(e).directories},realpath:P,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,inodeWatching:p,sysLog:v}),x=b.watchFile,S=b.watchDirectory,C={args:process.argv.slice(2),newLine:c.EOL,useCaseSensitiveFileNames:g,write:function(e){process.stdout.write(e);},getWidthOfTerminal:function(){return process.stdout.columns},writeOutputIsTTY:function(){return process.stdout.isTTY},readFile:function(t,r){e.perfLogger.logStartReadFile(t);var n=function(e,t){var r;try{r=o.readFileSync(e);}catch(e){return}var n=r.length;if(n>=2&&254===r[0]&&255===r[1]){n&=-2;for(var i=0;i<n;i+=2){var a=r[i];r[i]=r[i+1],r[i+1]=a;}return r.toString("utf16le",2)}return n>=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):n>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")}(t);return e.perfLogger.logStopReadFile(),n},writeFile:function(t,r,n){var i;e.perfLogger.logEvent("WriteFile: "+t),n&&(r="\ufeff"+r);try{i=o.openSync(t,"w"),o.writeSync(i,r,void 0,"utf8");}finally{void 0!==i&&o.closeSync(i);}},watchFile:x,watchDirectory:S,resolvePath:function(e){return s.resolve(e)},fileExists:F,directoryExists:function(e){return A(e,1)},createDirectory:function(e){if(!C.directoryExists(e))try{o.mkdirSync(e);}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:function(){return __filename},getCurrentDirectory:h,getDirectories:function(e){return N(e).directories.slice()},getEnvironmentVariable:function(e){return process.env[e]||""},readDirectory:function(t,r,n,i,a){return e.matchFiles(t,r,n,i,g,process.cwd(),a,N,P)},getModifiedTime:w,setModifiedTime:function(e,t){try{o.utimesSync(e,t,t);}catch(e){return}},deleteFile:function(e){try{return o.unlinkSync(e)}catch(e){return}},createHash:n?I:t,createSHA256Hash:n?I:void 0,getMemoryUsage:function(){return global.gc&&global.gc(),process.memoryUsage().heapUsed},getFileSize:function(e){try{var t=E(e);if(null==t?void 0:t.isFile())return t.size}catch(e){}return 0},exit:function(t){!function(t){t();}((function(){return process.exit(t)}));},cpuProfilingEnabled:function(){return e.contains(process.execArgv,"--cpu-prof")||e.contains(process.execArgv,"--prof")},realpath:P,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||e.some(process.execArgv,(function(e){return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(e)})),tryEnableSourceMapsForHost:function(){try{require("source-map-support").install();}catch(e){}},setTimeout,clearTimeout,clearScreen:function(){process.stdout.write("c");},setBlocking:function(){process.stdout&&process.stdout._handle&&process.stdout._handle.setBlocking&&process.stdout._handle.setBlocking(!0);},bufferFrom:k,base64decode:function(e){return k(e,"base64").toString("utf8")},base64encode:function(e){return k(e).toString("base64")},require:function(t,r){try{var n=e.resolveJSModule(r,t,C);return {module:require(n),modulePath:n,error:void 0}}catch(e){return {module:void 0,modulePath:void 0,error:e}}}};return C;function E(e){return o.statSync(e,{throwIfNoEntry:!1})}function k(e,t){return _.from&&_.from!==Int8Array.from?_.from(e,t):new _(e,t)}function N(t){e.perfLogger.logEvent("ReadDir: "+(t||"."));try{for(var r=o.readdirSync(t||".",{withFileTypes:!0}),n=[],i=[],a=0,s=r;a<s.length;a++){var c=s[a],l="string"==typeof c?c:c.name;if("."!==l&&".."!==l){var u=void 0;if("string"==typeof c||c.isSymbolicLink()){var _=e.combinePaths(t,l);try{if(!(u=E(_)))continue}catch(e){continue}}else u=c;u.isFile()?n.push(l):u.isDirectory()&&i.push(l);}}return n.sort(),i.sort(),{files:n,directories:i}}catch(t){return e.emptyFileSystemEntries}}function A(e,t){var r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{var n=E(e);if(!n)return !1;switch(t){case 0:return n.isFile();case 1:return n.isDirectory();default:return !1}}catch(e){return !1}finally{Error.stackTraceLimit=r;}}function F(e){return A(e,0)}function P(e){try{return m(e)}catch(t){return e}}function w(e){var t,r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return null===(t=E(e))||void 0===t?void 0:t.mtime}catch(e){return}finally{Error.stackTraceLimit=r;}}function I(e){var t=n.createHash("sha256");return t.update(e),t.digest("hex")}}()),g&&S(g),g),e.setSys=function(t){e.sys=t;},e.sys&&e.sys.getEnvironmentVariable&&(function(t){if(t.getEnvironmentVariable){var r=function(e,t){var r=a("TSC_WATCH_POLLINGINTERVAL");return !!r&&(n("Low"),n("Medium"),n("High"),!0);function n(e){t[e]=r[e]||t[e];}}(0,n);c=l("TSC_WATCH_POLLINGCHUNKSIZE",s)||c,e.unchangedPollThresholds=l("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS",s)||e.unchangedPollThresholds;}function a(e){var r;return n("Low"),n("Medium"),n("High"),r;function n(n){var i=function(e,r){return t.getEnvironmentVariable("".concat(e,"_").concat(r.toUpperCase()))}(e,n);i&&((r||(r={}))[n]=Number(i));}}function l(e,t){var n=a(e);return (r||n)&&o(n?i$1(i$1({},t),n):t)}}(e.sys),e.Debug.setAssertionLevel(/^development$/i.test(e.sys.getEnvironmentVariable("NODE_ENV"))?1:0)),e.sys&&e.sys.debugMode&&(e.Debug.isDebugging=!0);}(t),function(e){e.directorySeparator="/",e.altDirectorySeparator="\\";var t=/\\/g;function r(e){return 47===e||92===e}function i(e){return u(e)>0}function a(e){return 0!==u(e)}function o(e){return /^\.\.?($|[\\/])/.test(e)}function s(t,r){return t.length>r.length&&e.endsWith(t,r)}function c(e){return e.length>0&&r(e.charCodeAt(e.length-1))}function l(e){return e>=97&&e<=122||e>=65&&e<=90}function u(t){if(!t)return 0;var r=t.charCodeAt(0);if(47===r||92===r){if(t.charCodeAt(1)!==r)return 1;var n=t.indexOf(47===r?e.directorySeparator:e.altDirectorySeparator,2);return n<0?t.length:n+1}if(l(r)&&58===t.charCodeAt(1)){var i=t.charCodeAt(2);if(47===i||92===i)return 3;if(2===t.length)return 2}var a=t.indexOf("://");if(-1!==a){var o=a+"://".length,s=t.indexOf(e.directorySeparator,o);if(-1!==s){var c=t.slice(0,a),u=t.slice(o,s);if("file"===c&&(""===u||"localhost"===u)&&l(t.charCodeAt(s+1))){var _=function(e,t){var r=e.charCodeAt(t);if(58===r)return t+1;if(37===r&&51===e.charCodeAt(t+1)){var n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return -1}(t,s+2);if(-1!==_){if(47===t.charCodeAt(_))return ~(_+1);if(_===t.length)return ~_}}return ~(s+1)}return ~t.length}return 0}function _(e){var t=u(e);return t<0?~t:t}function d(t){var r=_(t=v(t));return r===t.length?t:(t=C(t)).slice(0,Math.max(r,t.lastIndexOf(e.directorySeparator)))}function p(t,r,n){if(_(t=v(t))===t.length)return "";var i=(t=C(t)).slice(Math.max(_(t),t.lastIndexOf(e.directorySeparator)+1)),a=void 0!==r&&void 0!==n?g(i,r,n):void 0;return a?i.slice(0,i.length-a.length):i}function f(t,r,n){if(e.startsWith(r,".")||(r="."+r),t.length>=r.length&&46===t.charCodeAt(t.length-r.length)){var i=t.slice(t.length-r.length);if(n(i,r))return i}}function g(t,r,n){if(r)return function(e,t,r){if("string"==typeof t)return f(e,t,r)||"";for(var n=0,i=t;n<i.length;n++){var a=f(e,i[n],r);if(a)return a}return ""}(C(t),r,n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive);var i=p(t),a=i.lastIndexOf(".");return a>=0?i.substring(a):""}function m(t,r){return void 0===r&&(r=""),function(t,r){var i=t.substring(0,r),a=t.substring(r).split(e.directorySeparator);return a.length&&!e.lastOrUndefined(a)&&a.pop(),n$4([i],a,!0)}(t=b(r,t),_(t))}function y(t){return 0===t.length?"":(t[0]&&E(t[0]))+t.slice(1).join(e.directorySeparator)}function v(r){return -1!==r.indexOf("\\")?r.replace(t,e.directorySeparator):r}function h(t){if(!e.some(t))return [];for(var r=[t[0]],n=1;n<t.length;n++){var i=t[n];if(i&&"."!==i){if(".."===i)if(r.length>1){if(".."!==r[r.length-1]){r.pop();continue}}else if(r[0])continue;r.push(i);}}return r}function b(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e&&(e=v(e));for(var n=0,i=t;n<i.length;n++){var a=i[n];a&&(a=v(a),e=e&&0===_(a)?E(e)+a:a);}return e}function x(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return T(e.some(r)?b.apply(void 0,n$4([t],r,!1)):v(t))}function D(e,t){return h(m(e,t))}function S(e,t){return y(D(e,t))}function T(e){if(e=v(e),!N.test(e))return e;var t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!N.test(e)))return e;var r=y(h(m(e)));return r&&c(e)?E(r):r}function C(e){return c(e)?e.substr(0,e.length-1):e}function E(t){return c(t)?t:t+e.directorySeparator}function k(e){return a(e)||o(e)?e:"./"+e}e.isAnyDirectorySeparator=r,e.isUrl=function(e){return u(e)<0},e.isRootedDiskPath=i,e.isDiskPathRoot=function(e){var t=u(e);return t>0&&t===e.length},e.pathIsAbsolute=a,e.pathIsRelative=o,e.pathIsBareSpecifier=function(e){return !a(e)&&!o(e)},e.hasExtension=function(t){return e.stringContains(p(t),".")},e.fileExtensionIs=s,e.fileExtensionIsOneOf=function(e,t){for(var r=0,n=t;r<n.length;r++)if(s(e,n[r]))return !0;return !1},e.hasTrailingDirectorySeparator=c,e.getRootLength=_,e.getDirectoryPath=d,e.getBaseFileName=p,e.getAnyExtensionFromPath=g,e.getPathComponents=m,e.getPathFromPathComponents=y,e.normalizeSlashes=v,e.reducePathComponents=h,e.combinePaths=b,e.resolvePath=x,e.getNormalizedPathComponents=D,e.getNormalizedAbsolutePath=S,e.normalizePath=T,e.getNormalizedAbsolutePathWithoutRoot=function(t,r){return 0===(n=D(t,r)).length?"":n.slice(1).join(e.directorySeparator);var n;},e.toPath=function(e,t,r){return r(i(e)?T(e):S(e,t))},e.removeTrailingDirectorySeparator=C,e.ensureTrailingDirectorySeparator=E,e.ensurePathIsNonModuleName=k,e.changeAnyExtension=function(t,r,n,i){var a=void 0!==n&&void 0!==i?g(t,n,i):g(t);return a?t.slice(0,t.length-a.length)+(e.startsWith(r,".")?r:"."+r):t};var N=/(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;function A(t,r,n){if(t===r)return 0;if(void 0===t)return -1;if(void 0===r)return 1;var i=t.substring(0,_(t)),a=r.substring(0,_(r)),o=e.compareStringsCaseInsensitive(i,a);if(0!==o)return o;var s=t.substring(i.length),c=r.substring(a.length);if(!N.test(s)&&!N.test(c))return n(s,c);for(var l=h(m(t)),u=h(m(r)),d=Math.min(l.length,u.length),p=1;p<d;p++){var f=n(l[p],u[p]);if(0!==f)return f}return e.compareValues(l.length,u.length)}function F(t,r,i,a){var o,s=h(m(t)),c=h(m(r));for(o=0;o<s.length&&o<c.length;o++){var l=a(s[o]),u=a(c[o]);if(!(0===o?e.equateStringsCaseInsensitive:i)(l,u))break}if(0===o)return c;for(var _=c.slice(o),d=[];o<s.length;o++)d.push("..");return n$4(n$4([""],d,!0),_,!0)}function P(t,r,n){e.Debug.assert(_(t)>0==_(r)>0,"Paths must either both be absolute or both be relative");var i="function"==typeof n?n:e.identity;return y(F(t,r,"boolean"==typeof n&&n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,i))}function w(t,r,n,a,o){var s=F(x(n,t),x(n,r),e.equateStringsCaseSensitive,a),c=s[0];if(o&&i(c)){var l=c.charAt(0)===e.directorySeparator?"file://":"file:///";s[0]=l+c;}return y(s)}e.comparePathsCaseSensitive=function(t,r){return A(t,r,e.compareStringsCaseSensitive)},e.comparePathsCaseInsensitive=function(t,r){return A(t,r,e.compareStringsCaseInsensitive)},e.comparePaths=function(t,r,n,i){return "string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),A(t,r,e.getStringComparer(i))},e.containsPath=function(t,r,n,i){if("string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),void 0===t||void 0===r)return !1;if(t===r)return !0;var a=h(m(t)),o=h(m(r));if(o.length<a.length)return !1;for(var s=i?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,c=0;c<a.length;c++)if(!(0===c?e.equateStringsCaseInsensitive:s)(a[c],o[c]))return !1;return !0},e.startsWithDirectory=function(t,r,n){var i=n(t),a=n(r);return e.startsWith(i,a+"/")||e.startsWith(i,a+"\\")},e.getPathComponentsRelativeTo=F,e.getRelativePathFromDirectory=P,e.convertToRelativePath=function(e,t,r){return i(e)?w(t,e,t,r,!1):e},e.getRelativePathFromFile=function(e,t,r){return k(P(d(e),t,r))},e.getRelativePathToDirectoryOrUrl=w,e.forEachAncestorDirectory=function(e,t){for(;;){var r=t(e);if(void 0!==r)return r;var n=d(e);if(n===e)return;e=n;}},e.isNodeModulesDirectory=function(t){return e.endsWith(t,"/node_modules")};}(t),function(e){function t(e,t,r,n,i,a,o){return {code:e,category:t,key:r,message:n,reportsUnnecessary:i,elidedInCompatabilityPyramid:a,reportsDeprecated:o}}e.Diagnostics={Unterminated_string_literal:t(1002,e.DiagnosticCategory.Error,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:t(1003,e.DiagnosticCategory.Error,"Identifier_expected_1003","Identifier expected."),_0_expected:t(1005,e.DiagnosticCategory.Error,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:t(1006,e.DiagnosticCategory.Error,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:t(1007,e.DiagnosticCategory.Error,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:t(1009,e.DiagnosticCategory.Error,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:t(1010,e.DiagnosticCategory.Error,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:t(1011,e.DiagnosticCategory.Error,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:t(1012,e.DiagnosticCategory.Error,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:t(1013,e.DiagnosticCategory.Error,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:t(1014,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:t(1015,e.DiagnosticCategory.Error,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:t(1016,e.DiagnosticCategory.Error,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:t(1017,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:t(1018,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:t(1019,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:t(1020,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:t(1021,e.DiagnosticCategory.Error,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:t(1022,e.DiagnosticCategory.Error,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:t(1024,e.DiagnosticCategory.Error,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:t(1025,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:t(1028,e.DiagnosticCategory.Error,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:t(1029,e.DiagnosticCategory.Error,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:t(1030,e.DiagnosticCategory.Error,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:t(1031,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:t(1034,e.DiagnosticCategory.Error,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:t(1035,e.DiagnosticCategory.Error,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:t(1036,e.DiagnosticCategory.Error,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:t(1038,e.DiagnosticCategory.Error,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:t(1039,e.DiagnosticCategory.Error,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:t(1040,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:t(1042,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:t(1044,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:t(1046,e.DiagnosticCategory.Error,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:t(1047,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:t(1048,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:t(1049,e.DiagnosticCategory.Error,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:t(1051,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:t(1052,e.DiagnosticCategory.Error,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:t(1053,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:t(1054,e.DiagnosticCategory.Error,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:t(1055,e.DiagnosticCategory.Error,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055","Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:t(1056,e.DiagnosticCategory.Error,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1058,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:t(1059,e.DiagnosticCategory.Error,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:t(1060,e.DiagnosticCategory.Error,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:t(1061,e.DiagnosticCategory.Error,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:t(1062,e.DiagnosticCategory.Error,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:t(1063,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:t(1064,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?"),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:t(1066,e.DiagnosticCategory.Error,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:t(1068,e.DiagnosticCategory.Error,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:t(1069,e.DiagnosticCategory.Error,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:t(1070,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:t(1071,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:t(1079,e.DiagnosticCategory.Error,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:t(1084,e.DiagnosticCategory.Error,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:t(1085,e.DiagnosticCategory.Error,"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085","Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."),_0_modifier_cannot_appear_on_a_constructor_declaration:t(1089,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:t(1090,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:t(1091,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:t(1092,e.DiagnosticCategory.Error,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:t(1093,e.DiagnosticCategory.Error,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:t(1094,e.DiagnosticCategory.Error,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:t(1095,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:t(1096,e.DiagnosticCategory.Error,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:t(1097,e.DiagnosticCategory.Error,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:t(1098,e.DiagnosticCategory.Error,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:t(1099,e.DiagnosticCategory.Error,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:t(1100,e.DiagnosticCategory.Error,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:t(1101,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:t(1102,e.DiagnosticCategory.Error,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1103,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:t(1104,e.DiagnosticCategory.Error,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:t(1105,e.DiagnosticCategory.Error,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:t(1106,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:t(1107,e.DiagnosticCategory.Error,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:t(1108,e.DiagnosticCategory.Error,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:t(1109,e.DiagnosticCategory.Error,"Expression_expected_1109","Expression expected."),Type_expected:t(1110,e.DiagnosticCategory.Error,"Type_expected_1110","Type expected."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:t(1113,e.DiagnosticCategory.Error,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:t(1114,e.DiagnosticCategory.Error,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:t(1115,e.DiagnosticCategory.Error,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:t(1116,e.DiagnosticCategory.Error,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:t(1117,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:t(1118,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:t(1119,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:t(1120,e.DiagnosticCategory.Error,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_in_strict_mode:t(1121,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_strict_mode_1121","Octal literals are not allowed in strict mode."),Variable_declaration_list_cannot_be_empty:t(1123,e.DiagnosticCategory.Error,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:t(1124,e.DiagnosticCategory.Error,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:t(1125,e.DiagnosticCategory.Error,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:t(1126,e.DiagnosticCategory.Error,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:t(1127,e.DiagnosticCategory.Error,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:t(1128,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:t(1129,e.DiagnosticCategory.Error,"Statement_expected_1129","Statement expected."),case_or_default_expected:t(1130,e.DiagnosticCategory.Error,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:t(1131,e.DiagnosticCategory.Error,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:t(1132,e.DiagnosticCategory.Error,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:t(1134,e.DiagnosticCategory.Error,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:t(1135,e.DiagnosticCategory.Error,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:t(1136,e.DiagnosticCategory.Error,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:t(1137,e.DiagnosticCategory.Error,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:t(1138,e.DiagnosticCategory.Error,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:t(1139,e.DiagnosticCategory.Error,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:t(1140,e.DiagnosticCategory.Error,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:t(1141,e.DiagnosticCategory.Error,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:t(1142,e.DiagnosticCategory.Error,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:t(1144,e.DiagnosticCategory.Error,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:t(1145,e.DiagnosticCategory.Error,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:t(1146,e.DiagnosticCategory.Error,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:t(1147,e.DiagnosticCategory.Error,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:t(1148,e.DiagnosticCategory.Error,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:t(1149,e.DiagnosticCategory.Error,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),const_declarations_must_be_initialized:t(1155,e.DiagnosticCategory.Error,"const_declarations_must_be_initialized_1155","'const' declarations must be initialized."),const_declarations_can_only_be_declared_inside_a_block:t(1156,e.DiagnosticCategory.Error,"const_declarations_can_only_be_declared_inside_a_block_1156","'const' declarations can only be declared inside a block."),let_declarations_can_only_be_declared_inside_a_block:t(1157,e.DiagnosticCategory.Error,"let_declarations_can_only_be_declared_inside_a_block_1157","'let' declarations can only be declared inside a block."),Unterminated_template_literal:t(1160,e.DiagnosticCategory.Error,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:t(1161,e.DiagnosticCategory.Error,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:t(1162,e.DiagnosticCategory.Error,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:t(1163,e.DiagnosticCategory.Error,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:t(1164,e.DiagnosticCategory.Error,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1165,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:t(1166,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1168,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1169,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1170,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:t(1171,e.DiagnosticCategory.Error,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:t(1172,e.DiagnosticCategory.Error,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:t(1173,e.DiagnosticCategory.Error,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:t(1174,e.DiagnosticCategory.Error,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:t(1175,e.DiagnosticCategory.Error,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:t(1176,e.DiagnosticCategory.Error,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:t(1177,e.DiagnosticCategory.Error,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:t(1178,e.DiagnosticCategory.Error,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:t(1179,e.DiagnosticCategory.Error,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:t(1180,e.DiagnosticCategory.Error,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:t(1181,e.DiagnosticCategory.Error,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:t(1182,e.DiagnosticCategory.Error,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:t(1183,e.DiagnosticCategory.Error,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:t(1184,e.DiagnosticCategory.Error,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:t(1185,e.DiagnosticCategory.Error,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:t(1186,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:t(1187,e.DiagnosticCategory.Error,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:t(1188,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:t(1189,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:t(1190,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:t(1191,e.DiagnosticCategory.Error,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:t(1192,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:t(1193,e.DiagnosticCategory.Error,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:t(1194,e.DiagnosticCategory.Error,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:t(1195,e.DiagnosticCategory.Error,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:t(1196,e.DiagnosticCategory.Error,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:t(1197,e.DiagnosticCategory.Error,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:t(1198,e.DiagnosticCategory.Error,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:t(1199,e.DiagnosticCategory.Error,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:t(1200,e.DiagnosticCategory.Error,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:t(1202,e.DiagnosticCategory.Error,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:t(1203,e.DiagnosticCategory.Error,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:t(1205,e.DiagnosticCategory.Error,"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205","Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."),Decorators_are_not_valid_here:t(1206,e.DiagnosticCategory.Error,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:t(1207,e.DiagnosticCategory.Error,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module:t(1208,e.DiagnosticCategory.Error,"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208","'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:t(1209,e.DiagnosticCategory.Error,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t(1210,e.DiagnosticCategory.Error,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:t(1211,e.DiagnosticCategory.Error,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:t(1212,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t(1213,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:t(1214,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:t(1215,e.DiagnosticCategory.Error,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:t(1216,e.DiagnosticCategory.Error,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:t(1218,e.DiagnosticCategory.Error,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning:t(1219,e.DiagnosticCategory.Error,"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219","Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),Generators_are_not_allowed_in_an_ambient_context:t(1221,e.DiagnosticCategory.Error,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:t(1222,e.DiagnosticCategory.Error,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:t(1223,e.DiagnosticCategory.Error,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:t(1224,e.DiagnosticCategory.Error,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:t(1225,e.DiagnosticCategory.Error,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:t(1226,e.DiagnosticCategory.Error,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:t(1227,e.DiagnosticCategory.Error,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:t(1228,e.DiagnosticCategory.Error,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:t(1229,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:t(1230,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1231,e.DiagnosticCategory.Error,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1232,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1233,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:t(1234,e.DiagnosticCategory.Error,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:t(1235,e.DiagnosticCategory.Error,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:t(1236,e.DiagnosticCategory.Error,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:t(1237,e.DiagnosticCategory.Error,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:t(1238,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:t(1239,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:t(1240,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:t(1241,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:t(1242,e.DiagnosticCategory.Error,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:t(1243,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:t(1244,e.DiagnosticCategory.Error,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:t(1245,e.DiagnosticCategory.Error,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:t(1246,e.DiagnosticCategory.Error,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:t(1247,e.DiagnosticCategory.Error,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:t(1248,e.DiagnosticCategory.Error,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:t(1249,e.DiagnosticCategory.Error,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:t(1250,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t(1251,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:t(1252,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:t(1254,e.DiagnosticCategory.Error,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:t(1255,e.DiagnosticCategory.Error,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:t(1257,e.DiagnosticCategory.Error,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1258,e.DiagnosticCategory.Error,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:t(1259,e.DiagnosticCategory.Error,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:t(1260,e.DiagnosticCategory.Error,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:t(1261,e.DiagnosticCategory.Error,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:t(1262,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t(1263,e.DiagnosticCategory.Error,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:t(1264,e.DiagnosticCategory.Error,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:t(1265,e.DiagnosticCategory.Error,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:t(1266,e.DiagnosticCategory.Error,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:t(1267,e.DiagnosticCategory.Error,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:t(1268,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided:t(1269,e.DiagnosticCategory.Error,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269","Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),Decorator_function_return_type_0_is_not_assignable_to_type_1:t(1270,e.DiagnosticCategory.Error,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:t(1271,e.DiagnosticCategory.Error,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:t(1272,e.DiagnosticCategory.Error,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:t(1273,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:t(1274,e.DiagnosticCategory.Error,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:t(1275,e.DiagnosticCategory.Error,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:t(1276,e.DiagnosticCategory.Error,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),with_statements_are_not_allowed_in_an_async_function_block:t(1300,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1308,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:t(1309,e.DiagnosticCategory.Error,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:t(1312,e.DiagnosticCategory.Error,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:t(1313,e.DiagnosticCategory.Error,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:t(1314,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:t(1315,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:t(1316,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:t(1317,e.DiagnosticCategory.Error,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:t(1318,e.DiagnosticCategory.Error,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:t(1319,e.DiagnosticCategory.Error,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1320,e.DiagnosticCategory.Error,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1321,e.DiagnosticCategory.Error,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1322,e.DiagnosticCategory.Error,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:t(1323,e.DiagnosticCategory.Error,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext:t(1324,e.DiagnosticCategory.Error,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),Argument_of_dynamic_import_cannot_be_spread_element:t(1325,e.DiagnosticCategory.Error,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:t(1326,e.DiagnosticCategory.Error,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:t(1327,e.DiagnosticCategory.Error,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:t(1328,e.DiagnosticCategory.Error,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:t(1329,e.DiagnosticCategory.Error,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:t(1330,e.DiagnosticCategory.Error,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:t(1331,e.DiagnosticCategory.Error,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:t(1332,e.DiagnosticCategory.Error,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:t(1333,e.DiagnosticCategory.Error,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:t(1334,e.DiagnosticCategory.Error,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:t(1335,e.DiagnosticCategory.Error,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:t(1337,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:t(1338,e.DiagnosticCategory.Error,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:t(1339,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:t(1340,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:t(1341,e.DiagnosticCategory.Error,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),Type_arguments_cannot_be_used_here:t(1342,e.DiagnosticCategory.Error,"Type_arguments_cannot_be_used_here_1342","Type arguments cannot be used here."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:t(1343,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:t(1344,e.DiagnosticCategory.Error,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:t(1345,e.DiagnosticCategory.Error,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:t(1346,e.DiagnosticCategory.Error,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:t(1347,e.DiagnosticCategory.Error,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:t(1348,e.DiagnosticCategory.Error,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:t(1349,e.DiagnosticCategory.Error,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:t(1350,e.DiagnosticCategory.Message,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:t(1351,e.DiagnosticCategory.Error,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:t(1352,e.DiagnosticCategory.Error,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:t(1353,e.DiagnosticCategory.Error,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:t(1354,e.DiagnosticCategory.Error,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:t(1355,e.DiagnosticCategory.Error,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:t(1356,e.DiagnosticCategory.Error,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:t(1357,e.DiagnosticCategory.Error,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:t(1358,e.DiagnosticCategory.Error,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:t(1359,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:t(1360,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:t(1361,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:t(1362,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:t(1363,e.DiagnosticCategory.Error,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:t(1364,e.DiagnosticCategory.Message,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:t(1365,e.DiagnosticCategory.Message,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:t(1366,e.DiagnosticCategory.Message,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:t(1367,e.DiagnosticCategory.Message,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:t(1368,e.DiagnosticCategory.Error,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:t(1369,e.DiagnosticCategory.Message,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:t(1371,e.DiagnosticCategory.Error,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),Convert_to_type_only_import:t(1373,e.DiagnosticCategory.Message,"Convert_to_type_only_import_1373","Convert to type-only import"),Convert_all_imports_not_used_as_a_value_to_type_only_imports:t(1374,e.DiagnosticCategory.Message,"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374","Convert all imports not used as a value to type-only imports"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1375,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:t(1376,e.DiagnosticCategory.Message,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:t(1377,e.DiagnosticCategory.Message,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1378,e.DiagnosticCategory.Error,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:t(1379,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:t(1380,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:t(1381,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `&rbrace;`?"),Unexpected_token_Did_you_mean_or_gt:t(1382,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `&gt;`?"),Only_named_exports_may_use_export_type:t(1383,e.DiagnosticCategory.Error,"Only_named_exports_may_use_export_type_1383","Only named exports may use 'export type'."),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1385,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1386,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1387,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1388,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:t(1389,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:t(1390,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:t(1392,e.DiagnosticCategory.Error,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:t(1393,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:t(1394,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:t(1395,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:t(1396,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:t(1397,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:t(1398,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:t(1399,e.DiagnosticCategory.Message,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:t(1400,e.DiagnosticCategory.Message,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:t(1401,e.DiagnosticCategory.Message,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:t(1402,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:t(1403,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:t(1404,e.DiagnosticCategory.Message,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:t(1405,e.DiagnosticCategory.Message,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:t(1406,e.DiagnosticCategory.Message,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:t(1407,e.DiagnosticCategory.Message,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:t(1408,e.DiagnosticCategory.Message,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:t(1409,e.DiagnosticCategory.Message,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:t(1410,e.DiagnosticCategory.Message,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:t(1411,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:t(1412,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:t(1413,e.DiagnosticCategory.Message,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:t(1414,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:t(1415,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:t(1416,e.DiagnosticCategory.Message,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:t(1417,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:t(1418,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:t(1419,e.DiagnosticCategory.Message,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:t(1420,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:t(1421,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:t(1422,e.DiagnosticCategory.Message,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:t(1423,e.DiagnosticCategory.Message,"File_is_library_specified_here_1423","File is library specified here."),Default_library:t(1424,e.DiagnosticCategory.Message,"Default_library_1424","Default library"),Default_library_for_target_0:t(1425,e.DiagnosticCategory.Message,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:t(1426,e.DiagnosticCategory.Message,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:t(1427,e.DiagnosticCategory.Message,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:t(1428,e.DiagnosticCategory.Message,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:t(1429,e.DiagnosticCategory.Message,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:t(1430,e.DiagnosticCategory.Message,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1431,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1432,e.DiagnosticCategory.Error,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Decorators_may_not_be_applied_to_this_parameters:t(1433,e.DiagnosticCategory.Error,"Decorators_may_not_be_applied_to_this_parameters_1433","Decorators may not be applied to 'this' parameters."),Unexpected_keyword_or_identifier:t(1434,e.DiagnosticCategory.Error,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:t(1435,e.DiagnosticCategory.Error,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:t(1436,e.DiagnosticCategory.Error,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:t(1437,e.DiagnosticCategory.Error,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:t(1438,e.DiagnosticCategory.Error,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:t(1439,e.DiagnosticCategory.Error,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:t(1440,e.DiagnosticCategory.Error,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:t(1441,e.DiagnosticCategory.Error,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:t(1442,e.DiagnosticCategory.Error,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:t(1443,e.DiagnosticCategory.Error,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1444,e.DiagnosticCategory.Error,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1446,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled:t(1448,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:t(1449,e.DiagnosticCategory.Message,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments:t(1450,e.DiagnosticCategory.Message,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional assertion as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:t(1451,e.DiagnosticCategory.Error,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext:t(1452,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452","'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),resolution_mode_should_be_either_require_or_import:t(1453,e.DiagnosticCategory.Error,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:t(1454,e.DiagnosticCategory.Error,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:t(1455,e.DiagnosticCategory.Error,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:t(1456,e.DiagnosticCategory.Error,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:t(1457,e.DiagnosticCategory.Message,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:t(1458,e.DiagnosticCategory.Message,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",'File is ECMAScript module because \'{0}\' has field "type" with value "module"'),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:t(1459,e.DiagnosticCategory.Message,"File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459",'File is CommonJS module because \'{0}\' has field "type" whose value is not "module"'),File_is_CommonJS_module_because_0_does_not_have_field_type:t(1460,e.DiagnosticCategory.Message,"File_is_CommonJS_module_because_0_does_not_have_field_type_1460","File is CommonJS module because '{0}' does not have field \"type\""),File_is_CommonJS_module_because_package_json_was_not_found:t(1461,e.DiagnosticCategory.Message,"File_is_CommonJS_module_because_package_json_was_not_found_1461","File is CommonJS module because 'package.json' was not found"),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:t(1470,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead:t(1471,e.DiagnosticCategory.Error,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),catch_or_finally_expected:t(1472,e.DiagnosticCategory.Error,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1473,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1474,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:t(1475,e.DiagnosticCategory.Message,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:t(1476,e.DiagnosticCategory.Message,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:t(1477,e.DiagnosticCategory.Error,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:t(1478,e.DiagnosticCategory.Error,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead:t(1479,e.DiagnosticCategory.Error,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479","The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"{0}\")' call instead."),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:t(1480,e.DiagnosticCategory.Message,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:t(1481,e.DiagnosticCategory.Message,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481","To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `\"type\": \"module\"` to '{1}'."),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:t(1482,e.DiagnosticCategory.Message,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:t(1483,e.DiagnosticCategory.Message,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),The_types_of_0_are_incompatible_between_these_types:t(2200,e.DiagnosticCategory.Error,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:t(2201,e.DiagnosticCategory.Error,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:t(2202,e.DiagnosticCategory.Error,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:t(2203,e.DiagnosticCategory.Error,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2204,e.DiagnosticCategory.Error,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2205,e.DiagnosticCategory.Error,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:t(2206,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:t(2207,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:t(2208,e.DiagnosticCategory.Error,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2209,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2210,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:t(2211,e.DiagnosticCategory.Message,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:t(2212,e.DiagnosticCategory.Message,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:t(2300,e.DiagnosticCategory.Error,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2301,e.DiagnosticCategory.Error,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:t(2302,e.DiagnosticCategory.Error,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:t(2303,e.DiagnosticCategory.Error,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:t(2304,e.DiagnosticCategory.Error,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:t(2305,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:t(2306,e.DiagnosticCategory.Error,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:t(2307,e.DiagnosticCategory.Error,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:t(2308,e.DiagnosticCategory.Error,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:t(2309,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:t(2310,e.DiagnosticCategory.Error,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:t(2311,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2312,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:t(2313,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:t(2314,e.DiagnosticCategory.Error,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:t(2315,e.DiagnosticCategory.Error,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:t(2316,e.DiagnosticCategory.Error,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:t(2317,e.DiagnosticCategory.Error,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:t(2318,e.DiagnosticCategory.Error,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:t(2319,e.DiagnosticCategory.Error,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:t(2320,e.DiagnosticCategory.Error,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:t(2321,e.DiagnosticCategory.Error,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:t(2322,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:t(2323,e.DiagnosticCategory.Error,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:t(2324,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:t(2325,e.DiagnosticCategory.Error,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:t(2326,e.DiagnosticCategory.Error,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:t(2327,e.DiagnosticCategory.Error,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:t(2328,e.DiagnosticCategory.Error,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:t(2329,e.DiagnosticCategory.Error,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:t(2330,e.DiagnosticCategory.Error,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:t(2331,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:t(2332,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:t(2333,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:t(2334,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:t(2335,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:t(2336,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:t(2337,e.DiagnosticCategory.Error,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:t(2338,e.DiagnosticCategory.Error,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:t(2339,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:t(2340,e.DiagnosticCategory.Error,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:t(2341,e.DiagnosticCategory.Error,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:t(2343,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:t(2344,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:t(2345,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Call_target_does_not_contain_any_signatures:t(2346,e.DiagnosticCategory.Error,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:t(2347,e.DiagnosticCategory.Error,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:t(2348,e.DiagnosticCategory.Error,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:t(2349,e.DiagnosticCategory.Error,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:t(2350,e.DiagnosticCategory.Error,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:t(2351,e.DiagnosticCategory.Error,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:t(2352,e.DiagnosticCategory.Error,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:t(2353,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:t(2354,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:t(2355,e.DiagnosticCategory.Error,"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'void' nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:t(2356,e.DiagnosticCategory.Error,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:t(2357,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:t(2358,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:t(2359,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359","The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2362,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2363,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:t(2364,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:t(2365,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:t(2366,e.DiagnosticCategory.Error,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:t(2367,e.DiagnosticCategory.Error,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:t(2368,e.DiagnosticCategory.Error,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:t(2369,e.DiagnosticCategory.Error,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:t(2370,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:t(2371,e.DiagnosticCategory.Error,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:t(2372,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:t(2373,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:t(2374,e.DiagnosticCategory.Error,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2375,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2376,e.DiagnosticCategory.Error,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:t(2377,e.DiagnosticCategory.Error,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:t(2378,e.DiagnosticCategory.Error,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2379,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type:t(2380,e.DiagnosticCategory.Error,"The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380","The return type of a 'get' accessor must be assignable to its 'set' accessor type"),Overload_signatures_must_all_be_exported_or_non_exported:t(2383,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:t(2384,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:t(2385,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:t(2386,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:t(2387,e.DiagnosticCategory.Error,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:t(2388,e.DiagnosticCategory.Error,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:t(2389,e.DiagnosticCategory.Error,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:t(2390,e.DiagnosticCategory.Error,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:t(2391,e.DiagnosticCategory.Error,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:t(2392,e.DiagnosticCategory.Error,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:t(2393,e.DiagnosticCategory.Error,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:t(2394,e.DiagnosticCategory.Error,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:t(2395,e.DiagnosticCategory.Error,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:t(2396,e.DiagnosticCategory.Error,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:t(2397,e.DiagnosticCategory.Error,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:t(2398,e.DiagnosticCategory.Error,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:t(2399,e.DiagnosticCategory.Error,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:t(2400,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2401,e.DiagnosticCategory.Error,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:t(2402,e.DiagnosticCategory.Error,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:t(2403,e.DiagnosticCategory.Error,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type.  Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:t(2404,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:t(2405,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:t(2406,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:t(2407,e.DiagnosticCategory.Error,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:t(2408,e.DiagnosticCategory.Error,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:t(2409,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:t(2410,e.DiagnosticCategory.Error,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:t(2412,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:t(2411,e.DiagnosticCategory.Error,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:t(2413,e.DiagnosticCategory.Error,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:t(2414,e.DiagnosticCategory.Error,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:t(2415,e.DiagnosticCategory.Error,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:t(2416,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:t(2417,e.DiagnosticCategory.Error,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:t(2418,e.DiagnosticCategory.Error,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:t(2419,e.DiagnosticCategory.Error,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:t(2420,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2422,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:t(2423,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:t(2425,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:t(2426,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:t(2427,e.DiagnosticCategory.Error,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:t(2428,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:t(2430,e.DiagnosticCategory.Error,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:t(2431,e.DiagnosticCategory.Error,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:t(2432,e.DiagnosticCategory.Error,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:t(2433,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:t(2434,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:t(2435,e.DiagnosticCategory.Error,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:t(2436,e.DiagnosticCategory.Error,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:t(2437,e.DiagnosticCategory.Error,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:t(2438,e.DiagnosticCategory.Error,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:t(2439,e.DiagnosticCategory.Error,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:t(2440,e.DiagnosticCategory.Error,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:t(2441,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:t(2442,e.DiagnosticCategory.Error,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:t(2443,e.DiagnosticCategory.Error,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:t(2444,e.DiagnosticCategory.Error,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:t(2445,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:t(2446,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:t(2447,e.DiagnosticCategory.Error,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:t(2448,e.DiagnosticCategory.Error,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:t(2449,e.DiagnosticCategory.Error,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:t(2450,e.DiagnosticCategory.Error,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:t(2451,e.DiagnosticCategory.Error,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:t(2452,e.DiagnosticCategory.Error,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:t(2454,e.DiagnosticCategory.Error,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:t(2456,e.DiagnosticCategory.Error,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:t(2457,e.DiagnosticCategory.Error,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:t(2458,e.DiagnosticCategory.Error,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:t(2459,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:t(2460,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:t(2461,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:t(2462,e.DiagnosticCategory.Error,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:t(2463,e.DiagnosticCategory.Error,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:t(2464,e.DiagnosticCategory.Error,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:t(2465,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:t(2466,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:t(2467,e.DiagnosticCategory.Error,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:t(2468,e.DiagnosticCategory.Error,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:t(2469,e.DiagnosticCategory.Error,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:t(2472,e.DiagnosticCategory.Error,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:t(2473,e.DiagnosticCategory.Error,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values:t(2474,e.DiagnosticCategory.Error,"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474","const enum member initializers can only contain literal values and other computed enum values."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:t(2475,e.DiagnosticCategory.Error,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:t(2476,e.DiagnosticCategory.Error,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:t(2477,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:t(2478,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:t(2480,e.DiagnosticCategory.Error,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:t(2481,e.DiagnosticCategory.Error,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:t(2483,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:t(2484,e.DiagnosticCategory.Error,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:t(2487,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2488,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:t(2489,e.DiagnosticCategory.Error,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:t(2490,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:t(2491,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:t(2492,e.DiagnosticCategory.Error,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:t(2493,e.DiagnosticCategory.Error,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:t(2494,e.DiagnosticCategory.Error,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:t(2495,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:t(2496,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:t(2497,e.DiagnosticCategory.Error,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:t(2498,e.DiagnosticCategory.Error,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2499,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2500,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:t(2501,e.DiagnosticCategory.Error,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:t(2502,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:t(2503,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:t(2504,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:t(2505,e.DiagnosticCategory.Error,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:t(2506,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:t(2507,e.DiagnosticCategory.Error,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:t(2508,e.DiagnosticCategory.Error,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2509,e.DiagnosticCategory.Error,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:t(2510,e.DiagnosticCategory.Error,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:t(2511,e.DiagnosticCategory.Error,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:t(2512,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:t(2513,e.DiagnosticCategory.Error,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:t(2514,e.DiagnosticCategory.Error,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:t(2515,e.DiagnosticCategory.Error,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:t(2516,e.DiagnosticCategory.Error,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:t(2517,e.DiagnosticCategory.Error,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:t(2518,e.DiagnosticCategory.Error,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:t(2519,e.DiagnosticCategory.Error,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:t(2520,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:t(2522,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:t(2523,e.DiagnosticCategory.Error,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:t(2524,e.DiagnosticCategory.Error,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:t(2525,e.DiagnosticCategory.Error,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:t(2526,e.DiagnosticCategory.Error,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:t(2527,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:t(2528,e.DiagnosticCategory.Error,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:t(2529,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:t(2530,e.DiagnosticCategory.Error,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:t(2531,e.DiagnosticCategory.Error,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:t(2532,e.DiagnosticCategory.Error,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:t(2533,e.DiagnosticCategory.Error,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:t(2534,e.DiagnosticCategory.Error,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Enum_type_0_has_members_with_initializers_that_are_not_literals:t(2535,e.DiagnosticCategory.Error,"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535","Enum type '{0}' has members with initializers that are not literals."),Type_0_cannot_be_used_to_index_type_1:t(2536,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:t(2537,e.DiagnosticCategory.Error,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:t(2538,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:t(2539,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:t(2540,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:t(2542,e.DiagnosticCategory.Error,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:t(2543,e.DiagnosticCategory.Error,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:t(2544,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:t(2545,e.DiagnosticCategory.Error,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:t(2547,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2548,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2549,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:t(2550,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:t(2551,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:t(2552,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:t(2553,e.DiagnosticCategory.Error,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:t(2554,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:t(2555,e.DiagnosticCategory.Error,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:t(2556,e.DiagnosticCategory.Error,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:t(2558,e.DiagnosticCategory.Error,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:t(2559,e.DiagnosticCategory.Error,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:t(2560,e.DiagnosticCategory.Error,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:t(2561,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:t(2562,e.DiagnosticCategory.Error,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:t(2563,e.DiagnosticCategory.Error,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:t(2564,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:t(2565,e.DiagnosticCategory.Error,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:t(2566,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:t(2567,e.DiagnosticCategory.Error,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:t(2568,e.DiagnosticCategory.Error,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:t(2570,e.DiagnosticCategory.Error,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:t(2571,e.DiagnosticCategory.Error,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:t(2574,e.DiagnosticCategory.Error,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:t(2575,e.DiagnosticCategory.Error,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:t(2576,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:t(2577,e.DiagnosticCategory.Error,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:t(2578,e.DiagnosticCategory.Error,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:t(2580,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:t(2581,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:t(2582,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:t(2583,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:t(2584,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:t(2585,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:t(2588,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:t(2589,e.DiagnosticCategory.Error,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:t(2590,e.DiagnosticCategory.Error,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:t(2591,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:t(2592,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:t(2593,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:t(2594,e.DiagnosticCategory.Error,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:t(2595,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2596,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:t(2597,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2598,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:t(2602,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:t(2603,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:t(2604,e.DiagnosticCategory.Error,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:t(2606,e.DiagnosticCategory.Error,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:t(2607,e.DiagnosticCategory.Error,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:t(2608,e.DiagnosticCategory.Error,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:t(2609,e.DiagnosticCategory.Error,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:t(2610,e.DiagnosticCategory.Error,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:t(2611,e.DiagnosticCategory.Error,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:t(2612,e.DiagnosticCategory.Error,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:t(2613,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:t(2614,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:t(2615,e.DiagnosticCategory.Error,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:t(2616,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2617,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:t(2618,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:t(2619,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:t(2620,e.DiagnosticCategory.Error,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:t(2621,e.DiagnosticCategory.Error,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:t(2623,e.DiagnosticCategory.Error,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:t(2624,e.DiagnosticCategory.Error,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:t(2625,e.DiagnosticCategory.Error,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:t(2626,e.DiagnosticCategory.Error,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:t(2627,e.DiagnosticCategory.Error,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:t(2628,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:t(2629,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:t(2630,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:t(2631,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:t(2632,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:t(2633,e.DiagnosticCategory.Error,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:t(2634,e.DiagnosticCategory.Error,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:t(2635,e.DiagnosticCategory.Error,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:t(2636,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:t(2637,e.DiagnosticCategory.Error,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:t(2638,e.DiagnosticCategory.Error,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:t(2649,e.DiagnosticCategory.Error,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:t(2651,e.DiagnosticCategory.Error,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:t(2652,e.DiagnosticCategory.Error,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:t(2653,e.DiagnosticCategory.Error,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:t(2657,e.DiagnosticCategory.Error,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:t(2658,e.DiagnosticCategory.Error,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:t(2659,e.DiagnosticCategory.Error,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:t(2660,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:t(2661,e.DiagnosticCategory.Error,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:t(2662,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:t(2663,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:t(2664,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:t(2665,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:t(2666,e.DiagnosticCategory.Error,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:t(2667,e.DiagnosticCategory.Error,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:t(2668,e.DiagnosticCategory.Error,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:t(2669,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:t(2670,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:t(2671,e.DiagnosticCategory.Error,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:t(2672,e.DiagnosticCategory.Error,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:t(2673,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:t(2674,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:t(2675,e.DiagnosticCategory.Error,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:t(2676,e.DiagnosticCategory.Error,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:t(2677,e.DiagnosticCategory.Error,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:t(2678,e.DiagnosticCategory.Error,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:t(2679,e.DiagnosticCategory.Error,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:t(2680,e.DiagnosticCategory.Error,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:t(2681,e.DiagnosticCategory.Error,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:t(2683,e.DiagnosticCategory.Error,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:t(2684,e.DiagnosticCategory.Error,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:t(2685,e.DiagnosticCategory.Error,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:t(2686,e.DiagnosticCategory.Error,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:t(2687,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:t(2688,e.DiagnosticCategory.Error,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:t(2689,e.DiagnosticCategory.Error,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:t(2690,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead:t(2691,e.DiagnosticCategory.Error,"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691","An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:t(2692,e.DiagnosticCategory.Error,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:t(2693,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:t(2694,e.DiagnosticCategory.Error,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:t(2695,e.DiagnosticCategory.Error,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:t(2696,e.DiagnosticCategory.Error,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2697,e.DiagnosticCategory.Error,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:t(2698,e.DiagnosticCategory.Error,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:t(2699,e.DiagnosticCategory.Error,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:t(2700,e.DiagnosticCategory.Error,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:t(2701,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:t(2702,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:t(2703,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:t(2704,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2705,e.DiagnosticCategory.Error,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:t(2706,e.DiagnosticCategory.Error,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:t(2707,e.DiagnosticCategory.Error,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:t(2708,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:t(2709,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:t(2710,e.DiagnosticCategory.Error,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2711,e.DiagnosticCategory.Error,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2712,e.DiagnosticCategory.Error,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:t(2713,e.DiagnosticCategory.Error,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\"{1}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:t(2714,e.DiagnosticCategory.Error,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:t(2715,e.DiagnosticCategory.Error,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:t(2716,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:t(2717,e.DiagnosticCategory.Error,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type.  Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:t(2718,e.DiagnosticCategory.Error,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:t(2719,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:t(2720,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:t(2721,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:t(2722,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:t(2723,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:t(2724,e.DiagnosticCategory.Error,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:t(2725,e.DiagnosticCategory.Error,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:t(2726,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:t(2727,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:t(2728,e.DiagnosticCategory.Message,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:t(2729,e.DiagnosticCategory.Error,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:t(2730,e.DiagnosticCategory.Error,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:t(2731,e.DiagnosticCategory.Error,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:t(2732,e.DiagnosticCategory.Error,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:t(2733,e.DiagnosticCategory.Error,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:t(2734,e.DiagnosticCategory.Error,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:t(2735,e.DiagnosticCategory.Error,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:t(2736,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:t(2737,e.DiagnosticCategory.Error,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:t(2738,e.DiagnosticCategory.Message,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:t(2739,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:t(2740,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:t(2741,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:t(2742,e.DiagnosticCategory.Error,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:t(2743,e.DiagnosticCategory.Error,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:t(2744,e.DiagnosticCategory.Error,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:t(2745,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:t(2746,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:t(2747,e.DiagnosticCategory.Error,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided:t(2748,e.DiagnosticCategory.Error,"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748","Cannot access ambient const enums when the '--isolatedModules' flag is provided."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:t(2749,e.DiagnosticCategory.Error,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:t(2750,e.DiagnosticCategory.Error,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:t(2751,e.DiagnosticCategory.Error,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:t(2752,e.DiagnosticCategory.Error,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:t(2753,e.DiagnosticCategory.Error,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:t(2754,e.DiagnosticCategory.Error,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:t(2755,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:t(2756,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:t(2757,e.DiagnosticCategory.Error,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2758,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:t(2759,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:t(2760,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:t(2761,e.DiagnosticCategory.Error,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2762,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:t(2763,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:t(2764,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:t(2765,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:t(2766,e.DiagnosticCategory.Error,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:t(2767,e.DiagnosticCategory.Error,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:t(2768,e.DiagnosticCategory.Error,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:t(2769,e.DiagnosticCategory.Error,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:t(2770,e.DiagnosticCategory.Error,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:t(2771,e.DiagnosticCategory.Error,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:t(2772,e.DiagnosticCategory.Error,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:t(2773,e.DiagnosticCategory.Error,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:t(2774,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:t(2775,e.DiagnosticCategory.Error,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:t(2776,e.DiagnosticCategory.Error,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:t(2777,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:t(2778,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:t(2779,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:t(2780,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:t(2781,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:t(2782,e.DiagnosticCategory.Message,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:t(2783,e.DiagnosticCategory.Error,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:t(2784,e.DiagnosticCategory.Error,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:t(2785,e.DiagnosticCategory.Error,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:t(2786,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:t(2787,e.DiagnosticCategory.Error,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:t(2788,e.DiagnosticCategory.Error,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:t(2789,e.DiagnosticCategory.Error,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:t(2790,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:t(2791,e.DiagnosticCategory.Error,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:t(2792,e.DiagnosticCategory.Error,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:t(2793,e.DiagnosticCategory.Error,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:t(2794,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:t(2795,e.DiagnosticCategory.Error,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:t(2796,e.DiagnosticCategory.Error,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:t(2797,e.DiagnosticCategory.Error,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:t(2798,e.DiagnosticCategory.Error,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:t(2799,e.DiagnosticCategory.Error,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:t(2800,e.DiagnosticCategory.Error,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:t(2801,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:t(2802,e.DiagnosticCategory.Error,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:t(2803,e.DiagnosticCategory.Error,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:t(2804,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:t(2806,e.DiagnosticCategory.Error,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:t(2807,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:t(2808,e.DiagnosticCategory.Error,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses:t(2809,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:t(2810,e.DiagnosticCategory.Error,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:t(2811,e.DiagnosticCategory.Error,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:t(2812,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:t(2813,e.DiagnosticCategory.Error,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:t(2814,e.DiagnosticCategory.Error,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:t(2815,e.DiagnosticCategory.Error,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:t(2816,e.DiagnosticCategory.Error,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:t(2817,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:t(2818,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:t(2819,e.DiagnosticCategory.Error,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:t(2820,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:t(2821,e.DiagnosticCategory.Error,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821","Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:t(2822,e.DiagnosticCategory.Error,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Cannot_find_namespace_0_Did_you_mean_1:t(2833,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:t(2834,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:t(2835,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls:t(2836,e.DiagnosticCategory.Error,"Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836","Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:t(2837,e.DiagnosticCategory.Error,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:t(2838,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value:t(2839,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839","This condition will always return '{0}' since JavaScript compares objects by reference, not value."),An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes:t(2840,e.DiagnosticCategory.Error,"An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840","An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(2841,e.DiagnosticCategory.Error,"The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841","The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation:t(2842,e.DiagnosticCategory.Error,"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842","'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here:t(2843,e.DiagnosticCategory.Error,"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843","We can only write a type for '{0}' by adding a type for the entire parameter here."),Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2844,e.DiagnosticCategory.Error,"Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844","Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),This_condition_will_always_return_0:t(2845,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),Import_declaration_0_is_using_private_name_1:t(4e3,e.DiagnosticCategory.Error,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:t(4002,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:t(4004,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4006,e.DiagnosticCategory.Error,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4008,e.DiagnosticCategory.Error,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4010,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4012,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4014,e.DiagnosticCategory.Error,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4016,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4019,e.DiagnosticCategory.Error,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4020,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:t(4021,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:t(4022,e.DiagnosticCategory.Error,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4023,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:t(4024,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:t(4025,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4026,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4027,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:t(4028,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4029,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4030,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:t(4031,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4032,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:t(4033,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4034,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4035,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4036,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4037,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4038,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4039,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4040,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4041,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4042,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4043,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4044,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:t(4045,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4046,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:t(4047,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4048,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:t(4049,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4050,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4051,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:t(4052,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4053,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4054,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t(4055,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4056,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:t(4057,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4058,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:t(4059,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:t(4060,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4061,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4062,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:t(4063,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4064,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4065,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4066,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4067,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4068,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4069,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4070,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4071,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4072,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4073,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4074,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4075,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4076,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:t(4077,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4078,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:t(4081,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:t(4082,e.DiagnosticCategory.Error,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:t(4083,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:t(4084,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:t(4090,e.DiagnosticCategory.Error,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4091,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:t(4092,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:t(4094,e.DiagnosticCategory.Error,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4095,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4096,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:t(4097,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4098,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4099,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:t(4100,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4101,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:t(4102,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:t(4103,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:t(4104,e.DiagnosticCategory.Error,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:t(4105,e.DiagnosticCategory.Error,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:t(4106,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:t(4107,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4108,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:t(4109,e.DiagnosticCategory.Error,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:t(4110,e.DiagnosticCategory.Error,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:t(4111,e.DiagnosticCategory.Error,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:t(4112,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:t(4113,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:t(4114,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:t(4115,e.DiagnosticCategory.Error,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:t(4116,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4117,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:t(4118,e.DiagnosticCategory.Error,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4119,e.DiagnosticCategory.Error,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4120,e.DiagnosticCategory.Error,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:t(4121,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:t(4122,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4123,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4124,e.DiagnosticCategory.Error,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4125,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125","'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:t(5001,e.DiagnosticCategory.Error,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:t(5009,e.DiagnosticCategory.Error,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5010,e.DiagnosticCategory.Error,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:t(5012,e.DiagnosticCategory.Error,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:t(5014,e.DiagnosticCategory.Error,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:t(5023,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:t(5024,e.DiagnosticCategory.Error,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:t(5025,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:t(5033,e.DiagnosticCategory.Error,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:t(5042,e.DiagnosticCategory.Error,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:t(5047,e.DiagnosticCategory.Error,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:t(5048,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:t(5051,e.DiagnosticCategory.Error,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:t(5052,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:t(5053,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:t(5054,e.DiagnosticCategory.Error,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:t(5055,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:t(5056,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:t(5057,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:t(5058,e.DiagnosticCategory.Error,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:t(5059,e.DiagnosticCategory.Error,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:t(5061,e.DiagnosticCategory.Error,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:t(5062,e.DiagnosticCategory.Error,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:t(5063,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:t(5064,e.DiagnosticCategory.Error,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5065,e.DiagnosticCategory.Error,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:t(5066,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:t(5067,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:t(5068,e.DiagnosticCategory.Error,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:t(5069,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy:t(5070,e.DiagnosticCategory.Error,"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070","Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:t(5071,e.DiagnosticCategory.Error,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:t(5072,e.DiagnosticCategory.Error,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:t(5073,e.DiagnosticCategory.Error,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:t(5074,e.DiagnosticCategory.Error,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:t(5075,e.DiagnosticCategory.Error,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:t(5076,e.DiagnosticCategory.Error,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:t(5077,e.DiagnosticCategory.Error,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:t(5078,e.DiagnosticCategory.Error,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:t(5079,e.DiagnosticCategory.Error,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:t(5080,e.DiagnosticCategory.Error,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:t(5081,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:t(5082,e.DiagnosticCategory.Error,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:t(5083,e.DiagnosticCategory.Error,"Cannot_read_file_0_5083","Cannot read file '{0}'."),Tuple_members_must_all_have_names_or_all_not_have_names:t(5084,e.DiagnosticCategory.Error,"Tuple_members_must_all_have_names_or_all_not_have_names_5084","Tuple members must all have names or all not have names."),A_tuple_member_cannot_be_both_optional_and_rest:t(5085,e.DiagnosticCategory.Error,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:t(5086,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:t(5087,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:t(5088,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:t(5089,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:t(5090,e.DiagnosticCategory.Error,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled:t(5091,e.DiagnosticCategory.Error,"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),The_root_value_of_a_0_file_must_be_an_object:t(5092,e.DiagnosticCategory.Error,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:t(5093,e.DiagnosticCategory.Error,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:t(5094,e.DiagnosticCategory.Error,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later:t(5095,e.DiagnosticCategory.Error,"Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:t(6e3,e.DiagnosticCategory.Message,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:t(6001,e.DiagnosticCategory.Message,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:t(6002,e.DiagnosticCategory.Message,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:t(6004,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:t(6005,e.DiagnosticCategory.Message,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:t(6006,e.DiagnosticCategory.Message,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:t(6007,e.DiagnosticCategory.Message,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:t(6008,e.DiagnosticCategory.Message,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:t(6009,e.DiagnosticCategory.Message,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:t(6010,e.DiagnosticCategory.Message,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:t(6011,e.DiagnosticCategory.Message,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:t(6012,e.DiagnosticCategory.Message,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:t(6013,e.DiagnosticCategory.Message,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:t(6014,e.DiagnosticCategory.Message,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:t(6015,e.DiagnosticCategory.Message,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:t(6016,e.DiagnosticCategory.Message,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:t(6017,e.DiagnosticCategory.Message,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:t(6019,e.DiagnosticCategory.Message,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:t(6020,e.DiagnosticCategory.Message,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:t(6023,e.DiagnosticCategory.Message,"Syntax_Colon_0_6023","Syntax: {0}"),options:t(6024,e.DiagnosticCategory.Message,"options_6024","options"),file:t(6025,e.DiagnosticCategory.Message,"file_6025","file"),Examples_Colon_0:t(6026,e.DiagnosticCategory.Message,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:t(6027,e.DiagnosticCategory.Message,"Options_Colon_6027","Options:"),Version_0:t(6029,e.DiagnosticCategory.Message,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:t(6030,e.DiagnosticCategory.Message,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:t(6031,e.DiagnosticCategory.Message,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:t(6032,e.DiagnosticCategory.Message,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:t(6034,e.DiagnosticCategory.Message,"KIND_6034","KIND"),FILE:t(6035,e.DiagnosticCategory.Message,"FILE_6035","FILE"),VERSION:t(6036,e.DiagnosticCategory.Message,"VERSION_6036","VERSION"),LOCATION:t(6037,e.DiagnosticCategory.Message,"LOCATION_6037","LOCATION"),DIRECTORY:t(6038,e.DiagnosticCategory.Message,"DIRECTORY_6038","DIRECTORY"),STRATEGY:t(6039,e.DiagnosticCategory.Message,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:t(6040,e.DiagnosticCategory.Message,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:t(6041,e.DiagnosticCategory.Message,"Errors_Files_6041","Errors  Files"),Generates_corresponding_map_file:t(6043,e.DiagnosticCategory.Message,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:t(6044,e.DiagnosticCategory.Error,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:t(6045,e.DiagnosticCategory.Error,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:t(6046,e.DiagnosticCategory.Error,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:t(6048,e.DiagnosticCategory.Error,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'."),Unable_to_open_file_0:t(6050,e.DiagnosticCategory.Error,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:t(6051,e.DiagnosticCategory.Error,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:t(6052,e.DiagnosticCategory.Message,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:t(6053,e.DiagnosticCategory.Error,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:t(6054,e.DiagnosticCategory.Error,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:t(6055,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:t(6056,e.DiagnosticCategory.Message,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:t(6058,e.DiagnosticCategory.Message,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:t(6059,e.DiagnosticCategory.Error,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:t(6060,e.DiagnosticCategory.Message,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:t(6061,e.DiagnosticCategory.Message,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:t(6064,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:t(6065,e.DiagnosticCategory.Message,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:t(6066,e.DiagnosticCategory.Message,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:t(6069,e.DiagnosticCategory.Message,"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069","Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:t(6070,e.DiagnosticCategory.Message,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:t(6071,e.DiagnosticCategory.Message,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:t(6072,e.DiagnosticCategory.Message,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:t(6073,e.DiagnosticCategory.Message,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:t(6074,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:t(6075,e.DiagnosticCategory.Message,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:t(6076,e.DiagnosticCategory.Message,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:t(6077,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:t(6078,e.DiagnosticCategory.Message,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:t(6079,e.DiagnosticCategory.Message,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:t(6080,e.DiagnosticCategory.Message,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:t(6081,e.DiagnosticCategory.Message,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:t(6082,e.DiagnosticCategory.Error,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:t(6083,e.DiagnosticCategory.Message,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:t(6084,e.DiagnosticCategory.Message,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:t(6085,e.DiagnosticCategory.Message,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:t(6086,e.DiagnosticCategory.Message,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:t(6087,e.DiagnosticCategory.Message,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:t(6088,e.DiagnosticCategory.Message,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:t(6089,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:t(6090,e.DiagnosticCategory.Message,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:t(6091,e.DiagnosticCategory.Message,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:t(6092,e.DiagnosticCategory.Message,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:t(6093,e.DiagnosticCategory.Message,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:t(6094,e.DiagnosticCategory.Message,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1:t(6095,e.DiagnosticCategory.Message,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095","Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),File_0_does_not_exist:t(6096,e.DiagnosticCategory.Message,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exist_use_it_as_a_name_resolution_result:t(6097,e.DiagnosticCategory.Message,"File_0_exist_use_it_as_a_name_resolution_result_6097","File '{0}' exist - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_type_1:t(6098,e.DiagnosticCategory.Message,"Loading_module_0_from_node_modules_folder_target_file_type_1_6098","Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),Found_package_json_at_0:t(6099,e.DiagnosticCategory.Message,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:t(6100,e.DiagnosticCategory.Message,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:t(6101,e.DiagnosticCategory.Message,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:t(6102,e.DiagnosticCategory.Message,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:t(6104,e.DiagnosticCategory.Message,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:t(6105,e.DiagnosticCategory.Message,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:t(6106,e.DiagnosticCategory.Message,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:t(6107,e.DiagnosticCategory.Message,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:t(6108,e.DiagnosticCategory.Message,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:t(6109,e.DiagnosticCategory.Message,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:t(6110,e.DiagnosticCategory.Message,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:t(6111,e.DiagnosticCategory.Message,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:t(6112,e.DiagnosticCategory.Message,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:t(6113,e.DiagnosticCategory.Message,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:t(6114,e.DiagnosticCategory.Error,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:t(6115,e.DiagnosticCategory.Message,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:t(6116,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:t(6119,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:t(6120,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:t(6121,e.DiagnosticCategory.Message,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:t(6122,e.DiagnosticCategory.Message,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:t(6123,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:t(6124,e.DiagnosticCategory.Message,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:t(6125,e.DiagnosticCategory.Message,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:t(6126,e.DiagnosticCategory.Message,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:t(6127,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:t(6128,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:t(6130,e.DiagnosticCategory.Message,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:t(6131,e.DiagnosticCategory.Error,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:t(6132,e.DiagnosticCategory.Message,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:t(6133,e.DiagnosticCategory.Error,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:t(6134,e.DiagnosticCategory.Message,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:t(6135,e.DiagnosticCategory.Message,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:t(6136,e.DiagnosticCategory.Message,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:t(6137,e.DiagnosticCategory.Error,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:t(6138,e.DiagnosticCategory.Error,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:t(6139,e.DiagnosticCategory.Message,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:t(6140,e.DiagnosticCategory.Error,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:t(6141,e.DiagnosticCategory.Message,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:t(6142,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:t(6144,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:t(6145,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:t(6146,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:t(6147,e.DiagnosticCategory.Message,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:t(6148,e.DiagnosticCategory.Message,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:t(6149,e.DiagnosticCategory.Message,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:t(6150,e.DiagnosticCategory.Message,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:t(6151,e.DiagnosticCategory.Message,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:t(6152,e.DiagnosticCategory.Message,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:t(6153,e.DiagnosticCategory.Message,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:t(6154,e.DiagnosticCategory.Message,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:t(6155,e.DiagnosticCategory.Message,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:t(6156,e.DiagnosticCategory.Message,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:t(6157,e.DiagnosticCategory.Message,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:t(6158,e.DiagnosticCategory.Message,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:t(6159,e.DiagnosticCategory.Message,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:t(6160,e.DiagnosticCategory.Message,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:t(6161,e.DiagnosticCategory.Message,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:t(6162,e.DiagnosticCategory.Message,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:t(6163,e.DiagnosticCategory.Message,"The_character_set_of_the_input_files_6163","The character set of the input files."),Do_not_truncate_error_messages:t(6165,e.DiagnosticCategory.Message,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:t(6166,e.DiagnosticCategory.Message,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:t(6167,e.DiagnosticCategory.Message,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:t(6168,e.DiagnosticCategory.Message,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:t(6169,e.DiagnosticCategory.Message,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:t(6170,e.DiagnosticCategory.Message,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:t(6171,e.DiagnosticCategory.Message,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:t(6179,e.DiagnosticCategory.Message,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:t(6180,e.DiagnosticCategory.Message,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:t(6182,e.DiagnosticCategory.Message,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6183,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6184,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:t(6186,e.DiagnosticCategory.Message,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:t(6187,e.DiagnosticCategory.Message,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:t(6188,e.DiagnosticCategory.Error,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:t(6189,e.DiagnosticCategory.Error,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:t(6191,e.DiagnosticCategory.Message,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:t(6192,e.DiagnosticCategory.Error,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:t(6193,e.DiagnosticCategory.Message,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:t(6194,e.DiagnosticCategory.Message,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:t(6195,e.DiagnosticCategory.Message,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:t(6196,e.DiagnosticCategory.Error,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:t(6197,e.DiagnosticCategory.Message,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:t(6198,e.DiagnosticCategory.Error,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:t(6199,e.DiagnosticCategory.Error,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:t(6200,e.DiagnosticCategory.Error,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:t(6201,e.DiagnosticCategory.Message,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:t(6202,e.DiagnosticCategory.Error,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:t(6203,e.DiagnosticCategory.Message,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:t(6204,e.DiagnosticCategory.Message,"and_here_6204","and here."),All_type_parameters_are_unused:t(6205,e.DiagnosticCategory.Error,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:t(6206,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:t(6207,e.DiagnosticCategory.Message,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:t(6208,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:t(6209,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:t(6210,e.DiagnosticCategory.Message,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:t(6211,e.DiagnosticCategory.Message,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:t(6212,e.DiagnosticCategory.Message,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:t(6213,e.DiagnosticCategory.Message,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:t(6214,e.DiagnosticCategory.Message,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:t(6215,e.DiagnosticCategory.Message,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:t(6216,e.DiagnosticCategory.Message,"Found_1_error_6216","Found 1 error."),Found_0_errors:t(6217,e.DiagnosticCategory.Message,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:t(6218,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:t(6219,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:t(6220,e.DiagnosticCategory.Message,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:t(6221,e.DiagnosticCategory.Message,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:t(6222,e.DiagnosticCategory.Message,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:t(6223,e.DiagnosticCategory.Message,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:t(6224,e.DiagnosticCategory.Message,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:t(6225,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:t(6226,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:t(6227,e.DiagnosticCategory.Message,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:t(6229,e.DiagnosticCategory.Error,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:t(6230,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:t(6231,e.DiagnosticCategory.Error,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:t(6232,e.DiagnosticCategory.Error,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:t(6233,e.DiagnosticCategory.Error,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:t(6234,e.DiagnosticCategory.Error,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:t(6235,e.DiagnosticCategory.Message,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:t(6236,e.DiagnosticCategory.Error,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:t(6237,e.DiagnosticCategory.Message,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:t(6238,e.DiagnosticCategory.Error,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:t(6239,e.DiagnosticCategory.Message,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:t(6240,e.DiagnosticCategory.Message,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:t(6241,e.DiagnosticCategory.Message,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:t(6242,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:t(6243,e.DiagnosticCategory.Message,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:t(6244,e.DiagnosticCategory.Message,"Modules_6244","Modules"),File_Management:t(6245,e.DiagnosticCategory.Message,"File_Management_6245","File Management"),Emit:t(6246,e.DiagnosticCategory.Message,"Emit_6246","Emit"),JavaScript_Support:t(6247,e.DiagnosticCategory.Message,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:t(6248,e.DiagnosticCategory.Message,"Type_Checking_6248","Type Checking"),Editor_Support:t(6249,e.DiagnosticCategory.Message,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:t(6250,e.DiagnosticCategory.Message,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:t(6251,e.DiagnosticCategory.Message,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:t(6252,e.DiagnosticCategory.Message,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:t(6253,e.DiagnosticCategory.Message,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:t(6254,e.DiagnosticCategory.Message,"Language_and_Environment_6254","Language and Environment"),Projects:t(6255,e.DiagnosticCategory.Message,"Projects_6255","Projects"),Output_Formatting:t(6256,e.DiagnosticCategory.Message,"Output_Formatting_6256","Output Formatting"),Completeness:t(6257,e.DiagnosticCategory.Message,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:t(6258,e.DiagnosticCategory.Error,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_1:t(6259,e.DiagnosticCategory.Message,"Found_1_error_in_1_6259","Found 1 error in {1}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:t(6260,e.DiagnosticCategory.Message,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:t(6261,e.DiagnosticCategory.Message,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:t(6270,e.DiagnosticCategory.Message,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6271,e.DiagnosticCategory.Message,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:t(6272,e.DiagnosticCategory.Message,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:t(6273,e.DiagnosticCategory.Message,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:t(6274,e.DiagnosticCategory.Message,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:t(6275,e.DiagnosticCategory.Message,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6276,e.DiagnosticCategory.Message,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Enable_project_compilation:t(6302,e.DiagnosticCategory.Message,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:t(6304,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:t(6305,e.DiagnosticCategory.Error,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:t(6306,e.DiagnosticCategory.Error,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:t(6307,e.DiagnosticCategory.Error,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:t(6308,e.DiagnosticCategory.Error,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:t(6309,e.DiagnosticCategory.Error,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:t(6310,e.DiagnosticCategory.Error,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:t(6350,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:t(6351,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:t(6352,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:t(6353,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:t(6354,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:t(6355,e.DiagnosticCategory.Message,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:t(6356,e.DiagnosticCategory.Message,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:t(6357,e.DiagnosticCategory.Message,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:t(6358,e.DiagnosticCategory.Message,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:t(6359,e.DiagnosticCategory.Message,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:t(6361,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:t(6362,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:t(6363,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:t(6364,e.DiagnosticCategory.Message,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:t(6365,e.DiagnosticCategory.Message,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:t(6367,e.DiagnosticCategory.Message,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:t(6369,e.DiagnosticCategory.Error,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:t(6370,e.DiagnosticCategory.Error,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:t(6371,e.DiagnosticCategory.Message,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:t(6372,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:t(6373,e.DiagnosticCategory.Message,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:t(6374,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:t(6375,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:t(6376,e.DiagnosticCategory.Message,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:t(6377,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:t(6379,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:t(6380,e.DiagnosticCategory.Message,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:t(6381,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:t(6382,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:t(6383,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6384,e.DiagnosticCategory.Message,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:t(6385,e.DiagnosticCategory.Suggestion,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:t(6386,e.DiagnosticCategory.Message,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:t(6387,e.DiagnosticCategory.Suggestion,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:t(6388,e.DiagnosticCategory.Message,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:t(6389,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6390,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6391,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:t(6392,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6393,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6394,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6395,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6396,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6397,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6398,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:t(6399,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:t(6400,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:t(6401,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:t(6402,e.DiagnosticCategory.Message,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:t(6403,e.DiagnosticCategory.Message,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:t(6404,e.DiagnosticCategory.Message,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:t(6405,e.DiagnosticCategory.Message,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:t(6500,e.DiagnosticCategory.Message,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:t(6501,e.DiagnosticCategory.Message,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:t(6502,e.DiagnosticCategory.Message,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:t(6503,e.DiagnosticCategory.Message,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:t(6504,e.DiagnosticCategory.Error,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:t(6505,e.DiagnosticCategory.Message,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:t(6506,e.DiagnosticCategory.Message,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:t(6600,e.DiagnosticCategory.Message,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:t(6601,e.DiagnosticCategory.Message,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:t(6602,e.DiagnosticCategory.Message,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:t(6603,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:t(6604,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:t(6605,e.DiagnosticCategory.Message,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6606,e.DiagnosticCategory.Message,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:t(6607,e.DiagnosticCategory.Message,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:t(6608,e.DiagnosticCategory.Message,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:t(6609,e.DiagnosticCategory.Message,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:t(6611,e.DiagnosticCategory.Message,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:t(6612,e.DiagnosticCategory.Message,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:t(6613,e.DiagnosticCategory.Message,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:t(6614,e.DiagnosticCategory.Message,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:t(6615,e.DiagnosticCategory.Message,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:t(6616,e.DiagnosticCategory.Message,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:t(6617,e.DiagnosticCategory.Message,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:t(6618,e.DiagnosticCategory.Message,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:t(6619,e.DiagnosticCategory.Message,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:t(6620,e.DiagnosticCategory.Message,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:t(6621,e.DiagnosticCategory.Message,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:t(6622,e.DiagnosticCategory.Message,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:t(6623,e.DiagnosticCategory.Message,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:t(6624,e.DiagnosticCategory.Message,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:t(6625,e.DiagnosticCategory.Message,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:t(6626,e.DiagnosticCategory.Message,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:t(6627,e.DiagnosticCategory.Message,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:t(6628,e.DiagnosticCategory.Message,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:t(6629,e.DiagnosticCategory.Message,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_TC39_stage_2_draft_decorators:t(6630,e.DiagnosticCategory.Message,"Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630","Enable experimental support for TC39 stage 2 draft decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:t(6631,e.DiagnosticCategory.Message,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:t(6632,e.DiagnosticCategory.Message,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:t(6633,e.DiagnosticCategory.Message,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:t(6634,e.DiagnosticCategory.Message,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:t(6635,e.DiagnosticCategory.Message,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:t(6636,e.DiagnosticCategory.Message,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:t(6637,e.DiagnosticCategory.Message,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:t(6638,e.DiagnosticCategory.Message,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:t(6639,e.DiagnosticCategory.Message,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:t(6641,e.DiagnosticCategory.Message,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:t(6642,e.DiagnosticCategory.Message,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:t(6643,e.DiagnosticCategory.Message,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:t(6644,e.DiagnosticCategory.Message,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:t(6645,e.DiagnosticCategory.Message,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:t(6646,e.DiagnosticCategory.Message,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:t(6647,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:t(6648,e.DiagnosticCategory.Message,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:t(6649,e.DiagnosticCategory.Message,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:t(6650,e.DiagnosticCategory.Message,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:t(6651,e.DiagnosticCategory.Message,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:t(6652,e.DiagnosticCategory.Message,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:t(6653,e.DiagnosticCategory.Message,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:t(6654,e.DiagnosticCategory.Message,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:t(6655,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:t(6656,e.DiagnosticCategory.Message,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:t(6657,e.DiagnosticCategory.Message,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:t(6658,e.DiagnosticCategory.Message,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:t(6659,e.DiagnosticCategory.Message,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:t(6660,e.DiagnosticCategory.Message,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:t(6661,e.DiagnosticCategory.Message,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:t(6662,e.DiagnosticCategory.Message,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:t(6663,e.DiagnosticCategory.Message,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:t(6664,e.DiagnosticCategory.Message,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:t(6665,e.DiagnosticCategory.Message,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:t(6666,e.DiagnosticCategory.Message,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:t(6667,e.DiagnosticCategory.Message,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:t(6668,e.DiagnosticCategory.Message,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:t(6669,e.DiagnosticCategory.Message,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:t(6670,e.DiagnosticCategory.Message,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:t(6671,e.DiagnosticCategory.Message,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:t(6672,e.DiagnosticCategory.Message,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:t(6673,e.DiagnosticCategory.Message,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:t(6674,e.DiagnosticCategory.Message,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:t(6675,e.DiagnosticCategory.Message,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:t(6676,e.DiagnosticCategory.Message,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:t(6677,e.DiagnosticCategory.Message,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:t(6678,e.DiagnosticCategory.Message,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:t(6679,e.DiagnosticCategory.Message,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:t(6680,e.DiagnosticCategory.Message,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:t(6681,e.DiagnosticCategory.Message,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:t(6682,e.DiagnosticCategory.Message,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:t(6683,e.DiagnosticCategory.Message,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:t(6684,e.DiagnosticCategory.Message,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:t(6685,e.DiagnosticCategory.Message,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:t(6686,e.DiagnosticCategory.Message,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:t(6687,e.DiagnosticCategory.Message,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:t(6688,e.DiagnosticCategory.Message,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:t(6689,e.DiagnosticCategory.Message,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:t(6690,e.DiagnosticCategory.Message,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:t(6691,e.DiagnosticCategory.Message,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:t(6692,e.DiagnosticCategory.Message,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:t(6693,e.DiagnosticCategory.Message,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:t(6694,e.DiagnosticCategory.Message,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:t(6695,e.DiagnosticCategory.Message,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:t(6697,e.DiagnosticCategory.Message,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:t(6698,e.DiagnosticCategory.Message,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:t(6699,e.DiagnosticCategory.Message,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:t(6700,e.DiagnosticCategory.Message,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:t(6701,e.DiagnosticCategory.Message,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:t(6702,e.DiagnosticCategory.Message,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:t(6703,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:t(6704,e.DiagnosticCategory.Message,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:t(6705,e.DiagnosticCategory.Message,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:t(6706,e.DiagnosticCategory.Message,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:t(6707,e.DiagnosticCategory.Message,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:t(6709,e.DiagnosticCategory.Message,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:t(6710,e.DiagnosticCategory.Message,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:t(6711,e.DiagnosticCategory.Message,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:t(6712,e.DiagnosticCategory.Message,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:t(6713,e.DiagnosticCategory.Message,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:t(6714,e.DiagnosticCategory.Message,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:t(6715,e.DiagnosticCategory.Message,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:t(6717,e.DiagnosticCategory.Message,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:t(6718,e.DiagnosticCategory.Message,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Default_catch_clause_variables_as_unknown_instead_of_any:t(6803,e.DiagnosticCategory.Message,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),one_of_Colon:t(6900,e.DiagnosticCategory.Message,"one_of_Colon_6900","one of:"),one_or_more_Colon:t(6901,e.DiagnosticCategory.Message,"one_or_more_Colon_6901","one or more:"),type_Colon:t(6902,e.DiagnosticCategory.Message,"type_Colon_6902","type:"),default_Colon:t(6903,e.DiagnosticCategory.Message,"default_Colon_6903","default:"),module_system_or_esModuleInterop:t(6904,e.DiagnosticCategory.Message,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:t(6905,e.DiagnosticCategory.Message,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:t(6906,e.DiagnosticCategory.Message,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:t(6907,e.DiagnosticCategory.Message,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:t(6908,e.DiagnosticCategory.Message,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:t(6909,e.DiagnosticCategory.Message,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:t(69010,e.DiagnosticCategory.Message,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:t(6911,e.DiagnosticCategory.Message,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:t(6912,e.DiagnosticCategory.Message,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:t(6913,e.DiagnosticCategory.Message,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:t(6914,e.DiagnosticCategory.Message,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:t(6915,e.DiagnosticCategory.Message,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:t(6916,e.DiagnosticCategory.Message,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:t(6917,e.DiagnosticCategory.Message,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:t(6918,e.DiagnosticCategory.Message,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:t(6919,e.DiagnosticCategory.Message,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:t(6920,e.DiagnosticCategory.Message,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:t(6921,e.DiagnosticCategory.Message,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:t(6922,e.DiagnosticCategory.Message,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:t(6923,e.DiagnosticCategory.Message,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:t(6924,e.DiagnosticCategory.Message,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:t(6925,e.DiagnosticCategory.Message,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:t(6926,e.DiagnosticCategory.Message,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:t(6927,e.DiagnosticCategory.Message,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:t(6928,e.DiagnosticCategory.Message,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:t(6929,e.DiagnosticCategory.Message,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:t(6930,e.DiagnosticCategory.Message,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:t(6931,e.DiagnosticCategory.Error,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:t(7005,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:t(7006,e.DiagnosticCategory.Error,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:t(7008,e.DiagnosticCategory.Error,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:t(7009,e.DiagnosticCategory.Error,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:t(7010,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7011,e.DiagnosticCategory.Error,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7013,e.DiagnosticCategory.Error,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7014,e.DiagnosticCategory.Error,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:t(7015,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:t(7016,e.DiagnosticCategory.Error,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:t(7017,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:t(7018,e.DiagnosticCategory.Error,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:t(7019,e.DiagnosticCategory.Error,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7020,e.DiagnosticCategory.Error,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:t(7022,e.DiagnosticCategory.Error,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7023,e.DiagnosticCategory.Error,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7024,e.DiagnosticCategory.Error,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:t(7025,e.DiagnosticCategory.Error,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:t(7026,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:t(7027,e.DiagnosticCategory.Error,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:t(7028,e.DiagnosticCategory.Error,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:t(7029,e.DiagnosticCategory.Error,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:t(7030,e.DiagnosticCategory.Error,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:t(7031,e.DiagnosticCategory.Error,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:t(7032,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:t(7033,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:t(7034,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:t(7035,e.DiagnosticCategory.Error,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:t(7036,e.DiagnosticCategory.Error,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:t(7037,e.DiagnosticCategory.Message,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:t(7038,e.DiagnosticCategory.Message,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:t(7039,e.DiagnosticCategory.Error,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:t(7040,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:t(7041,e.DiagnosticCategory.Error,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:t(7042,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7043,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7044,e.DiagnosticCategory.Suggestion,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7045,e.DiagnosticCategory.Suggestion,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:t(7046,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:t(7047,e.DiagnosticCategory.Suggestion,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:t(7048,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:t(7049,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:t(7050,e.DiagnosticCategory.Suggestion,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:t(7051,e.DiagnosticCategory.Error,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:t(7052,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:t(7053,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:t(7054,e.DiagnosticCategory.Error,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:t(7055,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:t(7056,e.DiagnosticCategory.Error,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:t(7057,e.DiagnosticCategory.Error,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:t(7058,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:t(7059,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:t(7060,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:t(7061,e.DiagnosticCategory.Error,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:t(8e3,e.DiagnosticCategory.Error,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:t(8001,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:t(8002,e.DiagnosticCategory.Error,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:t(8003,e.DiagnosticCategory.Error,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:t(8004,e.DiagnosticCategory.Error,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:t(8005,e.DiagnosticCategory.Error,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:t(8006,e.DiagnosticCategory.Error,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:t(8008,e.DiagnosticCategory.Error,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:t(8009,e.DiagnosticCategory.Error,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:t(8010,e.DiagnosticCategory.Error,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:t(8011,e.DiagnosticCategory.Error,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:t(8012,e.DiagnosticCategory.Error,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:t(8013,e.DiagnosticCategory.Error,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:t(8016,e.DiagnosticCategory.Error,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:t(8017,e.DiagnosticCategory.Error,"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017","Octal literal types must use ES2015 syntax. Use the syntax '{0}'."),Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0:t(8018,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018","Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."),Report_errors_in_js_files:t(8019,e.DiagnosticCategory.Message,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:t(8020,e.DiagnosticCategory.Error,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:t(8021,e.DiagnosticCategory.Error,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:t(8022,e.DiagnosticCategory.Error,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:t(8023,e.DiagnosticCategory.Error,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:t(8024,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:t(8025,e.DiagnosticCategory.Error,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:t(8026,e.DiagnosticCategory.Error,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:t(8027,e.DiagnosticCategory.Error,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:t(8028,e.DiagnosticCategory.Error,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:t(8029,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:t(8030,e.DiagnosticCategory.Error,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:t(8031,e.DiagnosticCategory.Error,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:t(8032,e.DiagnosticCategory.Error,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:t(8033,e.DiagnosticCategory.Error,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:t(8034,e.DiagnosticCategory.Error,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:t(8035,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:t(8036,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:t(8037,e.DiagnosticCategory.Error,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:t(9005,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:t(9006,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:t(17e3,e.DiagnosticCategory.Error,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:t(17001,e.DiagnosticCategory.Error,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:t(17002,e.DiagnosticCategory.Error,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:t(17004,e.DiagnosticCategory.Error,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:t(17005,e.DiagnosticCategory.Error,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17006,e.DiagnosticCategory.Error,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17007,e.DiagnosticCategory.Error,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:t(17008,e.DiagnosticCategory.Error,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:t(17009,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:t(17010,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:t(17011,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:t(17012,e.DiagnosticCategory.Error,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:t(17013,e.DiagnosticCategory.Error,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:t(17014,e.DiagnosticCategory.Error,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:t(17015,e.DiagnosticCategory.Error,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:t(17016,e.DiagnosticCategory.Error,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:t(17017,e.DiagnosticCategory.Error,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:t(17018,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),Circularity_detected_while_resolving_configuration_Colon_0:t(18e3,e.DiagnosticCategory.Error,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:t(18002,e.DiagnosticCategory.Error,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:t(18003,e.DiagnosticCategory.Error,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:t(80001,e.DiagnosticCategory.Suggestion,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:t(80002,e.DiagnosticCategory.Suggestion,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:t(80003,e.DiagnosticCategory.Suggestion,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:t(80004,e.DiagnosticCategory.Suggestion,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:t(80005,e.DiagnosticCategory.Suggestion,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:t(80006,e.DiagnosticCategory.Suggestion,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:t(80007,e.DiagnosticCategory.Suggestion,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:t(80008,e.DiagnosticCategory.Suggestion,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),Add_missing_super_call:t(90001,e.DiagnosticCategory.Message,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:t(90002,e.DiagnosticCategory.Message,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:t(90003,e.DiagnosticCategory.Message,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:t(90004,e.DiagnosticCategory.Message,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:t(90005,e.DiagnosticCategory.Message,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:t(90006,e.DiagnosticCategory.Message,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:t(90007,e.DiagnosticCategory.Message,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:t(90008,e.DiagnosticCategory.Message,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:t(90010,e.DiagnosticCategory.Message,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:t(90011,e.DiagnosticCategory.Message,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:t(90012,e.DiagnosticCategory.Message,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:t(90013,e.DiagnosticCategory.Message,"Import_0_from_1_90013","Import '{0}' from \"{1}\""),Change_0_to_1:t(90014,e.DiagnosticCategory.Message,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:t(90016,e.DiagnosticCategory.Message,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:t(90017,e.DiagnosticCategory.Message,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:t(90018,e.DiagnosticCategory.Message,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:t(90019,e.DiagnosticCategory.Message,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:t(90020,e.DiagnosticCategory.Message,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:t(90021,e.DiagnosticCategory.Message,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:t(90022,e.DiagnosticCategory.Message,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:t(90023,e.DiagnosticCategory.Message,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:t(90024,e.DiagnosticCategory.Message,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:t(90025,e.DiagnosticCategory.Message,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:t(90026,e.DiagnosticCategory.Message,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:t(90027,e.DiagnosticCategory.Message,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:t(90028,e.DiagnosticCategory.Message,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:t(90029,e.DiagnosticCategory.Message,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:t(90030,e.DiagnosticCategory.Message,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:t(90031,e.DiagnosticCategory.Message,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:t(90034,e.DiagnosticCategory.Message,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:t(90035,e.DiagnosticCategory.Message,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:t(90036,e.DiagnosticCategory.Message,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:t(90037,e.DiagnosticCategory.Message,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:t(90038,e.DiagnosticCategory.Message,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:t(90039,e.DiagnosticCategory.Message,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:t(90041,e.DiagnosticCategory.Message,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:t(90053,e.DiagnosticCategory.Message,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:t(90054,e.DiagnosticCategory.Message,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:t(90055,e.DiagnosticCategory.Message,"Remove_type_from_import_declaration_from_0_90055","Remove 'type' from import declaration from \"{0}\""),Remove_type_from_import_of_0_from_1:t(90056,e.DiagnosticCategory.Message,"Remove_type_from_import_of_0_from_1_90056","Remove 'type' from import of '{0}' from \"{1}\""),Add_import_from_0:t(90057,e.DiagnosticCategory.Message,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:t(90058,e.DiagnosticCategory.Message,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:t(90059,e.DiagnosticCategory.Message,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:t(90060,e.DiagnosticCategory.Message,"Export_all_referenced_locals_90060","Export all referenced locals"),Convert_function_to_an_ES2015_class:t(95001,e.DiagnosticCategory.Message,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:t(95003,e.DiagnosticCategory.Message,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:t(95004,e.DiagnosticCategory.Message,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:t(95005,e.DiagnosticCategory.Message,"Extract_function_95005","Extract function"),Extract_constant:t(95006,e.DiagnosticCategory.Message,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:t(95007,e.DiagnosticCategory.Message,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:t(95008,e.DiagnosticCategory.Message,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:t(95009,e.DiagnosticCategory.Message,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:t(95011,e.DiagnosticCategory.Message,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:t(95012,e.DiagnosticCategory.Message,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:t(95013,e.DiagnosticCategory.Message,"Convert_to_default_import_95013","Convert to default import"),Install_0:t(95014,e.DiagnosticCategory.Message,"Install_0_95014","Install '{0}'"),Replace_import_with_0:t(95015,e.DiagnosticCategory.Message,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:t(95016,e.DiagnosticCategory.Message,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:t(95017,e.DiagnosticCategory.Message,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:t(95018,e.DiagnosticCategory.Message,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:t(95019,e.DiagnosticCategory.Message,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:t(95020,e.DiagnosticCategory.Message,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:t(95021,e.DiagnosticCategory.Message,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:t(95022,e.DiagnosticCategory.Message,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:t(95023,e.DiagnosticCategory.Message,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:t(95024,e.DiagnosticCategory.Message,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:t(95025,e.DiagnosticCategory.Message,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:t(95026,e.DiagnosticCategory.Message,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:t(95027,e.DiagnosticCategory.Message,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:t(95028,e.DiagnosticCategory.Message,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:t(95029,e.DiagnosticCategory.Message,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:t(95030,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:t(95031,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:t(95032,e.DiagnosticCategory.Message,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:t(95033,e.DiagnosticCategory.Message,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:t(95034,e.DiagnosticCategory.Message,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:t(95035,e.DiagnosticCategory.Message,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:t(95036,e.DiagnosticCategory.Message,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:t(95037,e.DiagnosticCategory.Message,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:t(95038,e.DiagnosticCategory.Message,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:t(95039,e.DiagnosticCategory.Message,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:t(95040,e.DiagnosticCategory.Message,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:t(95041,e.DiagnosticCategory.Message,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:t(95042,e.DiagnosticCategory.Message,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:t(95043,e.DiagnosticCategory.Message,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:t(95044,e.DiagnosticCategory.Message,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:t(95045,e.DiagnosticCategory.Message,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:t(95046,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:t(95047,e.DiagnosticCategory.Message,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:t(95048,e.DiagnosticCategory.Message,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:t(95049,e.DiagnosticCategory.Message,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:t(95050,e.DiagnosticCategory.Message,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:t(95051,e.DiagnosticCategory.Message,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:t(95052,e.DiagnosticCategory.Message,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:t(95053,e.DiagnosticCategory.Message,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:t(95054,e.DiagnosticCategory.Message,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:t(95055,e.DiagnosticCategory.Message,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:t(95056,e.DiagnosticCategory.Message,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:t(95057,e.DiagnosticCategory.Message,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:t(95058,e.DiagnosticCategory.Message,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:t(95059,e.DiagnosticCategory.Message,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:t(95060,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:t(95061,e.DiagnosticCategory.Message,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:t(95062,e.DiagnosticCategory.Message,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:t(95063,e.DiagnosticCategory.Message,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:t(95064,e.DiagnosticCategory.Message,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:t(95065,e.DiagnosticCategory.Message,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:t(95066,e.DiagnosticCategory.Message,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:t(95067,e.DiagnosticCategory.Message,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:t(95068,e.DiagnosticCategory.Message,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:t(95069,e.DiagnosticCategory.Message,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:t(95070,e.DiagnosticCategory.Message,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:t(95071,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:t(95072,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:t(95073,e.DiagnosticCategory.Message,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:t(95074,e.DiagnosticCategory.Message,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:t(95075,e.DiagnosticCategory.Message,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:t(95077,e.DiagnosticCategory.Message,"Extract_type_95077","Extract type"),Extract_to_type_alias:t(95078,e.DiagnosticCategory.Message,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:t(95079,e.DiagnosticCategory.Message,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:t(95080,e.DiagnosticCategory.Message,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:t(95081,e.DiagnosticCategory.Message,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:t(95082,e.DiagnosticCategory.Message,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:t(95083,e.DiagnosticCategory.Message,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:t(95084,e.DiagnosticCategory.Message,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:t(95085,e.DiagnosticCategory.Message,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:t(95086,e.DiagnosticCategory.Message,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:t(95087,e.DiagnosticCategory.Message,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:t(95088,e.DiagnosticCategory.Message,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:t(95089,e.DiagnosticCategory.Message,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:t(95090,e.DiagnosticCategory.Message,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:t(95091,e.DiagnosticCategory.Message,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:t(95092,e.DiagnosticCategory.Message,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:t(95093,e.DiagnosticCategory.Message,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:t(95094,e.DiagnosticCategory.Message,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:t(95095,e.DiagnosticCategory.Message,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:t(95096,e.DiagnosticCategory.Message,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:t(95097,e.DiagnosticCategory.Message,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:t(95098,e.DiagnosticCategory.Message,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:t(95099,e.DiagnosticCategory.Message,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:t(95100,e.DiagnosticCategory.Message,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:t(95101,e.DiagnosticCategory.Message,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:t(95102,e.DiagnosticCategory.Message,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:t(95105,e.DiagnosticCategory.Message,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:t(95106,e.DiagnosticCategory.Message,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:t(95107,e.DiagnosticCategory.Message,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:t(95108,e.DiagnosticCategory.Message,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:t(95109,e.DiagnosticCategory.Message,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:t(95110,e.DiagnosticCategory.Message,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:t(95111,e.DiagnosticCategory.Message,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:t(95112,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:t(95113,e.DiagnosticCategory.Message,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:t(95114,e.DiagnosticCategory.Message,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:t(95115,e.DiagnosticCategory.Message,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:t(95116,e.DiagnosticCategory.Message,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:t(95117,e.DiagnosticCategory.Message,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:t(95118,e.DiagnosticCategory.Message,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:t(95119,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:t(95120,e.DiagnosticCategory.Message,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:t(95121,e.DiagnosticCategory.Message,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:t(95122,e.DiagnosticCategory.Message,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:t(95123,e.DiagnosticCategory.Message,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:t(95124,e.DiagnosticCategory.Message,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:t(95125,e.DiagnosticCategory.Message,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:t(95126,e.DiagnosticCategory.Message,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:t(95127,e.DiagnosticCategory.Message,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:t(95128,e.DiagnosticCategory.Message,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:t(95129,e.DiagnosticCategory.Message,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:t(95130,e.DiagnosticCategory.Message,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:t(95131,e.DiagnosticCategory.Message,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:t(95132,e.DiagnosticCategory.Message,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:t(95133,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:t(95134,e.DiagnosticCategory.Message,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:t(95135,e.DiagnosticCategory.Message,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:t(95136,e.DiagnosticCategory.Message,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:t(95137,e.DiagnosticCategory.Message,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:t(95138,e.DiagnosticCategory.Message,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:t(95139,e.DiagnosticCategory.Message,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:t(95140,e.DiagnosticCategory.Message,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:t(95141,e.DiagnosticCategory.Message,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:t(95142,e.DiagnosticCategory.Message,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:t(95143,e.DiagnosticCategory.Message,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:t(95144,e.DiagnosticCategory.Message,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:t(95145,e.DiagnosticCategory.Message,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:t(95146,e.DiagnosticCategory.Message,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:t(95147,e.DiagnosticCategory.Message,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:t(95148,e.DiagnosticCategory.Message,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:t(95149,e.DiagnosticCategory.Message,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:t(95150,e.DiagnosticCategory.Message,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:t(95151,e.DiagnosticCategory.Message,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:t(95152,e.DiagnosticCategory.Message,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:t(95153,e.DiagnosticCategory.Message,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenation:t(95154,e.DiagnosticCategory.Message,"Can_only_convert_string_concatenation_95154","Can only convert string concatenation"),Selection_is_not_a_valid_statement_or_statements:t(95155,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:t(95156,e.DiagnosticCategory.Message,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:t(95157,e.DiagnosticCategory.Message,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:t(95158,e.DiagnosticCategory.Message,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:t(95159,e.DiagnosticCategory.Message,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:t(95160,e.DiagnosticCategory.Message,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:t(95161,e.DiagnosticCategory.Message,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:t(95162,e.DiagnosticCategory.Message,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:t(95163,e.DiagnosticCategory.Message,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:t(95164,e.DiagnosticCategory.Message,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:t(95165,e.DiagnosticCategory.Message,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:t(95166,e.DiagnosticCategory.Message,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:t(95167,e.DiagnosticCategory.Message,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:t(95168,e.DiagnosticCategory.Message,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:t(95169,e.DiagnosticCategory.Message,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:t(95170,e.DiagnosticCategory.Message,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:t(95171,e.DiagnosticCategory.Message,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:t(95172,e.DiagnosticCategory.Message,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:t(95173,e.DiagnosticCategory.Message,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:t(95174,e.DiagnosticCategory.Message,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:t(95175,e.DiagnosticCategory.Message,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:t(18004,e.DiagnosticCategory.Error,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:t(18006,e.DiagnosticCategory.Error,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:t(18007,e.DiagnosticCategory.Error,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:t(18009,e.DiagnosticCategory.Error,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:t(18010,e.DiagnosticCategory.Error,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:t(18011,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:t(18012,e.DiagnosticCategory.Error,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:t(18013,e.DiagnosticCategory.Error,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:t(18014,e.DiagnosticCategory.Error,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:t(18015,e.DiagnosticCategory.Error,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:t(18016,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:t(18017,e.DiagnosticCategory.Error,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:t(18018,e.DiagnosticCategory.Error,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:t(18019,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:t(18024,e.DiagnosticCategory.Error,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:t(18026,e.DiagnosticCategory.Error,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:t(18027,e.DiagnosticCategory.Error,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18028,e.DiagnosticCategory.Error,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:t(18029,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:t(18030,e.DiagnosticCategory.Error,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:t(18031,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:t(18032,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead:t(18033,e.DiagnosticCategory.Error,"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033","Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:t(18034,e.DiagnosticCategory.Message,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:t(18035,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:t(18036,e.DiagnosticCategory.Error,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),Await_expression_cannot_be_used_inside_a_class_static_block:t(18037,e.DiagnosticCategory.Error,"Await_expression_cannot_be_used_inside_a_class_static_block_18037","Await expression cannot be used inside a class static block."),For_await_loops_cannot_be_used_inside_a_class_static_block:t(18038,e.DiagnosticCategory.Error,"For_await_loops_cannot_be_used_inside_a_class_static_block_18038","'For await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:t(18039,e.DiagnosticCategory.Error,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:t(18041,e.DiagnosticCategory.Error,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block."),_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation:t(18042,e.DiagnosticCategory.Error,"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:t(18043,e.DiagnosticCategory.Error,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:t(18044,e.DiagnosticCategory.Message,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18045,e.DiagnosticCategory.Error,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:t(18046,e.DiagnosticCategory.Error,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:t(18047,e.DiagnosticCategory.Error,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:t(18048,e.DiagnosticCategory.Error,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:t(18049,e.DiagnosticCategory.Error,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:t(18050,e.DiagnosticCategory.Error,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here.")};}(t),function(e){var t;function r(e){return e>=79}e.tokenIsIdentifierOrKeyword=r,e.tokenIsIdentifierOrKeywordOrGreaterThan=function(e){return 31===e||r(e)},e.textToKeywordObj=((t={abstract:126,accessor:127,any:131,as:128,asserts:129,assert:130,bigint:160,boolean:134,break:81,case:82,catch:83,class:84,continue:86,const:85}).constructor=135,t.debugger=87,t.declare=136,t.default=88,t.delete=89,t.do=90,t.else=91,t.enum=92,t.export=93,t.extends=94,t.false=95,t.finally=96,t.for=97,t.from=158,t.function=98,t.get=137,t.if=99,t.implements=117,t.import=100,t.in=101,t.infer=138,t.instanceof=102,t.interface=118,t.intrinsic=139,t.is=140,t.keyof=141,t.let=119,t.module=142,t.namespace=143,t.never=144,t.new=103,t.null=104,t.number=148,t.object=149,t.package=120,t.private=121,t.protected=122,t.public=123,t.override=161,t.out=145,t.readonly=146,t.require=147,t.global=159,t.return=105,t.satisfies=150,t.set=151,t.static=124,t.string=152,t.super=106,t.switch=107,t.symbol=153,t.this=108,t.throw=109,t.true=110,t.try=111,t.type=154,t.typeof=112,t.undefined=155,t.unique=156,t.unknown=157,t.var=113,t.void=114,t.while=115,t.with=116,t.yield=125,t.async=132,t.await=133,t.of=162,t);var n=new e.Map(e.getEntries(e.textToKeywordObj)),a=new e.Map(e.getEntries(i$1(i$1({},e.textToKeywordObj),{"{":18,"}":19,"(":20,")":21,"[":22,"]":23,".":24,"...":25,";":26,",":27,"<":29,">":31,"<=":32,">=":33,"==":34,"!=":35,"===":36,"!==":37,"=>":38,"+":39,"-":40,"**":42,"*":41,"/":43,"%":44,"++":45,"--":46,"<<":47,"</":30,">>":48,">>>":49,"&":50,"|":51,"^":52,"!":53,"~":54,"&&":55,"||":56,"?":57,"??":60,"?.":28,":":58,"=":63,"+=":64,"-=":65,"*=":66,"**=":67,"/=":68,"%=":69,"<<=":70,">>=":71,">>>=":72,"&=":73,"|=":74,"^=":78,"||=":75,"&&=":76,"??=":77,"@":59,"#":62,"`":61}))),o=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],s=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],c=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],l=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],u=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],_=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],d=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,p=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;function f(e,t){if(e<t[0])return !1;for(var r,n=0,i=t.length;n+1<i;){if(r=n+(i-n)/2,t[r-=r%2]<=e&&e<=t[r+1])return !0;e<t[r]?i=r:n=r+2;}return !1}function g(e,t){return f(e,t>=2?u:1===t?c:o)}e.isUnicodeIdentifierStart=g;var m,y=(m=[],a.forEach((function(e,t){m[e]=t;})),m);function v(e){for(var t=[],r=0,n=0;r<e.length;){var i=e.charCodeAt(r);switch(r++,i){case 13:10===e.charCodeAt(r)&&r++;case 10:t.push(n),n=r;break;default:i>127&&C(i)&&(t.push(n),n=r);}}return t.push(n),t}function h(t,r,n,i,a){(r<0||r>=t.length)&&(a?r=r<0?0:r>=t.length?t.length-1:r:e.Debug.fail("Bad line number. Line: ".concat(r,", lineStarts.length: ").concat(t.length," , line map is correct? ").concat(void 0!==i?e.arraysEqual(t,v(i)):"unknown")));var o=t[r]+n;return a?o>t[r+1]?t[r+1]:"string"==typeof i&&o>i.length?i.length:o:(r<t.length-1?e.Debug.assert(o<t[r+1]):void 0!==i&&e.Debug.assert(o<=i.length),o)}function b(e){return e.lineMap||(e.lineMap=v(e.text))}function x(e,t){var r=D(e,t);return {line:r,character:t-e[r]}}function D(t,r,n){var i=e.binarySearch(t,r,e.identity,e.compareValues,n);return i<0&&(i=~i-1,e.Debug.assert(-1!==i,"position cannot precede the beginning of the file")),i}function S(e){return T(e)||C(e)}function T(e){return 32===e||9===e||11===e||12===e||160===e||133===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function C(e){return 10===e||13===e||8232===e||8233===e}function E(e){return e>=48&&e<=57}function k(e){return E(e)||e>=65&&e<=70||e>=97&&e<=102}function N(e){return e>=48&&e<=55}e.tokenToString=function(e){return y[e]},e.stringToToken=function(e){return a.get(e)},e.computeLineStarts=v,e.getPositionOfLineAndCharacter=function(e,t,r,n){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,n):h(b(e),t,r,e.text,n)},e.computePositionOfLineAndCharacter=h,e.getLineStarts=b,e.computeLineAndCharacterOfPosition=x,e.computeLineOfPosition=D,e.getLinesBetweenPositions=function(e,t,r){if(t===r)return 0;var n=b(e),i=Math.min(t,r),a=i===r,o=a?t:r,s=D(n,i),c=D(n,o,s);return a?s-c:c-s},e.getLineAndCharacterOfPosition=function(e,t){return x(b(e),t)},e.isWhiteSpaceLike=S,e.isWhiteSpaceSingleLine=T,e.isLineBreak=C,e.isOctalDigit=N,e.couldStartTrivia=function(e,t){var r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return !0;case 35:return 0===t;default:return r>127}},e.skipTrivia=function(t,r,n,i,a){if(e.positionIsSynthesized(r))return r;for(var o=!1;;){var s=t.charCodeAt(r);switch(s){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)return r;o=!!a;continue;case 9:case 11:case 12:case 32:r++;continue;case 47:if(i)break;if(47===t.charCodeAt(r+1)){for(r+=2;r<t.length&&!C(t.charCodeAt(r));)r++;o=!1;continue}if(42===t.charCodeAt(r+1)){for(r+=2;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}o=!1;continue}break;case 60:case 124:case 61:case 62:if(F(t,r)){r=P(t,r),o=!1;continue}break;case 35:if(0===r&&I(t,r)){r=O(t,r),o=!1;continue}break;case 42:if(o){r++,o=!1;continue}break;default:if(s>127&&S(s)){r++;continue}}return r}};var A="<<<<<<<".length;function F(t,r){if(e.Debug.assert(r>=0),0===r||C(t.charCodeAt(r-1))){var n=t.charCodeAt(r);if(r+A<t.length){for(var i=0;i<A;i++)if(t.charCodeAt(r+i)!==n)return !1;return 61===n||32===t.charCodeAt(r+A)}}return !1}function P(t,r,n){n&&n(e.Diagnostics.Merge_conflict_marker_encountered,r,A);var i=t.charCodeAt(r),a=t.length;if(60===i||62===i)for(;r<a&&!C(t.charCodeAt(r));)r++;else for(e.Debug.assert(124===i||61===i);r<a;){var o=t.charCodeAt(r);if((61===o||62===o)&&o!==i&&F(t,r))break;r++;}return r}var w=/^#!.*/;function I(t,r){return e.Debug.assert(0===r),w.test(t)}function O(e,t){return t+w.exec(e)[0].length}function M(e,t,r,n,i,a,o){var s,c,l,u,_=!1,d=n,p=o;if(0===r){d=!0;var f=j(t);f&&(r=f.length);}e:for(;r>=0&&r<t.length;){var g=t.charCodeAt(r);switch(g){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)break e;d=!0,_&&(u=!0);continue;case 9:case 11:case 12:case 32:r++;continue;case 47:var m=t.charCodeAt(r+1),y=!1;if(47===m||42===m){var v=47===m?2:3,h=r;if(r+=2,47===m)for(;r<t.length;){if(C(t.charCodeAt(r))){y=!0;break}r++;}else for(;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}if(d){if(_&&(p=i(s,c,l,u,a,p),!e&&p))return p;s=h,c=r,l=v,u=y,_=!0;}continue}break e;default:if(g>127&&S(g)){_&&C(g)&&(u=!0),r++;continue}break e}}return _&&(p=i(s,c,l,u,a,p)),p}function L(e,t,r,n,i){return M(!0,e,t,!1,r,n,i)}function R(e,t,r,n,i){return M(!0,e,t,!0,r,n,i)}function B(e,t,r,n,i,a){return a||(a=[]),a.push({kind:r,pos:e,end:t,hasTrailingNewLine:n}),a}function j(e){var t=w.exec(e);if(t)return t[0]}function J(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&g(e,t)}function z(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||1===r&&(45===e||58===e)||e>127&&function(e,t){return f(e,t>=2?_:1===t?l:s)}(e,t)}e.isShebangTrivia=I,e.scanShebangTrivia=O,e.forEachLeadingCommentRange=function(e,t,r,n){return M(!1,e,t,!1,r,n)},e.forEachTrailingCommentRange=function(e,t,r,n){return M(!1,e,t,!0,r,n)},e.reduceEachLeadingCommentRange=L,e.reduceEachTrailingCommentRange=R,e.getLeadingCommentRanges=function(e,t){return L(e,t,B,void 0,void 0)},e.getTrailingCommentRanges=function(e,t){return R(e,t,B,void 0,void 0)},e.getShebang=j,e.isIdentifierStart=J,e.isIdentifierPart=z,e.isIdentifierText=function(e,t,r){var n=U(e,0);if(!J(n,t))return !1;for(var i=K(n);i<e.length;i+=K(n))if(!z(n=U(e,i),t,r))return !1;return !0},e.createScanner=function(t,i,a,o,s,c,l){void 0===a&&(a=0);var u,_,f,g,m,y,v,h,b=o,x=0;le(b,c,l);var D={getStartPos:function(){return f},getTextPos:function(){return u},getToken:function(){return m},getTokenPos:function(){return g},getTokenText:function(){return b.substring(g,u)},getTokenValue:function(){return y},hasUnicodeEscape:function(){return 0!=(1024&v)},hasExtendedUnicodeEscape:function(){return 0!=(8&v)},hasPrecedingLineBreak:function(){return 0!=(1&v)},hasPrecedingJSDocComment:function(){return 0!=(2&v)},isIdentifier:function(){return 79===m||m>116},isReservedWord:function(){return m>=81&&m<=116},isUnterminated:function(){return 0!=(4&v)},getCommentDirectives:function(){return h},getNumericLiteralFlags:function(){return 1008&v},getTokenFlags:function(){return v},reScanGreaterToken:function(){if(31===m){if(62===b.charCodeAt(u))return 62===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=72):(u+=2,m=49):61===b.charCodeAt(u+1)?(u+=2,m=71):(u++,m=48);if(61===b.charCodeAt(u))return u++,m=33}return m},reScanAsteriskEqualsToken:function(){return e.Debug.assert(66===m,"'reScanAsteriskEqualsToken' should only be called on a '*='"),u=g+1,m=63},reScanSlashToken:function(){if(43===m||68===m){for(var r=g+1,n=!1,i=!1;;){if(r>=_){v|=4,A(e.Diagnostics.Unterminated_regular_expression_literal);break}var a=b.charCodeAt(r);if(C(a)){v|=4,A(e.Diagnostics.Unterminated_regular_expression_literal);break}if(n)n=!1;else {if(47===a&&!i){r++;break}91===a?i=!0:92===a?n=!0:93===a&&(i=!1);}r++;}for(;r<_&&z(b.charCodeAt(r),t);)r++;u=r,y=b.substring(g,u),m=13;}return m},reScanTemplateToken:function(t){return e.Debug.assert(19===m,"'reScanTemplateToken' should only be called on a '}'"),u=g,m=H(t)},reScanTemplateHeadOrNoSubstitutionTemplate:function(){return u=g,m=H(!0)},scanJsxIdentifier:function(){if(r(m)){for(var e=!1;u<_;){var t=b.charCodeAt(u);if(45!==t)if(58!==t||e){var n=u;if(y+=$(),u===n)break}else y+=":",u++,e=!0,m=79;else y+="-",u++;}return ":"===y.slice(-1)&&(y=y.slice(0,-1),u--),ee()}return m},scanJsxAttributeValue:se,reScanJsxAttributeValue:function(){return u=g=f,se()},reScanJsxToken:function(e){return void 0===e&&(e=!0),u=g=f,m=oe(e)},reScanLessThanToken:function(){return 47===m?(u=g+1,m=29):m},reScanHashToken:function(){return 80===m?(u=g+1,m=62):m},reScanQuestionToken:function(){return e.Debug.assert(60===m,"'reScanQuestionToken' should only be called on a '??'"),u=g+1,m=57},reScanInvalidIdentifier:function(){e.Debug.assert(0===m,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),u=g=f,v=0;var t=U(b,u),r=ie(t,99);return r?m=r:(u+=K(t),m)},scanJsxToken:oe,scanJsDocToken:function(){if(f=g=u,v=0,u>=_)return m=1;var e=U(b,u);switch(u+=K(e),e){case 9:case 11:case 12:case 32:for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 64:return m=59;case 13:10===b.charCodeAt(u)&&u++;case 10:return v|=1,m=4;case 42:return m=41;case 123:return m=18;case 125:return m=19;case 91:return m=22;case 93:return m=23;case 60:return m=29;case 62:return m=31;case 61:return m=63;case 44:return m=27;case 46:return m=24;case 96:return m=61;case 35:return m=62;case 92:u--;var r=Z();if(r>=0&&J(r,t))return u+=3,v|=8,y=X()+$(),m=ee();var n=Y();return n>=0&&J(n,t)?(u+=6,v|=1024,y=String.fromCharCode(n)+$(),m=ee()):(u++,m=0)}if(J(e,t)){for(var i=e;u<_&&z(i=U(b,u),t)||45===b.charCodeAt(u);)u+=K(i);return y=b.substring(g,u),92===i&&(y+=$()),m=ee()}return m=0},scan:ne,getText:function(){return b},clearCommentDirectives:function(){h=void 0;},setText:le,setScriptTarget:function(e){t=e;},setLanguageVariant:function(e){a=e;},setOnError:function(e){s=e;},setTextPos:ue,setInJSDocType:function(e){x+=e?1:-1;},tryScan:function(e){return ce(e,!1)},lookAhead:function(e){return ce(e,!0)},scanRange:function(e,t,r){var n=_,i=u,a=f,o=g,s=m,c=y,l=v,d=h;le(b,e,t);var p=r();return _=n,u=i,f=a,g=o,m=s,y=c,v=l,h=d,p}};return e.Debug.isDebugging&&Object.defineProperty(D,"__debugShowCurrentPositionInText",{get:function(){var e=D.getText();return e.slice(0,D.getStartPos())+"║"+e.slice(D.getStartPos())}}),D;function A(e,t,r){if(void 0===t&&(t=u),s){var n=u;u=t,s(e,r||0),u=n;}}function w(){for(var t=u,r=!1,n=!1,i="";;){var a=b.charCodeAt(u);if(95!==a){if(!E(a))break;r=!0,n=!1,u++;}else v|=512,r?(r=!1,n=!0,i+=b.substring(t,u)):A(n?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),t=++u;}return 95===b.charCodeAt(u-1)&&A(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),i+b.substring(t,u)}function M(){var t,r,n=u,i=w();46===b.charCodeAt(u)&&(u++,t=w());var a,o=u;if(69===b.charCodeAt(u)||101===b.charCodeAt(u)){u++,v|=16,43!==b.charCodeAt(u)&&45!==b.charCodeAt(u)||u++;var s=u,c=w();c?(r=b.substring(o,s)+c,o=u):A(e.Diagnostics.Digit_expected);}if(512&v?(a=i,t&&(a+="."+t),r&&(a+=r)):a=b.substring(n,o),void 0!==t||16&v)return L(n,void 0===t&&!!(16&v)),{type:8,value:""+ +a};y=a;var l=re();return L(n),{type:l,value:y}}function L(r,n){if(J(U(b,u),t)){var i=u,a=$().length;1===a&&"n"===b[i]?A(n?e.Diagnostics.A_bigint_literal_cannot_use_exponential_notation:e.Diagnostics.A_bigint_literal_must_be_an_integer,r,i-r+1):(A(e.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal,i,a),u=i);}}function R(){for(var e=u;N(b.charCodeAt(u));)u++;return +b.substring(e,u)}function B(e,t){var r=V(e,!1,t);return r?parseInt(r,16):-1}function j(e,t){return V(e,!0,t)}function V(t,r,n){for(var i=[],a=!1,o=!1;i.length<t||r;){var s=b.charCodeAt(u);if(n&&95===s)v|=512,a?(a=!1,o=!0):A(o?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;else {if(a=n,s>=65&&s<=70)s+=32;else if(!(s>=48&&s<=57||s>=97&&s<=102))break;i.push(s),u++,o=!1;}}return i.length<t&&(i=[]),95===b.charCodeAt(u-1)&&A(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),String.fromCharCode.apply(String,i)}function W(t){void 0===t&&(t=!1);for(var r=b.charCodeAt(u),n="",i=++u;;){if(u>=_){n+=b.substring(i,u),v|=4,A(e.Diagnostics.Unterminated_string_literal);break}var a=b.charCodeAt(u);if(a===r){n+=b.substring(i,u),u++;break}if(92!==a||t){if(C(a)&&!t){n+=b.substring(i,u),v|=4,A(e.Diagnostics.Unterminated_string_literal);break}u++;}else n+=b.substring(i,u),n+=G(),i=u;}return n}function H(t){for(var r,n=96===b.charCodeAt(u),i=++u,a="";;){if(u>=_){a+=b.substring(i,u),v|=4,A(e.Diagnostics.Unterminated_template_literal),r=n?14:17;break}var o=b.charCodeAt(u);if(96===o){a+=b.substring(i,u),u++,r=n?14:17;break}if(36===o&&u+1<_&&123===b.charCodeAt(u+1)){a+=b.substring(i,u),u+=2,r=n?15:16;break}92!==o?13!==o?u++:(a+=b.substring(i,u),++u<_&&10===b.charCodeAt(u)&&u++,a+="\n",i=u):(a+=b.substring(i,u),a+=G(t),i=u);}return e.Debug.assert(void 0!==r),y=a,r}function G(t){var r=u;if(++u>=_)return A(e.Diagnostics.Unexpected_end_of_text),"";var n=b.charCodeAt(u);switch(u++,n){case 48:return t&&u<_&&E(b.charCodeAt(u))?(u++,v|=2048,b.substring(r,u)):"\0";case 98:return "\b";case 116:return "\t";case 110:return "\n";case 118:return "\v";case 102:return "\f";case 114:return "\r";case 39:return "'";case 34:return '"';case 117:if(t)for(var i=u;i<u+4;i++)if(i<_&&!k(b.charCodeAt(i))&&123!==b.charCodeAt(i))return u=i,v|=2048,b.substring(r,u);if(u<_&&123===b.charCodeAt(u)){if(u++,t&&!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(t){var a=u,o=j(1,!1);if(!((o?parseInt(o,16):-1)<=1114111&&125===b.charCodeAt(u)))return v|=2048,b.substring(r,u);u=a;}return v|=8,X()}return v|=1024,Q(4);case 120:if(t){if(!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(!k(b.charCodeAt(u+1)))return u++,v|=2048,b.substring(r,u)}return Q(2);case 13:u<_&&10===b.charCodeAt(u)&&u++;case 10:case 8232:case 8233:return "";default:return String.fromCharCode(n)}}function Q(t){var r=B(t,!1);return r>=0?String.fromCharCode(r):(A(e.Diagnostics.Hexadecimal_digit_expected),"")}function X(){var t=j(1,!1),r=t?parseInt(t,16):-1,n=!1;return r<0?(A(e.Diagnostics.Hexadecimal_digit_expected),n=!0):r>1114111&&(A(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),u>=_?(A(e.Diagnostics.Unexpected_end_of_text),n=!0):125===b.charCodeAt(u)?u++:(A(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":q(r)}function Y(){if(u+5<_&&117===b.charCodeAt(u+1)){var e=u;u+=2;var t=B(4,!1);return u=e,t}return -1}function Z(){if(117===U(b,u+1)&&123===U(b,u+2)){var e=u;u+=3;var t=j(1,!1),r=t?parseInt(t,16):-1;return u=e,r}return -1}function $(){for(var e="",r=u;u<_;){var n=U(b,u);if(z(n,t))u+=K(n);else {if(92!==n)break;if((n=Z())>=0&&z(n,t)){u+=3,v|=8,e+=X(),r=u;continue}if(!((n=Y())>=0&&z(n,t)))break;v|=1024,e+=b.substring(r,u),e+=q(n),r=u+=6;}}return e+b.substring(r,u)}function ee(){var e=y.length;if(e>=2&&e<=12){var t=y.charCodeAt(0);if(t>=97&&t<=122){var r=n.get(y);if(void 0!==r)return m=r}}return m=79}function te(t){for(var r="",n=!1,i=!1;;){var a=b.charCodeAt(u);if(95!==a){if(n=!0,!E(a)||a-48>=t)break;r+=b[u],u++,i=!1;}else v|=512,n?(n=!1,i=!0):A(i?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;}return 95===b.charCodeAt(u-1)&&A(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),r}function re(){if(110===b.charCodeAt(u))return y+="n",384&v&&(y=e.parsePseudoBigInt(y)+"n"),u++,9;var t=128&v?parseInt(y.slice(2),2):256&v?parseInt(y.slice(2),8):+y;return y=""+t,8}function ne(){var r;f=u,v=0;for(var n=!1;;){if(g=u,u>=_)return m=1;var o=U(b,u);if(35===o&&0===u&&I(b,u)){if(u=O(b,u),i)continue;return m=6}switch(o){case 10:case 13:if(v|=1,i){u++;continue}return 13===o&&u+1<_&&10===b.charCodeAt(u+1)?u+=2:u++,m=4;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 8203:case 8239:case 8287:case 12288:case 65279:if(i){u++;continue}for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 33:return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=37):(u+=2,m=35):(u++,m=53);case 34:case 39:return y=W(),m=10;case 96:return m=H(!1);case 37:return 61===b.charCodeAt(u+1)?(u+=2,m=69):(u++,m=44);case 38:return 38===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=76):(u+=2,m=55):61===b.charCodeAt(u+1)?(u+=2,m=73):(u++,m=50);case 40:return u++,m=20;case 41:return u++,m=21;case 42:if(61===b.charCodeAt(u+1))return u+=2,m=66;if(42===b.charCodeAt(u+1))return 61===b.charCodeAt(u+2)?(u+=3,m=67):(u+=2,m=42);if(u++,x&&!n&&1&v){n=!0;continue}return m=41;case 43:return 43===b.charCodeAt(u+1)?(u+=2,m=45):61===b.charCodeAt(u+1)?(u+=2,m=64):(u++,m=39);case 44:return u++,m=27;case 45:return 45===b.charCodeAt(u+1)?(u+=2,m=46):61===b.charCodeAt(u+1)?(u+=2,m=65):(u++,m=40);case 46:return E(b.charCodeAt(u+1))?(y=M().value,m=8):46===b.charCodeAt(u+1)&&46===b.charCodeAt(u+2)?(u+=3,m=25):(u++,m=24);case 47:if(47===b.charCodeAt(u+1)){for(u+=2;u<_&&!C(b.charCodeAt(u));)u++;if(h=ae(h,b.slice(g,u),d,g),i)continue;return m=2}if(42===b.charCodeAt(u+1)){u+=2,42===b.charCodeAt(u)&&47!==b.charCodeAt(u+1)&&(v|=2);for(var s=!1,c=g;u<_;){var l=b.charCodeAt(u);if(42===l&&47===b.charCodeAt(u+1)){u+=2,s=!0;break}u++,C(l)&&(c=u,v|=1);}if(h=ae(h,b.slice(c,u),p,c),s||A(e.Diagnostics.Asterisk_Slash_expected),i)continue;return s||(v|=4),m=3}return 61===b.charCodeAt(u+1)?(u+=2,m=68):(u++,m=43);case 48:if(u+2<_&&(88===b.charCodeAt(u+1)||120===b.charCodeAt(u+1)))return u+=2,(y=j(1,!0))||(A(e.Diagnostics.Hexadecimal_digit_expected),y="0"),y="0x"+y,v|=64,m=re();if(u+2<_&&(66===b.charCodeAt(u+1)||98===b.charCodeAt(u+1)))return u+=2,(y=te(2))||(A(e.Diagnostics.Binary_digit_expected),y="0"),y="0b"+y,v|=128,m=re();if(u+2<_&&(79===b.charCodeAt(u+1)||111===b.charCodeAt(u+1)))return u+=2,(y=te(8))||(A(e.Diagnostics.Octal_digit_expected),y="0"),y="0o"+y,v|=256,m=re();if(u+1<_&&N(b.charCodeAt(u+1)))return y=""+R(),v|=32,m=8;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r=M(),m=r.type,y=r.value,m;case 58:return u++,m=58;case 59:return u++,m=26;case 60:if(F(b,u)){if(u=P(b,u,A),i)continue;return m=7}return 60===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=70):(u+=2,m=47):61===b.charCodeAt(u+1)?(u+=2,m=32):1===a&&47===b.charCodeAt(u+1)&&42!==b.charCodeAt(u+2)?(u+=2,m=30):(u++,m=29);case 61:if(F(b,u)){if(u=P(b,u,A),i)continue;return m=7}return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=36):(u+=2,m=34):62===b.charCodeAt(u+1)?(u+=2,m=38):(u++,m=63);case 62:if(F(b,u)){if(u=P(b,u,A),i)continue;return m=7}return u++,m=31;case 63:return 46!==b.charCodeAt(u+1)||E(b.charCodeAt(u+2))?63===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=77):(u+=2,m=60):(u++,m=57):(u+=2,m=28);case 91:return u++,m=22;case 93:return u++,m=23;case 94:return 61===b.charCodeAt(u+1)?(u+=2,m=78):(u++,m=52);case 123:return u++,m=18;case 124:if(F(b,u)){if(u=P(b,u,A),i)continue;return m=7}return 124===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=75):(u+=2,m=56):61===b.charCodeAt(u+1)?(u+=2,m=74):(u++,m=51);case 125:return u++,m=19;case 126:return u++,m=54;case 64:return u++,m=59;case 92:var D=Z();if(D>=0&&J(D,t))return u+=3,v|=8,y=X()+$(),m=ee();var S=Y();return S>=0&&J(S,t)?(u+=6,v|=1024,y=String.fromCharCode(S)+$(),m=ee()):(A(e.Diagnostics.Invalid_character),u++,m=0);case 35:if(0!==u&&"!"===b[u+1])return A(e.Diagnostics.can_only_be_used_at_the_start_of_a_file),u++,m=0;var k=U(b,u+1);if(92===k){u++;var w=Z();if(w>=0&&J(w,t))return u+=3,v|=8,y="#"+X()+$(),m=80;var L=Y();if(L>=0&&J(L,t))return u+=6,v|=1024,y="#"+String.fromCharCode(L)+$(),m=80;u--;}return J(k,t)?(u++,ie(k,t)):(y="#",A(e.Diagnostics.Invalid_character,u++,K(o))),m=80;default:var B=ie(o,t);if(B)return m=B;if(T(o)){u+=K(o);continue}if(C(o)){v|=1,u+=K(o);continue}var z=K(o);return A(e.Diagnostics.Invalid_character,u,z),u+=z,m=0}}}function ie(e,t){var r=e;if(J(r,t)){for(u+=K(r);u<_&&z(r=U(b,u),t);)u+=K(r);return y=b.substring(g,u),92===r&&(y+=$()),ee()}}function ae(t,r,n,i){var a=function(e,t){var r=t.exec(e);if(r)switch(r[1]){case"ts-expect-error":return 0;case"ts-ignore":return 1}}(e.trimStringStart(r),n);return void 0===a?t:e.append(t,{range:{pos:i,end:u},type:a})}function oe(t){if(void 0===t&&(t=!0),f=g=u,u>=_)return m=1;var r=b.charCodeAt(u);if(60===r)return 47===b.charCodeAt(u+1)?(u+=2,m=30):(u++,m=29);if(123===r)return u++,m=18;for(var n=0;u<_&&123!==(r=b.charCodeAt(u));){if(60===r){if(F(b,u))return u=P(b,u,A),m=7;break}if(62===r&&A(e.Diagnostics.Unexpected_token_Did_you_mean_or_gt,u,1),125===r&&A(e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace,u,1),C(r)&&0===n)n=-1;else {if(!t&&C(r)&&n>0)break;S(r)||(n=u);}u++;}return y=b.substring(f,u),-1===n?12:11}function se(){switch(f=u,b.charCodeAt(u)){case 34:case 39:return y=W(!0),m=10;default:return ne()}}function ce(e,t){var r=u,n=f,i=g,a=m,o=y,s=v,c=e();return c&&!t||(u=r,f=n,g=i,m=a,y=o,v=s),c}function le(e,t,r){b=e||"",_=void 0===r?b.length:t+r,ue(t||0);}function ue(t){e.Debug.assert(t>=0),u=t,f=t,g=t,m=0,y=void 0,v=0;}};var U=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n=e.charCodeAt(t);if(n>=55296&&n<=56319&&r>t+1){var i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return 1024*(n-55296)+i-56320+65536}return n}};function K(e){return e>=65536?2:1}var V=String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var r=Math.floor((t-65536)/1024)+55296,n=(t-65536)%1024+56320;return String.fromCharCode(r,n)};function q(e){return V(e)}e.utf16EncodeAsString=q;}(t),function(e){function t(e){return e.start+e.length}function r(e){return 0===e.length}function n(e,t){var r=a(e,t);return r&&0===r.length?void 0:r}function i(e,t,r,n){return r<=e+t&&r+n>=e}function a(e,r){var n=Math.max(e.start,r.start),i=Math.min(t(e),t(r));return n<=i?s(n,i):void 0}function o(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return {start:e,length:t}}function s(e,t){return o(e,t-e)}function c(e,t){if(t<0)throw new Error("newLength < 0");return {span:e,newLength:t}}function l(t){return !!$(t)&&e.every(t.elements,u)}function u(t){return !!e.isOmittedExpression(t)||l(t.name)}function _(t){for(var r=t.parent;e.isBindingElement(r.parent);)r=r.parent.parent;return r.parent}function d(t,r){e.isBindingElement(t)&&(t=_(t));var n=r(t);return 257===t.kind&&(t=t.parent),t&&258===t.kind&&(n|=r(t),t=t.parent),t&&240===t.kind&&(n|=r(t)),n}function p(e){return 0==(8&e.flags)}function f(e){var t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function g(e){return f(e.escapedText)}function m(t){var r=t.parent.parent;if(r){if(ce(r))return y(r);switch(r.kind){case 240:if(r.declarationList&&r.declarationList.declarations[0])return y(r.declarationList.declarations[0]);break;case 241:var n=r.expression;switch(223===n.kind&&63===n.operatorToken.kind&&(n=n.left),n.kind){case 208:return n.name;case 209:var i=n.argumentExpression;if(e.isIdentifier(i))return i}break;case 214:return y(r.expression);case 253:if(ce(r.statement)||ie(r.statement))return y(r.statement)}}}function y(t){var r=x(t);return r&&e.isIdentifier(r)?r:void 0}function v(e){return e.name||m(e)}function h(e){return !!e.name}function b(t){switch(t.kind){case 79:return t;case 350:case 343:var r=t.name;if(163===r.kind)return r.right;break;case 210:case 223:var n=t;switch(e.getAssignmentDeclarationKind(n)){case 1:case 4:case 5:case 3:return e.getElementOrPropertyAccessArgumentExpressionOrName(n.left);case 7:case 8:case 9:return n.arguments[1];default:return}case 348:return v(t);case 342:return m(t);case 274:var i=t.expression;return e.isIdentifier(i)?i:void 0;case 209:var a=t;if(e.isBindableStaticElementAccessExpression(a))return a.argumentExpression}return t.name}function x(t){if(void 0!==t)return b(t)||(e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t)?D(t):void 0)}function D(t){if(t.parent){if(e.isPropertyAssignment(t.parent)||e.isBindingElement(t.parent))return t.parent.name;if(e.isBinaryExpression(t.parent)&&t===t.parent.right){if(e.isIdentifier(t.parent.left))return t.parent.left;if(e.isAccessExpression(t.parent.left))return e.getElementOrPropertyAccessArgumentExpressionOrName(t.parent.left)}else if(e.isVariableDeclaration(t.parent)&&e.isIdentifier(t.parent.name))return t.parent.name}}function S(t,r){if(t.name){if(e.isIdentifier(t.name)){var n=t.name.escapedText;return A(t.parent,r).filter((function(t){return e.isJSDocParameterTag(t)&&e.isIdentifier(t.name)&&t.name.escapedText===n}))}var i=t.parent.parameters.indexOf(t);e.Debug.assert(i>-1,"Parameters should always be in their parents' parameter list");var a=A(t.parent,r).filter(e.isJSDocParameterTag);if(i<a.length)return [a[i]]}return e.emptyArray}function T(e){return S(e,!1)}function C(t,r){var n=t.name.escapedText;return A(t.parent,r).filter((function(t){return e.isJSDocTemplateTag(t)&&t.typeParameters.some((function(e){return e.name.escapedText===n}))}))}function E(t){return P(t,e.isJSDocReturnTag)}function k(t){var r=P(t,e.isJSDocTypeTag);if(r&&r.typeExpression&&r.typeExpression.type)return r}function N(t){var r=P(t,e.isJSDocTypeTag);return !r&&e.isParameter(t)&&(r=e.find(T(t),(function(e){return !!e.typeExpression}))),r&&r.typeExpression&&r.typeExpression.type}function A(t,r){var n=t.jsDocCache;if(void 0===n||r){var i=e.getJSDocCommentsAndTags(t,r);e.Debug.assert(i.length<2||i[0]!==i[1]),n=e.flatMap(i,(function(t){return e.isJSDoc(t)?t.tags:t})),r||(t.jsDocCache=n);}return n}function F(e){return A(e,!1)}function P(t,r,n){return e.find(A(t,n),r)}function w(e,t){return F(e).filter(t)}function I(e){var t=e.kind;return !!(32&e.flags)&&(208===t||209===t||210===t||232===t)}function O(t){return I(t)&&!e.isNonNullExpression(t)&&!!t.questionDotToken}function M(t){return e.skipOuterExpressions(t,8)}function L(e){switch(e.kind){case 305:case 306:return !0;default:return !1}}function R(e){return e>=163}function B(e){return e>=0&&e<=162}function j(e){return 8<=e&&e<=14}function J(e){return 14<=e&&e<=17}function z(t){return (e.isPropertyDeclaration(t)||X(t))&&e.isPrivateIdentifier(t.name)}function U(e){switch(e){case 126:case 127:case 132:case 85:case 136:case 88:case 93:case 101:case 123:case 121:case 122:case 146:case 124:case 145:case 161:return !0}return !1}function K(t){return !!(16476&e.modifierToFlag(t))}function V(e){return U(e.kind)}function q(e){return !!e&&H(e.kind)}function W(e){switch(e){case 259:case 171:case 173:case 174:case 175:case 215:case 216:return !0;default:return !1}}function H(e){switch(e){case 170:case 176:case 326:case 177:case 178:case 181:case 320:case 182:return !0;default:return W(e)}}function G(e){var t=e.kind;return 173===t||169===t||171===t||174===t||175===t||178===t||172===t||237===t}function Q(e){return e&&(260===e.kind||228===e.kind)}function X(e){switch(e.kind){case 171:case 174:case 175:return !0;default:return !1}}function Y(e){var t=e.kind;return 177===t||176===t||168===t||170===t||178===t||174===t||175===t}function Z(e){var t=e.kind;return 299===t||300===t||301===t||171===t||174===t||175===t}function $(e){if(e){var t=e.kind;return 204===t||203===t}return !1}function ee(e){switch(e.kind){case 203:case 207:return !0}return !1}function te(e){switch(e.kind){case 204:case 206:return !0}return !1}function re(e){switch(e){case 208:case 209:case 211:case 210:case 281:case 282:case 285:case 212:case 206:case 214:case 207:case 228:case 215:case 79:case 80:case 13:case 8:case 9:case 10:case 14:case 225:case 95:case 104:case 108:case 110:case 106:case 232:case 230:case 233:case 100:return !0;default:return !1}}function ne(e){switch(e){case 221:case 222:case 217:case 218:case 219:case 220:case 213:return !0;default:return re(e)}}function ie(e){return function(e){switch(e){case 224:case 226:case 216:case 223:case 227:case 231:case 229:case 354:case 353:case 235:return !0;default:return ne(e)}}(M(e).kind)}function ae(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function oe(e){return 259===e||279===e||260===e||261===e||262===e||263===e||264===e||269===e||268===e||275===e||274===e||267===e}function se(e){return 249===e||248===e||256===e||243===e||241===e||239===e||246===e||247===e||245===e||242===e||253===e||250===e||252===e||254===e||255===e||240===e||244===e||251===e||352===e||356===e||355===e}function ce(t){return 165===t.kind?t.parent&&347!==t.parent.kind||e.isInJSFile(t):216===(r=t.kind)||205===r||260===r||228===r||172===r||173===r||263===r||302===r||278===r||259===r||215===r||174===r||270===r||268===r||273===r||261===r||288===r||171===r||170===r||264===r||267===r||271===r||277===r||166===r||299===r||169===r||168===r||175===r||300===r||262===r||165===r||257===r||348===r||341===r||350===r;var r;}function le(e){return e.kind>=330&&e.kind<=350}e.isExternalModuleNameRelative=function(t){return e.pathIsRelative(t)||e.isRootedDiskPath(t)},e.sortAndDeduplicateDiagnostics=function(t){return e.sortAndDeduplicate(t,e.compareDiagnostics)},e.getDefaultLibFileName=function(t){switch(e.getEmitScriptTarget(t)){case 99:return "lib.esnext.full.d.ts";case 9:return "lib.es2022.full.d.ts";case 8:return "lib.es2021.full.d.ts";case 7:return "lib.es2020.full.d.ts";case 6:return "lib.es2019.full.d.ts";case 5:return "lib.es2018.full.d.ts";case 4:return "lib.es2017.full.d.ts";case 3:return "lib.es2016.full.d.ts";case 2:return "lib.es6.d.ts";default:return "lib.d.ts"}},e.textSpanEnd=t,e.textSpanIsEmpty=r,e.textSpanContainsPosition=function(e,r){return r>=e.start&&r<t(e)},e.textRangeContainsPositionInclusive=function(e,t){return t>=e.pos&&t<=e.end},e.textSpanContainsTextSpan=function(e,r){return r.start>=e.start&&t(r)<=t(e)},e.textSpanOverlapsWith=function(e,t){return void 0!==n(e,t)},e.textSpanOverlap=n,e.textSpanIntersectsWithTextSpan=function(e,t){return i(e.start,e.length,t.start,t.length)},e.textSpanIntersectsWith=function(e,t,r){return i(e.start,e.length,t,r)},e.decodedTextSpanIntersectsWith=i,e.textSpanIntersectsWithPosition=function(e,r){return r<=t(e)&&r>=e.start},e.textSpanIntersection=a,e.createTextSpan=o,e.createTextSpanFromBounds=s,e.textChangeRangeNewSpan=function(e){return o(e.span.start,e.newLength)},e.textChangeRangeIsUnchanged=function(e){return r(e.span)&&0===e.newLength},e.createTextChangeRange=c,e.unchangedTextChangeRange=c(o(0,0),0),e.collapseTextChangeRangesAcrossMultipleVersions=function(r){if(0===r.length)return e.unchangedTextChangeRange;if(1===r.length)return r[0];for(var n=r[0],i=n.span.start,a=t(n.span),o=i+n.newLength,l=1;l<r.length;l++){var u=r[l],_=i,d=a,p=o,f=u.span.start,g=t(u.span),m=f+u.newLength;i=Math.min(_,f),a=Math.max(d,d+(g-p)),o=Math.max(m,m+(p-g));}return c(s(i,a),o-i)},e.getTypeParameterOwner=function(e){if(e&&165===e.kind)for(var t=e;t;t=t.parent)if(q(t)||Q(t)||261===t.kind)return t},e.isParameterPropertyDeclaration=function(t,r){return e.hasSyntacticModifier(t,16476)&&173===r.kind},e.isEmptyBindingPattern=l,e.isEmptyBindingElement=u,e.walkUpBindingElementsAndPatterns=_,e.getCombinedModifierFlags=function(t){return d(t,e.getEffectiveModifierFlags)},e.getCombinedNodeFlagsAlwaysIncludeJSDoc=function(t){return d(t,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc)},e.getCombinedNodeFlags=function(e){return d(e,(function(e){return e.flags}))},e.supportedLocaleDirectories=["cs","de","es","fr","it","ja","ko","pl","pt-br","ru","tr","zh-cn","zh-tw"],e.validateLocaleAndSetLanguage=function(t,r,n){var i=t.toLowerCase(),a=/^([a-z]+)([_\-]([a-z]+))?$/.exec(i);if(a){var o=a[1],s=a[3];e.contains(e.supportedLocaleDirectories,i)&&!c(o,s,n)&&c(o,void 0,n),e.setUILocale(t);}else n&&n.push(e.createCompilerDiagnostic(e.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1,"en","ja-jp"));function c(t,n,i){var a=e.normalizePath(r.getExecutingFilePath()),o=e.getDirectoryPath(a),s=e.combinePaths(o,t);if(n&&(s=s+"-"+n),s=r.resolvePath(e.combinePaths(s,"diagnosticMessages.generated.json")),!r.fileExists(s))return !1;var c="";try{c=r.readFile(s);}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Unable_to_open_file_0,s)),!1}try{e.setLocalizedDiagnosticMessages(JSON.parse(c));}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Corrupted_locale_file_0,s)),!1}return !0}},e.getOriginalNode=function(e,t){if(e)for(;void 0!==e.original;)e=e.original;return !t||t(e)?e:void 0},e.findAncestor=function(e,t){for(;e;){var r=t(e);if("quit"===r)return;if(r)return e;e=e.parent;}},e.isParseTreeNode=p,e.getParseTreeNode=function(e,t){if(void 0===e||p(e))return e;for(e=e.original;e;){if(p(e))return !t||t(e)?e:void 0;e=e.original;}},e.escapeLeadingUnderscores=function(e){return e.length>=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e},e.unescapeLeadingUnderscores=f,e.idText=g,e.symbolName=function(e){return e.valueDeclaration&&z(e.valueDeclaration)?g(e.valueDeclaration.name):f(e.escapedName)},e.nodeHasName=function t(r,n){return !(!h(r)||!e.isIdentifier(r.name)||g(r.name)!==g(n))||!(!e.isVariableStatement(r)||!e.some(r.declarationList.declarations,(function(e){return t(e,n)})))},e.getNameOfJSDocTypedef=v,e.isNamedDeclaration=h,e.getNonAssignedNameOfDeclaration=b,e.getNameOfDeclaration=x,e.getAssignedName=D,e.getDecorators=function(t){if(e.hasDecorators(t))return e.filter(t.modifiers,e.isDecorator)},e.getModifiers=function(t){if(e.hasSyntacticModifier(t,126975))return e.filter(t.modifiers,V)},e.getJSDocParameterTags=T,e.getJSDocParameterTagsNoCache=function(e){return S(e,!0)},e.getJSDocTypeParameterTags=function(e){return C(e,!1)},e.getJSDocTypeParameterTagsNoCache=function(e){return C(e,!0)},e.hasJSDocParameterTags=function(t){return !!P(t,e.isJSDocParameterTag)},e.getJSDocAugmentsTag=function(t){return P(t,e.isJSDocAugmentsTag)},e.getJSDocImplementsTags=function(t){return w(t,e.isJSDocImplementsTag)},e.getJSDocClassTag=function(t){return P(t,e.isJSDocClassTag)},e.getJSDocPublicTag=function(t){return P(t,e.isJSDocPublicTag)},e.getJSDocPublicTagNoCache=function(t){return P(t,e.isJSDocPublicTag,!0)},e.getJSDocPrivateTag=function(t){return P(t,e.isJSDocPrivateTag)},e.getJSDocPrivateTagNoCache=function(t){return P(t,e.isJSDocPrivateTag,!0)},e.getJSDocProtectedTag=function(t){return P(t,e.isJSDocProtectedTag)},e.getJSDocProtectedTagNoCache=function(t){return P(t,e.isJSDocProtectedTag,!0)},e.getJSDocReadonlyTag=function(t){return P(t,e.isJSDocReadonlyTag)},e.getJSDocReadonlyTagNoCache=function(t){return P(t,e.isJSDocReadonlyTag,!0)},e.getJSDocOverrideTagNoCache=function(t){return P(t,e.isJSDocOverrideTag,!0)},e.getJSDocDeprecatedTag=function(t){return P(t,e.isJSDocDeprecatedTag)},e.getJSDocDeprecatedTagNoCache=function(t){return P(t,e.isJSDocDeprecatedTag,!0)},e.getJSDocEnumTag=function(t){return P(t,e.isJSDocEnumTag)},e.getJSDocThisTag=function(t){return P(t,e.isJSDocThisTag)},e.getJSDocReturnTag=E,e.getJSDocTemplateTag=function(t){return P(t,e.isJSDocTemplateTag)},e.getJSDocTypeTag=k,e.getJSDocType=N,e.getJSDocReturnType=function(t){var r=E(t);if(r&&r.typeExpression)return r.typeExpression.type;var n=k(t);if(n&&n.typeExpression){var i=n.typeExpression.type;if(e.isTypeLiteralNode(i)){var a=e.find(i.members,e.isCallSignatureDeclaration);return a&&a.type}if(e.isFunctionTypeNode(i)||e.isJSDocFunctionType(i))return i.type}},e.getJSDocTags=F,e.getJSDocTagsNoCache=function(e){return A(e,!0)},e.getAllJSDocTags=w,e.getAllJSDocTagsOfKind=function(e,t){return F(e).filter((function(e){return e.kind===t}))},e.getTextOfJSDocComment=function(t){return "string"==typeof t?t:null==t?void 0:t.map((function(t){return 324===t.kind?t.text:(n=327===(r=t).kind?"link":328===r.kind?"linkcode":"linkplain",i=r.name?e.entityNameToString(r.name):"",a=r.name&&r.text.startsWith("://")?"":" ","{@".concat(n," ").concat(i).concat(a).concat(r.text,"}"));var r,n,i,a;})).join("")},e.getEffectiveTypeParameterDeclarations=function(t){if(e.isJSDocSignature(t))return e.emptyArray;if(e.isJSDocTypeAlias(t))return e.Debug.assert(323===t.parent.kind),e.flatMap(t.parent.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}));if(t.typeParameters)return t.typeParameters;if(e.canHaveIllegalTypeParameters(t)&&t.typeParameters)return t.typeParameters;if(e.isInJSFile(t)){var r=e.getJSDocTypeParameterDeclarations(t);if(r.length)return r;var n=N(t);if(n&&e.isFunctionTypeNode(n)&&n.typeParameters)return n.typeParameters}return e.emptyArray},e.getEffectiveConstraintOfTypeParameter=function(t){return t.constraint?t.constraint:e.isJSDocTemplateTag(t.parent)&&t===t.parent.typeParameters[0]?t.parent.constraint:void 0},e.isMemberName=function(e){return 79===e.kind||80===e.kind},e.isGetOrSetAccessorDeclaration=function(e){return 175===e.kind||174===e.kind},e.isPropertyAccessChain=function(t){return e.isPropertyAccessExpression(t)&&!!(32&t.flags)},e.isElementAccessChain=function(t){return e.isElementAccessExpression(t)&&!!(32&t.flags)},e.isCallChain=function(t){return e.isCallExpression(t)&&!!(32&t.flags)},e.isOptionalChain=I,e.isOptionalChainRoot=O,e.isExpressionOfOptionalChainRoot=function(e){return O(e.parent)&&e.parent.expression===e},e.isOutermostOptionalChain=function(e){return !I(e.parent)||O(e.parent)||e!==e.parent.expression},e.isNullishCoalesce=function(e){return 223===e.kind&&60===e.operatorToken.kind},e.isConstTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"const"===t.typeName.escapedText&&!t.typeArguments},e.skipPartiallyEmittedExpressions=M,e.isNonNullChain=function(t){return e.isNonNullExpression(t)&&!!(32&t.flags)},e.isBreakOrContinueStatement=function(e){return 249===e.kind||248===e.kind},e.isNamedExportBindings=function(e){return 277===e.kind||276===e.kind},e.isUnparsedTextLike=L,e.isUnparsedNode=function(e){return L(e)||303===e.kind||307===e.kind},e.isJSDocPropertyLikeTag=function(e){return 350===e.kind||343===e.kind},e.isNode=function(e){return R(e.kind)},e.isNodeKind=R,e.isTokenKind=B,e.isToken=function(e){return B(e.kind)},e.isNodeArray=function(t){return e.hasProperty(t,"pos")&&e.hasProperty(t,"end")},e.isLiteralKind=j,e.isLiteralExpression=function(e){return j(e.kind)},e.isLiteralExpressionOfObject=function(e){switch(e.kind){case 207:case 206:case 13:case 215:case 228:return !0}return !1},e.isTemplateLiteralKind=J,e.isTemplateLiteralToken=function(e){return J(e.kind)},e.isTemplateMiddleOrTemplateTail=function(e){var t=e.kind;return 16===t||17===t},e.isImportOrExportSpecifier=function(t){return e.isImportSpecifier(t)||e.isExportSpecifier(t)},e.isTypeOnlyImportOrExportDeclaration=function(e){switch(e.kind){case 273:case 278:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 271:return e.parent.isTypeOnly;case 270:case 268:return e.isTypeOnly;default:return !1}},e.isAssertionKey=function(t){return e.isStringLiteral(t)||e.isIdentifier(t)},e.isStringTextContainingNode=function(e){return 10===e.kind||J(e.kind)},e.isGeneratedIdentifier=function(t){return e.isIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isGeneratedPrivateIdentifier=function(t){return e.isPrivateIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isPrivateIdentifierClassElementDeclaration=z,e.isPrivateIdentifierPropertyAccessExpression=function(t){return e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name)},e.isModifierKind=U,e.isParameterPropertyModifier=K,e.isClassMemberModifier=function(e){return K(e)||124===e||161===e||127===e},e.isModifier=V,e.isEntityName=function(e){var t=e.kind;return 163===t||79===t},e.isPropertyName=function(e){var t=e.kind;return 79===t||80===t||10===t||8===t||164===t},e.isBindingName=function(e){var t=e.kind;return 79===t||203===t||204===t},e.isFunctionLike=q,e.isFunctionLikeOrClassStaticBlockDeclaration=function(t){return !!t&&(H(t.kind)||e.isClassStaticBlockDeclaration(t))},e.isFunctionLikeDeclaration=function(e){return e&&W(e.kind)},e.isBooleanLiteral=function(e){return 110===e.kind||95===e.kind},e.isFunctionLikeKind=H,e.isFunctionOrModuleBlock=function(t){return e.isSourceFile(t)||e.isModuleBlock(t)||e.isBlock(t)&&q(t.parent)},e.isClassElement=G,e.isClassLike=Q,e.isAccessor=function(e){return e&&(174===e.kind||175===e.kind)},e.isAutoAccessorPropertyDeclaration=function(t){return e.isPropertyDeclaration(t)&&e.hasAccessorModifier(t)},e.isMethodOrAccessor=X,e.isNamedClassElement=function(e){switch(e.kind){case 171:case 174:case 175:case 169:return !0;default:return !1}},e.isModifierLike=function(t){return V(t)||e.isDecorator(t)},e.isTypeElement=Y,e.isClassOrTypeElement=function(e){return Y(e)||G(e)},e.isObjectLiteralElementLike=Z,e.isTypeNode=function(t){return e.isTypeNodeKind(t.kind)},e.isFunctionOrConstructorTypeNode=function(e){switch(e.kind){case 181:case 182:return !0}return !1},e.isBindingPattern=$,e.isAssignmentPattern=function(e){var t=e.kind;return 206===t||207===t},e.isArrayBindingElement=function(e){var t=e.kind;return 205===t||229===t},e.isDeclarationBindingElement=function(e){switch(e.kind){case 257:case 166:case 205:return !0}return !1},e.isBindingOrAssignmentPattern=function(e){return ee(e)||te(e)},e.isObjectBindingOrAssignmentPattern=ee,e.isObjectBindingOrAssignmentElement=function(e){switch(e.kind){case 205:case 299:case 300:case 301:return !0}return !1},e.isArrayBindingOrAssignmentPattern=te,e.isPropertyAccessOrQualifiedNameOrImportTypeNode=function(e){var t=e.kind;return 208===t||163===t||202===t},e.isPropertyAccessOrQualifiedName=function(e){var t=e.kind;return 208===t||163===t},e.isCallLikeExpression=function(e){switch(e.kind){case 283:case 282:case 210:case 211:case 212:case 167:return !0;default:return !1}},e.isCallOrNewExpression=function(e){return 210===e.kind||211===e.kind},e.isTemplateLiteral=function(e){var t=e.kind;return 225===t||14===t},e.isLeftHandSideExpression=function(e){return re(M(e).kind)},e.isUnaryExpression=function(e){return ne(M(e).kind)},e.isUnaryExpressionWithWrite=function(e){switch(e.kind){case 222:return !0;case 221:return 45===e.operator||46===e.operator;default:return !1}},e.isExpression=ie,e.isAssertionExpression=function(e){var t=e.kind;return 213===t||231===t},e.isNotEmittedOrPartiallyEmittedNode=function(t){return e.isNotEmittedStatement(t)||e.isPartiallyEmittedExpression(t)},e.isIterationStatement=function e(t,r){switch(t.kind){case 245:case 246:case 247:case 243:case 244:return !0;case 253:return r&&e(t.statement,r)}return !1},e.isScopeMarker=ae,e.hasScopeMarker=function(t){return e.some(t,ae)},e.needsScopeMarker=function(t){return !(e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)||e.isAmbientModule(t))},e.isExternalModuleIndicator=function(t){return e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)},e.isForInOrOfStatement=function(e){return 246===e.kind||247===e.kind},e.isConciseBody=function(t){return e.isBlock(t)||ie(t)},e.isFunctionBody=function(t){return e.isBlock(t)},e.isForInitializer=function(t){return e.isVariableDeclarationList(t)||ie(t)},e.isModuleBody=function(e){var t=e.kind;return 265===t||264===t||79===t},e.isNamespaceBody=function(e){var t=e.kind;return 265===t||264===t},e.isJSDocNamespaceBody=function(e){var t=e.kind;return 79===t||264===t},e.isNamedImportBindings=function(e){var t=e.kind;return 272===t||271===t},e.isModuleOrEnumDeclaration=function(e){return 264===e.kind||263===e.kind},e.isDeclaration=ce,e.isDeclarationStatement=function(e){return oe(e.kind)},e.isStatementButNotDeclaration=function(e){return se(e.kind)},e.isStatement=function(t){var r=t.kind;return se(r)||oe(r)||function(t){return 238===t.kind&&((void 0===t.parent||255!==t.parent.kind&&295!==t.parent.kind)&&!e.isFunctionBlock(t))}(t)},e.isStatementOrBlock=function(e){var t=e.kind;return se(t)||oe(t)||238===t},e.isModuleReference=function(e){var t=e.kind;return 280===t||163===t||79===t},e.isJsxTagNameExpression=function(e){var t=e.kind;return 108===t||79===t||208===t},e.isJsxChild=function(e){var t=e.kind;return 281===t||291===t||282===t||11===t||285===t},e.isJsxAttributeLike=function(e){var t=e.kind;return 288===t||290===t},e.isStringLiteralOrJsxExpression=function(e){var t=e.kind;return 10===t||291===t},e.isJsxOpeningLikeElement=function(e){var t=e.kind;return 283===t||282===t},e.isCaseOrDefaultClause=function(e){var t=e.kind;return 292===t||293===t},e.isJSDocNode=function(e){return e.kind>=312&&e.kind<=350},e.isJSDocCommentContainingNode=function(t){return 323===t.kind||322===t.kind||324===t.kind||_e(t)||le(t)||e.isJSDocTypeLiteral(t)||e.isJSDocSignature(t)},e.isJSDocTag=le,e.isSetAccessor=function(e){return 175===e.kind},e.isGetAccessor=function(e){return 174===e.kind},e.hasJSDocNodes=function(e){var t=e.jsDoc;return !!t&&t.length>0},e.hasType=function(e){return !!e.type},e.hasInitializer=function(e){return !!e.initializer},e.hasOnlyExpressionInitializer=function(e){switch(e.kind){case 257:case 166:case 205:case 169:case 299:case 302:return !0;default:return !1}},e.isObjectLiteralElement=function(e){return 288===e.kind||290===e.kind||Z(e)},e.isTypeReferenceType=function(e){return 180===e.kind||230===e.kind};var ue=1073741823;function _e(e){return 327===e.kind||328===e.kind||329===e.kind}function de(t){var r=e.isJSDocParameterTag(t)?t.typeExpression&&t.typeExpression.type:t.type;return void 0!==t.dotDotDotToken||!!r&&321===r.kind}e.guessIndentation=function(t){for(var r=ue,n=0,i=t;n<i.length;n++){var a=i[n];if(a.length){for(var o=0;o<a.length&&o<r&&e.isWhiteSpaceLike(a.charCodeAt(o));o++);if(o<r&&(r=o),0===r)return 0}}return r===ue?void 0:r},e.isStringLiteralLike=function(e){return 10===e.kind||14===e.kind},e.isJSDocLinkLike=_e,e.hasRestParameter=function(t){var r=e.lastOrUndefined(t.parameters);return !!r&&de(r)},e.isRestParameter=de;}(t),function(e){e.resolvingEmptyArray=[],e.externalHelpersModuleNameText="tslib",e.defaultMaximumTruncationLength=160,e.noTruncationMaximumTruncationLength=1e6,e.getDeclarationOfKind=function(e,t){var r=e.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(a.kind===t)return a}},e.getDeclarationsOfKind=function(t,r){return e.filter(t.declarations||e.emptyArray,(function(e){return e.kind===r}))},e.createSymbolTable=function(t){var r=new e.Map;if(t)for(var n=0,i=t;n<i.length;n++){var a=i[n];r.set(a.escapedName,a);}return r},e.isTransientSymbol=function(e){return 0!=(33554432&e.flags)};var t,r,a,o=(t="",{getText:function(){return t},write:r=function(e){return t+=e},rawWrite:r,writeKeyword:r,writeOperator:r,writePunctuation:r,writeSpace:r,writeStringLiteral:r,writeLiteral:r,writeParameter:r,writeProperty:r,writeSymbol:function(e,t){return r(e)},writeTrailingSemicolon:r,writeComment:r,getTextPos:function(){return t.length},getLine:function(){return 0},getColumn:function(){return 0},getIndent:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingComment:function(){return !1},hasTrailingWhitespace:function(){return !!t.length&&e.isWhiteSpaceLike(t.charCodeAt(t.length-1))},writeLine:function(){return t+=" "},increaseIndent:e.noop,decreaseIndent:e.noop,clear:function(){return t=""},trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop});function s(t,r){return c(t,r,e.moduleResolutionOptionDeclarations)}function c(e,t,r){return e!==t&&r.some((function(r){return !xi(Jn(e,r),Jn(t,r))}))}function l(e){return e.end-e.pos}function u(e){var t=e.name,r=e.subModuleName;return r?"".concat(t,"/").concat(r):t}function _(e){for(;e&&308!==e.kind;)e=e.parent;return e}function d(t,r){e.Debug.assert(t>=0);var n=e.getLineStarts(r),i=t,a=r.text;if(i+1===n.length)return a.length-1;var o=n[i],s=n[i+1]-1;for(e.Debug.assert(e.isLineBreak(a.charCodeAt(s)));o<=s&&e.isLineBreak(a.charCodeAt(s));)s--;return s}function p(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function f(e){return !p(e)}function g(e,t,r){if(void 0===t||0===t.length)return e;for(var i=0;i<e.length&&r(e[i]);++i);return e.splice.apply(e,n$4([i,0],t,!1)),e}function m(e,t,r){if(void 0===t)return e;for(var n=0;n<e.length&&r(e[n]);++n);return e.splice(n,0,t),e}function y(e){return Q(e)||!!(1048576&T(e))}function v(e,t){return 42===e.charCodeAt(t+1)&&33===e.charCodeAt(t+2)}function h(t,r,n){return p(t)?t.pos:e.isJSDocNode(t)||11===t.kind?e.skipTrivia((r||_(t)).text,t.pos,!1,!0):n&&e.hasJSDocNodes(t)?h(t.jsDoc[0],r):351===t.kind&&t._children.length>0?h(t._children[0],r,n):e.skipTrivia((r||_(t)).text,t.pos,!1,!1,Te(t))}function b(e,t,r){return void 0===r&&(r=!1),x(e.text,t,r)}function x(t,r,n){if(void 0===n&&(n=!1),p(r))return "";var i=t.substring(n?r.pos:e.skipTrivia(t,r.pos),r.end);return function(t){return !!e.findAncestor(t,e.isJSDocTypeExpression)}(r)&&(i=i.split(/\r\n|\n|\r/).map((function(t){return e.trimStringStart(t.replace(/^\s*\*/,""))})).join("\n")),i}function D(e,t){return void 0===t&&(t=!1),b(_(e),e,t)}function S(e){return e.pos}function T(e){var t=e.emitNode;return t&&t.flags||0}function C(e){var t=Pt(e);return 257===t.kind&&295===t.parent.kind}function E(t){return e.isModuleDeclaration(t)&&(10===t.name.kind||N(t))}function k(t){return e.isModuleDeclaration(t)||e.isIdentifier(t)}function N(e){return !!(1024&e.flags)}function A(e){return E(e)&&F(e)}function F(t){switch(t.parent.kind){case 308:return e.isExternalModule(t.parent);case 265:return E(t.parent.parent)&&e.isSourceFile(t.parent.parent.parent)&&!e.isExternalModule(t.parent.parent.parent)}return !1}function P(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find((function(t){return !(A(t)||e.isModuleDeclaration(t)&&N(t))}))}function w(t,r){switch(t.kind){case 308:case 266:case 295:case 264:case 245:case 246:case 247:case 173:case 171:case 174:case 175:case 259:case 215:case 216:case 169:case 172:return !0;case 238:return !e.isFunctionLikeOrClassStaticBlockDeclaration(r)}return !1}function I(t){switch(t.kind){case 176:case 177:case 170:case 178:case 181:case 182:case 320:case 260:case 228:case 261:case 262:case 347:case 259:case 171:case 173:case 174:case 175:case 215:case 216:return !0;default:return e.assertType(t),!1}}function O(e){switch(e.kind){case 269:case 268:return !0;default:return !1}}function M(t){return O(t)||e.isExportDeclaration(t)}function L(t){return e.findAncestor(t.parent,(function(e){return w(e,e.parent)}))}function R(e){return e&&0!==l(e)?D(e):"(Missing)"}function B(t){switch(t.kind){case 79:case 80:return t.autoGenerateFlags?void 0:t.escapedText;case 10:case 8:case 14:return e.escapeLeadingUnderscores(t.text);case 164:return Tt(t.expression)?e.escapeLeadingUnderscores(t.expression.text):void 0;default:return e.Debug.assertNever(t)}}function j(t){switch(t.kind){case 108:return "this";case 80:case 79:return 0===l(t)?e.idText(t):D(t);case 163:return j(t.left)+"."+j(t.right);case 208:return e.isIdentifier(t.name)||e.isPrivateIdentifier(t.name)?j(t.expression)+"."+j(t.name):e.Debug.assertNever(t.name);case 314:return j(t.left)+j(t.right);default:return e.Debug.assertNever(t)}}function J(e,t,r,n,i,a,o){var s=V(e,t);return Cn(e,s.start,s.length,r,n,i,a,o)}function z(t,r,n){e.Debug.assertGreaterThanOrEqual(r,0),e.Debug.assertGreaterThanOrEqual(n,0),t&&(e.Debug.assertLessThanOrEqual(r,t.text.length),e.Debug.assertLessThanOrEqual(r+n,t.text.length));}function U(e,t,r,n,i){return z(e,t,r),{file:e,start:t,length:r,code:n.code,category:n.category,messageText:n.next?n:n.messageText,relatedInformation:i}}function K(t,r){var n=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,r);n.scan();var i=n.getTokenPos();return e.createTextSpanFromBounds(i,n.getTextPos())}function V(t,r){var n=r;switch(r.kind){case 308:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):K(t,i);case 257:case 205:case 260:case 228:case 261:case 264:case 263:case 302:case 259:case 215:case 171:case 174:case 175:case 262:case 169:case 168:case 271:n=r.name;break;case 216:return function(t,r){var n=e.skipTrivia(t.text,r.pos);if(r.body&&238===r.body.kind){var i=e.getLineAndCharacterOfPosition(t,r.body.pos).line;if(i<e.getLineAndCharacterOfPosition(t,r.body.end).line)return e.createTextSpan(n,d(i,t)-n+1)}return e.createTextSpanFromBounds(n,r.end)}(t,r);case 292:case 293:var a=e.skipTrivia(t.text,r.pos),o=r.statements.length>0?r.statements[0].pos:r.end;return e.createTextSpanFromBounds(a,o)}if(void 0===n)return K(t,r.pos);e.Debug.assert(!e.isJSDoc(n));var s=p(n),c=s||e.isJsxText(r)?n.pos:e.skipTrivia(t.text,n.pos);return s?(e.Debug.assert(c===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(e.Debug.assert(c>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),e.createTextSpanFromBounds(c,n.end)}function q(e){return 6===e.scriptKind}function W(t){return !!(2&e.getCombinedNodeFlags(t))}function H(e){return 210===e.kind&&100===e.expression.kind}function G(t){return e.isImportTypeNode(t)&&e.isLiteralTypeNode(t.argument)&&e.isStringLiteral(t.argument.literal)}function Q(e){return 241===e.kind&&10===e.expression.kind}function X(e){return !!(1048576&T(e))}function Y(t){return e.isIdentifier(t.name)&&!t.initializer}e.changesAffectModuleResolution=function(e,t){return e.configFilePath!==t.configFilePath||s(e,t)},e.optionsHaveModuleResolutionChanges=s,e.changesAffectingProgramStructure=function(t,r){return c(t,r,e.optionsAffectingProgramStructure)},e.optionsHaveChanges=c,e.forEachAncestor=function(t,r){for(;;){var n=r(t);if("quit"===n)return;if(void 0!==n)return n;if(e.isSourceFile(t))return;t=t.parent;}},e.forEachEntry=function(e,t){for(var r=e.entries(),n=r.next();!n.done;n=r.next()){var i=n.value,a=i[0],o=t(i[1],a);if(o)return o}},e.forEachKey=function(e,t){for(var r=e.keys(),n=r.next();!n.done;n=r.next()){var i=t(n.value);if(i)return i}},e.copyEntries=function(e,t){e.forEach((function(e,r){t.set(r,e);}));},e.usingSingleLineStringWriter=function(e){var t=o.getText();try{return e(o),o.getText()}finally{o.clear(),o.writeKeyword(t);}},e.getFullWidth=l,e.getResolvedModule=function(e,t,r){return e&&e.resolvedModules&&e.resolvedModules.get(t,r)},e.setResolvedModule=function(t,r,n,i){t.resolvedModules||(t.resolvedModules=e.createModeAwareCache()),t.resolvedModules.set(r,i,n);},e.setResolvedTypeReferenceDirective=function(t,r,n){t.resolvedTypeReferenceDirectiveNames||(t.resolvedTypeReferenceDirectiveNames=e.createModeAwareCache()),t.resolvedTypeReferenceDirectiveNames.set(r,void 0,n);},e.projectReferenceIsEqualTo=function(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular},e.moduleResolutionIsEqualTo=function(e,t){return e.isExternalLibraryImport===t.isExternalLibraryImport&&e.extension===t.extension&&e.resolvedFileName===t.resolvedFileName&&e.originalPath===t.originalPath&&((r=e.packageId)===(n=t.packageId)||!!r&&!!n&&r.name===n.name&&r.subModuleName===n.subModuleName&&r.version===n.version);var r,n;},e.packageIdToPackageName=u,e.packageIdToString=function(e){return "".concat(u(e),"@").concat(e.version)},e.typeDirectiveIsEqualTo=function(e,t){return e.resolvedFileName===t.resolvedFileName&&e.primary===t.primary&&e.originalPath===t.originalPath},e.hasChangesInResolutions=function(t,r,n,i,a){e.Debug.assert(t.length===r.length);for(var o=0;o<t.length;o++){var s=r[o],c=t[o],l=e.isString(c)?c:c.fileName.toLowerCase(),u=e.isString(c)?i&&e.getModeForResolutionAtIndex(i,o):e.getModeForFileReference(c,null==i?void 0:i.impliedNodeFormat),_=n&&n.get(l,u);if(_?!s||!a(_,s):s)return !0}return !1},e.containsParseError=function t(r){return function(r){1048576&r.flags||((0!=(131072&r.flags)||e.forEachChild(r,t))&&(r.flags|=524288),r.flags|=1048576);}(r),0!=(524288&r.flags)},e.getSourceFileOfNode=_,e.getSourceFileOfModule=function(e){return _(e.valueDeclaration||P(e))},e.isPlainJsFile=function(e,t){return !(!e||1!==e.scriptKind&&2!==e.scriptKind||e.checkJsDirective||void 0!==t)},e.isStatementWithLocals=function(e){switch(e.kind){case 238:case 266:case 245:case 246:case 247:return !0}return !1},e.getStartPositionOfLine=function(t,r){return e.Debug.assert(t>=0),e.getLineStarts(r)[t]},e.nodePosToString=function(t){var r=_(t),n=e.getLineAndCharacterOfPosition(r,t.pos);return "".concat(r.fileName,"(").concat(n.line+1,",").concat(n.character+1,")")},e.getEndLinePosition=d,e.isFileLevelUniqueName=function(e,t,r){return !(r&&r(t)||e.identifiers.has(t))},e.nodeIsMissing=p,e.nodeIsPresent=f,e.insertStatementsAfterStandardPrologue=function(e,t){return g(e,t,Q)},e.insertStatementsAfterCustomPrologue=function(e,t){return g(e,t,y)},e.insertStatementAfterStandardPrologue=function(e,t){return m(e,t,Q)},e.insertStatementAfterCustomPrologue=function(e,t){return m(e,t,y)},e.isRecognizedTripleSlashComment=function(t,r,n){if(47===t.charCodeAt(r+1)&&r+2<n&&47===t.charCodeAt(r+2)){var i=t.substring(r,n);return !!(e.fullTripleSlashReferencePathRegEx.test(i)||e.fullTripleSlashAMDReferencePathRegEx.test(i)||Z.test(i)||ne.test(i))}return !1},e.isPinnedComment=v,e.createCommentDirectivesMap=function(t,r){var n=new e.Map(r.map((function(r){return ["".concat(e.getLineAndCharacterOfPosition(t,r.range.end).line),r]}))),i=new e.Map;return {getUnusedExpectations:function(){return e.arrayFrom(n.entries()).filter((function(e){var t=e[0];return 0===e[1].type&&!i.get(t)})).map((function(e){return e[1]}))},markUsed:function(e){return !!n.has("".concat(e))&&(i.set("".concat(e),!0),!0)}}},e.getTokenPosOfNode=h,e.getNonDecoratorTokenPosOfNode=function(t,r){var n=!p(t)&&e.canHaveModifiers(t)?e.findLast(t.modifiers,e.isDecorator):void 0;return n?e.skipTrivia((r||_(t)).text,n.end):h(t,r)},e.getSourceTextOfNodeFromSourceFile=b,e.isExportNamespaceAsDefaultDeclaration=function(t){return !!(e.isExportDeclaration(t)&&t.exportClause&&e.isNamespaceExport(t.exportClause)&&"default"===t.exportClause.name.escapedText)},e.getTextOfNodeFromSourceText=x,e.getTextOfNode=D,e.indexOfNode=function(t,r){return e.binarySearch(t,r,S,e.compareValues)},e.getEmitFlags=T,e.getScriptTargetFeatures=function(){return {es2015:{Array:["find","findIndex","fill","copyWithin","entries","keys","values"],RegExp:["flags","sticky","unicode"],Reflect:["apply","construct","defineProperty","deleteProperty","get"," getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"],ArrayConstructor:["from","of"],ObjectConstructor:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],NumberConstructor:["isFinite","isInteger","isNaN","isSafeInteger","parseFloat","parseInt"],Math:["clz32","imul","sign","log10","log2","log1p","expm1","cosh","sinh","tanh","acosh","asinh","atanh","hypot","trunc","fround","cbrt"],Map:["entries","keys","values"],Set:["entries","keys","values"],Promise:e.emptyArray,PromiseConstructor:["all","race","reject","resolve"],Symbol:["for","keyFor"],WeakMap:["entries","keys","values"],WeakSet:["entries","keys","values"],Iterator:e.emptyArray,AsyncIterator:e.emptyArray,String:["codePointAt","includes","endsWith","normalize","repeat","startsWith","anchor","big","blink","bold","fixed","fontcolor","fontsize","italics","link","small","strike","sub","sup"],StringConstructor:["fromCodePoint","raw"]},es2016:{Array:["includes"]},es2017:{Atomics:e.emptyArray,SharedArrayBuffer:e.emptyArray,String:["padStart","padEnd"],ObjectConstructor:["values","entries","getOwnPropertyDescriptors"],DateTimeFormat:["formatToParts"]},es2018:{Promise:["finally"],RegExpMatchArray:["groups"],RegExpExecArray:["groups"],RegExp:["dotAll"],Intl:["PluralRules"],AsyncIterable:e.emptyArray,AsyncIterableIterator:e.emptyArray,AsyncGenerator:e.emptyArray,AsyncGeneratorFunction:e.emptyArray,NumberFormat:["formatToParts"]},es2019:{Array:["flat","flatMap"],ObjectConstructor:["fromEntries"],String:["trimStart","trimEnd","trimLeft","trimRight"],Symbol:["description"]},es2020:{BigInt:e.emptyArray,BigInt64Array:e.emptyArray,BigUint64Array:e.emptyArray,PromiseConstructor:["allSettled"],SymbolConstructor:["matchAll"],String:["matchAll"],DataView:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"],RelativeTimeFormat:["format","formatToParts","resolvedOptions"]},es2021:{PromiseConstructor:["any"],String:["replaceAll"]},es2022:{Array:["at"],String:["at"],Int8Array:["at"],Uint8Array:["at"],Uint8ClampedArray:["at"],Int16Array:["at"],Uint16Array:["at"],Int32Array:["at"],Uint32Array:["at"],Float32Array:["at"],Float64Array:["at"],BigInt64Array:["at"],BigUint64Array:["at"],ObjectConstructor:["hasOwn"],Error:["cause"]}}},(a=e.GetLiteralTextFlags||(e.GetLiteralTextFlags={}))[a.None=0]="None",a[a.NeverAsciiEscape=1]="NeverAsciiEscape",a[a.JsxAttributeEscape=2]="JsxAttributeEscape",a[a.TerminateUnterminatedLiterals=4]="TerminateUnterminatedLiterals",a[a.AllowNumericSeparator=8]="AllowNumericSeparator",e.getLiteralText=function(t,r,n){var i;if(r&&function(t,r){return !(wt(t)||!t.parent||4&r&&t.isUnterminated)&&(e.isNumericLiteral(t)&&512&t.numericLiteralFlags?!!(8&r):!e.isBigIntLiteral(t))}(t,n))return b(r,t);switch(t.kind){case 10:var a=2&n?Yt:1&n||16777216&T(t)?Vt:Wt;return t.singleQuote?"'"+a(t.text,39)+"'":'"'+a(t.text,34)+'"';case 14:case 15:case 16:case 17:a=1&n||16777216&T(t)?Vt:Wt;var o=null!==(i=t.rawText)&&void 0!==i?i:function(e){return e.replace(Rt,"\\${")}(a(t.text,96));switch(t.kind){case 14:return "`"+o+"`";case 15:return "`"+o+"${";case 16:return "}"+o+"${";case 17:return "}"+o+"`"}break;case 8:case 9:return t.text;case 13:return 4&n&&t.isUnterminated?t.text+(92===t.text.charCodeAt(t.text.length-1)?" /":"/"):t.text}return e.Debug.fail("Literal kind '".concat(t.kind,"' not accounted for."))},e.getTextOfConstantValue=function(t){return e.isString(t)?'"'+Wt(t)+'"':""+t},e.makeIdentifierFromModuleName=function(t){return e.getBaseFileName(t).replace(/^(\d)/,"_$1").replace(/\W/g,"_")},e.isBlockOrCatchScoped=function(t){return 0!=(3&e.getCombinedNodeFlags(t))||C(t)},e.isCatchClauseVariableDeclarationOrBindingElement=C,e.isAmbientModule=E,e.isModuleWithStringLiteralName=function(t){return e.isModuleDeclaration(t)&&10===t.name.kind},e.isNonGlobalAmbientModule=function(t){return e.isModuleDeclaration(t)&&e.isStringLiteral(t.name)},e.isEffectiveModuleDeclaration=k,e.isShorthandAmbientModuleSymbol=function(e){return !!(t=e.valueDeclaration)&&264===t.kind&&!t.body;var t;},e.isBlockScopedContainerTopLevel=function(t){return 308===t.kind||264===t.kind||e.isFunctionLikeOrClassStaticBlockDeclaration(t)},e.isGlobalScopeAugmentation=N,e.isExternalModuleAugmentation=A,e.isModuleAugmentationExternal=F,e.getNonAugmentationDeclaration=P,e.isEffectiveExternalModule=function(t,r){return e.isExternalModule(t)||r.isolatedModules||((n=On(r))===e.ModuleKind.CommonJS||n===e.ModuleKind.Node16||n===e.ModuleKind.NodeNext)&&!!t.commonJsModuleIndicator;var n;},e.isEffectiveStrictModeSourceFile=function(t,r){switch(t.scriptKind){case 1:case 3:case 2:case 4:break;default:return !1}return !(t.isDeclarationFile||!Bn(r,"alwaysStrict")&&!e.startsWithUseStrict(t.statements)&&(!e.isExternalModule(t)&&!r.isolatedModules||!(On(r)>=e.ModuleKind.ES2015)&&r.noImplicitUseStrict))},e.isAmbientPropertyDeclaration=function(e){return !!(16777216&e.flags)||Cr(e,2)},e.isBlockScope=w,e.isDeclarationWithTypeParameters=function(t){switch(t.kind){case 341:case 348:case 326:return !0;default:return e.assertType(t),I(t)}},e.isDeclarationWithTypeParameterChildren=I,e.isAnyImportSyntax=O,e.isAnyImportOrBareOrAccessedRequire=function(e){return O(e)||ke(e)},e.isLateVisibilityPaintedStatement=function(e){switch(e.kind){case 269:case 268:case 240:case 260:case 259:case 264:case 262:case 261:case 263:return !0;default:return !1}},e.hasPossibleExternalModuleReference=function(t){return M(t)||e.isModuleDeclaration(t)||e.isImportTypeNode(t)||H(t)},e.isAnyImportOrReExport=M,e.getEnclosingBlockScopeContainer=L,e.forEachEnclosingBlockScopeContainer=function(e,t){for(var r=L(e);r;)t(r),r=L(r);},e.declarationNameToString=R,e.getNameFromIndexInfo=function(e){return e.declaration?R(e.declaration.parameters[0].name):void 0},e.isComputedNonLiteralName=function(e){return 164===e.kind&&!Tt(e.expression)},e.tryGetTextOfPropertyName=B,e.getTextOfPropertyName=function(t){return e.Debug.checkDefined(B(t))},e.entityNameToString=j,e.createDiagnosticForNode=function(e,t,r,n,i,a){return J(_(e),e,t,r,n,i,a)},e.createDiagnosticForNodeArray=function(t,r,n,i,a,o,s){var c=e.skipTrivia(t.text,r.pos);return Cn(t,c,r.end-c,n,i,a,o,s)},e.createDiagnosticForNodeInSourceFile=J,e.createDiagnosticForNodeFromMessageChain=function(e,t,r){var n=_(e),i=V(n,e);return U(n,i.start,i.length,t,r)},e.createFileDiagnosticFromMessageChain=U,e.createDiagnosticForFileFromMessageChain=function(e,t,r){return {file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}},e.createDiagnosticMessageChainFromDiagnostic=function(e){return "string"==typeof e.messageText?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText},e.createDiagnosticForRange=function(e,t,r){return {file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}},e.getSpanOfTokenAtPosition=K,e.getErrorSpanForNode=V,e.isExternalOrCommonJsModule=function(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)},e.isJsonSourceFile=q,e.isEnumConst=function(t){return !!(2048&e.getCombinedModifierFlags(t))},e.isDeclarationReadonly=function(t){return !(!(64&e.getCombinedModifierFlags(t))||e.isParameterPropertyDeclaration(t,t.parent))},e.isVarConst=W,e.isLet=function(t){return !!(1&e.getCombinedNodeFlags(t))},e.isSuperCall=function(e){return 210===e.kind&&106===e.expression.kind},e.isImportCall=H,e.isImportMeta=function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText},e.isLiteralImportTypeNode=G,e.isPrologueDirective=Q,e.isCustomPrologue=X,e.isHoistedFunction=function(t){return X(t)&&e.isFunctionDeclaration(t)},e.isHoistedVariableStatement=function(t){return X(t)&&e.isVariableStatement(t)&&e.every(t.declarationList.declarations,Y)},e.getLeadingCommentRangesOfNode=function(t,r){return 11!==t.kind?e.getLeadingCommentRanges(r.text,t.pos):void 0},e.getJSDocCommentRanges=function(t,r){var n=166===t.kind||165===t.kind||215===t.kind||216===t.kind||214===t.kind||257===t.kind||278===t.kind?e.concatenate(e.getTrailingCommentRanges(r,t.pos),e.getLeadingCommentRanges(r,t.pos)):e.getLeadingCommentRanges(r,t.pos);return e.filter(n,(function(e){return 42===r.charCodeAt(e.pos+1)&&42===r.charCodeAt(e.pos+2)&&47!==r.charCodeAt(e.pos+3)}))},e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var Z=/^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var $,ee,te,re,ne=/^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;function ie(t){if(179<=t.kind&&t.kind<=202)return !0;switch(t.kind){case 131:case 157:case 148:case 160:case 152:case 134:case 153:case 149:case 155:case 144:return !0;case 114:return 219!==t.parent.kind;case 230:return e.isHeritageClause(t.parent)&&!Vr(t);case 165:return 197===t.parent.kind||192===t.parent.kind;case 79:(163===t.parent.kind&&t.parent.right===t||208===t.parent.kind&&t.parent.name===t)&&(t=t.parent),e.Debug.assert(79===t.kind||163===t.kind||208===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 163:case 208:case 108:var r=t.parent;if(183===r.kind)return !1;if(202===r.kind)return !r.isTypeOf;if(179<=r.kind&&r.kind<=202)return !0;switch(r.kind){case 230:return e.isHeritageClause(r.parent)&&!Vr(r);case 165:case 347:return t===r.constraint;case 169:case 168:case 166:case 257:case 259:case 215:case 216:case 173:case 171:case 170:case 174:case 175:case 176:case 177:case 178:case 213:return t===r.type;case 210:case 211:return e.contains(r.typeArguments,t);case 212:return !1}}return !1}function ae(e){if(e)switch(e.kind){case 205:case 302:case 166:case 299:case 169:case 168:case 300:case 257:return !0}return !1}function oe(e){return 258===e.parent.kind&&240===e.parent.parent.kind}function se(t){return !!Se(t)&&e.isBinaryExpression(t)&&1===Re(t)}function ce(e,t,r){return e.properties.filter((function(e){if(299===e.kind){var n=B(e.name);return t===n||!!r&&r===n}return !1}))}function le(t){if(t&&t.statements.length){var r=t.statements[0].expression;return e.tryCast(r,e.isObjectLiteralExpression)}}function ue(t,r){var n=le(t);return n?ce(n,r):e.emptyArray}function _e(t,r){for(e.Debug.assert(308!==t.kind);;){if(!(t=t.parent))return e.Debug.fail();switch(t.kind){case 164:if(e.isClassLike(t.parent.parent))return t;t=t.parent;break;case 167:166===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);break;case 216:if(!r)continue;case 259:case 215:case 264:case 172:case 169:case 168:case 171:case 170:case 173:case 174:case 175:case 176:case 177:case 178:case 263:case 308:return t}}}function de(e){var t=e.kind;return (208===t||209===t)&&106===e.expression.kind}function pe(t,r,n){if(e.isNamedDeclaration(t)&&e.isPrivateIdentifier(t.name))return !1;switch(t.kind){case 260:return !0;case 169:return 260===r.kind;case 174:case 175:case 171:return void 0!==t.body&&260===r.kind;case 166:return void 0!==r.body&&(173===r.kind||171===r.kind||175===r.kind)&&260===n.kind}return !1}function fe(e,t,r){return Ar(e)&&pe(e,t,r)}function ge(e,t,r){return fe(e,t,r)||me(e,t)}function me(t,r){switch(t.kind){case 260:return e.some(t.members,(function(e){return ge(e,t,r)}));case 171:case 175:case 173:return e.some(t.parameters,(function(e){return fe(e,t,r)}));default:return !1}}function ye(e){var t=e.parent;return (283===t.kind||282===t.kind||284===t.kind)&&t.tagName===e}function ve(t){switch(t.kind){case 106:case 104:case 110:case 95:case 13:case 206:case 207:case 208:case 209:case 210:case 211:case 212:case 231:case 213:case 235:case 232:case 214:case 215:case 228:case 216:case 219:case 217:case 218:case 221:case 222:case 223:case 224:case 227:case 225:case 229:case 281:case 282:case 285:case 226:case 220:case 233:return !0;case 230:return !e.isHeritageClause(t.parent);case 163:for(;163===t.parent.kind;)t=t.parent;return 183===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ye(t);case 314:for(;e.isJSDocMemberName(t.parent);)t=t.parent;return 183===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ye(t);case 80:return e.isBinaryExpression(t.parent)&&t.parent.left===t&&101===t.parent.operatorToken.kind;case 79:if(183===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ye(t))return !0;case 8:case 9:case 10:case 14:case 108:return he(t);default:return !1}}function he(e){var t=e.parent;switch(t.kind){case 257:case 166:case 169:case 168:case 302:case 299:case 205:return t.initializer===e;case 241:case 242:case 243:case 244:case 250:case 251:case 252:case 292:case 254:return t.expression===e;case 245:var r=t;return r.initializer===e&&258!==r.initializer.kind||r.condition===e||r.incrementor===e;case 246:case 247:var n=t;return n.initializer===e&&258!==n.initializer.kind||n.expression===e;case 213:case 231:case 236:case 164:case 235:return e===t.expression;case 167:case 291:case 290:case 301:return !0;case 230:return t.expression===e&&!ie(t);case 300:return t.objectAssignmentInitializer===e;default:return ve(t)}}function be(e){for(;163===e.kind||79===e.kind;)e=e.parent;return 183===e.kind}function xe(e){return 268===e.kind&&280===e.moduleReference.kind}function De(e){return Se(e)}function Se(e){return !!e&&!!(262144&e.flags)}function Te(e){return !!e&&!!(8388608&e.flags)}function Ce(t,r){if(210!==t.kind)return !1;var n=t,i=n.expression,a=n.arguments;if(79!==i.kind||"require"!==i.escapedText)return !1;if(1!==a.length)return !1;var o=a[0];return !r||e.isStringLiteralLike(o)}function Ee(e){return Ne(e,!1)}function ke(e){return Ne(e,!0)}function Ne(t,r){return e.isVariableDeclaration(t)&&!!t.initializer&&Ce(r?pn(t.initializer):t.initializer,!0)}function Ae(t){return e.isBinaryExpression(t)||dn(t)||e.isIdentifier(t)||e.isCallExpression(t)}function Fe(t){return Se(t)&&t.initializer&&e.isBinaryExpression(t.initializer)&&(56===t.initializer.operatorToken.kind||60===t.initializer.operatorToken.kind)&&t.name&&qr(t.name)&&we(t.name,t.initializer.left)?t.initializer.right:t.initializer}function Pe(t,r){if(e.isCallExpression(t)){var n=dt(t.expression);return 215===n.kind||216===n.kind?t:void 0}return 215===t.kind||228===t.kind||216===t.kind||e.isObjectLiteralExpression(t)&&(0===t.properties.length||r)?t:void 0}function we(t,r){return At(t)&&At(r)?Ft(t)===Ft(r):e.isMemberName(t)&&je(r)&&(108===r.expression.kind||e.isIdentifier(r.expression)&&("window"===r.expression.escapedText||"self"===r.expression.escapedText||"global"===r.expression.escapedText))?we(t,Ve(r)):!(!je(t)||!je(r))&&We(t)===We(r)&&we(t.expression,r.expression)}function Ie(e){for(;Kr(e,!0);)e=e.right;return e}function Oe(t){return e.isIdentifier(t)&&"exports"===t.escapedText}function Me(t){return e.isIdentifier(t)&&"module"===t.escapedText}function Le(t){return (e.isPropertyAccessExpression(t)||Je(t))&&Me(t.expression)&&"exports"===We(t)}function Re(t){var r=function(t){if(e.isCallExpression(t)){if(!Be(t))return 0;var r=t.arguments[0];return Oe(r)||Le(r)?8:ze(r)&&"prototype"===We(r)?9:7}return 63!==t.operatorToken.kind||!dn(t.left)||(n=Ie(t),e.isVoidExpression(n)&&e.isNumericLiteral(n.expression)&&"0"===n.expression.text)?0:Ke(t.left.expression,!0)&&"prototype"===We(t.left)&&e.isObjectLiteralExpression(Ge(t))?6:He(t.left);var n;}(t);return 5===r||Se(t)?r:0}function Be(t){return 3===e.length(t.arguments)&&e.isPropertyAccessExpression(t.expression)&&e.isIdentifier(t.expression.expression)&&"Object"===e.idText(t.expression.expression)&&"defineProperty"===e.idText(t.expression.name)&&Tt(t.arguments[1])&&Ke(t.arguments[0],!0)}function je(t){return e.isPropertyAccessExpression(t)||Je(t)}function Je(t){return e.isElementAccessExpression(t)&&Tt(t.argumentExpression)}function ze(t,r){return e.isPropertyAccessExpression(t)&&(!r&&108===t.expression.kind||e.isIdentifier(t.name)&&Ke(t.expression,!0))||Ue(t,r)}function Ue(e,t){return Je(e)&&(!t&&108===e.expression.kind||qr(e.expression)||ze(e.expression,!0))}function Ke(e,t){return qr(e)||ze(e,t)}function Ve(t){return e.isPropertyAccessExpression(t)?t.name:t.argumentExpression}function qe(t){if(e.isPropertyAccessExpression(t))return t.name;var r=dt(t.argumentExpression);return e.isNumericLiteral(r)||e.isStringLiteralLike(r)?r:t}function We(t){var r=qe(t);if(r){if(e.isIdentifier(r))return r.escapedText;if(e.isStringLiteralLike(r)||e.isNumericLiteral(r))return e.escapeLeadingUnderscores(r.text)}}function He(t){if(108===t.expression.kind)return 4;if(Le(t))return 2;if(Ke(t.expression,!0)){if(Hr(t.expression))return 3;for(var r=t;!e.isIdentifier(r.expression);)r=r.expression;var n=r.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===We(r))&&ze(t))return 1;if(Ke(t,!0)||e.isElementAccessExpression(t)&&kt(t))return 5}return 0}function Ge(t){for(;e.isBinaryExpression(t.right);)t=t.right;return t.right}function Qe(t){switch(t.parent.kind){case 269:case 275:return t.parent;case 280:return t.parent.parent;case 210:return H(t.parent)||Ce(t.parent,!1)?t.parent:void 0;case 198:return e.Debug.assert(e.isStringLiteral(t)),e.tryCast(t.parent.parent,e.isImportTypeNode);default:return}}function Xe(t){switch(t.kind){case 269:case 275:return t.moduleSpecifier;case 268:return 280===t.moduleReference.kind?t.moduleReference.expression:void 0;case 202:return G(t)?t.argument.literal:void 0;case 210:return t.arguments[0];case 264:return 10===t.name.kind?t.name:void 0;default:return e.Debug.assertNever(t)}}function Ye(e){return 348===e.kind||341===e.kind||342===e.kind}function Ze(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&0!==Re(t.expression)&&e.isBinaryExpression(t.expression.right)&&(56===t.expression.right.operatorToken.kind||60===t.expression.right.operatorToken.kind)?t.expression.right.right:void 0}function $e(e){switch(e.kind){case 240:var t=et(e);return t&&t.initializer;case 169:case 299:return e.initializer}}function et(t){return e.isVariableStatement(t)?e.firstOrUndefined(t.declarationList.declarations):void 0}function tt(t){return e.isModuleDeclaration(t)&&t.body&&264===t.body.kind?t.body:void 0}function rt(t,r){if(e.isJSDoc(r)){var n=e.filter(r.tags,(function(e){return nt(t,e)}));return r.tags===n?[r]:n}return nt(t,r)?[r]:void 0}function nt(t,r){return !(e.isJSDocTypeTag(r)&&r.parent&&e.isJSDoc(r.parent)&&e.isParenthesizedExpression(r.parent.parent)&&r.parent.parent!==t)}function it(t){var r=t.parent;return 299===r.kind||274===r.kind||169===r.kind||241===r.kind&&208===t.kind||250===r.kind||tt(r)||e.isBinaryExpression(t)&&63===t.operatorToken.kind?r:r.parent&&(et(r.parent)===t||e.isBinaryExpression(r)&&63===r.operatorToken.kind)?r.parent:r.parent&&r.parent.parent&&(et(r.parent.parent)||$e(r.parent.parent)===t||Ze(r.parent.parent))?r.parent.parent:void 0}function at(t){var r=ot(t);if(r)return e.isPropertySignature(r)&&r.type&&e.isFunctionLike(r.type)?r.type:e.isFunctionLike(r)?r:void 0}function ot(t){var r=st(t);if(r)return Ze(r)||function(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&63===t.expression.operatorToken.kind?Ie(t.expression):void 0}(r)||$e(r)||et(r)||tt(r)||r}function st(t){var r=ct(t);if(r){var n=r.parent;return n&&n.jsDoc&&r===e.lastOrUndefined(n.jsDoc)?n:void 0}}function ct(t){return e.findAncestor(t.parent,e.isJSDoc)}function lt(e){for(var t=e.parent;;){switch(t.kind){case 223:var r=t.operatorToken.kind;return Jr(r)&&t.left===e?63===r||jr(r)?1:2:0;case 221:case 222:var n=t.operator;return 45===n||46===n?2:0;case 246:case 247:return t.initializer===e?1:0;case 214:case 206:case 227:case 232:e=t;break;case 301:e=t.parent;break;case 300:if(t.name!==e)return 0;e=t.parent;break;case 299:if(t.name===e)return 0;e=t.parent;break;default:return 0}t=e.parent;}}function ut(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function _t(e){return ut(e,214)}function dt(t,r){var n=r?17:1;return e.skipOuterExpressions(t,n)}function pt(t){return qr(t)||e.isClassExpression(t)}function ft(e){return pt(gt(e))}function gt(t){return e.isExportAssignment(t)?t.expression:t.right}function mt(t){var r=yt(t);if(r&&Se(t)){var n=e.getJSDocAugmentsTag(t);if(n)return n.class}return r}function yt(e){var t=bt(e.heritageClauses,94);return t&&t.types.length>0?t.types[0]:void 0}function vt(t){if(Se(t))return e.getJSDocImplementsTags(t).map((function(e){return e.class}));var r=bt(t.heritageClauses,117);return null==r?void 0:r.types}function ht(e){var t=bt(e.heritageClauses,94);return t?t.types:void 0}function bt(e,t){if(e)for(var r=0,n=e;r<n.length;r++){var i=n[r];if(i.token===t)return i}}function xt(e){return 81<=e&&e<=162}function Dt(e){return 126<=e&&e<=162}function St(e){return xt(e)&&!Dt(e)}function Tt(t){return e.isStringLiteralLike(t)||e.isNumericLiteral(t)}function Ct(t){return e.isPrefixUnaryExpression(t)&&(39===t.operator||40===t.operator)&&e.isNumericLiteral(t.operand)}function Et(t){var r=e.getNameOfDeclaration(t);return !!r&&kt(r)}function kt(t){if(164!==t.kind&&209!==t.kind)return !1;var r=e.isElementAccessExpression(t)?dt(t.argumentExpression):t.expression;return !Tt(r)&&!Ct(r)}function Nt(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:return e.escapeLeadingUnderscores(t.text);case 164:var r=t.expression;return Tt(r)?e.escapeLeadingUnderscores(r.text):Ct(r)?40===r.operator?e.tokenToString(r.operator)+r.operand.text:r.operand.text:void 0;default:return e.Debug.assertNever(t)}}function At(e){switch(e.kind){case 79:case 10:case 14:case 8:return !0;default:return !1}}function Ft(t){return e.isMemberName(t)?e.idText(t):t.text}function Pt(e){for(;205===e.kind;)e=e.parent.parent;return e}function wt(e){return vi(e.pos)||vi(e.end)}function It(e,t,r){switch(e){case 211:return r?0:1;case 221:case 218:case 219:case 217:case 220:case 224:case 226:return 1;case 223:switch(t){case 42:case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 1}}return 0}function Ot(e){return 223===e.kind?e.operatorToken.kind:221===e.kind||222===e.kind?e.operator:e.kind}function Mt(e,t,r){switch(e){case 354:return 0;case 227:return 1;case 226:return 2;case 224:return 4;case 223:switch(t){case 27:return 0;case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 3;default:return Lt(t)}case 213:case 232:case 221:case 218:case 219:case 217:case 220:return 16;case 222:return 17;case 210:return 18;case 211:return r?19:18;case 212:case 208:case 209:case 233:return 19;case 231:case 235:return 11;case 108:case 106:case 79:case 80:case 104:case 110:case 95:case 8:case 9:case 10:case 206:case 207:case 215:case 216:case 228:case 13:case 14:case 225:case 214:case 229:case 281:case 282:case 285:return 20;default:return -1}}function Lt(e){switch(e){case 60:return 4;case 56:return 5;case 55:return 6;case 51:return 7;case 52:return 8;case 50:return 9;case 34:case 35:case 36:case 37:return 10;case 29:case 31:case 32:case 33:case 102:case 101:case 128:case 150:return 11;case 47:case 48:case 49:return 12;case 39:case 40:return 13;case 41:case 43:case 44:return 14;case 42:return 15}return -1}e.isPartOfTypeNode=ie,e.isChildOfNodeWithKind=function(e,t){for(;e;){if(e.kind===t)return !0;e=e.parent;}return !1},e.forEachReturnStatement=function(t,r){return function t(n){switch(n.kind){case 250:return r(n);case 266:case 238:case 242:case 243:case 244:case 245:case 246:case 247:case 251:case 252:case 292:case 293:case 253:case 255:case 295:return e.forEachChild(n,t)}}(t)},e.forEachYieldExpression=function(t,r){return function t(n){switch(n.kind){case 226:r(n);var i=n.expression;return void(i&&t(i));case 263:case 261:case 264:case 262:return;default:if(e.isFunctionLike(n)){if(n.name&&164===n.name.kind)return void t(n.name.expression)}else ie(n)||e.forEachChild(n,t);}}(t)},e.getRestParameterElementType=function(t){return t&&185===t.kind?t.elementType:t&&180===t.kind?e.singleOrUndefined(t.typeArguments):void 0},e.getMembersOfDeclaration=function(e){switch(e.kind){case 261:case 260:case 228:case 184:return e.members;case 207:return e.properties}},e.isVariableLike=ae,e.isVariableLikeOrAccessor=function(t){return ae(t)||e.isAccessor(t)},e.isVariableDeclarationInVariableStatement=oe,e.isCommonJsExportedExpression=function(t){return !!Se(t)&&(e.isObjectLiteralExpression(t.parent)&&e.isBinaryExpression(t.parent.parent)&&2===Re(t.parent.parent)||se(t.parent))},e.isCommonJsExportPropertyAssignment=se,e.isValidESSymbolDeclaration=function(t){return (e.isVariableDeclaration(t)?W(t)&&e.isIdentifier(t.name)&&oe(t):e.isPropertyDeclaration(t)?Nr(t)&&kr(t):e.isPropertySignature(t)&&Nr(t))||se(t)},e.introducesArgumentsExoticObject=function(e){switch(e.kind){case 171:case 170:case 173:case 174:case 175:case 259:case 215:return !0}return !1},e.unwrapInnermostStatementOfLabel=function(e,t){for(;;){if(t&&t(e),253!==e.statement.kind)return e.statement;e=e.statement;}},e.isFunctionBlock=function(t){return t&&238===t.kind&&e.isFunctionLike(t.parent)},e.isObjectLiteralMethod=function(e){return e&&171===e.kind&&207===e.parent.kind},e.isObjectLiteralOrClassExpressionMethodOrAccessor=function(e){return !(171!==e.kind&&174!==e.kind&&175!==e.kind||207!==e.parent.kind&&228!==e.parent.kind)},e.isIdentifierTypePredicate=function(e){return e&&1===e.kind},e.isThisTypePredicate=function(e){return e&&0===e.kind},e.getPropertyAssignment=ce,e.getPropertyArrayElementValue=function(t,r,n){return e.firstDefined(ce(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigObjectLiteralExpression=le,e.getTsConfigPropArrayElementValue=function(t,r,n){return e.firstDefined(ue(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigPropArray=ue,e.getContainingFunction=function(t){return e.findAncestor(t.parent,e.isFunctionLike)},e.getContainingFunctionDeclaration=function(t){return e.findAncestor(t.parent,e.isFunctionLikeDeclaration)},e.getContainingClass=function(t){return e.findAncestor(t.parent,e.isClassLike)},e.getContainingClassStaticBlock=function(t){return e.findAncestor(t.parent,(function(t){return e.isClassLike(t)||e.isFunctionLike(t)?"quit":e.isClassStaticBlockDeclaration(t)}))},e.getContainingFunctionOrClassStaticBlock=function(t){return e.findAncestor(t.parent,e.isFunctionLikeOrClassStaticBlockDeclaration)},e.getThisContainer=_e,e.isThisContainerOrFunctionBlock=function(e){switch(e.kind){case 216:case 259:case 215:case 169:return !0;case 238:switch(e.parent.kind){case 173:case 171:case 174:case 175:return !0;default:return !1}default:return !1}},e.isInTopLevelContext=function(t){e.isIdentifier(t)&&(e.isClassDeclaration(t.parent)||e.isFunctionDeclaration(t.parent))&&t.parent.name===t&&(t=t.parent);var r=_e(t,!0);return e.isSourceFile(r)},e.getNewTargetContainer=function(e){var t=_e(e,!1);if(t)switch(t.kind){case 173:case 259:case 215:return t}},e.getSuperContainer=function(t,r){for(;;){if(!(t=t.parent))return t;switch(t.kind){case 164:t=t.parent;break;case 259:case 215:case 216:if(!r)continue;case 169:case 168:case 171:case 170:case 173:case 174:case 175:case 172:return t;case 167:166===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);}}},e.getImmediatelyInvokedFunctionExpression=function(e){if(215===e.kind||216===e.kind){for(var t=e,r=e.parent;214===r.kind;)t=r,r=r.parent;if(210===r.kind&&r.expression===t)return r}},e.isSuperOrSuperProperty=function(e){return 106===e.kind||de(e)},e.isSuperProperty=de,e.isThisProperty=function(e){var t=e.kind;return (208===t||209===t)&&108===e.expression.kind},e.isThisInitializedDeclaration=function(t){var r;return !!t&&e.isVariableDeclaration(t)&&108===(null===(r=t.initializer)||void 0===r?void 0:r.kind)},e.isThisInitializedObjectBindingExpression=function(t){return !!t&&(e.isShorthandPropertyAssignment(t)||e.isPropertyAssignment(t))&&e.isBinaryExpression(t.parent.parent)&&63===t.parent.parent.operatorToken.kind&&108===t.parent.parent.right.kind},e.getEntityNameFromTypeNode=function(e){switch(e.kind){case 180:return e.typeName;case 230:return qr(e.expression)?e.expression:void 0;case 79:case 163:return e}},e.getInvokedExpression=function(e){switch(e.kind){case 212:return e.tag;case 283:case 282:return e.tagName;default:return e.expression}},e.nodeCanBeDecorated=pe,e.nodeIsDecorated=fe,e.nodeOrChildIsDecorated=ge,e.childIsDecorated=me,e.classOrConstructorParameterIsDecorated=function(e){if(fe(e))return !0;var t=pr(e);return !!t&&me(t,e)},e.isJSXTagName=ye,e.isExpressionNode=ve,e.isInExpressionContext=he,e.isPartOfTypeQuery=be,e.isNamespaceReexportDeclaration=function(t){return e.isNamespaceExport(t)&&!!t.parent.moduleSpecifier},e.isExternalModuleImportEqualsDeclaration=xe,e.getExternalModuleImportEqualsDeclarationExpression=function(t){return e.Debug.assert(xe(t)),t.moduleReference.expression},e.getExternalModuleRequireArgument=function(e){return ke(e)&&pn(e.initializer).arguments[0]},e.isInternalModuleImportEqualsDeclaration=function(e){return 268===e.kind&&280!==e.moduleReference.kind},e.isSourceFileJS=De,e.isSourceFileNotJS=function(e){return !Se(e)},e.isInJSFile=Se,e.isInJsonFile=function(e){return !!e&&!!(67108864&e.flags)},e.isSourceFileNotJson=function(e){return !q(e)},e.isInJSDoc=Te,e.isJSDocIndexSignature=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&t.typeArguments&&2===t.typeArguments.length&&(152===t.typeArguments[0].kind||148===t.typeArguments[0].kind)},e.isRequireCall=Ce,e.isVariableDeclarationInitializedToRequire=Ee,e.isVariableDeclarationInitializedToBareOrAccessedRequire=ke,e.isRequireVariableStatement=function(t){return e.isVariableStatement(t)&&t.declarationList.declarations.length>0&&e.every(t.declarationList.declarations,(function(e){return Ee(e)}))},e.isSingleOrDoubleQuote=function(e){return 39===e||34===e},e.isStringDoubleQuoted=function(e,t){return 34===b(t,e).charCodeAt(0)},e.isAssignmentDeclaration=Ae,e.getEffectiveInitializer=Fe,e.getDeclaredExpandoInitializer=function(e){var t=Fe(e);return t&&Pe(t,Hr(e.name))},e.getAssignedExpandoInitializer=function(t){if(t&&t.parent&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind){var r=Hr(t.parent.left);return Pe(t.parent.right,r)||function(t,r,n){var i=e.isBinaryExpression(r)&&(56===r.operatorToken.kind||60===r.operatorToken.kind)&&Pe(r.right,n);if(i&&we(t,r.left))return i}(t.parent.left,t.parent.right,r)}if(t&&e.isCallExpression(t)&&Be(t)){var n=function(t,r){return e.forEach(t.properties,(function(t){return e.isPropertyAssignment(t)&&e.isIdentifier(t.name)&&"value"===t.name.escapedText&&t.initializer&&Pe(t.initializer,r)}))}(t.arguments[2],"prototype"===t.arguments[1].text);if(n)return n}},e.getExpandoInitializer=Pe,e.isDefaultedExpandoInitializer=function(t){var r=e.isVariableDeclaration(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind?t.parent.left:void 0;return r&&Pe(t.right,Hr(r))&&qr(r)&&we(r,t.left)},e.getNameOfExpando=function(t){if(e.isBinaryExpression(t.parent)){var r=56!==t.parent.operatorToken.kind&&60!==t.parent.operatorToken.kind||!e.isBinaryExpression(t.parent.parent)?t.parent:t.parent.parent;if(63===r.operatorToken.kind&&e.isIdentifier(r.left))return r.left}else if(e.isVariableDeclaration(t.parent))return t.parent.name},e.isSameEntityName=we,e.getRightMostAssignedExpression=Ie,e.isExportsIdentifier=Oe,e.isModuleIdentifier=Me,e.isModuleExportsAccessExpression=Le,e.getAssignmentDeclarationKind=Re,e.isBindableObjectDefinePropertyCall=Be,e.isLiteralLikeAccess=je,e.isLiteralLikeElementAccess=Je,e.isBindableStaticAccessExpression=ze,e.isBindableStaticElementAccessExpression=Ue,e.isBindableStaticNameExpression=Ke,e.getNameOrArgument=Ve,e.getElementOrPropertyAccessArgumentExpressionOrName=qe,e.getElementOrPropertyAccessName=We,e.getAssignmentDeclarationPropertyAccessKind=He,e.getInitializerOfBinaryExpression=Ge,e.isPrototypePropertyAssignment=function(t){return e.isBinaryExpression(t)&&3===Re(t)},e.isSpecialPropertyDeclaration=function(t){return Se(t)&&t.parent&&241===t.parent.kind&&(!e.isElementAccessExpression(t)||Je(t))&&!!e.getJSDocTypeTag(t.parent)},e.setValueDeclaration=function(e,t){var r=e.valueDeclaration;(!r||(!(16777216&t.flags)||16777216&r.flags)&&Ae(r)&&!Ae(t)||r.kind!==t.kind&&k(r))&&(e.valueDeclaration=t);},e.isFunctionSymbol=function(t){if(!t||!t.valueDeclaration)return !1;var r=t.valueDeclaration;return 259===r.kind||e.isVariableDeclaration(r)&&r.initializer&&e.isFunctionLike(r.initializer)},e.tryGetModuleSpecifierFromDeclaration=function(t){var r,n;switch(t.kind){case 257:return null===(r=e.findAncestor(t.initializer,(function(e){return Ce(e,!0)})))||void 0===r?void 0:r.arguments[0];case 269:return e.tryCast(t.moduleSpecifier,e.isStringLiteralLike);case 268:return e.tryCast(null===(n=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===n?void 0:n.expression,e.isStringLiteralLike);default:e.Debug.assertNever(t);}},e.importFromModuleSpecifier=function(t){return Qe(t)||e.Debug.failBadSyntaxKind(t.parent)},e.tryGetImportFromModuleSpecifier=Qe,e.getExternalModuleName=Xe,e.getNamespaceDeclarationNode=function(t){switch(t.kind){case 269:return t.importClause&&e.tryCast(t.importClause.namedBindings,e.isNamespaceImport);case 268:return t;case 275:return t.exportClause&&e.tryCast(t.exportClause,e.isNamespaceExport);default:return e.Debug.assertNever(t)}},e.isDefaultImport=function(e){return 269===e.kind&&!!e.importClause&&!!e.importClause.name},e.forEachImportClauseDeclaration=function(t,r){var n;return t.name&&(n=r(t))||t.namedBindings&&(n=e.isNamespaceImport(t.namedBindings)?r(t.namedBindings):e.forEach(t.namedBindings.elements,r))?n:void 0},e.hasQuestionToken=function(e){if(e)switch(e.kind){case 166:case 171:case 170:case 300:case 299:case 169:case 168:return void 0!==e.questionToken}return !1},e.isJSDocConstructSignature=function(t){var r=e.isJSDocFunctionType(t)?e.firstOrUndefined(t.parameters):void 0,n=e.tryCast(r&&r.name,e.isIdentifier);return !!n&&"new"===n.escapedText},e.isJSDocTypeAlias=Ye,e.isTypeAlias=function(t){return Ye(t)||e.isTypeAliasDeclaration(t)},e.getSingleInitializerOfVariableStatementOrPropertyDeclaration=$e,e.getSingleVariableOfVariableStatement=et,e.getJSDocCommentsAndTags=function(t,r){var n;ae(t)&&e.hasInitializer(t)&&e.hasJSDocNodes(t.initializer)&&(n=e.addRange(n,rt(t,e.last(t.initializer.jsDoc))));for(var i=t;i&&i.parent;){if(e.hasJSDocNodes(i)&&(n=e.addRange(n,rt(t,e.last(i.jsDoc)))),166===i.kind){n=e.addRange(n,(r?e.getJSDocParameterTagsNoCache:e.getJSDocParameterTags)(i));break}if(165===i.kind){n=e.addRange(n,(r?e.getJSDocTypeParameterTagsNoCache:e.getJSDocTypeParameterTags)(i));break}i=it(i);}return n||e.emptyArray},e.getNextJSDocCommentLocation=it,e.getParameterSymbolFromJSDoc=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t.name)){var r=t.name.escapedText,n=at(t);if(n){var i=e.find(n.parameters,(function(e){return 79===e.name.kind&&e.name.escapedText===r}));return i&&i.symbol}}},e.getEffectiveContainerForJSDocTemplateTag=function(t){if(e.isJSDoc(t.parent)&&t.parent.tags){var r=e.find(t.parent.tags,Ye);if(r)return r}return at(t)},e.getHostSignatureFromJSDoc=at,e.getEffectiveJSDocHost=ot,e.getJSDocHost=st,e.getJSDocRoot=ct,e.getTypeParameterFromJsDoc=function(t){var r=t.name.escapedText,n=t.parent.parent.parent.typeParameters;return n&&e.find(n,(function(e){return e.name.escapedText===r}))},e.hasTypeArguments=function(e){return !!e.typeArguments},(re=e.AssignmentKind||(e.AssignmentKind={}))[re.None=0]="None",re[re.Definite=1]="Definite",re[re.Compound=2]="Compound",e.getAssignmentTargetKind=lt,e.isAssignmentTarget=function(e){return 0!==lt(e)},e.isNodeWithPossibleHoistedDeclaration=function(e){switch(e.kind){case 238:case 240:case 251:case 242:case 252:case 266:case 292:case 293:case 253:case 245:case 246:case 247:case 243:case 244:case 255:case 295:return !0}return !1},e.isValueSignatureDeclaration=function(t){return e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isMethodOrAccessor(t)||e.isFunctionDeclaration(t)||e.isConstructorDeclaration(t)},e.walkUpParenthesizedTypes=function(e){return ut(e,193)},e.walkUpParenthesizedExpressions=_t,e.walkUpParenthesizedTypesAndGetParentAndChild=function(e){for(var t;e&&193===e.kind;)t=e,e=e.parent;return [t,e]},e.skipTypeParentheses=function(t){for(;e.isParenthesizedTypeNode(t);)t=t.type;return t},e.skipParentheses=dt,e.isDeleteTarget=function(e){return (208===e.kind||209===e.kind)&&(e=_t(e.parent))&&217===e.kind},e.isNodeDescendantOf=function(e,t){for(;e;){if(e===t)return !0;e=e.parent;}return !1},e.isDeclarationName=function(t){return !e.isSourceFile(t)&&!e.isBindingPattern(t)&&e.isDeclaration(t.parent)&&t.parent.name===t},e.getDeclarationFromName=function(t){var r=t.parent;switch(t.kind){case 10:case 14:case 8:if(e.isComputedPropertyName(r))return r.parent;case 79:if(e.isDeclaration(r))return r.name===t?r:void 0;if(e.isQualifiedName(r)){var n=r.parent;return e.isJSDocParameterTag(n)&&n.name===r?n:void 0}var i=r.parent;return e.isBinaryExpression(i)&&0!==Re(i)&&(i.left.symbol||i.symbol)&&e.getNameOfDeclaration(i)===t?i:void 0;case 80:return e.isDeclaration(r)&&r.name===t?r:void 0;default:return}},e.isLiteralComputedPropertyDeclarationName=function(t){return Tt(t)&&164===t.parent.kind&&e.isDeclaration(t.parent.parent)},e.isIdentifierName=function(e){var t=e.parent;switch(t.kind){case 169:case 168:case 171:case 170:case 174:case 175:case 302:case 299:case 208:return t.name===e;case 163:return t.right===e;case 205:case 273:return t.propertyName===e;case 278:case 288:case 282:case 283:case 284:return !0}return !1},e.isAliasSymbolDeclaration=function(t){return !!(268===t.kind||267===t.kind||270===t.kind&&t.name||271===t.kind||277===t.kind||273===t.kind||278===t.kind||274===t.kind&&ft(t))||Se(t)&&(e.isBinaryExpression(t)&&2===Re(t)&&ft(t)||e.isPropertyAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&pt(t.parent.right))},e.getAliasDeclarationFromName=function e(t){switch(t.parent.kind){case 270:case 273:case 271:case 278:case 274:case 268:case 277:return t.parent;case 163:do{t=t.parent;}while(163===t.parent.kind);return e(t)}},e.isAliasableExpression=pt,e.exportAssignmentIsAlias=ft,e.getExportAssignmentExpression=gt,e.getPropertyAssignmentAliasLikeExpression=function(e){return 300===e.kind?e.name:299===e.kind?e.initializer:e.parent.right},e.getEffectiveBaseTypeNode=mt,e.getClassExtendsHeritageElement=yt,e.getEffectiveImplementsTypeNodes=vt,e.getAllSuperTypeNodes=function(t){return e.isInterfaceDeclaration(t)?ht(t)||e.emptyArray:e.isClassLike(t)&&e.concatenate(e.singleElementArray(mt(t)),vt(t))||e.emptyArray},e.getInterfaceBaseTypeNodes=ht,e.getHeritageClause=bt,e.getAncestor=function(e,t){for(;e;){if(e.kind===t)return e;e=e.parent;}},e.isKeyword=xt,e.isContextualKeyword=Dt,e.isNonContextualKeyword=St,e.isFutureReservedKeyword=function(e){return 117<=e&&e<=125},e.isStringANonContextualKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&St(r)},e.isStringAKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&xt(r)},e.isIdentifierANonContextualKeyword=function(e){var t=e.originalKeywordKind;return !!t&&!Dt(t)},e.isTrivia=function(e){return 2<=e&&e<=7},(te=e.FunctionFlags||(e.FunctionFlags={}))[te.Normal=0]="Normal",te[te.Generator=1]="Generator",te[te.Async=2]="Async",te[te.Invalid=4]="Invalid",te[te.AsyncGenerator=3]="AsyncGenerator",e.getFunctionFlags=function(e){if(!e)return 4;var t=0;switch(e.kind){case 259:case 215:case 171:e.asteriskToken&&(t|=1);case 216:Cr(e,512)&&(t|=2);}return e.body||(t|=4),t},e.isAsyncFunction=function(e){switch(e.kind){case 259:case 215:case 216:case 171:return void 0!==e.body&&void 0===e.asteriskToken&&Cr(e,512)}return !1},e.isStringOrNumericLiteralLike=Tt,e.isSignedNumericLiteral=Ct,e.hasDynamicName=Et,e.isDynamicName=kt,e.getPropertyNameForPropertyNameNode=Nt,e.isPropertyNameLiteral=At,e.getTextOfIdentifierOrLiteral=Ft,e.getEscapedTextOfIdentifierOrLiteral=function(t){return e.isMemberName(t)?t.escapedText:e.escapeLeadingUnderscores(t.text)},e.getPropertyNameForUniqueESSymbol=function(t){return "__@".concat(e.getSymbolId(t),"@").concat(t.escapedName)},e.getSymbolNameForPrivateIdentifier=function(t,r){return "__#".concat(e.getSymbolId(t),"@").concat(r)},e.isKnownSymbol=function(t){return e.startsWith(t.escapedName,"__@")},e.isPrivateIdentifierSymbol=function(t){return e.startsWith(t.escapedName,"__#")},e.isESSymbolIdentifier=function(e){return 79===e.kind&&"Symbol"===e.escapedText},e.isPushOrUnshiftIdentifier=function(e){return "push"===e.escapedText||"unshift"===e.escapedText},e.isParameterDeclaration=function(e){return 166===Pt(e).kind},e.getRootDeclaration=Pt,e.nodeStartsNewLexicalEnvironment=function(e){var t=e.kind;return 173===t||215===t||259===t||216===t||171===t||174===t||175===t||264===t||308===t},e.nodeIsSynthesized=wt,e.getOriginalSourceFile=function(t){return e.getParseTreeNode(t,e.isSourceFile)||t},(ee=e.Associativity||(e.Associativity={}))[ee.Left=0]="Left",ee[ee.Right=1]="Right",e.getExpressionAssociativity=function(e){var t=Ot(e),r=211===e.kind&&void 0!==e.arguments;return It(e.kind,t,r)},e.getOperatorAssociativity=It,e.getExpressionPrecedence=function(e){var t=Ot(e),r=211===e.kind&&void 0!==e.arguments;return Mt(e.kind,t,r)},e.getOperator=Ot,($=e.OperatorPrecedence||(e.OperatorPrecedence={}))[$.Comma=0]="Comma",$[$.Spread=1]="Spread",$[$.Yield=2]="Yield",$[$.Assignment=3]="Assignment",$[$.Conditional=4]="Conditional",$[$.Coalesce=4]="Coalesce",$[$.LogicalOR=5]="LogicalOR",$[$.LogicalAND=6]="LogicalAND",$[$.BitwiseOR=7]="BitwiseOR",$[$.BitwiseXOR=8]="BitwiseXOR",$[$.BitwiseAND=9]="BitwiseAND",$[$.Equality=10]="Equality",$[$.Relational=11]="Relational",$[$.Shift=12]="Shift",$[$.Additive=13]="Additive",$[$.Multiplicative=14]="Multiplicative",$[$.Exponentiation=15]="Exponentiation",$[$.Unary=16]="Unary",$[$.Update=17]="Update",$[$.LeftHandSide=18]="LeftHandSide",$[$.Member=19]="Member",$[$.Primary=20]="Primary",$[$.Highest=20]="Highest",$[$.Lowest=0]="Lowest",$[$.Invalid=-1]="Invalid",e.getOperatorPrecedence=Mt,e.getBinaryOperatorPrecedence=Lt,e.getSemanticJsxChildren=function(t){return e.filter(t,(function(e){switch(e.kind){case 291:return !!e.expression;case 11:return !e.containsOnlyTriviaWhiteSpaces;default:return !0}}))},e.createDiagnosticCollection=function(){var t=[],r=[],n=new e.Map,i=!1;return {add:function(a){var o;a.file?(o=n.get(a.file.fileName))||(o=[],n.set(a.file.fileName,o),e.insertSorted(r,a.file.fileName,e.compareStringsCaseSensitive)):(i&&(i=!1,t=t.slice()),o=t),e.insertSorted(o,a,Nn);},lookup:function(r){var i;if(i=r.file?n.get(r.file.fileName):t){var a=e.binarySearch(i,r,e.identity,Nn);return a>=0?i[a]:void 0}},getGlobalDiagnostics:function(){return i=!0,t},getDiagnostics:function(i){if(i)return n.get(i)||[];var a=e.flatMapToMutable(r,(function(e){return n.get(e)}));return t.length?(a.unshift.apply(a,t),a):a}}};var Rt=/\$\{/g;e.hasInvalidEscape=function(t){return t&&!!(e.isNoSubstitutionTemplateLiteral(t)?t.templateFlags:t.head.templateFlags||e.some(t.templateSpans,(function(e){return !!e.literal.templateFlags})))};var Bt=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,jt=/[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Jt=/\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,zt=new e.Map(e.getEntries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","":"\\u0085","\r\n":"\\r\\n"}));function Ut(e){return "\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Kt(e,t,r){if(0===e.charCodeAt(0)){var n=r.charCodeAt(t+e.length);return n>=48&&n<=57?"\\x00":"\\0"}return zt.get(e)||Ut(e.charCodeAt(0))}function Vt(e,t){var r=96===t?Jt:39===t?jt:Bt;return e.replace(r,Kt)}e.escapeString=Vt;var qt=/[^\u0000-\u007F]/g;function Wt(e,t){return e=Vt(e,t),qt.test(e)?e.replace(qt,(function(e){return Ut(e.charCodeAt(0))})):e}e.escapeNonAsciiString=Wt;var Ht=/[\"\u0000-\u001f\u2028\u2029\u0085]/g,Gt=/[\'\u0000-\u001f\u2028\u2029\u0085]/g,Qt=new e.Map(e.getEntries({'"':"&quot;","'":"&apos;"}));function Xt(e){return 0===e.charCodeAt(0)?"&#0;":Qt.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function Yt(e,t){var r=39===t?Gt:Ht;return e.replace(r,Xt)}e.escapeJsxAttributeString=Yt,e.stripQuotes=function(e){var t,r=e.length;return r>=2&&e.charCodeAt(0)===e.charCodeAt(r-1)&&(39===(t=e.charCodeAt(0))||34===t||96===t)?e.substring(1,r-1):e},e.isIntrinsicJsxName=function(t){var r=t.charCodeAt(0);return r>=97&&r<=122||e.stringContains(t,"-")||e.stringContains(t,":")};var Zt=["","  "];function $t(e){for(var t=Zt[1],r=Zt.length;r<=e;r++)Zt.push(Zt[r-1]+t);return Zt[e]}function er(){return Zt[1].length}function tr(e){return !!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function rr(e,t,r){return t.moduleName||ir(e,t.fileName,r&&r.fileName)}function nr(t,r){return t.getCanonicalFileName(e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()))}function ir(t,r,n){var i=function(e){return t.getCanonicalFileName(e)},a=e.toPath(n?e.getDirectoryPath(n):t.getCommonSourceDirectory(),t.getCurrentDirectory(),i),o=e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()),s=fi(e.getRelativePathToDirectoryOrUrl(a,o,a,i,!1));return n?e.ensurePathIsNonModuleName(s):s}function ar(e,t,r,n,i){var a=t.declarationDir||t.outDir,o=a?ur(e,a,r,n,i):e,s=or(o);return fi(o)+s}function or(t){return e.fileExtensionIsOneOf(t,[".mjs",".mts"])?".d.mts":e.fileExtensionIsOneOf(t,[".cjs",".cts"])?".d.cts":e.fileExtensionIsOneOf(t,[".json"])?".json.d.ts":".d.ts"}function sr(e){return e.outFile||e.out}function cr(e,t,r){return !(t.getCompilerOptions().noEmitForJsFiles&&De(e))&&!e.isDeclarationFile&&!t.isSourceFileFromExternalLibrary(e)&&(r||!(q(e)&&t.getResolvedProjectReferenceToRedirect(e.fileName))&&!t.isSourceOfProjectReferenceRedirect(e.fileName))}function lr(e,t,r){return ur(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))}function ur(t,r,n,i,a){var o=e.getNormalizedAbsolutePath(t,n);return o=0===a(o).indexOf(a(i))?o.substring(i.length):o,e.combinePaths(r,o)}function _r(t,r,n){t.length>e.getRootLength(t)&&!n(t)&&(_r(e.getDirectoryPath(t),r,n),r(t));}function dr(t,r){return e.computeLineOfPosition(t,r)}function pr(t){return e.find(t.members,(function(t){return e.isConstructorDeclaration(t)&&f(t.body)}))}function fr(e){if(e&&e.parameters.length>0){var t=2===e.parameters.length&&gr(e.parameters[0]);return e.parameters[t?1:0]}}function gr(e){return mr(e.name)}function mr(e){return !!e&&79===e.kind&&yr(e)}function yr(e){return 108===e.originalKeywordKind}function vr(t){if(Se(t)||!e.isFunctionDeclaration(t)){var r=t.type;return r||!Se(t)?r:e.isJSDocPropertyLikeTag(t)?t.typeExpression&&t.typeExpression.type:e.getJSDocType(t)}}function hr(e,t,r,n){br(e,t,r.pos,n);}function br(e,t,r,n){n&&n.length&&r!==n[0].pos&&dr(e,r)!==dr(e,n[0].pos)&&t.writeLine();}function xr(e,t,r,n,i,a,o,s){if(n&&n.length>0){i&&r.writeSpace(" ");for(var c=!1,l=0,u=n;l<u.length;l++){var _=u[l];c&&(r.writeSpace(" "),c=!1),s(e,t,r,_.pos,_.end,o),_.hasTrailingNewLine?r.writeLine():c=!0;}c&&a&&r.writeSpace(" ");}}function Dr(t,r,n,i,a,o){var s=Math.min(r,o-1),c=e.trimString(t.substring(a,s));c?(n.writeComment(c),s!==r&&n.writeLine()):n.rawWrite(i);}function Sr(t,r,n){for(var i=0;r<n&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));r++)9===t.charCodeAt(r)?i+=er()-i%er():i++;return i}function Tr(e,t){return !!Fr(e,t)}function Cr(e,t){return !!Pr(e,t)}function Er(t){return e.isClassElement(t)&&kr(t)||e.isClassStaticBlockDeclaration(t)}function kr(e){return Cr(e,32)}function Nr(e){return Tr(e,64)}function Ar(e){return Cr(e,131072)}function Fr(e,t){return Ir(e)&t}function Pr(e,t){return Or(e)&t}function wr(e,t,r){return e.kind>=0&&e.kind<=162?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|Lr(e)),!t||4096&e.modifierFlagsCache||!r&&!Se(e)||!e.parent||(e.modifierFlagsCache|=4096|Mr(e)),-536875009&e.modifierFlagsCache)}function Ir(e){return wr(e,!0)}function Or(e){return wr(e,!1)}function Mr(t){var r=0;return t.parent&&!e.isParameter(t)&&(Se(t)&&(e.getJSDocPublicTagNoCache(t)&&(r|=4),e.getJSDocPrivateTagNoCache(t)&&(r|=8),e.getJSDocProtectedTagNoCache(t)&&(r|=16),e.getJSDocReadonlyTagNoCache(t)&&(r|=64),e.getJSDocOverrideTagNoCache(t)&&(r|=16384)),e.getJSDocDeprecatedTagNoCache(t)&&(r|=8192)),r}function Lr(t){var r=e.canHaveModifiers(t)?Rr(t.modifiers):0;return (4&t.flags||79===t.kind&&t.isInJSDocNamespace)&&(r|=1),r}function Rr(e){var t=0;if(e)for(var r=0,n=e;r<n.length;r++)t|=Br(n[r].kind);return t}function Br(e){switch(e){case 124:return 32;case 123:return 4;case 122:return 16;case 121:return 8;case 126:return 256;case 127:return 128;case 93:return 1;case 136:return 2;case 85:return 2048;case 88:return 1024;case 132:return 512;case 146:return 64;case 161:return 16384;case 101:return 32768;case 145:return 65536;case 167:return 131072}return 0}function jr(e){return 75===e||76===e||77===e}function Jr(e){return e>=63&&e<=78}function zr(e){var t=Ur(e);return t&&!t.isImplements?t.class:void 0}function Ur(t){return e.isExpressionWithTypeArguments(t)&&e.isHeritageClause(t.parent)&&e.isClassLike(t.parent.parent)?{class:t.parent.parent,isImplements:117===t.parent.token}:void 0}function Kr(t,r){return e.isBinaryExpression(t)&&(r?63===t.operatorToken.kind:Jr(t.operatorToken.kind))&&e.isLeftHandSideExpression(t.left)}function Vr(e){return void 0!==zr(e)}function qr(e){return 79===e.kind||Wr(e)}function Wr(t){return e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&qr(t.expression)}function Hr(e){return ze(e)&&"prototype"===We(e)}function Gr(t){return e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isElementAccessExpression(t.parent)&&t.parent.argumentExpression===t}e.getIndentString=$t,e.getIndentSize=er,e.isNightly=function(){return e.stringContains(e.version,"-dev")||e.stringContains(e.version,"-insiders")},e.createTextWriter=function(t){var r,n,i,a,o,s=!1;function c(t){var n=e.computeLineStarts(t);n.length>1?(a=a+n.length-1,o=r.length-t.length+e.last(n),i=o-r.length==0):i=!1;}function l(e){e&&e.length&&(i&&(e=$t(n)+e,i=!1),r+=e,c(e));}function u(e){e&&(s=!1),l(e);}function _(){r="",n=0,i=!0,a=0,o=0,s=!1;}return _(),{write:u,rawWrite:function(e){void 0!==e&&(r+=e,c(e),s=!1);},writeLiteral:function(e){e&&e.length&&u(e);},writeLine:function(e){i&&!e||(a++,o=(r+=t).length,i=!0,s=!1);},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},getIndent:function(){return n},getTextPos:function(){return r.length},getLine:function(){return a},getColumn:function(){return i?n*er():r.length-o},getText:function(){return r},isAtStartOfLine:function(){return i},hasTrailingComment:function(){return s},hasTrailingWhitespace:function(){return !!r.length&&e.isWhiteSpaceLike(r.charCodeAt(r.length-1))},clear:_,reportInaccessibleThisError:e.noop,reportPrivateInBaseOfClassExpression:e.noop,reportInaccessibleUniqueSymbolError:e.noop,trackSymbol:function(){return !1},writeKeyword:u,writeOperator:u,writeParameter:u,writeProperty:u,writePunctuation:u,writeSpace:u,writeStringLiteral:u,writeSymbol:function(e,t){return u(e)},writeTrailingSemicolon:u,writeComment:function(e){e&&(s=!0),l(e);},getTextPosWithWriteLine:function(){return i?r.length:r.length+t.length}}},e.getTrailingSemicolonDeferringWriter=function(e){var t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1);}return i$1(i$1({},e),{writeTrailingSemicolon:function(){t=!0;},writeLiteral:function(t){r(),e.writeLiteral(t);},writeStringLiteral:function(t){r(),e.writeStringLiteral(t);},writeSymbol:function(t,n){r(),e.writeSymbol(t,n);},writePunctuation:function(t){r(),e.writePunctuation(t);},writeKeyword:function(t){r(),e.writeKeyword(t);},writeOperator:function(t){r(),e.writeOperator(t);},writeParameter:function(t){r(),e.writeParameter(t);},writeSpace:function(t){r(),e.writeSpace(t);},writeProperty:function(t){r(),e.writeProperty(t);},writeComment:function(t){r(),e.writeComment(t);},writeLine:function(){r(),e.writeLine();},increaseIndent:function(){r(),e.increaseIndent();},decreaseIndent:function(){r(),e.decreaseIndent();}})},e.hostUsesCaseSensitiveFileNames=tr,e.hostGetCanonicalFileName=function(t){return e.createGetCanonicalFileName(tr(t))},e.getResolvedExternalModuleName=rr,e.getExternalModuleNameFromDeclaration=function(t,r,n){var i=r.getExternalModuleFileFromDeclaration(n);if(i&&!i.isDeclarationFile){var a=Xe(n);if(!a||!e.isStringLiteralLike(a)||e.pathIsRelative(a.text)||-1!==nr(t,i.path).indexOf(nr(t,e.ensureTrailingDirectorySeparator(t.getCommonSourceDirectory()))))return rr(t,i)}},e.getExternalModuleNameFromPath=ir,e.getOwnEmitOutputFilePath=function(e,t,r){var n=t.getCompilerOptions();return (n.outDir?fi(lr(e,t,n.outDir)):fi(e))+r},e.getDeclarationEmitOutputFilePath=function(e,t){return ar(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))},e.getDeclarationEmitOutputFilePathWorker=ar,e.getDeclarationEmitExtensionForPath=or,e.getPossibleOriginalInputExtensionForExtension=function(t){return e.fileExtensionIsOneOf(t,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:e.fileExtensionIsOneOf(t,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:e.fileExtensionIsOneOf(t,[".json.d.ts"])?[".json"]:[".tsx",".ts",".jsx",".js"]},e.outFile=sr,e.getPathsBasePath=function(t,r){var n,i;if(t.paths)return null!==(n=t.baseUrl)&&void 0!==n?n:e.Debug.checkDefined(t.pathsBasePath||(null===(i=r.getCurrentDirectory)||void 0===i?void 0:i.call(r)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")},e.getSourceFilesToEmit=function(t,r,n){var i=t.getCompilerOptions();if(sr(i)){var a=On(i),o=i.emitDeclarationOnly||a===e.ModuleKind.AMD||a===e.ModuleKind.System;return e.filter(t.getSourceFiles(),(function(r){return (o||!e.isExternalModule(r))&&cr(r,t,n)}))}var s=void 0===r?t.getSourceFiles():[r];return e.filter(s,(function(e){return cr(e,t,n)}))},e.sourceFileMayBeEmitted=cr,e.getSourceFilePathInNewDir=lr,e.getSourceFilePathInNewDirWorker=ur,e.writeFile=function(t,r,n,i,a,o,s){t.writeFile(n,i,a,(function(t){r.add(En(e.Diagnostics.Could_not_write_file_0_Colon_1,n,t));}),o,s);},e.writeFileEnsuringDirectories=function(t,r,n,i,a,o){try{i(t,r,n);}catch(s){_r(e.getDirectoryPath(e.normalizePath(t)),a,o),i(t,r,n);}},e.getLineOfLocalPosition=function(t,r){var n=e.getLineStarts(t);return e.computeLineOfPosition(n,r)},e.getLineOfLocalPositionFromLineMap=dr,e.getFirstConstructorWithBody=pr,e.getSetAccessorValueParameter=fr,e.getSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&t.type},e.getThisParameter=function(t){if(t.parameters.length&&!e.isJSDocSignature(t)){var r=t.parameters[0];if(gr(r))return r}},e.parameterIsThisKeyword=gr,e.isThisIdentifier=mr,e.isThisInTypeQuery=function(t){if(!mr(t))return !1;for(;e.isQualifiedName(t.parent)&&t.parent.left===t;)t=t.parent;return 183===t.parent.kind},e.identifierIsThisKeyword=yr,e.getAllAccessorDeclarations=function(t,r){var n,i,a,o;return Et(r)?(n=r,174===r.kind?a=r:175===r.kind?o=r:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,(function(t){e.isAccessor(t)&&Er(t)===Er(r)&&Nt(t.name)===Nt(r.name)&&(n?i||(i=t):n=t,174!==t.kind||a||(a=t),175!==t.kind||o||(o=t));})),{firstAccessor:n,secondAccessor:i,getAccessor:a,setAccessor:o}},e.getEffectiveTypeAnnotationNode=vr,e.getTypeAnnotationNode=function(e){return e.type},e.getEffectiveReturnTypeNode=function(t){return e.isJSDocSignature(t)?t.type&&t.type.typeExpression&&t.type.typeExpression.type:t.type||(Se(t)?e.getJSDocReturnType(t):void 0)},e.getJSDocTypeParameterDeclarations=function(t){return e.flatMap(e.getJSDocTags(t),(function(t){return function(t){return e.isJSDocTemplateTag(t)&&!(323===t.parent.kind&&t.parent.tags.some(Ye))}(t)?t.typeParameters:void 0}))},e.getEffectiveSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&vr(t)},e.emitNewLineBeforeLeadingComments=hr,e.emitNewLineBeforeLeadingCommentsOfPosition=br,e.emitNewLineBeforeLeadingCommentOfPosition=function(e,t,r,n){r!==n&&dr(e,r)!==dr(e,n)&&t.writeLine();},e.emitComments=xr,e.emitDetachedComments=function(t,r,n,i,a,o,s){var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),(function(e){return v(t,e.pos)}))):c=e.getLeadingCommentRanges(t,a.pos),c){for(var u=[],_=void 0,d=0,p=c;d<p.length;d++){var f=p[d];if(_){var g=dr(r,_.end);if(dr(r,f.pos)>=g+2)break}u.push(f),_=f;}u.length&&(g=dr(r,e.last(u).end),dr(r,e.skipTrivia(t,a.pos))>=g+2&&(hr(r,n,a,c),xr(t,r,n,u,!1,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.last(u).end}));}return l},e.writeCommentRange=function(t,r,n,i,a,o){if(42===t.charCodeAt(i+1))for(var s=e.computeLineAndCharacterOfPosition(r,i),c=r.length,l=void 0,u=i,_=s.line;u<a;_++){var d=_+1===c?t.length+1:r[_+1];if(u!==i){void 0===l&&(l=Sr(t,r[s.line],i));var p=n.getIndent()*er()-l+Sr(t,u,d);if(p>0){var f=p%er(),g=$t((p-f)/er());for(n.rawWrite(g);f;)n.rawWrite(" "),f--;}else n.rawWrite("");}Dr(t,a,n,o,u,d),u=d;}else n.writeComment(t.substring(i,a));},e.hasEffectiveModifiers=function(e){return 0!==Ir(e)},e.hasSyntacticModifiers=function(e){return 0!==Or(e)},e.hasEffectiveModifier=Tr,e.hasSyntacticModifier=Cr,e.isStatic=Er,e.hasStaticModifier=kr,e.hasOverrideModifier=function(e){return Tr(e,16384)},e.hasAbstractModifier=function(e){return Cr(e,256)},e.hasAmbientModifier=function(e){return Cr(e,2)},e.hasAccessorModifier=function(e){return Cr(e,128)},e.hasEffectiveReadonlyModifier=Nr,e.hasDecorators=Ar,e.getSelectedEffectiveModifierFlags=Fr,e.getSelectedSyntacticModifierFlags=Pr,e.getEffectiveModifierFlags=Ir,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc=function(e){return wr(e,!0,!0)},e.getSyntacticModifierFlags=Or,e.getEffectiveModifierFlagsNoCache=function(e){return Lr(e)|Mr(e)},e.getSyntacticModifierFlagsNoCache=Lr,e.modifiersToFlags=Rr,e.modifierToFlag=Br,e.isLogicalOperator=function(e){return 56===e||55===e||53===e},e.isLogicalOrCoalescingAssignmentOperator=jr,e.isLogicalOrCoalescingAssignmentExpression=function(e){return jr(e.operatorToken.kind)},e.isAssignmentOperator=Jr,e.tryGetClassExtendingExpressionWithTypeArguments=zr,e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments=Ur,e.isAssignmentExpression=Kr,e.isLeftHandSideOfAssignment=function(e){return Kr(e.parent)&&e.parent.left===e},e.isDestructuringAssignment=function(e){if(Kr(e,!0)){var t=e.left.kind;return 207===t||206===t}return !1},e.isExpressionWithTypeArgumentsInClassExtendsClause=Vr,e.isEntityNameExpression=qr,e.getFirstIdentifier=function(e){switch(e.kind){case 79:return e;case 163:do{e=e.left;}while(79!==e.kind);return e;case 208:do{e=e.expression;}while(79!==e.kind);return e}},e.isDottedName=function e(t){return 79===t.kind||108===t.kind||106===t.kind||233===t.kind||208===t.kind&&e(t.expression)||214===t.kind&&e(t.expression)},e.isPropertyAccessEntityNameExpression=Wr,e.tryGetPropertyAccessOrIdentifierToString=function t(r){if(e.isPropertyAccessExpression(r)){if(void 0!==(n=t(r.expression)))return n+"."+j(r.name)}else if(e.isElementAccessExpression(r)){var n;if(void 0!==(n=t(r.expression))&&e.isPropertyName(r.argumentExpression))return n+"."+Nt(r.argumentExpression)}else if(e.isIdentifier(r))return e.unescapeLeadingUnderscores(r.escapedText)},e.isPrototypeAccess=Hr,e.isRightSideOfQualifiedNameOrPropertyAccess=function(e){return 163===e.parent.kind&&e.parent.right===e||208===e.parent.kind&&e.parent.name===e},e.isRightSideOfAccessExpression=Gr,e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName=function(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isJSDocMemberName(t.parent)&&t.parent.right===t},e.isEmptyObjectLiteral=function(e){return 207===e.kind&&0===e.properties.length},e.isEmptyArrayLiteral=function(e){return 206===e.kind&&0===e.elements.length},e.getLocalSymbolForExportDefault=function(t){if(function(t){return t&&e.length(t.declarations)>0&&Cr(t.declarations[0],1024)}(t)&&t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(i.localSymbol)return i.localSymbol}},e.tryExtractTSExtension=function(t){return e.find(si,(function(r){return e.fileExtensionIs(t,r)}))};var Qr,Xr,Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Zr(t){for(var r,n,i,a,o="",s=function(t){for(var r=[],n=t.length,i=0;i<n;i++){var a=t.charCodeAt(i);a<128?r.push(a):a<2048?(r.push(a>>6|192),r.push(63&a|128)):a<65536?(r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)):a<131072?(r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point");}return r}(t),c=0,l=s.length;c<l;)r=s[c]>>2,n=(3&s[c])<<4|s[c+1]>>4,i=(15&s[c+1])<<2|s[c+2]>>6,a=63&s[c+2],c+1>=l?i=a=64:c+2>=l&&(a=64),o+=Yr.charAt(r)+Yr.charAt(n)+Yr.charAt(i)+Yr.charAt(a),c+=3;return o}function $r(t,r){var n=e.isString(r)?r:r.readFile(t);if(n){var i=e.parseConfigFileTextToJson(t,n);return i.error?void 0:i.config}}function en(t,r){return void 0===r&&(r=t),e.Debug.assert(r>=t||-1===r),{pos:t,end:r}}function tn(e,t){return en(t,e.end)}function rn(t){var r=e.canHaveModifiers(t)?e.findLast(t.modifiers,e.isDecorator):void 0;return r&&!vi(r.end)?tn(t,r.end):t}function nn(e,t,r){return an(on(e,r,!1),t.end,r)}function an(t,r,n){return 0===e.getLinesBetweenPositions(n,t,r)}function on(t,r,n){return vi(t.pos)?-1:e.skipTrivia(r.text,t.pos,!1,n)}function sn(e){return void 0!==e.initializer}function cn(e){return 33554432&e.flags?e.checkFlags:0}function ln(t){var r=t.parent;if(!r)return 0;switch(r.kind){case 214:case 206:return ln(r);case 222:case 221:var n=r.operator;return 45===n||46===n?c():0;case 223:var i=r,a=i.left,o=i.operatorToken;return a===t&&Jr(o.kind)?63===o.kind?1:c():0;case 208:return r.name!==t?0:ln(r);case 299:var s=ln(r.parent);return t===r.name?function(t){switch(t){case 0:return 1;case 1:return 0;case 2:return 2;default:return e.Debug.assertNever(t)}}(s):s;case 300:return t===r.objectAssignmentInitializer?0:ln(r.parent);default:return 0}function c(){return r.parent&&241===_t(r.parent).kind?1:2}}function un(e,t,r){var n=r.onDeleteValue,i=r.onExistingValue;e.forEach((function(r,a){var o=t.get(a);void 0===o?(e.delete(a),n(r,a)):i&&i(r,o,a);}));}function _n(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find(e.isClassLike)}function dn(e){return 208===e.kind||209===e.kind}function pn(e){for(;dn(e);)e=e.expression;return e}function fn(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=void 0,this.mergeId=void 0,this.parent=void 0;}function gn(t,r){this.flags=r,(e.Debug.isDebugging||e.tracing)&&(this.checker=t);}function mn(t,r){this.flags=r,e.Debug.isDebugging&&(this.checker=t);}function yn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0;}function vn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0;}function hn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.flowNode=void 0;}function bn(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||function(e){return e};}function xn(t,r,n){return void 0===n&&(n=0),t.replace(/{(\d+)}/g,(function(t,i){return ""+e.Debug.checkDefined(r[+i+n])}))}function Dn(e){return Xr&&Xr[e.key]||e.message}function Sn(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function Tn(t,r){var n=r.fileName||"",i=r.text.length;e.Debug.assertEqual(t.fileName,n),e.Debug.assertLessThanOrEqual(t.start,i),e.Debug.assertLessThanOrEqual(t.start+t.length,i);var a={file:r,start:t.start,length:t.length,messageText:t.messageText,category:t.category,code:t.code,reportsUnnecessary:t.reportsUnnecessary};if(t.relatedInformation){a.relatedInformation=[];for(var o=0,s=t.relatedInformation;o<s.length;o++){var c=s[o];Sn(c)&&c.fileName===n?(e.Debug.assertLessThanOrEqual(c.start,i),e.Debug.assertLessThanOrEqual(c.start+c.length,i),a.relatedInformation.push(Tn(c,r))):a.relatedInformation.push(c);}}return a}function Cn(e,t,r,n){z(e,t,r);var i=Dn(n);return arguments.length>4&&(i=xn(i,arguments,4)),{file:e,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated}}function En(e){var t=Dn(e);return arguments.length>1&&(t=xn(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function kn(e){return e.file?e.file.path:void 0}function Nn(t,r){return e.compareStringsCaseSensitive(kn(t),kn(r))||e.compareValues(t.start,r.start)||e.compareValues(t.length,r.length)||e.compareValues(t.code,r.code)||An(t.messageText,r.messageText)||0}function An(t,r){if("string"==typeof t&&"string"==typeof r)return e.compareStringsCaseSensitive(t,r);if("string"==typeof t)return -1;if("string"==typeof r)return 1;var n=e.compareStringsCaseSensitive(t.messageText,r.messageText);if(n)return n;if(!t.next&&!r.next)return 0;if(!t.next)return -1;if(!r.next)return 1;for(var i=Math.min(t.next.length,r.next.length),a=0;a<i;a++)if(n=An(t.next[a],r.next[a]))return n;return t.next.length<r.next.length?-1:t.next.length>r.next.length?1:0}function Fn(t){if(2&t.transformFlags)return e.isJsxOpeningLikeElement(t)||e.isJsxFragment(t)?t:e.forEachChild(t,Fn)}function Pn(e){return e.isDeclarationFile?void 0:Fn(e)}function wn(t){return !(t.impliedNodeFormat!==e.ModuleKind.ESNext&&!e.fileExtensionIsOneOf(t.fileName,[".cjs",".cts",".mjs",".mts"])||t.isDeclarationFile)||void 0}function In(t){return t.target||t.module===e.ModuleKind.Node16&&9||t.module===e.ModuleKind.NodeNext&&99||0}function On(t){return "number"==typeof t.module?t.module:In(t)>=2?e.ModuleKind.ES2015:e.ModuleKind.CommonJS}function Mn(t){return t.moduleDetection||(On(t)===e.ModuleKind.Node16||On(t)===e.ModuleKind.NodeNext?e.ModuleDetectionKind.Force:e.ModuleDetectionKind.Auto)}function Ln(t){if(void 0!==t.esModuleInterop)return t.esModuleInterop;switch(On(t)){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return !0}}function Rn(e){return !(!e.declaration&&!e.composite)}function Bn(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function jn(e){return void 0===e.allowJs?!!e.checkJs:e.allowJs}function Jn(e,t){return t.strictFlag?Bn(e,t.name):e[t.name]}function zn(t,r){return void 0!==t&&("node_modules"===r(t)||e.startsWith(t,"@"))}e.convertToBase64=Zr,e.base64encode=function(e,t){return e&&e.base64encode?e.base64encode(t):Zr(t)},e.base64decode=function(e,t){if(e&&e.base64decode)return e.base64decode(t);for(var r=t.length,n=[],i=0;i<r&&t.charCodeAt(i)!==Yr.charCodeAt(64);){var a=Yr.indexOf(t[i]),o=Yr.indexOf(t[i+1]),s=Yr.indexOf(t[i+2]),c=Yr.indexOf(t[i+3]),l=(63&a)<<2|o>>4&3,u=(15&o)<<4|s>>2&15,_=(3&s)<<6|63&c;0===u&&0!==s?n.push(l):0===_&&0!==c?n.push(l,u):n.push(l,u,_),i+=4;}return function(e){for(var t="",r=0,n=e.length;r<n;){var i=e[r];if(i<128)t+=String.fromCharCode(i),r++;else if(192==(192&i)){for(var a=63&i,o=e[++r];128==(192&o);)a=a<<6|63&o,o=e[++r];t+=String.fromCharCode(a);}else t+=String.fromCharCode(i),r++;}return t}(n)},e.readJsonOrUndefined=$r,e.readJson=function(e,t){return $r(e,t)||{}},e.directoryProbablyExists=function(e,t){return !t.directoryExists||t.directoryExists(e)},e.getNewLineCharacter=function(t,r){switch(t.newLine){case 0:return "\r\n";case 1:return "\n"}return r?r():e.sys?e.sys.newLine:"\r\n"},e.createRange=en,e.moveRangeEnd=function(e,t){return en(e.pos,t)},e.moveRangePos=tn,e.moveRangePastDecorators=rn,e.moveRangePastModifiers=function(t){var r=e.canHaveModifiers(t)?e.lastOrUndefined(t.modifiers):void 0;return r&&!vi(r.end)?tn(t,r.end):rn(t)},e.isCollapsedRange=function(e){return e.pos===e.end},e.createTokenRange=function(t,r){return en(t,t+e.tokenToString(r).length)},e.rangeIsOnSingleLine=function(e,t){return nn(e,e,t)},e.rangeStartPositionsAreOnSameLine=function(e,t,r){return an(on(e,r,!1),on(t,r,!1),r)},e.rangeEndPositionsAreOnSameLine=function(e,t,r){return an(e.end,t.end,r)},e.rangeStartIsOnSameLineAsRangeEnd=nn,e.rangeEndIsOnSameLineAsRangeStart=function(e,t,r){return an(e.end,on(t,r,!1),r)},e.getLinesBetweenRangeEndAndRangeStart=function(t,r,n,i){var a=on(r,n,i);return e.getLinesBetweenPositions(n,t.end,a)},e.getLinesBetweenRangeEndPositions=function(t,r,n){return e.getLinesBetweenPositions(n,t.end,r.end)},e.isNodeArrayMultiLine=function(e,t){return !an(e.pos,e.end,t)},e.positionsAreOnSameLine=an,e.getStartPositionOfRange=on,e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i),o=function(t,r,n){for(void 0===r&&(r=0);t-- >r;)if(!e.isWhiteSpaceLike(n.text.charCodeAt(t)))return t}(a,r,n);return e.getLinesBetweenPositions(n,null!=o?o:r,a)},e.getLinesBetweenPositionAndNextNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i);return e.getLinesBetweenPositions(n,t,Math.min(r,a))},e.isDeclarationNameOfEnumOrNamespace=function(t){var r=e.getParseTreeNode(t);if(r)switch(r.parent.kind){case 263:case 264:return r===r.parent.name}return !1},e.getInitializedVariables=function(t){return e.filter(t.declarations,sn)},e.isWatchSet=function(t){return t.watch&&e.hasProperty(t,"watch")},e.closeFileWatcher=function(e){e.close();},e.getCheckFlags=cn,e.getDeclarationModifierFlagsFromSymbol=function(t,r){if(void 0===r&&(r=!1),t.valueDeclaration){var n=r&&t.declarations&&e.find(t.declarations,e.isSetAccessorDeclaration)||32768&t.flags&&e.find(t.declarations,e.isGetAccessorDeclaration)||t.valueDeclaration,i=e.getCombinedModifierFlags(n);return t.parent&&32&t.parent.flags?i:-29&i}if(6&cn(t)){var a=t.checkFlags;return (1024&a?8:256&a?4:16)|(2048&a?32:0)}return 4194304&t.flags?36:0},e.skipAlias=function(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e},e.getCombinedLocalAndExportSymbolFlags=function(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags},e.isWriteOnlyAccess=function(e){return 1===ln(e)},e.isWriteAccess=function(e){return 0!==ln(e)},function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite";}(Qr||(Qr={})),e.compareDataObjects=function e(t,r){if(!t||!r||Object.keys(t).length!==Object.keys(r).length)return !1;for(var n in t)if("object"==typeof t[n]){if(!e(t[n],r[n]))return !1}else if("function"!=typeof t[n]&&t[n]!==r[n])return !1;return !0},e.clearMap=function(e,t){e.forEach(t),e.clear();},e.mutateMapSkippingNewValues=un,e.mutateMap=function(e,t,r){un(e,t,r);var n=r.createNewValue;t.forEach((function(t,r){e.has(r)||e.set(r,n(r,t));}));},e.isAbstractConstructorSymbol=function(e){if(32&e.flags){var t=_n(e);return !!t&&Cr(t,256)}return !1},e.getClassLikeDeclarationOfSymbol=_n,e.getObjectFlags=function(e){return 3899393&e.flags?e.objectFlags:0},e.typeHasCallOrConstructSignatures=function(e,t){return 0!==t.getSignaturesOfType(e,0).length||0!==t.getSignaturesOfType(e,1).length},e.forSomeAncestorDirectory=function(t,r){return !!e.forEachAncestorDirectory(t,(function(e){return !!r(e)||void 0}))},e.isUMDExportSymbol=function(t){return !!t&&!!t.declarations&&!!t.declarations[0]&&e.isNamespaceExportDeclaration(t.declarations[0])},e.showModuleSpecifier=function(t){var r=t.moduleSpecifier;return e.isStringLiteral(r)?r.text:D(r)},e.getLastChild=function(t){var r;return e.forEachChild(t,(function(e){f(e)&&(r=e);}),(function(e){for(var t=e.length-1;t>=0;t--)if(f(e[t])){r=e[t];break}})),r},e.addToSeen=function(e,t,r){return void 0===r&&(r=!0),!e.has(t)&&(e.set(t,r),!0)},e.isObjectTypeDeclaration=function(t){return e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)},e.isTypeNodeKind=function(e){return e>=179&&e<=202||131===e||157===e||148===e||160===e||149===e||134===e||152===e||153===e||114===e||155===e||144===e||230===e||315===e||316===e||317===e||318===e||319===e||320===e||321===e},e.isAccessExpression=dn,e.getNameOfAccessExpression=function(t){return 208===t.kind?t.name:(e.Debug.assert(209===t.kind),t.argumentExpression)},e.isBundleFileTextLike=function(e){switch(e.kind){case"text":case"internal":return !0;default:return !1}},e.isNamedImportsOrExports=function(e){return 272===e.kind||276===e.kind},e.getLeftmostAccessExpression=pn,e.forEachNameInAccessChainWalkingLeft=function(t,r){if(dn(t.parent)&&Gr(t))return function t(n){if(208===n.kind){if(void 0!==(i=r(n.name)))return i}else if(209===n.kind){if(!e.isIdentifier(n.argumentExpression)&&!e.isStringLiteralLike(n.argumentExpression))return;var i;if(void 0!==(i=r(n.argumentExpression)))return i}return dn(n.expression)?t(n.expression):e.isIdentifier(n.expression)?r(n.expression):void 0}(t.parent)},e.getLeftmostExpression=function(e,t){for(;;){switch(e.kind){case 222:e=e.operand;continue;case 223:e=e.left;continue;case 224:e=e.condition;continue;case 212:e=e.tag;continue;case 210:if(t)return e;case 231:case 209:case 208:case 232:case 353:case 235:e=e.expression;continue}return e}},e.objectAllocator={getNodeConstructor:function(){return yn},getTokenConstructor:function(){return vn},getIdentifierConstructor:function(){return hn},getPrivateIdentifierConstructor:function(){return yn},getSourceFileConstructor:function(){return yn},getSymbolConstructor:function(){return fn},getTypeConstructor:function(){return gn},getSignatureConstructor:function(){return mn},getSourceMapSourceConstructor:function(){return bn}},e.setObjectAllocator=function(t){Object.assign(e.objectAllocator,t);},e.formatStringFromArgs=xn,e.setLocalizedDiagnosticMessages=function(e){Xr=e;},e.maybeSetLocalizedDiagnosticMessages=function(e){!Xr&&e&&(Xr=e());},e.getLocaleSpecificMessage=Dn,e.createDetachedDiagnostic=function(e,t,r,n){z(void 0,t,r);var i=Dn(n);return arguments.length>4&&(i=xn(i,arguments,4)),{file:void 0,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,fileName:e}},e.attachFileToDiagnostics=function(e,t){for(var r=[],n=0,i=e;n<i.length;n++){var a=i[n];r.push(Tn(a,t));}return r},e.createFileDiagnostic=Cn,e.formatMessage=function(e,t){var r=Dn(t);return arguments.length>2&&(r=xn(r,arguments,2)),r},e.createCompilerDiagnostic=En,e.createCompilerDiagnosticFromMessageChain=function(e,t){return {file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}},e.chainDiagnosticMessages=function(e,t){var r=Dn(t);return arguments.length>2&&(r=xn(r,arguments,2)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}},e.concatenateDiagnosticMessageChains=function(e,t){for(var r=e;r.next;)r=r.next[0];r.next=[t];},e.compareDiagnostics=function t(r,n){return Nn(r,n)||function(r,n){return r.relatedInformation||n.relatedInformation?r.relatedInformation&&n.relatedInformation?e.compareValues(r.relatedInformation.length,n.relatedInformation.length)||e.forEach(r.relatedInformation,(function(e,r){return t(e,n.relatedInformation[r])}))||0:r.relatedInformation?-1:1:0}(r,n)||0},e.compareDiagnosticsSkipRelatedInformation=Nn,e.getLanguageVariant=function(e){return 4===e||2===e||1===e||6===e?1:0},e.getSetExternalModuleIndicator=function(t){switch(Mn(t)){case e.ModuleDetectionKind.Force:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t)||!t.isDeclarationFile||void 0;};case e.ModuleDetectionKind.Legacy:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t);};case e.ModuleDetectionKind.Auto:var r=[e.isFileProbablyExternalModule];4!==t.jsx&&5!==t.jsx||r.push(Pn),r.push(wn);var n=e.or.apply(void 0,r);return function(e){e.externalModuleIndicator=n(e);}}},e.getEmitScriptTarget=In,e.getEmitModuleKind=On,e.getEmitModuleResolutionKind=function(t){var r=t.moduleResolution;if(void 0===r)switch(On(t)){case e.ModuleKind.CommonJS:r=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node16:r=e.ModuleResolutionKind.Node16;break;case e.ModuleKind.NodeNext:r=e.ModuleResolutionKind.NodeNext;break;default:r=e.ModuleResolutionKind.Classic;}return r},e.getEmitModuleDetectionKind=Mn,e.hasJsonModuleEmitEnabled=function(t){switch(On(t)){case e.ModuleKind.CommonJS:case e.ModuleKind.AMD:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return !0;default:return !1}},e.unreachableCodeIsError=function(e){return !1===e.allowUnreachableCode},e.unusedLabelIsError=function(e){return !1===e.allowUnusedLabels},e.getAreDeclarationMapsEnabled=function(e){return !(!Rn(e)||!e.declarationMap)},e.getESModuleInterop=Ln,e.getAllowSyntheticDefaultImports=function(t){var r=On(t);return void 0!==t.allowSyntheticDefaultImports?t.allowSyntheticDefaultImports:Ln(t)||r===e.ModuleKind.System},e.getEmitDeclarations=Rn,e.shouldPreserveConstEnums=function(e){return !(!e.preserveConstEnums&&!e.isolatedModules)},e.isIncrementalCompilation=function(e){return !(!e.incremental&&!e.composite)},e.getStrictOptionValue=Bn,e.getAllowJSCompilerOption=jn,e.getUseDefineForClassFields=function(e){return void 0===e.useDefineForClassFields?In(e)>=9:e.useDefineForClassFields},e.compilerOptionsAffectSemanticDiagnostics=function(t,r){return c(r,t,e.semanticDiagnosticsOptionDeclarations)},e.compilerOptionsAffectEmit=function(t,r){return c(r,t,e.affectsEmitOptionDeclarations)},e.compilerOptionsAffectDeclarationPath=function(t,r){return c(r,t,e.affectsDeclarationPathOptionDeclarations)},e.getCompilerOptionValue=Jn,e.getJSXTransformEnabled=function(e){var t=e.jsx;return 2===t||4===t||5===t},e.getJSXImplicitImportBase=function(t,r){var n=null==r?void 0:r.pragmas.get("jsximportsource"),i=e.isArray(n)?n[n.length-1]:n;return 4===t.jsx||5===t.jsx||t.jsxImportSource||i?(null==i?void 0:i.arguments.factory)||t.jsxImportSource||"react":void 0},e.getJSXRuntimeImport=function(e,t){return e?"".concat(e,"/").concat(5===t.jsx?"jsx-dev-runtime":"jsx-runtime"):void 0},e.hasZeroOrOneAsteriskCharacter=function(e){for(var t=!1,r=0;r<e.length;r++)if(42===e.charCodeAt(r)){if(t)return !1;t=!0;}return !0},e.createSymlinkCache=function(t,r){var n,i,a,o=!1;return {getSymlinkedFiles:function(){return a},getSymlinkedDirectories:function(){return n},getSymlinkedDirectoriesByRealpath:function(){return i},setSymlinkedFile:function(t,r){return (a||(a=new e.Map)).set(t,r)},setSymlinkedDirectory:function(a,o){var s=e.toPath(a,t,r);ki(s)||(s=e.ensureTrailingDirectorySeparator(s),!1===o||(null==n?void 0:n.has(s))||(i||(i=e.createMultiMap())).add(e.ensureTrailingDirectorySeparator(o.realPath),a),(n||(n=new e.Map)).set(s,o));},setSymlinksFromResolutions:function(t,r){var n,i=this;e.Debug.assert(!o),o=!0;for(var a=0,c=t;a<c.length;a++)null===(n=c[a].resolvedModules)||void 0===n||n.forEach((function(e){return s(i,e)}));null==r||r.forEach((function(e){return s(i,e)}));},hasProcessedResolutions:function(){return o}};function s(n,i){if(i&&i.originalPath&&i.resolvedFileName){var a=i.resolvedFileName,o=i.originalPath;n.setSymlinkedFile(e.toPath(o,t,r),a);var s=function(t,r,n,i){for(var a=e.getPathComponents(e.getNormalizedAbsolutePath(t,n)),o=e.getPathComponents(e.getNormalizedAbsolutePath(r,n)),s=!1;a.length>=2&&o.length>=2&&!zn(a[a.length-2],i)&&!zn(o[o.length-2],i)&&i(a[a.length-1])===i(o[o.length-1]);)a.pop(),o.pop(),s=!0;return s?[e.getPathFromPathComponents(a),e.getPathFromPathComponents(o)]:void 0}(a,o,t,r)||e.emptyArray,c=s[0],l=s[1];c&&l&&n.setSymlinkedDirectory(l,{real:c,realPath:e.toPath(c,t,r)});}}},e.tryRemoveDirectoryPrefix=function(t,r,n){var i,a=e.tryRemovePrefix(t,r,n);return void 0===a?void 0:(i=a,e.isAnyDirectorySeparator(i.charCodeAt(0))?i.slice(1):void 0)};var Un=/[^\w\s\/]/g;function Kn(e){return "\\"+e}e.regExpEscape=function(e){return e.replace(Un,Kn)};var Vn=[42,63];e.commonPackageFolders=["node_modules","bower_components","jspm_packages"];var qn="(?!(".concat(e.commonPackageFolders.join("|"),")(/|$))"),Wn={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:"(/".concat(qn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return ei(e,Wn.singleAsteriskRegexFragment)}},Hn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/".concat(qn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return ei(e,Hn.singleAsteriskRegexFragment)}},Gn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:function(e){return ei(e,Gn.singleAsteriskRegexFragment)}},Qn={files:Wn,directories:Hn,exclude:Gn};function Xn(e,t,r){var n=Yn(e,t,r);if(n&&n.length){var i=n.map((function(e){return "(".concat(e,")")})).join("|"),a="exclude"===r?"($|/)":"$";return "^(".concat(i,")").concat(a)}}function Yn(t,r,n){if(void 0!==t&&0!==t.length)return e.flatMap(t,(function(e){return e&&$n(e,r,n,Qn[n])}))}function Zn(e){return !/[.*?]/.test(e)}function $n(t,r,n,i){var a=i.singleAsteriskRegexFragment,o=i.doubleAsteriskRegexFragment,s=i.replaceWildcardCharacter,c="",l=!1,u=e.getNormalizedPathComponents(t,r),_=e.last(u);if("exclude"===n||"**"!==_){u[0]=e.removeTrailingDirectorySeparator(u[0]),Zn(_)&&u.push("**","*");for(var d=0,p=0,f=u;p<f.length;p++){var g=f[p];if("**"===g)c+=o;else if("directories"===n&&(c+="(",d++),l&&(c+=e.directorySeparator),"exclude"!==n){var m="";42===g.charCodeAt(0)?(m+="([^./]"+a+")?",g=g.substr(1)):63===g.charCodeAt(0)&&(m+="[^./]",g=g.substr(1)),(m+=g.replace(Un,s))!==g&&(c+=qn),c+=m;}else c+=g.replace(Un,s);l=!0;}for(;d>0;)c+=")?",d--;return c}}function ei(e,t){return "*"===e?t:"?"===e?"[^/]":"\\"+e}function ti(t,r,n,i,a){t=e.normalizePath(t),a=e.normalizePath(a);var o=e.combinePaths(a,t);return {includeFilePatterns:e.map(Yn(n,o,"files"),(function(e){return "^".concat(e,"$")})),includeFilePattern:Xn(n,o,"files"),includeDirectoryPattern:Xn(n,o,"directories"),excludePattern:Xn(r,o,"exclude"),basePaths:ni(t,n,i)}}function ri(e,t){return new RegExp(e,t?"":"i")}function ni(t,r,n){var i=[t];if(r){for(var a=[],o=0,s=r;o<s.length;o++){var c=s[o],l=e.isRootedDiskPath(c)?c:e.normalizePath(e.combinePaths(t,c));a.push(ii(l));}a.sort(e.getStringComparer(!n));for(var u=function(r){e.every(i,(function(i){return !e.containsPath(i,r,t,!n)}))&&i.push(r);},_=0,d=a;_<d.length;_++)u(d[_]);}return i}function ii(t){var r=e.indexOfAnyCharCode(t,Vn);return r<0?e.hasExtension(t)?e.removeTrailingDirectorySeparator(e.getDirectoryPath(t)):t:t.substring(0,t.lastIndexOf(e.directorySeparator,r))}function ai(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}e.getRegularExpressionForWildcard=Xn,e.getRegularExpressionsForWildcards=Yn,e.isImplicitGlob=Zn,e.getPatternFromSpec=function(e,t,r){var n=e&&$n(e,t,r,Qn[r]);return n&&"^(".concat(n,")").concat("exclude"===r?"($|/)":"$")},e.getFileMatcherPatterns=ti,e.getRegexFromPattern=ri,e.matchFiles=function(t,r,n,i,a,o,s,c,l){t=e.normalizePath(t),o=e.normalizePath(o);for(var u=ti(t,n,i,a,o),_=u.includeFilePatterns&&u.includeFilePatterns.map((function(e){return ri(e,a)})),d=u.includeDirectoryPattern&&ri(u.includeDirectoryPattern,a),p=u.excludePattern&&ri(u.excludePattern,a),f=_?_.map((function(){return []})):[[]],g=new e.Map,m=e.createGetCanonicalFileName(a),y=0,v=u.basePaths;y<v.length;y++){var h=v[y];b(h,e.combinePaths(o,h),s);}return e.flatten(f);function b(t,n,i){var a=m(l(n));if(!g.has(a)){g.set(a,!0);for(var o=c(t),s=o.files,u=o.directories,y=function(i){var a=e.combinePaths(t,i),o=e.combinePaths(n,i);if(r&&!e.fileExtensionIsOneOf(a,r))return "continue";if(p&&p.test(o))return "continue";if(_){var s=e.findIndex(_,(function(e){return e.test(o)}));-1!==s&&f[s].push(a);}else f[0].push(a);},v=0,h=e.sort(s,e.compareStringsCaseSensitive);v<h.length;v++)y(S=h[v]);if(void 0===i||0!=--i)for(var x=0,D=e.sort(u,e.compareStringsCaseSensitive);x<D.length;x++){var S=D[x],T=e.combinePaths(t,S),C=e.combinePaths(n,S);d&&!d.test(C)||p&&p.test(C)||b(T,C,i);}}}},e.ensureScriptKind=function(e,t){return t||ai(e)||3},e.getScriptKindFromFileName=ai,e.supportedTSExtensions=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],e.supportedTSExtensionsFlat=e.flatten(e.supportedTSExtensions);var oi=n$4(n$4([],e.supportedTSExtensions,!0),[[".json"]],!1),si=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx",".cts",".mts"];e.supportedJSExtensions=[[".js",".jsx"],[".mjs"],[".cjs"]],e.supportedJSExtensionsFlat=e.flatten(e.supportedJSExtensions);var ci=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],li=n$4(n$4([],ci,!0),[[".json"]],!1);function ui(t,r){var i=t&&jn(t);if(!r||0===r.length)return i?ci:e.supportedTSExtensions;var a=i?ci:e.supportedTSExtensions,o=e.flatten(a);return n$4(n$4([],a,!0),e.mapDefined(r,(function(e){return 7===e.scriptKind||i&&(1===(t=e.scriptKind)||2===t)&&-1===o.indexOf(e.extension)?[e.extension]:void 0;var t;})),!0)}function _i(t,r){return t&&t.resolveJsonModule?r===ci?li:r===e.supportedTSExtensions?oi:n$4(n$4([],r,!0),[[".json"]],!1):r}function di(e){var t=e.match(/\//g);return t?t.length:0}e.supportedDeclarationExtensions=[".d.ts",".d.cts",".d.mts"],e.getSupportedExtensions=ui,e.getSupportedExtensionsWithJsonIfResolveJsonModule=_i,e.hasJSFileExtension=function(t){return e.some(e.supportedJSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.hasTSFileExtension=function(t){return e.some(e.supportedTSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.isSupportedSourceFileName=function(t,r,n){if(!t)return !1;for(var i=ui(r,n),a=0,o=e.flatten(_i(r,i));a<o.length;a++){var s=o[a];if(e.fileExtensionIs(t,s))return !0}return !1},e.compareNumberOfDirectorySeparators=function(t,r){return e.compareValues(di(t),di(r))};var pi=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"];function fi(e){for(var t=0,r=pi;t<r.length;t++){var n=gi(e,r[t]);if(void 0!==n)return n}return e}function gi(t,r){return e.fileExtensionIs(t,r)?mi(t,r):void 0}function mi(e,t){return e.substring(0,e.length-t.length)}function yi(e){var t=e.indexOf("*");return -1===t?e:-1!==e.indexOf("*",t+1)?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}function vi(e){return !(e>=0)}function hi(e){return ".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e}function bi(t){return e.find(pi,(function(r){return e.fileExtensionIs(t,r)}))}function xi(t,r){return t===r||"object"==typeof t&&null!==t&&"object"==typeof r&&null!==r&&e.equalOwnProperties(t,r,xi)}function Di(e,t){return e.pos=t,e}function Si(e,t){return e.end=t,e}function Ti(e,t,r){return Si(Di(e,t),r)}function Ci(e,t){return e&&t&&(e.parent=t),e}function Ei(t){return !e.isOmittedExpression(t)}function ki(t){return e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))}function Ni(e){return 257===e.kind&&295===e.parent.kind}function Ai(e){return (+e).toString()===e}function Fi(e){switch(e.kind){case 165:case 260:case 261:case 262:case 263:case 348:case 341:case 342:return !0;case 270:return e.isTypeOnly;case 273:case 278:return e.parent.parent.isTypeOnly;default:return !1}}e.removeFileExtension=fi,e.tryRemoveExtension=gi,e.removeExtension=mi,e.changeExtension=function(t,r){return e.changeAnyExtension(t,r,pi,!1)},e.tryParsePattern=yi,e.tryParsePatterns=function(t){return e.mapDefined(e.getOwnKeys(t),(function(e){return yi(e)}))},e.positionIsSynthesized=vi,e.extensionIsTS=hi,e.resolutionExtensionIsTSOrJson=function(e){return hi(e)||".json"===e},e.extensionFromPath=function(t){var r=bi(t);return void 0!==r?r:e.Debug.fail("File ".concat(t," has unknown extension."))},e.isAnySupportedFileExtension=function(e){return void 0!==bi(e)},e.tryGetExtensionFromPath=bi,e.isCheckJsEnabledForFile=function(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs},e.emptyFileSystemEntries={files:e.emptyArray,directories:e.emptyArray},e.matchPatternOrExact=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i];if(o===r)return r;e.isString(o)||n.push(o);}return e.findBestPatternMatch(n,(function(e){return e}),r)},e.sliceAfter=function(t,r){var n=t.indexOf(r);return e.Debug.assert(-1!==n),t.slice(n)},e.addRelatedInfo=function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.length?(t.relatedInformation||(t.relatedInformation=[]),e.Debug.assert(t.relatedInformation!==e.emptyArray,"Diagnostic had empty array singleton for related info, but is still being constructed!"),(r=t.relatedInformation).push.apply(r,n),t):t},e.minAndMax=function(t,r){e.Debug.assert(0!==t.length);for(var n=r(t[0]),i=n,a=1;a<t.length;a++){var o=r(t[a]);o<n?n=o:o>i&&(i=o);}return {min:n,max:i}},e.rangeOfNode=function(e){return {pos:h(e),end:e.end}},e.rangeOfTypeParameters=function(t,r){return {pos:r.pos-1,end:e.skipTrivia(t.text,r.end)+1}},e.skipTypeChecking=function(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)},e.isJsonEqual=xi,e.parsePseudoBigInt=function(e){var t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:for(var r=e.length-1,n=0;48===e.charCodeAt(n);)n++;return e.slice(n,r)||"0"}for(var i=e.length-1,a=(i-2)*t,o=new Uint16Array((a>>>4)+(15&a?1:0)),s=i-1,c=0;s>=2;s--,c+=t){var l=c>>>4,u=e.charCodeAt(s),_=(u<=57?u-48:10+u-(u<=70?65:97))<<(15&c);o[l]|=_;var d=_>>>16;d&&(o[l+1]|=d);}for(var p="",f=o.length-1,g=!0;g;){var m=0;for(g=!1,l=f;l>=0;l--){var y=m<<16|o[l],v=y/10|0;o[l]=v,m=y-10*v,v&&!g&&(f=l,g=!0);}p=m+p;}return p},e.pseudoBigIntToString=function(e){var t=e.negative,r=e.base10Value;return (t&&"0"!==r?"-":"")+r},e.isValidTypeOnlyAliasUseSite=function(t){return !!(16777216&t.flags)||be(t)||function(t){if(79!==t.kind)return !1;var r=e.findAncestor(t.parent,(function(e){switch(e.kind){case 294:return !0;case 208:case 230:return !1;default:return "quit"}}));return 117===(null==r?void 0:r.token)||261===(null==r?void 0:r.parent.kind)}(t)||function(e){for(;79===e.kind||208===e.kind;)e=e.parent;if(164!==e.kind)return !1;if(Cr(e.parent,256))return !0;var t=e.parent.parent.kind;return 261===t||184===t}(t)||!(ve(t)||function(t){return e.isIdentifier(t)&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t}(t))},e.isIdentifierTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)},e.arrayIsHomogeneous=function(t,r){if(void 0===r&&(r=e.equateValues),t.length<2)return !0;for(var n=t[0],i=1,a=t.length;i<a;i++)if(!r(n,t[i]))return !1;return !0},e.setTextRangePos=Di,e.setTextRangeEnd=Si,e.setTextRangePosEnd=Ti,e.setTextRangePosWidth=function(e,t,r){return Ti(e,t,t+r)},e.setNodeFlags=function(e,t){return e&&(e.flags=t),e},e.setParent=Ci,e.setEachParent=function(e,t){if(e)for(var r=0,n=e;r<n.length;r++)Ci(n[r],t);return e},e.setParentRecursive=function(t,r){return t?(e.forEachChildRecursively(t,e.isJSDocNode(t)?n:function(t,r){return n(t,r)||function(t){if(e.hasJSDocNodes(t))for(var r=0,i=t.jsDoc;r<i.length;r++){var a=i[r];n(a,t),e.forEachChildRecursively(a,n);}}(t)}),t):t;function n(e,t){if(r&&e.parent===t)return "skip";Ci(e,t);}},e.isPackedArrayLiteral=function(t){return e.isArrayLiteralExpression(t)&&e.every(t.elements,Ei)},e.expressionResultIsUnused=function(t){for(e.Debug.assertIsDefined(t.parent);;){var r=t.parent;if(e.isParenthesizedExpression(r))t=r;else {if(e.isExpressionStatement(r)||e.isVoidExpression(r)||e.isForStatement(r)&&(r.initializer===t||r.incrementor===t))return !0;if(e.isCommaListExpression(r)){if(t!==e.last(r.elements))return !0;t=r;}else {if(!e.isBinaryExpression(r)||27!==r.operatorToken.kind)return !1;if(t===r.left)return !0;t=r;}}}},e.containsIgnoredPath=ki,e.getContainingNodeArray=function(t){if(t.parent){switch(t.kind){case 165:var r=t.parent;return 192===r.kind?void 0:r.typeParameters;case 166:return t.parent.parameters;case 201:case 236:return t.parent.templateSpans;case 167:var n=t.parent;return e.canHaveDecorators(n)?n.modifiers:e.canHaveIllegalDecorators(n)?n.illegalDecorators:void 0;case 294:return t.parent.heritageClauses}var i=t.parent;if(e.isJSDocTag(t))return e.isJSDocTypeLiteral(t.parent)?void 0:t.parent.tags;switch(i.kind){case 184:case 261:return e.isTypeElement(t)?i.members:void 0;case 189:case 190:return i.types;case 186:case 206:case 354:case 272:case 276:return i.elements;case 207:case 289:return i.properties;case 210:case 211:return e.isTypeNode(t)?i.typeArguments:i.expression===t?void 0:i.arguments;case 281:case 285:return e.isJsxChild(t)?i.children:void 0;case 283:case 282:return e.isTypeNode(t)?i.typeArguments:void 0;case 238:case 292:case 293:case 265:case 308:return i.statements;case 266:return i.clauses;case 260:case 228:return e.isClassElement(t)?i.members:void 0;case 263:return e.isEnumMember(t)?i.members:void 0}}},e.hasContextSensitiveParameters=function(t){if(!t.typeParameters){if(e.some(t.parameters,(function(e){return !vr(e)})))return !0;if(216!==t.kind){var r=e.firstOrUndefined(t.parameters);if(!r||!gr(r))return !0}}return !1},e.isInfinityOrNaNString=function(e){return "Infinity"===e||"-Infinity"===e||"NaN"===e},e.isCatchClauseVariableDeclaration=Ni,e.isParameterOrCatchClauseVariable=function(t){var r=t.valueDeclaration&&Pt(t.valueDeclaration);return !!r&&(e.isParameter(r)||Ni(r))},e.isFunctionExpressionOrArrowFunction=function(e){return 215===e.kind||216===e.kind},e.escapeSnippetText=function(e){return e.replace(/\$/gm,(function(){return "\\$"}))},e.isNumericLiteralName=Ai,e.createPropertyNameNodeForIdentifierOrLiteral=function(t,r,n,i){return e.isIdentifierText(t,r)?e.factory.createIdentifier(t):!i&&Ai(t)&&+t>=0?e.factory.createNumericLiteral(+t):e.factory.createStringLiteral(t,!!n)},e.isThisTypeParameter=function(e){return !!(262144&e.flags&&e.isThisType)},e.getNodeModulePathParts=function(t){var r,n=0,i=0,a=0;!function(e){e[e.BeforeNodeModules=0]="BeforeNodeModules",e[e.NodeModules=1]="NodeModules",e[e.Scope=2]="Scope",e[e.PackageContent=3]="PackageContent";}(r||(r={}));for(var o=0,s=0,c=0;s>=0;)switch(o=s,s=t.indexOf("/",o+1),c){case 0:t.indexOf(e.nodeModulesPathPart,o)===o&&(n=o,i=s,c=1);break;case 1:case 2:1===c&&"@"===t.charAt(o+1)?c=2:(a=s,c=3);break;case 3:c=t.indexOf(e.nodeModulesPathPart,o)===o?1:3;}return c>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:i,packageRootIndex:a,fileNameIndex:o}:void 0},e.getParameterTypeNode=function(e){var t;return 343===e.kind?null===(t=e.typeExpression)||void 0===t?void 0:t.type:e.type},e.isTypeDeclaration=Fi,e.canHaveExportModifier=function(t){return e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||Fi(t)||e.isModuleDeclaration(t)&&!A(t)&&!N(t)};}(t),function(e){e.createBaseNodeFactory=function(){var t,r,n,i,a;return {createBaseSourceFileNode:function(t){return new(a||(a=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(n||(n=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(i||(i=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(r||(r=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(r){return new(t||(t=e.objectAllocator.getNodeConstructor()))(r,-1,-1)}}};}(t),function(e){e.createParenthesizerRules=function(t){var r,n;return {getParenthesizeLeftSideOfBinaryForOperator:function(t){r||(r=new e.Map);var n=r.get(t);return n||(n=function(e){return o(t,e)},r.set(t,n)),n},getParenthesizeRightSideOfBinaryForOperator:function(t){n||(n=new e.Map);var r=n.get(t);return r||(r=function(e){return s(t,void 0,e)},n.set(t,r)),r},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:s,parenthesizeExpressionOfComputedPropertyName:function(r){return e.isCommaSequence(r)?t.createParenthesizedExpression(r):r},parenthesizeConditionOfConditionalExpression:function(r){var n=e.getOperatorPrecedence(224,57),i=e.skipPartiallyEmittedExpressions(r),a=e.getExpressionPrecedence(i);return 1!==e.compareValues(a,n)?t.createParenthesizedExpression(r):r},parenthesizeBranchOfConditionalExpression:function(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isCommaSequence(n)?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfExportDefault:function(r){var n=e.skipPartiallyEmittedExpressions(r),i=e.isCommaSequence(n);if(!i)switch(e.getLeftmostExpression(n,!1).kind){case 228:case 215:i=!0;}return i?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfNew:function(r){var n=e.getLeftmostExpression(r,!0);switch(n.kind){case 210:return t.createParenthesizedExpression(r);case 211:return n.arguments?r:t.createParenthesizedExpression(r)}return c(r)},parenthesizeLeftSideOfAccess:c,parenthesizeOperandOfPostfixUnary:function(r){return e.isLeftHandSideExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeOperandOfPrefixUnary:function(r){return e.isUnaryExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeExpressionsOfCommaDelimitedList:function(r){var n=e.sameMap(r,l);return e.setTextRange(t.createNodeArray(n,r.hasTrailingComma),r)},parenthesizeExpressionForDisallowedComma:l,parenthesizeExpressionOfExpressionStatement:function(r){var n=e.skipPartiallyEmittedExpressions(r);if(e.isCallExpression(n)){var i=n.expression,a=e.skipPartiallyEmittedExpressions(i).kind;if(215===a||216===a){var o=t.updateCallExpression(n,e.setTextRange(t.createParenthesizedExpression(i),i),n.typeArguments,n.arguments);return t.restoreOuterExpressions(r,o,8)}}var s=e.getLeftmostExpression(n,!1).kind;return 207===s||215===s?e.setTextRange(t.createParenthesizedExpression(r),r):r},parenthesizeConciseBodyOfArrowFunction:function(r){return e.isBlock(r)||!e.isCommaSequence(r)&&207!==e.getLeftmostExpression(r,!1).kind?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeCheckTypeOfConditionalType:u,parenthesizeExtendsTypeOfConditionalType:function(e){return 191===e.kind?t.createParenthesizedType(e):e},parenthesizeConstituentTypesOfUnionType:function(r){return t.createNodeArray(e.sameMap(r,_))},parenthesizeConstituentTypeOfUnionType:_,parenthesizeConstituentTypesOfIntersectionType:function(r){return t.createNodeArray(e.sameMap(r,d))},parenthesizeConstituentTypeOfIntersectionType:d,parenthesizeOperandOfTypeOperator:p,parenthesizeOperandOfReadonlyTypeOperator:function(e){return 195===e.kind?t.createParenthesizedType(e):p(e)},parenthesizeNonArrayTypeOfPostfixType:f,parenthesizeElementTypesOfTupleType:function(r){return t.createNodeArray(e.sameMap(r,g))},parenthesizeElementTypeOfTupleType:g,parenthesizeTypeOfOptionalType:function(e){return m(e)?t.createParenthesizedType(e):f(e)},parenthesizeTypeArguments:function(r){if(e.some(r))return t.createNodeArray(e.sameMap(r,v))},parenthesizeLeadingTypeArgument:y};function i(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isLiteralKind(t.kind))return t.kind;if(223===t.kind&&39===t.operatorToken.kind){if(void 0!==t.cachedLiteralKind)return t.cachedLiteralKind;var r=i(t.left),n=e.isLiteralKind(r)&&r===i(t.right)?r:0;return t.cachedLiteralKind=n,n}return 0}function a(r,n,a,o){return 214===e.skipPartiallyEmittedExpressions(n).kind?n:function(t,r,n,a){var o=e.getOperatorPrecedence(223,t),s=e.getOperatorAssociativity(223,t),c=e.skipPartiallyEmittedExpressions(r);if(!n&&216===r.kind&&o>3)return !0;var l=e.getExpressionPrecedence(c);switch(e.compareValues(l,o)){case-1:return !(!n&&1===s&&226===r.kind);case 1:return !1;case 0:if(n)return 1===s;if(e.isBinaryExpression(c)&&c.operatorToken.kind===t){if(function(e){return 41===e||51===e||50===e||52===e||27===e}(t))return !1;if(39===t){var u=a?i(a):0;if(e.isLiteralKind(u)&&u===i(c))return !1}}return 0===e.getExpressionAssociativity(c)}}(r,n,a,o)?t.createParenthesizedExpression(n):n}function o(e,t){return a(e,t,!0)}function s(e,t,r){return a(e,r,!1,t)}function c(r,n){var i=e.skipPartiallyEmittedExpressions(r);return !e.isLeftHandSideExpression(i)||211===i.kind&&!i.arguments||!n&&e.isOptionalChain(i)?e.setTextRange(t.createParenthesizedExpression(r),r):r}function l(r){var n=e.skipPartiallyEmittedExpressions(r);return e.getExpressionPrecedence(n)>e.getOperatorPrecedence(223,27)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function u(e){switch(e.kind){case 181:case 182:case 191:return t.createParenthesizedType(e)}return e}function _(e){switch(e.kind){case 189:case 190:return t.createParenthesizedType(e)}return u(e)}function d(e){switch(e.kind){case 189:case 190:return t.createParenthesizedType(e)}return _(e)}function p(e){return 190===e.kind?t.createParenthesizedType(e):d(e)}function f(e){switch(e.kind){case 192:case 195:case 183:return t.createParenthesizedType(e)}return p(e)}function g(e){return m(e)?t.createParenthesizedType(e):e}function m(t){return e.isJSDocNullableType(t)?t.postfix:e.isNamedTupleMember(t)||e.isFunctionTypeNode(t)||e.isConstructorTypeNode(t)||e.isTypeOperatorNode(t)?m(t.type):e.isConditionalTypeNode(t)?m(t.falseType):e.isUnionTypeNode(t)||e.isIntersectionTypeNode(t)?m(e.last(t.types)):!!e.isInferTypeNode(t)&&!!t.typeParameter.constraint&&m(t.typeParameter.constraint)}function y(r){return e.isFunctionOrConstructorTypeNode(r)&&r.typeParameters?t.createParenthesizedType(r):r}function v(e,t){return 0===t?y(e):e}},e.nullParenthesizerRules={getParenthesizeLeftSideOfBinaryForOperator:function(t){return e.identity},getParenthesizeRightSideOfBinaryForOperator:function(t){return e.identity},parenthesizeLeftSideOfBinary:function(e,t){return t},parenthesizeRightSideOfBinary:function(e,t,r){return r},parenthesizeExpressionOfComputedPropertyName:e.identity,parenthesizeConditionOfConditionalExpression:e.identity,parenthesizeBranchOfConditionalExpression:e.identity,parenthesizeExpressionOfExportDefault:e.identity,parenthesizeExpressionOfNew:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeLeftSideOfAccess:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPostfixUnary:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPrefixUnary:function(t){return e.cast(t,e.isUnaryExpression)},parenthesizeExpressionsOfCommaDelimitedList:function(t){return e.cast(t,e.isNodeArray)},parenthesizeExpressionForDisallowedComma:e.identity,parenthesizeExpressionOfExpressionStatement:e.identity,parenthesizeConciseBodyOfArrowFunction:e.identity,parenthesizeCheckTypeOfConditionalType:e.identity,parenthesizeExtendsTypeOfConditionalType:e.identity,parenthesizeConstituentTypesOfUnionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfUnionType:e.identity,parenthesizeConstituentTypesOfIntersectionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfIntersectionType:e.identity,parenthesizeOperandOfTypeOperator:e.identity,parenthesizeOperandOfReadonlyTypeOperator:e.identity,parenthesizeNonArrayTypeOfPostfixType:e.identity,parenthesizeElementTypesOfTupleType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeElementTypeOfTupleType:e.identity,parenthesizeTypeOfOptionalType:e.identity,parenthesizeTypeArguments:function(t){return t&&e.cast(t,e.isNodeArray)},parenthesizeLeadingTypeArgument:e.identity};}(t),function(e){e.createNodeConverters=function(t){return {convertToFunctionBlock:function(r,n){if(e.isBlock(r))return r;var i=t.createReturnStatement(r);e.setTextRange(i,r);var a=t.createBlock([i],n);return e.setTextRange(a,r),a},convertToFunctionExpression:function(r){if(!r.body)return e.Debug.fail("Cannot convert a FunctionDeclaration without a body");var n=t.createFunctionExpression(r.modifiers,r.asteriskToken,r.name,r.typeParameters,r.parameters,r.type,r.body);return e.setOriginalNode(n,r),e.setTextRange(n,r),e.getStartsOnNewLine(r)&&e.setStartsOnNewLine(n,!0),n},convertToArrayAssignmentElement:r,convertToObjectAssignmentElement:n,convertToAssignmentPattern:i,convertToObjectAssignmentPattern:a,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:s};function r(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadElement(r.name),r),r);var n=s(r.name);return r.initializer?e.setOriginalNode(e.setTextRange(t.createAssignment(n,r.initializer),r),r):n}return e.cast(r,e.isExpression)}function n(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadAssignment(r.name),r),r);if(r.propertyName){var n=s(r.name);return e.setOriginalNode(e.setTextRange(t.createPropertyAssignment(r.propertyName,r.initializer?t.createAssignment(n,r.initializer):n),r),r)}return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createShorthandPropertyAssignment(r.name,r.initializer),r),r)}return e.cast(r,e.isObjectLiteralElementLike)}function i(e){switch(e.kind){case 204:case 206:return o(e);case 203:case 207:return a(e)}}function a(r){return e.isObjectBindingPattern(r)?e.setOriginalNode(e.setTextRange(t.createObjectLiteralExpression(e.map(r.elements,n)),r),r):e.cast(r,e.isObjectLiteralExpression)}function o(n){return e.isArrayBindingPattern(n)?e.setOriginalNode(e.setTextRange(t.createArrayLiteralExpression(e.map(n.elements,r)),n),n):e.cast(n,e.isArrayLiteralExpression)}function s(t){return e.isBindingPattern(t)?i(t):e.cast(t,e.isExpression)}},e.nullNodeConverters={convertToFunctionBlock:e.notImplemented,convertToFunctionExpression:e.notImplemented,convertToArrayAssignmentElement:e.notImplemented,convertToObjectAssignmentElement:e.notImplemented,convertToAssignmentPattern:e.notImplemented,convertToObjectAssignmentPattern:e.notImplemented,convertToArrayAssignmentPattern:e.notImplemented,convertToAssignmentElementTarget:e.notImplemented};}(t),function(e){var t,r,i=0;function a(r,a){var f=8&r?o:s,g=e.memoize((function(){return 1&r?e.nullParenthesizerRules:e.createParenthesizerRules(F)})),m=e.memoize((function(){return 2&r?e.nullNodeConverters:e.createNodeConverters(F)})),y=e.memoizeOne((function(e){return function(t,r){return jt(t,e,r)}})),v=e.memoizeOne((function(e){return function(t){return Rt(e,t)}})),b=e.memoizeOne((function(e){return function(t){return Bt(t,e)}})),x=e.memoizeOne((function(e){return function(){return function(e){return w(e)}(e)}})),D=e.memoizeOne((function(e){return function(t){return un(e,t)}})),S=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(un(e,r),t):t}(e,t,r)}})),T=e.memoizeOne((function(e){return function(t,r){return ln(e,t,r)}})),C=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(ln(e,r,t.postfix),t):t}(e,t,r)}})),E=e.memoizeOne((function(e){return function(t,r){return Fn(e,t,r)}})),k=e.memoizeOne((function(e){return function(t,r,n){return function(e,t,r,n){return void 0===r&&(r=gn(t)),t.tagName!==r||t.comment!==n?f(Fn(e,r,n),t):t}(e,t,r,n)}})),N=e.memoizeOne((function(e){return function(t,r,n){return Pn(e,t,r,n)}})),A=e.memoizeOne((function(e){return function(t,r,n,i){return function(e,t,r,n,i){return void 0===r&&(r=gn(t)),t.tagName!==r||t.typeExpression!==n||t.comment!==i?f(Pn(e,r,n,i),t):t}(e,t,r,n,i)}})),F={get parenthesizer(){return g()},get converters(){return m()},baseFactory:a,flags:r,createNodeArray:P,createNumericLiteral:V,createBigIntLiteral:q,createStringLiteral:H,createStringLiteralFromNode:function(t){var r=W(e.getTextOfIdentifierOrLiteral(t),void 0);return r.textSourceNode=t,r},createRegularExpressionLiteral:G,createLiteralLikeNode:function(e,t){switch(e){case 8:return V(t,0);case 9:return q(t);case 10:return H(t,void 0);case 11:return Jn(t,!1);case 12:return Jn(t,!0);case 13:return G(t);case 14:return Vt(e,t,void 0,0)}},createIdentifier:Y,updateIdentifier:function(t,r){return t.typeArguments!==r?f(Y(e.idText(t),r),t):t},createTempVariable:Z,createLoopVariable:function(e){var t=2;return e&&(t|=8),X("",t,void 0,void 0)},createUniqueName:function(t,r,n,i){return void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags"),e.Debug.assert(32!=(48&r),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),X(t,3|r,n,i)},getGeneratedNameForNode:$,createPrivateIdentifier:function(t){return e.startsWith(t,"#")||e.Debug.fail("First character of private identifier must be #: "+t),ee(t)},createUniquePrivateName:function(t,r,n){return t&&!e.startsWith(t,"#")&&e.Debug.fail("First character of private identifier must be #: "+t),te(null!=t?t:"",8|(t?3:1),r,n)},getGeneratedPrivateNameForNode:function(t,r,n){var i=te(e.isMemberName(t)?e.formatGeneratedName(!0,r,t,n,e.idText):"#generated@".concat(e.getNodeId(t)),4|(r||n?16:0),r,n);return i.original=t,i},createToken:ne,createSuper:function(){return ne(106)},createThis:ie,createNull:function(){return ne(104)},createTrue:ae,createFalse:oe,createModifier:se,createModifiersFromModifierFlags:ce,createQualifiedName:le,updateQualifiedName:function(e,t,r){return e.left!==t||e.right!==r?f(le(t,r),e):e},createComputedPropertyName:ue,updateComputedPropertyName:function(e,t){return e.expression!==t?f(ue(t),e):e},createTypeParameterDeclaration:_e,updateTypeParameterDeclaration:de,createParameterDeclaration:pe,updateParameterDeclaration:fe,createDecorator:ge,updateDecorator:function(e,t){return e.expression!==t?f(ge(t),e):e},createPropertySignature:me,updatePropertySignature:ye,createPropertyDeclaration:ve,updatePropertyDeclaration:he,createMethodSignature:be,updateMethodSignature:xe,createMethodDeclaration:De,updateMethodDeclaration:Se,createConstructorDeclaration:Ce,updateConstructorDeclaration:Ee,createGetAccessorDeclaration:ke,updateGetAccessorDeclaration:Ne,createSetAccessorDeclaration:Ae,updateSetAccessorDeclaration:Fe,createCallSignature:Pe,updateCallSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(Pe(t,r,n),e):e},createConstructSignature:we,updateConstructSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(we(t,r,n),e):e},createIndexSignature:Ie,updateIndexSignature:Oe,createClassStaticBlockDeclaration:Te,updateClassStaticBlockDeclaration:function(e,t){return e.body!==t?((r=Te(t))!==(n=e)&&(r.illegalDecorators=n.illegalDecorators,r.modifiers=n.modifiers),f(r,n)):e;var r,n;},createTemplateLiteralTypeSpan:Me,updateTemplateLiteralTypeSpan:function(e,t,r){return e.type!==t||e.literal!==r?f(Me(t,r),e):e},createKeywordTypeNode:function(e){return ne(e)},createTypePredicateNode:Le,updateTypePredicateNode:function(e,t,r,n){return e.assertsModifier!==t||e.parameterName!==r||e.type!==n?f(Le(t,r,n),e):e},createTypeReferenceNode:Re,updateTypeReferenceNode:function(e,t,r){return e.typeName!==t||e.typeArguments!==r?f(Re(t,r),e):e},createFunctionTypeNode:Be,updateFunctionTypeNode:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?((i=Be(t,r,n))!==(a=e)&&(i.modifiers=a.modifiers),R(i,a)):e;var i,a;},createConstructorTypeNode:je,updateConstructorTypeNode:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 5===t.length?Ue.apply(void 0,t):4===t.length?Ke.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")},createTypeQueryNode:Ve,updateTypeQueryNode:function(e,t,r){return e.exprName!==t||e.typeArguments!==r?f(Ve(t,r),e):e},createTypeLiteralNode:qe,updateTypeLiteralNode:function(e,t){return e.members!==t?f(qe(t),e):e},createArrayTypeNode:We,updateArrayTypeNode:function(e,t){return e.elementType!==t?f(We(t),e):e},createTupleTypeNode:He,updateTupleTypeNode:function(e,t){return e.elements!==t?f(He(t),e):e},createNamedTupleMember:Ge,updateNamedTupleMember:function(e,t,r,n,i){return e.dotDotDotToken!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(Ge(t,r,n,i),e):e},createOptionalTypeNode:Qe,updateOptionalTypeNode:function(e,t){return e.type!==t?f(Qe(t),e):e},createRestTypeNode:Xe,updateRestTypeNode:function(e,t){return e.type!==t?f(Xe(t),e):e},createUnionTypeNode:function(e){return Ye(189,e,g().parenthesizeConstituentTypesOfUnionType)},updateUnionTypeNode:function(e,t){return Ze(e,t,g().parenthesizeConstituentTypesOfUnionType)},createIntersectionTypeNode:function(e){return Ye(190,e,g().parenthesizeConstituentTypesOfIntersectionType)},updateIntersectionTypeNode:function(e,t){return Ze(e,t,g().parenthesizeConstituentTypesOfIntersectionType)},createConditionalTypeNode:$e,updateConditionalTypeNode:function(e,t,r,n,i){return e.checkType!==t||e.extendsType!==r||e.trueType!==n||e.falseType!==i?f($e(t,r,n,i),e):e},createInferTypeNode:et,updateInferTypeNode:function(e,t){return e.typeParameter!==t?f(et(t),e):e},createImportTypeNode:rt,updateImportTypeNode:function(e,t,r,n,i,a){return void 0===a&&(a=e.isTypeOf),e.argument!==t||e.assertions!==r||e.qualifier!==n||e.typeArguments!==i||e.isTypeOf!==a?f(rt(t,r,n,i,a),e):e},createParenthesizedType:nt,updateParenthesizedType:function(e,t){return e.type!==t?f(nt(t),e):e},createThisTypeNode:function(){var e=w(194);return e.transformFlags=1,e},createTypeOperatorNode:it,updateTypeOperatorNode:function(e,t){return e.type!==t?f(it(e.operator,t),e):e},createIndexedAccessTypeNode:at,updateIndexedAccessTypeNode:function(e,t,r){return e.objectType!==t||e.indexType!==r?f(at(t,r),e):e},createMappedTypeNode:ot,updateMappedTypeNode:function(e,t,r,n,i,a,o){return e.readonlyToken!==t||e.typeParameter!==r||e.nameType!==n||e.questionToken!==i||e.type!==a||e.members!==o?f(ot(t,r,n,i,a,o),e):e},createLiteralTypeNode:st,updateLiteralTypeNode:function(e,t){return e.literal!==t?f(st(t),e):e},createTemplateLiteralType:tt,updateTemplateLiteralType:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(tt(t,r),e):e},createObjectBindingPattern:ct,updateObjectBindingPattern:function(e,t){return e.elements!==t?f(ct(t),e):e},createArrayBindingPattern:lt,updateArrayBindingPattern:function(e,t){return e.elements!==t?f(lt(t),e):e},createBindingElement:ut,updateBindingElement:function(e,t,r,n,i){return e.propertyName!==r||e.dotDotDotToken!==t||e.name!==n||e.initializer!==i?f(ut(t,r,n,i),e):e},createArrayLiteralExpression:dt,updateArrayLiteralExpression:function(e,t){return e.elements!==t?f(dt(t,e.multiLine),e):e},createObjectLiteralExpression:pt,updateObjectLiteralExpression:function(e,t){return e.properties!==t?f(pt(t,e.multiLine),e):e},createPropertyAccessExpression:4&r?function(t,r){return e.setEmitFlags(ft(t,r),131072)}:ft,updatePropertyAccessExpression:function(t,r,n){return e.isPropertyAccessChain(t)?mt(t,r,t.questionDotToken,e.cast(n,e.isIdentifier)):t.expression!==r||t.name!==n?f(ft(r,n),t):t},createPropertyAccessChain:4&r?function(t,r,n){return e.setEmitFlags(gt(t,r,n),131072)}:gt,updatePropertyAccessChain:mt,createElementAccessExpression:yt,updateElementAccessExpression:function(t,r,n){return e.isElementAccessChain(t)?ht(t,r,t.questionDotToken,n):t.expression!==r||t.argumentExpression!==n?f(yt(r,n),t):t},createElementAccessChain:vt,updateElementAccessChain:ht,createCallExpression:bt,updateCallExpression:function(t,r,n,i){return e.isCallChain(t)?Dt(t,r,t.questionDotToken,n,i):t.expression!==r||t.typeArguments!==n||t.arguments!==i?f(bt(r,n,i),t):t},createCallChain:xt,updateCallChain:Dt,createNewExpression:St,updateNewExpression:function(e,t,r,n){return e.expression!==t||e.typeArguments!==r||e.arguments!==n?f(St(t,r,n),e):e},createTaggedTemplateExpression:Tt,updateTaggedTemplateExpression:function(e,t,r,n){return e.tag!==t||e.typeArguments!==r||e.template!==n?f(Tt(t,r,n),e):e},createTypeAssertion:Ct,updateTypeAssertion:Et,createParenthesizedExpression:kt,updateParenthesizedExpression:Nt,createFunctionExpression:At,updateFunctionExpression:Ft,createArrowFunction:Pt,updateArrowFunction:wt,createDeleteExpression:It,updateDeleteExpression:function(e,t){return e.expression!==t?f(It(t),e):e},createTypeOfExpression:Ot,updateTypeOfExpression:function(e,t){return e.expression!==t?f(Ot(t),e):e},createVoidExpression:Mt,updateVoidExpression:function(e,t){return e.expression!==t?f(Mt(t),e):e},createAwaitExpression:Lt,updateAwaitExpression:function(e,t){return e.expression!==t?f(Lt(t),e):e},createPrefixUnaryExpression:Rt,updatePrefixUnaryExpression:function(e,t){return e.operand!==t?f(Rt(e.operator,t),e):e},createPostfixUnaryExpression:Bt,updatePostfixUnaryExpression:function(e,t){return e.operand!==t?f(Bt(t,e.operator),e):e},createBinaryExpression:jt,updateBinaryExpression:function(e,t,r,n){return e.left!==t||e.operatorToken!==r||e.right!==n?f(jt(t,r,n),e):e},createConditionalExpression:zt,updateConditionalExpression:function(e,t,r,n,i,a){return e.condition!==t||e.questionToken!==r||e.whenTrue!==n||e.colonToken!==i||e.whenFalse!==a?f(zt(t,r,n,i,a),e):e},createTemplateExpression:Ut,updateTemplateExpression:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(Ut(t,r),e):e},createTemplateHead:function(e,t,r){return Kt(15,e,t,r)},createTemplateMiddle:function(e,t,r){return Kt(16,e,t,r)},createTemplateTail:function(e,t,r){return Kt(17,e,t,r)},createNoSubstitutionTemplateLiteral:function(e,t,r){return Kt(14,e,t,r)},createTemplateLiteralLikeNode:Vt,createYieldExpression:qt,updateYieldExpression:function(e,t,r){return e.expression!==r||e.asteriskToken!==t?f(qt(t,r),e):e},createSpreadElement:Wt,updateSpreadElement:function(e,t){return e.expression!==t?f(Wt(t),e):e},createClassExpression:Ht,updateClassExpression:Gt,createOmittedExpression:function(){return _t(229)},createExpressionWithTypeArguments:Qt,updateExpressionWithTypeArguments:function(e,t,r){return e.expression!==t||e.typeArguments!==r?f(Qt(t,r),e):e},createAsExpression:Xt,updateAsExpression:Yt,createNonNullExpression:Zt,updateNonNullExpression:$t,createSatisfiesExpression:er,updateSatisfiesExpression:tr,createNonNullChain:rr,updateNonNullChain:nr,createMetaProperty:ir,updateMetaProperty:function(e,t){return e.name!==t?f(ir(e.keywordToken,t),e):e},createTemplateSpan:ar,updateTemplateSpan:function(e,t,r){return e.expression!==t||e.literal!==r?f(ar(t,r),e):e},createSemicolonClassElement:function(){var e=w(237);return e.transformFlags|=1024,e},createBlock:or,updateBlock:function(e,t){return e.statements!==t?f(or(t,e.multiLine),e):e},createVariableStatement:sr,updateVariableStatement:cr,createEmptyStatement:lr,createExpressionStatement:ur,updateExpressionStatement:function(e,t){return e.expression!==t?f(ur(t),e):e},createIfStatement:_r,updateIfStatement:function(e,t,r,n){return e.expression!==t||e.thenStatement!==r||e.elseStatement!==n?f(_r(t,r,n),e):e},createDoStatement:dr,updateDoStatement:function(e,t,r){return e.statement!==t||e.expression!==r?f(dr(t,r),e):e},createWhileStatement:pr,updateWhileStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(pr(t,r),e):e},createForStatement:fr,updateForStatement:function(e,t,r,n,i){return e.initializer!==t||e.condition!==r||e.incrementor!==n||e.statement!==i?f(fr(t,r,n,i),e):e},createForInStatement:gr,updateForInStatement:function(e,t,r,n){return e.initializer!==t||e.expression!==r||e.statement!==n?f(gr(t,r,n),e):e},createForOfStatement:mr,updateForOfStatement:function(e,t,r,n,i){return e.awaitModifier!==t||e.initializer!==r||e.expression!==n||e.statement!==i?f(mr(t,r,n,i),e):e},createContinueStatement:yr,updateContinueStatement:function(e,t){return e.label!==t?f(yr(t),e):e},createBreakStatement:vr,updateBreakStatement:function(e,t){return e.label!==t?f(vr(t),e):e},createReturnStatement:hr,updateReturnStatement:function(e,t){return e.expression!==t?f(hr(t),e):e},createWithStatement:br,updateWithStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(br(t,r),e):e},createSwitchStatement:xr,updateSwitchStatement:function(e,t,r){return e.expression!==t||e.caseBlock!==r?f(xr(t,r),e):e},createLabeledStatement:Dr,updateLabeledStatement:Sr,createThrowStatement:Tr,updateThrowStatement:function(e,t){return e.expression!==t?f(Tr(t),e):e},createTryStatement:Cr,updateTryStatement:function(e,t,r,n){return e.tryBlock!==t||e.catchClause!==r||e.finallyBlock!==n?f(Cr(t,r,n),e):e},createDebuggerStatement:function(){return w(256)},createVariableDeclaration:Er,updateVariableDeclaration:function(e,t,r,n,i){return e.name!==t||e.type!==n||e.exclamationToken!==r||e.initializer!==i?f(Er(t,r,n,i),e):e},createVariableDeclarationList:kr,updateVariableDeclarationList:function(e,t){return e.declarations!==t?f(kr(t,e.flags),e):e},createFunctionDeclaration:Nr,updateFunctionDeclaration:Ar,createClassDeclaration:Fr,updateClassDeclaration:Pr,createInterfaceDeclaration:wr,updateInterfaceDeclaration:Ir,createTypeAliasDeclaration:Or,updateTypeAliasDeclaration:Mr,createEnumDeclaration:Lr,updateEnumDeclaration:Rr,createModuleDeclaration:Br,updateModuleDeclaration:jr,createModuleBlock:Jr,updateModuleBlock:function(e,t){return e.statements!==t?f(Jr(t),e):e},createCaseBlock:zr,updateCaseBlock:function(e,t){return e.clauses!==t?f(zr(t),e):e},createNamespaceExportDeclaration:Ur,updateNamespaceExportDeclaration:function(e,t){return e.name!==t?((r=Ur(t))!==(n=e)&&(r.illegalDecorators=n.illegalDecorators,r.modifiers=n.modifiers),f(r,n)):e;var r,n;},createImportEqualsDeclaration:Kr,updateImportEqualsDeclaration:Vr,createImportDeclaration:qr,updateImportDeclaration:Wr,createImportClause:Hr,updateImportClause:function(e,t,r,n){return e.isTypeOnly!==t||e.name!==r||e.namedBindings!==n?f(Hr(t,r,n),e):e},createAssertClause:Gr,updateAssertClause:function(e,t,r){return e.elements!==t||e.multiLine!==r?f(Gr(t,r),e):e},createAssertEntry:Qr,updateAssertEntry:function(e,t,r){return e.name!==t||e.value!==r?f(Qr(t,r),e):e},createImportTypeAssertionContainer:Xr,updateImportTypeAssertionContainer:function(e,t,r){return e.assertClause!==t||e.multiLine!==r?f(Xr(t,r),e):e},createNamespaceImport:Yr,updateNamespaceImport:function(e,t){return e.name!==t?f(Yr(t),e):e},createNamespaceExport:Zr,updateNamespaceExport:function(e,t){return e.name!==t?f(Zr(t),e):e},createNamedImports:$r,updateNamedImports:function(e,t){return e.elements!==t?f($r(t),e):e},createImportSpecifier:en,updateImportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f(en(t,r,n),e):e},createExportAssignment:tn,updateExportAssignment:rn,createExportDeclaration:nn,updateExportDeclaration:an,createNamedExports:on,updateNamedExports:function(e,t){return e.elements!==t?f(on(t),e):e},createExportSpecifier:sn,updateExportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f(sn(t,r,n),e):e},createMissingDeclaration:function(){return I(279)},createExternalModuleReference:cn,updateExternalModuleReference:function(e,t){return e.expression!==t?f(cn(t),e):e},get createJSDocAllType(){return x(315)},get createJSDocUnknownType(){return x(316)},get createJSDocNonNullableType(){return T(318)},get updateJSDocNonNullableType(){return C(318)},get createJSDocNullableType(){return T(317)},get updateJSDocNullableType(){return C(317)},get createJSDocOptionalType(){return D(319)},get updateJSDocOptionalType(){return S(319)},get createJSDocVariadicType(){return D(321)},get updateJSDocVariadicType(){return S(321)},get createJSDocNamepathType(){return D(322)},get updateJSDocNamepathType(){return S(322)},createJSDocFunctionType:_n,updateJSDocFunctionType:function(e,t,r){return e.parameters!==t||e.type!==r?f(_n(t,r),e):e},createJSDocTypeLiteral:dn,updateJSDocTypeLiteral:function(e,t,r){return e.jsDocPropertyTags!==t||e.isArrayType!==r?f(dn(t,r),e):e},createJSDocTypeExpression:pn,updateJSDocTypeExpression:function(e,t){return e.type!==t?f(pn(t),e):e},createJSDocSignature:fn,updateJSDocSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?f(fn(t,r,n),e):e},createJSDocTemplateTag:yn,updateJSDocTemplateTag:function(e,t,r,n,i){return void 0===t&&(t=gn(e)),e.tagName!==t||e.constraint!==r||e.typeParameters!==n||e.comment!==i?f(yn(t,r,n,i),e):e},createJSDocTypedefTag:vn,updateJSDocTypedefTag:function(e,t,r,n,i){return void 0===t&&(t=gn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(vn(t,r,n,i),e):e},createJSDocParameterTag:hn,updateJSDocParameterTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=gn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(hn(t,r,n,i,a,o),e):e},createJSDocPropertyTag:bn,updateJSDocPropertyTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=gn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(bn(t,r,n,i,a,o),e):e},createJSDocCallbackTag:xn,updateJSDocCallbackTag:function(e,t,r,n,i){return void 0===t&&(t=gn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(xn(t,r,n,i),e):e},createJSDocAugmentsTag:Dn,updateJSDocAugmentsTag:function(e,t,r,n){return void 0===t&&(t=gn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(Dn(t,r,n),e):e},createJSDocImplementsTag:Sn,updateJSDocImplementsTag:function(e,t,r,n){return void 0===t&&(t=gn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(Sn(t,r,n),e):e},createJSDocSeeTag:Tn,updateJSDocSeeTag:function(e,t,r,n){return e.tagName!==t||e.name!==r||e.comment!==n?f(Tn(t,r,n),e):e},createJSDocNameReference:Cn,updateJSDocNameReference:function(e,t){return e.name!==t?f(Cn(t),e):e},createJSDocMemberName:En,updateJSDocMemberName:function(e,t,r){return e.left!==t||e.right!==r?f(En(t,r),e):e},createJSDocLink:kn,updateJSDocLink:function(e,t,r){return e.name!==t?f(kn(t,r),e):e},createJSDocLinkCode:Nn,updateJSDocLinkCode:function(e,t,r){return e.name!==t?f(Nn(t,r),e):e},createJSDocLinkPlain:An,updateJSDocLinkPlain:function(e,t,r){return e.name!==t?f(An(t,r),e):e},get createJSDocTypeTag(){return N(346)},get updateJSDocTypeTag(){return A(346)},get createJSDocReturnTag(){return N(344)},get updateJSDocReturnTag(){return A(344)},get createJSDocThisTag(){return N(345)},get updateJSDocThisTag(){return A(345)},get createJSDocEnumTag(){return N(342)},get updateJSDocEnumTag(){return A(342)},get createJSDocAuthorTag(){return E(333)},get updateJSDocAuthorTag(){return k(333)},get createJSDocClassTag(){return E(335)},get updateJSDocClassTag(){return k(335)},get createJSDocPublicTag(){return E(336)},get updateJSDocPublicTag(){return k(336)},get createJSDocPrivateTag(){return E(337)},get updateJSDocPrivateTag(){return k(337)},get createJSDocProtectedTag(){return E(338)},get updateJSDocProtectedTag(){return k(338)},get createJSDocReadonlyTag(){return E(339)},get updateJSDocReadonlyTag(){return k(339)},get createJSDocOverrideTag(){return E(340)},get updateJSDocOverrideTag(){return k(340)},get createJSDocDeprecatedTag(){return E(334)},get updateJSDocDeprecatedTag(){return k(334)},createJSDocUnknownTag:wn,updateJSDocUnknownTag:function(e,t,r){return e.tagName!==t||e.comment!==r?f(wn(t,r),e):e},createJSDocText:In,updateJSDocText:function(e,t){return e.text!==t?f(In(t),e):e},createJSDocComment:On,updateJSDocComment:function(e,t,r){return e.comment!==t||e.tags!==r?f(On(t,r),e):e},createJsxElement:Mn,updateJsxElement:function(e,t,r,n){return e.openingElement!==t||e.children!==r||e.closingElement!==n?f(Mn(t,r,n),e):e},createJsxSelfClosingElement:Ln,updateJsxSelfClosingElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Ln(t,r,n),e):e},createJsxOpeningElement:Rn,updateJsxOpeningElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Rn(t,r,n),e):e},createJsxClosingElement:Bn,updateJsxClosingElement:function(e,t){return e.tagName!==t?f(Bn(t),e):e},createJsxFragment:jn,createJsxText:Jn,updateJsxText:function(e,t,r){return e.text!==t||e.containsOnlyTriviaWhiteSpaces!==r?f(Jn(t,r),e):e},createJsxOpeningFragment:function(){var e=w(286);return e.transformFlags|=2,e},createJsxJsxClosingFragment:function(){var e=w(287);return e.transformFlags|=2,e},updateJsxFragment:function(e,t,r,n){return e.openingFragment!==t||e.children!==r||e.closingFragment!==n?f(jn(t,r,n),e):e},createJsxAttribute:zn,updateJsxAttribute:function(e,t,r){return e.name!==t||e.initializer!==r?f(zn(t,r),e):e},createJsxAttributes:Un,updateJsxAttributes:function(e,t){return e.properties!==t?f(Un(t),e):e},createJsxSpreadAttribute:Kn,updateJsxSpreadAttribute:function(e,t){return e.expression!==t?f(Kn(t),e):e},createJsxExpression:Vn,updateJsxExpression:function(e,t){return e.expression!==t?f(Vn(e.dotDotDotToken,t),e):e},createCaseClause:qn,updateCaseClause:function(e,t,r){return e.expression!==t||e.statements!==r?f(qn(t,r),e):e},createDefaultClause:Wn,updateDefaultClause:function(e,t){return e.statements!==t?f(Wn(t),e):e},createHeritageClause:Hn,updateHeritageClause:function(e,t){return e.types!==t?f(Hn(e.token,t),e):e},createCatchClause:Gn,updateCatchClause:function(e,t,r){return e.variableDeclaration!==t||e.block!==r?f(Gn(t,r),e):e},createPropertyAssignment:Qn,updatePropertyAssignment:function(e,t,r){return e.name!==t||e.initializer!==r?((n=Qn(t,r))!==(i=e)&&(n.illegalDecorators=i.illegalDecorators,n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createShorthandPropertyAssignment:Xn,updateShorthandPropertyAssignment:function(e,t,r){return e.name!==t||e.objectAssignmentInitializer!==r?((n=Xn(t,r))!==(i=e)&&(n.equalsToken=i.equalsToken,n.illegalDecorators=i.illegalDecorators,n.modifiers=i.modifiers,n.questionToken=i.questionToken,n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createSpreadAssignment:Yn,updateSpreadAssignment:function(e,t){return e.expression!==t?f(Yn(t),e):e},createEnumMember:Zn,updateEnumMember:function(e,t,r){return e.name!==t||e.initializer!==r?f(Zn(t,r),e):e},createSourceFile:function(e,t,r){var n=a.createBaseSourceFileNode(308);return n.statements=P(e),n.endOfFileToken=t,n.flags|=r,n.fileName="",n.text="",n.languageVersion=0,n.languageVariant=0,n.scriptKind=0,n.isDeclarationFile=!1,n.hasNoDefaultLib=!1,n.transformFlags|=d(n.statements)|_(n.endOfFileToken),n},updateSourceFile:function(t,r,n,i,o,s,c){return void 0===n&&(n=t.isDeclarationFile),void 0===i&&(i=t.referencedFiles),void 0===o&&(o=t.typeReferenceDirectives),void 0===s&&(s=t.hasNoDefaultLib),void 0===c&&(c=t.libReferenceDirectives),t.statements!==r||t.isDeclarationFile!==n||t.referencedFiles!==i||t.typeReferenceDirectives!==o||t.hasNoDefaultLib!==s||t.libReferenceDirectives!==c?f(function(t,r,n,i,o,s,c){var l=t.redirectInfo?Object.create(t.redirectInfo.redirectTarget):a.createBaseSourceFileNode(308);for(var u in t)"emitNode"!==u&&!e.hasProperty(l,u)&&e.hasProperty(t,u)&&(l[u]=t[u]);return l.flags|=t.flags,l.statements=P(r),l.endOfFileToken=t.endOfFileToken,l.isDeclarationFile=n,l.referencedFiles=i,l.typeReferenceDirectives=o,l.hasNoDefaultLib=s,l.libReferenceDirectives=c,l.transformFlags=d(l.statements)|_(l.endOfFileToken),l.impliedNodeFormat=t.impliedNodeFormat,l}(t,r,n,i,o,s,c),t):t},createBundle:$n,updateBundle:function(t,r,n){return void 0===n&&(n=e.emptyArray),t.sourceFiles!==r||t.prepends!==n?f($n(r,n),t):t},createUnparsedSource:function(t,r,n){var i=w(310);return i.prologues=t,i.syntheticReferences=r,i.texts=n,i.fileName="",i.text="",i.referencedFiles=e.emptyArray,i.libReferenceDirectives=e.emptyArray,i.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(i,t)},i},createUnparsedPrologue:function(e){return ei(303,e)},createUnparsedPrepend:function(e,t){var r=ei(304,e);return r.texts=t,r},createUnparsedTextLike:function(e,t){return ei(t?306:305,e)},createUnparsedSyntheticReference:function(e){var t=w(307);return t.data=e.data,t.section=e,t},createInputFiles:function(){var e=w(311);return e.javascriptText="",e.declarationText="",e},createSyntheticExpression:function(e,t,r){void 0===t&&(t=!1);var n=w(234);return n.type=e,n.isSpread=t,n.tupleNameSource=r,n},createSyntaxList:function(e){var t=w(351);return t._children=e,t},createNotEmittedStatement:function(t){var r=w(352);return r.original=t,e.setTextRange(r,t),r},createPartiallyEmittedExpression:ti,updatePartiallyEmittedExpression:ri,createCommaListExpression:ii,updateCommaListExpression:function(e,t){return e.elements!==t?f(ii(t),e):e},createEndOfDeclarationMarker:function(e){var t=w(356);return t.emitNode={},t.original=e,t},createMergeDeclarationMarker:function(e){var t=w(355);return t.emitNode={},t.original=e,t},createSyntheticReferenceExpression:ai,updateSyntheticReferenceExpression:function(e,t,r){return e.expression!==t||e.thisArg!==r?f(ai(t,r),e):e},cloneNode:oi,get createComma(){return y(27)},get createAssignment(){return y(63)},get createLogicalOr(){return y(56)},get createLogicalAnd(){return y(55)},get createBitwiseOr(){return y(51)},get createBitwiseXor(){return y(52)},get createBitwiseAnd(){return y(50)},get createStrictEquality(){return y(36)},get createStrictInequality(){return y(37)},get createEquality(){return y(34)},get createInequality(){return y(35)},get createLessThan(){return y(29)},get createLessThanEquals(){return y(32)},get createGreaterThan(){return y(31)},get createGreaterThanEquals(){return y(33)},get createLeftShift(){return y(47)},get createRightShift(){return y(48)},get createUnsignedRightShift(){return y(49)},get createAdd(){return y(39)},get createSubtract(){return y(40)},get createMultiply(){return y(41)},get createDivide(){return y(43)},get createModulo(){return y(44)},get createExponent(){return y(42)},get createPrefixPlus(){return v(39)},get createPrefixMinus(){return v(40)},get createPrefixIncrement(){return v(45)},get createPrefixDecrement(){return v(46)},get createBitwiseNot(){return v(54)},get createLogicalNot(){return v(53)},get createPostfixIncrement(){return b(45)},get createPostfixDecrement(){return b(46)},createImmediatelyInvokedFunctionExpression:function(e,t,r){return bt(At(void 0,void 0,void 0,void 0,t?[t]:[],void 0,or(e,!0)),void 0,r?[r]:[])},createImmediatelyInvokedArrowFunction:function(e,t,r){return bt(Pt(void 0,void 0,t?[t]:[],void 0,void 0,or(e,!0)),void 0,r?[r]:[])},createVoidZero:si,createExportDefault:function(e){return tn(void 0,!1,e)},createExternalModuleExport:function(e){return nn(void 0,!1,on([sn(!1,void 0,e)]))},createTypeCheck:function(e,t){return "undefined"===t?F.createStrictEquality(e,si()):F.createStrictEquality(Ot(e),H(t))},createMethodCall:ci,createGlobalMethodCall:li,createFunctionBindCall:function(e,t,r){return ci(e,"bind",n$4([t],r,!0))},createFunctionCallCall:function(e,t,r){return ci(e,"call",n$4([t],r,!0))},createFunctionApplyCall:function(e,t,r){return ci(e,"apply",[t,r])},createArraySliceCall:function(e,t){return ci(e,"slice",void 0===t?[]:[xi(t)])},createArrayConcatCall:function(e,t){return ci(e,"concat",t)},createObjectDefinePropertyCall:function(e,t,r){return li("Object","defineProperty",[e,xi(t),r])},createReflectGetCall:function(e,t,r){return li("Reflect","get",r?[e,t,r]:[e,t])},createReflectSetCall:function(e,t,r,n){return li("Reflect","set",n?[e,t,r,n]:[e,t,r])},createPropertyDescriptor:function(t,r){var n=[];ui(n,"enumerable",xi(t.enumerable)),ui(n,"configurable",xi(t.configurable));var i=ui(n,"writable",xi(t.writable));i=ui(n,"value",t.value)||i;var a=ui(n,"get",t.get);return a=ui(n,"set",t.set)||a,e.Debug.assert(!(i&&a),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),pt(n,!r)},createCallBinding:function(t,r,n,i){void 0===i&&(i=!1);var a,o,s=e.skipOuterExpressions(t,15);return e.isSuperProperty(s)?(a=ie(),o=s):e.isSuperKeyword(s)?(a=ie(),o=void 0!==n&&n<2?e.setTextRange(Y("_super"),s):s):4096&e.getEmitFlags(s)?(a=si(),o=g().parenthesizeLeftSideOfAccess(s,!1)):e.isPropertyAccessExpression(s)?_i(s.expression,i)?(a=Z(r),o=ft(e.setTextRange(F.createAssignment(a,s.expression),s.expression),s.name),e.setTextRange(o,s)):(a=s.expression,o=s):e.isElementAccessExpression(s)?_i(s.expression,i)?(a=Z(r),o=yt(e.setTextRange(F.createAssignment(a,s.expression),s.expression),s.argumentExpression),e.setTextRange(o,s)):(a=s.expression,o=s):(a=si(),o=g().parenthesizeLeftSideOfAccess(t,!1)),{target:o,thisArg:a}},createAssignmentTargetWrapper:function(e,t){return ft(kt(pt([Ae(void 0,"value",[pe(void 0,void 0,e,void 0,void 0,void 0)],or([ur(t)]))])),"value")},inlineExpressions:function(t){return t.length>10?ii(t):e.reduceLeft(t,F.createComma)},getInternalName:function(e,t,r){return di(e,t,r,49152)},getLocalName:function(e,t,r){return di(e,t,r,16384)},getExportName:pi,getDeclarationName:function(e,t,r){return di(e,t,r)},getNamespaceMemberName:fi,getExternalModuleOrNamespaceExportName:function(t,r,n,i){return t&&e.hasSyntacticModifier(r,1)?fi(t,di(r),n,i):pi(r,n,i)},restoreOuterExpressions:function t(r,n,i){return void 0===i&&(i=15),r&&e.isOuterExpression(r,i)&&(a=r,!(e.isParenthesizedExpression(a)&&e.nodeIsSynthesized(a)&&e.nodeIsSynthesized(e.getSourceMapRange(a))&&e.nodeIsSynthesized(e.getCommentRange(a)))||e.some(e.getSyntheticLeadingComments(a))||e.some(e.getSyntheticTrailingComments(a)))?function(e,t){switch(e.kind){case 214:return Nt(e,t);case 213:return Et(e,e.type,t);case 231:return Yt(e,t,e.type);case 235:return tr(e,t,e.type);case 232:return $t(e,t);case 353:return ri(e,t)}}(r,t(r.expression,n)):n;var a;},restoreEnclosingLabel:function t(r,n,i){if(!n)return r;var a=Sr(n,n.label,e.isLabeledStatement(n.statement)?t(r,n.statement):r);return i&&i(n),a},createUseStrictPrologue:gi,copyPrologue:function(e,t,r,n){return yi(e,t,mi(e,t,0,r),n)},copyStandardPrologue:mi,copyCustomPrologue:yi,ensureUseStrict:function(t){return e.findUseStrictPrologue(t)?t:e.setTextRange(P(n$4([gi()],t,!0)),t)},liftToBlock:function(t){return e.Debug.assert(e.every(t,e.isStatementOrBlock),"Cannot lift nodes to a Block."),e.singleOrUndefined(t)||or(t)},mergeLexicalEnvironment:function(t,r){if(!e.some(r))return t;var i=vi(t,e.isPrologueDirective,0),a=vi(t,e.isHoistedFunction,i),o=vi(t,e.isHoistedVariableStatement,a),s=vi(r,e.isPrologueDirective,0),c=vi(r,e.isHoistedFunction,s),l=vi(r,e.isHoistedVariableStatement,c),u=vi(r,e.isCustomPrologue,l);e.Debug.assert(u===r.length,"Expected declarations to be valid standard or custom prologues");var _=e.isNodeArray(t)?t.slice():t;if(u>l&&_.splice.apply(_,n$4([o,0],r.slice(l,u),!1)),l>c&&_.splice.apply(_,n$4([a,0],r.slice(c,l),!1)),c>s&&_.splice.apply(_,n$4([i,0],r.slice(s,c),!1)),s>0)if(0===i)_.splice.apply(_,n$4([0,0],r.slice(0,s),!1));else {for(var d=new e.Map,p=0;p<i;p++){var f=t[p];d.set(f.expression.text,!0);}for(p=s-1;p>=0;p--){var g=r[p];d.has(g.expression.text)||_.unshift(g);}}return e.isNodeArray(t)?e.setTextRange(P(_,t.hasTrailingComma),t):t},updateModifiers:function(t,r){var n,i;return i="number"==typeof r?ce(r):r,e.isTypeParameterDeclaration(t)?de(t,i,t.name,t.constraint,t.default):e.isParameter(t)?fe(t,i,t.dotDotDotToken,t.name,t.questionToken,t.type,t.initializer):e.isConstructorTypeNode(t)?Ue(t,i,t.typeParameters,t.parameters,t.type):e.isPropertySignature(t)?ye(t,i,t.name,t.questionToken,t.type):e.isPropertyDeclaration(t)?he(t,i,t.name,null!==(n=t.questionToken)&&void 0!==n?n:t.exclamationToken,t.type,t.initializer):e.isMethodSignature(t)?xe(t,i,t.name,t.questionToken,t.typeParameters,t.parameters,t.type):e.isMethodDeclaration(t)?Se(t,i,t.asteriskToken,t.name,t.questionToken,t.typeParameters,t.parameters,t.type,t.body):e.isConstructorDeclaration(t)?Ee(t,i,t.parameters,t.body):e.isGetAccessorDeclaration(t)?Ne(t,i,t.name,t.parameters,t.type,t.body):e.isSetAccessorDeclaration(t)?Fe(t,i,t.name,t.parameters,t.body):e.isIndexSignatureDeclaration(t)?Oe(t,i,t.parameters,t.type):e.isFunctionExpression(t)?Ft(t,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isArrowFunction(t)?wt(t,i,t.typeParameters,t.parameters,t.type,t.equalsGreaterThanToken,t.body):e.isClassExpression(t)?Gt(t,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isVariableStatement(t)?cr(t,i,t.declarationList):e.isFunctionDeclaration(t)?Ar(t,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isClassDeclaration(t)?Pr(t,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isInterfaceDeclaration(t)?Ir(t,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isTypeAliasDeclaration(t)?Mr(t,i,t.name,t.typeParameters,t.type):e.isEnumDeclaration(t)?Rr(t,i,t.name,t.members):e.isModuleDeclaration(t)?jr(t,i,t.name,t.body):e.isImportEqualsDeclaration(t)?Vr(t,i,t.isTypeOnly,t.name,t.moduleReference):e.isImportDeclaration(t)?Wr(t,i,t.importClause,t.moduleSpecifier,t.assertClause):e.isExportAssignment(t)?rn(t,i,t.expression):e.isExportDeclaration(t)?an(t,i,t.isTypeOnly,t.exportClause,t.moduleSpecifier,t.assertClause):e.Debug.assertNever(t)}};return F;function P(t,r){if(void 0===t||t===e.emptyArray)t=[];else if(e.isNodeArray(t)){if(void 0===r||t.hasTrailingComma===r)return void 0===t.transformFlags&&p(t),e.Debug.attachNodeArrayDebugInfo(t),t;var n=t.slice();return n.pos=t.pos,n.end=t.end,n.hasTrailingComma=r,n.transformFlags=t.transformFlags,e.Debug.attachNodeArrayDebugInfo(n),n}var i=t.length,a=i>=1&&i<=4?t.slice():t;return e.setTextRangePosEnd(a,-1,-1),a.hasTrailingComma=!!r,p(a),e.Debug.attachNodeArrayDebugInfo(a),a}function w(e){return a.createBaseNode(e)}function I(e){var t=w(e);return t.symbol=void 0,t.localSymbol=void 0,t.locals=void 0,t.nextContainer=void 0,t}function O(t,r,n){var i=I(t);if(n=bi(n),i.name=n,e.canHaveModifiers(i)&&(i.modifiers=hi(r),i.transformFlags|=d(i.modifiers)),n)switch(i.kind){case 171:case 174:case 175:case 169:case 299:if(e.isIdentifier(n)){i.transformFlags|=u(n);break}default:i.transformFlags|=_(n);}return i}function M(e,t,r,n){var i=O(e,t,r);return i.typeParameters=hi(n),i.transformFlags|=d(i.typeParameters),n&&(i.transformFlags|=1),i}function L(e,t,r,n,i,a){var o=M(e,t,r,n);return o.parameters=P(i),o.type=a,o.transformFlags|=d(o.parameters)|_(o.type),a&&(o.transformFlags|=1),o.typeArguments=void 0,o}function R(e,t){return e!==t&&(e.typeArguments=t.typeArguments),f(e,t)}function B(e,t,r,n,i,a,o){var s=L(e,t,r,n,i,a);return s.body=o,s.transformFlags|=-67108865&_(s.body),o||(s.transformFlags|=1),s}function j(e,t,r,n,i){var a=M(e,t,r,n);return a.heritageClauses=hi(i),a.transformFlags|=d(a.heritageClauses),a}function J(e,t,r,n,i,a){var o=j(e,t,r,n,i);return o.members=P(a),o.transformFlags|=d(o.members),o}function z(e,t,r,n){var i=O(e,t,r);return i.initializer=n,i.transformFlags|=_(i.initializer),i}function U(e,t,r,n,i){var a=z(e,t,r,i);return a.type=n,a.transformFlags|=_(n),n&&(a.transformFlags|=1),a}function K(e,t){var r=re(e);return r.text=t,r}function V(e,t){void 0===t&&(t=0);var r=K(8,"number"==typeof e?e+"":e);return r.numericLiteralFlags=t,384&t&&(r.transformFlags|=1024),r}function q(t){var r=K(9,"string"==typeof t?t:e.pseudoBigIntToString(t)+"n");return r.transformFlags|=4,r}function W(e,t){var r=K(10,e);return r.singleQuote=t,r}function H(e,t,r){var n=W(e,t);return n.hasExtendedUnicodeEscape=r,r&&(n.transformFlags|=1024),n}function G(e){return K(13,e)}function Q(t,r){void 0===r&&t&&(r=e.stringToToken(t)),79===r&&(r=void 0);var n=a.createBaseIdentifierNode(79);return n.originalKeywordKind=r,n.escapedText=e.escapeLeadingUnderscores(t),n}function X(e,t,r,n){var a=Q(e,void 0);return a.autoGenerateFlags=t,a.autoGenerateId=i,a.autoGeneratePrefix=r,a.autoGenerateSuffix=n,i++,a}function Y(e,t,r,n){var i=Q(e,r);return t&&(i.typeArguments=P(t)),133===i.originalKeywordKind&&(i.transformFlags|=67108864),n&&(i.hasExtendedUnicodeEscape=n,i.transformFlags|=1024),i}function Z(e,t,r,n){var i=1;t&&(i|=8);var a=X("",i,r,n);return e&&e(a),a}function $(t,r,n,i){void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags"),(n||i)&&(r|=16);var a=X(t?e.isMemberName(t)?e.formatGeneratedName(!1,n,t,i,e.idText):"generated@".concat(e.getNodeId(t)):"",4|r,n,i);return a.original=t,a}function ee(t){var r=a.createBasePrivateIdentifierNode(80);return r.escapedText=e.escapeLeadingUnderscores(t),r.transformFlags|=16777216,r}function te(e,t,r,n){var a=ee(e);return a.autoGenerateFlags=t,a.autoGenerateId=i,a.autoGeneratePrefix=r,a.autoGenerateSuffix=n,i++,a}function re(e){return a.createBaseTokenNode(e)}function ne(t){e.Debug.assert(t>=0&&t<=162,"Invalid token"),e.Debug.assert(t<=14||t>=17,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),e.Debug.assert(t<=8||t>=14,"Invalid token. Use 'createLiteralLikeNode' to create literals."),e.Debug.assert(79!==t,"Invalid token. Use 'createIdentifier' to create identifiers");var r=re(t),n=0;switch(t){case 132:n=384;break;case 123:case 121:case 122:case 146:case 126:case 136:case 85:case 131:case 148:case 160:case 144:case 149:case 101:case 145:case 161:case 152:case 134:case 153:case 114:case 157:case 155:n=1;break;case 106:n=134218752;break;case 124:n=1024;break;case 127:n=16777216;break;case 108:n=16384;}return n&&(r.transformFlags|=n),r}function ie(){return ne(108)}function ae(){return ne(110)}function oe(){return ne(95)}function se(e){return ne(e)}function ce(e){var t=[];return 1&e&&t.push(se(93)),2&e&&t.push(se(136)),1024&e&&t.push(se(88)),2048&e&&t.push(se(85)),4&e&&t.push(se(123)),8&e&&t.push(se(121)),16&e&&t.push(se(122)),256&e&&t.push(se(126)),32&e&&t.push(se(124)),16384&e&&t.push(se(161)),64&e&&t.push(se(146)),128&e&&t.push(se(127)),512&e&&t.push(se(132)),32768&e&&t.push(se(101)),65536&e&&t.push(se(145)),t.length?t:void 0}function le(e,t){var r=w(163);return r.left=e,r.right=bi(t),r.transformFlags|=_(r.left)|u(r.right),r}function ue(e){var t=w(164);return t.expression=g().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=132096|_(t.expression),t}function _e(e,t,r,n){var i=O(165,e,t);return i.constraint=r,i.default=n,i.transformFlags=1,i}function de(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.constraint!==n||e.default!==i?f(_e(t,r,n,i),e):e}function pe(t,r,n,i,a,o){var s=U(166,t,n,a,o&&g().parenthesizeExpressionForDisallowedComma(o));return s.dotDotDotToken=r,s.questionToken=i,e.isThisIdentifier(s.name)?s.transformFlags=1:(s.transformFlags|=_(s.dotDotDotToken)|_(s.questionToken),i&&(s.transformFlags|=1),16476&e.modifiersToFlags(s.modifiers)&&(s.transformFlags|=8192),(o||r)&&(s.transformFlags|=1024)),s}function fe(e,t,r,n,i,a,o){return e.modifiers!==t||e.dotDotDotToken!==r||e.name!==n||e.questionToken!==i||e.type!==a||e.initializer!==o?f(pe(t,r,n,i,a,o),e):e}function ge(e){var t=w(167);return t.expression=g().parenthesizeLeftSideOfAccess(e,!1),t.transformFlags|=33562625|_(t.expression),t}function me(e,t,r,n){var i=O(168,e,t);return i.type=n,i.questionToken=r,i.transformFlags=1,i.initializer=void 0,i}function ye(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.type!==i?((a=me(t,r,n,i))!==(o=e)&&(a.initializer=o.initializer),f(a,o)):e;var a,o;}function ve(t,r,n,i,a){var o=U(169,t,r,i,a);return o.questionToken=n&&e.isQuestionToken(n)?n:void 0,o.exclamationToken=n&&e.isExclamationToken(n)?n:void 0,o.transformFlags|=_(o.questionToken)|_(o.exclamationToken)|16777216,(e.isComputedPropertyName(o.name)||e.hasStaticModifier(o)&&o.initializer)&&(o.transformFlags|=8192),(n||2&e.modifiersToFlags(o.modifiers))&&(o.transformFlags|=1),o}function he(t,r,n,i,a,o){return t.modifiers!==r||t.name!==n||t.questionToken!==(void 0!==i&&e.isQuestionToken(i)?i:void 0)||t.exclamationToken!==(void 0!==i&&e.isExclamationToken(i)?i:void 0)||t.type!==a||t.initializer!==o?f(ve(r,n,i,a,o),t):t}function be(e,t,r,n,i,a){var o=L(170,e,t,n,i,a);return o.questionToken=r,o.transformFlags=1,o}function xe(e,t,r,n,i,a,o){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o?R(be(t,r,n,i,a,o),e):e}function De(t,r,n,i,a,o,s,c){var l=B(171,t,n,a,o,s,c);return l.asteriskToken=r,l.questionToken=i,l.transformFlags|=_(l.asteriskToken)|_(l.questionToken)|1024,i&&(l.transformFlags|=1),512&e.modifiersToFlags(l.modifiers)?l.transformFlags|=r?128:256:r&&(l.transformFlags|=2048),l.exclamationToken=void 0,l}function Se(e,t,r,n,i,a,o,s,c){return e.modifiers!==t||e.asteriskToken!==r||e.name!==n||e.questionToken!==i||e.typeParameters!==a||e.parameters!==o||e.type!==s||e.body!==c?((l=De(t,r,n,i,a,o,s,c))!==(u=e)&&(l.exclamationToken=u.exclamationToken),f(l,u)):e;var l,u;}function Te(e){var t=M(172,void 0,void 0,void 0);return t.body=e,t.transformFlags=16777216|_(e),t.illegalDecorators=void 0,t.modifiers=void 0,t}function Ce(e,t,r){var n=B(173,e,void 0,void 0,t,void 0,r);return n.transformFlags|=1024,n.illegalDecorators=void 0,n.typeParameters=void 0,n.type=void 0,n}function Ee(e,t,r,n){return e.modifiers!==t||e.parameters!==r||e.body!==n?((i=Ce(t,r,n))!==(a=e)&&(i.illegalDecorators=a.illegalDecorators,i.typeParameters=a.typeParameters,i.type=a.type),R(i,a)):e;var i,a;}function ke(e,t,r,n,i){var a=B(174,e,t,void 0,r,n,i);return a.typeParameters=void 0,a}function Ne(e,t,r,n,i,a){return e.modifiers!==t||e.name!==r||e.parameters!==n||e.type!==i||e.body!==a?((o=ke(t,r,n,i,a))!==(s=e)&&(o.typeParameters=s.typeParameters),R(o,s)):e;var o,s;}function Ae(e,t,r,n){var i=B(175,e,t,void 0,r,void 0,n);return i.typeParameters=void 0,i.type=void 0,i}function Fe(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.parameters!==n||e.body!==i?((a=Ae(t,r,n,i))!==(o=e)&&(a.typeParameters=o.typeParameters,a.type=o.type),R(a,o)):e;var a,o;}function Pe(e,t,r){var n=L(176,void 0,void 0,e,t,r);return n.transformFlags=1,n}function we(e,t,r){var n=L(177,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Ie(e,t,r){var n=L(178,e,void 0,void 0,t,r);return n.transformFlags=1,n}function Oe(e,t,r,n){return e.parameters!==r||e.type!==n||e.modifiers!==t?R(Ie(t,r,n),e):e}function Me(e,t){var r=w(201);return r.type=e,r.literal=t,r.transformFlags=1,r}function Le(e,t,r){var n=w(179);return n.assertsModifier=e,n.parameterName=bi(t),n.type=r,n.transformFlags=1,n}function Re(e,t){var r=w(180);return r.typeName=bi(e),r.typeArguments=t&&g().parenthesizeTypeArguments(P(t)),r.transformFlags=1,r}function Be(e,t,r){var n=L(181,void 0,void 0,e,t,r);return n.transformFlags=1,n.modifiers=void 0,n}function je(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 4===t.length?Je.apply(void 0,t):3===t.length?ze.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")}function Je(e,t,r,n){var i=L(182,e,void 0,t,r,n);return i.transformFlags=1,i}function ze(e,t,r){return Je(void 0,e,t,r)}function Ue(e,t,r,n,i){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i?R(je(t,r,n,i),e):e}function Ke(e,t,r,n){return Ue(e,e.modifiers,t,r,n)}function Ve(e,t){var r=w(183);return r.exprName=e,r.typeArguments=t&&g().parenthesizeTypeArguments(t),r.transformFlags=1,r}function qe(e){var t=w(184);return t.members=P(e),t.transformFlags=1,t}function We(e){var t=w(185);return t.elementType=g().parenthesizeNonArrayTypeOfPostfixType(e),t.transformFlags=1,t}function He(e){var t=w(186);return t.elements=P(g().parenthesizeElementTypesOfTupleType(e)),t.transformFlags=1,t}function Ge(e,t,r,n){var i=w(199);return i.dotDotDotToken=e,i.name=t,i.questionToken=r,i.type=n,i.transformFlags=1,i}function Qe(e){var t=w(187);return t.type=g().parenthesizeTypeOfOptionalType(e),t.transformFlags=1,t}function Xe(e){var t=w(188);return t.type=e,t.transformFlags=1,t}function Ye(e,t,r){var n=w(e);return n.types=F.createNodeArray(r(t)),n.transformFlags=1,n}function Ze(e,t,r){return e.types!==t?f(Ye(e.kind,t,r),e):e}function $e(e,t,r,n){var i=w(191);return i.checkType=g().parenthesizeCheckTypeOfConditionalType(e),i.extendsType=g().parenthesizeExtendsTypeOfConditionalType(t),i.trueType=r,i.falseType=n,i.transformFlags=1,i}function et(e){var t=w(192);return t.typeParameter=e,t.transformFlags=1,t}function tt(e,t){var r=w(200);return r.head=e,r.templateSpans=P(t),r.transformFlags=1,r}function rt(e,t,r,n,i){void 0===i&&(i=!1);var a=w(202);return a.argument=e,a.assertions=t,a.qualifier=r,a.typeArguments=n&&g().parenthesizeTypeArguments(n),a.isTypeOf=i,a.transformFlags=1,a}function nt(e){var t=w(193);return t.type=e,t.transformFlags=1,t}function it(e,t){var r=w(195);return r.operator=e,r.type=146===e?g().parenthesizeOperandOfReadonlyTypeOperator(t):g().parenthesizeOperandOfTypeOperator(t),r.transformFlags=1,r}function at(e,t){var r=w(196);return r.objectType=g().parenthesizeNonArrayTypeOfPostfixType(e),r.indexType=t,r.transformFlags=1,r}function ot(e,t,r,n,i,a){var o=w(197);return o.readonlyToken=e,o.typeParameter=t,o.nameType=r,o.questionToken=n,o.type=i,o.members=a&&P(a),o.transformFlags=1,o}function st(e){var t=w(198);return t.literal=e,t.transformFlags=1,t}function ct(e){var t=w(203);return t.elements=P(e),t.transformFlags|=525312|d(t.elements),32768&t.transformFlags&&(t.transformFlags|=65664),t}function lt(e){var t=w(204);return t.elements=P(e),t.transformFlags|=525312|d(t.elements),t}function ut(t,r,n,i){var a=z(205,void 0,n,i&&g().parenthesizeExpressionForDisallowedComma(i));return a.propertyName=bi(r),a.dotDotDotToken=t,a.transformFlags|=1024|_(a.dotDotDotToken),a.propertyName&&(a.transformFlags|=e.isIdentifier(a.propertyName)?u(a.propertyName):_(a.propertyName)),t&&(a.transformFlags|=32768),a}function _t(e){return w(e)}function dt(t,r){var n=_t(206),i=t&&e.lastOrUndefined(t),a=P(t,!(!i||!e.isOmittedExpression(i))||void 0);return n.elements=g().parenthesizeExpressionsOfCommaDelimitedList(a),n.multiLine=r,n.transformFlags|=d(n.elements),n}function pt(e,t){var r=_t(207);return r.properties=P(e),r.multiLine=t,r.transformFlags|=d(r.properties),r}function ft(t,r){var n=_t(208);return n.expression=g().parenthesizeLeftSideOfAccess(t,!1),n.name=bi(r),n.transformFlags=_(n.expression)|(e.isIdentifier(n.name)?u(n.name):536870912|_(n.name)),e.isSuperKeyword(t)&&(n.transformFlags|=384),n}function gt(t,r,n){var i=_t(208);return i.flags|=32,i.expression=g().parenthesizeLeftSideOfAccess(t,!0),i.questionDotToken=r,i.name=bi(n),i.transformFlags|=32|_(i.expression)|_(i.questionDotToken)|(e.isIdentifier(i.name)?u(i.name):536870912|_(i.name)),i}function mt(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),t.expression!==r||t.questionDotToken!==n||t.name!==i?f(gt(r,n,i),t):t}function yt(t,r){var n=_t(209);return n.expression=g().parenthesizeLeftSideOfAccess(t,!1),n.argumentExpression=xi(r),n.transformFlags|=_(n.expression)|_(n.argumentExpression),e.isSuperKeyword(t)&&(n.transformFlags|=384),n}function vt(e,t,r){var n=_t(209);return n.flags|=32,n.expression=g().parenthesizeLeftSideOfAccess(e,!0),n.questionDotToken=t,n.argumentExpression=xi(r),n.transformFlags|=_(n.expression)|_(n.questionDotToken)|_(n.argumentExpression)|32,n}function ht(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),t.expression!==r||t.questionDotToken!==n||t.argumentExpression!==i?f(vt(r,n,i),t):t}function bt(t,r,n){var i=_t(210);return i.expression=g().parenthesizeLeftSideOfAccess(t,!1),i.typeArguments=hi(r),i.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(P(n)),i.transformFlags|=_(i.expression)|d(i.typeArguments)|d(i.arguments),i.typeArguments&&(i.transformFlags|=1),e.isImportKeyword(i.expression)?i.transformFlags|=8388608:e.isSuperProperty(i.expression)&&(i.transformFlags|=16384),i}function xt(t,r,n,i){var a=_t(210);return a.flags|=32,a.expression=g().parenthesizeLeftSideOfAccess(t,!0),a.questionDotToken=r,a.typeArguments=hi(n),a.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(P(i)),a.transformFlags|=_(a.expression)|_(a.questionDotToken)|d(a.typeArguments)|d(a.arguments)|32,a.typeArguments&&(a.transformFlags|=1),e.isSuperProperty(a.expression)&&(a.transformFlags|=16384),a}function Dt(t,r,n,i,a){return e.Debug.assert(!!(32&t.flags),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),t.expression!==r||t.questionDotToken!==n||t.typeArguments!==i||t.arguments!==a?f(xt(r,n,i,a),t):t}function St(e,t,r){var n=_t(211);return n.expression=g().parenthesizeExpressionOfNew(e),n.typeArguments=hi(t),n.arguments=r?g().parenthesizeExpressionsOfCommaDelimitedList(r):void 0,n.transformFlags|=_(n.expression)|d(n.typeArguments)|d(n.arguments)|32,n.typeArguments&&(n.transformFlags|=1),n}function Tt(t,r,n){var i=_t(212);return i.tag=g().parenthesizeLeftSideOfAccess(t,!1),i.typeArguments=hi(r),i.template=n,i.transformFlags|=_(i.tag)|d(i.typeArguments)|_(i.template)|1024,i.typeArguments&&(i.transformFlags|=1),e.hasInvalidEscape(i.template)&&(i.transformFlags|=128),i}function Ct(e,t){var r=_t(213);return r.expression=g().parenthesizeOperandOfPrefixUnary(t),r.type=e,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Et(e,t,r){return e.type!==t||e.expression!==r?f(Ct(t,r),e):e}function kt(e){var t=_t(214);return t.expression=e,t.transformFlags=_(t.expression),t}function Nt(e,t){return e.expression!==t?f(kt(t),e):e}function At(t,r,n,i,a,o,s){var c=B(215,t,n,i,a,o,s);return c.asteriskToken=r,c.transformFlags|=_(c.asteriskToken),c.typeParameters&&(c.transformFlags|=1),512&e.modifiersToFlags(c.modifiers)?c.asteriskToken?c.transformFlags|=128:c.transformFlags|=256:c.asteriskToken&&(c.transformFlags|=2048),c}function Ft(e,t,r,n,i,a,o,s){return e.name!==n||e.modifiers!==t||e.asteriskToken!==r||e.typeParameters!==i||e.parameters!==a||e.type!==o||e.body!==s?R(At(t,r,n,i,a,o,s),e):e}function Pt(t,r,n,i,a,o){var s=B(216,t,void 0,r,n,i,g().parenthesizeConciseBodyOfArrowFunction(o));return s.equalsGreaterThanToken=null!=a?a:ne(38),s.transformFlags|=1024|_(s.equalsGreaterThanToken),512&e.modifiersToFlags(s.modifiers)&&(s.transformFlags|=16640),s}function wt(e,t,r,n,i,a,o){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i||e.equalsGreaterThanToken!==a||e.body!==o?R(Pt(t,r,n,i,a,o),e):e}function It(e){var t=_t(217);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function Ot(e){var t=_t(218);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function Mt(e){var t=_t(219);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function Lt(e){var t=_t(220);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=2097536|_(t.expression),t}function Rt(t,r){var n=_t(221);return n.operator=t,n.operand=g().parenthesizeOperandOfPrefixUnary(r),n.transformFlags|=_(n.operand),45!==t&&46!==t||!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=268435456),n}function Bt(t,r){var n=_t(222);return n.operator=r,n.operand=g().parenthesizeOperandOfPostfixUnary(t),n.transformFlags|=_(n.operand),!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=268435456),n}function jt(t,r,n){var i,a=_t(223),o="number"==typeof(i=r)?ne(i):i,s=o.kind;return a.left=g().parenthesizeLeftSideOfBinary(s,t),a.operatorToken=o,a.right=g().parenthesizeRightSideOfBinary(s,a.left,n),a.transformFlags|=_(a.left)|_(a.operatorToken)|_(a.right),60===s?a.transformFlags|=32:63===s?e.isObjectLiteralExpression(a.left)?a.transformFlags|=5248|Jt(a.left):e.isArrayLiteralExpression(a.left)&&(a.transformFlags|=5120|Jt(a.left)):42===s||67===s?a.transformFlags|=512:e.isLogicalOrCoalescingAssignmentOperator(s)&&(a.transformFlags|=16),101===s&&e.isPrivateIdentifier(a.left)&&(a.transformFlags|=536870912),a}function Jt(t){if(65536&t.transformFlags)return 65536;if(128&t.transformFlags)for(var r=0,n=e.getElementsOfBindingOrAssignmentPattern(t);r<n.length;r++){var i=n[r],a=e.getTargetOfBindingOrAssignmentElement(i);if(a&&e.isAssignmentPattern(a)){if(65536&a.transformFlags)return 65536;if(128&a.transformFlags){var o=Jt(a);if(o)return o}}}return 0}function zt(e,t,r,n,i){var a=_t(224);return a.condition=g().parenthesizeConditionOfConditionalExpression(e),a.questionToken=null!=t?t:ne(57),a.whenTrue=g().parenthesizeBranchOfConditionalExpression(r),a.colonToken=null!=n?n:ne(58),a.whenFalse=g().parenthesizeBranchOfConditionalExpression(i),a.transformFlags|=_(a.condition)|_(a.questionToken)|_(a.whenTrue)|_(a.colonToken)|_(a.whenFalse),a}function Ut(e,t){var r=_t(225);return r.head=e,r.templateSpans=P(t),r.transformFlags|=_(r.head)|d(r.templateSpans)|1024,r}function Kt(r,n,i,a){void 0===a&&(a=0),e.Debug.assert(!(-2049&a),"Unsupported template flags.");var o=void 0;if(void 0!==i&&i!==n&&(o=function(r,n){switch(t||(t=e.createScanner(99,!1,0)),r){case 14:t.setText("`"+n+"`");break;case 15:t.setText("`"+n+"${");break;case 16:t.setText("}"+n+"${");break;case 17:t.setText("}"+n+"`");}var i,a=t.scan();if(19===a&&(a=t.reScanTemplateToken(!1)),t.isUnterminated())return t.setText(void 0),l;switch(a){case 14:case 15:case 16:case 17:i=t.getTokenValue();}return void 0===i||1!==t.scan()?(t.setText(void 0),l):(t.setText(void 0),i)}(r,i),"object"==typeof o))return e.Debug.fail("Invalid raw text");if(void 0===n){if(void 0===o)return e.Debug.fail("Arguments 'text' and 'rawText' may not both be undefined.");n=o;}else void 0!==o&&e.Debug.assert(n===o,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return Vt(r,n,i,a)}function Vt(e,t,r,n){var i=re(e);return i.text=t,i.rawText=r,i.templateFlags=2048&n,i.transformFlags|=1024,i.templateFlags&&(i.transformFlags|=128),i}function qt(t,r){e.Debug.assert(!t||!!r,"A `YieldExpression` with an asteriskToken must have an expression.");var n=_t(226);return n.expression=r&&g().parenthesizeExpressionForDisallowedComma(r),n.asteriskToken=t,n.transformFlags|=_(n.expression)|_(n.asteriskToken)|1049728,n}function Wt(e){var t=_t(227);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=33792|_(t.expression),t}function Ht(e,t,r,n,i){var a=J(228,e,t,r,n,i);return a.transformFlags|=1024,a}function Gt(e,t,r,n,i,a){return e.modifiers!==t||e.name!==r||e.typeParameters!==n||e.heritageClauses!==i||e.members!==a?f(Ht(t,r,n,i,a),e):e}function Qt(e,t){var r=w(230);return r.expression=g().parenthesizeLeftSideOfAccess(e,!1),r.typeArguments=t&&g().parenthesizeTypeArguments(t),r.transformFlags|=_(r.expression)|d(r.typeArguments)|1024,r}function Xt(e,t){var r=_t(231);return r.expression=e,r.type=t,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Yt(e,t,r){return e.expression!==t||e.type!==r?f(Xt(t,r),e):e}function Zt(e){var t=_t(232);return t.expression=g().parenthesizeLeftSideOfAccess(e,!1),t.transformFlags|=1|_(t.expression),t}function $t(t,r){return e.isNonNullChain(t)?nr(t,r):t.expression!==r?f(Zt(r),t):t}function er(e,t){var r=_t(235);return r.expression=e,r.type=t,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function tr(e,t,r){return e.expression!==t||e.type!==r?f(er(t,r),e):e}function rr(e){var t=_t(232);return t.flags|=32,t.expression=g().parenthesizeLeftSideOfAccess(e,!0),t.transformFlags|=1|_(t.expression),t}function nr(t,r){return e.Debug.assert(!!(32&t.flags),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),t.expression!==r?f(rr(r),t):t}function ir(t,r){var n=_t(233);switch(n.keywordToken=t,n.name=r,n.transformFlags|=_(n.name),t){case 103:n.transformFlags|=1024;break;case 100:n.transformFlags|=4;break;default:return e.Debug.assertNever(t)}return n}function ar(e,t){var r=w(236);return r.expression=e,r.literal=t,r.transformFlags|=_(r.expression)|_(r.literal)|1024,r}function or(e,t){var r=w(238);return r.statements=P(e),r.multiLine=t,r.transformFlags|=d(r.statements),r}function sr(t,r){var n=I(240);return n.modifiers=hi(t),n.declarationList=e.isArray(r)?kr(r):r,n.transformFlags|=d(n.modifiers)|_(n.declarationList),2&e.modifiersToFlags(n.modifiers)&&(n.transformFlags=1),n}function cr(e,t,r){return e.modifiers!==t||e.declarationList!==r?f(sr(t,r),e):e}function lr(){return w(239)}function ur(e){var t=w(241);return t.expression=g().parenthesizeExpressionOfExpressionStatement(e),t.transformFlags|=_(t.expression),t}function _r(e,t,r){var n=w(242);return n.expression=e,n.thenStatement=Di(t),n.elseStatement=Di(r),n.transformFlags|=_(n.expression)|_(n.thenStatement)|_(n.elseStatement),n}function dr(e,t){var r=w(243);return r.statement=Di(e),r.expression=t,r.transformFlags|=_(r.statement)|_(r.expression),r}function pr(e,t){var r=w(244);return r.expression=e,r.statement=Di(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function fr(e,t,r,n){var i=w(245);return i.initializer=e,i.condition=t,i.incrementor=r,i.statement=Di(n),i.transformFlags|=_(i.initializer)|_(i.condition)|_(i.incrementor)|_(i.statement),i}function gr(e,t,r){var n=w(246);return n.initializer=e,n.expression=t,n.statement=Di(r),n.transformFlags|=_(n.initializer)|_(n.expression)|_(n.statement),n}function mr(e,t,r,n){var i=w(247);return i.awaitModifier=e,i.initializer=t,i.expression=g().parenthesizeExpressionForDisallowedComma(r),i.statement=Di(n),i.transformFlags|=_(i.awaitModifier)|_(i.initializer)|_(i.expression)|_(i.statement)|1024,e&&(i.transformFlags|=128),i}function yr(e){var t=w(248);return t.label=bi(e),t.transformFlags|=4194304|_(t.label),t}function vr(e){var t=w(249);return t.label=bi(e),t.transformFlags|=4194304|_(t.label),t}function hr(e){var t=w(250);return t.expression=e,t.transformFlags|=4194432|_(t.expression),t}function br(e,t){var r=w(251);return r.expression=e,r.statement=Di(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function xr(e,t){var r=w(252);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.caseBlock=t,r.transformFlags|=_(r.expression)|_(r.caseBlock),r}function Dr(e,t){var r=w(253);return r.label=bi(e),r.statement=Di(t),r.transformFlags|=_(r.label)|_(r.statement),r}function Sr(e,t,r){return e.label!==t||e.statement!==r?f(Dr(t,r),e):e}function Tr(e){var t=w(254);return t.expression=e,t.transformFlags|=_(t.expression),t}function Cr(e,t,r){var n=w(255);return n.tryBlock=e,n.catchClause=t,n.finallyBlock=r,n.transformFlags|=_(n.tryBlock)|_(n.catchClause)|_(n.finallyBlock),n}function Er(e,t,r,n){var i=U(257,void 0,e,r,n&&g().parenthesizeExpressionForDisallowedComma(n));return i.exclamationToken=t,i.transformFlags|=_(i.exclamationToken),t&&(i.transformFlags|=1),i}function kr(e,t){void 0===t&&(t=0);var r=w(258);return r.flags|=3&t,r.declarations=P(e),r.transformFlags|=4194304|d(r.declarations),3&t&&(r.transformFlags|=263168),r}function Nr(t,r,n,i,a,o,s){var c=B(259,t,n,i,a,o,s);return c.asteriskToken=r,!c.body||2&e.modifiersToFlags(c.modifiers)?c.transformFlags=1:(c.transformFlags|=4194304|_(c.asteriskToken),512&e.modifiersToFlags(c.modifiers)?c.asteriskToken?c.transformFlags|=128:c.transformFlags|=256:c.asteriskToken&&(c.transformFlags|=2048)),c.illegalDecorators=void 0,c}function Ar(e,t,r,n,i,a,o,s){return e.modifiers!==t||e.asteriskToken!==r||e.name!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o||e.body!==s?((c=Nr(t,r,n,i,a,o,s))!==(l=e)&&(c.illegalDecorators=l.illegalDecorators),R(c,l)):e;var c,l;}function Fr(t,r,n,i,a){var o=J(260,t,r,n,i,a);return 2&e.modifiersToFlags(o.modifiers)?o.transformFlags=1:(o.transformFlags|=1024,8192&o.transformFlags&&(o.transformFlags|=1)),o}function Pr(e,t,r,n,i,a){return e.modifiers!==t||e.name!==r||e.typeParameters!==n||e.heritageClauses!==i||e.members!==a?f(Fr(t,r,n,i,a),e):e}function wr(e,t,r,n,i){var a=j(261,e,t,r,n);return a.members=P(i),a.transformFlags=1,a.illegalDecorators=void 0,a}function Ir(e,t,r,n,i,a){return e.modifiers!==t||e.name!==r||e.typeParameters!==n||e.heritageClauses!==i||e.members!==a?((o=wr(t,r,n,i,a))!==(s=e)&&(o.illegalDecorators=s.illegalDecorators),f(o,s)):e;var o,s;}function Or(e,t,r,n){var i=M(262,e,t,r);return i.type=n,i.transformFlags=1,i.illegalDecorators=void 0,i}function Mr(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.typeParameters!==n||e.type!==i?((a=Or(t,r,n,i))!==(o=e)&&(a.illegalDecorators=o.illegalDecorators),f(a,o)):e;var a,o;}function Lr(e,t,r){var n=O(263,e,t);return n.members=P(r),n.transformFlags|=1|d(n.members),n.transformFlags&=-67108865,n.illegalDecorators=void 0,n}function Rr(e,t,r,n){return e.modifiers!==t||e.name!==r||e.members!==n?((i=Lr(t,r,n))!==(a=e)&&(i.illegalDecorators=a.illegalDecorators),f(i,a)):e;var i,a;}function Br(t,r,n,i){void 0===i&&(i=0);var a=I(264);return a.modifiers=hi(t),a.flags|=1044&i,a.name=r,a.body=n,2&e.modifiersToFlags(a.modifiers)?a.transformFlags=1:a.transformFlags|=d(a.modifiers)|_(a.name)|_(a.body)|1,a.transformFlags&=-67108865,a.illegalDecorators=void 0,a}function jr(e,t,r,n){return e.modifiers!==t||e.name!==r||e.body!==n?((i=Br(t,r,n,e.flags))!==(a=e)&&(i.illegalDecorators=a.illegalDecorators),f(i,a)):e;var i,a;}function Jr(e){var t=w(265);return t.statements=P(e),t.transformFlags|=d(t.statements),t}function zr(e){var t=w(266);return t.clauses=P(e),t.transformFlags|=d(t.clauses),t}function Ur(e){var t=O(267,void 0,e);return t.transformFlags=1,t.illegalDecorators=void 0,t.modifiers=void 0,t}function Kr(t,r,n,i){var a=O(268,t,n);return a.isTypeOnly=r,a.moduleReference=i,a.transformFlags|=_(a.moduleReference),e.isExternalModuleReference(a.moduleReference)||(a.transformFlags|=1),a.transformFlags&=-67108865,a.illegalDecorators=void 0,a}function Vr(e,t,r,n,i){return e.modifiers!==t||e.isTypeOnly!==r||e.name!==n||e.moduleReference!==i?((a=Kr(t,r,n,i))!==(o=e)&&(a.illegalDecorators=o.illegalDecorators),f(a,o)):e;var a,o;}function qr(e,t,r,n){var i=I(269);return i.modifiers=hi(e),i.importClause=t,i.moduleSpecifier=r,i.assertClause=n,i.transformFlags|=_(i.importClause)|_(i.moduleSpecifier),i.transformFlags&=-67108865,i.illegalDecorators=void 0,i}function Wr(e,t,r,n,i){return e.modifiers!==t||e.importClause!==r||e.moduleSpecifier!==n||e.assertClause!==i?((a=qr(t,r,n,i))!==(o=e)&&(a.illegalDecorators=o.illegalDecorators),f(a,o)):e;var a,o;}function Hr(e,t,r){var n=w(270);return n.isTypeOnly=e,n.name=t,n.namedBindings=r,n.transformFlags|=_(n.name)|_(n.namedBindings),e&&(n.transformFlags|=1),n.transformFlags&=-67108865,n}function Gr(e,t){var r=w(296);return r.elements=P(e),r.multiLine=t,r.transformFlags|=4,r}function Qr(e,t){var r=w(297);return r.name=e,r.value=t,r.transformFlags|=4,r}function Xr(e,t){var r=w(298);return r.assertClause=e,r.multiLine=t,r}function Yr(e){var t=w(271);return t.name=e,t.transformFlags|=_(t.name),t.transformFlags&=-67108865,t}function Zr(e){var t=w(277);return t.name=e,t.transformFlags|=4|_(t.name),t.transformFlags&=-67108865,t}function $r(e){var t=w(272);return t.elements=P(e),t.transformFlags|=d(t.elements),t.transformFlags&=-67108865,t}function en(e,t,r){var n=w(273);return n.isTypeOnly=e,n.propertyName=t,n.name=r,n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-67108865,n}function tn(e,t,r){var n=I(274);return n.modifiers=hi(e),n.isExportEquals=t,n.expression=t?g().parenthesizeRightSideOfBinary(63,void 0,r):g().parenthesizeExpressionOfExportDefault(r),n.transformFlags|=d(n.modifiers)|_(n.expression),n.transformFlags&=-67108865,n.illegalDecorators=void 0,n}function rn(e,t,r){return e.modifiers!==t||e.expression!==r?((n=tn(t,e.isExportEquals,r))!==(i=e)&&(n.illegalDecorators=i.illegalDecorators),f(n,i)):e;var n,i;}function nn(e,t,r,n,i){var a=I(275);return a.modifiers=hi(e),a.isTypeOnly=t,a.exportClause=r,a.moduleSpecifier=n,a.assertClause=i,a.transformFlags|=d(a.modifiers)|_(a.exportClause)|_(a.moduleSpecifier),a.transformFlags&=-67108865,a.illegalDecorators=void 0,a}function an(e,t,r,n,i,a){return e.modifiers!==t||e.isTypeOnly!==r||e.exportClause!==n||e.moduleSpecifier!==i||e.assertClause!==a?((o=nn(t,r,n,i,a))!==(s=e)&&(o.illegalDecorators=s.illegalDecorators),f(o,s)):e;var o,s;}function on(e){var t=w(276);return t.elements=P(e),t.transformFlags|=d(t.elements),t.transformFlags&=-67108865,t}function sn(e,t,r){var n=w(278);return n.isTypeOnly=e,n.propertyName=bi(t),n.name=bi(r),n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-67108865,n}function cn(e){var t=w(280);return t.expression=e,t.transformFlags|=_(t.expression),t.transformFlags&=-67108865,t}function ln(e,t,r){void 0===r&&(r=!1);var n=un(e,r?t&&g().parenthesizeNonArrayTypeOfPostfixType(t):t);return n.postfix=r,n}function un(e,t){var r=w(e);return r.type=t,r}function _n(e,t){return L(320,void 0,void 0,void 0,e,t)}function dn(e,t){void 0===t&&(t=!1);var r=w(325);return r.jsDocPropertyTags=hi(e),r.isArrayType=t,r}function pn(e){var t=w(312);return t.type=e,t}function fn(e,t,r){var n=w(326);return n.typeParameters=hi(e),n.parameters=P(t),n.type=r,n}function gn(t){var r=c(t.kind);return t.tagName.escapedText===e.escapeLeadingUnderscores(r)?t.tagName:Y(r)}function mn(e,t,r){var n=w(e);return n.tagName=t,n.comment=r,n}function yn(e,t,r,n){var i=mn(347,null!=e?e:Y("template"),n);return i.constraint=t,i.typeParameters=P(r),i}function vn(t,r,n,i){var a=mn(348,null!=t?t:Y("typedef"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function hn(e,t,r,n,i,a){var o=mn(343,null!=e?e:Y("param"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function bn(e,t,r,n,i,a){var o=mn(350,null!=e?e:Y("prop"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function xn(t,r,n,i){var a=mn(341,null!=t?t:Y("callback"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function Dn(e,t,r){var n=mn(331,null!=e?e:Y("augments"),r);return n.class=t,n}function Sn(e,t,r){var n=mn(332,null!=e?e:Y("implements"),r);return n.class=t,n}function Tn(e,t,r){var n=mn(349,null!=e?e:Y("see"),r);return n.name=t,n}function Cn(e){var t=w(313);return t.name=e,t}function En(e,t){var r=w(314);return r.left=e,r.right=t,r.transformFlags|=_(r.left)|_(r.right),r}function kn(e,t){var r=w(327);return r.name=e,r.text=t,r}function Nn(e,t){var r=w(328);return r.name=e,r.text=t,r}function An(e,t){var r=w(329);return r.name=e,r.text=t,r}function Fn(e,t,r){return mn(e,null!=t?t:Y(c(e)),r)}function Pn(e,t,r,n){var i=mn(e,null!=t?t:Y(c(e)),n);return i.typeExpression=r,i}function wn(e,t){return mn(330,e,t)}function In(e){var t=w(324);return t.text=e,t}function On(e,t){var r=w(323);return r.comment=e,r.tags=hi(t),r}function Mn(e,t,r){var n=w(281);return n.openingElement=e,n.children=P(t),n.closingElement=r,n.transformFlags|=_(n.openingElement)|d(n.children)|_(n.closingElement)|2,n}function Ln(e,t,r){var n=w(282);return n.tagName=e,n.typeArguments=hi(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,n.typeArguments&&(n.transformFlags|=1),n}function Rn(e,t,r){var n=w(283);return n.tagName=e,n.typeArguments=hi(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,t&&(n.transformFlags|=1),n}function Bn(e){var t=w(284);return t.tagName=e,t.transformFlags|=2|_(t.tagName),t}function jn(e,t,r){var n=w(285);return n.openingFragment=e,n.children=P(t),n.closingFragment=r,n.transformFlags|=_(n.openingFragment)|d(n.children)|_(n.closingFragment)|2,n}function Jn(e,t){var r=w(11);return r.text=e,r.containsOnlyTriviaWhiteSpaces=!!t,r.transformFlags|=2,r}function zn(e,t){var r=w(288);return r.name=e,r.initializer=t,r.transformFlags|=_(r.name)|_(r.initializer)|2,r}function Un(e){var t=w(289);return t.properties=P(e),t.transformFlags|=2|d(t.properties),t}function Kn(e){var t=w(290);return t.expression=e,t.transformFlags|=2|_(t.expression),t}function Vn(e,t){var r=w(291);return r.dotDotDotToken=e,r.expression=t,r.transformFlags|=_(r.dotDotDotToken)|_(r.expression)|2,r}function qn(e,t){var r=w(292);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.statements=P(t),r.transformFlags|=_(r.expression)|d(r.statements),r}function Wn(e){var t=w(293);return t.statements=P(e),t.transformFlags=d(t.statements),t}function Hn(t,r){var n=w(294);switch(n.token=t,n.types=P(r),n.transformFlags|=d(n.types),t){case 94:n.transformFlags|=1024;break;case 117:n.transformFlags|=1;break;default:return e.Debug.assertNever(t)}return n}function Gn(t,r){var n=w(295);return ("string"==typeof t||t&&!e.isVariableDeclaration(t))&&(t=Er(t,void 0,void 0,void 0)),n.variableDeclaration=t,n.block=r,n.transformFlags|=_(n.variableDeclaration)|_(n.block),t||(n.transformFlags|=64),n}function Qn(e,t){var r=O(299,void 0,e);return r.initializer=g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer),r.illegalDecorators=void 0,r.modifiers=void 0,r.questionToken=void 0,r.exclamationToken=void 0,r}function Xn(e,t){var r=O(300,void 0,e);return r.objectAssignmentInitializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=1024|_(r.objectAssignmentInitializer),r.equalsToken=void 0,r.illegalDecorators=void 0,r.modifiers=void 0,r.questionToken=void 0,r.exclamationToken=void 0,r}function Yn(e){var t=w(301);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=65664|_(t.expression),t}function Zn(e,t){var r=w(302);return r.name=bi(e),r.initializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer)|1,r}function $n(t,r){void 0===r&&(r=e.emptyArray);var n=w(309);return n.prepends=r,n.sourceFiles=t,n}function ei(e,t){var r=w(e);return r.data=t,r}function ti(t,r){var n=w(353);return n.expression=t,n.original=r,n.transformFlags|=1|_(n.expression),e.setTextRange(n,r),n}function ri(e,t){return e.expression!==t?f(ti(t,e.original),e):e}function ni(t){if(e.nodeIsSynthesized(t)&&!e.isParseTreeNode(t)&&!t.original&&!t.emitNode&&!t.id){if(e.isCommaListExpression(t))return t.elements;if(e.isBinaryExpression(t)&&e.isCommaToken(t.operatorToken))return [t.left,t.right]}return t}function ii(t){var r=w(354);return r.elements=P(e.sameFlatMap(t,ni)),r.transformFlags|=d(r.elements),r}function ai(e,t){var r=w(357);return r.expression=e,r.thisArg=t,r.transformFlags|=_(r.expression)|_(r.thisArg),r}function oi(t){if(void 0===t)return t;var r=e.isSourceFile(t)?a.createBaseSourceFileNode(308):e.isIdentifier(t)?a.createBaseIdentifierNode(79):e.isPrivateIdentifier(t)?a.createBasePrivateIdentifierNode(80):e.isNodeKind(t.kind)?a.createBaseNode(t.kind):a.createBaseTokenNode(t.kind);for(var n in r.flags|=-9&t.flags,r.transformFlags=t.transformFlags,h(r,t),t)!e.hasProperty(r,n)&&e.hasProperty(t,n)&&(r[n]=t[n]);return r}function si(){return Mt(V("0"))}function ci(t,r,n){return e.isCallChain(t)?xt(gt(t,void 0,r),void 0,void 0,n):bt(ft(t,r),void 0,n)}function li(e,t,r){return ci(Y(e),t,r)}function ui(e,t,r){return !!r&&(e.push(Qn(t,r)),!0)}function _i(t,r){var n=e.skipParentheses(t);switch(n.kind){case 79:return r;case 108:case 8:case 9:case 10:return !1;case 206:return 0!==n.elements.length;case 207:return n.properties.length>0;default:return !0}}function di(t,r,n,i){void 0===i&&(i=0);var a=e.getNameOfDeclaration(t);if(a&&e.isIdentifier(a)&&!e.isGeneratedIdentifier(a)){var o=e.setParent(e.setTextRange(oi(a),a),a.parent);return i|=e.getEmitFlags(a),n||(i|=48),r||(i|=1536),i&&e.setEmitFlags(o,i),o}return $(t)}function pi(e,t,r){return di(e,t,r,8192)}function fi(t,r,n,i){var a=ft(t,e.nodeIsSynthesized(r)?r:oi(r));e.setTextRange(a,r);var o=0;return i||(o|=48),n||(o|=1536),o&&e.setEmitFlags(a,o),a}function gi(){return e.startOnNewLine(ur(H("use strict")))}function mi(t,r,n,i){void 0===n&&(n=0),e.Debug.assert(0===r.length,"Prologue directives should be at the first statement in the target statements array");for(var a,o=!1,s=t.length;n<s;){var c=t[n];if(!e.isPrologueDirective(c))break;a=c,e.isStringLiteral(a.expression)&&"use strict"===a.expression.text&&(o=!0),r.push(c),n++;}return i&&!o&&r.push(gi()),n}function yi(t,r,n,i,a){void 0===a&&(a=e.returnTrue);for(var o=t.length;void 0!==n&&n<o;){var s=t[n];if(!(1048576&e.getEmitFlags(s)&&a(s)))break;e.append(r,i?e.visitNode(s,i,e.isStatement):s),n++;}return n}function vi(e,t,r){for(var n=r;n<e.length&&t(e[n]);)n++;return n}function hi(e){return e?P(e):void 0}function bi(e){return "string"==typeof e?Y(e):e}function xi(e){return "string"==typeof e?H(e):"number"==typeof e?V(e):"boolean"==typeof e?e?ae():oe():e}function Di(t){return t&&e.isNotEmittedStatement(t)?e.setTextRange(h(lr(),t),t):t}}function o(t,r){return t!==r&&e.setTextRange(t,r),t}function s(t,r){return t!==r&&(h(t,r),e.setTextRange(t,r)),t}function c(t){switch(t){case 346:return "type";case 344:return "returns";case 345:return "this";case 342:return "enum";case 333:return "author";case 335:return "class";case 336:return "public";case 337:return "private";case 338:return "protected";case 339:return "readonly";case 340:return "override";case 347:return "template";case 348:return "typedef";case 343:return "param";case 350:return "prop";case 341:return "callback";case 331:return "augments";case 332:return "implements";default:return e.Debug.fail("Unsupported kind: ".concat(e.Debug.formatSyntaxKind(t)))}}(r=e.NodeFactoryFlags||(e.NodeFactoryFlags={}))[r.None=0]="None",r[r.NoParenthesizerRules=1]="NoParenthesizerRules",r[r.NoNodeConverters=2]="NoNodeConverters",r[r.NoIndentationOnFreshPropertyAccess=4]="NoIndentationOnFreshPropertyAccess",r[r.NoOriginalNode=8]="NoOriginalNode",e.createNodeFactory=a;var l={};function u(e){return -67108865&_(e)}function _(t){if(!t)return 0;var r=t.transformFlags&~f(t.kind);return e.isNamedDeclaration(t)&&e.isPropertyName(t.name)?r|134234112&t.name.transformFlags:r}function d(e){return e?e.transformFlags:0}function p(e){for(var t=0,r=0,n=e;r<n.length;r++)t|=_(n[r]);e.transformFlags=t;}function f(e){if(e>=179&&e<=202)return -2;switch(e){case 210:case 211:case 206:case 203:case 204:return -2147450880;case 264:return -1941676032;case 166:case 213:case 235:case 231:case 353:case 214:case 106:case 208:case 209:default:return -2147483648;case 216:return -2072174592;case 215:case 259:return -1937940480;case 258:return -2146893824;case 260:case 228:return -2147344384;case 173:return -1937948672;case 169:return -2013249536;case 171:case 174:case 175:return -2005057536;case 131:case 148:case 160:case 144:case 152:case 149:case 134:case 153:case 114:case 165:case 168:case 170:case 176:case 177:case 178:case 261:case 262:return -2;case 207:return -2147278848;case 295:return -2147418112}}e.getTransformFlagsSubtreeExclusions=f;var g=e.createBaseNodeFactory();function m(e){return e.flags|=8,e}var y,v={createBaseSourceFileNode:function(e){return m(g.createBaseSourceFileNode(e))},createBaseIdentifierNode:function(e){return m(g.createBaseIdentifierNode(e))},createBasePrivateIdentifierNode:function(e){return m(g.createBasePrivateIdentifierNode(e))},createBaseTokenNode:function(e){return m(g.createBaseTokenNode(e))},createBaseNode:function(e){return m(g.createBaseNode(e))}};function h(t,r){if(t.original=r,r){var n=r.emitNode;n&&(t.emitNode=function(t,r){var n=t.flags,i=t.leadingComments,a=t.trailingComments,o=t.commentRange,s=t.sourceMapRange,c=t.tokenSourceMapRanges,l=t.constantValue,u=t.helpers,_=t.startsOnNewLine,d=t.snippetElement;if(r||(r={}),i&&(r.leadingComments=e.addRange(i.slice(),r.leadingComments)),a&&(r.trailingComments=e.addRange(a.slice(),r.trailingComments)),n&&(r.flags=-268435457&n),o&&(r.commentRange=o),s&&(r.sourceMapRange=s),c&&(r.tokenSourceMapRanges=function(e,t){for(var r in t||(t=[]),e)t[r]=e[r];return t}(c,r.tokenSourceMapRanges)),void 0!==l&&(r.constantValue=l),u)for(var p=0,f=u;p<f.length;p++){var g=f[p];r.helpers=e.appendIfUnique(r.helpers,g);}return void 0!==_&&(r.startsOnNewLine=_),void 0!==d&&(r.snippetElement=d),r}(n,t.emitNode));}return t}e.factory=a(4,v),e.createUnparsedSourceFile=function(t,r,n){var i,a,o,s,c,l,u,_,d,p;e.isString(t)?(o="",s=t,c=t.length,l=r,u=n):(e.Debug.assert("js"===r||"dts"===r),o=("js"===r?t.javascriptPath:t.declarationPath)||"",l="js"===r?t.javascriptMapPath:t.declarationMapPath,_=function(){return "js"===r?t.javascriptText:t.declarationText},d=function(){return "js"===r?t.javascriptMapText:t.declarationMapText},c=function(){return _().length},t.buildInfo&&t.buildInfo.bundle&&(e.Debug.assert(void 0===n||"boolean"==typeof n),i=n,a="js"===r?t.buildInfo.bundle.js:t.buildInfo.bundle.dts,p=t.oldFileOfCurrentEmit));var f=p?function(t){for(var r,n,i=0,a=t.sections;i<a.length;i++){var o=a[i];switch(o.kind){case"internal":case"text":r=e.append(r,e.setTextRange(e.factory.createUnparsedTextLike(o.data,"internal"===o.kind),o));break;case"no-default-lib":case"reference":case"type":case"type-import":case"type-require":case"lib":n=e.append(n,e.setTextRange(e.factory.createUnparsedSyntheticReference(o),o));break;case"prologue":case"emitHelpers":case"prepend":break;default:e.Debug.assertNever(o);}}var s=e.factory.createUnparsedSource(e.emptyArray,n,null!=r?r:e.emptyArray);return e.setEachParent(n,s),e.setEachParent(r,s),s.helpers=e.map(t.sources&&t.sources.helpers,(function(t){return e.getAllUnscopedEmitHelpers().get(t)})),s}(e.Debug.checkDefined(a)):function(t,r,n){for(var i,a,o,s,c,l,u,_,d=0,p=t?t.sections:e.emptyArray;d<p.length;d++){var f=p[d];switch(f.kind){case"prologue":i=e.append(i,e.setTextRange(e.factory.createUnparsedPrologue(f.data),f));break;case"emitHelpers":a=e.append(a,e.getAllUnscopedEmitHelpers().get(f.data));break;case"no-default-lib":_=!0;break;case"reference":o=e.append(o,{pos:-1,end:-1,fileName:f.data});break;case"type":s=e.append(s,{pos:-1,end:-1,fileName:f.data});break;case"type-import":s=e.append(s,{pos:-1,end:-1,fileName:f.data,resolutionMode:e.ModuleKind.ESNext});break;case"type-require":s=e.append(s,{pos:-1,end:-1,fileName:f.data,resolutionMode:e.ModuleKind.CommonJS});break;case"lib":c=e.append(c,{pos:-1,end:-1,fileName:f.data});break;case"prepend":for(var g=void 0,m=0,y=f.texts;m<y.length;m++){var v=y[m];r&&"internal"===v.kind||(g=e.append(g,e.setTextRange(e.factory.createUnparsedTextLike(v.data,"internal"===v.kind),v)));}l=e.addRange(l,g),u=e.append(u,e.factory.createUnparsedPrepend(f.data,null!=g?g:e.emptyArray));break;case"internal":if(r){u||(u=[]);break}case"text":u=e.append(u,e.setTextRange(e.factory.createUnparsedTextLike(f.data,"internal"===f.kind),f));break;default:e.Debug.assertNever(f);}}if(!u){var h=e.factory.createUnparsedTextLike(void 0,!1);e.setTextRangePosWidth(h,0,"function"==typeof n?n():n),u=[h];}var b=e.parseNodeFactory.createUnparsedSource(null!=i?i:e.emptyArray,void 0,u);return e.setEachParent(i,b),e.setEachParent(u,b),e.setEachParent(l,b),b.hasNoDefaultLib=_,b.helpers=a,b.referencedFiles=o||e.emptyArray,b.typeReferenceDirectives=s,b.libReferenceDirectives=c||e.emptyArray,b}(a,i,c);return f.fileName=o,f.sourceMapPath=l,f.oldFileOfCurrentEmit=p,_&&d?(Object.defineProperty(f,"text",{get:_}),Object.defineProperty(f,"sourceMapText",{get:d})):(e.Debug.assert(!p),f.text=null!=s?s:"",f.sourceMapText=u),f},e.createInputFiles=function(t,r,n,i,a,o,s,c,l,u,_){var d=e.parseNodeFactory.createInputFiles();if(e.isString(t))d.javascriptText=t,d.javascriptMapPath=n,d.javascriptMapText=i,d.declarationText=r,d.declarationMapPath=a,d.declarationMapText=o,d.javascriptPath=s,d.declarationPath=c,d.buildInfoPath=l,d.buildInfo=u,d.oldFileOfCurrentEmit=_;else {var p,f=new e.Map,g=function(e){if(void 0!==e){var r=f.get(e);return void 0===r&&(r=t(e),f.set(e,void 0!==r&&r)),!1!==r?r:void 0}},m=function(e){var t=g(e);return void 0!==t?t:"/* Input file ".concat(e," was missing */\r\n")};d.javascriptPath=r,d.javascriptMapPath=n,d.declarationPath=e.Debug.checkDefined(i),d.declarationMapPath=a,d.buildInfoPath=o,Object.defineProperties(d,{javascriptText:{get:function(){return m(r)}},javascriptMapText:{get:function(){return g(n)}},declarationText:{get:function(){return m(e.Debug.checkDefined(i))}},declarationMapText:{get:function(){return g(a)}},buildInfo:{get:function(){return function(t){var r;if(void 0===p){var n=g(o);p=void 0!==n&&null!==(r=e.getBuildInfo(d.buildInfoPath,n))&&void 0!==r&&r;}return p||void 0}()}}});}return d},e.createSourceMapSource=function(t,r,n){return new(y||(y=e.objectAllocator.getSourceMapSourceConstructor()))(t,r,n)},e.setOriginalNode=h;}(t),function(e){function t(r){var n;if(r.emitNode)e.Debug.assert(!(268435456&r.emitNode.flags),"Invalid attempt to mutate an immutable node.");else {if(e.isParseTreeNode(r)){if(308===r.kind)return r.emitNode={annotatedNodes:[r]};t(null!==(n=e.getSourceFileOfNode(e.getParseTreeNode(e.getSourceFileOfNode(r))))&&void 0!==n?n:e.Debug.fail("Could not determine parsed source file.")).annotatedNodes.push(r);}r.emitNode={};}return r.emitNode}function r(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.leadingComments}function n(e,r){return t(e).leadingComments=r,e}function i(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.trailingComments}function a(e,r){return t(e).trailingComments=r,e}e.getOrCreateEmitNode=t,e.disposeEmitNodes=function(t){var r,n,i=null===(n=null===(r=e.getSourceFileOfNode(e.getParseTreeNode(t)))||void 0===r?void 0:r.emitNode)||void 0===n?void 0:n.annotatedNodes;if(i)for(var a=0,o=i;a<o.length;a++)o[a].emitNode=void 0;},e.removeAllComments=function(e){var r=t(e);return r.flags|=1536,r.leadingComments=void 0,r.trailingComments=void 0,e},e.setEmitFlags=function(e,r){return t(e).flags=r,e},e.addEmitFlags=function(e,r){var n=t(e);return n.flags=n.flags|r,e},e.getSourceMapRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.sourceMapRange)&&void 0!==r?r:e},e.setSourceMapRange=function(e,r){return t(e).sourceMapRange=r,e},e.getTokenSourceMapRange=function(e,t){var r,n;return null===(n=null===(r=e.emitNode)||void 0===r?void 0:r.tokenSourceMapRanges)||void 0===n?void 0:n[t]},e.setTokenSourceMapRange=function(e,r,n){var i,a=t(e);return (null!==(i=a.tokenSourceMapRanges)&&void 0!==i?i:a.tokenSourceMapRanges=[])[r]=n,e},e.getStartsOnNewLine=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.startsOnNewLine},e.setStartsOnNewLine=function(e,r){return t(e).startsOnNewLine=r,e},e.getCommentRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.commentRange)&&void 0!==r?r:e},e.setCommentRange=function(e,r){return t(e).commentRange=r,e},e.getSyntheticLeadingComments=r,e.setSyntheticLeadingComments=n,e.addSyntheticLeadingComment=function(t,i,a,o){return n(t,e.append(r(t),{kind:i,pos:-1,end:-1,hasTrailingNewLine:o,text:a}))},e.getSyntheticTrailingComments=i,e.setSyntheticTrailingComments=a,e.addSyntheticTrailingComment=function(t,r,n,o){return a(t,e.append(i(t),{kind:r,pos:-1,end:-1,hasTrailingNewLine:o,text:n}))},e.moveSyntheticComments=function(e,o){n(e,r(o)),a(e,i(o));var s=t(o);return s.leadingComments=void 0,s.trailingComments=void 0,e},e.getConstantValue=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.constantValue},e.setConstantValue=function(e,r){return t(e).constantValue=r,e},e.addEmitHelper=function(r,n){var i=t(r);return i.helpers=e.append(i.helpers,n),r},e.addEmitHelpers=function(r,n){if(e.some(n))for(var i=t(r),a=0,o=n;a<o.length;a++){var s=o[a];i.helpers=e.appendIfUnique(i.helpers,s);}return r},e.removeEmitHelper=function(t,r){var n,i=null===(n=t.emitNode)||void 0===n?void 0:n.helpers;return !!i&&e.orderedRemoveItem(i,r)},e.getEmitHelpers=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.helpers},e.moveEmitHelpers=function(r,n,i){var a=r.emitNode,o=a&&a.helpers;if(e.some(o)){for(var s=t(n),c=0,l=0;l<o.length;l++){var u=o[l];i(u)?(c++,s.helpers=e.appendIfUnique(s.helpers,u)):c>0&&(o[l-c]=u);}c>0&&(o.length-=c);}},e.getSnippetElement=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.snippetElement},e.setSnippetElement=function(e,r){return t(e).snippetElement=r,e},e.ignoreSourceNewlines=function(e){return t(e).flags|=134217728,e},e.setTypeNode=function(e,r){return t(e).typeNode=r,e},e.getTypeNode=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.typeNode};}(t),function(e){function t(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(r){for(var n="",i=0;i<t.length;i++)n+=e[i],n+=r(t[i]);return n+e[e.length-1]}}var r;e.createEmitHelperFactory=function(t){var r=t.factory,i=e.memoize((function(){return e.setEmitFlags(r.createTrue(),268435456)})),a=e.memoize((function(){return e.setEmitFlags(r.createFalse(),268435456)}));return {getUnscopedHelperName:o,createDecorateHelper:function(n,i,a,s){t.requestEmitHelper(e.decorateHelper);var c=[];return c.push(r.createArrayLiteralExpression(n,!0)),c.push(i),a&&(c.push(a),s&&c.push(s)),r.createCallExpression(o("__decorate"),void 0,c)},createMetadataHelper:function(n,i){return t.requestEmitHelper(e.metadataHelper),r.createCallExpression(o("__metadata"),void 0,[r.createStringLiteral(n),i])},createParamHelper:function(n,i,a){return t.requestEmitHelper(e.paramHelper),e.setTextRange(r.createCallExpression(o("__param"),void 0,[r.createNumericLiteral(i+""),n]),a)},createAssignHelper:function(n){return e.getEmitScriptTarget(t.getCompilerOptions())>=2?r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Object"),"assign"),void 0,n):(t.requestEmitHelper(e.assignHelper),r.createCallExpression(o("__assign"),void 0,n))},createAwaitHelper:function(n){return t.requestEmitHelper(e.awaitHelper),r.createCallExpression(o("__await"),void 0,[n])},createAsyncGeneratorHelper:function(n,i){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncGeneratorHelper),(n.emitNode||(n.emitNode={})).flags|=786432,r.createCallExpression(o("__asyncGenerator"),void 0,[i?r.createThis():r.createVoidZero(),r.createIdentifier("arguments"),n])},createAsyncDelegatorHelper:function(n){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncDelegator),r.createCallExpression(o("__asyncDelegator"),void 0,[n])},createAsyncValuesHelper:function(n){return t.requestEmitHelper(e.asyncValues),r.createCallExpression(o("__asyncValues"),void 0,[n])},createRestHelper:function(n,i,a,s){t.requestEmitHelper(e.restHelper);for(var c=[],l=0,u=0;u<i.length-1;u++){var _=e.getPropertyNameOfBindingOrAssignmentElement(i[u]);if(_)if(e.isComputedPropertyName(_)){e.Debug.assertIsDefined(a,"Encountered computed property name but 'computedTempVariables' argument was not provided.");var d=a[l];l++,c.push(r.createConditionalExpression(r.createTypeCheck(d,"symbol"),void 0,d,void 0,r.createAdd(d,r.createStringLiteral(""))));}else c.push(r.createStringLiteralFromNode(_));}return r.createCallExpression(o("__rest"),void 0,[n,e.setTextRange(r.createArrayLiteralExpression(c),s)])},createAwaiterHelper:function(n,i,a,s){t.requestEmitHelper(e.awaiterHelper);var c=r.createFunctionExpression(void 0,r.createToken(41),void 0,void 0,[],void 0,s);return (c.emitNode||(c.emitNode={})).flags|=786432,r.createCallExpression(o("__awaiter"),void 0,[n?r.createThis():r.createVoidZero(),i?r.createIdentifier("arguments"):r.createVoidZero(),a?e.createExpressionFromEntityName(r,a):r.createVoidZero(),c])},createExtendsHelper:function(n){return t.requestEmitHelper(e.extendsHelper),r.createCallExpression(o("__extends"),void 0,[n,r.createUniqueName("_super",48)])},createTemplateObjectHelper:function(n,i){return t.requestEmitHelper(e.templateObjectHelper),r.createCallExpression(o("__makeTemplateObject"),void 0,[n,i])},createSpreadArrayHelper:function(n,s,c){return t.requestEmitHelper(e.spreadArrayHelper),r.createCallExpression(o("__spreadArray"),void 0,[n,s,c?i():a()])},createValuesHelper:function(n){return t.requestEmitHelper(e.valuesHelper),r.createCallExpression(o("__values"),void 0,[n])},createReadHelper:function(n,i){return t.requestEmitHelper(e.readHelper),r.createCallExpression(o("__read"),void 0,void 0!==i?[n,r.createNumericLiteral(i+"")]:[n])},createGeneratorHelper:function(n){return t.requestEmitHelper(e.generatorHelper),r.createCallExpression(o("__generator"),void 0,[r.createThis(),n])},createCreateBindingHelper:function(i,a,s){return t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__createBinding"),void 0,n$4([r.createIdentifier("exports"),i,a],s?[s]:[],!0))},createImportStarHelper:function(n){return t.requestEmitHelper(e.importStarHelper),r.createCallExpression(o("__importStar"),void 0,[n])},createImportStarCallbackHelper:function(){return t.requestEmitHelper(e.importStarHelper),o("__importStar")},createImportDefaultHelper:function(n){return t.requestEmitHelper(e.importDefaultHelper),r.createCallExpression(o("__importDefault"),void 0,[n])},createExportStarHelper:function(n,i){return void 0===i&&(i=r.createIdentifier("exports")),t.requestEmitHelper(e.exportStarHelper),t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__exportStar"),void 0,[n,i])},createClassPrivateFieldGetHelper:function(n,i,a,s){var c;return t.requestEmitHelper(e.classPrivateFieldGetHelper),c=s?[n,i,r.createStringLiteral(a),s]:[n,i,r.createStringLiteral(a)],r.createCallExpression(o("__classPrivateFieldGet"),void 0,c)},createClassPrivateFieldSetHelper:function(n,i,a,s,c){var l;return t.requestEmitHelper(e.classPrivateFieldSetHelper),l=c?[n,i,a,r.createStringLiteral(s),c]:[n,i,a,r.createStringLiteral(s)],r.createCallExpression(o("__classPrivateFieldSet"),void 0,l)},createClassPrivateFieldInHelper:function(n,i){return t.requestEmitHelper(e.classPrivateFieldInHelper),r.createCallExpression(o("__classPrivateFieldIn"),void 0,[n,i])}};function o(t){return e.setEmitFlags(r.createIdentifier(t),4098)}},e.compareEmitHelpers=function(t,r){return t===r||t.priority===r.priority?0:void 0===t.priority?1:void 0===r.priority?-1:e.compareValues(t.priority,r.priority)},e.helperString=t,e.decorateHelper={name:"typescript:decorate",importName:"__decorate",scoped:!1,priority:2,text:'\n      var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n      };'},e.metadataHelper={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n      var __metadata = (this && this.__metadata) || function (k, v) {\n        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n      };'},e.paramHelper={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n      var __param = (this && this.__param) || function (paramIndex, decorator) {\n        return function (target, key) { decorator(target, key, paramIndex); }\n      };"},e.assignHelper={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n      var __assign = (this && this.__assign) || function () {\n        __assign = Object.assign || function(t) {\n          for (var s, i = 1, n = arguments.length; i < n; i++) {\n            s = arguments[i];\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n              t[p] = s[p];\n          }\n          return t;\n        };\n        return __assign.apply(this, arguments);\n      };"},e.awaitHelper={name:"typescript:await",importName:"__await",scoped:!1,text:"\n      var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},e.asyncGeneratorHelper={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[e.awaitHelper],text:'\n      var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\n        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n        function fulfill(value) { resume("next", value); }\n        function reject(value) { resume("throw", value); }\n        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n      };'},e.asyncDelegator={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[e.awaitHelper],text:'\n      var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n        var i, p;\n        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n      };'},e.asyncValues={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n      var __asyncValues = (this && this.__asyncValues) || function (o) {\n        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n        var m = o[Symbol.asyncIterator], i;\n        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n      };'},e.restHelper={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n      var __rest = (this && this.__rest) || function (s, e) {\n        var t = {};\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n          t[p] = s[p];\n        if (s != null && typeof Object.getOwnPropertySymbols === "function")\n          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n              t[p[i]] = s[p[i]];\n          }\n        return t;\n      };'},e.awaiterHelper={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n      var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n        return new (P || (P = Promise))(function (resolve, reject) {\n          function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n          function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n          function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n          step((generator = generator.apply(thisArg, _arguments || [])).next());\n        });\n      };'},e.extendsHelper={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n      var __extends = (this && this.__extends) || (function () {\n        var extendStatics = function (d, b) {\n          extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n          return extendStatics(d, b);\n        };\n\n        return function (d, b) {\n          if (typeof b !== "function" && b !== null)\n            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n          extendStatics(d, b);\n          function __() { this.constructor = d; }\n          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n        };\n      })();'},e.templateObjectHelper={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n      var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n        return cooked;\n      };'},e.readHelper={name:"typescript:read",importName:"__read",scoped:!1,text:'\n      var __read = (this && this.__read) || function (o, n) {\n        var m = typeof Symbol === "function" && o[Symbol.iterator];\n        if (!m) return o;\n        var i = m.call(o), r, ar = [], e;\n        try {\n          while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n        }\n        catch (error) { e = { error: error }; }\n        finally {\n          try {\n            if (r && !r.done && (m = i["return"])) m.call(i);\n          }\n          finally { if (e) throw e.error; }\n        }\n        return ar;\n      };'},e.spreadArrayHelper={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n      var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n          if (ar || !(i in from)) {\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n            ar[i] = from[i];\n          }\n        }\n        return to.concat(ar || Array.prototype.slice.call(from));\n      };"},e.valuesHelper={name:"typescript:values",importName:"__values",scoped:!1,text:'\n      var __values = (this && this.__values) || function(o) {\n        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n        if (m) return m.call(o);\n        if (o && typeof o.length === "number") return {\n          next: function () {\n            if (o && i >= o.length) o = void 0;\n            return { value: o && o[i++], done: !o };\n          }\n        };\n        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n      };'},e.generatorHelper={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n      var __generator = (this && this.__generator) || function (thisArg, body) {\n        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n        function verb(n) { return function (v) { return step([n, v]); }; }\n        function step(op) {\n          if (f) throw new TypeError("Generator is already executing.");\n          while (g && (g = 0, op[0] && (_ = 0)), _) try {\n            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n            if (y = 0, t) op = [op[0] & 2, t.value];\n            switch (op[0]) {\n              case 0: case 1: t = op; break;\n              case 4: _.label++; return { value: op[1], done: false };\n              case 5: _.label++; y = op[1]; op = [0]; continue;\n              case 7: op = _.ops.pop(); _.trys.pop(); continue;\n              default:\n                if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                if (t[2]) _.ops.pop();\n                _.trys.pop(); continue;\n            }\n            op = body.call(thisArg, _);\n          } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n          if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n        }\n      };'},e.createBindingHelper={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:'\n      var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n        if (k2 === undefined) k2 = k;\n        var desc = Object.getOwnPropertyDescriptor(m, k);\n        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n          desc = { enumerable: true, get: function() { return m[k]; } };\n        }\n        Object.defineProperty(o, k2, desc);\n      }) : (function(o, m, k, k2) {\n        if (k2 === undefined) k2 = k;\n        o[k2] = m[k];\n      }));'},e.setModuleDefaultHelper={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n      var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n        Object.defineProperty(o, "default", { enumerable: true, value: v });\n      }) : function(o, v) {\n        o["default"] = v;\n      });'},e.importStarHelper={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[e.createBindingHelper,e.setModuleDefaultHelper],priority:2,text:'\n      var __importStar = (this && this.__importStar) || function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n        __setModuleDefault(result, mod);\n        return result;\n      };'},e.importDefaultHelper={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n      var __importDefault = (this && this.__importDefault) || function (mod) {\n        return (mod && mod.__esModule) ? mod : { "default": mod };\n      };'},e.exportStarHelper={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[e.createBindingHelper],priority:2,text:'\n      var __exportStar = (this && this.__exportStar) || function(m, exports) {\n        for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n      };'},e.classPrivateFieldGetHelper={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n      var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n        if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n        return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n      };'},e.classPrivateFieldSetHelper={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n      var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n        if (kind === "m") throw new TypeError("Private method is not writable");\n        if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n        return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n      };'},e.classPrivateFieldInHelper={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n      var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n        if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n        return typeof state === "function" ? receiver === state : state.has(receiver);\n      };'},e.getAllUnscopedEmitHelpers=function(){return r||(r=e.arrayToMap([e.decorateHelper,e.metadataHelper,e.paramHelper,e.assignHelper,e.awaitHelper,e.asyncGeneratorHelper,e.asyncDelegator,e.asyncValues,e.restHelper,e.awaiterHelper,e.extendsHelper,e.templateObjectHelper,e.spreadArrayHelper,e.valuesHelper,e.readHelper,e.generatorHelper,e.importStarHelper,e.importDefaultHelper,e.exportStarHelper,e.classPrivateFieldGetHelper,e.classPrivateFieldSetHelper,e.classPrivateFieldInHelper,e.createBindingHelper,e.setModuleDefaultHelper],(function(e){return e.name})))},e.asyncSuperHelper={name:"typescript:async-super",scoped:!0,text:t(a(["\n      const "," = name => super[name];"],["\n      const "," = name => super[name];"]),"_superIndex")},e.advancedAsyncSuperHelper={name:"typescript:advanced-async-super",scoped:!0,text:t(a(["\n      const "," = (function (geti, seti) {\n        const cache = Object.create(null);\n        return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n      })(name => super[name], (name, value) => super[name] = value);"],["\n      const "," = (function (geti, seti) {\n        const cache = Object.create(null);\n        return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n      })(name => super[name], (name, value) => super[name] = value);"]),"_superIndex")},e.isCallToHelper=function(t,r){return e.isCallExpression(t)&&e.isIdentifier(t.expression)&&0!=(4096&e.getEmitFlags(t.expression))&&t.expression.escapedText===r};}(t),function(e){e.isNumericLiteral=function(e){return 8===e.kind},e.isBigIntLiteral=function(e){return 9===e.kind},e.isStringLiteral=function(e){return 10===e.kind},e.isJsxText=function(e){return 11===e.kind},e.isRegularExpressionLiteral=function(e){return 13===e.kind},e.isNoSubstitutionTemplateLiteral=function(e){return 14===e.kind},e.isTemplateHead=function(e){return 15===e.kind},e.isTemplateMiddle=function(e){return 16===e.kind},e.isTemplateTail=function(e){return 17===e.kind},e.isDotDotDotToken=function(e){return 25===e.kind},e.isCommaToken=function(e){return 27===e.kind},e.isPlusToken=function(e){return 39===e.kind},e.isMinusToken=function(e){return 40===e.kind},e.isAsteriskToken=function(e){return 41===e.kind},e.isExclamationToken=function(e){return 53===e.kind},e.isQuestionToken=function(e){return 57===e.kind},e.isColonToken=function(e){return 58===e.kind},e.isQuestionDotToken=function(e){return 28===e.kind},e.isEqualsGreaterThanToken=function(e){return 38===e.kind},e.isIdentifier=function(e){return 79===e.kind},e.isPrivateIdentifier=function(e){return 80===e.kind},e.isExportModifier=function(e){return 93===e.kind},e.isAsyncModifier=function(e){return 132===e.kind},e.isAssertsKeyword=function(e){return 129===e.kind},e.isAwaitKeyword=function(e){return 133===e.kind},e.isReadonlyKeyword=function(e){return 146===e.kind},e.isStaticModifier=function(e){return 124===e.kind},e.isAbstractModifier=function(e){return 126===e.kind},e.isOverrideModifier=function(e){return 161===e.kind},e.isAccessorModifier=function(e){return 127===e.kind},e.isSuperKeyword=function(e){return 106===e.kind},e.isImportKeyword=function(e){return 100===e.kind},e.isQualifiedName=function(e){return 163===e.kind},e.isComputedPropertyName=function(e){return 164===e.kind},e.isTypeParameterDeclaration=function(e){return 165===e.kind},e.isParameter=function(e){return 166===e.kind},e.isDecorator=function(e){return 167===e.kind},e.isPropertySignature=function(e){return 168===e.kind},e.isPropertyDeclaration=function(e){return 169===e.kind},e.isMethodSignature=function(e){return 170===e.kind},e.isMethodDeclaration=function(e){return 171===e.kind},e.isClassStaticBlockDeclaration=function(e){return 172===e.kind},e.isConstructorDeclaration=function(e){return 173===e.kind},e.isGetAccessorDeclaration=function(e){return 174===e.kind},e.isSetAccessorDeclaration=function(e){return 175===e.kind},e.isCallSignatureDeclaration=function(e){return 176===e.kind},e.isConstructSignatureDeclaration=function(e){return 177===e.kind},e.isIndexSignatureDeclaration=function(e){return 178===e.kind},e.isTypePredicateNode=function(e){return 179===e.kind},e.isTypeReferenceNode=function(e){return 180===e.kind},e.isFunctionTypeNode=function(e){return 181===e.kind},e.isConstructorTypeNode=function(e){return 182===e.kind},e.isTypeQueryNode=function(e){return 183===e.kind},e.isTypeLiteralNode=function(e){return 184===e.kind},e.isArrayTypeNode=function(e){return 185===e.kind},e.isTupleTypeNode=function(e){return 186===e.kind},e.isNamedTupleMember=function(e){return 199===e.kind},e.isOptionalTypeNode=function(e){return 187===e.kind},e.isRestTypeNode=function(e){return 188===e.kind},e.isUnionTypeNode=function(e){return 189===e.kind},e.isIntersectionTypeNode=function(e){return 190===e.kind},e.isConditionalTypeNode=function(e){return 191===e.kind},e.isInferTypeNode=function(e){return 192===e.kind},e.isParenthesizedTypeNode=function(e){return 193===e.kind},e.isThisTypeNode=function(e){return 194===e.kind},e.isTypeOperatorNode=function(e){return 195===e.kind},e.isIndexedAccessTypeNode=function(e){return 196===e.kind},e.isMappedTypeNode=function(e){return 197===e.kind},e.isLiteralTypeNode=function(e){return 198===e.kind},e.isImportTypeNode=function(e){return 202===e.kind},e.isTemplateLiteralTypeSpan=function(e){return 201===e.kind},e.isTemplateLiteralTypeNode=function(e){return 200===e.kind},e.isObjectBindingPattern=function(e){return 203===e.kind},e.isArrayBindingPattern=function(e){return 204===e.kind},e.isBindingElement=function(e){return 205===e.kind},e.isArrayLiteralExpression=function(e){return 206===e.kind},e.isObjectLiteralExpression=function(e){return 207===e.kind},e.isPropertyAccessExpression=function(e){return 208===e.kind},e.isElementAccessExpression=function(e){return 209===e.kind},e.isCallExpression=function(e){return 210===e.kind},e.isNewExpression=function(e){return 211===e.kind},e.isTaggedTemplateExpression=function(e){return 212===e.kind},e.isTypeAssertionExpression=function(e){return 213===e.kind},e.isParenthesizedExpression=function(e){return 214===e.kind},e.isFunctionExpression=function(e){return 215===e.kind},e.isArrowFunction=function(e){return 216===e.kind},e.isDeleteExpression=function(e){return 217===e.kind},e.isTypeOfExpression=function(e){return 218===e.kind},e.isVoidExpression=function(e){return 219===e.kind},e.isAwaitExpression=function(e){return 220===e.kind},e.isPrefixUnaryExpression=function(e){return 221===e.kind},e.isPostfixUnaryExpression=function(e){return 222===e.kind},e.isBinaryExpression=function(e){return 223===e.kind},e.isConditionalExpression=function(e){return 224===e.kind},e.isTemplateExpression=function(e){return 225===e.kind},e.isYieldExpression=function(e){return 226===e.kind},e.isSpreadElement=function(e){return 227===e.kind},e.isClassExpression=function(e){return 228===e.kind},e.isOmittedExpression=function(e){return 229===e.kind},e.isExpressionWithTypeArguments=function(e){return 230===e.kind},e.isAsExpression=function(e){return 231===e.kind},e.isSatisfiesExpression=function(e){return 235===e.kind},e.isNonNullExpression=function(e){return 232===e.kind},e.isMetaProperty=function(e){return 233===e.kind},e.isSyntheticExpression=function(e){return 234===e.kind},e.isPartiallyEmittedExpression=function(e){return 353===e.kind},e.isCommaListExpression=function(e){return 354===e.kind},e.isTemplateSpan=function(e){return 236===e.kind},e.isSemicolonClassElement=function(e){return 237===e.kind},e.isBlock=function(e){return 238===e.kind},e.isVariableStatement=function(e){return 240===e.kind},e.isEmptyStatement=function(e){return 239===e.kind},e.isExpressionStatement=function(e){return 241===e.kind},e.isIfStatement=function(e){return 242===e.kind},e.isDoStatement=function(e){return 243===e.kind},e.isWhileStatement=function(e){return 244===e.kind},e.isForStatement=function(e){return 245===e.kind},e.isForInStatement=function(e){return 246===e.kind},e.isForOfStatement=function(e){return 247===e.kind},e.isContinueStatement=function(e){return 248===e.kind},e.isBreakStatement=function(e){return 249===e.kind},e.isReturnStatement=function(e){return 250===e.kind},e.isWithStatement=function(e){return 251===e.kind},e.isSwitchStatement=function(e){return 252===e.kind},e.isLabeledStatement=function(e){return 253===e.kind},e.isThrowStatement=function(e){return 254===e.kind},e.isTryStatement=function(e){return 255===e.kind},e.isDebuggerStatement=function(e){return 256===e.kind},e.isVariableDeclaration=function(e){return 257===e.kind},e.isVariableDeclarationList=function(e){return 258===e.kind},e.isFunctionDeclaration=function(e){return 259===e.kind},e.isClassDeclaration=function(e){return 260===e.kind},e.isInterfaceDeclaration=function(e){return 261===e.kind},e.isTypeAliasDeclaration=function(e){return 262===e.kind},e.isEnumDeclaration=function(e){return 263===e.kind},e.isModuleDeclaration=function(e){return 264===e.kind},e.isModuleBlock=function(e){return 265===e.kind},e.isCaseBlock=function(e){return 266===e.kind},e.isNamespaceExportDeclaration=function(e){return 267===e.kind},e.isImportEqualsDeclaration=function(e){return 268===e.kind},e.isImportDeclaration=function(e){return 269===e.kind},e.isImportClause=function(e){return 270===e.kind},e.isImportTypeAssertionContainer=function(e){return 298===e.kind},e.isAssertClause=function(e){return 296===e.kind},e.isAssertEntry=function(e){return 297===e.kind},e.isNamespaceImport=function(e){return 271===e.kind},e.isNamespaceExport=function(e){return 277===e.kind},e.isNamedImports=function(e){return 272===e.kind},e.isImportSpecifier=function(e){return 273===e.kind},e.isExportAssignment=function(e){return 274===e.kind},e.isExportDeclaration=function(e){return 275===e.kind},e.isNamedExports=function(e){return 276===e.kind},e.isExportSpecifier=function(e){return 278===e.kind},e.isMissingDeclaration=function(e){return 279===e.kind},e.isNotEmittedStatement=function(e){return 352===e.kind},e.isSyntheticReference=function(e){return 357===e.kind},e.isMergeDeclarationMarker=function(e){return 355===e.kind},e.isEndOfDeclarationMarker=function(e){return 356===e.kind},e.isExternalModuleReference=function(e){return 280===e.kind},e.isJsxElement=function(e){return 281===e.kind},e.isJsxSelfClosingElement=function(e){return 282===e.kind},e.isJsxOpeningElement=function(e){return 283===e.kind},e.isJsxClosingElement=function(e){return 284===e.kind},e.isJsxFragment=function(e){return 285===e.kind},e.isJsxOpeningFragment=function(e){return 286===e.kind},e.isJsxClosingFragment=function(e){return 287===e.kind},e.isJsxAttribute=function(e){return 288===e.kind},e.isJsxAttributes=function(e){return 289===e.kind},e.isJsxSpreadAttribute=function(e){return 290===e.kind},e.isJsxExpression=function(e){return 291===e.kind},e.isCaseClause=function(e){return 292===e.kind},e.isDefaultClause=function(e){return 293===e.kind},e.isHeritageClause=function(e){return 294===e.kind},e.isCatchClause=function(e){return 295===e.kind},e.isPropertyAssignment=function(e){return 299===e.kind},e.isShorthandPropertyAssignment=function(e){return 300===e.kind},e.isSpreadAssignment=function(e){return 301===e.kind},e.isEnumMember=function(e){return 302===e.kind},e.isUnparsedPrepend=function(e){return 304===e.kind},e.isSourceFile=function(e){return 308===e.kind},e.isBundle=function(e){return 309===e.kind},e.isUnparsedSource=function(e){return 310===e.kind},e.isJSDocTypeExpression=function(e){return 312===e.kind},e.isJSDocNameReference=function(e){return 313===e.kind},e.isJSDocMemberName=function(e){return 314===e.kind},e.isJSDocLink=function(e){return 327===e.kind},e.isJSDocLinkCode=function(e){return 328===e.kind},e.isJSDocLinkPlain=function(e){return 329===e.kind},e.isJSDocAllType=function(e){return 315===e.kind},e.isJSDocUnknownType=function(e){return 316===e.kind},e.isJSDocNullableType=function(e){return 317===e.kind},e.isJSDocNonNullableType=function(e){return 318===e.kind},e.isJSDocOptionalType=function(e){return 319===e.kind},e.isJSDocFunctionType=function(e){return 320===e.kind},e.isJSDocVariadicType=function(e){return 321===e.kind},e.isJSDocNamepathType=function(e){return 322===e.kind},e.isJSDoc=function(e){return 323===e.kind},e.isJSDocTypeLiteral=function(e){return 325===e.kind},e.isJSDocSignature=function(e){return 326===e.kind},e.isJSDocAugmentsTag=function(e){return 331===e.kind},e.isJSDocAuthorTag=function(e){return 333===e.kind},e.isJSDocClassTag=function(e){return 335===e.kind},e.isJSDocCallbackTag=function(e){return 341===e.kind},e.isJSDocPublicTag=function(e){return 336===e.kind},e.isJSDocPrivateTag=function(e){return 337===e.kind},e.isJSDocProtectedTag=function(e){return 338===e.kind},e.isJSDocReadonlyTag=function(e){return 339===e.kind},e.isJSDocOverrideTag=function(e){return 340===e.kind},e.isJSDocDeprecatedTag=function(e){return 334===e.kind},e.isJSDocSeeTag=function(e){return 349===e.kind},e.isJSDocEnumTag=function(e){return 342===e.kind},e.isJSDocParameterTag=function(e){return 343===e.kind},e.isJSDocReturnTag=function(e){return 344===e.kind},e.isJSDocThisTag=function(e){return 345===e.kind},e.isJSDocTypeTag=function(e){return 346===e.kind},e.isJSDocTemplateTag=function(e){return 347===e.kind},e.isJSDocTypedefTag=function(e){return 348===e.kind},e.isJSDocUnknownTag=function(e){return 330===e.kind},e.isJSDocPropertyTag=function(e){return 350===e.kind},e.isJSDocImplementsTag=function(e){return 332===e.kind},e.isSyntaxList=function(e){return 351===e.kind};}(t),function(e){function t(t,r,n,i){if(e.isComputedPropertyName(n))return e.setTextRange(t.createElementAccessExpression(r,n.expression),i);var a=e.setTextRange(e.isMemberName(n)?t.createPropertyAccessExpression(r,n):t.createElementAccessExpression(r,n),n);return e.getOrCreateEmitNode(a).flags|=64,a}function r(t,r){var n=e.parseNodeFactory.createIdentifier(t||"React");return e.setParent(n,e.getParseTreeNode(r)),n}function i(t,n,a){if(e.isQualifiedName(n)){var o=i(t,n.left,a),s=t.createIdentifier(e.idText(n.right));return s.escapedText=n.right.escapedText,t.createPropertyAccessExpression(o,s)}return r(e.idText(n),a)}function a(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"createElement")}function o(t,r){return e.isIdentifier(r)?t.createStringLiteralFromNode(r):e.isComputedPropertyName(r)?e.setParent(e.setTextRange(t.cloneNode(r.expression),r.expression),r.expression.parent):e.setParent(e.setTextRange(t.cloneNode(r),r),r.parent)}function s(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function c(t){return e.isParenthesizedExpression(t)&&e.isInJSFile(t)&&!!e.getJSDocTypeTag(t)}function l(e,t){switch(void 0===t&&(t=15),e.kind){case 214:return !(16&t&&c(e))&&0!=(1&t);case 213:case 231:case 235:return 0!=(2&t);case 232:return 0!=(4&t);case 353:return 0!=(8&t)}return !1}function u(e,t){for(void 0===t&&(t=15);l(e,t);)e=e.expression;return e}function _(t){return e.setStartsOnNewLine(t,!0)}function d(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return n&&n.externalHelpersModuleName}function p(t,r,n,i,a){if(n.importHelpers&&e.isEffectiveExternalModule(r,n)){var o=d(r);if(o)return o;var s=e.getEmitModuleKind(n),c=(i||e.getESModuleInterop(n)&&a)&&s!==e.ModuleKind.System&&(s<e.ModuleKind.ES2015||r.impliedNodeFormat===e.ModuleKind.CommonJS);if(!c){var l=e.getEmitHelpers(r);if(l)for(var u=0,_=l;u<_.length;u++)if(!_[u].scoped){c=!0;break}}if(c){var p=e.getOriginalNode(r,e.isSourceFile),f=e.getOrCreateEmitNode(p);return f.externalHelpersModuleName||(f.externalHelpersModuleName=t.createUniqueName(e.externalHelpersModuleNameText))}}}function f(t,r,n,i){if(r)return r.moduleName?t.createStringLiteral(r.moduleName):!r.isDeclarationFile&&e.outFile(i)?t.createStringLiteral(e.getExternalModuleNameFromPath(n,r.fileName)):void 0}function g(t){if(e.isDeclarationBindingElement(t))return t.name;if(!e.isObjectLiteralElementLike(t))return e.isAssignmentExpression(t,!0)?g(t.left):e.isSpreadElement(t)?g(t.expression):t;switch(t.kind){case 299:return g(t.initializer);case 300:return t.name;case 301:return g(t.expression)}}function m(t){switch(t.kind){case 205:if(t.propertyName){var r=t.propertyName;return e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r}break;case 299:if(t.name)return r=t.name,e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r;break;case 301:return t.name&&e.isPrivateIdentifier(t.name)?e.Debug.failBadSyntaxKind(t.name):t.name}var n=g(t);if(n&&e.isPropertyName(n))return n}function y(e){var t=e.kind;return 10===t||8===t}var v;e.createEmptyExports=function(e){return e.createExportDeclaration(void 0,!1,e.createNamedExports([]),void 0)},e.createMemberAccessForPropertyName=t,e.createJsxFactoryExpression=a,e.createExpressionForJsxElement=function(t,r,n,i,a,o){var s=[n];if(i&&s.push(i),a&&a.length>0)if(i||s.push(t.createNull()),a.length>1)for(var c=0,l=a;c<l.length;c++){var u=l[c];_(u),s.push(u);}else s.push(a[0]);return e.setTextRange(t.createCallExpression(r,void 0,s),o)},e.createExpressionForJsxFragment=function(t,n,o,s,c,l,u){var d=[function(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"Fragment")}(t,o,s,l),t.createNull()];if(c&&c.length>0)if(c.length>1)for(var p=0,f=c;p<f.length;p++){var g=f[p];_(g),d.push(g);}else d.push(c[0]);return e.setTextRange(t.createCallExpression(a(t,n,s,l),void 0,d),u)},e.createForOfBindingStatement=function(t,r,n){if(e.isVariableDeclarationList(r)){var i=e.first(r.declarations),a=t.updateVariableDeclaration(i,i.name,void 0,void 0,n);return e.setTextRange(t.createVariableStatement(void 0,t.updateVariableDeclarationList(r,[a])),r)}var o=e.setTextRange(t.createAssignment(r,n),r);return e.setTextRange(t.createExpressionStatement(o),r)},e.insertLeadingStatement=function(t,r,i){return e.isBlock(r)?t.updateBlock(r,e.setTextRange(t.createNodeArray(n$4([i],r.statements,!0)),r.statements)):t.createBlock(t.createNodeArray([r,i]),!0)},e.createExpressionFromEntityName=function t(r,n){if(e.isQualifiedName(n)){var i=t(r,n.left),a=e.setParent(e.setTextRange(r.cloneNode(n.right),n.right),n.right.parent);return e.setTextRange(r.createPropertyAccessExpression(i,a),n)}return e.setParent(e.setTextRange(r.cloneNode(n),n),n.parent)},e.createExpressionForPropertyName=o,e.createExpressionForObjectLiteralElementLike=function(r,n,i,a){switch(i.name&&e.isPrivateIdentifier(i.name)&&e.Debug.failBadSyntaxKind(i.name,"Private identifiers are not allowed in object literals."),i.kind){case 174:case 175:return function(t,r,n,i,a){var s=e.getAllAccessorDeclarations(r,n),c=s.firstAccessor,l=s.getAccessor,u=s.setAccessor;if(n===c)return e.setTextRange(t.createObjectDefinePropertyCall(i,o(t,n.name),t.createPropertyDescriptor({enumerable:t.createFalse(),configurable:!0,get:l&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(e.getModifiers(l),void 0,void 0,void 0,l.parameters,void 0,l.body),l),l),set:u&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(e.getModifiers(u),void 0,void 0,void 0,u.parameters,void 0,u.body),u),u)},!a)),c)}(r,n.properties,i,a,!!n.multiLine);case 299:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),n.initializer),n),n)}(r,i,a);case 300:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),r.cloneNode(n.name)),n),n)}(r,i,a);case 171:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),e.setOriginalNode(e.setTextRange(r.createFunctionExpression(e.getModifiers(n),n.asteriskToken,void 0,void 0,n.parameters,void 0,n.body),n),n)),n),n)}(r,i,a)}},e.expandPreOrPostfixIncrementOrDecrementExpression=function(t,r,n,i,a){var o=r.operator;e.Debug.assert(45===o||46===o,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");var s=t.createTempVariable(i);n=t.createAssignment(s,n),e.setTextRange(n,r.operand);var c=e.isPrefixUnaryExpression(r)?t.createPrefixUnaryExpression(o,s):t.createPostfixUnaryExpression(s,o);return e.setTextRange(c,r),a&&(c=t.createAssignment(a,c),e.setTextRange(c,r)),n=t.createComma(n,c),e.setTextRange(n,r),e.isPostfixUnaryExpression(r)&&(n=t.createComma(n,s),e.setTextRange(n,r)),n},e.isInternalName=function(t){return 0!=(32768&e.getEmitFlags(t))},e.isLocalName=function(t){return 0!=(16384&e.getEmitFlags(t))},e.isExportName=function(t){return 0!=(8192&e.getEmitFlags(t))},e.findUseStrictPrologue=function(t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!e.isPrologueDirective(i))break;if(s(i))return i}},e.startsWithUseStrict=function(t){var r=e.firstOrUndefined(t);return void 0!==r&&e.isPrologueDirective(r)&&s(r)},e.isCommaSequence=function(e){return 223===e.kind&&27===e.operatorToken.kind||354===e.kind},e.isJSDocTypeAssertion=c,e.getJSDocTypeAssertionType=function(t){var r=e.getJSDocType(t);return e.Debug.assertIsDefined(r),r},e.isOuterExpression=l,e.skipOuterExpressions=u,e.skipAssertions=function(e){return u(e,6)},e.startOnNewLine=_,e.getExternalHelpersModuleName=d,e.hasRecordedExternalHelpers=function(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return !(!n||!n.externalHelpersModuleName&&!n.externalHelpers)},e.createExternalHelpersImportDeclarationIfNeeded=function(t,r,n,i,a,o,s){if(i.importHelpers&&e.isEffectiveExternalModule(n,i)){var c=void 0,l=e.getEmitModuleKind(i);if(l>=e.ModuleKind.ES2015&&l<=e.ModuleKind.ESNext||n.impliedNodeFormat===e.ModuleKind.ESNext){var u=e.getEmitHelpers(n);if(u){for(var _=[],d=0,f=u;d<f.length;d++){var g=f[d];if(!g.scoped){var m=g.importName;m&&e.pushIfUnique(_,m);}}if(e.some(_)){_.sort(e.compareStringsCaseSensitive),c=t.createNamedImports(e.map(_,(function(i){return e.isFileLevelUniqueName(n,i)?t.createImportSpecifier(!1,void 0,t.createIdentifier(i)):t.createImportSpecifier(!1,t.createIdentifier(i),r.getUnscopedHelperName(i))})));var y=e.getOriginalNode(n,e.isSourceFile);e.getOrCreateEmitNode(y).externalHelpers=!0;}}}else {var v=p(t,n,i,a,o||s);v&&(c=t.createNamespaceImport(v));}if(c){var h=t.createImportDeclaration(void 0,t.createImportClause(!1,void 0,c),t.createStringLiteral(e.externalHelpersModuleNameText),void 0);return e.addEmitFlags(h,67108864),h}}},e.getOrCreateExternalHelpersModuleNameIfNeeded=p,e.getLocalNameForExternalImport=function(t,r,n){var i=e.getNamespaceDeclarationNode(r);if(i&&!e.isDefaultImport(r)&&!e.isExportNamespaceAsDefaultDeclaration(r)){var a=i.name;return e.isGeneratedIdentifier(a)?a:t.createIdentifier(e.getSourceTextOfNodeFromSourceFile(n,a)||e.idText(a))}return 269===r.kind&&r.importClause||275===r.kind&&r.moduleSpecifier?t.getGeneratedNameForNode(r):void 0},e.getExternalModuleNameLiteral=function(t,r,n,i,a,o){var s=e.getExternalModuleName(r);if(s&&e.isStringLiteral(s))return function(e,t,r,n,i){return f(r,n.getExternalModuleFileFromDeclaration(e),t,i)}(r,i,t,a,o)||function(e,t,r){var n=r.renamedDependencies&&r.renamedDependencies.get(t.text);return n?e.createStringLiteral(n):void 0}(t,s,n)||t.cloneNode(s)},e.tryGetModuleNameFromFile=f,e.getInitializerOfBindingOrAssignmentElement=function t(r){if(e.isDeclarationBindingElement(r))return r.initializer;if(e.isPropertyAssignment(r)){var n=r.initializer;return e.isAssignmentExpression(n,!0)?n.right:void 0}return e.isShorthandPropertyAssignment(r)?r.objectAssignmentInitializer:e.isAssignmentExpression(r,!0)?r.right:e.isSpreadElement(r)?t(r.expression):void 0},e.getTargetOfBindingOrAssignmentElement=g,e.getRestIndicatorOfBindingOrAssignmentElement=function(e){switch(e.kind){case 166:case 205:return e.dotDotDotToken;case 227:case 301:return e}},e.getPropertyNameOfBindingOrAssignmentElement=function(t){var r=m(t);return e.Debug.assert(!!r||e.isSpreadAssignment(t),"Invalid property name for binding element."),r},e.tryGetPropertyNameOfBindingOrAssignmentElement=m,e.getElementsOfBindingOrAssignmentPattern=function(e){switch(e.kind){case 203:case 204:case 206:return e.elements;case 207:return e.properties}},e.getJSDocTypeAliasName=function(t){if(t)for(var r=t;;){if(e.isIdentifier(r)||!r.body)return e.isIdentifier(r)?r:r.name;r=r.body;}},e.canHaveIllegalType=function(e){var t=e.kind;return 173===t||175===t},e.canHaveIllegalTypeParameters=function(e){var t=e.kind;return 173===t||174===t||175===t},e.canHaveIllegalDecorators=function(e){var t=e.kind;return 299===t||300===t||259===t||173===t||178===t||172===t||279===t||240===t||261===t||262===t||263===t||264===t||268===t||269===t||267===t||275===t||274===t},e.canHaveIllegalModifiers=function(e){var t=e.kind;return 172===t||299===t||300===t||181===t||279===t||267===t},e.isTypeNodeOrTypeParameterDeclaration=e.or(e.isTypeNode,e.isTypeParameterDeclaration),e.isQuestionOrExclamationToken=e.or(e.isQuestionToken,e.isExclamationToken),e.isIdentifierOrThisTypeNode=e.or(e.isIdentifier,e.isThisTypeNode),e.isReadonlyKeywordOrPlusOrMinusToken=e.or(e.isReadonlyKeyword,e.isPlusToken,e.isMinusToken),e.isQuestionOrPlusOrMinusToken=e.or(e.isQuestionToken,e.isPlusToken,e.isMinusToken),e.isModuleName=e.or(e.isIdentifier,e.isStringLiteral),e.isLiteralTypeLikeExpression=function(t){var r=t.kind;return 104===r||110===r||95===r||e.isLiteralExpression(t)||e.isPrefixUnaryExpression(t)},e.isBinaryOperatorToken=function(t){return function(t){return 60===t||function(e){return function(e){return 55===e||56===e}(e)||function(e){return function(e){return 50===e||51===e||52===e}(e)||function(e){return function(e){return 34===e||36===e||35===e||37===e}(e)||function(e){return function(e){return 29===e||32===e||31===e||33===e||102===e||101===e}(e)||function(e){return function(e){return 47===e||48===e||49===e}(e)||function(e){return function(e){return 39===e||40===e}(e)||function(e){return function(e){return 42===e}(e)||function(e){return 41===e||43===e||44===e}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(t)||e.isAssignmentOperator(t)}(r=t.kind)||27===r;var r;},function(t){function r(t,n,i,a,o,s,l){var u=n>0?o[n-1]:void 0;return e.Debug.assertEqual(i[n],r),o[n]=t.onEnter(a[n],u,l),i[n]=c(t,r),n}function n(t,r,i,a,o,s,_){e.Debug.assertEqual(i[r],n),e.Debug.assertIsDefined(t.onLeft),i[r]=c(t,n);var d=t.onLeft(a[r].left,o[r],a[r]);return d?(u(r,a,d),l(r,i,a,o,d)):r}function i(t,r,n,a,o,s,l){return e.Debug.assertEqual(n[r],i),e.Debug.assertIsDefined(t.onOperator),n[r]=c(t,i),t.onOperator(a[r].operatorToken,o[r],a[r]),r}function a(t,r,n,i,o,s,_){e.Debug.assertEqual(n[r],a),e.Debug.assertIsDefined(t.onRight),n[r]=c(t,a);var d=t.onRight(i[r].right,o[r],i[r]);return d?(u(r,i,d),l(r,n,i,o,d)):r}function o(t,r,n,i,a,s,l){e.Debug.assertEqual(n[r],o),n[r]=c(t,o);var u=t.onExit(i[r],a[r]);if(r>0){if(r--,t.foldState){var _=n[r]===o?"right":"left";a[r]=t.foldState(a[r],u,_);}}else s.value=u;return r}function s(t,r,n,i,a,o,c){return e.Debug.assertEqual(n[r],s),r}function c(t,c){switch(c){case r:if(t.onLeft)return n;case n:if(t.onOperator)return i;case i:if(t.onRight)return a;case a:return o;case o:case s:return s;default:e.Debug.fail("Invalid state");}}function l(e,t,n,i,a){return t[++e]=r,n[e]=a,i[e]=void 0,e}function u(t,r,n){if(e.Debug.shouldAssert(2))for(;t>=0;)e.Debug.assert(r[t]!==n,"Circular traversal detected."),t--;}t.enter=r,t.left=n,t.operator=i,t.right=a,t.exit=o,t.done=s,t.nextState=c;}(v||(v={}));var h=function(e,t,r,n,i,a){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=n,this.onExit=i,this.foldState=a;};function b(e,t){return "object"==typeof e?x(!1,e.prefix,e.node,e.suffix,t):"string"==typeof e?e.length>0&&35===e.charCodeAt(0)?e.slice(1):e:""}function x(t,r,n,i,a){return r=b(r,a),i=b(i,a),n=function(t,r){return "string"==typeof t?t:function(t,r){return e.isGeneratedPrivateIdentifier(t)?r(t).slice(1):e.isGeneratedIdentifier(t)?r(t):e.isPrivateIdentifier(t)?t.escapedText.slice(1):e.idText(t)}(t,e.Debug.checkDefined(r))}(n,a),"".concat(t?"#":"").concat(r).concat(n).concat(i)}e.createBinaryExpressionTrampoline=function(t,r,n,i,a,o){var s=new h(t,r,n,i,a,o);return function(t,r){for(var n={value:void 0},i=[v.enter],a=[t],o=[void 0],c=0;i[c]!==v.done;)c=i[c](s,c,i,a,o,n,r);return e.Debug.assertEqual(c,0),n.value}},e.elideNodes=function(t,r){if(void 0!==r)return 0===r.length?r:e.setTextRange(t.createNodeArray([],r.hasTrailingComma),r)},e.getNodeForGeneratedName=function(t){if(4&t.autoGenerateFlags){for(var r=t.autoGenerateId,n=t,i=n.original;i&&(n=i,!(e.isMemberName(n)&&4&n.autoGenerateFlags&&n.autoGenerateId!==r));)i=n.original;return n}return t},e.formatGeneratedNamePart=b,e.formatGeneratedName=x,e.createAccessorPropertyBackingField=function(e,t,r,n){return e.updatePropertyDeclaration(t,r,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage"),void 0,void 0,n)},e.createAccessorPropertyGetRedirector=function(e,t,r,n){return e.createGetAccessorDeclaration(r,n,[],void 0,e.createBlock([e.createReturnStatement(e.createPropertyAccessExpression(e.createThis(),e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")))]))},e.createAccessorPropertySetRedirector=function(e,t,r,n){return e.createSetAccessorDeclaration(r,n,[e.createParameterDeclaration(void 0,void 0,"value")],e.createBlock([e.createExpressionStatement(e.createAssignment(e.createPropertyAccessExpression(e.createThis(),e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")),e.createIdentifier("value")))]))};}(t),function(e){e.setTextRange=function(t,r){return r?e.setTextRangePosEnd(t,r.pos,r.end):t},e.canHaveModifiers=function(e){var t=e.kind;return 165===t||166===t||168===t||169===t||170===t||171===t||173===t||174===t||175===t||178===t||182===t||215===t||216===t||228===t||240===t||259===t||260===t||261===t||262===t||263===t||264===t||268===t||269===t||274===t||275===t},e.canHaveDecorators=function(e){var t=e.kind;return 166===t||169===t||171===t||174===t||175===t||228===t||260===t};}(t),function(e){var t,r,a,o,s,c,l,u;function _(e,t){return t&&e(t)}function d(e,t,r){if(r){if(t)return t(r);for(var n=0,i=r;n<i.length;n++){var a=e(i[n]);if(a)return a}}}function p(e,t){return 42===e.charCodeAt(t+1)&&42===e.charCodeAt(t+2)&&47!==e.charCodeAt(t+3)}function f(t){return e.forEach(t.statements,g)||function(e){return 4194304&e.flags?m(e):void 0}(t)}function g(t){return e.canHaveModifiers(t)&&function(t,r){return e.some(t.modifiers,(function(e){return 93===e.kind}))}(t)||e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)||e.isImportDeclaration(t)||e.isExportAssignment(t)||e.isExportDeclaration(t)?t:void 0}function m(t){return function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText}(t)?t:L(t,m)}!function(e){e[e.None=0]="None",e[e.Yield=1]="Yield",e[e.Await=2]="Await",e[e.Type=4]="Type",e[e.IgnoreMissingOpenBrace=16]="IgnoreMissingOpenBrace",e[e.JSDoc=32]="JSDoc";}(r||(r={})),function(e){e[e.TryParse=0]="TryParse",e[e.Lookahead=1]="Lookahead",e[e.Reparse=2]="Reparse";}(a||(a={})),e.parseBaseNodeFactory={createBaseSourceFileNode:function(t){return new(u||(u=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(c||(c=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(l||(l=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(s||(s=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(t){return new(o||(o=e.objectAllocator.getNodeConstructor()))(t,-1,-1)}},e.parseNodeFactory=e.createNodeFactory(1,e.parseBaseNodeFactory),e.isJSDocLikeText=p,e.isFileProbablyExternalModule=f;var y,v,h=((t={})[163]=function(e,t,r){return _(t,e.left)||_(t,e.right)},t[165]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||_(t,e.constraint)||_(t,e.default)||_(t,e.expression)},t[300]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||_(t,e.questionToken)||_(t,e.exclamationToken)||_(t,e.equalsToken)||_(t,e.objectAssignmentInitializer)},t[301]=function(e,t,r){return _(t,e.expression)},t[166]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.dotDotDotToken)||_(t,e.name)||_(t,e.questionToken)||_(t,e.type)||_(t,e.initializer)},t[169]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||_(t,e.questionToken)||_(t,e.exclamationToken)||_(t,e.type)||_(t,e.initializer)},t[168]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||_(t,e.questionToken)||_(t,e.type)||_(t,e.initializer)},t[299]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||_(t,e.questionToken)||_(t,e.exclamationToken)||_(t,e.initializer)},t[257]=function(e,t,r){return _(t,e.name)||_(t,e.exclamationToken)||_(t,e.type)||_(t,e.initializer)},t[205]=function(e,t,r){return _(t,e.dotDotDotToken)||_(t,e.propertyName)||_(t,e.name)||_(t,e.initializer)},t[178]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)},t[182]=function(e,t,r){return d(t,r,e.modifiers)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)},t[181]=function(e,t,r){return d(t,r,e.modifiers)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)},t[176]=b,t[177]=b,t[171]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.asteriskToken)||_(t,e.name)||_(t,e.questionToken)||_(t,e.exclamationToken)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[170]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||_(t,e.questionToken)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)},t[173]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[174]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[175]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[259]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.asteriskToken)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[215]=function(e,t,r){return d(t,r,e.modifiers)||_(t,e.asteriskToken)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.body)},t[216]=function(e,t,r){return d(t,r,e.modifiers)||d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)||_(t,e.equalsGreaterThanToken)||_(t,e.body)},t[172]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.body)},t[180]=function(e,t,r){return _(t,e.typeName)||d(t,r,e.typeArguments)},t[179]=function(e,t,r){return _(t,e.assertsModifier)||_(t,e.parameterName)||_(t,e.type)},t[183]=function(e,t,r){return _(t,e.exprName)||d(t,r,e.typeArguments)},t[184]=function(e,t,r){return d(t,r,e.members)},t[185]=function(e,t,r){return _(t,e.elementType)},t[186]=function(e,t,r){return d(t,r,e.elements)},t[189]=x,t[190]=x,t[191]=function(e,t,r){return _(t,e.checkType)||_(t,e.extendsType)||_(t,e.trueType)||_(t,e.falseType)},t[192]=function(e,t,r){return _(t,e.typeParameter)},t[202]=function(e,t,r){return _(t,e.argument)||_(t,e.assertions)||_(t,e.qualifier)||d(t,r,e.typeArguments)},t[298]=function(e,t,r){return _(t,e.assertClause)},t[193]=D,t[195]=D,t[196]=function(e,t,r){return _(t,e.objectType)||_(t,e.indexType)},t[197]=function(e,t,r){return _(t,e.readonlyToken)||_(t,e.typeParameter)||_(t,e.nameType)||_(t,e.questionToken)||_(t,e.type)||d(t,r,e.members)},t[198]=function(e,t,r){return _(t,e.literal)},t[199]=function(e,t,r){return _(t,e.dotDotDotToken)||_(t,e.name)||_(t,e.questionToken)||_(t,e.type)},t[203]=S,t[204]=S,t[206]=function(e,t,r){return d(t,r,e.elements)},t[207]=function(e,t,r){return d(t,r,e.properties)},t[208]=function(e,t,r){return _(t,e.expression)||_(t,e.questionDotToken)||_(t,e.name)},t[209]=function(e,t,r){return _(t,e.expression)||_(t,e.questionDotToken)||_(t,e.argumentExpression)},t[210]=T,t[211]=T,t[212]=function(e,t,r){return _(t,e.tag)||_(t,e.questionDotToken)||d(t,r,e.typeArguments)||_(t,e.template)},t[213]=function(e,t,r){return _(t,e.type)||_(t,e.expression)},t[214]=function(e,t,r){return _(t,e.expression)},t[217]=function(e,t,r){return _(t,e.expression)},t[218]=function(e,t,r){return _(t,e.expression)},t[219]=function(e,t,r){return _(t,e.expression)},t[221]=function(e,t,r){return _(t,e.operand)},t[226]=function(e,t,r){return _(t,e.asteriskToken)||_(t,e.expression)},t[220]=function(e,t,r){return _(t,e.expression)},t[222]=function(e,t,r){return _(t,e.operand)},t[223]=function(e,t,r){return _(t,e.left)||_(t,e.operatorToken)||_(t,e.right)},t[231]=function(e,t,r){return _(t,e.expression)||_(t,e.type)},t[232]=function(e,t,r){return _(t,e.expression)},t[235]=function(e,t,r){return _(t,e.expression)||_(t,e.type)},t[233]=function(e,t,r){return _(t,e.name)},t[224]=function(e,t,r){return _(t,e.condition)||_(t,e.questionToken)||_(t,e.whenTrue)||_(t,e.colonToken)||_(t,e.whenFalse)},t[227]=function(e,t,r){return _(t,e.expression)},t[238]=C,t[265]=C,t[308]=function(e,t,r){return d(t,r,e.statements)||_(t,e.endOfFileToken)},t[240]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.declarationList)},t[258]=function(e,t,r){return d(t,r,e.declarations)},t[241]=function(e,t,r){return _(t,e.expression)},t[242]=function(e,t,r){return _(t,e.expression)||_(t,e.thenStatement)||_(t,e.elseStatement)},t[243]=function(e,t,r){return _(t,e.statement)||_(t,e.expression)},t[244]=function(e,t,r){return _(t,e.expression)||_(t,e.statement)},t[245]=function(e,t,r){return _(t,e.initializer)||_(t,e.condition)||_(t,e.incrementor)||_(t,e.statement)},t[246]=function(e,t,r){return _(t,e.initializer)||_(t,e.expression)||_(t,e.statement)},t[247]=function(e,t,r){return _(t,e.awaitModifier)||_(t,e.initializer)||_(t,e.expression)||_(t,e.statement)},t[248]=E,t[249]=E,t[250]=function(e,t,r){return _(t,e.expression)},t[251]=function(e,t,r){return _(t,e.expression)||_(t,e.statement)},t[252]=function(e,t,r){return _(t,e.expression)||_(t,e.caseBlock)},t[266]=function(e,t,r){return d(t,r,e.clauses)},t[292]=function(e,t,r){return _(t,e.expression)||d(t,r,e.statements)},t[293]=function(e,t,r){return d(t,r,e.statements)},t[253]=function(e,t,r){return _(t,e.label)||_(t,e.statement)},t[254]=function(e,t,r){return _(t,e.expression)},t[255]=function(e,t,r){return _(t,e.tryBlock)||_(t,e.catchClause)||_(t,e.finallyBlock)},t[295]=function(e,t,r){return _(t,e.variableDeclaration)||_(t,e.block)},t[167]=function(e,t,r){return _(t,e.expression)},t[260]=k,t[228]=k,t[261]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.heritageClauses)||d(t,r,e.members)},t[262]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||_(t,e.type)},t[263]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.members)},t[302]=function(e,t,r){return _(t,e.name)||_(t,e.initializer)},t[264]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||_(t,e.body)},t[268]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.name)||_(t,e.moduleReference)},t[269]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.importClause)||_(t,e.moduleSpecifier)||_(t,e.assertClause)},t[270]=function(e,t,r){return _(t,e.name)||_(t,e.namedBindings)},t[296]=function(e,t,r){return d(t,r,e.elements)},t[297]=function(e,t,r){return _(t,e.name)||_(t,e.value)},t[267]=function(e,t,r){return d(t,r,e.illegalDecorators)||_(t,e.name)},t[271]=function(e,t,r){return _(t,e.name)},t[277]=function(e,t,r){return _(t,e.name)},t[272]=N,t[276]=N,t[275]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.exportClause)||_(t,e.moduleSpecifier)||_(t,e.assertClause)},t[273]=A,t[278]=A,t[274]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)||_(t,e.expression)},t[225]=function(e,t,r){return _(t,e.head)||d(t,r,e.templateSpans)},t[236]=function(e,t,r){return _(t,e.expression)||_(t,e.literal)},t[200]=function(e,t,r){return _(t,e.head)||d(t,r,e.templateSpans)},t[201]=function(e,t,r){return _(t,e.type)||_(t,e.literal)},t[164]=function(e,t,r){return _(t,e.expression)},t[294]=function(e,t,r){return d(t,r,e.types)},t[230]=function(e,t,r){return _(t,e.expression)||d(t,r,e.typeArguments)},t[280]=function(e,t,r){return _(t,e.expression)},t[279]=function(e,t,r){return d(t,r,e.illegalDecorators)||d(t,r,e.modifiers)},t[354]=function(e,t,r){return d(t,r,e.elements)},t[281]=function(e,t,r){return _(t,e.openingElement)||d(t,r,e.children)||_(t,e.closingElement)},t[285]=function(e,t,r){return _(t,e.openingFragment)||d(t,r,e.children)||_(t,e.closingFragment)},t[282]=F,t[283]=F,t[289]=function(e,t,r){return d(t,r,e.properties)},t[288]=function(e,t,r){return _(t,e.name)||_(t,e.initializer)},t[290]=function(e,t,r){return _(t,e.expression)},t[291]=function(e,t,r){return _(t,e.dotDotDotToken)||_(t,e.expression)},t[284]=function(e,t,r){return _(t,e.tagName)},t[187]=P,t[188]=P,t[312]=P,t[318]=P,t[317]=P,t[319]=P,t[321]=P,t[320]=function(e,t,r){return d(t,r,e.parameters)||_(t,e.type)},t[323]=function(e,t,r){return ("string"==typeof e.comment?void 0:d(t,r,e.comment))||d(t,r,e.tags)},t[349]=function(e,t,r){return _(t,e.tagName)||_(t,e.name)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[313]=function(e,t,r){return _(t,e.name)},t[314]=function(e,t,r){return _(t,e.left)||_(t,e.right)},t[343]=w,t[350]=w,t[333]=function(e,t,r){return _(t,e.tagName)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[332]=function(e,t,r){return _(t,e.tagName)||_(t,e.class)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[331]=function(e,t,r){return _(t,e.tagName)||_(t,e.class)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[347]=function(e,t,r){return _(t,e.tagName)||_(t,e.constraint)||d(t,r,e.typeParameters)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[348]=function(e,t,r){return _(t,e.tagName)||(e.typeExpression&&312===e.typeExpression.kind?_(t,e.typeExpression)||_(t,e.fullName)||("string"==typeof e.comment?void 0:d(t,r,e.comment)):_(t,e.fullName)||_(t,e.typeExpression)||("string"==typeof e.comment?void 0:d(t,r,e.comment)))},t[341]=function(e,t,r){return _(t,e.tagName)||_(t,e.fullName)||_(t,e.typeExpression)||("string"==typeof e.comment?void 0:d(t,r,e.comment))},t[344]=I,t[346]=I,t[345]=I,t[342]=I,t[326]=function(t,r,n){return e.forEach(t.typeParameters,r)||e.forEach(t.parameters,r)||_(r,t.type)},t[327]=O,t[328]=O,t[329]=O,t[325]=function(t,r,n){return e.forEach(t.jsDocPropertyTags,r)},t[330]=M,t[335]=M,t[336]=M,t[337]=M,t[338]=M,t[339]=M,t[334]=M,t[340]=M,t[353]=function(e,t,r){return _(t,e.expression)},t);function b(e,t,r){return d(t,r,e.typeParameters)||d(t,r,e.parameters)||_(t,e.type)}function x(e,t,r){return d(t,r,e.types)}function D(e,t,r){return _(t,e.type)}function S(e,t,r){return d(t,r,e.elements)}function T(e,t,r){return _(t,e.expression)||_(t,e.questionDotToken)||d(t,r,e.typeArguments)||d(t,r,e.arguments)}function C(e,t,r){return d(t,r,e.statements)}function E(e,t,r){return _(t,e.label)}function k(e,t,r){return d(t,r,e.modifiers)||_(t,e.name)||d(t,r,e.typeParameters)||d(t,r,e.heritageClauses)||d(t,r,e.members)}function N(e,t,r){return d(t,r,e.elements)}function A(e,t,r){return _(t,e.propertyName)||_(t,e.name)}function F(e,t,r){return _(t,e.tagName)||d(t,r,e.typeArguments)||_(t,e.attributes)}function P(e,t,r){return _(t,e.type)}function w(e,t,r){return _(t,e.tagName)||(e.isNameFirst?_(t,e.name)||_(t,e.typeExpression):_(t,e.typeExpression)||_(t,e.name))||("string"==typeof e.comment?void 0:d(t,r,e.comment))}function I(e,t,r){return _(t,e.tagName)||_(t,e.typeExpression)||("string"==typeof e.comment?void 0:d(t,r,e.comment))}function O(e,t,r){return _(t,e.name)}function M(e,t,r){return _(t,e.tagName)||("string"==typeof e.comment?void 0:d(t,r,e.comment))}function L(e,t,r){if(!(void 0===e||e.kind<=162)){var n=h[e.kind];return void 0===n?void 0:n(e,t,r)}}function R(e){var t=[];return L(e,r,r),t;function r(e){t.unshift(e);}}function B(e){e.externalModuleIndicator=f(e);}function j(e){return void 0!==e.externalModuleIndicator}function J(t){return e.fileExtensionIsOneOf(t,e.supportedDeclarationExtensions)}function z(t,r){for(var n=[],i=0,a=e.getLeadingCommentRanges(r,0)||e.emptyArray;i<a.length;i++){var o=a[i];H(n,o,r.substring(o.pos,o.end));}t.pragmas=new e.Map;for(var s=0,c=n;s<c.length;s++){var l=c[s];if(t.pragmas.has(l.name)){var u=t.pragmas.get(l.name);u instanceof Array?u.push(l.args):t.pragmas.set(l.name,[u,l.args]);}else t.pragmas.set(l.name,l.args);}}function U(t,r){t.checkJsDirective=void 0,t.referencedFiles=[],t.typeReferenceDirectives=[],t.libReferenceDirectives=[],t.amdDependencies=[],t.hasNoDefaultLib=!1,t.pragmas.forEach((function(n,a){switch(a){case"reference":var o=t.referencedFiles,s=t.typeReferenceDirectives,c=t.libReferenceDirectives;e.forEach(e.toArray(n),(function(n){var a=n.arguments,l=a.types,u=a.lib,_=a.path,d=a["resolution-mode"];if(n.arguments["no-default-lib"])t.hasNoDefaultLib=!0;else if(l){var p=function(t,r,n,i){if(t)return "import"===t?e.ModuleKind.ESNext:"require"===t?e.ModuleKind.CommonJS:void i(r,n-r,e.Diagnostics.resolution_mode_should_be_either_require_or_import)}(d,l.pos,l.end,r);s.push(i$1({pos:l.pos,end:l.end,fileName:l.value},p?{resolutionMode:p}:{}));}else u?c.push({pos:u.pos,end:u.end,fileName:u.value}):_?o.push({pos:_.pos,end:_.end,fileName:_.value}):r(n.range.pos,n.range.end-n.range.pos,e.Diagnostics.Invalid_reference_directive_syntax);}));break;case"amd-dependency":t.amdDependencies=e.map(e.toArray(n),(function(e){return {name:e.arguments.name,path:e.arguments.path}}));break;case"amd-module":if(n instanceof Array)for(var l=0,u=n;l<u.length;l++){var _=u[l];t.moduleName&&r(_.range.pos,_.range.end-_.range.pos,e.Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments),t.moduleName=_.arguments.name;}else t.moduleName=n.arguments.name;break;case"ts-nocheck":case"ts-check":e.forEach(e.toArray(n),(function(e){(!t.checkJsDirective||e.range.pos>t.checkJsDirective.pos)&&(t.checkJsDirective={enabled:"ts-check"===a,end:e.range.end,pos:e.range.pos});}));break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:e.Debug.fail("Unhandled pragma kind");}}));}e.forEachChild=L,e.forEachChildRecursively=function(t,r,n){for(var i=R(t),a=[];a.length<i.length;)a.push(t);for(;0!==i.length;){var o=i.pop(),s=a.pop();if(e.isArray(o)){if(n&&(l=n(o,s))){if("skip"===l)continue;return l}for(var c=o.length-1;c>=0;--c)i.push(o[c]),a.push(s);}else {var l;if(l=r(o,s)){if("skip"===l)continue;return l}if(o.kind>=163)for(var u=0,_=R(o);u<_.length;u++){var d=_[u];i.push(d),a.push(o);}}}},e.createSourceFile=function(t,r,n,i,a){var o;void 0===i&&(i=!1),null===e.tracing||void 0===e.tracing||e.tracing.push("parse","createSourceFile",{path:t},!0),e.performance.mark("beforeParse"),e.perfLogger.logStartParseSourceFile(t);var s="object"==typeof n?n:{languageVersion:n},c=s.languageVersion,l=s.setExternalModuleIndicator,u=s.impliedNodeFormat;if(100===c)o=y.parseSourceFile(t,r,c,void 0,i,6,e.noop);else {var _=void 0===u?l:function(e){return e.impliedNodeFormat=u,(l||B)(e)};o=y.parseSourceFile(t,r,c,void 0,i,a,_);}return e.perfLogger.logStopParseSourceFile(),e.performance.mark("afterParse"),e.performance.measure("Parse","beforeParse","afterParse"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o},e.parseIsolatedEntityName=function(e,t){return y.parseIsolatedEntityName(e,t)},e.parseJsonText=function(e,t){return y.parseJsonText(e,t)},e.isExternalModule=j,e.updateSourceFile=function(e,t,r,n){void 0===n&&(n=!1);var i=v.updateSourceFile(e,t,r,n);return i.flags|=6291456&e.flags,i},e.parseIsolatedJSDocComment=function(e,t,r){var n=y.JSDocParser.parseIsolatedJSDocComment(e,t,r);return n&&n.jsDoc&&y.fixupParentReferences(n.jsDoc),n},e.parseJSDocTypeExpressionForTests=function(e,t,r){return y.JSDocParser.parseJSDocTypeExpressionForTests(e,t,r)},function(t){var r,i,a,o,s,c=e.createScanner(99,!0);function l(e){return D++,e}var u,_,d,f,g,m,y,h,b,x,D,S,T,C,E,k,N,A={createBaseSourceFileNode:function(e){return l(new s(e,0,0))},createBaseIdentifierNode:function(e){return l(new a(e,0,0))},createBasePrivateIdentifierNode:function(e){return l(new o(e,0,0))},createBaseTokenNode:function(e){return l(new i(e,0,0))},createBaseNode:function(e){return l(new r(e,0,0))}},F=e.createNodeFactory(11,A),P=!0,w=!1;function I(t,r,n,i,a){void 0===n&&(n=2),void 0===a&&(a=!1),O(t,r,n,i,6),_=N,De();var o,s,c=ye();if(1===he())o=Ye([],c,c),s=He();else {for(var l=void 0;1!==he();){var u=void 0;switch(he()){case 22:u=Fn();break;case 110:case 95:case 104:u=He();break;case 40:u=Pe((function(){return 8===De()&&58!==De()}))?an():wn();break;case 8:case 10:if(Pe((function(){return 58!==De()}))){u=Jt();break}default:u=wn();}l&&e.isArray(l)?l.push(u):l?l=[l,u]:(l=u,1!==he()&&de(e.Diagnostics.Unexpected_token));}var d=e.isArray(l)?Ze(F.createArrayLiteralExpression(l),c):e.Debug.checkDefined(l),p=F.createExpressionStatement(d);Ze(p,c),o=Ye([p],c),s=We(1,e.Diagnostics.Unexpected_token);}var f=W(t,2,6,!1,o,s,_,e.noop);a&&q(f),f.nodeCount=D,f.identifierCount=C,f.identifiers=S,f.parseDiagnostics=e.attachFileToDiagnostics(y,f),h&&(f.jsDocDiagnostics=e.attachFileToDiagnostics(h,f));var g=f;return M(),g}function O(t,n,l,p,v){switch(r=e.objectAllocator.getNodeConstructor(),i=e.objectAllocator.getTokenConstructor(),a=e.objectAllocator.getIdentifierConstructor(),o=e.objectAllocator.getPrivateIdentifierConstructor(),s=e.objectAllocator.getSourceFileConstructor(),u=e.normalizePath(t),d=n,f=l,b=p,g=v,m=e.getLanguageVariant(v),y=[],E=0,S=new e.Map,T=new e.Map,C=0,D=0,_=0,P=!0,g){case 1:case 2:N=262144;break;case 6:N=67371008;break;default:N=0;}w=!1,c.setText(d),c.setOnError(me),c.setScriptTarget(f),c.setLanguageVariant(m);}function M(){c.clearCommentDirectives(),c.setText(""),c.setOnError(void 0),d=void 0,f=void 0,b=void 0,g=void 0,m=void 0,_=0,y=void 0,h=void 0,E=0,S=void 0,k=void 0,P=!0;}function L(t,r,n,i){var a=J(u);a&&(N|=16777216),_=N,De();var o=Tt(0,Hn);e.Debug.assert(1===he());var s=V(He()),l=W(u,t,n,a,o,s,_,i);return z(l,d),U(l,(function(t,r,n){y.push(e.createDetachedDiagnostic(u,t,r,n));})),l.commentDirectives=c.getCommentDirectives(),l.nodeCount=D,l.identifierCount=C,l.identifiers=S,l.parseDiagnostics=e.attachFileToDiagnostics(y,l),h&&(l.jsDocDiagnostics=e.attachFileToDiagnostics(h,l)),r&&q(l),l}function R(e,t){return t?V(e):e}t.parseSourceFile=function(t,r,n,i,a,o,s){var c;if(void 0===a&&(a=!1),6===(o=e.ensureScriptKind(t,o))){var l=I(t,r,n,i,a);return e.convertToObjectWorker(l,null===(c=l.statements[0])||void 0===c?void 0:c.expression,l.parseDiagnostics,!1,void 0,void 0),l.referencedFiles=e.emptyArray,l.typeReferenceDirectives=e.emptyArray,l.libReferenceDirectives=e.emptyArray,l.amdDependencies=e.emptyArray,l.hasNoDefaultLib=!1,l.pragmas=e.emptyMap,l}O(t,r,n,i,o);var u=L(n,a,o,s||B);return M(),u},t.parseIsolatedEntityName=function(e,t){O("",e,t,void 0,1),De();var r=It(!0),n=1===he()&&!y.length;return M(),n?r:void 0},t.parseJsonText=I;var K=!1;function V(t){e.Debug.assert(!t.jsDoc);var r=e.mapDefined(e.getJSDocCommentRanges(t,d),(function(e){return Be.parseJSDocComment(t,e.pos,e.end-e.pos)}));return r.length&&(t.jsDoc=r),K&&(K=!1,t.flags|=268435456),t}function q(t){e.setParentRecursive(t,!0);}function W(t,r,n,i,a,o,s,l){var u=F.createSourceFile(a,o,s);return e.setTextRangePosWidth(u,0,d.length),_(u),!i&&j(u)&&67108864&u.transformFlags&&(u=function(t){var r=b,n=v.createSyntaxCursor(t);b={currentNode:function(e){var t=n.currentNode(e);return P&&t&&d(t)&&(t.intersectsChange=!0),t}};var i=[],a=y;y=[];for(var o=0,s=p(t.statements,0),l=function(){var r=t.statements[o],n=t.statements[s];e.addRange(i,t.statements,o,s),o=f(t.statements,s);var l=e.findIndex(a,(function(e){return e.start>=r.pos})),u=l>=0?e.findIndex(a,(function(e){return e.start>=n.pos}),l):-1;l>=0&&e.addRange(y,a,l,u>=0?u:void 0),Fe((function(){var e=N;for(N|=32768,c.setTextPos(n.pos),De();1!==he();){var r=c.getStartPos(),a=Ct(0,Hn);if(i.push(a),r===c.getStartPos()&&De(),o>=0){var s=t.statements[o];if(a.end===s.pos)break;a.end>s.pos&&(o=f(t.statements,o+1));}}N=e;}),2),s=o>=0?p(t.statements,o):-1;};-1!==s;)l();if(o>=0){var u=t.statements[o];e.addRange(i,t.statements,o);var _=e.findIndex(a,(function(e){return e.start>=u.pos}));_>=0&&e.addRange(y,a,_);}return b=r,F.updateSourceFile(t,e.setTextRange(F.createNodeArray(i),t.statements));function d(e){return !(32768&e.flags||!(67108864&e.transformFlags))}function p(e,t){for(var r=t;r<e.length;r++)if(d(e[r]))return r;return -1}function f(e,t){for(var r=t;r<e.length;r++)if(!d(e[r]))return r;return -1}}(u),_(u)),u;function _(a){a.text=d,a.bindDiagnostics=[],a.bindSuggestionDiagnostics=void 0,a.languageVersion=r,a.fileName=t,a.languageVariant=e.getLanguageVariant(n),a.isDeclarationFile=i,a.scriptKind=n,l(a),a.setExternalModuleIndicator=l;}}function H(e,t){e?N|=t:N&=~t;}function G(e){H(e,4096);}function X(e){H(e,8192);}function Y(e){H(e,16384);}function Z(e){H(e,32768);}function $(e,t){var r=e&N;if(r){H(!1,r);var n=t();return H(!0,r),n}return t()}function ee(e,t){var r=e&~N;if(r){H(!0,r);var n=t();return H(!1,r),n}return t()}function te(e){return $(4096,e)}function re(e){return $(65536,e)}function ne(e){return ee(65536,e)}function ie(e){return ee(32768,e)}function ae(e){return $(32768,e)}function oe(e){return 0!=(N&e)}function se(){return oe(8192)}function ce(){return oe(4096)}function le(){return oe(65536)}function ue(){return oe(16384)}function _e(){return oe(32768)}function de(e,t){return fe(c.getTokenPos(),c.getTextPos(),e,t)}function pe(t,r,n,i){var a,o=e.lastOrUndefined(y);return o&&t===o.start||(a=e.createDetachedDiagnostic(u,t,r,n,i),y.push(a)),w=!0,a}function fe(e,t,r,n){return pe(e,t-e,r,n)}function ge(e,t,r){fe(e.pos,e.end,t,r);}function me(e,t){pe(c.getTextPos(),t,e);}function ye(){return c.getStartPos()}function ve(){return c.hasPrecedingJSDocComment()}function he(){return x}function be(){return x=c.scan()}function xe(e){return De(),e()}function De(){return e.isKeyword(x)&&(c.hasUnicodeEscape()||c.hasExtendedUnicodeEscape())&&fe(c.getTokenPos(),c.getTextPos(),e.Diagnostics.Keywords_cannot_contain_escape_characters),be()}function Se(){return x=c.scanJsDocToken()}function Te(){return x=c.reScanGreaterToken()}function Ce(){return x=c.reScanTemplateHeadOrNoSubstitutionTemplate()}function Ee(){return x=c.reScanLessThanToken()}function ke(){return x=c.reScanHashToken()}function Ne(){return x=c.scanJsxIdentifier()}function Ae(){return x=c.scanJsxToken()}function Fe(t,r){var n=x,i=y.length,a=w,o=N,s=0!==r?c.lookAhead(t):c.tryScan(t);return e.Debug.assert(o===N),s&&0===r||(x=n,2!==r&&(y.length=i),w=a),s}function Pe(e){return Fe(e,1)}function we(e){return Fe(e,0)}function Ie(){return 79===he()||he()>116}function Oe(){return 79===he()||(125!==he()||!se())&&(133!==he()||!_e())&&he()>116}function Me(t,r,n){return void 0===n&&(n=!0),he()===t?(n&&De(),!0):(r?de(r):de(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}t.fixupParentReferences=q;var Le,Re,Be,je=Object.keys(e.textToKeywordObj).filter((function(e){return e.length>2}));function Je(t){var r;if(e.isTaggedTemplateExpression(t))fe(e.skipTrivia(d,t.template.pos),t.template.end,e.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);else {var n=e.isIdentifier(t)?e.idText(t):void 0;if(n&&e.isIdentifierText(n,f)){var i=e.skipTrivia(d,t.pos);switch(n){case"const":case"let":case"var":return void fe(i,t.end,e.Diagnostics.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void ze(e.Diagnostics.Interface_name_cannot_be_0,e.Diagnostics.Interface_must_be_given_a_name,18);case"is":return void fe(i,c.getTextPos(),e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void ze(e.Diagnostics.Namespace_name_cannot_be_0,e.Diagnostics.Namespace_must_be_given_a_name,18);case"type":return void ze(e.Diagnostics.Type_alias_name_cannot_be_0,e.Diagnostics.Type_alias_must_be_given_a_name,63)}var a=null!==(r=e.getSpellingSuggestion(n,je,(function(e){return e})))&&void 0!==r?r:function(t){for(var r=0,n=je;r<n.length;r++){var i=n[r];if(t.length>i.length+2&&e.startsWith(t,i))return "".concat(i," ").concat(t.slice(i.length))}}(n);a?fe(i,t.end,e.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0,a):0!==he()&&fe(i,t.end,e.Diagnostics.Unexpected_keyword_or_identifier);}else de(e.Diagnostics._0_expected,e.tokenToString(26));}}function ze(e,t,r){he()===r?de(t):de(e,c.getTokenValue());}function Ue(t){return he()===t?(Se(),!0):(de(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function Ke(t,r,n,i){if(he()!==r){var a=de(e.Diagnostics._0_expected,e.tokenToString(r));n&&a&&e.addRelatedInfo(a,e.createDetachedDiagnostic(u,i,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,e.tokenToString(t),e.tokenToString(r)));}else De();}function Ve(e){return he()===e&&(De(),!0)}function qe(e){if(he()===e)return He()}function We(t,r,n){return qe(t)||$e(t,!1,r||e.Diagnostics._0_expected,n||e.tokenToString(t))}function He(){var e=ye(),t=he();return De(),Ze(F.createToken(t),e)}function Ge(){return 26===he()||19===he()||1===he()||c.hasPrecedingLineBreak()}function Qe(){return !!Ge()&&(26===he()&&De(),!0)}function Xe(){return Qe()||Me(26)}function Ye(t,r,n,i){var a=F.createNodeArray(t,i);return e.setTextRangePosEnd(a,r,null!=n?n:c.getStartPos()),a}function Ze(t,r,n){return e.setTextRangePosEnd(t,r,null!=n?n:c.getStartPos()),N&&(t.flags|=N),w&&(w=!1,t.flags|=131072),t}function $e(t,r,n,i){r?pe(c.getStartPos(),0,n,i):n&&de(n,i);var a=ye();return Ze(79===t?F.createIdentifier("",void 0,void 0):e.isTemplateLiteralKind(t)?F.createTemplateLiteralLikeNode(t,"","",void 0):8===t?F.createNumericLiteral("",void 0):10===t?F.createStringLiteral("",void 0):279===t?F.createMissingDeclaration():F.createToken(t),a)}function et(e){var t=S.get(e);return void 0===t&&S.set(e,t=e),t}function tt(t,r,n){if(t){C++;var i=ye(),a=he(),o=et(c.getTokenValue()),s=c.hasExtendedUnicodeEscape();return be(),Ze(F.createIdentifier(o,void 0,a,s),i)}if(80===he())return de(n||e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),tt(!0);if(0===he()&&c.tryScan((function(){return 79===c.reScanInvalidIdentifier()})))return tt(!0);C++;var l=1===he(),u=c.isReservedWord(),_=c.getTokenText(),d=u?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:e.Diagnostics.Identifier_expected;return $e(79,l,r||d,_)}function rt(e){return tt(Ie(),void 0,e)}function nt(e,t){return tt(Oe(),e,t)}function it(t){return tt(e.tokenIsIdentifierOrKeyword(he()),t)}function at(){return e.tokenIsIdentifierOrKeyword(he())||10===he()||8===he()}function ot(){return function(e){if(10===he()||8===he()){var t=Jt();return t.text=et(t.text),t}return e&&22===he()?function(){var e=ye();Me(22);var t=te(Vr);return Me(23),Ze(F.createComputedPropertyName(t),e)}():80===he()?st():it()}(!0)}function st(){var e,t,r=ye(),n=F.createPrivateIdentifier((e=c.getTokenValue(),void 0===(t=T.get(e))&&T.set(e,t=e),t));return De(),Ze(n,r)}function ct(e){return he()===e&&we(ut)}function lt(){return De(),!c.hasPrecedingLineBreak()&&pt()}function ut(){switch(he()){case 85:return 92===De();case 93:return De(),88===he()?Pe(ft):154===he()?Pe(dt):_t();case 88:return ft();case 127:case 124:case 137:case 151:return De(),pt();default:return lt()}}function _t(){return 41!==he()&&128!==he()&&18!==he()&&pt()}function dt(){return De(),_t()}function pt(){return 22===he()||18===he()||41===he()||25===he()||at()}function ft(){return De(),84===he()||98===he()||118===he()||126===he()&&Pe(Jn)||132===he()&&Pe(zn)}function gt(t,r){if(Et(t))return !0;switch(t){case 0:case 1:case 3:return !(26===he()&&r)&&qn();case 2:return 82===he()||88===he();case 4:return Pe(lr);case 5:return Pe(di)||26===he()&&!r;case 6:return 22===he()||at();case 12:switch(he()){case 22:case 41:case 25:case 24:return !0;default:return at()}case 18:return at();case 9:return 22===he()||25===he()||at();case 24:return e.tokenIsIdentifierOrKeyword(he())||10===he();case 7:return 18===he()?Pe(mt):r?Oe()&&!bt():Ur()&&!bt();case 8:return ei();case 10:return 27===he()||25===he()||ei();case 19:return 101===he()||Oe();case 15:switch(he()){case 27:case 24:return !0}case 11:return 25===he()||Kr();case 16:return Zt(!1);case 17:return Zt(!0);case 20:case 21:return 27===he()||kr();case 22:return ki();case 23:return e.tokenIsIdentifierOrKeyword(he());case 13:return e.tokenIsIdentifierOrKeyword(he())||18===he();case 14:return !0}return e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function mt(){if(e.Debug.assert(18===he()),19===De()){var t=De();return 27===t||18===t||94===t||117===t}return !0}function yt(){return De(),Oe()}function vt(){return De(),e.tokenIsIdentifierOrKeyword(he())}function ht(){return De(),e.tokenIsIdentifierOrKeywordOrGreaterThan(he())}function bt(){return (117===he()||94===he())&&Pe(xt)}function xt(){return De(),Kr()}function Dt(){return De(),kr()}function St(e){if(1===he())return !0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 19===he();case 3:return 19===he()||82===he()||88===he();case 7:return 18===he()||94===he()||117===he();case 8:return !!Ge()||!!$r(he())||38===he();case 19:return 31===he()||20===he()||18===he()||94===he()||117===he();case 11:return 21===he()||26===he();case 15:case 21:case 10:return 23===he();case 17:case 16:case 18:return 21===he()||23===he();case 20:return 27!==he();case 22:return 18===he()||19===he();case 13:return 31===he()||43===he();case 14:return 29===he()&&Pe(Oi);default:return !1}}function Tt(e,t){var r=E;E|=1<<e;for(var n=[],i=ye();!St(e);)if(gt(e,!1))n.push(Ct(e,t));else if(Nt(e))break;return E=r,Ye(n,i)}function Ct(e,t){var r=Et(e);return r?kt(r):t()}function Et(t,r){if(b&&function(e){switch(e){case 5:case 2:case 0:case 1:case 3:case 6:case 4:case 8:case 17:case 16:return !0}return !1}(t)&&!w){var n=b.currentNode(null!=r?r:c.getStartPos());if(!(e.nodeIsMissing(n)||n.intersectsChange||e.containsParseError(n))&&(50720768&n.flags)===N&&function(e,t){switch(t){case 5:return function(e){if(e)switch(e.kind){case 173:case 178:case 174:case 175:case 169:case 237:return !0;case 171:var t=e;return !(79===t.name.kind&&135===t.name.originalKeywordKind)}return !1}(e);case 2:return function(e){if(e)switch(e.kind){case 292:case 293:return !0}return !1}(e);case 0:case 1:case 3:return function(e){if(e)switch(e.kind){case 259:case 240:case 238:case 242:case 241:case 254:case 250:case 252:case 249:case 248:case 246:case 247:case 245:case 244:case 251:case 239:case 255:case 253:case 243:case 256:case 269:case 268:case 275:case 274:case 264:case 260:case 261:case 263:case 262:return !0}return !1}(e);case 6:return function(e){return 302===e.kind}(e);case 4:return function(e){if(e)switch(e.kind){case 177:case 170:case 178:case 168:case 176:return !0}return !1}(e);case 8:return function(e){return 257===e.kind&&void 0===e.initializer}(e);case 17:case 16:return function(e){return 166===e.kind&&void 0===e.initializer}(e)}return !1}(n,t))return n.jsDocCache&&(n.jsDocCache=void 0),n}}function kt(e){return c.setTextPos(e.end),De(),e}function Nt(t){return function(t){switch(t){case 0:return 88===he()?de(e.Diagnostics._0_expected,e.tokenToString(93)):de(e.Diagnostics.Declaration_or_statement_expected);case 1:return de(e.Diagnostics.Declaration_or_statement_expected);case 2:return de(e.Diagnostics.case_or_default_expected);case 3:return de(e.Diagnostics.Statement_expected);case 18:case 4:return de(e.Diagnostics.Property_or_signature_expected);case 5:return de(e.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected);case 6:return de(e.Diagnostics.Enum_member_expected);case 7:return de(e.Diagnostics.Expression_expected);case 8:return e.isKeyword(he())?de(e.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name,e.tokenToString(he())):de(e.Diagnostics.Variable_declaration_expected);case 9:return de(e.Diagnostics.Property_destructuring_pattern_expected);case 10:return de(e.Diagnostics.Array_element_destructuring_pattern_expected);case 11:return de(e.Diagnostics.Argument_expression_expected);case 12:return de(e.Diagnostics.Property_assignment_expected);case 15:return de(e.Diagnostics.Expression_or_comma_expected);case 17:return de(e.Diagnostics.Parameter_declaration_expected);case 16:return e.isKeyword(he())?de(e.Diagnostics._0_is_not_allowed_as_a_parameter_name,e.tokenToString(he())):de(e.Diagnostics.Parameter_declaration_expected);case 19:return de(e.Diagnostics.Type_parameter_declaration_expected);case 20:return de(e.Diagnostics.Type_argument_expected);case 21:return de(e.Diagnostics.Type_expected);case 22:return de(e.Diagnostics.Unexpected_token_expected);case 23:case 13:case 14:return de(e.Diagnostics.Identifier_expected);case 24:return de(e.Diagnostics.Identifier_or_string_literal_expected);case 25:return e.Debug.fail("ParsingContext.Count used as a context");default:e.Debug.assertNever(t);}}(t),!!function(){for(var e=0;e<25;e++)if(E&1<<e&&(gt(e,!0)||St(e)))return !0;return !1}()||(De(),!1)}function At(e,t,r){var n=E;E|=1<<e;for(var i=[],a=ye(),o=-1;;)if(gt(e,!1)){var s=c.getStartPos(),l=Ct(e,t);if(!l)return void(E=n);if(i.push(l),o=c.getTokenPos(),Ve(27))continue;if(o=-1,St(e))break;Me(27,Ft(e)),r&&26===he()&&!c.hasPrecedingLineBreak()&&De(),s===c.getStartPos()&&De();}else {if(St(e))break;if(Nt(e))break}return E=n,Ye(i,a,void 0,o>=0)}function Ft(t){return 6===t?e.Diagnostics.An_enum_member_name_must_be_followed_by_a_or:void 0}function Pt(){var e=Ye([],ye());return e.isMissingList=!0,e}function wt(e,t,r,n){if(Me(r)){var i=At(e,t);return Me(n),i}return Pt()}function It(e,t){for(var r=ye(),n=e?it(t):nt(t),i=ye();Ve(24);){if(29===he()){n.jsdocDotPos=i;break}i=ye(),n=Ze(F.createQualifiedName(n,Mt(e,!1)),r);}return n}function Ot(e,t){return Ze(F.createQualifiedName(e,t),e.pos)}function Mt(t,r){if(c.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(he())&&Pe(jn))return $e(79,!0,e.Diagnostics.Identifier_expected);if(80===he()){var n=st();return r?n:$e(79,!0,e.Diagnostics.Identifier_expected)}return t?it():nt()}function Lt(e){var t=ye();return Ze(F.createTemplateExpression(zt(e),function(e){var t,r=ye(),n=[];do{t=jt(e),n.push(t);}while(16===t.literal.kind);return Ye(n,r)}(e)),t)}function Rt(){var e=ye();return Ze(F.createTemplateLiteralTypeSpan(Jr(),Bt(!1)),e)}function Bt(t){return 19===he()?(function(e){x=c.reScanTemplateToken(e);}(t),r=Ut(he()),e.Debug.assert(16===r.kind||17===r.kind,"Template fragment has wrong token kind"),r):We(17,e.Diagnostics._0_expected,e.tokenToString(19));var r;}function jt(e){var t=ye();return Ze(F.createTemplateSpan(te(Vr),Bt(e)),t)}function Jt(){return Ut(he())}function zt(t){t&&Ce();var r=Ut(he());return e.Debug.assert(15===r.kind,"Template head has wrong token kind"),r}function Ut(t){var r=ye(),n=e.isTemplateLiteralKind(t)?F.createTemplateLiteralLikeNode(t,c.getTokenValue(),function(e){var t=14===e||17===e,r=c.getTokenText();return r.substring(1,r.length-(c.isUnterminated()?0:t?1:2))}(t),2048&c.getTokenFlags()):8===t?F.createNumericLiteral(c.getTokenValue(),c.getNumericLiteralFlags()):10===t?F.createStringLiteral(c.getTokenValue(),void 0,c.hasExtendedUnicodeEscape()):e.isLiteralKind(t)?F.createLiteralLikeNode(t,c.getTokenValue()):e.Debug.fail();return c.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),c.isUnterminated()&&(n.isUnterminated=!0),De(),Ze(n,r)}function Kt(){return It(!0,e.Diagnostics.Type_expected)}function Vt(){if(!c.hasPrecedingLineBreak()&&29===Ee())return wt(20,Jr,29,31)}function qt(){var e=ye();return Ze(F.createTypeReferenceNode(Kt(),Vt()),e)}function Wt(t){switch(t.kind){case 180:return e.nodeIsMissing(t.typeName);case 181:case 182:var r=t,n=r.parameters,i=r.type;return !!n.isMissingList||Wt(i);case 193:return Wt(t.type);default:return !1}}function Ht(){var e=ye();return De(),Ze(F.createThisTypeNode(),e)}function Gt(){var e,t=ye();return 108!==he()&&103!==he()||(e=it(),Me(58)),Ze(F.createParameterDeclaration(void 0,void 0,e,void 0,Qt(),void 0),t)}function Qt(){c.setInJSDocType(!0);var e=ye();if(Ve(142)){var t=F.createJSDocNamepathType(void 0);e:for(;;)switch(he()){case 19:case 1:case 27:case 5:break e;default:Se();}return c.setInJSDocType(!1),Ze(t,e)}var r=Ve(25),n=Br();return c.setInJSDocType(!1),r&&(n=Ze(F.createJSDocVariadicType(n),e)),63===he()?(De(),Ze(F.createJSDocOptionalType(n),e)):n}function Xt(){var e,t,r=ye(),n=vi(),i=nt();Ve(94)&&(kr()||!Kr()?e=Jr():t=on());var a=Ve(63)?Jr():void 0,o=F.createTypeParameterDeclaration(n,i,e,a);return o.expression=t,Ze(o,r)}function Yt(){if(29===he())return wt(19,Xt,29,31)}function Zt(t){return 25===he()||ei()||e.isModifierKind(he())||59===he()||kr(!t)}function $t(e){return er(e)}function er(t,r){void 0===r&&(r=!0);var n=ye(),i=ve(),a=t?ie(gi):ae(gi);if(108===he()){var o=F.createParameterDeclaration(a,void 0,tt(!0),void 0,zr(),void 0);return a&&ge(a[0],e.Diagnostics.Decorators_may_not_be_applied_to_this_parameters),R(Ze(o,n),i)}var s=P;P=!1;var c=yi(a,vi()),l=qe(25);if(r||Ie()||22===he()||18===he()){var u=R(Ze(F.createParameterDeclaration(c,l,function(t){var r=ti(e.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);return 0===e.getFullWidth(r)&&!e.some(t)&&e.isModifierKind(he())&&De(),r}(c),qe(57),zr(),qr()),n),i);return P=s,u}}function tr(t,r){if(function(t,r){return 38===t?(Me(t),!0):!!Ve(58)||!(!r||38!==he())&&(de(e.Diagnostics._0_expected,e.tokenToString(58)),De(),!0)}(t,r))return re(Br)}function rr(e,t){var r=se(),n=_e();X(!!(1&e)),Z(!!(2&e));var i=32&e?At(17,Gt):At(16,(function(){return t?$t(n):er(n,!1)}));return X(r),Z(n),i}function nr(e){if(!Me(20))return Pt();var t=rr(e,!0);return Me(21),t}function ir(){Ve(27)||Xe();}function ar(e){var t=ye(),r=ve();177===e&&Me(103);var n=Yt(),i=nr(4),a=tr(58,!0);return ir(),R(Ze(176===e?F.createCallSignature(n,i,a):F.createConstructSignature(n,i,a),t),r)}function or(){return 22===he()&&Pe(sr)}function sr(){if(De(),25===he()||23===he())return !0;if(e.isModifierKind(he())){if(De(),Oe())return !0}else {if(!Oe())return !1;De();}return 58===he()||27===he()||57===he()&&(De(),58===he()||27===he()||23===he())}function cr(e,t,r,n){var i=wt(16,(function(){return $t(!1)}),22,23),a=zr();ir();var o=F.createIndexSignature(n,i,a);return o.illegalDecorators=r,R(Ze(o,e),t)}function lr(){if(20===he()||29===he()||137===he()||151===he())return !0;for(var t=!1;e.isModifierKind(he());)t=!0,De();return 22===he()||(at()&&(t=!0,De()),!!t&&(20===he()||29===he()||57===he()||58===he()||27===he()||Ge()))}function ur(){if(20===he()||29===he())return ar(176);if(103===he()&&Pe(_r))return ar(177);var e=ye(),t=ve(),r=vi();return ct(137)?_i(e,t,void 0,r,174,4):ct(151)?_i(e,t,void 0,r,175,4):or()?cr(e,t,void 0,r):function(e,t,r){var n,i=ot(),a=qe(57);if(20===he()||29===he()){var o=Yt(),s=nr(4),c=tr(58,!0);n=F.createMethodSignature(r,i,a,o,s,c);}else c=zr(),n=F.createPropertySignature(r,i,a,c),63===he()&&(n.initializer=qr());return ir(),R(Ze(n,e),t)}(e,t,r)}function _r(){return De(),20===he()||29===he()}function dr(){return 24===De()}function pr(){switch(De()){case 20:case 29:case 24:return !0}return !1}function fr(){var e;return Me(18)?(e=Tt(4,ur),Me(19)):e=Pt(),e}function gr(){return De(),39===he()||40===he()?146===De():(146===he()&&De(),22===he()&&yt()&&101===De())}function mr(){var t=ye();if(Ve(25))return Ze(F.createRestTypeNode(Jr()),t);var r=Jr();if(e.isJSDocNullableType(r)&&r.pos===r.type.pos){var n=F.createOptionalTypeNode(r.type);return e.setTextRange(n,r),n.flags=r.flags,n}return r}function yr(){return 58===De()||57===he()&&58===De()}function vr(){return 25===he()?e.tokenIsIdentifierOrKeyword(De())&&yr():e.tokenIsIdentifierOrKeyword(he())&&yr()}function hr(){if(Pe(vr)){var e=ye(),t=ve(),r=qe(25),n=it(),i=qe(57);Me(58);var a=mr();return R(Ze(F.createNamedTupleMember(r,n,i,a),e),t)}return mr()}function br(){var e=ye(),t=ve(),r=function(){var e;if(126===he()){var t=ye();De(),e=Ye([Ze(F.createToken(126),t)],t);}return e}(),n=Ve(103),i=Yt(),a=nr(4),o=tr(38,!1),s=n?F.createConstructorTypeNode(r,i,a,o):F.createFunctionTypeNode(i,a,o);return n||(s.modifiers=r),R(Ze(s,e),t)}function xr(){var e=He();return 24===he()?void 0:e}function Dr(e){var t=ye();e&&De();var r=110===he()||95===he()||104===he()?He():Ut(he());return e&&(r=Ze(F.createPrefixUnaryExpression(40,r),t)),Ze(F.createLiteralTypeNode(r),t)}function Sr(){return De(),100===he()}function Tr(){_|=2097152;var t=ye(),r=Ve(112);Me(100),Me(20);var n,i=Jr();Ve(27)&&(n=function(){var t=ye(),r=c.getTokenPos();Me(18);var n=c.hasPrecedingLineBreak();Me(130),Me(58);var i=Li(!0);if(!Me(19)){var a=e.lastOrUndefined(y);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(u,r,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"));}return Ze(F.createImportTypeAssertionContainer(i,n),t)}()),Me(21);var a=Ve(24)?Kt():void 0,o=Vt();return Ze(F.createImportTypeNode(i,n,a,o,r),t)}function Cr(){return De(),8===he()||9===he()}function Er(){switch(he()){case 131:case 157:case 152:case 148:case 160:case 153:case 134:case 155:case 144:case 149:return we(xr)||qt();case 66:c.reScanAsteriskEqualsToken();case 41:return r=ye(),De(),Ze(F.createJSDocAllType(),r);case 60:c.reScanQuestionToken();case 57:return function(){var e=ye();return De(),27===he()||19===he()||21===he()||31===he()||63===he()||51===he()?Ze(F.createJSDocUnknownType(),e):Ze(F.createJSDocNullableType(Jr(),!1),e)}();case 98:return function(){var e=ye(),t=ve();if(Pe(wi)){De();var r=nr(36),n=tr(58,!1);return R(Ze(F.createJSDocFunctionType(r,n),e),t)}return Ze(F.createTypeReferenceNode(it(),void 0),e)}();case 53:return function(){var e=ye();return De(),Ze(F.createJSDocNonNullableType(Er(),!1),e)}();case 14:case 10:case 8:case 9:case 110:case 95:case 104:return Dr();case 40:return Pe(Cr)?Dr(!0):qt();case 114:return He();case 108:var e=Ht();return 140!==he()||c.hasPrecedingLineBreak()?e:(t=e,De(),Ze(F.createTypePredicateNode(void 0,t,Jr()),t.pos));case 112:return Pe(Sr)?Tr():function(){var e=ye();Me(112);var t=It(!0),r=c.hasPrecedingLineBreak()?void 0:Ei();return Ze(F.createTypeQueryNode(t,r),e)}();case 18:return Pe(gr)?function(){var e,t=ye();Me(18),146!==he()&&39!==he()&&40!==he()||146!==(e=He()).kind&&Me(146),Me(22);var r,n=function(){var e=ye(),t=it();Me(101);var r=Jr();return Ze(F.createTypeParameterDeclaration(void 0,t,r,void 0),e)}(),i=Ve(128)?Jr():void 0;Me(23),57!==he()&&39!==he()&&40!==he()||57!==(r=He()).kind&&Me(57);var a=zr();Xe();var o=Tt(4,ur);return Me(19),Ze(F.createMappedTypeNode(e,n,i,r,a,o),t)}():function(){var e=ye();return Ze(F.createTypeLiteralNode(fr()),e)}();case 22:return function(){var e=ye();return Ze(F.createTupleTypeNode(wt(21,hr,22,23)),e)}();case 20:return function(){var e=ye();Me(20);var t=Jr();return Me(21),Ze(F.createParenthesizedType(t),e)}();case 100:return Tr();case 129:return Pe(jn)?function(){var e=ye(),t=We(129),r=108===he()?Ht():nt(),n=Ve(140)?Jr():void 0;return Ze(F.createTypePredicateNode(t,r,n),e)}():qt();case 15:return function(){var e=ye();return Ze(F.createTemplateLiteralType(zt(!1),function(){var e,t=ye(),r=[];do{e=Rt(),r.push(e);}while(16===e.literal.kind);return Ye(r,t)}()),e)}();default:return qt()}var t,r;}function kr(e){switch(he()){case 131:case 157:case 152:case 148:case 160:case 134:case 146:case 153:case 156:case 114:case 155:case 104:case 108:case 112:case 144:case 18:case 22:case 29:case 51:case 50:case 103:case 10:case 8:case 9:case 110:case 95:case 149:case 41:case 57:case 53:case 25:case 138:case 100:case 129:case 14:case 15:return !0;case 98:return !e;case 40:return !e&&Pe(Cr);case 20:return !e&&Pe(Nr);default:return Oe()}}function Nr(){return De(),21===he()||Zt(!1)||kr()}function Ar(){for(var e=ye(),t=Er();!c.hasPrecedingLineBreak();)switch(he()){case 53:De(),t=Ze(F.createJSDocNonNullableType(t,!0),e);break;case 57:if(Pe(Dt))return t;De(),t=Ze(F.createJSDocNullableType(t,!0),e);break;case 22:if(Me(22),kr()){var r=Jr();Me(23),t=Ze(F.createIndexedAccessTypeNode(t,r),e);}else Me(23),t=Ze(F.createArrayTypeNode(t),e);break;default:return t}return t}function Fr(){if(Ve(94)){var e=ne(Jr);if(le()||57!==he())return e}}function Pr(){var e,t=he();switch(t){case 141:case 156:case 146:return function(e){var t=ye();return Me(e),Ze(F.createTypeOperatorNode(e,Pr()),t)}(t);case 138:return e=ye(),Me(138),Ze(F.createInferTypeNode(function(){var e=ye(),t=nt(),r=we(Fr);return Ze(F.createTypeParameterDeclaration(void 0,t,r),e)}()),e)}return re(Ar)}function wr(t){if(Lr()){var r=br();return ge(r,e.isFunctionTypeNode(r)?t?e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t?e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type),r}}function Ir(e,t,r){var n=ye(),i=51===e,a=Ve(e),o=a&&wr(i)||t();if(he()===e||a){for(var s=[o];Ve(e);)s.push(wr(i)||t());o=Ze(r(Ye(s,n)),n);}return o}function Or(){return Ir(50,Pr,F.createIntersectionTypeNode)}function Mr(){return De(),103===he()}function Lr(){return 29===he()||!(20!==he()||!Pe(Rr))||103===he()||126===he()&&Pe(Mr)}function Rr(){if(De(),21===he()||25===he())return !0;if(function(){if(e.isModifierKind(he())&&vi(),Oe()||108===he())return De(),!0;if(22===he()||18===he()){var t=y.length;return ti(),t===y.length}return !1}()){if(58===he()||27===he()||57===he()||63===he())return !0;if(21===he()&&(De(),38===he()))return !0}return !1}function Br(){var e=ye(),t=Oe()&&we(jr),r=Jr();return t?Ze(F.createTypePredicateNode(void 0,t,r),e):r}function jr(){var e=nt();if(140===he()&&!c.hasPrecedingLineBreak())return De(),e}function Jr(){if(40960&N)return $(40960,Jr);if(Lr())return br();var e=ye(),t=Ir(51,Or,F.createUnionTypeNode);if(!le()&&!c.hasPrecedingLineBreak()&&Ve(94)){var r=ne(Jr);Me(57);var n=re(Jr);Me(58);var i=re(Jr);return Ze(F.createConditionalTypeNode(t,r,n,i),e)}return t}function zr(){return Ve(58)?Jr():void 0}function Ur(){switch(he()){case 108:case 106:case 104:case 110:case 95:case 8:case 9:case 10:case 14:case 15:case 20:case 22:case 18:case 98:case 84:case 103:case 43:case 68:case 79:return !0;case 100:return Pe(pr);default:return Oe()}}function Kr(){if(Ur())return !0;switch(he()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 45:case 46:case 29:case 133:case 125:case 80:return !0;default:return !!tn()||Oe()}}function Vr(){var e=ue();e&&Y(!1);for(var t,r=ye(),n=Wr(!0);t=qe(27);)n=rn(n,t,Wr(!0),r);return e&&Y(!0),n}function qr(){return Ve(63)?Wr(!0):void 0}function Wr(t){if(125===he()&&(se()||Pe(Un)))return function(){var e=ye();return De(),c.hasPrecedingLineBreak()||41!==he()&&!Kr()?Ze(F.createYieldExpression(void 0,void 0),e):Ze(F.createYieldExpression(qe(41),Wr(!0)),e)}();var r=function(t){var r=20===he()||29===he()||132===he()?Pe(Gr):38===he()?1:0;if(0!==r)return 1===r?Xr(!0,!0):we((function(){return function(t){var r=c.getTokenPos();if(!(null==k?void 0:k.has(r))){var n=Xr(!1,t);return n||(k||(k=new e.Set)).add(r),n}}(t)}))}(t)||function(e){if(132===he()&&1===Pe(Qr)){var t=ye(),r=hi();return Hr(t,Zr(0),e,r)}}(t);if(r)return r;var n=ye(),i=Zr(0);return 79===i.kind&&38===he()?Hr(n,i,t,void 0):e.isLeftHandSideExpression(i)&&e.isAssignmentOperator(Te())?rn(i,He(),Wr(t),n):function(t,r,n){var i,a=qe(57);return a?Ze(F.createConditionalExpression(t,a,$(20480,(function(){return Wr(!1)})),i=We(58),e.nodeIsPresent(i)?Wr(n):$e(79,!1,e.Diagnostics._0_expected,e.tokenToString(58))),r):t}(i,n,t)}function Hr(t,r,n,i){e.Debug.assert(38===he(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var a=F.createParameterDeclaration(void 0,void 0,r,void 0,void 0,void 0);Ze(a,r.pos);var o=Ye([a],a.pos,a.end),s=We(38),c=Yr(!!i,n);return V(Ze(F.createArrowFunction(i,void 0,o,void 0,s,c),t))}function Gr(){if(132===he()){if(De(),c.hasPrecedingLineBreak())return 0;if(20!==he()&&29!==he())return 0}var t=he(),r=De();if(20===t){if(21===r)switch(De()){case 38:case 58:case 18:return 1;default:return 0}if(22===r||18===r)return 2;if(25===r)return 1;if(e.isModifierKind(r)&&132!==r&&Pe(yt))return 128===De()?0:1;if(!Oe()&&108!==r)return 0;switch(De()){case 58:return 1;case 57:return De(),58===he()||27===he()||63===he()||21===he()?1:0;case 27:case 63:case 21:return 2}return 0}return e.Debug.assert(29===t),Oe()?1===m?Pe((function(){var e=De();if(94===e)switch(De()){case 63:case 31:return !1;default:return !0}else if(27===e||63===e)return !0;return !1}))?1:0:2:0}function Qr(){if(132===he()){if(De(),c.hasPrecedingLineBreak()||38===he())return 0;var e=Zr(0);if(!c.hasPrecedingLineBreak()&&79===e.kind&&38===he())return 1}return 0}function Xr(t,r){var n,i=ye(),a=ve(),o=hi(),s=e.some(o,e.isAsyncModifier)?2:0,c=Yt();if(Me(20)){if(t)n=rr(s,t);else {var l=rr(s,t);if(!l)return;n=l;}if(!Me(21)&&!t)return}else {if(!t)return;n=Pt();}var u=58===he(),_=tr(58,!1);if(!_||t||!Wt(_)){for(var d=_;193===(null==d?void 0:d.kind);)d=d.type;var p=d&&e.isJSDocFunctionType(d);if(t||38===he()||!p&&18===he()){var f=he(),g=We(38),m=38===f||18===f?Yr(e.some(o,e.isAsyncModifier),r):nt();if(r||!u||58===he())return R(Ze(F.createArrowFunction(o,c,n,_,g,m),i),a)}}}function Yr(e,t){if(18===he())return Ln(e?2:0);if(26!==he()&&98!==he()&&84!==he()&&qn()&&(18===he()||98===he()||84===he()||59===he()||!Kr()))return Ln(16|(e?2:0));var r=P;P=!1;var n=e?ie((function(){return Wr(t)})):ae((function(){return Wr(t)}));return P=r,n}function Zr(e){var t=ye();return en(e,on(),t)}function $r(e){return 101===e||162===e}function en(t,r,n){for(;;){Te();var i=e.getBinaryOperatorPrecedence(he());if(!(42===he()?i>=t:i>t))break;if(101===he()&&ce())break;if(128===he()||150===he()){if(c.hasPrecedingLineBreak())break;var a=he();De(),r=150===a?(o=r,s=Jr(),Ze(F.createSatisfiesExpression(o,s),o.pos)):nn(r,Jr());}else r=rn(r,He(),Zr(i),n);}var o,s;return r}function tn(){return (!ce()||101!==he())&&e.getBinaryOperatorPrecedence(he())>0}function rn(e,t,r,n){return Ze(F.createBinaryExpression(e,t,r),n)}function nn(e,t){return Ze(F.createAsExpression(e,t),e.pos)}function an(){var e=ye();return Ze(F.createPrefixUnaryExpression(he(),xe(sn)),e)}function on(){if(function(){switch(he()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 133:return !1;case 29:if(1!==m)return !1;default:return !0}}()){var t=ye(),r=cn();return 42===he()?en(e.getBinaryOperatorPrecedence(he()),r,t):r}var n=he(),i=sn();if(42===he()){t=e.skipTrivia(d,i.pos);var a=i.end;213===i.kind?fe(t,a,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):fe(t,a,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n));}return i}function sn(){switch(he()){case 39:case 40:case 54:case 53:return an();case 89:return e=ye(),Ze(F.createDeleteExpression(xe(sn)),e);case 112:return function(){var e=ye();return Ze(F.createTypeOfExpression(xe(sn)),e)}();case 114:return function(){var e=ye();return Ze(F.createVoidExpression(xe(sn)),e)}();case 29:return function(){var e=ye();Me(29);var t=Jr();Me(31);var r=sn();return Ze(F.createTypeAssertion(t,r),e)}();case 133:if(133===he()&&(_e()||Pe(Un)))return function(){var e=ye();return Ze(F.createAwaitExpression(xe(sn)),e)}();default:return cn()}var e;}function cn(){if(45===he()||46===he()){var t=ye();return Ze(F.createPrefixUnaryExpression(he(),xe(ln)),t)}if(1===m&&29===he()&&Pe(ht))return _n(!0);var r=ln();if(e.Debug.assert(e.isLeftHandSideExpression(r)),(45===he()||46===he())&&!c.hasPrecedingLineBreak()){var n=he();return De(),Ze(F.createPostfixUnaryExpression(r,n),r.pos)}return r}function ln(){var t,r=ye();return 100===he()?Pe(_r)?(_|=2097152,t=He()):Pe(dr)?(De(),De(),t=Ze(F.createMetaProperty(100,it()),r),_|=4194304):t=un():t=106===he()?function(){var t=ye(),r=He();if(29===he()){var n=ye(),i=we(En);void 0!==i&&(fe(n,ye(),e.Diagnostics.super_may_not_use_type_arguments),Dn()||(r=F.createExpressionWithTypeArguments(r,i)));}return 20===he()||24===he()||22===he()?r:(We(24,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),Ze(F.createPropertyAccessExpression(r,Mt(!0,!0)),t))}():un(),Tn(r,t)}function un(){return xn(ye(),kn(),!0)}function _n(t,r,i){var a,o=ye(),s=function(e){var t=ye();if(Me(29),31===he())return Ae(),Ze(F.createJsxOpeningFragment(),t);var r,n=fn(),i=0==(262144&N)?Ei():void 0,a=function(){var e=ye();return Ze(F.createJsxAttributes(Tt(13,mn)),e)}();return 31===he()?(Ae(),r=F.createJsxOpeningElement(n,i,a)):(Me(43),Me(31,void 0,!1)&&(e?De():Ae()),r=F.createJsxSelfClosingElement(n,i,a)),Ze(r,t)}(t);if(283===s.kind){var c=pn(s),l=void 0,u=c[c.length-1];if(281===(null==u?void 0:u.kind)&&!Q(u.openingElement.tagName,u.closingElement.tagName)&&Q(s.tagName,u.closingElement.tagName)){var _=u.children.end,p=Ze(F.createJsxElement(u.openingElement,u.children,Ze(F.createJsxClosingElement(Ze(F.createIdentifier(""),_,_)),_,_)),u.openingElement.pos,_);c=Ye(n$4(n$4([],c.slice(0,c.length-1),!0),[p],!1),c.pos,_),l=u.closingElement;}else l=function(e,t){var r=ye();Me(30);var n=fn();return Me(31,void 0,!1)&&(t||!Q(e.tagName,n)?De():Ae()),Ze(F.createJsxClosingElement(n),r)}(s,t),Q(s.tagName,l.tagName)||(i&&e.isJsxOpeningElement(i)&&Q(l.tagName,i.tagName)?ge(s.tagName,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(d,s.tagName)):ge(l.tagName,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(d,s.tagName)));a=Ze(F.createJsxElement(s,c,l),o);}else 286===s.kind?a=Ze(F.createJsxFragment(s,pn(s),function(t){var r=ye();return Me(30),e.tokenIsIdentifierOrKeyword(he())&&ge(fn(),e.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment),Me(31,void 0,!1)&&(t?De():Ae()),Ze(F.createJsxJsxClosingFragment(),r)}(t)),o):(e.Debug.assert(282===s.kind),a=s);if(t&&29===he()){var f=void 0===r?a.pos:r,g=we((function(){return _n(!0,f)}));if(g){var m=$e(27,!1);return e.setTextRangePosWidth(m,g.pos,0),fe(e.skipTrivia(d,f),g.end,e.Diagnostics.JSX_expressions_must_have_one_parent_element),Ze(F.createBinaryExpression(a,m,g),o)}}return a}function dn(t,r){switch(r){case 1:if(e.isJsxOpeningFragment(t))ge(t,e.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);else {var n=t.tagName;fe(e.skipTrivia(d,n.pos),n.end,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(d,t.tagName));}return;case 30:case 7:return;case 11:case 12:return i=ye(),a=F.createJsxText(c.getTokenValue(),12===x),x=c.scanJsxToken(),Ze(a,i);case 18:return gn(!1);case 29:return _n(!1,void 0,t);default:return e.Debug.assertNever(r)}var i,a;}function pn(t){var r=[],n=ye(),i=E;for(E|=16384;;){var a=dn(t,x=c.reScanJsxToken());if(!a)break;if(r.push(a),e.isJsxOpeningElement(t)&&281===(null==a?void 0:a.kind)&&!Q(a.openingElement.tagName,a.closingElement.tagName)&&Q(t.tagName,a.closingElement.tagName))break}return E=i,Ye(r,n)}function fn(){var e=ye();Ne();for(var t=108===he()?He():it();Ve(24);)t=Ze(F.createPropertyAccessExpression(t,Mt(!0,!1)),e);return t}function gn(e){var t,r,n=ye();if(Me(18))return 19!==he()&&(t=qe(25),r=Vr()),e?Me(19):Me(19,void 0,!1)&&Ae(),Ze(F.createJsxExpression(t,r),n)}function mn(){if(18===he())return function(){var e=ye();Me(18),Me(25);var t=Vr();return Me(19),Ze(F.createJsxSpreadAttribute(t),e)}();Ne();var t=ye();return Ze(F.createJsxAttribute(it(),function(){if(63===he()){if(10===(x=c.scanJsxAttributeValue()))return Jt();if(18===he())return gn(!0);if(29===he())return _n(!0);de(e.Diagnostics.or_JSX_element_expected);}}()),t)}function yn(){return De(),e.tokenIsIdentifierOrKeyword(he())||22===he()||Dn()}function vn(t){if(32&t.flags)return !0;if(e.isNonNullExpression(t)){for(var r=t.expression;e.isNonNullExpression(r)&&!(32&r.flags);)r=r.expression;if(32&r.flags){for(;e.isNonNullExpression(t);)t.flags|=32,t=t.expression;return !0}}return !1}function hn(t,r,n){var i=Mt(!0,!0),a=n||vn(r),o=a?F.createPropertyAccessChain(r,n,i):F.createPropertyAccessExpression(r,i);return a&&e.isPrivateIdentifier(o.name)&&ge(o.name,e.Diagnostics.An_optional_chain_cannot_contain_private_identifiers),e.isExpressionWithTypeArguments(r)&&r.typeArguments&&fe(r.typeArguments.pos-1,e.skipTrivia(d,r.typeArguments.end)+1,e.Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access),Ze(o,t)}function bn(t,r,n){var i;if(23===he())i=$e(79,!0,e.Diagnostics.An_element_access_expression_should_take_an_argument);else {var a=te(Vr);e.isStringOrNumericLiteralLike(a)&&(a.text=et(a.text)),i=a;}return Me(23),Ze(n||vn(r)?F.createElementAccessChain(r,n,i):F.createElementAccessExpression(r,i),t)}function xn(t,r,n){for(;;){var i=void 0,a=!1;if(n&&28===he()&&Pe(yn)?(i=We(28),a=e.tokenIsIdentifierOrKeyword(he())):a=Ve(24),a)r=hn(t,r,i);else if(!i&&ue()||!Ve(22)){if(!Dn()){if(!i){if(53===he()&&!c.hasPrecedingLineBreak()){De(),r=Ze(F.createNonNullExpression(r),t);continue}var o=we(En);if(o){r=Ze(F.createExpressionWithTypeArguments(r,o),t);continue}}return r}r=i||230!==r.kind?Sn(t,r,i,void 0):Sn(t,r.expression,i,r.typeArguments);}else r=bn(t,r,i);}}function Dn(){return 14===he()||15===he()}function Sn(e,t,r,n){var i=F.createTaggedTemplateExpression(t,n,14===he()?(Ce(),Jt()):Lt(!0));return (r||32&t.flags)&&(i.flags|=32),i.questionDotToken=r,Ze(i,e)}function Tn(t,r){for(;;){r=xn(t,r,!0);var n=void 0,i=qe(28);if(i&&(n=we(En),Dn()))r=Sn(t,r,i,n);else {if(!n&&20!==he()){if(i){var a=$e(79,!1,e.Diagnostics.Identifier_expected);r=Ze(F.createPropertyAccessChain(r,i,a),t);}break}i||230!==r.kind||(n=r.typeArguments,r=r.expression);var o=Cn();r=Ze(i||vn(r)?F.createCallChain(r,i,n,o):F.createCallExpression(r,n,o),t);}}return r}function Cn(){Me(20);var e=At(11,An);return Me(21),e}function En(){if(0==(262144&N)&&29===Ee()){De();var e=At(20,Jr);if(31===Te())return De(),e&&function(){switch(he()){case 20:case 14:case 15:return !0;case 29:case 31:case 39:case 40:return !1}return c.hasPrecedingLineBreak()||tn()||!Kr()}()?e:void 0}}function kn(){switch(he()){case 8:case 9:case 10:case 14:return Jt();case 108:case 106:case 104:case 110:case 95:return He();case 20:return function(){var e=ye(),t=ve();Me(20);var r=te(Vr);return Me(21),R(Ze(F.createParenthesizedExpression(r),e),t)}();case 22:return Fn();case 18:return wn();case 132:if(!Pe(zn))break;return In();case 84:return Di(ye(),ve(),void 0,void 0,228);case 98:return In();case 103:return function(){var t=ye();if(Me(103),Ve(24)){var r=it();return Ze(F.createMetaProperty(103,r),t)}var n,i=xn(ye(),kn(),!1);230===i.kind&&(n=i.typeArguments,i=i.expression),28===he()&&de(e.Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,e.getTextOfNodeFromSourceText(d,i));var a=20===he()?Cn():void 0;return Ze(F.createNewExpression(i,n,a),t)}();case 43:case 68:if(13===(x=c.reScanSlashToken()))return Jt();break;case 15:return Lt(!1);case 80:return st()}return nt(e.Diagnostics.Expression_expected)}function Nn(){return 25===he()?function(){var e=ye();Me(25);var t=Wr(!0);return Ze(F.createSpreadElement(t),e)}():27===he()?Ze(F.createOmittedExpression(),ye()):Wr(!0)}function An(){return $(20480,Nn)}function Fn(){var e=ye(),t=c.getTokenPos(),r=Me(22),n=c.hasPrecedingLineBreak(),i=At(15,Nn);return Ke(22,23,r,t),Ze(F.createArrayLiteralExpression(i,n),e)}function Pn(){var e=ye(),t=ve();if(qe(25)){var r=Wr(!0);return R(Ze(F.createSpreadAssignment(r),e),t)}var n=gi(),i=vi();if(ct(137))return _i(e,t,n,i,174,0);if(ct(151))return _i(e,t,n,i,175,0);var a,o=qe(41),s=Oe(),c=ot(),l=qe(57),u=qe(53);if(o||20===he()||29===he())return ci(e,t,n,i,o,c,l,u);if(s&&58!==he()){var _=qe(63),d=_?te((function(){return Wr(!0)})):void 0;(a=F.createShorthandPropertyAssignment(c,d)).equalsToken=_;}else {Me(58);var p=te((function(){return Wr(!0)}));a=F.createPropertyAssignment(c,p);}return a.illegalDecorators=n,a.modifiers=i,a.questionToken=l,a.exclamationToken=u,R(Ze(a,e),t)}function wn(){var e=ye(),t=c.getTokenPos(),r=Me(18),n=c.hasPrecedingLineBreak(),i=At(12,Pn,!0);return Ke(18,19,r,t),Ze(F.createObjectLiteralExpression(i,n),e)}function In(){var t=ue();Y(!1);var r=ye(),n=ve(),i=vi();Me(98);var a=qe(41),o=a?1:0,s=e.some(i,e.isAsyncModifier)?2:0,c=o&&s?ee(40960,On):o?ee(8192,On):s?ie(On):On(),l=Yt(),u=nr(o|s),_=tr(58,!1),d=Ln(o|s);return Y(t),R(Ze(F.createFunctionExpression(i,a,c,l,u,_,d),r),n)}function On(){return Ie()?rt():void 0}function Mn(t,r){var n=ye(),i=ve(),a=c.getTokenPos(),o=Me(18,r);if(o||t){var s=c.hasPrecedingLineBreak(),l=Tt(1,Hn);Ke(18,19,o,a);var u=R(Ze(F.createBlock(l,s),n),i);return 63===he()&&(de(e.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses),De()),u}return l=Pt(),R(Ze(F.createBlock(l,void 0),n),i)}function Ln(e,t){var r=se();X(!!(1&e));var n=_e();Z(!!(2&e));var i=P;P=!1;var a=ue();a&&Y(!1);var o=Mn(!!(16&e),t);return a&&Y(!0),P=i,X(r),Z(n),o}function Rn(e){var t=ye(),r=ve();Me(249===e?81:86);var n=Ge()?void 0:nt();return Xe(),R(Ze(249===e?F.createBreakStatement(n):F.createContinueStatement(n),t),r)}function Bn(){return 82===he()?function(){var e=ye(),t=ve();Me(82);var r=te(Vr);Me(58);var n=Tt(3,Hn);return R(Ze(F.createCaseClause(r,n),e),t)}():function(){var e=ye();Me(88),Me(58);var t=Tt(3,Hn);return Ze(F.createDefaultClause(t),e)}()}function jn(){return De(),e.tokenIsIdentifierOrKeyword(he())&&!c.hasPrecedingLineBreak()}function Jn(){return De(),84===he()&&!c.hasPrecedingLineBreak()}function zn(){return De(),98===he()&&!c.hasPrecedingLineBreak()}function Un(){return De(),(e.tokenIsIdentifierOrKeyword(he())||8===he()||9===he()||10===he())&&!c.hasPrecedingLineBreak()}function Kn(){for(;;)switch(he()){case 113:case 119:case 85:case 98:case 84:case 92:return !0;case 118:case 154:return De(),!c.hasPrecedingLineBreak()&&Oe();case 142:case 143:return De(),!c.hasPrecedingLineBreak()&&(Oe()||10===he());case 126:case 127:case 132:case 136:case 121:case 122:case 123:case 146:if(De(),c.hasPrecedingLineBreak())return !1;continue;case 159:return De(),18===he()||79===he()||93===he();case 100:return De(),10===he()||41===he()||18===he()||e.tokenIsIdentifierOrKeyword(he());case 93:var t=De();if(154===t&&(t=Pe(De)),63===t||41===t||18===t||88===t||128===t)return !0;continue;case 124:De();continue;default:return !1}}function Vn(){return Pe(Kn)}function qn(){switch(he()){case 59:case 26:case 18:case 113:case 119:case 98:case 84:case 92:case 99:case 90:case 115:case 97:case 86:case 81:case 105:case 116:case 107:case 109:case 111:case 87:case 83:case 96:case 132:case 136:case 118:case 142:case 143:case 154:case 159:return !0;case 100:return Vn()||Pe(pr);case 85:case 93:return Vn();case 127:case 123:case 121:case 122:case 124:case 146:return Vn()||!Pe(jn);default:return Kr()}}function Wn(){return De(),Ie()||18===he()||22===he()}function Hn(){switch(he()){case 26:return t=ye(),r=ve(),Me(26),R(Ze(F.createEmptyStatement(),t),r);case 18:return Mn(!1);case 113:return oi(ye(),ve(),void 0,void 0);case 119:if(Pe(Wn))return oi(ye(),ve(),void 0,void 0);break;case 98:return si(ye(),ve(),void 0,void 0);case 84:return xi(ye(),ve(),void 0,void 0);case 99:return function(){var e=ye(),t=ve();Me(99);var r=c.getTokenPos(),n=Me(20),i=te(Vr);Ke(20,21,n,r);var a=Hn(),o=Ve(91)?Hn():void 0;return R(Ze(F.createIfStatement(i,a,o),e),t)}();case 90:return function(){var e=ye(),t=ve();Me(90);var r=Hn();Me(115);var n=c.getTokenPos(),i=Me(20),a=te(Vr);return Ke(20,21,i,n),Ve(26),R(Ze(F.createDoStatement(r,a),e),t)}();case 115:return function(){var e=ye(),t=ve();Me(115);var r=c.getTokenPos(),n=Me(20),i=te(Vr);Ke(20,21,n,r);var a=Hn();return R(Ze(F.createWhileStatement(i,a),e),t)}();case 97:return function(){var e=ye(),t=ve();Me(97);var r,n,i=qe(133);if(Me(20),26!==he()&&(r=113===he()||119===he()||85===he()?ii(!0):ee(4096,Vr)),i?Me(162):Ve(162)){var a=te((function(){return Wr(!0)}));Me(21),n=F.createForOfStatement(i,r,a,Hn());}else if(Ve(101))a=te(Vr),Me(21),n=F.createForInStatement(r,a,Hn());else {Me(26);var o=26!==he()&&21!==he()?te(Vr):void 0;Me(26);var s=21!==he()?te(Vr):void 0;Me(21),n=F.createForStatement(r,o,s,Hn());}return R(Ze(n,e),t)}();case 86:return Rn(248);case 81:return Rn(249);case 105:return function(){var e=ye(),t=ve();Me(105);var r=Ge()?void 0:te(Vr);return Xe(),R(Ze(F.createReturnStatement(r),e),t)}();case 116:return function(){var e=ye(),t=ve();Me(116);var r=c.getTokenPos(),n=Me(20),i=te(Vr);Ke(20,21,n,r);var a=ee(33554432,Hn);return R(Ze(F.createWithStatement(i,a),e),t)}();case 107:return function(){var e=ye(),t=ve();Me(107),Me(20);var r=te(Vr);Me(21);var n=function(){var e=ye();Me(18);var t=Tt(2,Bn);return Me(19),Ze(F.createCaseBlock(t),e)}();return R(Ze(F.createSwitchStatement(r,n),e),t)}();case 109:return function(){var e=ye(),t=ve();Me(109);var r=c.hasPrecedingLineBreak()?void 0:te(Vr);return void 0===r&&(C++,r=Ze(F.createIdentifier(""),ye())),Qe()||Je(r),R(Ze(F.createThrowStatement(r),e),t)}();case 111:case 83:case 96:return function(){var t=ye(),r=ve();Me(111);var n,i=Mn(!1),a=83===he()?function(){var e,t=ye();Me(83),Ve(20)?(e=ni(),Me(21)):e=void 0;var r=Mn(!1);return Ze(F.createCatchClause(e,r),t)}():void 0;return a&&96!==he()||(Me(96,e.Diagnostics.catch_or_finally_expected),n=Mn(!1)),R(Ze(F.createTryStatement(i,a,n),t),r)}();case 87:return function(){var e=ye(),t=ve();return Me(87),Xe(),R(Ze(F.createDebuggerStatement(),e),t)}();case 59:return Qn();case 132:case 118:case 154:case 142:case 143:case 136:case 85:case 92:case 93:case 100:case 121:case 122:case 123:case 126:case 127:case 124:case 146:case 159:if(Vn())return Qn()}var t,r;return function(){var t,r=ye(),n=ve(),i=20===he(),a=te(Vr);return e.isIdentifier(a)&&Ve(58)?t=F.createLabeledStatement(a,Hn()):(Qe()||Je(a),t=F.createExpressionStatement(a),i&&(n=!1)),R(Ze(t,r),n)}()}function Gn(e){return 136===e.kind}function Qn(){var t=ye(),r=ve(),n=gi(),i=vi();if(e.some(i,Gn)){var a=function(e){return ee(16777216,(function(){var t=Et(E,e);if(t)return kt(t)}))}(t);if(a)return a;for(var o=0,s=i;o<s.length;o++)s[o].flags|=16777216;return ee(16777216,(function(){return Xn(t,r,n,i)}))}return Xn(t,r,n,i)}function Xn(t,r,n,i){switch(he()){case 113:case 119:case 85:return oi(t,r,n,i);case 98:return si(t,r,n,i);case 84:return xi(t,r,n,i);case 118:return function(e,t,r,n){Me(118);var i=nt(),a=Yt(),o=Si(),s=fr(),c=F.createInterfaceDeclaration(n,i,a,o,s);return c.illegalDecorators=r,R(Ze(c,e),t)}(t,r,n,i);case 154:return function(e,t,r,n){Me(154);var i=nt(),a=Yt();Me(63);var o=139===he()&&we(xr)||Jr();Xe();var s=F.createTypeAliasDeclaration(n,i,a,o);return s.illegalDecorators=r,R(Ze(s,e),t)}(t,r,n,i);case 92:return function(e,t,r,n){Me(92);var i,a=nt();Me(18)?(i=$(40960,(function(){return At(6,Ni)})),Me(19)):i=Pt();var o=F.createEnumDeclaration(n,a,i);return o.illegalDecorators=r,R(Ze(o,e),t)}(t,r,n,i);case 159:case 142:case 143:return function(e,t,r,n){var i=0;if(159===he())return Pi(e,t,r,n);if(Ve(143))i|=16;else if(Me(142),10===he())return Pi(e,t,r,n);return Fi(e,t,r,n,i)}(t,r,n,i);case 100:return function(e,t,r,n){Me(100);var i,a=c.getStartPos();Oe()&&(i=nt());var o,s=!1;if(158===he()||"type"!==(null==i?void 0:i.escapedText)||!Oe()&&41!==he()&&18!==he()||(s=!0,i=Oe()?nt():void 0),i&&27!==he()&&158!==he())return function(e,t,r,n,i,a){Me(63);var o=147===he()&&Pe(wi)?function(){var e=ye();Me(147),Me(20);var t=Ri();return Me(21),Ze(F.createExternalModuleReference(t),e)}():It(!1);Xe();var s=F.createImportEqualsDeclaration(n,a,i,o);return s.illegalDecorators=r,R(Ze(s,e),t)}(e,t,r,n,i,s);(i||41===he()||18===he())&&(o=function(e,t,r){var n;return e&&!Ve(27)||(n=41===he()?function(){var e=ye();Me(41),Me(128);var t=nt();return Ze(F.createNamespaceImport(t),e)}():Bi(272)),Ze(F.createImportClause(r,e,n),t)}(i,a,s),Me(158));var l,u=Ri();130!==he()||c.hasPrecedingLineBreak()||(l=Li()),Xe();var _=F.createImportDeclaration(n,o,u,l);return _.illegalDecorators=r,R(Ze(_,e),t)}(t,r,n,i);case 93:switch(De(),he()){case 88:case 63:return function(e,t,r,n){var i,a=_e();Z(!0),Ve(63)?i=!0:Me(88);var o=Wr(!0);Xe(),Z(a);var s=F.createExportAssignment(n,i,o);return s.illegalDecorators=r,R(Ze(s,e),t)}(t,r,n,i);case 128:return function(e,t,r,n){Me(128),Me(143);var i=nt();Xe();var a=F.createNamespaceExportDeclaration(i);return a.illegalDecorators=r,a.modifiers=n,R(Ze(a,e),t)}(t,r,n,i);default:return function(e,t,r,n){var i,a,o,s=_e();Z(!0);var l=Ve(154),u=ye();Ve(41)?(Ve(128)&&(i=function(e){return Ze(F.createNamespaceExport(it()),e)}(u)),Me(158),a=Ri()):(i=Bi(276),(158===he()||10===he()&&!c.hasPrecedingLineBreak())&&(Me(158),a=Ri())),a&&130===he()&&!c.hasPrecedingLineBreak()&&(o=Li()),Xe(),Z(s);var _=F.createExportDeclaration(n,l,i,a,o);return _.illegalDecorators=r,R(Ze(_,e),t)}(t,r,n,i)}default:if(n||i){var a=$e(279,!0,e.Diagnostics.Declaration_expected);return e.setTextRangePos(a,t),a.illegalDecorators=n,a.modifiers=i,a}return}}function Yn(e,t){if(18!==he()){if(4&e)return void ir();if(Ge())return void Xe()}return Ln(e,t)}function Zn(){var e=ye();if(27===he())return Ze(F.createOmittedExpression(),e);var t=qe(25),r=ti(),n=qr();return Ze(F.createBindingElement(t,void 0,r,n),e)}function $n(){var e,t=ye(),r=qe(25),n=Ie(),i=ot();n&&58!==he()?(e=i,i=void 0):(Me(58),e=ti());var a=qr();return Ze(F.createBindingElement(r,i,e,a),t)}function ei(){return 18===he()||22===he()||80===he()||Ie()}function ti(e){return 22===he()?function(){var e=ye();Me(22);var t=At(10,Zn);return Me(23),Ze(F.createArrayBindingPattern(t),e)}():18===he()?function(){var e=ye();Me(18);var t=At(9,$n);return Me(19),Ze(F.createObjectBindingPattern(t),e)}():rt(e)}function ri(){return ni(!0)}function ni(t){var r,n=ye(),i=ve(),a=ti(e.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations);t&&79===a.kind&&53===he()&&!c.hasPrecedingLineBreak()&&(r=He());var o=zr(),s=$r(he())?void 0:qr();return R(Ze(F.createVariableDeclaration(a,r,o,s),n),i)}function ii(t){var r,n=ye(),i=0;switch(he()){case 113:break;case 119:i|=1;break;case 85:i|=2;break;default:e.Debug.fail();}if(De(),162===he()&&Pe(ai))r=Pt();else {var a=ce();G(t),r=At(8,t?ni:ri),G(a);}return Ze(F.createVariableDeclarationList(r,i),n)}function ai(){return yt()&&21===De()}function oi(e,t,r,n){var i=ii(!1);Xe();var a=F.createVariableStatement(n,i);return a.illegalDecorators=r,R(Ze(a,e),t)}function si(t,r,n,i){var a=_e(),o=e.modifiersToFlags(i);Me(98);var s=qe(41),c=1024&o?On():rt(),l=s?1:0,u=512&o?2:0,_=Yt();1&o&&Z(!0);var d=nr(l|u),p=tr(58,!1),f=Yn(l|u,e.Diagnostics.or_expected);Z(a);var g=F.createFunctionDeclaration(i,s,c,_,d,p,f);return g.illegalDecorators=n,R(Ze(g,t),r)}function ci(t,r,n,i,a,o,s,c,l){var u=a?1:0,_=e.some(i,e.isAsyncModifier)?2:0,d=Yt(),p=nr(u|_),f=tr(58,!1),g=Yn(u|_,l),m=F.createMethodDeclaration(yi(n,i),a,o,s,d,p,f,g);return m.exclamationToken=c,R(Ze(m,t),r)}function li(t,r,n,i,a,o){var s=o||c.hasPrecedingLineBreak()?void 0:qe(53),l=zr(),u=$(45056,qr);return function(t,r,n){if(59!==he()||c.hasPrecedingLineBreak())return 20===he()?(de(e.Diagnostics.Cannot_start_a_function_call_in_a_type_annotation),void De()):void(!r||Ge()?Qe()||(n?de(e.Diagnostics._0_expected,e.tokenToString(26)):Je(t)):n?de(e.Diagnostics._0_expected,e.tokenToString(26)):de(e.Diagnostics.Expected_for_property_initializer));de(e.Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);}(a,l,u),R(Ze(F.createPropertyDeclaration(yi(n,i),a,o||s,l,u),t),r)}function ui(t,r,n,i){var a=qe(41),o=ot(),s=qe(57);return a||20===he()||29===he()?ci(t,r,n,i,a,o,s,void 0,e.Diagnostics.or_expected):li(t,r,n,i,o,s)}function _i(t,r,n,i,a,o){var s=ot(),c=Yt(),l=nr(0),u=tr(58,!1),_=Yn(o),d=174===a?F.createGetAccessorDeclaration(yi(n,i),s,l,u,_):F.createSetAccessorDeclaration(yi(n,i),s,l,_);return d.typeParameters=c,e.isSetAccessorDeclaration(d)&&(d.type=u),R(Ze(d,t),r)}function di(){var t;if(59===he())return !0;for(;e.isModifierKind(he());){if(t=he(),e.isClassMemberModifier(t))return !0;De();}if(41===he())return !0;if(at()&&(t=he(),De()),22===he())return !0;if(void 0!==t){if(!e.isKeyword(t)||151===t||137===t)return !0;switch(he()){case 20:case 29:case 53:case 58:case 63:case 57:return !0;default:return Ge()}}return !1}function pi(){if(_e()&&133===he()){var t=ye(),r=nt(e.Diagnostics.Expression_expected);return De(),Tn(t,xn(t,r,!0))}return ln()}function fi(){var e=ye();if(Ve(59)){var t=ee(16384,pi);return Ze(F.createDecorator(t),e)}}function gi(){for(var t,r,n=ye();r=fi();)t=e.append(t,r);return t&&Ye(t,n)}function mi(t,r,n){var i=ye(),a=he();if(85===he()&&t){if(!we(lt))return}else {if(r&&124===he()&&Pe(Ii))return;if(n&&124===he())return;if(!e.isModifierKind(he())||!we(ut))return}return Ze(F.createToken(a),i)}function yi(t,r){if(!t)return r;if(!r)return t;var n=F.createNodeArray(e.concatenate(t,r));return e.setTextRangePosEnd(n,t.pos,r.end),n}function vi(t,r){for(var n,i,a=ye(),o=!1;i=mi(t,r,o);)124===i.kind&&(o=!0),n=e.append(n,i);return n&&Ye(n,a)}function hi(){var e;if(132===he()){var t=ye();De(),e=Ye([Ze(F.createToken(132),t)],t);}return e}function bi(){var t=ye();if(26===he())return De(),Ze(F.createSemicolonClassElement(),t);var r=ve(),n=gi(),i=vi(!0,!0);if(124===he()&&Pe(Ii))return function(e,t,r,n){We(124);var i=function(){var e=se(),t=_e();X(!1),Z(!0);var r=Mn(!1);return X(e),Z(t),r}(),a=R(Ze(F.createClassStaticBlockDeclaration(i),e),t);return a.illegalDecorators=r,a.modifiers=n,a}(t,r,n,i);if(ct(137))return _i(t,r,n,i,174,0);if(ct(151))return _i(t,r,n,i,175,0);if(135===he()||10===he()){var a=function(t,r,n,i){return we((function(){if(135===he()?Me(135):10===he()&&20===Pe(De)?we((function(){var e=Jt();return "constructor"===e.text?e:void 0})):void 0){var a=Yt(),o=nr(0),s=tr(58,!1),c=Yn(0,e.Diagnostics.or_expected),l=F.createConstructorDeclaration(i,o,c);return l.illegalDecorators=n,l.typeParameters=a,l.type=s,R(Ze(l,t),r)}}))}(t,r,n,i);if(a)return a}if(or())return cr(t,r,n,i);if(e.tokenIsIdentifierOrKeyword(he())||10===he()||8===he()||41===he()||22===he()){if(e.some(i,Gn)){for(var o=0,s=i;o<s.length;o++)s[o].flags|=16777216;return ee(16777216,(function(){return ui(t,r,n,i)}))}return ui(t,r,n,i)}if(n||i){var c=$e(79,!0,e.Diagnostics.Declaration_expected);return li(t,r,n,i,c,void 0)}return e.Debug.fail("Should not have attempted to parse class member declaration.")}function xi(e,t,r,n){return Di(e,t,r,n,260)}function Di(t,r,n,i,a){var o=_e();Me(84);var s=!Ie()||117===he()&&Pe(vt)?void 0:tt(Ie()),c=Yt();e.some(i,e.isExportModifier)&&Z(!0);var l,u=Si();return Me(18)?(l=Tt(5,bi),Me(19)):l=Pt(),Z(o),R(Ze(260===a?F.createClassDeclaration(yi(n,i),s,c,u,l):F.createClassExpression(yi(n,i),s,c,u,l),t),r)}function Si(){if(ki())return Tt(22,Ti)}function Ti(){var t=ye(),r=he();e.Debug.assert(94===r||117===r),De();var n=At(7,Ci);return Ze(F.createHeritageClause(r,n),t)}function Ci(){var e=ye(),t=ln();if(230===t.kind)return t;var r=Ei();return Ze(F.createExpressionWithTypeArguments(t,r),e)}function Ei(){return 29===he()?wt(20,Jr,29,31):void 0}function ki(){return 94===he()||117===he()}function Ni(){var e=ye(),t=ve(),r=ot(),n=te(qr);return R(Ze(F.createEnumMember(r,n),e),t)}function Ai(){var e,t=ye();return Me(18)?(e=Tt(1,Hn),Me(19)):e=Pt(),Ze(F.createModuleBlock(e),t)}function Fi(e,t,r,n,i){var a=16&i,o=nt(),s=Ve(24)?Fi(ye(),!1,void 0,void 0,4|a):Ai(),c=F.createModuleDeclaration(n,o,s,i);return c.illegalDecorators=r,R(Ze(c,e),t)}function Pi(e,t,r,n){var i,a,o=0;159===he()?(i=nt(),o|=1024):(i=Jt()).text=et(i.text),18===he()?a=Ai():Xe();var s=F.createModuleDeclaration(n,i,a,o);return s.illegalDecorators=r,R(Ze(s,e),t)}function wi(){return 20===De()}function Ii(){return 18===De()}function Oi(){return 43===De()}function Mi(){var t=ye(),r=e.tokenIsIdentifierOrKeyword(he())?it():Ut(10);Me(58);var n=Wr(!0);return Ze(F.createAssertEntry(r,n),t)}function Li(t){var r=ye();t||Me(130);var n=c.getTokenPos();if(Me(18)){var i=c.hasPrecedingLineBreak(),a=At(24,Mi,!0);if(!Me(19)){var o=e.lastOrUndefined(y);o&&o.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(o,e.createDetachedDiagnostic(u,n,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"));}return Ze(F.createAssertClause(a,i),r)}return a=Ye([],ye(),void 0,!1),Ze(F.createAssertClause(a,!1),r)}function Ri(){if(10===he()){var e=Jt();return e.text=et(e.text),e}return Vr()}function Bi(e){var t=ye();return Ze(272===e?F.createNamedImports(wt(23,Ji,18,19)):F.createNamedExports(wt(23,ji,18,19)),t)}function ji(){var e=ve();return R(zi(278),e)}function Ji(){return zi(273)}function zi(t){var r,n=ye(),i=e.isKeyword(he())&&!Oe(),a=c.getTokenPos(),o=c.getTextPos(),s=!1,l=!0,u=it();if("type"===u.escapedText)if(128===he()){var _=it();if(128===he()){var d=it();e.tokenIsIdentifierOrKeyword(he())?(s=!0,r=_,u=p(),l=!1):(r=u,u=d,l=!1);}else e.tokenIsIdentifierOrKeyword(he())?(r=u,l=!1,u=p()):(s=!0,u=_);}else e.tokenIsIdentifierOrKeyword(he())&&(s=!0,u=p());return l&&128===he()&&(r=u,Me(128),u=p()),273===t&&i&&fe(a,o,e.Diagnostics.Identifier_expected),Ze(273===t?F.createImportSpecifier(s,r,u):F.createExportSpecifier(s,r,u),n);function p(){return i=e.isKeyword(he())&&!Oe(),a=c.getTokenPos(),o=c.getTextPos(),it()}}!function(e){e[e.SourceElements=0]="SourceElements",e[e.BlockStatements=1]="BlockStatements",e[e.SwitchClauses=2]="SwitchClauses",e[e.SwitchClauseStatements=3]="SwitchClauseStatements",e[e.TypeMembers=4]="TypeMembers",e[e.ClassMembers=5]="ClassMembers",e[e.EnumMembers=6]="EnumMembers",e[e.HeritageClauseElement=7]="HeritageClauseElement",e[e.VariableDeclarations=8]="VariableDeclarations",e[e.ObjectBindingElements=9]="ObjectBindingElements",e[e.ArrayBindingElements=10]="ArrayBindingElements",e[e.ArgumentExpressions=11]="ArgumentExpressions",e[e.ObjectLiteralMembers=12]="ObjectLiteralMembers",e[e.JsxAttributes=13]="JsxAttributes",e[e.JsxChildren=14]="JsxChildren",e[e.ArrayLiteralMembers=15]="ArrayLiteralMembers",e[e.Parameters=16]="Parameters",e[e.JSDocParameters=17]="JSDocParameters",e[e.RestProperties=18]="RestProperties",e[e.TypeParameters=19]="TypeParameters",e[e.TypeArguments=20]="TypeArguments",e[e.TupleElementTypes=21]="TupleElementTypes",e[e.HeritageClauses=22]="HeritageClauses",e[e.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",e[e.AssertEntries=24]="AssertEntries",e[e.Count=25]="Count";}(Le||(Le={})),function(e){e[e.False=0]="False",e[e.True=1]="True",e[e.Unknown=2]="Unknown";}(Re||(Re={})),function(t){function r(e){var t=ye(),r=(e?Ve:Me)(18),n=ee(8388608,Qt);e&&!r||Ue(19);var i=F.createJSDocTypeExpression(n);return q(i),Ze(i,t)}function n(){for(var e=ye(),t=Ve(18),r=ye(),n=It(!1);80===he();)ke(),Se(),n=Ze(F.createJSDocMemberName(n,nt()),r);t&&Ue(19);var i=F.createJSDocNameReference(n);return q(i),Ze(i,e)}var i,a;function o(t,i){void 0===t&&(t=0);var a=d,o=void 0===i?a.length:t+i;if(i=o-t,e.Debug.assert(t>=0),e.Debug.assert(t<=o),e.Debug.assert(o<=a.length),p(a,t)){var s,l,_,f,g,m=[],y=[];return c.scanRange(t+3,i-5,(function(){var r,n,i=1,u=t-(a.lastIndexOf("\n",t)+1)+4;function d(e){r||(r=u),m.push(e),u+=e.length;}for(Se();W(5););W(4)&&(i=0,u=0);e:for(;;){switch(he()){case 59:0===i||1===i?(h(m),g||(g=ye()),(n=S(u))&&(s?s.push(n):(s=[n],l=n.pos),_=n.end),i=0,r=void 0):d(c.getTokenText());break;case 4:m.push(c.getTokenText()),i=0,u=0;break;case 41:var p=c.getTokenText();1===i||2===i?(i=2,d(p)):(i=1,u+=p.length);break;case 5:var b=c.getTokenText();2===i?m.push(b):void 0!==r&&u+b.length>r&&m.push(b.slice(r-u)),u+=b.length;break;case 1:break e;case 18:i=2;var x=c.getStartPos(),D=N(c.getTextPos()-1);if(D){f||v(m),y.push(Ze(F.createJSDocText(m.join("")),null!=f?f:t,x)),y.push(D),m=[],f=c.getTextPos();break}default:i=2,d(c.getTokenText());}Se();}h(m),y.length&&m.length&&y.push(Ze(F.createJSDocText(m.join("")),null!=f?f:t,g)),y.length&&s&&e.Debug.assertIsDefined(g,"having parsed tags implies that the end of the comment span should be set");var T=s&&Ye(s,l,_);return Ze(F.createJSDocComment(y.length?Ye(y,t,g):m.length?m.join(""):void 0,T),t,o)}))}function v(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift();}function h(e){for(;e.length&&""===e[e.length-1].trim();)e.pop();}function b(){for(;;){if(Se(),1===he())return !0;if(5!==he()&&4!==he())return !1}}function x(){if(5!==he()&&4!==he()||!Pe(b))for(;5===he()||4===he();)Se();}function D(){if((5===he()||4===he())&&Pe(b))return "";for(var e=c.hasPrecedingLineBreak(),t=!1,r="";e&&41===he()||5===he()||4===he();)r+=c.getTokenText(),4===he()?(e=!0,t=!0,r=""):41===he()&&(e=!1),Se();return t?r:""}function S(t){e.Debug.assert(59===he());var i=c.getTokenPos();Se();var a,o=H(void 0),l=D();switch(o.escapedText){case"author":a=function(t,r,n,i){var a=ye(),o=function(){for(var e=[],t=!1,r=c.getToken();1!==r&&4!==r;){if(29===r)t=!0;else {if(59===r&&!t)break;if(31===r&&t){e.push(c.getTokenText()),c.setTextPos(c.getTokenPos()+1);break}}e.push(c.getTokenText()),r=Se();}return F.createJSDocText(e.join(""))}(),s=c.getStartPos(),l=T(t,s,n,i);l||(s=c.getStartPos());var u="string"!=typeof l?Ye(e.concatenate([Ze(o,a,s)],l),a):o.text+l;return Ze(F.createJSDocAuthorTag(r,u),t)}(i,o,t,l);break;case"implements":a=function(e,t,r,n){var i=R();return Ze(F.createJSDocImplementsTag(t,i,T(e,ye(),r,n)),e)}(i,o,t,l);break;case"augments":case"extends":a=function(e,t,r,n){var i=R();return Ze(F.createJSDocAugmentsTag(t,i,T(e,ye(),r,n)),e)}(i,o,t,l);break;case"class":case"constructor":a=B(i,F.createJSDocClassTag,o,t,l);break;case"public":a=B(i,F.createJSDocPublicTag,o,t,l);break;case"private":a=B(i,F.createJSDocPrivateTag,o,t,l);break;case"protected":a=B(i,F.createJSDocProtectedTag,o,t,l);break;case"readonly":a=B(i,F.createJSDocReadonlyTag,o,t,l);break;case"override":a=B(i,F.createJSDocOverrideTag,o,t,l);break;case"deprecated":K=!0,a=B(i,F.createJSDocDeprecatedTag,o,t,l);break;case"this":a=function(e,t,n,i){var a=r(!0);return x(),Ze(F.createJSDocThisTag(t,a,T(e,ye(),n,i)),e)}(i,o,t,l);break;case"enum":a=function(e,t,n,i){var a=r(!0);return x(),Ze(F.createJSDocEnumTag(t,a,T(e,ye(),n,i)),e)}(i,o,t,l);break;case"arg":case"argument":case"param":return M(i,o,2,t);case"return":case"returns":a=function(t,r,n,i){e.some(s,e.isJSDocReturnTag)&&fe(r.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,r.escapedText);var a=w();return Ze(F.createJSDocReturnTag(r,a,T(t,ye(),n,i)),t)}(i,o,t,l);break;case"template":a=function(e,t,n,i){var a=18===he()?r():void 0,o=function(){var e=ye(),t=[];do{x();var r=q();void 0!==r&&t.push(r),D();}while(W(27));return Ye(t,e)}();return Ze(F.createJSDocTemplateTag(t,a,o,T(e,ye(),n,i)),e)}(i,o,t,l);break;case"type":a=L(i,o,t,l);break;case"typedef":a=function(t,r,n,i){var a,o=w();D();var s=j();x();var c,l=E(n);if(!o||O(o.type)){for(var _=void 0,d=void 0,p=void 0,f=!1;_=we((function(){return z(n)}));)if(f=!0,346===_.kind){if(d){var g=de(e.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);g&&e.addRelatedInfo(g,e.createDetachedDiagnostic(u,0,0,e.Diagnostics.The_tag_was_first_specified_here));break}d=_;}else p=e.append(p,_);if(f){var m=o&&185===o.type.kind,y=F.createJSDocTypeLiteral(p,m);c=(o=d&&d.typeExpression&&!O(d.typeExpression.type)?d.typeExpression:Ze(y,t)).end;}}return c=c||void 0!==l?ye():(null!==(a=null!=s?s:o)&&void 0!==a?a:r).end,l||(l=T(t,c,n,i)),Ze(F.createJSDocTypedefTag(r,o,s,l),t,c)}(i,o,t,l);break;case"callback":a=function(t,r,n,i){var a=j();x();var o=E(n),s=function(t){for(var r,n,i=ye();r=we((function(){return U(4,t)}));)n=e.append(n,r);return Ye(n||[],i)}(n),c=we((function(){if(W(59)){var e=S(n);if(e&&344===e.kind)return e}})),l=Ze(F.createJSDocSignature(void 0,s,c),t);o||(o=T(t,ye(),n,i));var u=void 0!==o?ye():l.end;return Ze(F.createJSDocCallbackTag(r,l,a,o),t,u)}(i,o,t,l);break;case"see":a=function(t,r,i,a){var o=22===he()||Pe((function(){return 59===Se()&&e.tokenIsIdentifierOrKeyword(Se())&&P(c.getTokenValue())}))?void 0:n(),s=void 0!==i&&void 0!==a?T(t,ye(),i,a):void 0;return Ze(F.createJSDocSeeTag(r,o,s),t)}(i,o,t,l);break;default:a=function(e,t,r,n){return Ze(F.createJSDocUnknownTag(t,T(e,ye(),r,n)),e)}(i,o,t,l);}return a}function T(e,t,r,n){return n||(r+=t-e),E(r,n.slice(r))}function E(e,t){var r,n,i=ye(),a=[],o=[],s=0,l=!0;function u(t){n||(n=e),a.push(t),e+=t.length;}void 0!==t&&(""!==t&&u(t),s=1);var _=he();e:for(;;){switch(_){case 4:s=0,a.push(c.getTokenText()),e=0;break;case 59:if(3===s||2===s&&(!l||Pe(k))){a.push(c.getTokenText());break}c.setTextPos(c.getTextPos()-1);case 1:break e;case 5:if(2===s||3===s)u(c.getTokenText());else {var d=c.getTokenText();void 0!==n&&e+d.length>n&&a.push(d.slice(n-e)),e+=d.length;}break;case 18:s=2;var p=c.getStartPos(),f=N(c.getTextPos()-1);f?(o.push(Ze(F.createJSDocText(a.join("")),null!=r?r:i,p)),o.push(f),a=[],r=c.getTextPos()):u(c.getTokenText());break;case 61:s=3===s?2:3,u(c.getTokenText());break;case 41:if(0===s){s=1,e+=1;break}default:3!==s&&(s=2),u(c.getTokenText());}l=5===he(),_=Se();}return v(a),h(a),o.length?(a.length&&o.push(Ze(F.createJSDocText(a.join("")),null!=r?r:i)),Ye(o,i,c.getTextPos())):a.length?a.join(""):void 0}function k(){var e=Se();return 5===e||4===e}function N(t){var r=we(A);if(r){Se(),x();var n=ye(),i=e.tokenIsIdentifierOrKeyword(he())?It(!0):void 0;if(i)for(;80===he();)ke(),Se(),i=Ze(F.createJSDocMemberName(i,nt()),n);for(var a=[];19!==he()&&4!==he()&&1!==he();)a.push(c.getTokenText()),Se();return Ze(("link"===r?F.createJSDocLink:"linkcode"===r?F.createJSDocLinkCode:F.createJSDocLinkPlain)(i,a.join("")),t,c.getTextPos())}}function A(){if(D(),18===he()&&59===Se()&&e.tokenIsIdentifierOrKeyword(Se())){var t=c.getTokenValue();if(P(t))return t}}function P(e){return "link"===e||"linkcode"===e||"linkplain"===e}function w(){return D(),18===he()?r():void 0}function I(){var t=W(22);t&&x();var r=W(61),n=function(){var e=H();for(Ve(22)&&Me(23);Ve(24);){var t=H();Ve(22)&&Me(23),e=Ot(e,t);}return e}();return r&&(function(e){if(he()===e)return t=ye(),r=he(),Se(),Ze(F.createToken(r),t);var t,r;}(61)||$e(61,!1,e.Diagnostics._0_expected,e.tokenToString(61))),t&&(x(),qe(63)&&Vr(),Me(23)),{name:n,isBracketed:t}}function O(t){switch(t.kind){case 149:return !0;case 185:return O(t.elementType);default:return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&!t.typeArguments}}function M(t,r,n,i){var a=w(),o=!a;D();var s=I(),c=s.name,l=s.isBracketed,u=D();o&&!Pe(A)&&(a=w());var _=T(t,ye(),i,u),d=4!==n&&function(t,r,n,i){if(t&&O(t.type)){for(var a=ye(),o=void 0,s=void 0;o=we((function(){return U(n,i,r)}));)343!==o.kind&&350!==o.kind||(s=e.append(s,o));if(s){var c=Ze(F.createJSDocTypeLiteral(s,185===t.type.kind),a);return Ze(F.createJSDocTypeExpression(c),a)}}}(a,c,n,i);return d&&(a=d,o=!0),Ze(1===n?F.createJSDocPropertyTag(r,c,l,a,o,_):F.createJSDocParameterTag(r,c,l,a,o,_),t)}function L(t,n,i,a){e.some(s,e.isJSDocTypeTag)&&fe(n.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,n.escapedText);var o=r(!0),l=void 0!==i&&void 0!==a?T(t,ye(),i,a):void 0;return Ze(F.createJSDocTypeTag(n,o,l),t)}function R(){var e=Ve(18),t=ye(),r=function(){for(var e=ye(),t=H();Ve(24);){var r=H();t=Ze(F.createPropertyAccessExpression(t,r),e);}return t}(),n=Ei(),i=Ze(F.createExpressionWithTypeArguments(r,n),t);return e&&Me(19),i}function B(e,t,r,n,i){return Ze(t(r,T(e,ye(),n,i)),e)}function j(t){var r=c.getTokenPos();if(e.tokenIsIdentifierOrKeyword(he())){var n=H();if(Ve(24)){var i=j(!0);return Ze(F.createModuleDeclaration(void 0,n,i,t?4:void 0),r)}return t&&(n.isInJSDocNamespace=!0),n}}function J(t,r){for(;!e.isIdentifier(t)||!e.isIdentifier(r);){if(e.isIdentifier(t)||e.isIdentifier(r)||t.right.escapedText!==r.right.escapedText)return !1;t=t.left,r=r.left;}return t.escapedText===r.escapedText}function z(e){return U(1,e)}function U(t,r,n){for(var i=!0,a=!1;;)switch(Se()){case 59:if(i){var o=V(t,r);return !(o&&(343===o.kind||350===o.kind)&&4!==t&&n&&(e.isIdentifier(o.name)||!J(n,o.name.left)))&&o}a=!1;break;case 4:i=!0,a=!1;break;case 41:a&&(i=!1),a=!0;break;case 79:i=!1;break;case 1:return !1}}function V(t,r){e.Debug.assert(59===he());var n=c.getStartPos();Se();var i,a=H();switch(x(),a.escapedText){case"type":return 1===t&&L(n,a);case"prop":case"property":i=1;break;case"arg":case"argument":case"param":i=6;break;default:return !1}return !!(t&i)&&M(n,a,t,r)}function q(){var t=ye(),r=W(22);r&&x();var n,i=H(e.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);if(r&&(x(),Me(63),n=ee(8388608,Qt),Me(23)),!e.nodeIsMissing(i))return Ze(F.createTypeParameterDeclaration(void 0,i,void 0,n),t)}function W(e){return he()===e&&(Se(),!0)}function H(t){if(!e.tokenIsIdentifierOrKeyword(he()))return $e(79,!t,t||e.Diagnostics.Identifier_expected);C++;var r=c.getTokenPos(),n=c.getTextPos(),i=he(),a=et(c.getTokenValue()),o=Ze(F.createIdentifier(a,void 0,i),r,n);return Se(),o}}t.parseJSDocTypeExpressionForTests=function(t,n,i){O("file.js",t,99,void 0,1),c.setText(t,n,i),x=c.scan();var a=r(),o=W("file.js",99,1,!1,[],F.createToken(1),0,e.noop),s=e.attachFileToDiagnostics(y,o);return h&&(o.jsDocDiagnostics=e.attachFileToDiagnostics(h,o)),M(),a?{jsDocTypeExpression:a,diagnostics:s}:void 0},t.parseJSDocTypeExpression=r,t.parseJSDocNameReference=n,t.parseIsolatedJSDocComment=function(t,r,n){O("",t,99,void 0,1);var i=ee(8388608,(function(){return o(r,n)})),a={languageVariant:0,text:t},s=e.attachFileToDiagnostics(y,a);return M(),i?{jsDoc:i,diagnostics:s}:void 0},t.parseJSDocComment=function(t,r,n){var i=x,a=y.length,s=w,c=ee(8388608,(function(){return o(r,n)}));return e.setParent(c,t),262144&N&&(h||(h=[]),h.push.apply(h,y)),x=i,y.length=a,w=s,c},function(e){e[e.BeginningOfLine=0]="BeginningOfLine",e[e.SawAsterisk=1]="SawAsterisk",e[e.SavingComments=2]="SavingComments",e[e.SavingBackticks=3]="SavingBackticks";}(i||(i={})),function(e){e[e.Property=1]="Property",e[e.Parameter=2]="Parameter",e[e.CallbackParameter=4]="CallbackParameter";}(a||(a={}));}(Be=t.JSDocParser||(t.JSDocParser={}));}(y||(y={})),function(t){function r(t,r,i,o,s,c){return void(r?u(t):l(t));function l(t){var r="";if(c&&n(t)&&(r=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),e.setTextRangePosEnd(t,t.pos+i,t.end+i),c&&n(t)&&e.Debug.assert(r===s.substring(t.pos,t.end)),L(t,l,u),e.hasJSDocNodes(t))for(var _=0,d=t.jsDoc;_<d.length;_++)l(d[_]);a(t,c);}function u(t){t._children=void 0,e.setTextRangePosEnd(t,t.pos+i,t.end+i);for(var r=0,n=t;r<n.length;r++)l(n[r]);}}function n(e){switch(e.kind){case 10:case 8:case 79:return !0}return !1}function i(t,r,n,i,a){e.Debug.assert(t.end>=r,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=n,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end);var o=Math.min(t.pos,i),s=t.end>=n?t.end+a:Math.min(t.end,i);e.Debug.assert(o<=s),t.parent&&(e.Debug.assertGreaterThanOrEqual(o,t.parent.pos),e.Debug.assertLessThanOrEqual(s,t.parent.end)),e.setTextRangePosEnd(t,o,s);}function a(t,r){if(r){var n=t.pos,i=function(t){e.Debug.assert(t.pos>=n),n=t.end;};if(e.hasJSDocNodes(t))for(var a=0,o=t.jsDoc;a<o.length;a++)i(o[a]);L(t,i),e.Debug.assert(n<=t.end);}}function o(t,r){var n,i=t;if(L(t,(function t(a){if(!e.nodeIsMissing(a))return a.pos<=r?(a.pos>=i.pos&&(i=a),r<a.end?(L(a,t),!0):(e.Debug.assert(a.end<=r),void(n=a))):(e.Debug.assert(a.pos>r),!0)})),n){var a=function(t){for(;;){var r=e.getLastChild(t);if(!r)return t;t=r;}}(n);a.pos>i.pos&&(i=a);}return i}function s(t,r,n,i){var a=t.text;if(n&&(e.Debug.assert(a.length-n.span.length+n.newLength===r.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,n.span.start),s=r.substr(0,n.span.start);e.Debug.assert(o===s);var c=a.substring(e.textSpanEnd(n.span),a.length),l=r.substring(e.textSpanEnd(e.textChangeRangeNewSpan(n)),r.length);e.Debug.assert(c===l);}}function c(t){var r=t.statements,n=0;e.Debug.assert(n<r.length);var i=r[n],a=-1;return {currentNode:function(o){return o!==a&&(i&&i.end===o&&n<r.length-1&&(n++,i=r[n]),i&&i.pos===o||function(e){return r=void 0,n=-1,i=void 0,void L(t,a,o);function a(t){return e>=t.pos&&e<t.end&&(L(t,a,o),!0)}function o(t){if(e>=t.pos&&e<t.end)for(var s=0;s<t.length;s++){var c=t[s];if(c){if(c.pos===e)return r=t,n=s,i=c,!0;if(c.pos<e&&e<c.end)return L(c,a,o),!0}}return !1}}(o)),a=o,e.Debug.assert(!i||i.pos===o),i}}}var l;t.updateSourceFile=function(t,n,l,u){if(s(t,n,l,u=u||e.Debug.shouldAssert(2)),e.textChangeRangeIsUnchanged(l))return t;if(0===t.statements.length)return y.parseSourceFile(t.fileName,n,t.languageVersion,void 0,!0,t.scriptKind,t.setExternalModuleIndicator);var _=t;e.Debug.assert(!_.hasBeenIncrementallyParsed),_.hasBeenIncrementallyParsed=!0,y.fixupParentReferences(_);var d=t.text,p=c(t),f=function(t,r){for(var n=r.span.start,i=0;n>0&&i<=1;i++){var a=o(t,n);e.Debug.assert(a.pos<=n);var s=a.pos;n=Math.max(0,s-1);}var c=e.createTextSpanFromBounds(n,e.textSpanEnd(r.span)),l=r.newLength+(r.span.start-n);return e.createTextChangeRange(c,l)}(t,l);s(t,n,f,u),e.Debug.assert(f.span.start<=l.span.start),e.Debug.assert(e.textSpanEnd(f.span)===e.textSpanEnd(l.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(f))===e.textSpanEnd(e.textChangeRangeNewSpan(l)));var g=e.textChangeRangeNewSpan(f).length-f.span.length;!function(t,n,o,s,c,l,u,_){return void d(t);function d(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!1,c,l,u,_);else {var f=t.end;if(f>=n){if(t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c),L(t,d,p),e.hasJSDocNodes(t))for(var g=0,m=t.jsDoc;g<m.length;g++)d(m[g]);a(t,_);}else e.Debug.assert(f<n);}}function p(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!0,c,l,u,_);else {var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c);for(var p=0,f=t;p<f.length;p++)d(f[p]);}else e.Debug.assert(a<n);}}}(_,f.span.start,e.textSpanEnd(f.span),e.textSpanEnd(e.textChangeRangeNewSpan(f)),g,d,n,u);var m=y.parseSourceFile(t.fileName,n,t.languageVersion,p,!0,t.scriptKind,t.setExternalModuleIndicator);return m.commentDirectives=function(t,r,n,i,a,o,s,c){if(!t)return r;for(var l,u=!1,_=0,d=t;_<d.length;_++){var p=d[_],f=p.range,g=p.type;if(f.end<n)l=e.append(l,p);else if(f.pos>i){y();var m={range:{pos:f.pos+a,end:f.end+a},type:g};l=e.append(l,m),c&&e.Debug.assert(o.substring(f.pos,f.end)===s.substring(m.range.pos,m.range.end));}}return y(),l;function y(){u||(u=!0,l?r&&l.push.apply(l,r):l=r);}}(t.commentDirectives,m.commentDirectives,f.span.start,e.textSpanEnd(f.span),g,d,n,u),m.impliedNodeFormat=t.impliedNodeFormat,m},t.createSyntaxCursor=c,function(e){e[e.Value=-1]="Value";}(l||(l={}));}(v||(v={})),e.isDeclarationFileName=J,e.processCommentPragmas=z,e.processPragmasIntoFields=U;var K=new e.Map;function V(e){if(K.has(e))return K.get(e);var t=new RegExp("(\\s".concat(e,"\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"),"im");return K.set(e,t),t}var q=/^\/\/\/\s*<(\S+)\s.*?\/>/im,W=/^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;function H(t,r,n){var i=2===r.kind&&q.exec(n);if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(!(o&&1&o.kind))return;if(o.args){for(var s={},c=0,l=o.args;c<l.length;c++){var u=l[c],_=V(u.name).exec(n);if(!_&&!u.optional)return;if(_){var d=_[2]||_[3];if(u.captureSpan){var p=r.pos+_.index+_[1].length+1;s[u.name]={value:d,pos:p,end:p+d.length};}else s[u.name]=d;}}t.push({name:a,args:{arguments:s,range:r}});}else t.push({name:a,args:{arguments:{},range:r}});}else {var f=2===r.kind&&W.exec(n);if(f)return G(t,r,2,f);if(3===r.kind)for(var g=/@(\S+)(\s+.*)?$/gim,m=void 0;m=g.exec(n);)G(t,r,4,m);}}function G(t,r,n,i){if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(o&&o.kind&n){var s=function(t,r){if(!r)return {};if(!t.args)return {};for(var n=e.trimString(r).split(/\s+/),i={},a=0;a<t.args.length;a++){var o=t.args[a];if(!n[a]&&!o.optional)return "fail";if(o.captureSpan)return e.Debug.fail("Capture spans not yet implemented for non-xml pragmas");i[o.name]=n[a];}return i}(o,i[2]);"fail"!==s&&t.push({name:a,args:{arguments:s,range:r}});}}}function Q(e,t){return e.kind===t.kind&&(79===e.kind?e.escapedText===t.escapedText:108===e.kind||e.name.escapedText===t.name.escapedText&&Q(e.expression,t.expression))}e.tagNamesAreEquivalent=Q;}(t),function(e){e.compileOnSaveCommandLineOption={name:"compileOnSave",type:"boolean",defaultValueDescription:!1};var t=new e.Map(e.getEntries({preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5}));e.inverseJsxOptionMap=new e.Map(e.arrayFrom(e.mapIterator(t.entries(),(function(e){var t=e[0];return [""+e[1],t]}))));var r=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["es2022","lib.es2022.d.ts"],["esnext","lib.esnext.d.ts"],["dom","lib.dom.d.ts"],["dom.iterable","lib.dom.iterable.d.ts"],["webworker","lib.webworker.d.ts"],["webworker.importscripts","lib.webworker.importscripts.d.ts"],["webworker.iterable","lib.webworker.iterable.d.ts"],["scripthost","lib.scripthost.d.ts"],["es2015.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["es2015.symbol","lib.es2015.symbol.d.ts"],["es2015.symbol.wellknown","lib.es2015.symbol.wellknown.d.ts"],["es2016.array.include","lib.es2016.array.include.d.ts"],["es2017.object","lib.es2017.object.d.ts"],["es2017.sharedmemory","lib.es2017.sharedmemory.d.ts"],["es2017.string","lib.es2017.string.d.ts"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2019.intl","lib.es2019.intl.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.date","lib.es2020.date.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2020.number","lib.es2020.number.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["es2022.array","lib.es2022.array.d.ts"],["es2022.error","lib.es2022.error.d.ts"],["es2022.intl","lib.es2022.intl.d.ts"],["es2022.object","lib.es2022.object.d.ts"],["es2022.sharedmemory","lib.es2022.sharedmemory.d.ts"],["es2022.string","lib.es2022.string.d.ts"],["esnext.array","lib.es2022.array.d.ts"],["esnext.symbol","lib.es2019.symbol.d.ts"],["esnext.asynciterable","lib.es2018.asynciterable.d.ts"],["esnext.intl","lib.esnext.intl.d.ts"],["esnext.bigint","lib.es2020.bigint.d.ts"],["esnext.string","lib.es2022.string.d.ts"],["esnext.promise","lib.es2021.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"]];e.libs=r.map((function(e){return e[0]})),e.libMap=new e.Map(r),e.optionsForWatch=[{name:"watchFile",type:new e.Map(e.getEntries({fixedpollinginterval:e.WatchFileKind.FixedPollingInterval,prioritypollinginterval:e.WatchFileKind.PriorityPollingInterval,dynamicprioritypolling:e.WatchFileKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchFileKind.FixedChunkSizePolling,usefsevents:e.WatchFileKind.UseFsEvents,usefseventsonparentdirectory:e.WatchFileKind.UseFsEventsOnParentDirectory})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_the_TypeScript_watch_mode_works,defaultValueDescription:e.WatchFileKind.UseFsEvents},{name:"watchDirectory",type:new e.Map(e.getEntries({usefsevents:e.WatchDirectoryKind.UseFsEvents,fixedpollinginterval:e.WatchDirectoryKind.FixedPollingInterval,dynamicprioritypolling:e.WatchDirectoryKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchDirectoryKind.FixedChunkSizePolling})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,defaultValueDescription:e.WatchDirectoryKind.UseFsEvents},{name:"fallbackPolling",type:new e.Map(e.getEntries({fixedinterval:e.PollingWatchKind.FixedInterval,priorityinterval:e.PollingWatchKind.PriorityInterval,dynamicpriority:e.PollingWatchKind.DynamicPriority,fixedchunksize:e.PollingWatchKind.FixedChunkSize})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,defaultValueDescription:e.PollingWatchKind.PriorityInterval},{name:"synchronousWatchDirectory",type:"boolean",category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:!1},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing}],e.commonOptionsWithBuild=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_this_message,defaultValueDescription:!1},{name:"help",shortName:"?",type:"boolean",isCommandLineOnly:!0,category:e.Diagnostics.Command_line_Options,defaultValueDescription:!1},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Watch_input_files,defaultValueDescription:!1},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:!1,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:!1},{name:"listFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:!1},{name:"explainFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:!1},{name:"listEmittedFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:!1},{name:"pretty",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:!0},{name:"traceResolution",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:!1},{name:"diagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"extendedDiagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"generateCpuProfile",type:"string",isFilePath:!0,paramType:e.Diagnostics.FILE_OR_DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:!0,isCommandLineOnly:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:e.Diagnostics.Projects,description:e.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:!1},{name:"locale",type:"string",category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:e.Diagnostics.Platform_specific}],e.targetOptionDeclaration={name:"target",shortName:"t",type:new e.Map(e.getEntries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,esnext:99})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,paramType:e.Diagnostics.VERSION,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:0},e.moduleOptionDeclaration={name:"module",shortName:"m",type:new e.Map(e.getEntries({none:e.ModuleKind.None,commonjs:e.ModuleKind.CommonJS,amd:e.ModuleKind.AMD,system:e.ModuleKind.System,umd:e.ModuleKind.UMD,es6:e.ModuleKind.ES2015,es2015:e.ModuleKind.ES2015,es2020:e.ModuleKind.ES2020,es2022:e.ModuleKind.ES2022,esnext:e.ModuleKind.ESNext,node16:e.ModuleKind.Node16,nodenext:e.ModuleKind.NodeNext})),affectsModuleResolution:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_what_module_code_is_generated,defaultValueDescription:void 0};var a,o=[{name:"all",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_all_compiler_options,defaultValueDescription:!1},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_the_compiler_s_version,defaultValueDescription:!1},{name:"init",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:!1},{name:"project",shortName:"p",type:"string",isFilePath:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,paramType:e.Diagnostics.FILE_OR_DIRECTORY,description:e.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:!1},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Print_the_final_configuration_instead_of_building,defaultValueDescription:!1},{name:"listFilesOnly",type:"boolean",category:e.Diagnostics.Command_line_Options,affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,isCommandLineOnly:!0,description:e.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:!1},e.targetOptionDeclaration,e.moduleOptionDeclaration,{name:"lib",type:"list",element:{name:"lib",type:e.libMap,defaultValueDescription:void 0},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",affectsModuleResolution:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,defaultValueDescription:!1},{name:"checkJs",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:!1},{name:"jsx",type:t,affectsSourceFile:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsModuleResolution:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_what_JSX_code_is_generated,defaultValueDescription:void 0},{name:"declaration",shortName:"d",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,defaultValueDescription:!1,description:e.Diagnostics.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"sourceMap",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:!1,description:e.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files},{name:"outFile",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsDeclarationPath:!0,affectsBundleEmitBuildInfo:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_root_folder_within_your_source_files,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsBundleEmitBuildInfo:!0,isTSConfigOnly:!0,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:!1,description:e.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsBundleEmitBuildInfo:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:e.Diagnostics.Specify_the_path_to_tsbuildinfo_incremental_compilation_file},{name:"removeComments",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:!1,description:e.Diagnostics.Disable_emitting_comments},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"importHelpers",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:!1},{name:"importsNotUsedAsValues",type:new e.Map(e.getEntries({remove:0,preserve:1,error:2})),affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,defaultValueDescription:0},{name:"downlevelIteration",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:!1},{name:"isolatedModules",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:!0,defaultValueDescription:!1},{name:"strict",type:"boolean",affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_all_strict_type_checking_options,defaultValueDescription:!1},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:!1},{name:"alwaysStrict",type:"boolean",affectsSourceFile:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_use_strict_is_always_emitted,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,defaultValueDescription:!1},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:!1},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:!1},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:!1},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:!1},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,defaultValueDescription:!1},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:!1},{name:"noPropertyAccessFromIndexSignature",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!1,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:!1},{name:"moduleResolution",type:new e.Map(e.getEntries({node:e.ModuleResolutionKind.NodeJs,classic:e.ModuleResolutionKind.Classic,node16:e.ModuleResolutionKind.Node16,nodenext:e.ModuleResolutionKind.NodeNext})),affectsModuleResolution:!0,paramType:e.Diagnostics.STRATEGY,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:e.Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:!0,isFilePath:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:!0,isTSConfigOnly:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:!0,element:{name:"rootDirs",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:e.Diagnostics.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:!1},{name:"preserveSymlinks",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:!1},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:!1},{name:"moduleSuffixes",type:"list",element:{name:"suffix",type:"string"},listPreserveFalsyValues:!0,affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module},{name:"sourceRoot",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSourceMap",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"inlineSources",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"experimentalDecorators",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,defaultValueDescription:!1},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:!1},{name:"jsxFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,defaultValueDescription:"React.Fragment"},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsModuleResolution:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Enable_importing_json_files,defaultValueDescription:!1},{name:"out",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsDeclarationPath:!0,affectsBundleEmitBuildInfo:!0,isFilePath:!1,category:e.Diagnostics.Backwards_Compatibility,paramType:e.Diagnostics.FILE,transpileOptionValue:void 0,description:e.Diagnostics.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:!1},{name:"charset",type:"string",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:!1},{name:"newLine",type:new e.Map(e.getEntries({crlf:0,lf:1})),affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,paramType:e.Diagnostics.NEWLINE,category:e.Diagnostics.Emit,description:e.Diagnostics.Set_the_newline_character_for_emitting_files,defaultValueDescription:e.Diagnostics.Platform_specific},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_truncating_types_in_error_messages,defaultValueDescription:!1},{name:"noLib",type:"boolean",category:e.Diagnostics.Language_and_Environment,affectsProgramStructure:!0,description:e.Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:!0,defaultValueDescription:!1},{name:"noResolve",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:!0,defaultValueDescription:!1},{name:"stripInternal",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:!1},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:!0,category:e.Diagnostics.Editor_Support,description:e.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:!1},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:!1},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:!1},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:!1},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:!1},{name:"noEmitHelpers",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:!1},{name:"noEmitOnError",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:!1},{name:"preserveConstEnums",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:!1},{name:"declarationDir",type:"string",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_all_d_ts_files,defaultValueDescription:!1},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unused_labels,defaultValueDescription:void 0},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unreachable_code,defaultValueDescription:void 0},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:!1},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:!1},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:!1},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:0},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:!1},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:e.Diagnostics.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:!0,affectsMultiFileEmitBuildInfo:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:!1},{name:"keyofStringsOnly",type:"boolean",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:!1},{name:"plugins",type:"list",isTSConfigOnly:!0,element:{name:"plugin",type:"object"},description:e.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,category:e.Diagnostics.Editor_Support},{name:"moduleDetection",type:new e.Map(e.getEntries({auto:e.ModuleDetectionKind.Auto,legacy:e.ModuleDetectionKind.Legacy,force:e.ModuleDetectionKind.Force})),affectsModuleResolution:!0,description:e.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,category:e.Diagnostics.Language_and_Environment,defaultValueDescription:e.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules}];function s(t){var r=new e.Map,n=new e.Map;return e.forEach(t,(function(e){r.set(e.name.toLowerCase(),e),e.shortName&&n.set(e.shortName,e.name);})),{optionsNameMap:r,shortOptionNames:n}}function c(){return a||(a=s(e.optionDeclarations))}e.optionDeclarations=n$4(n$4([],e.commonOptionsWithBuild,!0),o,!0),e.semanticDiagnosticsOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsSemanticDiagnostics})),e.affectsEmitOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsEmit})),e.affectsDeclarationPathOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsDeclarationPath})),e.moduleResolutionOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsModuleResolution})),e.sourceFileAffectingCompilerOptions=e.optionDeclarations.filter((function(e){return !!e.affectsSourceFile||!!e.affectsModuleResolution||!!e.affectsBindDiagnostics})),e.optionsAffectingProgramStructure=e.optionDeclarations.filter((function(e){return !!e.affectsProgramStructure})),e.transpileOptionValueCompilerOptions=e.optionDeclarations.filter((function(t){return e.hasProperty(t,"transpileOptionValue")})),e.optionsForBuild=[{name:"verbose",shortName:"v",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Enable_verbose_logging,type:"boolean",defaultValueDescription:!1},{name:"dry",shortName:"d",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:!1},{name:"force",shortName:"f",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:!1},{name:"clean",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:!1}],e.buildOpts=n$4(n$4([],e.commonOptionsWithBuild,!0),e.optionsForBuild,!0),e.typeAcquisitionDeclarations=[{name:"enableAutoDiscovery",type:"boolean",defaultValueDescription:!1},{name:"enable",type:"boolean",defaultValueDescription:!1},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:!1}],e.createOptionNameMap=s,e.getOptionsNameMap=c;var l,u={diagnostic:e.Diagnostics.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:D};function _(e){return e&&void 0!==e.enableAutoDiscovery&&void 0===e.enable?{enable:e.enableAutoDiscovery,include:e.include||[],exclude:e.exclude||[]}:e}function d(t){return p(t,e.createCompilerDiagnostic)}function p(t,r){var n=e.arrayFrom(t.type.keys()).map((function(e){return "'".concat(e,"'")})).join(", ");return r(e.Diagnostics.Argument_for_0_option_must_be_Colon_1,"--".concat(t.name),n)}function f(t,r,n){return ye(t,e.trimString(r||""),n)}function g(t,r,n){if(void 0===r&&(r=""),r=e.trimString(r),!e.startsWith(r,"-")){if(""===r)return [];var i=r.split(",");switch(t.element.type){case"number":return e.mapDefined(i,(function(e){return me(t.element,parseInt(e),n)}));case"string":return e.mapDefined(i,(function(e){return me(t.element,e||"",n)}));default:return e.mapDefined(i,(function(e){return f(t.element,e,n)}))}}}function m(e){return e.name}function y(t,r,n,i){var a;if(null===(a=r.alternateMode)||void 0===a?void 0:a.getOptionsNameMap().optionsNameMap.has(t.toLowerCase()))return n(r.alternateMode.diagnostic,t);var o=e.getSpellingSuggestion(t,r.optionDeclarations,m);return o?n(r.unknownDidYouMeanDiagnostic,i||t,o.name):n(r.unknownOptionDiagnostic,i||t)}function v(t,r,n){var i,a={},o=[],s=[];return c(r),{options:a,watchOptions:i,fileNames:o,errors:s};function c(r){for(var n=0;n<r.length;){var c=r[n];if(n++,64===c.charCodeAt(0))l(c.slice(1));else if(45===c.charCodeAt(0)){var u=c.slice(45===c.charCodeAt(1)?2:1),_=x(t.getOptionsNameMap,u,!0);if(_)n=h(r,n,t,_,a,s);else {var d=x(M.getOptionsNameMap,u,!0);d?n=h(r,n,M,d,i||(i={}),s):s.push(y(u,t,e.createCompilerDiagnostic,c));}}else o.push(c);}}function l(t){var r=E(t,n||function(t){return e.sys.readFile(t)});if(e.isString(r)){for(var i=[],a=0;;){for(;a<r.length&&r.charCodeAt(a)<=32;)a++;if(a>=r.length)break;var o=a;if(34===r.charCodeAt(o)){for(a++;a<r.length&&34!==r.charCodeAt(a);)a++;a<r.length?(i.push(r.substring(o+1,a)),a++):s.push(e.createCompilerDiagnostic(e.Diagnostics.Unterminated_quoted_string_in_response_file_0,t));}else {for(;r.charCodeAt(a)>32;)a++;i.push(r.substring(o,a));}}c(i);}else s.push(r);}}function h(t,r,n,i,a,o){if(i.isTSConfigOnly)"null"===(s=t[r])?(a[i.name]=void 0,r++):"boolean"===i.type?"false"===s?(a[i.name]=me(i,!1,o),r++):("true"===s&&r++,o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),s&&!e.startsWith(s,"-")&&r++);else if(t[r]||"boolean"===i.type||o.push(e.createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,i.name,U(i))),"null"!==t[r])switch(i.type){case"number":a[i.name]=me(i,parseInt(t[r]),o),r++;break;case"boolean":var s=t[r];a[i.name]=me(i,"false"!==s,o),"false"!==s&&"true"!==s||r++;break;case"string":a[i.name]=me(i,t[r]||"",o),r++;break;case"list":var c=g(i,t[r],o);a[i.name]=c||[],c&&r++;break;default:a[i.name]=f(i,t[r],o),r++;}else a[i.name]=void 0,r++;return r}function b(e,t){return x(c,e,t)}function x(e,t,r){void 0===r&&(r=!1),t=t.toLowerCase();var n=e(),i=n.optionsNameMap,a=n.shortOptionNames;if(r){var o=a.get(t);void 0!==o&&(t=o);}return i.get(t)}function D(){return l||(l=s(e.buildOpts))}e.defaultInitCompilerOptions={module:e.ModuleKind.CommonJS,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},e.convertEnableAutoDiscoveryToEnable=_,e.createCompilerDiagnosticForInvalidCustomType=d,e.parseCustomTypeOption=f,e.parseListTypeOption=g,e.parseCommandLineWorker=v,e.compilerOptionsDidYouMeanDiagnostics={alternateMode:u,getOptionsNameMap:c,optionDeclarations:e.optionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Compiler_option_0_expects_an_argument},e.parseCommandLine=function(t,r){return v(e.compilerOptionsDidYouMeanDiagnostics,t,r)},e.getOptionFromName=b;var S={alternateMode:{diagnostic:e.Diagnostics.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:c},getOptionsNameMap:D,optionDeclarations:e.buildOpts,unknownOptionDiagnostic:e.Diagnostics.Unknown_build_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Build_option_0_requires_a_value_of_type_1};function T(t,r){var n=e.parseJsonText(t,r);return {config:j(n,n.parseDiagnostics,!1,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function C(t,r){var n=E(t,r);return e.isString(n)?e.parseJsonText(t,n):{fileName:t,parseDiagnostics:[n]}}function E(t,r){var n;try{n=r(t);}catch(r){return e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,r.message)}return void 0===n?e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0,t):n}function k(t){return e.arrayToMap(t,m)}e.parseBuildCommand=function(t){var r=v(S,t),n=r.options,i=r.watchOptions,a=r.fileNames,o=r.errors,s=n;return 0===a.length&&a.push("."),s.clean&&s.force&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","force")),s.clean&&s.verbose&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","verbose")),s.clean&&s.watch&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","watch")),s.watch&&s.dry&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:s,watchOptions:i,projects:a,errors:o}},e.getDiagnosticText=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=e.createCompilerDiagnostic.apply(void 0,arguments);return i.messageText},e.getParsedCommandLineOfConfigFile=function(t,r,n,i,a,o){var s=E(t,(function(e){return n.readFile(e)}));if(e.isString(s)){var c=e.parseJsonText(t,s),l=n.getCurrentDirectory();return c.path=e.toPath(t,l,e.createGetCanonicalFileName(n.useCaseSensitiveFileNames)),c.resolvedPath=c.path,c.originalFileName=c.fileName,Z(c,n,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),l),r,e.getNormalizedAbsolutePath(t,l),void 0,o,i,a)}n.onUnRecoverableConfigFileDiagnostic(s);},e.readConfigFile=function(t,r){var n=E(t,r);return e.isString(n)?T(t,n):{config:{},error:n}},e.parseConfigFileTextToJson=T,e.readJsonConfigFile=C,e.tryReadFile=E;var N,A={optionDeclarations:e.typeAcquisitionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1};function F(){return N||(N=s(e.optionsForWatch))}var P,w,I,O,M={getOptionsNameMap:F,optionDeclarations:e.optionsForWatch,unknownOptionDiagnostic:e.Diagnostics.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Watch_option_0_requires_a_value_of_type_1};function L(){return P||(P=k(e.optionDeclarations))}function R(){return w||(w=k(e.optionsForWatch))}function B(){return I||(I=k(e.typeAcquisitionDeclarations))}function j(t,r,n,i){var a,o=null===(a=t.statements[0])||void 0===a?void 0:a.expression,s=n?(void 0===O&&(O={name:void 0,type:"object",elementOptions:k([{name:"compilerOptions",type:"object",elementOptions:L(),extraKeyDiagnostics:e.compilerOptionsDidYouMeanDiagnostics},{name:"watchOptions",type:"object",elementOptions:R(),extraKeyDiagnostics:M},{name:"typingOptions",type:"object",elementOptions:B(),extraKeyDiagnostics:A},{name:"typeAcquisition",type:"object",elementOptions:B(),extraKeyDiagnostics:A},{name:"extends",type:"string",category:e.Diagnostics.File_Management},{name:"references",type:"list",element:{name:"references",type:"object"},category:e.Diagnostics.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:e.Diagnostics.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},e.compileOnSaveCommandLineOption])}),O):void 0;if(o&&207!==o.kind){if(r.push(e.createDiagnosticForNodeInSourceFile(t,o,e.Diagnostics.The_root_value_of_a_0_file_must_be_an_object,"jsconfig.json"===e.getBaseFileName(t.fileName)?"jsconfig.json":"tsconfig.json")),e.isArrayLiteralExpression(o)){var c=e.find(o.elements,e.isObjectLiteralExpression);if(c)return z(t,c,r,!0,s,i)}return {}}return z(t,o,r,!0,s,i)}function J(e,t){var r;return z(e,null===(r=e.statements[0])||void 0===r?void 0:r.expression,t,!0,void 0,void 0)}function z(t,r,i,a,o,s){return r?u(r,o):a?{}:void 0;function c(e){return o&&o.elementOptions===e}function l(r,n,o,l){for(var d=a?{}:void 0,p=function(r){if(299!==r.kind)return i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_assignment_expected)),"continue";r.questionToken&&i.push(e.createDiagnosticForNodeInSourceFile(t,r.questionToken,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),_(r.name)||i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,e.Diagnostics.String_literal_with_double_quotes_expected));var p=e.isComputedNonLiteralName(r.name)?void 0:e.getTextOfPropertyName(r.name),f=p&&e.unescapeLeadingUnderscores(p),g=f&&n?n.get(f):void 0;f&&o&&!g&&(n?i.push(y(f,o,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r.name,n,i,a)}))):i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,o.unknownOptionDiagnostic,f)));var m=u(r.initializer,g);if(void 0!==f&&(a&&(d[f]=m),s&&(l||c(n)))){var v=K(g,m);l?v&&s.onSetValidOptionKeyValueInParent(l,g,m):c(n)&&(v?s.onSetValidOptionKeyValueInRoot(f,r.name,m,r.initializer):g||s.onSetUnknownOptionKeyValueInRoot(f,r.name,m,r.initializer));}},f=0,g=r.properties;f<g.length;f++)p(g[f]);return d}function u(r,o){var s;switch(r.kind){case 110:return y(o&&"boolean"!==o.type),m(!0);case 95:return y(o&&"boolean"!==o.type),m(!1);case 104:return y(o&&"extends"===o.name),m(null);case 10:_(r)||i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.String_literal_with_double_quotes_expected)),y(o&&e.isString(o.type)&&"string"!==o.type);var c=r.text;if(o&&!e.isString(o.type)){var d=o;d.type.has(c.toLowerCase())||(i.push(p(d,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a)}))),s=!0);}return m(c);case 8:return y(o&&"number"!==o.type),m(Number(r.text));case 221:if(40!==r.operator||8!==r.operand.kind)break;return y(o&&"number"!==o.type),m(-Number(r.operand.text));case 207:y(o&&"object"!==o.type);var f=r;if(o){var g=o;return m(l(f,g.elementOptions,g.extraKeyDiagnostics,g.name))}return m(l(f,void 0,void 0,void 0));case 206:return y(o&&"list"!==o.type),m(function(t,r){if(a)return e.filter(t.map((function(e){return u(e,r)})),(function(e){return void 0!==e}));t.forEach((function(e){return u(e,r)}));}(r.elements,o&&o.element))}return void(o?y(!0):i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)));function m(a){var c;if(!s){var l=null===(c=null==o?void 0:o.extraValidation)||void 0===c?void 0:c.call(o,a);if(l)return void i.push(e.createDiagnosticForNodeInSourceFile.apply(void 0,n$4([t,r],l,!1)))}return a}function y(n){n&&(i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,o.name,U(o))),s=!0);}}function _(r){return e.isStringLiteral(r)&&e.isStringDoubleQuoted(r,t)}}function U(t){return "list"===t.type?"Array":e.isString(t.type)?t.type:"string"}function K(t,r){return !!t&&(!!ee(r)||("list"===t.type?e.isArray(r):typeof r===(e.isString(t.type)?t.type:"string")))}function V(t){return i$1({},e.arrayFrom(t.entries()).reduce((function(e,t){var r;return i$1(i$1({},e),((r={})[t[0]]=t[1],r))}),{}))}function q(t){if(e.length(t)){if(1!==e.length(t))return t;if(t[0]!==e.defaultIncludeSpec)return t}}function W(e){return "string"===e.type||"number"===e.type||"boolean"===e.type||"object"===e.type?void 0:"list"===e.type?W(e.element):e.type}function H(t,r){return e.forEachEntry(r,(function(e,r){if(e===t)return r}))}function G(e,t){return Q(e,c(),t)}function Q(t,r,n){var i=r.optionsNameMap,a=new e.Map,o=n&&e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),s=function(r){if(e.hasProperty(t,r)){if(i.has(r)&&(i.get(r).category===e.Diagnostics.Command_line_Options||i.get(r).category===e.Diagnostics.Output_Formatting))return "continue";var s=t[r],c=i.get(r.toLowerCase());if(c){var l=W(c);l?"list"===c.type?a.set(r,s.map((function(e){return H(e,l)}))):a.set(r,H(s,l)):n&&c.isFilePath?a.set(r,e.getRelativePathFromFile(n.configFilePath,e.getNormalizedAbsolutePath(s,e.getDirectoryPath(n.configFilePath)),o)):a.set(r,s);}}};for(var c in t)s(c);return a}function X(t){return G(e.extend(t,e.defaultInitCompilerOptions))}function Y(e,t,r){if(e&&!ee(t))if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function Z(t,r,n,i,a,o,s,c,l){null===e.tracing||void 0===e.tracing||e.tracing.push("parse","parseJsonSourceFileConfigFileContent",{path:t.fileName});var u=re(void 0,t,r,n,i,l,a,o,s,c);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),u}function $(e,t){t&&Object.defineProperty(e,"configFile",{enumerable:!1,writable:!1,value:t});}function ee(e){return null==e}function te(t,r){return e.getDirectoryPath(e.getNormalizedAbsolutePath(t,r))}function re(t,r,n,i,a,o,s,c,l,u){void 0===a&&(a={}),void 0===c&&(c=[]),void 0===l&&(l=[]),e.Debug.assert(void 0===t&&void 0!==r||void 0!==t&&void 0===r);var _=[],d=oe(t,r,n,i,s,c,_,u),p=d.raw,f=e.extend(a,d.options||{}),g=o&&d.watchOptions?e.extend(o,d.watchOptions):d.watchOptions||o;f.configFilePath=s&&e.normalizeSlashes(s);var m=function(){var t=b("references",(function(e){return "object"==typeof e}),"object"),n=v(h("files"));if(n){var i="no-prop"===t||e.isArray(t)&&0===t.length,a=e.hasProperty(p,"extends");if(0===n.length&&i&&!a)if(r){var o=s||"tsconfig.json",c=e.Diagnostics.The_files_list_in_config_file_0_is_empty,l=e.firstDefined(e.getTsConfigPropArray(r,"files"),(function(e){return e.initializer})),u=l?e.createDiagnosticForNodeInSourceFile(r,l,c,o):e.createCompilerDiagnostic(c,o);_.push(u);}else x(e.Diagnostics.The_files_list_in_config_file_0_is_empty,s||"tsconfig.json");}var d,f,g=v(h("include")),m=h("exclude"),y=!1,D=v(m);if("no-prop"===m&&p.compilerOptions){var S=p.compilerOptions.outDir,T=p.compilerOptions.declarationDir;(S||T)&&(D=[S,T].filter((function(e){return !!e})));}return void 0===n&&void 0===g&&(g=[e.defaultIncludeSpec],y=!0),g&&(d=Se(g,_,!0,r,"include")),D&&(f=Se(D,_,!1,r,"exclude")),{filesSpecs:n,includeSpecs:g,excludeSpecs:D,validatedFilesSpec:e.filter(n,e.isString),validatedIncludeSpecs:d,validatedExcludeSpecs:f,pathPatterns:void 0,isDefaultIncludeSpec:y}}();r&&(r.configFileSpecs=m),$(f,r);var y=e.normalizePath(s?te(s,i):i);return {options:f,watchOptions:g,fileNames:function(e){var t=be(m,e,f,n,l);return ie(t,ae(p),c)&&_.push(ne(m,s)),t}(y),projectReferences:function(t){var r,n=b("references",(function(e){return "object"==typeof e}),"object");if(e.isArray(n))for(var i=0,a=n;i<a.length;i++){var o=a[i];"string"!=typeof o.path?x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string"):(r||(r=[])).push({path:e.getNormalizedAbsolutePath(o.path,t),originalPath:o.path,prepend:o.prepend,circular:o.circular});}return r}(y),typeAcquisition:d.typeAcquisition||ue(),raw:p,errors:_,wildcardDirectories:Ce(m,y,n.useCaseSensitiveFileNames),compileOnSave:!!p.compileOnSave};function v(t){return e.isArray(t)?t:void 0}function h(t){return b(t,e.isString,"string")}function b(t,n,i){if(e.hasProperty(p,t)&&!ee(p[t])){if(e.isArray(p[t])){var a=p[t];return r||e.every(a,n)||_.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,i)),a}return x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,"Array"),"not-array"}return "no-prop"}function x(t,n,i){r||_.push(e.createCompilerDiagnostic(t,n,i));}}function ne(t,r){var n=t.includeSpecs,i=t.excludeSpecs;return e.createCompilerDiagnostic(e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,r||"tsconfig.json",JSON.stringify(n||[]),JSON.stringify(i||[]))}function ie(e,t,r){return 0===e.length&&t&&(!r||0===r.length)}function ae(t){return !e.hasProperty(t,"files")&&!e.hasProperty(t,"references")}function oe(t,r,i,a,s,c,l,u){var _;a=e.normalizeSlashes(a);var d=e.getNormalizedAbsolutePath(s||"",a);if(c.indexOf(d)>=0)return l.push(e.createCompilerDiagnostic(e.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0,n$4(n$4([],c,!0),[d],!1).join(" -> "))),{raw:t||J(r,l)};var p=t?function(t,r,n,i,a){e.hasProperty(t,"excludes")&&a.push(e.createCompilerDiagnostic(e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));var o,s=le(t.compilerOptions,n,a,i),c=_e(t.typeAcquisition||t.typingOptions,n,a,i),l=function(e,t,r){return de(R(),e,t,void 0,M,r)}(t.watchOptions,n,a);if(t.compileOnSave=function(t,r,n){if(!e.hasProperty(t,e.compileOnSaveCommandLineOption.name))return !1;var i=pe(e.compileOnSaveCommandLineOption,t.compileOnSave,r,n);return "boolean"==typeof i&&i}(t,n,a),t.extends)if(e.isString(t.extends)){var u=i?te(i,n):n;o=se(t.extends,r,u,a,e.createCompilerDiagnostic);}else a.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"extends","string"));return {raw:t,options:s,watchOptions:l,typeAcquisition:c,extendedConfigPath:o}}(t,i,a,s,l):function(t,r,n,i,a){var s,c,l,u,_,d=ce(i),p={onSetValidOptionKeyValueInParent:function(t,r,a){var o;switch(t){case"compilerOptions":o=d;break;case"watchOptions":o=l||(l={});break;case"typeAcquisition":o=s||(s=ue(i));break;case"typingOptions":o=c||(c=ue(i));break;default:e.Debug.fail("Unknown option");}o[r.name]=fe(r,n,a);},onSetValidOptionKeyValueInRoot:function(o,s,c,l){if("extends"!==o);else {var _=i?te(i,n):n;u=se(c,r,_,a,(function(r,n){return e.createDiagnosticForNodeInSourceFile(t,l,r,n)}));}},onSetUnknownOptionKeyValueInRoot:function(r,n,i,s){"excludes"===r&&a.push(e.createDiagnosticForNodeInSourceFile(t,n,e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)),e.find(o,(function(e){return e.name===r}))&&(_=e.append(_,n));}},f=j(t,a,!0,p);return s||(s=c?void 0!==c.enableAutoDiscovery?{enable:c.enableAutoDiscovery,include:c.include,exclude:c.exclude}:c:ue(i)),_&&f&&void 0===f.compilerOptions&&a.push(e.createDiagnosticForNodeInSourceFile(t,_[0],e.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,e.getTextOfPropertyName(_[0]))),{raw:f,options:d,watchOptions:l,typeAcquisition:s,extendedConfigPath:u}}(r,i,a,s,l);if((null===(_=p.options)||void 0===_?void 0:_.paths)&&(p.options.pathsBasePath=a),p.extendedConfigPath){c=c.concat([d]);var f=function(t,r,n,i,a,o){var s,c,l,u,_=n.useCaseSensitiveFileNames?r:e.toFileNameLowerCase(r);if(o&&(c=o.get(_))?(l=c.extendedResult,u=c.extendedConfig):(l=C(r,(function(e){return n.readFile(e)})),l.parseDiagnostics.length||(u=oe(void 0,l,n,e.getDirectoryPath(r),e.getBaseFileName(r),i,a,o)),o&&o.set(_,{extendedResult:l,extendedConfig:u})),t&&(t.extendedSourceFiles=[l.fileName],l.extendedSourceFiles&&(s=t.extendedSourceFiles).push.apply(s,l.extendedSourceFiles)),!l.parseDiagnostics.length)return u;a.push.apply(a,l.parseDiagnostics);}(r,p.extendedConfigPath,i,c,l,u);if(f&&f.options){var g,m=f.raw,y=p.raw,v=function(t){!y[t]&&m[t]&&(y[t]=e.map(m[t],(function(t){return e.isRootedDiskPath(t)?t:e.combinePaths(g||(g=e.convertToRelativePath(e.getDirectoryPath(p.extendedConfigPath),a,e.createGetCanonicalFileName(i.useCaseSensitiveFileNames))),t)})));};v("include"),v("exclude"),v("files"),void 0===y.compileOnSave&&(y.compileOnSave=m.compileOnSave),p.options=e.assign({},f.options,p.options),p.watchOptions=p.watchOptions&&f.watchOptions?e.assign({},f.watchOptions,p.watchOptions):p.watchOptions||f.watchOptions;}}return p}function se(t,r,n,i,a){if(t=e.normalizeSlashes(t),e.isRootedDiskPath(t)||e.startsWith(t,"./")||e.startsWith(t,"../")){var o=e.getNormalizedAbsolutePath(t,n);return r.fileExists(o)||e.endsWith(o,".json")||(o="".concat(o,".json"),r.fileExists(o))?o:void i.push(a(e.Diagnostics.File_0_not_found,t))}var s=e.nodeModuleNameResolver(t,e.combinePaths(n,"tsconfig.json"),{moduleResolution:e.ModuleResolutionKind.NodeJs},r,void 0,void 0,!0);if(s.resolvedModule)return s.resolvedModule.resolvedFileName;i.push(a(e.Diagnostics.File_0_not_found,t));}function ce(t){return t&&"jsconfig.json"===e.getBaseFileName(t)?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function le(t,r,n,i){var a=ce(i);return de(L(),t,r,a,e.compilerOptionsDidYouMeanDiagnostics,n),i&&(a.configFilePath=e.normalizeSlashes(i)),a}function ue(t){return {enable:!!t&&"jsconfig.json"===e.getBaseFileName(t),include:[],exclude:[]}}function _e(e,t,r,n){var i=ue(n),a=_(e);return de(B(),a,t,i,A,r),i}function de(t,r,n,i,a,o){if(r){for(var s in r){var c=t.get(s);c?(i||(i={}))[c.name]=pe(c,r[s],n,o):o.push(y(s,a,e.createCompilerDiagnostic));}return i}}function pe(t,r,n,i){if(K(t,r)){var a=t.type;if("list"===a&&e.isArray(r))return function(t,r,n,i){return e.filter(e.map(r,(function(e){return pe(t.element,e,n,i)})),(function(e){return !!t.listPreserveFalsyValues||!!e}))}(t,r,n,i);if(!e.isString(a))return ye(t,r,i);var o=me(t,r,i);return ee(o)?o:ge(t,n,o)}i.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t.name,U(t)));}function fe(t,r,n){if(!ee(n)){if("list"===t.type){var i=t;return i.element.isFilePath||!e.isString(i.element.type)?e.filter(e.map(n,(function(e){return fe(i.element,r,e)})),(function(e){return !!i.listPreserveFalsyValues||!!e})):n}return e.isString(t.type)?ge(t,r,n):t.type.get(e.isString(n)?n.toLowerCase():n)}}function ge(t,r,n){return t.isFilePath&&""===(n=e.getNormalizedAbsolutePath(n,r))&&(n="."),n}function me(t,r,n){var i;if(!ee(r)){var a=null===(i=t.extraValidation)||void 0===i?void 0:i.call(t,r);if(!a)return r;n.push(e.createCompilerDiagnostic.apply(void 0,a));}}function ye(e,t,r){if(!ee(t)){var n=t.toLowerCase(),i=e.type.get(n);if(void 0!==i)return me(e,i,r);r.push(d(e));}}e.convertToObject=J,e.convertToObjectWorker=z,e.convertToTSConfig=function(t,r,n){var a,o,s,c=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),l=e.map(e.filter(t.fileNames,(null===(o=null===(a=t.options.configFile)||void 0===a?void 0:a.configFileSpecs)||void 0===o?void 0:o.validatedIncludeSpecs)?function(t,r,n,i){if(!r)return e.returnTrue;var a=e.getFileMatcherPatterns(t,n,r,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=a.excludePattern&&e.getRegexFromPattern(a.excludePattern,i.useCaseSensitiveFileNames),s=a.includeFilePattern&&e.getRegexFromPattern(a.includeFilePattern,i.useCaseSensitiveFileNames);return s?o?function(e){return !(s.test(e)&&!o.test(e))}:function(e){return !s.test(e)}:o?function(e){return o.test(e)}:e.returnTrue}(r,t.options.configFile.configFileSpecs.validatedIncludeSpecs,t.options.configFile.configFileSpecs.validatedExcludeSpecs,n):e.returnTrue),(function(t){return e.getRelativePathFromFile(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),e.getNormalizedAbsolutePath(t,n.getCurrentDirectory()),c)})),u=G(t.options,{configFilePath:e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),useCaseSensitiveFileNames:n.useCaseSensitiveFileNames}),_=t.watchOptions&&Q(t.watchOptions,F());return i$1(i$1({compilerOptions:i$1(i$1({},V(u)),{showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0}),watchOptions:_&&V(_),references:e.map(t.projectReferences,(function(e){return i$1(i$1({},e),{path:e.originalPath?e.originalPath:"",originalPath:void 0})})),files:e.length(l)?l:void 0},(null===(s=t.options.configFile)||void 0===s?void 0:s.configFileSpecs)?{include:q(t.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:t.options.configFile.configFileSpecs.validatedExcludeSpecs}:{}),{compileOnSave:!!t.compileOnSave||void 0})},e.getNameOfCompilerOptionValue=H,e.getCompilerOptionsDiffValue=function(t,r){var n,i,a=X(t);return n=[],i=Array(3).join(" "),o.forEach((function(t){if(a.has(t.name)){var r=a.get(t.name),o=Ne(t);r!==o?n.push("".concat(i).concat(t.name,": ").concat(r)):e.hasProperty(e.defaultInitCompilerOptions,t.name)&&n.push("".concat(i).concat(t.name,": ").concat(o));}})),n.join(r)+r},e.generateTSConfig=function(t,r,n){var i=X(t);return function(){var t=new e.Map;t.set(e.Diagnostics.Projects,[]),t.set(e.Diagnostics.Language_and_Environment,[]),t.set(e.Diagnostics.Modules,[]),t.set(e.Diagnostics.JavaScript_Support,[]),t.set(e.Diagnostics.Emit,[]),t.set(e.Diagnostics.Interop_Constraints,[]),t.set(e.Diagnostics.Type_Checking,[]),t.set(e.Diagnostics.Completeness,[]);for(var s=0,c=e.optionDeclarations;s<c.length;s++){var l=c[s];if(o(l)){var u=t.get(l.category);u||t.set(l.category,u=[]),u.push(l);}}var _=0,d=0,p=[];t.forEach((function(t,r){0!==p.length&&p.push({value:""}),p.push({value:"/* ".concat(e.getLocaleSpecificMessage(r)," */")});for(var n=0,a=t;n<a.length;n++){var o,s=a[n];o=i.has(s.name)?'"'.concat(s.name,'": ').concat(JSON.stringify(i.get(s.name))).concat((d+=1)===i.size?"":","):'// "'.concat(s.name,'": ').concat(JSON.stringify(Ne(s)),","),p.push({value:o,description:"/* ".concat(s.description&&e.getLocaleSpecificMessage(s.description)||s.name," */")}),_=Math.max(o.length,_);}}));var f=a(2),g=[];g.push("{"),g.push("".concat(f,'"compilerOptions": {')),g.push("".concat(f).concat(f,"/* ").concat(e.getLocaleSpecificMessage(e.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)," */")),g.push("");for(var m=0,y=p;m<y.length;m++){var v=y[m],h=v.value,b=v.description,x=void 0===b?"":b;g.push(h&&"".concat(f).concat(f).concat(h).concat(x&&a(_-h.length+2)+x));}if(r.length){g.push("".concat(f,"},")),g.push("".concat(f,'"files": ['));for(var D=0;D<r.length;D++)g.push("".concat(f).concat(f).concat(JSON.stringify(r[D])).concat(D===r.length-1?"":","));g.push("".concat(f,"]"));}else g.push("".concat(f,"}"));return g.push("}"),g.join(n)+n}();function a(e){return Array(e+1).join(" ")}function o(t){var r=t.category,n=t.name,a=t.isCommandLineOnly,o=[e.Diagnostics.Command_line_Options,e.Diagnostics.Editor_Support,e.Diagnostics.Compiler_Diagnostics,e.Diagnostics.Backwards_Compatibility,e.Diagnostics.Watch_and_Build_Modes,e.Diagnostics.Output_Formatting];return !a&&void 0!==r&&(!o.includes(r)||i.has(n))}},e.convertToOptionsWithAbsolutePaths=function(t,r){var n={},i=c().optionsNameMap;for(var a in t)e.hasProperty(t,a)&&(n[a]=Y(i.get(a.toLowerCase()),t[a],r));return n.configFilePath&&(n.configFilePath=r(n.configFilePath)),n},e.parseJsonConfigFileContent=function(e,t,r,n,i,a,o,s,c){return re(e,void 0,t,r,n,c,i,a,o,s)},e.parseJsonSourceFileConfigFileContent=Z,e.setConfigFileInOptions=$,e.defaultIncludeSpec="**/*",e.canJsonReportNoInputFiles=ae,e.updateErrorForNoInputFiles=function(t,r,n,i,a){var o=i.length;return ie(t,a)?i.push(ne(n,r)):e.filterMutate(i,(function(t){return !function(t){return t.code===e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}(t)})),o!==i.length},e.convertCompilerOptionsFromJson=function(e,t,r){var n=[];return {options:le(e,t,n,r),errors:n}},e.convertTypeAcquisitionFromJson=function(e,t,r){var n=[];return {options:_e(e,t,n,r),errors:n}},e.convertJsonOption=pe;var ve=/(^|\/)\*\*\/?$/,he=/^[^*?]*(?=\/[^/]*[*?])/;function be(t,r,n,i,a){void 0===a&&(a=e.emptyArray),r=e.normalizePath(r);var o,s=e.createGetCanonicalFileName(i.useCaseSensitiveFileNames),c=new e.Map,l=new e.Map,u=new e.Map,_=t.validatedFilesSpec,d=t.validatedIncludeSpecs,p=t.validatedExcludeSpecs,f=e.getSupportedExtensions(n,a),g=e.getSupportedExtensionsWithJsonIfResolveJsonModule(n,f);if(_)for(var m=0,y=_;m<y.length;m++){var v=y[m],h=e.getNormalizedAbsolutePath(v,r);c.set(s(h),h);}if(d&&d.length>0)for(var b=function(t){if(e.fileExtensionIs(t,".json")){if(!o){var n=d.filter((function(t){return e.endsWith(t,".json")})),a=e.map(e.getRegularExpressionsForWildcards(n,r,"files"),(function(e){return "^".concat(e,"$")}));o=a?a.map((function(t){return e.getRegexFromPattern(t,i.useCaseSensitiveFileNames)})):e.emptyArray;}if(-1!==e.findIndex(o,(function(e){return e.test(t)}))){var _=s(t);c.has(_)||u.has(_)||u.set(_,t);}return "continue"}if(function(t,r,n,i,a){var o=e.forEach(i,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(!o)return !1;for(var s=0,c=o;s<c.length;s++){var l=c[s];if(e.fileExtensionIs(t,l))return !1;var u=a(e.changeExtension(t,l));if(r.has(u)||n.has(u)){if(".d.ts"===l&&(e.fileExtensionIs(t,".js")||e.fileExtensionIs(t,".jsx")))continue;return !0}}return !1}(t,c,l,f,s))return "continue";!function(t,r,n,i){var a=e.forEach(n,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(a)for(var o=a.length-1;o>=0;o--){var s=a[o];if(e.fileExtensionIs(t,s))return;var c=i(e.changeExtension(t,s));r.delete(c);}}(t,l,f,s);var p=s(t);c.has(p)||l.has(p)||l.set(p,t);},x=0,D=i.readDirectory(r,e.flatten(g),p,d,void 0);x<D.length;x++)b(h=D[x]);var S=e.arrayFrom(c.values()),T=e.arrayFrom(l.values());return S.concat(T,e.arrayFrom(u.values()))}function xe(t){var r=e.startsWith(t,"**/")?0:t.indexOf("/**/");return -1!==r&&(e.endsWith(t,"/..")?t.length:t.lastIndexOf("/../"))>r}function De(t,r,n,i,a){var o=e.getRegularExpressionForWildcard(r,e.combinePaths(e.normalizePath(i),a),"exclude"),s=o&&e.getRegexFromPattern(o,n);return !!s&&(!!s.test(t)||!e.hasExtension(t)&&s.test(e.ensureTrailingDirectorySeparator(t)))}function Se(t,r,n,i,a){return t.filter((function(t){if(!e.isString(t))return !1;var i=Te(t,n);return void 0!==i&&r.push(o.apply(void 0,i)),void 0===i}));function o(t,r){var n=e.getTsConfigPropArrayElementValue(i,a,r);return n?e.createDiagnosticForNodeInSourceFile(i,n,t,r):e.createCompilerDiagnostic(t,r)}}function Te(t,r){return r&&ve.test(t)?[e.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:xe(t)?[e.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:void 0}function Ce(t,r,n){var i=t.validatedIncludeSpecs,a=t.validatedExcludeSpecs,o=e.getRegularExpressionForWildcard(a,r,"exclude"),s=o&&new RegExp(o,n?"":"i"),c={};if(void 0!==i){for(var l=[],u=0,_=i;u<_.length;u++){var d=_[u],p=e.normalizePath(e.combinePaths(r,d));if(!s||!s.test(p)){var f=Ee(p,n);if(f){var g=f.key,m=f.flags,y=c[g];(void 0===y||y<m)&&(c[g]=m,1===m&&l.push(g));}}}for(var g in c)if(e.hasProperty(c,g))for(var v=0,h=l;v<h.length;v++){var b=h[v];g!==b&&e.containsPath(b,g,r,!n)&&delete c[g];}}return c}function Ee(t,r){var n=he.exec(t);if(n){var i=t.indexOf("?"),a=t.indexOf("*"),o=t.lastIndexOf(e.directorySeparator);return {key:r?n[0]:e.toFileNameLowerCase(n[0]),flags:-1!==i&&i<o||-1!==a&&a<o?1:0}}if(e.isImplicitGlob(t.substring(t.lastIndexOf(e.directorySeparator)+1)))return {key:e.removeTrailingDirectorySeparator(r?t:e.toFileNameLowerCase(t)),flags:1}}function ke(t,r){switch(r.type){case"object":case"string":return "";case"number":return "number"==typeof t?t:"";case"boolean":return "boolean"==typeof t?t:"";case"list":var n=r.element;return e.isArray(t)?t.map((function(e){return ke(e,n)})):"";default:return e.forEachEntry(r.type,(function(e,r){if(e===t)return r}))}}function Ne(t){switch(t.type){case"number":return 1;case"boolean":return !0;case"string":var r=t.defaultValueDescription;return t.isFilePath?"./".concat(r&&"string"==typeof r?r:""):"";case"list":return [];case"object":return {};default:var n=t.type.keys().next();return n.done?e.Debug.fail("Expected 'option.type' to have entries."):n.value}}e.getFileNamesFromConfigSpecs=be,e.isExcludedFile=function(t,r,n,i,a){var o=r.validatedFilesSpec,s=r.validatedIncludeSpecs,c=r.validatedExcludeSpecs;if(!e.length(s)||!e.length(c))return !1;n=e.normalizePath(n);var l=e.createGetCanonicalFileName(i);if(o)for(var u=0,_=o;u<_.length;u++){var d=_[u];if(l(e.getNormalizedAbsolutePath(d,n))===t)return !1}return De(t,c,i,a,n)},e.matchesExclude=function(t,r,n,i){return De(t,e.filter(r,(function(e){return !xe(e)})),n,i)},e.convertCompilerOptionsForTelemetry=function(t){var r={};for(var n in t)if(e.hasProperty(t,n)){var i=b(n);void 0!==i&&(r[n]=ke(t[n],i));}return r};}(t),function(e){function t(t){t.trace(e.formatMessage.apply(void 0,arguments));}function r(e,t){return !!e.traceResolution&&void 0!==t.trace}function a(t,r){var n;if(r&&t){var i=t.contents.packageJsonContent;"string"==typeof i.name&&"string"==typeof i.version&&(n={name:i.name,subModuleName:r.path.slice(t.packageDirectory.length+e.directorySeparator.length),version:i.version});}return r&&{path:r.path,extension:r.ext,packageId:n}}function o(e){return a(void 0,e)}function s(t){if(t)return e.Debug.assert(void 0===t.packageId),{path:t.path,ext:t.extension}}var c,l;function u(t){if(t)return e.Debug.assert(e.extensionIsTS(t.extension)),{fileName:t.path,packageId:t.packageId}}function _(e,t,r,n,i,a){var o,s;return a?((o=a.failedLookupLocations).push.apply(o,r),(s=a.affectingLocations).push.apply(s,n),a):{resolvedModule:e&&{resolvedFileName:e.path,originalPath:!0===e.originalPath?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId},failedLookupLocations:r,affectingLocations:n,resolutionDiagnostics:i}}function d(r,n,i,a){if(e.hasProperty(r,n)){var o=r[n];if(typeof o===i&&null!==o)return o;a.traceEnabled&&t(a.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,n,i,null===o?"null":typeof o);}else a.traceEnabled&&t(a.host,e.Diagnostics.package_json_does_not_have_a_0_field,n);}function p(r,n,i,a){var o=d(r,n,"string",a);if(void 0!==o){if(o){var s=e.normalizePath(e.combinePaths(i,o));return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_0_field_1_that_references_2,n,o,s),s}a.traceEnabled&&t(a.host,e.Diagnostics.package_json_had_a_falsy_0_field,n);}}function f(e,t,r){return p(e,"typings",t,r)||p(e,"types",t,r)}function g(e,t,r){return p(e,"main",t,r)}function m(r,n){var i=function(r,n){var i=d(r,"typesVersions","object",n);if(void 0!==i)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings),i}(r,n);if(void 0!==i){if(n.traceEnabled)for(var a in i)e.hasProperty(i,a)&&!e.VersionRange.tryParse(a)&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,a);var o=y(i);if(o){var s=o.version,c=o.paths;if("object"==typeof c)return o;n.traceEnabled&&t(n.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,"typesVersions['".concat(s,"']"),"object",typeof c);}else n.traceEnabled&&t(n.host,e.Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,e.versionMajorMinor);}}function y(t){for(var r in l||(l=new e.Version(e.version)),t)if(e.hasProperty(t,r)){var n=e.VersionRange.tryParse(r);if(void 0!==n&&n.test(l))return {version:r,paths:t[r]}}}function v(t,r){return t.typeRoots?t.typeRoots:(t.configFilePath?n=e.getDirectoryPath(t.configFilePath):r.getCurrentDirectory&&(n=r.getCurrentDirectory()),void 0!==n?function(t,r){return r.directoryExists?(e.forEachAncestorDirectory(e.normalizePath(t),(function(t){var i=e.combinePaths(t,b);r.directoryExists(i)&&(n||(n=[])).push(i);})),n):[e.combinePaths(t,b)];var n;}(n,r):void 0);var n;}e.trace=t,e.isTraceEnabled=r,function(e){e[e.TypeScript=0]="TypeScript",e[e.JavaScript=1]="JavaScript",e[e.Json=2]="Json",e[e.TSConfig=3]="TSConfig",e[e.DtsOnly=4]="DtsOnly",e[e.TsOnly=5]="TsOnly";}(c||(c={})),e.getPackageJsonTypesVersionsPaths=y,e.getEffectiveTypeRoots=v;var h,b=e.combinePaths("node_modules","@types");function x(t,r,n){var i="function"==typeof n.useCaseSensitiveFileNames?n.useCaseSensitiveFileNames():n.useCaseSensitiveFileNames;return 0===e.comparePaths(t,r,!i)}function D(t){return e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node16?h.Node16Default:e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext?h.NodeNextDefault:h.None}function S(t){var r=new e.Map,n=new e.Map;return {getOwnMap:function(){return r},redirectsMap:n,getOrCreateMapOfCacheRedirects:function(i){if(!i)return r;var a=i.sourceFile.path,o=n.get(a);return o||(o=!t||e.optionsHaveModuleResolutionChanges(t,i.commandLine.options)?new e.Map:r,n.set(a,o)),o},clear:function(){r.clear(),n.clear();},setOwnOptions:function(e){t=e;},setOwnMap:function(e){r=e;}}}function T(t,r){var n;return {getPackageJsonInfo:function(i){return null==n?void 0:n.get(e.toPath(i,t,r))},setPackageJsonInfo:function(i,a){(n||(n=new e.Map)).set(e.toPath(i,t,r),a);},clear:function(){n=void 0;},entries:function(){var t=null==n?void 0:n.entries();return t?e.arrayFrom(t):[]},getInternalMap:function(){return n}}}function C(e,t,r,n){var i=e.getOrCreateMapOfCacheRedirects(t),a=i.get(r);return a||(a=n(),i.set(r,a)),a}function E(t,r,n){if(t.configFile){if(0===r.redirectsMap.size)e.Debug.assert(!n||0===n.redirectsMap.size),e.Debug.assert(0===r.getOwnMap().size),e.Debug.assert(!n||0===n.getOwnMap().size),r.redirectsMap.set(t.configFile.path,r.getOwnMap()),null==n||n.redirectsMap.set(t.configFile.path,n.getOwnMap());else {e.Debug.assert(!n||n.redirectsMap.size>0);var i={sourceFile:t.configFile,commandLine:{options:t}};r.setOwnMap(r.getOrCreateMapOfCacheRedirects(i)),null==n||n.setOwnMap(n.getOrCreateMapOfCacheRedirects(i));}r.setOwnOptions(t),null==n||n.setOwnOptions(t);}}function k(t,r,n){return {getOrCreateCacheForDirectory:function(i,a){var o=e.toPath(i,t,r);return C(n,a,o,(function(){return N()}))},clear:function(){n.clear();},update:function(e){E(e,n);}}}function N(){var t=new e.Map,r=new e.Map,n={get:function(e,r){return t.get(i(e,r))},set:function(e,r,a){return t.set(i(e,r),a),n},delete:function(e,r){return t.delete(i(e,r)),n},has:function(e,r){return t.has(i(e,r))},forEach:function(e){return t.forEach((function(t,n){var i=r.get(n),a=i[0],o=i[1];return e(t,a,o)}))},size:function(){return t.size}};return n;function i(e,t){var n=void 0===t?e:"".concat(t,"|").concat(e);return r.set(n,[e,t]),n}}function A(r,n,i,a,o){var s=function(r,n,i,a){var o,s=a.compilerOptions,c=s.baseUrl,l=s.paths,u=s.configFile;if(l&&!e.pathIsRelative(n))return a.traceEnabled&&(c&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,c,n),t(a.host,e.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,n)),pe(r,n,e.getPathsBasePath(a.compilerOptions,a.host),l,(null==u?void 0:u.configFileSpecs)?(o=u.configFileSpecs).pathPatterns||(o.pathPatterns=e.tryParsePatterns(l)):void 0,i,!1,a)}(r,n,a,o);return s?s.value:e.isExternalModuleNameRelative(n)?function(r,n,i,a,o){if(o.compilerOptions.rootDirs){o.traceEnabled&&t(o.host,e.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,n);for(var s,c,l=e.normalizePath(e.combinePaths(i,n)),u=0,_=o.compilerOptions.rootDirs;u<_.length;u++){var d=_[u],p=e.normalizePath(d);e.endsWith(p,e.directorySeparator)||(p+=e.directorySeparator);var f=e.startsWith(l,p)&&(void 0===c||c.length<p.length);o.traceEnabled&&t(o.host,e.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2,p,l,f),f&&(c=p,s=d);}if(c){o.traceEnabled&&t(o.host,e.Diagnostics.Longest_matching_prefix_for_0_is_1,l,c);var g=l.substr(c.length);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,c,l);var m=a(r,l,!e.directoryProbablyExists(i,o.host),o);if(m)return m;o.traceEnabled&&t(o.host,e.Diagnostics.Trying_other_entries_in_rootDirs);for(var y=0,v=o.compilerOptions.rootDirs;y<v.length;y++)if((d=v[y])!==s){var h=e.combinePaths(e.normalizePath(d),g);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,d,h);var b=e.getDirectoryPath(h),x=a(r,h,!e.directoryProbablyExists(b,o.host),o);if(x)return x}o.traceEnabled&&t(o.host,e.Diagnostics.Module_resolution_using_rootDirs_has_failed);}}}(r,n,i,a,o):function(r,n,i,a){var o=a.compilerOptions.baseUrl;if(o){a.traceEnabled&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,o,n);var s=e.normalizePath(e.combinePaths(o,n));return a.traceEnabled&&t(a.host,e.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2,n,o,s),i(r,s,!e.directoryProbablyExists(e.getDirectoryPath(s),a.host),a)}}(r,n,a,o)}e.resolveTypeReferenceDirective=function(n,i,a,o,s,l,_){e.Debug.assert("string"==typeof n,"Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");var d=r(a,o);s&&(a=s.commandLine.options);var p=i?e.getDirectoryPath(i):void 0,f=p?l&&l.getOrCreateCacheForDirectory(p,s):void 0,g=f&&f.get(n,_);if(g)return d&&(t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1,n,i),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName),t(o,e.Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,n,p),O(g)),g;var m=v(a,o);d&&(void 0===i?void 0===m?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,n):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,n,m):void 0===m?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,n,i):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,n,i,m),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName));var y=[],b=[],S=D(a);_!==e.ModuleKind.ESNext||e.getEmitModuleResolutionKind(a)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(a)!==e.ModuleResolutionKind.NodeNext||(S|=h.EsmMode);var T,C=S&h.Exports?S&h.EsmMode?["node","import","types"]:["node","require","types"]:[],E=[],k={compilerOptions:a,host:o,traceEnabled:d,failedLookupLocations:y,affectingLocations:b,packageJsonInfoCache:l,features:S,conditions:C,requestContainingDirectory:p,reportDiagnostic:function(e){E.push(e);}},N=function(){if(m&&m.length)return d&&t(o,e.Diagnostics.Resolving_with_primary_search_path_0,m.join(", ")),e.firstDefined(m,(function(r){var i=e.combinePaths(r,n),a=e.getDirectoryPath(i),s=e.directoryProbablyExists(a,o);return !s&&d&&t(o,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,a),u(X(c.DtsOnly,i,!s,k))}));d&&t(o,e.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths);}(),A=!0;if(N||(N=function(){var r=i&&e.getDirectoryPath(i);if(void 0!==r){var a;if(d&&t(o,e.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0,r),e.isExternalModuleNameRelative(n)){var s=R(r,n).path;a=j(c.DtsOnly,s,!1,k,!0);}else {var l=le(c.DtsOnly,n,r,k,void 0,void 0);a=l&&l.value;}return u(a)}d&&t(o,e.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder);}(),A=!1),N){var F=N.fileName,P=N.packageId,w=a.preserveSymlinks?F:B(F,o,d),I=x(F,w,o);T={primary:A,resolvedFileName:I?F:w,originalPath:I?void 0:F,packageId:P,isExternalLibraryImport:J(F)};}return g={resolvedTypeReferenceDirective:T,failedLookupLocations:y,affectingLocations:b,resolutionDiagnostics:E},null==f||f.set(n,_,g),d&&O(g),g;function O(r){var i;(null===(i=r.resolvedTypeReferenceDirective)||void 0===i?void 0:i.resolvedFileName)?r.resolvedTypeReferenceDirective.packageId?t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,n,r.resolvedTypeReferenceDirective.resolvedFileName,e.packageIdToString(r.resolvedTypeReferenceDirective.packageId),r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,n,r.resolvedTypeReferenceDirective.resolvedFileName,r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_not_resolved,n);}},e.resolvePackageNameToPackageJson=function(t,r,n,i,a){var o=Z(null==a?void 0:a.getPackageJsonInfoCache(),i,n);return e.forEachAncestorDirectory(r,(function(r){if("node_modules"!==e.getBaseFileName(r)){var n=e.combinePaths(r,"node_modules");return ee(e.combinePaths(n,t),!1,o)}}))},e.getAutomaticTypeDirectiveNames=function(t,r){if(t.types)return t.types;var n=[];if(r.directoryExists&&r.getDirectories){var i=v(t,r);if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];if(r.directoryExists(s))for(var c=0,l=r.getDirectories(s);c<l.length;c++){var u=l[c],_=e.normalizePath(u),d=e.combinePaths(s,_,"package.json");if(!r.fileExists(d)||null!==e.readJson(d,r).typings){var p=e.getBaseFileName(_);46!==p.charCodeAt(0)&&n.push(p);}}}}return n},e.createCacheWithRedirects=S,e.createModeAwareCache=N,e.zipToModeAwareCache=function(t,r,n){e.Debug.assert(r.length===n.length);for(var i=N(),a=0;a<r.length;++a){var o=r[a],s=e.isString(o)?o:o.fileName.toLowerCase(),c=e.isString(o)?e.getModeForResolutionAtIndex(t,a):o.resolutionMode||t.impliedNodeFormat;i.set(s,c,n[a]);}return i},e.createModuleResolutionCache=function(t,r,n,a,o){var s=k(t,r,a||(a=S(n)));o||(o=S(n));var c=T(t,r);return i$1(i$1(i$1({},c),s),{getOrCreateCacheForModuleName:function(t,r,n){return e.Debug.assert(!e.isExternalModuleNameRelative(t)),C(o,n,void 0===r?t:"".concat(r,"|").concat(t),u)},clear:function(){l(),c.clear();},update:function(e){E(e,a,o);},getPackageJsonInfoCache:function(){return c},clearAllExceptPackageJsonInfoCache:l});function l(){s.clear(),o.clear();}function u(){var n=new e.Map;return {get:function(i){return n.get(e.toPath(i,t,r))},set:function(i,a){var o=e.toPath(i,t,r);if(!n.has(o)){n.set(o,a);for(var s=a.resolvedModule&&(a.resolvedModule.originalPath||a.resolvedModule.resolvedFileName),c=s&&function(n,i){for(var a=e.toPath(e.getDirectoryPath(i),t,r),o=0,s=Math.min(n.length,a.length);o<s&&n.charCodeAt(o)===a.charCodeAt(o);)o++;if(o===n.length&&(a.length===o||a[o]===e.directorySeparator))return n;var c=e.getRootLength(n);if(!(o<c)){var l=n.lastIndexOf(e.directorySeparator,o-1);if(-1!==l)return n.substr(0,Math.max(l,c))}}(o,s),l=o;l!==c;){var u=e.getDirectoryPath(l);if(u===l||n.has(u))break;n.set(u,a),l=u;}}}}}},e.createTypeReferenceDirectiveResolutionCache=function(e,t,r,n,a){var o=k(e,t,a||(a=S(r)));return n||(n=T(e,t)),i$1(i$1(i$1({},n),o),{clear:function(){s(),n.clear();},clearAllExceptPackageJsonInfoCache:s});function s(){o.clear();}},e.resolveModuleNameFromCache=function(t,r,n,i){var a=e.getDirectoryPath(r),o=n&&n.getOrCreateCacheForDirectory(a);if(o)return o.get(t,i)},e.resolveModuleName=function(n,i,a,o,s,c,l){var u=r(a,o);c&&(a=c.commandLine.options),u&&(t(o,e.Diagnostics.Resolving_module_0_from_1,n,i),c&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,c.sourceFile.fileName));var _=e.getDirectoryPath(i),d=s&&s.getOrCreateCacheForDirectory(_,c),p=d&&d.get(n,l);if(p)u&&t(o,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,_);else {var f=a.moduleResolution;if(void 0===f){switch(e.getEmitModuleKind(a)){case e.ModuleKind.CommonJS:f=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node16:f=e.ModuleResolutionKind.Node16;break;case e.ModuleKind.NodeNext:f=e.ModuleResolutionKind.NodeNext;break;default:f=e.ModuleResolutionKind.Classic;}u&&t(o,e.Diagnostics.Module_resolution_kind_is_not_specified_using_0,e.ModuleResolutionKind[f]);}else u&&t(o,e.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0,e.ModuleResolutionKind[f]);switch(e.perfLogger.logStartResolveModule(n),f){case e.ModuleResolutionKind.Node16:p=function(e,t,r,n,i,a,o){return O(h.Node16Default,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeNext:p=function(e,t,r,n,i,a,o){return O(h.NodeNextDefault,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeJs:p=M(n,i,a,o,s,c);break;case e.ModuleResolutionKind.Classic:p=ve(n,i,a,o,s,c);break;default:return e.Debug.fail("Unexpected moduleResolution: ".concat(f))}p&&p.resolvedModule&&e.perfLogger.logInfoEvent('Module "'.concat(n,'" resolved to "').concat(p.resolvedModule.resolvedFileName,'"')),e.perfLogger.logStopResolveModule(p&&p.resolvedModule?""+p.resolvedModule.resolvedFileName:"null"),d&&(d.set(n,l,p),e.isExternalModuleNameRelative(n)||s.getOrCreateCacheForModuleName(n,l,c).set(_,p));}return u&&(p.resolvedModule?p.resolvedModule.packageId?t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,n,p.resolvedModule.resolvedFileName,e.packageIdToString(p.resolvedModule.packageId)):t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1,n,p.resolvedModule.resolvedFileName):t(o,e.Diagnostics.Module_name_0_was_not_resolved,n)),p},e.resolveJSModule=function(t,r,n){var i=function(t,r,n){return L(h.None,t,r,{moduleResolution:e.ModuleResolutionKind.NodeJs,allowJs:!0},n,void 0,F,void 0)}(t,r,n),a=i.resolvedModule,o=i.failedLookupLocations;if(!a)throw new Error("Could not resolve JS module '".concat(t,"' starting at '").concat(r,"'. Looked in: ").concat(o.join(", ")));return a.resolvedFileName},function(e){e[e.None=0]="None",e[e.Imports=2]="Imports",e[e.SelfName=4]="SelfName",e[e.Exports=8]="Exports",e[e.ExportsPatternTrailers=16]="ExportsPatternTrailers",e[e.AllFeatures=30]="AllFeatures",e[e.Node16Default=30]="Node16Default",e[e.NodeNextDefault=30]="NodeNextDefault",e[e.EsmMode=32]="EsmMode";}(h||(h={}));var F=[c.JavaScript],P=[c.TypeScript,c.JavaScript],w=n$4(n$4([],P,!0),[c.Json],!1),I=[c.TSConfig];function O(t,r,i,a,o,s,l,u){var _=e.getDirectoryPath(i),d=u===e.ModuleKind.ESNext?h.EsmMode:0,p=a.noDtsResolution?[c.TsOnly,c.JavaScript]:P;return a.resolveJsonModule&&(p=n$4(n$4([],p,!0),[c.Json],!1)),L(t|d,r,_,a,o,s,p,l)}function M(t,r,n,i,a,o,s){var l;return s?l=I:n.noDtsResolution?(l=[c.TsOnly],n.allowJs&&l.push(c.JavaScript),n.resolveJsonModule&&l.push(c.Json)):l=n.resolveJsonModule?w:P,L(h.None,t,e.getDirectoryPath(r),n,i,a,l,o)}function L(n,a,o,s,l,u,d,p){var f,g,m=r(s,l),y=[],v=[],b=n&h.EsmMode?["node","import","types"]:["node","require","types"];s.noDtsResolution&&b.pop();var D=[],S={compilerOptions:s,host:l,traceEnabled:m,failedLookupLocations:y,affectingLocations:v,packageJsonInfoCache:u,features:n,conditions:b,requestContainingDirectory:o,reportDiagnostic:function(e){D.push(e);}};m&&e.getEmitModuleResolutionKind(s)>=e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(s)<=e.ModuleResolutionKind.NodeNext&&t(l,e.Diagnostics.Resolving_in_0_mode_with_conditions_1,n&h.EsmMode?"ESM":"CJS",b.map((function(e){return "'".concat(e,"'")})).join(", "));var T=e.forEach(d,(function(r){return function(r){var _,d=A(r,a,o,(function(e,t,r,n){return j(e,t,r,n,!0)}),S);if(d)return he({resolved:d,isExternalLibraryImport:J(d.path)});if(e.isExternalModuleNameRelative(a)){var f=R(o,a),g=f.path,y=f.parts,v=j(r,g,!1,S,!0);return v&&he({resolved:v,isExternalLibraryImport:e.contains(y,"node_modules")})}if(n&h.Imports&&e.startsWith(a,"#")&&(_=function(r,n,i,a,o,s){var c,l;if("#"===n||e.startsWith(n,"#/"))return a.traceEnabled&&t(a.host,e.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions,n),he(void 0);var u=e.getNormalizedAbsolutePath(e.combinePaths(i,"dummy"),null===(l=(c=a.host).getCurrentDirectory)||void 0===l?void 0:l.call(c)),_=$(u,a);if(!_)return a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,u),he(void 0);if(!_.contents.packageJsonContent.imports)return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_scope_0_has_no_imports_defined,_.packageDirectory),he(void 0);var d=oe(r,a,o,s,n,_.contents.packageJsonContent.imports,_,!0);return d||(a.traceEnabled&&t(a.host,e.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,_.packageDirectory),he(void 0))}(r,a,o,S,u,p)),!_&&n&h.SelfName&&(_=function(t,r,n,i,a,o){var s,c,l=$(e.getNormalizedAbsolutePath(e.combinePaths(n,"dummy"),null===(c=(s=i.host).getCurrentDirectory)||void 0===c?void 0:c.call(s)),i);if(l&&l.contents.packageJsonContent.exports&&"string"==typeof l.contents.packageJsonContent.name){var u=e.getPathComponents(r),_=e.getPathComponents(l.contents.packageJsonContent.name);if(e.every(_,(function(e,t){return u[t]===e}))){var d=u.slice(_.length);return ie(l,t,e.length(d)?".".concat(e.directorySeparator).concat(d.join(e.directorySeparator)):".",i,a,o)}}}(r,a,o,S,u,p)),_||(m&&t(l,e.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1,a,c[r]),_=le(r,a,o,S,u,p)),_){var b=_.value;if(!s.preserveSymlinks&&b&&!b.originalPath){var D=B(b.path,l,m),T=x(D,b.path,l),C=T?void 0:b.path;b=i$1(i$1({},b),{path:T?b.path:D,originalPath:C});}return {value:b&&{resolved:b,isExternalLibraryImport:!0}}}}(r)}));return _(null===(f=null==T?void 0:T.value)||void 0===f?void 0:f.resolved,null===(g=null==T?void 0:T.value)||void 0===g?void 0:g.isExternalLibraryImport,y,v,D,S.resultFromCache)}function R(t,r){var n=e.combinePaths(t,r),i=e.getPathComponents(n),a=e.lastOrUndefined(i);return {path:"."===a||".."===a?e.ensureTrailingDirectorySeparator(e.normalizePath(n)):e.normalizePath(n),parts:i}}function B(r,n,i){if(!n.realpath)return r;var a=e.normalizePath(n.realpath(r));return i&&t(n,e.Diagnostics.Resolving_real_path_for_0_result_1,r,a),e.Debug.assert(n.fileExists(a),"".concat(r," linked to nonexistent file ").concat(a)),a}function j(r,n,i,o,s){if(o.traceEnabled&&t(o.host,e.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1,n,c[r]),!e.hasTrailingDirectorySeparator(n)){if(!i){var l=e.getDirectoryPath(n);e.directoryProbablyExists(l,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,l),i=!0);}var u=V(r,n,i,o);if(u){var _=s?z(u.path):void 0;return a(_?ee(_,!1,o):void 0,u)}}if(i||e.directoryProbablyExists(n,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,n),i=!0),!(o.features&h.EsmMode))return X(r,n,i,o,s)}function J(t){return e.stringContains(t,e.nodeModulesPathPart)}function z(t){var r=e.normalizePath(t),n=r.lastIndexOf(e.nodeModulesPathPart);if(-1!==n){var i=n+e.nodeModulesPathPart.length,a=U(r,i);return 64===r.charCodeAt(i)&&(a=U(r,a)),r.slice(0,a)}}function U(t,r){var n=t.indexOf(e.directorySeparator,r+1);return -1===n?r:n}function K(e,t,r,n){return o(V(e,t,r,n))}function V(t,r,n,i){if(t===c.Json||t===c.TSConfig){var a=e.tryRemoveExtension(r,".json"),o=a?r.substring(a.length):"";return void 0===a&&t===c.Json?void 0:H(a||r,t,o,n,i)}if(!(i.features&h.EsmMode)){var s=H(r,t,"",n,i);if(s)return s}return q(t,r,n,i)}function q(r,n,i,a){if(e.hasJSFileExtension(n)||e.fileExtensionIs(n,".json")&&a.compilerOptions.resolveJsonModule){var o=e.removeFileExtension(n),s=n.substring(o.length);return a.traceEnabled&&t(a.host,e.Diagnostics.File_name_0_has_a_1_extension_stripping_it,n,s),H(o,r,s,i,a)}}function W(t,r,n,i){return t!==c.TypeScript&&t!==c.DtsOnly||!e.fileExtensionIsOneOf(r,e.supportedTSExtensionsFlat)?q(t,r,n,i):void 0!==G(r,n,i)?{path:r,ext:e.tryExtractTSExtension(r)}:void 0}function H(t,r,n,i,a){if(!i){var o=e.getDirectoryPath(t);o&&(i=!e.directoryProbablyExists(o,a.host));}switch(r){case c.DtsOnly:switch(n){case".mjs":case".mts":case".d.mts":return l(".d.mts");case".cjs":case".cts":case".d.cts":return l(".d.cts");case".json":return t+=".json",l(".d.ts");default:return l(".d.ts")}case c.TypeScript:case c.TsOnly:var s=r===c.TypeScript;switch(n){case".mjs":case".mts":case".d.mts":return l(".mts")||(s?l(".d.mts"):void 0);case".cjs":case".cts":case".d.cts":return l(".cts")||(s?l(".d.cts"):void 0);case".json":return t+=".json",s?l(".d.ts"):void 0;default:return l(".ts")||l(".tsx")||(s?l(".d.ts"):void 0)}case c.JavaScript:switch(n){case".mjs":case".mts":case".d.mts":return l(".mjs");case".cjs":case".cts":case".d.cts":return l(".cjs");case".json":return l(".json");default:return l(".js")||l(".jsx")}case c.TSConfig:case c.Json:return l(".json")}function l(e){var r=G(t+e,i,a);return void 0===r?void 0:{path:r,ext:e}}}function G(t,r,n){var i,a;if(!(null===(i=n.compilerOptions.moduleSuffixes)||void 0===i?void 0:i.length))return Q(t,r,n);var o=null!==(a=e.tryGetExtensionFromPath(t))&&void 0!==a?a:"",s=o?e.removeExtension(t,o):t;return e.forEach(n.compilerOptions.moduleSuffixes,(function(e){return Q(s+e+o,r,n)}))}function Q(r,n,i){if(!n){if(i.host.fileExists(r))return i.traceEnabled&&t(i.host,e.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result,r),r;i.traceEnabled&&t(i.host,e.Diagnostics.File_0_does_not_exist,r);}i.failedLookupLocations.push(r);}function X(e,t,r,n,i){void 0===i&&(i=!0);var o=i?ee(t,r,n):void 0;return a(o,te(e,t,r,n,o&&o.contents.packageJsonContent,o&&o.contents.versionPaths))}function Y(t,r,n,i){var a;if(e.isArray(r))for(var o=0,s=r;o<s.length;o++)l(s[o]);else if("object"==typeof r&&null!==r&&ne(r))for(var c in r)l(r[c]);else l(r);return a;function l(r){var o,s;if("string"==typeof r&&e.startsWith(r,"./")&&-1===r.indexOf("*")){var c=e.getPathComponents(r).slice(2);if(c.indexOf("..")>=0||c.indexOf(".")>=0||c.indexOf("node_modules")>=0)return !1;var u=e.combinePaths(t.packageDirectory,r),_=e.getNormalizedAbsolutePath(u,null===(s=(o=n.host).getCurrentDirectory)||void 0===s?void 0:s.call(o)),d=W(i,_,!1,n);if(d)return a=e.appendIfUnique(a,d,(function(e,t){return e.path===t.path})),!0}else if(Array.isArray(r)){for(var p=0,f=r;p<f.length;p++)if(l(f[p]))return !0}else if("object"==typeof r&&null!==r)return e.forEach(e.getOwnKeys(r),(function(t){if("default"===t||e.contains(n.conditions,t)||ce(n.conditions,t))return l(r[t]),!0}))}}function Z(t,n,i){return {host:n,compilerOptions:i,traceEnabled:r(i,n),failedLookupLocations:e.noopPush,affectingLocations:e.noopPush,packageJsonInfoCache:t,features:h.None,conditions:e.emptyArray,requestContainingDirectory:void 0,reportDiagnostic:e.noop}}function $(t,r){var n=e.getPathComponents(t);for(n.pop();n.length>0;){var i=ee(e.getPathFromPathComponents(n),!1,r);if(i)return i;n.pop();}}function ee(r,n,i){var a,o,s,c=i.host,l=i.traceEnabled,u=e.combinePaths(r,"package.json");if(n)i.failedLookupLocations.push(u);else {var _=null===(a=i.packageJsonInfoCache)||void 0===a?void 0:a.getPackageJsonInfo(u);if(void 0!==_)return "boolean"!=typeof _?(l&&t(c,e.Diagnostics.File_0_exists_according_to_earlier_cached_lookups,u),i.affectingLocations.push(u),_.packageDirectory===r?_:{packageDirectory:r,contents:_.contents}):(_&&l&&t(c,e.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void i.failedLookupLocations.push(u));var d=e.directoryProbablyExists(r,c);if(d&&c.fileExists(u)){var p=e.readJson(u,c);l&&t(c,e.Diagnostics.Found_package_json_at_0,u);var f={packageDirectory:r,contents:{packageJsonContent:p,versionPaths:m(p,i),resolvedEntrypoints:void 0}};return null===(o=i.packageJsonInfoCache)||void 0===o||o.setPackageJsonInfo(u,f),i.affectingLocations.push(u),f}d&&l&&t(c,e.Diagnostics.File_0_does_not_exist,u),null===(s=i.packageJsonInfoCache)||void 0===s||s.setPackageJsonInfo(u,d),i.failedLookupLocations.push(u);}}function te(r,n,i,a,l,u){var _;if(l)switch(r){case c.JavaScript:case c.Json:case c.TsOnly:_=g(l,n,a);break;case c.TypeScript:_=f(l,n,a)||g(l,n,a);break;case c.DtsOnly:_=f(l,n,a);break;case c.TSConfig:_=function(e,t,r){return p(e,"tsconfig",t,r)}(l,n,a);break;default:return e.Debug.assertNever(r)}var d=function(r,n,i,a){var s=G(n,i,a);if(s){var u=function(t,r){var n=e.tryGetExtensionFromPath(r);return void 0!==n&&function(e,t){switch(e){case c.JavaScript:return ".js"===t||".jsx"===t||".mjs"===t||".cjs"===t;case c.TSConfig:case c.Json:return ".json"===t;case c.TypeScript:return ".ts"===t||".tsx"===t||".mts"===t||".cts"===t||".d.ts"===t||".d.mts"===t||".d.cts"===t;case c.TsOnly:return ".ts"===t||".tsx"===t||".mts"===t||".cts"===t;case c.DtsOnly:return ".d.ts"===t||".d.mts"===t||".d.cts"===t}}(t,n)?{path:r,ext:n}:void 0}(r,s);if(u)return o(u);a.traceEnabled&&t(a.host,e.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it,s);}var _=r===c.DtsOnly?c.TypeScript:r,d=a.features;"module"!==(null==l?void 0:l.type)&&(a.features&=~h.EsmMode);var p=j(_,n,i,a,!1);return a.features=d,p},m=_?!e.directoryProbablyExists(e.getDirectoryPath(_),a.host):void 0,y=i||!e.directoryProbablyExists(n,a.host),v=e.combinePaths(n,r===c.TSConfig?"tsconfig":"index");if(u&&(!_||e.containsPath(n,_))){var b=e.getRelativePathFromDirectory(n,_||v,!1);a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,u.version,e.version,b);var x=pe(r,b,n,u.paths,void 0,d,m||y,a);if(x)return s(x.value)}return _&&s(d(r,_,m,a))||(a.features&h.EsmMode?void 0:V(r,v,y,a))}function re(t){var r=t.indexOf(e.directorySeparator);return "@"===t[0]&&(r=t.indexOf(e.directorySeparator,r+1)),-1===r?{packageName:t,rest:""}:{packageName:t.slice(0,r),rest:t.slice(r+1)}}function ne(t){return e.every(e.getOwnKeys(t),(function(t){return e.startsWith(t,".")}))}function ie(r,n,i,a,o,s){if(r.contents.packageJsonContent.exports){if("."===i){var c=void 0;if("string"==typeof r.contents.packageJsonContent.exports||Array.isArray(r.contents.packageJsonContent.exports)||"object"==typeof r.contents.packageJsonContent.exports&&(u=r.contents.packageJsonContent.exports,!e.some(e.getOwnKeys(u),(function(t){return e.startsWith(t,".")})))?c=r.contents.packageJsonContent.exports:e.hasProperty(r.contents.packageJsonContent.exports,".")&&(c=r.contents.packageJsonContent.exports["."]),c)return se(n,a,o,s,i,r,!1)(c,"",!1,".")}else if(ne(r.contents.packageJsonContent.exports)){if("object"!=typeof r.contents.packageJsonContent.exports)return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0);var l=oe(n,a,o,s,i,r.contents.packageJsonContent.exports,r,!1);if(l)return l}var u;return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0)}}function ae(e,t){var r=e.indexOf("*"),n=t.indexOf("*"),i=-1===r?e.length:r+1,a=-1===n?t.length:n+1;return i>a?-1:a>i||-1===r?1:-1===n||e.length>t.length?-1:t.length>e.length?1:0}function oe(t,r,n,i,a,o,s,c){var l=se(t,r,n,i,a,s,c);if(!e.endsWith(a,e.directorySeparator)&&-1===a.indexOf("*")&&e.hasProperty(o,a))return l(p=o[a],"",!1,a);for(var u=0,_=e.sort(e.filter(e.getOwnKeys(o),(function(t){return -1!==t.indexOf("*")||e.endsWith(t,"/")})),ae);u<_.length;u++){var d=_[u];if(r.features&h.ExportsPatternTrailers&&g(d,a)){var p=o[d],f=d.indexOf("*");return l(p,a.substring(d.substring(0,f).length,a.length-(d.length-1-f)),!0,d)}if(e.endsWith(d,"*")&&e.startsWith(a,d.substring(0,d.length-1)))return l(p=o[d],a.substring(d.length-1),!0,d);if(e.startsWith(a,d))return l(p=o[d],a.substring(d.length),!1,d)}function g(t,r){if(e.endsWith(t,"*"))return !1;var n=t.indexOf("*");return -1!==n&&e.startsWith(r,t.substring(0,n))&&e.endsWith(r,t.substring(n+1))}}function se(r,n,i,o,s,l,u){return function _(d,p,f,g){if("string"==typeof d){if(!f&&p.length>0&&!e.endsWith(d,"/"))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);if(!e.startsWith(d,"./")){if(u&&!e.startsWith(d,"../")&&!e.startsWith(d,"/")&&!e.isRootedDiskPath(d)){var m=f?d.replace(/\*/g,p):d+p;return be(n,e.Diagnostics.Using_0_subpath_1_with_target_2,"imports",g,m),be(n,e.Diagnostics.Resolving_module_0_from_1,m,l.packageDirectory+"/"),he((k=L(n.features,m,l.packageDirectory+"/",n.compilerOptions,n.host,i,[r],o)).resolvedModule?{path:k.resolvedModule.resolvedFileName,extension:k.resolvedModule.extension,packageId:k.resolvedModule.packageId,originalPath:k.resolvedModule.originalPath}:void 0)}return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0)}var y=(e.pathIsRelative(d)?e.getPathComponents(d).slice(1):e.getPathComponents(d)).slice(1);if(y.indexOf("..")>=0||y.indexOf(".")>=0||y.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);var v=e.combinePaths(l.packageDirectory,d),h=e.getPathComponents(p);if(h.indexOf("..")>=0||h.indexOf(".")>=0||h.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);n.traceEnabled&&t(n.host,e.Diagnostics.Using_0_subpath_1_with_target_2,u?"imports":"exports",g,f?d.replace(/\*/g,p):d+p);var b=N(f?v.replace(/\*/g,p):v+p),x=function(t,i,o,s){var u,_,d,p;if((r===c.TypeScript||r===c.JavaScript||r===c.Json)&&(n.compilerOptions.declarationDir||n.compilerOptions.outDir)&&-1===t.indexOf("/node_modules/")&&(!n.compilerOptions.configFile||e.containsPath(l.packageDirectory,N(n.compilerOptions.configFile.fileName),!F()))){var f=e.hostGetCanonicalFileName({useCaseSensitiveFileNames:F}),g=[];if(n.compilerOptions.rootDir||n.compilerOptions.composite&&n.compilerOptions.configFilePath){var m=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return []}),(null===(_=(u=n.host).getCurrentDirectory)||void 0===_?void 0:_.call(u))||"",f));g.push(m);}else if(n.requestContainingDirectory){var y=N(e.combinePaths(n.requestContainingDirectory,"index.ts"));m=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return [y,N(o)]}),(null===(p=(d=n.host).getCurrentDirectory)||void 0===p?void 0:p.call(d))||"",f)),g.push(m);for(var v=e.ensureTrailingDirectorySeparator(m);v&&v.length>1;){var h=e.getPathComponents(v);h.pop();var b=e.getPathFromPathComponents(h);g.unshift(b),v=e.ensureTrailingDirectorySeparator(b);}}g.length>1&&n.reportDiagnostic(e.createCompilerDiagnostic(s?e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,""===i?".":i,o));for(var x=0,D=g;x<D.length;x++)for(var S=D[x],T=0,C=j(S);T<C.length;T++){var E=C[T];if(e.containsPath(E,t,!F()))for(var k=t.slice(E.length+1),P=e.combinePaths(S,k),w=0,I=[".mjs",".cjs",".js",".json",".d.mts",".d.cts",".d.ts"];w<I.length;w++){var O=I[w];if(e.fileExtensionIs(P,O))for(var M=0,L=e.getPossibleOriginalInputExtensionForExtension(P);M<L.length;M++){var R=L[M],B=e.changeAnyExtension(P,R,O,!F());if(!(r===c.TypeScript&&e.hasJSFileExtension(B)||r===c.JavaScript&&e.hasTSFileExtension(B))&&n.host.fileExists(B))return he(a(l,W(r,B,!1,n)))}}}}return;function j(e){var t,r,i=n.compilerOptions.configFile?(null===(r=(t=n.host).getCurrentDirectory)||void 0===r?void 0:r.call(t))||"":e,a=[];return n.compilerOptions.declarationDir&&a.push(N(A(i,n.compilerOptions.declarationDir))),n.compilerOptions.outDir&&n.compilerOptions.outDir!==n.compilerOptions.declarationDir&&a.push(N(A(i,n.compilerOptions.outDir))),a}}(b,p,e.combinePaths(l.packageDirectory,"package.json"),u);return x||he(a(l,W(r,b,!1,n)))}if("object"==typeof d&&null!==d){if(!Array.isArray(d)){for(var D=0,S=e.getOwnKeys(d);D<S.length;D++){var T=S[D];if("default"===T||n.conditions.indexOf(T)>=0||ce(n.conditions,T)){if(be(n,e.Diagnostics.Matched_0_condition_1,u?"imports":"exports",T),k=_(d[T],p,f,g))return k}else be(n,e.Diagnostics.Saw_non_matching_condition_0,T);}return}if(!e.length(d))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);for(var C=0,E=d;C<E.length;C++){var k;if(k=_(E[C],p,f,g))return k}}else if(null===d)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null,l.packageDirectory,s),he(void 0);return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);function N(t){var r,i;return void 0===t?t:e.getNormalizedAbsolutePath(t,null===(i=(r=n.host).getCurrentDirectory)||void 0===i?void 0:i.call(r))}function A(t,r){return e.ensureTrailingDirectorySeparator(e.combinePaths(t,r))}function F(){return !n.host.useCaseSensitiveFileNames||("boolean"==typeof n.host.useCaseSensitiveFileNames?n.host.useCaseSensitiveFileNames:n.host.useCaseSensitiveFileNames())}}}function ce(t,r){if(-1===t.indexOf("types"))return !1;if(!e.startsWith(r,"types@"))return !1;var n=e.VersionRange.tryParse(r.substring("types@".length));return !!n&&n.test(e.version)}function le(e,t,r,n,i,a){return ue(e,t,r,n,!1,i,a)}function ue(t,r,n,i,a,o,s){var c=o&&o.getOrCreateCacheForModuleName(r,0===i.features?void 0:i.features&h.EsmMode?e.ModuleKind.ESNext:e.ModuleKind.CommonJS,s);return e.forEachAncestorDirectory(e.normalizeSlashes(n),(function(n){if("node_modules"!==e.getBaseFileName(n))return ye(c,r,n,i)||he(_e(t,r,n,i,a,o,s))}))}function _e(r,n,i,a,o,s,l){var u=e.combinePaths(i,"node_modules"),_=e.directoryProbablyExists(u,a.host);!_&&a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,u);var d=o?void 0:de(r,n,u,_,a,s,l);if(d)return d;if(r===c.TypeScript||r===c.DtsOnly){var p=e.combinePaths(u,"@types"),f=_;return _&&!e.directoryProbablyExists(p,a.host)&&(a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,p),f=!1),de(c.DtsOnly,function(r,n){var i=ge(r);return n.traceEnabled&&i!==r&&t(n.host,e.Diagnostics.Scoped_package_detected_looking_in_0,i),i}(n,a),p,f,a,s,l)}}function de(r,n,i,s,c,l,u){var _,d=e.normalizePath(e.combinePaths(i,n)),p=ee(d,!s,c);if(!(c.features&h.Exports)&&p){var f=V(r,d,!s,c);if(f)return o(f);var g=te(r,d,!s,c,p.contents.packageJsonContent,p.contents.versionPaths);return a(p,g)}var m=function(t,r,n,i){var o=V(t,r,n,i)||te(t,r,n,i,p&&p.contents.packageJsonContent,p&&p.contents.versionPaths);return !o&&p&&(void 0===p.contents.packageJsonContent.exports||null===p.contents.packageJsonContent.exports)&&i.features&h.EsmMode&&(o=V(t,e.combinePaths(r,"index.js"),n,i)),a(p,o)},y=re(n),v=y.packageName,b=y.rest,x=e.combinePaths(i,v);if(""!==b&&(p=ee(x,!s,c)),p&&p.contents.packageJsonContent.exports&&c.features&h.Exports)return null===(_=ie(p,r,e.combinePaths(".",b),c,l,u))||void 0===_?void 0:_.value;if(""!==b&&p&&p.contents.versionPaths){c.traceEnabled&&t(c.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,p.contents.versionPaths.version,e.version,b);var D=s&&e.directoryProbablyExists(x,c.host),S=pe(r,b,x,p.contents.versionPaths.paths,void 0,m,!D,c);if(S)return S.value}return m(r,d,!s,c)}function pe(r,n,i,a,s,c,l,u){s||(s=e.tryParsePatterns(a));var _=e.matchPatternOrExact(s,n);if(_){var d=e.isString(_)?void 0:e.matchedText(_,n),p=e.isString(_)?_:e.patternText(_);return u.traceEnabled&&t(u.host,e.Diagnostics.Module_name_0_matched_pattern_1,n,p),{value:e.forEach(a[p],(function(n){var a=d?n.replace("*",d):n,s=e.normalizePath(e.combinePaths(i,a));u.traceEnabled&&t(u.host,e.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1,n,a);var _=e.tryGetExtensionFromPath(n);if(void 0!==_){var p=G(s,l,u);if(void 0!==p)return o({path:p,ext:_})}return c(r,s,l||!e.directoryProbablyExists(e.getDirectoryPath(s),u.host),u)}))}}}e.nodeModuleNameResolver=M,e.nodeModulesPathPart="/node_modules/",e.pathContainsNodeModules=J,e.parseNodeModuleFromPath=z,e.getEntrypointsFromPackageJsonInfo=function(t,r,n,a,o){if(!o&&void 0!==t.contents.resolvedEntrypoints)return t.contents.resolvedEntrypoints;var s,l=o?c.JavaScript:c.TypeScript,u=D(r),_=Z(null==a?void 0:a.getPackageJsonInfoCache(),n,r);_.conditions=["node","require","types"],_.requestContainingDirectory=t.packageDirectory;var d=te(l,t.packageDirectory,!1,_,t.contents.packageJsonContent,t.contents.versionPaths);if(s=e.append(s,null==d?void 0:d.path),u&h.Exports&&t.contents.packageJsonContent.exports)for(var p=0,f=[["node","import","types"],["node","require","types"]];p<f.length;p++){var g=f[p],m=i$1(i$1({},_),{failedLookupLocations:[],conditions:g}),y=Y(t,t.contents.packageJsonContent.exports,m,l);if(y)for(var v=0,b=y;v<b.length;v++){var x=b[v];s=e.appendIfUnique(s,x.path);}}return t.contents.resolvedEntrypoints=s||!1},e.getTemporaryModuleResolutionState=Z,e.getPackageScopeForPath=$,e.getPackageJsonInfo=ee,e.parsePackageName=re,e.allKeysStartWithDot=ne,e.comparePatternKeys=ae,e.isApplicableVersionedTypesKey=ce;var fe="__";function ge(t){if(e.startsWith(t,"@")){var r=t.replace(e.directorySeparator,fe);if(r!==t)return r.slice(1)}return t}function me(t){return e.stringContains(t,fe)?"@"+t.replace(fe,e.directorySeparator):t}function ye(r,n,i,a){var o=r&&r.get(i);if(o)return a.traceEnabled&&t(a.host,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,i),a.resultFromCache=o,{value:o.resolvedModule&&{path:o.resolvedModule.resolvedFileName,originalPath:o.resolvedModule.originalPath||!0,extension:o.resolvedModule.extension,packageId:o.resolvedModule.packageId}}}function ve(t,n,i,a,o,s){var l=r(i,a),u=[],d=[],p=e.getDirectoryPath(n),f=[],g={compilerOptions:i,host:a,traceEnabled:l,failedLookupLocations:u,affectingLocations:d,packageJsonInfoCache:o,features:h.None,conditions:[],requestContainingDirectory:p,reportDiagnostic:function(e){f.push(e);}},m=y(c.TypeScript)||y(c.JavaScript);return _(m&&m.value,!1,u,d,f,g.resultFromCache);function y(r){var n=A(r,t,p,K,g);if(n)return {value:n};if(e.isExternalModuleNameRelative(t)){var i=e.normalizePath(e.combinePaths(p,t));return he(K(r,i,!1,g))}var a=o&&o.getOrCreateCacheForModuleName(t,void 0,s);return e.forEachAncestorDirectory(p,(function(n){var i=ye(a,t,n,g);if(i)return i;var o=e.normalizePath(e.combinePaths(n,t));return he(K(r,o,!1,g))}))||(r===c.TypeScript?function(e,t,r){return ue(c.DtsOnly,e,t,r,!0,void 0,void 0)}(t,p,g):void 0)}}function he(e){return void 0!==e?{value:e}:void 0}function be(e,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];e.traceEnabled&&t.apply(void 0,n$4([e.host,r],i,!1));}e.getTypesPackageName=function(e){return "@types/".concat(ge(e))},e.mangleScopedPackageName=ge,e.getPackageNameFromTypesPackageName=function(t){var r=e.removePrefix(t,"@types/");return r!==t?me(r):t},e.unmangleScopedPackageName=me,e.classicNameResolver=ve,e.loadModuleFromGlobalCache=function(n,i,a,o,s,l){var u=r(a,o);u&&t(o,e.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,i,n,s);var d=[],p=[],f=[],g={compilerOptions:a,host:o,traceEnabled:u,failedLookupLocations:d,affectingLocations:p,packageJsonInfoCache:l,features:h.None,conditions:[],requestContainingDirectory:void 0,reportDiagnostic:function(e){f.push(e);}};return _(_e(c.DtsOnly,n,s,g,!1,void 0,void 0),!0,d,p,f,g.resultFromCache)};}(t),function(e){var t,r;function a(t,r){return t.body&&!t.body.parent&&(e.setParent(t.body,t),e.setParentRecursive(t.body,!1)),t.body?o(t.body,r):1}function o(t,r){void 0===r&&(r=new e.Map);var n=e.getNodeId(t);if(r.has(n))return r.get(n)||0;r.set(n,void 0);var i=function(t,r){switch(t.kind){case 261:case 262:return 0;case 263:if(e.isEnumConst(t))return 2;break;case 269:case 268:if(!e.hasSyntacticModifier(t,1))return 0;break;case 275:var n=t;if(!n.moduleSpecifier&&n.exportClause&&276===n.exportClause.kind){for(var i=0,c=0,l=n.exportClause.elements;c<l.length;c++){var u=s(l[c],r);if(u>i&&(i=u),1===i)return i}return i}break;case 265:var _=0;return e.forEachChild(t,(function(t){var n=o(t,r);switch(n){case 0:return;case 2:return void(_=2);case 1:return _=1,!0;default:e.Debug.assertNever(n);}})),_;case 264:return a(t,r);case 79:if(t.isInJSDocNamespace)return 0}return 1}(t,r);return r.set(n,i),i}function s(t,r){for(var n=t.propertyName||t.name,i=t.parent;i;){if(e.isBlock(i)||e.isModuleBlock(i)||e.isSourceFile(i)){for(var a=void 0,s=0,c=i.statements;s<c.length;s++){var l=c[s];if(e.nodeHasName(l,n)){l.parent||(e.setParent(l,i),e.setParentRecursive(l,!1));var u=o(l,r);if((void 0===a||u>a)&&(a=u),1===a)return a}}if(void 0!==a)return a}i=i.parent;}return 1}function c(t){return e.Debug.attachFlowNodeDebugInfo(t),t}(r=e.ModuleInstanceState||(e.ModuleInstanceState={}))[r.NonInstantiated=0]="NonInstantiated",r[r.Instantiated=1]="Instantiated",r[r.ConstEnumOnly=2]="ConstEnumOnly",e.getModuleInstanceState=a,function(e){e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor";}(t||(t={}));var l=function(){var t,r,o,s,l,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,A,F,P,w=!1,I=0,O={flags:1},M={flags:1},L=function(){return e.createBinaryExpressionTrampoline((function(t,r){if(r){r.stackIndex++,e.setParent(t,s);var n=A;je(t);var i=s;s=t,r.skip=!1,r.inStrictModeStack[r.stackIndex]=n,r.parentStack[r.stackIndex]=i;}else r={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};var a=t.operatorToken.kind;if(55===a||56===a||60===a||e.isLogicalOrCoalescingAssignmentOperator(a)){if(ue(t)){var o=$();he(t,o,o),v=ce(o);}else he(t,D,S);r.skip=!0;}return r}),(function(e,r,n){if(!r.skip){var i=t(e);return 27===n.operatorToken.kind&&me(e),i}}),(function(e,t,r){t.skip||Le(e);}),(function(e,r,n){if(!r.skip){var i=t(e);return 27===n.operatorToken.kind&&me(e),i}}),(function(t,r){if(!r.skip){var n=t.operatorToken.kind;e.isAssignmentOperator(n)&&!e.isAssignmentTarget(t)&&(ve(t.left),63===n&&209===t.left.kind&&Z(t.left.expression)&&(v=oe(256,v,t)));}var i=r.inStrictModeStack[r.stackIndex],a=r.parentStack[r.stackIndex];void 0!==i&&(A=i),void 0!==a&&(s=a),r.skip=!1,r.stackIndex--;}),void 0);function t(t){if(t&&e.isBinaryExpression(t)&&!e.isDestructuringAssignment(t))return t;Le(t);}}();function R(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(e.getSourceFileOfNode(r)||t,r,n,i,a,o)}return function(n,i){t=n,r=i,o=e.getEmitScriptTarget(r),A=function(t,r){return !(!e.getStrictOptionValue(r,"alwaysStrict")||t.isDeclarationFile)||!!t.externalModuleIndicator}(t,i),P=new e.Set,I=0,F=e.objectAllocator.getSymbolConstructor(),e.Debug.attachFlowNodeDebugInfo(O),e.Debug.attachFlowNodeDebugInfo(M),t.locals||(null===e.tracing||void 0===e.tracing||e.tracing.push("bind","bindSourceFile",{path:t.path},!0),Le(t),null===e.tracing||void 0===e.tracing||e.tracing.pop(),t.symbolCount=I,t.classifiableNames=P,function(){if(m){for(var r=l,n=g,i=f,a=s,o=v,u=0,d=m;u<d.length;u++){var p=d[u],y=p.parent.parent;l=e.findAncestor(y.parent,(function(e){return !!(1&Ce(e))}))||t,f=e.getEnclosingBlockScopeContainer(y)||t,v=c({flags:2}),s=p,Le(p.typeExpression);var h=e.getNameOfDeclaration(p);if((e.isJSDocEnumTag(p)||!p.fullName)&&h&&e.isPropertyAccessEntityNameExpression(h.parent)){var b=Ye(h.parent);if(b){Qe(t.symbol,h.parent,b,!!e.findAncestor(h,(function(t){return e.isPropertyAccessExpression(t)&&"prototype"===t.name.escapedText})),!1);var x=l;switch(e.getAssignmentDeclarationPropertyAccessKind(h.parent)){case 1:case 2:l=e.isExternalOrCommonJsModule(t)?t:void 0;break;case 4:l=h.parent.expression;break;case 3:l=h.parent.expression.name;break;case 5:l=_(t,h.parent.expression)?t:e.isPropertyAccessExpression(h.parent.expression)?h.parent.expression.name:h.parent.expression;break;case 0:return e.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}l&&K(p,524288,788968),l=x;}}else e.isJSDocEnumTag(p)||!p.fullName||79===p.fullName.kind?(s=p.parent,Pe(p,524288,788968)):Le(p.fullName);}l=r,g=n,f=i,s=a,v=o;}}()),t=void 0,r=void 0,o=void 0,s=void 0,l=void 0,p=void 0,f=void 0,g=void 0,m=void 0,y=!1,v=void 0,h=void 0,b=void 0,x=void 0,D=void 0,S=void 0,T=void 0,E=void 0,k=!1,w=!1,N=0;};function B(e,t){return I++,new F(e,t)}function j(t,r,n){t.flags|=n,r.symbol=t,t.declarations=e.appendIfUnique(t.declarations,r),1955&n&&!t.exports&&(t.exports=e.createSymbolTable()),6240&n&&!t.members&&(t.members=e.createSymbolTable()),t.constEnumOnlyModule&&304&t.flags&&(t.constEnumOnlyModule=!1),111551&n&&e.setValueDeclaration(t,r);}function J(t){if(274===t.kind)return t.isExportEquals?"export=":"default";var r=e.getNameOfDeclaration(t);if(r){if(e.isAmbientModule(t)){var n=e.getTextOfIdentifierOrLiteral(r);return e.isGlobalScopeAugmentation(t)?"__global":'"'.concat(n,'"')}if(164===r.kind){var i=r.expression;if(e.isStringOrNumericLiteralLike(i))return e.escapeLeadingUnderscores(i.text);if(e.isSignedNumericLiteral(i))return e.tokenToString(i.operator)+i.operand.text;e.Debug.fail("Only computed properties with literal names have declaration names");}if(e.isPrivateIdentifier(r)){var a=e.getContainingClass(t);if(!a)return;var o=a.symbol;return e.getSymbolNameForPrivateIdentifier(o,r.escapedText)}return e.isPropertyNameLiteral(r)?e.getEscapedTextOfIdentifierOrLiteral(r):void 0}switch(t.kind){case 173:return "__constructor";case 181:case 176:case 326:return "__call";case 182:case 177:return "__new";case 178:return "__index";case 275:return "__export";case 308:return "export=";case 223:if(2===e.getAssignmentDeclarationKind(t))return "export=";e.Debug.fail("Unknown binary declaration kind");break;case 320:return e.isJSDocConstructSignature(t)?"__new":"__call";case 166:return e.Debug.assert(320===t.parent.kind,"Impossible parameter parent kind",(function(){return "parent is: ".concat(e.Debug.formatSyntaxKind(t.parent.kind),", expected JSDocFunctionType")})),"arg"+t.parent.parameters.indexOf(t)}}function z(t){return e.isNamedDeclaration(t)?e.declarationNameToString(t.name):e.unescapeLeadingUnderscores(e.Debug.checkDefined(J(t)))}function U(r,i,a,o,s,c,l){e.Debug.assert(l||!e.hasDynamicName(a));var u,_=e.hasSyntacticModifier(a,1024)||e.isExportSpecifier(a)&&"default"===a.name.escapedText,d=l?"__computed":_&&i?"default":J(a);if(void 0===d)u=B(0,"__missing");else if(u=r.get(d),2885600&o&&P.add(d),u){if(c&&!u.isReplaceableByMethod)return u;if(u.flags&s)if(u.isReplaceableByMethod)r.set(d,u=B(0,d));else if(!(3&o&&67108864&u.flags)){e.isNamedDeclaration(a)&&e.setParent(a.name,a);var p=2&u.flags?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,f=!0;(384&u.flags||384&o)&&(p=e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,f=!1);var g=!1;e.length(u.declarations)&&(_||u.declarations&&u.declarations.length&&274===a.kind&&!a.isExportEquals)&&(p=e.Diagnostics.A_module_cannot_have_multiple_default_exports,f=!1,g=!0);var m=[];e.isTypeAliasDeclaration(a)&&e.nodeIsMissing(a.type)&&e.hasSyntacticModifier(a,1)&&2887656&u.flags&&m.push(R(a,e.Diagnostics.Did_you_mean_0,"export type { ".concat(e.unescapeLeadingUnderscores(a.name.escapedText)," }")));var y=e.getNameOfDeclaration(a)||a;e.forEach(u.declarations,(function(r,n){var i=e.getNameOfDeclaration(r)||r,a=R(i,p,f?z(r):void 0);t.bindDiagnostics.push(g?e.addRelatedInfo(a,R(y,0===n?e.Diagnostics.Another_export_default_is_here:e.Diagnostics.and_here)):a),g&&m.push(R(i,e.Diagnostics.The_first_export_default_is_here));}));var v=R(y,p,f?z(a):void 0);t.bindDiagnostics.push(e.addRelatedInfo.apply(void 0,n$4([v],m,!1))),u=B(0,d);}}else r.set(d,u=B(0,d)),c&&(u.isReplaceableByMethod=!0);return j(u,a,o),u.parent?e.Debug.assert(u.parent===i,"Existing symbol parent should match new one"):u.parent=i,u}function K(t,r,n){var i=!!(1&e.getCombinedModifierFlags(t))||function(t){if(t.parent&&e.isModuleDeclaration(t)&&(t=t.parent),!e.isJSDocTypeAlias(t))return !1;if(!e.isJSDocEnumTag(t)&&t.fullName)return !0;var r=e.getNameOfDeclaration(t);return !!(r&&(e.isPropertyAccessEntityNameExpression(r.parent)&&Ye(r.parent)||e.isDeclaration(r.parent)&&1&e.getCombinedModifierFlags(r.parent)))}(t);if(2097152&r)return 278===t.kind||268===t.kind&&i?U(l.symbol.exports,l.symbol,t,r,n):U(l.locals,void 0,t,r,n);if(e.isJSDocTypeAlias(t)&&e.Debug.assert(e.isInJSFile(t)),!e.isAmbientModule(t)&&(i||64&l.flags)){if(!l.locals||e.hasSyntacticModifier(t,1024)&&!J(t))return U(l.symbol.exports,l.symbol,t,r,n);var a=111551&r?1048576:0,o=U(l.locals,void 0,t,a,n);return o.exportSymbol=U(l.symbol.exports,l.symbol,t,r,n),t.localSymbol=o,o}return U(l.locals,void 0,t,r,n)}function V(e){q(e,(function(e){return 259===e.kind?Le(e):void 0})),q(e,(function(e){return 259!==e.kind?Le(e):void 0}));}function q(t,r){void 0===r&&(r=Le),void 0!==t&&e.forEach(t,r);}function W(t){e.forEachChild(t,Le,q);}function H(t){var n=w;if(w=!1,function(t){if(!(1&v.flags))return !1;if(v===O){var n=e.isStatementButNotDeclaration(t)&&239!==t.kind||260===t.kind||264===t.kind&&function(t){var n=a(t);return 1===n||2===n&&e.shouldPreserveConstEnums(r)}(t);if(n&&(v=M,!r.allowUnreachableCode)){var i=e.unreachableCodeIsError(r)&&!(16777216&t.flags)&&(!e.isVariableStatement(t)||!!(3&e.getCombinedNodeFlags(t.declarationList))||t.declarationList.declarations.some((function(e){return !!e.initializer})));!function(t,r){if(e.isStatement(t)&&u(t)&&e.isBlock(t.parent)){var n=t.parent.statements,i=e.sliceAfter(n,t);e.getRangesWhere(i,u,(function(e,t){return r(i[e],i[t-1])}));}else r(t,t);}(t,(function(t,r){return Me(i,t,r,e.Diagnostics.Unreachable_code_detected)}));}}return !0}(t))return W(t),Re(t),void(w=n);switch(t.kind>=240&&t.kind<=256&&!r.allowUnreachableCode&&(t.flowNode=v),t.kind){case 244:!function(e){var t=fe(e,ee()),r=$(),n=$();ne(t,v),v=t,de(e.expression,r,n),v=ce(r),pe(e.statement,n,t),ne(t,v),v=ce(n);}(t);break;case 243:!function(e){var t=ee(),r=fe(e,$()),n=$();ne(t,v),v=t,pe(e.statement,n,r),ne(r,v),v=ce(r),de(e.expression,t,n),v=ce(n);}(t);break;case 245:!function(e){var t=fe(e,ee()),r=$(),n=$();Le(e.initializer),ne(t,v),v=t,de(e.condition,r,n),v=ce(r),pe(e.statement,n,t),Le(e.incrementor),ne(t,v),v=ce(n);}(t);break;case 246:case 247:!function(e){var t=fe(e,ee()),r=$();Le(e.expression),ne(t,v),v=t,247===e.kind&&Le(e.awaitModifier),ne(r,v),Le(e.initializer),258!==e.initializer.kind&&ve(e.initializer),pe(e.statement,r,t),ne(t,v),v=ce(r);}(t);break;case 242:!function(e){var t=$(),r=$(),n=$();de(e.expression,t,r),v=ce(t),Le(e.thenStatement),ne(n,v),v=ce(r),Le(e.elseStatement),ne(n,v),v=ce(n);}(t);break;case 250:case 254:!function(e){Le(e.expression),250===e.kind&&(k=!0,x&&ne(x,v)),v=O;}(t);break;case 249:case 248:!function(e){if(Le(e.label),e.label){var t=function(e){for(var t=E;t;t=t.next)if(t.name===e)return t}(e.label.escapedText);t&&(t.referenced=!0,ge(e,t.breakTarget,t.continueTarget));}else ge(e,h,b);}(t);break;case 255:!function(t){var r=x,n=T,i=$(),a=$(),o=$();if(t.finallyBlock&&(x=a),ne(o,v),T=o,Le(t.tryBlock),ne(i,v),t.catchClause&&(v=ce(o),ne(o=$(),v),T=o,Le(t.catchClause),ne(i,v)),x=r,T=n,t.finallyBlock){var s=$();s.antecedents=e.concatenate(e.concatenate(i.antecedents,o.antecedents),a.antecedents),v=s,Le(t.finallyBlock),1&v.flags?v=O:(x&&a.antecedents&&ne(x,te(s,a.antecedents,v)),T&&o.antecedents&&ne(T,te(s,o.antecedents,v)),v=i.antecedents?te(s,i.antecedents,v):O);}else v=ce(i);}(t);break;case 252:!function(t){var r=$();Le(t.expression);var n=h,i=C;h=r,C=v,Le(t.caseBlock),ne(r,v);var a=e.forEach(t.caseBlock.clauses,(function(e){return 293===e.kind}));t.possiblyExhaustive=!a&&!r.antecedents,a||ne(r,ae(C,t,0,0)),h=n,C=i,v=ce(r);}(t);break;case 266:!function(e){for(var t=e.clauses,n=G(e.parent.expression),i=O,a=0;a<t.length;a++){for(var o=a;!t[a].statements.length&&a+1<t.length;)Le(t[a]),a++;var s=$();ne(s,n?ae(C,e.parent,o,a+1):C),ne(s,i),v=ce(s);var c=t[a];Le(c),i=v,1&v.flags||a===t.length-1||!r.noFallthroughCasesInSwitch||(c.fallthroughFlowNode=v);}}(t);break;case 292:!function(e){var t=v;v=C,Le(e.expression),v=t,q(e.statements);}(t);break;case 241:!function(e){Le(e.expression),me(e.expression);}(t);break;case 253:!function(t){var n=$();E={next:E,name:t.label.escapedText,breakTarget:n,continueTarget:void 0,referenced:!1},Le(t.label),Le(t.statement),E.referenced||r.allowUnusedLabels||function(e,t,r){Me(e,t,t,r);}(e.unusedLabelIsError(r),t.label,e.Diagnostics.Unused_label),E=E.next,ne(n,v),v=ce(n);}(t);break;case 221:!function(e){if(53===e.operator){var t=D;D=S,S=t,W(e),S=D,D=t;}else W(e),45!==e.operator&&46!==e.operator||ve(e.operand);}(t);break;case 222:!function(e){W(e),(45===e.operator||46===e.operator)&&ve(e.operand);}(t);break;case 223:if(e.isDestructuringAssignment(t))return w=n,void function(e){w?(w=!1,Le(e.operatorToken),Le(e.right),w=!0,Le(e.left)):(w=!0,Le(e.left),w=!1,Le(e.operatorToken),Le(e.right)),ve(e.left);}(t);L(t);break;case 217:!function(e){W(e),208===e.expression.kind&&ve(e.expression);}(t);break;case 224:!function(e){var t=$(),r=$(),n=$();de(e.condition,t,r),v=ce(t),Le(e.questionToken),Le(e.whenTrue),ne(n,v),v=ce(r),Le(e.colonToken),Le(e.whenFalse),ne(n,v),v=ce(n);}(t);break;case 257:!function(t){W(t),(t.initializer||e.isForInOrOfStatement(t.parent.parent))&&be(t);}(t);break;case 208:case 209:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 210:!function(t){if(e.isOptionalChain(t))Te(t);else {var r=e.skipParentheses(t.expression);215===r.kind||216===r.kind?(q(t.typeArguments),q(t.arguments),Le(t.expression)):(W(t),106===t.expression.kind&&(v=se(v,t)));}if(208===t.expression.kind){var n=t.expression;e.isIdentifier(n.name)&&Z(n.expression)&&e.isPushOrUnshiftIdentifier(n.name)&&(v=oe(256,v,t));}}(t);break;case 232:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 348:case 341:case 342:!function(t){Le(t.tagName),342!==t.kind&&t.fullName&&(e.setParent(t.fullName,t),e.setParentRecursive(t.fullName,!1)),"string"!=typeof t.comment&&q(t.comment);}(t);break;case 308:V(t.statements),Le(t.endOfFileToken);break;case 238:case 265:V(t.statements);break;case 205:!function(e){Le(e.dotDotDotToken),Le(e.propertyName),xe(e.initializer),Le(e.name);}(t);break;case 166:!function(e){q(e.modifiers),Le(e.dotDotDotToken),Le(e.questionToken),Le(e.type),xe(e.initializer),Le(e.name);}(t);break;case 207:case 206:case 299:case 227:w=n;default:W(t);}Re(t),w=n;}function G(e){switch(e.kind){case 79:case 80:case 108:case 208:case 209:return X(e);case 210:return function(e){if(e.arguments)for(var t=0,r=e.arguments;t<r.length;t++)if(X(r[t]))return !0;return !(208!==e.expression.kind||!X(e.expression.expression))}(e);case 214:case 232:case 218:return G(e.expression);case 223:return function(e){switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return X(e.left);case 34:case 35:case 36:case 37:return Z(e.left)||Z(e.right)||Y(e.right,e.left)||Y(e.left,e.right);case 102:return Z(e.left);case 101:case 27:return G(e.right)}return !1}(e);case 221:return 53===e.operator&&G(e.operand)}return !1}function Q(t){return e.isDottedName(t)||(e.isPropertyAccessExpression(t)||e.isNonNullExpression(t)||e.isParenthesizedExpression(t))&&Q(t.expression)||e.isBinaryExpression(t)&&27===t.operatorToken.kind&&Q(t.right)||e.isElementAccessExpression(t)&&(e.isStringOrNumericLiteralLike(t.argumentExpression)||e.isEntityNameExpression(t.argumentExpression))&&Q(t.expression)||e.isAssignmentExpression(t)&&Q(t.left)}function X(t){return Q(t)||e.isOptionalChain(t)&&X(t.expression)}function Y(t,r){return e.isTypeOfExpression(t)&&Z(t.expression)&&e.isStringLiteralLike(r)}function Z(e){switch(e.kind){case 214:return Z(e.expression);case 223:switch(e.operatorToken.kind){case 63:return Z(e.left);case 27:return Z(e.right)}}return X(e)}function $(){return c({flags:4,antecedents:void 0})}function ee(){return c({flags:8,antecedents:void 0})}function te(e,t,r){return c({flags:1024,target:e,antecedents:t,antecedent:r})}function re(e){e.flags|=2048&e.flags?4096:2048;}function ne(t,r){1&r.flags||e.contains(t.antecedents,r)||((t.antecedents||(t.antecedents=[])).push(r),re(r));}function ie(t,r,n){return 1&r.flags?r:n?!(110===n.kind&&64&t||95===n.kind&&32&t)||e.isExpressionOfOptionalChainRoot(n)||e.isNullishCoalesce(n.parent)?G(n)?(re(r),c({flags:t,antecedent:r,node:n})):r:O:32&t?r:O}function ae(e,t,r,n){return re(e),c({flags:128,antecedent:e,switchStatement:t,clauseStart:r,clauseEnd:n})}function oe(e,t,r){re(t);var n=c({flags:e,antecedent:t,node:r});return T&&ne(T,n),n}function se(e,t){return re(e),c({flags:512,antecedent:e,node:t})}function ce(e){var t=e.antecedents;return t?1===t.length?t[0]:e:O}function le(e){for(;;)if(214===e.kind)e=e.expression;else {if(221!==e.kind||53!==e.operator)return 223===e.kind&&(55===e.operatorToken.kind||56===e.operatorToken.kind||60===e.operatorToken.kind);e=e.operand;}}function ue(t){for(;e.isParenthesizedExpression(t.parent)||e.isPrefixUnaryExpression(t.parent)&&53===t.parent.operator;)t=t.parent;return !(function(e){var t=e.parent;switch(t.kind){case 242:case 244:case 243:return t.expression===e;case 245:case 224:return t.condition===e}return !1}(t)||le(t.parent)||e.isOptionalChain(t.parent)&&t.parent.expression===t)}function _e(e,t,r,n){var i=D,a=S;D=r,S=n,e(t),D=i,S=a;}function de(t,r,n){_e(Le,t,r,n),t&&(function(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)&&e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)}(t)||le(t)||e.isOptionalChain(t)&&e.isOutermostOptionalChain(t))||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function pe(e,t,r){var n=h,i=b;h=t,b=r,Le(e),h=n,b=i;}function fe(e,t){for(var r=E;r&&253===e.parent.kind;)r.continueTarget=t,r=r.next,e=e.parent;return t}function ge(e,t,r){var n=249===e.kind?t:r;n&&(ne(n,v),v=O);}function me(t){if(210===t.kind){var r=t;106!==r.expression.kind&&e.isDottedName(r.expression)&&(v=se(v,r));}}function ye(e){223===e.kind&&63===e.operatorToken.kind?ve(e.left):ve(e);}function ve(e){if(Q(e))v=oe(16,v,e);else if(206===e.kind)for(var t=0,r=e.elements;t<r.length;t++){var n=r[t];227===n.kind?ve(n.expression):ye(n);}else if(207===e.kind)for(var i=0,a=e.properties;i<a.length;i++){var o=a[i];299===o.kind?ye(o.initializer):300===o.kind?ve(o.name):301===o.kind&&ve(o.expression);}}function he(t,r,n){var i=$();55===t.operatorToken.kind||76===t.operatorToken.kind?de(t.left,i,n):de(t.left,r,i),v=ce(i),Le(t.operatorToken),e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)?(_e(Le,t.right,r,n),ve(t.left),ne(r,ie(32,v,t)),ne(n,ie(64,v,t))):de(t.right,r,n);}function be(t){var r=e.isOmittedExpression(t)?void 0:t.name;if(e.isBindingPattern(r))for(var n=0,i=r.elements;n<i.length;n++)be(i[n]);else v=oe(16,v,t);}function xe(e){if(e){var t=v;if(Le(e),t!==O&&t!==v){var r=$();ne(r,t),ne(r,v),v=ce(r);}}}function De(e){switch(e.kind){case 208:Le(e.questionDotToken),Le(e.name);break;case 209:Le(e.questionDotToken),Le(e.argumentExpression);break;case 210:Le(e.questionDotToken),q(e.typeArguments),q(e.arguments);}}function Se(t,r,n){var i=e.isOptionalChainRoot(t)?$():void 0;!function(t,r,n){_e(Le,t,r,n),e.isOptionalChain(t)&&!e.isOutermostOptionalChain(t)||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}(t.expression,i||r,n),i&&(v=ce(i)),_e(De,t,r,n),e.isOutermostOptionalChain(t)&&(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function Te(e){if(ue(e)){var t=$();Se(e,t,t),v=ce(t);}else Se(e,D,S);}function Ce(t){switch(t.kind){case 228:case 260:case 263:case 207:case 184:case 325:case 289:return 1;case 261:return 65;case 264:case 262:case 197:case 178:return 33;case 308:return 37;case 174:case 175:case 171:if(e.isObjectLiteralOrClassExpressionMethodOrAccessor(t))return 173;case 173:case 259:case 170:case 176:case 326:case 320:case 181:case 177:case 182:case 172:return 45;case 215:case 216:return 61;case 265:return 4;case 169:return t.initializer?4:0;case 295:case 245:case 246:case 247:case 266:return 2;case 238:return e.isFunctionLike(t.parent)||e.isClassStaticBlockDeclaration(t.parent)?0:2}return 0}function Ee(e){g&&(g.nextContainer=e),g=e;}function ke(r,n,i){switch(l.kind){case 264:return K(r,n,i);case 308:return function(r,n,i){return e.isExternalModule(t)?K(r,n,i):U(t.locals,void 0,r,n,i)}(r,n,i);case 228:case 260:return function(t,r,n){return e.isStatic(t)?U(l.symbol.exports,l.symbol,t,r,n):U(l.symbol.members,l.symbol,t,r,n)}(r,n,i);case 263:return U(l.symbol.exports,l.symbol,r,n,i);case 184:case 325:case 207:case 261:case 289:return U(l.symbol.members,l.symbol,r,n,i);case 181:case 182:case 176:case 177:case 326:case 178:case 171:case 170:case 173:case 174:case 175:case 259:case 215:case 216:case 320:case 348:case 341:case 172:case 262:case 197:return U(l.locals,void 0,r,n,i)}}function Ne(t){16777216&t.flags&&!function(t){var r=e.isSourceFile(t)?t:e.tryCast(t.body,e.isModuleBlock);return !!r&&r.statements.some((function(t){return e.isExportDeclaration(t)||e.isExportAssignment(t)}))}(t)?t.flags|=64:t.flags&=-65;}function Ae(e){var t=a(e),r=0!==t;return ke(e,r?512:1024,r?110735:0),t}function Fe(e,t,r){var n=B(t,r);return 106508&t&&(n.parent=l.symbol),j(n,e,t),n}function Pe(t,r,n){switch(f.kind){case 264:K(t,r,n);break;case 308:if(e.isExternalOrCommonJsModule(l)){K(t,r,n);break}default:f.locals||(f.locals=e.createSymbolTable(),Ee(f)),U(f.locals,void 0,t,r,n);}}function we(r,n){if(n&&79===n.kind){var i=n;if(o=i,e.isIdentifier(o)&&("eval"===o.escapedText||"arguments"===o.escapedText)){var a=e.getErrorSpanForNode(t,n);t.bindDiagnostics.push(e.createFileDiagnostic(t,a.start,a.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t.externalModuleIndicator?e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode:e.Diagnostics.Invalid_use_of_0_in_strict_mode}(r),e.idText(i)));}}var o;}function Ie(e){A&&we(e,e.name);}function Oe(r,n,i,a,o){var s=e.getSpanOfTokenAtPosition(t,r.pos);t.bindDiagnostics.push(e.createFileDiagnostic(t,s.start,s.length,n,i,a,o));}function Me(r,n,a,o){!function(r,n,a){var o=e.createFileDiagnostic(t,n.pos,n.end-n.pos,a);r?t.bindDiagnostics.push(o):t.bindSuggestionDiagnostics=e.append(t.bindSuggestionDiagnostics,i$1(i$1({},o),{category:e.DiagnosticCategory.Suggestion}));}(r,{pos:e.getTokenPosOfNode(n,t),end:a.end},o);}function Le(r){if(r){e.setParent(r,s),e.tracing&&(r.tracingPath=t.path);var n=A;if(je(r),r.kind>162){var i=s;s=r;var a=Ce(r);0===a?H(r):function(t,r){var n=l,i=p,a=f;if(1&r?(216!==t.kind&&(p=l),l=f=t,32&r&&(l.locals=e.createSymbolTable()),Ee(l)):2&r&&((f=t).locals=void 0),4&r){var o=v,s=h,u=b,_=x,d=T,g=E,m=k,D=16&r&&!e.hasSyntacticModifier(t,512)&&!t.asteriskToken&&!!e.getImmediatelyInvokedFunctionExpression(t)||172===t.kind;D||(v=c({flags:2}),144&r&&(v.node=t)),x=D||173===t.kind||e.isInJSFile(t)&&(259===t.kind||215===t.kind)?$():void 0,T=void 0,h=void 0,b=void 0,E=void 0,k=!1,H(t),t.flags&=-2817,!(1&v.flags)&&8&r&&e.nodeIsPresent(t.body)&&(t.flags|=256,k&&(t.flags|=512),t.endFlowNode=v),308===t.kind&&(t.flags|=N,t.endFlowNode=v),x&&(ne(x,v),v=ce(x),(173===t.kind||172===t.kind||e.isInJSFile(t)&&(259===t.kind||215===t.kind))&&(t.returnFlowNode=v)),D||(v=o),h=s,b=u,x=_,T=d,E=g,k=m;}else 64&r?(y=!1,H(t),t.flags=y?128|t.flags:-129&t.flags):H(t);l=n,p=i,f=a;}(r,a),s=i;}else i=s,1===r.kind&&(s=r),Re(r),s=i;A=n;}}function Re(t){if(e.hasJSDocNodes(t))if(e.isInJSFile(t))for(var r=0,n=t.jsDoc;r<n.length;r++)Le(o=n[r]);else for(var i=0,a=t.jsDoc;i<a.length;i++){var o=a[i];e.setParent(o,t),e.setParentRecursive(o,!1);}}function Be(r){if(!A)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))return;if(o=a,'"use strict"'===(s=e.getSourceTextOfNodeFromSourceFile(t,o.expression))||"'use strict'"===s)return void(A=!0)}var o,s;}function je(n){switch(n.kind){case 79:if(n.isInJSDocNamespace){for(var i=n.parent;i&&!e.isJSDocTypeAlias(i);)i=i.parent;Pe(i,524288,788968);break}case 108:return v&&(e.isExpression(n)||300===s.kind)&&(n.flowNode=v),function(r){t.parseDiagnostics.length||16777216&r.flags||8388608&r.flags||e.isIdentifierName(r)||(A&&r.originalKeywordKind>=117&&r.originalKeywordKind<=125?t.bindDiagnostics.push(R(r,function(r){return e.getContainingClass(r)?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(r),e.declarationNameToString(r))):133===r.originalKeywordKind?e.isExternalModule(t)&&e.isInTopLevelContext(r)?t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,e.declarationNameToString(r))):32768&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))):125===r.originalKeywordKind&&8192&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))));}(n);case 163:v&&e.isPartOfTypeQuery(n)&&(n.flowNode=v);break;case 233:case 106:n.flowNode=v;break;case 80:return function(r){"#constructor"===r.escapedText&&(t.parseDiagnostics.length||t.bindDiagnostics.push(R(r,e.Diagnostics.constructor_is_a_reserved_word,e.declarationNameToString(r))));}(n);case 208:case 209:var a=n;v&&Q(a)&&(a.flowNode=v),e.isSpecialPropertyDeclaration(a)&&function(t){108===t.expression.kind?Ve(t):e.isBindableStaticAccessExpression(t)&&308===t.parent.parent.kind&&(e.isPrototypeAccess(t.expression)?He(t,t.parent):Ge(t));}(a),e.isInJSFile(a)&&t.commonJsModuleIndicator&&e.isModuleExportsAccessExpression(a)&&!d(f,"module")&&U(t.locals,void 0,a.expression,134217729,111550);break;case 223:switch(e.getAssignmentDeclarationKind(n)){case 1:Ue(n);break;case 2:!function(r){if(ze(r)){var n=e.getRightMostAssignedExpression(r.right);if(!(e.isEmptyObjectLiteral(n)||l===t&&_(t,n)))if(e.isObjectLiteralExpression(n)&&e.every(n.properties,e.isShorthandPropertyAssignment))e.forEach(n.properties,Ke);else {var i=e.exportAssignmentIsAlias(r)?2097152:1049092,a=U(t.symbol.exports,t.symbol,r,67108864|i,0);e.setValueDeclaration(a,r);}}}(n);break;case 3:He(n.left,n);break;case 6:!function(t){e.setParent(t.left,t),e.setParent(t.right,t),Ze(t.left.expression,t.left,!1,!0);}(n);break;case 4:Ve(n);break;case 5:var c=n.left.expression;if(e.isInJSFile(n)&&e.isIdentifier(c)){var u=d(f,c.escapedText);if(e.isThisInitializedDeclaration(null==u?void 0:u.valueDeclaration)){Ve(n);break}}!function(r){var n,i=$e(r.left.expression,l)||$e(r.left.expression,f);if(e.isInJSFile(r)||e.isFunctionSymbol(i)){var a=e.getLeftmostAccessExpression(r.left);e.isIdentifier(a)&&2097152&(null===(n=d(l,a.escapedText))||void 0===n?void 0:n.flags)||(e.setParent(r.left,r),e.setParent(r.right,r),e.isIdentifier(r.left.expression)&&l===t&&_(t,r.left.expression)?Ue(r):e.hasDynamicName(r)?(Fe(r,67108868,"__computed"),We(r,Qe(i,r.left.expression,Ye(r.left),!1,!1))):Ge(e.cast(r.left,e.isBindableStaticNameExpression)));}}(n);break;case 0:break;default:e.Debug.fail("Unknown binary expression special property assignment kind");}return function(t){A&&e.isLeftHandSideExpression(t.left)&&e.isAssignmentOperator(t.operatorToken.kind)&&we(t,t.left);}(n);case 295:return function(e){A&&e.variableDeclaration&&we(e,e.variableDeclaration.name);}(n);case 217:return function(r){if(A&&79===r.expression.kind){var n=e.getErrorSpanForNode(t,r.expression);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,e.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));}}(n);case 8:return function(r){o<1&&A&&32&r.numericLiteralFlags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));}(n);case 222:return function(e){A&&we(e,e.operand);}(n);case 221:return function(e){A&&(45!==e.operator&&46!==e.operator||we(e,e.operand));}(n);case 251:return function(t){A&&Oe(t,e.Diagnostics.with_statements_are_not_allowed_in_strict_mode);}(n);case 253:return function(t){A&&e.getEmitScriptTarget(r)>=2&&(e.isDeclarationStatement(t.statement)||e.isVariableStatement(t.statement))&&Oe(t.label,e.Diagnostics.A_label_is_not_allowed_here);}(n);case 194:return void(y=!0);case 179:break;case 165:return function(t){if(e.isJSDocTemplateTag(t.parent)){var r=e.getEffectiveContainerForJSDocTemplateTag(t.parent);r?(r.locals||(r.locals=e.createSymbolTable()),U(r.locals,void 0,t,262144,526824)):ke(t,262144,526824);}else if(192===t.parent.kind){var n=function(t){var r=e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&t.parent.extendsType===t}));return r&&r.parent}(t.parent);n?(n.locals||(n.locals=e.createSymbolTable()),U(n.locals,void 0,t,262144,526824)):Fe(t,262144,J(t));}else ke(t,262144,526824);}(n);case 166:return rt(n);case 257:return tt(n);case 205:return n.flowNode=v,tt(n);case 169:case 168:return function(t){var r=e.isAutoAccessorPropertyDeclaration(t),n=r?13247:0;return nt(t,(r?98304:4)|(t.questionToken?16777216:0),n)}(n);case 299:case 300:return nt(n,4,0);case 302:return nt(n,8,900095);case 176:case 177:case 178:return ke(n,131072,0);case 171:case 170:return nt(n,8192|(n.questionToken?16777216:0),e.isObjectLiteralMethod(n)?0:103359);case 259:return function(r){t.isDeclarationFile||16777216&r.flags||e.isAsyncFunction(r)&&(N|=2048),Ie(r),A?(function(r){if(o<2&&308!==f.kind&&264!==f.kind&&!e.isFunctionLikeOrClassStaticBlockDeclaration(f)){var n=e.getErrorSpanForNode(t,r);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}(r)));}}(r),Pe(r,16,110991)):ke(r,16,110991);}(n);case 173:return ke(n,16384,0);case 174:return nt(n,32768,46015);case 175:return nt(n,65536,78783);case 181:case 320:case 326:case 182:return function(t){var r=B(131072,J(t));j(r,t,131072);var n=B(2048,"__type");j(n,t,2048),n.members=e.createSymbolTable(),n.members.set(r.escapedName,r);}(n);case 184:case 325:case 197:return function(e){return Fe(e,2048,"__type")}(n);case 335:return function(t){W(t);var r=e.getHostSignatureFromJSDoc(t);r&&171!==r.kind&&j(r.symbol,r,32);}(n);case 207:return function(e){return Fe(e,4096,"__object")}(n);case 215:case 216:return function(r){return t.isDeclarationFile||16777216&r.flags||e.isAsyncFunction(r)&&(N|=2048),v&&(r.flowNode=v),Ie(r),Fe(r,16,r.name?r.name.escapedText:"__function")}(n);case 210:switch(e.getAssignmentDeclarationKind(n)){case 7:return function(e){var t=$e(e.arguments[0]),r=308===e.parent.parent.kind;Xe(e,t=Qe(t,e.arguments[0],r,!1,!1),!1);}(n);case 8:return function(e){if(ze(e)){var t=et(e.arguments[0],void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(t){U(t.exports,t,e,1048580,0);}}}(n);case 9:return function(e){var t=$e(e.arguments[0].expression);t&&t.valueDeclaration&&j(t,t.valueDeclaration,32),Xe(e,t,!0);}(n);case 0:break;default:return e.Debug.fail("Unknown call expression assignment declaration kind")}e.isInJSFile(n)&&function(r){!t.commonJsModuleIndicator&&e.isRequireCall(r,!1)&&ze(r);}(n);break;case 228:case 260:return A=!0,function(r){260===r.kind?Pe(r,32,899503):(Fe(r,32,r.name?r.name.escapedText:"__class"),r.name&&P.add(r.name.escapedText));var n=r.symbol,i=B(4194308,"prototype"),a=n.exports.get(i.escapedName);a&&(r.name&&e.setParent(r.name,r),t.bindDiagnostics.push(R(a.declarations[0],e.Diagnostics.Duplicate_identifier_0,e.symbolName(i)))),n.exports.set(i.escapedName,i),i.parent=n;}(n);case 261:return Pe(n,64,788872);case 262:return Pe(n,524288,788968);case 263:return function(t){return e.isEnumConst(t)?Pe(t,128,899967):Pe(t,256,899327)}(n);case 264:return function(r){if(Ne(r),e.isAmbientModule(r))if(e.hasSyntacticModifier(r,1)&&Oe(r,e.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible),e.isModuleAugmentationExternal(r))Ae(r);else {var n=void 0;if(10===r.name.kind){var i=r.name.text;void 0===(n=e.tryParsePattern(i))&&Oe(r.name,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,i);}var a=ke(r,512,110735);t.patternAmbientModules=e.append(t.patternAmbientModules,n&&!e.isString(n)?{pattern:n,symbol:a}:void 0);}else {var o=Ae(r);0!==o&&((a=r.symbol).constEnumOnlyModule=!(304&a.flags)&&2===o&&!1!==a.constEnumOnlyModule);}}(n);case 289:return function(e){return Fe(e,4096,"__jsxAttributes")}(n);case 288:return function(e,t,r){return ke(e,4,0)}(n);case 268:case 271:case 273:case 278:return ke(n,2097152,2097152);case 267:return function(r){e.some(r.modifiers)&&t.bindDiagnostics.push(R(r,e.Diagnostics.Modifiers_cannot_appear_here));var n=e.isSourceFile(r.parent)?e.isExternalModule(r.parent)?r.parent.isDeclarationFile?void 0:e.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files:e.Diagnostics.Global_module_exports_may_only_appear_in_module_files:e.Diagnostics.Global_module_exports_may_only_appear_at_top_level;n?t.bindDiagnostics.push(R(r,n)):(t.symbol.globalExports=t.symbol.globalExports||e.createSymbolTable(),U(t.symbol.globalExports,t.symbol,r,2097152,2097152));}(n);case 270:return function(e){e.name&&ke(e,2097152,2097152);}(n);case 275:return function(t){l.symbol&&l.symbol.exports?t.exportClause?e.isNamespaceExport(t.exportClause)&&(e.setParent(t.exportClause,t),U(l.symbol.exports,l.symbol,t.exportClause,2097152,2097152)):U(l.symbol.exports,l.symbol,t,8388608,0):Fe(t,8388608,J(t));}(n);case 274:return function(t){if(l.symbol&&l.symbol.exports){var r=e.exportAssignmentIsAlias(t)?2097152:4,n=U(l.symbol.exports,l.symbol,t,r,67108863);t.isExportEquals&&e.setValueDeclaration(n,t);}else Fe(t,111551,J(t));}(n);case 308:return Be(n.statements),function(){if(Ne(t),e.isExternalModule(t))Je();else if(e.isJsonSourceFile(t)){Je();var r=t.symbol;U(t.symbol.exports,t.symbol,t,4,67108863),t.symbol=r;}}();case 238:if(!e.isFunctionLikeOrClassStaticBlockDeclaration(n.parent))return;case 265:return Be(n.statements);case 343:if(326===n.parent.kind)return rt(n);if(325!==n.parent.kind)break;case 350:var p=n;return ke(p,p.isBracketed||p.typeExpression&&319===p.typeExpression.type.kind?16777220:4,0);case 348:case 341:case 342:return (m||(m=[])).push(n)}}function Je(){Fe(t,512,'"'.concat(e.removeFileExtension(t.fileName),'"'));}function ze(e){return !(t.externalModuleIndicator&&!0!==t.externalModuleIndicator||(t.commonJsModuleIndicator||(t.commonJsModuleIndicator=e,t.externalModuleIndicator||Je()),0))}function Ue(t){if(ze(t)){var r=et(t.left.expression,void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(r){var n=e.isAliasableExpression(t.right)&&(e.isExportsIdentifier(t.left.expression)||e.isModuleExportsAccessExpression(t.left.expression))?2097152:1048580;e.setParent(t.left,t),U(r.exports,r,t.left,n,0);}}}function Ke(e){U(t.symbol.exports,t.symbol,e,69206016,0);}function Ve(t){if(e.Debug.assert(e.isInJSFile(t)),!(e.isBinaryExpression(t)&&e.isPropertyAccessExpression(t.left)&&e.isPrivateIdentifier(t.left.name)||e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name))){var r=e.getThisContainer(t,!1);switch(r.kind){case 259:case 215:var n=r.symbol;if(e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind){var i=r.parent.left;e.isBindableStaticAccessExpression(i)&&e.isPrototypeAccess(i.expression)&&(n=$e(i.expression.expression,p));}n&&n.valueDeclaration&&(n.members=n.members||e.createSymbolTable(),e.hasDynamicName(t)?qe(t,n,n.members):U(n.members,n,t,67108868,0),j(n,n.valueDeclaration,32));break;case 173:case 169:case 171:case 174:case 175:case 172:var a=r.parent,o=e.isStatic(r)?a.symbol.exports:a.symbol.members;e.hasDynamicName(t)?qe(t,a.symbol,o):U(o,a.symbol,t,67108868,0,!0);break;case 308:if(e.hasDynamicName(t))break;r.commonJsModuleIndicator?U(r.symbol.exports,r.symbol,t,1048580,0):ke(t,1,111550);break;default:e.Debug.failBadSyntaxKind(r);}}}function qe(e,t,r){U(r,t,e,4,0,!0,!0),We(e,t);}function We(t,r){r&&(r.assignmentDeclarationMembers||(r.assignmentDeclarationMembers=new e.Map)).set(e.getNodeId(t),t);}function He(t,r){var n=t.expression,i=n.expression;e.setParent(i,n),e.setParent(n,t),e.setParent(t,r),Ze(i,t,!0,!0);}function Ge(t){e.Debug.assert(!e.isIdentifier(t)),e.setParent(t.expression,t),Ze(t.expression,t,!1,!1);}function Qe(r,n,i,a,o){if(2097152&(null==r?void 0:r.flags))return r;if(i&&!a){var s=67110400;r=et(n,r,(function(r,n,i){return n?(j(n,r,s),n):U(i?i.exports:t.jsGlobalAugmentations||(t.jsGlobalAugmentations=e.createSymbolTable()),i,r,s,110735)}));}return o&&r&&r.valueDeclaration&&j(r,r.valueDeclaration,32),r}function Xe(t,r,n){if(r&&function(t){if(1072&t.flags)return !0;var r=t.valueDeclaration;if(r&&e.isCallExpression(r))return !!e.getAssignedExpandoInitializer(r);var n=r?e.isVariableDeclaration(r)?r.initializer:e.isBinaryExpression(r)?r.right:e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)?r.parent.right:void 0:void 0;if(n=n&&e.getRightMostAssignedExpression(n)){var i=e.isPrototypeAccess(e.isVariableDeclaration(r)?r.name:e.isBinaryExpression(r)?r.left:r);return !!e.getExpandoInitializer(!e.isBinaryExpression(n)||56!==n.operatorToken.kind&&60!==n.operatorToken.kind?n:n.right,i)}return !1}(r)){var i=n?r.members||(r.members=e.createSymbolTable()):r.exports||(r.exports=e.createSymbolTable()),a=0,o=0;e.isFunctionLikeDeclaration(e.getAssignedExpandoInitializer(t))?(a=8192,o=103359):e.isCallExpression(t)&&e.isBindableObjectDefinePropertyCall(t)&&(e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"set"===e.idText(r)}))&&(a|=65540,o|=78783),e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"get"===e.idText(r)}))&&(a|=32772,o|=46015)),0===a&&(a=4,o=0),U(i,r,t,67108864|a,-67108865&o);}}function Ye(t){return e.isBinaryExpression(t.parent)?308===function(t){for(;e.isBinaryExpression(t.parent);)t=t.parent;return t.parent}(t.parent).parent.kind:308===t.parent.parent.kind}function Ze(e,t,r,n){var i=$e(e,l)||$e(e,f),a=Ye(t);Xe(t,i=Qe(i,t.expression,a,r,n),r);}function $e(t,r){if(void 0===r&&(r=l),e.isIdentifier(t))return d(r,t.escapedText);var n=$e(t.expression);return n&&n.exports&&n.exports.get(e.getElementOrPropertyAccessName(t))}function et(r,n,i){if(_(t,r))return t.symbol;if(e.isIdentifier(r))return i(r,$e(r),n);var a=et(r.expression,n,i),o=e.getNameOrArgument(r);return e.isPrivateIdentifier(o)&&e.Debug.fail("unexpected PrivateIdentifier"),i(o,a&&a.exports&&a.exports.get(e.getElementOrPropertyAccessName(r)),a)}function tt(t){if(A&&we(t,t.name),!e.isBindingPattern(t.name)){var r=257===t.kind?t:t.parent.parent;!e.isInJSFile(t)||!e.isVariableDeclarationInitializedToBareOrAccessedRequire(r)||e.getJSDocTypeTag(t)||1&e.getCombinedModifierFlags(t)?e.isBlockOrCatchScoped(t)?Pe(t,2,111551):e.isParameterDeclaration(t)?ke(t,1,111551):ke(t,1,111550):ke(t,2097152,2097152);}}function rt(t){if((343!==t.kind||326===l.kind)&&(!A||16777216&t.flags||we(t,t.name),e.isBindingPattern(t.name)?Fe(t,1,"__"+t.parent.parameters.indexOf(t)):ke(t,1,111551),e.isParameterPropertyDeclaration(t,t.parent))){var r=t.parent.parent;U(r.symbol.members,r.symbol,t,4|(t.questionToken?16777216:0),0);}}function nt(r,n,i){return t.isDeclarationFile||16777216&r.flags||!e.isAsyncFunction(r)||(N|=2048),v&&e.isObjectLiteralOrClassExpressionMethodOrAccessor(r)&&(r.flowNode=v),e.hasDynamicName(r)?Fe(r,n,"__computed"):ke(r,n,i)}}();function u(t){return !(e.isFunctionDeclaration(t)||function(t){switch(t.kind){case 261:case 262:return !0;case 264:return 1!==a(t);case 263:return e.hasSyntacticModifier(t,2048);default:return !1}}(t)||e.isEnumDeclaration(t)||e.isVariableStatement(t)&&!(3&e.getCombinedNodeFlags(t))&&t.declarationList.declarations.some((function(e){return !e.initializer})))}function _(t,r){var n=0,i=e.createQueue();for(i.enqueue(r);!i.isEmpty()&&n<100;){if(n++,r=i.dequeue(),e.isExportsIdentifier(r)||e.isModuleExportsAccessExpression(r))return !0;if(e.isIdentifier(r)){var a=d(t,r.escapedText);if(a&&a.valueDeclaration&&e.isVariableDeclaration(a.valueDeclaration)&&a.valueDeclaration.initializer){var o=a.valueDeclaration.initializer;i.enqueue(o),e.isAssignmentExpression(o,!0)&&(i.enqueue(o.left),i.enqueue(o.right));}}}return !1}function d(t,r){var n=t.locals&&t.locals.get(r);return n?n.exportSymbol||n:e.isSourceFile(t)&&t.jsGlobalAugmentations&&t.jsGlobalAugmentations.has(r)?t.jsGlobalAugmentations.get(r):t.symbol&&t.symbol.exports&&t.symbol.exports.get(r)}e.bindSourceFile=function(t,r){e.performance.mark("beforeBind"),e.perfLogger.logStartBindFile(""+t.fileName),l(t,r),e.perfLogger.logStopBindFile(),e.performance.mark("afterBind"),e.performance.measure("Bind","beforeBind","afterBind");},e.isExportsOrModuleExportsOrAlias=_;}(t),function(e){e.createGetSymbolWalker=function(t,r,n,i,a,o,s,c,l,u){return function(_){void 0===_&&(_=function(){return !0});var d=[],p=[];return {walkType:function(t){try{return f(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}},walkSymbol:function(t){try{return y(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}}};function f(t){if(t&&!d[t.id]&&(d[t.id]=t,!y(t.symbol))){if(524288&t.flags){var r=t,n=r.objectFlags;4&n&&function(t){f(t.target),e.forEach(u(t),f);}(t),32&n&&function(e){f(e.typeParameter),f(e.constraintType),f(e.templateType),f(e.modifiersType);}(t),3&n&&(m(a=t),e.forEach(a.typeParameters,f),e.forEach(i(a),f),f(a.thisType)),24&n&&m(r);}var a;262144&t.flags&&function(e){f(c(e));}(t),3145728&t.flags&&function(t){e.forEach(t.types,f);}(t),4194304&t.flags&&function(e){f(e.type);}(t),8388608&t.flags&&function(e){f(e.objectType),f(e.indexType),f(e.constraint);}(t);}}function g(i){var a=r(i);a&&f(a.type),e.forEach(i.typeParameters,f);for(var o=0,s=i.parameters;o<s.length;o++)y(s[o]);f(t(i)),f(n(i));}function m(e){for(var t=a(e),r=0,n=t.indexInfos;r<n.length;r++){var i=n[r];f(i.keyType),f(i.type);}for(var o=0,s=t.callSignatures;o<s.length;o++)g(s[o]);for(var c=0,l=t.constructSignatures;c<l.length;c++)g(l[c]);for(var u=0,_=t.properties;u<_.length;u++)y(_[u]);}function y(t){if(!t)return !1;var r=e.getSymbolId(t);return !p[r]&&(p[r]=t,!_(t)||(f(o(t)),t.exports&&t.exports.forEach(y),e.forEach(t.declarations,(function(e){if(e.type&&183===e.type.kind){var t=e.type;y(s(l(t.exprName)));}})),!1))}}};}(t),function(e){var t,r,a,s,c=/^".+"$/,l="(anonymous)",u=1,_=1,d=1,p=1;!function(e){e[e.AllowsSyncIterablesFlag=1]="AllowsSyncIterablesFlag",e[e.AllowsAsyncIterablesFlag=2]="AllowsAsyncIterablesFlag",e[e.AllowsStringInputFlag=4]="AllowsStringInputFlag",e[e.ForOfFlag=8]="ForOfFlag",e[e.YieldStarFlag=16]="YieldStarFlag",e[e.SpreadFlag=32]="SpreadFlag",e[e.DestructuringFlag=64]="DestructuringFlag",e[e.PossiblyOutOfBounds=128]="PossiblyOutOfBounds",e[e.Element=1]="Element",e[e.Spread=33]="Spread",e[e.Destructuring=65]="Destructuring",e[e.ForOf=13]="ForOf",e[e.ForAwaitOf=15]="ForAwaitOf",e[e.YieldStar=17]="YieldStar",e[e.AsyncYieldStar=19]="AsyncYieldStar",e[e.GeneratorReturnType=1]="GeneratorReturnType",e[e.AsyncGeneratorReturnType=2]="AsyncGeneratorReturnType";}(t||(t={})),function(e){e[e.Yield=0]="Yield",e[e.Return=1]="Return",e[e.Next=2]="Next";}(r||(r={})),function(e){e[e.Normal=0]="Normal",e[e.FunctionReturn=1]="FunctionReturn",e[e.GeneratorNext=2]="GeneratorNext",e[e.GeneratorYield=3]="GeneratorYield";}(a||(a={})),(s=e.TypeFacts||(e.TypeFacts={}))[s.None=0]="None",s[s.TypeofEQString=1]="TypeofEQString",s[s.TypeofEQNumber=2]="TypeofEQNumber",s[s.TypeofEQBigInt=4]="TypeofEQBigInt",s[s.TypeofEQBoolean=8]="TypeofEQBoolean",s[s.TypeofEQSymbol=16]="TypeofEQSymbol",s[s.TypeofEQObject=32]="TypeofEQObject",s[s.TypeofEQFunction=64]="TypeofEQFunction",s[s.TypeofEQHostObject=128]="TypeofEQHostObject",s[s.TypeofNEString=256]="TypeofNEString",s[s.TypeofNENumber=512]="TypeofNENumber",s[s.TypeofNEBigInt=1024]="TypeofNEBigInt",s[s.TypeofNEBoolean=2048]="TypeofNEBoolean",s[s.TypeofNESymbol=4096]="TypeofNESymbol",s[s.TypeofNEObject=8192]="TypeofNEObject",s[s.TypeofNEFunction=16384]="TypeofNEFunction",s[s.TypeofNEHostObject=32768]="TypeofNEHostObject",s[s.EQUndefined=65536]="EQUndefined",s[s.EQNull=131072]="EQNull",s[s.EQUndefinedOrNull=262144]="EQUndefinedOrNull",s[s.NEUndefined=524288]="NEUndefined",s[s.NENull=1048576]="NENull",s[s.NEUndefinedOrNull=2097152]="NEUndefinedOrNull",s[s.Truthy=4194304]="Truthy",s[s.Falsy=8388608]="Falsy",s[s.IsUndefined=16777216]="IsUndefined",s[s.IsNull=33554432]="IsNull",s[s.IsUndefinedOrNull=50331648]="IsUndefinedOrNull",s[s.All=134217727]="All",s[s.BaseStringStrictFacts=3735041]="BaseStringStrictFacts",s[s.BaseStringFacts=12582401]="BaseStringFacts",s[s.StringStrictFacts=16317953]="StringStrictFacts",s[s.StringFacts=16776705]="StringFacts",s[s.EmptyStringStrictFacts=12123649]="EmptyStringStrictFacts",s[s.EmptyStringFacts=12582401]="EmptyStringFacts",s[s.NonEmptyStringStrictFacts=7929345]="NonEmptyStringStrictFacts",s[s.NonEmptyStringFacts=16776705]="NonEmptyStringFacts",s[s.BaseNumberStrictFacts=3734786]="BaseNumberStrictFacts",s[s.BaseNumberFacts=12582146]="BaseNumberFacts",s[s.NumberStrictFacts=16317698]="NumberStrictFacts",s[s.NumberFacts=16776450]="NumberFacts",s[s.ZeroNumberStrictFacts=12123394]="ZeroNumberStrictFacts",s[s.ZeroNumberFacts=12582146]="ZeroNumberFacts",s[s.NonZeroNumberStrictFacts=7929090]="NonZeroNumberStrictFacts",s[s.NonZeroNumberFacts=16776450]="NonZeroNumberFacts",s[s.BaseBigIntStrictFacts=3734276]="BaseBigIntStrictFacts",s[s.BaseBigIntFacts=12581636]="BaseBigIntFacts",s[s.BigIntStrictFacts=16317188]="BigIntStrictFacts",s[s.BigIntFacts=16775940]="BigIntFacts",s[s.ZeroBigIntStrictFacts=12122884]="ZeroBigIntStrictFacts",s[s.ZeroBigIntFacts=12581636]="ZeroBigIntFacts",s[s.NonZeroBigIntStrictFacts=7928580]="NonZeroBigIntStrictFacts",s[s.NonZeroBigIntFacts=16775940]="NonZeroBigIntFacts",s[s.BaseBooleanStrictFacts=3733256]="BaseBooleanStrictFacts",s[s.BaseBooleanFacts=12580616]="BaseBooleanFacts",s[s.BooleanStrictFacts=16316168]="BooleanStrictFacts",s[s.BooleanFacts=16774920]="BooleanFacts",s[s.FalseStrictFacts=12121864]="FalseStrictFacts",s[s.FalseFacts=12580616]="FalseFacts",s[s.TrueStrictFacts=7927560]="TrueStrictFacts",s[s.TrueFacts=16774920]="TrueFacts",s[s.SymbolStrictFacts=7925520]="SymbolStrictFacts",s[s.SymbolFacts=16772880]="SymbolFacts",s[s.ObjectStrictFacts=7888800]="ObjectStrictFacts",s[s.ObjectFacts=16736160]="ObjectFacts",s[s.FunctionStrictFacts=7880640]="FunctionStrictFacts",s[s.FunctionFacts=16728e3]="FunctionFacts",s[s.VoidFacts=9830144]="VoidFacts",s[s.UndefinedFacts=26607360]="UndefinedFacts",s[s.NullFacts=42917664]="NullFacts",s[s.EmptyObjectStrictFacts=83427327]="EmptyObjectStrictFacts",s[s.EmptyObjectFacts=83886079]="EmptyObjectFacts",s[s.UnknownFacts=83886079]="UnknownFacts",s[s.AllTypeofNE=556800]="AllTypeofNE",s[s.OrFactsMask=8256]="OrFactsMask",s[s.AndFactsMask=134209471]="AndFactsMask";var f,g,m,y,v,h,b,x,D,S=new e.Map(e.getEntries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384}));!function(e){e[e.Type=0]="Type",e[e.ResolvedBaseConstructorType=1]="ResolvedBaseConstructorType",e[e.DeclaredType=2]="DeclaredType",e[e.ResolvedReturnType=3]="ResolvedReturnType",e[e.ImmediateBaseConstraint=4]="ImmediateBaseConstraint",e[e.EnumTagType=5]="EnumTagType",e[e.ResolvedTypeArguments=6]="ResolvedTypeArguments",e[e.ResolvedBaseTypes=7]="ResolvedBaseTypes",e[e.WriteType=8]="WriteType";}(f||(f={})),(D=e.CheckMode||(e.CheckMode={}))[D.Normal=0]="Normal",D[D.Contextual=1]="Contextual",D[D.Inferential=2]="Inferential",D[D.SkipContextSensitive=4]="SkipContextSensitive",D[D.SkipGenericFunctions=8]="SkipGenericFunctions",D[D.IsForSignatureHelp=16]="IsForSignatureHelp",D[D.IsForStringLiteralArgumentCompletions=32]="IsForStringLiteralArgumentCompletions",D[D.RestBindingElement=64]="RestBindingElement",(x=e.SignatureCheckMode||(e.SignatureCheckMode={}))[x.BivariantCallback=1]="BivariantCallback",x[x.StrictCallback=2]="StrictCallback",x[x.IgnoreReturnTypes=4]="IgnoreReturnTypes",x[x.StrictArity=8]="StrictArity",x[x.Callback=3]="Callback",function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target";}(g||(g={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(m||(m={})),function(e){e[e.IncludeReadonly=1]="IncludeReadonly",e[e.ExcludeReadonly=2]="ExcludeReadonly",e[e.IncludeOptional=4]="IncludeOptional",e[e.ExcludeOptional=8]="ExcludeOptional";}(y||(y={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(v||(v={})),function(e){e.resolvedExports="resolvedExports",e.resolvedMembers="resolvedMembers";}(h||(h={})),function(e){e[e.Local=0]="Local",e[e.Parameter=1]="Parameter";}(b||(b={}));var T,C,E,k,N=e.and(L,(function(t){return !e.isAccessor(t)}));!function(e){e[e.GetAccessor=1]="GetAccessor",e[e.SetAccessor=2]="SetAccessor",e[e.PropertyAssignment=4]="PropertyAssignment",e[e.Method=8]="Method",e[e.PrivateStatic=16]="PrivateStatic",e[e.GetOrSetAccessor=3]="GetOrSetAccessor",e[e.PropertyAssignmentOrMethod=12]="PropertyAssignmentOrMethod";}(T||(T={})),function(e){e[e.None=0]="None",e[e.ExportValue=1]="ExportValue",e[e.ExportType=2]="ExportType",e[e.ExportNamespace=4]="ExportNamespace";}(C||(C={})),function(e){e[e.None=0]="None",e[e.StrongArityForUntypedJS=1]="StrongArityForUntypedJS",e[e.VoidIsNonOptional=2]="VoidIsNonOptional";}(E||(E={})),function(e){e[e.Uppercase=0]="Uppercase",e[e.Lowercase=1]="Lowercase",e[e.Capitalize=2]="Capitalize",e[e.Uncapitalize=3]="Uncapitalize";}(k||(k={}));var A,F=new e.Map(e.getEntries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3}));function P(){}function w(){this.flags=0;}function I(e){return e.id||(e.id=_,_++),e.id}function O(e){return e.id||(e.id=u,u++),e.id}function M(t,r){var n=e.getModuleInstanceState(t);return 1===n||r&&2===n}function L(e){return 259!==e.kind&&171!==e.kind||!!e.body}function R(t){switch(t.parent.kind){case 273:case 278:return e.isIdentifier(t);default:return e.isDeclarationName(t)}}function B(e){switch(e){case 0:return "yieldType";case 1:return "returnType";case 2:return "nextType"}}function j(e){return !!(1&e.flags)}function J(e){return !!(2&e.flags)}e.getNodeId=I,e.getSymbolId=O,e.isInstantiatedModule=M,e.createTypeChecker=function(t){var r,a,s,u,_,f=e.memoize((function(){var r=new e.Map;return t.getSourceFiles().forEach((function(e){e.resolvedModules&&e.resolvedModules.forEach((function(e){e&&e.packageId&&r.set(e.packageId.name,".d.ts"===e.extension||!!r.get(e.packageId.name));}));})),r})),g=[],m=function(e){g.push(e);},y=e.objectAllocator.getSymbolConstructor(),v=e.objectAllocator.getTypeConstructor(),h=e.objectAllocator.getSignatureConstructor(),b=0,x=0,D=0,T=0,C=0,E=0,k=0,z=e.createSymbolTable(),U=[1],K=t.getCompilerOptions(),V=e.getEmitScriptTarget(K),q=e.getEmitModuleKind(K),W=e.getUseDefineForClassFields(K),H=e.getAllowSyntheticDefaultImports(K),G=e.getStrictOptionValue(K,"strictNullChecks"),Q=e.getStrictOptionValue(K,"strictFunctionTypes"),X=e.getStrictOptionValue(K,"strictBindCallApply"),Y=e.getStrictOptionValue(K,"strictPropertyInitialization"),Z=e.getStrictOptionValue(K,"noImplicitAny"),$=e.getStrictOptionValue(K,"noImplicitThis"),ee=e.getStrictOptionValue(K,"useUnknownInCatchVariables"),te=!!K.keyofStringsOnly,re=K.suppressExcessPropertyErrors?0:8192,ne=K.exactOptionalPropertyTypes,ie=function(){var t=e.createBinaryExpressionTrampoline((function(t,r,i){return r?(r.stackIndex++,r.skip=!1,n(r,void 0),a(r,void 0)):r={checkMode:i,skip:!1,stackIndex:0,typeStack:[void 0,void 0]},e.isInJSFile(t)&&e.getAssignedExpandoInitializer(t)?(r.skip=!0,a(r,Zx(t.right,i)),r):(function(t){var r=t.left,n=t.operatorToken,i=t.right;60===n.kind&&(!e.isBinaryExpression(r)||56!==r.operatorToken.kind&&55!==r.operatorToken.kind||XC(r,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(r.operatorToken.kind),e.tokenToString(n.kind)),!e.isBinaryExpression(i)||56!==i.operatorToken.kind&&55!==i.operatorToken.kind||XC(i,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(i.operatorToken.kind),e.tokenToString(n.kind)));}(t),63!==t.operatorToken.kind||207!==t.left.kind&&206!==t.left.kind||(r.skip=!0,a(r,Cx(t.left,Zx(t.right,i),i,108===t.right.kind))),r)}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r,o){if(!r.skip){var s=i(r);e.Debug.assertIsDefined(s),n(r,s),a(r,void 0);var c=t.kind;if(55===c||56===c||60===c){if(55===c){for(var l=o.parent;214===l.kind||e.isBinaryExpression(l)&&(55===l.operatorToken.kind||56===l.operatorToken.kind);)l=l.parent;lS(o.left,s,e.isIfStatement(l)?l.thenStatement:void 0);}uS(s,o.left);}}}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r){var o;if(r.skip)o=i(r);else {var s=function(e){return e.typeStack[e.stackIndex]}(r);e.Debug.assertIsDefined(s);var c=i(r);e.Debug.assertIsDefined(c),o=Nx(t.left,t.operatorToken,t.right,s,c,t);}return r.skip=!1,n(r,void 0),a(r,void 0),r.stackIndex--,o}),(function(e,t,r){return a(e,t),e}));return function(r,n){var i=t(r,n);return e.Debug.assertIsDefined(i),i};function r(t,r){if(e.isBinaryExpression(r))return r;a(t,Zx(r,t.checkMode));}function n(e,t){e.typeStack[e.stackIndex]=t;}function i(e){return e.typeStack[e.stackIndex+1]}function a(e,t){e.typeStack[e.stackIndex+1]=t;}}(),ae=function(){var r,n=t.getResolvedTypeReferenceDirectives();return n&&(r=new e.Map,n.forEach((function(e,r,n){if(e&&e.resolvedFileName){var i=t.getSourceFile(e.resolvedFileName);i&&a(i,r,n);}}))),{getReferencedExportContainer:VT,getReferencedImportDeclaration:qT,getReferencedDeclarationWithCollidingName:HT,isDeclarationWithCollidingName:GT,isValueAliasDeclaration:function(t){var r=e.getParseTreeNode(t);return !r||QT(r)},hasGlobalName:fC,isReferencedAliasDeclaration:function(t,r){var n=e.getParseTreeNode(t);return !n||$T(n,r)},getNodeCheckFlags:function(t){var r=e.getParseTreeNode(t);return r?aC(r):0},isTopLevelValueImportEqualsWithEntityName:XT,isDeclarationVisible:yo,isImplementationOfOverload:eC,isRequiredInitializedParameter:tC,isOptionalUninitializedParameterProperty:rC,isExpandoFunctionDeclaration:nC,getPropertiesOfContainerFunction:iC,createTypeOfDeclaration:_C,createReturnTypeOfSignatureDeclaration:dC,createTypeOfExpression:pC,createLiteralConstValue:vC,isSymbolAccessible:Qa,isEntityNameVisible:to,getConstantValue:function(t){var r=e.getParseTreeNode(t,sC);return r?cC(r):void 0},collectLinkedAliases:vo,getReferencedValueDeclaration:mC,getTypeReferenceSerializationKind:uC,isOptionalParameter:Al,moduleExportsSomeValue:KT,isArgumentsLocalBinding:UT,getExternalModuleFileFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.hasPossibleExternalModuleReference);return r&&xC(r)},getTypeReferenceDirectivesForEntityName:function(e){if(r){var t;164===e.parent.kind?t=1160127:(t=790504,(79===e.kind&&pm(e)||208===e.kind&&!function(e){return e.parent&&230===e.parent.kind&&e.parent.parent&&294===e.parent.parent.kind}(e))&&(t=1160127));var n=ia(e,t,!0);return n&&n!==we?i(n,t):void 0}},getTypeReferenceDirectivesForSymbol:i,isLiteralConstDeclaration:yC,isLateBound:function(t){var r=e.getParseTreeNode(t,e.isDeclaration),n=r&&Da(r);return !!(n&&4096&e.getCheckFlags(n))},getJsxFactoryEntity:hC,getJsxFragmentFactoryEntity:bC,getAllAccessorDeclarations:function(t){var r=175===(t=e.getParseTreeNode(t,e.isGetOrSetAccessorDeclaration)).kind?174:175,n=e.getDeclarationOfKind(Da(t),r);return {firstAccessor:n&&n.pos<t.pos?n:t,secondAccessor:n&&n.pos<t.pos?t:n,setAccessor:175===t.kind?t:n,getAccessor:174===t.kind?t:n}},getSymbolOfExternalModuleSpecifier:function(e){return sa(e,e,void 0)},isBindingCapturedByNode:function(t,r){var n=e.getParseTreeNode(t),i=e.getParseTreeNode(r);return !!n&&!!i&&(e.isVariableDeclaration(i)||e.isBindingElement(i))&&function(t,r){var n=di(t);return !!n&&e.contains(n.capturedBlockScopeBindings,Da(r))}(n,i)},getDeclarationStatementsForSourceFile:function(t,r,n,i){var a=e.getParseTreeNode(t);e.Debug.assert(a&&308===a.kind,"Non-sourcefile node passed into getDeclarationsForSourceFile");var o=Da(t);return o?o.exports?oe.symbolTableToDeclarationStatements(o.exports,t,r,n,i):[]:t.locals?oe.symbolTableToDeclarationStatements(t.locals,t,r,n,i):[]},isImportRequiredByAugmentation:function(t){var r=e.getSourceFileOfNode(t);if(!r.symbol)return !1;var n=xC(t);if(!n)return !1;if(n===r)return !1;for(var i=va(r.symbol),a=0,o=e.arrayFrom(i.values());a<o.length;a++){var s=o[a];if(s.mergeId){var c=xa(s);if(c.declarations)for(var l=0,u=c.declarations;l<u.length;l++){var _=u[l];if(e.getSourceFileOfNode(_)===n)return !0}}}return !1}};function i(t,n){if(r&&function(t){if(!t.declarations)return !1;for(var n=t;;){var i=Sa(n);if(!i)break;n=i;}if(n.valueDeclaration&&308===n.valueDeclaration.kind&&512&n.flags)return !1;for(var a=0,o=t.declarations;a<o.length;a++){var s=o[a],c=e.getSourceFileOfNode(s);if(r.has(c.path))return !0}return !1}(t)){for(var i,a=0,o=t.declarations;a<o.length;a++){var s=o[a];if(s.symbol&&s.symbol.flags&n){var c=e.getSourceFileOfNode(s),l=r.get(c.path);if(!l)return;(i||(i=[])).push(l);}}return i}}function a(n,i,o){if(!r.has(n.path)){r.set(n.path,[i,o]);for(var s=0,c=n.referencedFiles;s<c.length;s++){var l=c[s],u=l.fileName,_=l.resolutionMode,d=e.resolveTripleslashReference(u,n.fileName),p=t.getSourceFile(d);p&&a(p,i,_||n.impliedNodeFormat);}}}}(),oe=function(){return {typeToTypeNode:function(e,t,r,n){return a(t,r,n,(function(t){return l(e,t)}))},indexInfoToIndexSignatureDeclaration:function(e,t,r,n){return a(t,r,n,(function(t){return g(e,t,void 0)}))},signatureToSignatureDeclaration:function(e,t,r,n,i){return a(r,n,i,(function(r){return m(e,t,r)}))},symbolToEntityName:function(e,t,r,n,i){return a(r,n,i,(function(r){return P(e,r,t,!1)}))},symbolToExpression:function(e,t,r,n,i){return a(r,n,i,(function(r){return w(e,r,t)}))},symbolToTypeParameterDeclarations:function(e,t,r,n){return a(t,r,n,(function(t){return S(e,t)}))},symbolToParameterDeclaration:function(e,t,r,n){return a(t,r,n,(function(t){return h(e,t)}))},typeParameterToDeclaration:function(e,t,r,n){return a(t,r,n,(function(t){return v(e,t)}))},symbolTableToDeclarationStatements:function(t,r,s,c,u){return a(r,s,c,(function(r){return function(t,r,a){var s=Q(e.factory.createPropertyDeclaration,171,!0),c=Q((function(t,r,n,i){return e.factory.createPropertySignature(t,r,n,i)}),170,!1),u=r.enclosingDeclaration,_=[],d=new e.Set,p=[],f=r;(r=i$1(i$1({},f),{usedSymbolNames:new e.Set(f.usedSymbolNames),remappedSymbolNames:new e.Map,tracker:i$1(i$1({},f.tracker),{trackSymbol:function(e,t,n){if(0===Qa(e,t,n,!1).accessibility){var i=D(e,r,n);4&e.flags||N(i[0]);}else if(f.tracker&&f.tracker.trackSymbol)return f.tracker.trackSymbol(e,t,n);return !1}})})).tracker=o(r,r.tracker),e.forEachEntry(t,(function(t,r){re(t,e.unescapeLeadingUnderscores(r));}));var y,h=!a,b=t.get("export=");return b&&t.size>1&&2097152&b.flags&&(t=e.createSymbolTable()).set("export=",b),C(t),y=function(t){var r=e.findIndex(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!t.assertClause&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(r>=0){var n=t[r],i=e.mapDefined(n.exportClause.elements,(function(r){if(!r.propertyName){var n=e.indicesOf(t),i=e.filter(n,(function(n){return e.nodeHasName(t[n],r.name)}));if(e.length(i)&&e.every(i,(function(r){return e.canHaveExportModifier(t[r])}))){for(var a=0,o=i;a<o.length;a++){var s=o[a];t[s]=S(t[s]);}return}}return r}));e.length(i)?t[r]=e.factory.updateExportDeclaration(n,n.modifiers,n.isTypeOnly,e.factory.updateNamedExports(n.exportClause,i),n.moduleSpecifier,n.assertClause):e.orderedRemoveItemAt(t,r);}return t}(y=function(t){var r=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(r)>1){var i=e.filter(t,(function(t){return !e.isExportDeclaration(t)||!!t.moduleSpecifier||!t.exportClause}));t=n$4(n$4([],i,!0),[e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),void 0)],!1);}var a=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(a)>1){var o=e.group(a,(function(t){return e.isStringLiteral(t.moduleSpecifier)?">"+t.moduleSpecifier.text:">"}));if(o.length!==a.length)for(var s=function(r){r.length>1&&(t=n$4(n$4([],e.filter(t,(function(e){return -1===r.indexOf(e)})),!0),[e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),r[0].moduleSpecifier)],!1));},c=0,l=o;c<l.length;c++)s(l[c]);}return t}(y=function(t){var r=e.find(t,e.isExportAssignment),i=e.findIndex(t,e.isModuleDeclaration),a=-1!==i?t[i]:void 0;if(a&&r&&r.isExportEquals&&e.isIdentifier(r.expression)&&e.isIdentifier(a.name)&&e.idText(a.name)===e.idText(r.expression)&&a.body&&e.isModuleBlock(a.body)){var o=e.filter(t,(function(t){return !!(1&e.getEffectiveModifierFlags(t))})),s=a.name,c=a.body;if(e.length(o)&&(a=e.factory.updateModuleDeclaration(a,a.modifiers,a.name,c=e.factory.updateModuleBlock(c,e.factory.createNodeArray(n$4(n$4([],a.body.statements,!0),[e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports(e.map(e.flatMap(o,(function(t){return r=t,e.isVariableStatement(r)?e.filter(e.map(r.declarationList.declarations,e.getNameOfDeclaration),x):e.filter([e.getNameOfDeclaration(r)],x);var r;})),(function(t){return e.factory.createExportSpecifier(!1,void 0,t)}))),void 0)],!1)))),t=n$4(n$4(n$4([],t.slice(0,i),!0),[a],!1),t.slice(i+1),!0)),!e.find(t,(function(t){return t!==a&&e.nodeHasName(t,s)}))){_=[];var l=!e.some(c.statements,(function(t){return e.hasSyntacticModifier(t,1)||e.isExportAssignment(t)||e.isExportDeclaration(t)}));e.forEach(c.statements,(function(e){A(e,l?1:0);})),t=n$4(n$4([],e.filter(t,(function(e){return e!==a&&e!==r})),!0),_,!0);}}return t}(y=_))),u&&(e.isSourceFile(u)&&e.isExternalOrCommonJsModule(u)||e.isModuleDeclaration(u))&&(!e.some(y,e.isExternalModuleIndicator)||!e.hasScopeMarker(y)&&e.some(y,e.needsScopeMarker))&&y.push(e.createEmptyExports(e.factory)),y;function x(e){return !!e&&79===e.kind}function S(t){var r=-3&(1|e.getEffectiveModifierFlags(t));return e.factory.updateModifiers(t,r)}function T(t){var r=-2&e.getEffectiveModifierFlags(t);return e.factory.updateModifiers(t,r)}function C(t,r,n){r||p.push(new e.Map),t.forEach((function(e){k(e,!1,!!n);})),r||(p[p.length-1].forEach((function(e){k(e,!0,!!n);})),p.pop());}function k(t,_,p){var g=xa(t);if(!d.has(O(g))&&(d.add(O(g)),!_||e.length(t.declarations)&&e.some(t.declarations,(function(t){return !!e.findAncestor(t,(function(e){return e===u}))})))){var m=r;r=function(t){var r=i$1({},t);return r.typeParameterNames&&(r.typeParameterNames=new e.Map(r.typeParameterNames)),r.typeParameterNamesByText&&(r.typeParameterNamesByText=new e.Set(r.typeParameterNamesByText)),r.typeParameterSymbolList&&(r.typeParameterSymbolList=new e.Set(r.typeParameterSymbolList)),r.tracker=o(r,r.tracker),r}(r),function(t,i,o){var _,d,p,f,g=e.unescapeLeadingUnderscores(t.escapedName),m="default"===t.escapedName;if(!i||131072&r.flags||!e.isStringANonContextualKeyword(g)||m){var y=m&&!!(-113&t.flags||16&t.flags&&e.length(zc(ds(t))))&&!(2097152&t.flags),h=!y&&!i&&e.isStringANonContextualKeyword(g)&&!m;(y||h)&&(i=!0);var b=(i?0:1)|(m&&!y?1024:0),x=1536&t.flags&&7&t.flags&&"export="!==t.escapedName,D=x&&G(ds(t),t);if((8208&t.flags||D)&&I(ds(t),t,re(t,g),b),524288&t.flags&&function(t,n,i){var o,s=ws(t),c=_i(t).typeParameters,u=e.map(c,(function(e){return v(e,r)})),_=null===(o=t.declarations)||void 0===o?void 0:o.find(e.isJSDocTypeAlias),d=e.getTextOfJSDocComment(_?_.comment||_.parent.comment:void 0),p=r.flags;r.flags|=8388608;var f=r.enclosingDeclaration;r.enclosingDeclaration=_;var g=_&&_.typeExpression&&e.isJSDocTypeExpression(_.typeExpression)&&U(r,_.typeExpression.type,N,a)||l(s,r);A(e.setSyntheticLeadingComments(e.factory.createTypeAliasDeclaration(void 0,re(t,n),u,g),d?[{kind:3,text:"*\n * "+d.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]:[]),i),r.flags=p,r.enclosingDeclaration=f;}(t,g,b),7&t.flags&&"export="!==t.escapedName&&!(4194304&t.flags)&&!(32&t.flags)&&!(8192&t.flags)&&!D)if(o)H(t)&&(h=!1,y=!1);else {var S=ds(t),T=re(t,g);if(16&t.flags||!G(S,t)){var C=2&t.flags?Ey(t)?2:1:(null===(_=t.parent)||void 0===_?void 0:_.valueDeclaration)&&e.isSourceFile(null===(d=t.parent)||void 0===d?void 0:d.valueDeclaration)?2:void 0,k=!y&&4&t.flags?ee(T,t):T,P=t.declarations&&e.find(t.declarations,(function(t){return e.isVariableDeclaration(t)}));P&&e.isVariableDeclarationList(P.parent)&&1===P.parent.declarations.length&&(P=P.parent.parent);var w=null===(p=t.declarations)||void 0===p?void 0:p.find(e.isPropertyAccessExpression);if(w&&e.isBinaryExpression(w.parent)&&e.isIdentifier(w.parent.right)&&(null===(f=S.symbol)||void 0===f?void 0:f.valueDeclaration)&&e.isSourceFile(S.symbol.valueDeclaration)){var O=T===w.parent.right.escapedText?void 0:w.parent.right;A(e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,O,T)])),0),r.tracker.trackSymbol(S.symbol,r.enclosingDeclaration,111551);}else A(e.setTextRange(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(k,void 0,J(r,S,t,u,N,a))],C)),P),k!==T?-2&b:b),k===T||i||(A(e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,k,T)])),0),h=!1,y=!1);}else I(S,t,T,b);}if(384&t.flags&&function(t,r,n){A(e.factory.createEnumDeclaration(e.factory.createModifiersFromModifierFlags(Dx(t)?2048:0),re(t,r),e.map(e.filter(zc(ds(t)),(function(e){return !!(8&e.flags)})),(function(t){var r=t.declarations&&t.declarations[0]&&e.isEnumMember(t.declarations[0])?cC(t.declarations[0]):void 0;return e.factory.createEnumMember(e.unescapeLeadingUnderscores(t.escapedName),void 0===r?void 0:"string"==typeof r?e.factory.createStringLiteral(r):e.factory.createNumericLiteral(r))}))),n);}(t,g,b),32&t.flags&&(4&t.flags&&t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration.parent)&&e.isClassExpression(t.valueDeclaration.parent.right)?q(t,re(t,g),b):function(t,i,o){var c,u,_=null===(c=t.declarations)||void 0===c?void 0:c.find(e.isClassLike),d=r.enclosingDeclaration;r.enclosingDeclaration=_||d;var p=bs(t),f=e.map(p,(function(e){return v(e,r)})),g=Ps(t),m=Ns(g),y=_&&e.getEffectiveImplementsTypeNodes(_),h=y&&function(t){var n=e.mapDefined(t,(function(t){var n,i=r.enclosingDeclaration;r.enclosingDeclaration=t;var o=t.expression;if(e.isEntityNameExpression(o)){if(e.isIdentifier(o)&&""===e.idText(o))return c(void 0);var s=void 0;if(s=(n=z(o,r,N)).introducesError,o=n.node,s)return c(void 0)}return c(e.factory.createExpressionWithTypeArguments(o,e.map(t.typeArguments,(function(e){return U(r,e,N,a)||l(Hd(e),r)}))));function c(e){return r.enclosingDeclaration=i,e}}));if(n.length===t.length)return n}(y)||e.mapDefined(function(t){var r=e.emptyArray;if(t.symbol.declarations)for(var n=0,i=t.symbol.declarations;n<i.length;n++){var a=i[n],o=e.getEffectiveImplementsTypeNodes(a);if(o)for(var s=0,c=o;s<c.length;s++){var l=Hd(c[s]);Eo(l)||(r===e.emptyArray?r=[l]:r.push(l));}}return r}(g),$),b=ds(t),x=!!(null===(u=b.symbol)||void 0===u?void 0:u.valueDeclaration)&&e.isClassLike(b.symbol.valueDeclaration),D=x?Es(b):Le,S=n$4(n$4([],e.length(m)?[e.factory.createHeritageClause(94,e.map(m,(function(t){return function(t,n,i){var a=Z(t,111551);if(a)return a;var o=ee("".concat(i,"_base"));return A(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(o,void 0,l(n,r))],2)),0),e.factory.createExpressionWithTypeArguments(e.factory.createIdentifier(o),void 0)}(t,D,i)})))]:[],!0),e.length(h)?[e.factory.createHeritageClause(117,h)]:[],!0),T=function(t,r,n){if(!e.length(r))return n;var i=new e.Map;e.forEach(n,(function(e){i.set(e.escapedName,e);}));for(var a=0,o=r;a<o.length;a++)for(var s=0,c=zc(oc(o[a],t.thisType));s<c.length;s++){var l=c[s],u=i.get(l.escapedName);u&&l.parent===u.parent&&i.delete(l.escapedName);}return e.arrayFrom(i.values())}(g,m,zc(g)),C=e.filter(T,(function(t){var r=t.valueDeclaration;return !(!r||e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name))})),E=e.some(T,(function(t){var r=t.valueDeclaration;return !!r&&e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name)}))?[e.factory.createPropertyDeclaration(void 0,e.factory.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:e.emptyArray,k=e.flatMap(C,(function(e){return s(e,!1,m[0])})),F=e.flatMap(e.filter(zc(b),(function(e){return !(4194304&e.flags||"prototype"===e.escapedName||j(e))})),(function(e){return s(e,!0,D)})),P=!x&&t.valueDeclaration&&e.isInJSFile(t.valueDeclaration)&&!e.some(fl(b,1))?[e.factory.createConstructorDeclaration(e.factory.createModifiersFromModifierFlags(8),[],void 0)]:X(1,b,D,173),w=Y(g,m[0]);r.enclosingDeclaration=d,A(e.setTextRange(e.factory.createClassDeclaration(void 0,i,f,S,n$4(n$4(n$4(n$4(n$4([],w,!0),F,!0),P,!0),k,!0),E,!0)),t.declarations&&e.filter(t.declarations,(function(t){return e.isClassDeclaration(t)||e.isClassExpression(t)}))[0]),o);}(t,re(t,g),b)),(1536&t.flags&&(!x||function(t){return e.every(F(t),(function(e){return !(111551&Xi(Gi(e)))}))}(t))||D)&&function(t,n,i){var a=F(t),o=e.arrayToMultiMap(a,(function(e){return e.parent&&e.parent===t?"real":"merged"})),s=o.get("real")||e.emptyArray,c=o.get("merged")||e.emptyArray;if(e.length(s)&&L(s,u=re(t,n),i,!!(67108880&t.flags)),e.length(c)){var l=e.getSourceFileOfNode(r.enclosingDeclaration),u=re(t,n),_=e.factory.createModuleBlock([e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports(e.mapDefined(e.filter(c,(function(e){return "export="!==e.escapedName})),(function(n){var i,a,o=e.unescapeLeadingUnderscores(n.escapedName),s=re(n,o),c=n.declarations&&Fi(n);if(!l||(c?l===e.getSourceFileOfNode(c):e.some(n.declarations,(function(t){return e.getSourceFileOfNode(t)===l})))){var u=c&&Wi(c,!0);N(u||n);var _=u?re(u,e.unescapeLeadingUnderscores(u.escapedName)):s;return e.factory.createExportSpecifier(!1,o===_?void 0:_,o)}null===(a=null===(i=r.tracker)||void 0===i?void 0:i.reportNonlocalAugmentation)||void 0===a||a.call(i,l,t,n);}))))]);A(e.factory.createModuleDeclaration(void 0,e.factory.createIdentifier(u),_,16),0);}}(t,g,b),64&t.flags&&!(32&t.flags)&&function(t,i,a){var o=Ps(t),s=bs(t),l=e.map(s,(function(e){return v(e,r)})),u=Ns(o),_=e.length(u)?N_(u):void 0,d=e.flatMap(zc(o),(function(e){return function(e,t){return c(e,!1,t)}(e,_)})),p=X(0,o,_,176),f=X(1,o,_,177),g=Y(o,_),m=e.length(u)?[e.factory.createHeritageClause(94,e.mapDefined(u,(function(e){return Z(e,111551)})))]:void 0;A(e.factory.createInterfaceDeclaration(void 0,re(t,i),l,m,n$4(n$4(n$4(n$4([],g,!0),f,!0),p,!0),d,!0)),a);}(t,g,b),2097152&t.flags&&q(t,re(t,g),b),4&t.flags&&"export="===t.escapedName&&H(t),8388608&t.flags&&t.declarations)for(var M=0,R=t.declarations;M<R.length;M++){var B=R[M],K=oa(B,B.moduleSpecifier);K&&A(e.factory.createExportDeclaration(void 0,!1,void 0,e.factory.createStringLiteral(E(K,r))),0);}y?A(e.factory.createExportAssignment(void 0,!1,e.factory.createIdentifier(re(t,g))),0):h&&A(e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,re(t,g),g)])),0);}else r.encounteredError=!0;}(t,_,p),r.reportedDiagnostic&&(f.reportedDiagnostic=r.reportedDiagnostic),r=m;}}function N(t){if(!e.some(t.declarations,e.isParameterDeclaration)){e.Debug.assertIsDefined(p[p.length-1]),ee(e.unescapeLeadingUnderscores(t.escapedName),t);var r=!!(2097152&t.flags)&&!e.some(t.declarations,(function(t){return !!e.findAncestor(t,e.isExportDeclaration)||e.isNamespaceExport(t)||e.isImportEqualsDeclaration(t)&&!e.isExternalModuleReference(t.moduleReference)}));p[r?0:p.length-1].set(O(t),t);}}function A(t,n){if(e.canHaveModifiers(t)){var i=0,a=r.enclosingDeclaration&&(e.isJSDocTypeAlias(r.enclosingDeclaration)?e.getSourceFileOfNode(r.enclosingDeclaration):r.enclosingDeclaration);1&n&&a&&(function(t){return e.isSourceFile(t)&&(e.isExternalOrCommonJsModule(t)||e.isJsonSourceFile(t))||e.isAmbientModule(t)&&!e.isGlobalScopeAugmentation(t)}(a)||e.isModuleDeclaration(a))&&e.canHaveExportModifier(t)&&(i|=1),!h||1&i||a&&16777216&a.flags||!(e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isModuleDeclaration(t))||(i|=2),1024&n&&(e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionDeclaration(t))&&(i|=1024),i&&(t=e.factory.updateModifiers(t,i|e.getEffectiveModifierFlags(t)));}_.push(t);}function F(t){return t.exports?e.filter(e.arrayFrom(t.exports.values()),j):[]}function I(t,n,i,o){for(var s=0,c=fl(t,0);s<c.length;s++){var l=c[s],u=m(l,259,r,{name:e.factory.createIdentifier(i),privateSymbolVisitor:N,bundledImports:a});A(e.setTextRange(u,M(l)),o);}1536&n.flags&&n.exports&&n.exports.size||L(e.filter(zc(t),j),i,o,!0);}function M(t){if(t.declaration&&t.declaration.parent){if(e.isBinaryExpression(t.declaration.parent)&&5===e.getAssignmentDeclarationKind(t.declaration.parent))return t.declaration.parent;if(e.isVariableDeclaration(t.declaration.parent)&&t.declaration.parent.parent)return t.declaration.parent.parent}return t.declaration}function L(t,n,a,o){if(e.length(t)){var s=e.arrayToMultiMap(t,(function(t){return !e.length(t.declarations)||e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(r.enclosingDeclaration)}))?"local":"remote"})).get("local")||e.emptyArray,c=e.parseNodeFactory.createModuleDeclaration(void 0,e.factory.createIdentifier(n),e.factory.createModuleBlock([]),16);e.setParent(c,u),c.locals=e.createSymbolTable(t),c.symbol=t[0].parent;var l=_;_=[];var d=h;h=!1;var p=i$1(i$1({},r),{enclosingDeclaration:c}),f=r;r=p,C(e.createSymbolTable(s),o,!0),r=f,h=d;var g=_;_=l;var m=e.map(g,(function(t){return e.isExportAssignment(t)&&!t.isExportEquals&&e.isIdentifier(t.expression)?e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t.expression,e.factory.createIdentifier("default"))])):t})),y=e.every(m,(function(t){return e.hasSyntacticModifier(t,1)}))?e.map(m,T):m;A(c=e.factory.updateModuleDeclaration(c,c.modifiers,c.name,e.factory.createModuleBlock(y)),a);}}function j(t){return !!(2887656&t.flags)||!(4194304&t.flags||"prototype"===t.escapedName||t.valueDeclaration&&e.isStatic(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))}function q(t,n,i){var a,o,s,c,l,u=Fi(t);if(!u)return e.Debug.fail();var _,d=xa(Wi(u,!0));if(d){var p=e.isShorthandAmbientModuleSymbol(d)&&(_=t.declarations,e.firstDefined(_,(function(t){if(e.isImportSpecifier(t)||e.isExportSpecifier(t))return e.idText(t.propertyName||t.name);if(e.isBinaryExpression(t)||e.isExportAssignment(t)){var r=e.isExportAssignment(t)?t.expression:t.right;if(e.isPropertyAccessExpression(r))return e.idText(r.name)}if(Pi(t)){var n=e.getNameOfDeclaration(t);if(n&&e.isIdentifier(n))return e.idText(n)}})))||e.unescapeLeadingUnderscores(d.escapedName);"export="===p&&(e.getESModuleInterop(K)||K.allowSyntheticDefaultImports)&&(p="default");var f=re(d,p);switch(N(d),u.kind){case 205:if(257===(null===(o=null===(a=u.parent)||void 0===a?void 0:a.parent)||void 0===o?void 0:o.kind)){var g=E(d.parent||d,r),m=u.propertyName;A(e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,m&&e.isIdentifier(m)?e.factory.createIdentifier(e.idText(m)):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(g),void 0),0);break}e.Debug.failBadSyntaxKind((null===(s=u.parent)||void 0===s?void 0:s.parent)||u,"Unhandled binding element grandparent kind in declaration serialization");break;case 300:223===(null===(l=null===(c=u.parent)||void 0===c?void 0:c.parent)||void 0===l?void 0:l.kind)&&W(e.unescapeLeadingUnderscores(t.escapedName),f);break;case 257:if(e.isPropertyAccessExpression(u.initializer)){var y=u.initializer,v=e.factory.createUniqueName(n),h=E(d.parent||d,r);A(e.factory.createImportEqualsDeclaration(void 0,!1,v,e.factory.createExternalModuleReference(e.factory.createStringLiteral(h))),0),A(e.factory.createImportEqualsDeclaration(void 0,!1,e.factory.createIdentifier(n),e.factory.createQualifiedName(v,y.name)),i);break}case 268:if("export="===d.escapedName&&e.some(d.declarations,e.isJsonSourceFile)){H(t);break}var b=!(512&d.flags||e.isVariableDeclaration(u));A(e.factory.createImportEqualsDeclaration(void 0,!1,e.factory.createIdentifier(n),b?P(d,r,67108863,!1):e.factory.createExternalModuleReference(e.factory.createStringLiteral(E(d,r)))),b?i:0);break;case 267:A(e.factory.createNamespaceExportDeclaration(e.idText(u.name)),0);break;case 270:A(e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,e.factory.createIdentifier(n),void 0),e.factory.createStringLiteral(E(d.parent||d,r)),void 0),0);break;case 271:A(e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(n))),e.factory.createStringLiteral(E(d,r)),void 0),0);break;case 277:A(e.factory.createExportDeclaration(void 0,!1,e.factory.createNamespaceExport(e.factory.createIdentifier(n)),e.factory.createStringLiteral(E(d,r))),0);break;case 273:A(e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,n!==p?e.factory.createIdentifier(p):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(E(d.parent||d,r)),void 0),0);break;case 278:var x=u.parent.parent.moduleSpecifier;W(e.unescapeLeadingUnderscores(t.escapedName),x?p:f,x&&e.isStringLiteralLike(x)?e.factory.createStringLiteral(x.text):void 0);break;case 274:H(t);break;case 223:case 208:case 209:"default"===t.escapedName||"export="===t.escapedName?H(t):W(n,f);break;default:return e.Debug.failBadSyntaxKind(u,"Unhandled alias declaration kind in symbol serializer!")}}}function W(t,r,n){A(e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t!==r?r:void 0,t)]),n),0);}function H(t){if(4194304&t.flags)return !1;var n=e.unescapeLeadingUnderscores(t.escapedName),i="export="===n,o=i||"default"===n,s=t.declarations&&Fi(t),c=s&&Wi(s,!0);if(c&&e.length(c.declarations)&&e.some(c.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(u)}))){var l=s&&(e.isExportAssignment(s)||e.isBinaryExpression(s)?e.getExportAssignmentExpression(s):e.getPropertyAssignmentAliasLikeExpression(s)),d=l&&e.isEntityNameExpression(l)?function(t){switch(t.kind){case 79:return t;case 163:do{t=t.left;}while(79!==t.kind);return t;case 208:do{if(e.isModuleExportsAccessExpression(t.expression)&&!e.isPrivateIdentifier(t.name))return t.name;t=t.expression;}while(79!==t.kind);return t}}(l):void 0,p=d&&ia(d,67108863,!0,!0,u);(p||c)&&N(p||c);var f=r.tracker.trackSymbol;if(r.tracker.trackSymbol=function(){return !1},o)_.push(e.factory.createExportAssignment(void 0,i,w(c,r,67108863)));else if(d===l&&d)W(n,e.idText(d));else if(l&&e.isClassExpression(l))W(n,re(c,e.symbolName(c)));else {var g=ee(n,t);A(e.factory.createImportEqualsDeclaration(void 0,!1,e.factory.createIdentifier(g),P(c,r,67108863,!1)),0),W(n,g);}return r.tracker.trackSymbol=f,!0}g=ee(n,t);var m=Cg(ds(xa(t)));return G(m,t)?I(m,t,g,o?0:1):A(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(g,void 0,J(r,m,t,u,N,a))],2)),c&&4&c.flags&&"export="===c.escapedName?2:n===g?1:0),o?(_.push(e.factory.createExportAssignment(void 0,i,e.factory.createIdentifier(g))),!0):n!==g&&(W(n,g),!0)}function G(t,n){var i=e.getSourceFileOfNode(r.enclosingDeclaration);return 48&e.getObjectFlags(t)&&!e.length(hl(t))&&!lo(t)&&!(!e.length(e.filter(zc(t),j))&&!e.length(fl(t,0)))&&!e.length(fl(t,1))&&!B(n,u)&&!(t.symbol&&e.some(t.symbol.declarations,(function(t){return e.getSourceFileOfNode(t)!==i})))&&!e.some(zc(t),(function(e){return Zs(e.escapedName)}))&&!e.some(zc(t),(function(t){return e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)!==i}))}))&&e.every(zc(t),(function(t){return e.isIdentifierText(e.symbolName(t),V)}))}function Q(t,n,i){return function(o,s,c){var l,_,d,p,f,g=e.getDeclarationModifierFlagsFromSymbol(o),y=!!(8&g);if(s&&2887656&o.flags)return [];if(4194304&o.flags||c&&dl(c,o.escapedName)&&px(dl(c,o.escapedName))===px(o)&&(16777216&o.flags)==(16777216&dl(c,o.escapedName).flags)&&Np(ds(o),To(c,o.escapedName)))return [];var v=-513&g|(s?32:0),h=R(o,r),b=null===(l=o.declarations)||void 0===l?void 0:l.find(e.or(e.isPropertyDeclaration,e.isAccessor,e.isVariableDeclaration,e.isPropertySignature,e.isBinaryExpression,e.isPropertyAccessExpression));if(98304&o.flags&&i){var x=[];if(65536&o.flags&&x.push(e.setTextRange(e.factory.createSetAccessorDeclaration(e.factory.createModifiersFromModifierFlags(v),h,[e.factory.createParameterDeclaration(void 0,void 0,"arg",void 0,y?void 0:J(r,ds(o),o,u,N,a))],void 0),(null===(_=o.declarations)||void 0===_?void 0:_.find(e.isSetAccessor))||b)),32768&o.flags){var D=8&g;x.push(e.setTextRange(e.factory.createGetAccessorDeclaration(e.factory.createModifiersFromModifierFlags(v),h,[],D?void 0:J(r,ds(o),o,u,N,a),void 0),(null===(d=o.declarations)||void 0===d?void 0:d.find(e.isGetAccessor))||b));}return x}if(98311&o.flags)return e.setTextRange(t(e.factory.createModifiersFromModifierFlags((px(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,y?void 0:J(r,_s(o),o,u,N,a),void 0),(null===(p=o.declarations)||void 0===p?void 0:p.find(e.or(e.isPropertyDeclaration,e.isVariableDeclaration)))||b);if(8208&o.flags){var S=fl(ds(o),0);if(8&v)return e.setTextRange(t(e.factory.createModifiersFromModifierFlags((px(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,void 0,void 0),(null===(f=o.declarations)||void 0===f?void 0:f.find(e.isFunctionLikeDeclaration))||S[0]&&S[0].declaration||o.declarations&&o.declarations[0]);for(var T=[],C=0,E=S;C<E.length;C++){var k=E[C],A=m(k,n,r,{name:h,questionToken:16777216&o.flags?e.factory.createToken(57):void 0,modifiers:v?e.factory.createModifiersFromModifierFlags(v):void 0}),F=k.declaration&&e.isPrototypePropertyAssignment(k.declaration.parent)?k.declaration.parent:k.declaration;T.push(e.setTextRange(A,F));}return T}return e.Debug.fail("Unhandled class member kind! ".concat(o.__debugFlags||o.flags))}}function X(t,n,i,a){var o=fl(n,t);if(1===t){if(!i&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(i){var s=fl(i,1);if(!e.length(s)&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(s.length===o.length){for(var c=!1,l=0;l<s.length;l++)if(!Ff(o[l],s[l],!1,!1,!0,Ap)){c=!0;break}if(!c)return []}}for(var u=0,_=0,d=o;_<d.length;_++){var p=d[_];p.declaration&&(u|=e.getSelectedEffectiveModifierFlags(p.declaration,24));}if(u)return [e.setTextRange(e.factory.createConstructorDeclaration(e.factory.createModifiersFromModifierFlags(u),[],void 0),o[0].declaration)]}for(var f=[],g=0,y=o;g<y.length;g++){var v=y[g],h=m(v,a,r);f.push(e.setTextRange(h,v.declaration));}return f}function Y(e,t){for(var n=[],i=0,a=hl(e);i<a.length;i++){var o=a[i];if(t){var s=bl(t,o.keyType);if(s&&Np(o.type,s.type))continue}n.push(g(o,r,void 0));}return n}function Z(t,n){var i,a;if(t.target&&Ha(t.target.symbol,u,n)?(i=e.map(fu(t),(function(e){return l(e,r)})),a=w(t.target.symbol,r,788968)):t.symbol&&Ha(t.symbol,u,n)&&(a=w(t.symbol,r,788968)),a)return e.factory.createExpressionWithTypeArguments(a,i)}function $(t){return Z(t,788968)||(t.symbol?e.factory.createExpressionWithTypeArguments(w(t.symbol,r,788968),void 0):void 0)}function ee(e,t){var n,i,a=t?O(t):void 0;if(a&&r.remappedSymbolNames.has(a))return r.remappedSymbolNames.get(a);t&&(e=te(t,e));for(var o=0,s=e;null===(n=r.usedSymbolNames)||void 0===n?void 0:n.has(e);)o++,e="".concat(s,"_").concat(o);return null===(i=r.usedSymbolNames)||void 0===i||i.add(e),a&&r.remappedSymbolNames.set(a,e),e}function te(t,n){if("default"===n||"__class"===n||"__function"===n){var i=r.flags;r.flags|=16777216;var a=mo(t,r);r.flags=i,n=a.length>0&&e.isSingleOrDoubleQuote(a.charCodeAt(0))?e.stripQuotes(a):a;}return "default"===n?n="_default":"export="===n&&(n="_exports"),e.isIdentifierText(n,V)&&!e.isStringANonContextualKeyword(n)?n:"_"+n.replace(/[^a-zA-Z0-9]/g,"_")}function re(e,t){var n=O(e);return r.remappedSymbolNames.has(n)?r.remappedSymbolNames.get(n):(t=te(e,t),r.remappedSymbolNames.set(n,t),t)}}(t,r,u)}))},symbolToNode:function(t,r,n,i,o){return a(n,i,o,(function(n){return function(t,r,n){if(1073741824&r.flags){if(t.valueDeclaration){var i=e.getNameOfDeclaration(t.valueDeclaration);if(i&&e.isComputedPropertyName(i))return i}var a=_i(t).nameType;if(a&&9216&a.flags)return r.enclosingDeclaration=a.symbol.valueDeclaration,e.factory.createComputedPropertyName(w(a.symbol,r,n))}return w(t,r,n)}(t,n,r)}))}};function a(r,n,i,a){var s,c;e.Debug.assert(void 0===r||0==(8&r.flags));var l={enclosingDeclaration:r,flags:n||0,tracker:i&&i.trackSymbol?i:{trackSymbol:function(){return !1},moduleResolverHost:134217728&n?{getCommonSourceDirectory:t.getCommonSourceDirectory?function(){return t.getCommonSourceDirectory()}:function(){return ""},getCurrentDirectory:function(){return t.getCurrentDirectory()},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getPackageJsonInfoCache)||void 0===e?void 0:e.call(t)},useCaseSensitiveFileNames:e.maybeBind(t,t.useCaseSensitiveFileNames),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},fileExists:function(e){return t.fileExists(e)},getFileIncludeReasons:function(){return t.getFileIncludeReasons()},readFile:t.readFile?function(e){return t.readFile(e)}:void 0}:void 0},encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0};l.tracker=o(l,l.tracker);var u=a(l);return l.truncating&&1&l.flags&&(null===(c=null===(s=l.tracker)||void 0===s?void 0:s.reportTruncationError)||void 0===c||c.call(s)),l.encounteredError?void 0:u}function o(e,t){var r=t.trackSymbol;return i$1(i$1({},t),{reportCyclicStructureError:n(t.reportCyclicStructureError),reportInaccessibleThisError:n(t.reportInaccessibleThisError),reportInaccessibleUniqueSymbolError:n(t.reportInaccessibleUniqueSymbolError),reportLikelyUnsafeImportRequiredError:n(t.reportLikelyUnsafeImportRequiredError),reportNonlocalAugmentation:n(t.reportNonlocalAugmentation),reportPrivateInBaseOfClassExpression:n(t.reportPrivateInBaseOfClassExpression),reportNonSerializableProperty:n(t.reportNonSerializableProperty),trackSymbol:r&&function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(void 0,t);return i&&(e.reportedDiagnostic=!0),i}});function n(t){return t?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.reportedDiagnostic=!0,t.apply(void 0,r)}:t}}function s(t){return t.truncating?t.truncating:t.truncating=t.approximateLength>(1&t.flags?e.noTruncationMaximumTruncationLength:e.defaultMaximumTruncationLength)}function l(t,n){var i=n.flags,a=function(t,n){r&&r.throwIfCancellationRequested&&r.throwIfCancellationRequested();var i=8388608&n.flags;if(n.flags&=-8388609,!t)return 262144&n.flags?(n.approximateLength+=3,e.factory.createKeywordTypeNode(131)):void(n.encounteredError=!0);if(536870912&n.flags||(t=sl(t)),1&t.flags)return t.aliasSymbol?e.factory.createTypeReferenceNode(k(t.aliasSymbol),f(t.aliasTypeArguments,n)):t===Je?e.addSyntheticLeadingComment(e.factory.createKeywordTypeNode(131),3,"unresolved"):(n.approximateLength+=3,e.factory.createKeywordTypeNode(t===Ue?139:131));if(2&t.flags)return e.factory.createKeywordTypeNode(157);if(4&t.flags)return n.approximateLength+=6,e.factory.createKeywordTypeNode(152);if(8&t.flags)return n.approximateLength+=6,e.factory.createKeywordTypeNode(148);if(64&t.flags)return n.approximateLength+=6,e.factory.createKeywordTypeNode(160);if(16&t.flags&&!t.aliasSymbol)return n.approximateLength+=7,e.factory.createKeywordTypeNode(134);if(1024&t.flags&&!(1048576&t.flags)){var a=Sa(t.symbol),o=N(a,n,788968);if(Js(a)===t)return o;var c=e.symbolName(t.symbol);return e.isIdentifierText(c,0)?W(o,e.factory.createTypeReferenceNode(c,void 0)):e.isImportTypeNode(o)?(o.isTypeOf=!0,e.factory.createIndexedAccessTypeNode(o,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c)))):e.isTypeReferenceNode(o)?e.factory.createIndexedAccessTypeNode(e.factory.createTypeQueryNode(o.typeName),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c))):e.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}if(1056&t.flags)return N(t.symbol,n,788968);if(128&t.flags)return n.approximateLength+=t.value.length+2,e.factory.createLiteralTypeNode(e.setEmitFlags(e.factory.createStringLiteral(t.value,!!(268435456&n.flags)),16777216));if(256&t.flags){var d=t.value;return n.approximateLength+=(""+d).length,e.factory.createLiteralTypeNode(d<0?e.factory.createPrefixUnaryExpression(40,e.factory.createNumericLiteral(-d)):e.factory.createNumericLiteral(d))}if(2048&t.flags)return n.approximateLength+=e.pseudoBigIntToString(t.value).length+1,e.factory.createLiteralTypeNode(e.factory.createBigIntLiteral(t.value));if(512&t.flags)return n.approximateLength+=t.intrinsicName.length,e.factory.createLiteralTypeNode("true"===t.intrinsicName?e.factory.createTrue():e.factory.createFalse());if(8192&t.flags){if(!(1048576&n.flags)){if(Wa(t.symbol,n.enclosingDeclaration))return n.approximateLength+=6,N(t.symbol,n,111551);n.tracker.reportInaccessibleUniqueSymbolError&&n.tracker.reportInaccessibleUniqueSymbolError();}return n.approximateLength+=13,e.factory.createTypeOperatorNode(156,e.factory.createKeywordTypeNode(153))}if(16384&t.flags)return n.approximateLength+=4,e.factory.createKeywordTypeNode(114);if(32768&t.flags)return n.approximateLength+=9,e.factory.createKeywordTypeNode(155);if(65536&t.flags)return n.approximateLength+=4,e.factory.createLiteralTypeNode(e.factory.createNull());if(131072&t.flags)return n.approximateLength+=5,e.factory.createKeywordTypeNode(144);if(4096&t.flags)return n.approximateLength+=6,e.factory.createKeywordTypeNode(153);if(67108864&t.flags)return n.approximateLength+=6,e.factory.createKeywordTypeNode(149);if(e.isThisTypeParameter(t))return 4194304&n.flags&&(n.encounteredError||32768&n.flags||(n.encounteredError=!0),n.tracker.reportInaccessibleThisError&&n.tracker.reportInaccessibleThisError()),n.approximateLength+=4,e.factory.createThisTypeNode();if(!i&&t.aliasSymbol&&(16384&n.flags||qa(t.aliasSymbol,n.enclosingDeclaration))){var v=f(t.aliasTypeArguments,n);return !La(t.aliasSymbol.escapedName)||32&t.aliasSymbol.flags?1===e.length(v)&&t.aliasSymbol===Qt.symbol?e.factory.createArrayTypeNode(v[0]):N(t.aliasSymbol,n,788968,v):e.factory.createTypeReferenceNode(e.factory.createIdentifier(""),v)}var h=e.getObjectFlags(t);if(4&h)return e.Debug.assert(!!(524288&t.flags)),t.node?K(t,q):q(t);if(262144&t.flags||3&h){if(262144&t.flags&&e.contains(n.inferTypeParameters,t)){n.approximateLength+=e.symbolName(t.symbol).length+6;var b=void 0,x=Kc(t);if(x){var D=au(t,!0);D&&Np(x,D)||(n.approximateLength+=9,b=x&&l(x,n));}return e.factory.createInferTypeNode(y(t,n,b))}if(4&n.flags&&262144&t.flags&&!qa(t.symbol,n.enclosingDeclaration)){var S=F(t,n);return n.approximateLength+=e.idText(S).length,e.factory.createTypeReferenceNode(e.factory.createIdentifier(e.idText(S)),void 0)}if(t.symbol)return N(t.symbol,n,788968);var T=(t===jt||t===Jt)&&_&&_.symbol?(t===Jt?"sub-":"super-")+e.symbolName(_.symbol):"?";return e.factory.createTypeReferenceNode(e.factory.createIdentifier(T),void 0)}if(1048576&t.flags&&t.origin&&(t=t.origin),3145728&t.flags){var C=1048576&t.flags?function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e[n];if(r|=i.flags,!(98304&i.flags)){if(1536&i.flags){var a=512&i.flags?at:Ls(i);if(1048576&a.flags){var o=a.types.length;if(n+o<=e.length&&Rd(e[n+o-1])===Rd(a.types[o-1])){t.push(a),n+=o-1;continue}}}t.push(i);}}return 65536&r&&t.push(Qe),32768&r&&t.push(qe),t||e}(t.types):t.types;if(1===e.length(C))return l(C[0],n);var E=f(C,n,!0);return E&&E.length>0?1048576&t.flags?e.factory.createUnionTypeNode(E):e.factory.createIntersectionTypeNode(E):void(n.encounteredError||262144&n.flags||(n.encounteredError=!0))}if(48&h)return e.Debug.assert(!!(524288&t.flags)),U(t);if(4194304&t.flags){var A=t.type;n.approximateLength+=6;var P=l(A,n);return e.factory.createTypeOperatorNode(141,P)}if(134217728&t.flags){var w=t.texts,M=t.types,L=e.factory.createTemplateHead(w[0]),R=e.factory.createNodeArray(e.map(M,(function(t,r){return e.factory.createTemplateLiteralTypeSpan(l(t,n),(r<M.length-1?e.factory.createTemplateMiddle:e.factory.createTemplateTail)(w[r+1]))})));return n.approximateLength+=2,e.factory.createTemplateLiteralType(L,R)}if(268435456&t.flags){var B=l(t.type,n);return N(t.symbol,n,788968,[B])}if(8388608&t.flags){var j=l(t.objectType,n);return P=l(t.indexType,n),n.approximateLength+=2,e.factory.createIndexedAccessTypeNode(j,P)}return 16777216&t.flags?K(t,(function(t){return function(t){var r=l(t.checkType,n);if(n.approximateLength+=15,4&n.flags&&t.root.isDistributive&&!(262144&t.checkType.flags)){var i=Ma(ri(262144,"T")),a=F(i,n),o=e.factory.createTypeReferenceNode(a);n.approximateLength+=37;var s=sp(t.root.checkType,i,t.mapper),c=n.inferTypeParameters;n.inferTypeParameters=t.root.inferTypeParameters;var u=l(hp(t.root.extendsType,s),n);n.inferTypeParameters=c;var _=J(hp(Hd(t.root.node.trueType),s)),d=J(hp(Hd(t.root.node.falseType),s));return e.factory.createConditionalTypeNode(r,e.factory.createInferTypeNode(e.factory.createTypeParameterDeclaration(void 0,e.factory.cloneNode(o.typeName))),e.factory.createConditionalTypeNode(e.factory.createTypeReferenceNode(e.factory.cloneNode(a)),l(t.checkType,n),e.factory.createConditionalTypeNode(o,u,_,d),e.factory.createKeywordTypeNode(144)),e.factory.createKeywordTypeNode(144))}var p=n.inferTypeParameters;n.inferTypeParameters=t.root.inferTypeParameters;var f=l(t.extendsType,n);n.inferTypeParameters=p;var g=J(bd(t)),m=J(xd(t));return e.factory.createConditionalTypeNode(r,f,g,m)}(t)})):33554432&t.flags?l(t.baseType,n):e.Debug.fail("Should be unreachable.");function J(e){var t,r,i;return 1048576&e.flags?(null===(t=n.visitedTypes)||void 0===t?void 0:t.has(p_(e)))?(131072&n.flags||(n.encounteredError=!0,null===(i=null===(r=n.tracker)||void 0===r?void 0:r.reportCyclicStructureError)||void 0===i||i.call(r)),u(n)):K(e,(function(e){return l(e,n)})):l(e,n)}function z(e){return Pc(e)&&!(262144&wc(e).flags)}function U(t){var r,i=t.id,a=t.symbol;if(a){var o=lo(t)?788968:111551;if(bb(a.valueDeclaration))return N(a,n,o);if(32&a.flags&&!os(a)&&(!(a.valueDeclaration&&e.isClassLike(a.valueDeclaration)&&2048&n.flags)||e.isClassDeclaration(a.valueDeclaration)&&0===Qa(a,n.enclosingDeclaration,o,!1).accessibility)||896&a.flags||function(){var t,r=!!(8192&a.flags)&&e.some(a.declarations,(function(t){return e.isStatic(t)})),o=!!(16&a.flags)&&(a.parent||e.forEach(a.declarations,(function(e){return 308===e.parent.kind||265===e.parent.kind})));if(r||o)return (!!(4096&n.flags)||(null===(t=n.visitedTypes)||void 0===t?void 0:t.has(i)))&&(!(8&n.flags)||Wa(a,n.enclosingDeclaration))}())return N(a,n,o);if(null===(r=n.visitedTypes)||void 0===r?void 0:r.has(i)){var s=function(t){if(t.symbol&&2048&t.symbol.flags&&t.symbol.declarations){var r=e.walkUpParenthesizedTypes(t.symbol.declarations[0].parent);if(262===r.kind)return Da(r)}}(t);return s?N(s,n,788968):u(n)}return K(t,V)}return V(t)}function K(t,r){var i,a,o=t.id,s=16&e.getObjectFlags(t)&&t.symbol&&32&t.symbol.flags,c=4&e.getObjectFlags(t)&&t.node?"N"+I(t.node):16777216&t.flags?"N"+I(t.root.node):t.symbol?(s?"+":"")+O(t.symbol):void 0;n.visitedTypes||(n.visitedTypes=new e.Set),c&&!n.symbolDepth&&(n.symbolDepth=new e.Map);var l=n.enclosingDeclaration&&di(n.enclosingDeclaration),_="".concat(p_(t),"|").concat(n.flags);l&&(l.serializedTypes||(l.serializedTypes=new e.Map));var d,p=null===(i=null==l?void 0:l.serializedTypes)||void 0===i?void 0:i.get(_);if(p)return p.truncating&&(n.truncating=!0),n.approximateLength+=p.addedLength,function t(r){return e.nodeIsSynthesized(r)||e.getParseTreeNode(r)!==r?e.setTextRange(e.factory.cloneNode(e.visitEachChild(r,t,e.nullTransformationContext,y)),r):r}(p);if(c){if((d=n.symbolDepth.get(c)||0)>10)return u(n);n.symbolDepth.set(c,d+1);}n.visitedTypes.add(o);var f=n.approximateLength,g=r(t),m=n.approximateLength-f;return n.reportedDiagnostic||n.encounteredError||(n.truncating&&(g.truncating=!0),g.addedLength=m,null===(a=null==l?void 0:l.serializedTypes)||void 0===a||a.set(_,g)),n.visitedTypes.delete(o),c&&n.symbolDepth.set(c,d),g;function y(t,r,n,i,a){return t&&0===t.length?e.setTextRange(e.factory.createNodeArray(void 0,t.hasTrailingComma),t):e.visitNodes(t,r,n,i,a)}}function V(t){if(Lc(t)||t.containsError)return function(t){e.Debug.assert(!!(524288&t.flags));var r,i,a=t.declaration.readonlyToken?e.factory.createToken(t.declaration.readonlyToken.kind):void 0,o=t.declaration.questionToken?e.factory.createToken(t.declaration.questionToken.kind):void 0;if(Pc(t)){if(z(t)&&4&n.flags){var s=F(Ma(ri(262144,"T")),n);i=e.factory.createTypeReferenceNode(s);}r=e.factory.createTypeOperatorNode(141,i||l(wc(t),n));}else r=l(kc(t),n);var c=y(Ec(t),n,r),u=t.declaration.nameType?l(Nc(t),n):void 0,_=l(fg(Ac(t),!!(4&Ic(t))),n),d=e.factory.createMappedTypeNode(a,c,u,o,_,void 0);n.approximateLength+=10;var p=e.setEmitFlags(d,1);if(z(t)&&4&n.flags){var f=hp(Kc(Hd(t.declaration.typeParameter.constraint.type))||Ke,t.mapper);return e.factory.createConditionalTypeNode(l(wc(t),n),e.factory.createInferTypeNode(e.factory.createTypeParameterDeclaration(void 0,e.factory.cloneNode(i.typeName),2&f.flags?void 0:l(f,n))),p,e.factory.createKeywordTypeNode(144))}return p}(t);var r=Rc(t);if(!r.properties.length&&!r.indexInfos.length){if(!r.callSignatures.length&&!r.constructSignatures.length)return n.approximateLength+=2,e.setEmitFlags(e.factory.createTypeLiteralNode(void 0),1);if(1===r.callSignatures.length&&!r.constructSignatures.length)return m(r.callSignatures[0],181,n);if(1===r.constructSignatures.length&&!r.callSignatures.length)return m(r.constructSignatures[0],182,n)}var i=e.filter(r.constructSignatures,(function(e){return !!(4&e.flags)}));if(e.some(i)){var a=e.map(i,Yl);return r.callSignatures.length+(r.constructSignatures.length-i.length)+r.indexInfos.length+(2048&n.flags?e.countWhere(r.properties,(function(e){return !(4194304&e.flags)})):e.length(r.properties))&&a.push(function(t){if(0===t.constructSignatures.length)return t;if(t.objectTypeWithoutAbstractConstructSignatures)return t.objectTypeWithoutAbstractConstructSignatures;var r=e.filter(t.constructSignatures,(function(e){return !(4&e.flags)}));if(t.constructSignatures===r)return t;var n=Ja(t.symbol,t.members,t.callSignatures,e.some(r)?r:e.emptyArray,t.indexInfos);return t.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(r)),l(N_(a),n)}var o=n.flags;n.flags|=4194304;var c=function(t){if(s(n))return [e.factory.createPropertySignature(void 0,"...",void 0,void 0)];for(var r=[],i=0,a=t.callSignatures;i<a.length;i++){var o=a[i];r.push(m(o,176,n));}for(var c=0,l=t.constructSignatures;c<l.length;c++)4&(o=l[c]).flags||r.push(m(o,177,n));for(var _=0,d=t.indexInfos;_<d.length;_++){var f=d[_];r.push(g(f,n,1024&t.objectFlags?u(n):void 0));}var y=t.properties;if(!y)return r;for(var v=0,h=0,b=y;h<b.length;h++){var x=b[h];if(v++,2048&n.flags){if(4194304&x.flags)continue;24&e.getDeclarationModifierFlagsFromSymbol(x)&&n.tracker.reportPrivateInBaseOfClassExpression&&n.tracker.reportPrivateInBaseOfClassExpression(e.unescapeLeadingUnderscores(x.escapedName));}if(s(n)&&v+2<y.length-1){r.push(e.factory.createPropertySignature(void 0,"... ".concat(y.length-v," more ..."),void 0,void 0)),p(y[y.length-1],n,r);break}p(x,n,r);}return r.length?r:void 0}(r);n.flags=o;var _=e.factory.createTypeLiteralNode(c);return n.approximateLength+=2,e.setEmitFlags(_,1024&n.flags?0:1),_}function q(t){var r=fu(t);if(t.target===Qt||t.target===Xt){if(2&n.flags){var i=l(r[0],n);return e.factory.createTypeReferenceNode(t.target===Qt?"Array":"ReadonlyArray",[i])}var a=l(r[0],n),o=e.factory.createArrayTypeNode(a);return t.target===Qt?o:e.factory.createTypeOperatorNode(146,o)}if(!(8&t.target.objectFlags)){if(2048&n.flags&&t.symbol.valueDeclaration&&e.isClassLike(t.symbol.valueDeclaration)&&!Wa(t.symbol,n.enclosingDeclaration))return U(t);var s=t.target.outerTypeParameters,c=void(D=0);if(s)for(var u=s.length;D<u;){var _=D,d=su(s[D]);do{D++;}while(D<u&&su(s[D])===d);if(!e.rangeEquals(s,r,_,D)){var p=f(r.slice(_,D),n),g=n.flags;n.flags|=16;var m=N(d,n,788968,p);n.flags=g,c=c?W(c,m):m;}}var y=void 0;if(r.length>0){var v=(t.target.typeParameters||e.emptyArray).length;y=f(r.slice(D,v),n);}S=n.flags,n.flags|=16;var h=N(t.symbol,n,788968,y);return n.flags=S,c?W(c,h):h}if(r=e.sameMap(r,(function(e,r){return fg(e,!!(2&t.target.elementFlags[r]))})),r.length>0){var b=gu(t),x=f(r.slice(0,b),n);if(x){if(t.target.labeledElementDeclarations)for(var D=0;D<x.length;D++){var S=t.target.elementFlags[D];x[D]=e.factory.createNamedTupleMember(12&S?e.factory.createToken(25):void 0,e.factory.createIdentifier(e.unescapeLeadingUnderscores(Lb(t.target.labeledElementDeclarations[D]))),2&S?e.factory.createToken(57):void 0,4&S?e.factory.createArrayTypeNode(x[D]):x[D]);}else for(D=0;D<Math.min(b,x.length);D++){S=t.target.elementFlags[D];x[D]=12&S?e.factory.createRestTypeNode(4&S?e.factory.createArrayTypeNode(x[D]):x[D]):2&S?e.factory.createOptionalTypeNode(x[D]):x[D];}var T=e.setEmitFlags(e.factory.createTupleTypeNode(x),1);return t.target.readonly?e.factory.createTypeOperatorNode(146,T):T}}if(n.encounteredError||524288&n.flags)return T=e.setEmitFlags(e.factory.createTupleTypeNode([]),1),t.target.readonly?e.factory.createTypeOperatorNode(146,T):T;n.encounteredError=!0;}function W(t,r){if(e.isImportTypeNode(t)){var n=t.typeArguments,i=t.qualifier;i&&(i=e.isIdentifier(i)?e.factory.updateIdentifier(i,n):e.factory.updateQualifiedName(i,i.left,e.factory.updateIdentifier(i.right,n))),n=r.typeArguments;for(var a=0,o=H(r);a<o.length;a++){var s=o[a];i=i?e.factory.createQualifiedName(i,s):s;}return e.factory.updateImportTypeNode(t,t.argument,t.assertions,i,n,t.isTypeOf)}n=t.typeArguments;var c=t.typeName;c=e.isIdentifier(c)?e.factory.updateIdentifier(c,n):e.factory.updateQualifiedName(c,c.left,e.factory.updateIdentifier(c.right,n)),n=r.typeArguments;for(var l=0,u=H(r);l<u.length;l++)s=u[l],c=e.factory.createQualifiedName(c,s);return e.factory.updateTypeReferenceNode(t,c,n)}function H(t){for(var r=t.typeName,n=[];!e.isIdentifier(r);)n.unshift(r.right),r=r.left;return n.unshift(r),n}}(t,n);return n.flags=i,a}function u(t){return t.approximateLength+=3,1&t.flags?e.factory.createKeywordTypeNode(131):e.factory.createTypeReferenceNode(e.factory.createIdentifier("..."),void 0)}function d(t,r){var n;return !!(8192&e.getCheckFlags(t))&&(e.contains(r.reverseMappedStack,t)||(null===(n=r.reverseMappedStack)||void 0===n?void 0:n[0])&&!(16&e.getObjectFlags(e.last(r.reverseMappedStack).propertyType)))}function p(t,r,n){var i,a,o=!!(8192&e.getCheckFlags(t)),s=d(t,r)?Le:ps(t),c=r.enclosingDeclaration;if(r.enclosingDeclaration=void 0,r.tracker.trackSymbol&&Zs(t.escapedName))if(t.declarations){var l=e.first(t.declarations);if($s(l))if(e.isBinaryExpression(l)){var _=e.getNameOfDeclaration(l);_&&e.isElementAccessExpression(_)&&e.isPropertyAccessEntityNameExpression(_.argumentExpression)&&b(_.argumentExpression,c,r);}else b(l.name.expression,c,r);}else (null===(i=r.tracker)||void 0===i?void 0:i.reportNonSerializableProperty)&&r.tracker.reportNonSerializableProperty(ro(t));r.enclosingDeclaration=t.valueDeclaration||(null===(a=t.declarations)||void 0===a?void 0:a[0])||c;var p=R(t,r);r.enclosingDeclaration=c,r.approximateLength+=e.symbolName(t).length+1;var f=16777216&t.flags?e.factory.createToken(57):void 0;if(8208&t.flags&&!Bc(s).length&&!px(t))for(var g=0,y=fl(Zm(s,(function(e){return !(32768&e.flags)})),0);g<y.length;g++){var v=m(y[g],170,r,{name:p,questionToken:f});n.push(S(v));}else {var h=void 0;d(t,r)?h=u(r):(o&&(r.reverseMappedStack||(r.reverseMappedStack=[]),r.reverseMappedStack.push(t)),h=s?J(r,s,t,c):e.factory.createKeywordTypeNode(131),o&&r.reverseMappedStack.pop());var x=px(t)?[e.factory.createToken(146)]:void 0;x&&(r.approximateLength+=9);var D=e.factory.createPropertySignature(x,p,f,h);n.push(S(D));}function S(r){var n;if(e.some(t.declarations,(function(e){return 350===e.kind}))){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(e){return 350===e.kind})),a=e.getTextOfJSDocComment(i.comment);a&&e.setSyntheticLeadingComments(r,[{kind:3,text:"*\n * "+a.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]);}else t.valueDeclaration&&e.setCommentRange(r,t.valueDeclaration);return r}}function f(t,r,n){if(e.some(t)){if(s(r)){if(!n)return [e.factory.createTypeReferenceNode("...",void 0)];if(t.length>2)return [l(t[0],r),e.factory.createTypeReferenceNode("... ".concat(t.length-2," more ..."),void 0),l(t[t.length-1],r)]}for(var i=64&r.flags?void 0:e.createUnderscoreEscapedMultiMap(),a=[],o=0,c=0,u=t;c<u.length;c++){var _=u[c];if(o++,s(r)&&o+2<t.length-1){a.push(e.factory.createTypeReferenceNode("... ".concat(t.length-o," more ..."),void 0));var d=l(t[t.length-1],r);d&&a.push(d);break}r.approximateLength+=2;var p=l(_,r);p&&(a.push(p),i&&e.isIdentifierTypeReference(p)&&i.add(p.typeName.escapedText,[_,a.length-1]));}if(i){var f=r.flags;r.flags|=64,i.forEach((function(t){if(!e.arrayIsHomogeneous(t,(function(e,t){return r=e[0],n=t[0],r===n||!!r.symbol&&r.symbol===n.symbol||!!r.aliasSymbol&&r.aliasSymbol===n.aliasSymbol;var r,n;})))for(var n=0,i=t;n<i.length;n++){var o=i[n],s=o[0],c=o[1];a[c]=l(s,r);}})),r.flags=f;}return a}}function g(t,r,n){var i=e.getNameFromIndexInfo(t)||"x",a=l(t.keyType,r),o=e.factory.createParameterDeclaration(void 0,void 0,i,void 0,a,void 0);return n||(n=l(t.type||Le,r)),t.type||2097152&r.flags||(r.encounteredError=!0),r.approximateLength+=i.length+4,e.factory.createIndexSignature(t.isReadonly?[e.factory.createToken(146)]:void 0,[o],n)}function m(t,r,n,i){var a,o,s,c,u,_,d=256&n.flags;d&&(n.flags&=-257),n.approximateLength+=3,32&n.flags&&t.target&&t.mapper&&t.target.typeParameters?_=t.target.typeParameters.map((function(e){return l(hp(e,t.mapper),n)})):u=t.typeParameters&&t.typeParameters.map((function(e){return v(e,n)}));var p,f=dc(t,!0)[0],g=(e.some(f,(function(t){return t!==f[f.length-1]&&!!(32768&e.getCheckFlags(t))}))?t.parameters:f).map((function(e){return h(e,n,173===r,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports)})),m=33554432&n.flags?void 0:function(t,r){if(t.thisParameter)return h(t.thisParameter,r);if(t.declaration){var n=e.getJSDocThisTag(t.declaration);if(n&&n.typeExpression)return e.factory.createParameterDeclaration(void 0,void 0,"this",void 0,l(Hd(n.typeExpression),r))}}(t,n);m&&g.unshift(m);var y=Jl(t);if(y){var b=2===y.kind||3===y.kind?e.factory.createToken(129):void 0,x=1===y.kind||3===y.kind?e.setEmitFlags(e.factory.createIdentifier(y.parameterName),16777216):e.factory.createThisTypeNode(),D=y.type&&l(y.type,n);p=e.factory.createTypePredicateNode(b,x,D);}else {var S=Ul(t);!S||d&&Co(S)?d||(p=e.factory.createKeywordTypeNode(131)):p=function(t,r,n,i,a){if(!Eo(r)&&t.enclosingDeclaration){var o=n.declaration&&e.getEffectiveReturnTypeNode(n.declaration);if(e.findAncestor(o,(function(e){return e===t.enclosingDeclaration}))&&o){var s=Hd(o);if((262144&s.flags&&s.isThisType?hp(s,n.mapper):s)===r&&j(o,r)){var c=U(t,o,i,a);if(c)return c}}}return l(r,t)}(n,S,t,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports);}var T=null==i?void 0:i.modifiers;if(182===r&&4&t.flags){var C=e.modifiersToFlags(T);T=e.factory.createModifiersFromModifierFlags(256|C);}var E=176===r?e.factory.createCallSignature(u,g,p):177===r?e.factory.createConstructSignature(u,g,p):170===r?e.factory.createMethodSignature(T,null!==(a=null==i?void 0:i.name)&&void 0!==a?a:e.factory.createIdentifier(""),null==i?void 0:i.questionToken,u,g,p):171===r?e.factory.createMethodDeclaration(T,void 0,null!==(o=null==i?void 0:i.name)&&void 0!==o?o:e.factory.createIdentifier(""),void 0,u,g,p,void 0):173===r?e.factory.createConstructorDeclaration(T,g,void 0):174===r?e.factory.createGetAccessorDeclaration(T,null!==(s=null==i?void 0:i.name)&&void 0!==s?s:e.factory.createIdentifier(""),g,p,void 0):175===r?e.factory.createSetAccessorDeclaration(T,null!==(c=null==i?void 0:i.name)&&void 0!==c?c:e.factory.createIdentifier(""),g,void 0):178===r?e.factory.createIndexSignature(T,g,p):320===r?e.factory.createJSDocFunctionType(g,p):181===r?e.factory.createFunctionTypeNode(u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):182===r?e.factory.createConstructorTypeNode(T,u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):259===r?e.factory.createFunctionDeclaration(T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,void 0):215===r?e.factory.createFunctionExpression(T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,e.factory.createBlock([])):216===r?e.factory.createArrowFunction(T,u,g,p,void 0,e.factory.createBlock([])):e.Debug.assertNever(r);return _&&(E.typeArguments=e.factory.createNodeArray(_)),E}function y(t,r,n){var i=r.flags;r.flags&=-513;var a=e.factory.createModifiersFromModifierFlags(hf(t)),o=F(t,r),s=$c(t),c=s&&l(s,r);return r.flags=i,e.factory.createTypeParameterDeclaration(a,o,n,c)}function v(e,t,r){return void 0===r&&(r=Kc(e)),y(e,t,r&&l(r,t))}function h(t,r,n,i,a){var o=e.getDeclarationOfKind(t,166);o||e.isTransientSymbol(t)||(o=e.getDeclarationOfKind(t,343));var s=ds(t);o&&tC(o)&&(s=cg(s));var c=J(r,s,t,r.enclosingDeclaration,i,a),l=!(8192&r.flags)&&n&&o&&e.canHaveModifiers(o)?e.map(e.getModifiers(o),e.factory.cloneNode):void 0,u=o&&e.isRestParameter(o)||32768&e.getCheckFlags(t)?e.factory.createToken(25):void 0,_=o&&o.name?79===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name),16777216):163===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name.right),16777216):function t(n){r.tracker.trackSymbol&&e.isComputedPropertyName(n)&&Ys(n)&&b(n.expression,r.enclosingDeclaration,r);var i=e.visitEachChild(n,t,e.nullTransformationContext,void 0,t);return e.isBindingElement(i)&&(i=e.factory.updateBindingElement(i,i.dotDotDotToken,i.propertyName,i.name,void 0)),e.nodeIsSynthesized(i)||(i=e.factory.cloneNode(i)),e.setEmitFlags(i,16777217)}(o.name):e.symbolName(t),d=o&&Al(o)||16384&e.getCheckFlags(t)?e.factory.createToken(57):void 0,p=e.factory.createParameterDeclaration(l,u,_,d,c,void 0);return r.approximateLength+=e.symbolName(t).length+3,p}function b(t,r,n){if(n.tracker.trackSymbol){var i=e.getFirstIdentifier(t),a=vi(i,i.escapedText,1160127,void 0,void 0,!0);a&&n.tracker.trackSymbol(a,r,111551);}}function x(e,t,r,n){return t.tracker.trackSymbol(e,t.enclosingDeclaration,r),D(e,t,r,n)}function D(t,r,n,i){var a;return 262144&t.flags||!(r.enclosingDeclaration||64&r.flags)||134217728&r.flags?a=[t]:(a=e.Debug.checkDefined(function t(n,a,o){var s,c=Ka(n,r.enclosingDeclaration,a,!!(128&r.flags));if(!c||Va(c[0],r.enclosingDeclaration,1===c.length?a:Ua(a))){var l=Ta(c?c[0]:n,r.enclosingDeclaration,a);if(e.length(l)){s=l.map((function(t){return e.some(t.declarations,$a)?E(t,r):void 0}));var u=l.map((function(e,t){return t}));u.sort((function(t,r){var n=s[t],i=s[r];if(n&&i){var a=e.pathIsRelative(i);return e.pathIsRelative(n)===a?e.moduleSpecifiers.countPathComponents(n)-e.moduleSpecifiers.countPathComponents(i):a?-1:1}return 0}));for(var _=0,d=u.map((function(e){return l[e]}));_<d.length;_++){var p=d[_],f=t(p,Ua(a),!1);if(f){if(p.exports&&p.exports.get("export=")&&ka(p.exports.get("export="),n)){c=f;break}c=f.concat(c||[Ea(p,n)||n]);break}}}}if(c)return c;if(o||!(6144&n.flags)){if(!o&&!i&&e.forEach(n.declarations,$a))return;return [n]}}(t,n,!0)),e.Debug.assert(a&&a.length>0)),a}function S(t,r){var n;return 524384&YS(t).flags&&(n=e.factory.createNodeArray(e.map(bs(t),(function(e){return v(e,r)})))),n}function T(t,r,n){var i;e.Debug.assert(t&&0<=r&&r<t.length);var a=t[r],o=O(a);if(!(null===(i=n.typeParameterSymbolList)||void 0===i?void 0:i.has(o))){var s;if((n.typeParameterSymbolList||(n.typeParameterSymbolList=new e.Set)).add(o),512&n.flags&&r<t.length-1){var c=a,l=t[r+1];if(1&e.getCheckFlags(l)){var u=function(t){return e.concatenate(hs(t),bs(t))}(2097152&c.flags?Qi(c):c);s=f(e.map(u,(function(e){return ep(e,l.mapper)})),n);}else s=S(a,n);}return s}}function C(t){return e.isIndexedAccessTypeNode(t.objectType)?C(t.objectType):t}function E(t,r,n){var a,o=e.getDeclarationOfKind(t,308);if(!o){var s=e.firstDefined(t.declarations,(function(e){return Ca(e,t)}));s&&(o=e.getDeclarationOfKind(s,308));}if(o&&void 0!==o.moduleName)return o.moduleName;if(!o){if(r.tracker.trackReferencedAmbientModule){var l=e.filter(t.declarations,e.isAmbientModule);if(e.length(l))for(var u=0,_=l;u<_.length;u++){var d=_[u];r.tracker.trackReferencedAmbientModule(d,t);}}if(c.test(t.escapedName))return t.escapedName.substring(1,t.escapedName.length-1)}if(!r.enclosingDeclaration||!r.tracker.moduleResolverHost)return c.test(t.escapedName)?t.escapedName.substring(1,t.escapedName.length-1):e.getSourceFileOfNode(e.getNonAugmentationDeclaration(t)).fileName;var p,f,g=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),m=n||(null==g?void 0:g.impliedNodeFormat),y=(p=g.path,void 0===(f=m)?p:"".concat(f,"|").concat(p)),v=_i(t),h=v.specifierCache&&v.specifierCache.get(y);if(!h){var b=!!e.outFile(K),x=r.tracker.moduleResolverHost,D=b?i$1(i$1({},K),{baseUrl:x.getCommonSourceDirectory()}):K;h=e.first(e.moduleSpecifiers.getModuleSpecifiers(t,pe,D,g,x,{importModuleSpecifierPreference:b?"non-relative":"project-relative",importModuleSpecifierEnding:b?"minimal":m===e.ModuleKind.ESNext?"js":void 0},{overrideImportMode:n})),null!==(a=v.specifierCache)&&void 0!==a||(v.specifierCache=new e.Map),v.specifierCache.set(y,h);}return h}function k(t){var r=e.factory.createIdentifier(e.unescapeLeadingUnderscores(t.escapedName));return t.parent?e.factory.createQualifiedName(k(t.parent),r):r}function N(t,r,n,i){var a,o,s,c,l=x(t,r,n,!(16384&r.flags)),u=111551===n;if(e.some(l[0].declarations,$a)){var _=l.length>1?A(l,l.length-1,1):void 0,d=i||T(l,0,r),p=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),f=e.getSourceFileOfModule(l[0]),g=void 0,m=void 0;if(e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.NodeNext||(null==f?void 0:f.impliedNodeFormat)===e.ModuleKind.ESNext&&f.impliedNodeFormat!==(null==p?void 0:p.impliedNodeFormat)&&(g=E(l[0],r,e.ModuleKind.ESNext),m=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral("import"))]))),null===(o=(a=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===o||o.call(a)),g||(g=E(l[0],r)),!(67108864&r.flags)&&e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.Classic&&g.indexOf("/node_modules/")>=0){var y=g;if(e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.NodeNext){var v=(null==p?void 0:p.impliedNodeFormat)===e.ModuleKind.ESNext?e.ModuleKind.CommonJS:e.ModuleKind.ESNext;(g=E(l[0],r,v)).indexOf("/node_modules/")>=0?g=y:(m=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral(v===e.ModuleKind.ESNext?"import":"require"))]))),null===(c=(s=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===c||c.call(s));}m||(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(y));}var h=e.factory.createLiteralTypeNode(e.factory.createStringLiteral(g));if(r.tracker.trackExternalModuleSymbolOfImportTypeNode&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l[0]),r.approximateLength+=g.length+10,!_||e.isEntityName(_))return _&&((k=e.isIdentifier(_)?_:_.right).typeArguments=void 0),e.factory.createImportTypeNode(h,m,_,d,u);var b=C(_),D=b.objectType.typeName;return e.factory.createIndexedAccessTypeNode(e.factory.createImportTypeNode(h,m,D,d,u),b.indexType)}var S=A(l,l.length-1,0);if(e.isIndexedAccessTypeNode(S))return S;if(u)return e.factory.createTypeQueryNode(S);var k,N=(k=e.isIdentifier(S)?S:S.right).typeArguments;return k.typeArguments=void 0,e.factory.createTypeReferenceNode(S,N);function A(t,n,a){var o,s=n===t.length-1?i:T(t,n,r),c=t[n],l=t[n-1];if(0===n)r.flags|=16777216,o=mo(c,r),r.approximateLength+=(o?o.length:0)+1,r.flags^=16777216;else if(l&&ya(l)){var u=ya(l);e.forEachEntry(u,(function(t,r){if(ka(t,c)&&!Zs(r)&&"export="!==r)return o=e.unescapeLeadingUnderscores(r),!0}));}if(void 0===o){var _=e.firstDefined(c.declarations,e.getNameOfDeclaration);if(_&&e.isComputedPropertyName(_)&&e.isEntityName(_.expression)){var d=A(t,n-1,a);return e.isEntityName(d)?e.factory.createIndexedAccessTypeNode(e.factory.createParenthesizedType(e.factory.createTypeQueryNode(d)),e.factory.createTypeQueryNode(_.expression)):d}o=mo(c,r);}if(r.approximateLength+=o.length+1,!(16&r.flags)&&l&&ic(l)&&ic(l).get(c.escapedName)&&ka(ic(l).get(c.escapedName),c))return d=A(t,n-1,a),e.isIndexedAccessTypeNode(d)?e.factory.createIndexedAccessTypeNode(d,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o))):e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(d,s),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o)));var p=e.setEmitFlags(e.factory.createIdentifier(o,s),16777216);return p.symbol=c,n>a?(d=A(t,n-1,a),e.isEntityName(d)?e.factory.createQualifiedName(d,p):e.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable")):p}}function A(e,t,r){var n=vi(t.enclosingDeclaration,e,788968,void 0,e,!1);return !(!n||262144&n.flags&&n===r.symbol)}function F(t,r){var n,i;if(4&r.flags&&r.typeParameterNames){var a=r.typeParameterNames.get(p_(t));if(a)return a}var o=P(t.symbol,r,788968,!0);if(!(79&o.kind))return e.factory.createIdentifier("(Missing type parameter)");if(4&r.flags){for(var s=o.escapedText,c=(null===(n=r.typeParameterNamesByTextNextNameCount)||void 0===n?void 0:n.get(s))||0,l=s;(null===(i=r.typeParameterNamesByText)||void 0===i?void 0:i.has(l))||A(l,r,t);)c++,l="".concat(s,"_").concat(c);l!==s&&(o=e.factory.createIdentifier(l,o.typeArguments)),(r.typeParameterNamesByTextNextNameCount||(r.typeParameterNamesByTextNextNameCount=new e.Map)).set(s,c),(r.typeParameterNames||(r.typeParameterNames=new e.Map)).set(p_(t),o),(r.typeParameterNamesByText||(r.typeParameterNamesByText=new e.Set)).add(s);}return o}function P(t,r,n,i){var a=x(t,r,n);return !i||1===a.length||r.encounteredError||65536&r.flags||(r.encounteredError=!0),function t(n,i){var a=T(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=mo(o,r);0===i&&(r.flags^=16777216);var c=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return c.symbol=o,i>0?e.factory.createQualifiedName(t(n,i-1),c):c}(a,a.length-1)}function w(t,r,n){var i=x(t,r,n);return function t(n,i){var a=T(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=mo(o,r);0===i&&(r.flags^=16777216);var c=s.charCodeAt(0);if(e.isSingleOrDoubleQuote(c)&&e.some(o.declarations,$a))return e.factory.createStringLiteral(E(o,r));var l=35===c?s.length>1&&e.isIdentifierStart(s.charCodeAt(1),V):e.isIdentifierStart(c,V);if(0===i||l){var u=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return u.symbol=o,i>0?e.factory.createPropertyAccessExpression(t(n,i-1),u):u}91===c&&(c=(s=s.substring(1,s.length-1)).charCodeAt(0));var _=void 0;return !e.isSingleOrDoubleQuote(c)||8&o.flags?""+ +s===s&&(_=e.factory.createNumericLiteral(+s)):_=e.factory.createStringLiteral(e.stripQuotes(s).replace(/\\./g,(function(e){return e.substring(1)})),39===c),_||((_=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216)).symbol=o),e.factory.createElementAccessExpression(t(n,i-1),_)}(i,i.length-1)}function M(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isStringLiteral(r)}function L(t){var r=e.getNameOfDeclaration(t);return !!(r&&e.isStringLiteral(r)&&(r.singleQuote||!e.nodeIsSynthesized(r)&&e.startsWith(e.getTextOfNode(r,!1),"'")))}function R(t,r){var n=!!e.length(t.declarations)&&e.every(t.declarations,L),i=function(t,r,n){var i=_i(t).nameType;if(i){if(384&i.flags){var a=""+i.value;return e.isIdentifierText(a,e.getEmitScriptTarget(K))||e.isNumericLiteralName(a)?e.isNumericLiteralName(a)&&e.startsWith(a,"-")?e.factory.createComputedPropertyName(e.factory.createNumericLiteral(+a)):e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(K)):e.factory.createStringLiteral(a,!!n)}if(8192&i.flags)return e.factory.createComputedPropertyName(w(i.symbol,r,111551))}}(t,r,n);if(i)return i;var a=e.unescapeLeadingUnderscores(t.escapedName),o=!!e.length(t.declarations)&&e.every(t.declarations,M);return e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(K),n,o)}function B(t,r){return t.declarations&&e.find(t.declarations,(function(t){return !(!e.getEffectiveTypeAnnotationNode(t)||r&&!e.findAncestor(t,(function(e){return e===r})))}))}function j(t,r){return !(4&e.getObjectFlags(r))||!e.isTypeReferenceNode(t)||e.length(t.typeArguments)>=wl(r.target.typeParameters)}function J(t,r,n,i,a,o){if(!Eo(r)&&i){var s=B(n,i);if(s&&!e.isFunctionLikeDeclaration(s)&&!e.isGetAccessorDeclaration(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(function(t,r,n){var i=Hd(t);return i===n||!(!e.isParameter(r)||!r.questionToken)&&Fm(n,524288)===i}(c,s,r)&&j(c,r)){var u=U(t,c,a,o);if(u)return u}}}var _=t.flags;8192&r.flags&&r.symbol===n&&(!t.enclosingDeclaration||e.some(n.declarations,(function(r){return e.getSourceFileOfNode(r)===e.getSourceFileOfNode(t.enclosingDeclaration)})))&&(t.flags|=1048576);var d=l(r,t);return t.flags=_,d}function z(t,r,n){var i,a,o=!1,s=e.getFirstIdentifier(t);if(e.isInJSFile(t)&&(e.isExportsIdentifier(s)||e.isModuleExportsAccessExpression(s.parent)||e.isQualifiedName(s.parent)&&e.isModuleIdentifier(s.parent.left)&&e.isExportsIdentifier(s.parent.right)))return {introducesError:o=!0,node:t};var c=ia(s,67108863,!0,!0);if(c&&(0!==Qa(c,r.enclosingDeclaration,67108863,!1).accessibility?o=!0:(null===(a=null===(i=r.tracker)||void 0===i?void 0:i.trackSymbol)||void 0===a||a.call(i,c,r.enclosingDeclaration,67108863),null==n||n(c)),e.isIdentifier(t))){var l=Js(c),u=262144&c.flags&&!qa(l.symbol,r.enclosingDeclaration)?F(l,r):e.factory.cloneNode(t);return u.symbol=c,{introducesError:o,node:e.setEmitFlags(e.setOriginalNode(u,t),16777216)}}return {introducesError:o,node:t}}function U(n,i,a,o){r&&r.throwIfCancellationRequested&&r.throwIfCancellationRequested();var s=!1,c=e.getSourceFileOfNode(i),u=e.visitNode(i,(function r(i){if(e.isJSDocAllType(i)||322===i.kind)return e.factory.createKeywordTypeNode(131);if(e.isJSDocUnknownType(i))return e.factory.createKeywordTypeNode(157);if(e.isJSDocNullableType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,r),e.factory.createLiteralTypeNode(e.factory.createNull())]);if(e.isJSDocOptionalType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,r),e.factory.createKeywordTypeNode(155)]);if(e.isJSDocNonNullableType(i))return e.visitNode(i.type,r);if(e.isJSDocVariadicType(i))return e.factory.createArrayTypeNode(e.visitNode(i.type,r));if(e.isJSDocTypeLiteral(i))return e.factory.createTypeLiteralNode(e.map(i.jsDocPropertyTags,(function(t){var a=e.isIdentifier(t.name)?t.name:t.name.right,o=To(Hd(i),a.escapedText),s=o&&t.typeExpression&&Hd(t.typeExpression.type)!==o?l(o,n):void 0;return e.factory.createPropertySignature(void 0,a,t.isBracketed||t.typeExpression&&e.isJSDocOptionalType(t.typeExpression.type)?e.factory.createToken(57):void 0,s||t.typeExpression&&e.visitNode(t.typeExpression.type,r)||e.factory.createKeywordTypeNode(131))})));if(e.isTypeReferenceNode(i)&&e.isIdentifier(i.typeName)&&""===i.typeName.escapedText)return e.setOriginalNode(e.factory.createKeywordTypeNode(131),i);if((e.isExpressionWithTypeArguments(i)||e.isTypeReferenceNode(i))&&e.isJSDocIndexSignature(i))return e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,[e.factory.createParameterDeclaration(void 0,void 0,"x",void 0,e.visitNode(i.typeArguments[0],r))],e.visitNode(i.typeArguments[1],r))]);var u;if(e.isJSDocFunctionType(i))return e.isJSDocConstructSignature(i)?e.factory.createConstructorTypeNode(void 0,e.visitNodes(i.typeParameters,r),e.mapDefined(i.parameters,(function(t,n){return t.name&&e.isIdentifier(t.name)&&"new"===t.name.escapedText?void(u=t.type):e.factory.createParameterDeclaration(void 0,g(t),m(t,n),t.questionToken,e.visitNode(t.type,r),void 0)})),e.visitNode(u||i.type,r)||e.factory.createKeywordTypeNode(131)):e.factory.createFunctionTypeNode(e.visitNodes(i.typeParameters,r),e.map(i.parameters,(function(t,n){return e.factory.createParameterDeclaration(void 0,g(t),m(t,n),t.questionToken,e.visitNode(t.type,r),void 0)})),e.visitNode(i.type,r)||e.factory.createKeywordTypeNode(131));if(e.isTypeReferenceNode(i)&&e.isInJSDoc(i)&&(!j(i,Hd(i))||Au(i)||we===xu(i,788968,!0)))return e.setOriginalNode(l(Hd(i),n),i);if(e.isLiteralImportTypeNode(i)){var _=di(i).resolvedSymbol;return !e.isInJSDoc(i)||!_||(i.isTypeOf||788968&_.flags)&&e.length(i.typeArguments)>=wl(bs(_))?e.factory.updateImportTypeNode(i,e.factory.updateLiteralTypeNode(i.argument,function(r,i){if(o){if(n.tracker&&n.tracker.moduleResolverHost){var a=xC(r);if(a){var s={getCanonicalFileName:e.createGetCanonicalFileName(!!t.useCaseSensitiveFileNames),getCurrentDirectory:function(){return n.tracker.moduleResolverHost.getCurrentDirectory()},getCommonSourceDirectory:function(){return n.tracker.moduleResolverHost.getCommonSourceDirectory()}},c=e.getResolvedExternalModuleName(s,a);return e.factory.createStringLiteral(c)}}}else if(n.tracker&&n.tracker.trackExternalModuleSymbolOfImportTypeNode){var l=sa(i,i,void 0);l&&n.tracker.trackExternalModuleSymbolOfImportTypeNode(l);}return i}(i,i.argument.literal)),i.assertions,i.qualifier,e.visitNodes(i.typeArguments,r,e.isTypeNode),i.isTypeOf):e.setOriginalNode(l(Hd(i),n),i)}if(e.isEntityName(i)||e.isEntityNameExpression(i)){var d=z(i,n,a),p=d.introducesError,f=d.node;if(s=s||p,f!==i)return f}return c&&e.isTupleTypeNode(i)&&e.getLineAndCharacterOfPosition(c,i.pos).line===e.getLineAndCharacterOfPosition(c,i.end).line&&e.setEmitFlags(i,1),e.visitEachChild(i,r,e.nullTransformationContext);function g(t){return t.dotDotDotToken||(t.type&&e.isJSDocVariadicType(t.type)?e.factory.createToken(25):void 0)}function m(t,r){return t.name&&e.isIdentifier(t.name)&&"this"===t.name.escapedText?"this":g(t)?"args":"arg".concat(r)}}));if(!s)return u===i?e.setTextRange(e.factory.cloneNode(i),i):u}}(),se=e.createSymbolTable(),ce=ri(4,"undefined");ce.declarations=[];var le=ri(1536,"globalThis",8);le.exports=se,le.declarations=[],se.set(le.escapedName,le);var ue,_e=ri(4,"arguments"),de=ri(4,"require"),pe={getNodeCount:function(){return e.sum(t.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(t.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(t.getSourceFiles(),"symbolCount")+x},getTypeCount:function(){return b},getInstantiationCount:function(){return T},getRelationCacheSizes:function(){return {assignable:Ln.size,identity:Bn.size,subtype:On.size,strictSubtype:Mn.size}},isUndefinedSymbol:function(e){return e===ce},isArgumentsSymbol:function(e){return e===_e},isUnknownSymbol:function(e){return e===we},getMergedSymbol:xa,getDiagnostics:CT,getGlobalDiagnostics:function(){return ET(),Pn.getGlobalDiagnostics()},getRecursionIdentity:Nf,getUnmatchedProperties:qg,getTypeOfSymbolAtLocation:function(t,r){var n=e.getParseTreeNode(r);return n?function(t,r){if(t=t.exportSymbol||t,(79===r.kind||80===r.kind)&&(e.isRightSideOfQualifiedNameOrPropertyAccess(r)&&(r=r.parent),e.isExpressionNode(r)&&(!e.isAssignmentTarget(r)||e.isWriteAccess(r)))){var n=Qx(r);if(Na(di(r).resolvedSymbol)===t)return n}return e.isDeclarationName(r)&&e.isSetAccessor(r.parent)&&rs(r.parent)?as(r.parent.symbol):ps(t)}(t,n):je},getTypeOfSymbol:ds,getSymbolsOfParameterPropertyDeclaration:function(t,r){var n=e.getParseTreeNode(t,e.isParameter);return void 0===n?e.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):function(t,r){var n=t.parent,i=t.parent.parent,a=fi(n.locals,r,111551),o=fi(ic(i.symbol),r,111551);return a&&o?[a,o]:e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,e.escapeLeadingUnderscores(r))},getDeclaredTypeOfSymbol:Js,getPropertiesOfType:zc,getPropertyOfType:function(t,r){return dl(t,e.escapeLeadingUnderscores(r))},getPrivateIdentifierPropertyOfType:function(t,r,n){var i=e.getParseTreeNode(n);if(i){var a=oh(e.escapeLeadingUnderscores(r),i);return a?ch(t,a):void 0}},getTypeOfPropertyOfType:function(t,r){return To(t,e.escapeLeadingUnderscores(r))},getIndexInfoOfType:function(e,t){return bl(e,0===t?Ye:Ze)},getIndexInfosOfType:hl,getIndexInfosOfIndexSymbol:ru,getSignaturesOfType:fl,getIndexTypeOfType:function(e,t){return xl(e,0===t?Ye:Ze)},getIndexType:function(e){return z_(e)},getBaseTypes:Ns,getBaseTypeOfLiteralType:Gf,getWidenedType:Cg,getTypeFromTypeNode:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r?Hd(r):je},getParameterType:zb,getParameterIdentifierNameAtPosition:function(e,t){var r;if(320!==(null===(r=e.declaration)||void 0===r?void 0:r.kind)){var n=e.parameters.length-(j(e)?1:0);if(t<n){var i=e.parameters[t];return Bb(i)?[i.escapedName,!1]:void 0}var a=e.parameters[n]||we;if(Bb(a)){var o=ds(a);if($f(o)){var s=o.target.labeledElementDeclarations,c=null==s?void 0:s[t-n],l=!!(null==c?void 0:c.dotDotDotToken);return c?[Lb(c),l]:void 0}return t===n?[a.escapedName,!0]:void 0}}},getPromisedTypeOfPromise:hD,getAwaitedType:function(e){return CD(e)},getReturnTypeOfSignature:Ul,isNullableType:Xv,getNullableType:sg,getNonNullableType:lg,getNonOptionalType:_g,getTypeArguments:fu,typeToTypeNode:oe.typeToTypeNode,indexInfoToIndexSignatureDeclaration:oe.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:oe.signatureToSignatureDeclaration,symbolToEntityName:oe.symbolToEntityName,symbolToExpression:oe.symbolToExpression,symbolToNode:oe.symbolToNode,symbolToTypeParameterDeclarations:oe.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:oe.symbolToParameterDeclaration,typeParameterToDeclaration:oe.typeParameterToDeclaration,getSymbolsInScope:function(t,r){var n=e.getParseTreeNode(t);return n?function(t,r){if(33554432&t.flags)return [];var n=e.createSymbolTable(),i=!1;return function(){for(;t;){switch(t.locals&&!pi(t)&&o(t.locals,r),t.kind){case 308:if(!e.isExternalModule(t))break;case 264:s(Da(t).exports,2623475&r);break;case 263:o(Da(t).exports,8&r);break;case 228:t.name&&a(t.symbol,r);case 260:case 261:i||o(ic(Da(t)),788968&r);break;case 215:t.name&&a(t.symbol,r);}e.introducesArgumentsExoticObject(t)&&a(_e,r),i=e.isStatic(t),t=t.parent;}o(se,r);}(),n.delete("this"),El(n);function a(t,r){if(e.getCombinedLocalAndExportSymbolFlags(t)&r){var i=t.escapedName;n.has(i)||n.set(i,t);}}function o(e,t){t&&e.forEach((function(e){a(e,t);}));}function s(t,r){r&&t.forEach((function(t){e.getDeclarationOfKind(t,278)||e.getDeclarationOfKind(t,277)||a(t,r);}));}}(n,r):[]},getSymbolAtLocation:function(t){var r=e.getParseTreeNode(t);return r?OT(r,!0):void 0},getIndexInfosAtLocation:function(t){var r=e.getParseTreeNode(t);return r?function(t){if(e.isIdentifier(t)&&e.isPropertyAccessExpression(t.parent)&&t.parent.name===t){var r=M_(t),n=Qx(t.parent.expression),i=1048576&n.flags?n.types:[n];return e.flatMap(i,(function(t){return e.filter(hl(t),(function(e){return yl(r,e.keyType)}))}))}}(r):void 0},getShorthandAssignmentValueSymbol:function(t){var r=e.getParseTreeNode(t);return r?function(e){if(e&&300===e.kind)return ia(e.name,2208703)}(r):void 0},getExportSpecifierLocalTargetSymbol:function(t){var r=e.getParseTreeNode(t,e.isExportSpecifier);return r?function(t){return e.isExportSpecifier(t)?t.parent.parent.moduleSpecifier?zi(t.parent.parent,t):ia(t.propertyName||t.name,2998271):ia(t,2998271)}(r):void 0},getExportSymbolOfSymbol:function(e){return xa(e.exportSymbol||e)},getTypeAtLocation:function(t){var r=e.getParseTreeNode(t);return r?MT(r):je},getTypeOfAssignmentPattern:function(t){var r=e.getParseTreeNode(t,e.isAssignmentPattern);return r&&LT(r)||je},getPropertySymbolOfDestructuringAssignment:function(t){var r=e.getParseTreeNode(t,e.isIdentifier);return r?function(t){var r=LT(e.cast(t.parent.parent,e.isAssignmentPattern));return r&&dl(r,t.escapedText)}(r):void 0},signatureToString:function(t,r,n,i){return no(t,e.getParseTreeNode(r),n,i)},typeToString:function(t,r,n){return io(t,e.getParseTreeNode(r),n)},symbolToString:function(t,r,n,i){return ro(t,e.getParseTreeNode(r),n,i)},typePredicateToString:function(t,r,n){return uo(t,e.getParseTreeNode(r),n)},writeSignature:function(t,r,n,i,a){return no(t,e.getParseTreeNode(r),n,i,a)},writeType:function(t,r,n,i){return io(t,e.getParseTreeNode(r),n,i)},writeSymbol:function(t,r,n,i,a){return ro(t,e.getParseTreeNode(r),n,i,a)},writeTypePredicate:function(t,r,n,i){return uo(t,e.getParseTreeNode(r),n,i)},getAugmentedPropertiesOfType:JT,getRootSymbols:function t(r){var n=function(t){if(6&e.getCheckFlags(t))return e.mapDefined(_i(t).containingType.types,(function(e){return dl(e,t.escapedName)}));if(33554432&t.flags){var r=t,n=r.leftSpread,i=r.rightSpread,a=r.syntheticOrigin;return n?[n,i]:a?[a]:e.singleElementArray(function(e){for(var t,r=e;r=_i(r).target;)t=r;return t}(t))}}(r);return n?e.flatMap(n,t):[r]},getSymbolOfExpando:Db,getContextualType:function(t,r){var n=e.getParseTreeNode(t,e.isExpression);if(n)return 4&r?fe(n,(function(){return cv(n,r)})):cv(n,r)},getContextualTypeForObjectLiteralElement:function(t){var r=e.getParseTreeNode(t,e.isObjectLiteralElementLike);return r?tv(r,void 0):void 0},getContextualTypeForArgumentAtIndex:function(t,r){var n=e.getParseTreeNode(t,e.isCallLikeExpression);return n&&Xy(n,r)},getContextualTypeForJsxAttribute:function(t){var r=e.getParseTreeNode(t,e.isJsxAttributeLike);return r&&nv(r,void 0)},isContextSensitive:Tp,getTypeOfPropertyOfContextualType:$y,getFullyQualifiedName:na,getResolvedSignature:function(e,t,r){return ge(e,t,r,0)},getResolvedSignatureForStringLiteralCompletions:function(e,t,r){return ge(e,r,void 0,32,t)},getResolvedSignatureForSignatureHelp:function(e,t,r){return ge(e,t,r,16)},getExpandedParameters:dc,hasEffectiveRestParameter:Wb,containsArgumentsReference:Ll,getConstantValue:function(t){var r=e.getParseTreeNode(t,sC);return r?cC(r):void 0},isValidPropertyAccess:function(t,r){var n=e.getParseTreeNode(t,e.isPropertyAccessOrQualifiedNameOrImportTypeNode);return !!n&&function(e,t){switch(e.kind){case 208:return kh(e,106===e.expression.kind,t,Cg(Zx(e.expression)));case 163:return kh(e,!1,t,Cg(Zx(e.left)));case 202:return kh(e,!1,t,Hd(e))}}(n,e.escapeLeadingUnderscores(r))},isValidPropertyAccessForCompletions:function(t,r,n){var i=e.getParseTreeNode(t,e.isPropertyAccessExpression);return !!i&&Eh(i,r,n)},getSignatureFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?Ol(r):void 0},isImplementationOfOverload:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?eC(r):void 0},getImmediateAliasedSymbol:Dv,getAliasedSymbol:Qi,getEmitResolver:function(e,t){return CT(e,t),ae},getExportsOfModule:fa,getExportsAndPropertiesOfModule:function(t){var r=fa(t),n=ua(t);if(n!==t){var i=ds(n);ma(i)&&e.addRange(r,zc(i));}return r},forEachExportAndPropertyOfModule:function(e,t){va(e).forEach((function(e,r){La(r)||t(e,r);}));var r=ua(e);if(r!==e){var n=ds(r);ma(n)&&function(e,r){3670016&(e=nl(e)).flags&&Rc(e).members.forEach((function(e,r){Ba(e,r)&&function(e,r){t(e,r);}(e,r);}));}(n);}},getSymbolWalker:e.createGetSymbolWalker((function(e){return ql(e)||Le}),Jl,Ul,Ns,Rc,ds,dm,Kc,e.getFirstIdentifier,fu),getAmbientModules:function(){return Ut||(Ut=[],se.forEach((function(e,t){c.test(t)&&Ut.push(e);}))),Ut},getJsxIntrinsicTagNamesAt:function(t){var r=Av(A.IntrinsicElements,t);return r?zc(r):e.emptyArray},isOptionalParameter:function(t){var r=e.getParseTreeNode(t,e.isParameter);return !!r&&Al(r)},tryGetMemberInModuleExports:function(t,r){return ga(e.escapeLeadingUnderscores(t),r)},tryGetMemberInModuleExportsAndProperties:function(t,r){return function(e,t){var r=ga(e,t);if(r)return r;var n=ua(t);if(n!==t){var i=ds(n);return ma(i)?dl(i,e):void 0}}(e.escapeLeadingUnderscores(t),r)},tryFindAmbientModule:function(e){return Nl(e,!0)},tryFindAmbientModuleWithoutAugmentations:function(e){return Nl(e,!1)},getApparentType:rl,getUnionType:b_,isTypeAssignableTo:Ip,createAnonymousType:Ja,createSignature:cc,createSymbol:ri,createIndexInfo:eu,getAnyType:function(){return Le},getStringType:function(){return Ye},getNumberType:function(){return Ze},createPromiseType:$b,createArrayType:$u,getElementTypeOfArrayType:Rf,getBooleanType:function(){return at},getFalseType:function(e){return e?et:tt},getTrueType:function(e){return e?rt:nt},getVoidType:function(){return st},getUndefinedType:function(){return qe},getNullType:function(){return Qe},getESSymbolType:function(){return ot},getNeverType:function(){return ct},getOptionalType:function(){return He},getPromiseType:function(){return Vu(!1)},getPromiseLikeType:function(){return qu(!1)},getAsyncIterableType:function(){var e=Hu(!1);if(e!==Pt)return e},isSymbolAccessible:Qa,isArrayType:If,isTupleType:$f,isArrayLikeType:Bf,isTypeInvalidDueToUnionDiscriminant:function(e,t){return t.properties.some((function(t){var r=t.name&&M_(t.name),n=r&&Xs(r)?tc(r):void 0,i=void 0===n?void 0:To(e,n);return !!i&&Hf(i)&&!Ip(MT(t),i)}))},getExactOptionalProperties:function(e){return zc(e).filter((function(e){return gg(ds(e))}))},getAllPossiblePropertiesOfTypes:function(t){var r=b_(t);if(!(1048576&r.flags))return JT(r);for(var n=e.createSymbolTable(),i=0,a=t;i<a.length;i++)for(var o=0,s=JT(a[i]);o<s.length;o++){var c=s[o].escapedName;if(!n.has(c)){var l=il(r,c);l&&n.set(c,l);}}return e.arrayFrom(n.values())},getSuggestedSymbolForNonexistentProperty:vh,getSuggestionForNonexistentProperty:bh,getSuggestedSymbolForNonexistentJSXAttribute:hh,getSuggestedSymbolForNonexistentSymbol:function(t,r,n){return xh(t,e.escapeLeadingUnderscores(r),n)},getSuggestionForNonexistentSymbol:function(t,r,n){return function(t,r,n){var i=xh(t,r,n);return i&&e.symbolName(i)}(t,e.escapeLeadingUnderscores(r),n)},getSuggestedSymbolForNonexistentModule:Dh,getSuggestionForNonexistentExport:function(t,r){var n=Dh(t,r);return n&&e.symbolName(n)},getSuggestedSymbolForNonexistentClassMember:yh,getBaseConstraintOfType:Gc,getDefaultFromTypeParameter:function(e){return e&&262144&e.flags?$c(e):void 0},resolveName:function(t,r,n,i){return vi(r,e.escapeLeadingUnderscores(t),n,void 0,void 0,!1,i)},getJsxNamespace:function(t){return e.unescapeLeadingUnderscores(Vn(t))},getJsxFragmentFactory:function(t){var r=bC(t);return r&&e.unescapeLeadingUnderscores(e.getFirstIdentifier(r).escapedText)},getAccessibleSymbolChain:Ka,getTypePredicateOfSignature:Jl,resolveExternalModuleName:function(t){var r=e.getParseTreeNode(t,e.isExpression);return r&&oa(r,r,!0)},resolveExternalModuleSymbol:ua,tryGetThisTypeAt:function(t,r,n){var i=e.getParseTreeNode(t);return i&&By(i,r,n)},getTypeArgumentConstraint:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r&&function(t){var r=e.tryCast(t.parent,e.isTypeReferenceType);if(r){var n=_D(r);if(n){var i=Kc(n[r.typeArguments.indexOf(t)]);return i&&hp(i,$d(n,lD(r,n)))}}}(r)},getSuggestionDiagnostics:function(n,a){var o,s=e.getParseTreeNode(n,e.isSourceFile)||e.Debug.fail("Could not determine parsed source file.");if(e.skipTypeChecking(s,K,t))return e.emptyArray;try{return r=a,kT(s),e.Debug.assert(!!(1&di(s).flags)),o=e.addRange(o,wn.getDiagnostics(s.fileName)),RD(TT(s),(function(t,r,n){e.containsParseError(t)||ST(r,!!(16777216&t.flags))||(o||(o=[])).push(i$1(i$1({},n),{category:e.DiagnosticCategory.Suggestion}));})),o||e.emptyArray}finally{r=void 0;}},runWithCancellationToken:function(e,t){try{return r=e,t(pe)}finally{r=void 0;}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:bs,isDeclarationVisible:yo,isPropertyAccessible:Nh,getTypeOnlyAliasDeclaration:$i,getMemberOverrideModifierStatus:function(t,r){if(!r.name)return 0;var n=Da(t),i=Js(n),a=oc(i),o=ds(n),s=e.getEffectiveBaseTypeNode(t)&&Ns(i),c=(null==s?void 0:s.length)?oc(e.first(s),i.thisType):void 0,l=Es(i),u=r.parent?e.hasOverrideModifier(r):e.hasSyntacticModifier(r,16384),_=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(r.name));return QS(t,o,l,c,i,a,u,e.hasAbstractModifier(r),e.isStatic(r),!1,_)},isTypeParameterPossiblyReferenced:dp};function fe(t,r){var n=e.findAncestor(t,e.isCallLikeExpression),i=n&&di(n).resolvedSignature;if(n){var a=t;do{di(a).skipDirectInference=!0,a=a.parent;}while(a&&a!==n);di(n).resolvedSignature=void 0;}var o=r();if(n){a=t;do{di(a).skipDirectInference=void 0,a=a.parent;}while(a&&a!==n);di(n).resolvedSignature=i;}return o}function ge(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isCallLikeExpression);ue=n;var s=o?a?fe(a,(function(){return hb(o,r,i)})):hb(o,r,i):void 0;return ue=void 0,s}var me=new e.Map,ye=new e.Map,ve=new e.Map,he=new e.Map,be=new e.Map,xe=new e.Map,De=new e.Map,Se=new e.Map,Te=new e.Map,Ce=new e.Map,Ee=new e.Map,ke=new e.Map,Ne=new e.Map,Ae=[],Fe=new e.Map,Pe=new e.Set,we=ri(4,"unknown"),Ie=ri(0,"__resolving__"),Oe=new e.Map,Me=new e.Map,Le=Ia(1,"any"),Re=Ia(1,"any",262144),Be=Ia(1,"any"),je=Ia(1,"error"),Je=Ia(1,"unresolved"),ze=Ia(1,"any",65536),Ue=Ia(1,"intrinsic"),Ke=Ia(2,"unknown"),Ve=Ia(2,"unknown"),qe=Ia(32768,"undefined"),We=G?qe:Ia(32768,"undefined",65536),He=Ia(32768,"undefined"),Ge=ne?Ia(32768,"undefined"):qe,Qe=Ia(65536,"null"),Xe=G?Qe:Ia(65536,"null",65536),Ye=Ia(4,"string"),Ze=Ia(8,"number"),$e=Ia(64,"bigint"),et=Ia(512,"false"),tt=Ia(512,"false"),rt=Ia(512,"true"),nt=Ia(512,"true");rt.regularType=nt,rt.freshType=rt,nt.regularType=nt,nt.freshType=rt,et.regularType=tt,et.freshType=et,tt.regularType=tt,tt.freshType=et;var it,at=b_([tt,nt]),ot=Ia(4096,"symbol"),st=Ia(16384,"void"),ct=Ia(131072,"never"),lt=Ia(131072,"never",262144),ut=Ia(131072,"never"),_t=Ia(131072,"never"),dt=Ia(67108864,"object"),pt=b_([Ye,Ze]),ft=b_([Ye,Ze,ot]),gt=te?Ye:ft,mt=b_([Ze,$e]),yt=b_([Ye,Ze,at,$e,Qe,qe]),vt=K_(["",""],[Ze]),ht=rp((function(e){return 262144&e.flags?!(t=e).constraint&&!iu(t)||t.constraint===It?t:t.restrictiveInstantiation||(t.restrictiveInstantiation=Ma(t.symbol),t.restrictiveInstantiation.constraint=It,t.restrictiveInstantiation):e;var t;}),(function(){return "(restrictive mapper)"})),bt=rp((function(e){return 262144&e.flags?Be:e}),(function(){return "(permissive mapper)"})),xt=Ia(131072,"never"),Dt=rp((function(e){return 262144&e.flags?xt:e}),(function(){return "(unique literal mapper)"})),St=rp((function(e){return !it||e!==Lt&&e!==Rt&&e!==Bt||it(!0),e}),(function(){return "(unmeasurable reporter)"})),Tt=rp((function(e){return !it||e!==Lt&&e!==Rt&&e!==Bt||it(!1),e}),(function(){return "(unreliable reporter)"})),Ct=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray),Et=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray);Et.objectFlags|=2048;var kt=ri(2048,"__type");kt.members=e.createSymbolTable();var Nt=Ja(kt,z,e.emptyArray,e.emptyArray,e.emptyArray),At=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray),Ft=G?b_([qe,Qe,At]):Ke,Pt=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray);Pt.instantiations=new e.Map;var wt=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray);wt.objectFlags|=262144;var It=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray),Ot=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray),Mt=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray),Lt=Ma(),Rt=Ma();Rt.constraint=Lt;var Bt=Ma(),jt=Ma(),Jt=Ma();Jt.constraint=jt;var zt,Ut,Kt,Vt,qt,Wt,Ht,Gt,Qt,Xt,Yt,Zt,$t,er,tr,rr,nr,ir,ar,or,sr,cr,lr,ur,_r,dr,pr,fr,gr,mr,yr,vr,hr,br,xr,Dr,Sr,Tr,Cr,Er,kr,Nr,Ar,Fr,Pr,wr,Ir,Or,Mr,Lr,Rr,Br,jr=Pl(1,"<<unresolved>>",0,Le),Jr=cc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),zr=cc(void 0,void 0,void 0,e.emptyArray,je,void 0,0,0),Ur=cc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),Kr=cc(void 0,void 0,void 0,e.emptyArray,lt,void 0,0,0),Vr=eu(Ze,Ye,!0),qr=new e.Map,Wr={get yieldType(){return e.Debug.fail("Not supported")},get returnType(){return e.Debug.fail("Not supported")},get nextType(){return e.Debug.fail("Not supported")}},Hr=yS(Le,Le,Le),Gr=yS(Le,Le,Ke),Qr=yS(ct,Le,qe),Xr={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return xr||(xr=Bu("AsyncIterator",3,e))||Pt},getGlobalIterableType:Hu,getGlobalIterableIteratorType:function(e){return Dr||(Dr=Bu("AsyncIterableIterator",1,e))||Pt},getGlobalGeneratorType:function(e){return Sr||(Sr=Bu("AsyncGenerator",3,e))||Pt},resolveIterationType:CD,mustHaveANextMethodDiagnostic:e.Diagnostics.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},Yr={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return gr||(gr=Bu("Iterator",3,e))||Pt},getGlobalIterableType:Gu,getGlobalIterableIteratorType:function(e){return mr||(mr=Bu("IterableIterator",1,e))||Pt},getGlobalGeneratorType:function(e){return yr||(yr=Bu("Generator",3,e))||Pt},resolveIterationType:function(e,t){return e},mustHaveANextMethodDiagnostic:e.Diagnostics.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Zr=new e.Map,$r=!1,en=new e.Map,tn=0,rn=0,nn=0,an=!1,on=0,sn=jd(""),cn=Jd(0),ln=zd({negative:!1,base10Value:"0"}),un=[],_n=[],dn=[],pn=0,fn=[],gn=[],mn=[],yn=[],vn=[],hn=[],bn=[],xn=[],Dn=[],Sn=[],Tn=[],Cn=[],En=[],kn=[],Nn=[],An=[],Fn=[],Pn=e.createDiagnosticCollection(),wn=e.createDiagnosticCollection(),In=b_(e.arrayFrom(S.keys(),jd)),On=new e.Map,Mn=new e.Map,Ln=new e.Map,Rn=new e.Map,Bn=new e.Map,jn=new e.Map,Jn=e.createSymbolTable();Jn.set(ce.escapedName,ce);var zn=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===K.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(var r=0,n=t.getSourceFiles();r<n.length;r++){var i=n[r];e.bindSourceFile(i,K);}var a,o,s,c;zt=new e.Map;for(var l=0,u=t.getSourceFiles();l<u.length;l++)if(!(i=u[l]).redirectInfo){if(!e.isExternalOrCommonJsModule(i)){var _=i.locals.get("globalThis");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f=p[d];Pn.add(e.createDiagnosticForNode(f,e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"));}li(se,i.locals);}i.jsGlobalAugmentations&&li(se,i.jsGlobalAugmentations),i.patternAmbientModules&&i.patternAmbientModules.length&&(Kt=e.concatenate(Kt,i.patternAmbientModules)),i.moduleAugmentations.length&&(a||(a=[])).push(i.moduleAugmentations),i.symbol&&i.symbol.globalExports&&i.symbol.globalExports.forEach((function(e,t){se.has(t)||se.set(t,e);}));}if(a)for(var g=0,m=a;g<m.length;g++)for(var y=0,v=m[g];y<v.length;y++){var h=v[y];e.isGlobalScopeAugmentation(h.parent)&&ui(h);}if(o=se,s=Jn,c=e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,s.forEach((function(t,r){var n=o.get(r);n?e.forEach(n.declarations,function(t,r){return function(n){return Pn.add(e.createDiagnosticForNode(n,r,t))}}(e.unescapeLeadingUnderscores(r),c)):o.set(r,t);})),_i(ce).type=We,_i(_e).type=Bu("IArguments",0,!0),_i(we).type=je,_i(le).type=Oa(16,le),Qt=Bu("Array",1,!0),qt=Bu("Object",0,!0),Wt=Bu("Function",0,!0),Ht=X&&Bu("CallableFunction",0,!0)||Wt,Gt=X&&Bu("NewableFunction",0,!0)||Wt,Yt=Bu("String",0,!0),Zt=Bu("Number",0,!0),$t=Bu("Boolean",0,!0),er=Bu("RegExp",0,!0),rr=$u(Le),(nr=$u(Re))===Ct&&(nr=Ja(void 0,z,e.emptyArray,e.emptyArray,e.emptyArray)),Xt=Qu("ReadonlyArray",1)||Qt,ir=Xt?Yu(Xt,[Le]):rr,tr=Qu("ThisType",1),a)for(var b=0,x=a;b<x.length;b++)for(var D=0,S=x[b];D<S.length;D++)h=S[D],e.isGlobalScopeAugmentation(h.parent)||ui(h);zt.forEach((function(t){var r=t.firstFile,n=t.secondFile,i=t.conflictingSymbols;if(i.size<8)i.forEach((function(t,r){for(var n=t.isBlockScoped,i=t.firstFileLocations,a=t.secondFileLocations,o=n?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,s=0,c=i;s<c.length;s++)ci(c[s],o,r,a);for(var l=0,u=a;l<u.length;l++)ci(u[l],o,r,i);}));else {var a=e.arrayFrom(i.keys()).join(", ");Pn.add(e.addRelatedInfo(e.createDiagnosticForNode(r,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(n,e.Diagnostics.Conflicts_are_in_this_file))),Pn.add(e.addRelatedInfo(e.createDiagnosticForNode(n,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(r,e.Diagnostics.Conflicts_are_in_this_file)));}})),zt=void 0;}(),pe;function Un(e){return e?Ne.get(e):void 0}function Kn(e,t){return e&&Ne.set(e,t),t}function Vn(t){if(t){var r=e.getSourceFileOfNode(t);if(r)if(e.isJsxOpeningFragment(t)){if(r.localJsxFragmentNamespace)return r.localJsxFragmentNamespace;var n=r.pragmas.get("jsxfrag");if(n){var i=e.isArray(n)?n[0]:n;if(r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,V),e.visitNode(r.localJsxFragmentFactory,Wn),r.localJsxFragmentFactory)return r.localJsxFragmentNamespace=e.getFirstIdentifier(r.localJsxFragmentFactory).escapedText}var a=bC(t);if(a)return r.localJsxFragmentFactory=a,r.localJsxFragmentNamespace=e.getFirstIdentifier(a).escapedText}else {var o=qn(r);if(o)return r.localJsxNamespace=o}}return Rr||(Rr="React",K.jsxFactory?(Br=e.parseIsolatedEntityName(K.jsxFactory,V),e.visitNode(Br,Wn),Br&&(Rr=e.getFirstIdentifier(Br).escapedText)):K.reactNamespace&&(Rr=e.escapeLeadingUnderscores(K.reactNamespace))),Br||(Br=e.factory.createQualifiedName(e.factory.createIdentifier(e.unescapeLeadingUnderscores(Rr)),"createElement")),Rr}function qn(t){if(t.localJsxNamespace)return t.localJsxNamespace;var r=t.pragmas.get("jsx");if(r){var n=e.isArray(r)?r[0]:r;if(t.localJsxFactory=e.parseIsolatedEntityName(n.arguments.factory,V),e.visitNode(t.localJsxFactory,Wn),t.localJsxFactory)return t.localJsxNamespace=e.getFirstIdentifier(t.localJsxFactory).escapedText}}function Wn(t){return e.setTextRangePosEnd(t,-1,-1),e.visitEachChild(t,Wn,e.nullTransformationContext)}function Hn(e,t,r,n,i,a,o){var s=Qn(t,r,n,i,a,o);return s.skippedOn=e,s}function Gn(t,r,n,i,a,o){return t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o)}function Qn(e,t,r,n,i,a){var o=Gn(e,t,r,n,i,a);return Pn.add(o),o}function Xn(t,r){t?Pn.add(r):wn.add(i$1(i$1({},r),{category:e.DiagnosticCategory.Suggestion}));}function Yn(t,r,n,i,a,o,s){if(r.pos<0||r.end<0){if(!t)return;var c=e.getSourceFileOfNode(r);Xn(t,"message"in n?e.createFileDiagnostic(c,0,0,n,i,a,o,s):e.createDiagnosticForFileFromMessageChain(c,n));}else Xn(t,"message"in n?e.createDiagnosticForNode(r,n,i,a,o,s):e.createDiagnosticForNodeFromMessageChain(r,n));}function Zn(t,r,n,i,a,o,s){var c=Qn(t,n,i,a,o,s);if(r){var l=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);e.addRelatedInfo(c,l);}return c}function $n(t,r){var n=Array.isArray(t)?e.forEach(t,e.getJSDocDeprecatedTag):e.getJSDocDeprecatedTag(t);return n&&e.addRelatedInfo(r,e.createDiagnosticForNode(n,e.Diagnostics.The_declaration_was_marked_as_deprecated_here)),wn.add(r),r}function ei(e){return !!(268435456&Vv(e))}function ti(t,r,n){return $n(r,e.createDiagnosticForNode(t,e.Diagnostics._0_is_deprecated,n))}function ri(e,t,r){x++;var n=new y(33554432|e,t);return n.checkFlags=r||0,n}function ni(e){var t=0;return 2&e&&(t|=111551),1&e&&(t|=111550),4&e&&(t|=0),8&e&&(t|=900095),16&e&&(t|=110991),32&e&&(t|=899503),64&e&&(t|=788872),256&e&&(t|=899327),128&e&&(t|=899967),512&e&&(t|=110735),8192&e&&(t|=103359),32768&e&&(t|=46015),65536&e&&(t|=78783),262144&e&&(t|=526824),524288&e&&(t|=788968),2097152&e&&(t|=2097152),t}function ii(e,t){t.mergeId||(t.mergeId=d,d++),fn[t.mergeId]=e;}function ai(t){var r=ri(t.flags,t.escapedName);return r.declarations=t.declarations?t.declarations.slice():[],r.parent=t.parent,t.valueDeclaration&&(r.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(r.constEnumOnlyModule=!0),t.members&&(r.members=new e.Map(t.members)),t.exports&&(r.exports=new e.Map(t.exports)),ii(r,t),r}function oi(t,r,n){if(void 0===n&&(n=!1),!(t.flags&ni(r.flags))||67108864&(r.flags|t.flags)){if(r===t)return t;if(!(33554432&t.flags)){var i=Gi(t);if(i===we)return r;t=ai(i);}512&r.flags&&512&t.flags&&t.constEnumOnlyModule&&!r.constEnumOnlyModule&&(t.constEnumOnlyModule=!1),t.flags|=r.flags,r.valueDeclaration&&e.setValueDeclaration(t,r.valueDeclaration),e.addRange(t.declarations,r.declarations),r.members&&(t.members||(t.members=e.createSymbolTable()),li(t.members,r.members,n)),r.exports&&(t.exports||(t.exports=e.createSymbolTable()),li(t.exports,r.exports,n)),n||ii(t,r);}else if(1024&t.flags)t!==le&&Qn(r.declarations&&e.getNameOfDeclaration(r.declarations[0]),e.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,ro(t));else {var a=!!(384&t.flags||384&r.flags),o=!!(2&t.flags||2&r.flags),s=a?e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:o?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,c=r.declarations&&e.getSourceFileOfNode(r.declarations[0]),l=t.declarations&&e.getSourceFileOfNode(t.declarations[0]),u=e.isPlainJsFile(c,K.checkJs),_=e.isPlainJsFile(l,K.checkJs),d=ro(r);if(c&&l&&zt&&!a&&c!==l){var p=-1===e.comparePaths(c.path,l.path)?c:l,f=p===c?l:c,g=e.getOrUpdate(zt,"".concat(p.path,"|").concat(f.path),(function(){return {firstFile:p,secondFile:f,conflictingSymbols:new e.Map}})),m=e.getOrUpdate(g.conflictingSymbols,d,(function(){return {isBlockScoped:o,firstFileLocations:[],secondFileLocations:[]}}));u||y(m.firstFileLocations,r),_||y(m.secondFileLocations,t);}else u||si(r,s,d,t),_||si(t,s,d,r);}return t;function y(t,r){if(r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];e.pushIfUnique(t,a);}}}function si(t,r,n,i){e.forEach(t.declarations,(function(e){ci(e,r,n,i.declarations);}));}function ci(t,r,n,i){for(var a=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t,o=function(t,r,n,i,a,o){var s=t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o);return Pn.lookup(s)||(Pn.add(s),s)}(a,r,n),s=function(t){var r=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t;if(r===a)return "continue";o.relatedInformation=o.relatedInformation||[];var i=e.createDiagnosticForNode(r,e.Diagnostics._0_was_also_declared_here,n),s=e.createDiagnosticForNode(r,e.Diagnostics.and_here);if(e.length(o.relatedInformation)>=5||e.some(o.relatedInformation,(function(t){return 0===e.compareDiagnostics(t,s)||0===e.compareDiagnostics(t,i)})))return "continue";e.addRelatedInfo(o,e.length(o.relatedInformation)?s:i);},c=0,l=i||e.emptyArray;c<l.length;c++)s(l[c]);}function li(e,t,r){void 0===r&&(r=!1),t.forEach((function(t,n){var i=e.get(n);e.set(n,i?oi(i,t,r):xa(t));}));}function ui(t){var r,n,i,a=t.parent;if((null===(r=a.symbol.declarations)||void 0===r?void 0:r[0])===a)if(e.isGlobalScopeAugmentation(a))li(se,a.symbol.exports);else {var o=sa(t,t,16777216&t.parent.parent.flags?void 0:e.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found,!0);if(!o)return;if(1920&(o=ua(o)).flags)if(e.some(Kt,(function(e){return o===e.symbol}))){var s=oi(a.symbol,o,!0);Vt||(Vt=new e.Map),Vt.set(t.text,s);}else {if((null===(n=o.exports)||void 0===n?void 0:n.get("__export"))&&(null===(i=a.symbol.exports)||void 0===i?void 0:i.size))for(var c=nc(o,"resolvedExports"),l=0,u=e.arrayFrom(a.symbol.exports.entries());l<u.length;l++){var _=u[l],d=_[0],p=_[1];c.has(d)&&!o.exports.has(d)&&oi(c.get(d),p);}oi(o,a.symbol);}else Qn(t,e.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,t.text);}else e.Debug.assert(a.symbol.declarations.length>1);}function _i(e){if(33554432&e.flags)return e;var t=O(e);return gn[t]||(gn[t]=new P)}function di(e){var t=I(e);return mn[t]||(mn[t]=new w)}function pi(t){return 308===t.kind&&!e.isExternalOrCommonJsModule(t)}function fi(t,r,n){if(n){var i=xa(t.get(r));if(i){if(e.Debug.assert(0==(1&e.getCheckFlags(i)),"Should never get an instantiated symbol here."),i.flags&n)return i;if(2097152&i.flags&&Xi(i)&n)return i}}}function gi(r,n){var i=e.getSourceFileOfNode(r),a=e.getSourceFileOfNode(n),o=e.getEnclosingBlockScopeContainer(r);if(i!==a){if(q&&(i.externalModuleIndicator||a.externalModuleIndicator)||!e.outFile(K)||pm(n)||16777216&r.flags)return !0;if(l(n,r))return !0;var s=t.getSourceFiles();return s.indexOf(i)<=s.indexOf(a)}if(r.pos<=n.pos&&(!e.isPropertyDeclaration(r)||!e.isThisProperty(n.parent)||r.initializer||r.exclamationToken)){if(205===r.kind){var c=e.getAncestor(n,205);return c?e.findAncestor(c,e.isBindingElement)!==e.findAncestor(r,e.isBindingElement)||r.pos<c.pos:gi(e.getAncestor(r,257),n)}return 257===r.kind?!function(t,r){switch(t.parent.parent.kind){case 240:case 245:case 247:if(Ni(r,t,o))return !0}var n=t.parent.parent;return e.isForInOrOfStatement(n)&&Ni(r,n.expression,o)}(r,n):e.isClassDeclaration(r)?!e.findAncestor(n,(function(t){return e.isComputedPropertyName(t)&&t.parent.parent===r})):e.isPropertyDeclaration(r)?!u(r,n,!1):!e.isParameterPropertyDeclaration(r,r.parent)||!(99===e.getEmitScriptTarget(K)&&W&&e.getContainingClass(r)===e.getContainingClass(n)&&l(n,r))}return !(!(278===n.parent.kind||274===n.parent.kind&&n.parent.isExportEquals)&&(274!==n.kind||!n.isExportEquals)&&!(8388608&n.flags||pm(n)||e.findAncestor(n,(function(t){return e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)})))&&(!l(n,r)||99===e.getEmitScriptTarget(K)&&W&&e.getContainingClass(r)&&(e.isPropertyDeclaration(r)||e.isParameterPropertyDeclaration(r,r.parent))&&u(r,n,!0)));function l(t,r){return !!e.findAncestor(t,(function(n){if(n===o)return "quit";if(e.isFunctionLike(n))return !0;if(e.isClassStaticBlockDeclaration(n))return r.pos<t.pos;var i=e.tryCast(n.parent,e.isPropertyDeclaration);if(i&&i.initializer===n)if(e.isStatic(n.parent)){if(171===r.kind)return !0;if(e.isPropertyDeclaration(r)&&e.getContainingClass(t)===e.getContainingClass(r)){var a=r.name;if((e.isIdentifier(a)||e.isPrivateIdentifier(a))&&function(t,r,n,i,a){for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.pos>=i&&c.pos<=a){var l=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);if(e.setParent(l.expression,l),e.setParent(l,c),l.flowNode=c.returnFlowNode,!Zp(Dy(l,r,cg(r))))return !0}}return !1}(a,ds(Da(r)),e.filter(r.parent.members,e.isClassStaticBlockDeclaration),r.parent.pos,n.pos))return !0}}else if(169!==r.kind||e.isStatic(r)||e.getContainingClass(t)!==e.getContainingClass(r))return !0;return !1}))}function u(t,r,n){return !(r.end>t.end)&&void 0===e.findAncestor(r,(function(r){if(r===t)return "quit";switch(r.kind){case 216:return !0;case 169:return !n||!(e.isPropertyDeclaration(t)&&r.parent===t.parent||e.isParameterPropertyDeclaration(t,t.parent)&&r.parent===t.parent.parent)||"quit";case 238:switch(r.parent.kind){case 174:case 171:case 175:return !0;default:return !1}default:return !1}}))}}function mi(t,r,n){var i=e.getEmitScriptTarget(K),a=r;if(e.isParameter(n)&&a.body&&t.valueDeclaration&&t.valueDeclaration.pos>=a.body.pos&&t.valueDeclaration.end<=a.body.end&&i>=2){var o=di(a);return void 0===o.declarationRequiresScopeChange&&(o.declarationRequiresScopeChange=e.forEach(a.parameters,(function(e){return s(e.name)||!!e.initializer&&s(e.initializer)}))||!1),!o.declarationRequiresScopeChange}return !1;function s(t){switch(t.kind){case 216:case 215:case 259:case 173:return !1;case 171:case 174:case 175:case 299:return s(t.name);case 169:return e.hasStaticModifier(t)?i<99||!W:s(t.name);default:return e.isNullishCoalesce(t)||e.isOptionalChain(t)?i<7:e.isBindingElement(t)&&t.dotDotDotToken&&e.isObjectBindingPattern(t.parent)?i<4:!e.isTypeNode(t)&&(e.forEachChild(t,s)||!1)}}}function yi(t){return e.isAssertionExpression(t)&&e.isConstTypeReference(t.type)||e.isJSDocTypeTag(t)&&e.isConstTypeReference(t.typeExpression)}function vi(e,t,r,n,i,a,o,s){return void 0===o&&(o=!1),void 0===s&&(s=!0),hi(e,t,r,n,i,a,o,s,fi)}function hi(t,r,n,i,a,o,s,c,l){var u,_,d,p,f,g,y,v,h,b=t,x=!1,D=t,S=!1;e:for(;t;){if("const"===r&&yi(t))return;if(t.locals&&!pi(t)&&(p=l(t.locals,r,n))){var T=!0;if(e.isFunctionLike(t)&&f&&f!==t.body?(n&p.flags&788968&&323!==f.kind&&(T=!!(262144&p.flags)&&(f===t.type||166===f.kind||343===f.kind||344===f.kind||165===f.kind)),n&p.flags&3&&(mi(p,t,f)?T=!1:1&p.flags&&(T=166===f.kind||f===t.type&&!!e.findAncestor(p.valueDeclaration,e.isParameter)))):191===t.kind&&(T=f===t.trueType),T)break e;p=void 0;}switch(x=x||xi(t,f),t.kind){case 308:if(!e.isExternalOrCommonJsModule(t))break;S=!0;case 264:var C=(null===(u=Da(t))||void 0===u?void 0:u.exports)||z;if(308===t.kind||e.isModuleDeclaration(t)&&16777216&t.flags&&!e.isGlobalScopeAugmentation(t)){if(p=C.get("default")){var E=e.getLocalSymbolForExportDefault(p);if(E&&p.flags&n&&E.escapedName===r)break e;p=void 0;}var k=C.get(r);if(k&&2097152===k.flags&&(e.getDeclarationOfKind(k,278)||e.getDeclarationOfKind(k,277)))break}if("default"!==r&&(p=l(C,r,2623475&n))){if(!e.isSourceFile(t)||!t.commonJsModuleIndicator||(null===(_=p.declarations)||void 0===_?void 0:_.some(e.isJSDocTypeAlias)))break e;p=void 0;}break;case 263:if(p=l((null===(d=Da(t))||void 0===d?void 0:d.exports)||z,r,8&n))break e;break;case 169:if(!e.isStatic(t)){var N=Fa(t.parent);N&&N.locals&&l(N.locals,r,111551&n)&&(e.Debug.assertNode(t,e.isPropertyDeclaration),y=t);}break;case 260:case 228:case 261:if(p=l(Da(t).members||z,r,788968&n)){if(!Ti(p,t)){p=void 0;break}if(f&&e.isStatic(f))return void(i&&Qn(D,e.Diagnostics.Static_members_cannot_reference_class_type_parameters));break e}if(228===t.kind&&32&n){var A=t.name;if(A&&r===A.escapedText){p=t.symbol;break e}}break;case 230:if(f===t.expression&&94===t.parent.token){var F=t.parent.parent;if(e.isClassLike(F)&&(p=l(Da(F).members,r,788968&n)))return void(i&&Qn(D,e.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters))}break;case 164:if(h=t.parent.parent,(e.isClassLike(h)||261===h.kind)&&(p=l(Da(h).members,r,788968&n)))return void(i&&Qn(D,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type));break;case 216:if(e.getEmitScriptTarget(K)>=2)break;case 171:case 173:case 174:case 175:case 259:if(3&n&&"arguments"===r){p=_e;break e}break;case 215:if(3&n&&"arguments"===r){p=_e;break e}if(16&n){var P=t.name;if(P&&r===P.escapedText){p=t.symbol;break e}}break;case 167:t.parent&&166===t.parent.kind&&(t=t.parent),t.parent&&(e.isClassElement(t.parent)||260===t.parent.kind)&&(t=t.parent);break;case 348:case 341:case 342:var w=e.getJSDocRoot(t);w&&(t=w.parent);break;case 166:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&(v||(v=t));break;case 205:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&e.isParameterDeclaration(t)&&!v&&(v=t);break;case 192:if(262144&n){var I=t.typeParameter.name;if(I&&r===I.escapedText){p=t.typeParameter.symbol;break e}}}Di(t)&&(g=t),f=t,t=e.isJSDocTemplateTag(t)?e.getEffectiveContainerForJSDocTemplateTag(t)||t.parent:(e.isJSDocParameterTag(t)||e.isJSDocReturnTag(t))&&e.getHostSignatureFromJSDoc(t)||t.parent;}if(!o||!p||g&&p===g.symbol||(p.isReferenced|=n),!p){if(f&&(e.Debug.assert(308===f.kind),f.commonJsModuleIndicator&&"exports"===r&&n&f.symbol.flags))return f.symbol;s||(p=l(se,r,n));}if(!p&&b&&e.isInJSFile(b)&&b.parent&&e.isRequireCall(b.parent,!1))return de;function O(){return !(!y||W&&e.getEmitScriptTarget(K)>=9||(Qn(D,D&&y.type&&e.textRangeContainsPositionInclusive(y.type,D.pos)?e.Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(y.name),Si(a)),0))}if(p){if(!i||!O())return i&&m((function(){if(D&&(2&n||(32&n||384&n)&&111551==(111551&n))){var t=Na(p);(2&t.flags||32&t.flags||384&t.flags)&&function(t,r){var n;if(e.Debug.assert(!!(2&t.flags||32&t.flags||384&t.flags)),!(67108881&t.flags&&32&t.flags)){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isBlockOrCatchScoped(t)||e.isClassLike(t)||263===t.kind}));if(void 0===i)return e.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(16777216&i.flags||gi(i,r))){var a=void 0,o=e.declarationNameToString(e.getNameOfDeclaration(i));2&t.flags?a=Qn(r,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,o):32&t.flags?a=Qn(r,e.Diagnostics.Class_0_used_before_its_declaration,o):256&t.flags?a=Qn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o):(e.Debug.assert(!!(128&t.flags)),e.shouldPreserveConstEnums(K)&&(a=Qn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o))),a&&e.addRelatedInfo(a,e.createDiagnosticForNode(i,e.Diagnostics._0_is_declared_here,o));}}}(t,D);}if(p&&S&&111551==(111551&n)&&!(8388608&b.flags)){var i=xa(p);e.length(i.declarations)&&e.every(i.declarations,(function(t){return e.isNamespaceExportDeclaration(t)||e.isSourceFile(t)&&!!t.symbol.globalExports}))&&Yn(!K.allowUmdGlobalAccess,D,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,e.unescapeLeadingUnderscores(r));}if(p&&v&&!x&&111551==(111551&n)){var a=xa(ac(p)),o=e.getRootDeclaration(v);a===Da(v)?Qn(D,e.Diagnostics.Parameter_0_cannot_reference_itself,e.declarationNameToString(v.name)):a.valueDeclaration&&a.valueDeclaration.pos>v.pos&&o.parent.locals&&l(o.parent.locals,a.escapedName,n)===a&&Qn(D,e.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it,e.declarationNameToString(v.name),e.declarationNameToString(D));}if(p&&D&&111551&n&&2097152&p.flags&&!(111551&p.flags)&&!e.isValidTypeOnlyAliasUseSite(D)){var s=$i(p,111551);if(s){var c=278===s.kind?e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,u=e.unescapeLeadingUnderscores(r);bi(Qn(D,c,u),s,u);}}})),p}else i&&m((function(){if(!D||!(function(t,r,n){if(!e.isIdentifier(t)||t.escapedText!==r||NT(t)||pm(t))return !1;for(var i=e.getThisContainer(t,!1),a=i;a;){if(e.isClassLike(a.parent)){var o=Da(a.parent);if(!o)break;if(dl(ds(o),r))return Qn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,Si(n),ro(o)),!0;if(a===i&&!e.isStatic(a)&&dl(Js(o).thisType,r))return Qn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,Si(n)),!0}a=a.parent;}return !1}(D,r,a)||O()||Ci(D)||function(t,r,n){var i=1920|(e.isInJSFile(t)?111551:0);if(n===i){var a=Gi(vi(t,r,788968&~i,void 0,void 0,!1)),o=t.parent;if(a){if(e.isQualifiedName(o)){e.Debug.assert(o.left===t,"Should only be resolving left side of qualified name as a namespace");var s=o.right.escapedText;if(dl(Js(a),s))return Qn(o,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,e.unescapeLeadingUnderscores(r),e.unescapeLeadingUnderscores(s)),!0}return Qn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,e.unescapeLeadingUnderscores(r)),!0}}return !1}(D,r,n)||function(t,r){return !(!ki(r)||278!==t.parent.kind)&&(Qn(t,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,r),!0)}(D,r)||function(t,r,n){if(111127&n){if(Gi(vi(t,r,1024,void 0,void 0,!1)))return Qn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_value,e.unescapeLeadingUnderscores(r)),!0}else if(788544&n&&Gi(vi(t,r,1536,void 0,void 0,!1)))return Qn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_type,e.unescapeLeadingUnderscores(r)),!0;return !1}(D,r,n)||function(t,r,n){if(111551&n){if(ki(r))return function(t){var r=t.parent.parent,n=r.parent;if(r&&n){var i=e.isHeritageClause(r)&&94===r.token,a=e.isInterfaceDeclaration(n);return i&&a}return !1}(t)?Qn(t,e.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes,e.unescapeLeadingUnderscores(r)):Qn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,e.unescapeLeadingUnderscores(r)),!0;var i=Gi(vi(t,r,788544,void 0,void 0,!1)),a=i&&Xi(i);if(i&&void 0!==a&&!(111551&a)){var o=e.unescapeLeadingUnderscores(r);return function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return !0}return !1}(r)?Qn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,o):function(t,r){var n=e.findAncestor(t.parent,(function(t){return !e.isComputedPropertyName(t)&&!e.isPropertySignature(t)&&(e.isTypeLiteralNode(t)||"quit")}));if(n&&1===n.members.length){var i=Js(r);return !!(1048576&i.flags)&&bx(i,384,!0)}return !1}(t,i)?Qn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,o,"K"===o?"P":"K"):Qn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,o),!0}}return !1}(D,r,n)||function(t,r,n){if(788584&n){var i=Gi(vi(t,r,111127,void 0,void 0,!1));if(i&&!(1920&i.flags))return Qn(t,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.unescapeLeadingUnderscores(r)),!0}return !1}(D,r,n))){var t=void 0,o=void 0;if(a&&(o=function(t){for(var r=Si(t),n=e.getScriptTargetFeatures(),i=0,a=e.getOwnKeys(n);i<a.length;i++){var o=a[i],s=e.getOwnKeys(n[o]);if(void 0!==s&&e.contains(s,r))return o}}(a),o&&Qn(D,i,Si(a),o)),!o&&c&&pn<10&&((null==(t=xh(b,r,n))?void 0:t.valueDeclaration)&&e.isAmbientModule(t.valueDeclaration)&&e.isGlobalScopeAugmentation(t.valueDeclaration)&&(t=void 0),t)){var s=ro(t),l=_h(b,t,!1),u=1920===n||a&&"string"!=typeof a&&e.nodeIsSynthesized(a)?e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1:l?e.Diagnostics.Could_not_find_name_0_Did_you_mean_1:e.Diagnostics.Cannot_find_name_0_Did_you_mean_1,_=Gn(D,u,Si(a),s);Xn(!l,_),t.valueDeclaration&&e.addRelatedInfo(_,e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_is_declared_here,s));}t||o||!a||Qn(D,i,Si(a)),pn++;}}));}function bi(t,r,n){return r?e.addRelatedInfo(t,e.createDiagnosticForNode(r,278===r.kind?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,n)):t}function xi(t,r){return 216!==t.kind&&215!==t.kind?e.isTypeQueryNode(t)||(e.isFunctionLikeDeclaration(t)||169===t.kind&&!e.isStatic(t))&&(!r||r!==t.name):!(r&&r===t.name||!t.asteriskToken&&!e.hasSyntacticModifier(t,512)&&e.getImmediatelyInvokedFunctionExpression(t))}function Di(e){switch(e.kind){case 259:case 260:case 261:case 263:case 262:case 264:return !0;default:return !1}}function Si(t){return e.isString(t)?e.unescapeLeadingUnderscores(t):e.declarationNameToString(t)}function Ti(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(165===a.kind&&(e.isJSDocTemplateTag(a.parent)?e.getJSDocHost(a.parent):a.parent)===r)return !(e.isJSDocTemplateTag(a.parent)&&e.find(a.parent.parent.tags,e.isJSDocTypeAlias))}return !1}function Ci(t){var r=Ei(t);return !(!r||!ia(r,64,!0)||(Qn(t,e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements,e.getTextOfNode(r)),0))}function Ei(t){switch(t.kind){case 79:case 208:return t.parent?Ei(t.parent):void 0;case 230:if(e.isEntityNameExpression(t.expression))return t.expression;default:return}}function ki(e){return "any"===e||"string"===e||"number"===e||"boolean"===e||"never"===e||"unknown"===e}function Ni(t,r,n){return !!r&&!!e.findAncestor(t,(function(t){return t===r||!(t!==n&&(!e.isFunctionLike(t)||e.getImmediatelyInvokedFunctionExpression(t)))&&"quit"}))}function Ai(e){switch(e.kind){case 268:return e;case 270:return e.parent;case 271:return e.parent.parent;case 273:return e.parent.parent.parent;default:return}}function Fi(t){return t.declarations&&e.findLast(t.declarations,Pi)}function Pi(t){return 268===t.kind||267===t.kind||270===t.kind&&!!t.name||271===t.kind||277===t.kind||273===t.kind||278===t.kind||274===t.kind&&e.exportAssignmentIsAlias(t)||e.isBinaryExpression(t)&&2===e.getAssignmentDeclarationKind(t)&&e.exportAssignmentIsAlias(t)||e.isAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&wi(t.parent.right)||300===t.kind||299===t.kind&&wi(t.initializer)||257===t.kind&&e.isVariableDeclarationInitializedToBareOrAccessedRequire(t)||205===t.kind&&e.isVariableDeclarationInitializedToBareOrAccessedRequire(t.parent.parent)}function wi(t){return e.isAliasableExpression(t)||e.isFunctionExpression(t)&&bb(t)}function Ii(e,t,r,n){var i=e.exports.get("export="),a=i?dl(ds(i),t):e.exports.get(t),o=Gi(a,n);return Yi(r,a,o,!1),o}function Oi(t){return e.isExportAssignment(t)&&!t.isExportEquals||e.hasSyntacticModifier(t,1024)||e.isExportSpecifier(t)}function Mi(t){return e.isStringLiteralLike(t)?e.getModeForUsageLocation(e.getSourceFileOfNode(t),t):void 0}function Li(t,r){return t===e.ModuleKind.ESNext&&r===e.ModuleKind.CommonJS}function Ri(t){return Mi(t)===e.ModuleKind.ESNext&&e.endsWith(t.text,".json")}function Bi(t,r,n,i){var a=t&&Mi(i);if(t&&void 0!==a){var o=Li(a,t.impliedNodeFormat);if(a===e.ModuleKind.ESNext||o)return o}if(!H)return !1;if(!t||t.isDeclarationFile){var s=Ii(r,"default",void 0,!0);return !(s&&e.some(s.declarations,Oi)||Ii(r,e.escapeLeadingUnderscores("__esModule"),void 0,n))}return e.isSourceFileJS(t)?"object"!=typeof t.externalModuleIndicator&&!Ii(r,e.escapeLeadingUnderscores("__esModule"),void 0,n):pa(r)}function ji(t,r,n){var i,a;a=e.isShorthandAmbientModuleSymbol(t)?t:Ii(t,"default",r,n);var o=null===(i=t.declarations)||void 0===i?void 0:i.find(e.isSourceFile),s=Ji(r);if(!s)return a;var c=Ri(s),l=Bi(o,t,n,s);if(a||l||c){if(l||c){var u=ua(t,n)||Gi(t,n);return Yi(r,t,u,!1),u}}else if(pa(t)){var _=q>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop",d=t.exports.get("export=").valueDeclaration,p=Qn(r.name,e.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag,ro(t),_);d&&e.addRelatedInfo(p,e.createDiagnosticForNode(d,e.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,_));}else e.isImportClause(r)?function(t,r){var n,i,a;if(null===(n=t.exports)||void 0===n?void 0:n.has(r.symbol.escapedName))Qn(r.name,e.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,ro(t),ro(r.symbol));else {var o=Qn(r.name,e.Diagnostics.Module_0_has_no_default_export,ro(t)),s=null===(i=t.exports)||void 0===i?void 0:i.get("__export");if(s){var c=null===(a=s.declarations)||void 0===a?void 0:a.find((function(t){var r,n;return !!(e.isExportDeclaration(t)&&t.moduleSpecifier&&(null===(n=null===(r=oa(t,t.moduleSpecifier))||void 0===r?void 0:r.exports)||void 0===n?void 0:n.has("default")))}));c&&e.addRelatedInfo(o,e.createDiagnosticForNode(c,e.Diagnostics.export_Asterisk_does_not_re_export_a_default));}}}(t,r):Ui(t,t,r,e.isImportOrExportSpecifier(r)&&r.propertyName||r.name);return Yi(r,a,void 0,!1),a}function Ji(t){switch(t.kind){case 270:return t.parent.moduleSpecifier;case 268:return e.isExternalModuleReference(t.moduleReference)?t.moduleReference.expression:void 0;case 271:case 278:return t.parent.parent.moduleSpecifier;case 273:return t.parent.parent.parent.moduleSpecifier;default:return e.Debug.assertNever(t)}}function zi(t,r,n){var i;void 0===n&&(n=!1);var a=e.getExternalModuleRequireArgument(t)||t.moduleSpecifier,o=oa(t,a),s=!e.isPropertyAccessExpression(r)&&r.propertyName||r.name;if(e.isIdentifier(s)){var c=_a(o,a,!1,"default"===s.escapedText&&!(!K.allowSyntheticDefaultImports&&!e.getESModuleInterop(K)));if(c&&s.escapedText){if(e.isShorthandAmbientModuleSymbol(o))return o;var l=void 0;l=o&&o.exports&&o.exports.get("export=")?dl(ds(c),s.escapedText,!0):function(e,t){if(3&e.flags){var r=e.valueDeclaration.type;if(r)return Gi(dl(Hd(r),t))}}(c,s.escapedText),l=Gi(l,n);var u=function(e,t,r,n){if(1536&e.flags){var i=ya(e).get(t.escapedText),a=Gi(i,n);return Yi(r,i,a,!1),a}}(c,s,r,n);if(void 0===u&&"default"===s.escapedText){var _=null===(i=o.declarations)||void 0===i?void 0:i.find(e.isSourceFile);(Ri(a)||Bi(_,o,n,a))&&(u=ua(o,n)||Gi(o,n));}var d=u&&l&&u!==l?function(t,r){if(t===we&&r===we)return we;if(790504&t.flags)return t;var n=ri(t.flags|r.flags,t.escapedName);return n.declarations=e.deduplicate(e.concatenate(t.declarations,r.declarations),e.equateValues),n.parent=t.parent||r.parent,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),r.members&&(n.members=new e.Map(r.members)),t.exports&&(n.exports=new e.Map(t.exports)),n}(l,u):u||l;return d||Ui(o,c,t,s),d}}}function Ui(t,r,i,a){var o,s=na(t,i),c=e.declarationNameToString(a),l=Dh(a,r);if(void 0!==l){var u=ro(l),_=Qn(a,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,s,c,u);l.valueDeclaration&&e.addRelatedInfo(_,e.createDiagnosticForNode(l.valueDeclaration,e.Diagnostics._0_is_declared_here,u));}else (null===(o=t.exports)||void 0===o?void 0:o.has("default"))?Qn(a,e.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,s,c):function(t,r,i,a,o){var s,c,l=null===(c=null===(s=a.valueDeclaration)||void 0===s?void 0:s.locals)||void 0===c?void 0:c.get(r.escapedText),u=a.exports;if(l){var _=null==u?void 0:u.get("export=");if(_)ka(_,l)?function(t,r,n,i){q>=e.ModuleKind.ES2015?Qn(r,e.getESModuleInterop(K)?e.Diagnostics._0_can_only_be_imported_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):e.isInJSFile(t)?Qn(r,e.getESModuleInterop(K)?e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):Qn(r,e.getESModuleInterop(K)?e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,i);}(t,r,i,o):Qn(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);else {var d=u?e.find(El(u),(function(e){return !!ka(e,l)})):void 0,p=d?Qn(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2,o,i,ro(d)):Qn(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported,o,i);l.declarations&&e.addRelatedInfo.apply(void 0,n$4([p],e.map(l.declarations,(function(t,r){return e.createDiagnosticForNode(t,0===r?e.Diagnostics._0_is_declared_here:e.Diagnostics.and_here,i)})),!1));}}else Qn(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);}(i,a,c,t,s);}function Ki(t){if(e.isVariableDeclaration(t)&&t.initializer&&e.isPropertyAccessExpression(t.initializer))return t.initializer}function Vi(t,r,n){if("default"===e.idText(t.propertyName||t.name)){var i=Ji(t),a=i&&oa(t,i);if(a)return ji(a,t,!!n)}var o=t.parent.parent.moduleSpecifier?zi(t.parent.parent,t,n):ia(t.propertyName||t.name,r,!1,n);return Yi(t,void 0,o,!1),o}function qi(t,r){return e.isClassExpression(t)?Ix(t).symbol:e.isEntityName(t)||e.isEntityNameExpression(t)?ia(t,901119,!0,r)||(Ix(t),di(t).resolvedSymbol):void 0}function Wi(t,r){switch(void 0===r&&(r=!1),t.kind){case 268:case 257:return function(t,r){var n=Ki(t);if(n){var i=e.getLeftmostAccessExpression(n.expression).arguments[0];return e.isIdentifier(n.name)?Gi(dl(Bl(i),n.name.escapedText)):void 0}if(e.isVariableDeclaration(t)||280===t.moduleReference.kind){var a=oa(t,e.getExternalModuleRequireArgument(t)||e.getExternalModuleImportEqualsDeclarationExpression(t)),o=ua(a);return Yi(t,a,o,!1),o}var s=ra(t.moduleReference,r);return function(t,r){if(Yi(t,void 0,r,!1)&&!t.isTypeOnly){var n=$i(Da(t)),i=278===n.kind,a=i?e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type,o=i?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,s=e.unescapeLeadingUnderscores(n.name.escapedText);e.addRelatedInfo(Qn(t.moduleReference,a),e.createDiagnosticForNode(n,o,s));}}(t,s),s}(t,r);case 270:return function(e,t){var r=oa(e,e.parent.moduleSpecifier);if(r)return ji(r,e,t)}(t,r);case 271:return function(e,t){var r=e.parent.parent.moduleSpecifier,n=oa(e,r),i=_a(n,r,t,!1);return Yi(e,n,i,!1),i}(t,r);case 277:return function(e,t){var r=e.parent.moduleSpecifier,n=r&&oa(e,r),i=r&&_a(n,r,t,!1);return Yi(e,n,i,!1),i}(t,r);case 273:case 205:return function(t,r){if(e.isImportSpecifier(t)&&"default"===e.idText(t.propertyName||t.name)){var n=Ji(t),i=n&&oa(t,n);if(i)return ji(i,t,r)}var a=e.isBindingElement(t)?e.getRootDeclaration(t):t.parent.parent.parent,o=Ki(a),s=zi(a,o||t,r),c=t.propertyName||t.name;return o&&s&&e.isIdentifier(c)?Gi(dl(ds(s),c.escapedText),r):(Yi(t,void 0,s,!1),s)}(t,r);case 278:return Vi(t,901119,r);case 274:case 223:return function(t,r){var n=qi(e.isExportAssignment(t)?t.expression:t.right,r);return Yi(t,void 0,n,!1),n}(t,r);case 267:return function(e,t){var r=ua(e.parent.symbol,t);return Yi(e,void 0,r,!1),r}(t,r);case 300:return ia(t.name,901119,!0,r);case 299:return qi(t.initializer,r);case 209:case 208:return function(t,r){if(e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind)return qi(t.parent.right,r)}(t,r);default:return e.Debug.fail()}}function Hi(e,t){return void 0===t&&(t=901119),!(!e||2097152!=(e.flags&(2097152|t))&&!(2097152&e.flags&&67108864&e.flags))}function Gi(e,t){return !t&&Hi(e)?Qi(e):e}function Qi(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=_i(t);if(r.aliasTarget)r.aliasTarget===Ie&&(r.aliasTarget=we);else {r.aliasTarget=Ie;var n=Fi(t);if(!n)return e.Debug.fail();var i=Wi(n);r.aliasTarget===Ie?r.aliasTarget=i||we:Qn(n,e.Diagnostics.Circular_definition_of_import_alias_0,ro(t));}return r.aliasTarget}function Xi(t){for(var r,n=t.flags;2097152&t.flags;){var i=Qi(t);if(i===we)return 67108863;if(i===t||(null==r?void 0:r.has(i)))break;2097152&i.flags&&(r?r.add(i):r=new e.Set([t,i])),n|=i.flags,t=i;}return n}function Yi(t,r,n,i){if(!t||e.isPropertyAccessExpression(t))return !1;var a=Da(t);if(e.isTypeOnlyImportOrExportDeclaration(t))return _i(a).typeOnlyDeclaration=t,!0;var o=_i(a);return Zi(o,r,i)||Zi(o,n,i)}function Zi(t,r,n){var i,a,o;if(r&&(void 0===t.typeOnlyDeclaration||n&&!1===t.typeOnlyDeclaration)){var s=null!==(a=null===(i=r.exports)||void 0===i?void 0:i.get("export="))&&void 0!==a?a:r,c=s.declarations&&e.find(s.declarations,e.isTypeOnlyImportOrExportDeclaration);t.typeOnlyDeclaration=null!==(o=null!=c?c:_i(s).typeOnlyDeclaration)&&void 0!==o&&o;}return !!t.typeOnlyDeclaration}function $i(e,t){if(2097152&e.flags){var r=_i(e);return void 0===t?r.typeOnlyDeclaration||void 0:r.typeOnlyDeclaration&&Xi(Qi(r.typeOnlyDeclaration.symbol))&t?r.typeOnlyDeclaration:void 0}}function ea(e){var t=Da(e),r=Qi(t);r&&(r===we||111551&Xi(r)&&!ZT(r)&&!$i(t,111551))&&ta(t);}function ta(t){var r=_i(t);if(!r.referenced){r.referenced=!0;var n=Fi(t);if(!n)return e.Debug.fail();e.isInternalModuleImportEqualsDeclaration(n)&&111551&Xi(Gi(t))&&Ix(n.moduleReference);}}function ra(t,r){return 79===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),79===t.kind||163===t.parent.kind?ia(t,1920,!1,r):(e.Debug.assert(268===t.parent.kind),ia(t,901119,!1,r))}function na(e,t){return e.parent?na(e.parent,t)+"."+ro(e):ro(e,t,void 0,36)}function ia(t,r,n,i,a){if(!e.nodeIsMissing(t)){var o,s=1920|(e.isInJSFile(t)?111551&r:0);if(79===t.kind){var c=r===s||e.nodeIsSynthesized(t)?e.Diagnostics.Cannot_find_namespace_0:_m(e.getFirstIdentifier(t)),l=e.isInJSFile(t)&&!e.nodeIsSynthesized(t)?function(t,r){if(ku(t.parent)){var n=function(t){if(!e.findAncestor(t,(function(t){return e.isJSDocNode(t)||8388608&t.flags?e.isJSDocTypeAlias(t):"quit"}))){var r=e.getJSDocHost(t);if(r&&e.isExpressionStatement(r)&&e.isPrototypePropertyAssignment(r.expression)&&(n=Da(r.expression.left)))return aa(n);if(r&&e.isFunctionExpression(r)&&e.isPrototypePropertyAssignment(r.parent)&&e.isExpressionStatement(r.parent.parent)&&(n=Da(r.parent.left)))return aa(n);if(r&&(e.isObjectLiteralMethod(r)||e.isPropertyAssignment(r))&&e.isBinaryExpression(r.parent.parent)&&6===e.getAssignmentDeclarationKind(r.parent.parent)&&(n=Da(r.parent.parent.left)))return aa(n);var n,i=e.getEffectiveJSDocHost(t);if(i&&e.isFunctionLike(i))return (n=Da(i))&&n.valueDeclaration}}(t.parent);if(n)return vi(n,t.escapedText,r,void 0,t,!0)}}(t,r):void 0;if(!(o=xa(vi(a||t,t.escapedText,r,n||l?void 0:c,t,!0,!1))))return xa(l)}else {if(163!==t.kind&&208!==t.kind)throw e.Debug.assertNever(t,"Unknown entity name kind.");var u=163===t.kind?t.left:t.expression,_=163===t.kind?t.right:t.name,d=ia(u,s,n,!1,a);if(!d||e.nodeIsMissing(_))return;if(d===we)return d;if(d.valueDeclaration&&e.isInJSFile(d.valueDeclaration)&&e.isVariableDeclaration(d.valueDeclaration)&&d.valueDeclaration.initializer&&Ab(d.valueDeclaration.initializer)){var p=d.valueDeclaration.initializer.arguments[0],f=oa(p,p);if(f){var g=ua(f);g&&(d=g);}}if(!(o=xa(fi(ya(d),_.escapedText,r)))){if(!n){var m=na(d),y=e.declarationNameToString(_),v=Dh(_,d);if(v)return void Qn(_,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,m,y,ro(v));var h=e.isQualifiedName(t)&&function(t){for(;e.isQualifiedName(t.parent);)t=t.parent;return t}(t),b=qt&&788968&r&&h&&!e.isTypeOfExpression(h.parent)&&function(t){var r=e.getFirstIdentifier(t),n=vi(r,r.escapedText,111551,void 0,r,!0);if(n){for(;e.isQualifiedName(r.parent);){if(!(n=dl(ds(n),r.parent.right.escapedText)))return;r=r.parent;}return n}}(h);if(b)return void Qn(h,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.entityNameToString(h));if(1920&r&&e.isQualifiedName(t.parent)){var x=xa(fi(ya(d),_.escapedText,788968));if(x)return void Qn(t.parent.right,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,ro(x),e.unescapeLeadingUnderscores(t.parent.right.escapedText))}Qn(_,e.Diagnostics.Namespace_0_has_no_exported_member_1,m,y);}return}}return e.Debug.assert(0==(1&e.getCheckFlags(o)),"Should never get an instantiated symbol here."),!e.nodeIsSynthesized(t)&&e.isEntityName(t)&&(2097152&o.flags||274===t.parent.kind)&&Yi(e.getAliasDeclarationFromName(t),o,void 0,!0),o.flags&r||i?o:Qi(o)}}function aa(t){var r=t.parent.valueDeclaration;if(r)return (e.isAssignmentDeclaration(r)?e.getAssignedExpandoInitializer(r):e.hasOnlyExpressionInitializer(r)?e.getDeclaredExpandoInitializer(r):void 0)||r}function oa(t,r,n){var i=e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;return sa(t,r,n?void 0:i)}function sa(t,r,n,i){return void 0===i&&(i=!1),e.isStringLiteralLike(r)?ca(t,r.text,n,r,i):void 0}function ca(r,n,i,a,o){var s,c,l,u,_,d,p,f;void 0===o&&(o=!1),e.startsWith(n,"@types/")&&Qn(a,L=e.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,e.removePrefix(n,"@types/"),n);var g=Nl(n,!0);if(g)return g;var m=e.getSourceFileOfNode(r),y=e.isStringLiteralLike(r)?r:(null===(s=e.findAncestor(r,e.isImportCall))||void 0===s?void 0:s.arguments[0])||(null===(c=e.findAncestor(r,e.isImportDeclaration))||void 0===c?void 0:c.moduleSpecifier)||(null===(l=e.findAncestor(r,e.isExternalModuleImportEqualsDeclaration))||void 0===l?void 0:l.moduleReference.expression)||(null===(u=e.findAncestor(r,e.isExportDeclaration))||void 0===u?void 0:u.moduleSpecifier)||(null===(_=e.isModuleDeclaration(r)?r:r.parent&&e.isModuleDeclaration(r.parent)&&r.parent.name===r?r.parent:void 0)||void 0===_?void 0:_.name)||(null===(d=e.isLiteralImportTypeNode(r)?r:void 0)||void 0===d?void 0:d.argument.literal),v=y&&e.isStringLiteralLike(y)?e.getModeForUsageLocation(m,y):m.impliedNodeFormat,h=e.getResolvedModule(m,n,v),b=h&&e.getResolutionDiagnostic(K,h),x=h&&(!b||b===e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&t.getSourceFile(h.resolvedFileName);if(x){if(b&&Qn(a,b,n,h.resolvedFileName),x.symbol){if(h.isExternalLibraryImport&&!e.resolutionExtensionIsTSOrJson(h.extension)&&la(!1,a,h,n),e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.NodeNext){var D=m.impliedNodeFormat===e.ModuleKind.CommonJS&&!e.findAncestor(r,e.isImportCall)||!!e.findAncestor(r,e.isImportEqualsDeclaration),S=e.findAncestor(r,(function(t){return e.isImportTypeNode(t)||e.isExportDeclaration(t)||e.isImportDeclaration(t)})),T=S&&e.isImportTypeNode(S)?null===(p=S.assertions)||void 0===p?void 0:p.assertClause:null==S?void 0:S.assertClause;if(D&&x.impliedNodeFormat===e.ModuleKind.ESNext&&!e.getResolutionModeOverrideForClause(T))if(e.findAncestor(r,e.isImportEqualsDeclaration))Qn(a,e.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead,n);else {var C=void 0,E=e.tryGetExtensionFromPath(m.fileName);if(".ts"===E||".js"===E||".tsx"===E||".jsx"===E){var k=m.packageJsonScope,N=".ts"===E?".mts":".js"===E?".mjs":void 0;C=k&&!k.contents.packageJsonContent.type?N?e.chainDiagnosticMessages(void 0,e.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1,N,e.combinePaths(k.packageDirectory,"package.json")):e.chainDiagnosticMessages(void 0,e.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0,e.combinePaths(k.packageDirectory,"package.json")):N?e.chainDiagnosticMessages(void 0,e.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module,N):e.chainDiagnosticMessages(void 0,e.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module);}Pn.add(e.createDiagnosticForNodeFromMessageChain(a,e.chainDiagnosticMessages(C,e.Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead,n)));}}return xa(x.symbol)}i&&Qn(a,e.Diagnostics.File_0_is_not_a_module,x.fileName);}else {if(Kt){var A=e.findBestPatternMatch(Kt,(function(e){return e.pattern}),n);if(A){var F=Vt&&Vt.get(n);return xa(F||A.symbol)}}if(h&&!e.resolutionExtensionIsTSOrJson(h.extension)&&void 0===b||b===e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type)o?Qn(a,L=e.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,h.resolvedFileName):la(Z&&!!i,a,h,n);else if(i){if(h){var P=t.getProjectReferenceRedirect(h.resolvedFileName);if(P)return void Qn(a,e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,P,h.resolvedFileName)}if(b)Qn(a,b,n,h.resolvedFileName);else {var w=e.tryExtractTSExtension(n),I=e.pathIsRelative(n)&&!e.hasExtension(n),O=e.getEmitModuleResolutionKind(K),M=O===e.ModuleResolutionKind.Node16||O===e.ModuleResolutionKind.NodeNext;if(w){var L=e.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead,R=e.removeExtension(n,w);q>=e.ModuleKind.ES2015&&(R+=".mts"===w?".mjs":".cts"===w?".cjs":".js"),Qn(a,L,w,R);}else if(!K.resolveJsonModule&&e.fileExtensionIs(n,".json")&&e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.Classic&&e.hasJsonModuleEmitEnabled(K))Qn(a,e.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(v===e.ModuleKind.ESNext&&M&&I){var B=e.getNormalizedAbsolutePath(n,e.getDirectoryPath(m.path)),j=null===(f=zn.find((function(e){var r=e[0];return t.fileExists(B+r)})))||void 0===f?void 0:f[1];j?Qn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,n+j):Qn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);}else Qn(a,i,n);}}}}function la(t,r,n,i){var a,o=n.packageId,s=n.resolvedFileName,c=!e.isExternalModuleNameRelative(i)&&o?(a=o.name,f().has(e.getTypesPackageName(a))?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,o.name,e.mangleScopedPackageName(o.name)):function(e){return !!f().get(e)}(o.name)?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,o.name,i):e.chainDiagnosticMessages(void 0,e.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,i,e.mangleScopedPackageName(o.name))):void 0;Yn(t,r,e.chainDiagnosticMessages(c,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,i,s));}function ua(t,r){if(null==t?void 0:t.exports){var n=function(t,r){if(!t||t===we||t===r||1===r.exports.size||2097152&t.flags)return t;var n=_i(t);if(n.cjsExportMerged)return n.cjsExportMerged;var i=33554432&t.flags?t:ai(t);return i.flags=512|i.flags,void 0===i.exports&&(i.exports=e.createSymbolTable()),r.exports.forEach((function(e,t){"export="!==t&&i.exports.set(t,i.exports.has(t)?oi(i.exports.get(t),e):e);})),_i(i).cjsExportMerged=i,n.cjsExportMerged=i}(xa(Gi(t.exports.get("export="),r)),xa(t));return xa(n)||t}}function _a(t,r,n,i){var a,o=ua(t,n);if(!n&&o){if(!(i||1539&o.flags||e.getDeclarationOfKind(o,308))){var s=q>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop";return Qn(r,e.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,s),o}var c=r.parent;if(e.isImportDeclaration(c)&&e.getNamespaceDeclarationNode(c)||e.isImportCall(c)){var l=e.isImportCall(c)?c.arguments[0]:c.moduleSpecifier,u=ds(o),_=kb(u,o,t,l);if(_)return da(o,_,c);var d=null===(a=null==t?void 0:t.declarations)||void 0===a?void 0:a.find(e.isSourceFile),p=d&&Li(Mi(l),d.impliedNodeFormat);if(e.getESModuleInterop(K)||p){var f=pl(u,0);if(f&&f.length||(f=pl(u,1)),f&&f.length||dl(u,"default",!0)||p)return da(o,Nb(u,o,t,l),c)}}}return o}function da(t,r,n){var i=ri(t.flags,t.escapedName);i.declarations=t.declarations?t.declarations.slice():[],i.parent=t.parent,i.target=t,i.originatingImport=n,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(i.constEnumOnlyModule=!0),t.members&&(i.members=new e.Map(t.members)),t.exports&&(i.exports=new e.Map(t.exports));var a=Rc(r);return i.type=Ja(i,a.members,e.emptyArray,e.emptyArray,a.indexInfos),i}function pa(e){return void 0!==e.exports.get("export=")}function fa(e){return El(va(e))}function ga(e,t){var r=va(t);if(r)return r.get(e)}function ma(t){return !(131068&t.flags||1&e.getObjectFlags(t)||If(t)||$f(t))}function ya(e){return 6256&e.flags?nc(e,"resolvedExports"):1536&e.flags?va(e):e.exports||z}function va(e){var t=_i(e);return t.resolvedExports||(t.resolvedExports=ba(e))}function ha(t,r,n,i){r&&r.forEach((function(r,a){if("default"!==a){var o=t.get(a);if(o){if(n&&i&&o&&Gi(o)!==Gi(r)){var s=n.get(a);s.exportsWithDuplicate?s.exportsWithDuplicate.push(i):s.exportsWithDuplicate=[i];}}else t.set(a,r),n&&i&&n.set(a,{specifierText:e.getTextOfNode(i.moduleSpecifier)});}}));}function ba(t){var r=[];return function t(n){if(n&&n.exports&&e.pushIfUnique(r,n)){var i=new e.Map(n.exports),a=n.exports.get("__export");if(a){var o=e.createSymbolTable(),s=new e.Map;if(a.declarations)for(var c=0,l=a.declarations;c<l.length;c++){var u=l[c];ha(o,t(oa(u,u.moduleSpecifier)),s,u);}s.forEach((function(t,r){var n=t.exportsWithDuplicate;if("export="!==r&&n&&n.length&&!i.has(r))for(var a=0,o=n;a<o.length;a++){var c=o[a];Pn.add(e.createDiagnosticForNode(c,e.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,s.get(r).specifierText,e.unescapeLeadingUnderscores(r)));}})),ha(i,o);}return i}}(t=ua(t))||z}function xa(e){var t;return e&&e.mergeId&&(t=fn[e.mergeId])?t:e}function Da(e){return xa(e.symbol&&ac(e.symbol))}function Sa(e){return xa(e.parent&&ac(e.parent))}function Ta(r,i,a){var o=Sa(r);if(o&&!(262144&r.flags)){var s=e.mapDefined(o.declarations,(function(e){return o&&Ca(e,o)})),c=i&&function(r,n){var i,a=e.getSourceFileOfNode(n),o=I(a),s=_i(r);if(s.extendedContainersByFile&&(i=s.extendedContainersByFile.get(o)))return i;if(a&&a.imports){for(var c=0,l=a.imports;c<l.length;c++){var u=l[c];if(!e.nodeIsSynthesized(u)){var _=oa(n,u,!0);_&&Ea(_,r)&&(i=e.append(i,_));}}if(e.length(i))return (s.extendedContainersByFile||(s.extendedContainersByFile=new e.Map)).set(o,i),i}if(s.extendedContainers)return s.extendedContainers;for(var d=0,p=t.getSourceFiles();d<p.length;d++){var f=p[d];if(e.isExternalModule(f)){var g=Da(f);Ea(g,r)&&(i=e.append(i,g));}}return s.extendedContainers=i||e.emptyArray}(r,i),l=function(t,r){var n=!!e.length(t.declarations)&&e.first(t.declarations);if(111551&r&&n&&n.parent&&e.isVariableDeclaration(n.parent)&&(e.isObjectLiteralExpression(n)&&n===n.parent.initializer||e.isTypeLiteralNode(n)&&n===n.parent.type))return Da(n.parent)}(o,a);if(i&&o.flags&Ua(a)&&Ka(o,i,1920,!1))return e.append(e.concatenate(e.concatenate([o],s),c),l);var u=!(o.flags&Ua(a))&&788968&o.flags&&524288&Js(o).flags&&111551===a?za(i,(function(t){return e.forEachEntry(t,(function(e){if(e.flags&Ua(a)&&ds(e)===Js(o))return e}))})):void 0,_=n$4(n$4(u?[u]:[],s,!0),[o],!1);return _=e.append(_,l),e.addRange(_,c)}var d=e.mapDefined(r.declarations,(function(t){if(!e.isAmbientModule(t)&&t.parent){if($a(t.parent))return Da(t.parent);if(e.isModuleBlock(t.parent)&&t.parent.parent&&ua(Da(t.parent.parent))===r)return Da(t.parent.parent)}if(e.isClassExpression(t)&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind&&e.isAccessExpression(t.parent.left)&&e.isEntityNameExpression(t.parent.left.expression))return e.isModuleExportsAccessExpression(t.parent.left)||e.isExportsIdentifier(t.parent.left.expression)?Da(e.getSourceFileOfNode(t)):(Ix(t.parent.left.expression),di(t.parent.left.expression).resolvedSymbol)}));if(e.length(d))return e.mapDefined(d,(function(e){return Ea(e,r)?e:void 0}))}function Ca(e,t){var r=Ya(e),n=r&&r.exports&&r.exports.get("export=");return n&&ka(n,t)?r:void 0}function Ea(t,r){if(t===Sa(r))return r;var n=t.exports&&t.exports.get("export=");if(n&&ka(n,r))return t;var i=ya(t),a=i.get(r.escapedName);return a&&ka(a,r)?a:e.forEachEntry(i,(function(e){if(ka(e,r))return e}))}function ka(e,t){if(xa(Gi(xa(e)))===xa(Gi(xa(t))))return e}function Na(e){return xa(e&&0!=(1048576&e.flags)&&e.exportSymbol||e)}function Aa(e,t){return !!(111551&e.flags||2097152&e.flags&&111551&Xi(e)&&(t||!$i(e)))}function Fa(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r];if(173===i.kind&&e.nodeIsPresent(i.body))return i}}function Pa(t){var r=new v(pe,t);return b++,r.id=b,null===e.tracing||void 0===e.tracing||e.tracing.recordType(r),r}function wa(e){return new v(pe,e)}function Ia(e,t,r){void 0===r&&(r=0);var n=Pa(e);return n.intrinsicName=t,n.objectFlags=r,n}function Oa(e,t){var r=Pa(524288);return r.objectFlags=e,r.symbol=t,r.members=void 0,r.properties=void 0,r.callSignatures=void 0,r.constructSignatures=void 0,r.indexInfos=void 0,r}function Ma(e){var t=Pa(262144);return e&&(t.symbol=e),t}function La(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&95!==e.charCodeAt(2)&&64!==e.charCodeAt(2)&&35!==e.charCodeAt(2)}function Ra(t){var r;return t.forEach((function(e,t){Ba(e,t)&&(r||(r=[])).push(e);})),r||e.emptyArray}function Ba(e,t){return !La(t)&&Aa(e)}function ja(t,r,n,i,a){var o=t;return o.members=r,o.properties=e.emptyArray,o.callSignatures=n,o.constructSignatures=i,o.indexInfos=a,r!==z&&(o.properties=Ra(r)),o}function Ja(e,t,r,n,i){return ja(Oa(16,e),t,r,n,i)}function za(t,r){for(var n,i=function(t){if(t.locals&&!pi(t)&&(n=r(t.locals,void 0,!0,t)))return {value:n};switch(t.kind){case 308:if(!e.isExternalOrCommonJsModule(t))break;case 264:var i=Da(t);if(n=r((null==i?void 0:i.exports)||z,void 0,!0,t))return {value:n};break;case 260:case 228:case 261:var a;if((Da(t).members||z).forEach((function(t,r){788968&t.flags&&(a||(a=e.createSymbolTable())).set(r,t);})),a&&(n=r(a,void 0,!1,t)))return {value:n}}},a=t;a;a=a.parent){var o=i(a);if("object"==typeof o)return o.value}return r(se,void 0,!0)}function Ua(e){return 111551===e?111551:1920}function Ka(t,r,n,i,a){if(void 0===a&&(a=new e.Map),t&&!function(e){if(e.declarations&&e.declarations.length){for(var t=0,r=e.declarations;t<r.length;t++)switch(r[t].kind){case 169:case 171:case 174:case 175:continue;default:return !1}return !0}return !1}(t)){var o=_i(t),s=o.accessibleChainCache||(o.accessibleChainCache=new e.Map),c=za(r,(function(e,t,r,n){return n})),l="".concat(i?0:1,"|").concat(c&&I(c),"|").concat(n);if(s.has(l))return s.get(l);var u=O(t),_=a.get(u);_||a.set(u,_=[]);var d=za(r,p);return s.set(l,d),d}function p(n,a,o){if(e.pushIfUnique(_,n)){var s=function(n,a,o){return g(n.get(t.escapedName),void 0,a)?[t]:e.forEachEntry(n,(function(n){if(2097152&n.flags&&"export="!==n.escapedName&&"default"!==n.escapedName&&!(e.isUMDExportSymbol(n)&&r&&e.isExternalModule(e.getSourceFileOfNode(r)))&&(!i||e.some(n.declarations,e.isExternalModuleImportEqualsDeclaration))&&(!o||!e.some(n.declarations,e.isNamespaceReexportDeclaration))&&(a||!e.getDeclarationOfKind(n,278))){var s=m(n,Qi(n),a);if(s)return s}if(n.escapedName===t.escapedName&&n.exportSymbol&&g(xa(n.exportSymbol),void 0,a))return [t]}))||(n===se?m(le,le,a):void 0)}(n,a,o);return _.pop(),s}}function f(e,t){return !Va(e,r,t)||!!Ka(e.parent,r,Ua(t),i,a)}function g(r,i,a){return (t===(i||r)||xa(t)===xa(i||r))&&!e.some(r.declarations,$a)&&(a||f(xa(r),n))}function m(e,t,r){if(g(e,t,r))return [e];var i=ya(t),a=i&&p(i,!0);return a&&f(e,Ua(n))?[e].concat(a):void 0}}function Va(t,r,n){var i=!1;return za(r,(function(r){var a=xa(r.get(t.escapedName));if(!a)return !1;if(a===t)return !0;var o=2097152&a.flags&&!e.getDeclarationOfKind(a,278);return a=o?Qi(a):a,!!((o?Xi(a):a.flags)&n)&&(i=!0,!0)})),i}function qa(e,t){return 0===Xa(e,t,788968,!1,!0).accessibility}function Wa(e,t){return 0===Xa(e,t,111551,!1,!0).accessibility}function Ha(e,t,r){return 0===Xa(e,t,r,!1,!1).accessibility}function Ga(t,r,n,i,a,o){if(e.length(t)){for(var s,c=!1,l=0,u=t;l<u.length;l++){var _=u[l],d=Ka(_,r,i,!1);if(d){s=_;var p=eo(d[0],a);if(p)return p}if(o&&e.some(_.declarations,$a)){if(a){c=!0;continue}return {accessibility:0}}var f=Ga(Ta(_,r,i),r,n,n===_?Ua(i):i,a,o);if(f)return f}return c?{accessibility:0}:s?{accessibility:1,errorSymbolName:ro(n,r,i),errorModuleName:s!==n?ro(s,r,1920):void 0}:void 0}}function Qa(e,t,r,n){return Xa(e,t,r,n,!0)}function Xa(t,r,n,i,a){if(t&&r){var o=Ga([t],r,t,n,i,a);if(o)return o;var s=e.forEach(t.declarations,Ya);return s&&s!==Ya(r)?{accessibility:2,errorSymbolName:ro(t,r,n),errorModuleName:ro(s),errorNode:e.isInJSFile(r)?r:void 0}:{accessibility:1,errorSymbolName:ro(t,r,n)}}return {accessibility:0}}function Ya(t){var r=e.findAncestor(t,Za);return r&&Da(r)}function Za(t){return e.isAmbientModule(t)||308===t.kind&&e.isExternalOrCommonJsModule(t)}function $a(t){return e.isModuleWithStringLiteralName(t)||308===t.kind&&e.isExternalOrCommonJsModule(t)}function eo(t,r){var n;if(e.every(e.filter(t.declarations,(function(e){return 79!==e.kind})),(function(r){var n,a;if(!yo(r)){var o=Ai(r);if(o&&!e.hasSyntacticModifier(o,1)&&yo(o.parent))return i(r,o);if(e.isVariableDeclaration(r)&&e.isVariableStatement(r.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent,1)&&yo(r.parent.parent.parent))return i(r,r.parent.parent);if(e.isLateVisibilityPaintedStatement(r)&&!e.hasSyntacticModifier(r,1)&&yo(r.parent))return i(r,r);if(e.isBindingElement(r)){if(2097152&t.flags&&e.isInJSFile(r)&&(null===(n=r.parent)||void 0===n?void 0:n.parent)&&e.isVariableDeclaration(r.parent.parent)&&(null===(a=r.parent.parent.parent)||void 0===a?void 0:a.parent)&&e.isVariableStatement(r.parent.parent.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent.parent.parent,1)&&r.parent.parent.parent.parent.parent&&yo(r.parent.parent.parent.parent.parent))return i(r,r.parent.parent.parent.parent);if(2&t.flags){var s=e.findAncestor(r,e.isVariableStatement);return !!e.hasSyntacticModifier(s,1)||!!yo(s.parent)&&i(r,s)}}return !1}return !0})))return {accessibility:0,aliasesToMakeVisible:n};function i(t,i){return r&&(di(t).isVisible=!0,n=e.appendIfUnique(n,i)),!0}}function to(t,r){var n;n=183===t.parent.kind||230===t.parent.kind&&!e.isPartOfTypeNode(t.parent)||164===t.parent.kind?1160127:163===t.kind||208===t.kind||268===t.parent.kind?1920:788968;var i=e.getFirstIdentifier(t),a=vi(r,i.escapedText,n,void 0,void 0,!1);return a&&262144&a.flags&&788968&n||!a&&e.isThisIdentifier(i)&&0===Qa(Da(e.getThisContainer(i,!1)),i,n,!1).accessibility?{accessibility:0}:a&&eo(a,!0)||{accessibility:1,errorSymbolName:e.getTextOfNode(i),errorNode:i}}function ro(t,r,n,i,a){void 0===i&&(i=4);var o=70221824;2&i&&(o|=128),1&i&&(o|=512),8&i&&(o|=16384),32&i&&(o|=134217728),16&i&&(o|=1073741824);var s=4&i?oe.symbolToNode:oe.symbolToEntityName;return a?c(a).getText():e.usingSingleLineStringWriter(c);function c(i){var a=s(t,n,r,o),c=308===(null==r?void 0:r.kind)?e.createPrinter({removeComments:!0,neverAsciiEscape:!0}):e.createPrinter({removeComments:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,a,l,i),i}}function no(t,r,n,i,a){return void 0===n&&(n=0),a?o(a).getText():e.usingSingleLineStringWriter(o);function o(a){var o;o=262144&n?1===i?182:181:1===i?177:176;var s=oe.signatureToSignatureDeclaration(t,o,r,70222336|co(n)),c=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,s,l,e.getTrailingSemicolonDeferringWriter(a)),a}}function io(t,r,n,i){void 0===n&&(n=1064960),void 0===i&&(i=e.createTextWriter(""));var a=K.noErrorTruncation||1&n,o=oe.typeToTypeNode(t,r,70221824|co(n)|(a?1:0),i);if(void 0===o)return e.Debug.fail("should always get typenode");var s={removeComments:t!==Je},c=e.createPrinter(s),l=r&&e.getSourceFileOfNode(r);c.writeNode(4,o,l,i);var u=i.getText(),_=a?2*e.noTruncationMaximumTruncationLength:2*e.defaultMaximumTruncationLength;return _&&u&&u.length>=_?u.substr(0,_-"...".length)+"...":u}function ao(e,t){var r=so(e.symbol)?io(e,e.symbol.valueDeclaration):io(e),n=so(t.symbol)?io(t,t.symbol.valueDeclaration):io(t);return r===n&&(r=oo(e),n=oo(t)),[r,n]}function oo(e){return io(e,void 0,64)}function so(t){return t&&!!t.valueDeclaration&&e.isExpression(t.valueDeclaration)&&!Tp(t.valueDeclaration)}function co(e){return void 0===e&&(e=0),848330091&e}function lo(t){return !!(t.symbol&&32&t.symbol.flags&&(t===Ps(t.symbol)||524288&t.flags&&16777216&e.getObjectFlags(t)))}function uo(t,r,n,i){return void 0===n&&(n=16384),i?a(i).getText():e.usingSingleLineStringWriter(a);function a(i){var a=e.factory.createTypePredicateNode(2===t.kind||3===t.kind?e.factory.createToken(129):void 0,1===t.kind||3===t.kind?e.factory.createIdentifier(t.parameterName):e.factory.createThisTypeNode(),t.type&&oe.typeToTypeNode(t.type,r,70222336|co(n))),o=e.createPrinter({removeComments:!0}),s=r&&e.getSourceFileOfNode(r);return o.writeNode(4,a,s,i),i}}function _o(e){return 8===e?"private":16===e?"protected":"public"}function po(t){return t&&t.parent&&265===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function fo(t){return 308===t.kind||e.isAmbientModule(t)}function go(t,r){var n=_i(t).nameType;if(n){if(384&n.flags){var i=""+n.value;return e.isIdentifierText(i,e.getEmitScriptTarget(K))||e.isNumericLiteralName(i)?e.isNumericLiteralName(i)&&e.startsWith(i,"-")?"[".concat(i,"]"):i:'"'.concat(e.escapeString(i,34),'"')}if(8192&n.flags)return "[".concat(mo(n.symbol,r),"]")}}function mo(t,r){if(r&&"default"===t.escapedName&&!(16384&r.flags)&&(!(16777216&r.flags)||!t.declarations||r.enclosingDeclaration&&e.findAncestor(t.declarations[0],fo)!==e.findAncestor(r.enclosingDeclaration,fo)))return "default";if(t.declarations&&t.declarations.length){var n=e.firstDefined(t.declarations,(function(t){return e.getNameOfDeclaration(t)?t:void 0})),i=n&&e.getNameOfDeclaration(n);if(n&&i){if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n))return e.symbolName(t);if(e.isComputedPropertyName(i)&&!(4096&e.getCheckFlags(t))){var a=_i(t).nameType;if(a&&384&a.flags){var o=go(t,r);if(void 0!==o)return o}}return e.declarationNameToString(i)}if(n||(n=t.declarations[0]),n.parent&&257===n.parent.kind)return e.declarationNameToString(n.parent.name);switch(n.kind){case 228:case 215:case 216:return !r||r.encounteredError||131072&r.flags||(r.encounteredError=!0),228===n.kind?"(Anonymous class)":"(Anonymous function)"}}var s=go(t,r);return void 0!==s?s:e.symbolName(t)}function yo(t){if(t){var r=di(t);return void 0===r.isVisible&&(r.isVisible=!!function(){switch(t.kind){case 341:case 348:case 342:return !!(t.parent&&t.parent.parent&&t.parent.parent.parent&&e.isSourceFile(t.parent.parent.parent));case 205:return yo(t.parent.parent);case 257:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return !1;case 264:case 260:case 261:case 262:case 259:case 263:case 268:if(e.isExternalModuleAugmentation(t))return !0;var r=So(t);return 1&e.getCombinedModifierFlags(t)||268!==t.kind&&308!==r.kind&&16777216&r.flags?yo(r):pi(r);case 169:case 168:case 174:case 175:case 171:case 170:if(e.hasEffectiveModifier(t,24))return !1;case 173:case 177:case 176:case 178:case 166:case 265:case 181:case 182:case 184:case 180:case 185:case 186:case 189:case 190:case 193:case 199:return yo(t.parent);case 270:case 271:case 273:return !1;case 165:case 308:case 267:return !0;default:return !1}}()),r.isVisible}return !1}function vo(t,r){var n,i,a;return t.parent&&274===t.parent.kind?n=vi(t,t.escapedText,2998271,void 0,t,!1):278===t.parent.kind&&(n=Vi(t.parent,2998271)),n&&((a=new e.Set).add(O(n)),function t(n){e.forEach(n,(function(n){var o=Ai(n)||n;if(r?di(n).isVisible=!0:(i=i||[],e.pushIfUnique(i,o)),e.isInternalModuleImportEqualsDeclaration(n)){var s=n.moduleReference,c=vi(n,e.getFirstIdentifier(s).escapedText,901119,void 0,void 0,!1);c&&a&&e.tryAddToSet(a,O(c))&&t(c.declarations);}}));}(n.declarations)),i}function ho(e,t){var r=bo(e,t);if(r>=0){for(var n=un.length,i=r;i<n;i++)_n[i]=!1;return !1}return un.push(e),_n.push(!0),dn.push(t),!0}function bo(e,t){for(var r=un.length-1;r>=0;r--){if(xo(un[r],dn[r]))return -1;if(un[r]===e&&dn[r]===t)return r}return -1}function xo(t,r){switch(r){case 0:return !!_i(t).type;case 5:return !!di(t).resolvedEnumType;case 2:return !!_i(t).declaredType;case 1:return !!t.resolvedBaseConstructorType;case 3:return !!t.resolvedReturnType;case 4:return !!t.immediateBaseConstraint;case 6:return !!t.resolvedTypeArguments;case 7:return !!t.baseTypesResolved;case 8:return !!_i(t).writeType}return e.Debug.assertNever(r)}function Do(){return un.pop(),dn.pop(),_n.pop()}function So(t){return e.findAncestor(e.getRootDeclaration(t),(function(e){switch(e.kind){case 257:case 258:case 273:case 272:case 271:case 270:return !1;default:return !0}})).parent}function To(e,t){var r=dl(e,t);return r?ds(r):void 0}function Co(e){return e&&0!=(1&e.flags)}function Eo(e){return e===je||!!(1&e.flags&&e.aliasSymbol)}function ko(e,t){if(0!==t)return jo(e,!1,t);var r=Da(e);return r&&_i(r).type||jo(e,!1,t)}function No(t,r,i){if(131072&(t=Zm(t,(function(e){return !(98304&e.flags)}))).flags)return Ct;if(1048576&t.flags)return ty(t,(function(e){return No(e,r,i)}));for(var a=b_(e.map(r,M_)),o=[],s=[],c=0,l=zc(t);c<l.length;c++){var u=L_(g=l[c],8576);Ip(u,a)||24&e.getDeclarationModifierFlagsFromSymbol(g)||!Id(g)?s.push(u):o.push(g);}if(rd(t)||nd(a)){if(s.length&&(a=b_(n$4([a],s,!0))),131072&a.flags)return t;var _=(Ar||(Ar=Lu("Omit",2,!0)||we),Ar===we?void 0:Ar);return _?yu(_,[t,a]):je}for(var d=e.createSymbolTable(),p=0,f=o;p<f.length;p++){var g=f[p];d.set(g.escapedName,Od(g,!1));}var m=Ja(i,d,e.emptyArray,e.emptyArray,hl(t));return m.objectFlags|=4194304,m}function Ao(e){return !!(465829888&e.flags)&&vx(Gc(e)||Ke,32768)}function Fo(e){return Fm(Xm(e,Ao)?ty(e,(function(e){return 465829888&e.flags?Qc(e):e})):e,524288)}function Po(e,t){var r=wo(e);return r?Dy(r,t):t}function wo(t){var r=function(e){var t=e.parent.parent;switch(t.kind){case 205:case 299:return wo(t);case 206:return wo(e.parent);case 257:return t.initializer;case 223:return t.right}}(t);if(r&&r.flowNode){var n=Io(t);if(n){var i=e.setTextRange(e.parseNodeFactory.createStringLiteral(n),t),a=e.isLeftHandSideExpression(r)?r:e.parseNodeFactory.createParenthesizedExpression(r),o=e.setTextRange(e.parseNodeFactory.createElementAccessExpression(a,i),t);return e.setParent(i,o),e.setParent(o,t),a!==r&&e.setParent(a,o),o.flowNode=r.flowNode,o}}}function Io(e){var t=e.parent;return 205===e.kind&&203===t.kind?Oo(e.propertyName||e.name):299===e.kind||300===e.kind?Oo(e.name):""+t.elements.indexOf(e)}function Oo(e){var t=M_(e);return 384&t.flags?""+t.value:void 0}function Mo(t,r){if(Co(r))return r;var n,i=t.parent;if(G&&16777216&t.flags&&e.isParameterDeclaration(t)?r=lg(r):!G||!i.parent.initializer||65536&Am(zm(i.parent.initializer))||(r=Fm(r,524288)),203===i.kind)if(t.dotDotDotToken){if(2&(r=sl(r)).flags||!Sv(r))return Qn(t,e.Diagnostics.Rest_types_may_only_be_created_from_object_types),je;for(var a=[],o=0,s=i.elements;o<s.length;o++){var c=s[o];c.dotDotDotToken||a.push(c.propertyName||c.name);}n=No(r,a,t.symbol);}else {var l=t.propertyName||t.name;n=Po(t,ld(r,M_(l),32,l));}else {var u=fS(65|(t.dotDotDotToken?0:128),r,qe,i),_=i.elements.indexOf(t);n=t.dotDotDotToken?Ym(r,$f)?ty(r,(function(e){return l_(e,_)})):$u(u):Bf(r)?Po(t,_d(r,Jd(_),32|(gv(t)?16:0),t.name)||je):u;}return t.initializer?e.getEffectiveTypeAnnotationNode(e.walkUpBindingElementsAndPatterns(t))?!G||16777216&Am(Mx(t,0))?n:Fo(n):Lx(t,b_([Fo(n),Mx(t,0)],2)):n}function Lo(t){var r=e.getJSDocType(t);if(r)return Hd(r)}function Ro(t){var r=e.skipParentheses(t,!0);return 206===r.kind&&0===r.elements.length}function Bo(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),G&&r?cg(e,t):e}function jo(t,r,n){if(e.isVariableDeclaration(t)&&246===t.parent.parent.kind){var i=z_(Yv(Zx(t.parent.parent.expression,n)));return 4456448&i.flags?U_(i):Ye}if(e.isVariableDeclaration(t)&&247===t.parent.parent.kind)return pS(t.parent.parent)||Le;if(e.isBindingPattern(t.parent))return function(e){var t=e.dotDotDotToken?64:0,r=ko(e.parent.parent,t);return r&&Mo(e,r)}(t);var a,o,s=e.isPropertyDeclaration(t)&&!e.hasAccessorModifier(t)||e.isPropertySignature(t),c=r&&(s&&!!t.questionToken||e.isParameter(t)&&(!!t.questionToken||kl(t))||Fl(t)),l=ts(t);if(l)return Bo(l,s,c);if((Z||e.isInJSFile(t))&&e.isVariableDeclaration(t)&&!e.isBindingPattern(t.name)&&!(1&e.getCombinedModifierFlags(t))&&!(16777216&t.flags)){if(!(2&e.getCombinedNodeFlags(t)||t.initializer&&(a=t.initializer,o=e.skipParentheses(a,!0),104!==o.kind&&(79!==o.kind||dm(o)!==ce))))return Re;if(t.initializer&&Ro(t.initializer))return nr}if(e.isParameter(t)){var u=t.parent;if(175===u.kind&&ec(u)){var _=e.getDeclarationOfKind(Da(t.parent),174);if(_){var d=Ol(_),p=BC(u);return p&&t===p?(e.Debug.assert(!p.type),ds(d.thisParameter)):Ul(d)}}var f=function(e,t){var r=Ml(e);if(r){var n=e.parameters.indexOf(t);return t.dotDotDotToken?Kb(r,n):zb(r,n)}}(u,t);if(f)return f;if(y="this"===t.symbol.escapedName?Ky(u):Vy(t))return Bo(y,!1,c)}if(e.hasOnlyExpressionInitializer(t)&&t.initializer){if(e.isInJSFile(t)&&!e.isParameter(t)){var g=Wo(t,Da(t),e.getDeclaredExpandoInitializer(t));if(g)return g}return Bo(y=Lx(t,Mx(t,n)),s,c)}if(e.isPropertyDeclaration(t)&&(Z||e.isInJSFile(t))){if(e.hasStaticModifier(t)){var m=e.filter(t.parent.members,e.isClassStaticBlockDeclaration);return y=m.length?function(t,r){for(var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=0,a=r;i<a.length;i++){var o=a[i],s=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(s.expression,s),e.setParent(s,o),s.flowNode=o.returnFlowNode;var c=Vo(s,t);if(!Z||c!==Re&&c!==nr||Qn(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,ro(t),io(c)),!Ym(c,Xv))return nS(c)}}(t.symbol,m):2&e.getEffectiveModifierFlags(t)?Cf(t.symbol):void 0,y&&Bo(y,!0,c)}var y,v=Fa(t.parent);return (y=v?Ko(t.symbol,v):2&e.getEffectiveModifierFlags(t)?Cf(t.symbol):void 0)&&Bo(y,!0,c)}return e.isJsxAttribute(t)?rt:e.isBindingPattern(t.name)?Yo(t.name,!1,!0):void 0}function Jo(t){if(t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration)){var r=_i(t);return void 0===r.isConstructorDeclaredProperty&&(r.isConstructorDeclaredProperty=!1,r.isConstructorDeclaredProperty=!!Uo(t)&&e.every(t.declarations,(function(r){return e.isBinaryExpression(r)&&Yy(r)&&(209!==r.left.kind||e.isStringOrNumericLiteralLike(r.left.argumentExpression))&&!Ho(void 0,r,t,r)}))),r.isConstructorDeclaredProperty}return !1}function zo(t){var r=t.valueDeclaration;return r&&e.isPropertyDeclaration(r)&&!e.getEffectiveTypeAnnotationNode(r)&&!r.initializer&&(Z||e.isInJSFile(r))}function Uo(t){if(t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=e.getThisContainer(i,!1);if(a&&(173===a.kind||bb(a)))return a}}function Ko(t,r){var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(i.expression,i),e.setParent(i,r),i.flowNode=r.returnFlowNode;var a=Vo(i,t);return !Z||a!==Re&&a!==nr||Qn(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,ro(t),io(a)),Ym(a,Xv)?void 0:nS(a)}function Vo(t,r){var n=(null==r?void 0:r.valueDeclaration)&&(!zo(r)||2&e.getEffectiveModifierFlags(r.valueDeclaration))&&Cf(r)||qe;return Dy(t,Re,n)}function qo(t,r){var n,i=e.getAssignedExpandoInitializer(t.valueDeclaration);if(i){var a=e.getJSDocTypeTag(i);return a&&a.typeExpression?Hd(a.typeExpression):t.valueDeclaration&&Wo(t.valueDeclaration,t,i)||Qf(Ix(i))}var o=!1,s=!1;if(Jo(t)&&(n=Ko(t,Uo(t))),!n){var c=void 0;if(t.declarations){for(var l=void 0,u=0,_=t.declarations;u<_.length;u++){var d=_[u],p=e.isBinaryExpression(d)||e.isCallExpression(d)?d:e.isAccessExpression(d)?e.isBinaryExpression(d.parent)?d.parent:d:void 0;if(p){var f=e.isAccessExpression(p)?e.getAssignmentDeclarationPropertyAccessKind(p):e.getAssignmentDeclarationKind(p);(4===f||e.isBinaryExpression(p)&&Yy(p,f))&&(Qo(p)?o=!0:s=!0),e.isCallExpression(p)||(l=Ho(l,p,t,d)),l||(c||(c=[])).push(e.isBinaryExpression(p)||e.isCallExpression(p)?Go(t,r,p,f):ct);}}n=l;}if(!n){if(!e.length(c))return je;var g=o&&t.declarations?function(t,r){return e.Debug.assert(t.length===r.length),t.filter((function(t,n){var i=r[n],a=e.isBinaryExpression(i)?i:e.isBinaryExpression(i.parent)?i.parent:void 0;return a&&Qo(a)}))}(c,t.declarations):void 0;if(s){var m=Cf(t);m&&((g||(g=[])).push(m),o=!0);}n=b_(e.some(g,(function(e){return !!(-98305&e.flags)}))?g:c);}}var y=Cg(Bo(n,!1,s&&!o));return t.valueDeclaration&&Zm(y,(function(e){return !!(-98305&e.flags)}))===ct?(Ng(t.valueDeclaration,Le),Le):y}function Wo(t,r,n){var i,a;if(e.isInJSFile(t)&&n&&e.isObjectLiteralExpression(n)&&!n.properties.length){for(var o=e.createSymbolTable();e.isBinaryExpression(t)||e.isPropertyAccessExpression(t);){var s=Da(t);(null===(i=null==s?void 0:s.exports)||void 0===i?void 0:i.size)&&li(o,s.exports),t=e.isBinaryExpression(t)?t.parent:t.parent.parent;}var c=Da(t);(null===(a=null==c?void 0:c.exports)||void 0===a?void 0:a.size)&&li(o,c.exports);var l=Ja(r,o,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=4096,l}}function Ho(t,r,n,i){var a,o=e.getEffectiveTypeAnnotationNode(r.parent);if(o){var s=Cg(Hd(o));if(!t)return s;Eo(t)||Eo(s)||Np(t,s)||aS(void 0,t,i,s);}if(null===(a=n.parent)||void 0===a?void 0:a.valueDeclaration){var c=e.getEffectiveTypeAnnotationNode(n.parent.valueDeclaration);if(c){var l=dl(Hd(c),n.escapedName);if(l)return ps(l)}}return t}function Go(t,r,n,i){if(e.isCallExpression(n)){if(r)return ds(r);var a=Ix(n.arguments[2]),o=To(a,"value");if(o)return o;var s=To(a,"get");if(s){var c=Jh(s);if(c)return Ul(c)}var l=To(a,"set");if(l){var u=Jh(l);if(u)return Qb(u)}return Le}if(function(t,r){return e.isPropertyAccessExpression(t)&&108===t.expression.kind&&e.forEachChildRecursively(r,(function(e){return gm(t,e)}))}(n.left,n.right))return Le;var _=1===i&&(e.isPropertyAccessExpression(n.left)||e.isElementAccessExpression(n.left))&&(e.isModuleExportsAccessExpression(n.left.expression)||e.isIdentifier(n.left.expression)&&e.isExportsIdentifier(n.left.expression)),d=r?ds(r):_?Rd(Ix(n.right)):Qf(Ix(n.right));if(524288&d.flags&&2===i&&"export="===t.escapedName){var p=Rc(d),f=e.createSymbolTable();e.copyEntries(p.members,f);var g=f.size;r&&!r.exports&&(r.exports=e.createSymbolTable()),(r||t).exports.forEach((function(t,r){var n,i=f.get(r);if(!i||i===t||2097152&t.flags)f.set(r,t);else if(111551&t.flags&&111551&i.flags){if(t.valueDeclaration&&i.valueDeclaration&&e.getSourceFileOfNode(t.valueDeclaration)!==e.getSourceFileOfNode(i.valueDeclaration)){var a=e.unescapeLeadingUnderscores(t.escapedName),o=(null===(n=e.tryCast(i.valueDeclaration,e.isNamedDeclaration))||void 0===n?void 0:n.name)||i.valueDeclaration;e.addRelatedInfo(Qn(t.valueDeclaration,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(o,e.Diagnostics._0_was_also_declared_here,a)),e.addRelatedInfo(Qn(o,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_was_also_declared_here,a));}var s=ri(t.flags|i.flags,r);s.type=b_([ds(t),ds(i)]),s.valueDeclaration=i.valueDeclaration,s.declarations=e.concatenate(i.declarations,t.declarations),f.set(r,s);}else f.set(r,oi(t,i));}));var m=Ja(g!==f.size?void 0:p.symbol,f,p.callSignatures,p.constructSignatures,p.indexInfos);if(g===f.size&&(d.aliasSymbol&&(m.aliasSymbol=d.aliasSymbol,m.aliasTypeArguments=d.aliasTypeArguments),4&e.getObjectFlags(d))){m.aliasSymbol=d.symbol;var y=fu(d);m.aliasTypeArguments=e.length(y)?y:void 0;}return m.objectFlags|=4096&e.getObjectFlags(d),m.symbol&&32&m.symbol.flags&&d===Ps(m.symbol)&&(m.objectFlags|=16777216),m}return zf(d)?(Ng(n,rr),rr):d}function Qo(t){var r=e.getThisContainer(t,!1);return 173===r.kind||259===r.kind||215===r.kind&&!e.isPrototypePropertyAssignment(r.parent)}function Xo(t,r,n){return t.initializer?Bo(Lx(t,Mx(t,0,e.isBindingPattern(t.name)?Yo(t.name,!0,!1):Ke))):e.isBindingPattern(t.name)?Yo(t.name,r,n):(n&&!es(t)&&Ng(t,Le),r?ze:Le)}function Yo(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),203===t.kind?function(t,r,n){var i,a=e.createSymbolTable(),o=131200;e.forEach(t.elements,(function(e){var t=e.propertyName||e.name;if(e.dotDotDotToken)i=eu(Ye,Le,!1);else {var s=M_(t);if(Xs(s)){var c=tc(s),l=ri(4|(e.initializer?16777216:0),c);l.type=Xo(e,r,n),l.bindingElement=e,a.set(l.escapedName,l);}else o|=512;}}));var s=Ja(void 0,a,e.emptyArray,e.emptyArray,i?[i]:e.emptyArray);return s.objectFlags|=o,r&&(s.pattern=t,s.objectFlags|=131072),s}(t,r,n):function(t,r,n){var i,a=t.elements,o=e.lastOrUndefined(a),s=o&&205===o.kind&&o.dotDotDotToken?o:void 0;if(0===a.length||1===a.length&&s)return V>=2?(i=Le,Yu(Gu(!0),[i])):rr;var c=e.map(a,(function(t){return e.isOmittedExpression(t)?Le:Xo(t,r,n)})),l=e.findLastIndex(a,(function(t){return !(t===s||e.isOmittedExpression(t)||gv(t))}),a.length-1)+1,u=a_(c,e.map(a,(function(e,t){return e===s?4:t>=l?2:1})));return r&&((u=du(u)).pattern=t,u.objectFlags|=131072),u}(t,r,n)}function Zo(e,t){return $o(jo(e,!0,0),e,t)}function $o(t,r,n){return t?(4096&t.flags&&(i=r.parent,a=Da(i),(o=sr||(sr=Mu("SymbolConstructor",!1)))&&a&&a===o)&&(t=Kd(r)),n&&Ag(r,t),8192&t.flags&&(e.isBindingElement(r)||!r.type)&&t.symbol!==Da(r)&&(t=ot),Cg(t)):(t=e.isParameter(r)&&r.dotDotDotToken?rr:Le,n&&(es(r)||Ng(r,t)),t);var i,a,o;}function es(t){var r=e.getRootDeclaration(t);return fD(166===r.kind?r.parent:r)}function ts(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return Hd(r)}function rs(t){if(t)switch(t.kind){case 174:return e.getEffectiveReturnTypeNode(t);case 175:return e.getEffectiveSetAccessorTypeAnnotationNode(t);case 169:return e.Debug.assert(e.hasAccessorModifier(t)),e.getEffectiveTypeAnnotationNode(t)}}function ns(e){var t=rs(e);return t&&Hd(t)}function is(t){var r=_i(t);if(!r.type){if(!ho(t,0))return je;var n=e.getDeclarationOfKind(t,174),i=e.getDeclarationOfKind(t,175),a=e.tryCast(e.getDeclarationOfKind(t,169),e.isAutoAccessorPropertyDeclaration),o=n&&e.isInJSFile(n)&&Lo(n)||ns(n)||ns(i)||ns(a)||n&&n.body&&rx(n)||a&&a.initializer&&Zo(a,!0);o||(i&&!fD(i)?Yn(Z,i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,ro(t)):n&&!fD(n)?Yn(Z,n,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,ro(t)):a&&!fD(a)&&Yn(Z,a,e.Diagnostics.Member_0_implicitly_has_an_1_type,ro(t),"any"),o=Le),Do()||(rs(n)?Qn(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ro(t)):rs(i)||rs(a)?Qn(i,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ro(t)):n&&Z&&Qn(n,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,ro(t)),o=Le),r.type=o;}return r.type}function as(t){var r,n=_i(t);if(!n.writeType){if(!ho(t,8))return je;var i=null!==(r=e.getDeclarationOfKind(t,175))&&void 0!==r?r:e.tryCast(e.getDeclarationOfKind(t,169),e.isAutoAccessorPropertyDeclaration),a=ns(i);Do()||(rs(i)&&Qn(i,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ro(t)),a=Le),n.writeType=a||is(t);}return n.writeType}function os(t){var r=Es(Ps(t));return 8650752&r.flags?r:2097152&r.flags?e.find(r.types,(function(e){return !!(8650752&e.flags)})):void 0}function ss(t){var r=_i(t),n=r;if(!r.type){var i=t.valueDeclaration&&Db(t.valueDeclaration,!1);if(i){var a=xb(t,i);a&&(t=r=a);}n.type=r.type=function(t){var r=t.valueDeclaration;if(1536&t.flags&&e.isShorthandAmbientModuleSymbol(t))return Le;if(r&&(223===r.kind||e.isAccessExpression(r)&&223===r.parent.kind))return qo(t);if(512&t.flags&&r&&e.isSourceFile(r)&&r.commonJsModuleIndicator){var n=ua(t);if(n!==t){if(!ho(t,0))return je;var i=xa(t.exports.get("export=")),a=qo(i,i===n?void 0:n);return Do()?a:ls(t)}}var o=Oa(16,t);if(32&t.flags){var s=os(t);return s?N_([o,s]):o}return G&&16777216&t.flags?cg(o):o}(t);}return r.type}function cs(e){var t=_i(e);return t.type||(t.type=Bs(e))}function ls(t){var r=t.valueDeclaration;return e.getEffectiveTypeAnnotationNode(r)?(Qn(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ro(t)),je):(Z&&(166!==r.kind||r.initializer)&&Qn(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,ro(t)),Le)}function us(t){var r=_i(t);return r.type||(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.type=1048576&r.deferralParent.flags?b_(r.deferralConstituents):N_(r.deferralConstituents)),r.type}function _s(t){var r=e.getCheckFlags(t);return 4&t.flags?2&r?65536&r?function(t){var r=_i(t);return !r.writeType&&r.deferralWriteConstituents&&(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.writeType=1048576&r.deferralParent.flags?b_(r.deferralWriteConstituents):N_(r.deferralWriteConstituents)),r.writeType}(t)||us(t):t.writeType||t.type:ds(t):98304&t.flags?1&r?function(e){var t=_i(e);return t.writeType||(t.writeType=hp(_s(t.target),t.mapper))}(t):as(t):ds(t)}function ds(t){var r=e.getCheckFlags(t);return 65536&r?us(t):1&r?function(e){var t=_i(e);return t.type||(t.type=hp(ds(t.target),t.mapper))}(t):262144&r?function(t){if(!t.type){var r=t.mappedType;if(!ho(t,0))return r.containsError=!0,je;var n=hp(Ac(r.target||r),cp(r.mapper,Ec(r),t.keyType)),i=G&&16777216&t.flags&&!vx(n,49152)?cg(n,!0):524288&t.checkFlags?mg(n):n;Do()||(Qn(u,e.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1,ro(t),io(r)),i=je),t.type=i;}return t.type}(t):8192&r?function(e){var t=_i(e);return t.type||(t.type=Vg(e.propertyType,e.mappedType,e.constraintType)),t.type}(t):7&t.flags?function(t){var r=_i(t);if(!r.type){var n=function(t){if(4194304&t.flags)return (r=Js(Sa(t))).typeParameters?_u(r,e.map(r.typeParameters,(function(e){return Le}))):r;var r;if(t===de)return Le;if(134217728&t.flags&&t.valueDeclaration){var n=Da(e.getSourceFileOfNode(t.valueDeclaration)),i=ri(n.flags,"exports");i.declarations=n.declarations?n.declarations.slice():[],i.parent=t,i.target=n,n.valueDeclaration&&(i.valueDeclaration=n.valueDeclaration),n.members&&(i.members=new e.Map(n.members)),n.exports&&(i.exports=new e.Map(n.exports));var a=e.createSymbolTable();return a.set("exports",i),Ja(t,a,e.emptyArray,e.emptyArray,e.emptyArray)}e.Debug.assertIsDefined(t.valueDeclaration);var o,s=t.valueDeclaration;if(e.isCatchClauseVariableDeclarationOrBindingElement(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(void 0===c)return ee?Ke:Le;var l=MT(c);return Co(l)||l===Ke?l:je}if(e.isSourceFile(s)&&e.isJsonSourceFile(s))return s.statements.length?Cg(Qf(Zx(s.statements[0].expression))):Ct;if(e.isAccessor(s))return is(t);if(!ho(t,0))return 512&t.flags&&!(67108864&t.flags)?ss(t):ls(t);if(274===s.kind)o=$o(ts(s)||Ix(s.expression),s);else if(e.isBinaryExpression(s)||e.isInJSFile(s)&&(e.isCallExpression(s)||(e.isPropertyAccessExpression(s)||e.isBindableStaticElementAccessExpression(s))&&e.isBinaryExpression(s.parent)))o=qo(t);else if(e.isPropertyAccessExpression(s)||e.isElementAccessExpression(s)||e.isIdentifier(s)||e.isStringLiteralLike(s)||e.isNumericLiteral(s)||e.isClassDeclaration(s)||e.isFunctionDeclaration(s)||e.isMethodDeclaration(s)&&!e.isObjectLiteralMethod(s)||e.isMethodSignature(s)||e.isSourceFile(s)){if(9136&t.flags)return ss(t);o=e.isBinaryExpression(s.parent)?qo(t):ts(s)||Le;}else if(e.isPropertyAssignment(s))o=ts(s)||Jx(s);else if(e.isJsxAttribute(s))o=ts(s)||Ev(s);else if(e.isShorthandPropertyAssignment(s))o=ts(s)||jx(s.name,0);else if(e.isObjectLiteralMethod(s))o=ts(s)||zx(s,0);else if(e.isParameter(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isVariableDeclaration(s)||e.isBindingElement(s)||e.isJSDocPropertyLikeTag(s))o=Zo(s,!0);else if(e.isEnumDeclaration(s))o=ss(t);else {if(!e.isEnumMember(s))return e.Debug.fail("Unhandled declaration kind! "+e.Debug.formatSyntaxKind(s.kind)+" for "+e.Debug.formatSymbol(t));o=cs(t);}return Do()?o:512&t.flags&&!(67108864&t.flags)?ss(t):ls(t)}(t);r.type||(r.type=n);}return r.type}(t):9136&t.flags?ss(t):8&t.flags?cs(t):98304&t.flags?is(t):2097152&t.flags?function(t){var r=_i(t);if(!r.type){var n=Qi(t),i=t.declarations&&Wi(Fi(t),!0),a=e.firstDefined(null==i?void 0:i.declarations,(function(t){return e.isExportAssignment(t)?ts(t):void 0}));r.type=(null==i?void 0:i.declarations)&&yT(i.declarations)&&t.declarations.length?function(t){var r=e.getSourceFileOfNode(t.declarations[0]),n=e.unescapeLeadingUnderscores(t.escapedName),i=t.declarations.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&e.isModuleExportsAccessExpression(t.expression)})),a=i?e.factory.createPropertyAccessExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("module"),e.factory.createIdentifier("exports")),n):e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),n);return i&&e.setParent(a.expression.expression,a.expression),e.setParent(a.expression,a),e.setParent(a,r),a.flowNode=r.endFlowNode,Dy(a,Re,qe)}(i):yT(t.declarations)?Re:a||(111551&Xi(n)?ds(n):je);}return r.type}(t):je}function ps(e){return fg(ds(e),!!(16777216&e.flags))}function fs(t,r){return void 0!==t&&void 0!==r&&0!=(4&e.getObjectFlags(t))&&t.target===r}function gs(t){return 4&e.getObjectFlags(t)?t.target:t}function ms(t,r){return function t(n){if(7&e.getObjectFlags(n)){var i=gs(n);return i===r||e.some(Ns(i),t)}return !!(2097152&n.flags)&&e.some(n.types,t)}(t)}function ys(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];t=e.appendIfUnique(t,js(Da(a)));}return t}function vs(t,r){for(;;){if((t=t.parent)&&e.isBinaryExpression(t)){var n=e.getAssignmentDeclarationKind(t);if(6===n||3===n){var i=Da(t.left);i&&i.parent&&!e.findAncestor(i.parent.valueDeclaration,(function(e){return t===e}))&&(t=i.parent.valueDeclaration);}}if(!t)return;switch(t.kind){case 260:case 228:case 261:case 176:case 177:case 170:case 181:case 182:case 320:case 259:case 171:case 215:case 216:case 262:case 347:case 348:case 342:case 341:case 197:case 191:var a=vs(t,r);if(197===t.kind)return e.append(a,js(Da(t.typeParameter)));if(191===t.kind)return e.concatenate(a,Dd(t));var o=ys(a,e.getEffectiveTypeParameterDeclarations(t)),s=r&&(260===t.kind||228===t.kind||261===t.kind||bb(t))&&Ps(Da(t)).thisType;return s?e.append(o,s):o;case 343:var c=e.getParameterSymbolFromJSDoc(t);c&&(t=c.valueDeclaration);break;case 323:return a=vs(t,r),t.tags?ys(a,e.flatMap(t.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}))):a}}}function hs(t){var r=32&t.flags?t.valueDeclaration:e.getDeclarationOfKind(t,261);return e.Debug.assert(!!r,"Class was missing valueDeclaration -OR- non-class had no interface declarations"),vs(r)}function bs(t){if(t.declarations){for(var r,n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(261===a.kind||260===a.kind||228===a.kind||bb(a)||e.isTypeAlias(a)){var o=a;r=ys(r,e.getEffectiveTypeParameterDeclarations(o));}}return r}}function xs(e){var t=fl(e,1);if(1===t.length){var r=t[0];if(!r.typeParameters&&1===r.parameters.length&&j(r)){var n=Mb(r.parameters[0]);return Co(n)||Rf(n)===Le}}return !1}function Ds(e){if(fl(e,1).length>0)return !0;if(8650752&e.flags){var t=Gc(e);return !!t&&xs(t)}return !1}function Ss(t){var r=e.getClassLikeDeclarationOfSymbol(t.symbol);return r&&e.getEffectiveBaseTypeNode(r)}function Ts(t,r,n){var i=e.length(r),a=e.isInJSFile(n);return e.filter(fl(t,1),(function(t){return (a||i>=wl(t.typeParameters))&&i<=e.length(t.typeParameters)}))}function Cs(t,r,n){var i=Ts(t,r,n),a=e.map(r,Hd);return e.sameMap(i,(function(t){return e.some(t.typeParameters)?Wl(t,a,e.isInJSFile(n)):t}))}function Es(t){if(!t.resolvedBaseConstructorType){var r=e.getClassLikeDeclarationOfSymbol(t.symbol),n=r&&e.getEffectiveBaseTypeNode(r),i=Ss(t);if(!i)return t.resolvedBaseConstructorType=qe;if(!ho(t,1))return je;var a=Zx(i.expression);if(n&&i!==n&&(e.Debug.assert(!n.typeArguments),Zx(n.expression)),2621440&a.flags&&Rc(a),!Do())return Qn(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,ro(t.symbol)),t.resolvedBaseConstructorType=je;if(!(1&a.flags||a===Xe||Ds(a))){var o=Qn(i.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,io(a));if(262144&a.flags){var s=ou(a),c=Ke;if(s){var l=fl(s,1);l[0]&&(c=Ul(l[0]));}a.symbol.declarations&&e.addRelatedInfo(o,e.createDiagnosticForNode(a.symbol.declarations[0],e.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,ro(a.symbol),io(c)));}return t.resolvedBaseConstructorType=je}t.resolvedBaseConstructorType=a;}return t.resolvedBaseConstructorType}function ks(t,r){Qn(t,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,io(r,void 0,2));}function Ns(t){if(!t.baseTypesResolved){if(ho(t,7)&&(8&t.objectFlags?t.resolvedBaseTypes=[As(t)]:96&t.symbol.flags?(32&t.symbol.flags&&function(t){t.resolvedBaseTypes=e.resolvingEmptyArray;var r=rl(Es(t));if(!(2621441&r.flags))return t.resolvedBaseTypes=e.emptyArray;var n,i=Ss(t),a=r.symbol?Js(r.symbol):void 0;if(r.symbol&&32&r.symbol.flags&&function(e){var t=e.outerTypeParameters;if(t){var r=t.length-1,n=fu(e);return t[r].symbol!==n[r].symbol}return !0}(a))n=mu(i,r.symbol);else if(1&r.flags)n=r;else {var o=Cs(r,i.typeArguments,i);if(!o.length)return Qn(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments),t.resolvedBaseTypes=e.emptyArray;n=Ul(o[0]);}if(Eo(n))return t.resolvedBaseTypes=e.emptyArray;var s=sl(n);if(!Fs(s)){var c=_l(void 0,n),l=e.chainDiagnosticMessages(c,e.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,io(s));return Pn.add(e.createDiagnosticForNodeFromMessageChain(i.expression,l)),t.resolvedBaseTypes=e.emptyArray}if(t===s||ms(s,t))return Qn(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,io(t,void 0,2)),t.resolvedBaseTypes=e.emptyArray;t.resolvedBaseTypes===e.resolvingEmptyArray&&(t.members=void 0),t.resolvedBaseTypes=[s];}(t),64&t.symbol.flags&&function(t){if(t.resolvedBaseTypes=t.resolvedBaseTypes||e.emptyArray,t.symbol.declarations)for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];if(261===i.kind&&e.getInterfaceBaseTypeNodes(i))for(var a=0,o=e.getInterfaceBaseTypeNodes(i);a<o.length;a++){var s=o[a],c=sl(Hd(s));Eo(c)||(Fs(c)?t===c||ms(c,t)?ks(i,t):t.resolvedBaseTypes===e.emptyArray?t.resolvedBaseTypes=[c]:t.resolvedBaseTypes.push(c):Qn(s,e.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members));}}}(t)):e.Debug.fail("type must be class or interface"),!Do()&&t.symbol.declarations))for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];260!==i.kind&&261!==i.kind||ks(i,t);}t.baseTypesResolved=!0;}return t.resolvedBaseTypes}function As(t){return $u(b_(e.sameMap(t.typeParameters,(function(e,r){return 8&t.elementFlags[r]?ld(e,Ze):e}))||e.emptyArray),t.readonly)}function Fs(t){if(262144&t.flags){var r=Gc(t);if(r)return Fs(r)}return !!(67633153&t.flags&&!Lc(t)||2097152&t.flags&&e.every(t.types,Fs))}function Ps(t){var r,n,i,a,o,s=_i(t),c=s;if(!s.declaredType){var l=32&t.flags?1:2,u=xb(t,t.valueDeclaration&&((o=(null==(a=null===(n=null==(i=(r=t.valueDeclaration)&&Db(r,!0))?void 0:i.exports)||void 0===n?void 0:n.get("prototype"))?void 0:a.valueDeclaration)&&function(t){if(!t.parent)return !1;for(var r=t.parent;r&&208===r.kind;)r=r.parent;if(r&&e.isBinaryExpression(r)&&e.isPrototypeAccess(r.left)&&63===r.operatorToken.kind){var n=e.getInitializerOfBinaryExpression(r);return e.isObjectLiteralExpression(n)&&n}}(a.valueDeclaration))?Da(o):void 0));u&&(t=s=u);var _=c.declaredType=s.declaredType=Oa(l,t),d=hs(t),p=bs(t);(d||p||1===l||!function(t){if(!t.declarations)return !0;for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(261===i.kind){if(128&i.flags)return !1;var a=e.getInterfaceBaseTypeNodes(i);if(a)for(var o=0,s=a;o<s.length;o++){var c=s[o];if(e.isEntityNameExpression(c.expression)){var l=ia(c.expression,788968,!0);if(!l||!(64&l.flags)||Ps(l).thisType)return !1}}}}return !0}(t))&&(_.objectFlags|=4,_.typeParameters=e.concatenate(d,p),_.outerTypeParameters=d,_.localTypeParameters=p,_.instantiations=new e.Map,_.instantiations.set(cu(_.typeParameters),_),_.target=_,_.resolvedTypeArguments=_.typeParameters,_.thisType=Ma(t),_.thisType.isThisType=!0,_.thisType.constraint=_);}return s.declaredType}function ws(t){var r,n=_i(t);if(!n.declaredType){if(!ho(t,2))return je;var i=e.Debug.checkDefined(null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias),"Type alias symbol with no valid declaration found"),a=e.isJSDocTypeAlias(i)?i.typeExpression:i.type,o=a?Hd(a):je;if(Do()){var s=bs(t);s&&(n.typeParameters=s,n.instantiations=new e.Map,n.instantiations.set(cu(s),o));}else o=je,342===i.kind?Qn(i.typeExpression.type,e.Diagnostics.Type_alias_0_circularly_references_itself,ro(t)):Qn(e.isNamedDeclaration(i)&&i.name||i,e.Diagnostics.Type_alias_0_circularly_references_itself,ro(t));n.declaredType=o;}return n.declaredType}function Is(t){return !!e.isStringLiteralLike(t)||223===t.kind&&Is(t.left)&&Is(t.right)}function Os(t){var r=t.initializer;if(!r)return !(16777216&t.flags);switch(r.kind){case 10:case 8:case 14:return !0;case 221:return 40===r.operator&&8===r.operand.kind;case 79:return e.nodeIsMissing(r)||!!Da(t.parent).exports.get(r.escapedText);case 223:return Is(r);default:return !1}}function Ms(t){var r=_i(t);if(void 0!==r.enumKind)return r.enumKind;var n=!1;if(t.declarations)for(var i=0,a=t.declarations;i<a.length;i++){var o=a[i];if(263===o.kind)for(var s=0,c=o.members;s<c.length;s++){var l=c[s];if(l.initializer&&e.isStringLiteralLike(l.initializer))return r.enumKind=1;Os(l)||(n=!0);}}return r.enumKind=n?0:1}function Ls(e){return 1024&e.flags&&!(1048576&e.flags)?Js(Sa(e.symbol)):e}function Rs(e){var t=_i(e);if(t.declaredType)return t.declaredType;if(1===Ms(e)){D++;var r=[];if(e.declarations)for(var n=0,i=e.declarations;n<i.length;n++){var a=i[n];if(263===a.kind)for(var o=0,s=a.members;o<s.length;o++){var c=s[o],l=oC(c),u=Ld(Ud(void 0!==l?l:0,D,Da(c)));_i(Da(c)).declaredType=u,r.push(Rd(u));}}if(r.length){var _=b_(r,1,e,void 0);return 1048576&_.flags&&(_.flags|=1024,_.symbol=e),t.declaredType=_}}var d=Pa(32);return d.symbol=e,t.declaredType=d}function Bs(e){var t=_i(e);if(!t.declaredType){var r=Rs(Sa(e));t.declaredType||(t.declaredType=r);}return t.declaredType}function js(e){var t=_i(e);return t.declaredType||(t.declaredType=Ma(e))}function Js(e){return zs(e)||je}function zs(e){return 96&e.flags?Ps(e):524288&e.flags?ws(e):262144&e.flags?js(e):384&e.flags?Rs(e):8&e.flags?Bs(e):2097152&e.flags?function(e){var t=_i(e);return t.declaredType||(t.declaredType=Js(Qi(e)))}(e):void 0}function Us(e){switch(e.kind){case 131:case 157:case 152:case 148:case 160:case 134:case 153:case 149:case 114:case 155:case 144:case 198:return !0;case 185:return Us(e.elementType);case 180:return !e.typeArguments||e.typeArguments.every(Us)}return !1}function Ks(t){var r=e.getEffectiveConstraintOfTypeParameter(t);return !r||Us(r)}function Vs(t){var r=e.getEffectiveTypeAnnotationNode(t);return r?Us(r):!e.hasInitializer(t)}function qs(t){if(t.declarations&&1===t.declarations.length){var r=t.declarations[0];if(r)switch(r.kind){case 169:case 168:return Vs(r);case 171:case 170:case 173:case 174:case 175:return n=r,i=e.getEffectiveReturnTypeNode(n),a=e.getEffectiveTypeParameterDeclarations(n),(173===n.kind||!!i&&Us(i))&&n.parameters.every(Vs)&&a.every(Ks)}}var n,i,a;return !1}function Ws(t,r,n){for(var i=e.createSymbolTable(),a=0,o=t;a<o.length;a++){var s=o[a];i.set(s.escapedName,n&&qs(s)?s:_p(s,r));}return i}function Hs(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];e.has(i.escapedName)||Gs(i)||e.set(i.escapedName,i);}}function Gs(t){return !!t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration)&&e.isStatic(t.valueDeclaration)}function Qs(t){if(!t.declaredProperties){var r=t.symbol,n=ic(r);t.declaredProperties=Ra(n),t.declaredCallSignatures=e.emptyArray,t.declaredConstructSignatures=e.emptyArray,t.declaredIndexInfos=e.emptyArray,t.declaredCallSignatures=Rl(n.get("__call")),t.declaredConstructSignatures=Rl(n.get("__new")),t.declaredIndexInfos=tu(r);}return t}function Xs(e){return !!(8576&e.flags)}function Ys(t){if(!e.isComputedPropertyName(t)&&!e.isElementAccessExpression(t))return !1;var r=e.isComputedPropertyName(t)?t.expression:t.argumentExpression;return e.isEntityNameExpression(r)&&Xs(e.isComputedPropertyName(t)?hv(t):Ix(r))}function Zs(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&64===e.charCodeAt(2)}function $s(t){var r=e.getNameOfDeclaration(t);return !!r&&Ys(r)}function ec(t){return !e.hasDynamicName(t)||$s(t)}function tc(t){return 8192&t.flags?t.escapedName:384&t.flags?e.escapeLeadingUnderscores(""+t.value):e.Debug.fail()}function rc(t,r,n,i){e.Debug.assert(!!i.symbol,"The member is expected to have a symbol.");var a=di(i);if(!a.resolvedSymbol){a.resolvedSymbol=i.symbol;var o=e.isBinaryExpression(i)?i.left:i.name,s=e.isElementAccessExpression(o)?Ix(o.argumentExpression):hv(o);if(Xs(s)){var c=tc(s),l=i.symbol.flags,u=n.get(c);u||n.set(c,u=ri(0,c,4096));var _=r&&r.get(c);if(u.flags&ni(l)||_){var d=_?e.concatenate(_.declarations,u.declarations):u.declarations,p=!(8192&s.flags)&&e.unescapeLeadingUnderscores(c)||e.declarationNameToString(o);e.forEach(d,(function(t){return Qn(e.getNameOfDeclaration(t)||t,e.Diagnostics.Property_0_was_also_declared_here,p)})),Qn(o||i,e.Diagnostics.Duplicate_property_0,p),u=ri(0,c,4096);}return u.nameType=s,function(t,r,n){e.Debug.assert(!!(4096&e.getCheckFlags(t)),"Expected a late-bound symbol."),t.flags|=n,_i(r.symbol).lateSymbol=t,t.declarations?r.symbol.isReplaceableByMethod||t.declarations.push(r):t.declarations=[r],111551&n&&(t.valueDeclaration&&t.valueDeclaration.kind===r.kind||(t.valueDeclaration=r));}(u,i,l),u.parent?e.Debug.assert(u.parent===t,"Existing symbol parent should match new one"):u.parent=t,a.resolvedSymbol=u}}return a.resolvedSymbol}function nc(t,r){var n=_i(t);if(!n[r]){var i="resolvedExports"===r,a=i?1536&t.flags?ba(t):t.exports:t.members;n[r]=a||z;for(var o=e.createSymbolTable(),s=0,c=t.declarations||e.emptyArray;s<c.length;s++){var l=c[s],u=e.getMembersOfDeclaration(l);if(u)for(var _=0,d=u;_<d.length;_++){var p=d[_];i===e.hasStaticModifier(p)&&$s(p)&&rc(t,a,o,p);}}var f=t.assignmentDeclarationMembers;if(f)for(var g=0,m=e.arrayFrom(f.values());g<m.length;g++){p=m[g];var y=e.getAssignmentDeclarationKind(p);i===!(3===y||e.isBinaryExpression(p)&&Yy(p,y)||9===y||6===y)&&$s(p)&&rc(t,a,o,p);}n[r]=function(t,r){if(!(null==t?void 0:t.size))return r;if(!(null==r?void 0:r.size))return t;var n=e.createSymbolTable();return li(n,t),li(n,r),n}(a,o)||z;}return n[r]}function ic(e){return 6256&e.flags?nc(e,"resolvedMembers"):e.members||z}function ac(t){if(106500&t.flags&&"__computed"===t.escapedName){var r=_i(t);if(!r.lateSymbol&&e.some(t.declarations,$s)){var n=xa(t.parent);e.some(t.declarations,e.hasStaticModifier)?ya(n):ic(n);}return r.lateSymbol||(r.lateSymbol=t)}return t}function oc(t,r,n){if(4&e.getObjectFlags(t)){var i=t.target,a=fu(t);if(e.length(i.typeParameters)===e.length(a)){var o=_u(i,e.concatenate(a,[r||i.thisType]));return n?rl(o):o}}else if(2097152&t.flags){var s=e.sameMap(t.types,(function(e){return oc(e,r,n)}));return s!==t.types?N_(s):t}return n?rl(t):t}function sc(t,r,n,i){var a,o,s,c,l;e.rangeEquals(n,i,0,n.length)?(o=r.symbol?ic(r.symbol):e.createSymbolTable(r.declaredProperties),s=r.declaredCallSignatures,c=r.declaredConstructSignatures,l=r.declaredIndexInfos):(a=$d(n,i),o=Ws(r.declaredProperties,a,1===n.length),s=Yd(r.declaredCallSignatures,a),c=Yd(r.declaredConstructSignatures,a),l=Zd(r.declaredIndexInfos,a));var u=Ns(r);if(u.length){r.symbol&&o===ic(r.symbol)&&(o=e.createSymbolTable(r.declaredProperties)),ja(t,o,s,c,l);for(var _=e.lastOrUndefined(i),d=0,p=u;d<p.length;d++){var f=p[d],g=_?oc(hp(f,a),_):f;Hs(o,zc(g)),s=e.concatenate(s,fl(g,0)),c=e.concatenate(c,fl(g,1));var m=g!==Le?hl(g):[eu(Ye,Le,!1)];l=e.concatenate(l,e.filter(m,(function(e){return !gl(l,e.keyType)})));}}ja(t,o,s,c,l);}function cc(e,t,r,n,i,a,o,s){var c=new h(pe,s);return c.declaration=e,c.typeParameters=t,c.parameters=n,c.thisParameter=r,c.resolvedReturnType=i,c.resolvedTypePredicate=a,c.minArgumentCount=o,c.resolvedMinArgumentCount=void 0,c.target=void 0,c.mapper=void 0,c.compositeSignatures=void 0,c.compositeKind=void 0,c}function lc(e){var t=cc(e.declaration,e.typeParameters,e.thisParameter,e.parameters,void 0,void 0,e.minArgumentCount,39&e.flags);return t.target=e.target,t.mapper=e.mapper,t.compositeSignatures=e.compositeSignatures,t.compositeKind=e.compositeKind,t}function uc(e,t){var r=lc(e);return r.compositeSignatures=t,r.compositeKind=1048576,r.target=void 0,r.mapper=void 0,r}function _c(t,r){if((24&t.flags)===r)return t;t.optionalCallSignatureCache||(t.optionalCallSignatureCache={});var n=8===r?"inner":"outer";return t.optionalCallSignatureCache[n]||(t.optionalCallSignatureCache[n]=function(t,r){e.Debug.assert(8===r||16===r,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");var n=lc(t);return n.flags|=r,n}(t,r))}function dc(t,r){if(j(t)){var n=t.parameters.length-1,i=ds(t.parameters[n]);if($f(i))return [a(i,n)];if(!r&&1048576&i.flags&&e.every(i.types,$f))return e.map(i.types,(function(e){return a(e,n)}))}return [t.parameters];function a(r,n){var i=fu(r),a=r.target.labeledElementDeclarations,o=e.map(i,(function(e,i){var o=!!a&&Lb(a[i])||Rb(t,n+i,r),s=r.target.elementFlags[i],c=ri(1,o,12&s?32768:2&s?16384:0);return c.type=4&s?$u(e):e,c}));return e.concatenate(t.parameters.slice(0,n),o)}}function pc(e,t,r,n,i){for(var a=0,o=e;a<o.length;a++){var s=o[a];if(Ff(s,t,r,n,i,r?Pp:Ap))return s}}function fc(t,r,n){if(r.typeParameters){if(n>0)return;for(var i=1;i<t.length;i++)if(!pc(t[i],r,!1,!1,!1))return;return [r]}var a;for(i=0;i<t.length;i++){var o=i===n?r:pc(t[i],r,!0,!1,!0);if(!o)return;a=e.appendIfUnique(a,o);}return a}function gc(t){for(var r,n,i=0;i<t.length;i++){if(0===t[i].length)return e.emptyArray;t[i].length>1&&(n=void 0===n?i:-1);for(var a=0,o=t[i];a<o.length;a++){var s=o[a];if(!r||!pc(r,s,!1,!1,!0)){var c=fc(t,s,i);if(c){var l=s;if(c.length>1){var u=s.thisParameter,_=e.forEach(c,(function(e){return e.thisParameter}));_&&(u=vg(_,N_(e.mapDefined(c,(function(e){return e.thisParameter&&ds(e.thisParameter)}))))),(l=uc(s,c)).thisParameter=u;}(r||(r=[])).push(l);}}}}if(!e.length(r)&&-1!==n){for(var d=t[void 0!==n?n:0],p=d.slice(),f=function(t){if(t!==d){var r=t[0];if(e.Debug.assert(!!r,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),p=r.typeParameters&&e.some(p,(function(e){return !!e.typeParameters&&!mc(r.typeParameters,e.typeParameters)}))?void 0:e.map(p,(function(t){return function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=$d(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Vb(e),i=Vb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=Wb(e)||Wb(t),l=c&&!Wb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Ub(a,_);a===t&&(d=hp(d,r));var p=Ub(o,_)||Ke;o===t&&(p=hp(p,r));var f=N_([d,p]),g=c&&!l&&_===s-1,m=_>=qb(a)&&_>=qb(o),y=_>=n?void 0:Rb(e,_),v=_>=i?void 0:Rb(t,_),h=ri(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?$u(f):f,u[_]=h;}if(l){var b=ri(1,"args");b.type=$u(zb(o,s)),o===t&&(b.type=hp(b.type,r)),u[s]=b;}return u}(t,r,n),s=function(e,t,r){return e&&t?vg(e,N_([ds(e),hp(ds(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),c=cc(a,i,s,o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return c.compositeKind=1048576,c.compositeSignatures=e.concatenate(2097152!==t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(c.mapper=2097152!==t.compositeKind&&t.mapper&&t.compositeSignatures?op(t.mapper,n):n),c}(t,r)})),!p)return "break"}},g=0,m=t;g<m.length&&"break"!==f(m[g]);g++);r=p;}return r||e.emptyArray}function mc(t,r){if(e.length(t)!==e.length(r))return !1;if(!t||!r)return !0;for(var n=$d(r,t),i=0;i<t.length;i++){var a=t[i],o=r[i];if(a!==o&&!Np(ou(a)||Ke,hp(ou(o)||Ke,n)))return !1}return !0}function yc(t){var r=hl(t[0]);if(r){for(var n=[],i=function(r){var i=r.keyType;e.every(t,(function(e){return !!bl(e,i)}))&&n.push(eu(i,b_(e.map(t,(function(e){return xl(e,i)}))),e.some(t,(function(e){return bl(e,i).isReadonly}))));},a=0,o=r;a<o.length;a++)i(o[a]);return n}return e.emptyArray}function vc(e,t){return e?t?N_([e,t]):e:t}function hc(t){var r=e.countWhere(t,(function(e){return fl(e,1).length>0})),n=e.map(t,xs);if(r>0&&r===e.countWhere(n,(function(e){return e}))){var i=n.indexOf(!0);n[i]=!1;}return n}function bc(t,r){for(var n=function(r){t&&!e.every(t,(function(e){return !Ff(e,r,!1,!1,!1,Ap)}))||(t=e.append(t,r));},i=0,a=r;i<a.length;i++)n(a[i]);return t}function xc(t,r,n){if(t)for(var i=0;i<t.length;i++){var a=t[i];if(a.keyType===r.keyType)return t[i]=eu(a.keyType,n?b_([a.type,r.type]):N_([a.type,r.type]),n?a.isReadonly||r.isReadonly:a.isReadonly&&r.isReadonly),t}return e.append(t,r)}function Dc(e,t,r){return hp(e,$d([t.indexType,t.objectType],[Jd(0),a_([r])]))}function Sc(t){if(4194304&t.flags){var r=rl(t.type);return eg(r)?u_(r):z_(r)}if(16777216&t.flags){if(t.root.isDistributive){var n=t.checkType,i=Sc(n);if(i!==n)return vp(t,sp(t.root.checkType,i,t.mapper))}return t}if(1048576&t.flags)return ty(t,Sc);if(2097152&t.flags){var a=t.types;return 2===a.length&&76&a[0].flags&&a[1]===Nt?t:N_(e.sameMap(t.types,Sc))}return t}function Tc(t){return 4096&e.getCheckFlags(t)}function Cc(e,t,r,n){for(var i=0,a=zc(e);i<a.length;i++)n(L_(a[i],t));if(1&e.flags)n(Ye);else for(var o=0,s=hl(e);o<s.length;o++){var c=s[o];(!r||134217732&c.keyType.flags)&&n(c.keyType);}}function Ec(e){return e.typeParameter||(e.typeParameter=js(Da(e.declaration.typeParameter)))}function kc(e){return e.constraintType||(e.constraintType=Kc(Ec(e))||je)}function Nc(e){return e.declaration.nameType?e.nameType||(e.nameType=hp(Hd(e.declaration.nameType),e.mapper)):void 0}function Ac(e){return e.templateType||(e.templateType=e.declaration.type?hp(Bo(Hd(e.declaration.type),!0,!!(4&Ic(e))),e.mapper):je)}function Fc(t){return e.getEffectiveConstraintOfTypeParameter(t.declaration.typeParameter)}function Pc(e){var t=Fc(e);return 195===t.kind&&141===t.operator}function wc(e){if(!e.modifiersType)if(Pc(e))e.modifiersType=hp(Hd(Fc(e).type),e.mapper);else {var t=kc(pd(e.declaration)),r=t&&262144&t.flags?Kc(t):t;e.modifiersType=r&&4194304&r.flags?hp(r.type,e.mapper):Ke;}return e.modifiersType}function Ic(e){var t=e.declaration;return (t.readonlyToken?40===t.readonlyToken.kind?2:1:0)|(t.questionToken?40===t.questionToken.kind?8:4:0)}function Oc(e){var t=Ic(e);return 8&t?-1:4&t?1:0}function Mc(e){var t=Oc(e),r=wc(e);return t||(Lc(r)?Oc(r):0)}function Lc(t){if(32&e.getObjectFlags(t)){var r=kc(t);if(nd(r))return !0;var n=Nc(t);if(n&&nd(hp(n,tp(Ec(t),r))))return !0}return !1}function Rc(t){return t.members||(524288&t.flags?4&t.objectFlags?function(t){var r=Qs(t.target),n=e.concatenate(r.typeParameters,[r.thisType]),i=fu(t);sc(t,r,n,i.length===n.length?i:e.concatenate(i,[t]));}(t):3&t.objectFlags?function(t){sc(t,Qs(t),e.emptyArray,e.emptyArray);}(t):1024&t.objectFlags?function(t){for(var r=bl(t.source,Ye),n=Ic(t.mappedType),i=!(1&n),a=4&n?0:16777216,o=r?[eu(Ye,Vg(r.type,t.mappedType,t.constraintType),i&&r.isReadonly)]:e.emptyArray,s=e.createSymbolTable(),c=0,l=zc(t.source);c<l.length;c++){var u=l[c],_=8192|(i&&px(u)?8:0),d=ri(4|u.flags&a,u.escapedName,_);if(d.declarations=u.declarations,d.nameType=_i(u).nameType,d.propertyType=ds(u),8388608&t.constraintType.type.flags&&262144&t.constraintType.type.objectType.flags&&262144&t.constraintType.type.indexType.flags){var p=t.constraintType.type.objectType,f=Dc(t.mappedType,t.constraintType.type,p);d.mappedType=f,d.constraintType=z_(p);}else d.mappedType=t.mappedType,d.constraintType=t.constraintType;s.set(u.escapedName,d);}ja(t,s,e.emptyArray,e.emptyArray,o);}(t):16&t.objectFlags?function(t){if(t.target)return ja(t,z,e.emptyArray,e.emptyArray,e.emptyArray),void ja(t,Ws(Bc(t.target),t.mapper,!1),i=Yd(fl(t.target,0),t.mapper),a=Yd(fl(t.target,1),t.mapper),Zd(hl(t.target),t.mapper));var r=xa(t.symbol);if(2048&r.flags){ja(t,z,e.emptyArray,e.emptyArray,e.emptyArray);var n=ic(r),i=Rl(n.get("__call")),a=Rl(n.get("__new"));ja(t,n,i,a,tu(r));}else {var o,s,c=z;if(r.exports&&(c=ya(r),r===le)){var l=new e.Map;c.forEach((function(t){var r;418&t.flags||512&t.flags&&(null===(r=t.declarations)||void 0===r?void 0:r.length)&&e.every(t.declarations,e.isAmbientModule)||l.set(t.escapedName,t);})),c=l;}if(ja(t,c,e.emptyArray,e.emptyArray,e.emptyArray),32&r.flags){var u=Es(Ps(r));11272192&u.flags?Hs(c=e.createSymbolTable(function(t){var r=Ra(t),n=$l(t);return n?e.concatenate(r,[n]):r}(c)),zc(u)):u===Le&&(s=eu(Ye,Le,!1));}var _=$l(c);if(_?o=ru(_):(s&&(o=e.append(o,s)),384&r.flags&&(32&Js(r).flags||e.some(t.properties,(function(e){return !!(296&ds(e).flags)})))&&(o=e.append(o,Vr))),ja(t,c,e.emptyArray,e.emptyArray,o||e.emptyArray),8208&r.flags&&(t.callSignatures=Rl(r)),32&r.flags){var d=Ps(r);a=r.members?Rl(r.members.get("__constructor")):e.emptyArray,16&r.flags&&(a=e.addRange(a.slice(),e.mapDefined(t.callSignatures,(function(e){return bb(e.declaration)?cc(e.declaration,e.typeParameters,e.thisParameter,e.parameters,d,void 0,e.minArgumentCount,39&e.flags):void 0})))),a.length||(a=function(t){var r=fl(Es(t),1),n=e.getClassLikeDeclarationOfSymbol(t.symbol),i=!!n&&e.hasSyntacticModifier(n,256);if(0===r.length)return [cc(void 0,t.localTypeParameters,void 0,e.emptyArray,t,void 0,0,i?4:0)];for(var a=Ss(t),o=e.isInJSFile(a),s=Pu(a),c=e.length(s),l=[],u=0,_=r;u<_.length;u++){var d=_[u],p=wl(d.typeParameters),f=e.length(d.typeParameters);if(o||c>=p&&c<=f){var g=f?Gl(d,Il(s,d.typeParameters,p,o)):lc(d);g.typeParameters=t.localTypeParameters,g.resolvedReturnType=t,g.flags=i?4|g.flags:-5&g.flags,l.push(g);}}return l}(d)),t.constructSignatures=a;}}}(t):32&t.objectFlags?function(t){var r,n=e.createSymbolTable();ja(t,z,e.emptyArray,e.emptyArray,e.emptyArray);var i=Ec(t),a=kc(t),o=Nc(t.target||t),s=Ac(t.target||t),c=rl(wc(t)),l=Ic(t),u=te?128:8576;function _(e){Qm(o?hp(o,cp(t.mapper,i,e)):e,(function(a){return function(e,a){if(Xs(a)){var u=tc(a),_=n.get(u);if(_)_.nameType=b_([_.nameType,a]),_.keyType=b_([_.keyType,e]);else {var d=Xs(e)?dl(c,tc(e)):void 0,p=!!(4&l||!(8&l)&&d&&16777216&d.flags),f=!!(1&l||!(2&l)&&d&&px(d)),g=G&&!p&&d&&16777216&d.flags,m=ri(4|(p?16777216:0),u,262144|(d?Tc(d):0)|(f?8:0)|(g?524288:0));m.mappedType=t,m.nameType=a,m.keyType=e,d&&(m.syntheticOrigin=d,m.declarations=o?void 0:d.declarations),n.set(u,m);}}else if(nu(a)||33&a.flags){var y=eu(5&a.flags?Ye:40&a.flags?Ze:a,hp(s,cp(t.mapper,i,e)),!!(1&l));r=xc(r,y,!0);}}(e,a)}));}Pc(t)?Cc(c,u,te,_):Qm(Sc(a),_),ja(t,n,e.emptyArray,e.emptyArray,r||e.emptyArray);}(t):e.Debug.fail("Unhandled object type "+e.Debug.formatObjectFlags(t.objectFlags)):1048576&t.flags?function(t){var r=gc(e.map(t.types,(function(e){return e===Wt?[zr]:fl(e,0)}))),n=gc(e.map(t.types,(function(e){return fl(e,1)}))),i=yc(t.types);ja(t,z,r,n,i);}(t):2097152&t.flags?function(t){for(var r,n,i,a=t.types,o=hc(a),s=e.countWhere(o,(function(e){return e})),c=function(c){var l=t.types[c];if(!o[c]){var u=fl(l,1);u.length&&s>0&&(u=e.map(u,(function(e){var t=lc(e);return t.resolvedReturnType=function(e,t,r,n){for(var i=[],a=0;a<t.length;a++)a===n?i.push(e):r[a]&&i.push(Ul(fl(t[a],1)[0]));return N_(i)}(Ul(e),a,o,c),t}))),n=bc(n,u);}r=bc(r,fl(l,0)),i=e.reduceLeft(hl(l),(function(e,t){return xc(e,t,!1)}),i);},l=0;l<a.length;l++)c(l);ja(t,z,r||e.emptyArray,n||e.emptyArray,i||e.emptyArray);}(t):e.Debug.fail("Unhandled type "+e.Debug.formatTypeFlags(t.flags))),t}function Bc(t){return 524288&t.flags?Rc(t).properties:e.emptyArray}function jc(e,t){if(524288&e.flags){var r=Rc(e).members.get(t);if(r&&Aa(r))return r}}function Jc(t){if(!t.resolvedProperties){for(var r=e.createSymbolTable(),n=0,i=t.types;n<i.length;n++){for(var a=i[n],o=0,s=zc(a);o<s.length;o++){var c=s[o];if(!r.has(c.escapedName)){var l=ol(t,c.escapedName);l&&r.set(c.escapedName,l);}}if(1048576&t.flags&&0===hl(a).length)break}t.resolvedProperties=Ra(r);}return t.resolvedProperties}function zc(e){return 3145728&(e=nl(e)).flags?Jc(e):Bc(e)}function Uc(e){return 262144&e.flags?Kc(e):8388608&e.flags?function(e){return Xc(e)?function(e){if(tl(e))return cd(e.objectType,e.indexType);var t=Vc(e.indexType);if(t&&t!==e.indexType){var r=_d(e.objectType,t,e.accessFlags);if(r)return r}var n=Vc(e.objectType);return n&&n!==e.objectType?_d(n,e.indexType,e.accessFlags):void 0}(e):void 0}(e):16777216&e.flags?function(e){return Xc(e)?Hc(e):void 0}(e):Gc(e)}function Kc(e){return Xc(e)?ou(e):void 0}function Vc(e){var t=ad(e,!1);return t!==e?t:Uc(e)}function qc(e){if(!e.resolvedDefaultConstraint){var t=function(e){return e.resolvedInferredTrueType||(e.resolvedInferredTrueType=e.combinedMapper?hp(Hd(e.root.node.trueType),e.combinedMapper):bd(e))}(e),r=xd(e);e.resolvedDefaultConstraint=Co(t)?r:Co(r)?t:b_([t,r]);}return e.resolvedDefaultConstraint}function Wc(e){if(e.root.isDistributive&&e.restrictiveInstantiation!==e){var t=ad(e.checkType,!1),r=t===e.checkType?Uc(t):t;if(r&&r!==e.checkType){var n=vp(e,sp(e.root.checkType,r,e.mapper));if(!(131072&n.flags))return n}}}function Hc(e){return Wc(e)||qc(e)}function Gc(e){if(464781312&e.flags){var t=Yc(e);return t!==It&&t!==Ot?t:void 0}return 4194304&e.flags?gt:void 0}function Qc(e){return Gc(e)||e}function Xc(e){return Yc(e)!==Ot}function Yc(t){if(t.resolvedBaseConstraint)return t.resolvedBaseConstraint;var r=[];return t.resolvedBaseConstraint=oc(n(t),t);function n(t){if(!t.immediateBaseConstraint){if(!ho(t,4))return Ot;var n=void 0,a=Nf(t);if((r.length<10||r.length<50&&!e.contains(r,a))&&(r.push(a),n=function(t){if(262144&t.flags){var r=ou(t);return t.isThisType||!r?r:i(r)}if(3145728&t.flags){for(var n=[],a=!1,o=0,s=u=t.types;o<s.length;o++){var c=s[o],l=i(c);l?(l!==c&&(a=!0),n.push(l)):a=!0;}return a?1048576&t.flags&&n.length===u.length?b_(n):2097152&t.flags&&n.length?N_(n):void 0:t}if(4194304&t.flags)return gt;if(134217728&t.flags){var u=t.types,_=e.mapDefined(u,i);return _.length===u.length?K_(t.texts,_):Ye}if(268435456&t.flags)return (r=i(t.type))&&r!==t.type?q_(t.symbol,r):Ye;if(8388608&t.flags){if(tl(t))return i(cd(t.objectType,t.indexType));var d=i(t.objectType),p=i(t.indexType),f=d&&p&&_d(d,p,t.accessFlags);return f&&i(f)}return 16777216&t.flags?(r=Hc(t))&&i(r):33554432&t.flags?i(Tu(t)):t}(ad(t,!1)),r.pop()),!Do()){if(262144&t.flags){var o=iu(t);if(o){var s=Qn(o,e.Diagnostics.Type_parameter_0_has_a_circular_constraint,io(t));!u||e.isNodeDescendantOf(o,u)||e.isNodeDescendantOf(u,o)||e.addRelatedInfo(s,e.createDiagnosticForNode(u,e.Diagnostics.Circularity_originates_in_type_at_this_location));}}n=Ot;}t.immediateBaseConstraint=n||It;}return t.immediateBaseConstraint}function i(e){var t=n(e);return t!==It&&t!==Ot?t:void 0}}function Zc(t){if(t.default)t.default===Mt&&(t.default=Ot);else if(t.target){var r=Zc(t.target);t.default=r?hp(r,t.mapper):It;}else {t.default=Mt;var n=t.symbol&&e.forEach(t.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default})),i=n?Hd(n):It;t.default===Mt&&(t.default=i);}return t.default}function $c(e){var t=Zc(e);return t!==It&&t!==Ot?t:void 0}function el(t){return !(!t.symbol||!e.forEach(t.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default})))}function tl(t){var r;return !(!(8388608&t.flags&&32&e.getObjectFlags(r=t.objectType)&&!Lc(r)&&nd(t.indexType))||8&Ic(r)||r.declaration.nameType)}function rl(t){var r=465829888&t.flags?Gc(t)||Ke:t;return 32&e.getObjectFlags(r)?function(e){return e.resolvedApparentType||(e.resolvedApparentType=function(e){var t=pp(e);if(t&&!e.declaration.nameType){var r=Kc(t);if(r&&Mf(r))return hp(e,sp(t,r,e.mapper))}return e}(e))}(r):2097152&r.flags?function(e){return e.resolvedApparentType||(e.resolvedApparentType=oc(e,e,!0))}(r):402653316&r.flags?Yt:296&r.flags?Zt:2112&r.flags?Pr||(Pr=Bu("BigInt",0,!1))||Ct:528&r.flags?$t:12288&r.flags?Ku():67108864&r.flags?Ct:4194304&r.flags?gt:2&r.flags&&!G?Ct:r}function nl(e){return sl(rl(sl(e)))}function il(t,r,n){for(var i,a,o,s,c,l,u=1048576&t.flags,_=4,d=u?0:8,p=!1,f=0,g=t.types;f<g.length;f++)if(!(Eo(F=rl(g[f]))||131072&F.flags)){var m=(A=dl(F,r,n))?e.getDeclarationModifierFlagsFromSymbol(A):0;if(A){if(106500&A.flags&&(null!=l||(l=u?0:16777216),u?l|=16777216&A.flags:l&=A.flags),o){if(A!==o)if((YS(A)||A)===(YS(o)||o)&&-1===Af(o,A,(function(e,t){return e===t?-1:0})))p=!!o.parent&&!!e.length(bs(o.parent));else {s||(s=new e.Map).set(O(o),o);var y=O(A);s.has(y)||s.set(y,A);}}else o=A;u&&px(A)?d|=8:u||px(A)||(d&=-9),d|=(24&m?0:256)|(16&m?512:0)|(8&m?1024:0)|(32&m?2048:0),qv(A)||(_=2);}else if(u){var v=!Zs(r)&&Tl(F,r);v?(d|=32|(v.isReadonly?8:0),c=e.append(c,$f(F)?rg(F)||qe:v.type)):!om(F)||2097152&e.getObjectFlags(F)?d|=16:(d|=32,c=e.append(c,qe));}}if(o&&(!(u&&(s||48&d)&&1536&d)||s&&function(t){for(var r,n=function(t){return t.declarations?r?(r.forEach((function(n){e.contains(t.declarations,n)||r.delete(n);})),0===r.size?{value:void 0}:void 0):(r=new e.Set(t.declarations),"continue"):{value:void 0}},i=0,a=t;i<a.length;i++){var o=n(a[i]);if("object"==typeof o)return o.value}return r}(e.arrayFrom(s.values())))){if(!(s||16&d||c)){if(p){var h=vg(o,o.type);return h.parent=null===(a=null===(i=o.valueDeclaration)||void 0===i?void 0:i.symbol)||void 0===a?void 0:a.parent,h.containingType=t,h.mapper=o.mapper,h}return o}for(var b,x,D,S,T,C=[],E=!1,k=0,N=s?e.arrayFrom(s.values()):[o];k<N.length;k++){var A=N[k];T?A.valueDeclaration&&A.valueDeclaration!==T&&(E=!0):T=A.valueDeclaration,b=e.addRange(b,A.declarations);var F=ds(A);x||(x=F,D=_i(A).nameType);var P=_s(A);S||P!==F?S=e.append(S||C.slice(),P):F!==x&&(d|=64),(Hf(F)||ed(F)||F===xt)&&(d|=128),131072&F.flags&&F!==xt&&(d|=131072),C.push(F);}e.addRange(C,c);var w=ri(4|(null!=l?l:0),r,_|d);return w.containingType=t,!E&&T&&(w.valueDeclaration=T,T.symbol.parent&&(w.parent=T.symbol.parent)),w.declarations=b,w.nameType=D,C.length>2?(w.checkFlags|=65536,w.deferralParent=t,w.deferralConstituents=C,w.deferralWriteConstituents=S):(w.type=u?b_(C):N_(C),S&&(w.writeType=u?b_(S):N_(S))),w}}function al(t,r,n){var i,a,o=(null===(i=t.propertyCacheWithoutObjectFunctionPropertyAugment)||void 0===i?void 0:i.get(r))||!n?null===(a=t.propertyCache)||void 0===a?void 0:a.get(r):void 0;return o||(o=il(t,r,n))&&(n?t.propertyCacheWithoutObjectFunctionPropertyAugment||(t.propertyCacheWithoutObjectFunctionPropertyAugment=e.createSymbolTable()):t.propertyCache||(t.propertyCache=e.createSymbolTable())).set(r,o),o}function ol(t,r,n){var i=al(t,r,n);return !i||16&e.getCheckFlags(i)?void 0:i}function sl(t){return 1048576&t.flags&&16777216&t.objectFlags?t.resolvedReducedType||(t.resolvedReducedType=function(t){var r=e.sameMap(t.types,sl);if(r===t.types)return t;var n=b_(r);return 1048576&n.flags&&(n.resolvedReducedType=n),n}(t)):2097152&t.flags?(16777216&t.objectFlags||(t.objectFlags|=16777216|(e.some(Jc(t),cl)?33554432:0)),33554432&t.objectFlags?ct:t):t}function cl(e){return ll(e)||ul(e)}function ll(t){return !(16777216&t.flags||192!=(131264&e.getCheckFlags(t))||!(131072&ds(t).flags))}function ul(t){return !t.valueDeclaration&&!!(1024&e.getCheckFlags(t))}function _l(t,r){if(2097152&r.flags&&33554432&e.getObjectFlags(r)){var n=e.find(Jc(r),ll);if(n)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,io(r,void 0,536870912),ro(n));var i=e.find(Jc(r),ul);if(i)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,io(r,void 0,536870912),ro(i))}return t}function dl(e,t,r,n){if(524288&(e=nl(e)).flags){var i=Rc(e),a=i.members.get(t);if(a&&Aa(a,n))return a;if(r)return;var o=i===wt?Wt:i.callSignatures.length?Ht:i.constructSignatures.length?Gt:void 0;if(o){var s=jc(o,t);if(s)return s}return jc(qt,t)}if(3145728&e.flags)return ol(e,t,r)}function pl(t,r){if(3670016&t.flags){var n=Rc(t);return 0===r?n.callSignatures:n.constructSignatures}return e.emptyArray}function fl(e,t){return pl(nl(e),t)}function gl(t,r){return e.find(t,(function(e){return e.keyType===r}))}function ml(t,r){for(var n,i,a,o=0,s=t;o<s.length;o++){var c=s[o];c.keyType===Ye?n=c:yl(r,c.keyType)&&(i?(a||(a=[i])).push(c):i=c);}return a?eu(Ke,N_(e.map(a,(function(e){return e.type}))),e.reduceLeft(a,(function(e,t){return e&&t.isReadonly}),!0)):i||(n&&yl(r,Ye)?n:void 0)}function yl(t,r){return Ip(t,r)||r===Ye&&Ip(t,Ze)||r===Ze&&(t===vt||!!(128&t.flags)&&e.isNumericLiteralName(t.value))}function vl(t){return 3670016&t.flags?Rc(t).indexInfos:e.emptyArray}function hl(e){return vl(nl(e))}function bl(e,t){return gl(hl(e),t)}function xl(e,t){var r;return null===(r=bl(e,t))||void 0===r?void 0:r.type}function Dl(e,t){return hl(e).filter((function(e){return yl(t,e.keyType)}))}function Sl(e,t){return ml(hl(e),t)}function Tl(t,r){return Sl(t,Zs(r)?ot:jd(e.unescapeLeadingUnderscores(r)))}function Cl(t){for(var r,n,i=0,a=e.getEffectiveTypeParameterDeclarations(t);i<a.length;i++){var o=a[i];n=e.appendIfUnique(n,js(o.symbol));}return (null==n?void 0:n.length)?n:e.isFunctionDeclaration(t)?null===(r=Ml(t))||void 0===r?void 0:r.typeParameters:void 0}function El(e){var t=[];return e.forEach((function(e,r){La(r)||t.push(e);})),t}function kl(t){return e.isInJSFile(t)&&(t.type&&319===t.type.kind||e.getJSDocParameterTags(t).some((function(e){var t=e.isBracketed,r=e.typeExpression;return t||!!r&&319===r.type.kind})))}function Nl(t,r){if(!e.isExternalModuleNameRelative(t)){var n=fi(se,'"'+t+'"',512);return n&&r?xa(n):n}}function Al(t){if(e.hasQuestionToken(t)||Fl(t)||kl(t))return !0;if(t.initializer){var r=Ol(t.parent),n=t.parent.parameters.indexOf(t);return e.Debug.assert(n>=0),n>=qb(r,3)}var i=e.getImmediatelyInvokedFunctionExpression(t.parent);return !!i&&!t.type&&!t.dotDotDotToken&&t.parent.parameters.indexOf(t)>=i.arguments.length}function Fl(t){if(!e.isJSDocPropertyLikeTag(t))return !1;var r=t.isBracketed,n=t.typeExpression;return r||!!n&&319===n.type.kind}function Pl(e,t,r,n){return {kind:e,parameterName:t,parameterIndex:r,type:n}}function wl(e){var t=0;if(e)for(var r=0;r<e.length;r++)el(e[r])||(t=r+1);return t}function Il(t,r,n,i){var a=e.length(r);if(!a)return [];var o=e.length(t);if(i||o>=n&&o<=a){for(var s=t?t.slice():[],c=o;c<a;c++)s[c]=je;var l=lm(i);for(c=o;c<a;c++){var u=$c(r[c]);i&&u&&(Np(u,Ke)||Np(u,Ct))&&(u=Le),s[c]=u?hp(u,$d(r,s)):l;}return s.length=r.length,s}return t&&t.slice()}function Ol(t){var r,n=di(t);if(!n.resolvedSignature){var i=[],a=0,o=0,s=void 0,c=!1,l=e.getImmediatelyInvokedFunctionExpression(t),u=e.isJSDocConstructSignature(t);!l&&e.isInJSFile(t)&&e.isValueSignatureDeclaration(t)&&!e.hasJSDocParameterTags(t)&&!e.getJSDocType(t)&&(a|=32);for(var _=u?1:0;_<t.parameters.length;_++){var d=t.parameters[_],p=d.symbol,f=e.isJSDocParameterTag(d)?d.typeExpression&&d.typeExpression.type:d.type;p&&4&p.flags&&!e.isBindingPattern(d.name)&&(p=vi(d,p.escapedName,111551,void 0,void 0,!1)),0===_&&"this"===p.escapedName?(c=!0,s=d.symbol):i.push(p),f&&198===f.kind&&(a|=2),Fl(d)||d.initializer||d.questionToken||e.isRestParameter(d)||l&&i.length>l.arguments.length&&!f||kl(d)||(o=i.length);}if((174===t.kind||175===t.kind)&&ec(t)&&(!c||!s)){var g=174===t.kind?175:174,m=e.getDeclarationOfKind(Da(t),g);m&&(s=(r=BC(m))&&r.symbol);}var y=173===t.kind?Ps(xa(t.parent.symbol)):void 0,v=y?y.localTypeParameters:Cl(t);(e.hasRestParameter(t)||e.isInJSFile(t)&&function(t,r){if(e.isJSDocSignature(t)||!Ll(t))return !1;var n=e.lastOrUndefined(t.parameters),i=n?e.getJSDocParameterTags(n):e.getJSDocTags(t).filter(e.isJSDocParameterTag),a=e.firstDefined(i,(function(t){return t.typeExpression&&e.isJSDocVariadicType(t.typeExpression.type)?t.typeExpression.type:void 0})),o=ri(3,"args",32768);return a?o.type=$u(Hd(a.type)):(o.checkFlags|=65536,o.deferralParent=ct,o.deferralConstituents=[rr],o.deferralWriteConstituents=[rr]),a&&r.pop(),r.push(o),!0}(t,i))&&(a|=1),(e.isConstructorTypeNode(t)&&e.hasSyntacticModifier(t,256)||e.isConstructorDeclaration(t)&&e.hasSyntacticModifier(t.parent,256))&&(a|=4),n.resolvedSignature=cc(t,v,s,i,void 0,void 0,o,a);}return n.resolvedSignature}function Ml(t){if(e.isInJSFile(t)&&e.isFunctionLikeDeclaration(t)){var r=e.getJSDocTypeTag(t);return (null==r?void 0:r.typeExpression)&&Jh(Hd(r.typeExpression))}}function Ll(t){var r=di(t);return void 0===r.containsArgumentsReference&&(8192&r.flags?r.containsArgumentsReference=!0:r.containsArgumentsReference=function t(r){if(!r)return !1;switch(r.kind){case 79:return r.escapedText===_e.escapedName&&gC(r)===_e;case 169:case 171:case 174:case 175:return 164===r.name.kind&&t(r.name);case 208:case 209:return t(r.expression);case 299:return t(r.initializer);default:return !e.nodeStartsNewLexicalEnvironment(r)&&!e.isPartOfTypeNode(r)&&!!e.forEachChild(r,t)}}(t.body)),r.containsArgumentsReference}function Rl(t){if(!t||!t.declarations)return e.emptyArray;for(var r=[],n=0;n<t.declarations.length;n++){var i=t.declarations[n];if(e.isFunctionLike(i)){if(n>0&&i.body){var a=t.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)continue}r.push(!e.isFunctionExpressionOrArrowFunction(i)&&!e.isObjectLiteralMethod(i)&&Ml(i)||Ol(i));}}return r}function Bl(e){var t=oa(e,e);if(t){var r=ua(t);if(r)return ds(r)}return Le}function jl(e){if(e.thisParameter)return ds(e.thisParameter)}function Jl(t){if(!t.resolvedTypePredicate){if(t.target){var r=Jl(t.target);t.resolvedTypePredicate=r?(o=r,s=t.mapper,Pl(o.kind,o.parameterName,o.parameterIndex,hp(o.type,s))):jr;}else if(t.compositeSignatures)t.resolvedTypePredicate=function(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=Jl(a[i]);if(!o||2===o.kind||3===o.kind){if(2097152!==t)continue;return}if(r){if(!x_(r,o))return}else r=o;n.push(o.type);}if(r){var s=zl(n,t);return Pl(r.kind,r.parameterName,r.parameterIndex,s)}}(t.compositeSignatures,t.compositeKind)||jr;else {var n=t.declaration&&e.getEffectiveReturnTypeNode(t.declaration),i=void 0;if(!n){var a=Ml(t.declaration);a&&t!==a&&(i=Jl(a));}t.resolvedTypePredicate=n&&e.isTypePredicateNode(n)?function(t,r){var n=t.parameterName,i=t.type&&Hd(t.type);return 194===n.kind?Pl(t.assertsModifier?2:0,void 0,void 0,i):Pl(t.assertsModifier?3:1,n.escapedText,e.findIndex(r.parameters,(function(e){return e.escapedName===n.escapedText})),i)}(n,t):i||jr;}e.Debug.assert(!!t.resolvedTypePredicate);}var o,s;return t.resolvedTypePredicate===jr?void 0:t.resolvedTypePredicate}function zl(e,t,r){return 2097152!==t?b_(e,r):N_(e)}function Ul(t){if(!t.resolvedReturnType){if(!ho(t,3))return je;var r=t.target?hp(Ul(t.target),t.mapper):t.compositeSignatures?hp(zl(e.map(t.compositeSignatures,Ul),t.compositeKind,2),t.mapper):Kl(t.declaration)||(e.nodeIsMissing(t.declaration.body)?Le:rx(t.declaration));if(8&t.flags?r=ug(r):16&t.flags&&(r=cg(r)),!Do()){if(t.declaration){var n=e.getEffectiveReturnTypeNode(t.declaration);if(n)Qn(n,e.Diagnostics.Return_type_annotation_circularly_references_itself);else if(Z){var i=t.declaration,a=e.getNameOfDeclaration(i);a?Qn(a,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,e.declarationNameToString(a)):Qn(i,e.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);}}r=Le;}t.resolvedReturnType=r;}return t.resolvedReturnType}function Kl(t){if(173===t.kind)return Ps(xa(t.parent.symbol));if(e.isJSDocConstructSignature(t))return Hd(t.parameters[0].type);var r,n=e.getEffectiveReturnTypeNode(t);if(n)return Hd(n);if(174===t.kind&&ec(t)){var i=e.isInJSFile(t)&&Lo(t);if(i)return i;var a=ns(e.getDeclarationOfKind(Da(t),175));if(a)return a}return (r=Ml(t))&&Ul(r)}function Vl(e){return !e.resolvedReturnType&&bo(e,3)>=0}function ql(e){if(j(e)){var t=ds(e.parameters[e.parameters.length-1]),r=$f(t)?rg(t):t;return r&&xl(r,Ze)}}function Wl(e,t,r,n){var i=Hl(e,Il(t,e.typeParameters,wl(e.typeParameters),r));if(n){var a=zh(Ul(i));if(a){var o=lc(a);o.typeParameters=n;var s=lc(i);return s.resolvedReturnType=Yl(o),s}}return i}function Hl(t,r){var n=t.instantiations||(t.instantiations=new e.Map),i=cu(r),a=n.get(i);return a||n.set(i,a=Gl(t,r)),a}function Gl(e,t){return up(e,function(e,t){return $d(e.typeParameters,t)}(e,t),!0)}function Ql(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return up(e,ap(e.typeParameters),!0)}(e)):e}function Xl(t){var r=t.typeParameters;if(r){if(t.baseSignatureCache)return t.baseSignatureCache;for(var n=ap(r),i=$d(r,e.map(r,(function(e){return Kc(e)||Ke}))),a=e.map(r,(function(e){return hp(e,i)||Ke})),o=0;o<r.length-1;o++)a=Xd(a,i);return a=Xd(a,n),t.baseSignatureCache=up(t,$d(r,a),!0)}return t}function Yl(t){var r;if(!t.isolatedSignatureType){var n=null===(r=t.declaration)||void 0===r?void 0:r.kind,i=void 0===n||173===n||177===n||182===n,a=Oa(16);a.members=z,a.properties=e.emptyArray,a.callSignatures=i?e.emptyArray:[t],a.constructSignatures=i?[t]:e.emptyArray,a.indexInfos=e.emptyArray,t.isolatedSignatureType=a;}return t.isolatedSignatureType}function Zl(e){return e.members?$l(e.members):void 0}function $l(e){return e.get("__index")}function eu(e,t,r,n){return {keyType:e,type:t,isReadonly:r,declaration:n}}function tu(t){var r=Zl(t);return r?ru(r):e.emptyArray}function ru(t){if(t.declarations){for(var r=[],n=function(t){if(1===t.parameters.length){var n=t.parameters[0];n.type&&Qm(Hd(n.type),(function(n){nu(n)&&!gl(r,n)&&r.push(eu(n,t.type?Hd(t.type):Le,e.hasEffectiveModifier(t,64),t));}));}},i=0,a=t.declarations;i<a.length;i++)n(a[i]);return r}return e.emptyArray}function nu(t){return !!(4108&t.flags)||ed(t)||!!(2097152&t.flags)&&!td(t)&&e.some(t.types,nu)}function iu(t){return e.mapDefined(e.filter(t.symbol&&t.symbol.declarations,e.isTypeParameterDeclaration),e.getEffectiveConstraintOfTypeParameter)[0]}function au(t,r){var n,i;if(null===(n=t.symbol)||void 0===n?void 0:n.declarations)for(var a=function(n){if(192===n.parent.kind){var a=e.walkUpParenthesizedTypesAndGetParentAndChild(n.parent.parent),o=a[0],s=void 0===o?n.parent:o,c=a[1];if(180!==c.kind||r){if(166===c.kind&&c.dotDotDotToken||188===c.kind||199===c.kind&&c.dotDotDotToken)i=e.append(i,$u(Ke));else if(201===c.kind)i=e.append(i,Ye);else if(165===c.kind&&197===c.parent.kind)i=e.append(i,gt);else if(197===c.kind&&c.type&&e.skipParentheses(c.type)===n.parent&&191===c.parent.kind&&c.parent.extendsType===c&&197===c.parent.checkType.kind&&c.parent.checkType.type){var l=c.parent.checkType,u=Hd(l.type);i=e.append(i,hp(u,tp(js(Da(l.typeParameter)),l.typeParameter.constraint?Hd(l.typeParameter.constraint):gt)));}}else {var _=c,d=_D(_);if(d){var p=_.typeArguments.indexOf(s);if(p<d.length){var f=Kc(d[p]);if(f){var g=np(d,d.map((function(e,t){return function(){return function(e,t,r){return e.typeArguments&&r<e.typeArguments.length?Hd(e.typeArguments[r]):lD(e,t)[r]}(_,d,t)}}))),m=hp(f,g);m!==t&&(i=e.append(i,m));}}}}}},o=0,s=t.symbol.declarations;o<s.length;o++)a(s[o]);return i&&N_(i)}function ou(e){if(!e.constraint)if(e.target){var t=Kc(e.target);e.constraint=t?hp(t,e.mapper):It;}else {var r=iu(e);if(r){var n=Hd(r);1&n.flags&&!Eo(n)&&(n=197===r.parent.parent.kind?gt:Ke),e.constraint=n;}else e.constraint=au(e)||It;}return e.constraint===It?void 0:e.constraint}function su(t){var r=e.getDeclarationOfKind(t.symbol,165),n=e.isJSDocTemplateTag(r.parent)?e.getEffectiveContainerForJSDocTemplateTag(r.parent):r.parent;return n&&Da(n)}function cu(e){var t="";if(e)for(var r=e.length,n=0;n<r;){for(var i=e[n].id,a=1;n+a<r&&e[n+a].id===i+a;)a++;t.length&&(t+=","),t+=i,a>1&&(t+=":"+a),n+=a;}return t}function lu(e,t){return e?"@".concat(O(e))+(t?":".concat(cu(t)):""):""}function uu(t,r){for(var n=0,i=0,a=t;i<a.length;i++){var o=a[i];void 0!==r&&o.flags&r||(n|=e.getObjectFlags(o));}return 458752&n}function _u(e,t){var r=cu(t),n=e.instantiations.get(r);return n||(n=Oa(4,e.symbol),e.instantiations.set(r,n),n.objectFlags|=t?uu(t):0,n.target=e,n.resolvedTypeArguments=t),n}function du(e){var t=Pa(e.flags);return t.symbol=e.symbol,t.objectFlags=e.objectFlags,t.target=e.target,t.resolvedTypeArguments=e.resolvedTypeArguments,t}function pu(e,t,r,n,i){if(!n){var a=Nd(n=kd(t));i=r?Xd(a,r):a;}var o=Oa(4,e.symbol);return o.target=e,o.node=t,o.mapper=r,o.aliasSymbol=n,o.aliasTypeArguments=i,o}function fu(t){var r,n;if(!t.resolvedTypeArguments){if(!ho(t,6))return (null===(r=t.target.localTypeParameters)||void 0===r?void 0:r.map((function(){return je})))||e.emptyArray;var i=t.node,a=i?180===i.kind?e.concatenate(t.target.outerTypeParameters,lD(i,t.target.localTypeParameters)):185===i.kind?[Hd(i.elementType)]:e.map(i.elements,Hd):e.emptyArray;Do()?t.resolvedTypeArguments=t.mapper?Xd(a,t.mapper):a:(t.resolvedTypeArguments=(null===(n=t.target.localTypeParameters)||void 0===n?void 0:n.map((function(){return je})))||e.emptyArray,Qn(t.node||u,t.target.symbol?e.Diagnostics.Type_arguments_for_0_circularly_reference_themselves:e.Diagnostics.Tuple_type_arguments_circularly_reference_themselves,t.target.symbol&&ro(t.target.symbol)));}return t.resolvedTypeArguments}function gu(t){return e.length(t.target.typeParameters)}function mu(t,r){var n=Js(xa(r)),i=n.localTypeParameters;if(i){var a=e.length(t.typeArguments),o=wl(i),s=e.isInJSFile(t);if((Z||!s)&&(a<o||a>i.length)){var c=s&&e.isExpressionWithTypeArguments(t)&&!e.isJSDocAugmentsTag(t.parent);if(Qn(t,o===i.length?c?e.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_1_type_argument_s:c?e.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,io(n,void 0,2),o,i.length),!s)return je}return 180===t.kind&&r_(t,e.length(t.typeArguments)!==i.length)?pu(n,t,void 0):_u(n,e.concatenate(n.outerTypeParameters,Il(Pu(t),i,o,s)))}return Nu(t,r)?n:je}function yu(t,r,n,i){var a=Js(t);if(a===Ue&&F.has(t.escapedName)&&r&&1===r.length)return q_(t,r[0]);var o=_i(t),s=o.typeParameters,c=cu(r)+lu(n,i),l=o.instantiations.get(c);return l||o.instantiations.set(c,l=bp(a,$d(s,Il(r,s,wl(s),e.isInJSFile(t.valueDeclaration))),n,i)),l}function vu(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias);return !(!n||!e.getContainingFunction(n))}function hu(e){return e.parent?"".concat(hu(e.parent),".").concat(e.escapedName):e.escapedName}function bu(e){var t=(163===e.kind?e.right:208===e.kind?e.name:e).escapedText;if(t){var r=163===e.kind?bu(e.left):208===e.kind?bu(e.expression):void 0,n=r?"".concat(hu(r),".").concat(t):t,i=Oe.get(n);return i||(Oe.set(n,i=ri(524288,t,1048576)),i.parent=r,i.declaredType=Je),i}return we}function xu(t,r,n){var i=function(t){switch(t.kind){case 180:return t.typeName;case 230:var r=t.expression;if(e.isEntityNameExpression(r))return r}}(t);if(!i)return we;var a=ia(i,r,n);return a&&a!==we?a:n?we:bu(i)}function Du(t,r){if(r===we)return je;if(96&(r=function(t){var r=t.valueDeclaration;if(r&&e.isInJSFile(r)&&!(524288&t.flags)&&!e.getExpandoInitializer(r,!1)){var n=e.isVariableDeclaration(r)?e.getDeclaredExpandoInitializer(r):e.getAssignedExpandoInitializer(r);if(n){var i=Da(n);if(i)return xb(i,t)}}}(r)||r).flags)return mu(t,r);if(524288&r.flags)return function(t,r){if(1048576&e.getCheckFlags(r)){var n=Pu(t),i=lu(r,n),a=Me.get(i);return a||((a=Ia(1,"error")).aliasSymbol=r,a.aliasTypeArguments=n,Me.set(i,a)),a}var o=Js(r),s=_i(r).typeParameters;if(s){var c=e.length(t.typeArguments),l=wl(s);if(c<l||c>s.length)return Qn(t,l===s.length?e.Diagnostics.Generic_type_0_requires_1_type_argument_s:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,ro(r),l,s.length),je;var u=kd(t),_=!u||!vu(r)&&vu(u)?void 0:u;return yu(r,Pu(t),_,Nd(_))}return Nu(t,r)?o:je}(t,r);var n=zs(r);if(n)return Nu(t,r)?Rd(n):je;if(111551&r.flags&&ku(t)){var i=function(e,t){var r=di(e);if(!r.resolvedJSDocType){var n=ds(t),i=n;if(t.valueDeclaration){var a=202===e.kind&&e.qualifier;n.symbol&&n.symbol!==t&&a&&(i=Du(e,n.symbol));}r.resolvedJSDocType=i;}return r.resolvedJSDocType}(t,r);return i||(xu(t,788968),ds(r))}return je}function Su(e,t){if(3&t.flags||t===e||!td(e)&&!td(t))return e;var r="".concat(p_(e),">").concat(p_(t)),n=Ee.get(r);if(n)return n;var i=Pa(33554432);return i.baseType=e,i.constraint=t,Ee.set(r,i),i}function Tu(e){return N_([e.constraint,e.baseType])}function Cu(e){return 186===e.kind&&1===e.elements.length}function Eu(e,t,r){return Cu(t)&&Cu(r)?Eu(e,t.elements[0],r.elements[0]):fd(Hd(t))===fd(e)?Hd(r):void 0}function ku(e){return !!(8388608&e.flags)&&(180===e.kind||202===e.kind)}function Nu(t,r){return !t.typeArguments||(Qn(t,e.Diagnostics.Type_0_is_not_generic,r?ro(r):t.typeName?e.declarationNameToString(t.typeName):l),!1)}function Au(t){if(e.isIdentifier(t.typeName)){var r=t.typeArguments;switch(t.typeName.escapedText){case"String":return Nu(t),Ye;case"Number":return Nu(t),Ze;case"Boolean":return Nu(t),at;case"Void":return Nu(t),st;case"Undefined":return Nu(t),qe;case"Null":return Nu(t),Qe;case"Function":case"function":return Nu(t),Wt;case"array":return r&&r.length||Z?void 0:rr;case"promise":return r&&r.length||Z?void 0:$b(Le);case"Object":if(r&&2===r.length){if(e.isJSDocIndexSignature(t)){var n=Hd(r[0]),i=Hd(r[1]),a=n===Ye||n===Ze?[eu(n,i,!1)]:e.emptyArray;return Ja(void 0,z,e.emptyArray,e.emptyArray,a)}return Le}return Nu(t),Z?void 0:Le}}}function Fu(t){var r=di(t);if(!r.resolvedType){if(e.isConstTypeReference(t)&&e.isAssertionExpression(t.parent))return r.resolvedSymbol=we,r.resolvedType=Ix(t.parent.expression);var n=void 0,i=void 0,a=788968;ku(t)&&((i=Au(t))||((n=xu(t,a,!0))===we?n=xu(t,900095):xu(t,a),i=Du(t,n))),i||(i=Du(t,n=xu(t,a))),r.resolvedSymbol=n,r.resolvedType=i;}return r.resolvedType}function Pu(t){return e.map(t.typeArguments,Hd)}function wu(e){var t=di(e);if(!t.resolvedType){var r=wb(e);t.resolvedType=Rd(Cg(r));}return t.resolvedType}function Iu(t,r){function n(e){var t=e.declarations;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];switch(i.kind){case 260:case 261:case 263:return i}}}if(!t)return r?Pt:Ct;var i=Js(t);return 524288&i.flags?e.length(i.typeParameters)!==r?(Qn(n(t),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(t),r),r?Pt:Ct):i:(Qn(n(t),e.Diagnostics.Global_type_0_must_be_a_class_or_interface_type,e.symbolName(t)),r?Pt:Ct)}function Ou(t,r){return Ru(t,111551,r?e.Diagnostics.Cannot_find_global_value_0:void 0)}function Mu(t,r){return Ru(t,788968,r?e.Diagnostics.Cannot_find_global_type_0:void 0)}function Lu(t,r,n){var i=Ru(t,788968,n?e.Diagnostics.Cannot_find_global_type_0:void 0);if(!i||(Js(i),e.length(_i(i).typeParameters)===r))return i;Qn(i.declarations&&e.find(i.declarations,e.isTypeAliasDeclaration),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(i),r);}function Ru(e,t,r){return vi(void 0,e,t,r,e,!1,!1,!1)}function Bu(e,t,r){var n=Mu(e,r);return n||r?Iu(n,t):void 0}function ju(){return Cr||(Cr=Bu("ImportMeta",0,!0)||Ct)}function Ju(){if(!Er){var t=ri(0,"ImportMetaExpression"),r=ju(),n=ri(4,"meta",8);n.parent=t,n.type=r;var i=e.createSymbolTable([n]);t.members=i,Er=Ja(t,i,e.emptyArray,e.emptyArray,e.emptyArray);}return Er}function zu(e){return kr||(kr=Bu("ImportCallOptions",0,e))||Ct}function Uu(e){return or||(or=Ou("Symbol",e))}function Ku(){return cr||(cr=Bu("Symbol",0,!1))||Ct}function Vu(e){return ur||(ur=Bu("Promise",1,e))||Pt}function qu(e){return _r||(_r=Bu("PromiseLike",1,e))||Pt}function Wu(e){return dr||(dr=Ou("Promise",e))}function Hu(e){return br||(br=Bu("AsyncIterable",1,e))||Pt}function Gu(e){return fr||(fr=Bu("Iterable",1,e))||Pt}function Qu(e,t){void 0===t&&(t=0);var r=Ru(e,788968,void 0);return r&&Iu(r,t)}function Xu(e){return Fr||(Fr=Lu("Awaited",1,e)||(e?we:void 0)),Fr===we?void 0:Fr}function Yu(e,t){return e!==Pt?_u(e,t):Ct}function Zu(e){return Yu(lr||(lr=Bu("TypedPropertyDescriptor",1,!0)||Pt),[e])}function $u(e,t){return Yu(t?Xt:Qt,[e])}function e_(e){switch(e.kind){case 187:return 2;case 188:return t_(e);case 199:return e.questionToken?2:e.dotDotDotToken?t_(e):1;default:return 1}}function t_(e){return Wd(e.type)?4:8}function r_(t,r){return !!kd(t)||n_(t)&&(185===t.kind?i_(t.elementType):186===t.kind?e.some(t.elements,i_):r||e.some(t.typeArguments,i_))}function n_(e){var t=e.parent;switch(t.kind){case 193:case 199:case 180:case 189:case 190:case 196:case 191:case 195:case 185:case 186:return n_(t);case 262:return !0}return !1}function i_(t){switch(t.kind){case 180:return ku(t)||!!(524288&xu(t,788968).flags);case 183:return !0;case 195:return 156!==t.operator&&i_(t.type);case 193:case 187:case 199:case 319:case 317:case 318:case 312:return i_(t.type);case 188:return 185!==t.type.kind||i_(t.type.elementType);case 189:case 190:return e.some(t.types,i_);case 196:return i_(t.objectType)||i_(t.indexType);case 191:return i_(t.checkType)||i_(t.extendsType)||i_(t.trueType)||i_(t.falseType)}return !1}function a_(t,r,n,i){void 0===n&&(n=!1);var a=o_(r||e.map(t,(function(e){return 1})),n,i);return a===Pt?Ct:t.length?s_(a,t):a}function o_(t,r,n){if(1===t.length&&4&t[0])return r?Xt:Qt;var i=e.map(t,(function(e){return 1&e?"#":2&e?"?":4&e?".":"*"})).join()+(r?"R":"")+(n&&n.length?","+e.map(n,I).join(","):""),a=me.get(i);return a||me.set(i,a=function(t,r,n){var i,a=t.length,o=e.countWhere(t,(function(e){return !!(9&e)})),s=[],c=0;if(a){i=new Array(a);for(var l=0;l<a;l++){var u=i[l]=Ma(),_=t[l];if(!(12&(c|=_))){var d=ri(4|(2&_?16777216:0),""+l,r?8:0);d.tupleLabelDeclaration=null==n?void 0:n[l],d.type=u,s.push(d);}}}var p=s.length,f=ri(4,"length",r?8:0);if(12&c)f.type=Ze;else {var g=[];for(l=o;l<=a;l++)g.push(Jd(l));f.type=b_(g);}s.push(f);var m=Oa(12);return m.typeParameters=i,m.outerTypeParameters=void 0,m.localTypeParameters=i,m.instantiations=new e.Map,m.instantiations.set(cu(m.typeParameters),m),m.target=m,m.resolvedTypeArguments=m.typeParameters,m.thisType=Ma(),m.thisType.isThisType=!0,m.thisType.constraint=m,m.declaredProperties=s,m.declaredCallSignatures=e.emptyArray,m.declaredConstructSignatures=e.emptyArray,m.declaredIndexInfos=e.emptyArray,m.elementFlags=t,m.minLength=o,m.fixedLength=p,m.hasRestElement=!!(12&c),m.combinedFlags=c,m.readonly=r,m.labeledElementDeclarations=n,m}(t,r,n)),a}function s_(e,t){return 8&e.objectFlags?c_(e,t):_u(e,t)}function c_(t,r){var n,i,a;if(!(14&t.combinedFlags))return _u(t,r);if(8&t.combinedFlags){var o=e.findIndex(r,(function(e,r){return !!(8&t.elementFlags[r]&&1179648&e.flags)}));if(o>=0)return F_(e.map(r,(function(e,r){return 8&t.elementFlags[r]?e:Ke})))?ty(r[o],(function(n){return c_(t,e.replaceElement(r,o,n))})):je}for(var s=[],c=[],l=[],_=-1,d=-1,p=-1,f=function(o){var c=r[o],l=t.elementFlags[o];if(8&l)if(58982400&c.flags||Lc(c))v(c,8,null===(n=t.labeledElementDeclarations)||void 0===n?void 0:n[o]);else if($f(c)){var _=fu(c);if(_.length+s.length>=1e4)return Qn(u,e.isPartOfTypeNode(u)?e.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent:e.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent),{value:je};e.forEach(_,(function(e,t){var r;return v(e,c.target.elementFlags[t],null===(r=c.target.labeledElementDeclarations)||void 0===r?void 0:r[t])}));}else v(Bf(c)&&xl(c,Ze)||je,4,null===(i=t.labeledElementDeclarations)||void 0===i?void 0:i[o]);else v(c,l,null===(a=t.labeledElementDeclarations)||void 0===a?void 0:a[o]);},g=0;g<r.length;g++){var m=f(g);if("object"==typeof m)return m.value}for(g=0;g<_;g++)2&c[g]&&(c[g]=1);d>=0&&d<p&&(s[d]=b_(e.sameMap(s.slice(d,p+1),(function(e,t){return 8&c[d+t]?ld(e,Ze):e}))),s.splice(d+1,p-d),c.splice(d+1,p-d),null==l||l.splice(d+1,p-d));var y=o_(c,t.readonly,l);return y===Pt?Ct:c.length?_u(y,s):y;function v(e,t,r){1&t&&(_=c.length),4&t&&d<0&&(d=c.length),6&t&&(p=c.length),s.push(2&t?Bo(e,!0):e),c.push(t),l&&r?l.push(r):l=void 0;}}function l_(t,r,n){void 0===n&&(n=0);var i=t.target,a=gu(t)-n;return r>i.fixedLength?function(e){var t=rg(e);return t&&$u(t)}(t)||a_(e.emptyArray):a_(fu(t).slice(r,a),i.elementFlags.slice(r,a),!1,i.labeledElementDeclarations&&i.labeledElementDeclarations.slice(r,a))}function u_(t){return b_(e.append(e.arrayOf(t.target.fixedLength,(function(e){return jd(""+e)})),z_(t.target.readonly?Xt:Qt)))}function __(t,r){var n=e.findIndex(t.elementFlags,(function(e){return !(e&r)}));return n>=0?n:t.elementFlags.length}function d_(t,r){return t.elementFlags.length-e.findLastIndex(t.elementFlags,(function(e){return !(e&r)}))-1}function p_(e){return e.id}function f_(t,r){return e.binarySearch(t,r,p_,e.compareValues)>=0}function g_(t,r){var n=e.binarySearch(t,r,p_,e.compareValues);return n<0&&(t.splice(~n,0,r),!0)}function m_(t,r,n){var i=n.flags;if(1048576&i)return y_(t,r|(function(e){return !!(1048576&e.flags&&(e.aliasSymbol||e.origin))}(n)?1048576:0),n.types);if(!(131072&i))if(r|=205258751&i,465829888&i&&(r|=33554432),n===Be&&(r|=8388608),!G&&98304&i)65536&e.getObjectFlags(n)||(r|=4194304);else {var a=t.length,o=a&&n.id>t[a-1].id?~a:e.binarySearch(t,n,p_,e.compareValues);o<0&&t.splice(~o,0,n);}return r}function y_(e,t,r){for(var n=0,i=r;n<i.length;n++)t=m_(e,t,i[n]);return t}function v_(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];if(1048576&a.flags){var o=a.origin;a.aliasSymbol||o&&!(1048576&o.flags)?e.pushIfUnique(t,a):o&&1048576&o.flags&&v_(t,o.types);}}}function h_(e,t){var r=wa(e);return r.types=t,r}function b_(t,r,n,i,a){if(void 0===r&&(r=1),0===t.length)return ct;if(1===t.length)return t[0];var o=[],s=y_(o,0,t);if(0!==r){if(3&s)return 1&s?8388608&s?Be:Le:65536&s||f_(o,Ke)?Ke:Ve;if(ne&&32768&s){var c=e.binarySearch(o,Ge,p_,e.compareValues);c>=0&&f_(o,qe)&&e.orderedRemoveItemAt(o,c);}if((402664320&s||16384&s&&32768&s)&&function(t,r,n){for(var i=t.length;i>0;){var a=t[--i],o=a.flags;(402653312&o&&4&r||256&o&&8&r||2048&o&&64&r||8192&o&&4096&r||n&&32768&o&&16384&r||Bd(a)&&f_(t,a.regularType))&&e.orderedRemoveItemAt(t,i);}}(o,s,!!(2&r)),128&s&&134217728&s&&function(t){var r=e.filter(t,ed);if(r.length)for(var n=t.length,i=function(){n--;var i=t[n];128&i.flags&&e.some(r,(function(e){return em(i,e)}))&&e.orderedRemoveItemAt(t,n);};n>0;)i();}(o),2===r&&(o=function(t,r){if(t.length<2)return t;var n=cu(t),i=ke.get(n);if(i)return i;for(var a=r&&e.some(t,(function(e){return !!(524288&e.flags)&&!Lc(e)&&Qp(Rc(e))})),o=t.length,s=o,c=0;s>0;){var l=t[--s];if(a||469499904&l.flags)for(var _=61603840&l.flags?e.find(zc(l),(function(e){return qf(ds(e))})):void 0,d=_&&Rd(ds(_)),p=0,f=t;p<f.length;p++){var g=f[p];if(l!==g){if(1e5===c&&c/(o-s)*o>1e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","removeSubtypes_DepthLimit",{typeIds:t.map((function(e){return e.id}))}),void Qn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(c++,_&&61603840&g.flags){var m=To(g,_.escapedName);if(m&&qf(m)&&Rd(m)!==d)continue}if(rf(l,g,Mn)&&(!(1&e.getObjectFlags(gs(l)))||!(1&e.getObjectFlags(gs(g)))||Op(l,g))){e.orderedRemoveItemAt(t,s);break}}}}return ke.set(n,t),t}(o,!!(524288&s)),!o))return je;if(0===o.length)return 65536&s?4194304&s?Qe:Xe:32768&s?4194304&s?qe:We:ct}if(!a&&1048576&s){var l=[];v_(l,t);for(var _=[],d=function(t){e.some(l,(function(e){return f_(e.types,t)}))||_.push(t);},p=0,f=o;p<f.length;p++)d(f[p]);if(!n&&1===l.length&&0===_.length)return l[0];if(e.reduceLeft(l,(function(e,t){return e+t.types.length}),0)+_.length===o.length){for(var g=0,m=l;g<m.length;g++)g_(_,m[g]);a=h_(1048576,_);}}return D_(o,(36323363&s?0:32768)|(2097152&s?16777216:0),n,i,a)}function x_(e,t){return e.kind===t.kind&&e.parameterIndex===t.parameterIndex}function D_(e,t,r,n,i){if(0===e.length)return ct;if(1===e.length)return e[0];var a=(i?1048576&i.flags?"|".concat(cu(i.types)):2097152&i.flags?"&".concat(cu(i.types)):"#".concat(i.type.id,"|").concat(cu(e)):cu(e))+lu(r,n),o=ye.get(a);return o||((o=Pa(1048576)).objectFlags=t|uu(e,98304),o.types=e,o.origin=i,o.aliasSymbol=r,o.aliasTypeArguments=n,2===e.length&&512&e[0].flags&&512&e[1].flags&&(o.flags|=16,o.intrinsicName="boolean"),ye.set(a,o)),o}function S_(e,t,r){var n=r.flags;return 2097152&n?T_(e,t,r.types):(Yp(r)?16777216&t||(t|=16777216,e.set(r.id.toString(),r)):(3&n?r===Be&&(t|=8388608):!G&&98304&n||(ne&&r===Ge&&(t|=262144,r=qe),e.has(r.id.toString())||(109440&r.flags&&109440&t&&(t|=67108864),e.set(r.id.toString(),r))),t|=205258751&n),t)}function T_(e,t,r){for(var n=0,i=r;n<i.length;n++)t=S_(e,t,Rd(i[n]));return t}function C_(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!f_(i.types,t)){var a=128&t.flags?Ye:256&t.flags?Ze:2048&t.flags?$e:8192&t.flags?ot:void 0;if(!a||!f_(i.types,a))return !1}}return !0}function E_(t,r){return e.every(t,(function(t){return !!(1048576&t.flags)&&e.some(t.types,(function(e){return !!(e.flags&r)}))}))}function k_(e,t){for(var r=0;r<e.length;r++)e[r]=Zm(e[r],(function(e){return !(e.flags&t)}));}function N_(t,r,n,i){var a=new e.Map,o=T_(a,0,t),s=e.arrayFrom(a.values());if(131072&o)return e.contains(s,lt)?lt:ct;if(G&&98304&o&&84410368&o||67108864&o&&402783228&o||402653316&o&&67238776&o||296&o&&469891796&o||2112&o&&469889980&o||12288&o&&469879804&o||49152&o&&469842940&o)return ct;if(134217728&o&&128&o&&function(t){for(var r=t.length,n=e.filter(t,(function(e){return !!(128&e.flags)}));r>0;){var i=t[--r];if(134217728&i.flags)for(var a=0,o=n;a<o.length;a++){if(wp(o[a],i)){e.orderedRemoveItemAt(t,r);break}if(ed(i))return !0}}return !1}(s))return ct;if(1&o)return 8388608&o?Be:Le;if(!G&&98304&o)return 16777216&o?ct:32768&o?qe:Qe;if((4&o&&402653312&o||8&o&&256&o||64&o&&2048&o||4096&o&&8192&o||16384&o&&32768&o||16777216&o&&470302716&o)&&(i||function(t,r){for(var n=t.length;n>0;){var i=t[--n];(4&i.flags&&402653312&r||8&i.flags&&256&r||64&i.flags&&2048&r||4096&i.flags&&8192&r||16384&i.flags&&32768&r||Yp(i)&&470302716&r)&&e.orderedRemoveItemAt(t,n);}}(s,o)),262144&o&&(s[s.indexOf(qe)]=Ge),0===s.length)return Ke;if(1===s.length)return s[0];var c=cu(s)+lu(r,n),l=ve.get(c);if(!l){if(1048576&o)if(function(t){var r,n=e.findIndex(t,(function(t){return !!(32768&e.getObjectFlags(t))}));if(n<0)return !1;for(var i=n+1;i<t.length;){var a=t[i];32768&e.getObjectFlags(a)?((r||(r=[t[n]])).push(a),e.orderedRemoveItemAt(t,i)):i++;}if(!r)return !1;for(var o=[],s=[],c=0,l=r;c<l.length;c++)for(var u=0,_=l[c].types;u<_.length;u++)g_(o,a=_[u])&&C_(r,a)&&g_(s,a);return t[n]=D_(s,32768),!0}(s))l=N_(s,r,n);else if(E_(s,32768)){var u=ne&&e.some(s,(function(e){return f_(e.types,Ge)}))?Ge:qe;k_(s,32768),l=b_([N_(s),u],1,r,n);}else if(E_(s,65536))k_(s,65536),l=b_([N_(s),Qe],1,r,n);else {if(!F_(s))return je;var _=function(e){for(var t=A_(e),r=[],n=0;n<t;n++){for(var i=e.slice(),a=n,o=e.length-1;o>=0;o--)if(1048576&e[o].flags){var s=e[o].types,c=s.length;i[o]=s[a%c],a=Math.floor(a/c);}var l=N_(i);131072&l.flags||r.push(l);}return r}(s);l=b_(_,1,r,n,e.some(_,(function(e){return !!(2097152&e.flags)}))&&w_(_)>w_(s)?h_(2097152,s):void 0);}else l=function(e,t,r){var n=Pa(2097152);return n.objectFlags=uu(e,98304),n.types=e,n.aliasSymbol=t,n.aliasTypeArguments=r,n}(s,r,n);ve.set(c,l);}return l}function A_(t){return e.reduceLeft(t,(function(e,t){return 1048576&t.flags?e*t.types.length:131072&t.flags?0:e}),1)}function F_(t){var r=A_(t);return !(r>=1e5&&(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkCrossProductUnion_DepthLimit",{typeIds:t.map((function(e){return e.id})),size:r}),Qn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent),1))}function P_(e){return 3145728&e.flags&&!e.aliasSymbol?1048576&e.flags&&e.origin?P_(e.origin):w_(e.types):1}function w_(t){return e.reduceLeft(t,(function(e,t){return e+P_(t)}),0)}function I_(e,t){var r=Pa(4194304);return r.type=e,r.stringsOnly=t,r}function O_(e,t){return t?e.resolvedStringIndexType||(e.resolvedStringIndexType=I_(e,!0)):e.resolvedIndexType||(e.resolvedIndexType=I_(e,!1))}function M_(t){return e.isPrivateIdentifier(t)?ct:e.isIdentifier(t)?jd(e.unescapeLeadingUnderscores(t.escapedText)):Rd(e.isComputedPropertyName(t)?hv(t):Zx(t))}function L_(t,r,n){if(n||!(24&e.getDeclarationModifierFlagsFromSymbol(t))){var i=_i(ac(t)).nameType;if(!i){var a=e.getNameOfDeclaration(t.valueDeclaration);i="default"===t.escapedName?jd("default"):a&&M_(a)||(e.isKnownSymbol(t)?void 0:jd(e.symbolName(t)));}if(i&&i.flags&r)return i}return ct}function R_(t,r){return !!(t.flags&r||2097152&t.flags&&e.some(t.types,(function(e){return R_(e,r)})))}function B_(t,r,n){var i=n&&(7&e.getObjectFlags(t)||t.aliasSymbol)?function(e){var t=wa(4194304);return t.type=e,t}(t):void 0,a=e.map(zc(t),(function(e){return L_(e,r)})),o=e.map(hl(t),(function(e){return e!==Vr&&R_(e.keyType,r)?e.keyType===Ye&&8&r?pt:e.keyType:ct}));return b_(e.concatenate(a,o),1,void 0,void 0,i)}function j_(e){var t=function(e){return 262143&e.flags?e:e.uniqueLiteralFilledInstantiation||(e.uniqueLiteralFilledInstantiation=hp(e,Dt))}(e);return sl(t)!==t}function J_(t){return !!(58982400&t.flags||eg(t)||Lc(t)&&(r=t,n=Ec(r),!function t(r){return !!(68157439&r.flags)||(16777216&r.flags?r.root.isDistributive&&r.checkType===n:137363456&r.flags?e.every(r.types,t):8388608&r.flags?t(r.objectType)&&t(r.indexType):33554432&r.flags?t(r.baseType)&&t(r.constraint):!!(268435456&r.flags)&&t(r.type))}(Nc(r)||n))||1048576&t.flags&&e.some(t.types,j_)||2097152&t.flags&&vx(t,465829888)&&e.some(t.types,Yp));var r,n;}function z_(t,r,n){return void 0===r&&(r=te),J_(t=sl(t))?O_(t,r):1048576&t.flags?N_(e.map(t.types,(function(e){return z_(e,r,n)}))):2097152&t.flags?b_(e.map(t.types,(function(e){return z_(e,r,n)}))):32&e.getObjectFlags(t)?function(e,t,r){var n=Ec(e),i=kc(e),a=Nc(e.target||e);if(!a&&!r)return i;var o=[];if(Pc(e)){if(nd(i))return O_(e,t);Cc(rl(wc(e)),8576,t,c);}else Qm(Sc(i),c);nd(i)&&Qm(i,c);var s=r?Zm(b_(o),(function(e){return !(5&e.flags)})):b_(o);return 1048576&s.flags&&1048576&i.flags&&cu(s.types)===cu(i.types)?i:s;function c(t){var r=a?hp(a,cp(e.mapper,n,t)):t;o.push(r===Ye?pt:r);}}(t,r,n):t===Be?Be:2&t.flags?ct:131073&t.flags?gt:B_(t,(n?128:402653316)|(r?0:12584),r===te&&!n)}function U_(e){if(te)return e;var t=(Nr||(Nr=Lu("Extract",2,!0)||we),Nr===we?void 0:Nr);return t?yu(t,[e,Ye]):Ye}function K_(t,r){var n=e.findIndex(r,(function(e){return !!(1179648&e.flags)}));if(n>=0)return F_(r)?ty(r[n],(function(i){return K_(t,e.replaceElement(r,n,i))})):je;if(e.contains(r,Be))return Be;var i=[],a=[],o=t[0];if(!function t(r,n){for(var s=e.isArray(r),c=0;c<n.length;c++){var l=n[c],u=s?r[c+1]:r;if(101248&l.flags){if(o+=V_(l)||"",o+=u,!s)return !0}else if(134217728&l.flags){if(o+=l.texts[0],!t(l.texts,l.types))return !1;if(o+=u,!s)return !0}else if(nd(l)||$_(l))i.push(l),a.push(o),o=u;else if(2097152&l.flags){if(!t(r[c+1],l.types))return !1}else if(s)return !1}return !0}(t,r))return Ye;if(0===i.length)return jd(o);if(a.push(o),e.every(a,(function(e){return ""===e}))){if(e.every(i,(function(e){return !!(4&e.flags)})))return Ye;if(1===i.length&&ed(i[0]))return i[0]}var s="".concat(cu(i),"|").concat(e.map(a,(function(e){return e.length})).join(","),"|").concat(a.join("")),c=Te.get(s);return c||Te.set(s,c=function(e,t){var r=Pa(134217728);return r.texts=e,r.types=t,r}(a,i)),c}function V_(t){return 128&t.flags?t.value:256&t.flags?""+t.value:2048&t.flags?e.pseudoBigIntToString(t.value):98816&t.flags?t.intrinsicName:void 0}function q_(e,t){return 1179648&t.flags?ty(t,(function(t){return q_(e,t)})):128&t.flags?jd(W_(e,t.value)):134217728&t.flags?K_.apply(void 0,function(e,t,r){switch(F.get(e.escapedName)){case 0:return [t.map((function(e){return e.toUpperCase()})),r.map((function(t){return q_(e,t)}))];case 1:return [t.map((function(e){return e.toLowerCase()})),r.map((function(t){return q_(e,t)}))];case 2:return [""===t[0]?t:n$4([t[0].charAt(0).toUpperCase()+t[0].slice(1)],t.slice(1),!0),""===t[0]?n$4([q_(e,r[0])],r.slice(1),!0):r];case 3:return [""===t[0]?t:n$4([t[0].charAt(0).toLowerCase()+t[0].slice(1)],t.slice(1),!0),""===t[0]?n$4([q_(e,r[0])],r.slice(1),!0):r]}return [t,r]}(e,t.texts,t.types)):268435456&t.flags&&e===t.symbol?t:268435461&t.flags||nd(t)?H_(e,t):$_(t)?H_(e,K_(["",""],[t])):t}function W_(e,t){switch(F.get(e.escapedName)){case 0:return t.toUpperCase();case 1:return t.toLowerCase();case 2:return t.charAt(0).toUpperCase()+t.slice(1);case 3:return t.charAt(0).toLowerCase()+t.slice(1)}return t}function H_(e,t){var r="".concat(O(e),",").concat(p_(t)),n=Ce.get(r);return n||Ce.set(r,n=function(e,t){var r=Pa(268435456);return r.symbol=e,r.type=t,r}(e,t)),n}function G_(t){if(Z)return !1;if(4096&e.getObjectFlags(t))return !0;if(1048576&t.flags)return e.every(t.types,G_);if(2097152&t.flags)return e.some(t.types,G_);if(465829888&t.flags){var r=Yc(t);return r!==t&&G_(r)}return !1}function Q_(t,r){return Xs(t)?tc(t):r&&e.isPropertyName(r)?e.getPropertyNameForPropertyNameNode(r):void 0}function X_(t,r){if(8208&r.flags){var n=e.findAncestor(t.parent,(function(t){return !e.isAccessExpression(t)}))||t.parent;return e.isCallLikeExpression(n)?e.isCallOrNewExpression(n)&&e.isIdentifier(t)&&Em(n,t):e.every(r.declarations,(function(t){return !e.isFunctionLike(t)||!!(268435456&e.getCombinedNodeFlags(t))}))}return !0}function Y_(t,r,n,i,a,o){var s,c=a&&209===a.kind?a:void 0,l=a&&e.isPrivateIdentifier(a)?void 0:Q_(n,a);if(void 0!==l){if(256&o)return $y(r,l)||Le;var u=dl(r,l);if(u){if(64&o&&a&&u.declarations&&ei(u)&&X_(a,u)&&ti(null!==(s=null==c?void 0:c.argumentExpression)&&void 0!==s?s:e.isIndexedAccessTypeNode(a)?a.indexType:a,u.declarations,l),c){if(Th(u,c,Ch(c.expression,r.symbol)),fx(c,u,e.getAssignmentTargetKind(c)))return void Qn(c.argumentExpression,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,ro(u));if(8&o&&(di(a).resolvedSymbol=u),lh(c,u))return Re}var _=ds(u);return c&&1!==e.getAssignmentTargetKind(c)?Dy(c,_):_}if(Ym(r,$f)&&e.isNumericLiteralName(l)){var d=+l;if(a&&Ym(r,(function(e){return !e.target.hasRestElement}))&&!(16&o)){var p=Z_(a);if($f(r)){if(d<0)return Qn(p,e.Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value),qe;Qn(p,e.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,io(r),gu(r),e.unescapeLeadingUnderscores(l));}else Qn(p,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),io(r));}if(d>=0)return x(bl(r,Ze)),ty(r,(function(e){var t=rg(e)||qe;return 1&o?b_([t,qe]):t}))}}if(!(98304&n.flags)&&hx(n,402665900)){if(131073&r.flags)return r;var f=Sl(r,n)||bl(r,Ye);if(f)return 2&o&&f.keyType!==Ze?void(c&&Qn(c,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,io(n),io(t))):a&&f.keyType===Ye&&!hx(n,12)?(Qn(p=Z_(a),e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,io(n)),1&o?b_([f.type,qe]):f.type):(x(f),1&o&&!(r.symbol&&384&r.symbol.flags&&n.symbol&&1024&n.flags&&Sa(n.symbol)===r.symbol)?b_([f.type,qe]):f.type);if(131072&n.flags)return ct;if(G_(r))return Le;if(c&&!xx(r)){if(om(r)){if(Z&&384&n.flags)return Pn.add(e.createDiagnosticForNode(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,io(r))),qe;if(12&n.flags){var g=e.map(r.properties,(function(e){return ds(e)}));return b_(e.append(g,qe))}}if(r.symbol===le&&void 0!==l&&le.exports.has(l)&&418&le.exports.get(l).flags)Qn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),io(r));else if(Z&&!K.suppressImplicitAnyIndexErrors&&!(128&o))if(void 0!==l&&mh(l,r)){var m=io(r);Qn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,m,m+"["+e.getTextOfNode(c.argumentExpression)+"]");}else if(xl(r,Ze))Qn(c.argumentExpression,e.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else {var y=void 0;if(void 0!==l&&(y=bh(l,r)))void 0!==y&&Qn(c.argumentExpression,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,l,io(r),y);else {var v=function(t,r,n){var i=e.isAssignmentTarget(r)?"set":"get";if(function(e){var r=jc(t,e);if(r){var i=Jh(ds(r));return !!i&&qb(i)>=1&&Ip(n,zb(i,0))}return !1}(i)){var a=e.tryGetPropertyAccessOrIdentifierToString(r.expression);return void 0===a?a=i:a+="."+i,a}}(r,c,n);if(void 0!==v)Qn(c,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,io(r),v);else {var h=void 0;if(1024&n.flags)h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+io(n)+"]",io(r));else if(8192&n.flags){var b=na(n.symbol,c);h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+b+"]",io(r));}else 128&n.flags||256&n.flags?h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,io(r)):12&n.flags&&(h=e.chainDiagnosticMessages(void 0,e.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,io(n),io(r)));h=e.chainDiagnosticMessages(h,e.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,io(i),io(r)),Pn.add(e.createDiagnosticForNodeFromMessageChain(c,h));}}}return}}return G_(r)?Le:(a&&(p=Z_(a),384&n.flags?Qn(p,e.Diagnostics.Property_0_does_not_exist_on_type_1,""+n.value,io(r)):12&n.flags?Qn(p,e.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1,io(r),io(n)):Qn(p,e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,io(n))),Co(n)?n:void 0);function x(t){t&&t.isReadonly&&c&&(e.isAssignmentTarget(c)||e.isDeleteTarget(c))&&Qn(c,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,io(r));}}function Z_(e){return 209===e.kind?e.argumentExpression:196===e.kind?e.indexType:164===e.kind?e.expression:e}function $_(e){return !!(77&e.flags)||ed(e)}function ed(t){return !!(134217728&t.flags)&&e.every(t.types,$_)||!!(268435456&t.flags)&&$_(t.type)}function td(e){return !!id(e)}function rd(e){return !!(4194304&id(e))}function nd(e){return !!(8388608&id(e))}function id(t){return 3145728&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|e.reduceLeft(t.types,(function(e,t){return e|id(t)}),0)),12582912&t.objectFlags):33554432&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|id(t.baseType)|id(t.constraint)),12582912&t.objectFlags):(58982400&t.flags||Lc(t)||eg(t)?4194304:0)|(465829888&t.flags&&!ed(t)?8388608:0)}function ad(t,r){return 8388608&t.flags?function(t,r){var n=r?"simplifiedForWriting":"simplifiedForReading";if(t[n])return t[n]===Ot?t:t[n];t[n]=Ot;var i=ad(t.objectType,r),a=ad(t.indexType,r),o=function(t,r,n){if(1048576&r.flags){var i=e.map(r.types,(function(e){return ad(ld(t,e),n)}));return n?N_(i):b_(i)}}(i,a,r);if(o)return t[n]=o;if(!(465829888&a.flags)){var s=od(i,a,r);if(s)return t[n]=s}if(eg(i)&&296&a.flags){var c=ng(i,8&a.flags?0:i.target.fixedLength,0,r);if(c)return t[n]=c}if(Lc(i)){var l=Nc(i);if(!l||Ip(l,Ec(i)))return t[n]=ty(cd(i,t.indexType),(function(e){return ad(e,r)}))}return t[n]=t}(t,r):16777216&t.flags?function(e,t){var r=e.checkType,n=e.extendsType,i=bd(e),a=xd(e);if(131072&a.flags&&fd(i)===fd(r)){if(1&r.flags||Ip(Dp(r),Dp(n)))return ad(i,t);if(sd(r,n))return ct}else if(131072&i.flags&&fd(a)===fd(r)){if(!(1&r.flags)&&Ip(Dp(r),Dp(n)))return ct;if(1&r.flags||sd(r,n))return ad(a,t)}return e}(t,r):t}function od(t,r,n){if(1048576&t.flags||2097152&t.flags&&!J_(t)){var i=e.map(t.types,(function(e){return ad(ld(e,r),n)}));return 2097152&t.flags||n?N_(i):b_(i)}}function sd(e,t){return !!(131072&b_([vc(e,t),ct]).flags)}function cd(e,t){var r=$d([Ec(e)],[t]),n=op(e.mapper,r);return hp(Ac(e.target||e),n)}function ld(e,t,r,n,i,a){return void 0===r&&(r=0),_d(e,t,r,n,i,a)||(n?je:Ke)}function ud(t,r){return Ym(t,(function(t){if(384&t.flags){var n=tc(t);if(e.isNumericLiteralName(n)){var i=+n;return i>=0&&i<r}}return !1}))}function _d(e,t,r,n,i,a){if(void 0===r&&(r=0),e===Be||t===Be)return Be;if(!$p(e)||98304&t.flags||!hx(t,12)||(t=Ye),K.noUncheckedIndexedAccess&&32&r&&(r|=1),nd(t)||(n&&196!==n.kind?eg(e)&&!ud(t,e.target.fixedLength):rd(e)&&(!$f(e)||!ud(t,e.target.fixedLength)))){if(3&e.flags)return e;var o=1&r,s=e.id+","+t.id+","+o+lu(i,a),c=Se.get(s);return c||Se.set(s,c=function(e,t,r,n,i){var a=Pa(8388608);return a.objectType=e,a.indexType=t,a.accessFlags=r,a.aliasSymbol=n,a.aliasTypeArguments=i,a}(e,t,o,i,a)),c}var l=nl(e);if(1048576&t.flags&&!(16&t.flags)){for(var u=[],_=!1,d=0,p=t.types;d<p.length;d++){var f=Y_(e,l,p[d],t,n,r|(_?128:0));if(f)u.push(f);else {if(!n)return;_=!0;}}if(_)return;return 4&r?N_(u,i,a):b_(u,1,i,a)}return Y_(e,l,t,t,n,72|r)}function dd(e){var t=di(e);if(!t.resolvedType){var r=Hd(e.objectType),n=Hd(e.indexType),i=kd(e);t.resolvedType=ld(r,n,0,e,i,Nd(i));}return t.resolvedType}function pd(e){var t=di(e);if(!t.resolvedType){var r=Oa(32,e.symbol);r.declaration=e,r.aliasSymbol=kd(e),r.aliasTypeArguments=Nd(r.aliasSymbol),t.resolvedType=r,kc(r);}return t.resolvedType}function fd(e){return 33554432&e.flags?e.baseType:8388608&e.flags&&(33554432&e.objectType.flags||33554432&e.indexType.flags)?ld(fd(e.objectType),fd(e.indexType)):e}function gd(e){var t=Kc(e);return t&&(rd(t)||nd(t))?lp(e):e}function md(e){return !e.isDistributive&&yd(e.node.checkType)&&yd(e.node.extendsType)}function yd(t){return e.isTupleTypeNode(t)&&1===e.length(t.elements)&&!e.isOptionalTypeNode(t.elements[0])&&!e.isRestTypeNode(t.elements[0])&&!(e.isNamedTupleMember(t.elements[0])&&(t.elements[0].questionToken||t.elements[0].dotDotDotToken))}function vd(e,t){return md(e)&&$f(t)?fu(t)[0]:t}function hd(t,r,n,i){for(var a,o,s=0;;){if(1e3===s){Qn(u,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),a=je;break}var c=md(t),l=hp(vd(t,fd(t.checkType)),r),_=td(l),d=hp(vd(t,t.extendsType),r);if(l===Be||d===Be)return Be;var p=void 0;if(t.inferTypeParameters){var f=e.sameMap(t.inferTypeParameters,gd),g=f!==t.inferTypeParameters?$d(t.inferTypeParameters,f):void 0,m=wg(f,void 0,0);if(g)for(var y=op(r,g),v=0,h=f;v<h.length;v++){var b=h[v];-1===t.inferTypeParameters.indexOf(b)&&(b.mapper=y);}_||nm(m.inferences,l,hp(d,g),1536);var x=op(g,m.mapper);p=r?op(x,r):x;}var D=p?hp(vd(t,t.extendsType),p):d;if(!_&&!td(D)){if(!(3&D.flags)&&(1&l.flags&&!c||!Ip(xp(l),xp(D)))){1&l.flags&&!c&&(o||(o=[])).push(hp(Hd(t.node.trueType),p||r));var S=Hd(t.node.falseType);if(16777216&S.flags){var T=S.root;if(T.node.parent===t.node&&(!T.isDistributive||T.checkType===t.checkType)){t=T;continue}if(k(S,r))continue}a=hp(S,r);break}if(3&D.flags||Ip(Dp(l),Dp(D))){var C=Hd(t.node.trueType),E=p||r;if(k(C,E))continue;a=hp(C,E);break}}(a=Pa(16777216)).root=t,a.checkType=hp(t.checkType,r),a.extendsType=hp(t.extendsType,r),a.mapper=r,a.combinedMapper=p,a.aliasSymbol=n||t.aliasSymbol,a.aliasTypeArguments=n?i:Xd(t.aliasTypeArguments,r);break}return o?b_(e.append(o,a)):a;function k(a,o){if(16777216&a.flags&&o){var c=a.root;if(c.outerTypeParameters){var l=op(a.mapper,o),u=e.map(c.outerTypeParameters,(function(e){return ep(e,l)})),_=$d(c.outerTypeParameters,u),d=c.isDistributive?ep(c.checkType,_):void 0;if(!(d&&d!==c.checkType&&1179648&d.flags))return t=c,r=_,n=void 0,i=void 0,c.aliasSymbol&&s++,!0}}return !1}}function bd(e){return e.resolvedTrueType||(e.resolvedTrueType=hp(Hd(e.root.node.trueType),e.mapper))}function xd(e){return e.resolvedFalseType||(e.resolvedFalseType=hp(Hd(e.root.node.falseType),e.mapper))}function Dd(t){var r;return t.locals&&t.locals.forEach((function(t){262144&t.flags&&(r=e.append(r,Js(t)));})),r}function Sd(t){return e.isIdentifier(t)?[t]:e.append(Sd(t.left),t.right)}function Td(t){var r,n=di(t);if(!n.resolvedType){if(t.isTypeOf&&t.typeArguments)return Qn(t,e.Diagnostics.Type_arguments_cannot_be_used_here),n.resolvedSymbol=we,n.resolvedType=je;if(!e.isLiteralImportTypeNode(t))return Qn(t.argument,e.Diagnostics.String_literal_expected),n.resolvedSymbol=we,n.resolvedType=je;var i=t.isTypeOf?111551:8388608&t.flags?900095:788968,a=oa(t,t.argument.literal);if(!a)return n.resolvedSymbol=we,n.resolvedType=je;var o=!!(null===(r=a.exports)||void 0===r?void 0:r.get("export=")),s=ua(a,!1);if(e.nodeIsMissing(t.qualifier))s.flags&i?n.resolvedType=Cd(t,n,s,i):(Qn(t,111551===i?e.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0,t.argument.literal.text),n.resolvedSymbol=we,n.resolvedType=je);else {for(var c=Sd(t.qualifier),l=s,u=void 0;u=c.shift();){var _=c.length?1920:i,d=xa(Gi(l)),p=t.isTypeOf||e.isInJSFile(t)&&o?dl(ds(d),u.escapedText,!1,!0):void 0,f=t.isTypeOf?void 0:fi(ya(d),u.escapedText,_),g=null!=f?f:p;if(!g)return Qn(u,e.Diagnostics.Namespace_0_has_no_exported_member_1,na(l),e.declarationNameToString(u)),n.resolvedType=je;di(u).resolvedSymbol=g,di(u.parent).resolvedSymbol=g,l=g;}n.resolvedType=Cd(t,n,l,i);}}return n.resolvedType}function Cd(e,t,r,n){var i=Gi(r);return t.resolvedSymbol=i,111551===n?ds(r):Du(e,i)}function Ed(t){var r=di(t);if(!r.resolvedType){var n=kd(t);if(0!==ic(t.symbol).size||n){var i=Oa(16,t.symbol);i.aliasSymbol=n,i.aliasTypeArguments=Nd(n),e.isJSDocTypeLiteral(t)&&t.isArrayType&&(i=$u(i)),r.resolvedType=i;}else r.resolvedType=Nt;}return r.resolvedType}function kd(t){for(var r=t.parent;e.isParenthesizedTypeNode(r)||e.isJSDocTypeExpression(r)||e.isTypeOperatorNode(r)&&146===r.operator;)r=r.parent;return e.isTypeAlias(r)?Da(r):void 0}function Nd(e){return e?bs(e):void 0}function Ad(e){return !!(524288&e.flags)&&!Lc(e)}function Fd(e){return Xp(e)||!!(474058748&e.flags)}function Pd(t,r){if(!(1048576&t.flags))return t;if(e.every(t.types,Fd))return e.find(t.types,Xp)||Ct;var n=e.find(t.types,(function(e){return !Fd(e)}));return n?e.find(t.types,(function(e){return e!==n&&!Fd(e)}))?t:function(t){for(var n=e.createSymbolTable(),i=0,a=zc(t);i<a.length;i++){var o=a[i];if(24&e.getDeclarationModifierFlagsFromSymbol(o));else if(Id(o)){var s=65536&o.flags&&!(32768&o.flags),c=ri(16777220,o.escapedName,Tc(o)|(r?8:0));c.type=s?qe:Bo(ds(o),!0),c.declarations=o.declarations,c.nameType=_i(o).nameType,c.syntheticOrigin=o,n.set(o.escapedName,c);}}var l=Ja(t.symbol,n,e.emptyArray,e.emptyArray,hl(t));return l.objectFlags|=131200,l}(n):t}function wd(t,r,n,i,a){if(1&t.flags||1&r.flags)return Le;if(2&t.flags||2&r.flags)return Ke;if(131072&t.flags)return r;if(131072&r.flags)return t;if(1048576&(t=Pd(t,a)).flags)return F_([t,r])?ty(t,(function(e){return wd(e,r,n,i,a)})):je;if(1048576&(r=Pd(r,a)).flags)return F_([t,r])?ty(r,(function(e){return wd(t,e,n,i,a)})):je;if(473960444&r.flags)return t;if(rd(t)||rd(r)){if(Xp(t))return r;if(2097152&t.flags){var o=t.types,s=o[o.length-1];if(Ad(s)&&Ad(r))return N_(e.concatenate(o.slice(0,o.length-1),[wd(s,r,n,i,a)]))}return N_([t,r])}for(var c=e.createSymbolTable(),l=new e.Set,u=t===Ct?hl(r):yc([t,r]),_=0,d=zc(r);_<d.length;_++){var p=d[_];24&e.getDeclarationModifierFlagsFromSymbol(p)?l.add(p.escapedName):Id(p)&&c.set(p.escapedName,Od(p,a));}for(var f=0,g=zc(t);f<g.length;f++){var m=g[f];if(!l.has(m.escapedName)&&Id(m))if(c.has(m.escapedName)){var y=ds(p=c.get(m.escapedName));if(16777216&p.flags){var v=e.concatenate(m.declarations,p.declarations),h=ri(4|16777216&m.flags,m.escapedName);h.type=b_([ds(m),mg(y)],2),h.leftSpread=m,h.rightSpread=p,h.declarations=v,h.nameType=_i(m).nameType,c.set(m.escapedName,h);}}else c.set(m.escapedName,Od(m,a));}var b=Ja(n,c,e.emptyArray,e.emptyArray,e.sameMap(u,(function(e){return function(e,t){return e.isReadonly!==t?eu(e.keyType,e.type,t,e.declaration):e}(e,a)})));return b.objectFlags|=2228352|i,b}function Id(t){var r;return !(e.some(t.declarations,e.isPrivateIdentifierClassElementDeclaration)||106496&t.flags&&(null===(r=t.declarations)||void 0===r?void 0:r.some((function(t){return e.isClassLike(t.parent)}))))}function Od(e,t){var r=65536&e.flags&&!(32768&e.flags);if(!r&&t===px(e))return e;var n=ri(4|16777216&e.flags,e.escapedName,Tc(e)|(t?8:0));return n.type=r?qe:ds(e),n.declarations=e.declarations,n.nameType=_i(e).nameType,n.syntheticOrigin=e,n}function Md(e,t,r,n){var i=Pa(e);return i.symbol=r,i.value=t,i.regularType=n||i,i}function Ld(e){if(2944&e.flags){if(!e.freshType){var t=Md(e.flags,e.value,e.symbol,e);t.freshType=t,e.freshType=t;}return e.freshType}return e}function Rd(e){return 2944&e.flags?e.regularType:1048576&e.flags?e.regularType||(e.regularType=ty(e,Rd)):e}function Bd(e){return !!(2944&e.flags)&&e.freshType===e}function jd(e){var t;return he.get(e)||(he.set(e,t=Md(128,e)),t)}function Jd(e){var t;return be.get(e)||(be.set(e,t=Md(256,e)),t)}function zd(t){var r,n=e.pseudoBigIntToString(t);return xe.get(n)||(xe.set(n,r=Md(2048,t)),r)}function Ud(e,t,r){var n,i=t+("string"==typeof e?"@":"#")+e,a=1024|("string"==typeof e?128:256);return De.get(i)||(De.set(i,n=Md(a,e,r)),n)}function Kd(t){if(e.isValidESSymbolDeclaration(t)){var r=e.isCommonJsExportPropertyAssignment(t)?Da(t.left):Da(t);if(r){var n=_i(r);return n.uniqueESSymbolType||(n.uniqueESSymbolType=function(e){var t=Pa(8192);return t.symbol=e,t.escapedName="__@".concat(t.symbol.escapedName,"@").concat(O(t.symbol)),t}(r))}}return ot}function Vd(t){var r=di(t);return r.resolvedType||(r.resolvedType=function(t){var r=e.getThisContainer(t,!1),n=r&&r.parent;if(n&&(e.isClassLike(n)||261===n.kind)&&!e.isStatic(r)&&(!e.isConstructorDeclaration(r)||e.isNodeDescendantOf(t,r.body)))return Ps(Da(n)).thisType;if(n&&e.isObjectLiteralExpression(n)&&e.isBinaryExpression(n.parent)&&6===e.getAssignmentDeclarationKind(n.parent))return Ps(Da(n.parent.left).parent).thisType;var i=8388608&t.flags?e.getHostSignatureFromJSDoc(t):void 0;return i&&e.isFunctionExpression(i)&&e.isBinaryExpression(i.parent)&&3===e.getAssignmentDeclarationKind(i.parent)?Ps(Da(i.parent.left).parent).thisType:bb(r)&&e.isNodeDescendantOf(t,r.body)?Ps(Da(r)).thisType:(Qn(t,e.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),je)}(t)),r.resolvedType}function qd(e){return Hd(Wd(e.type)||e.type)}function Wd(e){switch(e.kind){case 193:return Wd(e.type);case 186:if(1===e.elements.length&&(188===(e=e.elements[0]).kind||199===e.kind&&e.dotDotDotToken))return Wd(e.type);break;case 185:return e.elementType}}function Hd(t){return function(t,r){for(var n,i=!0;r&&!e.isStatement(r)&&323!==r.kind;){var a=r.parent;if(166===a.kind&&(i=!i),(i||8650752&t.flags)&&191===a.kind&&r===a.trueType)(s=Eu(t,a.checkType,a.extendsType))&&(n=e.append(n,s));else if(262144&t.flags&&197===a.kind&&r===a.type){var o=Hd(a);if(Ec(o)===fd(t)){var s,c=pp(o);c&&(s=Kc(c))&&Ym(s,Mf)&&(n=e.append(n,b_([Ze,vt])));}}r=a;}return n?Su(t,N_(n)):t}(Gd(t),t)}function Gd(t){switch(t.kind){case 131:case 315:case 316:return Le;case 157:return Ke;case 152:return Ye;case 148:return Ze;case 160:return $e;case 134:return at;case 153:return ot;case 114:return st;case 155:return qe;case 104:return Qe;case 144:return ct;case 149:return 262144&t.flags&&!Z?Le:dt;case 139:return Ue;case 194:case 108:return Vd(t);case 198:return function(e){if(104===e.literal.kind)return Qe;var t=di(e);return t.resolvedType||(t.resolvedType=Rd(Zx(e.literal))),t.resolvedType}(t);case 180:case 230:return Fu(t);case 179:return t.assertsModifier?st:at;case 183:return wu(t);case 185:case 186:return function(t){var r=di(t);if(!r.resolvedType){var n=function(t){var r=function(t){return e.isTypeOperatorNode(t)&&146===t.operator}(t.parent);return Wd(t)?r?Xt:Qt:o_(e.map(t.elements,e_),r,e.some(t.elements,(function(e){return 199!==e.kind}))?void 0:t.elements)}(t);if(n===Pt)r.resolvedType=Ct;else if(186===t.kind&&e.some(t.elements,(function(e){return !!(8&e_(e))}))||!r_(t)){var i=185===t.kind?[Hd(t.elementType)]:e.map(t.elements,Hd);r.resolvedType=s_(n,i);}else r.resolvedType=186===t.kind&&0===t.elements.length?n:pu(n,t,void 0);}return r.resolvedType}(t);case 187:return function(e){return Bo(Hd(e.type),!0)}(t);case 189:return function(t){var r=di(t);if(!r.resolvedType){var n=kd(t);r.resolvedType=b_(e.map(t.types,Hd),1,n,Nd(n));}return r.resolvedType}(t);case 190:return function(t){var r=di(t);if(!r.resolvedType){var n=kd(t),i=e.map(t.types,Hd),a=2===i.length&&!!(76&i[0].flags)&&i[1]===Nt;r.resolvedType=N_(i,n,Nd(n),a);}return r.resolvedType}(t);case 317:return function(e){var t=Hd(e.type);return G?sg(t,65536):t}(t);case 319:return Bo(Hd(t.type));case 199:return function(e){var t=di(e);return t.resolvedType||(t.resolvedType=e.dotDotDotToken?qd(e):Bo(Hd(e.type),!0,!!e.questionToken))}(t);case 193:case 318:case 312:return Hd(t.type);case 188:return qd(t);case 321:return function(t){var r=Hd(t.type),n=t.parent,i=t.parent.parent;if(e.isJSDocTypeExpression(t.parent)&&e.isJSDocParameterTag(i)){var a=e.getHostSignatureFromJSDoc(i),o=e.isJSDocCallbackTag(i.parent.parent);if(a||o){var s=o?e.lastOrUndefined(i.parent.parent.typeExpression.parameters):e.lastOrUndefined(a.parameters),c=e.getParameterSymbolFromJSDoc(i);if(!s||c&&s.symbol===c&&e.isRestParameter(s))return $u(r)}}return e.isParameter(n)&&e.isJSDocFunctionType(n.parent)?$u(r):Bo(r)}(t);case 181:case 182:case 184:case 325:case 320:case 326:return Ed(t);case 195:return function(t){var r=di(t);if(!r.resolvedType)switch(t.operator){case 141:r.resolvedType=z_(Hd(t.type));break;case 156:r.resolvedType=153===t.type.kind?Kd(e.walkUpParenthesizedTypes(t.parent)):je;break;case 146:r.resolvedType=Hd(t.type);break;default:throw e.Debug.assertNever(t.operator)}return r.resolvedType}(t);case 196:return dd(t);case 197:return pd(t);case 191:return function(t){var r=di(t);if(!r.resolvedType){var n=Hd(t.checkType),i=kd(t),a=Nd(i),o=vs(t,!0),s=a?o:e.filter(o,(function(e){return dp(e,t)})),c={node:t,checkType:n,extendsType:Hd(t.extendsType),isDistributive:!!(262144&n.flags),inferTypeParameters:Dd(t),outerTypeParameters:s,instantiations:void 0,aliasSymbol:i,aliasTypeArguments:a};r.resolvedType=hd(c,void 0),s&&(c.instantiations=new e.Map,c.instantiations.set(cu(s),r.resolvedType));}return r.resolvedType}(t);case 192:return function(e){var t=di(e);return t.resolvedType||(t.resolvedType=js(Da(e.typeParameter))),t.resolvedType}(t);case 200:return function(t){var r=di(t);return r.resolvedType||(r.resolvedType=K_(n$4([t.head.text],e.map(t.templateSpans,(function(e){return e.literal.text})),!0),e.map(t.templateSpans,(function(e){return Hd(e.type)})))),r.resolvedType}(t);case 202:return Td(t);case 79:case 163:case 208:var r=OT(t);return r?Js(r):je;default:return je}}function Qd(e,t,r){if(e&&e.length)for(var n=0;n<e.length;n++){var i=e[n],a=r(i,t);if(i!==a){var o=0===n?[]:e.slice(0,n);for(o.push(a),n++;n<e.length;n++)o.push(r(e[n],t));return o}}return e}function Xd(e,t){return Qd(e,t,hp)}function Yd(e,t){return Qd(e,t,up)}function Zd(e,t){return Qd(e,t,Sp)}function $d(t,r){return 1===t.length?tp(t[0],r?r[0]:Le):function(t,r){return e.Debug.attachDebugPrototypeIfDebug({kind:1,sources:t,targets:r})}(t,r)}function ep(e,t){switch(t.kind){case 0:return e===t.source?t.target:e;case 1:for(var r=t.sources,n=t.targets,i=0;i<r.length;i++)if(e===r[i])return n?n[i]:Le;return e;case 2:for(r=t.sources,n=t.targets,i=0;i<r.length;i++)if(e===r[i])return n[i]();return e;case 3:return t.func(e);case 4:case 5:var a=ep(e,t.mapper1);return a!==e&&4===t.kind?hp(a,t.mapper2):ep(a,t.mapper2)}}function tp(t,r){return e.Debug.attachDebugPrototypeIfDebug({kind:0,source:t,target:r})}function rp(t,r){return e.Debug.attachDebugPrototypeIfDebug({kind:3,func:t,debugInfo:e.Debug.isDebugging?r:void 0})}function np(t,r){return e.Debug.attachDebugPrototypeIfDebug({kind:2,sources:t,targets:r})}function ip(t,r,n){return e.Debug.attachDebugPrototypeIfDebug({kind:t,mapper1:r,mapper2:n})}function ap(e){return $d(e,void 0)}function op(e,t){return e?ip(4,e,t):t}function sp(e,t,r){return r?ip(5,tp(e,t),r):tp(e,t)}function cp(e,t,r){return e?ip(5,e,tp(t,r)):tp(t,r)}function lp(e){var t=Ma(e.symbol);return t.target=e,t}function up(t,r,n){var i;if(t.typeParameters&&!n){i=e.map(t.typeParameters,lp),r=op($d(t.typeParameters,i),r);for(var a=0,o=i;a<o.length;a++)o[a].mapper=r;}var s=cc(t.declaration,i,t.thisParameter&&_p(t.thisParameter,r),Qd(t.parameters,r,_p),void 0,void 0,t.minArgumentCount,39&t.flags);return s.target=t,s.mapper=r,s}function _p(t,r){var n=_i(t);if(n.type&&!jg(n.type))return t;1&e.getCheckFlags(t)&&(t=n.target,r=op(n.mapper,r));var i=ri(t.flags,t.escapedName,1|53256&e.getCheckFlags(t));return i.declarations=t.declarations,i.parent=t.parent,i.target=t,i.mapper=r,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),n.nameType&&(i.nameType=n.nameType),i}function dp(t,r){if(t.symbol&&t.symbol.declarations&&1===t.symbol.declarations.length){for(var n=t.symbol.declarations[0].parent,i=r;i!==n;i=i.parent)if(!i||238===i.kind||191===i.kind&&e.forEachChild(i.extendsType,a))return !0;return a(r)}return !0;function a(r){switch(r.kind){case 194:return !!t.isThisType;case 79:return !t.isThisType&&e.isPartOfTypeNode(r)&&function(e){return !(180===e.parent.kind&&e.parent.typeArguments&&e===e.parent.typeName||202===e.parent.kind&&e.parent.typeArguments&&e===e.parent.qualifier)}(r)&&Gd(r)===t;case 183:var n,i=r.exprName,o=dm(e.getFirstIdentifier(i)),s=t.symbol.declarations[0];if(165===s.kind)n=s.parent;else {if(!t.isThisType)return !0;n=s;}return !o.declarations||e.some(o.declarations,(function(t){return e.isNodeDescendantOf(t,n)}))||e.some(r.typeArguments,a);case 171:case 170:return !r.type&&!!r.body||e.some(r.typeParameters,a)||e.some(r.parameters,a)||!!r.type&&a(r.type)}return !!e.forEachChild(r,a)}}function pp(e){var t=kc(e);if(4194304&t.flags){var r=fd(t.type);if(262144&r.flags)return r}}function fp(t,r,n,i){var a=pp(t);if(a){var o=hp(a,r);if(a!==o)return ry(sl(o),(function(n){if(61603843&n.flags&&n!==Be&&!Eo(n)){if(!t.declaration.nameType){var i=void 0;if(If(n)||1&n.flags&&bo(a,4)<0&&(i=Kc(a))&&Ym(i,Mf))return function(e,t,r){var n=mp(t,Ze,!0,r);return Eo(n)?je:$u(n,gp(Of(e),Ic(t)))}(n,t,sp(a,n,r));if(eg(n))return function(t,r,n,i){var a=t.target.elementFlags,o=e.map(fu(t),(function(e,t){var o=8&a[t]?e:4&a[t]?$u(e):a_([e],[a[t]]);return fp(r,sp(n,o,i))})),s=gp(t.target.readonly,Ic(r));return a_(o,e.map(o,(function(e){return 8})),s)}(n,t,a,r);if($f(n))return function(t,r,n){var i=t.target.elementFlags,a=e.map(fu(t),(function(e,t){return mp(r,jd(""+t),!!(2&i[t]),n)})),o=Ic(r),s=4&o?e.map(i,(function(e){return 1&e?2:e})):8&o?e.map(i,(function(e){return 2&e?1:e})):i,c=gp(t.target.readonly,o);return e.contains(a,je)?je:a_(a,s,c,t.target.labeledElementDeclarations)}(n,t,sp(a,n,r))}return yp(t,sp(a,n,r))}return n}),n,i)}return hp(kc(t),r)===Be?Be:yp(t,r,n,i)}function gp(e,t){return !!(1&t)||!(2&t)&&e}function mp(e,t,r,n){var i=cp(n,Ec(e),t),a=hp(Ac(e.target||e),i),o=Ic(e);return G&&4&o&&!vx(a,49152)?cg(a,!0):G&&8&o&&r?Fm(a,524288):a}function yp(e,t,r,n){var i=Oa(64|e.objectFlags,e.symbol);if(32&e.objectFlags){i.declaration=e.declaration;var a=Ec(e),o=lp(a);i.typeParameter=o,t=op(tp(a,o),t),o.mapper=t;}return 8388608&e.objectFlags&&(i.node=e.node),i.target=e,i.mapper=t,i.aliasSymbol=r||e.aliasSymbol,i.aliasTypeArguments=r?n:Xd(e.aliasTypeArguments,t),i.objectFlags|=i.aliasTypeArguments?uu(i.aliasTypeArguments):0,i}function vp(t,r,n,i){var a=t.root;if(a.outerTypeParameters){var o=e.map(a.outerTypeParameters,(function(e){return ep(e,r)})),s=cu(o)+lu(n,i),c=a.instantiations.get(s);if(!c){var l=$d(a.outerTypeParameters,o),u=a.checkType,_=a.isDistributive?ep(u,l):void 0;c=_&&u!==_&&1179648&_.flags?ry(sl(_),(function(e){return hd(a,sp(u,e,l))}),n,i):hd(a,l,n,i),a.instantiations.set(s,c);}return c}return t}function hp(e,t){return e&&t?bp(e,t,void 0,void 0):e}function bp(t,r,n,i){if(!jg(t))return t;if(100===E||C>=5e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","instantiateType_DepthLimit",{typeId:t.id,instantiationDepth:E,instantiationCount:C}),Qn(u,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),je;T++,C++,E++;var a=function(t,r,n,i){var a=t.flags;if(262144&a)return ep(t,r);if(524288&a){var o=t.objectFlags;if(52&o){if(4&o&&!t.node){var s=t.resolvedTypeArguments,c=Xd(s,r);return c!==s?s_(t.target,c):t}return 1024&o?function(t,r){var n=hp(t.mappedType,r);if(!(32&e.getObjectFlags(n)))return t;var i=hp(t.constraintType,r);if(!(4194304&i.flags))return t;var a=Ug(hp(t.source,r),n,i);return a||t}(t,r):function(t,r,n,i){var a=4&t.objectFlags||8388608&t.objectFlags?t.node:t.symbol.declarations[0],o=di(a),s=4&t.objectFlags?o.resolvedType:64&t.objectFlags?t.target:t,c=o.outerTypeParameters;if(!c){var l=vs(a,!0);if(bb(a)){var u=Cl(a);l=e.addRange(l,u);}c=l||e.emptyArray;var _=8388612&t.objectFlags?[a]:t.symbol.declarations;c=(8388612&s.objectFlags||8192&s.symbol.flags||2048&s.symbol.flags)&&!s.aliasTypeArguments?e.filter(c,(function(t){return e.some(_,(function(e){return dp(t,e)}))})):c,o.outerTypeParameters=c;}if(c.length){var d=op(t.mapper,r),p=e.map(c,(function(e){return ep(e,d)})),f=n||t.aliasSymbol,g=n?i:Xd(t.aliasTypeArguments,r),m=cu(p)+lu(f,g);s.instantiations||(s.instantiations=new e.Map,s.instantiations.set(cu(c)+lu(s.aliasSymbol,s.aliasTypeArguments),s));var y=s.instantiations.get(m);if(!y){var v=$d(c,p);y=4&s.objectFlags?pu(t.target,t.node,v,f,g):32&s.objectFlags?fp(s,v,f,g):yp(s,v,f,g),s.instantiations.set(m,y);}return y}return t}(t,r,n,i)}return t}if(3145728&a){var l=1048576&t.flags?t.origin:void 0,u=l&&3145728&l.flags?l.types:t.types,_=Xd(u,r);if(_===u&&n===t.aliasSymbol)return t;var d=n||t.aliasSymbol,p=n?i:Xd(t.aliasTypeArguments,r);return 2097152&a||l&&2097152&l.flags?N_(_,d,p):b_(_,1,d,p)}if(4194304&a)return z_(hp(t.type,r));if(134217728&a)return K_(t.texts,Xd(t.types,r));if(268435456&a)return q_(t.symbol,hp(t.type,r));if(8388608&a)return d=n||t.aliasSymbol,p=n?i:Xd(t.aliasTypeArguments,r),ld(hp(t.objectType,r),hp(t.indexType,r),t.accessFlags,void 0,d,p);if(16777216&a)return vp(t,op(t.mapper,r),n,i);if(33554432&a){var f=hp(t.baseType,r),g=hp(t.constraint,r);return 8650752&f.flags&&td(g)?Su(f,g):3&g.flags||Ip(Dp(f),Dp(g))?f:8650752&f.flags?Su(f,g):N_([g,f])}return t}(t,r,n,i);return E--,a}function xp(e){return 262143&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=hp(e,bt))}function Dp(e){return 262143&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=hp(e,ht),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function Sp(e,t){return eu(e.keyType,hp(e.type,t),e.isReadonly,e.declaration)}function Tp(t){switch(e.Debug.assert(171!==t.kind||e.isObjectLiteralMethod(t)),t.kind){case 215:case 216:case 171:case 259:return Cp(t);case 207:return e.some(t.properties,Tp);case 206:return e.some(t.elements,Tp);case 224:return Tp(t.whenTrue)||Tp(t.whenFalse);case 223:return (56===t.operatorToken.kind||60===t.operatorToken.kind)&&(Tp(t.left)||Tp(t.right));case 299:return Tp(t.initializer);case 214:return Tp(t.expression);case 289:return e.some(t.properties,Tp)||e.isJsxOpeningElement(t.parent)&&e.some(t.parent.parent.children,Tp);case 288:var r=t.initializer;return !!r&&Tp(r);case 291:var n=t.expression;return !!n&&Tp(n)}return !1}function Cp(t){return e.hasContextSensitiveParameters(t)||function(t){return !t.typeParameters&&!e.getEffectiveReturnTypeNode(t)&&!!t.body&&238!==t.body.kind&&Tp(t.body)}(t)}function Ep(t){return (e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t))&&Cp(t)}function kp(t){if(524288&t.flags){var r=Rc(t);if(r.constructSignatures.length||r.callSignatures.length){var n=Oa(16,t.symbol);return n.members=r.members,n.properties=r.properties,n.callSignatures=e.emptyArray,n.constructSignatures=e.emptyArray,n.indexInfos=e.emptyArray,n}}else if(2097152&t.flags)return N_(e.map(t.types,kp));return t}function Np(e,t){return rf(e,t,Bn)}function Ap(e,t){return rf(e,t,Bn)?-1:0}function Fp(e,t){return rf(e,t,Ln)?-1:0}function Pp(e,t){return rf(e,t,On)?-1:0}function wp(e,t){return rf(e,t,On)}function Ip(e,t){return rf(e,t,Ln)}function Op(t,r){return 1048576&t.flags?e.every(t.types,(function(e){return Op(e,r)})):1048576&r.flags?e.some(r.types,(function(e){return Op(t,e)})):58982400&t.flags?Op(Gc(t)||Ke,r):r===qt?!!(67633152&t.flags):r===Wt?!!(524288&t.flags)&&Nm(t):ms(t,gs(r))||If(r)&&!Of(r)&&Op(t,Xt)}function Mp(e,t){return rf(e,t,Rn)}function Lp(e,t){return Mp(e,t)||Mp(t,e)}function Rp(e,t,r,n,i,a){return sf(e,t,Ln,r,n,i,a)}function Bp(e,t,r,n,i,a){return jp(e,t,Ln,r,n,i,a,void 0)}function jp(e,t,r,n,i,a,o,s){return !!rf(e,t,r)||(!n||!zp(i,e,t,r,a,o,s))&&sf(e,t,r,n,a,o,s)}function Jp(t){return !!(16777216&t.flags||2097152&t.flags&&e.some(t.types,Jp))}function zp(t,r,n,a,s,c,l){if(!t||Jp(n))return !1;if(!sf(r,n,a,void 0)&&function(t,r,n,i,a,o,s){for(var c=fl(r,0),l=fl(r,1),u=0,_=[l,c];u<_.length;u++){var d=_[u];if(e.some(d,(function(e){var t=Ul(e);return !(131073&t.flags)&&sf(t,n,i,void 0)}))){var p=s||{};Rp(r,n,t,a,o,p);var f=p.errors[p.errors.length-1];return e.addRelatedInfo(f,e.createDiagnosticForNode(t,d===l?e.Diagnostics.Did_you_mean_to_use_new_with_this_expression:e.Diagnostics.Did_you_mean_to_call_this_expression)),!0}}return !1}(t,r,n,a,s,c,l))return !0;switch(t.kind){case 291:case 214:return zp(t.expression,r,n,a,s,c,l);case 223:switch(t.operatorToken.kind){case 63:case 27:return zp(t.right,r,n,a,s,c,l)}break;case 207:return function(t,r,n,i,a,s){return !(262140&n.flags)&&Vp(function(t){var r,n,i,a;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,o.label=1;case 1:if(!(r<n.length))return [3,8];if(i=n[r],e.isSpreadAssignment(i))return [3,7];if(!(a=L_(Da(i),8576))||131072&a.flags)return [3,7];switch(i.kind){case 175:case 174:case 171:case 300:return [3,2];case 299:return [3,4]}return [3,6];case 2:return [4,{errorNode:i.name,innerExpression:void 0,nameType:a}];case 3:return o.sent(),[3,7];case 4:return [4,{errorNode:i.name,innerExpression:i.initializer,nameType:a,errorMessage:e.isComputedNonLiteralName(i.name)?e.Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:void 0}];case 5:return o.sent(),[3,7];case 6:e.Debug.assertNever(i),o.label=7;case 7:return r++,[3,1];case 8:return [2]}}))}(t),r,n,i,a,s)}(t,r,n,a,c,l);case 206:return function(e,t,r,n,i,a){if(262140&r.flags)return !1;if(Uf(t))return Vp(Wp(e,r),t,r,n,i,a);var o=e.contextualType;e.contextualType=r;try{var s=mv(e,1,!0);return e.contextualType=o,!!Uf(s)&&Vp(Wp(e,r),s,r,n,i,a)}finally{e.contextualType=o;}}(t,r,n,a,c,l);case 289:return function(t,r,n,a,s,c){var l,u=Vp(function(t){var r,n,i;return o(this,(function(a){switch(a.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,a.label=1;case 1:return r<n.length?(i=n[r],e.isJsxSpreadAttribute(i)||Tv(e.idText(i.name))?[3,3]:[4,{errorNode:i.name,innerExpression:i.initializer,nameType:jd(e.idText(i.name))}]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return [2]}}))}(t),r,n,a,s,c);if(e.isJsxOpeningElement(t.parent)&&e.isJsxElement(t.parent.parent)){var _=t.parent.parent,d=Ov(wv(t)),p=void 0===d?"children":e.unescapeLeadingUnderscores(d),f=jd(p),g=ld(n,f),m=e.getSemanticJsxChildren(_.children);if(!e.length(m))return u;var y=e.length(m)>1,v=Zm(g,Kf),h=Zm(g,(function(e){return !Kf(e)}));if(y){if(v!==ct){var b=a_(kv(_,0)),x=function(t,r){var n,i,a,s,c;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.children))return [2];n=0,i=0,o.label=1;case 1:return i<t.children.length?(a=t.children[i],s=Jd(i-n),(c=qp(a,s,r))?[4,c]:[3,3]):[3,5];case 2:return o.sent(),[3,4];case 3:n++,o.label=4;case 4:return i++,[3,1];case 5:return [2]}}))}(_,T);u=Vp(x,b,v,a,s,c)||u;}else if(!rf(ld(r,f),g,a)){u=!0;var D=Qn(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,p,io(g));c&&c.skipLogging&&(c.errors||(c.errors=[])).push(D);}}else if(h!==ct){var S=qp(m[0],f,T);S&&(u=Vp(function(){return o(this,(function(e){switch(e.label){case 0:return [4,S];case 1:return e.sent(),[2]}}))}(),r,n,a,s,c)||u);}else rf(ld(r,f),g,a)||(u=!0,D=Qn(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,p,io(g)),c&&c.skipLogging&&(c.errors||(c.errors=[])).push(D));}return u;function T(){if(!l){var r=e.getTextOfNode(t.parent.tagName),a=Ov(wv(t)),o=void 0===a?"children":e.unescapeLeadingUnderscores(a),s=ld(n,jd(o)),c=e.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;l=i$1(i$1({},c),{key:"!!ALREADY FORMATTED!!",message:e.formatMessage(void 0,c,r,o,io(s))});}return l}}(t,r,n,a,c,l);case 216:return function(t,r,n,i,a,o){if(e.isBlock(t.body))return !1;if(e.some(t.parameters,e.hasType))return !1;var s=Jh(r);if(!s)return !1;var c=fl(n,0);if(!e.length(c))return !1;var l=t.body,u=Ul(s),_=b_(e.map(c,Ul));if(!sf(u,_,i,void 0)){var d=l&&zp(l,u,_,i,void 0,a,o);if(d)return d;var p=o||{};if(sf(u,_,i,l,void 0,a,p),p.errors)return n.symbol&&e.length(n.symbol.declarations)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(n.symbol.declarations[0],e.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature)),0==(2&e.getFunctionFlags(t))&&!To(u,"then")&&sf($b(u),_,i,void 0)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async)),!0}return !1}(t,r,n,a,c,l)}return !1}function Up(e,t,r){var n=_d(t,r);if(n)return n;if(1048576&t.flags){var i=_f(e,t);if(i)return _d(i,r)}}function Kp(e,t){e.contextualType=t;try{return jx(e,1,t)}finally{e.contextualType=void 0;}}function Vp(t,r,n,i,a,o){for(var s=!1,c=t.next();!c.done;c=t.next()){var l=c.value,u=l.errorNode,_=l.innerExpression,d=l.nameType,p=l.errorMessage,f=Up(r,n,d);if(f&&!(8388608&f.flags)){var g=_d(r,d);if(g){var m=Q_(d,void 0);if(!sf(g,f,i,void 0)&&(s=!0,!_||!zp(_,g,f,i,void 0,a,o))){var y=o||{},v=_?Kp(_,g):g;if(ne&&uf(v,f)){var h=e.createDiagnosticForNode(u,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,io(v),io(f));Pn.add(h),y.errors=[h];}else {var b=!!(m&&16777216&(dl(n,m)||we).flags),x=!!(m&&16777216&(dl(r,m)||we).flags);f=fg(f,b),g=fg(g,b&&x),sf(v,f,i,u,p,a,y)&&v!==g&&sf(g,f,i,u,p,a,y);}if(y.errors){var D=y.errors[y.errors.length-1],S=Xs(d)?tc(d):void 0,T=void 0!==S?dl(n,S):void 0,C=!1;if(!T){var E=Sl(n,d);E&&E.declaration&&!e.getSourceFileOfNode(E.declaration).hasNoDefaultLib&&(C=!0,e.addRelatedInfo(D,e.createDiagnosticForNode(E.declaration,e.Diagnostics.The_expected_type_comes_from_this_index_signature)));}if(!C&&(T&&e.length(T.declarations)||n.symbol&&e.length(n.symbol.declarations))){var k=T&&e.length(T.declarations)?T.declarations[0]:n.symbol.declarations[0];e.getSourceFileOfNode(k).hasNoDefaultLib||e.addRelatedInfo(D,e.createDiagnosticForNode(k,e.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,!S||8192&d.flags?io(d):e.unescapeLeadingUnderscores(S),io(n)));}}}}}}return s}function qp(t,r,n){switch(t.kind){case 291:return {errorNode:t,innerExpression:t.expression,nameType:r};case 11:if(t.containsOnlyTriviaWhiteSpaces)break;return {errorNode:t,innerExpression:void 0,nameType:r,errorMessage:n()};case 281:case 282:case 285:return {errorNode:t,innerExpression:t,nameType:r};default:return e.Debug.assertNever(t,"Found invalid jsx child")}}function Wp(t,r){var n,i,a,s;return o(this,(function(o){switch(o.label){case 0:if(!(n=e.length(t.elements)))return [2];i=0,o.label=1;case 1:return i<n?Uf(r)&&!dl(r,""+i)?[3,3]:(a=t.elements[i],e.isOmittedExpression(a)?[3,3]:(s=Jd(i),[4,{errorNode:a,innerExpression:a,nameType:s}])):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return [2]}}))}function Hp(e,t,r,n,i){return sf(e,t,Rn,r,n,i)}function Gp(t,r,n,i,a,o,s,c){if(t===r)return -1;if(!(l=r).typeParameters&&(!l.thisParameter||Co(Mb(l.thisParameter)))&&1===l.parameters.length&&j(l)&&(Mb(l.parameters[0])===rr||Co(Mb(l.parameters[0])))&&Co(Ul(l)))return -1;var l,u,_=Vb(r);if(!Wb(r)&&(8&n?Wb(t)||Vb(t)>_:qb(t)>_))return 0;t.typeParameters&&t.typeParameters!==r.typeParameters&&(t=Kh(t,r=(u=r).typeParameters?u.canonicalSignatureCache||(u.canonicalSignatureCache=function(t){return Wl(t,e.map(t.typeParameters,(function(e){return e.target&&!Kc(e.target)?e.target:e})),e.isInJSFile(t.declaration))}(u)):u,void 0,s));var d=Vb(t),p=Gb(t),f=Gb(r);(p||f)&&hp(p||f,c);var g=r.declaration?r.declaration.kind:0,m=!(3&n)&&Q&&171!==g&&170!==g&&173!==g,y=-1,v=jl(t);if(v&&v!==st){var h=jl(r);if(h){if(!(C=!m&&s(v,h,!1)||s(h,v,i)))return i&&a(e.Diagnostics.The_this_types_of_each_signature_are_incompatible),0;y&=C;}}for(var b=p||f?Math.min(d,_):Math.max(d,_),x=p||f?b-1:-1,D=0;D<b;D++){var S=D===x?Kb(t,D):Ub(t,D),T=D===x?Kb(r,D):Ub(r,D);if(S&&T){var C,E=3&n?void 0:Jh(lg(S)),k=3&n?void 0:Jh(lg(T));if((C=E&&k&&!Jl(E)&&!Jl(k)&&(50331648&Am(S))==(50331648&Am(T))?Gp(k,E,8&n|(m?2:1),i,a,o,s,c):!(3&n)&&!m&&s(S,T,!1)||s(T,S,i))&&8&n&&D>=qb(t)&&D<qb(r)&&s(S,T,!1)&&(C=0),!C)return i&&a(e.Diagnostics.Types_of_parameters_0_and_1_are_incompatible,e.unescapeLeadingUnderscores(Rb(t,D)),e.unescapeLeadingUnderscores(Rb(r,D))),0;y&=C;}}if(!(4&n)){var N=Vl(r)?Le:r.declaration&&bb(r.declaration)?Ps(xa(r.declaration.symbol)):Ul(r);if(N===st||N===Le)return y;var A=Vl(t)?Le:t.declaration&&bb(t.declaration)?Ps(xa(t.declaration.symbol)):Ul(t),F=Jl(r);if(F){var P=Jl(t);if(P)y&=function(t,r,n,i,a){if(t.kind!==r.kind)return n&&(i(e.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,uo(t),uo(r))),0;if((1===t.kind||3===t.kind)&&t.parameterIndex!==r.parameterIndex)return n&&(i(e.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1,t.parameterName,r.parameterName),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,uo(t),uo(r))),0;var o=t.type===r.type?-1:t.type&&r.type?a(t.type,r.type,n):0;return 0===o&&n&&i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,uo(t),uo(r)),o}(P,F,i,a,s);else if(e.isIdentifierTypePredicate(F))return i&&a(e.Diagnostics.Signature_0_must_be_a_type_predicate,no(t)),0}else !(y&=1&n&&s(N,A,!1)||s(A,N,i))&&i&&o&&o(A,N);}return y}function Qp(e){return e!==wt&&0===e.properties.length&&0===e.callSignatures.length&&0===e.constructSignatures.length&&0===e.indexInfos.length}function Xp(t){return 524288&t.flags?!Lc(t)&&Qp(Rc(t)):!!(67108864&t.flags)||(1048576&t.flags?e.some(t.types,Xp):!!(2097152&t.flags)&&e.every(t.types,Xp))}function Yp(t){return !!(16&e.getObjectFlags(t)&&(t.members&&Qp(t)||t.symbol&&2048&t.symbol.flags&&0===ic(t.symbol).size))}function Zp(e){return !!(32768&(1048576&e.flags?e.types[0]:e).flags)}function $p(t){return 524288&t.flags&&!Lc(t)&&0===zc(t).length&&1===hl(t).length&&!!bl(t,Ye)||3145728&t.flags&&e.every(t.types,$p)||!1}function ef(t,r,n){if(t===r)return !0;var i=O(t)+","+O(r),a=jn.get(i);if(void 0!==a&&(4&a||!(2&a)||!n))return !!(1&a);if(!(t.escapedName===r.escapedName&&256&t.flags&&256&r.flags))return jn.set(i,6),!1;for(var o=ds(r),s=0,c=zc(ds(t));s<c.length;s++){var l=c[s];if(8&l.flags){var u=dl(o,l.escapedName);if(!(u&&8&u.flags))return n?(n(e.Diagnostics.Property_0_is_missing_in_type_1,e.symbolName(l),io(Js(r),void 0,64)),jn.set(i,6)):jn.set(i,2),!1}}return jn.set(i,1),!0}function tf(t,r,n,i){var a=t.flags,o=r.flags;if(3&o||131072&a||t===Be)return !0;if(131072&o)return !1;if(402653316&a&&4&o)return !0;if(128&a&&1024&a&&128&o&&!(1024&o)&&t.value===r.value)return !0;if(296&a&&8&o)return !0;if(256&a&&1024&a&&256&o&&!(1024&o)&&t.value===r.value)return !0;if(2112&a&&64&o)return !0;if(528&a&&16&o)return !0;if(12288&a&&4096&o)return !0;if(32&a&&32&o&&ef(t.symbol,r.symbol,i))return !0;if(1024&a&&1024&o){if(1048576&a&&1048576&o&&ef(t.symbol,r.symbol,i))return !0;if(2944&a&&2944&o&&t.value===r.value&&ef(Sa(t.symbol),Sa(r.symbol),i))return !0}if(32768&a&&(!G&&!(3145728&o)||49152&o))return !0;if(65536&a&&(!G&&!(3145728&o)||65536&o))return !0;if(524288&a&&67108864&o&&(n!==Mn||!Yp(t)||8192&e.getObjectFlags(t)))return !0;if(n===Ln||n===Rn){if(1&a)return !0;if(264&a&&!(1024&a)&&(32&o||n===Ln&&256&o&&1024&o))return !0;if(function(t){if(G&&1048576&t.flags){if(!(33554432&t.objectFlags)){var r=t.types;t.objectFlags|=33554432|(r.length>=3&&32768&r[0].flags&&65536&r[1].flags&&e.some(r,Yp)?67108864:0);}return !!(67108864&t.objectFlags)}return !1}(r))return !0}return !1}function rf(e,t,r){if(Bd(e)&&(e=e.regularType),Bd(t)&&(t=t.regularType),e===t)return !0;if(r!==Bn){if(r===Rn&&!(131072&t.flags)&&tf(t,e,r)||tf(e,t,r))return !0}else if(!(61865984&(e.flags|t.flags))){if(e.flags!==t.flags)return !1;if(67358815&e.flags)return !0}if(524288&e.flags&&524288&t.flags){var n=r.get(Df(e,t,0,r,!1));if(void 0!==n)return !!(1&n)}return !!(469499904&e.flags||469499904&t.flags)&&sf(e,t,r,void 0)}function nf(t,r){return 2048&e.getObjectFlags(t)&&Tv(r.escapedName)}function af(t,r){for(;;){var n=Bd(t)?t.regularType:4&e.getObjectFlags(t)?t.node?_u(t.target,fu(t)):jf(t)||t:3145728&t.flags?of(t,r):33554432&t.flags?r?t.baseType:Tu(t):25165824&t.flags?ad(t,r):t;if(n===t)return n;t=n;}}function of(t,r){var n=sl(t);if(n!==t)return n;if(2097152&t.flags&&e.some(t.types,Yp)){var i=e.sameMap(t.types,(function(e){return af(e,r)}));if(i!==t.types)return N_(i)}return t}function sf(t,r,i,a,o,s,c){var _,d,p,f,g,m,y,v=0,h=0,b=0,x=0,D=!1,S=0,T=!1;e.Debug.assert(i!==Bn||!a,"no error reporting in identity checking");var C=z(t,r,3,!!a,o);if(y&&M(),D){null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkTypeRelatedTo_DepthLimit",{sourceId:t.id,targetId:r.id,depth:h,targetDepth:b});var E=Qn(a||u,e.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1,io(t),io(r));c&&(c.errors||(c.errors=[])).push(E);}else if(_){if(s){var k=s();k&&(e.concatenateDiagnosticMessageChains(k,_),_=k);}var N=void 0;if(o&&a&&!C&&t.symbol){var F=_i(t.symbol);if(F.originatingImport&&!e.isImportCall(F.originatingImport)&&sf(ds(F.target),r,i,void 0)){var P=e.createDiagnosticForNode(F.originatingImport,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);N=e.append(N,P);}}E=e.createDiagnosticForNodeFromMessageChain(a,_,N),d&&e.addRelatedInfo.apply(void 0,n$4([E],d,!1)),c&&(c.errors||(c.errors=[])).push(E),c&&c.skipLogging||Pn.add(E);}return a&&c&&c.skipLogging&&0===C&&e.Debug.assert(!!c.errors,"missed opportunity to interact with error."),0!==C;function w(e){_=e.errorInfo,m=e.lastSkippedInfo,y=e.incompatibleStack,S=e.overrideNextErrorInfo,d=e.relatedInfo;}function I(){return {errorInfo:_,lastSkippedInfo:m,incompatibleStack:null==y?void 0:y.slice(),overrideNextErrorInfo:S,relatedInfo:null==d?void 0:d.slice()}}function O(e,t,r,n,i){S++,m=void 0,(y||(y=[])).push([e,t,r,n,i]);}function M(){var t=y||[];y=void 0;var r=m;if(m=void 0,1===t.length)return L.apply(void 0,t[0]),void(r&&B.apply(void 0,n$4([void 0],r,!1)));for(var i="",a=[];t.length;){var o=t.pop(),s=o[0],c=o.slice(1);switch(s.code){case e.Diagnostics.Types_of_property_0_are_incompatible.code:0===i.indexOf("new ")&&(i="(".concat(i,")"));var l=""+c[0];i=0===i.length?"".concat(l):e.isIdentifierText(l,e.getEmitScriptTarget(K))?"".concat(i,".").concat(l):"["===l[0]&&"]"===l[l.length-1]?"".concat(i).concat(l):"".concat(i,"[").concat(l,"]");break;case e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:if(0===i.length){var u=s;s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?u=e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible:s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code&&(u=e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible),a.unshift([u,c[0],c[1]]);}else {var _=s.code===e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":"",d=s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"...";i="".concat(_).concat(i,"(").concat(d,")");}break;case e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:a.unshift([e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,c[0],c[1]]);break;case e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:a.unshift([e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,c[0],c[1],c[2]]);break;default:return e.Debug.fail("Unhandled Diagnostic: ".concat(s.code))}}i?L(")"===i[i.length-1]?e.Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types:e.Diagnostics.The_types_of_0_are_incompatible_between_these_types,i):a.shift();for(var p=0,f=a;p<f.length;p++){var g=f[p],v=(s=g[0],c=g.slice(1),s.elidedInCompatabilityPyramid);s.elidedInCompatabilityPyramid=!1,L.apply(void 0,n$4([s],c,!1)),s.elidedInCompatabilityPyramid=v;}r&&B.apply(void 0,n$4([void 0],r,!1));}function L(t,r,n,i,o){e.Debug.assert(!!a),y&&M(),t.elidedInCompatabilityPyramid||(_=e.chainDiagnosticMessages(_,t,r,n,i,o));}function R(t){e.Debug.assert(!!_),d?d.push(t):d=[t];}function B(t,r,n){y&&M();var a=ao(r,n),o=a[0],s=a[1],c=r,l=o;if(Hf(r)&&!cf(n)&&(c=Gf(r),e.Debug.assert(!Ip(c,n),"generalized source shouldn't be assignable"),l=oo(c)),262144&n.flags&&n!==jt&&n!==Jt){var u=Gc(n),d=void 0;u&&(Ip(c,u)||(d=Ip(r,u)))?L(e.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,d?o:l,s,io(u)):(_=void 0,L(e.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,s,l));}if(t)t===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&ne&&lf(r,n).length&&(t=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);else if(i===Rn)t=e.Diagnostics.Type_0_is_not_comparable_to_type_1;else if(o===s)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;else if(ne&&lf(r,n).length)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;else {if(128&r.flags&&1048576&n.flags){var p=function(t,r){var n=r.types.filter((function(e){return !!(128&e.flags)}));return e.getSpellingSuggestion(t.value,n,(function(e){return e.value}))}(r,n);if(p)return void L(e.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,l,s,io(p))}t=e.Diagnostics.Type_0_is_not_assignable_to_type_1;}L(t,l,s);}function j(t,r,n){return $f(t)?t.target.readonly&&Lf(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,io(t),io(r)),!1):Mf(r):Of(t)&&Lf(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,io(t),io(r)),!1):!$f(r)||If(t)}function J(e,t,r){return z(e,t,3,r)}function z(t,r,n,o,s,c){if(void 0===n&&(n=3),void 0===o&&(o=!1),void 0===c&&(c=0),524288&t.flags&&131068&r.flags)return tf(t,r,i,o?L:void 0)?-1:(o&&U(t,r,t,r,s),0);var l=af(t,!1),u=af(r,!0);if(l===u)return -1;if(i===Bn)return l.flags!==u.flags?0:67358815&l.flags?-1:(V(l,u),X(l,u,!1,0,n));if(262144&l.flags&&Uc(l)===u)return -1;if(470302716&l.flags&&1048576&u.flags){var _=u.types,d=2===_.length&&98304&_[0].flags?_[1]:3===_.length&&98304&_[0].flags&&98304&_[1].flags?_[2]:void 0;if(d&&!(98304&d.flags)&&l===(u=af(d,!0)))return -1}if(i===Rn&&!(131072&u.flags)&&tf(u,l,i)||tf(l,u,i,o?L:void 0))return -1;if(469499904&l.flags||469499904&u.flags){if(!(2&c)&&om(l)&&8192&e.getObjectFlags(l)&&function(t,r,n){var o;if(!Kv(r)||!Z&&4096&e.getObjectFlags(r))return !1;var s=!!(2048&e.getObjectFlags(t));if((i===Ln||i===Rn)&&(Gm(qt,r)||!s&&Xp(r)))return !1;var c,l=r;1048576&r.flags&&(l=tE(t,r,z)||function(e){if(vx(e,67108864)){var t=Zm(e,(function(e){return !(131068&e.flags)}));if(!(131072&t.flags))return t}return e}(r),c=1048576&l.flags?l.types:[l]);for(var u=function(r){if(function(e,t){return e.valueDeclaration&&t.valueDeclaration&&e.valueDeclaration.parent===t.valueDeclaration}(r,t.symbol)&&!nf(t,r)){if(!Uv(l,r.escapedName,s)){if(n){var i=Zm(l,Kv);if(!a)return {value:e.Debug.fail()};if(e.isJsxAttributes(a)||e.isJsxOpeningLikeElement(a)||e.isJsxOpeningLikeElement(a.parent)){r.valueDeclaration&&e.isJsxAttribute(r.valueDeclaration)&&e.getSourceFileOfNode(a)===e.getSourceFileOfNode(r.valueDeclaration.name)&&(a=r.valueDeclaration.name);var u=ro(r),_=hh(u,i);(p=_?ro(_):void 0)?L(e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,u,io(i),p):L(e.Diagnostics.Property_0_does_not_exist_on_type_1,u,io(i));}else {var d=(null===(o=t.symbol)||void 0===o?void 0:o.declarations)&&e.firstOrUndefined(t.symbol.declarations),p=void 0;if(r.valueDeclaration&&e.findAncestor(r.valueDeclaration,(function(e){return e===d}))&&e.getSourceFileOfNode(d)===e.getSourceFileOfNode(a)){var f=r.valueDeclaration;e.Debug.assertNode(f,e.isObjectLiteralElementLike),a=f;var g=f.name;e.isIdentifier(g)&&(p=bh(g,i));}void 0!==p?L(e.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,ro(r),io(i),p):L(e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,ro(r),io(i));}}return {value:!0}}if(c&&!z(ds(r),function(t,r){return b_(e.reduceLeft(t,(function(t,n){var i,a=3145728&(n=rl(n)).flags?ol(n,r):jc(n,r),o=a&&ds(a)||(null===(i=Tl(n,r))||void 0===i?void 0:i.type)||qe;return e.append(t,o)}),void 0)||e.emptyArray)}(c,r.escapedName),3,n))return n&&O(e.Diagnostics.Types_of_property_0_are_incompatible,ro(r)),{value:!0}}},_=0,d=zc(t);_<d.length;_++){var p=u(d[_]);if("object"==typeof p)return p.value}return !1}(l,u,o))return o&&B(s,l,r.aliasSymbol?r:u),0;var p=(i!==Rn||qf(l))&&!(2&c)&&2752508&l.flags&&l!==qt&&2621440&u.flags&&pf(u)&&(zc(l).length>0||zT(l)),f=!!(2048&e.getObjectFlags(l));if(p&&!function(e,t,r){for(var n=0,i=zc(e);n<i.length;n++)if(Uv(t,i[n].escapedName,r))return !0;return !1}(l,u,f)){if(o){var g=io(t.aliasSymbol?t:l),m=io(r.aliasSymbol?r:u),y=fl(l,0),v=fl(l,1);y.length>0&&z(Ul(y[0]),u,1,!1)||v.length>0&&z(Ul(v[0]),u,1,!1)?L(e.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,g,m):L(e.Diagnostics.Type_0_has_no_properties_in_common_with_type_1,g,m);}return 0}V(l,u);var h=1048576&l.flags&&l.types.length<4&&!(1048576&u.flags)||1048576&u.flags&&u.types.length<4&&!(469499904&l.flags)?q(l,u,o,c):X(l,u,o,c,n);if(h)return h}return o&&U(t,r,l,u,s),0}function U(t,r,n,i,o){var s,c,l=!!jf(t),u=!!jf(r);n=t.aliasSymbol||l?t:n,i=r.aliasSymbol||u?r:i;var d=S>0;if(d&&S--,524288&n.flags&&524288&i.flags){var p=_;j(n,i,!0),_!==p&&(d=!!_);}if(524288&n.flags&&131068&i.flags)!function(t,r){var n=so(t.symbol)?io(t,t.symbol.valueDeclaration):io(t),i=so(r.symbol)?io(r,r.symbol.valueDeclaration):io(r);(Yt===t&&Ye===r||Zt===t&&Ze===r||$t===t&&at===r||Ku()===t&&ot===r)&&L(e.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,i,n);}(n,i);else if(n.symbol&&524288&n.flags&&qt===n)L(e.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(2048&e.getObjectFlags(n)&&2097152&i.flags){var f=i.types,g=Av(A.IntrinsicAttributes,a),y=Av(A.IntrinsicClassAttributes,a);if(!Eo(g)&&!Eo(y)&&(e.contains(f,g)||e.contains(f,y)))return}else _=_l(_,r);if(o||!d){if(B(o,n,i),262144&n.flags&&(null===(c=null===(s=n.symbol)||void 0===s?void 0:s.declarations)||void 0===c?void 0:c[0])&&!Uc(n)){var v=lp(n);if(v.constraint=hp(i,tp(n,v)),Xc(v)){var h=io(i,n.symbol.declarations[0]);R(e.createDiagnosticForNode(n.symbol.declarations[0],e.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint,h));}}}else m=[n,i];}function V(t,r){if(e.tracing&&3145728&t.flags&&3145728&r.flags){var n=t,i=r;if(n.objectFlags&i.objectFlags&32768)return;var o=n.types.length,s=i.types.length;o*s>1e6&&e.tracing.instant("checkTypes","traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:t.id,sourceSize:o,targetId:r.id,targetSize:s,pos:null==a?void 0:a.pos,end:null==a?void 0:a.end});}}function q(t,r,n,a){if(1048576&t.flags)return i===Rn?Q(t,r,n&&!(131068&t.flags),a):function(e,t,r,n){for(var i=-1,a=e.types,o=function(e,t){return 1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags?ny(t,-32769):t}(e,t),s=0;s<a.length;s++){var c=a[s];if(1048576&o.flags&&a.length>=o.types.length&&a.length%o.types.length==0){var l=z(c,o.types[s%o.types.length],3,!1,void 0,n);if(l){i&=l;continue}}var u=z(c,t,1,r,void 0,n);if(!u)return 0;i&=u;}return i}(t,r,n&&!(131068&t.flags),a);if(1048576&r.flags)return H(hg(t),r,n&&!(131068&t.flags)&&!(131068&r.flags));if(2097152&r.flags)return function(e,t,r,n){for(var i=-1,a=0,o=t.types;a<o.length;a++){var s=z(e,o[a],2,r,void 0,2);if(!s)return 0;i&=s;}return i}(t,r,n);if(i===Rn&&131068&r.flags){var o=e.sameMap(t.types,(function(e){return 465829888&e.flags?Gc(e)||Ke:e}));if(o!==t.types){if(131072&(t=N_(o)).flags)return 0;if(!(2097152&t.flags))return z(t,r,1,!1)||z(r,t,1,!1)}}return Q(t,r,!1,1)}function W(e,t){for(var r=-1,n=0,i=e.types;n<i.length;n++){var a=H(i[n],t,!1);if(!a)return 0;r&=a;}return r}function H(e,t,r){var n=t.types;if(1048576&t.flags){if(f_(n,e))return -1;var i=Tm(t,e);if(i&&(s=z(e,i,2,!1)))return s}for(var a=0,o=n;a<o.length;a++){var s;if(s=z(e,o[a],2,!1))return s}if(r){var c=_f(e,t,z);c&&z(e,c,2,!0);}return 0}function Q(e,t,r,n){var i=e.types;if(1048576&e.flags&&f_(i,t))return -1;for(var a=i.length,o=0;o<a;o++){var s=z(i[o],t,1,r&&o===a-1,void 0,n);if(s)return s}return 0}function X(t,r,a,o,s){if(D)return 0;var c=Df(t,r,o,i,!1),l=i.get(c);if(void 0!==l&&(!(a&&2&l)||4&l)){if(it){var u=24&l;8&u&&hp(t,Tt),16&u&&hp(t,St);}return 1&l?-1:0}if(p){for(var d=c.startsWith("*")?Df(t,r,o,i,!0):void 0,m=0;m<v;m++)if(c===p[m]||d&&d===p[m])return 3;if(100===h||100===b)return D=!0,0}else p=[],f=[],g=[];var y=v;p[v]=c,v++;var S,C=x;1&s&&(f[h]=t,h++,1&x||!kf(t,f,h)||(x|=1)),2&s&&(g[b]=r,b++,2&x||!kf(r,g,b)||(x|=2));var E,k=0;if(it&&(S=it,it=function(e){return k|=e?16:8,S(e)}),3===x?(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","recursiveTypeRelatedTo_DepthLimit",{sourceId:t.id,sourceIdStack:f.map((function(e){return e.id})),targetId:r.id,targetIdStack:g.map((function(e){return e.id})),depth:h,targetDepth:b}),E=3):(null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","structuredTypeRelatedTo",{sourceId:t.id,targetId:r.id}),E=function(t,r,a,o){var s=I(),c=function(t,r,a,o,s){var c,l,u,d,p=!1,m=t.flags,y=r.flags;if(i===Bn){if(3145728&m){var v=W(t,r);return v&&(v&=W(r,t)),v}if(4194304&m)return z(t.type,r.type,3,!1);if(8388608&m&&(c=z(t.objectType,r.objectType,3,!1))&&(c&=z(t.indexType,r.indexType,3,!1)))return c;if(16777216&m&&t.root.isDistributive===r.root.isDistributive&&(c=z(t.checkType,r.checkType,3,!1))&&(c&=z(t.extendsType,r.extendsType,3,!1))&&(c&=z(bd(t),bd(r),3,!1))&&(c&=z(xd(t),xd(r),3,!1)))return c;if(33554432&m&&(c=z(t.baseType,r.baseType,3,!1))&&(c&=z(t.constraint,r.constraint,3,!1)))return c;if(!(524288&m))return 0}else if(3145728&m||3145728&y){if(c=q(t,r,a,o))return c;if(!(465829888&m||524288&m&&1048576&y||2097152&m&&467402752&y))return 0}if(17301504&m&&t.aliasSymbol&&t.aliasTypeArguments&&t.aliasSymbol===r.aliasSymbol&&!vf(t)&&!vf(r)){if((le=gf(t.aliasSymbol))===e.emptyArray)return 1;if(void 0!==(ue=ge(t.aliasTypeArguments,r.aliasTypeArguments,le,o)))return ue}if(tg(t)&&!t.target.readonly&&(c=z(fu(t)[0],r,1))||tg(r)&&(r.target.readonly||Lf(Gc(t)||t))&&(c=z(t,fu(r)[0],2)))return c;if(262144&y){if(32&e.getObjectFlags(t)&&!t.declaration.nameType&&z(z_(r),kc(t),3)&&!(4&Ic(t))){var x=Ac(t),D=ld(r,Ec(t));if(c=z(x,D,3,a))return c}if(i===Rn&&262144&m){if((X=Kc(t))&&Xc(t))for(;X&&Xm(X,(function(e){return !!(262144&e.flags)}));){if(c=z(X,r,1,!1))return c;X=Kc(X);}return 0}}else if(4194304&y){var S=r.type;if(4194304&m&&(c=z(S,t.type,3,!1)))return c;if($f(S)){if(c=z(t,u_(S),2,a))return c}else if(X=Vc(S)){if(-1===z(t,z_(X,r.stringsOnly),2,a))return -1}else if(Lc(S)){var T=Nc(S),C=kc(S),E=void 0;if(T&&Pc(S)){var k=rl(wc(S)),N=[];Cc(k,8576,!1,(function(e){N.push(hp(T,cp(S.mapper,Ec(S),e)));})),E=b_(n$4(n$4([],N,!0),[T],!1));}else E=T||C;if(-1===z(t,E,2,a))return -1}}else if(8388608&y){if(8388608&m){if((c=z(t.objectType,r.objectType,3,a))&&(c&=z(t.indexType,r.indexType,3,a)),c)return c;a&&(l=_);}if(i===Ln||i===Rn){var A=r.objectType,F=r.indexType,P=Gc(A)||A,I=Gc(F)||F;if(!rd(P)&&!nd(I)&&(X=_d(P,I,4|(P!==A?2:0)))){if(a&&l&&w(s),c=z(t,X,2,a,void 0,o))return c;a&&l&&_&&(_=fe([l])<=fe([_])?l:_);}}a&&(l=void 0);}else if(Lc(r)&&i!==Bn){var O=!!r.declaration.nameType,M=(x=Ac(r),Ic(r));if(!(8&M)){if(!O&&8388608&x.flags&&x.objectType===t&&x.indexType===Ec(r))return -1;if(!Lc(t)){E=O?Nc(r):kc(r);var L=z_(t,void 0,!0),R=4&M,B=R?vc(E,L):void 0;if(R?!(131072&B.flags):z(E,L,3)){var j=Ac(r),U=Ec(r),K=ny(j,-98305);if(!O&&8388608&K.flags&&K.indexType===U){if(c=z(t,K.objectType,2,a))return c}else if(D=ld(t,O?B||E:B?N_([B,U]):U),c=z(D,j,3,a))return c}l=_,w(s);}}}else if(16777216&y){if(kf(r,g,b,10))return 3;var V=r;if(!(V.root.inferTypeParameters||(u=V.root).isDistributive&&(dp(u.checkType,u.node.trueType)||dp(u.checkType,u.node.falseType)))){var H=!Ip(xp(V.checkType),xp(V.extendsType)),Q=!H&&Ip(Dp(V.checkType),Dp(V.extendsType));if((c=H?-1:z(t,bd(V),2,!1,void 0,o))&&(c&=Q?-1:z(t,xd(V),2,!1,void 0,o)))return c}}else if(134217728&y){if(134217728&m){if(i===Rn)return function(e,t){var r=e.texts[0],n=t.texts[0],i=e.texts[e.texts.length-1],a=t.texts[t.texts.length-1],o=Math.min(r.length,n.length),s=Math.min(i.length,a.length);return r.slice(0,o)!==n.slice(0,o)||i.slice(i.length-s)!==a.slice(a.length-s)}(t,r)?0:-1;hp(t,St);}if(em(t,r))return -1}else if(268435456&r.flags&&!(268435456&t.flags)&&Zg(t,r))return -1;if(8650752&m){if(!(8388608&m&&8388608&y)){var X=Uc(t)||Ke;if(c=z(X,r,1,!1,void 0,o))return c;if(c=z(oc(X,t),r,1,a&&X!==Ke&&!(y&m&262144),void 0,o))return c;if(tl(t)){var Y=Uc(t.indexType);if(Y&&(c=z(ld(t.objectType,Y),r,1,a)))return c}}}else if(4194304&m){if(c=z(gt,r,1,a))return c}else if(134217728&m&&!(524288&y)){if(!(134217728&y)&&(X=Gc(t))&&X!==t&&(c=z(X,r,1,a)))return c}else if(268435456&m){if(268435456&y){if(t.symbol!==r.symbol)return 0;if(c=z(t.type,r.type,3,a))return c}else if((X=Gc(t))&&(c=z(X,r,1,a)))return c}else if(16777216&m){if(kf(t,f,h,10))return 3;if(16777216&y){var Z=t.root.inferTypeParameters,re=t.extendsType,ne=void 0;if(Z){var ie=wg(Z,void 0,0,J);nm(ie.inferences,r.extendsType,re,1536),re=hp(re,ie.mapper),ne=ie.mapper;}if(Np(re,r.extendsType)&&(z(t.checkType,r.checkType,3)||z(r.checkType,t.checkType,3))&&((c=z(hp(bd(t),ne),bd(r),3,a))&&(c&=z(xd(t),xd(r),3,a)),c))return c}else {var ae=Xc(t)?Wc(t):void 0;if(ae&&(c=z(ae,r,1,a)))return c}var oe=qc(t);if(oe&&(c=z(oe,r,1,a)))return c}else {if(i!==On&&i!==Mn&&(d=r,32&e.getObjectFlags(d)&&4&Ic(d))&&Xp(t))return -1;if(Lc(r))return Lc(t)&&(c=function(e,t,r){var n;if((i===Rn||(i===Bn?Ic(e)===Ic(t):Mc(e)<=Mc(t)))&&(n=z(kc(t),hp(kc(e),Mc(e)<0?Tt:St),3,r))){var a=$d([Ec(e)],[Ec(t)]);if(hp(Nc(e),a)===hp(Nc(t),a))return n&z(hp(Ac(e),a),Ac(t),3,r)}return 0}(t,r,a))?c:0;var ce=!!(131068&m);if(i!==Bn)m=(t=rl(t)).flags;else if(Lc(t))return 0;if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&t.target===r.target&&!$f(t)&&!vf(t)&&!vf(r)){if(zf(t))return -1;var le,ue;if((le=ff(t.target))===e.emptyArray)return 1;if(void 0!==(ue=ge(fu(t),fu(r),le,o)))return ue}else {if(Of(r)?Mf(t):If(r)&&$f(t)&&!t.target.readonly)return i!==Bn?z(xl(t,Ze)||Le,xl(r,Ze)||Le,3,a):0;if((i===On||i===Mn)&&Xp(r)&&8192&e.getObjectFlags(r)&&!Xp(t))return 0}if(2621440&m&&524288&y){var _e=a&&_===s.errorInfo&&!ce;if((c=ee(t,r,_e,void 0,o))&&(c&=te(t,r,0,_e))&&(c&=te(t,r,1,_e))&&(c&=se(t,r,ce,_e,o)),p&&c)_=l||_||s.errorInfo;else if(c)return c}if(2621440&m&&1048576&y){var de=ny(r,36175872);if(1048576&de.flags){var pe=function(t,r){var n=xm(zc(t),r);if(!n)return 0;for(var a=1,o=0,s=n;o<s.length;o++)if((a*=ey(ps(_=s[o])))>25)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","typeRelatedToDiscriminatedType_DepthLimit",{sourceId:t.id,targetId:r.id,numCombinations:a}),0;for(var c=new Array(n.length),l=new e.Set,u=0;u<n.length;u++){var _,d=ps(_=n[u]);c[u]=1048576&d.flags?d.types:[d],l.add(_.escapedName);}for(var p=e.cartesianProduct(c),f=[],g=function(a){var o=!1;e:for(var s=0,c=r.types;s<c.length;s++){for(var l=c[s],u=function(e){var o=n[e],s=dl(l,o.escapedName);return s?o===s?"continue":$(t,r,o,s,(function(t){return a[e]}),!1,0,G||i===Rn)?void 0:"continue-outer":"continue-outer"},_=0;_<n.length;_++)if("continue-outer"===u(_))continue e;e.pushIfUnique(f,l,e.equateValues),o=!0;}if(!o)return {value:0}},m=0,y=p;m<y.length;m++){var v=g(y[m]);if("object"==typeof v)return v.value}for(var h=-1,b=0,x=f;b<x.length;b++){var D=x[b];if((h&=ee(t,D,!1,l,0))&&(h&=te(t,D,0,!1))&&(!(h&=te(t,D,1,!1))||$f(t)&&$f(D)||(h&=se(t,D,!1,!1,0))),!h)return h}return h}(t,de);if(pe)return pe}}}return 0;function fe(t){return t?e.reduceLeft(t,(function(e,t){return e+1+fe(t.next)}),0):0}function ge(t,r,n,o){if(c=function(t,r,n,a,o){if(void 0===t&&(t=e.emptyArray),void 0===r&&(r=e.emptyArray),void 0===n&&(n=e.emptyArray),t.length!==r.length&&i===Bn)return 0;for(var s=t.length<=r.length?t.length:r.length,c=-1,l=0;l<s;l++){var u=l<n.length?n[l]:1,_=7&u;if(4!==_){var d=t[l],p=r[l],f=-1;if(8&u?f=i===Bn?z(d,p,3,!1):Ap(d,p):1===_?f=z(d,p,3,a,void 0,o):2===_?f=z(p,d,3,a,void 0,o):3===_?(f=z(p,d,3,!1))||(f=z(d,p,3,a,void 0,o)):(f=z(d,p,3,a,void 0,o))&&(f&=z(p,d,3,a,void 0,o)),!f)return 0;c&=f;}}return c}(t,r,n,a,o))return c;if(e.some(n,(function(e){return !!(24&e)})))return l=void 0,void w(s);var u=r&&function(e,t){for(var r=0;r<t.length;r++)if(1==(7&t[r])&&16384&e[r].flags)return !0;return !1}(r,n);if(p=!u,n!==e.emptyArray&&!u){if(p&&(!a||!e.some(n,(function(e){return 0==(7&e)}))))return 0;l=_,w(s);}}}(t,r,a,o,s);if(i!==Bn){if(!c&&(2097152&t.flags||262144&t.flags&&1048576&r.flags)){var l=function(t,r){for(var n,i=!1,a=0,o=t;a<o.length;a++)if(465829888&(u=o[a]).flags){for(var s=Uc(u);s&&21233664&s.flags;)s=Uc(s);s&&(n=e.append(n,s),r&&(n=e.append(n,u)));}else (469892092&u.flags||Yp(u))&&(i=!0);if(n&&(r||i)){if(i)for(var c=0,l=t;c<l.length;c++){var u;(469892092&(u=l[c]).flags||Yp(u))&&(n=e.append(n,u));}return af(N_(n),!1)}}(2097152&t.flags?t.types:[t],!!(1048576&r.flags));l&&Ym(l,(function(e){return e!==t}))&&(c=z(l,r,1,!1,void 0,o));}c&&!T&&(2097152&r.flags&&!rd(r)&&2621440&t.flags||Ad(r)&&!Mf(r)&&2097152&t.flags&&3670016&rl(t).flags&&!e.some(t.types,(function(t){return !!(262144&e.getObjectFlags(t))})))&&(T=!0,c&=ee(t,r,a,void 0,0),T=!1);}return c&&w(s),c}(t,r,a,o),null===e.tracing||void 0===e.tracing||e.tracing.pop()),it&&(it=S),1&s&&h--,2&s&&b--,x=C,E){if(-1===E||0===h&&0===b){if(-1===E||3===E)for(m=y;m<v;m++)i.set(p[m],1|k);v=y;}}else i.set(c,2|(a?4:0)|k),v=y;return E}function Y(e,t){if(!t||0===e.length)return e;for(var r,n=0;n<e.length;n++)t.has(e[n].escapedName)?r||(r=e.slice(0,n)):r&&r.push(e[n]);return r||e}function $(t,r,n,a,o,s,c,l){var u=e.getDeclarationModifierFlagsFromSymbol(n),_=e.getDeclarationModifierFlagsFromSymbol(a);if(8&u||8&_){if(n.valueDeclaration!==a.valueDeclaration)return s&&(8&u&&8&_?L(e.Diagnostics.Types_have_separate_declarations_of_a_private_property_0,ro(a)):L(e.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2,ro(a),io(8&u?t:r),io(8&u?r:t))),0}else if(16&_){if(!function(t,r){return !Sf(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r))&&(n=t,i=Tf(r),!Sf(n,(function(e){var t=Tf(e);return !!t&&ms(t,i)})));var n,i;}))}(n,a))return s&&L(e.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,ro(a),io(Tf(n)||t),io(Tf(a)||r)),0}else if(16&u)return s&&L(e.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2,ro(a),io(t),io(r)),0;if(i===Mn&&px(n)&&!px(a))return 0;var d=function(t,r,n,i,a){var o=G&&!!(48&e.getCheckFlags(r)),s=Bo(ps(r),!1,o);return z(n(t),s,3,i,void 0,a)}(n,a,o,s,c);return d?!l&&16777216&n.flags&&106500&a.flags&&!(16777216&a.flags)?(s&&L(e.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2,ro(a),io(t),io(r)),0):d:(s&&O(e.Diagnostics.Types_of_property_0_are_incompatible,ro(a)),0)}function ee(t,r,a,s,c){if(i===Bn)return function(e,t,r){if(!(524288&e.flags&&524288&t.flags))return 0;var n=Y(Bc(e),r),i=Y(Bc(t),r);if(n.length!==i.length)return 0;for(var a=-1,o=0,s=n;o<s.length;o++){var c=s[o],l=jc(t,c.escapedName);if(!l)return 0;var u=Af(c,l,z);if(!u)return 0;a&=u;}return a}(t,r,s);var u=-1;if($f(r)){if(Mf(t)){if(!r.target.readonly&&(Of(t)||$f(t)&&t.target.readonly))return 0;var d=gu(t),p=gu(r),f=$f(t)?4&t.target.combinedFlags:4,g=4&r.target.combinedFlags,m=$f(t)?t.target.minLength:0,y=r.target.minLength;if(!f&&d<y)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_requires_1,d,y),0;if(!g&&p<m)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_allows_only_1,m,p),0;if(!g&&(f||p<d))return a&&(m<y?L(e.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer,y):L(e.Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more,p)),0;for(var v=fu(t),h=fu(r),b=Math.min($f(t)?__(t.target,11):0,__(r.target,11)),x=Math.min($f(t)?d_(t.target,11):0,g?d_(r.target,11):0),D=!!s,T=0;T<p;T++){var C=T<p-x?T:T+d-p,E=$f(t)&&(T<b||T>=p-x)?t.target.elementFlags[C]:4,k=r.target.elementFlags[T];if(8&k&&!(8&E))return a&&L(e.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target,T),0;if(8&E&&!(12&k))return a&&L(e.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,C,T),0;if(1&k&&!(1&E))return a&&L(e.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target,T),0;if(!(D&&((12&E||12&k)&&(D=!1),D&&(null==s?void 0:s.has(""+T))))){var N=$f(t)?T<b||T>=p-x?fg(v[C],!!(E&k&2)):ng(t,b,x)||ct:v[0],A=h[T];if(!(W=z(N,8&E&&4&k?$u(A):fg(A,!!(2&k)),3,a,void 0,c)))return a&&(p>1||d>1)&&(T<b||T>=p-x||d-b-x==1?O(e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,C,T):O(e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,b,d-x-1,T)),0;u&=W;}}return u}if(12&r.target.combinedFlags)return 0}var F=!(i!==On&&i!==Mn||om(t)||zf(t)||$f(t)),P=Wg(t,r,F,!1);if(P)return a&&function(e,t){var r=pl(e,0),n=pl(e,1),i=Bc(e);return !((r.length||n.length)&&!i.length)||!!(fl(t,0).length&&r.length||fl(t,1).length&&n.length)}(t,r)&&function(t,r,i,a){var s=!1;if(i.valueDeclaration&&e.isNamedDeclaration(i.valueDeclaration)&&e.isPrivateIdentifier(i.valueDeclaration.name)&&t.symbol&&32&t.symbol.flags){var c=i.valueDeclaration.name.escapedText,u=e.getSymbolNameForPrivateIdentifier(t.symbol,c);if(u&&dl(t,u)){var d=e.factory.getDeclarationName(t.symbol.valueDeclaration),p=e.factory.getDeclarationName(r.symbol.valueDeclaration);return void L(e.Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2,Si(c),Si(""===d.escapedText?l:d),Si(""===p.escapedText?l:p))}}var f=e.arrayFrom(qg(t,r,a,!1));if((!o||o.code!==e.Diagnostics.Class_0_incorrectly_implements_interface_1.code&&o.code!==e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)&&(s=!0),1===f.length){var g=ro(i,void 0,0,20);L.apply(void 0,n$4([e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2,g],ao(t,r),!1)),e.length(i.declarations)&&R(e.createDiagnosticForNode(i.declarations[0],e.Diagnostics._0_is_declared_here,g)),s&&_&&S++;}else j(t,r,!1)&&(f.length>5?L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,io(t),io(r),e.map(f.slice(0,4),(function(e){return ro(e)})).join(", "),f.length-4):L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,io(t),io(r),e.map(f,(function(e){return ro(e)})).join(", ")),s&&_&&S++);}(t,r,P,F),0;if(om(r))for(var w=0,I=Y(zc(t),s);w<I.length;w++)if(!(jc(r,(K=I[w]).escapedName)||32768&(N=ds(K)).flags))return a&&L(e.Diagnostics.Property_0_does_not_exist_on_type_1,ro(K),io(r)),0;for(var M=zc(r),B=$f(t)&&$f(r),J=0,U=Y(M,s);J<U.length;J++){var K,V=U[J],q=V.escapedName;if(!(4194304&V.flags)&&(!B||e.isNumericLiteralName(q)||"length"===q)&&(K=dl(t,q))&&K!==V){var W;if(!(W=$(t,r,K,V,ps,a,c,i===Rn)))return 0;u&=W;}}return u}function te(t,r,n,a){var o,s;if(i===Bn)return function(e,t,r){var n=fl(e,r),i=fl(t,r);if(n.length!==i.length)return 0;for(var a=-1,o=0;o<n.length;o++){var s=Ff(n[o],i[o],!1,!1,!1,z);if(!s)return 0;a&=s;}return a}(t,r,n);if(r===wt||t===wt)return -1;var c=t.symbol&&bb(t.symbol.valueDeclaration),l=r.symbol&&bb(r.symbol.valueDeclaration),u=fl(t,c&&1===n?0:n),_=fl(r,l&&1===n?0:n);if(1===n&&u.length&&_.length){var d=!!(4&u[0].flags),p=!!(4&_[0].flags);if(d&&!p)return a&&L(e.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type),0;if(!function(t,r,n){if(!t.declaration||!r.declaration)return !0;var i=e.getSelectedEffectiveModifierFlags(t.declaration,24),a=e.getSelectedEffectiveModifierFlags(r.declaration,24);return 8===a||(16===a&&8!==i||(16!==a&&!i||(n&&L(e.Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type,_o(i),_o(a)),!1)))}(u[0],_[0],a))return 0}var f=-1,g=1===n?ie:re,m=e.getObjectFlags(t),y=e.getObjectFlags(r);if(64&m&&64&y&&t.symbol===r.symbol||4&m&&4&y&&t.target===r.target)for(var v=0;v<_.length;v++){if(!(F=ae(u[v],_[v],!0,a,g(u[v],_[v]))))return 0;f&=F;}else if(1===u.length&&1===_.length){var h=i===Rn||!!K.noStrictGenericChecks,b=e.first(u),x=e.first(_);if(!(f=ae(b,x,h,a,g(b,x)))&&a&&1===n&&m&y&&(173===(null===(o=x.declaration)||void 0===o?void 0:o.kind)||173===(null===(s=b.declaration)||void 0===s?void 0:s.kind))){var D=function(e){return no(e,void 0,262144,n)};return L(e.Diagnostics.Type_0_is_not_assignable_to_type_1,D(b),D(x)),L(e.Diagnostics.Types_of_construct_signatures_are_incompatible),f}}else e:for(var S=0,T=_;S<T.length;S++){for(var C=T[S],E=I(),k=a,N=0,A=u;N<A.length;N++){var F,P=A[N];if(F=ae(P,C,!0,k,g(P,C))){f&=F,w(E);continue e}k=!1;}return k&&L(e.Diagnostics.Type_0_provides_no_match_for_the_signature_1,io(t),no(C,void 0,void 0,n)),0}return f}function re(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,io(t),io(r))}:function(t,r){return O(e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible,io(t),io(r))}}function ie(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,io(t),io(r))}:function(t,r){return O(e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible,io(t),io(r))}}function ae(e,t,r,n,a){return Gp(r?Ql(e):e,r?Ql(t):t,i===Mn?8:0,n,L,a,J,St)}function oe(t,r,n){var i=z(t.type,r.type,3,n);return !i&&n&&(t.keyType===r.keyType?L(e.Diagnostics._0_index_signatures_are_incompatible,io(t.keyType)):L(e.Diagnostics._0_and_1_index_signatures_are_incompatible,io(t.keyType),io(r.keyType))),i}function se(t,r,n,a,o){if(i===Bn)return function(e,t){var r=hl(e),n=hl(t);if(r.length!==n.length)return 0;for(var i=0,a=n;i<a.length;i++){var o=a[i],s=bl(e,o.keyType);if(!s||!z(s.type,o.type,3)||s.isReadonly!==o.isReadonly)return 0}return -1}(t,r);for(var s=hl(r),c=e.some(s,(function(e){return e.keyType===Ye})),l=-1,u=0,_=s;u<_.length;u++){var d=_[u],p=!n&&c&&1&d.type.flags?-1:Lc(t)&&c?z(Ac(t),d.type,3,a):ce(t,d,a,o);if(!p)return 0;l&=p;}return l}function ce(t,r,n,i){var a=Sl(t,r.keyType);return a?oe(a,r,n):1&i||!yg(t)?(n&&L(e.Diagnostics.Index_signature_for_type_0_is_missing_in_type_1,io(r.keyType),io(t)),0):function(t,r,n){for(var i=-1,a=r.keyType,o=0,s=2097152&t.flags?Jc(t):Bc(t);o<s.length;o++){var c=s[o];if(!nf(t,c)&&yl(L_(c,8576),a)){var l=ps(c);if(!(p=z(ne||32768&l.flags||a===Ze||!(16777216&c.flags)?l:Fm(l,524288),r.type,3,n)))return n&&L(e.Diagnostics.Property_0_is_incompatible_with_index_signature,ro(c)),0;i&=p;}}for(var u=0,_=hl(t);u<_.length;u++){var d=_[u];if(yl(d.keyType,a)){var p;if(!(p=oe(d,r,n)))return 0;i&=p;}}return i}(t,r,n)}}function cf(t){if(16&t.flags)return !1;if(3145728&t.flags)return !!e.forEach(t.types,cf);if(465829888&t.flags){var r=Uc(t);if(r&&r!==t)return cf(r)}return qf(t)||!!(134217728&t.flags)||!!(268435456&t.flags)}function lf(t,r){return $f(t)&&$f(r)?e.emptyArray:zc(r).filter((function(e){return uf(To(t,e.escapedName),ds(e))}))}function uf(e,t){return !!e&&!!t&&vx(e,32768)&&!!gg(t)}function _f(t,r,n){return void 0===n&&(n=Fp),tE(t,r,n,!0)||function(t,r){var n=e.getObjectFlags(t);if(20&n&&1048576&r.flags)return e.find(r.types,(function(r){if(524288&r.flags){var i=n&e.getObjectFlags(r);if(4&i)return t.target===r.target;if(16&i)return !!t.aliasSymbol&&t.aliasSymbol===r.aliasSymbol}return !1}))}(t,r)||function(t,r){if(128&e.getObjectFlags(t)&&Xm(r,Bf))return e.find(r.types,(function(e){return !Bf(e)}))}(t,r)||function(t,r){var n=0;if(fl(t,n).length>0||fl(t,n=1).length>0)return e.find(r.types,(function(e){return fl(e,n).length>0}))}(t,r)||function(t,r){var n;if(!(406978556&t.flags))for(var i=0,a=0,o=r.types;a<o.length;a++){var s=o[a];if(!(406978556&s.flags)){var c=N_([z_(t),z_(s)]);if(4194304&c.flags)return s;if(qf(c)||1048576&c.flags){var l=1048576&c.flags?e.countWhere(c.types,qf):1;l>=i&&(n=s,i=l);}}}return n}(t,r)}function df(t,r,n,i,a){for(var o=t.types.map((function(e){})),s=0,c=r;s<c.length;s++){var l=c[s],u=l[0],_=l[1],d=al(t,_);if(!(a&&d&&16&e.getCheckFlags(d)))for(var p=0,f=0,g=t.types;f<g.length;f++){var m=To(g[f],_);m&&n(u(),m)?o[p]=void 0===o[p]||o[p]:o[p]=!1,p++;}}var y=o.indexOf(!0);if(-1===y)return i;for(var v=o.indexOf(!0,y+1);-1!==v;){if(!Np(t.types[y],t.types[v]))return i;v=o.indexOf(!0,v+1);}return t.types[y]}function pf(t){if(524288&t.flags){var r=Rc(t);return 0===r.callSignatures.length&&0===r.constructSignatures.length&&0===r.indexInfos.length&&r.properties.length>0&&e.every(r.properties,(function(e){return !!(16777216&e.flags)}))}return !!(2097152&t.flags)&&e.every(t.types,pf)}function ff(e){return e===Qt||e===Xt||8&e.objectFlags?U:mf(e.symbol,e.typeParameters)}function gf(e){return mf(e,_i(e).typeParameters)}function mf(t,r){void 0===r&&(r=e.emptyArray);var n=_i(t);if(!n.variances){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","getVariancesWorker",{arity:r.length,id:p_(Js(t))}),n.variances=e.emptyArray;for(var i=[],a=function(e){var r=hf(e),n=65536&r?32768&r?0:1:32768&r?2:void 0;if(void 0===n){var a=!1,o=!1,s=it;it=function(e){return e?o=!0:a=!0};var c=yf(t,e,Lt),l=yf(t,e,Rt);3==(n=(Ip(l,c)?1:0)|(Ip(c,l)?2:0))&&Ip(yf(t,e,Bt),c)&&(n=4),it=s,(a||o)&&(a&&(n|=8),o&&(n|=16));}i.push(n);},o=0,s=r;o<s.length;o++)a(s[o]);n.variances=i,null===e.tracing||void 0===e.tracing||e.tracing.pop({variances:i.map(e.Debug.formatVariance)});}return n.variances}function yf(e,t,r){var n=tp(t,r),i=Js(e);if(Eo(i))return i;var a=524288&e.flags?yu(e,Xd(_i(e).typeParameters,n)):_u(i,Xd(i.typeParameters,n));return Pe.add(p_(a)),a}function vf(e){return Pe.has(p_(e))}function hf(t){var r,n;return (e.some(null===(r=t.symbol)||void 0===r?void 0:r.declarations,(function(t){return e.hasSyntacticModifier(t,32768)}))?32768:0)|(e.some(null===(n=t.symbol)||void 0===n?void 0:n.declarations,(function(t){return e.hasSyntacticModifier(t,65536)}))?65536:0)}function bf(e){return 262144&e.flags&&!Kc(e)}function xf(t){return function(t){return !!(4&e.getObjectFlags(t))&&!t.node}(t)&&e.some(fu(t),(function(e){return !!(262144&e.flags)||xf(e)}))}function Df(e,t,r,n,i){if(n===Bn&&e.id>t.id){var a=e;e=t,t=a;}var o=r?":"+r:"";return xf(e)&&xf(t)?function(e,t,r,n){var i=[],a="",o=c(e,0),s=c(t,0);return "".concat(a).concat(o,",").concat(s).concat(r);function c(e,t){void 0===t&&(t=0);for(var r=""+e.target.id,o=0,s=fu(e);o<s.length;o++){var l=s[o];if(262144&l.flags){if(n||bf(l)){var u=i.indexOf(l);u<0&&(u=i.length,i.push(l)),r+="="+u;continue}a="*";}else if(t<4&&xf(l)){r+="<"+c(l,t+1)+">";continue}r+="-"+l.id;}return r}}(e,t,o,i):"".concat(e.id,",").concat(t.id).concat(o)}function Sf(t,r){if(!(6&e.getCheckFlags(t)))return r(t);for(var n=0,i=t.containingType.types;n<i.length;n++){var a=dl(i[n],t.escapedName),o=a&&Sf(a,r);if(o)return o}}function Tf(e){return e.parent&&32&e.parent.flags?Js(Sa(e)):void 0}function Cf(e){var t=Tf(e),r=t&&Ns(t)[0];return r&&To(r,e.escapedName)}function Ef(t,r,n){return Sf(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r,n))&&!ms(t,Tf(r))}))?void 0:t}function kf(e,t,r,n){if(void 0===n&&(n=3),r>=n)for(var i=Nf(e),a=0,o=0,s=0;s<r;s++){var c=t[s];if(Nf(c)===i){if(c.id>=o&&++a>=n)return !0;o=c.id;}}return !1}function Nf(t){if(524288&t.flags&&!sm(t)){if(e.getObjectFlags(t)&&t.node)return t.node;if(t.symbol&&!(16&e.getObjectFlags(t)&&32&t.symbol.flags))return t.symbol;if($f(t))return t.target}if(262144&t.flags)return t.symbol;if(8388608&t.flags){do{t=t.objectType;}while(8388608&t.flags);return t}return 16777216&t.flags?t.root:t}function Af(t,r,n){if(t===r)return -1;var i=24&e.getDeclarationModifierFlagsFromSymbol(t);if(i!==(24&e.getDeclarationModifierFlagsFromSymbol(r)))return 0;if(i){if(YS(t)!==YS(r))return 0}else if((16777216&t.flags)!=(16777216&r.flags))return 0;return px(t)!==px(r)?0:n(ds(t),ds(r))}function Ff(t,r,n,i,a,o){if(t===r)return -1;if(!function(e,t,r){var n=Vb(e),i=Vb(t),a=qb(e),o=qb(t),s=Wb(e),c=Wb(t);return n===i&&a===o&&s===c||!!(r&&a<=o)}(t,r,n))return 0;if(e.length(t.typeParameters)!==e.length(r.typeParameters))return 0;if(r.typeParameters){for(var s=$d(t.typeParameters,r.typeParameters),c=0;c<r.typeParameters.length;c++)if(!((g=t.typeParameters[c])===(p=r.typeParameters[c])||o(hp(ou(g),s)||Ke,ou(p)||Ke)&&o(hp($c(g),s)||Ke,$c(p)||Ke)))return 0;t=up(t,s,!0);}var l=-1;if(!i){var u=jl(t);if(u){var _=jl(r);if(_){if(!(f=o(u,_)))return 0;l&=f;}}}var d=Vb(r);for(c=0;c<d;c++){var p,f,g=zb(t,c);if(!(f=o(p=zb(r,c),g)))return 0;l&=f;}if(!a){var m=Jl(t),y=Jl(r);l&=m||y?function(e,t,r){return e&&t&&x_(e,t)?e.type===t.type?-1:e.type&&t.type?r(e.type,t.type):0:0}(m,y,o):o(Ul(t),Ul(r));}return l}function Pf(t){return e.reduceLeft(t,(function(e,t){return e|(1048576&t.flags?Pf(t.types):t.flags)}),0)}function wf(t){if(1===t.length)return t[0];var r=G?e.sameMap(t,(function(e){return Zm(e,(function(e){return !(98304&e.flags)}))})):t,n=function(e){for(var t,r=0,n=e;r<n.length;r++){var i=n[r];if(!(131072&i.flags)){var a=Gf(i);if(null!=t||(t=a),a===i||a!==t)return !1}}return !0}(r)?b_(r):e.reduceLeft(r,(function(e,t){return wp(e,t)?t:e}));return r===t?n:sg(n,98304&Pf(t))}function If(t){return !!(4&e.getObjectFlags(t))&&(t.target===Qt||t.target===Xt)}function Of(t){return !!(4&e.getObjectFlags(t))&&t.target===Xt}function Mf(e){return If(e)||$f(e)}function Lf(e){return If(e)&&!Of(e)||$f(e)&&!e.target.readonly}function Rf(e){return If(e)?fu(e)[0]:void 0}function Bf(e){return If(e)||!(98304&e.flags)&&Ip(e,ir)}function jf(t){if(4&e.getObjectFlags(t)&&3&e.getObjectFlags(t.target)){if(33554432&e.getObjectFlags(t))return 67108864&e.getObjectFlags(t)?t.cachedEquivalentBaseType:void 0;t.objectFlags|=33554432;var r=t.target;if(1&e.getObjectFlags(r)){var n=Ss(r);if(n&&79!==n.expression.kind&&208!==n.expression.kind)return}var i=Ns(r);if(1===i.length&&!ic(t.symbol).size){var a=e.length(r.typeParameters)?hp(i[0],$d(r.typeParameters,fu(t).slice(0,r.typeParameters.length))):i[0];return e.length(fu(t))>e.length(r.typeParameters)&&(a=oc(a,e.last(fu(t)))),t.objectFlags|=67108864,t.cachedEquivalentBaseType=a}}}function Jf(e){return G?e===ut:e===We}function zf(e){var t=Rf(e);return !!t&&Jf(t)}function Uf(e){return $f(e)||!!dl(e,"0")}function Kf(e){return Bf(e)||Uf(e)}function Vf(e){return !(240512&e.flags)}function qf(e){return !!(109440&e.flags)}function Wf(t){var r=Qc(t);return 2097152&r.flags?e.some(r.types,qf):qf(r)}function Hf(t){return !!(16&t.flags)||(1048576&t.flags?!!(1024&t.flags)||e.every(t.types,qf):qf(t))}function Gf(e){return 1024&e.flags?Ls(e):402653312&e.flags?Ye:256&e.flags?Ze:2048&e.flags?$e:512&e.flags?at:1048576&e.flags?function(e){var t,r="B".concat(p_(e));return null!==(t=Un(r))&&void 0!==t?t:Kn(r,ty(e,Gf))}(e):e}function Qf(e){return 1024&e.flags&&Bd(e)?Ls(e):128&e.flags&&Bd(e)?Ye:256&e.flags&&Bd(e)?Ze:2048&e.flags&&Bd(e)?$e:512&e.flags&&Bd(e)?at:1048576&e.flags?ty(e,Qf):e}function Xf(e){return 8192&e.flags?ot:1048576&e.flags?ty(e,Xf):e}function Yf(e,t){return Rx(e,t)||(e=Xf(Qf(e))),Rd(e)}function Zf(e,t,r,n){return e&&qf(e)&&(e=Yf(e,t?LS(r,t,n):void 0)),e}function $f(t){return !!(4&e.getObjectFlags(t)&&8&t.target.objectFlags)}function eg(e){return $f(e)&&!!(8&e.target.combinedFlags)}function tg(e){return eg(e)&&1===e.target.elementFlags.length}function rg(e){return ng(e,e.target.fixedLength)}function ng(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=!1);var i=gu(e)-r;if(t<i){for(var a=fu(e),o=[],s=t;s<i;s++){var c=a[s];o.push(8&e.target.elementFlags[s]?ld(c,Ze):c);}return n?N_(o):b_(o)}}function ig(e){return "0"===e.value.base10Value}function ag(e){return Zm(e,(function(e){return !!(4194304&Am(e))}))}function og(e){return 4&e.flags?sn:8&e.flags?cn:64&e.flags?ln:e===tt||e===et||114691&e.flags||128&e.flags&&""===e.value||256&e.flags&&0===e.value||2048&e.flags&&ig(e)?e:ct}function sg(e,t){var r=t&~e.flags&98304;return 0===r?e:b_(32768===r?[e,qe]:65536===r?[e,Qe]:[e,qe,Qe])}function cg(t,r){void 0===r&&(r=!1),e.Debug.assert(G);var n=r?Ge:qe;return 32768&t.flags||1048576&t.flags&&t.types[0]===n?t:b_([t,n])}function lg(e){return G?Pm(e,2097152):e}function ug(e){return G?b_([e,He]):e}function _g(e){return G?$m(e,He):e}function dg(t,r,n){return n?e.isOutermostOptionalChain(r)?cg(t):ug(t):t}function pg(t,r){return e.isExpressionOfOptionalChainRoot(r)?lg(t):e.isOptionalChain(r)?_g(t):t}function fg(e,t){return ne&&t?$m(e,Ge):e}function gg(e){return ne&&(e===Ge||1048576&e.flags&&f_(e.types,Ge))}function mg(e){return ne?$m(e,Ge):Fm(e,524288)}function yg(t){var r=e.getObjectFlags(t);return 2097152&t.flags?e.every(t.types,yg):!(!t.symbol||0==(7040&t.symbol.flags)||32&t.symbol.flags||zT(t))||!!(4194304&r)||!!(1024&r&&yg(t.source))}function vg(t,r){var n=ri(t.flags,t.escapedName,8&e.getCheckFlags(t));n.declarations=t.declarations,n.parent=t.parent,n.type=r,n.target=t,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration);var i=_i(t).nameType;return i&&(n.nameType=i),n}function hg(t){if(!(om(t)&&8192&e.getObjectFlags(t)))return t;var r=t.regularType;if(r)return r;var n=t,i=function(t,r){for(var n=e.createSymbolTable(),i=0,a=Bc(t);i<a.length;i++){var o=a[i],s=ds(o),c=r(s);n.set(o.escapedName,c===s?o:vg(o,c));}return n}(t,hg),a=Ja(n.symbol,i,n.callSignatures,n.constructSignatures,n.indexInfos);return a.flags=n.flags,a.objectFlags|=-8193&n.objectFlags,t.regularType=a,a}function bg(e,t,r){return {parent:e,propertyName:t,siblings:r,resolvedProperties:void 0}}function xg(e){if(!e.siblings){for(var t=[],r=0,n=xg(e.parent);r<n.length;r++){var i=n[r];if(om(i)){var a=jc(i,e.propertyName);a&&Qm(ds(a),(function(e){t.push(e);}));}}e.siblings=t;}return e.siblings}function Dg(t){if(!t.resolvedProperties){for(var r=new e.Map,n=0,i=xg(t);n<i.length;n++){var a=i[n];if(om(a)&&!(2097152&e.getObjectFlags(a)))for(var o=0,s=zc(a);o<s.length;o++){var c=s[o];r.set(c.escapedName,c);}}t.resolvedProperties=e.arrayFrom(r.values());}return t.resolvedProperties}function Sg(e,t){if(!(4&e.flags))return e;var r=ds(e),n=Eg(r,t&&bg(t,e.escapedName,void 0));return n===r?e:vg(e,n)}function Tg(e){var t=Fe.get(e.escapedName);if(t)return t;var r=vg(e,Ge);return r.flags|=16777216,Fe.set(e.escapedName,r),r}function Cg(e){return Eg(e,void 0)}function Eg(t,r){if(196608&e.getObjectFlags(t)){if(void 0===r&&t.widened)return t.widened;var n=void 0;if(98305&t.flags)n=Le;else if(om(t))n=function(t,r){for(var n=e.createSymbolTable(),i=0,a=Bc(t);i<a.length;i++){var o=a[i];n.set(o.escapedName,Sg(o,r));}if(r)for(var s=0,c=Dg(r);s<c.length;s++)o=c[s],n.has(o.escapedName)||n.set(o.escapedName,Tg(o));var l=Ja(t.symbol,n,e.emptyArray,e.emptyArray,e.sameMap(hl(t),(function(e){return eu(e.keyType,Cg(e.type),e.isReadonly)})));return l.objectFlags|=266240&e.getObjectFlags(t),l}(t,r);else if(1048576&t.flags){var i=r||bg(void 0,void 0,t.types),a=e.sameMap(t.types,(function(e){return 98304&e.flags?e:Eg(e,i)}));n=b_(a,e.some(a,Xp)?2:1);}else 2097152&t.flags?n=N_(e.sameMap(t.types,Cg)):Mf(t)&&(n=_u(t.target,e.sameMap(fu(t),Cg)));return n&&void 0===r&&(t.widened=n),n||t}return t}function kg(t){var r=!1;if(65536&e.getObjectFlags(t)){if(1048576&t.flags)if(e.some(t.types,Xp))r=!0;else for(var n=0,i=t.types;n<i.length;n++)kg(u=i[n])&&(r=!0);if(Mf(t))for(var a=0,o=fu(t);a<o.length;a++)kg(u=o[a])&&(r=!0);if(om(t))for(var s=0,c=Bc(t);s<c.length;s++){var l=c[s],u=ds(l);65536&e.getObjectFlags(u)&&(kg(u)||Qn(l.valueDeclaration,e.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type,ro(l),io(Cg(u))),r=!0);}}return r}function Ng(t,r,n){var i=io(Cg(r));if(!e.isInJSFile(t)||e.isCheckJsEnabledForFile(e.getSourceFileOfNode(t),K)){var a;switch(t.kind){case 223:case 169:case 168:a=Z?e.Diagnostics.Member_0_implicitly_has_an_1_type:e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 166:var o=t;if(e.isIdentifier(o.name)&&(e.isCallSignatureDeclaration(o.parent)||e.isMethodSignature(o.parent)||e.isFunctionTypeNode(o.parent))&&o.parent.parameters.indexOf(o)>-1&&(vi(o,o.name.escapedText,788968,void 0,o.name.escapedText,!0)||o.name.originalKeywordKind&&e.isTypeNodeKind(o.name.originalKeywordKind))){var s="arg"+o.parent.parameters.indexOf(o),c=e.declarationNameToString(o.name)+(o.dotDotDotToken?"[]":"");return void Yn(Z,t,e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,s,c)}a=t.dotDotDotToken?Z?e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type:e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:Z?e.Diagnostics.Parameter_0_implicitly_has_an_1_type:e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 205:if(a=e.Diagnostics.Binding_element_0_implicitly_has_an_1_type,!Z)return;break;case 320:return void Qn(t,e.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);case 259:case 171:case 170:case 174:case 175:case 215:case 216:if(Z&&!t.name)return void Qn(t,3===n?e.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:e.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);a=Z?3===n?e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 197:return void(Z&&Qn(t,e.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type));default:a=Z?e.Diagnostics.Variable_0_implicitly_has_an_1_type:e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;}Yn(Z,t,a,e.declarationNameToString(e.getNameOfDeclaration(t)),i);}}function Ag(t,r,n){m((function(){!(Z&&65536&e.getObjectFlags(r))||n&&pv(t)||kg(r)||Ng(t,r,n);}));}function Fg(e,t,r){var n=Vb(e),i=Vb(t),a=Hb(e),o=Hb(t),s=o?i-1:i,c=a?s:Math.min(n,s),l=jl(e);if(l){var u=jl(t);u&&r(l,u);}for(var _=0;_<c;_++)r(zb(e,_),zb(t,_));o&&r(Kb(e,c),o);}function Pg(e,t,r){var n=Jl(e),i=Jl(t);n&&i&&x_(n,i)&&n.type&&i.type?r(n.type,i.type):r(Ul(e),Ul(t));}function wg(e,t,r,n){return Ig(e.map(Lg),t,r,n||Fp)}function Ig(t,r,n,i){var a={inferences:t,signature:r,flags:n,compareTypes:i,mapper:Tt,nonFixingMapper:Tt};return a.mapper=function(t){return np(e.map(t.inferences,(function(e){return e.typeParameter})),e.map(t.inferences,(function(e,r){return function(){return e.isFixed||(function(e){if(e.intraExpressionInferenceSites){for(var t=0,r=e.intraExpressionInferenceSites;t<r.length;t++){var n=r[t],i=n.node,a=n.type,o=171===i.kind?ev(i,2):cv(i,2);o&&nm(e.inferences,a,o);}e.intraExpressionInferenceSites=void 0;}}(t),Og(t.inferences),e.isFixed=!0),cm(t,r)}})))}(a),a.nonFixingMapper=function(t){return np(e.map(t.inferences,(function(e){return e.typeParameter})),e.map(t.inferences,(function(e,r){return function(){return cm(t,r)}})))}(a),a}function Og(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];n.isFixed||(n.inferredType=void 0);}}function Mg(e,t,r){var n;(null!==(n=e.intraExpressionInferenceSites)&&void 0!==n?n:e.intraExpressionInferenceSites=[]).push({node:t,type:r});}function Lg(e){return {typeParameter:e,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:!0,isFixed:!1,impliedArity:void 0}}function Rg(e){return {typeParameter:e.typeParameter,candidates:e.candidates&&e.candidates.slice(),contraCandidates:e.contraCandidates&&e.contraCandidates.slice(),inferredType:e.inferredType,priority:e.priority,topLevel:e.topLevel,isFixed:e.isFixed,impliedArity:e.impliedArity}}function Bg(e){return e&&e.mapper}function jg(t){var r=e.getObjectFlags(t);if(524288&r)return !!(1048576&r);var n=!!(465829888&t.flags||524288&t.flags&&!Jg(t)&&(4&r&&(t.node||e.forEach(fu(t),jg))||16&r&&t.symbol&&14384&t.symbol.flags&&t.symbol.declarations||12583968&r)||3145728&t.flags&&!(1024&t.flags)&&!Jg(t)&&e.some(t.types,jg));return 3899393&t.flags&&(t.objectFlags|=524288|(n?1048576:0)),n}function Jg(t){if(t.aliasSymbol&&!t.aliasTypeArguments){var r=e.getDeclarationOfKind(t.aliasSymbol,262);return !(!r||!e.findAncestor(r.parent,(function(e){return 308===e.kind||264!==e.kind&&"quit"})))}return !1}function zg(t,r){return !!(t===r||3145728&t.flags&&e.some(t.types,(function(e){return zg(e,r)}))||16777216&t.flags&&(bd(t)===r||xd(t)===r))}function Ug(t,r,n){if(!$r){var i=t.id+","+r.id+","+n.id;if(Zr.has(i))return Zr.get(i);$r=!0;var a=function(t,r,n){if(bl(t,Ye)||0!==zc(t).length&&Kg(t)){if(If(t))return $u(Vg(fu(t)[0],r,n),Of(t));if($f(t))return a_(e.map(fu(t),(function(e){return Vg(e,r,n)})),4&Ic(r)?e.sameMap(t.target.elementFlags,(function(e){return 2&e?1:e})):t.target.elementFlags,t.target.readonly,t.target.labeledElementDeclarations);var i=Oa(1040,void 0);return i.source=t,i.mappedType=r,i.constraintType=n,i}}(t,r,n);return $r=!1,Zr.set(i,a),a}}function Kg(t){return !(262144&e.getObjectFlags(t))||om(t)&&e.some(zc(t),(function(e){return Kg(ds(e))}))||$f(t)&&e.some(fu(t),Kg)}function Vg(e,t,r){var n=ld(r.type,Ec(t)),i=Ac(t),a=Lg(n);return nm([a],e,i),Hg(a)||Ke}function qg(t,r,n,i){var a,s,c,l,u,_,d;return o(this,(function(o){switch(o.label){case 0:a=zc(r),s=0,c=a,o.label=1;case 1:return s<c.length?Gs(l=c[s])||!n&&(16777216&l.flags||48&e.getCheckFlags(l))?[3,5]:(u=dl(t,l.escapedName))?[3,3]:[4,l]:[3,6];case 2:return o.sent(),[3,5];case 3:return i&&109440&(_=ds(l)).flags?1&(d=ds(u)).flags||Rd(d)===Rd(_)?[3,5]:[4,l]:[3,5];case 4:o.sent(),o.label=5;case 5:return s++,[3,1];case 6:return [2]}}))}function Wg(e,t,r,n){var i=qg(e,t,r,n).next();if(!i.done)return i.value}function Hg(e){return e.candidates?b_(e.candidates,2):e.contraCandidates?N_(e.contraCandidates):void 0}function Gg(e){return !!di(e).skipDirectInference}function Qg(t){return !(!t.symbol||!e.some(t.symbol.declarations,Gg))}function Xg(e,t){if(""===e)return !1;var r=+e;return isFinite(r)&&(!t||""+r===e)}function Yg(t,r){if(""===t)return !1;var n=e.createScanner(99,!1),i=!0;n.setOnError((function(){return i=!1})),n.setText(t+"n");var a=n.scan(),o=40===a;o&&(a=n.scan());var s=n.getTokenFlags();return i&&9===a&&n.getTextPos()===t.length+1&&!(512&s)&&(!r||t===e.pseudoBigIntToString({negative:o,base10Value:e.parsePseudoBigInt(n.getTokenValue())}))}function Zg(t,r){if(5&r.flags)return !0;if(134217728&r.flags)return Ip(t,r);if(268435456&r.flags){for(var n=[];268435456&r.flags;)n.unshift(r.symbol),r=r.type;return e.reduceLeft(n,(function(e,t){return q_(t,e)}),t)===t&&Zg(t,r)}return !1}function $g(t,r){return 128&t.flags?rm([t.value],e.emptyArray,r):134217728&t.flags?e.arraysEqual(t.texts,r.texts)?e.map(t.types,tm):rm(t.texts,t.types,r):void 0}function em(t,r){var n=$g(t,r);return !!n&&e.every(n,(function(e,t){return function(e,t){if(e===t||5&t.flags)return !0;if(128&e.flags){var r=e.value;return !!(8&t.flags&&Xg(r,!1)||64&t.flags&&Yg(r,!1)||98816&t.flags&&r===t.intrinsicName||268435456&t.flags&&Zg(jd(r),t))}if(134217728&e.flags){var n=e.texts;return 2===n.length&&""===n[0]&&""===n[1]&&Ip(e.types[0],t)}return Ip(e,t)}(e,r.types[t])}))}function tm(e){return 402653317&e.flags?e:K_(["",""],[e])}function rm(e,t,r){var i=e.length-1,a=e[0],o=e[i],s=r.texts,c=s.length-1,l=s[0],u=s[c];if(!(0===i&&a.length<l.length+u.length)&&a.startsWith(l)&&o.endsWith(u)){for(var _=o.slice(0,o.length-u.length),d=[],p=0,f=l.length,g=1;g<c;g++){var m=s[g];if(m.length>0){for(var y=p,v=f;!((v=h(y).indexOf(m,v))>=0);){if(++y===e.length)return;v=0;}b(y,v),f+=m.length;}else if(f<h(p).length)b(p,f+1);else {if(!(p<i))return;b(p+1,0);}}return b(i,h(i).length),d}function h(t){return t<i?e[t]:_}function b(r,i){var a=r===p?jd(h(r).slice(f,i)):K_(n$4(n$4([e[p].slice(f)],e.slice(p+1,r),!0),[h(r).slice(0,i)],!1),t.slice(p,r));d.push(a),p=r,f=i;}}function nm(t,r,n,i,a){void 0===i&&(i=0),void 0===a&&(a=!1);var o,s,c,l,u=!1,_=2048,d=!0,p=0;function f(r,s){if(jg(s)){if(r===Be){var c=o;return o=r,f(s,s),void(o=c)}if(r.aliasSymbol&&r.aliasSymbol===s.aliasSymbol)r.aliasTypeArguments&&v(r.aliasTypeArguments,s.aliasTypeArguments,gf(r.aliasSymbol));else if(r===s&&3145728&r.flags)for(var l=0,p=r.types;l<p.length;l++){var b=p[l];f(b,b);}else {if(1048576&s.flags){var S=y(1048576&r.flags?r.types:[r],s.types,im),E=y(S[0],S[1],am),k=E[0];if(0===(A=E[1]).length)return;if(s=b_(A),0===k.length)return void g(r,s,1);r=b_(k);}else if(2097152&s.flags&&e.some(s.types,(function(e){return !!x(e)||Lc(e)&&!!x(pp(e)||ct)}))){if(!(1048576&r.flags)){var N=y(2097152&r.flags?r.types:[r],s.types,Np),A=(k=N[0],N[1]);if(0===k.length||0===A.length)return;r=N_(k),s=N_(A);}}else 41943040&s.flags&&(s=fd(s));if(8650752&s.flags){if(Qg(r))return;var F=x(s);if(F){if(262144&e.getObjectFlags(r)||r===ze)return;if(!F.isFixed){if((void 0===F.priority||i<F.priority)&&(F.candidates=void 0,F.contraCandidates=void 0,F.topLevel=!0,F.priority=i),i===F.priority){var P=o||r;a&&!u?e.contains(F.contraCandidates,P)||(F.contraCandidates=e.append(F.contraCandidates,P),Og(t)):e.contains(F.candidates,P)||(F.candidates=e.append(F.candidates,P),Og(t));}!(128&i)&&262144&s.flags&&F.topLevel&&!zg(n,s)&&(F.topLevel=!1,Og(t));}return void(_=Math.min(_,i))}var w=ad(s,!1);if(w!==s)f(r,w);else if(8388608&s.flags){var I=ad(s.indexType,!1);if(465829888&I.flags){var O=od(ad(s.objectType,!1),I,!1);O&&O!==s&&f(r,O);}}}if(!(4&e.getObjectFlags(r)&&4&e.getObjectFlags(s)&&(r.target===s.target||If(r)&&If(s)))||r.node&&s.node)if(4194304&r.flags&&4194304&s.flags)h(r.type,s.type);else if((Hf(r)||4&r.flags)&&4194304&s.flags){var M=function(t){var r=e.createSymbolTable();Qm(t,(function(t){if(128&t.flags){var n=e.escapeLeadingUnderscores(t.value),i=ri(4,n);i.type=Le,t.symbol&&(i.declarations=t.symbol.declarations,i.valueDeclaration=t.symbol.valueDeclaration),r.set(n,i);}}));var n=4&t.flags?[eu(Ye,Ct,!1)]:e.emptyArray;return Ja(void 0,r,e.emptyArray,e.emptyArray,n)}(r);!function(e,t,r){var n=i;i|=256,h(e,t),i=n;}(M,s.type);}else if(8388608&r.flags&&8388608&s.flags)f(r.objectType,s.objectType),f(r.indexType,s.indexType);else if(268435456&r.flags&&268435456&s.flags)r.symbol===s.symbol&&f(r.type,s.type);else if(33554432&r.flags)f(r.baseType,s),g(Tu(r),s,4);else if(16777216&s.flags)m(r,s,T);else if(3145728&s.flags)D(r,s.types,s.flags);else if(1048576&r.flags)for(var L=0,R=r.types;L<R.length;L++)f(R[L],s);else if(134217728&s.flags)!function(t,r){var n=$g(t,r),i=r.types;if(n||e.every(r.texts,(function(e){return 0===e.length})))for(var a=function(t){var r=n?n[t]:ct,a=i[t];if(128&r.flags&&8650752&a.flags){var o=x(a),s=o?Gc(o.typeParameter):void 0;if(s&&!Co(s)){var c=1048576&s.flags?s.types:[s],l=e.reduceLeft(c,(function(e,t){return e|t.flags}),0);if(!(4&l)){var u=r.value;296&l&&!Xg(u,!0)&&(l&=-297),2112&l&&!Yg(u,!0)&&(l&=-2113);var _=e.reduceLeft(c,(function(t,n){return n.flags&l?4&t.flags?t:4&n.flags?r:134217728&t.flags?t:134217728&n.flags&&em(r,n)?r:268435456&t.flags?t:268435456&n.flags&&u===W_(n.symbol,u)?r:128&t.flags?t:128&n.flags&&n.value===u?n:8&t.flags?t:8&n.flags?Jd(+u):32&t.flags?t:32&n.flags?Jd(+u):256&t.flags?t:256&n.flags&&n.value===+u?n:64&t.flags?t:64&n.flags?zd({negative:a=(i=u).startsWith("-"),base10Value:e.parsePseudoBigInt("".concat(a?i.slice(1):i,"n"))}):2048&t.flags?t:2048&n.flags&&e.pseudoBigIntToString(n.value)===u?n:16&t.flags?t:16&n.flags?"true"===u?rt:"false"===u?et:at:512&t.flags?t:512&n.flags&&n.intrinsicName===u?n:32768&t.flags?t:32768&n.flags&&n.intrinsicName===u?n:65536&t.flags?t:65536&n.flags&&n.intrinsicName===u?n:t:t;var i,a;}),ct);if(!(131072&_.flags))return f(_,a),"continue"}}}f(r,a);},o=0;o<i.length;o++)a(o);}(r,s);else {if(r=sl(r),!(512&i&&467927040&r.flags)){var B=rl(r);if(B!==r&&d&&!(2621440&B.flags))return d=!1,f(B,s);r=B;}2621440&r.flags&&m(r,s,C);}else v(fu(r),fu(s),ff(r.target));}}}function g(e,t,r){var n=i;i|=r,f(e,t),i=n;}function m(t,r,n){var i=t.id+","+r.id,a=s&&s.get(i);if(void 0===a){(s||(s=new e.Map)).set(i,-1);var o=_;_=2048;var u=p,d=Nf(t),f=Nf(r);e.contains(c,d)&&(p|=1),e.contains(l,f)&&(p|=2),3!==p?((c||(c=[])).push(d),(l||(l=[])).push(f),n(t,r),l.pop(),c.pop()):_=-1,p=u,s.set(i,_),_=Math.min(_,o);}else _=Math.min(_,a);}function y(t,r,n){for(var i,a,o=0,s=r;o<s.length;o++)for(var c=s[o],l=0,u=t;l<u.length;l++){var _=u[l];n(_,c)&&(f(_,c),i=e.appendIfUnique(i,_),a=e.appendIfUnique(a,c));}return [i?e.filter(t,(function(t){return !e.contains(i,t)})):t,a?e.filter(r,(function(t){return !e.contains(a,t)})):r]}function v(e,t,r){for(var n=e.length<t.length?e.length:t.length,i=0;i<n;i++)i<r.length&&2==(7&r[i])?h(e[i],t[i]):f(e[i],t[i]);}function h(e,t){a=!a,f(e,t),a=!a;}function b(e,t){Q||1024&i?h(e,t):f(e,t);}function x(e){if(8650752&e.flags)for(var r=0,n=t;r<n.length;r++){var i=n[r];if(e===i.typeParameter)return i}}function D(t,r,n){var a=0;if(1048576&n){for(var o=void 0,s=1048576&t.flags?t.types:[t],c=new Array(s.length),l=!1,u=0,d=r;u<d.length;u++)if(x(T=d[u]))o=T,a++;else for(var p=0;p<s.length;p++){var m=_;_=2048,f(s[p],T),_===i&&(c[p]=!0),l=l||-1===_,_=Math.min(_,m);}if(0===a){var y=function(t){for(var r,n=0,i=t;n<i.length;n++){var a=i[n],o=2097152&a.flags&&e.find(a.types,(function(e){return !!x(e)}));if(!o||r&&o!==r)return;r=o;}return r}(r);return void(y&&g(t,y,1))}if(1===a&&!l){var v=e.flatMap(s,(function(e,t){return c[t]?void 0:e}));if(v.length)return void f(b_(v),o)}}else for(var h=0,b=r;h<b.length;h++)x(T=b[h])?a++:f(t,T);if(2097152&n?1===a:a>0)for(var D=0,S=r;D<S.length;D++){var T;x(T=S[D])&&g(t,T,1);}}function S(t,r,n){if(1048576&n.flags){for(var i=!1,a=0,o=n.types;a<o.length;a++)i=S(t,r,o[a])||i;return i}if(4194304&n.flags){var s=x(n.type);if(s&&!s.isFixed&&!Qg(t)){var c=Ug(t,r,n);c&&g(c,s.typeParameter,262144&e.getObjectFlags(t)?16:8);}return !0}if(262144&n.flags){g(z_(t),n,32);var l=Uc(n);if(l&&S(t,r,l))return !0;var u=e.map(zc(t),ds),_=e.map(hl(t),(function(e){return e!==Vr?e.type:ct}));return f(b_(e.concatenate(u,_)),Ac(r)),!0}return !1}function T(e,t){16777216&e.flags?(f(e.checkType,t.checkType),f(e.extendsType,t.extendsType),f(bd(e),bd(t)),f(xd(e),xd(t))):function(e,t,r,n){var a=i;i|=n,D(e,t,r),i=a;}(e,[bd(t),xd(t)],t.flags,a?64:0);}function C(t,r){if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&(t.target===r.target||If(t)&&If(r)))v(fu(t),fu(r),ff(t.target));else {if(Lc(t)&&Lc(r)){f(kc(t),kc(r)),f(Ac(t),Ac(r));var n=Nc(t),i=Nc(r);n&&i&&f(n,i);}var a,o;if(32&e.getObjectFlags(r)&&!r.declaration.nameType&&S(t,r,kc(r)))return;if(!function(e,t){return $f(e)&&$f(t)?function(e,t){return !(8&t.target.combinedFlags)&&t.target.minLength>e.target.minLength||!t.target.hasRestElement&&(e.target.hasRestElement||t.target.fixedLength<e.target.fixedLength)}(e,t):!!Wg(e,t,!1,!0)&&!!Wg(t,e,!1,!1)}(t,r)){if(Mf(t)){if($f(r)){var s=gu(t),c=gu(r),l=fu(r),u=r.target.elementFlags;if($f(t)&&(o=r,gu(a=t)===gu(o)&&e.every(a.target.elementFlags,(function(e,t){return (12&e)==(12&o.target.elementFlags[t])})))){for(var _=0;_<c;_++)f(fu(t)[_],l[_]);return}var d=$f(t)?Math.min(t.target.fixedLength,r.target.fixedLength):0,p=Math.min($f(t)?d_(t.target,3):0,r.target.hasRestElement?d_(r.target,3):0);for(_=0;_<d;_++)f(fu(t)[_],l[_]);if(!$f(t)||s-d-p==1&&4&t.target.elementFlags[d]){var m=fu(t)[d];for(_=d;_<c-p;_++)f(8&u[_]?$u(m):m,l[_]);}else {var y=c-d-p;if(2===y&&u[d]&u[d+1]&8&&$f(t)){var h=x(l[d]);h&&void 0!==h.impliedArity&&(f(l_(t,d,p+s-h.impliedArity),l[d]),f(l_(t,d+h.impliedArity,p),l[d+1]));}else if(1===y&&8&u[d]){var b=2&r.target.elementFlags[c-1];g($f(t)?l_(t,d,p):$u(fu(t)[0]),l[d],b?2:0);}else 1===y&&4&u[d]&&(m=$f(t)?ng(t,d,p):fu(t)[0])&&f(m,l[d]);}for(_=0;_<p;_++)f(fu(t)[s-_-1],l[c-_-1]);return}if(If(r))return void N(t,r)}!function(t,r){for(var n=0,i=Bc(r);n<i.length;n++){var a=i[n],o=dl(t,a.escapedName);o&&!e.some(o.declarations,Gg)&&f(ds(o),ds(a));}}(t,r),E(t,r,0),E(t,r,1),N(t,r);}}}function E(e,t,r){for(var n=fl(e,r),i=fl(t,r),a=n.length,o=i.length,s=a<o?a:o,c=0;c<s;c++)k(Xl(n[a-s+c]),Ql(i[o-s+c]));}function k(e,t){var r=u,n=t.declaration?t.declaration.kind:0;u=u||171===n||170===n||173===n,Fg(e,t,b),u=r,Pg(e,t,f);}function N(t,r){var n=e.getObjectFlags(t)&e.getObjectFlags(r)&32?8:0,i=hl(r);if(yg(t))for(var a=0,o=i;a<o.length;a++){for(var s=o[a],c=[],l=0,u=zc(t);l<u.length;l++){var _=u[l];if(yl(L_(_,8576),s.keyType)){var d=ds(_);c.push(16777216&_.flags?mg(d):d);}}for(var p=0,f=hl(t);p<f.length;p++){var m=f[p];yl(m.keyType,s.keyType)&&c.push(m.type);}c.length&&g(b_(c),s.type,n);}for(var y=0,v=i;y<v.length;y++){var h=Sl(t,(s=v[y]).keyType);h&&g(h.type,s.type,n);}}f(r,n);}function im(e,t){return ne&&t===Ge?e===t:Np(e,t)||!!(4&t.flags&&128&e.flags||8&t.flags&&256&e.flags)}function am(e,t){return !!(524288&e.flags&&524288&t.flags&&e.symbol&&e.symbol===t.symbol||e.aliasSymbol&&e.aliasTypeArguments&&e.aliasSymbol===t.aliasSymbol)}function om(t){return !!(128&e.getObjectFlags(t))}function sm(t){return !!(16512&e.getObjectFlags(t))}function cm(t,r){var n,i,a=t.inferences[r];if(!a.inferredType){var o=void 0,s=t.signature;if(s){var c=a.candidates?function(t,r){var n,i=function(t){if(t.length>1){var r=e.filter(t,sm);if(r.length){var n=b_(r,2);return e.concatenate(e.filter(t,(function(e){return !sm(e)})),[n])}}return t}(t.candidates),a=!!(n=Kc(t.typeParameter))&&vx(16777216&n.flags?qc(n):n,406978556),o=!a&&t.topLevel&&(t.isFixed||!zg(Ul(r),t.typeParameter)),s=a?e.sameMap(i,Rd):o?e.sameMap(i,Qf):i;return Cg(416&t.priority?b_(s,2):wf(s))}(a,s):void 0;if(a.contraCandidates)o=!c||131072&c.flags||!e.some(a.contraCandidates,(function(e){return wp(c,e)}))?function(t){return 416&t.priority?N_(t.contraCandidates):(r=t.contraCandidates,e.reduceLeft(r,(function(e,t){return wp(t,e)?t:e})));var r;}(a):c;else if(c)o=c;else if(1&t.flags)o=lt;else {var l=$c(a.typeParameter);l&&(o=hp(l,(n=function(t,r){var n=t.inferences.slice(r);return $d(e.map(n,(function(e){return e.typeParameter})),e.map(n,(function(){return Ke})))}(t,r),i=t.nonFixingMapper,n?ip(5,n,i):i)));}}else o=Hg(a);a.inferredType=o||lm(!!(2&t.flags));var u=Kc(a.typeParameter);if(u){var _=hp(u,t.nonFixingMapper);o&&t.compareTypes(o,oc(_,o))||(a.inferredType=o=_);}}return a.inferredType}function lm(e){return e?Le:Ke}function um(e){for(var t=[],r=0;r<e.inferences.length;r++)t.push(cm(e,r));return t}function _m(t){switch(t.escapedText){case"document":case"console":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;case"$":return K.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;case"describe":case"suite":case"it":case"test":return K.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;case"process":case"require":case"Buffer":case"module":return K.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;case"Map":case"Set":case"Promise":case"Symbol":case"WeakMap":case"WeakSet":case"Iterator":case"AsyncIterator":case"SharedArrayBuffer":case"Atomics":case"AsyncIterable":case"AsyncIterableIterator":case"AsyncGenerator":case"AsyncGeneratorFunction":case"BigInt":case"Reflect":case"BigInt64Array":case"BigUint64Array":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;case"await":if(e.isCallExpression(t.parent))return e.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;default:return 300===t.parent.kind?e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:e.Diagnostics.Cannot_find_name_0}}function dm(t){var r=di(t);return r.resolvedSymbol||(r.resolvedSymbol=!e.nodeIsMissing(t)&&vi(t,t.escapedText,1160127,_m(t),t,!e.isWriteOnlyAccess(t),!1)||we),r.resolvedSymbol}function pm(t){return !!e.findAncestor(t,(function(e){return 183===e.kind||79!==e.kind&&163!==e.kind&&"quit"}))}function fm(t,r,n,i){switch(t.kind){case 79:if(!e.isThisInTypeQuery(t)){var a=dm(t);return a!==we?"".concat(i?I(i):"-1","|").concat(p_(r),"|").concat(p_(n),"|").concat(O(a)):void 0}case 108:return "0|".concat(i?I(i):"-1","|").concat(p_(r),"|").concat(p_(n));case 232:case 214:return fm(t.expression,r,n,i);case 163:var o=fm(t.left,r,n,i);return o&&o+"."+t.right.escapedText;case 208:case 209:var s=mm(t);if(void 0!==s){var c=fm(t.expression,r,n,i);return c&&c+"."+s}break;case 203:case 204:case 259:case 215:case 216:case 171:return "".concat(I(t),"#").concat(p_(r))}}function gm(t,r){switch(r.kind){case 214:case 232:return gm(t,r.expression);case 223:return e.isAssignmentExpression(r)&&gm(t,r.left)||e.isBinaryExpression(r)&&27===r.operatorToken.kind&&gm(t,r.right)}switch(t.kind){case 233:return 233===r.kind&&t.keywordToken===r.keywordToken&&t.name.escapedText===r.name.escapedText;case 79:case 80:return e.isThisInTypeQuery(t)?108===r.kind:79===r.kind&&dm(t)===dm(r)||(257===r.kind||205===r.kind)&&Na(dm(t))===Da(r);case 108:return 108===r.kind;case 106:return 106===r.kind;case 232:case 214:return gm(t.expression,r);case 208:case 209:var n=mm(t),i=e.isAccessExpression(r)?mm(r):void 0;return void 0!==n&&void 0!==i&&i===n&&gm(t.expression,r.expression);case 163:return e.isAccessExpression(r)&&t.right.escapedText===mm(r)&&gm(t.left,r.expression);case 223:return e.isBinaryExpression(t)&&27===t.operatorToken.kind&&gm(t.right,r)}return !1}function mm(t){if(e.isPropertyAccessExpression(t))return t.name.escapedText;if(e.isElementAccessExpression(t))return function(t){if(e.isStringOrNumericLiteralLike(t.argumentExpression))return e.escapeLeadingUnderscores(t.argumentExpression.text);if(e.isEntityNameExpression(t.argumentExpression)){var r=ia(t.argumentExpression,111551,!0);if(!r||!(Ey(r)||8&r.flags))return;var n=r.valueDeclaration;if(void 0===n)return;var i=ts(n);if(i){var a=ym(i);if(void 0!==a)return a}if(e.hasOnlyExpressionInitializer(n)&&gi(n,t.argumentExpression)){var o=e.getEffectiveInitializer(n);if(o)return ym(Qx(o));if(e.isEnumMember(n))return e.getTextOfPropertyName(n.name)}}}(t);if(e.isBindingElement(t)){var r=Io(t);return r?e.escapeLeadingUnderscores(r):void 0}return e.isParameter(t)?""+t.parent.parameters.indexOf(t):void 0}function ym(t){return 8192&t.flags?t.escapedName:384&t.flags?e.escapeLeadingUnderscores(""+t.value):void 0}function vm(t,r){for(;e.isAccessExpression(t);)if(gm(t=t.expression,r))return !0;return !1}function hm(t,r){for(;e.isOptionalChain(t);)if(gm(t=t.expression,r))return !0;return !1}function bm(t,r){if(t&&1048576&t.flags){var n=al(t,r);if(n&&2&e.getCheckFlags(n))return void 0===n.isDiscriminantProperty&&(n.isDiscriminantProperty=192==(192&n.checkFlags)&&!td(ds(n))),!!n.isDiscriminantProperty}return !1}function xm(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(bm(t,a.escapedName)){if(r){r.push(a);continue}r=[a];}}return r}function Dm(t){var r=t.types;if(!(r.length<10||32768&e.getObjectFlags(t)||e.countWhere(r,(function(e){return !!(59506688&e.flags)}))<10)){if(void 0===t.keyPropertyName){var n=e.forEach(r,(function(t){return 59506688&t.flags?e.forEach(zc(t),(function(e){return qf(ds(e))?e.escapedName:void 0})):void 0})),i=n&&function(t,r){for(var n=new e.Map,i=0,a=function(e){if(61603840&e.flags){var t=To(e,r);if(t){if(!Hf(t))return {value:void 0};var a=!1;Qm(t,(function(t){var r=p_(Rd(t)),i=n.get(r);i?i!==Ke&&(n.set(r,Ke),a=!0):n.set(r,e);})),a||i++;}}},o=0,s=t;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return i>=10&&2*i>=t.length?n:void 0}(r,n);t.keyPropertyName=i?n:"",t.constituentMap=i;}return t.keyPropertyName.length?t.keyPropertyName:void 0}}function Sm(e,t){var r,n=null===(r=e.constituentMap)||void 0===r?void 0:r.get(p_(Rd(t)));return n!==Ke?n:void 0}function Tm(e,t){var r=Dm(e),n=r&&To(t,r);return n&&Sm(e,n)}function Cm(e,t){return gm(e,t)||vm(e,t)}function Em(e,t){if(e.arguments)for(var r=0,n=e.arguments;r<n.length;r++)if(Cm(t,n[r]))return !0;return !(208!==e.expression.kind||!Cm(t,e.expression.expression))}function km(e){return (!e.id||e.id<0)&&(e.id=p,p++),e.id}function Nm(e){var t=Rc(e);return !!(t.callSignatures.length||t.constructSignatures.length||t.members.get("bind")&&wp(e,Wt))}function Am(t){467927040&t.flags&&(t=Gc(t)||Ke);var r=t.flags;if(268435460&r)return G?16317953:16776705;if(134217856&r){var n=128&r&&""===t.value;return G?n?12123649:7929345:n?12582401:16776705}if(40&r)return G?16317698:16776450;if(256&r){var i=0===t.value;return G?i?12123394:7929090:i?12582146:16776450}return 64&r?G?16317188:16775940:2048&r?(i=ig(t),G?i?12122884:7928580:i?12581636:16775940):16&r?G?16316168:16774920:528&r?G?t===et||t===tt?12121864:7927560:t===et||t===tt?12580616:16774920:524288&r?16&e.getObjectFlags(t)&&Xp(t)?G?83427327:83886079:Nm(t)?G?7880640:16728e3:G?7888800:16736160:16384&r?9830144:32768&r?26607360:65536&r?42917664:12288&r?G?7925520:16772880:67108864&r?G?7888800:16736160:131072&r?0:1048576&r?e.reduceLeft(t.types,(function(e,t){return e|Am(t)}),0):2097152&r?function(e){for(var t=vx(e,131068),r=0,n=134217727,i=0,a=e.types;i<a.length;i++){var o=a[i];if(!(t&&524288&o.flags)){var s=Am(o);r|=s,n&=s;}}return 8256&r|134209471&n}(t):83886079}function Fm(e,t){return Zm(e,(function(e){return 0!=(Am(e)&t)}))}function Pm(e,t){var r=wm(Fm(G&&2&e.flags?Ft:e,t));if(G)switch(t){case 524288:return ty(r,(function(e){return 65536&Am(e)?N_([e,131072&Am(e)&&!vx(r,65536)?b_([Ct,Qe]):Ct]):e}));case 1048576:return ty(r,(function(e){return 131072&Am(e)?N_([e,65536&Am(e)&&!vx(r,32768)?b_([Ct,qe]):Ct]):e}));case 2097152:case 4194304:return ty(r,(function(e){return 262144&Am(e)?function(e){return ar||(ar=Ru("NonNullable",524288,void 0)||we),ar!==we?yu(ar,[e]):N_([e,Ct])}(e):e}))}return r}function wm(e){return e===Ft?Ke:e}function Im(e,t){return t?b_([Fo(e),Qx(t)]):e}function Om(e,t){var r,n=M_(t);if(!Xs(n))return je;var i=tc(n);return To(e,i)||Lm(null===(r=Tl(e,i))||void 0===r?void 0:r.type)||je}function Mm(e,t){return Ym(e,Uf)&&function(e,t){return To(e,""+t)||(Ym(e,$f)?ty(e,(function(e){return rg(e)||qe})):void 0)}(e,t)||Lm(fS(65,e,qe,void 0))||je}function Lm(e){return e&&K.noUncheckedIndexedAccess?b_([e,qe]):e}function Rm(e){return $u(fS(65,e,qe,void 0)||je)}function Bm(e){return 223===e.parent.kind&&e.parent.left===e||247===e.parent.kind&&e.parent.initializer===e}function jm(e){return Om(Jm(e.parent),e.name)}function Jm(e){var t=e.parent;switch(t.kind){case 246:return Ye;case 247:return pS(t)||je;case 223:return function(e){return 206===e.parent.kind&&Bm(e.parent)||299===e.parent.kind&&Bm(e.parent.parent)?Im(Jm(e),e.right):Qx(e.right)}(t);case 217:return qe;case 206:return function(e,t){return Mm(Jm(e),e.elements.indexOf(t))}(t,e);case 227:return function(e){return Rm(Jm(e.parent))}(t);case 299:return jm(t);case 300:return function(e){return Im(jm(e),e.objectAssignmentInitializer)}(t)}return je}function zm(e){return di(e).resolvedType||Qx(e)}function Um(e){return 257===e.kind?function(e){return e.initializer?zm(e.initializer):246===e.parent.parent.kind?Ye:247===e.parent.parent.kind&&pS(e.parent.parent)||je}(e):function(e){var t=e.parent,r=Um(t.parent);return Im(203===t.kind?Om(r,e.propertyName||e.name):e.dotDotDotToken?Rm(r):Mm(r,t.elements.indexOf(e)),e.initializer)}(e)}function Km(e){switch(e.kind){case 214:return Km(e.expression);case 223:switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return Km(e.left);case 27:return Km(e.right)}}return e}function Vm(e){var t=e.parent;return 214===t.kind||223===t.kind&&63===t.operatorToken.kind&&t.left===e||223===t.kind&&27===t.operatorToken.kind&&t.right===e?Vm(t):e}function qm(e){return 292===e.kind?Rd(Qx(e.expression)):ct}function Wm(e){var t=di(e);if(!t.switchTypes){t.switchTypes=[];for(var r=0,n=e.caseBlock.clauses;r<n.length;r++){var i=n[r];t.switchTypes.push(qm(i));}}return t.switchTypes}function Hm(t){if(!e.some(t.caseBlock.clauses,(function(t){return 292===t.kind&&!e.isStringLiteralLike(t.expression)}))){for(var r=[],n=0,i=t.caseBlock.clauses;n<i.length;n++){var a=i[n],o=292===a.kind?a.expression.text:void 0;r.push(o&&!e.contains(r,o)?o:void 0);}return r}}function Gm(e,t){return e===t||1048576&t.flags&&function(e,t){if(1048576&e.flags){for(var r=0,n=e.types;r<n.length;r++){var i=n[r];if(!f_(t.types,i))return !1}return !0}return !!(1024&e.flags&&Ls(e)===t)||f_(t.types,e)}(e,t)}function Qm(t,r){return 1048576&t.flags?e.forEach(t.types,r):r(t)}function Xm(t,r){return 1048576&t.flags?e.some(t.types,r):r(t)}function Ym(t,r){return 1048576&t.flags?e.every(t.types,r):r(t)}function Zm(t,r){if(1048576&t.flags){var n=t.types,i=e.filter(n,r);if(i===n)return t;var a=t.origin,o=void 0;if(a&&1048576&a.flags){var s=a.types,c=e.filter(s,(function(e){return !!(1048576&e.flags)||r(e)}));if(s.length-c.length==n.length-i.length){if(1===c.length)return c[0];o=h_(1048576,c);}}return D_(i,t.objectFlags,void 0,void 0,o)}return 131072&t.flags||r(t)?t:ct}function $m(e,t){return Zm(e,(function(e){return e!==t}))}function ey(e){return 1048576&e.flags?e.types.length:1}function ty(e,t,r){if(131072&e.flags)return e;if(!(1048576&e.flags))return t(e);for(var n,i=e.origin,a=!1,o=0,s=i&&1048576&i.flags?i.types:e.types;o<s.length;o++){var c=s[o],l=1048576&c.flags?ty(c,t,r):t(c);a||(a=c!==l),l&&(n?n.push(l):n=[l]);}return a?n&&b_(n,r?0:1):e}function ry(t,r,n,i){return 1048576&t.flags&&n?b_(e.map(t.types,r),1,n,i):ty(t,r)}function ny(e,t){return Zm(e,(function(e){return 0!=(e.flags&t)}))}function iy(e,t){return vx(e,134217804)&&vx(t,402655616)?ty(e,(function(e){return 4&e.flags?ny(t,402653316):ed(e)&&!vx(t,402653188)?ny(t,128):8&e.flags?ny(t,264):64&e.flags?ny(t,2112):e})):e}function ay(e){return 0===e.flags}function oy(e){return 0===e.flags?e.type:e}function sy(e,t){return t?{flags:0,type:131072&e.flags?lt:e}:e}function cy(e){return Ae[e.id]||(Ae[e.id]=function(e){var t=Oa(256);return t.elementType=e,t}(e))}function ly(e,t){var r=hg(Gf(Yx(t)));return Gm(r,e.elementType)?e:cy(b_([e.elementType,r]))}function uy(t){return 256&e.getObjectFlags(t)?(r=t).finalArrayType||(r.finalArrayType=131072&(n=r.elementType).flags?nr:$u(1048576&n.flags?b_(n.types,2):n)):t;var r,n;}function _y(t){return 256&e.getObjectFlags(t)?t.elementType:ct}function dy(t){var r=Vm(t),n=r.parent,i=e.isPropertyAccessExpression(n)&&("length"===n.name.escapedText||210===n.parent.kind&&e.isIdentifier(n.name)&&e.isPushOrUnshiftIdentifier(n.name)),a=209===n.kind&&n.expression===r&&223===n.parent.kind&&63===n.parent.operatorToken.kind&&n.parent.left===n&&!e.isAssignmentTarget(n.parent)&&hx(Qx(n.argumentExpression),296);return i||a}function py(t,r){if(8752&(t=Gi(t)).flags)return ds(t);if(7&t.flags){if(262144&e.getCheckFlags(t)){var n=t.syntheticOrigin;if(n&&py(n))return ds(t)}var i=t.valueDeclaration;if(i){if(s=i,(e.isVariableDeclaration(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isParameter(s))&&(e.getEffectiveTypeAnnotationNode(s)||e.isInJSFile(s)&&e.hasInitializer(s)&&s.initializer&&e.isFunctionExpressionOrArrowFunction(s.initializer)&&e.getEffectiveReturnTypeNode(s.initializer)))return ds(t);if(e.isVariableDeclaration(i)&&247===i.parent.parent.kind){var a=i.parent.parent,o=fy(a.expression,void 0);if(o)return fS(a.awaitModifier?15:13,o,qe,void 0)}r&&e.addRelatedInfo(r,e.createDiagnosticForNode(i,e.Diagnostics._0_needs_an_explicit_type_annotation,ro(t)));}}var s;}function fy(t,r){if(!(33554432&t.flags))switch(t.kind){case 79:return py(Na(dm(t)),r);case 108:return function(t){var r=e.getThisContainer(t,!1);if(e.isFunctionLike(r)){var n=Ol(r);if(n.thisParameter)return py(n.thisParameter)}if(e.isClassLike(r.parent)){var i=Da(r.parent);return e.isStatic(r)?ds(i):Js(i).thisType}}(t);case 106:return Jy(t);case 208:var n=fy(t.expression,r);if(n){var i=t.name,a=void 0;if(e.isPrivateIdentifier(i)){if(!n.symbol)return;a=dl(n,e.getSymbolNameForPrivateIdentifier(n.symbol,i.escapedText));}else a=dl(n,i.escapedText);return a&&py(a,r)}return;case 214:return fy(t.expression,r)}}function gy(t){var r=di(t),n=r.effectsSignature;if(void 0===n){var i=void 0;241===t.parent.kind?i=fy(t.expression,void 0):106!==t.expression.kind&&(i=e.isOptionalChain(t)?th(pg(Zx(t.expression),t.expression),t.expression):Qv(t.expression));var a=fl(i&&rl(i)||Ke,0),o=1!==a.length||a[0].typeParameters?e.some(a,my)?hb(t):void 0:a[0];n=r.effectsSignature=o&&my(o)?o:zr;}return n===zr?void 0:n}function my(e){return !!(Jl(e)||e.declaration&&131072&(Kl(e.declaration)||Ke).flags)}function yy(e){var t=hy(e,!1);return Or=e,Mr=t,t}function vy(t){var r=e.skipParentheses(t,!0);return 95===r.kind||223===r.kind&&(55===r.operatorToken.kind&&(vy(r.left)||vy(r.right))||56===r.operatorToken.kind&&vy(r.left)&&vy(r.right))}function hy(t,r){for(;;){if(t===Or)return Mr;var n=t.flags;if(4096&n){if(!r){var i=km(t),a=Sn[i];return void 0!==a?a:Sn[i]=hy(t,!0)}r=!1;}if(368&n)t=t.antecedent;else if(512&n){var o=gy(t.node);if(o){var s=Jl(o);if(s&&3===s.kind&&!s.type){var c=t.node.arguments[s.parameterIndex];if(c&&vy(c))return !1}if(131072&Ul(o).flags)return !1}t=t.antecedent;}else {if(4&n)return e.some(t.antecedents,(function(e){return hy(e,!1)}));if(8&n){var l=t.antecedents;if(void 0===l||0===l.length)return !1;t=l[0];}else {if(!(128&n)){if(1024&n){Or=void 0;var u=t.target,_=u.antecedents;u.antecedents=t.antecedents;var d=hy(t.antecedent,!1);return u.antecedents=_,d}return !(1&n)}if(t.clauseStart===t.clauseEnd&&ox(t.switchStatement))return !1;t=t.antecedent;}}}}function by(t,r){for(;;){var n=t.flags;if(4096&n){if(!r){var i=km(t),a=Tn[i];return void 0!==a?a:Tn[i]=by(t,!0)}r=!1;}if(496&n)t=t.antecedent;else if(512&n){if(106===t.node.expression.kind)return !0;t=t.antecedent;}else {if(4&n)return e.every(t.antecedents,(function(e){return by(e,!1)}));if(!(8&n)){if(1024&n){var o=t.target,s=o.antecedents;o.antecedents=t.antecedents;var c=by(t.antecedent,!1);return o.antecedents=s,c}return !!(1&n)}t=t.antecedents[0];}}}function xy(t){switch(t.kind){case 79:var r=dm(t);return Ey(r)||e.isParameterOrCatchClauseVariable(r)&&!Ty(r);case 208:case 209:return xy(t.expression)&&px(di(t).resolvedSymbol||we)}return !1}function Dy(t,r,n,i,a){var o;void 0===n&&(n=r),void 0===a&&(a=t.flowNode);var s=!1,c=0;if(an)return je;if(!a)return r;on++;var l=nn,u=oy(p(a));nn=l;var _=256&e.getObjectFlags(u)&&dy(t)?nr:uy(u);return _===_t||t.parent&&232===t.parent.kind&&!(131072&_.flags)&&131072&Fm(_,2097152).flags?r:_===Ve?Ke:_;function d(){return s?o:(s=!0,o=fm(t,r,n,i))}function p(a){if(2e3===c)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","getTypeAtFlowNode_DepthLimit",{flowId:a.id}),an=!0,o=t,s=e.findAncestor(o,e.isFunctionOrModuleBlock),u=e.getSourceFileOfNode(o),_=e.getSpanOfTokenAtPosition(u,s.statements.pos),Pn.add(e.createFileDiagnostic(u,_.start,_.length,e.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)),je;var o,s,u,_,d;for(c++;;){var f=a.flags;if(4096&f){for(var m=l;m<nn;m++)if(xn[m]===a)return c--,Dn[m];d=a;}var S=void 0;if(16&f){if(!(S=g(a))){a=a.antecedent;continue}}else if(512&f){if(!(S=y(a))){a=a.antecedent;continue}}else if(96&f)S=h(a);else if(128&f)S=b(a);else if(12&f){if(1===a.antecedents.length){a=a.antecedents[0];continue}S=4&f?x(a):D(a);}else if(256&f){if(!(S=v(a))){a=a.antecedent;continue}}else if(1024&f){var T=a.target,C=T.antecedents;T.antecedents=a.antecedents,S=p(a.antecedent),T.antecedents=C;}else if(2&f){var E=a.node;if(E&&E!==i&&208!==t.kind&&209!==t.kind&&108!==t.kind){a=E.flowNode;continue}S=n;}else S=nS(r);return d&&(xn[nn]=d,Dn[nn]=S,nn++),c--,S}}function f(e){var r=e.node;return Ay(257===r.kind||205===r.kind?Um(r):Jm(r),t)}function g(n){var i=n.node;if(gm(t,i)){if(!yy(n))return _t;if(2===e.getAssignmentTargetKind(i)){var a=p(n.antecedent);return sy(Gf(oy(a)),ay(a))}if(r===Re||r===nr){if(function(e){return 257===e.kind&&e.initializer&&Ro(e.initializer)||205!==e.kind&&223===e.parent.kind&&Ro(e.parent.right)}(i))return cy(ct);var o=Qf(f(n));return Ip(o,r)?o:rr}return 1048576&r.flags?function(e,t){var r;if(e===t)return e;if(131072&t.flags)return t;var n="A".concat(p_(e),",").concat(p_(t));return null!==(r=Un(n))&&void 0!==r?r:Kn(n,function(e,t){var r=Zm(e,(function(e){return function(e,t){if(!(1048576&e.flags))return Ip(e,t);for(var r=0,n=e.types;r<n.length;r++)if(Ip(n[r],t))return !0;return !1}(t,e)})),n=512&t.flags&&Bd(t)?ty(r,Ld):r;return Ip(t,n)?n:e}(e,t))}(r,f(n)):r}if(vm(t,i)){if(!yy(n))return _t;if(e.isVariableDeclaration(i)&&(e.isInJSFile(i)||e.isVarConst(i))){var s=e.getDeclaredExpandoInitializer(i);if(s&&(215===s.kind||216===s.kind))return p(n.antecedent)}return r}if(e.isVariableDeclaration(i)&&246===i.parent.parent.kind&&gm(t,i.parent.parent.expression))return Yv(uy(oy(p(n.antecedent))))}function m(t,r){var n=e.skipParentheses(r,!0);if(95===n.kind)return _t;if(223===n.kind){if(55===n.operatorToken.kind)return m(m(t,n.left),n.right);if(56===n.operatorToken.kind)return b_([m(t,n.left),m(t,n.right)])}return V(t,n,!0)}function y(e){var t=gy(e.node);if(t){var r=Jl(t);if(r&&(2===r.kind||3===r.kind)){var n=p(e.antecedent),i=uy(oy(n)),a=r.type?K(i,r,e.node,!0):3===r.kind&&r.parameterIndex>=0&&r.parameterIndex<e.node.arguments.length?m(i,e.node.arguments[r.parameterIndex]):i;return a===i?n:sy(a,ay(n))}if(131072&Ul(t).flags)return _t}}function v(n){if(r===Re||r===nr){var i=n.node,a=210===i.kind?i.expression.expression:i.left.expression;if(gm(t,Km(a))){var o=p(n.antecedent),s=oy(o);if(256&e.getObjectFlags(s)){var c=s;if(210===i.kind)for(var l=0,u=i.arguments;l<u.length;l++)c=ly(c,u[l]);else hx(Yx(i.left.argumentExpression),296)&&(c=ly(c,i.right));return c===s?o:sy(c,ay(o))}return o}}}function h(e){var t=p(e.antecedent),r=oy(t);if(131072&r.flags)return t;var n=0!=(32&e.flags),i=uy(r),a=V(i,e.node,n);return a===i?t:sy(a,ay(t))}function b(r){var n=r.switchStatement.expression,i=p(r.antecedent),a=oy(i);if(gm(t,n))a=R(a,r.switchStatement,r.clauseStart,r.clauseEnd);else if(218===n.kind&&gm(t,n.expression))a=function(t,r,n,i){var a=Hm(r);if(!a)return t;var o=e.findIndex(r.caseBlock.clauses,(function(e){return 293===e.kind}));if(n===i||o>=n&&o<i){var s=ax(n,i,a);return Zm(t,(function(e){return (Am(e)&s)===s}))}var c=a.slice(n,i);return b_(e.map(c,(function(e){return e?B(t,e):ct})))}(a,r.switchStatement,r.clauseStart,r.clauseEnd);else {G&&(hm(n,t)?a=L(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(163840&e.flags)})):218===n.kind&&hm(n.expression,t)&&(a=L(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(131072&e.flags||128&e.flags&&"undefined"===e.value)}))));var o=C(n,a);o&&(a=function(t,r,n,i,a){if(i<a&&1048576&t.flags&&Dm(t)===mm(r)){var o=Wm(n).slice(i,a),s=b_(e.map(o,(function(e){return Sm(t,e)||Ke})));if(s!==Ke)return s}return E(t,r,(function(e){return R(e,n,i,a)}))}(a,o,r.switchStatement,r.clauseStart,r.clauseEnd));}return sy(a,ay(i))}function x(t){for(var i,a=[],o=!1,s=!1,c=0,l=t.antecedents;c<l.length;c++){var u=l[c];if(!i&&128&u.flags&&u.clauseStart===u.clauseEnd)i=u;else {if((d=oy(_=p(u)))===r&&r===n)return d;e.pushIfUnique(a,d),Gm(d,r)||(o=!0),ay(_)&&(s=!0);}}if(i){var _,d=oy(_=p(i));if(!e.contains(a,d)&&!ox(i.switchStatement)){if(d===r&&r===n)return d;a.push(d),Gm(d,r)||(o=!0),ay(_)&&(s=!0);}}return sy(T(a,o?2:1),s)}function D(t){var n=km(t),i=yn[n]||(yn[n]=new e.Map),a=d();if(!a)return r;var o=i.get(a);if(o)return o;for(var s=tn;s<rn;s++)if(vn[s]===t&&hn[s]===a&&bn[s].length)return sy(T(bn[s],1),!0);for(var c,l=[],u=!1,_=0,f=t.antecedents;_<f.length;_++){var g=f[_],m=void 0;if(c){vn[rn]=t,hn[rn]=a,bn[rn]=l,rn++;var y=Lr;Lr=void 0,m=p(g),Lr=y,rn--;var v=i.get(a);if(v)return v}else m=c=p(g);var h=oy(m);if(e.pushIfUnique(l,h),Gm(h,r)||(u=!0),h===r)break}var b=T(l,u?2:1);return ay(c)?sy(b,!0):(i.set(a,b),b)}function T(t,n){if(function(t){for(var r=!1,n=0,i=t;n<i.length;n++){var a=i[n];if(!(131072&a.flags)){if(!(256&e.getObjectFlags(a)))return !1;r=!0;}}return r}(t))return cy(b_(e.map(t,_y)));var i=wm(b_(e.sameMap(t,uy),n));return i!==r&&i.flags&r.flags&1048576&&e.arraysEqual(i.types,r.types)?r:i}function C(n,i){var a=1048576&r.flags?r:i;if(1048576&a.flags){var o=function(r){if(e.isBindingPattern(t)||e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t)){if(e.isIdentifier(r)&&(i=(n=dm(r)).valueDeclaration)&&(e.isBindingElement(i)||e.isParameter(i))&&t===i.parent&&!i.initializer&&!i.dotDotDotToken)return i}else if(e.isAccessExpression(r)){if(gm(t,r.expression))return r}else if(e.isIdentifier(r)){var n;if(Ey(n=dm(r))){var i=n.valueDeclaration;if(e.isVariableDeclaration(i)&&!i.type&&i.initializer&&e.isAccessExpression(i.initializer)&&gm(t,i.initializer.expression))return i.initializer;if(e.isBindingElement(i)&&!i.initializer){var a=i.parent.parent;if(e.isVariableDeclaration(a)&&!a.type&&a.initializer&&(e.isIdentifier(a.initializer)||e.isAccessExpression(a.initializer))&&gm(t,a.initializer))return i}}}}(n);if(o){var s=mm(o);if(s&&bm(a,s))return o}}}function E(t,r,n){var i=mm(r);if(void 0===i)return t;var a=G&&e.isOptionalChain(r)&&vx(t,98304),o=To(a?Fm(t,2097152):t,i);if(!o)return t;var s=n(o=a?cg(o):o);return Zm(t,(function(e){var t=function(e,t){var r;return To(e,t)||(null===(r=Tl(e,t))||void 0===r?void 0:r.type)||Ke}(e,i);return !(131072&t.flags)&&!(131072&s.flags)&&Lp(s,t)}))}function N(e,t,r,n,i){if((36===r||37===r)&&1048576&e.flags){var a=Dm(e);if(a&&a===mm(t)){var o=Sm(e,Qx(n));if(o)return r===(i?36:37)?o:qf(To(o,a)||Ke)?$m(e,o):e}}return E(e,t,(function(e){return I(e,r,n,i)}))}function A(e,r,n){if(gm(t,r))return Pm(e,n?4194304:8388608);G&&n&&hm(r,t)&&(e=Pm(e,2097152));var i=C(r,e);return i?E(e,i,(function(e){return Fm(e,n?4194304:8388608)})):e}function F(e,t,r){var n=dl(e,t);return n?!!(16777216&n.flags)||r:!!Tl(e,t)||!r}function P(r,n,i){switch(n.operatorToken.kind){case 63:case 75:case 76:case 77:return A(V(r,n.right,i),n.left,i);case 34:case 35:case 36:case 37:var a=n.operatorToken.kind,o=Km(n.left),s=Km(n.right);if(218===o.kind&&e.isStringLiteralLike(s))return O(r,o,a,s,i);if(218===s.kind&&e.isStringLiteralLike(o))return O(r,s,a,o,i);if(gm(t,o))return I(r,a,s,i);if(gm(t,s))return I(r,a,o,i);G&&(hm(o,t)?r=w(r,a,s,i):hm(s,t)&&(r=w(r,a,o,i)));var c=C(o,r);if(c)return N(r,c,a,s,i);var l=C(s,r);if(l)return N(r,l,a,o,i);if(J(o))return z(r,a,s,i);if(J(s))return z(r,a,o,i);break;case 102:return function(r,n,i){var a=Km(n.left);if(!gm(t,a))return i&&G&&hm(a,t)?Pm(r,2097152):r;var o,s=Qx(n.right);if(!Op(s,Wt))return r;var c=dl(s,"prototype");if(c){var l=ds(c);Co(l)||(o=l);}if(Co(r)&&(o===qt||o===Wt))return r;if(!o){var u=fl(s,1);o=u.length?b_(e.map(u,(function(e){return Ul(Ql(e))}))):Ct;}return !i&&1048576&s.flags&&!e.find(s.types,(function(e){return !Ds(e)}))?r:U(r,o,i,!0)}(r,n,i);case 101:if(e.isPrivateIdentifier(n.left))return function(r,n,i){var a=Km(n.right);if(!gm(t,a))return r;e.Debug.assertNode(n.left,e.isPrivateIdentifier);var o=sh(n.left);if(void 0===o)return r;var s=o.parent;return U(r,e.hasStaticModifier(e.Debug.checkDefined(o.valueDeclaration,"should always have a declaration"))?ds(s):Js(s),i,!0)}(r,n,i);var u=Km(n.right),_=Qx(n.left);if(8576&_.flags){if(gg(r)&&e.isAccessExpression(t)&&gm(t.expression,u)&&mm(t)===tc(_))return Fm(r,i?524288:65536);if(gm(t,u))return function(e,t,r){var n=tc(t);if(Xm(e,(function(e){return F(e,n,!0)})))return Zm(e,(function(e){return F(e,n,r)}));if(r){var i=(Ir||(Ir=Lu("Record",2,!0)||we),Ir===we?void 0:Ir);if(i)return N_([e,yu(i,[t,Ke])])}return e}(r,_,i)}break;case 27:return V(r,n.right,i);case 55:return i?V(V(r,n.left,!0),n.right,!0):b_([V(r,n.left,!1),V(r,n.right,!1)]);case 56:return i?b_([V(r,n.left,!0),V(r,n.right,!0)]):V(V(r,n.left,!1),n.right,!1)}return r}function w(e,t,r,n){var i=34===t||36===t,a=34===t||35===t?98304:32768,o=Qx(r);return i!==n&&Ym(o,(function(e){return !!(e.flags&a)}))||i===n&&Ym(o,(function(e){return !(e.flags&(3|a))}))?Pm(e,2097152):e}function I(e,t,r,n){if(1&e.flags)return e;35!==t&&37!==t||(n=!n);var i=Qx(r),a=34===t||35===t;if(98304&i.flags)return G?Pm(e,a?n?262144:2097152:65536&i.flags?n?131072:1048576:n?65536:524288):e;if(n){if(!a&&(2&e.flags||Xm(e,Yp))){if(67239932&i.flags||Yp(i))return i;if(524288&i.flags)return dt}return iy(Zm(e,(function(e){return Lp(e,i)||a&&(t=i,0!=(524&e.flags)&&0!=(28&t.flags));var t;})),i)}return qf(i)?Zm(e,(function(e){return !(Wf(e)&&Lp(e,i))})):e}function O(e,r,n,i,a){35!==n&&37!==n||(a=!a);var o=Km(r.expression);if(!gm(t,o)){var s=C(r.expression,e);return s?E(e,s,(function(e){return M(e,i,a)})):G&&hm(o,t)&&a===("undefined"!==i.text)?Pm(e,2097152):e}return M(e,i,a)}function M(e,t,r){return r?B(e,t.text):Fm(e,S.get(t.text)||32768)}function L(t,r,n,i,a){return n!==i&&e.every(Wm(r).slice(n,i),a)?Fm(t,2097152):t}function R(t,r,n,i){var a=Wm(r);if(!a.length)return t;var o=a.slice(n,i),s=n===i||e.contains(o,ct);if(2&t.flags&&!s){for(var c=void 0,l=0;l<o.length;l+=1){var u=o[l];if(67239932&u.flags)void 0!==c&&c.push(u);else {if(!(524288&u.flags))return t;void 0===c&&(c=o.slice(0,l)),c.push(dt);}}return b_(void 0===c?o:c)}var _=b_(o),d=131072&_.flags?ct:iy(Zm(t,(function(e){return Lp(_,e)})),_);if(!s)return d;var p=Zm(t,(function(t){return !(Wf(t)&&e.contains(a,Rd(function(t){return 2097152&t.flags&&e.find(t.types,qf)||t}(t))))}));return 131072&d.flags?p:b_([d,p])}function B(e,t){switch(t){case"string":return j(e,Ye,1);case"number":return j(e,Ze,2);case"bigint":return j(e,$e,4);case"boolean":return j(e,at,8);case"symbol":return j(e,ot,16);case"object":return 1&e.flags?e:b_([j(e,dt,32),j(e,Qe,131072)]);case"function":return 1&e.flags?e:j(e,Wt,64);case"undefined":return j(e,qe,65536)}return j(e,dt,128)}function j(e,t,r){return ty(e,(function(e){return rf(e,t,Mn)?Am(e)&r?e:ct:wp(t,e)?t:Am(e)&r?N_([e,t]):ct}))}function J(r){return (e.isPropertyAccessExpression(r)&&"constructor"===e.idText(r.name)||e.isElementAccessExpression(r)&&e.isStringLiteralLike(r.argumentExpression)&&"constructor"===r.argumentExpression.text)&&gm(t,r.expression)}function z(t,r,n,i){if(i?34!==r&&36!==r:35!==r&&37!==r)return t;var a=Qx(n);if(!lC(a)&&!Ds(a))return t;var o=dl(a,"prototype");if(!o)return t;var s=ds(o),c=Co(s)?void 0:s;return c&&c!==qt&&c!==Wt?Co(t)?c:Zm(t,(function(t){return n=c,524288&(r=t).flags&&1&e.getObjectFlags(r)||524288&n.flags&&1&e.getObjectFlags(n)?r.symbol===n.symbol:wp(r,n);var r,n;})):t}function U(e,t,r,n){var i,a=1048576&e.flags?"N".concat(p_(e),",").concat(p_(t),",").concat((r?1:0)|(n?2:0)):void 0;return null!==(i=Un(a))&&void 0!==i?i:Kn(a,function(e,t,r,n){var i=n?Op:wp;if(!r)return Zm(e,(function(e){return !i(e,t)}));if(3&e.flags)return t;var a=1048576&e.flags?Dm(e):void 0,o=ty(t,(function(t){var r=a&&To(t,a),o=ty(r&&Sm(e,r)||e,n?function(e){return Op(e,t)?e:Op(t,e)?t:ct}:function(e){return wp(t,e)?t:wp(e,t)?e:ct});return 131072&o.flags?ty(e,(function(e){return vx(e,465829888)&&i(t,Gc(e)||Ke)?N_([e,t]):ct})):o}));return 131072&o.flags?wp(t,e)?t:Ip(e,t)?e:Ip(t,e)?t:N_([e,t]):o}(e,t,r,n))}function K(r,n,i,a){if(n.type&&(!Co(r)||n.type!==qt&&n.type!==Wt)){var o=function(t,r){if(1===t.kind||3===t.kind)return r.arguments[t.parameterIndex];var n=e.skipParentheses(r.expression);return e.isAccessExpression(n)?e.skipParentheses(n.expression):void 0}(n,i);if(o){if(gm(t,o))return U(r,n.type,a,!1);G&&a&&hm(o,t)&&!(65536&Am(n.type))&&(r=Pm(r,2097152));var s=C(o,r);if(s)return E(r,s,(function(e){return U(e,n.type,a,!1)}))}}return r}function V(r,n,i){if(e.isExpressionOfOptionalChainRoot(n)||e.isBinaryExpression(n.parent)&&60===n.parent.operatorToken.kind&&n.parent.left===n)return function(e,r,n){if(gm(t,r))return Pm(e,n?2097152:262144);var i=C(r,e);return i?E(e,i,(function(e){return Fm(e,n?2097152:262144)})):e}(r,n,i);switch(n.kind){case 79:if(!gm(t,n)&&k<5){var a=dm(n);if(Ey(a)){var o=a.valueDeclaration;if(o&&e.isVariableDeclaration(o)&&!o.type&&o.initializer&&xy(t)){k++;var s=V(r,o.initializer,i);return k--,s}}}case 108:case 106:case 208:case 209:return A(r,n,i);case 210:return function(r,n,i){if(Em(n,t)){var a=i||!e.isCallChain(n)?gy(n):void 0,o=a&&Jl(a);if(o&&(0===o.kind||1===o.kind))return K(r,o,n,i)}if(gg(r)&&e.isAccessExpression(t)&&e.isPropertyAccessExpression(n.expression)){var s=n.expression;if(gm(t.expression,Km(s.expression))&&e.isIdentifier(s.name)&&"hasOwnProperty"===s.name.escapedText&&1===n.arguments.length){var c=n.arguments[0];if(e.isStringLiteralLike(c)&&mm(t)===e.escapeLeadingUnderscores(c.text))return Fm(r,i?524288:65536)}}return r}(r,n,i);case 214:case 232:return V(r,n.expression,i);case 223:return P(r,n,i);case 221:if(53===n.operator)return V(r,n.operand,!i)}return r}}function Sy(t){return e.findAncestor(t.parent,(function(t){return e.isFunctionLike(t)&&!e.getImmediatelyInvokedFunctionExpression(t)||265===t.kind||308===t.kind||169===t.kind}))}function Ty(t){if(!t.valueDeclaration)return !1;var r,n=e.getRootDeclaration(t.valueDeclaration).parent,i=di(n);return 8388608&i.flags||(i.flags|=8388608,r=n,e.findAncestor(r.parent,(function(t){return (e.isFunctionLike(t)||e.isCatchClause(t))&&!!(8388608&di(t).flags)}))||Cy(n)),t.isAssigned||!1}function Cy(t){if(79===t.kind){if(e.isAssignmentTarget(t)){var r=dm(t);e.isParameterOrCatchClauseVariable(r)&&(r.isAssigned=!0);}}else e.forEachChild(t,Cy);}function Ey(e){return 3&e.flags&&0!=(2&Vv(e))}function ky(t){return 2097152&t.flags?e.some(t.types,ky):!!(465829888&t.flags&&1146880&Qc(t).flags)}function Ny(t){return 2097152&t.flags?e.some(t.types,Ny):!(!(465829888&t.flags)||vx(Qc(t),98304))}function Ay(t,r,n){var i=!(n&&2&n)&&Xm(t,ky)&&(function(e,t){var r=t.parent;return 208===r.kind||163===r.kind||210===r.kind&&r.expression===t||209===r.kind&&r.expression===t&&!(Xm(e,Ny)&&nd(Qx(r.argumentExpression)))}(t,r)||function(t,r){var n=(e.isIdentifier(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&!((e.isJsxOpeningElement(t.parent)||e.isJsxSelfClosingElement(t.parent))&&t.parent.tagName===t)&&cv(t,r&&64&r?8:void 0);return n&&!td(n)}(r,n));return i?ty(t,Qc):t}function Fy(t){return !!e.findAncestor(t,(function(t){var r=t.parent;return void 0===r?"quit":e.isExportAssignment(r)?r.expression===t&&e.isEntityNameExpression(t):!!e.isExportSpecifier(r)&&(r.name===t||r.propertyName===t)}))}function Py(t,r){if(Hi(t,111551)&&!pm(r)&&!$i(t,111551)){var n=Qi(t);1160127&Xi(n)&&(K.isolatedModules||e.shouldPreserveConstEnums(K)&&Fy(r)||!ZT(Na(n))?ta(t):function(e){var t=_i(e);t.constEnumReferenced||(t.constEnumReferenced=!0);}(t));}}function wy(t){return e.findAncestor(t,(function(t){return !t||e.nodeStartsNewLexicalEnvironment(t)?"quit":e.isIterationStatement(t,!1)}))}function Iy(e,t){di(e).flags|=2,169===t.kind||173===t.kind?di(t.parent).flags|=4:di(t).flags|=4;}function Oy(t){return e.isSuperCall(t)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,Oy)}function My(e){return Es(Js(Da(e)))===Xe}function Ly(t,r,n){var i=r.parent;e.getClassExtendsHeritageElement(i)&&!My(i)&&t.flowNode&&!by(t.flowNode,!1)&&Qn(t,n);}function Ry(t){var r=pm(t),n=e.getThisContainer(t,!0),i=!1;switch(173===n.kind&&Ly(t,n,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class),216===n.kind&&(n=e.getThisContainer(n,!1),i=!0),function(t,r){e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)&&r.initializer&&e.textRangeContainsPositionInclusive(r.initializer,t.pos)&&e.hasDecorators(r.parent)&&Qn(t,e.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class);}(t,n),n.kind){case 264:Qn(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 263:Qn(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 173:jy(t,n)&&Qn(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 164:Qn(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);}!r&&i&&V<2&&Iy(t,n);var a=By(t,!0,n);if($){var o=ds(le);if(a===o&&i)Qn(t,e.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);else if(!a){var s=Qn(t,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!e.isSourceFile(n)){var c=By(n);c&&c!==o&&e.addRelatedInfo(s,e.createDiagnosticForNode(n,e.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));}}}return a||Le}function By(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=e.getThisContainer(t,!1));var i=e.isInJSFile(t);if(e.isFunctionLike(n)&&(!Wy(t)||e.getThisParameter(n))){var a=jl(Ol(n))||i&&function(t){var r=e.getJSDocType(t);if(r&&320===r.kind){var n=r;if(n.parameters.length>0&&n.parameters[0].name&&"this"===n.parameters[0].name.escapedText)return Hd(n.parameters[0].type)}var i=e.getJSDocThisTag(t);if(i&&i.typeExpression)return Hd(i.typeExpression)}(n);if(!a){var o=function(t){return 215===t.kind&&e.isBinaryExpression(t.parent)&&3===e.getAssignmentDeclarationKind(t.parent)?t.parent.left.expression.expression:171===t.kind&&207===t.parent.kind&&e.isBinaryExpression(t.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.left.expression:215===t.kind&&299===t.parent.kind&&207===t.parent.parent.kind&&e.isBinaryExpression(t.parent.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.left.expression:215===t.kind&&e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)&&("value"===t.parent.name.escapedText||"get"===t.parent.name.escapedText||"set"===t.parent.name.escapedText)&&e.isObjectLiteralExpression(t.parent.parent)&&e.isCallExpression(t.parent.parent.parent)&&t.parent.parent.parent.arguments[2]===t.parent.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.arguments[0].expression:e.isMethodDeclaration(t)&&e.isIdentifier(t.name)&&("value"===t.name.escapedText||"get"===t.name.escapedText||"set"===t.name.escapedText)&&e.isObjectLiteralExpression(t.parent)&&e.isCallExpression(t.parent.parent)&&t.parent.parent.arguments[2]===t.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.arguments[0].expression:void 0}(n);if(i&&o){var s=Zx(o).symbol;s&&s.members&&16&s.flags&&(a=Js(s).thisType);}else bb(n)&&(a=Js(xa(n.symbol)).thisType);a||(a=Ky(n));}if(a)return Dy(t,a)}if(e.isClassLike(n.parent)){var c=Da(n.parent);return Dy(t,e.isStatic(n)?ds(c):Js(c).thisType)}if(e.isSourceFile(n)){if(n.commonJsModuleIndicator){var l=Da(n);return l&&ds(l)}if(n.externalModuleIndicator)return qe;if(r)return ds(le)}}function jy(t,r){return !!e.findAncestor(t,(function(t){return e.isFunctionLikeDeclaration(t)?"quit":166===t.kind&&t.parent===r}))}function Jy(t){var r=210===t.parent.kind&&t.parent.expression===t,n=e.getSuperContainer(t,!0),i=n,a=!1,o=!1;if(!r){for(;i&&216===i.kind;)e.hasSyntacticModifier(i,512)&&(o=!0),i=e.getSuperContainer(i,!0),a=V<2;i&&e.hasSyntacticModifier(i,512)&&(o=!0);}var s=function(t){return !!t&&(r?173===t.kind:!(!e.isClassLike(t.parent)&&207!==t.parent.kind)&&(e.isStatic(t)?171===t.kind||170===t.kind||174===t.kind||175===t.kind||169===t.kind||172===t.kind:171===t.kind||170===t.kind||174===t.kind||175===t.kind||169===t.kind||168===t.kind||173===t.kind))}(i),c=0;if(!s){var l=e.findAncestor(t,(function(e){return e===i?"quit":164===e.kind}));return l&&164===l.kind?Qn(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):r?Qn(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):i&&i.parent&&(e.isClassLike(i.parent)||207===i.parent.kind)?Qn(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):Qn(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),je}if(r||173!==n.kind||Ly(t,i,e.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),e.isStatic(i)||r?(c=512,!r&&V>=2&&V<=8&&(e.isPropertyDeclaration(i)||e.isClassStaticBlockDeclaration(i))&&e.forEachEnclosingBlockScopeContainer(t.parent,(function(t){e.isSourceFile(t)&&!e.isExternalOrCommonJsModule(t)||(di(t).flags|=134217728);}))):c=256,di(t).flags|=c,171===i.kind&&o&&(e.isSuperProperty(t.parent)&&e.isAssignmentTarget(t.parent)?di(i).flags|=4096:di(i).flags|=2048),a&&Iy(t.parent,i),207===i.parent.kind)return V<2?(Qn(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),je):Le;var u=i.parent;if(!e.getClassExtendsHeritageElement(u))return Qn(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),je;var _=Js(Da(u)),d=_&&Ns(_)[0];return d?173===i.kind&&jy(t,i)?(Qn(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),je):512===c?Es(_):oc(d,_.thisType):je}function zy(t){return 4&e.getObjectFlags(t)&&t.target===tr?fu(t)[0]:void 0}function Uy(t){return ty(t,(function(t){return 2097152&t.flags?e.forEach(t.types,zy):zy(t)}))}function Ky(t){if(216!==t.kind){if(Ep(t)){var r=fv(t);if(r){var n=r.thisParameter;if(n)return ds(n)}}var i=e.isInJSFile(t);if($||i){var a=function(e){return 171!==e.kind&&174!==e.kind&&175!==e.kind||207!==e.parent.kind?215===e.kind&&299===e.parent.kind?e.parent.parent:void 0:e.parent}(t);if(a){for(var o=av(a,void 0),s=a,c=o;c;){var l=Uy(c);if(l)return hp(l,Bg(lv(a)));if(299!==s.parent.kind)break;c=av(s=s.parent.parent,void 0);}return Cg(o?lg(o):Ix(a))}var u=e.walkUpParenthesizedExpressions(t.parent);if(223===u.kind&&63===u.operatorToken.kind){var _=u.left;if(e.isAccessExpression(_)){var d=_.expression;if(i&&e.isIdentifier(d)){var p=e.getSourceFileOfNode(u);if(p.commonJsModuleIndicator&&dm(d)===p.symbol)return}return Cg(Ix(d))}}}}}function Vy(t){var r=t.parent;if(Ep(r)){var n=e.getImmediatelyInvokedFunctionExpression(r);if(n&&n.arguments){var i=$h(n),a=r.parameters.indexOf(t);if(t.dotDotDotToken)return Hh(i,a,i.length,Le,void 0,0);var o=di(n),s=o.resolvedSignature;o.resolvedSignature=Jr;var c=a<i.length?Qf(Zx(i[a])):t.initializer?void 0:We;return o.resolvedSignature=s,c}var l=fv(r);if(l){var u=r.parameters.indexOf(t)-(e.getThisParameter(r)?1:0);return t.dotDotDotToken&&e.lastOrUndefined(r.parameters)===t?Kb(l,u):Ub(l,u)}}}function qy(t,r){var n=e.getEffectiveTypeAnnotationNode(t);if(n)return Hd(n);switch(t.kind){case 166:return Vy(t);case 205:return function(t,r){var n=t.parent.parent,i=t.propertyName||t.name,a=qy(n,r)||205!==n.kind&&n.initializer&&Mx(n,t.dotDotDotToken?64:0);if(a&&!e.isBindingPattern(i)&&!e.isComputedNonLiteralName(i)){if(204===n.name.kind){var o=e.indexOfNode(t.parent.elements,t);if(o<0)return;return rv(a,o)}var s=M_(i);return Xs(s)?To(a,tc(s)):void 0}}(t,r);case 169:if(e.isStatic(t))return function(t,r){var n=e.isExpression(t.parent)&&cv(t.parent,r);return n?$y(n,Da(t).escapedName):void 0}(t,r)}}function Wy(t){for(var r=!1;t.parent&&!e.isFunctionLike(t.parent);){if(e.isParameter(t.parent)&&(r||t.parent.initializer===t))return !0;e.isBindingElement(t.parent)&&t.parent.initializer===t&&(r=!0),t=t.parent;}return !1}function Hy(t,r){var n=!!(2&e.getFunctionFlags(r)),i=Gy(r,void 0);if(i)return LS(t,i,n)||void 0}function Gy(t,r){var n=Kl(t);if(n)return n;var i=pv(t);if(i&&!Vl(i))return Ul(i);var a=e.getImmediatelyInvokedFunctionExpression(t);return a?cv(a,r):void 0}function Qy(e,t){var r=$h(e).indexOf(t);return -1===r?void 0:Xy(e,r)}function Xy(t,r){if(e.isImportCall(t))return 0===r?Ye:1===r?zu(!1):Le;var n=di(t).resolvedSignature===Ur?Ur:hb(t);if(e.isJsxOpeningLikeElement(t)&&0===r)return uv(n,t);var i=n.parameters.length-1;return j(n)&&r>=i?ld(ds(n.parameters[i]),Jd(r-i),256):zb(n,r)}function Yy(t,r){if(void 0===r&&(r=e.getAssignmentDeclarationKind(t)),4===r)return !0;if(!e.isInJSFile(t)||5!==r||!e.isIdentifier(t.left.expression))return !1;var n=t.left.expression.escapedText,i=vi(t.left,n,111551,void 0,void 0,!0,!0);return e.isThisInitializedDeclaration(null==i?void 0:i.valueDeclaration)}function Zy(t){if(!t.symbol)return Qx(t.left);if(t.symbol.valueDeclaration){var r=e.getEffectiveTypeAnnotationNode(t.symbol.valueDeclaration);if(r){var n=Hd(r);if(n)return n}}var i=e.cast(t.left,e.isAccessExpression);if(e.isObjectLiteralMethod(e.getThisContainer(i.expression,!1))){var a=Ry(i.expression),o=e.getElementOrPropertyAccessName(i);return void 0!==o&&$y(a,o)||void 0}}function $y(t,r,n){return ty(t,(function(t){var i,a;if(Lc(t)&&!t.declaration.nameType){var o=kc(t),s=Gc(o)||o,c=n||jd(e.unescapeLeadingUnderscores(r));if(Ip(c,s))return cd(t,c)}else if(3670016&t.flags){var l=dl(t,r);if(l)return a=l,262144&e.getCheckFlags(a)&&!a.type&&bo(a,0)>=0?void 0:ds(l);if($f(t)){var u=rg(t);if(u&&e.isNumericLiteralName(r)&&+r>=0)return u}return null===(i=ml(vl(t),n||jd(e.unescapeLeadingUnderscores(r))))||void 0===i?void 0:i.type}}),!0)}function ev(t,r){if(e.Debug.assert(e.isObjectLiteralMethod(t)),!(33554432&t.flags))return tv(t,r)}function tv(t,r){var n=t.parent,i=e.isPropertyAssignment(t)&&qy(t,r);if(i)return i;var a=av(n,r);if(a){if(ec(t)){var o=Da(t);return $y(a,o.escapedName,_i(o).nameType)}if(t.name){var s=M_(t.name);return ty(a,(function(e){var t;return null===(t=ml(vl(e),s))||void 0===t?void 0:t.type}),!0)}}}function rv(e,t){return e&&($y(e,""+t)||ty(e,(function(e){return gS(1,e,qe,void 0,!1)}),!0))}function nv(t,r){if(e.isJsxAttribute(t)){var n=av(t.parent,r);if(!n||Co(n))return;return $y(n,t.name.escapedText)}return cv(t.parent,r)}function iv(e){switch(e.kind){case 10:case 8:case 9:case 14:case 110:case 95:case 104:case 79:case 155:return !0;case 208:case 214:return iv(e.expression);case 291:return !e.expression||iv(e.expression)}return !1}function av(t,r){var n=ov(e.isObjectLiteralMethod(t)?ev(t,r):cv(t,r),t,r);if(n&&!(r&&2&r&&8650752&n.flags)){var i=ty(n,rl,!0);return 1048576&i.flags&&e.isObjectLiteralExpression(t)?function(t,r){return function(t,r){var n=Dm(t),i=n&&e.find(r.properties,(function(e){return e.symbol&&299===e.kind&&e.symbol.escapedName===n&&iv(e.initializer)})),a=i&&Yx(i.initializer);return a&&Sm(t,a)}(r,t)||df(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&299===e.kind&&iv(e.initializer)&&bm(r,e.symbol.escapedName)})),(function(e){return [function(){return Yx(e.initializer)},e.symbol.escapedName]})),e.map(e.filter(zc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&bm(r,e.escapedName)})),(function(e){return [function(){return qe},e.escapedName]}))),Ip,r)}(t,i):1048576&i.flags&&e.isJsxAttributes(t)?function(t,r){return df(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&288===e.kind&&bm(r,e.symbol.escapedName)&&(!e.initializer||iv(e.initializer))})),(function(e){return [e.initializer?function(){return Yx(e.initializer)}:function(){return rt},e.symbol.escapedName]})),e.map(e.filter(zc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&bm(r,e.escapedName)})),(function(e){return [function(){return qe},e.escapedName]}))),Ip,r)}(t,i):i}}function ov(t,r,n){if(t&&vx(t,465829888)){var i=lv(r);if(i&&1&n&&e.some(i.inferences,qx))return sv(t,i.nonFixingMapper);if(null==i?void 0:i.returnMapper){var a=sv(t,i.returnMapper);return 1048576&a.flags&&f_(a.types,tt)&&f_(a.types,nt)?Zm(a,(function(e){return e!==tt&&e!==nt})):a}}return t}function sv(t,r){return 465829888&t.flags?hp(t,r):1048576&t.flags?b_(e.map(t.types,(function(e){return sv(e,r)})),0):2097152&t.flags?N_(e.map(t.types,(function(e){return sv(e,r)}))):t}function cv(t,r){if(33554432&t.flags);else {if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 257:case 166:case 169:case 168:case 205:return function(t,r){var n=t.parent;if(e.hasInitializer(n)&&t===n.initializer){var i=qy(n,r);if(i)return i;if(!(8&r)&&e.isBindingPattern(n.name)&&n.name.elements.length>0)return Yo(n.name,!0,!1)}}(t,r);case 216:case 250:return function(t,r){var n=e.getContainingFunction(t);if(n){var i=Gy(n,r);if(i){var a=e.getFunctionFlags(n);if(1&a){var o=0!=(2&a);1048576&i.flags&&(i=Zm(i,(function(e){return !!LS(1,e,o)})));var s=LS(1,i,0!=(2&a));if(!s)return;i=s;}if(2&a){var c=ty(i,ED);return c&&b_([c,ex(c)])}return i}}}(t,r);case 226:return function(t,r){var n=e.getContainingFunction(t);if(n){var i=e.getFunctionFlags(n),a=Gy(n,r);if(a){var o=0!=(2&i);return !t.asteriskToken&&1048576&a.flags&&(a=Zm(a,(function(e){return !!LS(1,e,o)}))),t.asteriskToken?a:LS(0,a,o)}}}(n,r);case 220:return function(e,t){var r=cv(e,t);if(r){var n=ED(r);return n&&b_([n,ex(n)])}}(n,r);case 210:case 211:return Qy(n,t);case 213:case 231:return e.isConstTypeReference(n.type)?o(n):Hd(n.type);case 223:return function(t,r){var n=t.parent,i=n.left,a=n.operatorToken,o=n.right;switch(a.kind){case 63:case 76:case 75:case 77:return t===o?function(t){var r,n,i=e.getAssignmentDeclarationKind(t);switch(i){case 0:case 4:var a=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t))return dm(t);if(e.isPropertyAccessExpression(t)){var r=Qx(t.expression);return e.isPrivateIdentifier(t.name)?function(e,t){var r=oh(t.escapedText,t);return r&&ch(e,r)}(r,t.name):dl(r,t.name.escapedText)}if(e.isElementAccessExpression(t)){var n=Ix(t.argumentExpression);if(!Xs(n))return;return dl(r=Qx(t.expression),tc(n))}}(t.left),o=a&&a.valueDeclaration;return o&&(e.isPropertyDeclaration(o)||e.isPropertySignature(o))?(c=e.getEffectiveTypeAnnotationNode(o))&&hp(Hd(c),_i(a).mapper)||(e.isPropertyDeclaration(o)?o.initializer&&Qx(t.left):void 0):0===i?Qx(t.left):Zy(t);case 5:if(Yy(t,i))return Zy(t);if(t.left.symbol){var s=t.left.symbol.valueDeclaration;if(!s)return;var c,l=e.cast(t.left,e.isAccessExpression);if(c=e.getEffectiveTypeAnnotationNode(s))return Hd(c);if(e.isIdentifier(l.expression)){var u=l.expression,_=vi(u,u.escapedText,111551,void 0,u.escapedText,!0);if(_){var d=_.valueDeclaration&&e.getEffectiveTypeAnnotationNode(_.valueDeclaration);if(d){var p=e.getElementOrPropertyAccessName(l);if(void 0!==p)return $y(Hd(d),p)}return}}return e.isInJSFile(s)?void 0:Qx(t.left)}return Qx(t.left);case 1:case 6:case 3:case 2:var f=void 0;2!==i&&(f=null===(r=t.left.symbol)||void 0===r?void 0:r.valueDeclaration),f||(f=null===(n=t.symbol)||void 0===n?void 0:n.valueDeclaration);var g=f&&e.getEffectiveTypeAnnotationNode(f);return g?Hd(g):void 0;case 7:case 8:case 9:return e.Debug.fail("Does not apply");default:return e.Debug.assertNever(i)}}(n):void 0;case 56:case 60:var s=cv(n,r);return t===o&&(s&&s.pattern||!s&&!e.isDefaultedExpandoInitializer(n))?Qx(i):s;case 55:case 27:return t===o?cv(n,r):void 0;default:return}}(t,r);case 299:case 300:return tv(n,r);case 301:return cv(n.parent,r);case 206:var i=n;return rv(av(i,r),e.indexOfNode(i.elements,t));case 224:return function(e,t){var r=e.parent;return e===r.whenTrue||e===r.whenFalse?cv(r,t):void 0}(t,r);case 236:return e.Debug.assert(225===n.parent.kind),function(e,t){if(212===e.parent.kind)return Qy(e.parent,t)}(n.parent,t);case 214:var a=e.isInJSFile(n)?e.getJSDocTypeTag(n):void 0;return a?e.isJSDocTypeTag(a)&&e.isConstTypeReference(a.typeExpression.type)?o(n):Hd(a.typeExpression.type):cv(n,r);case 232:return cv(n,r);case 235:return Hd(n.type);case 274:return ts(n);case 291:return function(t,r){var n=t.parent;return e.isJsxAttributeLike(n)?cv(t,r):e.isJsxElement(n)?function(t,r,n){var i=av(t.openingElement.tagName,n),a=Ov(wv(t));if(i&&!Co(i)&&a&&""!==a){var o=e.getSemanticJsxChildren(t.children),s=o.indexOf(r),c=$y(i,a);return c&&(1===o.length?c:ty(c,(function(e){return Bf(e)?ld(e,Jd(s)):e}),!0))}}(n,t,r):void 0}(n,r);case 288:case 290:return nv(n,r);case 283:case 282:return function(t,r){return e.isJsxOpeningElement(t)&&t.parent.contextualType&&4!==r?t.parent.contextualType:Xy(t,0)}(n,r)}}function o(e){return cv(e,r)}}function lv(t){var r=e.findAncestor(t,(function(e){return !!e.inferenceContext}));return r&&r.inferenceContext}function uv(t,r){return 0!==Qh(r)?function(e,t){var r=Xb(e,Ke);r=_v(t,wv(t),r);var n=Av(A.IntrinsicAttributes,t);return Eo(n)||(r=vc(n,r)),r}(t,r):function(t,r){var n,i=wv(r),a=(n=i,Iv(A.ElementAttributesPropertyNameContainer,n)),o=void 0===a?Xb(t,Ke):""===a?Ul(t):function(e,t){if(e.compositeSignatures){for(var r=[],n=0,i=e.compositeSignatures;n<i.length;n++){var a=Ul(i[n]);if(Co(a))return a;var o=To(a,t);if(!o)return;r.push(o);}return N_(r)}var s=Ul(e);return Co(s)?s:To(s,t)}(t,a);if(!o)return a&&e.length(r.attributes.properties)&&Qn(r,e.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,e.unescapeLeadingUnderscores(a)),Ke;if(Co(o=_v(r,i,o)))return o;var s=o,c=Av(A.IntrinsicClassAttributes,r);if(!Eo(c)){var l=bs(c.symbol),u=Ul(t);s=vc(l?hp(c,$d(l,Il([u],l,wl(l),e.isInJSFile(r)))):c,s);}var _=Av(A.IntrinsicAttributes,r);return Eo(_)||(s=vc(_,s)),s}(t,r)}function _v(t,r,n){var i,a=(i=r)&&fi(i.exports,A.LibraryManagedAttributes,788968);if(a){var o=Js(a),s=function(e){if(Cv(e.tagName))return Yl(mb(e,t=Rv(e)));var t,r=Ix(e.tagName);return 128&r.flags?(t=Lv(r,e))?Yl(mb(e,t)):je:r}(t);if(524288&a.flags){var c=_i(a).typeParameters;if(e.length(c)>=2)return yu(a,Il([s,n],c,2,e.isInJSFile(t)))}if(e.length(o.typeParameters)>=2)return _u(o,Il([s,n],o.typeParameters,2,e.isInJSFile(t)))}return n}function dv(t,r){var n=fl(t,0),i=e.filter(n,(function(t){return !function(t,r){for(var n=0;n<r.parameters.length;n++){var i=r.parameters[n];if(i.initializer||i.questionToken||i.dotDotDotToken||kl(i))break}return r.parameters.length&&e.parameterIsThisKeyword(r.parameters[0])&&n--,!Wb(t)&&Vb(t)<n}(t,r)}));return 1===i.length?i[0]:function(t){return e.getStrictOptionValue(K,"noImplicitAny")?e.reduceLeft(t,(function(t,r){return t!==r&&t?mc(t.typeParameters,r.typeParameters)?function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=$d(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Vb(e),i=Vb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=Wb(e)||Wb(t),l=c&&!Wb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Ub(a,_);a===t&&(d=hp(d,r));var p=Ub(o,_)||Ke;o===t&&(p=hp(p,r));var f=b_([d,p]),g=c&&!l&&_===s-1,m=_>=qb(a)&&_>=qb(o),y=_>=n?void 0:Rb(e,_),v=_>=i?void 0:Rb(t,_),h=ri(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?$u(f):f,u[_]=h;}if(l){var b=ri(1,"args");b.type=$u(zb(o,s)),o===t&&(b.type=hp(b.type,r)),u[s]=b;}return u}(t,r,n),s=function(e,t,r){return e&&t?vg(e,b_([ds(e),hp(ds(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),c=cc(a,i,s,o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return c.compositeKind=2097152,c.compositeSignatures=e.concatenate(2097152===t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(c.mapper=2097152===t.compositeKind&&t.mapper&&t.compositeSignatures?op(t.mapper,n):n),c}(t,r):void 0:t})):void 0}(i)}function pv(t){return e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t)?fv(t):void 0}function fv(t){e.Debug.assert(171!==t.kind||e.isObjectLiteralMethod(t));var r=Ml(t);if(r)return r;var n=av(t,1);if(n){if(!(1048576&n.flags))return dv(n,t);for(var i,a=0,o=n.types;a<o.length;a++){var s=dv(o[a],t);if(s)if(i){if(!Ff(i[0],s,!1,!0,!0,Ap))return;i.push(s);}else i=[s];}return i?1===i.length?i[0]:uc(i[0],i):void 0}}function gv(e){return 205===e.kind&&!!e.initializer||223===e.kind&&63===e.operatorToken.kind}function mv(t,r,n){for(var i=t.elements,a=i.length,o=[],s=[],c=av(t,void 0),l=e.isAssignmentTarget(t),u=Bx(t),_=!1,d=0;d<a;d++){var p=i[d];if(227===p.kind){V<2&&DC(p,K.downlevelIteration?1536:1024);var f=Zx(p.expression,r,n);if(Bf(f))o.push(f),s.push(8);else if(l){var g=xl(f,Ze)||gS(65,f,qe,void 0,!1)||Ke;o.push(g),s.push(4);}else o.push(fS(33,f,qe,p.expression)),s.push(4);}else if(ne&&229===p.kind)_=!0,o.push(Ge),s.push(2);else {var m=jx(p,r,rv(c,o.length),n);if(o.push(Bo(m,!0,_)),s.push(_?2:1),c&&Xm(c,Uf)&&r&&2&r&&!(4&r)&&Tp(p)){var y=lv(t);e.Debug.assert(y),Mg(y,p,m);}}}return l?a_(o,s):n||u||c&&Xm(c,Uf)?yv(a_(o,s,u)):yv($u(o.length?b_(e.sameMap(o,(function(e,t){return 8&s[t]?_d(e,Ze)||Le:e})),2):G?ut:We,u))}function yv(t){if(!(4&e.getObjectFlags(t)))return t;var r=t.literalType;return r||((r=t.literalType=du(t)).objectFlags|=147456),r}function vv(t){switch(t.kind){case 164:return function(e){return hx(hv(e),296)}(t);case 79:return e.isNumericLiteralName(t.escapedText);case 8:case 10:return e.isNumericLiteralName(t.text);default:return !1}}function hv(t){var r=di(t.expression);if(!r.resolvedType){if((e.isTypeLiteralNode(t.parent.parent)||e.isClassLike(t.parent.parent)||e.isInterfaceDeclaration(t.parent.parent))&&e.isBinaryExpression(t.expression)&&101===t.expression.operatorToken.kind&&174!==t.parent.kind&&175!==t.parent.kind)return r.resolvedType=je;if(r.resolvedType=Zx(t.expression),e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&e.isClassExpression(t.parent.parent)){var n=wy(e.getEnclosingBlockScopeContainer(t.parent.parent));n&&(di(n).flags|=65536,di(t).flags|=524288,di(t.parent.parent).flags|=524288);}(98304&r.resolvedType.flags||!hx(r.resolvedType,402665900)&&!Ip(r.resolvedType,ft))&&Qn(t,e.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);}return r.resolvedType}function bv(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r[0];return e.isKnownSymbol(t)||n&&e.isNamedDeclaration(n)&&e.isComputedPropertyName(n.name)&&hx(hv(n.name),4096)}function xv(t,r,n,i){for(var a,o,s,c=[],l=r;l<n.length;l++){var u=n[l];(i===Ye&&!bv(u)||i===Ze&&(s=null===(o=(a=u).declarations)||void 0===o?void 0:o[0],e.isNumericLiteralName(a.escapedName)||s&&e.isNamedDeclaration(s)&&vv(s.name))||i===ot&&bv(u))&&c.push(ds(n[l]));}return eu(i,c.length?b_(c,2):qe,Bx(t))}function Dv(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=_i(t);if(!r.immediateTarget){var n=Fi(t);if(!n)return e.Debug.fail();r.immediateTarget=Wi(n,!0);}return r.immediateTarget}function Sv(t){var r=ag(ty(t,Qc));return !!(126615553&r.flags||3145728&r.flags&&e.every(r.types,Sv))}function Tv(t){return e.stringContains(t,"-")}function Cv(t){return 79===t.kind&&e.isIntrinsicJsxName(t.escapedText)}function Ev(e,t){return e.initializer?jx(e.initializer,t):rt}function kv(e,t){for(var r=[],n=0,i=e.children;n<i.length;n++){var a=i[n];if(11===a.kind)a.containsOnlyTriviaWhiteSpaces||r.push(Ye);else {if(291===a.kind&&!a.expression)continue;r.push(jx(a,t));}}return r}function Nv(t,r,n){for(var i=0,a=zc(t);i<a.length;i++){var o=a[i];if(!(16777216&o.flags)){var s=r.get(o.escapedName);if(s){var c=Qn(s.valueDeclaration,e.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,e.unescapeLeadingUnderscores(s.escapedName));e.addRelatedInfo(c,e.createDiagnosticForNode(n,e.Diagnostics.This_spread_always_overwrites_this_property));}}}}function Av(e,t){var r=wv(t),n=r&&ya(r),i=n&&fi(n,e,788968);return i?Js(i):je}function Fv(t){var r=di(t);if(!r.resolvedSymbol){var n=Av(A.IntrinsicElements,t);if(Eo(n))return Z&&Qn(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,e.unescapeLeadingUnderscores(A.IntrinsicElements)),r.resolvedSymbol=we;if(!e.isIdentifier(t.tagName))return e.Debug.fail();var i=dl(n,t.tagName.escapedText);return i?(r.jsxFlags|=1,r.resolvedSymbol=i):xl(n,Ye)?(r.jsxFlags|=2,r.resolvedSymbol=n.symbol):(Qn(t,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.idText(t.tagName),"JSX."+A.IntrinsicElements),r.resolvedSymbol=we)}return r.resolvedSymbol}function Pv(t){var r=t&&e.getSourceFileOfNode(t),n=r&&di(r);if(!n||!1!==n.jsxImplicitImportContainer){if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;var i=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(K,r),K);if(i){var a=ca(t,i,e.getEmitModuleResolutionKind(K)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations,t),o=a&&a!==we?xa(Gi(a)):void 0;return n&&(n.jsxImplicitImportContainer=o||!1),o}}}function wv(e){var t=e&&di(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){var r=Pv(e);if(!r||r===we){var n=Vn(e);r=vi(e,n,1920,void 0,n,!1);}if(r){var i=Gi(fi(ya(Gi(r)),A.JSX,1920));if(i&&i!==we)return t&&(t.jsxNamespace=i),i}t&&(t.jsxNamespace=!1);}var a=Gi(Ru(A.JSX,1920,void 0));return a!==we?a:void 0}function Iv(t,r){var n=r&&fi(r.exports,t,788968),i=n&&Js(n),a=i&&zc(i);if(a){if(0===a.length)return "";if(1===a.length)return a[0].escapedName;a.length>1&&n.declarations&&Qn(n.declarations[0],e.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property,e.unescapeLeadingUnderscores(t));}}function Ov(e){return Iv(A.ElementChildrenAttributeNameContainer,e)}function Mv(t,r){if(4&t.flags)return [Jr];if(128&t.flags){var n=Lv(t,r);return n?[mb(r,n)]:(Qn(r,e.Diagnostics.Property_0_does_not_exist_on_type_1,t.value,"JSX."+A.IntrinsicElements),e.emptyArray)}var i=rl(t),a=fl(i,1);return 0===a.length&&(a=fl(i,0)),0===a.length&&1048576&i.flags&&(a=gc(e.map(i.types,(function(e){return Mv(e,r)})))),a}function Lv(t,r){var n=Av(A.IntrinsicElements,r);if(!Eo(n)){var i=t.value,a=dl(n,e.escapeLeadingUnderscores(i));return a?ds(a):xl(n,Ye)||void 0}return Le}function Rv(t){e.Debug.assert(Cv(t.tagName));var r=di(t);if(!r.resolvedJsxElementAttributesType){var n=Fv(t);return 1&r.jsxFlags?r.resolvedJsxElementAttributesType=ds(n)||je:2&r.jsxFlags?r.resolvedJsxElementAttributesType=xl(Av(A.IntrinsicElements,t),Ye)||je:r.resolvedJsxElementAttributesType=je}return r.resolvedJsxElementAttributesType}function Bv(e){var t=Av(A.ElementClass,e);if(!Eo(t))return t}function jv(e){return Av(A.Element,e)}function Jv(e){var t=jv(e);if(t)return b_([t,Qe])}function zv(t){var r,n=e.isJsxOpeningLikeElement(t);if(n&&function(t){(function(t){if(e.isPropertyAccessExpression(t)){var r=t;do{var n=a(r.name);if(n)return n;r=r.expression;}while(e.isPropertyAccessExpression(r));var i=a(r);if(i)return i}function a(t){if(e.isIdentifier(t)&&-1!==e.idText(t).indexOf(":"))return XC(t,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}})(t.tagName),FC(t,t.typeArguments);for(var r=new e.Map,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(290!==a.kind){var o=a.name,s=a.initializer;if(r.get(o.escapedText))return XC(o,e.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);if(r.set(o.escapedText,!0),s&&291===s.kind&&!s.expression)return XC(s,e.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}}(t),r=t,0===(K.jsx||0)&&Qn(r,e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided),void 0===jv(r)&&Z&&Qn(r,e.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist),!Pv(t)){var i=Pn&&2===K.jsx?e.Diagnostics.Cannot_find_name_0:void 0,a=Vn(t),o=n?t.tagName:t,s=void 0;if(e.isJsxOpeningFragment(t)&&"null"===a||(s=vi(o,a,111551,i,a,!0)),s&&(s.isReferenced=67108863,2097152&s.flags&&!$i(s)&&ta(s)),e.isJsxOpeningFragment(t)){var c=qn(e.getSourceFileOfNode(t));c&&vi(o,c,111551,i,c,!0);}}if(n){var l=t,u=hb(l);Sb(u,t),function(t,r,n){if(1===t)(i=Jv(n))&&sf(r,i,Ln,n.tagName,e.Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element,o);else if(0===t)(a=Bv(n))&&sf(r,a,Ln,n.tagName,e.Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element,o);else {var i=Jv(n),a=Bv(n);if(!i||!a)return;sf(r,b_([i,a]),Ln,n.tagName,e.Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element,o);}function o(){var t=e.getTextOfNode(n.tagName);return e.chainDiagnosticMessages(void 0,e.Diagnostics._0_cannot_be_used_as_a_JSX_component,t)}}(Qh(l),Ul(u),l);}}function Uv(e,t,r){if(524288&e.flags){if(jc(e,t)||Tl(e,t)||Zs(t)&&bl(e,Ye)||r&&Tv(t))return !0}else if(3145728&e.flags&&Kv(e))for(var n=0,i=e.types;n<i.length;n++)if(Uv(i[n],t,r))return !0;return !1}function Kv(t){return !!(524288&t.flags&&!(512&e.getObjectFlags(t))||67108864&t.flags||1048576&t.flags&&e.some(t.types,Kv)||2097152&t.flags&&e.every(t.types,Kv))}function Vv(t){return t.valueDeclaration?e.getCombinedNodeFlags(t.valueDeclaration):0}function qv(t){if(8192&t.flags||4&e.getCheckFlags(t))return !0;if(e.isInJSFile(t.valueDeclaration)){var r=t.valueDeclaration.parent;return r&&e.isBinaryExpression(r)&&3===e.getAssignmentDeclarationKind(r)}}function Wv(e,t,r,n,i,a){return void 0===a&&(a=!0),Hv(e,t,r,n,i,a?163===e.kind?e.right:202===e.kind?e:205===e.kind&&e.propertyName?e.propertyName:e.name:void 0)}function Hv(t,r,n,i,a,o){var s,c,l=e.getDeclarationModifierFlagsFromSymbol(a,n);if(r){if(V<2&&Gv(a))return o&&Qn(o,e.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword),!1;if(256&l)return o&&Qn(o,e.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,ro(a),io(Tf(a))),!1}if(256&l&&Gv(a)&&(e.isThisProperty(t)||e.isThisInitializedObjectBindingExpression(t)||e.isObjectBindingPattern(t.parent)&&e.isThisInitializedDeclaration(t.parent.parent))&&(c=e.getClassLikeDeclarationOfSymbol(Sa(a)))&&(s=t,e.findAncestor(s,(function(t){return !!(e.isConstructorDeclaration(t)&&e.nodeIsPresent(t.body)||e.isPropertyDeclaration(t))||!(!e.isClassLike(t)&&!e.isFunctionLikeDeclaration(t))&&"quit"}))))return o&&Qn(o,e.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,ro(a),e.getTextOfIdentifierOrLiteral(c.name)),!1;if(!(24&l))return !0;if(8&l)return !!FT(t,c=e.getClassLikeDeclarationOfSymbol(Sa(a)))||(o&&Qn(o,e.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1,ro(a),io(Tf(a))),!1);if(r)return !0;var u=AT(t,(function(e){return Ef(Js(Da(e)),a,n)}));return !u&&(u=function(t){var r=function(t){var r=e.getThisContainer(t,!1);return r&&e.isFunctionLike(r)?e.getThisParameter(r):void 0}(t),n=(null==r?void 0:r.type)&&Hd(r.type);if(n&&262144&n.flags&&(n=Kc(n)),n&&7&e.getObjectFlags(n))return gs(n)}(t),u=u&&Ef(u,a,n),32&l||!u)?(o&&Qn(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,ro(a),io(Tf(a)||i)),!1):!!(32&l)||(262144&i.flags&&(i=i.isThisType?Kc(i):Gc(i)),!(!i||!ms(i,u))||(o&&Qn(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,ro(a),io(u),io(i)),!1))}function Gv(e){return !!Sf(e,(function(e){return !(8192&e.flags)}))}function Qv(e){return th(Zx(e),e)}function Xv(e){return !!(50331648&Am(e))}function Yv(e){return Xv(e)?lg(e):e}function Zv(t,r){var n=e.isEntityNameExpression(t)?e.entityNameToString(t):void 0;if(104!==t.kind)if(void 0!==n&&n.length<100){if(e.isIdentifier(t)&&"undefined"===n)return void Qn(t,e.Diagnostics.The_value_0_cannot_be_used_here,"undefined");Qn(t,16777216&r?33554432&r?e.Diagnostics._0_is_possibly_null_or_undefined:e.Diagnostics._0_is_possibly_undefined:e.Diagnostics._0_is_possibly_null,n);}else Qn(t,16777216&r?33554432&r?e.Diagnostics.Object_is_possibly_null_or_undefined:e.Diagnostics.Object_is_possibly_undefined:e.Diagnostics.Object_is_possibly_null);else Qn(t,e.Diagnostics.The_value_0_cannot_be_used_here,"null");}function $v(t,r){Qn(t,16777216&r?33554432&r?e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);}function eh(t,r,n){if(G&&2&t.flags){if(e.isEntityNameExpression(r)){var i=e.entityNameToString(r);if(i.length<100)return Qn(r,e.Diagnostics._0_is_of_type_unknown,i),je}return Qn(r,e.Diagnostics.Object_is_of_type_unknown),je}var a=Am(t);if(50331648&a){n(r,a);var o=lg(t);return 229376&o.flags?je:o}return t}function th(e,t){return eh(e,t,Zv)}function rh(t,r){var n=th(t,r);if(16384&n.flags){if(e.isEntityNameExpression(r)){var i=e.entityNameToString(r);if(e.isIdentifier(r)&&"undefined"===i)return Qn(r,e.Diagnostics.The_value_0_cannot_be_used_here,i),n;if(i.length<100)return Qn(r,e.Diagnostics._0_is_possibly_undefined,i),n}Qn(r,e.Diagnostics.Object_is_possibly_undefined);}return n}function nh(e,t){return 32&e.flags?function(e,t){var r=Zx(e.expression),n=pg(r,e.expression);return dg(uh(e,e.expression,th(n,e.expression),e.name,t),e,n!==r)}(e,t):uh(e,e.expression,Qv(e.expression),e.name,t)}function ih(t,r){var n=e.isPartOfTypeQuery(t)&&e.isThisIdentifier(t.left)?th(Ry(t.left),t.left):Qv(t.left);return uh(t,t.left,n,t.right,r)}function ah(t){for(;214===t.parent.kind;)t=t.parent;return e.isCallOrNewExpression(t.parent)&&t.parent.expression===t}function oh(t,r){for(var n=e.getContainingClass(r);n;n=e.getContainingClass(n)){var i=n.symbol,a=e.getSymbolNameForPrivateIdentifier(i,t),o=i.members&&i.members.get(a)||i.exports&&i.exports.get(a);if(o)return o}}function sh(t){if(e.isExpressionNode(t)){var r=di(t);return void 0===r.resolvedSymbol&&(r.resolvedSymbol=oh(t.escapedText,t)),r.resolvedSymbol}}function ch(e,t){return dl(e,t.escapedName)}function lh(t,r){return (Jo(r)||e.isThisProperty(t)&&zo(r))&&e.getThisContainer(t,!0)===Uo(r)}function uh(t,r,n,i,a){var o,s,c=di(r).resolvedSymbol,u=e.getAssignmentTargetKind(t),_=rl(0!==u||ah(t)?Cg(n):n),d=Co(_)||_===lt;if(e.isPrivateIdentifier(i)){V<99&&(0!==u&&DC(t,1048576),1!==u&&DC(t,524288));var p=oh(i.escapedText,i);if(u&&p&&p.valueDeclaration&&e.isMethodDeclaration(p.valueDeclaration)&&XC(i,e.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable,e.idText(i)),d){if(p)return Eo(_)?je:_;if(!e.getContainingClass(i))return XC(i,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),Le}if(!(o=p?ch(n,p):void 0)&&function(t,r,n){var i,a=zc(t);a&&e.forEach(a,(function(t){var n=t.valueDeclaration;if(n&&e.isNamedDeclaration(n)&&e.isPrivateIdentifier(n.name)&&n.name.escapedText===r.escapedText)return i=t,!0}));var o=Si(r);if(i){var s=e.Debug.checkDefined(i.valueDeclaration),c=e.Debug.checkDefined(e.getContainingClass(s));if(null==n?void 0:n.valueDeclaration){var u=n.valueDeclaration,_=e.getContainingClass(u);if(e.Debug.assert(!!_),e.findAncestor(_,(function(e){return c===e}))){var d=Qn(r,e.Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,o,io(t));return e.addRelatedInfo(d,e.createDiagnosticForNode(u,e.Diagnostics.The_shadowing_declaration_of_0_is_defined_here,o),e.createDiagnosticForNode(s,e.Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,o)),!0}}return Qn(r,e.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,o,Si(c.name||l)),!0}return !1}(n,i,p))return je;o&&65536&o.flags&&!(32768&o.flags)&&1!==u&&Qn(t,e.Diagnostics.Private_accessor_was_defined_without_a_getter);}else {if(d)return e.isIdentifier(r)&&c&&Py(c,t),Eo(_)?je:_;o=dl(_,i.escapedText,!1,163===t.kind);}if(e.isIdentifier(r)&&c&&(K.isolatedModules||!o||!(ZT(o)||8&o.flags&&302===t.parent.kind)||e.shouldPreserveConstEnums(K)&&Fy(t))&&Py(c,t),o){ei(o)&&X_(t,o)&&o.declarations&&ti(i,o.declarations,i.escapedText),function(t,r,n){var i,a=t.valueDeclaration;if(a&&!e.getSourceFileOfNode(r).isDeclarationFile){var o=e.idText(n);!ph(r)||function(t){return e.isPropertyDeclaration(t)&&!e.hasAccessorModifier(t)&&t.questionToken}(a)||e.isAccessExpression(r)&&e.isAccessExpression(r.expression)||gi(a,n)||e.isMethodDeclaration(a)&&32&e.getCombinedModifierFlags(a)||!K.useDefineForClassFields&&function(e){if(!(32&e.parent.flags))return !1;for(var t=ds(e.parent);;){if(!(t=t.symbol&&fh(t)))return !1;var r=dl(t,e.escapedName);if(r&&r.valueDeclaration)return !0}}(t)?260!==a.kind||180===r.parent.kind||16777216&a.flags||gi(a,n)||(i=Qn(n,e.Diagnostics.Class_0_used_before_its_declaration,o)):i=Qn(n,e.Diagnostics.Property_0_is_used_before_its_initialization,o),i&&e.addRelatedInfo(i,e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_here,o));}}(o,t,i),Th(o,t,Ch(r,c)),di(t).resolvedSymbol=o;var f=e.isWriteAccess(t);if(Wv(t,106===r.kind,f,_,o),fx(t,o,u))return Qn(i,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,e.idText(i)),je;s=lh(t,o)?Re:f?_s(o):ds(o);}else {var g=e.isPrivateIdentifier(i)||0!==u&&rd(n)&&!e.isThisTypeParameter(n)?void 0:Tl(_,i.escapedText);if(!g||!g.type){var m=_h(t,n.symbol,!0);return !m&&G_(n)?Le:n.symbol===le?(le.exports.has(i.escapedText)&&418&le.exports.get(i.escapedText).flags?Qn(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(i.escapedText),io(n)):Z&&Qn(i,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature,io(n)),Le):(i.escapedText&&!Ci(t)&&gh(i,e.isThisTypeParameter(n)?_:n,m),je)}g.isReadonly&&(e.isAssignmentTarget(t)||e.isDeleteTarget(t))&&Qn(t,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,io(_)),s=K.noUncheckedIndexedAccess&&!e.isAssignmentTarget(t)?b_([g.type,qe]):g.type,K.noPropertyAccessFromIndexSignature&&e.isPropertyAccessExpression(t)&&Qn(i,e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0,e.unescapeLeadingUnderscores(i.escapedText)),g.declaration&&268435456&e.getCombinedNodeFlags(g.declaration)&&ti(i,[g.declaration],i.escapedText);}return dh(t,o,s,i,a)}function _h(t,r,n){var i=e.getSourceFileOfNode(t);if(i&&void 0===K.checkJs&&void 0===i.checkJsDirective&&(1===i.scriptKind||2===i.scriptKind)){var a=e.forEach(null==r?void 0:r.declarations,e.getSourceFileOfNode);return !(i!==a&&a&&pi(a)||n&&r&&32&r.flags||t&&n&&e.isPropertyAccessExpression(t)&&108===t.expression.kind)}return !1}function dh(t,r,n,i,a){var o=e.getAssignmentTargetKind(t);if(1===o)return fg(n,!!(r&&16777216&r.flags));if(r&&!(98311&r.flags)&&!(8192&r.flags&&1048576&n.flags)&&!yT(r.declarations))return n;if(n===Re)return Vo(t,r);n=Ay(n,t,a);var s=!1;if(G&&Y&&e.isAccessExpression(t)&&108===t.expression.kind){var c=r&&r.valueDeclaration;if(c&&$S(c)&&!e.isStatic(c)){var l=Sy(t);173!==l.kind||l.parent!==c.parent||16777216&c.flags||(s=!0);}}else G&&r&&r.valueDeclaration&&e.isPropertyAccessExpression(r.valueDeclaration)&&e.getAssignmentDeclarationPropertyAccessKind(r.valueDeclaration)&&Sy(t)===Sy(r.valueDeclaration)&&(s=!0);var u=Dy(t,n,s?cg(n):n);return s&&!Zp(n)&&Zp(u)?(Qn(i,e.Diagnostics.Property_0_is_used_before_being_assigned,ro(r)),n):o?Gf(u):u}function ph(t){return !!e.findAncestor(t,(function(t){switch(t.kind){case 169:return !0;case 299:case 171:case 174:case 175:case 301:case 164:case 236:case 291:case 288:case 289:case 290:case 283:case 230:case 294:return !1;case 216:case 241:return !(!e.isBlock(t.parent)||!e.isClassStaticBlockDeclaration(t.parent.parent))||"quit";default:return !e.isExpressionNode(t)&&"quit"}}))}function fh(e){var t=Ns(e);if(0!==t.length)return N_(t)}function gh(t,r,n){var i,a;if(!e.isPrivateIdentifier(t)&&1048576&r.flags&&!(131068&r.flags))for(var o=0,s=r.types;o<s.length;o++){var c=s[o];if(!dl(c,t.escapedText)&&!Tl(c,t.escapedText)){i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),io(c));break}}if(mh(t.escapedText,r)){var l=e.declarationNameToString(t),u=io(r);i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,u,u+"."+l);}else {var _=hD(r);if(_&&dl(_,t.escapedText))i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),io(r)),a=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);else {var d=e.declarationNameToString(t),p=io(r),f=function(t,r){var n=rl(r).symbol;if(n)for(var i=e.getScriptTargetFeatures(),a=0,o=e.getOwnKeys(i);a<o.length;a++){var s=o[a],c=i[s][e.symbolName(n)];if(void 0!==c&&e.contains(c,t))return s}}(d,r);if(void 0!==f)i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,d,p,f);else {var g=vh(t,r);if(void 0!==g){var m=e.symbolName(g),y=n?e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2:e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;i=e.chainDiagnosticMessages(i,y,d,p,m),a=g.valueDeclaration&&e.createDiagnosticForNode(g.valueDeclaration,e.Diagnostics._0_is_declared_here,m);}else {var v=function(t){return K.lib&&!K.lib.includes("dom")&&(n=function(t){return t.symbol&&/^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(e.unescapeLeadingUnderscores(t.symbol.escapedName))},3145728&(r=t).flags?e.every(r.types,n):n(r))&&Xp(t);var r,n;}(r)?e.Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:e.Diagnostics.Property_0_does_not_exist_on_type_1;i=e.chainDiagnosticMessages(_l(i,r),v,d,p);}}}}var h=e.createDiagnosticForNodeFromMessageChain(t,i);a&&e.addRelatedInfo(h,a),Xn(!n||i.code!==e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,h);}function mh(t,r){var n=r.symbol&&dl(ds(r.symbol),t);return void 0!==n&&!!n.valueDeclaration&&e.isStatic(n.valueDeclaration)}function yh(e,t){return Sh(e,zc(t),106500)}function vh(t,r){var n=zc(r);if("string"!=typeof t){var i=t.parent;e.isPropertyAccessExpression(i)&&(n=e.filter(n,(function(e){return Eh(i,r,e)}))),t=e.idText(t);}return Sh(t,n,111551)}function hh(t,r){var n=e.isString(t)?t:e.idText(t),i=zc(r),a="for"===n?e.find(i,(function(t){return "htmlFor"===e.symbolName(t)})):"class"===n?e.find(i,(function(t){return "className"===e.symbolName(t)})):void 0;return null!=a?a:Sh(n,i,111551)}function bh(t,r){var n=vh(t,r);return n&&e.symbolName(n)}function xh(t,r,n){e.Debug.assert(void 0!==r,"outername should always be defined");var i=hi(t,r,n,void 0,r,!1,!1,!0,(function(t,n,i){e.Debug.assertEqual(r,n,"name should equal outerName");var a,o=fi(t,n,i);return o||(a=t===se?e.mapDefined(["string","number","boolean","object","bigint","symbol"],(function(e){return t.has(e.charAt(0).toUpperCase()+e.slice(1))?ri(524288,e):void 0})).concat(e.arrayFrom(t.values())):e.arrayFrom(t.values()),Sh(e.unescapeLeadingUnderscores(n),a,i))}));return i}function Dh(t,r){return r.exports&&Sh(e.idText(t),fa(r),2623475)}function Sh(t,r,n){return e.getSpellingSuggestion(t,r,(function(t){var r=e.symbolName(t);if(!e.startsWith(r,'"')){if(t.flags&n)return r;if(2097152&t.flags){var i=function(e){if(_i(e).aliasTarget!==Ie)return Qi(e)}(t);if(i&&i.flags&n)return r}}}))}function Th(t,r,n){var i=t&&106500&t.flags&&t.valueDeclaration;if(i){var a=e.hasEffectiveModifier(i,8),o=t.valueDeclaration&&e.isNamedDeclaration(t.valueDeclaration)&&e.isPrivateIdentifier(t.valueDeclaration.name);if((a||o)&&(!r||!e.isWriteOnlyAccess(r)||65536&t.flags)){if(n){var s=e.findAncestor(r,e.isFunctionLikeDeclaration);if(s&&s.symbol===t)return}(1&e.getCheckFlags(t)?_i(t).target:t).isReferenced=67108863;}}}function Ch(t,r){return 108===t.kind||!!r&&e.isEntityNameExpression(t)&&r===dm(e.getFirstIdentifier(t))}function Eh(e,t,r){return Nh(e,208===e.kind&&106===e.expression.kind,!1,t,r)}function kh(e,t,r,n){if(Co(n))return !0;var i=dl(n,r);return !!i&&Nh(e,t,!1,n,i)}function Nh(t,r,n,i,a){if(Co(i))return !0;if(a.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(a.valueDeclaration)){var o=e.getContainingClass(a.valueDeclaration);return !e.isOptionalChain(t)&&!!e.findAncestor(t,(function(e){return e===o}))}return Hv(t,r,n,i,a)}function Ah(t){var r=t.initializer;if(258===r.kind){var n=r.declarations[0];if(n&&!e.isBindingPattern(n.name))return Da(n)}else if(79===r.kind)return dm(r)}function Fh(t,r,n){var i=0!==e.getAssignmentTargetKind(t)||ah(t)?Cg(r):r,a=t.argumentExpression,o=Zx(a);if(Eo(i)||i===lt)return i;if(xx(i)&&!e.isStringLiteralLike(a))return Qn(a,e.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal),je;var s=function(t){var r,n=e.skipParentheses(t);if(79===n.kind){var i=dm(n);if(3&i.flags)for(var a=t,o=t.parent;o;){if(246===o.kind&&a===o.statement&&Ah(o)===i&&1===hl(r=Qx(o.expression)).length&&bl(r,Ze))return !0;a=o,o=o.parent;}}return !1}(a)?Ze:o,c=_d(i,s,e.isAssignmentTarget(t)?4|(rd(i)&&!e.isThisTypeParameter(i)?2:0):32,t)||je;return pD(dh(t,di(t).resolvedSymbol,c,a,n),t)}function Ph(t){return e.isCallOrNewExpression(t)||e.isTaggedTemplateExpression(t)||e.isJsxOpeningLikeElement(t)}function wh(t){return Ph(t)&&e.forEach(t.typeArguments,vT),212===t.kind?Zx(t.template):e.isJsxOpeningLikeElement(t)?Zx(t.attributes):167!==t.kind&&e.forEach(t.arguments,(function(e){Zx(e);})),Jr}function Ih(e){return wh(e),zr}function Oh(e){return !!e&&(227===e.kind||234===e.kind&&e.isSpread)}function Mh(t){return e.findIndex(t,Oh)}function Lh(e){return !!(16384&e.flags)}function Rh(e){return !!(49155&e.flags)}function Bh(t,r,n,i){var a;void 0===i&&(i=!1);var o=!1,s=Vb(n),c=qb(n);if(212===t.kind)if(a=r.length,225===t.template.kind){var l=e.last(t.template.templateSpans);o=e.nodeIsMissing(l.literal)||!!l.literal.isUnterminated;}else {var u=t.template;e.Debug.assert(14===u.kind),o=!!u.isUnterminated;}else if(167===t.kind)a=eb(t,n);else if(e.isJsxOpeningLikeElement(t)){if(o=t.attributes.end===t.end)return !0;a=0===c?r.length:1,s=0===r.length?s:1,c=Math.min(c,1);}else {if(!t.arguments)return e.Debug.assert(211===t.kind),0===qb(n);a=i?r.length+1:r.length,o=t.arguments.end===t.end;var _=Mh(r);if(_>=0)return _>=qb(n)&&(Wb(n)||_<Vb(n))}if(!Wb(n)&&a>s)return !1;if(o||a>=c)return !0;for(var d=a;d<c;d++)if(131072&Zm(zb(n,d),e.isInJSFile(t)&&!G?Rh:Lh).flags)return !1;return !0}function jh(t,r){var n=e.length(t.typeParameters),i=wl(t.typeParameters);return !e.some(r)||r.length>=i&&r.length<=n}function Jh(e){return Uh(e,0,!1)}function zh(e){return Uh(e,0,!1)||Uh(e,1,!1)}function Uh(e,t,r){if(524288&e.flags){var n=Rc(e);if(r||0===n.properties.length&&0===n.indexInfos.length){if(0===t&&1===n.callSignatures.length&&0===n.constructSignatures.length)return n.callSignatures[0];if(1===t&&1===n.constructSignatures.length&&0===n.callSignatures.length)return n.constructSignatures[0]}}}function Kh(t,r,n,i){var a=wg(t.typeParameters,t,0,i),o=Hb(r),s=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return Fg(s?up(r,s):r,t,(function(e,t){nm(a.inferences,e,t);})),n||Pg(r,t,(function(e,t){nm(a.inferences,e,t,128);})),Wl(t,um(a),e.isInJSFile(r.declaration))}function Vh(t){if(!t)return st;var r=Zx(t);return e.isOptionalChainRoot(t.parent)?lg(r):e.isOptionalChain(t.parent)?_g(r):r}function qh(t,r,n,i,a){if(e.isJsxOpeningLikeElement(t))return function(e,t,r,n){var i=uv(t,e),a=wx(e.attributes,i,n,r);return nm(n.inferences,a,i),um(n)}(t,r,i,a);if(167!==t.kind){var o=e.every(r.typeParameters,(function(e){return !!$c(e)})),s=cv(t,o?8:0);if(s){var c=Ul(r);if(jg(c)){var l=lv(t);if(o||cv(t,8)===s){var u=Bg(function(t,r){return void 0===r&&(r=0),t&&Ig(e.map(t.inferences,Rg),t.signature,t.flags|r,t.compareTypes)}(l,1)),_=hp(s,u),d=Jh(_),p=d&&d.typeParameters?Yl(Hl(d,d.typeParameters)):_;nm(a.inferences,p,c,128);}var f=wg(r.typeParameters,r,a.flags),g=hp(s,l&&l.returnMapper);nm(f.inferences,g,c),a.returnMapper=e.some(f.inferences,Vx)?Bg(function(t){var r=e.filter(t.inferences,Vx);return r.length?Ig(e.map(r,Rg),t.signature,t.flags,t.compareTypes):void 0}(f)):void 0;}}}var m=Gb(r),y=m?Math.min(Vb(r)-1,n.length):n.length;if(m&&262144&m.flags){var v=e.find(a.inferences,(function(e){return e.typeParameter===m}));v&&(v.impliedArity=e.findIndex(n,Oh,y)<0?n.length-y:void 0);}var h=jl(r);if(h&&jg(h)){var b=Yh(t);nm(a.inferences,Vh(b),h);}for(var x=0;x<y;x++){var D=n[x];if(229!==D.kind&&!(32&i&&Gg(D))){var S=zb(r,x);if(jg(S)){var T=wx(D,S,a,i);nm(a.inferences,T,S);}}}if(m&&jg(m)){var C=Hh(n,y,n.length,m,a,i);nm(a.inferences,C,m);}return um(a)}function Wh(e){return 1048576&e.flags?ty(e,Wh):1&e.flags||Lf(Gc(e)||e)?e:$f(e)?a_(fu(e),e.target.elementFlags,!1,e.target.labeledElementDeclarations):a_([e],[8])}function Hh(t,r,n,i,a,o){if(r>=n-1&&Oh(_=t[n-1]))return Wh(234===_.kind?_.type:wx(_.expression,i,a,o));for(var s=[],c=[],l=[],u=r;u<n;u++){var _;if(Oh(_=t[u])){var d=234===_.kind?_.type:Zx(_.expression);Bf(d)?(s.push(d),c.push(8)):(s.push(fS(33,d,qe,227===_.kind?_.expression:_)),c.push(4));}else {var p=ld(i,Jd(u-r),256),f=wx(_,p,a,o),g=vx(p,406978556);s.push(g?Rd(f):Qf(f)),c.push(1);}234===_.kind&&_.tupleNameSource&&l.push(_.tupleNameSource);}return a_(s,c,!1,e.length(l)===e.length(s)?l:void 0)}function Gh(t,r,n,i){for(var a,o=e.isInJSFile(t.declaration),s=t.typeParameters,c=Il(e.map(r,Hd),s,wl(s),o),l=0;l<r.length;l++){e.Debug.assert(void 0!==s[l],"Should not call checkTypeArguments with too many type arguments");var u=Kc(s[l]);if(u){var _=n&&i?function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1)}:void 0,d=i||e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;a||(a=$d(s,c));var p=c[l];if(!Rp(p,oc(hp(u,a),p),n?r[l]:void 0,d,_))return}}return c}function Qh(t){if(Cv(t.tagName))return 2;var r=rl(Zx(t.tagName));return e.length(fl(r,1))?0:e.length(fl(r,0))?1:2}function Xh(t,r,n,i,a,o,s){var c={errors:void 0,skipLogging:!0};if(e.isJsxOpeningLikeElement(t))return function(t,r,n,i,a,o,s){var c=uv(r,t),l=wx(t.attributes,c,void 0,i);return function(){var r;if(Pv(t))return !0;var n=e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)&&!Cv(t.tagName)?Zx(t.tagName):void 0;if(!n)return !0;var i=fl(n,0);if(!e.length(i))return !0;var o=hC(t);if(!o)return !0;var c=ia(o,111551,!0,!1,t);if(!c)return !0;var l=fl(ds(c),0);if(!e.length(l))return !0;for(var u=!1,_=0,d=0,p=l;d<p.length;d++){var f=fl(zb(p[d],0),0);if(e.length(f))for(var g=0,m=f;g<m.length;g++){var y=m[g];if(u=!0,Wb(y))return !0;var v=Vb(y);v>_&&(_=v);}}if(!u)return !0;for(var h=1/0,b=0,x=i;b<x.length;b++){var D=qb(x[b]);D<h&&(h=D);}if(h<=_)return !0;if(a){var S=e.createDiagnosticForNode(t.tagName,e.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3,e.entityNameToString(t.tagName),h,e.entityNameToString(o),_),T=null===(r=OT(t.tagName))||void 0===r?void 0:r.valueDeclaration;T&&e.addRelatedInfo(S,e.createDiagnosticForNode(T,e.Diagnostics._0_is_declared_here,e.entityNameToString(t.tagName))),s&&s.skipLogging&&(s.errors||(s.errors=[])).push(S),s.skipLogging||Pn.add(S);}return !1}()&&jp(l,c,n,a?t.tagName:void 0,t.attributes,void 0,o,s)}(t,n,i,a,o,s,c)?void 0:(e.Debug.assert(!o||!!c.errors,"jsx should have errors when reporting errors"),c.errors||e.emptyArray);var l=jl(n);if(l&&l!==st&&211!==t.kind){var u=Yh(t),_=Vh(u),d=o?u||t:void 0,p=e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;if(!sf(_,l,i,d,p,s,c))return e.Debug.assert(!o||!!c.errors,"this parameter should have errors when reporting errors"),c.errors||e.emptyArray}for(var f=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1,g=Gb(n),m=g?Math.min(Vb(n)-1,r.length):r.length,y=0;y<m;y++){var v=r[y];if(229!==v.kind){var h=zb(n,y),b=wx(v,h,void 0,a),x=4&a?hg(b):b;if(!jp(x,h,i,o?v:void 0,v,f,s,c))return e.Debug.assert(!o||!!c.errors,"parameter should have errors when reporting errors"),T(v,x,h),c.errors||e.emptyArray}}if(g){var D=Hh(r,m,r.length,g,void 0,a),S=r.length-m;if(d=o?0===S?t:1===S?r[m]:e.setTextRangePosEnd(Zh(t,D),r[m].pos,r[r.length-1].end):void 0,!sf(D,g,i,d,f,void 0,c))return e.Debug.assert(!o||!!c.errors,"rest parameter should have errors when reporting errors"),T(d,D,g),c.errors||e.emptyArray}return;function T(t,r,n){if(t&&o&&c.errors&&c.errors.length){if(vD(n))return;var a=vD(r);a&&rf(a,n,i)&&e.addRelatedInfo(c.errors[0],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await));}}}function Yh(t){var r=210===t.kind?t.expression:212===t.kind?t.tag:void 0;if(r){var n=e.skipOuterExpressions(r);if(e.isAccessExpression(n))return n.expression}}function Zh(t,r,n,i){var a=e.parseNodeFactory.createSyntheticExpression(r,n,i);return e.setTextRange(a,t),e.setParent(a,t),a}function $h(t){if(212===t.kind){var r=t.template,n=[Zh(r,Tr||(Tr=Bu("TemplateStringsArray",0,!0)||Ct))];return 225===r.kind&&e.forEach(r.templateSpans,(function(e){n.push(e.expression);})),n}if(167===t.kind)return function(t){var r=t.parent,n=t.expression;switch(r.kind){case 260:case 228:return [Zh(n,ds(Da(r)))];case 166:var i=r.parent;return [Zh(n,173===r.parent.kind?ds(Da(i)):je),Zh(n,Le),Zh(n,Ze)];case 169:case 171:case 174:case 175:var a=0!==V&&(!e.isPropertyDeclaration(r)||e.hasAccessorModifier(r));return [Zh(n,BT(r)),Zh(n,jT(r)),Zh(n,a?Zu(MT(r)):Le)]}return e.Debug.fail()}(t);if(e.isJsxOpeningLikeElement(t))return t.attributes.properties.length>0||e.isJsxOpeningElement(t)&&t.parent.children.length>0?[t.attributes]:e.emptyArray;var i=t.arguments||e.emptyArray,a=Mh(i);if(a>=0){for(var o=i.slice(0,a),s=function(t){var r=i[t],n=227===r.kind&&(rn?Zx(r.expression):Ix(r.expression));n&&$f(n)?e.forEach(fu(n),(function(e,t){var i,a=n.target.elementFlags[t],s=Zh(r,4&a?$u(e):e,!!(12&a),null===(i=n.target.labeledElementDeclarations)||void 0===i?void 0:i[t]);o.push(s);})):o.push(r);},c=a;c<i.length;c++)s(c);return o}return i}function eb(t,r){switch(t.parent.kind){case 260:case 228:return 1;case 169:return e.hasAccessorModifier(t.parent)?3:2;case 171:case 174:case 175:return 0===V||r.parameters.length<=2?2:3;case 166:return 3;default:return e.Debug.fail()}}function tb(t,r){var n,i,a=e.getSourceFileOfNode(t);if(e.isPropertyAccessExpression(t.expression)){var o=e.getErrorSpanForNode(a,t.expression.name);n=o.start,i=r?o.length:t.end-n;}else {var s=e.getErrorSpanForNode(a,t.expression);n=s.start,i=r?s.length:t.end-n;}return {start:n,length:i,sourceFile:a}}function rb(t,r,n,i,a,o){if(e.isCallExpression(t)){var s=tb(t),c=s.sourceFile,l=s.start,u=s.length;return e.createFileDiagnostic(c,l,u,r,n,i,a,o)}return e.createDiagnosticForNode(t,r,n,i,a,o)}function nb(t,r,n){var i,a=Mh(n);if(a>-1)return e.createDiagnosticForNode(n[a],e.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);for(var o,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,_=0,d=r;_<d.length;_++){var p=d[_],f=qb(p),g=Vb(p);f<s&&(s=f,o=p),c=Math.max(c,g),f<n.length&&f>l&&(l=f),n.length<g&&g<u&&(u=g);}var m=e.some(r,Wb),y=m?s:s<c?s+"-"+c:s,v=!m&&1===y&&0===n.length&&function(t){if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return !1;var r=vi(t.expression,t.expression.escapedText,111551,void 0,void 0,!1),n=null==r?void 0:r.valueDeclaration;if(!(n&&e.isParameter(n)&&e.isFunctionExpressionOrArrowFunction(n.parent)&&e.isNewExpression(n.parent.parent)&&e.isIdentifier(n.parent.parent.expression)))return !1;var i=Wu(!1);return !!i&&OT(n.parent.parent.expression,!0)===i}(t);if(v&&e.isInJSFile(t))return rb(t,e.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments);var h=m?e.Diagnostics.Expected_at_least_0_arguments_but_got_1:v?e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:e.Diagnostics.Expected_0_arguments_but_got_1;if(s<n.length&&n.length<c)return rb(t,e.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments,n.length,l,u);if(n.length<s){var b=rb(t,h,y,n.length),x=null===(i=null==o?void 0:o.declaration)||void 0===i?void 0:i.parameters[o.thisParameter?n.length+1:n.length];if(x){var D=e.createDiagnosticForNode(x,e.isBindingPattern(x.name)?e.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided:e.isRestParameter(x)?e.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided:e.Diagnostics.An_argument_for_0_was_not_provided,x.name?e.isBindingPattern(x.name)?void 0:e.idText(e.getFirstIdentifier(x.name)):n.length);return e.addRelatedInfo(b,D)}return b}var S=e.factory.createNodeArray(n.slice(c)),T=e.first(S).pos,C=e.last(S).end;return C===T&&C++,e.setTextRangePosEnd(S,T,C),e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),S,h,y,n.length)}function ib(t,r,i,a,o,s){var c,l=212===t.kind,u=167===t.kind,_=e.isJsxOpeningLikeElement(t),d=!i;u||e.isSuperCall(t)||(c=t.typeArguments,(l||_||106!==t.expression.kind)&&e.forEach(c,vT));var p=i||[];if(function(t,r,n){var i,a,o,s,c=0,l=-1;e.Debug.assert(!r.length);for(var u=0,_=t;u<_.length;u++){var d=_[u],p=d.declaration&&Da(d.declaration),f=d.declaration&&d.declaration.parent;a&&p!==a?(o=c=r.length,i=f):i&&f===i?o+=1:(i=f,o=c),a=p,J(d)?(s=++l,c++):s=o,r.splice(s,0,n?_c(d,n):d);}}(r,p,o),!p.length)return d&&Pn.add(rb(t,e.Diagnostics.Call_target_does_not_contain_any_signatures)),Ih(t);var f,g,m,y,v=$h(t),h=1===p.length&&!p[0].typeParameters,b=u||h||!e.some(v,Tp)?0:4;b|=32&a;var x=!!(16&a)&&210===t.kind&&t.arguments.hasTrailingComma;if(p.length>1&&(y=q(p,On,h,x)),y||(y=q(p,Ln,h,x)),y)return y;if(y=function(t,r,n,i,a){return e.Debug.assert(r.length>0),xT(t),i||1===r.length||r.some((function(e){return !!e.typeParameters}))?function(t,r,n,i){var a=function(e,t){for(var r=-1,n=-1,i=0;i<e.length;i++){var a=e[i],o=Vb(a);if(Wb(a)||o>=t)return i;o>n&&(n=o,r=i);}return r}(r,void 0===ue?n.length:ue),o=r[a],s=o.typeParameters;if(!s)return o;var c=Ph(t)?t.typeArguments:void 0,l=c?Gl(o,function(e,t,r){for(var n=e.map(MT);n.length>t.length;)n.pop();for(;n.length<t.length;)n.push($c(t[n.length])||Kc(t[n.length])||lm(r));return n}(c,s,e.isInJSFile(t))):function(t,r,n,i,a){return Gl(n,qh(t,n,i,12|a,wg(r,n,e.isInJSFile(t)?2:0)))}(t,s,o,n,i);return r[a]=l,l}(t,r,n,a):function(t){var r,n=e.mapDefined(t,(function(e){return e.thisParameter}));n.length&&(r=ob(n,n.map(Mb)));for(var i=e.minAndMax(t,ab),a=i.min,o=i.max,s=[],c=function(r){var n=e.mapDefined(t,(function(t){return j(t)?r<t.parameters.length-1?t.parameters[r]:e.last(t.parameters):r<t.parameters.length?t.parameters[r]:void 0}));e.Debug.assert(0!==n.length),s.push(ob(n,e.mapDefined(t,(function(e){return Ub(e,r)}))));},l=0;l<o;l++)c(l);var u=e.mapDefined(t,(function(t){return j(t)?e.last(t.parameters):void 0})),_=0;if(0!==u.length){var d=$u(b_(e.mapDefined(t,ql),2));s.push(sb(u,d)),_|=1;}return t.some(J)&&(_|=2),cc(t[0].declaration,void 0,r,s,N_(t.map(Ul)),void 0,a,_)}(r)}(t,p,v,!!i,a),di(t).resolvedSignature=y,d)if(f)if(1===f.length||f.length>3){var D,S=f[f.length-1];f.length>3&&(D=e.chainDiagnosticMessages(D,e.Diagnostics.The_last_overload_gave_the_following_error),D=e.chainDiagnosticMessages(D,e.Diagnostics.No_overload_matches_this_call));var T=Xh(t,v,S,Ln,0,!0,(function(){return D}));if(T)for(var C=0,E=T;C<E.length;C++){var k=E[C];S.declaration&&f.length>3&&e.addRelatedInfo(k,e.createDiagnosticForNode(S.declaration,e.Diagnostics.The_last_overload_is_declared_here)),V(S,k),Pn.add(k);}else e.Debug.fail("No error for last overload signature");}else {for(var N=[],A=0,F=Number.MAX_VALUE,P=0,w=0,I=function(r){var n=Xh(t,v,r,Ln,0,!0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Overload_0_of_1_2_gave_the_following_error,w+1,p.length,no(r))}));n?(n.length<=F&&(F=n.length,P=w),A=Math.max(A,n.length),N.push(n)):e.Debug.fail("No error for 3 or fewer overload signatures"),w++;},O=0,M=f;O<M.length;O++)I(M[O]);var L=A>1?N[P]:e.flatten(N);e.Debug.assert(L.length>0,"No errors reported for 3 or fewer overload signatures");var R=e.chainDiagnosticMessages(e.map(L,e.createDiagnosticMessageChainFromDiagnostic),e.Diagnostics.No_overload_matches_this_call),B=n$4([],e.flatMap(L,(function(e){return e.relatedInformation})),!0),z=void 0;if(e.every(L,(function(e){return e.start===L[0].start&&e.length===L[0].length&&e.file===L[0].file}))){var U=L[0];z={file:U.file,start:U.start,length:U.length,code:R.code,category:R.category,messageText:R,relatedInformation:B};}else z=e.createDiagnosticForNodeFromMessageChain(t,R,B);V(f[0],z),Pn.add(z);}else if(g)Pn.add(nb(t,[g],v));else if(m)Gh(m,t.typeArguments,!0,s);else {var K=e.filter(r,(function(e){return jh(e,c)}));0===K.length?Pn.add(function(t,r,n){var i=n.length;if(1===r.length){var a=wl((_=r[0]).typeParameters),o=e.length(_.typeParameters);return e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,a<o?a+"-"+o:a,i)}for(var s=-1/0,c=1/0,l=0,u=r;l<u.length;l++){var _,d=wl((_=u[l]).typeParameters);o=e.length(_.typeParameters),d>i?c=Math.min(c,d):o<i&&(s=Math.max(s,o));}return s!==-1/0&&c!==1/0?e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments,i,s,c):e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,s===-1/0?c:s,i)}(t,r,c)):u?s&&Pn.add(rb(t,s)):Pn.add(nb(t,K,v));}return y;function V(t,r){var n,i,a=f,o=g,s=m,c=(null===(i=null===(n=t.declaration)||void 0===n?void 0:n.symbol)||void 0===i?void 0:i.declarations)||e.emptyArray,l=c.length>1?e.find(c,(function(t){return e.isFunctionLikeDeclaration(t)&&e.nodeIsPresent(t.body)})):void 0;if(l){var u=Ol(l),_=!u.typeParameters;q([u],Ln,_)&&e.addRelatedInfo(r,e.createDiagnosticForNode(l,e.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));}f=a,g=o,m=s;}function q(r,n,i,o){if(void 0===o&&(o=!1),f=void 0,g=void 0,m=void 0,i){var s=r[0];if(e.some(c)||!Bh(t,v,s,o))return;return Xh(t,v,s,n,0,!1,void 0)?void(f=[s]):s}for(var l=0;l<r.length;l++)if(jh(s=r[l],c)&&Bh(t,v,s,o)){var u=void 0,_=void 0;if(s.typeParameters){var d=void 0;if(e.some(c)){if(!(d=Gh(s,c,!1))){m=s;continue}}else _=wg(s.typeParameters,s,e.isInJSFile(t)?2:0),d=qh(t,s,v,8|b,_),b|=4&_.flags?8:0;if(u=Wl(s,d,e.isInJSFile(s.declaration),_&&_.inferredTypeParameters),Gb(s)&&!Bh(t,v,u,o)){g=u;continue}}else u=s;if(!Xh(t,v,u,n,b,!1,void 0)){if(b){if(b=32&a,_&&(u=Wl(s,d=qh(t,s,v,b,_),e.isInJSFile(s.declaration),_.inferredTypeParameters),Gb(s)&&!Bh(t,v,u,o))){g=u;continue}if(Xh(t,v,u,n,b,!1,void 0)){(f||(f=[])).push(u);continue}}return r[l]=u,u}(f||(f=[])).push(u);}}}function ab(e){var t=e.parameters.length;return j(e)?t-1:t}function ob(e,t){return sb(e,b_(t,2))}function sb(t,r){return vg(e.first(t),r)}function cb(e){return !(!e.typeParameters||!lC(Ul(e)))}function lb(e,t,r,n){return Co(e)||Co(t)&&!!(262144&e.flags)||!r&&!n&&!(1048576&t.flags)&&!(131072&sl(t).flags)&&Ip(e,Wt)}function ub(t,r,n){if(t.arguments&&V<1){var i=Mh(t.arguments);i>=0&&Qn(t.arguments[i],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher);}var a=Qv(t.expression);if(a===lt)return Kr;if(Eo(a=rl(a)))return Ih(t);if(Co(a))return t.typeArguments&&Qn(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),wh(t);var o=fl(a,1);if(o.length){if(!function(t,r){if(!r||!r.declaration)return !0;var n=r.declaration,i=e.getSelectedEffectiveModifierFlags(n,24);if(!i||173!==n.kind)return !0;var a=e.getClassLikeDeclarationOfSymbol(n.parent.symbol),o=Js(n.parent.symbol);if(!FT(t,a)){var s=e.getContainingClass(t);if(s&&16&i){var c=MT(s);if(db(n.parent.symbol,c))return !0}return 8&i&&Qn(t,e.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,io(o)),16&i&&Qn(t,e.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,io(o)),!1}return !0}(t,o[0]))return Ih(t);if(_b(o,(function(e){return !!(4&e.flags)})))return Qn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Ih(t);var s=a.symbol&&e.getClassLikeDeclarationOfSymbol(a.symbol);return s&&e.hasSyntacticModifier(s,256)?(Qn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Ih(t)):ib(t,o,r,n,0)}var c=fl(a,0);if(c.length){var l=ib(t,c,r,n,0);return Z||(l.declaration&&!bb(l.declaration)&&Ul(l)!==st&&Qn(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),jl(l)===st&&Qn(t,e.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),l}return fb(t.expression,a,1),Ih(t)}function _b(t,r){return e.isArray(t)?e.some(t,(function(e){return _b(e,r)})):1048576===t.compositeKind?e.some(t.compositeSignatures,r):r(t)}function db(t,r){var n=Ns(r);if(!e.length(n))return !1;var i=n[0];if(2097152&i.flags){for(var a=hc(i.types),o=0,s=0,c=i.types;s<c.length;s++){var l=c[s];if(!a[o]&&3&e.getObjectFlags(l)){if(l.symbol===t)return !0;if(db(t,l))return !0}o++;}return !1}return i.symbol===t||db(t,i)}function pb(t,r,n){var i,a=0===n,o=CD(r),s=o&&fl(o,n).length>0;if(1048576&r.flags){for(var c=!1,l=0,u=r.types;l<u.length;l++){var _=u[l];if(0!==fl(_,n).length){if(c=!0,i)break}else if(i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,io(_)),i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Not_all_constituents_of_type_0_are_callable:e.Diagnostics.Not_all_constituents_of_type_0_are_constructable,io(r))),c)break}c||(i=e.chainDiagnosticMessages(void 0,a?e.Diagnostics.No_constituent_of_type_0_is_callable:e.Diagnostics.No_constituent_of_type_0_is_constructable,io(r))),i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:e.Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,io(r)));}else i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,io(r));var d=a?e.Diagnostics.This_expression_is_not_callable:e.Diagnostics.This_expression_is_not_constructable;if(e.isCallExpression(t.parent)&&0===t.parent.arguments.length){var p=di(t).resolvedSymbol;p&&32768&p.flags&&(d=e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without);}return {messageChain:e.chainDiagnosticMessages(i,d),relatedMessage:s?e.Diagnostics.Did_you_forget_to_use_await:void 0}}function fb(t,r,n,i){var a=pb(t,r,n),o=a.messageChain,s=a.relatedMessage,c=e.createDiagnosticForNodeFromMessageChain(t,o);if(s&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,s)),e.isCallExpression(t.parent)){var l=tb(t.parent,!0),u=l.start,_=l.length;c.start=u,c.length=_;}Pn.add(c),gb(r,n,i?e.addRelatedInfo(c,i):c);}function gb(t,r,n){if(t.symbol){var i=_i(t.symbol).originatingImport;if(i&&!e.isImportCall(i)){var a=fl(ds(_i(t.symbol).target),r);if(!a||!a.length)return;e.addRelatedInfo(n,e.createDiagnosticForNode(i,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));}}}function mb(t,r){var n=wv(t),i=n&&ya(n),a=i&&fi(i,A.Element,788968),o=a&&oe.symbolToEntityName(a,788968,t),s=e.factory.createFunctionTypeNode(void 0,[e.factory.createParameterDeclaration(void 0,void 0,"props",void 0,oe.typeToTypeNode(r,t))],o?e.factory.createTypeReferenceNode(o,void 0):e.factory.createKeywordTypeNode(131)),c=ri(1,"props");return c.type=r,cc(s,void 0,void 0,[c],a?Js(a):je,void 0,1,0)}function yb(t,r,n){if(Cv(t.tagName)){var i=Rv(t),a=mb(t,i);return Bp(wx(t.attributes,uv(a,t),void 0,0),i,t.tagName,t.attributes),e.length(t.typeArguments)&&(e.forEach(t.typeArguments,vT),Pn.add(e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),t.typeArguments,e.Diagnostics.Expected_0_type_arguments_but_got_1,0,e.length(t.typeArguments)))),a}var o=Zx(t.tagName),s=rl(o);if(Eo(s))return Ih(t);var c=Mv(o,t);return lb(o,s,c.length,0)?wh(t):0===c.length?(Qn(t.tagName,e.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,e.getTextOfNode(t.tagName)),Ih(t)):ib(t,c,r,n,0)}function vb(t,r,n){switch(t.kind){case 210:return function(t,r,n){if(106===t.expression.kind){var i=Jy(t.expression);if(Co(i)){for(var a=0,o=t.arguments;a<o.length;a++)Zx(o[a]);return Jr}if(!Eo(i)){var s=e.getEffectiveBaseTypeNode(e.getContainingClass(t));if(s)return ib(t,Cs(i,s.typeArguments,s),r,n,0)}return wh(t)}var c,l=Zx(t.expression);if(e.isCallChain(t)){var u=pg(l,t.expression);c=u===l?0:e.isOutermostOptionalChain(t)?16:8,l=u;}else c=0;if((l=eh(l,t.expression,$v))===lt)return Kr;var _=rl(l);if(Eo(_))return Ih(t);var d=fl(_,0),p=fl(_,1).length;if(lb(l,_,d.length,p))return !Eo(l)&&t.typeArguments&&Qn(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),wh(t);if(!d.length){if(p)Qn(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,io(l));else {var f=void 0;if(1===t.arguments.length){var g=e.getSourceFileOfNode(t).text;e.isLineBreak(g.charCodeAt(e.skipTrivia(g,t.expression.end,!0)-1))&&(f=e.createDiagnosticForNode(t.expression,e.Diagnostics.Are_you_missing_a_semicolon));}fb(t.expression,_,0,f);}return Ih(t)}return 8&n&&!t.typeArguments&&d.some(cb)?(Kx(t,n),Ur):d.some((function(t){return e.isInJSFile(t.declaration)&&!!e.getJSDocClassTag(t.declaration)}))?(Qn(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,io(l)),Ih(t)):ib(t,d,r,n,c)}(t,r,n);case 211:return ub(t,r,n);case 212:return function(t,r,n){var i=Zx(t.tag),a=rl(i);if(Eo(a))return Ih(t);var o=fl(a,0),s=fl(a,1).length;if(lb(i,a,o.length,s))return wh(t);if(!o.length){if(e.isArrayLiteralExpression(t.parent)){var c=e.createDiagnosticForNode(t.tag,e.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);return Pn.add(c),Ih(t)}return fb(t.tag,a,0),Ih(t)}return ib(t,o,r,n,0)}(t,r,n);case 167:return function(t,r,n){var i=Zx(t.expression),a=rl(i);if(Eo(a))return Ih(t);var o,s,c=fl(a,0),l=fl(a,1).length;if(lb(i,a,c.length,l))return wh(t);if(o=t,(s=c).length&&e.every(s,(function(e){return 0===e.minArgumentCount&&!j(e)&&e.parameters.length<eb(o,e)}))){var u=e.getTextOfNode(t.expression,!1);return Qn(t,e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0,u),Ih(t)}var _=function(t){switch(t.parent.kind){case 260:case 228:return e.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 166:return e.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 169:return e.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 171:case 174:case 175:return e.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;default:return e.Debug.fail()}}(t);if(!c.length){var d=pb(t.expression,a,0),p=e.chainDiagnosticMessages(d.messageChain,_),f=e.createDiagnosticForNodeFromMessageChain(t.expression,p);return d.relatedMessage&&e.addRelatedInfo(f,e.createDiagnosticForNode(t.expression,d.relatedMessage)),Pn.add(f),gb(a,0,f),Ih(t)}return ib(t,c,r,n,0,_)}(t,r,n);case 283:case 282:return yb(t,r,n)}throw e.Debug.assertNever(t,"Branch in 'resolveSignature' should be unreachable.")}function hb(e,t,r){var n=di(e),i=n.resolvedSignature;if(i&&i!==Ur&&!t)return i;n.resolvedSignature=Ur;var a=vb(e,t,r||0);return a!==Ur&&(n.resolvedSignature=tn===rn?a:i),a}function bb(t){var r;if(!t||!e.isInJSFile(t))return !1;var n=e.isFunctionDeclaration(t)||e.isFunctionExpression(t)?t:(e.isVariableDeclaration(t)||e.isPropertyAssignment(t))&&t.initializer&&e.isFunctionExpression(t.initializer)?t.initializer:void 0;if(n){if(e.getJSDocClassTag(t))return !0;if(e.isPropertyAssignment(e.walkUpParenthesizedExpressions(n.parent)))return !1;var i=Da(n);return !!(null===(r=null==i?void 0:i.members)||void 0===r?void 0:r.size)}return !1}function xb(t,r){var n,i;if(r){var a=_i(r);if(!a.inferredClassSymbol||!a.inferredClassSymbol.has(O(t))){var o=e.isTransientSymbol(t)?t:ai(t);return o.exports=o.exports||e.createSymbolTable(),o.members=o.members||e.createSymbolTable(),o.flags|=32&r.flags,(null===(n=r.exports)||void 0===n?void 0:n.size)&&li(o.exports,r.exports),(null===(i=r.members)||void 0===i?void 0:i.size)&&li(o.members,r.members),(a.inferredClassSymbol||(a.inferredClassSymbol=new e.Map)).set(O(o),o),o}return a.inferredClassSymbol.get(O(t))}}function Db(t,r){if(t.parent){var n,i;if(e.isVariableDeclaration(t.parent)&&t.parent.initializer===t){if(!(e.isInJSFile(t)||e.isVarConst(t.parent)&&e.isFunctionLikeDeclaration(t)))return;n=t.parent.name,i=t.parent;}else if(e.isBinaryExpression(t.parent)){var a=t.parent,o=t.parent.operatorToken.kind;if(63!==o||!r&&a.right!==t){if(!(56!==o&&60!==o||(e.isVariableDeclaration(a.parent)&&a.parent.initializer===a?(n=a.parent.name,i=a.parent):e.isBinaryExpression(a.parent)&&63===a.parent.operatorToken.kind&&(r||a.parent.right===a)&&(i=n=a.parent.left),n&&e.isBindableStaticNameExpression(n)&&e.isSameEntityName(n,a.left))))return}else i=n=a.left;}else r&&e.isFunctionDeclaration(t)&&(n=t.name,i=t);if(i&&n&&(r||e.getExpandoInitializer(t,e.isPrototypeAccess(n))))return Da(i)}}function Sb(t,r){if(t.declaration&&268435456&t.declaration.flags){var n=Tb(r),i=e.tryGetPropertyAccessOrIdentifierToString(e.getInvokedExpression(r));a=n,o=t.declaration,s=i,c=no(t),$n(o,s?e.createDiagnosticForNode(a,e.Diagnostics.The_signature_0_of_1_is_deprecated,c,s):e.createDiagnosticForNode(a,e.Diagnostics._0_is_deprecated,c));}var a,o,s,c;}function Tb(t){switch((t=e.skipParentheses(t)).kind){case 210:case 167:case 211:return Tb(t.expression);case 212:return Tb(t.tag);case 283:case 282:return Tb(t.tagName);case 209:return t.argumentExpression;case 208:return t.name;case 180:var r=t;return e.isQualifiedName(r.typeName)?r.typeName.right:r;default:return t}}function Cb(t){if(!e.isCallExpression(t))return !1;var r=t.expression;if(e.isPropertyAccessExpression(r)&&"for"===r.name.escapedText&&(r=r.expression),!e.isIdentifier(r)||"Symbol"!==r.escapedText)return !1;var n=Uu(!1);return !!n&&n===vi(r,"Symbol",111551,void 0,void 0,!1)}function Eb(t,r,n){var i=e.createSymbolTable(),a=ri(2097152,"default");return a.parent=r,a.nameType=jd("default"),a.aliasTarget=Gi(t),i.set("default",a),Ja(n,i,e.emptyArray,e.emptyArray,e.emptyArray)}function kb(e,t,r,n){if(Ri(n)&&e&&!Eo(e)){var i=e;if(!i.defaultOnlyType){var a=Eb(t,r);i.defaultOnlyType=a;}return i.defaultOnlyType}}function Nb(t,r,n,i){var a;if(H&&t&&!Eo(t)){var o=t;if(!o.syntheticType)if(Bi(null===(a=n.declarations)||void 0===a?void 0:a.find(e.isSourceFile),n,!1,i)){var s=ri(2048,"__type"),c=Eb(r,n,s);s.type=c,o.syntheticType=Sv(t)?wd(t,c,s,0,!1):c;}else o.syntheticType=t;return o.syntheticType}return t}function Ab(t){if(!e.isRequireCall(t,!0))return !1;if(!e.isIdentifier(t.expression))return e.Debug.fail();var r=vi(t.expression,t.expression.escapedText,111551,void 0,void 0,!0);if(r===de)return !0;if(2097152&r.flags)return !1;var n=16&r.flags?259:3&r.flags?257:0;if(0!==n){var i=e.getDeclarationOfKind(r,n);return !!i&&!!(16777216&i.flags)}return !1}function Fb(e){switch(e.kind){case 10:case 14:case 8:case 9:case 110:case 95:case 206:case 207:case 225:return !0;case 214:return Fb(e.expression);case 221:var t=e.operator,r=e.operand;return 40===t&&(8===r.kind||9===r.kind)||39===t&&8===r.kind;case 208:case 209:var n=MT(e.expression).symbol;return n&&2097152&n.flags&&(n=Qi(n)),!!(n&&384&Xi(n)&&1===Ms(n))}return !1}function Pb(t,r,n,i){var a=Zx(n,i);if(e.isConstTypeReference(r))return Fb(n)||Qn(n,e.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals),Rd(a);vT(r),a=hg(Gf(a));var o=Hd(r);return Eo(o)||m((function(){var r=Cg(a);Mp(o,r)||Hp(a,o,t,e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);})),o}function wb(t){wC(t);var r=230===t.kind?Zx(t.expression):e.isThisIdentifier(t.exprName)?Ry(t.exprName):Zx(t.exprName),n=t.typeArguments;if(r===lt||Eo(r)||!e.some(n))return r;var i,a=!1,o=function r(n){var o=!1,s=!1,l=function n(i){if(524288&i.flags){var a=Rc(i),l=c(a.callSignatures),u=c(a.constructSignatures);if(o||(o=0!==a.callSignatures.length||0!==a.constructSignatures.length),s||(s=0!==l.length||0!==u.length),l!==a.callSignatures||u!==a.constructSignatures){var _=Ja(void 0,a.members,l,u,a.indexInfos);return _.objectFlags|=8388608,_.node=t,_}}else if(58982400&i.flags){var d=Gc(i);if(d){var p=n(d);if(p!==d)return p}}else {if(1048576&i.flags)return ty(i,r);if(2097152&i.flags)return N_(e.sameMap(i.types,n))}return i}(n);return a||(a=s),o&&!s&&(null!=i||(i=n)),l}(r),s=a?i:r;return s&&Pn.add(e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable,io(s))),o;function c(t){var r=e.filter(t,(function(e){return !!e.typeParameters&&jh(e,n)}));return e.sameMap(r,(function(t){var r=Gh(t,n,!0);return r?Wl(t,r,e.isInJSFile(t.declaration)):t}))}}function Ib(t){switch(t.keywordToken){case 100:return Ju();case 103:var r=Ob(t);return Eo(r)?je:function(t){var r=ri(0,"NewTargetExpression"),n=ri(4,"target",8);n.parent=r,n.type=t;var i=e.createSymbolTable([n]);return r.members=i,Ja(r,i,e.emptyArray,e.emptyArray,e.emptyArray)}(r);default:e.Debug.assertNever(t.keywordToken);}}function Ob(t){var r=e.getNewTargetContainer(t);return r?173===r.kind?ds(Da(r.parent)):ds(Da(r)):(Qn(t,e.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target"),je)}function Mb(t){var r=ds(t);if(G){var n=t.valueDeclaration;if(n&&e.hasInitializer(n))return cg(r)}return r}function Lb(t){return e.Debug.assert(e.isIdentifier(t.name)),t.name.escapedText}function Rb(e,t,r){var n=e.parameters.length-(j(e)?1:0);if(t<n)return e.parameters[t].escapedName;var i=e.parameters[n]||we,a=r||ds(i);if($f(a)){var o=a.target.labeledElementDeclarations,s=t-n;return o&&Lb(o[s])||i.escapedName+"_"+s}return i.escapedName}function Bb(t){return t.valueDeclaration&&e.isParameter(t.valueDeclaration)&&e.isIdentifier(t.valueDeclaration.name)}function jb(t){return 199===t.kind||e.isParameter(t)&&t.name&&e.isIdentifier(t.name)}function Jb(e,t){var r=e.parameters.length-(j(e)?1:0);if(t<r){var n=e.parameters[t].valueDeclaration;return n&&jb(n)?n:void 0}var i=e.parameters[r]||we,a=ds(i);if($f(a)){var o=a.target.labeledElementDeclarations;return o&&o[t-r]}return i.valueDeclaration&&jb(i.valueDeclaration)?i.valueDeclaration:void 0}function zb(e,t){return Ub(e,t)||Le}function Ub(e,t){var r=e.parameters.length-(j(e)?1:0);if(t<r)return Mb(e.parameters[t]);if(j(e)){var n=ds(e.parameters[r]),i=t-r;if(!$f(n)||n.target.hasRestElement||i<n.target.fixedLength)return ld(n,Jd(i))}}function Kb(t,r){var n=Vb(t),i=qb(t),a=Hb(t);if(a&&r>=n-1)return r===n-1?a:$u(ld(a,Ze));for(var o=[],s=[],c=[],l=r;l<n;l++){!a||l<n-1?(o.push(zb(t,l)),s.push(l<i?1:2)):(o.push(a),s.push(8));var u=Jb(t,l);u&&c.push(u);}return a_(o,s,!1,e.length(c)===e.length(o)?c:void 0)}function Vb(e){var t=e.parameters.length;if(j(e)){var r=ds(e.parameters[t-1]);if($f(r))return t+r.target.fixedLength-(r.target.hasRestElement?0:1)}return t}function qb(t,r){var n=1&r,i=2&r;if(i||void 0===t.resolvedMinArgumentCount){var a=void 0;if(j(t)){var o=ds(t.parameters[t.parameters.length-1]);if($f(o)){var s=e.findIndex(o.target.elementFlags,(function(e){return !(1&e)})),c=s<0?o.target.fixedLength:s;c>0&&(a=t.parameters.length-1+c);}}if(void 0===a){if(!n&&32&t.flags)return 0;a=t.minArgumentCount;}if(i)return a;for(var l=a-1;l>=0&&!(131072&Zm(zb(t,l),Lh).flags);l--)a=l;t.resolvedMinArgumentCount=a;}return t.resolvedMinArgumentCount}function Wb(e){if(j(e)){var t=ds(e.parameters[e.parameters.length-1]);return !$f(t)||t.target.hasRestElement}return !1}function Hb(e){if(j(e)){var t=ds(e.parameters[e.parameters.length-1]);if(!$f(t))return t;if(t.target.hasRestElement)return l_(t,t.target.fixedLength)}}function Gb(e){var t=Hb(e);return !t||If(t)||Co(t)||0!=(131072&sl(t).flags)?void 0:t}function Qb(e){return Xb(e,ct)}function Xb(e,t){return e.parameters.length>0?zb(e,0):t}function Yb(t,r){var n=_i(t);if(n.type)r&&e.Debug.assertEqual(n.type,r,"Parameter symbol already has a cached type which differs from newly assigned type");else {var i=t.valueDeclaration;n.type=r||(i?Zo(i,!0):ds(t)),i&&79!==i.name.kind&&(n.type===Ke&&(n.type=Yo(i.name)),Zb(i.name,n.type));}}function Zb(t,r){for(var n=0,i=t.elements;n<i.length;n++){var a=i[n];if(!e.isOmittedExpression(a)){var o=Mo(a,r);79===a.name.kind?_i(Da(a)).type=o:Zb(a.name,o);}}}function $b(e){var t=Vu(!0);return t!==Pt?_u(t,[e=ED(SD(e))||Ke]):Ke}function ex(e){var t=qu(!0);return t!==Pt?_u(t,[e=ED(SD(e))||Ke]):Ke}function tx(t,r){var n=$b(r);return n===Ke?(Qn(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option),je):(Wu(!0)||Qn(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),n)}function rx(t,r){if(!t.body)return je;var n,i,a,o=e.getFunctionFlags(t),s=0!=(2&o),c=0!=(1&o),l=st;if(238!==t.body.kind)n=Ix(t.body,r&&-9&r),s&&(n=SD(bD(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(c){var u=cx(t,r);u?u.length>0&&(n=b_(u,2)):l=ct;var _=function(t,r){var n=[],i=[],a=0!=(2&e.getFunctionFlags(t));return e.forEachYieldExpression(t.body,(function(t){var o,s=t.expression?Zx(t.expression,r):We;if(e.pushIfUnique(n,ix(t,s,Le,a)),t.asteriskToken){var c=xS(s,a?19:17,t.expression);o=c&&c.nextType;}else o=cv(t,void 0);o&&e.pushIfUnique(i,o);})),{yieldTypes:n,nextTypes:i}}(t,r),d=_.yieldTypes,p=_.nextTypes;i=e.some(d)?b_(d,2):void 0,a=e.some(p)?N_(p):void 0;}else {var f=cx(t,r);if(!f)return 2&o?tx(t,ct):ct;if(0===f.length)return 2&o?tx(t,st):st;n=b_(f,2);}if(n||i||a){if(i&&Ag(t,i,3),n&&Ag(t,n,1),a&&Ag(t,a,2),n&&qf(n)||i&&qf(i)||a&&qf(a)){var g=pv(t),m=g?g===Ol(t)?c?void 0:n:ov(Ul(g),t,void 0):void 0;c?(i=Zf(i,m,0,s),n=Zf(n,m,1,s),a=Zf(a,m,2,s)):n=function(e,t,r){return e&&qf(e)&&(e=Yf(e,t?r?hD(t):t:void 0)),e}(n,m,s);}i&&(i=Cg(i)),n&&(n=Cg(n)),a&&(a=Cg(a));}return c?nx(i||ct,n||l,a||Hy(2,t)||Ke,s):s?$b(n||l):n||l}function nx(e,t,r,n){var i=n?Xr:Yr,a=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||Ke,t=i.resolveIterationType(t,void 0)||Ke,r=i.resolveIterationType(r,void 0)||Ke,a===Pt){var o=i.getGlobalIterableIteratorType(!1),s=o!==Pt?CS(o,i):void 0,c=s?s.returnType:Le,l=s?s.nextType:qe;return Ip(t,c)&&Ip(l,r)?o!==Pt?Yu(o,[e]):(i.getGlobalIterableIteratorType(!0),Ct):(i.getGlobalGeneratorType(!0),Ct)}return Yu(a,[e,t,r])}function ix(t,r,n,i){var a=t.expression||t,o=t.asteriskToken?fS(i?19:17,r,n,a):r;return i?CD(o,a,t.asteriskToken?e.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:e.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function ax(e,t,r){for(var n=0,i=0;i<r.length;i++){var a=i<e||i>=t?r[i]:void 0;n|=void 0!==a?S.get(a)||32768:0;}return n}function ox(t){var r=di(t);if(void 0===r.isExhaustive){r.isExhaustive=0;var n=function(t){if(218===t.expression.kind){var r=Hm(t);if(!r)return !1;var n=Qc(Ix(t.expression.expression)),i=ax(0,0,r);return 3&n.flags?556800==(556800&i):!Xm(n,(function(e){return (Am(e)&i)===i}))}var a=Ix(t.expression);if(!Hf(a))return !1;var o,s,c=Wm(t);return !(!c.length||e.some(c,Vf))&&(o=ty(a,Rd),s=c,1048576&o.flags?!e.forEach(o.types,(function(t){return !e.contains(s,t)})):e.contains(s,o))}(t);0===r.isExhaustive&&(r.isExhaustive=n);}else 0===r.isExhaustive&&(r.isExhaustive=!1);return r.isExhaustive}function sx(e){return e.endFlowNode&&yy(e.endFlowNode)}function cx(t,r){var n=e.getFunctionFlags(t),i=[],a=sx(t),o=!1;if(e.forEachReturnStatement(t.body,(function(s){var c=s.expression;if(c){var l=Ix(c,r&&-9&r);2&n&&(l=SD(bD(l,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))),131072&l.flags&&(o=!0),e.pushIfUnique(i,l);}else a=!0;})),0!==i.length||a||!o&&!function(e){switch(e.kind){case 215:case 216:return !0;case 171:return 207===e.parent.kind;default:return !1}}(t))return !(G&&i.length&&a)||bb(t)&&i.some((function(e){return e.symbol===t.symbol}))||e.pushIfUnique(i,qe),i}function lx(t,r){m((function(){var n=e.getFunctionFlags(t),i=r&&BS(r,n);if((!i||!vx(i,16385))&&170!==t.kind&&!e.nodeIsMissing(t.body)&&238===t.body.kind&&sx(t)){var a=512&t.flags,o=e.getEffectiveReturnTypeNode(t)||t;if(i&&131072&i.flags)Qn(o,e.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);else if(i&&!a)Qn(o,e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);else if(i&&G&&!Ip(qe,i))Qn(o,e.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);else if(K.noImplicitReturns){if(!i){if(!a)return;var s=Ul(Ol(t));if(jS(t,s))return}Qn(o,e.Diagnostics.Not_all_code_paths_return_a_value);}}}));}function ux(t,r){if(e.Debug.assert(171!==t.kind||e.isObjectLiteralMethod(t)),xT(t),e.isFunctionExpression(t)&&rS(t,t.name),r&&4&r&&Tp(t)){if(!e.getEffectiveReturnTypeNode(t)&&!e.hasContextSensitiveParameters(t)){var n=fv(t);if(n&&jg(Ul(n))){var i=di(t);if(i.contextFreeType)return i.contextFreeType;var a=rx(t,r),o=cc(void 0,void 0,void 0,e.emptyArray,a,void 0,0,0),s=Ja(t.symbol,z,[o],e.emptyArray,e.emptyArray);return s.objectFlags|=262144,i.contextFreeType=s}}return wt}return AC(t)||215!==t.kind||OC(t),function(t,r){var n=di(t);if(!(1024&n.flags)){var i=fv(t);if(!(1024&n.flags)){n.flags|=1024;var a=e.firstOrUndefined(fl(ds(Da(t)),0));if(!a)return;if(Tp(t))if(i){var o=lv(t),s=void 0;if(r&&2&r){!function(t,r,n){for(var i=t.parameters.length-(j(t)?1:0),a=0;a<i;a++){var o=t.parameters[a].valueDeclaration;if(o.type){var s=e.getEffectiveTypeAnnotationNode(o);s&&nm(n.inferences,Hd(s),zb(r,a));}}}(a,i,o);var c=Hb(i);c&&262144&c.flags&&(s=up(i,o.nonFixingMapper));}s||(s=o?up(i,o.mapper):i),function(t,r){if(r.typeParameters){if(t.typeParameters)return;t.typeParameters=r.typeParameters;}r.thisParameter&&(!(a=t.thisParameter)||a.valueDeclaration&&!a.valueDeclaration.type)&&(a||(t.thisParameter=vg(r.thisParameter,void 0)),Yb(t.thisParameter,ds(r.thisParameter)));for(var n=t.parameters.length-(j(t)?1:0),i=0;i<n;i++){var a=t.parameters[i];e.getEffectiveTypeAnnotationNode(a.valueDeclaration)||Yb(a,Ub(r,i));}j(t)&&((a=e.last(t.parameters)).valueDeclaration?!e.getEffectiveTypeAnnotationNode(a.valueDeclaration):65536&e.getCheckFlags(a))&&Yb(a,Kb(r,n));}(a,s);}else !function(e){e.thisParameter&&Yb(e.thisParameter);for(var t=0,r=e.parameters;t<r.length;t++)Yb(r[t]);}(a);if(i&&!Kl(t)&&!a.resolvedReturnType){var l=rx(t,r);a.resolvedReturnType||(a.resolvedReturnType=l);}rD(t);}}}(t,r),ds(Da(t))}function _x(e,t,r,n){if(void 0===n&&(n=!1),!Ip(t,mt)){var i=n&&vD(t);return Zn(e,!!i&&Ip(i,mt),r),!1}return !0}function dx(t){if(!e.isCallExpression(t))return !1;if(!e.isBindableObjectDefinePropertyCall(t))return !1;var r=Ix(t.arguments[2]);if(To(r,"value")){var n=dl(r,"writable"),i=n&&ds(n);if(!i||i===et||i===tt)return !0;if(n&&n.valueDeclaration&&e.isPropertyAssignment(n.valueDeclaration)){var a=Zx(n.valueDeclaration.initializer);if(a===et||a===tt)return !0}return !1}return !dl(r,"set")}function px(t){return !!(8&e.getCheckFlags(t)||4&t.flags&&64&e.getDeclarationModifierFlagsFromSymbol(t)||3&t.flags&&2&Vv(t)||98304&t.flags&&!(65536&t.flags)||8&t.flags||e.some(t.declarations,dx))}function fx(t,r,n){var i,a;if(0===n)return !1;if(px(r)){if(4&r.flags&&e.isAccessExpression(t)&&108===t.expression.kind){var o=e.getContainingFunction(t);if(!o||173!==o.kind&&!bb(o))return !0;if(r.valueDeclaration){var s=e.isBinaryExpression(r.valueDeclaration),c=o.parent===r.valueDeclaration.parent,l=o===r.valueDeclaration.parent,u=s&&(null===(i=r.parent)||void 0===i?void 0:i.valueDeclaration)===o.parent,_=s&&(null===(a=r.parent)||void 0===a?void 0:a.valueDeclaration)===o;return !(c||l||u||_)}}return !0}if(e.isAccessExpression(t)){var d=e.skipParentheses(t.expression);if(79===d.kind){var p=di(d).resolvedSymbol;if(2097152&p.flags){var f=Fi(p);return !!f&&271===f.kind}}}return !1}function gx(t,r,n){var i=e.skipOuterExpressions(t,7);return 79===i.kind||e.isAccessExpression(i)?!(32&i.flags&&(Qn(t,n),1)):(Qn(t,r),!1)}function mx(e){return vx(e,2112)?hx(e,3)||vx(e,296)?mt:$e:Ze}function yx(e,t){if(vx(e,t))return !0;var r=Qc(e);return !!r&&vx(r,t)}function vx(e,t){if(e.flags&t)return !0;if(3145728&e.flags)for(var r=0,n=e.types;r<n.length;r++)if(vx(n[r],t))return !0;return !1}function hx(e,t,r){return !!(e.flags&t)||!(r&&114691&e.flags)&&(!!(296&t)&&Ip(e,Ze)||!!(2112&t)&&Ip(e,$e)||!!(402653316&t)&&Ip(e,Ye)||!!(528&t)&&Ip(e,at)||!!(16384&t)&&Ip(e,st)||!!(131072&t)&&Ip(e,ct)||!!(65536&t)&&Ip(e,Qe)||!!(32768&t)&&Ip(e,qe)||!!(4096&t)&&Ip(e,ot)||!!(67108864&t)&&Ip(e,dt))}function bx(t,r,n){return 1048576&t.flags?e.every(t.types,(function(e){return bx(e,r,n)})):hx(t,r,n)}function xx(t){return !!(16&e.getObjectFlags(t))&&!!t.symbol&&Dx(t.symbol)}function Dx(e){return 0!=(128&e.flags)}function Sx(t,r,n,i,a){void 0===a&&(a=!1);var o=t.properties,s=o[n];if(299===s.kind||300===s.kind){var c=s.name,l=M_(c);if(Xs(l)){var u=dl(r,tc(l));u&&(Th(u,s,a),Wv(s,!1,!0,r,u));}var _=Po(s,ld(r,l,32,c));return Cx(300===s.kind?s:s.initializer,_)}if(301===s.kind){if(!(n<o.length-1)){V<99&&DC(s,4);var d=[];if(i)for(var p=0,f=i;p<f.length;p++){var g=f[p];e.isSpreadAssignment(g)||d.push(g.name);}return _=No(r,d,r.symbol),kC(i,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Cx(s.expression,_)}Qn(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);}else Qn(s,e.Diagnostics.Property_assignment_expected);}function Tx(t,r,n,i,a){var o=t.elements,s=o[n];if(229!==s.kind){if(227!==s.kind){var c=Jd(n);if(Bf(r)){var l=_d(r,c,32|(gv(s)?16:0),Zh(s,c))||je;return Cx(s,Po(s,gv(s)?Fm(l,524288):l),a)}return Cx(s,i,a)}if(n<o.length-1)Qn(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);else {var u=s.expression;if(223!==u.kind||63!==u.operatorToken.kind)return kC(t.elements,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Cx(u,Ym(r,$f)?ty(r,(function(e){return l_(e,n)})):$u(i),a);Qn(u.operatorToken,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}}}function Cx(t,r,n,i){var a;if(300===t.kind){var o=t;o.objectAssignmentInitializer&&(!G||16777216&Am(Zx(o.objectAssignmentInitializer))||(r=Fm(r,524288)),function(e,t,r,n,i){var a=t.kind;if(63===a&&(207===e.kind||206===e.kind))return Cx(e,Zx(r,n),n,108===r.kind);Nx(e,t,r,55===a||56===a||60===a?_S(e,n):Zx(e,n),Zx(r,n),void 0);}(o.name,o.equalsToken,o.objectAssignmentInitializer,n)),a=t.name;}else a=t;return 223===a.kind&&63===a.operatorToken.kind&&(ie(a,n),a=a.left,G&&(r=Fm(r,524288))),207===a.kind?function(e,t,r){var n=e.properties;if(G&&0===n.length)return th(t,e);for(var i=0;i<n.length;i++)Sx(e,t,i,n,r);return t}(a,r,i):206===a.kind?function(e,t,r){var n=e.elements;V<2&&K.downlevelIteration&&DC(e,512);for(var i=fS(193,t,qe,e)||je,a=K.noUncheckedIndexedAccess?void 0:i,o=0;o<n.length;o++){var s=i;227===e.elements[o].kind&&(s=a=null!=a?a:fS(65,t,qe,e)||je),Tx(e,t,o,s,r);}return t}(a,r,n):function(t,r,n){var i=Zx(t,n);return gx(t,301===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,301===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&Bp(r,i,t,t),e.isPrivateIdentifierPropertyAccessExpression(t)&&DC(t.parent,1048576),r}(a,r,n)}function Ex(t){switch((t=e.skipParentheses(t)).kind){case 79:case 10:case 13:case 212:case 225:case 14:case 8:case 9:case 110:case 95:case 104:case 155:case 215:case 228:case 216:case 206:case 207:case 218:case 232:case 282:case 281:return !0;case 224:return Ex(t.whenTrue)&&Ex(t.whenFalse);case 223:return !e.isAssignmentOperator(t.operatorToken.kind)&&Ex(t.left)&&Ex(t.right);case 221:case 222:switch(t.operator){case 53:case 39:case 40:case 54:return !0}return !1;default:return !1}}function kx(e,t){return 0!=(98304&t.flags)||Mp(e,t)}function Nx(t,r,n,i,a,o){var s,c,l=r.kind;switch(l){case 41:case 42:case 66:case 67:case 43:case 68:case 44:case 69:case 40:case 65:case 47:case 70:case 48:case 71:case 49:case 72:case 51:case 74:case 52:case 78:case 50:case 73:if(i===lt||a===lt)return lt;i=th(i,t),a=th(a,n);var u=void 0;if(528&i.flags&&528&a.flags&&void 0!==(u=function(e){switch(e){case 51:case 74:return 56;case 52:case 78:return 37;case 50:case 73:return 55;default:return}}(r.kind)))return Qn(o||r,e.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,e.tokenToString(r.kind),e.tokenToString(u)),Ze;var _,d=_x(t,i,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0),p=_x(n,a,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0);if(hx(i,3)&&hx(a,3)||!vx(i,2112)&&!vx(a,2112))_=Ze;else if(C(i,a)){switch(l){case 49:case 72:A();break;case 42:case 67:V<3&&Qn(o,e.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);}_=$e;}else A(C),_=je;return d&&p&&k(_),_;case 39:case 64:if(i===lt||a===lt)return lt;hx(i,402653316)||hx(a,402653316)||(i=th(i,t),a=th(a,n));var f=void 0;if(hx(i,296,!0)&&hx(a,296,!0)?f=Ze:hx(i,2112,!0)&&hx(a,2112,!0)?f=$e:hx(i,402653316,!0)||hx(a,402653316,!0)?f=Ye:(Co(i)||Co(a))&&(f=Eo(i)||Eo(a)?je:Le),f&&!E(l))return f;if(!f){var g=402655727;return A((function(e,t){return hx(e,g)&&hx(t,g)})),Le}return 64===l&&k(f),f;case 29:case 31:case 32:case 33:return E(l)&&(i=Gf(th(i,t)),a=Gf(th(a,n)),N((function(e,t){return Mp(e,t)||Mp(t,e)||Ip(e,mt)&&Ip(t,mt)}))),at;case 34:case 35:case 36:case 37:if(e.isLiteralExpressionOfObject(t)||e.isLiteralExpressionOfObject(n)){var y=34===l||36===l;Qn(o,e.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value,y?"false":"true");}return function(t,r,n,i){var a=F(e.skipParentheses(n)),o=F(e.skipParentheses(i));if(a||o){var s=Qn(t,e.Diagnostics.This_condition_will_always_return_0,e.tokenToString(36===r||34===r?95:110));if(a&&o)return;var c=37===r||35===r?e.tokenToString(53):"",l=a?i:n,u=e.skipParentheses(l);e.addRelatedInfo(s,e.createDiagnosticForNode(l,e.Diagnostics.Did_you_mean_0,"".concat(c,"Number.isNaN(").concat(e.isEntityNameExpression(u)?e.entityNameToString(u):"...",")")));}}(o,l,t,n),N((function(e,t){return kx(e,t)||kx(t,e)})),at;case 102:return function(t,r,n,i){return n===lt||i===lt?lt:(!Co(n)&&bx(n,131068)&&Qn(t,e.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter),Co(i)||zT(i)||wp(i,Wt)||Qn(r,e.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type),at)}(t,n,i,a);case 101:return function(t,r,n,i){return n===lt||i===lt?lt:(e.isPrivateIdentifier(t)?(V<99&&DC(t,2097152),!di(t).resolvedSymbol&&e.getContainingClass(t)&&gh(t,i,_h(t,i.symbol,!0))):Rp(th(n,t),ft,t),Rp(th(i,r),dt,r)&&Xm(i,(function(t){return t===At||!!(2097152&t.flags)&&e.some(t.types,Yp)}))&&Qn(r,e.Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator,io(i)),at)}(t,n,i,a);case 55:case 76:var v=4194304&Am(i)?b_([(c=G?i:Gf(a),ty(c,og)),a]):i;return 76===l&&k(a),v;case 56:case 75:var h=8388608&Am(i)?b_([lg(ag(i)),a],2):i;return 75===l&&k(a),h;case 60:case 77:var b=262144&Am(i)?b_([lg(i),a],2):i;return 77===l&&k(a),b;case 63:var x=e.isBinaryExpression(t.parent)?e.getAssignmentDeclarationKind(t.parent):0;return function(t,r){if(2===t)for(var n=0,i=Bc(r);n<i.length;n++){var a=i[n],o=ds(a);if(o.symbol&&32&o.symbol.flags){var s=a.escapedName,c=vi(a.valueDeclaration,s,788968,void 0,s,!1);(null==c?void 0:c.declarations)&&c.declarations.some(e.isJSDocTypedefTag)&&(si(c,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),a),si(a,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),c));}}}(x,a),function(r){var i;switch(r){case 2:return !0;case 1:case 5:case 6:case 3:case 4:var a=Da(t),o=e.getAssignedExpandoInitializer(n);return !!o&&e.isObjectLiteralExpression(o)&&!!(null===(i=null==a?void 0:a.exports)||void 0===i?void 0:i.size);default:return !1}}(x)?(524288&a.flags&&(2===x||6===x||Xp(a)||Nm(a)||1&e.getObjectFlags(a))||k(a),i):(k(a),hg(a));case 27:if(!K.allowUnreachableCode&&Ex(t)&&(79!==(s=n).kind||"eval"!==s.escapedText)){var D=e.getSourceFileOfNode(t),S=D.text,T=e.skipTrivia(S,t.pos);D.parseDiagnostics.some((function(t){return t.code===e.Diagnostics.JSX_expressions_must_have_one_parent_element.code&&e.textSpanContainsPosition(t,T)}))||Qn(t,e.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);}return a;default:return e.Debug.fail()}function C(e,t){return hx(e,2112)&&hx(t,2112)}function E(r){var o=yx(i,12288)?t:yx(a,12288)?n:void 0;return !o||(Qn(o,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(r)),!1)}function k(r){e.isAssignmentOperator(l)&&m((function(){if(gx(t,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&(!e.isIdentifier(t)||"exports"!==e.unescapeLeadingUnderscores(t.escapedText))){var a=void 0;if(ne&&e.isPropertyAccessExpression(t)&&vx(r,32768)){var o=To(Qx(t.expression),t.name.escapedText);uf(r,o)&&(a=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target);}Bp(r,i,t,n,a);}}));}function N(e){return !e(i,a)&&(A(e),!0)}function A(t){var n,s=!1,c=o||r;if(t){var l=ED(i),u=ED(a);s=!(l===i&&u===a)&&!(!l||!u)&&t(l,u);}var _=i,d=a;!s&&t&&(n=function(e,t,r){var n=e,i=t,a=Gf(e),o=Gf(t);return r(a,o)||(n=a,i=o),[n,i]}(i,a,t),_=n[0],d=n[1]);var p=ao(_,d),f=p[0],g=p[1];(function(t,n,i,a){switch(r.kind){case 36:case 34:case 37:case 35:return Zn(t,n,e.Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap,i,a);default:return}})(c,s,f,g)||Zn(c,s,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2,e.tokenToString(r.kind),f,g);}function F(t){if(e.isIdentifier(t)&&"NaN"===t.escapedText){var r=wr||(wr=Ou("NaN",!1));return !!r&&r===dm(t)}return !1}}function Ax(t){var r=t.parent;return e.isParenthesizedExpression(r)&&Ax(r)||e.isElementAccessExpression(r)&&r.argumentExpression===t}function Fx(t){for(var r=[t.head.text],n=[],i=0,a=t.templateSpans;i<a.length;i++){var o=a[i],s=Zx(o.expression);yx(s,12288)&&Qn(o.expression,e.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String),r.push(o.literal.text),n.push(Ip(s,yt)?s:Ye);}return Bx(t)||Ax(t)||Xm(cv(t,void 0)||Ke,Px)?K_(r,n):Ye}function Px(e){return !!(134217856&e.flags||58982400&e.flags&&vx(Gc(e)||Ke,402653316))}function wx(t,r,n,i){var a=function(t){return 289!==t.kind||e.isJsxSelfClosingElement(t.parent)?t:t.parent.parent}(t),o=a.contextualType,s=a.inferenceContext;try{a.contextualType=r,a.inferenceContext=n;var c=Zx(t,1|i|(n?2:0));return n&&n.intraExpressionInferenceSites&&(n.intraExpressionInferenceSites=void 0),vx(c,2944)&&Rx(c,ov(r,t,void 0))?Rd(c):c}finally{a.contextualType=o,a.inferenceContext=s;}}function Ix(e,t){if(t&&0!==t)return Zx(e,t);var r=di(e);if(!r.resolvedType){var n=tn,i=Lr;tn=rn,Lr=void 0,r.resolvedType=Zx(e,t),Lr=i,tn=n;}return r.resolvedType}function Ox(t){return 213===(t=e.skipParentheses(t,!0)).kind||231===t.kind||e.isJSDocTypeAssertion(t)}function Mx(t,r,n){var i=e.getEffectiveInitializer(t),a=Xx(i)||(n?wx(i,n,void 0,r||0):Ix(i,r));return e.isParameter(t)&&204===t.name.kind&&$f(a)&&!a.target.hasRestElement&&gu(a)<t.name.elements.length?function(t,r){for(var n=r.elements,i=fu(t).slice(),a=t.target.elementFlags.slice(),o=gu(t);o<n.length;o++){var s=n[o];(o<n.length-1||205!==s.kind||!s.dotDotDotToken)&&(i.push(!e.isOmittedExpression(s)&&gv(s)?Xo(s,!1,!1):Le),a.push(2),e.isOmittedExpression(s)||gv(s)||Ng(s,Le));}return a_(i,a,t.target.readonly)}(a,t.name):a}function Lx(t,r){var n=2&e.getCombinedNodeFlags(t)||e.isDeclarationReadonly(t)?r:Qf(r);if(e.isInJSFile(t)){if(Jf(n))return Ng(t,Le),Le;if(zf(n))return Ng(t,rr),rr}return n}function Rx(t,r){if(r){if(3145728&r.flags){var n=r.types;return e.some(n,(function(e){return Rx(t,e)}))}if(58982400&r.flags){var i=Gc(r)||Ke;return vx(i,4)&&vx(t,128)||vx(i,8)&&vx(t,256)||vx(i,64)&&vx(t,2048)||vx(i,4096)&&vx(t,8192)||Rx(t,i)}return !!(406847616&r.flags&&vx(t,128)||256&r.flags&&vx(t,256)||2048&r.flags&&vx(t,2048)||512&r.flags&&vx(t,512)||8192&r.flags&&vx(t,8192))}return !1}function Bx(t){var r=t.parent;return e.isAssertionExpression(r)&&e.isConstTypeReference(r.type)||e.isJSDocTypeAssertion(r)&&e.isConstTypeReference(e.getJSDocTypeAssertionType(r))||(e.isParenthesizedExpression(r)||e.isArrayLiteralExpression(r)||e.isSpreadElement(r))&&Bx(r)||(e.isPropertyAssignment(r)||e.isShorthandPropertyAssignment(r)||e.isTemplateSpan(r))&&Bx(r.parent)}function jx(t,r,n,i){var a=Zx(t,r,i);return Bx(t)||e.isCommonJsExportedExpression(t)?Rd(a):Ox(t)?a:Yf(a,ov(2===arguments.length?cv(t,void 0):n,t,void 0))}function Jx(e,t){return 164===e.name.kind&&hv(e.name),jx(e.initializer,t)}function zx(e,t){return JC(e),164===e.name.kind&&hv(e.name),Ux(e,ux(e,t),t)}function Ux(t,r,n){if(n&&10&n){var i=Uh(r,0,!0),a=Uh(r,1,!0),o=i||a;if(o&&o.typeParameters){var s=av(t,2);if(s){var c=Uh(lg(s),i?0:1,!1);if(c&&!c.typeParameters){if(8&n)return Kx(t,n),wt;var l=lv(t),u=l.signature&&Ul(l.signature),_=u&&zh(u);if(_&&!_.typeParameters&&!e.every(l.inferences,Vx)){var d=function(t,r){for(var n,i,a=[],o=0,s=r;o<s.length;o++){var c=(p=s[o]).symbol.escapedName;if(Wx(t.inferredTypeParameters,c)||Wx(a,c)){var l=Ma(ri(262144,Hx(e.concatenate(t.inferredTypeParameters,a),c)));l.target=p,n=e.append(n,p),i=e.append(i,l),a.push(l);}else a.push(p);}if(i)for(var u=$d(n,i),_=0,d=i;_<d.length;_++){var p;(p=d[_]).mapper=u;}return a}(l,o.typeParameters),p=Hl(o,d),f=e.map(l.inferences,(function(e){return Lg(e.typeParameter)}));if(Fg(p,c,(function(e,t){nm(f,e,t,0,!0);})),e.some(f,Vx)&&(Pg(p,c,(function(e,t){nm(f,e,t);})),!function(e,t){for(var r=0;r<e.length;r++)if(Vx(e[r])&&Vx(t[r]))return !0;return !1}(l.inferences,f)))return function(e,t){for(var r=0;r<e.length;r++)!Vx(e[r])&&Vx(t[r])&&(e[r]=t[r]);}(l.inferences,f),l.inferredTypeParameters=e.concatenate(l.inferredTypeParameters,d),Yl(p)}return Yl(Kh(o,c,l))}}}}return r}function Kx(e,t){2&t&&(lv(e).flags|=4);}function Vx(e){return !(!e.candidates&&!e.contraCandidates)}function qx(e){return !!(e.candidates||e.contraCandidates||el(e.typeParameter))}function Wx(t,r){return e.some(t,(function(e){return e.symbol.escapedName===r}))}function Hx(e,t){for(var r=t.length;r>1&&t.charCodeAt(r-1)>=48&&t.charCodeAt(r-1)<=57;)r--;for(var n=t.slice(0,r),i=1;;i++){var a=n+i;if(!Wx(e,a))return a}}function Gx(e){var t=Jh(e);if(t&&!t.typeParameters)return Ul(t)}function Qx(t){var r=Xx(t);if(r)return r;if(134217728&t.flags&&Lr){var n=Lr[I(t)];if(n)return n}var i=on,a=Zx(t);return on!==i&&((Lr||(Lr=[]))[I(t)]=a,e.setNodeFlags(t,134217728|t.flags)),a}function Xx(t){var r=e.skipParentheses(t,!0);if(e.isJSDocTypeAssertion(r)){var n=e.getJSDocTypeAssertionType(r);if(!e.isConstTypeReference(n))return Hd(n)}if(r=e.skipParentheses(t),!e.isCallExpression(r)||106===r.expression.kind||e.isRequireCall(r,!0)||Cb(r)){if(e.isAssertionExpression(r)&&!e.isConstTypeReference(r.type))return Hd(r.type);if(8===t.kind||10===t.kind||110===t.kind||95===t.kind)return Zx(t)}else if(n=e.isCallChain(r)?function(e){var t=Zx(e.expression),r=pg(t,e.expression),n=Gx(t);return n&&dg(n,e,r!==t)}(r):Gx(Qv(r.expression)))return n}function Yx(e){var t=di(e);if(t.contextFreeType)return t.contextFreeType;var r=e.contextualType;e.contextualType=Le;try{return t.contextFreeType=Zx(e,4)}finally{e.contextualType=r;}}function Zx(t,n,i){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkExpression",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var a=u;u=t,C=0;var o=function(t,n,i){var a=t.kind;if(r)switch(a){case 228:case 215:case 216:r.throwIfCancellationRequested();}switch(a){case 79:return function(t,r){if(e.isThisInTypeQuery(t))return Ry(t);var n=dm(t);if(n===we)return je;if(n===_e){if(ph(t))return Qn(t,e.Diagnostics.arguments_cannot_be_referenced_in_property_initializers),je;var i=e.getContainingFunction(t);return V<2&&(216===i.kind?Qn(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression):e.hasSyntacticModifier(i,512)&&Qn(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method)),di(i).flags|=8192,ds(n)}(function(t){var r,n=t.parent;if(n){if(e.isPropertyAccessExpression(n)&&n.expression===t)return !1;if(e.isExportSpecifier(n)&&n.isTypeOnly)return !1;var i=null===(r=n.parent)||void 0===r?void 0:r.parent;if(i&&e.isExportDeclaration(i)&&i.isTypeOnly)return !1}return !0})(t)&&Py(n,t);var a=Na(n),o=lT(a,t);ei(o)&&X_(t,o)&&o.declarations&&ti(t,o.declarations,t.escapedText);var s=a.valueDeclaration;if(s&&32&a.flags)if(260===s.kind&&e.nodeIsDecorated(s))for(i=e.getContainingClass(t);void 0!==i;){if(i===s&&i.name!==t){di(s).flags|=16777216,di(t).flags|=33554432;break}i=e.getContainingClass(i);}else if(228===s.kind)for(i=e.getThisContainer(t,!1);308!==i.kind;){if(i.parent===s){(e.isPropertyDeclaration(i)&&e.isStatic(i)||e.isClassStaticBlockDeclaration(i))&&(di(s).flags|=16777216,di(t).flags|=33554432);break}i=e.getThisContainer(i,!1);}!function(t,r){if(!(V>=2||0==(34&r.flags)||!r.valueDeclaration||e.isSourceFile(r.valueDeclaration)||295===r.valueDeclaration.parent.kind)){var n=e.getEnclosingBlockScopeContainer(r.valueDeclaration),i=function(t,r){return !!e.findAncestor(t,(function(t){return t===r?"quit":e.isFunctionLike(t)||t.parent&&e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&t.parent.initializer===t}))}(t,n),a=wy(n);if(a){if(i){var o=!0;if(e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,258))&&u.parent===n){var s=function(t,r){return e.findAncestor(t,(function(e){return e===r?"quit":e===r.initializer||e===r.condition||e===r.incrementor||e===r.statement}))}(t.parent,n);if(s){var c=di(s);c.flags|=131072;var l=c.capturedBlockScopeBindings||(c.capturedBlockScopeBindings=[]);e.pushIfUnique(l,r),s===n.initializer&&(o=!1);}}o&&(di(a).flags|=65536);}var u;e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,258))&&u.parent===n&&function(t,r){for(var n=t;214===n.parent.kind;)n=n.parent;var i=!1;if(e.isAssignmentTarget(n))i=!0;else if(221===n.parent.kind||222===n.parent.kind){var a=n.parent;i=45===a.operator||46===a.operator;}return !!i&&!!e.findAncestor(n,(function(e){return e===r?"quit":e===r.statement}))}(t,n)&&(di(r.valueDeclaration).flags|=4194304),di(r.valueDeclaration).flags|=524288;}i&&(di(r.valueDeclaration).flags|=262144);}}(t,n);var c=function(t,r){var n=t.valueDeclaration;if(n){if(e.isBindingElement(n)&&!n.initializer&&!n.dotDotDotToken&&n.parent.elements.length>=2){var i=n.parent.parent;if(257===i.kind&&2&e.getCombinedNodeFlags(n)||166===i.kind){var a=di(i);if(!(268435456&a.flags)){a.flags|=268435456;var o=ko(i,0),s=o&&ty(o,Qc);if(a.flags&=-268435457,s&&1048576&s.flags&&(166!==i.kind||!Ty(t)))return 131072&(u=Dy(n.parent,s,s,void 0,r.flowNode)).flags?ct:Mo(n,u)}}}if(e.isParameter(n)&&!n.type&&!n.initializer&&!n.dotDotDotToken){var c=n.parent;if(c.parameters.length>=2&&Ep(c)){var l=fv(c);if(l&&1===l.parameters.length&&j(l)){var u,_=nl(ds(l.parameters[0]));if(1048576&_.flags&&Ym(_,$f)&&!Ty(t))return ld(u=Dy(c,_,_,void 0,r.flowNode),Jd(c.parameters.indexOf(n)-(e.getThisParameter(c)?1:0)))}}}}return ds(t)}(a,t),l=e.getAssignmentTargetKind(t);if(l){if(!(3&a.flags||e.isInJSFile(t)&&512&a.flags))return Qn(t,384&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum:32&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_class:1536&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace:16&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_function:2097152&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_import:e.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable,ro(n)),je;if(px(a))return 3&a.flags?Qn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant,ro(n)):Qn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,ro(n)),je}var u=2097152&a.flags;if(3&a.flags){if(1===l)return c}else {if(!u)return c;s=Fi(n);}if(!s)return c;c=Ay(c,t,r);for(var _=166===e.getRootDeclaration(s).kind,d=Sy(s),p=Sy(t),f=p!==d,g=t.parent&&t.parent.parent&&e.isSpreadAssignment(t.parent)&&Bm(t.parent.parent),m=134217728&n.flags;p!==d&&(215===p.kind||216===p.kind||e.isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(Ey(a)&&c!==nr||_&&!Ty(a));)p=Sy(p);var y=_||u||f||g||m||function(t,r){if(e.isBindingElement(r)){var n=e.findAncestor(t,e.isBindingElement);return n&&e.getRootDeclaration(n)===e.getRootDeclaration(r)}}(t,s)||c!==Re&&c!==nr&&(!G||0!=(16387&c.flags)||pm(t)||278===t.parent.kind)||232===t.parent.kind||257===s.kind&&s.exclamationToken||16777216&s.flags,v=y?_?function(e,t){if(ho(t.symbol,2)){var r=G&&166===t.kind&&t.initializer&&16777216&Am(e)&&!(16777216&Am(Zx(t.initializer)));return Do(),r?Fm(e,524288):e}return ls(t.symbol),e}(c,s):c:c===Re||c===nr?qe:cg(c),h=Dy(t,c,v,p);if(dy(t)||c!==Re&&c!==nr){if(!y&&!Zp(c)&&Zp(h))return Qn(t,e.Diagnostics.Variable_0_is_used_before_being_assigned,ro(n)),c}else if(h===Re||h===nr)return Z&&(Qn(e.getNameOfDeclaration(s),e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,ro(n),io(h)),Qn(t,e.Diagnostics.Variable_0_implicitly_has_an_1_type,ro(n),io(h))),nS(h);return l?Gf(h):h}(t,n);case 80:return function(t){!function(t){if(!e.getContainingClass(t))return XC(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);if(!e.isForInStatement(t.parent)){if(!e.isExpressionNode(t))return XC(t,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);var r=e.isBinaryExpression(t.parent)&&101===t.parent.operatorToken.kind;sh(t)||r||XC(t,e.Diagnostics.Cannot_find_name_0,e.idText(t));}}(t);var r=sh(t);return r&&Th(r,void 0,!1),Le}(t);case 108:return Ry(t);case 106:return Jy(t);case 104:return Xe;case 14:case 10:return Ld(jd(t.text));case 8:return $C(t),Ld(Jd(+t.text));case 9:return function(t){if(!(e.isLiteralTypeNode(t.parent)||e.isPrefixUnaryExpression(t.parent)&&e.isLiteralTypeNode(t.parent.parent))&&V<7&&XC(t,e.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020));}(t),Ld(zd({negative:!1,base10Value:e.parsePseudoBigInt(t.text)}));case 110:return rt;case 95:return et;case 225:return Fx(t);case 13:return er;case 206:return mv(t,n,i);case 207:return function(t,r){var n=e.isAssignmentTarget(t);!function(t,r){for(var n=new e.Map,i=0,a=t.properties;i<a.length;i++){var o=a[i];if(301!==o.kind){var s=o.name;if(164===s.kind&&IC(s),300===o.kind&&!r&&o.objectAssignmentInitializer&&XC(o.equalsToken,e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern),80===s.kind&&XC(s,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),e.canHaveModifiers(o)&&o.modifiers)for(var c=0,l=o.modifiers;c<l.length;c++){var u=l[c];!e.isModifier(u)||132===u.kind&&171===o.kind||XC(u,e.Diagnostics._0_modifier_cannot_be_used_here,e.getTextOfNode(u));}else if(e.canHaveIllegalModifiers(o)&&o.modifiers)for(var _=0,d=o.modifiers;_<d.length;_++)XC(u=d[_],e.Diagnostics._0_modifier_cannot_be_used_here,e.getTextOfNode(u));var p=void 0;switch(o.kind){case 300:case 299:LC(o.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context),MC(o.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional),8===s.kind&&$C(s),p=4;break;case 171:p=8;break;case 174:p=1;break;case 175:p=2;break;default:throw e.Debug.assertNever(o,"Unexpected syntax kind:"+o.kind)}if(!r){var f=e.getPropertyNameForPropertyNameNode(s);if(void 0===f)continue;var g=n.get(f);if(g)if(8&p&&8&g)XC(s,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(s));else if(4&p&&4&g)XC(s,e.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name,e.getTextOfNode(s));else {if(!(3&p&&3&g))return XC(s,e.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);if(3===g||p===g)return XC(s,e.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);n.set(f,p|g);}else n.set(f,p);}}else if(r){var m=e.skipParentheses(o.expression);if(e.isArrayLiteralExpression(m)||e.isObjectLiteralExpression(m))return XC(o.expression,e.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern)}}}(t,n);for(var i=G?e.createSymbolTable():void 0,a=e.createSymbolTable(),o=[],s=Ct,c=av(t,void 0),l=c&&c.pattern&&(203===c.pattern.kind||207===c.pattern.kind),u=Bx(t),_=u?8:0,d=e.isInJSFile(t)&&!e.isInJsonFile(t),p=e.getJSDocEnumTag(t),f=!c&&d&&!p,g=re,m=!1,y=!1,v=!1,h=!1,b=0,x=t.properties;b<x.length;b++){var D=x[b];D.name&&e.isComputedPropertyName(D.name)&&hv(D.name);}for(var S=0,T=0,C=t.properties;T<C.length;T++){var E=C[T],k=Da(E),N=E.name&&164===E.name.kind?hv(E.name):void 0;if(299===E.kind||300===E.kind||e.isObjectLiteralMethod(E)){var A=299===E.kind?Jx(E,r):300===E.kind?jx(!n&&E.objectAssignmentInitializer?E.objectAssignmentInitializer:E.name,r):zx(E,r);if(d){var F=Lo(E);F?(Rp(A,F,E),A=F):p&&p.typeExpression&&Rp(A,Hd(p.typeExpression),E);}g|=458752&e.getObjectFlags(A);var P=N&&Xs(N)?N:void 0,w=P?ri(4|k.flags,tc(P),4096|_):ri(4|k.flags,k.escapedName,_);if(P&&(w.nameType=P),n)(299===E.kind&&gv(E.initializer)||300===E.kind&&E.objectAssignmentInitializer)&&(w.flags|=16777216);else if(l&&!(512&e.getObjectFlags(c))){var I=dl(c,k.escapedName);I?w.flags|=16777216&I.flags:K.suppressExcessPropertyErrors||bl(c,Ye)||Qn(E.name,e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,ro(k),io(c));}if(w.declarations=k.declarations,w.parent=k.parent,k.valueDeclaration&&(w.valueDeclaration=k.valueDeclaration),w.type=A,w.target=k,k=w,null==i||i.set(w.escapedName,w),c&&r&&2&r&&!(4&r)&&(299===E.kind||171===E.kind)&&Tp(E)){var O=lv(t);e.Debug.assert(O),Mg(O,299===E.kind?E.initializer:E,A);}}else {if(301===E.kind){if(V<2&&DC(E,2),o.length>0&&(s=wd(s,j(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1,h=!1),Sv(A=sl(Zx(E.expression)))){var M=Pd(A,u);if(i&&Nv(M,i,E),S=o.length,Eo(s))continue;s=wd(s,M,t.symbol,g,u);}else Qn(E,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),s=je;continue}e.Debug.assert(174===E.kind||175===E.kind),xT(E);}!N||8576&N.flags?a.set(k.escapedName,k):Ip(N,ft)&&(Ip(N,Ze)?v=!0:Ip(N,ot)?h=!0:y=!0,n&&(m=!0)),o.push(k);}if(l){var L=e.findAncestor(c.pattern.parent,(function(e){return 257===e.kind||223===e.kind||166===e.kind}));if(301!==e.findAncestor(t,(function(e){return e===L||301===e.kind})).kind)for(var R=0,B=zc(c);R<B.length;R++)w=B[R],a.get(w.escapedName)||dl(s,w.escapedName)||(16777216&w.flags||Qn(w.valueDeclaration||w.bindingElement,e.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value),a.set(w.escapedName,w),o.push(w));}return Eo(s)?je:s!==Ct?(o.length>0&&(s=wd(s,j(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1),ty(s,(function(e){return e===Ct?j():e}))):j();function j(){var r=[];y&&r.push(xv(t,S,o,Ye)),v&&r.push(xv(t,S,o,Ze)),h&&r.push(xv(t,S,o,ot));var i=Ja(t.symbol,a,e.emptyArray,e.emptyArray,r);return i.objectFlags|=131200|g,f&&(i.objectFlags|=4096),m&&(i.objectFlags|=512),n&&(i.pattern=t),i}}(t,n);case 208:return nh(t,n);case 163:return ih(t,n);case 209:return function(e,t){return 32&e.flags?function(e,t){var r=Zx(e.expression),n=pg(r,e.expression);return dg(Fh(e,th(n,e.expression),t),e,n!==r)}(e,t):Fh(e,Qv(e.expression),t)}(t,n);case 210:if(100===t.expression.kind)return function(t){if(function(t){if(q===e.ModuleKind.ES2015)return XC(t,e.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);if(t.typeArguments)return XC(t,e.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);var r=t.arguments;if(q!==e.ModuleKind.ESNext&&q!==e.ModuleKind.NodeNext&&q!==e.ModuleKind.Node16&&(kC(r),r.length>1))return XC(r[1],e.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);if(0===r.length||r.length>2)return XC(t,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);var n=e.find(r,e.isSpreadElement);n&&XC(n,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element);}(t),0===t.arguments.length)return tx(t,Le);for(var r=t.arguments[0],n=Ix(r),i=t.arguments.length>1?Ix(t.arguments[1]):void 0,a=2;a<t.arguments.length;++a)Ix(t.arguments[a]);if((32768&n.flags||65536&n.flags||!Ip(n,Ye))&&Qn(r,e.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0,io(n)),i){var o=zu(!0);o!==Ct&&Rp(i,sg(o,32768),t.arguments[1]);}var s=oa(t,r);if(s){var c=_a(s,r,!0,!1);if(c)return tx(t,kb(ds(c),c,s,r)||Nb(ds(c),c,s,r))}return tx(t,Le)}(t);case 211:return function(t,r){var n;FC(t,t.typeArguments);var i=hb(t,void 0,r);if(i===Ur)return lt;if(Sb(i,t),106===t.expression.kind)return st;if(211===t.kind){var a=i.declaration;if(a&&173!==a.kind&&177!==a.kind&&182!==a.kind&&!e.isJSDocConstructSignature(a)&&!bb(a))return Z&&Qn(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),Le}if(e.isInJSFile(t)&&Ab(t))return Bl(t.arguments[0]);var o=Ul(i);if(12288&o.flags&&Cb(t))return Kd(e.walkUpParenthesizedExpressions(t.parent));if(210===t.kind&&!t.questionDotToken&&241===t.parent.kind&&16384&o.flags&&Jl(i))if(e.isDottedName(t.expression)){if(!gy(t)){var s=Qn(t.expression,e.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);fy(t.expression,s);}}else Qn(t.expression,e.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(e.isInJSFile(t)){var c=Db(t,!1);if(null===(n=null==c?void 0:c.exports)||void 0===n?void 0:n.size){var l=Ja(c,c.exports,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=4096,N_([o,l])}}return o}(t,n);case 212:return function(t){(function(t){return !!(t.questionDotToken||32&t.flags)&&XC(t.template,e.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain)})(t)||FC(t,t.typeArguments),V<2&&DC(t,262144);var r=hb(t);return Sb(r,t),Ul(r)}(t);case 214:return function(t,r){if(e.hasJSDocNodes(t)&&e.isJSDocTypeAssertion(t)){var n=e.getJSDocTypeAssertionType(t);return Pb(n,n,t.expression,r)}return Zx(t.expression,r)}(t,n);case 228:return function(e){return HS(e),xT(e),ds(Da(e))}(t);case 215:case 216:return ux(t,n);case 218:return function(e){return Zx(e.expression),In}(t);case 213:case 231:return function(t){if(213===t.kind){var r=e.getSourceFileOfNode(t);r&&e.fileExtensionIsOneOf(r.fileName,[".cts",".mts"])&&XC(t,e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);}return Pb(t,t.type,t.expression)}(t);case 232:return function(e){return 32&e.flags?function(e){var t=Zx(e.expression),r=pg(t,e.expression);return dg(lg(r),e,r!==t)}(e):lg(Zx(e.expression))}(t);case 230:return wb(t);case 235:return function(t){vT(t.type);var r=Zx(t.expression),n=Hd(t.type);return Eo(n)?n:(Bp(r,n,t.type,t.expression,e.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1),r)}(t);case 233:return function(t){return function(t){var r=t.name.escapedText;switch(t.keywordToken){case 103:if("target"!==r)return XC(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"target");break;case 100:"meta"!==r&&XC(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"meta");}}(t),103===t.keywordToken?Ob(t):100===t.keywordToken?function(t){q===e.ModuleKind.Node16||q===e.ModuleKind.NodeNext?e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext&&Qn(t,e.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output):q<e.ModuleKind.ES2020&&q!==e.ModuleKind.System&&Qn(t,e.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);var r=e.getSourceFileOfNode(t);return e.Debug.assert(!!(4194304&r.flags),"Containing file is missing import meta node flag."),"meta"===t.name.escapedText?ju():je}(t):e.Debug.assertNever(t.keywordToken)}(t);case 217:return function(t){Zx(t.expression);var r=e.skipParentheses(t.expression);if(!e.isAccessExpression(r))return Qn(r,e.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference),at;e.isPropertyAccessExpression(r)&&e.isPrivateIdentifier(r.name)&&Qn(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);var n=Na(di(r).resolvedSymbol);return n&&(px(n)&&Qn(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property),function(t,r){var n=ds(r);!G||131075&n.flags||(ne?16777216&r.flags:16777216&Am(n))||Qn(t,e.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);}(r,n)),at}(t);case 219:return function(e){return Zx(e.expression),We}(t);case 220:return function(t){m((function(){return function(t){var r=e.getContainingFunctionOrClassStaticBlock(t);if(r&&e.isClassStaticBlockDeclaration(r))Qn(t,e.Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block);else if(!(32768&t.flags)){var n;if(e.isInTopLevelContext(t)){if(!HC(n=e.getSourceFileOfNode(t))){var i=void 0;if(!e.isEffectiveExternalModule(n,K)){null!=i||(i=e.getSpanOfTokenAtPosition(n,t.pos));var a=e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);Pn.add(a);}switch(q){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:if(n.impliedNodeFormat===e.ModuleKind.CommonJS){null!=i||(i=e.getSpanOfTokenAtPosition(n,t.pos)),Pn.add(e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.System:if(V>=4)break;default:null!=i||(i=e.getSpanOfTokenAtPosition(n,t.pos)),Pn.add(e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));}}}else if(!HC(n=e.getSourceFileOfNode(t))){if(i=e.getSpanOfTokenAtPosition(n,t.pos),a=e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),r&&173!==r.kind&&0==(2&e.getFunctionFlags(r))){var o=e.createDiagnosticForNode(r,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(a,o);}Pn.add(a);}}Wy(t)&&Qn(t,e.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer);}(t)}));var r=Zx(t.expression),n=bD(r,!0,t,e.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return n!==r||Eo(n)||3&r.flags||Xn(!1,e.createDiagnosticForNode(t,e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression)),n}(t);case 221:return function(t){var r=Zx(t.operand);if(r===lt)return lt;switch(t.operand.kind){case 8:switch(t.operator){case 40:return Ld(Jd(-t.operand.text));case 39:return Ld(Jd(+t.operand.text))}break;case 9:if(40===t.operator)return Ld(zd({negative:!0,base10Value:e.parsePseudoBigInt(t.operand.text)}))}switch(t.operator){case 39:case 40:case 54:return th(r,t.operand),yx(r,12288)&&Qn(t.operand,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(t.operator)),39===t.operator?(yx(r,2112)&&Qn(t.operand,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1,e.tokenToString(t.operator),io(Gf(r))),Ze):mx(r);case 53:_S(t.operand);var n=12582912&Am(r);return 4194304===n?et:8388608===n?rt:at;case 45:case 46:return _x(t.operand,th(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&gx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),mx(r)}return je}(t);case 222:return function(t){var r=Zx(t.operand);return r===lt?lt:(_x(t.operand,th(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&gx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),mx(r))}(t);case 223:return ie(t,n);case 224:return function(e,t){var r=_S(e.condition);return lS(e.condition,r,e.whenTrue),b_([Zx(e.whenTrue,t),Zx(e.whenFalse,t)],2)}(t,n);case 227:return function(e,t){return V<2&&DC(e,K.downlevelIteration?1536:1024),fS(33,Zx(e.expression,t),qe,e.expression)}(t,n);case 229:return We;case 226:return function(t){m((function(){8192&t.flags||GC(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),Wy(t)&&Qn(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer);}));var r=e.getContainingFunction(t);if(!r)return Le;var n=e.getFunctionFlags(r);if(!(1&n))return Le;var i=0!=(2&n);t.asteriskToken&&(i&&V<99&&DC(t,26624),!i&&V<2&&K.downlevelIteration&&DC(t,256));var a=Kl(r),o=a&&RS(a,i),s=o&&o.yieldType||Le,c=o&&o.nextType||Le,l=i?CD(c)||Le:c,u=t.expression?Zx(t.expression):We,_=ix(t,u,l,i);if(a&&_&&Bp(_,s,t.expression||t,t.expression),t.asteriskToken)return mS(i?19:17,1,u,t.expression)||Le;if(a)return LS(2,a,i)||Le;var d=Hy(2,r);return d||(d=Le,m((function(){if(Z&&!e.expressionResultIsUnused(t)){var r=cv(t,void 0);r&&!Co(r)||Qn(t,e.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);}}))),d}(t);case 234:return function(e){return e.isSpread?ld(e.type,Ze):e.type}(t);case 291:return function(t,r){if(function(t){t.expression&&e.isCommaSequence(t.expression)&&XC(t.expression,e.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);}(t),t.expression){var n=Zx(t.expression,r);return t.dotDotDotToken&&n!==Le&&!If(n)&&Qn(t,e.Diagnostics.JSX_spread_child_must_be_an_array_type),n}return je}(t,n);case 281:case 282:return function(e,t){return xT(e),jv(e)||Le}(t);case 285:return function(t){zv(t.openingFragment);var r=e.getSourceFileOfNode(t);return !e.getJSXTransformEnabled(K)||!K.jsxFactory&&!r.pragmas.has("jsx")||K.jsxFragmentFactory||r.pragmas.has("jsxfrag")||Qn(t,K.jsxFactory?e.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:e.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),kv(t),jv(t)||Le}(t);case 289:return function(t,r){return function(t,r){for(var n,i=t.attributes,a=cv(i,0),o=G?e.createSymbolTable():void 0,s=e.createSymbolTable(),c=Et,l=!1,u=!1,_=2048,d=Ov(wv(t)),p=0,f=i.properties;p<f.length;p++){var g=f[p],m=g.symbol;if(e.isJsxAttribute(g)){var y=Ev(g,r);_|=458752&e.getObjectFlags(y);var v=ri(4|m.flags,m.escapedName);if(v.declarations=m.declarations,v.parent=m.parent,m.valueDeclaration&&(v.valueDeclaration=m.valueDeclaration),v.type=y,v.target=m,s.set(v.escapedName,v),null==o||o.set(v.escapedName,v),g.name.escapedText===d&&(u=!0),a){var h=dl(a,m.escapedName);h&&h.declarations&&ei(h)&&ti(g.name,h.declarations,g.name.escapedText);}}else e.Debug.assert(290===g.kind),s.size>0&&(c=wd(c,E(),i.symbol,_,!1),s=e.createSymbolTable()),Co(y=sl(Ix(g.expression,r)))&&(l=!0),Sv(y)?(c=wd(c,y,i.symbol,_,!1),o&&Nv(y,o,g)):(Qn(g.expression,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),n=n?N_([n,y]):y);}l||s.size>0&&(c=wd(c,E(),i.symbol,_,!1));var b=281===t.parent.kind?t.parent:void 0;if(b&&b.openingElement===t&&b.children.length>0){var x=kv(b,r);if(!l&&d&&""!==d){u&&Qn(i,e.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,e.unescapeLeadingUnderscores(d));var D=av(t.attributes,void 0),S=D&&$y(D,d),T=ri(4,d);T.type=1===x.length?x[0]:S&&Xm(S,Uf)?a_(x):$u(b_(x)),T.valueDeclaration=e.factory.createPropertySignature(void 0,e.unescapeLeadingUnderscores(d),void 0,void 0),e.setParent(T.valueDeclaration,i),T.valueDeclaration.symbol=T;var C=e.createSymbolTable();C.set(d,T),c=wd(c,Ja(i.symbol,C,e.emptyArray,e.emptyArray,e.emptyArray),i.symbol,_,!1);}}return l?Le:n&&c!==Et?N_([n,c]):n||(c===Et?E():c);function E(){_|=re;var t=Ja(i.symbol,s,e.emptyArray,e.emptyArray,e.emptyArray);return t.objectFlags|=131200|_,t}}(t.parent,r)}(t,n);case 283:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");}return je}(t,n,i),s=Ux(t,o,n);return xx(s)&&function(t,r){208===t.parent.kind&&t.parent.expression===t||209===t.parent.kind&&t.parent.expression===t||(79===t.kind||163===t.kind)&&PT(t)||183===t.parent.kind&&t.parent.exprName===t||278===t.parent.kind||Qn(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query),K.isolatedModules&&(e.Debug.assert(!!(128&r.symbol.flags)),16777216&r.symbol.valueDeclaration.flags&&Qn(t,e.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided));}(t,s),u=a,null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function $x(t){CC(t),t.expression&&GC(t.expression,e.Diagnostics.Type_expected),vT(t.constraint),vT(t.default);var r=js(Da(t));Gc(r),function(e){return Zc(e)!==Ot}(r)||Qn(t.default,e.Diagnostics.Type_parameter_0_has_a_circular_default,io(r));var n=Kc(r),i=$c(r);n&&i&&Rp(i,oc(hp(n,tp(r,i)),i),t.default,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1),xT(t),m((function(){return KS(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0)}));}function eD(t){TC(t),iS(t);var r=e.getContainingFunction(t);e.hasSyntacticModifier(t,16476)&&(173===r.kind&&e.nodeIsPresent(r.body)||Qn(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation),173===r.kind&&e.isIdentifier(t.name)&&"constructor"===t.name.escapedText&&Qn(t.name,e.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name)),(t.questionToken||kl(t))&&e.isBindingPattern(t.name)&&r.body&&Qn(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),t.name&&e.isIdentifier(t.name)&&("this"===t.name.escapedText||"new"===t.name.escapedText)&&(0!==r.parameters.indexOf(t)&&Qn(t,e.Diagnostics.A_0_parameter_must_be_the_first_parameter,t.name.escapedText),173!==r.kind&&177!==r.kind&&182!==r.kind||Qn(t,e.Diagnostics.A_constructor_cannot_have_a_this_parameter),216===r.kind&&Qn(t,e.Diagnostics.An_arrow_function_cannot_have_a_this_parameter),174!==r.kind&&175!==r.kind||Qn(t,e.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters)),!t.dotDotDotToken||e.isBindingPattern(t.name)||Ip(sl(ds(t.symbol)),ir)||Qn(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type);}function tD(t,r,n){for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(!e.isOmittedExpression(o)){var s=o.name;if(79===s.kind&&s.escapedText===n)return Qn(r,e.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,n),!0;if((204===s.kind||203===s.kind)&&tD(s,r,n))return !0}}}function rD(t){178===t.kind?function(t){TC(t)||function(t){var r=t.parameters[0];if(1!==t.parameters.length)return XC(r?r.name:t,e.Diagnostics.An_index_signature_must_have_exactly_one_parameter);if(kC(t.parameters,e.Diagnostics.An_index_signature_cannot_have_a_trailing_comma),r.dotDotDotToken)return XC(r.dotDotDotToken,e.Diagnostics.An_index_signature_cannot_have_a_rest_parameter);if(e.hasEffectiveModifiers(r))return XC(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier);if(r.questionToken)return XC(r.questionToken,e.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark);if(r.initializer)return XC(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer);if(!r.type)return XC(r.name,e.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);var n=Hd(r.type);Xm(n,(function(e){return !!(8576&e.flags)}))||td(n)?XC(r.name,e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead):Ym(n,nu)?t.type||XC(t,e.Diagnostics.An_index_signature_must_have_a_type_annotation):XC(r.name,e.Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);}(t);}(t):181!==t.kind&&259!==t.kind&&182!==t.kind&&176!==t.kind&&173!==t.kind&&177!==t.kind||AC(t);var r=e.getFunctionFlags(t);4&r||(3==(3&r)&&V<99&&DC(t,6144),2==(3&r)&&V<4&&DC(t,64),0!=(3&r)&&V<2&&DC(t,128)),VS(e.getEffectiveTypeParameterDeclarations(t)),function(t){var r=e.filter(e.getJSDocTags(t),e.isJSDocParameterTag);if(e.length(r)){var n=e.isInJSFile(t),i=new e.Set,a=new e.Set;if(e.forEach(t.parameters,(function(t,r){var n=t.name;e.isIdentifier(n)&&i.add(n.escapedText),e.isBindingPattern(n)&&a.add(r);})),Ll(t)){var o=e.lastOrUndefined(r);n&&o&&e.isIdentifier(o.name)&&o.typeExpression&&o.typeExpression.type&&!i.has(o.name.escapedText)&&!If(Hd(o.typeExpression.type))&&Qn(o.name,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,e.idText(o.name));}else e.forEach(r,(function(t,r){var o=t.name,s=t.isNameFirst;a.has(r)||e.isIdentifier(o)&&i.has(o.escapedText)||(e.isQualifiedName(o)?n&&Qn(o,e.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,e.entityNameToString(o),e.entityNameToString(o.left)):s||Yn(n,o,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,e.idText(o)));}));}}(t),e.forEach(t.parameters,eD),t.type&&vT(t.type),m((function(){!function(t){V>=2||!e.hasRestParameter(t)||16777216&t.flags||e.nodeIsMissing(t.body)||e.forEach(t.parameters,(function(t){t.name&&!e.isBindingPattern(t.name)&&t.name.escapedText===_e.escapedName&&Hn("noEmit",t,e.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);}));}(t);var r=e.getEffectiveReturnTypeNode(t);if(Z&&!r)switch(t.kind){case 177:Qn(t,e.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 176:Qn(t,e.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);}if(r){var n=e.getFunctionFlags(t);if(1==(5&n)){var i=Hd(r);if(i===st)Qn(r,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else {var a=LS(0,i,0!=(2&n))||Le;Rp(nx(a,LS(1,i,0!=(2&n))||a,LS(2,i,0!=(2&n))||Ke,!!(2&n)),i,r);}}else 2==(3&n)&&function(t,r){var n=Hd(r);if(V>=2){if(Eo(n))return;var i=Vu(!0);if(i!==Pt&&!fs(n,i))return void Qn(r,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,io(ED(n)||st))}else {if(function(t){ND(t&&e.getEntityNameFromTypeNode(t),!1);}(r),Eo(n))return;var a=e.getEntityNameFromTypeNode(r);if(void 0===a)return void Qn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,io(n));var o=ia(a,111551,!0),s=o?ds(o):je;if(Eo(s))return void(79===a.kind&&"Promise"===a.escapedText&&gs(n)===Vu(!1)?Qn(r,e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):Qn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a)));var c=(pr||(pr=Bu("PromiseConstructorLike",0,true))||Ct);if(c===Ct)return void Qn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a));if(!Rp(s,c,r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value))return;var l=a&&e.getFirstIdentifier(a),u=fi(t.locals,l.escapedText,111551);if(u)return void Qn(u.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,e.idText(l),e.entityNameToString(a))}bD(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);}(t,r);}178!==t.kind&&320!==t.kind&&LD(t);}));}function nD(t){for(var r=new e.Map,n=0,i=t.members;n<i.length;n++){var a=i[n];if(168===a.kind){var o=void 0,s=a.name;switch(s.kind){case 10:case 8:o=s.text;break;case 79:o=e.idText(s);break;default:continue}r.get(o)?(Qn(e.getNameOfDeclaration(a.symbol.valueDeclaration),e.Diagnostics.Duplicate_identifier_0,o),Qn(a.name,e.Diagnostics.Duplicate_identifier_0,o)):r.set(o,!0);}}}function iD(t){if(261===t.kind){var r=Da(t);if(r.declarations&&r.declarations.length>0&&r.declarations[0]!==t)return}var n=Zl(Da(t));if(null==n?void 0:n.declarations){for(var i=new e.Map,a=function(e){1===e.parameters.length&&e.parameters[0].type&&Qm(Hd(e.parameters[0].type),(function(t){var r=i.get(p_(t));r?r.declarations.push(e):i.set(p_(t),{type:t,declarations:[e]});}));},o=0,s=n.declarations;o<s.length;o++)a(s[o]);i.forEach((function(t){if(t.declarations.length>1)for(var r=0,n=t.declarations;r<n.length;r++)Qn(n[r],e.Diagnostics.Duplicate_index_signature_for_type_0,io(t.type));}));}}function aD(t){TC(t)||function(t){if(e.isComputedPropertyName(t.name)&&e.isBinaryExpression(t.name.expression)&&101===t.name.expression.operatorToken.kind)return XC(t.parent.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);if(e.isClassLike(t.parent)){if(e.isStringLiteral(t.name)&&"constructor"===t.name.text)return XC(t.name,e.Diagnostics.Classes_may_not_have_a_field_named_constructor);if(jC(t.name,e.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))return !0;if(V<2&&e.isPrivateIdentifier(t.name))return XC(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(V<2&&e.isAutoAccessorPropertyDeclaration(t))return XC(t.name,e.Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(e.isAutoAccessorPropertyDeclaration(t)&&MC(t.questionToken,e.Diagnostics.An_accessor_property_cannot_be_declared_optional))return !0}else if(261===t.parent.kind){if(jC(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(e.Debug.assertNode(t,e.isPropertySignature),t.initializer)return XC(t.initializer,e.Diagnostics.An_interface_property_cannot_have_an_initializer)}else if(e.isTypeLiteralNode(t.parent)){if(jC(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(e.Debug.assertNode(t,e.isPropertySignature),t.initializer)return XC(t.initializer,e.Diagnostics.A_type_literal_property_cannot_have_an_initializer)}if(16777216&t.flags&&UC(t),e.isPropertyDeclaration(t)&&t.exclamationToken&&(!e.isClassLike(t.parent)||!t.type||t.initializer||16777216&t.flags||e.isStatic(t)||e.hasAbstractModifier(t))){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return XC(t.exclamationToken,r)}}(t)||IC(t.name),iS(t),oD(t),e.hasSyntacticModifier(t,256)&&169===t.kind&&t.initializer&&Qn(t,e.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,e.declarationNameToString(t.name));}function oD(t){if(e.isPrivateIdentifier(t.name)&&V<99){for(var r=e.getEnclosingBlockScopeContainer(t);r;r=e.getEnclosingBlockScopeContainer(r))di(r).flags|=67108864;if(e.isClassExpression(t.parent)){var n=wy(t.parent);n&&(di(t.name).flags|=524288,di(n).flags|=65536);}}}function sD(t){return 106===t.kind||108===t.kind||!e.isThisContainerOrFunctionBlock(t)&&!!e.forEachChild(t,sD)}function cD(t){e.isIdentifier(t.name)&&"constructor"===e.idText(t.name)&&Qn(t.name,e.Diagnostics.Class_constructor_may_not_be_an_accessor),m((function(){if(AC(t)||function(t){if(!(16777216&t.flags)&&184!==t.parent.kind&&261!==t.parent.kind){if(V<1)return XC(t.name,e.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);if(V<2&&e.isPrivateIdentifier(t.name))return XC(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(void 0===t.body&&!e.hasSyntacticModifier(t,256))return QC(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(t.body){if(e.hasSyntacticModifier(t,256))return XC(t,e.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);if(184===t.parent.kind||261===t.parent.kind)return XC(t.body,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts)}if(t.typeParameters)return XC(t.name,e.Diagnostics.An_accessor_cannot_have_type_parameters);if(!function(e){return BC(e)||e.parameters.length===(174===e.kind?0:1)}(t))return XC(t.name,174===t.kind?e.Diagnostics.A_get_accessor_cannot_have_parameters:e.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);if(175===t.kind){if(t.type)return XC(t.name,e.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);var r=e.Debug.checkDefined(e.getSetAccessorValueParameter(t),"Return value does not match parameter count assertion.");if(r.dotDotDotToken)return XC(r.dotDotDotToken,e.Diagnostics.A_set_accessor_cannot_have_rest_parameter);if(r.questionToken)return XC(r.questionToken,e.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter);if(r.initializer)return XC(t.name,e.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer)}return !1}(t)||IC(t.name),ID(t),rD(t),174===t.kind&&!(16777216&t.flags)&&e.nodeIsPresent(t.body)&&256&t.flags&&(512&t.flags||Qn(t.name,e.Diagnostics.A_get_accessor_must_return_a_value)),164===t.name.kind&&hv(t.name),ec(t)){var r=Da(t),n=e.getDeclarationOfKind(r,174),i=e.getDeclarationOfKind(r,175);if(n&&i&&!(1&aC(n))){di(n).flags|=1;var a=e.getEffectiveModifierFlags(n),o=e.getEffectiveModifierFlags(i);(256&a)!=(256&o)&&(Qn(n.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract),Qn(i.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract)),(16&a&&!(24&o)||8&a&&!(8&o))&&(Qn(n.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter),Qn(i.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter));var s=ns(n),c=ns(i);s&&c&&Rp(s,c,n,e.Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type);}}var l=is(Da(t));174===t.kind&&lx(t,l);})),vT(t.body),oD(t);}function lD(t,r){return Il(e.map(t.typeArguments,Hd),r,wl(r),e.isInJSFile(t))}function uD(t,r){for(var n,i,a=!0,o=0;o<r.length;o++){var s=Kc(r[o]);s&&(n||(i=$d(r,n=lD(t,r))),a=a&&Rp(n[o],hp(s,i),t.typeArguments[o],e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1));}return a}function _D(t){var r=Fu(t);if(!Eo(r)){var n=di(t).resolvedSymbol;if(n)return 524288&n.flags&&_i(n).typeParameters||(4&e.getObjectFlags(r)?r.target.localTypeParameters:void 0)}}function dD(t){FC(t,t.typeArguments),180!==t.kind||void 0===t.typeName.jsdocDotPos||e.isInJSFile(t)||e.isInJSDoc(t)||QC(t,t.typeName.jsdocDotPos,1,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments),e.forEach(t.typeArguments,vT);var r=Fu(t);if(!Eo(r)){t.typeArguments&&m((function(){var e=_D(t);e&&uD(t,e);}));var n=di(t).resolvedSymbol;n&&(e.some(n.declarations,(function(t){return e.isTypeDeclaration(t)&&!!(268435456&t.flags)}))&&ti(Tb(t),n.declarations,n.escapedName),32&r.flags&&8&n.flags&&Qn(t,e.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals,io(r)));}}function pD(t,r){if(!(8388608&t.flags))return t;var n=t.objectType,i=t.indexType;if(Ip(i,z_(n,!1)))return 209===r.kind&&e.isAssignmentTarget(r)&&32&e.getObjectFlags(n)&&1&Ic(n)&&Qn(r,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,io(n)),t;var a=rl(n);if(bl(a,Ze)&&hx(i,296))return t;if(rd(n)){var o=Q_(i,r);if(o){var s=Qm(a,(function(e){return dl(e,o)}));if(s&&24&e.getDeclarationModifierFlagsFromSymbol(s))return Qn(r,e.Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,e.unescapeLeadingUnderscores(o)),je}}return Qn(r,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,io(i),io(n)),je}function fD(t){return (e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t))&&!!(16777216&t.flags)}function gD(t,r){var n=e.getCombinedModifierFlags(t);return 261!==t.parent.kind&&260!==t.parent.kind&&228!==t.parent.kind&&16777216&t.flags&&(2&n||e.isModuleBlock(t.parent)&&e.isModuleDeclaration(t.parent.parent)&&e.isGlobalScopeAugmentation(t.parent.parent)||(n|=1),n|=2),n&r}function mD(t){m((function(){return function(t){function r(e,t){return void 0!==t&&t.parent===e[0].parent?t:e[0]}var i,a,o,s=0,c=283,l=!1,u=!0,_=!1,d=t.declarations,p=0!=(16384&t.flags);function f(t){if(!t.name||!e.nodeIsMissing(t.name)){var r=!1,n=e.forEachChild(t.parent,(function(e){if(r)return e;r=e===t;}));if(n&&n.pos===t.end&&n.kind===t.kind){var i=n.name||n,a=n.name;if(t.name&&a&&(e.isPrivateIdentifier(t.name)&&e.isPrivateIdentifier(a)&&t.name.escapedText===a.escapedText||e.isComputedPropertyName(t.name)&&e.isComputedPropertyName(a)||e.isPropertyNameLiteral(t.name)&&e.isPropertyNameLiteral(a)&&e.getEscapedTextOfIdentifierOrLiteral(t.name)===e.getEscapedTextOfIdentifierOrLiteral(a)))return void(171!==t.kind&&170!==t.kind||e.isStatic(t)===e.isStatic(n)||Qn(i,e.isStatic(t)?e.Diagnostics.Function_overload_must_be_static:e.Diagnostics.Function_overload_must_not_be_static));if(e.nodeIsPresent(n.body))return void Qn(i,e.Diagnostics.Function_implementation_name_must_be_0,e.declarationNameToString(t.name))}var o=t.name||t;p?Qn(o,e.Diagnostics.Constructor_implementation_is_missing):e.hasSyntacticModifier(t,256)?Qn(o,e.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive):Qn(o,e.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);}}var g,m,y,v,h,b=!1,x=!1,D=!1,S=[];if(d)for(var T=0,C=d;T<C.length;T++){var E=C[T],k=16777216&E.flags,N=E.parent&&(261===E.parent.kind||184===E.parent.kind)||k;if(N&&(o=void 0),260!==E.kind&&228!==E.kind||k||(D=!0),259===E.kind||171===E.kind||170===E.kind||173===E.kind){S.push(E);var A=gD(E,283);s|=A,c&=A,l=l||e.hasQuestionToken(E),u=u&&e.hasQuestionToken(E);var F=e.nodeIsPresent(E.body);F&&i?p?x=!0:b=!0:(null==o?void 0:o.parent)===E.parent&&o.end!==E.pos&&f(o),F?i||(i=E):_=!0,o=E,N||(a=E);}}if(x&&e.forEach(S,(function(t){Qn(t,e.Diagnostics.Multiple_constructor_implementations_are_not_allowed);})),b&&e.forEach(S,(function(t){Qn(e.getNameOfDeclaration(t)||t,e.Diagnostics.Duplicate_function_implementation);})),D&&!p&&16&t.flags&&d){var P=e.filter(d,(function(e){return 260===e.kind})).map((function(t){return e.createDiagnosticForNode(t,e.Diagnostics.Consider_adding_a_declare_modifier_to_this_class)}));e.forEach(d,(function(r){var i=260===r.kind?e.Diagnostics.Class_declaration_cannot_implement_overload_list_for_0:259===r.kind?e.Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;i&&e.addRelatedInfo.apply(void 0,n$4([Qn(e.getNameOfDeclaration(r)||r,i,e.symbolName(t))],P,!1));}));}if(!a||a.body||e.hasSyntacticModifier(a,256)||a.questionToken||f(a),_&&(d&&(function(t,n,i,a,o){if(0!=(a^o)){var s=gD(r(t,n),i);e.forEach(t,(function(t){var r=gD(t,i)^s;1&r?Qn(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported):2&r?Qn(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient):24&r?Qn(e.getNameOfDeclaration(t)||t,e.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected):256&r&&Qn(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);}));}}(d,i,283,s,c),function(t,n,i,a){if(i!==a){var o=e.hasQuestionToken(r(t,n));e.forEach(t,(function(t){e.hasQuestionToken(t)!==o&&Qn(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_optional_or_required);}));}}(d,i,l,u)),i))for(var w=Rl(t),I=Ol(i),O=0,M=w;O<M.length;O++){var L=M[O];if(g=L,m=void 0,y=void 0,v=void 0,h=void 0,m=Ql(I),y=Ql(g),v=Ul(m),(h=Ul(y))!==st&&!rf(h,v,Ln)&&!rf(v,h,Ln)||0===Gp(m,y,4,!1,void 0,void 0,Fp,void 0)){e.addRelatedInfo(Qn(L.declaration,e.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),e.createDiagnosticForNode(i,e.Diagnostics.The_implementation_signature_is_declared_here));break}}}(t)}));}function yD(t){m((function(){return function(t){var r=t.localSymbol;if((r||(r=Da(t)).exportSymbol)&&e.getDeclarationOfKind(r,t.kind)===t){for(var n=0,i=0,a=0,o=0,s=r.declarations;o<s.length;o++){var c=m(f=s[o]),l=gD(f,1025);1&l?1024&l?a|=c:n|=c:i|=c;}var u=n&i,_=a&(n|i);if(u||_)for(var d=0,p=r.declarations;d<p.length;d++){c=m(f=p[d]);var f,g=e.getNameOfDeclaration(f);c&_?Qn(g,e.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,e.declarationNameToString(g)):c&u&&Qn(g,e.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,e.declarationNameToString(g));}}function m(t){var r=t;switch(r.kind){case 261:case 262:case 348:case 341:case 342:return 2;case 264:return e.isAmbientModule(r)||0!==e.getModuleInstanceState(r)?5:4;case 260:case 263:case 302:return 3;case 308:return 7;case 274:case 223:var n=r,i=e.isExportAssignment(n)?n.expression:n.right;if(!e.isEntityNameExpression(i))return 1;r=i;case 268:case 271:case 270:var a=0,o=Qi(Da(r));return e.forEach(o.declarations,(function(e){a|=m(e);})),a;case 257:case 205:case 259:case 273:case 79:return 1;default:return e.Debug.failBadSyntaxKind(r)}}}(t)}));}function vD(e,t,r,n){var i=hD(e,t);return i&&CD(i,t,r,n)}function hD(t,r,n){if(!Co(t)){var i=t;if(i.promisedTypeOfPromise)return i.promisedTypeOfPromise;if(fs(t,Vu(!1)))return i.promisedTypeOfPromise=fu(t)[0];if(!bx(Qc(t),262140)){var a=To(t,"then");if(!Co(a)){var o=a?fl(a,0):e.emptyArray;if(0!==o.length){for(var s,c,l=0,u=o;l<u.length;l++){var _=u[l],d=jl(_);d&&d!==st&&!rf(t,d,On)?s=d:c=e.append(c,_);}if(!c)return e.Debug.assertIsDefined(s),n&&(n.value=s),void(r&&Qn(r,e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,io(t),io(s)));var p=Fm(b_(e.map(c,Qb)),2097152);if(!Co(p)){var f=fl(p,0);if(0!==f.length)return i.promisedTypeOfPromise=b_(e.map(f,Qb),2);r&&Qn(r,e.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);}}else r&&Qn(r,e.Diagnostics.A_promise_must_have_a_then_method);}}}}function bD(e,t,r,n,i){return (t?CD(e,r,n,i):ED(e,r,n,i))||je}function xD(e){if(bx(Qc(e),262140))return !1;var t=To(e,"then");return !!t&&fl(Fm(t,2097152),0).length>0}function DD(e){var t;if(16777216&e.flags){var r=Xu(!1);return !!r&&e.aliasSymbol===r&&1===(null===(t=e.aliasTypeArguments)||void 0===t?void 0:t.length)}return !1}function SD(e){return 1048576&e.flags?ty(e,SD):DD(e)?e.aliasTypeArguments[0]:e}function TD(e){if(Co(e)||DD(e))return !1;if(rd(e)){var t=Gc(e);if(t?3&t.flags||Xp(t)||Xm(t,xD):vx(e,8650752))return !0}return !1}function CD(t,r,n,i){var a=ED(t,r,n,i);return a&&function(t){if(TD(t)){var r=function(e){var t=Xu(!0);if(t)return yu(t,[SD(e)])}(t);if(r)return r}return e.Debug.assert(void 0===hD(t),"type provided should not be a non-generic 'promise'-like."),t}(a)}function ED(t,r,n,i){if(Co(t))return t;if(DD(t))return t;var a=t;if(a.awaitedTypeOfType)return a.awaitedTypeOfType;if(1048576&t.flags){if(Fn.lastIndexOf(t.id)>=0)return void(r&&Qn(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));var o=r?function(e){return ED(e,r,n,i)}:ED;Fn.push(t.id);var s=ty(t,o);return Fn.pop(),a.awaitedTypeOfType=s}if(TD(t))return a.awaitedTypeOfType=t;var c={value:void 0},l=hD(t,void 0,c);if(l){if(t.id===l.id||Fn.lastIndexOf(l.id)>=0)return void(r&&Qn(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));Fn.push(t.id);var u=ED(l,r,n,i);if(Fn.pop(),!u)return;return a.awaitedTypeOfType=u}if(!xD(t))return a.awaitedTypeOfType=t;if(r){e.Debug.assertIsDefined(n);var _=void 0;c.value&&(_=e.chainDiagnosticMessages(_,e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,io(t),io(c.value))),_=e.chainDiagnosticMessages(_,n,i),Pn.add(e.createDiagnosticForNodeFromMessageChain(r,_));}}function kD(t){var r=hb(t);Sb(r,t);var n=Ul(r);if(!(1&n.flags)){var i,a;switch(t.parent.kind){case 260:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=b_([ds(Da(t.parent)),st]);break;case 169:case 166:i=e.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any,a=st;break;case 171:case 174:case 175:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=b_([Zu(MT(t.parent)),st]);break;default:return e.Debug.fail()}Rp(n,a,t,i);}}function ND(t,r){if(t){var n=e.getFirstIdentifier(t),i=2097152|(79===t.kind?788968:1920),a=vi(n,n.escapedText,i,void 0,void 0,!0);if(a&&2097152&a.flags)if(!Aa(a)||ZT(Qi(a))||$i(a)){if(r&&K.isolatedModules&&e.getEmitModuleKind(K)>=e.ModuleKind.ES2015&&!Aa(a)&&!e.some(a.declarations,e.isTypeOnlyImportOrExportDeclaration)){var o=Qn(t,e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled),s=e.find(a.declarations||e.emptyArray,Pi);s&&e.addRelatedInfo(o,e.createDiagnosticForNode(s,e.Diagnostics._0_was_imported_here,e.idText(n)));}}else ta(a);}}function AD(t){var r=FD(t);r&&e.isEntityName(r)&&ND(r,!0);}function FD(e){if(e)switch(e.kind){case 190:case 189:return PD(e.types);case 191:return PD([e.trueType,e.falseType]);case 193:case 199:return FD(e.type);case 180:return e.typeName}}function PD(t){for(var r,n=0,i=t;n<i.length;n++){for(var a=i[n];193===a.kind||199===a.kind;)a=a.type;if(144!==a.kind&&(G||(198!==a.kind||104!==a.literal.kind)&&155!==a.kind)){var o=FD(a);if(!o)return;if(r){if(!e.isIdentifier(r)||!e.isIdentifier(o)||r.escapedText!==o.escapedText)return}else r=o;}}return r}function wD(t){var r=e.getEffectiveTypeAnnotationNode(t);return e.isRestParameter(t)?e.getRestParameterElementType(r):r}function ID(t){if(e.canHaveDecorators(t)&&e.hasDecorators(t)&&t.modifiers&&e.nodeCanBeDecorated(t,t.parent,t.parent.parent)){K.experimentalDecorators||Qn(t,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning);var r=e.find(t.modifiers,e.isDecorator);if(r){if(DC(r,8),166===t.kind&&DC(r,32),K.emitDecoratorMetadata)switch(DC(r,16),t.kind){case 260:var n=e.getFirstConstructorWithBody(t);if(n)for(var i=0,a=n.parameters;i<a.length;i++)AD(wD(a[i]));break;case 174:case 175:var o=174===t.kind?175:174,s=e.getDeclarationOfKind(Da(t),o);AD(rs(t)||s&&rs(s));break;case 171:for(var c=0,l=t.parameters;c<l.length;c++)AD(wD(l[c]));AD(e.getEffectiveReturnTypeNode(t));break;case 169:AD(e.getEffectiveTypeAnnotationNode(t));break;case 166:AD(wD(t));for(var u=0,_=t.parent.parameters;u<_.length;u++)AD(wD(_[u]));}for(var d=0,p=t.modifiers;d<p.length;d++){var f=p[d];e.isDecorator(f)&&kD(f);}}}}function OD(e){switch(e.kind){case 79:return e;case 208:return e.name;default:return}}function MD(t){var r;ID(t),rD(t);var n=e.getFunctionFlags(t);if(t.name&&164===t.name.kind&&hv(t.name),ec(t)){var i=Da(t),a=t.localSymbol||i,o=null===(r=a.declarations)||void 0===r?void 0:r.find((function(e){return e.kind===t.kind&&!(262144&e.flags)}));t===o&&mD(a),i.parent&&mD(i);}var s=170===t.kind?void 0:t.body;if(vT(s),lx(t,Kl(t)),m((function(){e.getEffectiveReturnTypeNode(t)||(e.nodeIsMissing(s)&&!fD(t)&&Ng(t,Le),1&n&&e.nodeIsPresent(s)&&Ul(Ol(t)));})),e.isInJSFile(t)){var c=e.getJSDocTypeTag(t);c&&c.typeExpression&&!dv(Hd(c.typeExpression),t)&&Qn(c.typeExpression.type,e.Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature);}}function LD(t){m((function(){var r=e.getSourceFileOfNode(t),n=en.get(r.path);n||(n=[],en.set(r.path,n)),n.push(t);}));}function RD(t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n];switch(a.kind){case 260:case 228:JD(a,r),UD(a,r);break;case 308:case 264:case 238:case 266:case 245:case 246:case 247:HD(a,r);break;case 173:case 215:case 259:case 216:case 171:case 174:case 175:a.body&&HD(a,r),UD(a,r);break;case 170:case 176:case 177:case 181:case 182:case 262:case 261:UD(a,r);break;case 192:zD(a,r);break;default:e.Debug.assertNever(a,"Node should not have been registered for unused identifiers check");}}}function BD(t,r,n){var i=e.getNameOfDeclaration(t)||t,a=e.isTypeDeclaration(t)?e.Diagnostics._0_is_declared_but_never_used:e.Diagnostics._0_is_declared_but_its_value_is_never_read;n(t,0,e.createDiagnosticForNode(i,a,r));}function jD(t){return e.isIdentifier(t)&&95===e.idText(t).charCodeAt(0)}function JD(t,r){for(var n=0,i=t.members;n<i.length;n++){var a=i[n];switch(a.kind){case 171:case 169:case 174:case 175:if(175===a.kind&&32768&a.symbol.flags)break;var o=Da(a);o.isReferenced||!(e.hasEffectiveModifier(a,8)||e.isNamedDeclaration(a)&&e.isPrivateIdentifier(a.name))||16777216&a.flags||r(a,0,e.createDiagnosticForNode(a.name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,ro(o)));break;case 173:for(var s=0,c=a.parameters;s<c.length;s++){var l=c[s];!l.symbol.isReferenced&&e.hasSyntacticModifier(l,8)&&r(l,0,e.createDiagnosticForNode(l.name,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read,e.symbolName(l.symbol)));}break;case 178:case 237:case 172:break;default:e.Debug.fail("Unexpected class member");}}}function zD(t,r){var n=t.typeParameter;KD(n)&&r(t,1,e.createDiagnosticForNode(t,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(n.name)));}function UD(t,r){var n=Da(t).declarations;if(n&&e.last(n)===t)for(var i=e.getEffectiveTypeParameterDeclarations(t),a=new e.Set,o=0,s=i;o<s.length;o++){var c=s[o];if(KD(c)){var l=e.idText(c.name),u=c.parent;if(192!==u.kind&&u.typeParameters.every(KD)){if(e.tryAddToSet(a,u)){var _=e.getSourceFileOfNode(u),d=e.isJSDocTemplateTag(u)?e.rangeOfNode(u):e.rangeOfTypeParameters(_,u.typeParameters),p=1===u.typeParameters.length,f=p?e.Diagnostics._0_is_declared_but_its_value_is_never_read:e.Diagnostics.All_type_parameters_are_unused,g=p?l:void 0;r(c,1,e.createFileDiagnostic(_,d.pos,d.end-d.pos,f,g));}}else r(c,1,e.createDiagnosticForNode(c,e.Diagnostics._0_is_declared_but_its_value_is_never_read,l));}}}function KD(e){return !(262144&xa(e.symbol).isReferenced||jD(e.name))}function VD(e,t,r,n){var i=String(n(t)),a=e.get(i);a?a[1].push(r):e.set(i,[t,[r]]);}function qD(t){return e.tryCast(e.getRootDeclaration(t),e.isParameter)}function WD(t){return e.isBindingElement(t)?e.isObjectBindingPattern(t.parent)?!(!t.propertyName||!jD(t.name)):jD(t.name):e.isAmbientModule(t)||(e.isVariableDeclaration(t)&&e.isForInOrOfStatement(t.parent.parent)||QD(t))&&jD(t.name)}function HD(t,r){var n=new e.Map,i=new e.Map,a=new e.Map;t.locals.forEach((function(t){var o;if(!(262144&t.flags?!(3&t.flags)||3&t.isReferenced:t.isReferenced||t.exportSymbol)&&t.declarations)for(var s=0,c=t.declarations;s<c.length;s++){var l=c[s];if(!WD(l))if(QD(l))VD(n,270===(o=l).kind?o:271===o.kind?o.parent:o.parent.parent,l,I);else if(e.isBindingElement(l)&&e.isObjectBindingPattern(l.parent))l!==e.last(l.parent.elements)&&e.last(l.parent.elements).dotDotDotToken||VD(i,l.parent,l,I);else if(e.isVariableDeclaration(l))VD(a,l.parent,l,I);else {var u=t.valueDeclaration&&qD(t.valueDeclaration),_=t.valueDeclaration&&e.getNameOfDeclaration(t.valueDeclaration);u&&_?e.isParameterPropertyDeclaration(u,u.parent)||e.parameterIsThisKeyword(u)||jD(_)||(e.isBindingElement(l)&&e.isArrayBindingPattern(l.parent)?VD(i,l.parent,l,I):r(u,1,e.createDiagnosticForNode(_,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.symbolName(t)))):BD(l,e.symbolName(t),r);}}})),n.forEach((function(t){var n=t[0],i=t[1],a=n.parent;if((n.name?1:0)+(n.namedBindings?271===n.namedBindings.kind?1:n.namedBindings.elements.length:0)===i.length)r(a,0,1===i.length?e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(e.first(i).name)):e.createDiagnosticForNode(a,e.Diagnostics.All_imports_in_import_declaration_are_unused));else for(var o=0,s=i;o<s.length;o++){var c=s[o];BD(c,e.idText(c.name),r);}})),i.forEach((function(t){var n=t[0],i=t[1],o=qD(n.parent)?1:0;if(n.elements.length===i.length)1===i.length&&257===n.parent.kind&&258===n.parent.parent.kind?VD(a,n.parent.parent,n.parent,I):r(n,o,1===i.length?e.createDiagnosticForNode(n,e.Diagnostics._0_is_declared_but_its_value_is_never_read,GD(e.first(i).name)):e.createDiagnosticForNode(n,e.Diagnostics.All_destructured_elements_are_unused));else for(var s=0,c=i;s<c.length;s++){var l=c[s];r(l,o,e.createDiagnosticForNode(l,e.Diagnostics._0_is_declared_but_its_value_is_never_read,GD(l.name)));}})),a.forEach((function(t){var n=t[0],i=t[1];if(n.declarations.length===i.length)r(n,0,1===i.length?e.createDiagnosticForNode(e.first(i).name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,GD(e.first(i).name)):e.createDiagnosticForNode(240===n.parent.kind?n.parent:n,e.Diagnostics.All_variables_are_unused));else for(var a=0,o=i;a<o.length;a++){var s=o[a];r(s,0,e.createDiagnosticForNode(s,e.Diagnostics._0_is_declared_but_its_value_is_never_read,GD(s.name)));}}));}function GD(t){switch(t.kind){case 79:return e.idText(t);case 204:case 203:return GD(e.cast(e.first(t.elements),e.isBindingElement).name);default:return e.Debug.assertNever(t)}}function QD(e){return 270===e.kind||273===e.kind||271===e.kind}function XD(t){if(238===t.kind&&ZC(t),e.isFunctionOrModuleBlock(t)){var r=an;e.forEach(t.statements,vT),an=r;}else e.forEach(t.statements,vT);t.locals&&LD(t);}function YD(t,r,n){if((null==r?void 0:r.escapedText)!==n)return !1;if(169===t.kind||168===t.kind||171===t.kind||170===t.kind||174===t.kind||175===t.kind||299===t.kind)return !1;if(16777216&t.flags)return !1;if((e.isImportClause(t)||e.isImportEqualsDeclaration(t)||e.isImportSpecifier(t))&&e.isTypeOnlyImportOrExportDeclaration(t))return !1;var i=e.getRootDeclaration(t);return !e.isParameter(i)||!e.nodeIsMissing(i.parent.body)}function ZD(t){e.findAncestor(t,(function(r){return !!(4&aC(r))&&(79!==t.kind?Qn(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference):Qn(t,e.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference),!0)}));}function $D(t){e.findAncestor(t,(function(r){return !!(8&aC(r))&&(79!==t.kind?Qn(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference):Qn(t,e.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference),!0)}));}function eS(t){67108864&aC(e.getEnclosingBlockScopeContainer(t))&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name)&&"string"==typeof t.name.escapedText,"The target of a WeakMap/WeakSet collision check should be an identifier"),Hn("noEmit",t,e.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,t.name.escapedText));}function tS(t){var r=!1;if(e.isClassExpression(t)){for(var n=0,i=t.members;n<i.length;n++)if(134217728&aC(i[n])){r=!0;break}}else if(e.isFunctionExpression(t))134217728&aC(t)&&(r=!0);else {var a=e.getEnclosingBlockScopeContainer(t);a&&134217728&aC(a)&&(r=!0);}r&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name),"The target of a Reflect collision check should be an identifier"),Hn("noEmit",t,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,e.declarationNameToString(t.name),"Reflect"));}function rS(t,r){r&&(function(t,r){if((!(q>=e.ModuleKind.ES2015)||q>=e.ModuleKind.Node16&&e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&r&&(YD(t,r,"require")||YD(t,r,"exports"))&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=So(t);308===n.kind&&e.isExternalOrCommonJsModule(n)&&Hn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(t,r){if(r&&!(V>=4)&&YD(t,r,"Promise")&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=So(t);308===n.kind&&e.isExternalOrCommonJsModule(n)&&2048&n.flags&&Hn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(e,t){V<=8&&(YD(e,t,"WeakMap")||YD(e,t,"WeakSet"))&&kn.push(e);}(t,r),function(e,t){t&&V>=2&&V<=8&&YD(e,t,"Reflect")&&Nn.push(e);}(t,r),e.isClassLike(t)?(KS(r,e.Diagnostics.Class_name_cannot_be_0),16777216&t.flags||function(t){V>=1&&"Object"===t.escapedText&&(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&Qn(t,e.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0,e.ModuleKind[q]);}(r)):e.isEnumDeclaration(t)&&KS(r,e.Diagnostics.Enum_name_cannot_be_0));}function nS(e){return e===Re?Le:e===nr?rr:e}function iS(t){var r;if(ID(t),e.isBindingElement(t)||vT(t.type),t.name){if(164===t.name.kind&&(hv(t.name),e.hasOnlyExpressionInitializer(t)&&t.initializer&&Ix(t.initializer)),e.isBindingElement(t)){if(t.propertyName&&e.isIdentifier(t.name)&&e.isParameterDeclaration(t)&&e.nodeIsMissing(e.getContainingFunction(t).body))return void An.push(t);e.isObjectBindingPattern(t.parent)&&t.dotDotDotToken&&V<5&&DC(t,4),t.propertyName&&164===t.propertyName.kind&&hv(t.propertyName);var n=t.parent.parent,i=ko(n,t.dotDotDotToken?64:0),a=t.propertyName||t.name;if(i&&!e.isBindingPattern(a)){var o=M_(a);if(Xs(o)){var s=dl(i,tc(o));s&&(Th(s,void 0,!1),Wv(t,!!n.initializer&&106===n.initializer.kind,!1,i,s));}}}if(e.isBindingPattern(t.name)&&(204===t.name.kind&&V<2&&K.downlevelIteration&&DC(t,512),e.forEach(t.name.elements,vT)),e.isParameter(t)&&t.initializer&&e.nodeIsMissing(e.getContainingFunction(t).body))Qn(t,e.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);else if(e.isBindingPattern(t.name)){var c=e.hasOnlyExpressionInitializer(t)&&t.initializer&&246!==t.parent.parent.kind,l=!e.some(t.name.elements,e.not(e.isOmittedExpression));if(c||l){var u=Zo(t);if(c){var _=Ix(t.initializer);G&&l?rh(_,t):Bp(_,Zo(t),t,t.initializer);}l&&(e.isArrayBindingPattern(t.name)?fS(65,u,qe,t):G&&rh(u,t));}}else {var d=Da(t);if(2097152&d.flags&&e.isVariableDeclarationInitializedToBareOrAccessedRequire(205===t.kind?t.parent.parent:t))sT(t);else {var p=nS(ds(d));if(t===d.valueDeclaration){var f=e.hasOnlyExpressionInitializer(t)&&e.getEffectiveInitializer(t);f&&(e.isInJSFile(t)&&e.isObjectLiteralExpression(f)&&(0===f.properties.length||e.isPrototypeAccess(t.name))&&(null===(r=d.exports)||void 0===r?void 0:r.size)||246===t.parent.parent.kind||Bp(Ix(f),p,t,f,void 0)),d.declarations&&d.declarations.length>1&&e.some(d.declarations,(function(r){return r!==t&&e.isVariableLike(r)&&!oS(r,t)}))&&Qn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}else {var g=nS(Zo(t));Eo(p)||Eo(g)||Np(p,g)||67108864&d.flags||aS(d.valueDeclaration,p,t,g),e.hasOnlyExpressionInitializer(t)&&t.initializer&&Bp(Ix(t.initializer),g,t,t.initializer,void 0),d.valueDeclaration&&!oS(t,d.valueDeclaration)&&Qn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}169!==t.kind&&168!==t.kind&&(yD(t),257!==t.kind&&205!==t.kind||function(t){if(0==(3&e.getCombinedNodeFlags(t))&&!e.isParameterDeclaration(t)&&(257!==t.kind||t.initializer)){var r=Da(t);if(1&r.flags){if(!e.isIdentifier(t.name))return e.Debug.fail();var n=vi(t,t.name.escapedText,3,void 0,void 0,!1);if(n&&n!==r&&2&n.flags&&3&Vv(n)){var i=e.getAncestor(n.valueDeclaration,258),a=240===i.parent.kind&&i.parent.parent?i.parent.parent:void 0;if(!a||!(238===a.kind&&e.isFunctionLike(a.parent)||265===a.kind||264===a.kind||308===a.kind)){var o=ro(n);Qn(t,e.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,o,o);}}}}}(t),rS(t,t.name));}}}}function aS(t,r,n,i){var a=e.getNameOfDeclaration(n),o=169===n.kind||168===n.kind?e.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:e.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,s=e.declarationNameToString(a),c=Qn(a,o,s,io(r),io(i));t&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,e.Diagnostics._0_was_also_declared_here,s));}function oS(t,r){return 166===t.kind&&257===r.kind||257===t.kind&&166===r.kind||e.hasQuestionToken(t)===e.hasQuestionToken(r)&&e.getSelectedEffectiveModifierFlags(t,888)===e.getSelectedEffectiveModifierFlags(r,888)}function sS(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath}),function(t){if(246!==t.parent.parent.kind&&247!==t.parent.parent.kind)if(16777216&t.flags)UC(t);else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return XC(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isVarConst(t))return XC(t,e.Diagnostics.const_declarations_must_be_initialized)}if(t.exclamationToken&&(240!==t.parent.parent.kind||!t.type||t.initializer||16777216&t.flags)){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return XC(t.exclamationToken,r)}!(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)||q===e.ModuleKind.System||16777216&t.parent.parent.flags||!e.hasSyntacticModifier(t.parent.parent,1)||KC(t.name),(e.isLet(t)||e.isVarConst(t))&&VC(t.name);}(t),iS(t),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function cS(t){TC(t)||qC(t.declarationList)||function(t){if(!WC(t.parent)){if(e.isLet(t.declarationList))return XC(t,e.Diagnostics.let_declarations_can_only_be_declared_inside_a_block);e.isVarConst(t.declarationList)&&XC(t,e.Diagnostics.const_declarations_can_only_be_declared_inside_a_block);}}(t),e.forEach(t.declarationList.declarations,vT);}function lS(t,r,n){if(G)for(i(t,n);e.isBinaryExpression(t)&&56===t.operatorToken.kind;)i(t=t.left,n);function i(t,n){var i=!e.isBinaryExpression(t)||56!==t.operatorToken.kind&&55!==t.operatorToken.kind?t:t.right;if(!e.isModuleExportsAccessExpression(i)){var a=i===t?r:_S(i),o=e.isPropertyAccessExpression(i)&&Ox(i.expression);if(4194304&Am(a)&&!o){var s=fl(a,0),c=!!vD(a);if(0!==s.length||c){var l=e.isIdentifier(i)?i:e.isPropertyAccessExpression(i)?i.name:e.isBinaryExpression(i)&&e.isIdentifier(i.right)?i.right:void 0,u=l&&OT(l);if(u||c){var _=u&&e.isBinaryExpression(t.parent)&&function(t,r){for(;e.isBinaryExpression(t)&&55===t.operatorToken.kind;){if(e.forEachChild(t.right,(function t(n){if(e.isIdentifier(n)){var i=OT(n);if(i&&i===r)return !0}return e.forEachChild(n,t)})))return !0;t=t.parent;}return !1}(t.parent,u)||u&&n&&function(t,r,n,i){return !!e.forEachChild(r,(function r(a){if(e.isIdentifier(a)){var o=OT(a);if(o&&o===i){if(e.isIdentifier(t)||e.isIdentifier(n)&&e.isBinaryExpression(n.parent))return !0;for(var s=n.parent,c=a.parent;s&&c;){if(e.isIdentifier(s)&&e.isIdentifier(c)||108===s.kind&&108===c.kind)return OT(s)===OT(c);if(e.isPropertyAccessExpression(s)&&e.isPropertyAccessExpression(c)){if(OT(s.name)!==OT(c.name))return !1;c=c.expression,s=s.expression;}else {if(!e.isCallExpression(s)||!e.isCallExpression(c))return !1;c=c.expression,s=s.expression;}}}}return e.forEachChild(a,r)}))}(t,n,l,u);_||(c?Zn(i,!0,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined,oo(a)):Qn(i,e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead));}}}}}}function uS(t,r){return 16384&t.flags&&Qn(r,e.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness),t}function _S(e,t){return uS(Zx(e,t),e)}function dS(e){var t=e.initializer;t.declarations.length>=1&&sS(t.declarations[0]);}function pS(e){return fS(e.awaitModifier?15:13,Qv(e.expression),qe,e.expression)}function fS(e,t,r,n){return Co(t)?t:gS(e,t,r,n,!0)||Le}function gS(t,r,n,i,a){var o=0!=(2&t);if(r!==ct){var s=V>=2,c=!s&&K.downlevelIteration,l=K.noUncheckedIndexedAccess&&!!(128&t);if(s||c||o){var u=xS(r,t,s?i:void 0);if(a&&u){var _=8&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&t?e.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;_&&Rp(n,u.nextType,i,_);}if(u||s)return l?Lm(u&&u.yieldType):u&&u.yieldType}var d=r,p=!1,f=!1;if(4&t){if(1048576&d.flags){var g=r.types,m=e.filter(g,(function(e){return !(402653316&e.flags)}));m!==g&&(d=b_(m,2));}else 402653316&d.flags&&(d=ct);if((f=d!==r)&&(V<1&&i&&(Qn(i,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),p=!0),131072&d.flags))return l?Lm(Ye):Ye}if(!Bf(d)){if(i&&!p){var y=function(n,i){var a;return i?n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:mS(t,0,r,void 0)?[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!1]:function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return !0}return !1}(null===(a=r.symbol)||void 0===a?void 0:a.escapedName)?[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0]:n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,!0]:[e.Diagnostics.Type_0_is_not_an_array_type,!0]}(!!(4&t)&&!f,c),v=y[0];Zn(i,y[1]&&!!vD(d),v,io(d));}return f?l?Lm(Ye):Ye:void 0}var h=xl(d,Ze);return f&&h?402653316&h.flags&&!K.noUncheckedIndexedAccess?Ye:b_(l?[h,Ye,qe]:[h,Ye],2):128&t?Lm(h):h}NS(i,r,o);}function mS(e,t,r,n){if(!Co(r)){var i=xS(r,e,n);return i&&i[B(t)]}}function yS(e,t,r){if(void 0===e&&(e=ct),void 0===t&&(t=ct),void 0===r&&(r=Ke),67359327&e.flags&&180227&t.flags&&180227&r.flags){var n=cu([e,t,r]),i=qr.get(n);return i||(i={yieldType:e,returnType:t,nextType:r},qr.set(n,i)),i}return {yieldType:e,returnType:t,nextType:r}}function vS(t){for(var r,n,i,a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s&&s!==Wr){if(s===Hr)return Hr;r=e.append(r,s.yieldType),n=e.append(n,s.returnType),i=e.append(i,s.nextType);}}return r||n||i?yS(r&&b_(r),n&&b_(n),i&&N_(i)):Wr}function hS(e,t){return e[t]}function bS(e,t,r){return e[t]=r}function xS(t,r,i){var a,o;if(Co(t))return Hr;if(!(1048576&t.flags)){var s=SS(t,r,i,y=i?{errors:void 0}:void 0);if(s===Wr){if(i){var c=NS(i,t,!!(2&r));(null==y?void 0:y.errors)&&e.addRelatedInfo.apply(void 0,n$4([c],y.errors,!1));}return}if(null===(a=null==y?void 0:y.errors)||void 0===a?void 0:a.length)for(var l=0,u=y.errors;l<u.length;l++){var _=u[l];Pn.add(_);}return s}var d,p=2&r?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable",f=hS(t,p);if(f)return f===Wr?void 0:f;for(var g=0,m=t.types;g<m.length;g++){var y,v=SS(m[g],r,i,y=i?{errors:void 0}:void 0);if(v===Wr)return i&&(c=NS(i,t,!!(2&r)),(null==y?void 0:y.errors)&&e.addRelatedInfo.apply(void 0,n$4([c],y.errors,!1))),void bS(t,p,Wr);if(null===(o=null==y?void 0:y.errors)||void 0===o?void 0:o.length)for(var h=0,b=y.errors;h<b.length;h++)_=b[h],Pn.add(_);d=e.append(d,v);}var x=d?vS(d):Wr;return bS(t,p,x),x===Wr?void 0:x}function DS(e,t){if(e===Wr)return Wr;if(e===Hr)return Hr;var r=e.yieldType,n=e.returnType,i=e.nextType;return t&&Xu(!0),yS(CD(r,t)||Le,CD(n,t)||Le,i)}function SS(e,t,r,n){if(Co(e))return Hr;var i,a=!1;if(2&t&&(i=TS(e,Xr)||ES(e,Xr))){if(i!==Wr||!r)return 8&t?DS(i,r):i;a=!0;}if(1&t&&(i=TS(e,Yr)||ES(e,Yr)))if(i===Wr&&r)a=!0;else {if(!(2&t))return i;if(i!==Wr)return i=DS(i,r),a?i:bS(e,"iterationTypesOfAsyncIterable",i)}return 2&t&&(i=kS(e,Xr,r,n,a))!==Wr?i:1&t&&(i=kS(e,Yr,r,n,a))!==Wr?2&t?(i=DS(i,r),a?i:bS(e,"iterationTypesOfAsyncIterable",i)):i:Wr}function TS(e,t){return hS(e,t.iterableCacheKey)}function CS(e,t){var r=TS(e,t)||kS(e,t,void 0,void 0,!1);return r===Wr?Qr:r}function ES(e,t){var r;if(fs(e,r=t.getGlobalIterableType(!1))||fs(e,r=t.getGlobalIterableIteratorType(!1))){var n=fu(e)[0],i=CS(r,t),a=i.returnType,o=i.nextType;return bS(e,t.iterableCacheKey,yS(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}if(fs(e,t.getGlobalGeneratorType(!1))){var s=fu(e);return n=s[0],a=s[1],o=s[2],bS(e,t.iterableCacheKey,yS(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}}function kS(t,r,n,i,a){var o,s,c,l,u=dl(t,(s=r.iteratorSymbolName,(l=(c=Uu(!1))&&To(ds(c),e.escapeLeadingUnderscores(s)))&&Xs(l)?tc(l):"__@".concat(s))),_=!u||16777216&u.flags?void 0:ds(u);if(Co(_))return a?Hr:bS(t,r.iterableCacheKey,Hr);var d=_?fl(_,0):void 0;if(!e.some(d))return a?Wr:bS(t,r.iterableCacheKey,Wr);var p=null!==(o=AS(N_(e.map(d,Ul)),r,n,i,a))&&void 0!==o?o:Wr;return a?p:bS(t,r.iterableCacheKey,p)}function NS(t,r,n){var i=n?e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;return Zn(t,!!vD(r)||!n&&e.isForOfStatement(t.parent)&&t.parent.expression===t&&Hu(!1)!==Pt&&Ip(r,Hu(!1)),i,io(r))}function AS(e,t,r,n,i){if(Co(e))return Hr;var a=FS(e,t)||function(e,t){var r=t.getGlobalIterableIteratorType(!1);if(fs(e,r)){var n=fu(e)[0],i=FS(r,t)||MS(r,t,void 0,void 0,!1),a=i===Wr?Qr:i,o=a.returnType,s=a.nextType;return bS(e,t.iteratorCacheKey,yS(n,o,s))}if(fs(e,t.getGlobalIteratorType(!1))||fs(e,t.getGlobalGeneratorType(!1))){var c=fu(e);return n=c[0],o=c[1],s=c[2],bS(e,t.iteratorCacheKey,yS(n,o,s))}}(e,t);return a===Wr&&r&&(a=void 0,i=!0),null!=a||(a=MS(e,t,r,n,i)),a===Wr?void 0:a}function FS(e,t){return hS(e,t.iteratorCacheKey)}function PS(e,t){var r=To(e,"done")||et;return Ip(0===t?et:rt,r)}function wS(e){return PS(e,0)}function IS(e){return PS(e,1)}function OS(t,r,n,i,a){var o,s,c,l,u,_,d=dl(t,n);if(d||"next"===n){var p=!d||"next"===n&&16777216&d.flags?void 0:"next"===n?ds(d):Fm(ds(d),2097152);if(Co(p))return "next"===n?Hr:Gr;var f,g,m,y,v,h=p?fl(p,0):e.emptyArray;if(0===h.length){if(i){var b="next"===n?r.mustHaveANextMethodDiagnostic:r.mustBeAMethodDiagnostic;a?(null!==(o=a.errors)&&void 0!==o||(a.errors=[]),a.errors.push(e.createDiagnosticForNode(i,b,n))):Qn(i,b,n);}return "next"===n?Wr:void 0}if((null==p?void 0:p.symbol)&&1===h.length){var x=r.getGlobalGeneratorType(!1),D=r.getGlobalIteratorType(!1),S=(null===(c=null===(s=x.symbol)||void 0===s?void 0:s.members)||void 0===c?void 0:c.get(n))===p.symbol,T=!S&&(null===(u=null===(l=D.symbol)||void 0===l?void 0:l.members)||void 0===u?void 0:u.get(n))===p.symbol;if(S||T){var C=S?x:D,E=p.mapper;return yS(ep(C.typeParameters[0],E),ep(C.typeParameters[1],E),"next"===n?ep(C.typeParameters[2],E):void 0)}}for(var k=0,N=h;k<N.length;k++){var A=N[k];"throw"!==n&&e.some(A.parameters)&&(f=e.append(f,zb(A,0))),g=e.append(g,Ul(A));}if("throw"!==n){var F=f?b_(f):Ke;if("next"===n)y=F;else if("return"===n){var P=r.resolveIterationType(F,i)||Le;m=e.append(m,P);}}var w=g?N_(g):ct,I=function(e){if(Co(e))return Hr;var t=hS(e,"iterationTypesOfIteratorResult");if(t)return t;if(fs(e,vr||(vr=Bu("IteratorYieldResult",1,!1))||Pt))return bS(e,"iterationTypesOfIteratorResult",yS(fu(e)[0],void 0,void 0));if(fs(e,hr||(hr=Bu("IteratorReturnResult",1,!1))||Pt))return bS(e,"iterationTypesOfIteratorResult",yS(void 0,fu(e)[0],void 0));var r=Zm(e,wS),n=r!==ct?To(r,"value"):void 0,i=Zm(e,IS),a=i!==ct?To(i,"value"):void 0;return bS(e,"iterationTypesOfIteratorResult",n||a?yS(n,a||st,void 0):Wr)}(r.resolveIterationType(w,i)||Le);return I===Wr?(i&&(a?(null!==(_=a.errors)&&void 0!==_||(a.errors=[]),a.errors.push(e.createDiagnosticForNode(i,r.mustHaveAValueDiagnostic,n))):Qn(i,r.mustHaveAValueDiagnostic,n)),v=Le,m=e.append(m,Le)):(v=I.yieldType,m=e.append(m,I.returnType)),yS(v,b_(m),y)}}function MS(e,t,r,n,i){var a=vS([OS(e,t,"next",r,n),OS(e,t,"return",r,n),OS(e,t,"throw",r,n)]);return i?a:bS(e,t.iteratorCacheKey,a)}function LS(e,t,r){if(!Co(t)){var n=RS(t,r);return n&&n[B(e)]}}function RS(e,t){if(Co(e))return Hr;var r=t?Xr:Yr;return xS(e,t?2:1,void 0)||function(e,t,r,n){return AS(e,t,void 0,void 0,!1)}(e,r)}function BS(e,t){var r=!!(2&t);if(1&t){var n=LS(1,e,r);return n?r?ED(SD(n)):n:je}return r?ED(e)||je:e}function jS(t,r){var n=BS(r,e.getFunctionFlags(t));return !!n&&vx(n,16387)}function JS(t,r,n){var i=hl(t);if(0!==i.length){for(var a=0,o=Bc(t);a<o.length;a++){var s=o[a];n&&4194304&s.flags||zS(t,s,L_(s,8576,!0),ps(s));}var c=r.valueDeclaration;if(c&&e.isClassLike(c))for(var l=0,u=c.members;l<u.length;l++){var _=u[l];if(!e.isStatic(_)&&!ec(_)){var d=Da(_);zS(t,d,Qx(_.name.expression),ps(d));}}if(i.length>1)for(var p=0,f=i;p<f.length;p++)US(t,f[p]);}}function zS(t,r,n,i){var a=r.valueDeclaration,o=e.getNameOfDeclaration(a);if(!o||!e.isPrivateIdentifier(o))for(var s=Dl(t,n),c=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,261):void 0,l=a&&223===a.kind||o&&164===o.kind?a:void 0,u=Sa(r)===t.symbol?a:void 0,_=function(n){var a=n.declaration&&Sa(Da(n.declaration))===t.symbol?n.declaration:void 0,o=u||a||(c&&!e.some(Ns(t),(function(e){return !!jc(e,r.escapedName)&&!!xl(e,n.keyType)}))?c:void 0);if(o&&!Ip(i,n.type)){var s=Gn(o,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,ro(r),io(i),io(n.keyType),io(n.type));l&&o!==l&&e.addRelatedInfo(s,e.createDiagnosticForNode(l,e.Diagnostics._0_is_declared_here,ro(r))),Pn.add(s);}},d=0,p=s;d<p.length;d++)_(p[d]);}function US(t,r){for(var n=r.declaration,i=Dl(t,r.keyType),a=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,261):void 0,o=n&&Sa(Da(n))===t.symbol?n:void 0,s=function(n){if(n===r)return "continue";var i=n.declaration&&Sa(Da(n.declaration))===t.symbol?n.declaration:void 0,s=o||i||(a&&!e.some(Ns(t),(function(e){return !!bl(e,r.keyType)&&!!xl(e,n.keyType)}))?a:void 0);s&&!Ip(r.type,n.type)&&Qn(s,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3,io(r.keyType),io(r.type),io(n.keyType),io(n.type));},c=0,l=i;c<l.length;c++)s(l[c]);}function KS(e,t){switch(e.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":Qn(e,t,e.escapedText);}}function VS(t){var r=!1;if(t)for(var n=0;n<t.length;n++){var i=t[n];$x(i),m(a(i,n));}function a(n,i){return function(){var a,o,s;n.default?(r=!0,a=n.default,o=t,s=i,function t(r){if(180===r.kind){var n=Fu(r);if(262144&n.flags)for(var i=s;i<o.length;i++)n.symbol===Da(o[i])&&Qn(r,e.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters);}e.forEachChild(r,t);}(a)):r&&Qn(n,e.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters);for(var c=0;c<i;c++)t[c].symbol===n.symbol&&Qn(n.name,e.Diagnostics.Duplicate_identifier_0,e.declarationNameToString(n.name));}}}function qS(t){if(!t.declarations||1!==t.declarations.length){var r=_i(t);if(!r.typeParametersChecked){r.typeParametersChecked=!0;var n=function(t){return e.filter(t.declarations,(function(e){return 260===e.kind||261===e.kind}))}(t);if(!n||n.length<=1)return;if(!WS(n,Js(t).localTypeParameters,e.getEffectiveTypeParameterDeclarations))for(var i=ro(t),a=0,o=n;a<o.length;a++)Qn(o[a].name,e.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters,i);}}}function WS(t,r,n){for(var i=e.length(r),a=wl(r),o=0,s=t;o<s.length;o++){var c=n(s[o]),l=c.length;if(l<a||l>i)return !1;for(var u=0;u<l;u++){var _=c[u],d=r[u];if(_.name.escapedText!==d.symbol.escapedName)return !1;var p=e.getEffectiveConstraintOfTypeParameter(_),f=p&&Hd(p),g=Kc(d);if(f&&g&&!Np(f,g))return !1;var m=_.default&&Hd(_.default),y=$c(d);if(m&&y&&!Np(m,y))return !1}}return !0}function HS(t){!function(t){var r=e.getSourceFileOfNode(t);(function(t){var r=!1,n=!1;if(!TC(t)&&t.heritageClauses)for(var i=0,a=t.heritageClauses;i<a.length;i++){var o=a[i];if(94===o.token){if(r)return GC(o,e.Diagnostics.extends_clause_already_seen);if(n)return GC(o,e.Diagnostics.extends_clause_must_precede_implements_clause);if(o.types.length>1)return GC(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);r=!0;}else {if(e.Debug.assert(117===o.token),n)return GC(o,e.Diagnostics.implements_clause_already_seen);n=!0;}PC(o);}})(t)||NC(t.typeParameters,r);}(t),ID(t),rS(t,t.name),VS(e.getEffectiveTypeParameterDeclarations(t)),yD(t);var r=Da(t),n=Js(r),i=oc(n),a=ds(r);qS(r),mD(r),function(t){for(var r=new e.Map,n=new e.Map,i=new e.Map,a=0,o=t.members;a<o.length;a++){var s=o[a];if(173===s.kind)for(var c=0,l=s.parameters;c<l.length;c++){var u=l[c];e.isParameterPropertyDeclaration(u,s)&&!e.isBindingPattern(u.name)&&y(r,u.name,u.name.escapedText,3);}else {var _=e.isStatic(s),d=s.name;if(!d)continue;var p=e.isPrivateIdentifier(d),f=p&&_?16:0,g=p?i:_?n:r,m=d&&e.getPropertyNameForPropertyNameNode(d);if(m)switch(s.kind){case 174:y(g,d,m,1|f);break;case 175:y(g,d,m,2|f);break;case 169:y(g,d,m,3|f);break;case 171:y(g,d,m,8|f);}}}function y(t,r,n,i){var a=t.get(n);if(a)if((16&a)!=(16&i))Qn(r,e.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name,e.getTextOfNode(r));else {var o=!!(8&a),s=!!(8&i);o||s?o!==s&&Qn(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):a&i&-17?Qn(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):t.set(n,a|i);}else t.set(n,i);}}(t),16777216&t.flags||function(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r],a=i.name;if(e.isStatic(i)&&a){var o=e.getPropertyNameForPropertyNameNode(a);switch(o){case"name":case"length":case"caller":case"arguments":case"prototype":Qn(a,e.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1,o,mo(Da(t)));}}}}(t);var o=e.getEffectiveBaseTypeNode(t);if(o){e.forEach(o.typeArguments,vT),V<2&&DC(o.parent,1);var s=e.getClassExtendsHeritageElement(t);s&&s!==o&&Zx(s.expression);var c=Ns(n);c.length&&m((function(){var r=c[0],s=Es(n),l=rl(s);if(function(t,r){var n=fl(t,1);if(n.length){var i=n[0].declaration;i&&e.hasEffectiveModifier(i,8)&&(FT(r,e.getClassLikeDeclarationOfSymbol(t.symbol))||Qn(r,e.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,na(t.symbol)));}}(l,o),vT(o.expression),e.some(o.typeArguments)){e.forEach(o.typeArguments,vT);for(var u=0,_=Ts(l,o.typeArguments,o);u<_.length;u++){var d=_[u];if(!uD(o,d.typeParameters))break}}var p=oc(r,n.thisType);if(Rp(i,p,void 0)?Rp(a,kp(l),t.name||t,e.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1):XS(t,i,p,e.Diagnostics.Class_0_incorrectly_extends_base_class_1),8650752&s.flags&&(xs(a)?fl(s,1).some((function(e){return 4&e.flags}))&&!e.hasSyntacticModifier(t,256)&&Qn(t.name||t,e.Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract):Qn(t.name||t,e.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)),!(l.symbol&&32&l.symbol.flags||8650752&s.flags)){var f=Cs(l,o.typeArguments,o);e.forEach(f,(function(e){return !bb(e.declaration)&&!Np(Ul(e),r)}))&&Qn(o.expression,e.Diagnostics.Base_constructors_must_all_have_the_same_return_type);}!function(t,r){for(var n,i,a,o,s=function(s){var c=YS(s);if(4194304&c.flags)return "continue";var l=jc(t,c.escapedName);if(!l)return "continue";var u=YS(l),_=e.getDeclarationModifierFlagsFromSymbol(c);if(e.Debug.assert(!!u,"derived should point to something, even if it is the base class' declaration."),u===c){var d=e.getClassLikeDeclarationOfSymbol(t.symbol);if(256&_&&(!d||!e.hasSyntacticModifier(d,256))){for(var p=0,f=Ns(t);p<f.length;p++){var g=f[p];if(g!==r){var m=jc(g,c.escapedName),y=m&&YS(m);if(y&&y!==c)return "continue-basePropertyCheck"}}228===d.kind?Qn(d,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,ro(s),io(r)):Qn(d,e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,io(t),ro(s),io(r));}}else {var v=e.getDeclarationModifierFlagsFromSymbol(u);if(8&_||8&v)return "continue";var h=void 0,b=98308&c.flags,x=98308&u.flags;if(b&&x){if((6&e.getCheckFlags(c)?null===(n=c.declarations)||void 0===n?void 0:n.some((function(e){return ZS(e,_)})):null===(i=c.declarations)||void 0===i?void 0:i.every((function(e){return ZS(e,_)})))||262144&e.getCheckFlags(c)||u.valueDeclaration&&e.isBinaryExpression(u.valueDeclaration))return "continue";var D=4!==b&&4===x;if(D||4===b&&4!==x){var S=D?e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;Qn(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,S,ro(c),io(r),io(t));}else if(W){var T=null===(a=u.declarations)||void 0===a?void 0:a.find((function(e){return 169===e.kind&&!e.initializer}));if(T&&!(33554432&u.flags)&&!(256&_)&&!(256&v)&&!(null===(o=u.declarations)||void 0===o?void 0:o.some((function(e){return !!(16777216&e.flags)})))){var C=Fa(e.getClassLikeDeclarationOfSymbol(t.symbol)),E=T.name;if(T.exclamationToken||!C||!e.isIdentifier(E)||!G||!eT(E,t,C)){var k=e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;Qn(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,k,ro(c),io(r));}}}return "continue"}if(qv(c)){if(qv(u)||4&u.flags)return "continue";e.Debug.assert(!!(98304&u.flags)),h=e.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;}else h=98304&c.flags?e.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:e.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;Qn(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,h,io(r),ro(c),io(t));}},c=0,l=zc(r);c<l.length;c++)s(l[c]);}(n,r);}));}!function(t,r,n,i){for(var a=e.getEffectiveBaseTypeNode(t)&&Ns(r),o=(null==a?void 0:a.length)?oc(e.first(a),r.thisType):void 0,s=Es(r),c=function(a){if(e.hasAmbientModifier(a))return "continue";e.isConstructorDeclaration(a)&&e.forEach(a.parameters,(function(c){e.isParameterPropertyDeclaration(c,a)&&GS(t,i,s,o,r,n,c,!0);})),GS(t,i,s,o,r,n,a,!1);},l=0,u=t.members;l<u.length;l++)c(u[l]);}(t,n,i,a);var l=e.getEffectiveImplementsTypeNodes(t);if(l)for(var u=0,_=l;u<_.length;u++){var d=_[u];e.isEntityNameExpression(d.expression)&&!e.isOptionalChain(d.expression)||Qn(d.expression,e.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments),dD(d),m(p(d));}function p(r){return function(){var a=sl(Hd(r));if(!Eo(a))if(Fs(a)){var o=a.symbol&&32&a.symbol.flags?e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:e.Diagnostics.Class_0_incorrectly_implements_interface_1,s=oc(a,n.thisType);Rp(i,s,void 0)||XS(t,i,s,o);}else Qn(r,e.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);}}m((function(){JS(n,r),JS(a,r,!0),iD(t),function(t){if(G&&Y&&!(16777216&t.flags))for(var r=Fa(t),n=0,i=t.members;n<i.length;n++){var a=i[n];if(!(2&e.getEffectiveModifierFlags(a))&&!e.isStatic(a)&&$S(a)){var o=a.name;if(e.isIdentifier(o)||e.isPrivateIdentifier(o)||e.isComputedPropertyName(o)){var s=ds(Da(a));3&s.flags||Zp(s)||r&&eT(o,s,r)||Qn(a.name,e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,e.declarationNameToString(o));}}}}(t);}));}function GS(t,r,n,i,a,o,s,c,l){void 0===l&&(l=!0);var u=s.name&&OT(s.name)||OT(s);return u?QS(t,r,n,i,a,o,e.hasOverrideModifier(s),e.hasAbstractModifier(s),e.isStatic(s),c,e.symbolName(u),l?s:void 0):0}function QS(t,r,n,i,a,o,s,c,l,u,_,d){var p=e.isInJSFile(t),f=!!(16777216&t.flags);if(i&&(s||K.noImplicitOverride)){var g=e.escapeLeadingUnderscores(_),m=l?n:i,y=dl(l?r:o,g),v=dl(m,g),h=io(i);if(y&&!v&&s){if(d){var b=yh(_,m);b?Qn(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,h,ro(b)):Qn(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,h);}return 2}if(y&&(null==v?void 0:v.declarations)&&K.noImplicitOverride&&!f){var x=e.some(v.declarations,e.hasAbstractModifier);if(s)return 0;if(!x)return d&&Qn(d,u?p?e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:p?e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0,h),1;if(c&&x)return d&&Qn(d,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,h),1}}else if(s){if(d){var D=io(a);Qn(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,D);}return 2}return 0}function XS(t,r,n,i){for(var a=!1,o=function(t){if(e.isStatic(t))return "continue";var i=t.name&&OT(t.name)||OT(t);if(i){var o=dl(r,i.escapedName),s=dl(n,i.escapedName);o&&s&&(Rp(ds(o),ds(s),t.name||t,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,ro(i),io(r),io(n))}))||(a=!0));}},s=0,c=t.members;s<c.length;s++)o(c[s]);a||Rp(r,n,t.name||t,i);}function YS(t){return 1&e.getCheckFlags(t)?t.target:t}function ZS(t,r){return 256&r&&(!e.isPropertyDeclaration(t)||!t.initializer)||e.isInterfaceDeclaration(t.parent)}function $S(t){return 169===t.kind&&!e.hasAbstractModifier(t)&&!t.exclamationToken&&!t.initializer}function eT(t,r,n){var i=e.isComputedPropertyName(t)?e.factory.createElementAccessExpression(e.factory.createThis(),t.expression):e.factory.createPropertyAccessExpression(e.factory.createThis(),t);return e.setParent(i.expression,i),e.setParent(i,n),i.flowNode=n.returnFlowNode,!Zp(Dy(i,r,cg(r)))}function tT(e){var t=di(e);if(!(16384&t.flags)){t.flags|=16384;for(var r=0,n=0,i=e.members;n<i.length;n++){var a=i[n],o=rT(a,r);di(a).enumMemberValue=o,r="number"==typeof o?o+1:void 0;}}}function rT(t,r){if(e.isComputedNonLiteralName(t.name))Qn(t.name,e.Diagnostics.Computed_property_names_are_not_allowed_in_enums);else {var n=e.getTextOfPropertyName(t.name);e.isNumericLiteralName(n)&&!e.isInfinityOrNaNString(n)&&Qn(t.name,e.Diagnostics.An_enum_member_cannot_have_a_numeric_name);}return t.initializer?function(t){var r=Ms(Da(t.parent)),n=e.isEnumConst(t.parent),i=t.initializer,a=1!==r||Os(t)?function r(n){switch(n.kind){case 221:var i=r(n.operand);if("number"==typeof i)switch(n.operator){case 39:return i;case 40:return -i;case 54:return ~i}break;case 223:var a=r(n.left),o=r(n.right);if("number"==typeof a&&"number"==typeof o)switch(n.operatorToken.kind){case 51:return a|o;case 50:return a&o;case 48:return a>>o;case 49:return a>>>o;case 47:return a<<o;case 52:return a^o;case 41:return a*o;case 43:return a/o;case 39:return a+o;case 40:return a-o;case 44:return a%o;case 42:return Math.pow(a,o)}else if("string"==typeof a&&"string"==typeof o&&39===n.operatorToken.kind)return a+o;break;case 10:case 14:return n.text;case 8:return $C(n),+n.text;case 214:return r(n.expression);case 79:var c=n;return e.isInfinityOrNaNString(c.escapedText)?+c.escapedText:e.nodeIsMissing(n)?0:s(n,Da(t.parent),c.escapedText);case 209:case 208:if(nT(n)){var l=Qx(n.expression);if(l.symbol&&384&l.symbol.flags){var u;return u=208===n.kind?n.name.escapedText:e.escapeLeadingUnderscores(e.cast(n.argumentExpression,e.isLiteralExpression).text),s(n,l.symbol,u)}}}}(i):void 0;if(void 0!==a)n&&"number"==typeof a&&!isFinite(a)&&Qn(i,isNaN(a)?e.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:e.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);else {if(1===r)return Qn(i,e.Diagnostics.Computed_values_are_not_permitted_in_an_enum_with_string_valued_members),0;if(n)Qn(i,e.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);else if(16777216&t.parent.flags)Qn(i,e.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);else {var o=Zx(i);hx(o,296)?Rp(o,Js(Da(t.parent)),i,void 0):Qn(i,e.Diagnostics.Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead,io(o));}}return a;function s(r,n,i){var a=n.exports.get(i);if(a){var o=a.valueDeclaration;if(o!==t)return o&&gi(o,t)&&e.isEnumDeclaration(o.parent)?oC(o):(Qn(r,e.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums),0);Qn(r,e.Diagnostics.Property_0_is_used_before_being_assigned,ro(a));}}}(t):16777216&t.parent.flags&&!e.isEnumConst(t.parent)&&0===Ms(Da(t.parent))?void 0:void 0!==r?r:void Qn(t.name,e.Diagnostics.Enum_member_must_have_initializer)}function nT(t){return Qx(t)!==je&&(79===t.kind||208===t.kind&&nT(t.expression)||209===t.kind&&nT(t.expression)&&e.isStringLiteralLike(t.argumentExpression))}function iT(t){e.isPrivateIdentifier(t.name)&&Qn(t,e.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier);}function aT(t,r){switch(t.kind){case 240:for(var n=0,i=t.declarationList.declarations;n<i.length;n++)aT(i[n],r);break;case 274:case 275:GC(t,e.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 268:case 269:GC(t,e.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 205:case 257:var a=t.name;if(e.isBindingPattern(a)){for(var o=0,s=a.elements;o<s.length;o++)aT(s[o],r);break}case 260:case 263:case 259:case 261:case 264:case 262:if(r)return}}function oT(t){var r=e.getExternalModuleName(t);if(!r||e.nodeIsMissing(r))return !1;if(!e.isStringLiteral(r))return Qn(r,e.Diagnostics.String_literal_expected),!1;var n=265===t.parent.kind&&e.isAmbientModule(t.parent.parent);if(308!==t.parent.kind&&!n)return Qn(r,275===t.kind?e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace:e.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module),!1;if(n&&e.isExternalModuleNameRelative(r.text)&&!po(t))return Qn(t,e.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name),!1;if(!e.isImportEqualsDeclaration(t)&&t.assertClause){for(var i=!1,a=0,o=t.assertClause.elements;a<o.length;a++){var s=o[a];e.isStringLiteral(s.value)||(i=!0,Qn(s.value,e.Diagnostics.Import_assertion_values_must_be_string_literal_expressions));}return !i}return !0}function sT(t){var r,n,i,a,o,s=Da(t),c=Qi(s);if(c!==we){if(s=xa(s.exportSymbol||s),e.isInJSFile(t)&&!(111551&c.flags)&&!e.isTypeOnlyImportOrExportDeclaration(t)){var l=e.isImportOrExportSpecifier(t)?t.propertyName||t.name:e.isNamedDeclaration(t)?t.name:t;if(e.Debug.assert(277!==t.kind),278===t.kind){var u=Qn(l,e.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files),_=null===(n=null===(r=e.getSourceFileOfNode(t).symbol)||void 0===r?void 0:r.exports)||void 0===n?void 0:n.get((t.propertyName||t.name).escapedText);if(_===c){var d=null===(i=_.declarations)||void 0===i?void 0:i.find(e.isJSDocNode);d&&e.addRelatedInfo(u,e.createDiagnosticForNode(d,e.Diagnostics._0_is_automatically_exported_here,e.unescapeLeadingUnderscores(_.escapedName)));}}else {e.Debug.assert(257!==t.kind);var p=e.findAncestor(t,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration)),f=null!==(o=p&&(null===(a=e.tryGetModuleSpecifierFromDeclaration(p))||void 0===a?void 0:a.text))&&void 0!==o?o:"...",g=e.unescapeLeadingUnderscores(e.isIdentifier(l)?l.escapedText:s.escapedName);Qn(l,e.Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation,g,'import("'.concat(f,'").').concat(g));}return}var m=Xi(c);if(m&((1160127&s.flags?111551:0)|(788968&s.flags?788968:0)|(1920&s.flags?1920:0))&&Qn(t,278===t.kind?e.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0:e.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0,ro(s)),K.isolatedModules&&!e.isTypeOnlyImportOrExportDeclaration(t)&&!(16777216&t.flags)){var y=$i(s),v=!(111551&m);if(v||y)switch(t.kind){case 270:case 273:case 268:K.preserveValueImports&&(e.Debug.assertIsDefined(t.name,"An ImportClause with a symbol should have a name"),bi(Qn(t,v?e.Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled,h=e.idText(273===t.kind&&t.propertyName||t.name)),v?void 0:y,h)),v&&268===t.kind&&e.hasEffectiveModifier(t,1)&&Qn(t,e.Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);break;case 278:var h;if(e.getSourceFileOfNode(y)!==e.getSourceFileOfNode(t))return void bi(Qn(t,v?e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled,h=e.idText(t.propertyName||t.name)),v?void 0:y,h)}}if(e.isImportSpecifier(t)){var b=lT(s,t);cT(b)&&b.declarations&&ti(t,b.declarations,b.escapedName);}}}function cT(t){return !!t.declarations&&e.every(t.declarations,(function(t){return !!(268435456&e.getCombinedNodeFlags(t))}))}function lT(t,r){if(!(2097152&t.flags))return t;var n=Qi(t);if(n===we)return n;for(;2097152&t.flags;){var i=Dv(t);if(!i)break;if(i===n)break;if(i.declarations&&e.length(i.declarations)){if(cT(i)){ti(r,i.declarations,i.escapedName);break}if(t===n)break;t=i;}}return n}function uT(t){rS(t,t.name),sT(t),273===t.kind&&"default"===e.idText(t.propertyName||t.name)&&e.getESModuleInterop(K)&&q!==e.ModuleKind.System&&(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&DC(t,131072);}function _T(t){var r;if(t.assertClause){var n=e.isExclusivelyTypeOnlyImportOrExport(t),i=e.getResolutionModeOverrideForClause(t.assertClause,n?XC:void 0);if(n&&i)return e.isNightly()||XC(t.assertClause,e.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next),e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.NodeNext?XC(t.assertClause,e.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext):void 0;if((q===e.ModuleKind.NodeNext&&t.moduleSpecifier&&Mi(t.moduleSpecifier))!==e.ModuleKind.ESNext&&q!==e.ModuleKind.ESNext)return XC(t.assertClause,q===e.ModuleKind.NodeNext?e.Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls:e.Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext);if(e.isImportDeclaration(t)?null===(r=t.importClause)||void 0===r?void 0:r.isTypeOnly:t.isTypeOnly)return XC(t.assertClause,e.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);if(i)return XC(t.assertClause,e.Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports)}}function dT(e,t){var r=308===e.parent.kind||265===e.parent.kind||264===e.parent.kind;return r||GC(e,t),!r}function pT(t){return e.isImportDeclaration(t)&&t.importClause&&!t.importClause.isTypeOnly&&(r=t.importClause,e.forEachImportClauseDeclaration(r,(function(e){return !!Da(e).isReferenced})))&&!$T(t.importClause,!0)&&!function(t){return e.forEachImportClauseDeclaration(t,(function(e){return !!_i(Da(e)).constEnumReferenced}))}(t.importClause);var r;}function fT(t){return e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)&&!t.isTypeOnly&&Da(t).isReferenced&&!$T(t,!1)&&!_i(Da(t)).constEnumReferenced}function gT(t){if(sT(t),e.getEmitDeclarations(K)&&vo(t.propertyName||t.name,!0),t.parent.parent.moduleSpecifier)e.getESModuleInterop(K)&&q!==e.ModuleKind.System&&(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&"default"===e.idText(t.propertyName||t.name)&&DC(t,131072);else {var r=t.propertyName||t.name,n=vi(r,r.escapedText,2998271,void 0,void 0,!0);if(n&&(n===ce||n===le||n.declarations&&pi(So(n.declarations[0]))))Qn(r,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,e.idText(r));else {t.isTypeOnly||t.parent.parent.isTypeOnly||ea(t);var i=n&&(2097152&n.flags?Qi(n):n);(!i||111551&Xi(i))&&Ix(t.propertyName||t.name);}}}function mT(t){var r=Da(t),n=_i(r);if(!n.exportsChecked){var i=r.exports.get("export=");if(i&&function(t){return e.forEachEntry(t.exports,(function(e,t){return "export="!==t}))}(r)){var a=Fi(i)||i.valueDeclaration;!a||po(a)||e.isInJSFile(a)||Qn(a,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);}var o=va(r);o&&o.forEach((function(t,r){var n=t.declarations,i=t.flags;if("__export"!==r&&!(1920&i)){var a=e.countWhere(n,e.and(N,e.not(e.isInterfaceDeclaration)));if(!(524288&i&&a<=2)&&a>1&&!yT(n))for(var o=0,s=n;o<s.length;o++){var c=s[o];L(c)&&Pn.add(e.createDiagnosticForNode(c,e.Diagnostics.Cannot_redeclare_exported_variable_0,e.unescapeLeadingUnderscores(r)));}}})),n.exportsChecked=!0;}}function yT(t){return t&&t.length>1&&t.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&(e.isExportsIdentifier(t.expression)||e.isModuleExportsAccessExpression(t.expression))}))}function vT(t){if(t){var n=u;u=t,C=0,function(t){e.forEach(t.jsDoc,(function(r){var n=r.comment,i=r.tags;hT(n),e.forEach(i,(function(r){hT(r.comment),e.isInJSFile(t)&&vT(r);}));}));var n=t.kind;if(r)switch(n){case 264:case 260:case 261:case 259:r.throwIfCancellationRequested();}switch(n>=240&&n<=256&&t.flowNode&&!yy(t.flowNode)&&Yn(!1===K.allowUnreachableCode,t,e.Diagnostics.Unreachable_code_detected),n){case 165:return $x(t);case 166:return eD(t);case 169:return aD(t);case 168:return function(t){return e.isPrivateIdentifier(t.name)&&Qn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),aD(t)}(t);case 182:case 181:case 176:case 177:case 178:return rD(t);case 171:case 170:return function(t){JC(t)||IC(t.name),e.isMethodDeclaration(t)&&t.asteriskToken&&e.isIdentifier(t.name)&&"constructor"===e.idText(t.name)&&Qn(t.name,e.Diagnostics.Class_constructor_may_not_be_a_generator),MD(t),e.hasSyntacticModifier(t,256)&&171===t.kind&&t.body&&Qn(t,e.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,e.declarationNameToString(t.name)),e.isPrivateIdentifier(t.name)&&!e.getContainingClass(t)&&Qn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),oD(t);}(t);case 172:return function(t){TC(t),e.forEachChild(t,vT);}(t);case 173:return function(t){rD(t),function(t){var r=e.isInJSFile(t)?e.getJSDocTypeParameterDeclarations(t):void 0,n=t.typeParameters||r&&e.firstOrUndefined(r);if(n){var i=n.pos===n.end?n.pos:e.skipTrivia(e.getSourceFileOfNode(t).text,n.pos);return QC(t,i,n.end-i,e.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration)}}(t)||function(t){var r=t.type||e.getEffectiveReturnTypeNode(t);r&&XC(r,e.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration);}(t),vT(t.body);var r=Da(t),n=e.getDeclarationOfKind(r,t.kind);function i(t){return !!e.isPrivateIdentifierClassElementDeclaration(t)||169===t.kind&&!e.isStatic(t)&&!!t.initializer}t===n&&mD(r),e.nodeIsMissing(t.body)||m((function(){var r=t.parent;if(e.getClassExtendsHeritageElement(r)){Iy(t.parent,r);var n=My(r),a=Oy(t.body);if(a){if(n&&Qn(a,e.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null),(99!==e.getEmitScriptTarget(K)||!W)&&(e.some(t.parent.members,i)||e.some(t.parameters,(function(t){return e.hasSyntacticModifier(t,16476)}))))if(function(t,r){var n=e.walkUpParenthesizedExpressions(t.parent);return e.isExpressionStatement(n)&&n.parent===r}(a,t.body)){for(var o=void 0,s=0,c=t.body.statements;s<c.length;s++){var l=c[s];if(e.isExpressionStatement(l)&&e.isSuperCall(e.skipOuterExpressions(l.expression))){o=l;break}if(sD(l))break}void 0===o&&Qn(t,e.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers);}else Qn(a,e.Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);}else n||Qn(t,e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call);}}));}(t);case 174:case 175:return cD(t);case 180:return dD(t);case 179:return function(t){var r=function(e){switch(e.parent.kind){case 216:case 176:case 259:case 215:case 181:case 171:case 170:var t=e.parent;if(e===t.type)return t}}(t);if(r){var n=Ol(r),i=Jl(n);if(i){vT(t.type);var a=t.parameterName;if(0===i.kind||2===i.kind)Vd(a);else if(i.parameterIndex>=0)j(n)&&i.parameterIndex===n.parameters.length-1?Qn(a,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):i.type&&Rp(i.type,ds(n.parameters[i.parameterIndex]),t.type,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type)}));else if(a){for(var o=!1,s=0,c=r.parameters;s<c.length;s++){var l=c[s].name;if(e.isBindingPattern(l)&&tD(l,a,i.parameterName)){o=!0;break}}o||Qn(t.parameterName,e.Diagnostics.Cannot_find_parameter_0,i.parameterName);}}}else Qn(t,e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);}(t);case 183:return function(e){wu(e);}(t);case 184:return function(t){e.forEach(t.members,vT),m((function(){var e=Ed(t);JS(e,e.symbol),iD(t),nD(t);}));}(t);case 185:return function(e){vT(e.elementType);}(t);case 186:return function(t){for(var r=t.elements,n=!1,i=!1,a=e.some(r,e.isNamedTupleMember),o=0,s=r;o<s.length;o++){var c=s[o];if(199!==c.kind&&a){XC(c,e.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);break}var l=e_(c);if(8&l){var u=Hd(c.type);if(!Bf(u)){Qn(c,e.Diagnostics.A_rest_element_type_must_be_an_array_type);break}(If(u)||$f(u)&&4&u.target.combinedFlags)&&(i=!0);}else if(4&l){if(i){XC(c,e.Diagnostics.A_rest_element_cannot_follow_another_rest_element);break}i=!0;}else if(2&l){if(i){XC(c,e.Diagnostics.An_optional_element_cannot_follow_a_rest_element);break}n=!0;}else if(n){XC(c,e.Diagnostics.A_required_element_cannot_follow_an_optional_element);break}}e.forEach(t.elements,vT),Hd(t);}(t);case 189:case 190:return function(t){e.forEach(t.types,vT),Hd(t);}(t);case 193:case 187:case 188:return vT(t.type);case 194:return function(e){Vd(e);}(t);case 195:return function(t){!function(t){if(156===t.operator){if(153!==t.type.kind)return XC(t.type,e.Diagnostics._0_expected,e.tokenToString(153));var r=e.walkUpParenthesizedTypes(t.parent);if(e.isInJSFile(r)&&e.isJSDocTypeExpression(r)){var n=e.getJSDocHost(r);n&&(r=e.getSingleVariableOfVariableStatement(n)||n);}switch(r.kind){case 257:var i=r;if(79!==i.name.kind)return XC(t,e.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);if(!e.isVariableDeclarationInVariableStatement(i))return XC(t,e.Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);if(!(2&i.parent.flags))return XC(r.name,e.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);break;case 169:if(!e.isStatic(r)||!e.hasEffectiveReadonlyModifier(r))return XC(r.name,e.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);break;case 168:if(!e.hasSyntacticModifier(r,64))return XC(r.name,e.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);break;default:XC(t,e.Diagnostics.unique_symbol_types_are_not_allowed_here);}}else 146===t.operator&&185!==t.type.kind&&186!==t.type.kind&&GC(t,e.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,e.tokenToString(153));}(t),vT(t.type);}(t);case 191:return function(t){e.forEachChild(t,vT);}(t);case 192:return function(t){e.findAncestor(t,(function(e){return e.parent&&191===e.parent.kind&&e.parent.extendsType===e}))||XC(t,e.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type),vT(t.typeParameter);var r=Da(t.typeParameter);if(r.declarations&&r.declarations.length>1){var n=_i(r);if(!n.typeParametersChecked){n.typeParametersChecked=!0;var i=js(r),a=e.getDeclarationsOfKind(r,165);if(!WS(a,[i],(function(e){return [e]})))for(var o=ro(r),s=0,c=a;s<c.length;s++)Qn(c[s].name,e.Diagnostics.All_declarations_of_0_must_have_identical_constraints,o);}}LD(t);}(t);case 200:return function(e){for(var t=0,r=e.templateSpans;t<r.length;t++){var n=r[t];vT(n.type),Rp(Hd(n.type),yt,n.type);}Hd(e);}(t);case 202:return function(t){vT(t.argument),t.assertions&&e.getResolutionModeOverrideForClause(t.assertions.assertClause,XC)&&(e.isNightly()||XC(t.assertions.assertClause,e.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next),e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(K)!==e.ModuleResolutionKind.NodeNext&&XC(t.assertions.assertClause,e.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)),Hd(t);}(t);case 199:return function(t){t.dotDotDotToken&&t.questionToken&&XC(t,e.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest),187===t.type.kind&&XC(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type),188===t.type.kind&&XC(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type),vT(t.type),Hd(t);}(t);case 331:return function(t){var r=e.getEffectiveJSDocHost(t);if(r&&(e.isClassDeclaration(r)||e.isClassExpression(r))){var n=e.getJSDocTags(r).filter(e.isJSDocAugmentsTag);e.Debug.assert(n.length>0),n.length>1&&Qn(n[1],e.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);var i=OD(t.class.expression),a=e.getClassExtendsHeritageElement(r);if(a){var o=OD(a.expression);o&&i.escapedText!==o.escapedText&&Qn(i,e.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause,e.idText(t.tagName),e.idText(i),e.idText(o));}}else Qn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 332:return function(t){var r=e.getEffectiveJSDocHost(t);r&&(e.isClassDeclaration(r)||e.isClassExpression(r))||Qn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 348:case 341:case 342:return function(t){t.typeExpression||Qn(t.name,e.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),t.name&&KS(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),vT(t.typeExpression),VS(e.getEffectiveTypeParameterDeclarations(t));}(t);case 347:return function(e){vT(e.constraint);for(var t=0,r=e.typeParameters;t<r.length;t++)vT(r[t]);}(t);case 346:return function(e){vT(e.typeExpression);}(t);case 327:case 328:case 329:return function(e){e.name&&IT(e.name,!0);}(t);case 343:case 350:return function(e){vT(e.typeExpression);}(t);case 320:!function(t){m((function(){t.type||e.isJSDocConstructSignature(t)||Ng(t,Le);})),rD(t);}(t);case 318:case 317:case 315:case 316:case 325:return bT(t),void e.forEachChild(t,vT);case 321:return void function(t){bT(t),vT(t.type);var r=t.parent;if(e.isParameter(r)&&e.isJSDocFunctionType(r.parent))e.last(r.parent.parameters)!==r&&Qn(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);else {e.isJSDocTypeExpression(r)||Qn(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);var n=t.parent.parent;if(e.isJSDocParameterTag(n)){var i=e.getParameterSymbolFromJSDoc(n);if(i){var a=e.getHostSignatureFromJSDoc(n);a&&e.last(a.parameters).symbol===i||Qn(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);}}else Qn(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);}}(t);case 312:return vT(t.type);case 336:case 338:case 337:return function(t){var r=e.getJSDocHost(t);r&&e.isPrivateIdentifierClassElementDeclaration(r)&&Qn(t,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);}(t);case 196:return function(e){vT(e.objectType),vT(e.indexType),pD(dd(e),e);}(t);case 197:return function(t){!function(t){var r;(null===(r=t.members)||void 0===r?void 0:r.length)&&XC(t.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);}(t),vT(t.typeParameter),vT(t.nameType),vT(t.type),t.type||Ng(t,Le);var r=pd(t),n=Nc(r);n?Rp(n,gt,t.nameType):Rp(kc(r),gt,e.getEffectiveConstraintOfTypeParameter(t.typeParameter));}(t);case 259:return function(e){m((function(){MD(e),OC(e),rS(e,e.name);}));}(t);case 238:case 265:return XD(t);case 240:return cS(t);case 241:return function(e){ZC(e),Zx(e.expression);}(t);case 242:return function(t){ZC(t);var r=_S(t.expression);lS(t.expression,r,t.thenStatement),vT(t.thenStatement),239===t.thenStatement.kind&&Qn(t.thenStatement,e.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement),vT(t.elseStatement);}(t);case 243:return function(e){ZC(e),vT(e.statement),_S(e.expression);}(t);case 244:return function(e){ZC(e),_S(e.expression),vT(e.statement);}(t);case 245:return function(t){ZC(t)||t.initializer&&258===t.initializer.kind&&qC(t.initializer),t.initializer&&(258===t.initializer.kind?e.forEach(t.initializer.declarations,sS):Zx(t.initializer)),t.condition&&_S(t.condition),t.incrementor&&Zx(t.incrementor),vT(t.statement),t.locals&&LD(t);}(t);case 246:return function(t){RC(t);var r,n=Yv(Zx(t.expression));if(258===t.initializer.kind){var i=t.initializer.declarations[0];i&&e.isBindingPattern(i.name)&&Qn(i.name,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern),dS(t);}else {var a=t.initializer,o=Zx(a);206===a.kind||207===a.kind?Qn(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern):Ip(131072&(r=U_(z_(n))).flags?Ye:r,o)?gx(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access):Qn(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);}n!==ct&&hx(n,126091264)||Qn(t.expression,e.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0,io(n)),vT(t.statement),t.locals&&LD(t);}(t);case 247:return function(t){RC(t);var r=e.getContainingFunctionOrClassStaticBlock(t);if(t.awaitModifier?r&&e.isClassStaticBlockDeclaration(r)?XC(t.awaitModifier,e.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block):2==(6&e.getFunctionFlags(r))&&V<99&&DC(t,16384):K.downlevelIteration&&V<2&&DC(t,256),258===t.initializer.kind)dS(t);else {var n=t.initializer,i=pS(t);if(206===n.kind||207===n.kind)Cx(n,i||je);else {var a=Zx(n);gx(n,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access),i&&Bp(i,a,n,t.expression);}}vT(t.statement),t.locals&&LD(t);}(t);case 248:case 249:return function(t){ZC(t)||function(t){for(var r=t;r;){if(e.isFunctionLikeOrClassStaticBlockDeclaration(r))return XC(t,e.Diagnostics.Jump_target_cannot_cross_function_boundary);switch(r.kind){case 253:if(t.label&&r.label.escapedText===t.label.escapedText)return !(248!==t.kind||e.isIterationStatement(r.statement,!0))&&XC(t,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);break;case 252:if(249===t.kind&&!t.label)return !1;break;default:if(e.isIterationStatement(r,!1)&&!t.label)return !1}r=r.parent;}t.label?XC(t,249===t.kind?e.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement):XC(t,249===t.kind?e.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:e.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement);}(t);}(t);case 250:return function(t){var r;if(!ZC(t)){var n=e.getContainingFunctionOrClassStaticBlock(t);if(n&&e.isClassStaticBlockDeclaration(n))GC(t,e.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block);else if(n){var i=Ul(Ol(n)),a=e.getFunctionFlags(n);if(G||t.expression||131072&i.flags){var o=t.expression?Ix(t.expression):qe;if(175===n.kind)t.expression&&Qn(t,e.Diagnostics.Setters_cannot_return_a_value);else if(173===n.kind)t.expression&&!Bp(o,i,t,t.expression)&&Qn(t,e.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);else if(Kl(n)){var s=null!==(r=BS(i,a))&&void 0!==r?r:i,c=2&a?bD(o,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o;s&&Bp(c,s,t,t.expression);}}else 173!==n.kind&&K.noImplicitReturns&&!jS(n,i)&&Qn(t,e.Diagnostics.Not_all_code_paths_return_a_value);}else GC(t,e.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);}}(t);case 251:return function(t){ZC(t)||32768&t.flags&&GC(t,e.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block),Zx(t.expression);var r=e.getSourceFileOfNode(t);if(!HC(r)){var n=e.getSpanOfTokenAtPosition(r,t.pos).start;QC(r,n,t.statement.pos-n,e.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);}}(t);case 252:return function(t){var r;ZC(t);var n=!1,i=Zx(t.expression),a=Hf(i);e.forEach(t.caseBlock.clauses,(function(t){293!==t.kind||n||(void 0===r?r=t:(XC(t,e.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),n=!0)),292===t.kind&&m(function(e){return function(){var t=Zx(e.expression),r=Hf(t),n=i;r&&a||(t=r?Gf(t):t,n=Gf(i)),kx(n,t)||Hp(t,n,e.expression,void 0);}}(t)),e.forEach(t.statements,vT),K.noFallthroughCasesInSwitch&&t.fallthroughFlowNode&&yy(t.fallthroughFlowNode)&&Qn(t,e.Diagnostics.Fallthrough_case_in_switch);})),t.caseBlock.locals&&LD(t.caseBlock);}(t);case 253:return function(t){ZC(t)||e.findAncestor(t.parent,(function(r){return e.isFunctionLike(r)?"quit":253===r.kind&&r.label.escapedText===t.label.escapedText&&(XC(t.label,e.Diagnostics.Duplicate_label_0,e.getTextOfNode(t.label)),!0)})),vT(t.statement);}(t);case 254:return function(t){ZC(t)||e.isIdentifier(t.expression)&&!t.expression.escapedText&&function(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!HC(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);Pn.add(e.createFileDiagnostic(o,e.textSpanEnd(s),0,r,void 0,void 0,void 0));}}(t,e.Diagnostics.Line_break_not_permitted_here),t.expression&&Zx(t.expression);}(t);case 255:return function(t){ZC(t),XD(t.tryBlock);var r=t.catchClause;if(r){if(r.variableDeclaration){var n=r.variableDeclaration,i=e.getEffectiveTypeAnnotationNode(e.getRootDeclaration(n));if(i){var a=jo(n,!1,0);!a||3&a.flags||GC(i,e.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);}else if(n.initializer)GC(n.initializer,e.Diagnostics.Catch_clause_variable_cannot_have_an_initializer);else {var o=r.block.locals;o&&e.forEachKey(r.locals,(function(t){var r=o.get(t);(null==r?void 0:r.valueDeclaration)&&0!=(2&r.flags)&&XC(r.valueDeclaration,e.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause,t);}));}}XD(r.block);}t.finallyBlock&&XD(t.finallyBlock);}(t);case 257:return sS(t);case 205:return function(t){return function(t){if(t.dotDotDotToken){var r=t.parent.elements;if(t!==e.last(r))return XC(t,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);if(kC(r,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),t.propertyName)return XC(t.name,e.Diagnostics.A_rest_element_cannot_have_a_property_name)}t.dotDotDotToken&&t.initializer&&QC(t,t.initializer.pos-1,1,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}(t),iS(t)}(t);case 260:return function(t){var r=e.find(t.modifiers,e.isDecorator);r&&e.some(t.members,(function(t){return e.hasStaticModifier(t)&&e.isPrivateIdentifierClassElementDeclaration(t)}))&&XC(r,e.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator),t.name||e.hasSyntacticModifier(t,1024)||GC(t,e.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name),HS(t),e.forEach(t.members,vT),LD(t);}(t);case 261:return function(t){TC(t)||function(t){var r=!1;if(t.heritageClauses)for(var n=0,i=t.heritageClauses;n<i.length;n++){var a=i[n];if(94!==a.token)return e.Debug.assert(117===a.token),GC(a,e.Diagnostics.Interface_declaration_cannot_have_implements_clause);if(r)return GC(a,e.Diagnostics.extends_clause_already_seen);r=!0,PC(a);}}(t),VS(t.typeParameters),m((function(){KS(t.name,e.Diagnostics.Interface_name_cannot_be_0),yD(t);var r=Da(t);qS(r);var n=e.getDeclarationOfKind(r,261);if(t===n){var i=Js(r),a=oc(i);if(function(t,r){var n=Ns(t);if(n.length<2)return !0;var i=new e.Map;e.forEach(Qs(t).declaredProperties,(function(e){i.set(e.escapedName,{prop:e,containingType:t});}));for(var a=!0,o=0,s=n;o<s.length;o++)for(var c=s[o],l=0,u=zc(oc(c,t.thisType));l<u.length;l++){var _=u[l],d=i.get(_.escapedName);if(d){if(d.containingType!==t&&0===Af(d.prop,_,Ap)){a=!1;var p=io(d.containingType),f=io(c),g=e.chainDiagnosticMessages(void 0,e.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical,ro(_),p,f);g=e.chainDiagnosticMessages(g,e.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2,io(t),p,f),Pn.add(e.createDiagnosticForNodeFromMessageChain(r,g));}}else i.set(_.escapedName,{prop:_,containingType:c});}return a}(i,t.name)){for(var o=0,s=Ns(i);o<s.length;o++)Rp(a,oc(s[o],i.thisType),t.name,e.Diagnostics.Interface_0_incorrectly_extends_interface_1);JS(i,r);}}nD(t);})),e.forEach(e.getInterfaceBaseTypeNodes(t),(function(t){e.isEntityNameExpression(t.expression)&&!e.isOptionalChain(t.expression)||Qn(t.expression,e.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments),dD(t);})),e.forEach(t.members,vT),m((function(){iD(t),LD(t);}));}(t);case 262:return function(t){TC(t),KS(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),yD(t),VS(t.typeParameters),139===t.type.kind?F.has(t.name.escapedText)&&1===e.length(t.typeParameters)||Qn(t.type,e.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types):(vT(t.type),LD(t));}(t);case 263:return function(t){m((function(){return function(t){TC(t),rS(t,t.name),yD(t),t.members.forEach(iT),tT(t);var r=Da(t);if(t===e.getDeclarationOfKind(r,t.kind)){if(r.declarations&&r.declarations.length>1){var n=e.isEnumConst(t);e.forEach(r.declarations,(function(t){e.isEnumDeclaration(t)&&e.isEnumConst(t)!==n&&Qn(e.getNameOfDeclaration(t),e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const);}));}var i=!1;e.forEach(r.declarations,(function(t){if(263!==t.kind)return !1;var r=t;if(!r.members.length)return !1;var n=r.members[0];n.initializer||(i?Qn(n.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):i=!0);}));}}(t)}));}(t);case 264:return function(t){t.body&&(vT(t.body),e.isGlobalScopeAugmentation(t)||LD(t)),m((function(){var r=e.isGlobalScopeAugmentation(t),n=16777216&t.flags;r&&!n&&Qn(t.name,e.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);var i=e.isAmbientModule(t),a=i?e.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:e.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(!dT(t,a)){TC(t)||n||10!==t.name.kind||XC(t.name,e.Diagnostics.Only_ambient_modules_can_use_quoted_names),e.isIdentifier(t.name)&&rS(t,t.name),yD(t);var o,s,c,l,u=Da(t);if(512&u.flags&&!n&&u.declarations&&u.declarations.length>1&&M(t,e.shouldPreserveConstEnums(K))){var _=function(t){var r=t.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if((260===a.kind||259===a.kind&&e.nodeIsPresent(a.body))&&!(16777216&a.flags))return a}}(u);_&&(e.getSourceFileOfNode(t)!==e.getSourceFileOfNode(_)?Qn(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):t.pos<_.pos&&Qn(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged));var d=e.getDeclarationOfKind(u,260);d&&(o=t,s=d,c=e.getEnclosingBlockScopeContainer(o),l=e.getEnclosingBlockScopeContainer(s),pi(c)?pi(l):!pi(l)&&c===l)&&(di(t).flags|=32768);}if(i)if(e.isExternalModuleAugmentation(t)){if((r||33554432&Da(t).flags)&&t.body)for(var p=0,f=t.body.statements;p<f.length;p++)aT(f[p],r);}else pi(t.parent)?r?Qn(t.name,e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name))&&Qn(t.name,e.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name):Qn(t.name,r?e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:e.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);}}));}(t);case 269:return function(t){if(!dT(t,e.isInJSFile(t)?e.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:e.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!TC(t)&&e.hasEffectiveModifiers(t)&&GC(t,e.Diagnostics.An_import_declaration_cannot_have_modifiers),oT(t)){var r=t.importClause;r&&!function(t){var r;return t.isTypeOnly&&t.name&&t.namedBindings?XC(t,e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both):!(!t.isTypeOnly||272!==(null===(r=t.namedBindings)||void 0===r?void 0:r.kind))&&eE(t.namedBindings)}(r)&&(r.name&&uT(r),r.namedBindings&&(271===r.namedBindings.kind?(uT(r.namedBindings),q!==e.ModuleKind.System&&(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&e.getESModuleInterop(K)&&DC(t,65536)):oa(t,t.moduleSpecifier)&&e.forEach(r.namedBindings.elements,uT)));}_T(t);}}(t);case 268:return function(t){if(!dT(t,e.isInJSFile(t)?e.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:e.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)&&(TC(t),e.isInternalModuleImportEqualsDeclaration(t)||oT(t)))if(uT(t),e.hasSyntacticModifier(t,1)&&ea(t),280!==t.moduleReference.kind){var r=Qi(Da(t));if(r!==we){var n=Xi(r);if(111551&n){var i=e.getFirstIdentifier(t.moduleReference);1920&ia(i,112575).flags||Qn(i,e.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,e.declarationNameToString(i));}788968&n&&KS(t.name,e.Diagnostics.Import_name_cannot_be_0);}t.isTypeOnly&&XC(t,e.Diagnostics.An_import_alias_cannot_use_import_type);}else !(q>=e.ModuleKind.ES2015&&void 0===e.getSourceFileOfNode(t).impliedNodeFormat)||t.isTypeOnly||16777216&t.flags||XC(t,e.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);}(t);case 275:return function(t){if(!dT(t,e.isInJSFile(t)?e.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:e.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!TC(t)&&e.hasSyntacticModifiers(t)&&GC(t,e.Diagnostics.An_export_declaration_cannot_have_modifiers),t.moduleSpecifier&&t.exportClause&&e.isNamedExports(t.exportClause)&&e.length(t.exportClause.elements)&&0===V&&DC(t,4194304),function(t){var r;t.isTypeOnly&&(276===(null===(r=t.exportClause)||void 0===r?void 0:r.kind)?eE(t.exportClause):XC(t,e.Diagnostics.Only_named_exports_may_use_export_type));}(t),!t.moduleSpecifier||oT(t))if(t.exportClause&&!e.isNamespaceExport(t.exportClause)){e.forEach(t.exportClause.elements,gT);var r=265===t.parent.kind&&e.isAmbientModule(t.parent.parent),n=!r&&265===t.parent.kind&&!t.moduleSpecifier&&16777216&t.flags;308===t.parent.kind||r||n||Qn(t,e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);}else {var i=oa(t,t.moduleSpecifier);i&&pa(i)?Qn(t.moduleSpecifier,e.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,ro(i)):t.exportClause&&sT(t.exportClause),q!==e.ModuleKind.System&&(q<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&(t.exportClause?e.getESModuleInterop(K)&&DC(t,65536):DC(t,32768));}_T(t);}}(t);case 274:return function(t){if(!dT(t,t.isExportEquals?e.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration)){var r=308===t.parent.kind?t.parent:t.parent.parent;if(264!==r.kind||e.isAmbientModule(r)){!TC(t)&&e.hasEffectiveModifiers(t)&&GC(t,e.Diagnostics.An_export_assignment_cannot_have_modifiers);var n=e.getEffectiveTypeAnnotationNode(t);if(n&&Rp(Ix(t.expression),Hd(n),t.expression),79===t.expression.kind){var i=t.expression,a=ia(i,67108863,!0,!0,t);a?(Py(a,i),111551&Xi(2097152&a.flags?Qi(a):a)&&Ix(t.expression)):Ix(t.expression),e.getEmitDeclarations(K)&&vo(t.expression,!0);}else Ix(t.expression);mT(r),16777216&t.flags&&!e.isEntityNameExpression(t.expression)&&XC(t.expression,e.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),!t.isExportEquals||16777216&t.flags||(q>=e.ModuleKind.ES2015&&e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.CommonJS?XC(t,e.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):q===e.ModuleKind.System&&XC(t,e.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system));}else t.isExportEquals?Qn(t,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace):Qn(t,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);}}(t);case 239:case 256:return void ZC(t);case 279:!function(e){ID(e);}(t);}}(t),u=n;}}function hT(t){e.isArray(t)&&e.forEach(t,(function(t){e.isJSDocLinkLike(t)&&vT(t);}));}function bT(t){e.isInJSFile(t)||XC(t,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);}function xT(t){var r=di(e.getSourceFileOfNode(t));1&r.flags||(r.deferredNodes||(r.deferredNodes=new e.Set),r.deferredNodes.add(t));}function DT(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkDeferredNode",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var r=u;switch(u=t,C=0,t.kind){case 210:case 211:case 212:case 167:case 283:wh(t);break;case 215:case 216:case 171:case 170:!function(t){e.Debug.assert(171!==t.kind||e.isObjectLiteralMethod(t));var r=e.getFunctionFlags(t),n=Kl(t);if(lx(t,n),t.body)if(e.getEffectiveReturnTypeNode(t)||Ul(Ol(t)),238===t.body.kind)vT(t.body);else {var i=Zx(t.body),a=n&&BS(n,r);a&&Bp(2==(3&r)?bD(i,!1,t.body,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,a,t.body,t.body);}}(t);break;case 174:case 175:cD(t);break;case 228:!function(t){e.forEach(t.members,vT),LD(t);}(t);break;case 165:!function(t){if(e.isInterfaceDeclaration(t.parent)||e.isClassLike(t.parent)||e.isTypeAliasDeclaration(t.parent)){var r=js(Da(t)),n=hf(r);if(n){var i=Da(t.parent);if(!e.isTypeAliasDeclaration(t.parent)||48&e.getObjectFlags(Js(i))){if(32768===n||65536===n){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","checkTypeParameterDeferred",{parent:p_(Js(i)),id:p_(r)});var a=yf(i,r,65536===n?Jt:jt),o=yf(i,r,65536===n?jt:Jt),s=r;_=r,Rp(a,o,t,e.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation),_=s,null===e.tracing||void 0===e.tracing||e.tracing.pop();}}else Qn(t,e.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);}}}(t);break;case 282:!function(e){zv(e);}(t);break;case 281:!function(e){zv(e.openingElement),Cv(e.closingElement.tagName)?Fv(e.closingElement):Zx(e.closingElement.tagName),kv(e);}(t);}u=r,null===e.tracing||void 0===e.tracing||e.tracing.pop();}function ST(t,r){if(r)return !1;switch(t){case 0:return !!K.noUnusedLocals;case 1:return !!K.noUnusedParameters;default:return e.Debug.assertNever(t)}}function TT(t){return en.get(t.path)||e.emptyArray}function CT(n,i){try{return r=i,function(r){if(r){ET();var n=Pn.getGlobalDiagnostics(),i=n.length;kT(r);var a=Pn.getDiagnostics(r.fileName),o=Pn.getGlobalDiagnostics();if(o!==n){var s=e.relativeComplement(n,o,e.compareDiagnostics);return e.concatenate(s,a)}return 0===i&&o.length>0?e.concatenate(o,a):a}return e.forEach(t.getSourceFiles(),kT),Pn.getDiagnostics()}(n)}finally{r=void 0;}}function ET(){for(var e=0,t=g;e<t.length;e++)(0, t[e])();g=[];}function kT(r){ET();var n,i=m;m=function(e){return e()},n=r,null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkSourceFile",{path:n.path},!0),e.performance.mark("beforeCheck"),function(r){var n=di(r);if(!(1&n.flags)){if(e.skipTypeChecking(r,K,t))return;!function(t){16777216&t.flags&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if((e.isDeclaration(i)||240===i.kind)&&YC(i))return !0}}(t);}(r),e.clear(Cn),e.clear(En),e.clear(kn),e.clear(Nn),e.clear(An),e.forEach(r.statements,vT),vT(r.endOfFileToken),function(e){var t=di(e);t.deferredNodes&&t.deferredNodes.forEach(DT);}(r),e.isExternalOrCommonJsModule(r)&&LD(r),m((function(){r.isDeclarationFile||!K.noUnusedLocals&&!K.noUnusedParameters||RD(TT(r),(function(t,r,n){!e.containsParseError(t)&&ST(r,!!(16777216&t.flags))&&Pn.add(n);})),r.isDeclarationFile||function(){for(var t,r=0,n=An;r<n.length;r++){var i=n[r];if(!(null===(t=Da(i))||void 0===t?void 0:t.isReferenced)){var a=e.walkUpBindingElementsAndPatterns(i);e.Debug.assert(e.isParameterDeclaration(a),"Only parameter declaration should be checked here");var o=e.createDiagnosticForNode(i.name,e.Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation,e.declarationNameToString(i.name),e.declarationNameToString(i.propertyName));a.type||e.addRelatedInfo(o,e.createFileDiagnostic(e.getSourceFileOfNode(a),a.end,1,e.Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here,e.declarationNameToString(i.propertyName))),Pn.add(o);}}}();})),2===K.importsNotUsedAsValues&&!r.isDeclarationFile&&e.isExternalModule(r)&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];(pT(i)||fT(i))&&Qn(i,e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error);}}(r),e.isExternalOrCommonJsModule(r)&&mT(r),Cn.length&&(e.forEach(Cn,ZD),e.clear(Cn)),En.length&&(e.forEach(En,$D),e.clear(En)),kn.length&&(e.forEach(kn,eS),e.clear(kn)),Nn.length&&(e.forEach(Nn,tS),e.clear(Nn)),n.flags|=1;}}(n),e.performance.mark("afterCheck"),e.performance.measure("Check","beforeCheck","afterCheck"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),m=i;}function NT(e){for(;163===e.parent.kind;)e=e.parent;return 180===e.parent.kind}function AT(t,r){for(var n;(t=e.getContainingClass(t))&&!(n=r(t)););return n}function FT(e,t){return !!AT(e,(function(e){return e===t}))}function PT(e){return void 0!==function(e){for(;163===e.parent.kind;)e=e.parent;return 268===e.parent.kind?e.parent.moduleReference===e?e.parent:void 0:274===e.parent.kind&&e.parent.expression===e?e.parent:void 0}(e)}function wT(t){if(e.isDeclarationName(t))return Da(t.parent);if(e.isInJSFile(t)&&208===t.parent.kind&&t.parent===t.parent.parent.left&&!e.isPrivateIdentifier(t)&&!e.isJSDocMemberName(t)){var r=function(t){switch(e.getAssignmentDeclarationKind(t.parent.parent)){case 1:case 3:return Da(t.parent);case 4:case 2:case 5:return Da(t.parent.parent)}}(t);if(r)return r}if(274===t.parent.kind&&e.isEntityNameExpression(t)){var n=ia(t,2998271,!0);if(n&&n!==we)return n}else if(e.isEntityName(t)&&PT(t)){var i=e.getAncestor(t,268);return e.Debug.assert(void 0!==i),ra(t,!0)}if(e.isEntityName(t)){var a=function(t){for(var r=t.parent;e.isQualifiedName(r);)t=r,r=r.parent;if(r&&202===r.kind&&r.qualifier===t)return r}(t);if(a){Hd(a);var o=di(t).resolvedSymbol;return o===we?void 0:o}}for(;e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(t);)t=t.parent;if(function(e){for(;208===e.parent.kind;)e=e.parent;return 230===e.parent.kind}(t)){var s=0;230===t.parent.kind?(s=788968,e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)&&(s|=111551)):s=1920,s|=2097152;var c=e.isEntityNameExpression(t)?ia(t,s):void 0;if(c)return c}if(343===t.parent.kind)return e.getParameterSymbolFromJSDoc(t.parent);if(165===t.parent.kind&&347===t.parent.parent.kind){e.Debug.assert(!e.isInJSFile(t));var l=e.getTypeParameterFromJsDoc(t.parent);return l&&l.symbol}if(e.isExpressionNode(t)){if(e.nodeIsMissing(t))return;var u=e.findAncestor(t,e.or(e.isJSDocLinkLike,e.isJSDocNameReference,e.isJSDocMemberName));if(s=u?901119:111551,79===t.kind){if(e.isJSXTagName(t)&&Cv(t))return (m=Fv(t.parent))===we?void 0:m;var _,d=ia(t,s,!1,!0,e.getHostSignatureFromJSDoc(t));return !d&&u&&(_=e.findAncestor(t,e.or(e.isClassLike,e.isInterfaceDeclaration)))?IT(t,!1,Da(_)):d&&u&&(_=e.getJSDocHost(t))&&e.isEnumMember(_)&&_===d.valueDeclaration&&ia(t,s,!0,!0,e.getSourceFileOfNode(_))||d}if(e.isPrivateIdentifier(t))return sh(t);if(208===t.kind||163===t.kind){var p=di(t);if(p.resolvedSymbol)return p.resolvedSymbol;if(208===t.kind){if(nh(t,0),!p.resolvedSymbol){var f=Ix(t.expression),g=Dl(f,M_(t.name));if(g.length&&f.members){var m=Rc(f).members.get("__index");if(g===hl(f))p.resolvedSymbol=m;else if(m){var y=_i(m),v=e.mapDefined(g,(function(e){return e.declaration})),h=e.map(v,I).join(",");if(y.filteredIndexSymbolCache||(y.filteredIndexSymbolCache=new e.Map),y.filteredIndexSymbolCache.has(h))p.resolvedSymbol=y.filteredIndexSymbolCache.get(h);else {var b=ri(131072,"__index");b.declarations=e.mapDefined(g,(function(e){return e.declaration})),b.parent=f.aliasSymbol?f.aliasSymbol:f.symbol?f.symbol:OT(b.declarations[0].parent),y.filteredIndexSymbolCache.set(h,b),p.resolvedSymbol=y.filteredIndexSymbolCache.get(h);}}}}}else ih(t,0);return !p.resolvedSymbol&&u&&e.isQualifiedName(t)?IT(t):p.resolvedSymbol}if(e.isJSDocMemberName(t))return IT(t)}else if(NT(t))return (m=ia(t,s=180===t.parent.kind?788968:1920,!1,!0))&&m!==we?m:bu(t);return 179===t.parent.kind?ia(t,1):void 0}function IT(t,r,n){if(e.isEntityName(t)){var i=901119,a=ia(t,i,r,!0,e.getHostSignatureFromJSDoc(t));if(!a&&e.isIdentifier(t)&&n&&(a=xa(fi(ya(n),t.escapedText,i))),a)return a}var o=e.isIdentifier(t)?n:IT(t.left,r,n),s=e.isIdentifier(t)?t.escapedText:t.right.escapedText;if(o){var c=111551&o.flags&&dl(ds(o),"prototype");return dl(c?ds(c):Js(o),s)}}function OT(t,r){if(308===t.kind)return e.isExternalModule(t)?xa(t.symbol):void 0;var n=t.parent,i=n.parent;if(!(33554432&t.flags)){if(R(t)){var a=Da(n);return e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t?Dv(a):a}if(e.isLiteralComputedPropertyDeclarationName(t))return Da(n.parent);if(79===t.kind){if(PT(t))return wT(t);if(205===n.kind&&203===i.kind&&t===n.propertyName){var o=dl(MT(i),t.escapedText);if(o)return o}else if(e.isMetaProperty(n)&&n.name===t)return 103===n.keywordToken&&"target"===e.idText(t)?Ob(n).symbol:100===n.keywordToken&&"meta"===e.idText(t)?Ju().members.get("meta"):void 0}switch(t.kind){case 79:case 80:case 208:case 163:if(!e.isThisInTypeQuery(t))return wT(t);case 108:var s=e.getThisContainer(t,!1);if(e.isFunctionLike(s)){var c=Ol(s);if(c.thisParameter)return c.thisParameter}if(e.isInExpressionContext(t))return Zx(t).symbol;case 194:return Vd(t).symbol;case 106:return Zx(t).symbol;case 135:var l=t.parent;return l&&173===l.kind?l.parent.symbol:void 0;case 10:case 14:if(e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t||(269===t.parent.kind||275===t.parent.kind)&&t.parent.moduleSpecifier===t||e.isInJSFile(t)&&e.isRequireCall(t.parent,!1)||e.isImportCall(t.parent)||e.isLiteralTypeNode(t.parent)&&e.isLiteralImportTypeNode(t.parent.parent)&&t.parent.parent.argument===t.parent)return oa(t,t,r);if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n)&&n.arguments[1]===t)return Da(n);case 8:var u=e.isElementAccessExpression(n)?n.argumentExpression===t?Qx(n.expression):void 0:e.isLiteralTypeNode(n)&&e.isIndexedAccessTypeNode(i)?Hd(i.objectType):void 0;return u&&dl(u,e.escapeLeadingUnderscores(t.text));case 88:case 98:case 38:case 84:return Da(t.parent);case 202:return e.isLiteralImportTypeNode(t)?OT(t.argument.literal,r):void 0;case 93:return e.isExportAssignment(t.parent)?e.Debug.checkDefined(t.parent.symbol):void 0;case 100:case 103:return e.isMetaProperty(t.parent)?Ib(t.parent).symbol:void 0;case 233:return Zx(t).symbol;default:return}}}function MT(t){if(e.isSourceFile(t)&&!e.isExternalModule(t))return je;if(33554432&t.flags)return je;var r,n,i=e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(t),a=i&&Ps(Da(i.class));if(e.isPartOfTypeNode(t)){var o=Hd(t);return a?oc(o,a.thisType):o}if(e.isExpressionNode(t))return RT(t);if(a&&!i.isImplements){var s=e.firstOrUndefined(Ns(a));return s?oc(s,a.thisType):je}if(e.isTypeDeclaration(t))return Js(n=Da(t));if(79===(r=t).kind&&e.isTypeDeclaration(r.parent)&&e.getNameOfDeclaration(r.parent)===r)return (n=OT(t))?Js(n):je;if(e.isDeclaration(t))return (n=Da(t))?ds(n):je;if(R(t))return (n=OT(t))?ds(n):je;if(e.isBindingPattern(t))return jo(t.parent,!0,0)||je;if(PT(t)&&(n=OT(t))){var c=Js(n);return Eo(c)?ds(n):c}return e.isMetaProperty(t.parent)&&t.parent.keywordToken===t.kind?Ib(t.parent):je}function LT(t){if(e.Debug.assert(207===t.kind||206===t.kind),247===t.parent.kind)return Cx(t,pS(t.parent)||je);if(223===t.parent.kind)return Cx(t,Qx(t.parent.right)||je);if(299===t.parent.kind){var r=e.cast(t.parent.parent,e.isObjectLiteralExpression);return Sx(r,LT(r)||je,e.indexOfNode(r.properties,t.parent))}var n=e.cast(t.parent,e.isArrayLiteralExpression),i=LT(n)||je,a=fS(65,i,qe,t.parent)||je;return Tx(n,i,n.elements.indexOf(t),a)}function RT(t){return e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),Rd(Qx(t))}function BT(t){var r=Da(t.parent);return e.isStatic(t)?ds(r):Js(r)}function jT(t){var r=t.name;switch(r.kind){case 79:return jd(e.idText(r));case 8:case 10:return jd(r.text);case 164:var n=hv(r);return hx(n,12288)?n:Ye;default:return e.Debug.fail("Unsupported property name.")}}function JT(t){t=rl(t);var r=e.createSymbolTable(zc(t)),n=fl(t,0).length?Ht:fl(t,1).length?Gt:void 0;return n&&e.forEach(zc(n),(function(e){r.has(e.escapedName)||r.set(e.escapedName,e);})),Ra(r)}function zT(t){return e.typeHasCallOrConstructSignatures(t,pe)}function UT(t){if(e.isGeneratedIdentifier(t))return !1;var r=e.getParseTreeNode(t,e.isIdentifier);if(!r)return !1;var n=r.parent;return !(!n||(e.isPropertyAccessExpression(n)||e.isPropertyAssignment(n))&&n.name===r||gC(r)!==_e)}function KT(t){var r=oa(t.parent,t);if(!r||e.isShorthandAmbientModuleSymbol(r))return !0;var n=pa(r),i=_i(r=ua(r));return void 0===i.exportsSomeValue&&(i.exportsSomeValue=n?!!(111551&r.flags):e.forEachEntry(va(r),(function(e){return (e=Gi(e))&&!!(111551&Xi(e))}))),i.exportsSomeValue}function VT(t,r){var n,i=e.getParseTreeNode(t,e.isIdentifier);if(i){var a=gC(i,function(t){return e.isModuleOrEnumDeclaration(t.parent)&&t===t.parent.name}(i));if(a){if(1048576&a.flags){var o=xa(a.exportSymbol);if(!r&&944&o.flags&&!(3&o.flags))return;a=o;}var s=Sa(a);if(s){if(512&s.flags&&308===(null===(n=s.valueDeclaration)||void 0===n?void 0:n.kind)){var c=s.valueDeclaration;return c!==e.getSourceFileOfNode(i)?void 0:c}return e.findAncestor(i.parent,(function(t){return e.isModuleOrEnumDeclaration(t)&&Da(t)===s}))}}}}function qT(t){if(t.generatedImportReference)return t.generatedImportReference;var r,n,i=e.getParseTreeNode(t,e.isIdentifier);if(i){var a=(n=di(r=i).resolvedSymbol)&&n!==we?n:vi(r,r.escapedText,3257279,void 0,void 0,!0,void 0,void 0);if(Hi(a,111551)&&!$i(a,111551))return Fi(a)}}function WT(t){if(418&t.flags&&t.valueDeclaration&&!e.isSourceFile(t.valueDeclaration)){var r=_i(t);if(void 0===r.isDeclarationWithCollidingName){var n=e.getEnclosingBlockScopeContainer(t.valueDeclaration);if(e.isStatementWithLocals(n)||function(t){return t.valueDeclaration&&e.isBindingElement(t.valueDeclaration)&&295===e.walkUpBindingElementsAndPatterns(t.valueDeclaration).parent.kind}(t)){var i=di(t.valueDeclaration);if(vi(n.parent,t.escapedName,111551,void 0,void 0,!1))r.isDeclarationWithCollidingName=!0;else if(262144&i.flags){var a=524288&i.flags,o=e.isIterationStatement(n,!1),s=238===n.kind&&e.isIterationStatement(n.parent,!1);r.isDeclarationWithCollidingName=!(e.isBlockScopedContainerTopLevel(n)||a&&(o||s));}else r.isDeclarationWithCollidingName=!1;}}return r.isDeclarationWithCollidingName}return !1}function HT(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=gC(r);if(n&&WT(n))return n.valueDeclaration}}}function GT(t){var r=e.getParseTreeNode(t,e.isDeclaration);if(r){var n=Da(r);if(n)return WT(n)}return !1}function QT(t){switch(t.kind){case 268:return YT(Da(t));case 270:case 271:case 273:case 278:var r=Da(t);return !!r&&YT(r)&&!$i(r,111551);case 275:var n=t.exportClause;return !!n&&(e.isNamespaceExport(n)||e.some(n.elements,QT));case 274:return !t.expression||79!==t.expression.kind||YT(Da(t))}return !1}function XT(t){var r=e.getParseTreeNode(t,e.isImportEqualsDeclaration);return !(void 0===r||308!==r.parent.kind||!e.isInternalModuleImportEqualsDeclaration(r))&&YT(Da(r))&&r.moduleReference&&!e.nodeIsMissing(r.moduleReference)}function YT(t){var r;if(!t)return !1;var n=Na(Qi(t));return n===we||!!(111551&(null!==(r=Xi(n))&&void 0!==r?r:-1))&&(e.shouldPreserveConstEnums(K)||!ZT(n))}function ZT(e){return Dx(e)||!!e.constEnumOnlyModule}function $T(t,r){if(Pi(t)){var n=Da(t),i=n&&_i(n);if(null==i?void 0:i.referenced)return !0;var a=_i(n).aliasTarget;if(a&&1&e.getEffectiveModifierFlags(t)&&111551&Xi(a)&&(e.shouldPreserveConstEnums(K)||!ZT(a)))return !0}return !!r&&!!e.forEachChild(t,(function(e){return $T(e,r)}))}function eC(t){if(e.nodeIsPresent(t.body)){if(e.isGetAccessor(t)||e.isSetAccessor(t))return !1;var r=Rl(Da(t));return r.length>1||1===r.length&&r[0].declaration!==t}return !1}function tC(t){return !(!G||Al(t)||e.isJSDocParameterTag(t)||!t.initializer||e.hasSyntacticModifier(t,16476))}function rC(t){return G&&Al(t)&&!t.initializer&&e.hasSyntacticModifier(t,16476)}function nC(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return !1;var n=Da(r);return !!(n&&16&n.flags)&&!!e.forEachEntry(ya(n),(function(t){return 111551&t.flags&&t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)}))}function iC(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return e.emptyArray;var n=Da(r);return n&&zc(ds(n))||e.emptyArray}function aC(e){var t,r=e.id||0;return r<0||r>=mn.length?0:(null===(t=mn[r])||void 0===t?void 0:t.flags)||0}function oC(e){return tT(e.parent),di(e).enumMemberValue}function sC(e){switch(e.kind){case 302:case 208:case 209:return !0}return !1}function cC(t){if(302===t.kind)return oC(t);var r=di(t).resolvedSymbol;if(r&&8&r.flags){var n=r.valueDeclaration;if(e.isEnumConst(n.parent))return oC(n)}}function lC(e){return !!(524288&e.flags)&&fl(e,0).length>0}function uC(t,r){var n,i,a=e.getParseTreeNode(t,e.isEntityName);if(!a)return e.TypeReferenceSerializationKind.Unknown;if(r&&!(r=e.getParseTreeNode(r)))return e.TypeReferenceSerializationKind.Unknown;var o=!1;if(e.isQualifiedName(a)){var s=ia(e.getFirstIdentifier(a),111551,!0,!0,r);o=!!(null===(n=null==s?void 0:s.declarations)||void 0===n?void 0:n.every(e.isTypeOnlyImportOrExportDeclaration));}var c=ia(a,111551,!0,!0,r),l=c&&2097152&c.flags?Qi(c):c;o||(o=!!(null===(i=null==c?void 0:c.declarations)||void 0===i?void 0:i.every(e.isTypeOnlyImportOrExportDeclaration)));var u=ia(a,788968,!0,!1,r);if(l&&l===u){var _=Wu(!1);if(_&&l===_)return e.TypeReferenceSerializationKind.Promise;var d=ds(l);if(d&&Ds(d))return o?e.TypeReferenceSerializationKind.TypeWithCallSignature:e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue}if(!u)return o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown;var p=Js(u);return Eo(p)?o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown:3&p.flags?e.TypeReferenceSerializationKind.ObjectType:hx(p,245760)?e.TypeReferenceSerializationKind.VoidNullableOrNeverType:hx(p,528)?e.TypeReferenceSerializationKind.BooleanType:hx(p,296)?e.TypeReferenceSerializationKind.NumberLikeType:hx(p,2112)?e.TypeReferenceSerializationKind.BigIntLikeType:hx(p,402653316)?e.TypeReferenceSerializationKind.StringLikeType:$f(p)?e.TypeReferenceSerializationKind.ArrayLikeType:hx(p,12288)?e.TypeReferenceSerializationKind.ESSymbolType:lC(p)?e.TypeReferenceSerializationKind.TypeWithCallSignature:If(p)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function _C(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isVariableLikeOrAccessor);if(!o)return e.factory.createToken(131);var s=Da(o),c=!s||133120&s.flags?je:Qf(ds(s));return 8192&c.flags&&c.symbol===s&&(n|=1048576),a&&(c=cg(c)),oe.typeToTypeNode(c,r,1024|n,i)}function dC(t,r,n,i){var a=e.getParseTreeNode(t,e.isFunctionLike);if(!a)return e.factory.createToken(131);var o=Ol(a);return oe.typeToTypeNode(Ul(o),r,1024|n,i)}function pC(t,r,n,i){var a=e.getParseTreeNode(t,e.isExpression);if(!a)return e.factory.createToken(131);var o=Cg(RT(a));return oe.typeToTypeNode(o,r,1024|n,i)}function fC(t){return se.has(e.escapeLeadingUnderscores(t))}function gC(t,r){var n=di(t).resolvedSymbol;if(n)return n;var i=t;if(r){var a=t.parent;e.isDeclaration(a)&&t===a.name&&(i=So(a));}return vi(i,t.escapedText,3257279,void 0,void 0,!0)}function mC(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=gC(r);if(n)return Na(n).valueDeclaration}}}function yC(t){return !!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&Bd(ds(Da(t)))}function vC(t,r){return function(t,r,n){var i=1024&t.flags?oe.symbolToExpression(t.symbol,111551,r,void 0,n):t===rt?e.factory.createTrue():t===et&&e.factory.createFalse();if(i)return i;var a=t.value;return "object"==typeof a?e.factory.createBigIntLiteral(a):"number"==typeof a?e.factory.createNumericLiteral(a):e.factory.createStringLiteral(a)}(ds(Da(t)),t,r)}function hC(t){return t?(Vn(t),e.getSourceFileOfNode(t).localJsxFactory||Br):Br}function bC(t){if(t){var r=e.getSourceFileOfNode(t);if(r){if(r.localJsxFragmentFactory)return r.localJsxFragmentFactory;var n=r.pragmas.get("jsxfrag"),i=e.isArray(n)?n[0]:n;if(i)return r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,V),r.localJsxFragmentFactory}}if(K.jsxFragmentFactory)return e.parseIsolatedEntityName(K.jsxFragmentFactory,V)}function xC(t){var r=264===t.kind?e.tryCast(t.name,e.isStringLiteral):e.getExternalModuleName(t),n=sa(r,r,void 0);if(n)return e.getDeclarationOfKind(n,308)}function DC(t,r){if((a&r)!==r&&K.importHelpers){var n=e.getSourceFileOfNode(t);if(e.isEffectiveExternalModule(n,K)&&!(16777216&t.flags)){var i=(_=n,d=t,s||(s=ca(_,e.externalHelpersModuleNameText,e.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,d)||we),s);if(i!==we)for(var o=r&~a,c=1;c<=4194304;c<<=1)if(o&c){var l=SC(c),u=fi(i.exports,e.escapeLeadingUnderscores(l),111551);u?524288&c?e.some(Rl(u),(function(e){return Vb(e)>3}))||Qn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,4):1048576&c?e.some(Rl(u),(function(e){return Vb(e)>4}))||Qn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,5):1024&c&&(e.some(Rl(u),(function(e){return Vb(e)>2}))||Qn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,3)):Qn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l);}a|=r;}}var _,d;}function SC(t){switch(t){case 1:return "__extends";case 2:return "__assign";case 4:return "__rest";case 8:return "__decorate";case 16:return "__metadata";case 32:return "__param";case 64:return "__awaiter";case 128:return "__generator";case 256:return "__values";case 512:return "__read";case 1024:return "__spreadArray";case 2048:return "__await";case 4096:return "__asyncGenerator";case 8192:return "__asyncDelegator";case 16384:return "__asyncValues";case 32768:return "__exportStar";case 65536:return "__importStar";case 131072:return "__importDefault";case 262144:return "__makeTemplateObject";case 524288:return "__classPrivateFieldGet";case 1048576:return "__classPrivateFieldSet";case 2097152:return "__classPrivateFieldIn";case 4194304:return "__createBinding";default:return e.Debug.fail("Unrecognized helper")}}function TC(t){return function(t){if(e.canHaveIllegalDecorators(t)&&e.some(t.illegalDecorators))return GC(t,e.Diagnostics.Decorators_are_not_valid_here);if(!e.canHaveDecorators(t)||!e.hasDecorators(t))return !1;if(!e.nodeCanBeDecorated(t,t.parent,t.parent.parent))return 171!==t.kind||e.nodeIsPresent(t.body)?GC(t,e.Diagnostics.Decorators_are_not_valid_here):GC(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(174===t.kind||175===t.kind){var r=e.getAllAccessorDeclarations(t.parent.members,t);if(e.hasDecorators(r.firstAccessor)&&t===r.secondAccessor)return GC(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return !1}(t)||CC(t)}function CC(t){var r,n,i,a,o=function(t){return !!t.modifiers&&(function(t){switch(t.kind){case 174:case 175:case 173:case 169:case 168:case 171:case 170:case 178:case 264:case 269:case 268:case 275:case 274:case 215:case 216:case 166:case 165:return !1;case 172:case 299:case 300:case 267:case 181:case 279:return !0;default:if(265===t.parent.kind||308===t.parent.kind)return !1;switch(t.kind){case 259:return EC(t,132);case 260:case 182:return EC(t,126);case 228:case 261:case 240:case 262:return !0;case 263:return EC(t,85);default:e.Debug.assertNever(t);}}}(t)?GC(t,e.Diagnostics.Modifiers_cannot_appear_here):void 0)}(t);if(void 0!==o)return o;for(var s=0,c=0,l=t.modifiers;c<l.length;c++){var u=l[c];if(!e.isDecorator(u)){if(146!==u.kind){if(168===t.kind||170===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_type_member,e.tokenToString(u.kind));if(178===t.kind&&(124!==u.kind||!e.isClassLike(t.parent)))return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_an_index_signature,e.tokenToString(u.kind))}if(101!==u.kind&&145!==u.kind&&165===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_type_parameter,e.tokenToString(u.kind));switch(u.kind){case 85:if(263!==t.kind)return XC(t,e.Diagnostics.A_class_member_cannot_have_the_0_keyword,e.tokenToString(85));break;case 161:if(16384&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"override");if(2&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"override","declare");if(64&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","readonly");if(128&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","accessor");if(512&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","async");s|=16384,a=u;break;case 123:case 122:case 121:var _=_o(e.modifierToFlag(u.kind));if(28&s)return XC(u,e.Diagnostics.Accessibility_modifier_already_seen);if(16384&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"override");if(32&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"static");if(128&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"accessor");if(64&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"readonly");if(512&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"async");if(265===t.parent.kind||308===t.parent.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,_);if(256&s)return 121===u.kind?XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,_,"abstract"):XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,_,"abstract");if(e.isPrivateIdentifierClassElementDeclaration(t))return XC(u,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);s|=e.modifierToFlag(u.kind);break;case 124:if(32&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"static");if(64&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","readonly");if(512&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","async");if(128&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","accessor");if(265===t.parent.kind||308===t.parent.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static");if(166===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"static");if(256&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(16384&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","override");s|=32,r=u;break;case 127:if(128&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"accessor");if(64&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"accessor","readonly");if(2&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"accessor","declare");if(169!==t.kind)return XC(u,e.Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);s|=128;break;case 146:if(64&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"readonly");if(169!==t.kind&&168!==t.kind&&178!==t.kind&&166!==t.kind)return XC(u,e.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);s|=64;break;case 93:if(1&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"export");if(2&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","declare");if(256&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","abstract");if(512&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","async");if(e.isClassLike(t.parent))return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export");if(166===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"export");s|=1;break;case 88:var d=308===t.parent.kind?t.parent:t.parent.parent;if(264===d.kind&&!e.isAmbientModule(d))return XC(u,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);if(!(1&s))return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","default");s|=1024;break;case 136:if(2&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"declare");if(512&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(16384&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"override");if(e.isClassLike(t.parent)&&!e.isPropertyDeclaration(t))return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare");if(166===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"declare");if(16777216&t.parent.flags&&265===t.parent.kind)return XC(u,e.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);if(e.isPrivateIdentifierClassElementDeclaration(t))return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"declare");s|=2,n=u;break;case 126:if(256&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"abstract");if(260!==t.kind&&182!==t.kind){if(171!==t.kind&&169!==t.kind&&174!==t.kind&&175!==t.kind)return XC(u,e.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);if(260!==t.parent.kind||!e.hasSyntacticModifier(t.parent,256))return XC(u,e.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);if(32&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(8&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"private","abstract");if(512&s&&i)return XC(i,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");if(16384&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"abstract","override");if(128&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"abstract","accessor")}if(e.isNamedDeclaration(t)&&80===t.name.kind)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"abstract");s|=256;break;case 132:if(512&s)return XC(u,e.Diagnostics._0_modifier_already_seen,"async");if(2&s||16777216&t.parent.flags)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(166===t.kind)return XC(u,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"async");if(256&s)return XC(u,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");s|=512,i=u;break;case 101:case 145:var p=101===u.kind?32768:65536,f=101===u.kind?"in":"out";if(165!==t.kind||!(e.isInterfaceDeclaration(t.parent)||e.isClassLike(t.parent)||e.isTypeAliasDeclaration(t.parent)))return XC(u,e.Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias,f);if(s&p)return XC(u,e.Diagnostics._0_modifier_already_seen,f);if(32768&p&&65536&s)return XC(u,e.Diagnostics._0_modifier_must_precede_1_modifier,"in","out");s|=p;}}}return 173===t.kind?32&s?XC(r,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"static"):16384&s?XC(a,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"override"):!!(512&s)&&XC(i,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"async"):(269===t.kind||268===t.kind)&&2&s?XC(n,e.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare"):166===t.kind&&16476&s&&e.isBindingPattern(t.name)?XC(t,e.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern):166===t.kind&&16476&s&&t.dotDotDotToken?XC(t,e.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter):!!(512&s)&&function(t,r){switch(t.kind){case 171:case 259:case 215:case 216:return !1}return XC(r,e.Diagnostics._0_modifier_cannot_be_used_here,"async")}(t,i)}function EC(t,r){for(var n=0,i=t.modifiers;n<i.length;n++){var a=i[n];if(!e.isDecorator(a))return a.kind!==r}return !1}function kC(t,r){return void 0===r&&(r=e.Diagnostics.Trailing_comma_not_allowed),!(!t||!t.hasTrailingComma)&&QC(t[0],t.end-",".length,",".length,r)}function NC(t,r){if(t&&0===t.length){var n=t.pos-"<".length;return QC(r,n,e.skipTrivia(r.text,t.end)+">".length-n,e.Diagnostics.Type_parameter_list_cannot_be_empty)}return !1}function AC(t){var r=e.getSourceFileOfNode(t);return TC(t)||NC(t.typeParameters,r)||function(t){for(var r=!1,n=t.length,i=0;i<n;i++){var a=t[i];if(a.dotDotDotToken){if(i!==n-1)return XC(a.dotDotDotToken,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);if(16777216&a.flags||kC(t,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),a.questionToken)return XC(a.questionToken,e.Diagnostics.A_rest_parameter_cannot_be_optional);if(a.initializer)return XC(a.name,e.Diagnostics.A_rest_parameter_cannot_have_an_initializer)}else if(Al(a)){if(r=!0,a.questionToken&&a.initializer)return XC(a.name,e.Diagnostics.Parameter_cannot_have_question_mark_and_initializer)}else if(r&&!a.initializer)return XC(a.name,e.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter)}}(t.parameters)||function(t,r){if(!e.isArrowFunction(t))return !1;t.typeParameters&&!(e.length(t.typeParameters)>1||t.typeParameters.hasTrailingComma||t.typeParameters[0].constraint)&&r&&e.fileExtensionIsOneOf(r.fileName,[".mts",".cts"])&&XC(t.typeParameters[0],e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);var n=t.equalsGreaterThanToken;return e.getLineAndCharacterOfPosition(r,n.pos).line!==e.getLineAndCharacterOfPosition(r,n.end).line&&XC(n,e.Diagnostics.Line_terminator_not_permitted_before_arrow)}(t,r)||e.isFunctionLikeDeclaration(t)&&function(t){if(V>=3){var r=t.body&&e.isBlock(t.body)&&e.findUseStrictPrologue(t.body.statements);if(r){var i=(o=t.parameters,e.filter(o,(function(t){return !!t.initializer||e.isBindingPattern(t.name)||e.isRestParameter(t)})));if(e.length(i)){e.forEach(i,(function(t){e.addRelatedInfo(Qn(t,e.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive),e.createDiagnosticForNode(r,e.Diagnostics.use_strict_directive_used_here));}));var a=i.map((function(t,r){return 0===r?e.createDiagnosticForNode(t,e.Diagnostics.Non_simple_parameter_declared_here):e.createDiagnosticForNode(t,e.Diagnostics.and_here)}));return e.addRelatedInfo.apply(void 0,n$4([Qn(r,e.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)],a,!1)),!0}}}var o;return !1}(t)}function FC(t,r){return kC(r)||function(t,r){if(r&&0===r.length){var n=e.getSourceFileOfNode(t),i=r.pos-"<".length;return QC(n,i,e.skipTrivia(n.text,r.end)+">".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}return !1}(t,r)}function PC(t){var r=t.types;if(kC(r))return !0;if(r&&0===r.length){var n=e.tokenToString(t.token);return QC(t,r.pos,0,e.Diagnostics._0_list_cannot_be_empty,n)}return e.some(r,wC)}function wC(t){return e.isExpressionWithTypeArguments(t)&&e.isImportKeyword(t.expression)&&t.typeArguments?XC(t,e.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments):FC(t,t.typeArguments)}function IC(t){if(164!==t.kind)return !1;var r=t;return 223===r.expression.kind&&27===r.expression.operatorToken.kind&&XC(r.expression,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function OC(t){if(t.asteriskToken){if(e.Debug.assert(259===t.kind||215===t.kind||171===t.kind),16777216&t.flags)return XC(t.asteriskToken,e.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);if(!t.body)return XC(t.asteriskToken,e.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator)}}function MC(e,t){return !!e&&XC(e,t)}function LC(e,t){return !!e&&XC(e,t)}function RC(t){if(ZC(t))return !0;if(247===t.kind&&t.awaitModifier&&!(32768&t.flags)){var r=e.getSourceFileOfNode(t);if(e.isInTopLevelContext(t)){if(!HC(r))switch(e.isEffectiveExternalModule(r,K)||Pn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),q){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:if(r.impliedNodeFormat===e.ModuleKind.CommonJS){Pn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.System:if(V>=4)break;default:Pn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));}}else if(!HC(r)){var n=e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),i=e.getContainingFunction(t);if(i&&173!==i.kind){e.Debug.assert(0==(2&e.getFunctionFlags(i)),"Enclosing function should never be an async function.");var a=e.createDiagnosticForNode(i,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(n,a);}return Pn.add(n),!0}return !1}if(e.isForOfStatement(t)&&!(32768&t.flags)&&e.isIdentifier(t.initializer)&&"async"===t.initializer.escapedText)return XC(t.initializer,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(258===t.initializer.kind){var o=t.initializer;if(!qC(o)){var s=o.declarations;if(!s.length)return !1;if(s.length>1)return n=246===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement,GC(o.declarations[1],n);var c=s[0];if(c.initializer){n=246===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return XC(c.name,n)}if(c.type)return XC(c,n=246===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}return !1}function BC(t){if(t.parameters.length===(174===t.kind?1:2))return e.getThisParameter(t)}function jC(t,r){if(function(t){return e.isDynamicName(t)&&!Ys(t)}(t))return XC(t,r)}function JC(t){if(AC(t))return !0;if(171===t.kind){if(207===t.parent.kind){if(t.modifiers&&(1!==t.modifiers.length||132!==e.first(t.modifiers).kind))return GC(t,e.Diagnostics.Modifiers_cannot_appear_here);if(MC(t.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional))return !0;if(LC(t.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context))return !0;if(void 0===t.body)return QC(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(OC(t))return !0}if(e.isClassLike(t.parent)){if(V<2&&e.isPrivateIdentifier(t.name))return XC(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(16777216&t.flags)return jC(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(171===t.kind&&!t.body)return jC(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else {if(261===t.parent.kind)return jC(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(184===t.parent.kind)return jC(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function zC(t){return e.isStringOrNumericLiteralLike(t)||221===t.kind&&40===t.operator&&8===t.operand.kind}function UC(t){var r,n=t.initializer;if(n){var i=!(zC(n)||function(t){if((e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)&&zC(t.argumentExpression))&&e.isEntityNameExpression(t.expression))return !!(1024&Ix(t).flags)}(n)||110===n.kind||95===n.kind||(r=n,9===r.kind||221===r.kind&&40===r.operator&&9===r.operand.kind));if(!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))||t.type)return XC(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);if(i)return XC(n,e.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference)}}function KC(t){if(79===t.kind){if("__esModule"===e.idText(t))return a=t,o=e.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules,!HC(e.getSourceFileOfNode(a))&&(Hn("noEmit",a,o,void 0,void 0,void 0),!0)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];if(!e.isOmittedExpression(i))return KC(i.name)}var a,o;return !1}function VC(t){if(79===t.kind){if(119===t.originalKeywordKind)return XC(t,e.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];e.isOmittedExpression(i)||VC(i.name);}return !1}function qC(t){var r=t.declarations;return !!kC(t.declarations)||!t.declarations.length&&QC(t,r.pos,r.end-r.pos,e.Diagnostics.Variable_declaration_list_cannot_be_empty)}function WC(e){switch(e.kind){case 242:case 243:case 244:case 251:case 245:case 246:case 247:return !1;case 253:return WC(e.parent)}return !0}function HC(e){return e.parseDiagnostics.length>0}function GC(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!HC(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return Pn.add(e.createFileDiagnostic(o,s.start,s.length,r,n,i,a)),!0}return !1}function QC(t,r,n,i,a,o,s){var c=e.getSourceFileOfNode(t);return !HC(c)&&(Pn.add(e.createFileDiagnostic(c,r,n,i,a,o,s)),!0)}function XC(t,r,n,i,a){return !HC(e.getSourceFileOfNode(t))&&(Pn.add(e.createDiagnosticForNode(t,r,n,i,a)),!0)}function YC(t){return 261!==t.kind&&262!==t.kind&&269!==t.kind&&268!==t.kind&&275!==t.kind&&274!==t.kind&&267!==t.kind&&!e.hasSyntacticModifier(t,1027)&&GC(t,e.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function ZC(t){if(16777216&t.flags){if(!di(t).hasReportedStatementInAmbientContext&&(e.isFunctionLike(t.parent)||e.isAccessor(t.parent)))return di(t).hasReportedStatementInAmbientContext=GC(t,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);if(238===t.parent.kind||265===t.parent.kind||308===t.parent.kind){var r=di(t.parent);if(!r.hasReportedStatementInAmbientContext)return r.hasReportedStatementInAmbientContext=GC(t,e.Diagnostics.Statements_are_not_allowed_in_ambient_contexts)}}return !1}function $C(t){if(32&t.numericLiteralFlags){var r=void 0;if(V>=1?r=e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:e.isChildOfNodeWithKind(t,198)?r=e.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:e.isChildOfNodeWithKind(t,302)&&(r=e.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0),r){var n=e.isPrefixUnaryExpression(t.parent)&&40===t.parent.operator,i=(n?"-":"")+"0o"+t.text;return XC(n?t.parent:t,r,i)}}return function(t){var r=-1!==e.getTextOfNode(t).indexOf("."),n=16&t.numericLiteralFlags;r||n||(+t.text<=Math.pow(2,53)-1||Xn(!1,e.createDiagnosticForNode(t,e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers)));}(t),!1}function eE(t){return !!e.forEach(t.elements,(function(t){if(t.isTypeOnly)return GC(t,273===t.kind?e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}))}function tE(t,r,n,i){if(1048576&r.flags&&2621440&t.flags){var a=Tm(r,t);if(a)return a;var o=zc(t);if(o){var s=xm(o,r);if(s)return df(r,e.map(s,(function(e){return [function(){return ds(e)},e.escapedName]})),n,void 0,i)}}}},function(e){e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes";}(A||(A={})),e.signatureHasRestParameter=j,e.signatureHasLiteralTypes=J;}(t),function(e){var t;function r(t,r,n,i){if(void 0===t||void 0===r)return t;var a,o=r(t);return o===t?t:void 0!==o?(a=e.isArray(o)?(i||_)(o):o,e.Debug.assertNode(a,n),a):void 0}function n(t,r,n,a,o){if(void 0===t||void 0===r)return t;var s,c=t.length;(void 0===a||a<0)&&(a=0),(void 0===o||o>c-a)&&(o=c-a);var l=-1,u=-1;a>0||o<c?s=t.hasTrailingComma&&a+o===c:(l=t.pos,u=t.end,s=t.hasTrailingComma);var _=i(t,r,n,a,o);if(_!==t){var d=e.factory.createNodeArray(_,s);return e.setTextRangePosEnd(d,l,u),d}return t}function i(t,r,n,i,a){var o,s=t.length;(i>0||a<s)&&(o=[]);for(var c=0;c<a;c++){var l=t[c+i],u=void 0!==l?r(l):void 0;if((void 0!==o||void 0===u||u!==l)&&(void 0===o&&(o=t.slice(0,c)),u))if(e.isArray(u))for(var _=0,d=u;_<d.length;_++){var p=d[_];e.Debug.assertNode(p,n),o.push(p);}else e.Debug.assertNode(u,n),o.push(u);}return null!=o?o:t}function a(t,r,i,a,o,s){return void 0===s&&(s=n),i.startLexicalEnvironment(),t=s(t,r,e.isStatement,a),o&&(t=i.factory.ensureUseStrict(t)),e.factory.mergeLexicalEnvironment(t,i.endLexicalEnvironment())}function o(t,r,i,a){var o;return void 0===a&&(a=n),i.startLexicalEnvironment(),t&&(i.setLexicalEnvironmentFlags(1,!0),o=a(t,r,e.isParameterDeclaration),2&i.getLexicalEnvironmentFlags()&&e.getEmitScriptTarget(i.getCompilerOptions())>=2&&(o=function(t,r){for(var n,i=0;i<t.length;i++){var a=t[i],o=s(a,r);(n||o!==a)&&(n||(n=t.slice(0,i)),n[i]=o);}return n?e.setTextRange(r.factory.createNodeArray(n,t.hasTrailingComma),t):t}(o,i)),i.setLexicalEnvironmentFlags(1,!1)),i.suspendLexicalEnvironment(),o}function s(t,r){return t.dotDotDotToken?t:e.isBindingPattern(t.name)?function(e,t){var r=t.factory;return t.addInitializationStatement(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(e.name,void 0,e.type,e.initializer?r.createConditionalExpression(r.createStrictEquality(r.getGeneratedNameForNode(e),r.createVoidZero()),void 0,e.initializer,void 0,r.getGeneratedNameForNode(e)):r.getGeneratedNameForNode(e))]))),r.updateParameterDeclaration(e,e.modifiers,e.dotDotDotToken,r.getGeneratedNameForNode(e),e.questionToken,e.type,void 0)}(t,r):t.initializer?function(t,r,n,i){var a=i.factory;return i.addInitializationStatement(a.createIfStatement(a.createTypeCheck(a.cloneNode(r),"undefined"),e.setEmitFlags(e.setTextRange(a.createBlock([a.createExpressionStatement(e.setEmitFlags(e.setTextRange(a.createAssignment(e.setEmitFlags(a.cloneNode(r),48),e.setEmitFlags(n,1584|e.getEmitFlags(n))),t),1536))]),t),1953))),a.updateParameterDeclaration(t,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,void 0)}(t,t.name,t.initializer,r):t}function c(t,n,i,a){void 0===a&&(a=r),i.resumeLexicalEnvironment();var o=a(t,n,e.isConciseBody),s=i.endLexicalEnvironment();if(e.some(s)){if(!o)return i.factory.createBlock(s);var c=i.factory.converters.convertToFunctionBlock(o),l=e.factory.mergeLexicalEnvironment(c.statements,s);return i.factory.updateBlock(c,l)}return o}function l(t,n,i,a){void 0===a&&(a=r),i.startBlockScope();var o=a(t,n,e.isStatement,i.factory.liftToBlock),s=i.endBlockScope();return e.some(s)?e.isBlock(o)?(s.push.apply(s,o.statements),i.factory.updateBlock(o,s)):(s.push(o),i.factory.createBlock(s)):o}e.visitNode=r,e.visitNodes=n,e.visitArray=function(e,t,r,n,a){if(void 0===e)return e;var o=e.length;return (void 0===n||n<0)&&(n=0),(void 0===a||a>o-n)&&(a=o-n),i(e,t,r,n,a)},e.visitLexicalEnvironment=a,e.visitParameterList=o,e.visitFunctionBody=c,e.visitIterationBody=l,e.visitEachChild=function(e,t,i,a,o,s){if(void 0===a&&(a=n),void 0===s&&(s=r),void 0!==e){var c=u[e.kind];return void 0===c?e:c(e,t,i,a,s,o)}};var u=((t={})[79]=function(t,r,n,i,a,o){return n.factory.updateIdentifier(t,i(t.typeArguments,r,e.isTypeNodeOrTypeParameterDeclaration))},t[163]=function(t,r,n,i,a,o){return n.factory.updateQualifiedName(t,a(t.left,r,e.isEntityName),a(t.right,r,e.isIdentifier))},t[164]=function(t,r,n,i,a,o){return n.factory.updateComputedPropertyName(t,a(t.expression,r,e.isExpression))},t[165]=function(t,r,n,i,a,o){return n.factory.updateTypeParameterDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isIdentifier),a(t.constraint,r,e.isTypeNode),a(t.default,r,e.isTypeNode))},t[166]=function(t,r,n,i,a,o){return n.factory.updateParameterDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.dotDotDotToken,o,e.isDotDotDotToken),a(t.name,r,e.isBindingName),a(t.questionToken,o,e.isQuestionToken),a(t.type,r,e.isTypeNode),a(t.initializer,r,e.isExpression))},t[167]=function(t,r,n,i,a,o){return n.factory.updateDecorator(t,a(t.expression,r,e.isExpression))},t[168]=function(t,r,n,i,a,o){return n.factory.updatePropertySignature(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isPropertyName),a(t.questionToken,o,e.isToken),a(t.type,r,e.isTypeNode))},t[169]=function(t,r,n,i,a,o){var s;return n.factory.updatePropertyDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.name,r,e.isPropertyName),a(null!==(s=t.questionToken)&&void 0!==s?s:t.exclamationToken,o,e.isQuestionOrExclamationToken),a(t.type,r,e.isTypeNode),a(t.initializer,r,e.isExpression))},t[170]=function(t,r,n,i,a,o){return n.factory.updateMethodSignature(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isPropertyName),a(t.questionToken,o,e.isQuestionToken),i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[171]=function(t,r,n,i,a,s){return n.factory.updateMethodDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.asteriskToken,s,e.isAsteriskToken),a(t.name,r,e.isPropertyName),a(t.questionToken,s,e.isQuestionToken),i(t.typeParameters,r,e.isTypeParameterDeclaration),o(t.parameters,r,n,i),a(t.type,r,e.isTypeNode),c(t.body,r,n,a))},t[173]=function(t,r,n,i,a,s){return n.factory.updateConstructorDeclaration(t,i(t.modifiers,r,e.isModifier),o(t.parameters,r,n,i),c(t.body,r,n,a))},t[174]=function(t,r,n,i,a,s){return n.factory.updateGetAccessorDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.name,r,e.isPropertyName),o(t.parameters,r,n,i),a(t.type,r,e.isTypeNode),c(t.body,r,n,a))},t[175]=function(t,r,n,i,a,s){return n.factory.updateSetAccessorDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.name,r,e.isPropertyName),o(t.parameters,r,n,i),c(t.body,r,n,a))},t[172]=function(e,t,r,n,i,a){return r.startLexicalEnvironment(),r.suspendLexicalEnvironment(),r.factory.updateClassStaticBlockDeclaration(e,c(e.body,t,r,i))},t[176]=function(t,r,n,i,a,o){return n.factory.updateCallSignature(t,i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[177]=function(t,r,n,i,a,o){return n.factory.updateConstructSignature(t,i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[178]=function(t,r,n,i,a,o){return n.factory.updateIndexSignature(t,i(t.modifiers,r,e.isModifier),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[179]=function(t,r,n,i,a,o){return n.factory.updateTypePredicateNode(t,a(t.assertsModifier,r,e.isAssertsKeyword),a(t.parameterName,r,e.isIdentifierOrThisTypeNode),a(t.type,r,e.isTypeNode))},t[180]=function(t,r,n,i,a,o){return n.factory.updateTypeReferenceNode(t,a(t.typeName,r,e.isEntityName),i(t.typeArguments,r,e.isTypeNode))},t[181]=function(t,r,n,i,a,o){return n.factory.updateFunctionTypeNode(t,i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[182]=function(t,r,n,i,a,o){return n.factory.updateConstructorTypeNode(t,i(t.modifiers,r,e.isModifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.parameters,r,e.isParameterDeclaration),a(t.type,r,e.isTypeNode))},t[183]=function(t,r,n,i,a,o){return n.factory.updateTypeQueryNode(t,a(t.exprName,r,e.isEntityName),i(t.typeArguments,r,e.isTypeNode))},t[184]=function(t,r,n,i,a,o){return n.factory.updateTypeLiteralNode(t,i(t.members,r,e.isTypeElement))},t[185]=function(t,r,n,i,a,o){return n.factory.updateArrayTypeNode(t,a(t.elementType,r,e.isTypeNode))},t[186]=function(t,r,n,i,a,o){return n.factory.updateTupleTypeNode(t,i(t.elements,r,e.isTypeNode))},t[187]=function(t,r,n,i,a,o){return n.factory.updateOptionalTypeNode(t,a(t.type,r,e.isTypeNode))},t[188]=function(t,r,n,i,a,o){return n.factory.updateRestTypeNode(t,a(t.type,r,e.isTypeNode))},t[189]=function(t,r,n,i,a,o){return n.factory.updateUnionTypeNode(t,i(t.types,r,e.isTypeNode))},t[190]=function(t,r,n,i,a,o){return n.factory.updateIntersectionTypeNode(t,i(t.types,r,e.isTypeNode))},t[191]=function(t,r,n,i,a,o){return n.factory.updateConditionalTypeNode(t,a(t.checkType,r,e.isTypeNode),a(t.extendsType,r,e.isTypeNode),a(t.trueType,r,e.isTypeNode),a(t.falseType,r,e.isTypeNode))},t[192]=function(t,r,n,i,a,o){return n.factory.updateInferTypeNode(t,a(t.typeParameter,r,e.isTypeParameterDeclaration))},t[202]=function(t,r,n,i,a,o){return n.factory.updateImportTypeNode(t,a(t.argument,r,e.isTypeNode),a(t.assertions,r,e.isImportTypeAssertionContainer),a(t.qualifier,r,e.isEntityName),i(t.typeArguments,r,e.isTypeNode),t.isTypeOf)},t[298]=function(t,r,n,i,a,o){return n.factory.updateImportTypeAssertionContainer(t,a(t.assertClause,r,e.isAssertClause),t.multiLine)},t[199]=function(t,r,n,i,a,o){return n.factory.updateNamedTupleMember(t,a(t.dotDotDotToken,o,e.isDotDotDotToken),a(t.name,r,e.isIdentifier),a(t.questionToken,o,e.isQuestionToken),a(t.type,r,e.isTypeNode))},t[193]=function(t,r,n,i,a,o){return n.factory.updateParenthesizedType(t,a(t.type,r,e.isTypeNode))},t[195]=function(t,r,n,i,a,o){return n.factory.updateTypeOperatorNode(t,a(t.type,r,e.isTypeNode))},t[196]=function(t,r,n,i,a,o){return n.factory.updateIndexedAccessTypeNode(t,a(t.objectType,r,e.isTypeNode),a(t.indexType,r,e.isTypeNode))},t[197]=function(t,r,n,i,a,o){return n.factory.updateMappedTypeNode(t,a(t.readonlyToken,o,e.isReadonlyKeywordOrPlusOrMinusToken),a(t.typeParameter,r,e.isTypeParameterDeclaration),a(t.nameType,r,e.isTypeNode),a(t.questionToken,o,e.isQuestionOrPlusOrMinusToken),a(t.type,r,e.isTypeNode),i(t.members,r,e.isTypeElement))},t[198]=function(t,r,n,i,a,o){return n.factory.updateLiteralTypeNode(t,a(t.literal,r,e.isExpression))},t[200]=function(t,r,n,i,a,o){return n.factory.updateTemplateLiteralType(t,a(t.head,r,e.isTemplateHead),i(t.templateSpans,r,e.isTemplateLiteralTypeSpan))},t[201]=function(t,r,n,i,a,o){return n.factory.updateTemplateLiteralTypeSpan(t,a(t.type,r,e.isTypeNode),a(t.literal,r,e.isTemplateMiddleOrTemplateTail))},t[203]=function(t,r,n,i,a,o){return n.factory.updateObjectBindingPattern(t,i(t.elements,r,e.isBindingElement))},t[204]=function(t,r,n,i,a,o){return n.factory.updateArrayBindingPattern(t,i(t.elements,r,e.isArrayBindingElement))},t[205]=function(t,r,n,i,a,o){return n.factory.updateBindingElement(t,a(t.dotDotDotToken,o,e.isDotDotDotToken),a(t.propertyName,r,e.isPropertyName),a(t.name,r,e.isBindingName),a(t.initializer,r,e.isExpression))},t[206]=function(t,r,n,i,a,o){return n.factory.updateArrayLiteralExpression(t,i(t.elements,r,e.isExpression))},t[207]=function(t,r,n,i,a,o){return n.factory.updateObjectLiteralExpression(t,i(t.properties,r,e.isObjectLiteralElementLike))},t[208]=function(t,r,n,i,a,o){return e.isPropertyAccessChain(t)?n.factory.updatePropertyAccessChain(t,a(t.expression,r,e.isExpression),a(t.questionDotToken,o,e.isQuestionDotToken),a(t.name,r,e.isMemberName)):n.factory.updatePropertyAccessExpression(t,a(t.expression,r,e.isExpression),a(t.name,r,e.isMemberName))},t[209]=function(t,r,n,i,a,o){return e.isElementAccessChain(t)?n.factory.updateElementAccessChain(t,a(t.expression,r,e.isExpression),a(t.questionDotToken,o,e.isQuestionDotToken),a(t.argumentExpression,r,e.isExpression)):n.factory.updateElementAccessExpression(t,a(t.expression,r,e.isExpression),a(t.argumentExpression,r,e.isExpression))},t[210]=function(t,r,n,i,a,o){return e.isCallChain(t)?n.factory.updateCallChain(t,a(t.expression,r,e.isExpression),a(t.questionDotToken,o,e.isQuestionDotToken),i(t.typeArguments,r,e.isTypeNode),i(t.arguments,r,e.isExpression)):n.factory.updateCallExpression(t,a(t.expression,r,e.isExpression),i(t.typeArguments,r,e.isTypeNode),i(t.arguments,r,e.isExpression))},t[211]=function(t,r,n,i,a,o){return n.factory.updateNewExpression(t,a(t.expression,r,e.isExpression),i(t.typeArguments,r,e.isTypeNode),i(t.arguments,r,e.isExpression))},t[212]=function(t,r,n,i,a,o){return n.factory.updateTaggedTemplateExpression(t,a(t.tag,r,e.isExpression),i(t.typeArguments,r,e.isTypeNode),a(t.template,r,e.isTemplateLiteral))},t[213]=function(t,r,n,i,a,o){return n.factory.updateTypeAssertion(t,a(t.type,r,e.isTypeNode),a(t.expression,r,e.isExpression))},t[214]=function(t,r,n,i,a,o){return n.factory.updateParenthesizedExpression(t,a(t.expression,r,e.isExpression))},t[215]=function(t,r,n,i,a,s){return n.factory.updateFunctionExpression(t,i(t.modifiers,r,e.isModifier),a(t.asteriskToken,s,e.isAsteriskToken),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),o(t.parameters,r,n,i),a(t.type,r,e.isTypeNode),c(t.body,r,n,a))},t[216]=function(t,r,n,i,a,s){return n.factory.updateArrowFunction(t,i(t.modifiers,r,e.isModifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),o(t.parameters,r,n,i),a(t.type,r,e.isTypeNode),a(t.equalsGreaterThanToken,s,e.isEqualsGreaterThanToken),c(t.body,r,n,a))},t[217]=function(t,r,n,i,a,o){return n.factory.updateDeleteExpression(t,a(t.expression,r,e.isExpression))},t[218]=function(t,r,n,i,a,o){return n.factory.updateTypeOfExpression(t,a(t.expression,r,e.isExpression))},t[219]=function(t,r,n,i,a,o){return n.factory.updateVoidExpression(t,a(t.expression,r,e.isExpression))},t[220]=function(t,r,n,i,a,o){return n.factory.updateAwaitExpression(t,a(t.expression,r,e.isExpression))},t[221]=function(t,r,n,i,a,o){return n.factory.updatePrefixUnaryExpression(t,a(t.operand,r,e.isExpression))},t[222]=function(t,r,n,i,a,o){return n.factory.updatePostfixUnaryExpression(t,a(t.operand,r,e.isExpression))},t[223]=function(t,r,n,i,a,o){return n.factory.updateBinaryExpression(t,a(t.left,r,e.isExpression),a(t.operatorToken,o,e.isBinaryOperatorToken),a(t.right,r,e.isExpression))},t[224]=function(t,r,n,i,a,o){return n.factory.updateConditionalExpression(t,a(t.condition,r,e.isExpression),a(t.questionToken,o,e.isQuestionToken),a(t.whenTrue,r,e.isExpression),a(t.colonToken,o,e.isColonToken),a(t.whenFalse,r,e.isExpression))},t[225]=function(t,r,n,i,a,o){return n.factory.updateTemplateExpression(t,a(t.head,r,e.isTemplateHead),i(t.templateSpans,r,e.isTemplateSpan))},t[226]=function(t,r,n,i,a,o){return n.factory.updateYieldExpression(t,a(t.asteriskToken,o,e.isAsteriskToken),a(t.expression,r,e.isExpression))},t[227]=function(t,r,n,i,a,o){return n.factory.updateSpreadElement(t,a(t.expression,r,e.isExpression))},t[228]=function(t,r,n,i,a,o){return n.factory.updateClassExpression(t,i(t.modifiers,r,e.isModifierLike),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.heritageClauses,r,e.isHeritageClause),i(t.members,r,e.isClassElement))},t[230]=function(t,r,n,i,a,o){return n.factory.updateExpressionWithTypeArguments(t,a(t.expression,r,e.isExpression),i(t.typeArguments,r,e.isTypeNode))},t[231]=function(t,r,n,i,a,o){return n.factory.updateAsExpression(t,a(t.expression,r,e.isExpression),a(t.type,r,e.isTypeNode))},t[235]=function(t,r,n,i,a,o){return n.factory.updateSatisfiesExpression(t,a(t.expression,r,e.isExpression),a(t.type,r,e.isTypeNode))},t[232]=function(t,r,n,i,a,o){return e.isOptionalChain(t)?n.factory.updateNonNullChain(t,a(t.expression,r,e.isExpression)):n.factory.updateNonNullExpression(t,a(t.expression,r,e.isExpression))},t[233]=function(t,r,n,i,a,o){return n.factory.updateMetaProperty(t,a(t.name,r,e.isIdentifier))},t[236]=function(t,r,n,i,a,o){return n.factory.updateTemplateSpan(t,a(t.expression,r,e.isExpression),a(t.literal,r,e.isTemplateMiddleOrTemplateTail))},t[238]=function(t,r,n,i,a,o){return n.factory.updateBlock(t,i(t.statements,r,e.isStatement))},t[240]=function(t,r,n,i,a,o){return n.factory.updateVariableStatement(t,i(t.modifiers,r,e.isModifier),a(t.declarationList,r,e.isVariableDeclarationList))},t[241]=function(t,r,n,i,a,o){return n.factory.updateExpressionStatement(t,a(t.expression,r,e.isExpression))},t[242]=function(t,r,n,i,a,o){return n.factory.updateIfStatement(t,a(t.expression,r,e.isExpression),a(t.thenStatement,r,e.isStatement,n.factory.liftToBlock),a(t.elseStatement,r,e.isStatement,n.factory.liftToBlock))},t[243]=function(t,r,n,i,a,o){return n.factory.updateDoStatement(t,l(t.statement,r,n,a),a(t.expression,r,e.isExpression))},t[244]=function(t,r,n,i,a,o){return n.factory.updateWhileStatement(t,a(t.expression,r,e.isExpression),l(t.statement,r,n,a))},t[245]=function(t,r,n,i,a,o){return n.factory.updateForStatement(t,a(t.initializer,r,e.isForInitializer),a(t.condition,r,e.isExpression),a(t.incrementor,r,e.isExpression),l(t.statement,r,n,a))},t[246]=function(t,r,n,i,a,o){return n.factory.updateForInStatement(t,a(t.initializer,r,e.isForInitializer),a(t.expression,r,e.isExpression),l(t.statement,r,n,a))},t[247]=function(t,r,n,i,a,o){return n.factory.updateForOfStatement(t,a(t.awaitModifier,o,e.isAwaitKeyword),a(t.initializer,r,e.isForInitializer),a(t.expression,r,e.isExpression),l(t.statement,r,n,a))},t[248]=function(t,r,n,i,a,o){return n.factory.updateContinueStatement(t,a(t.label,r,e.isIdentifier))},t[249]=function(t,r,n,i,a,o){return n.factory.updateBreakStatement(t,a(t.label,r,e.isIdentifier))},t[250]=function(t,r,n,i,a,o){return n.factory.updateReturnStatement(t,a(t.expression,r,e.isExpression))},t[251]=function(t,r,n,i,a,o){return n.factory.updateWithStatement(t,a(t.expression,r,e.isExpression),a(t.statement,r,e.isStatement,n.factory.liftToBlock))},t[252]=function(t,r,n,i,a,o){return n.factory.updateSwitchStatement(t,a(t.expression,r,e.isExpression),a(t.caseBlock,r,e.isCaseBlock))},t[253]=function(t,r,n,i,a,o){return n.factory.updateLabeledStatement(t,a(t.label,r,e.isIdentifier),a(t.statement,r,e.isStatement,n.factory.liftToBlock))},t[254]=function(t,r,n,i,a,o){return n.factory.updateThrowStatement(t,a(t.expression,r,e.isExpression))},t[255]=function(t,r,n,i,a,o){return n.factory.updateTryStatement(t,a(t.tryBlock,r,e.isBlock),a(t.catchClause,r,e.isCatchClause),a(t.finallyBlock,r,e.isBlock))},t[257]=function(t,r,n,i,a,o){return n.factory.updateVariableDeclaration(t,a(t.name,r,e.isBindingName),a(t.exclamationToken,o,e.isExclamationToken),a(t.type,r,e.isTypeNode),a(t.initializer,r,e.isExpression))},t[258]=function(t,r,n,i,a,o){return n.factory.updateVariableDeclarationList(t,i(t.declarations,r,e.isVariableDeclaration))},t[259]=function(t,r,n,i,a,s){return n.factory.updateFunctionDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.asteriskToken,s,e.isAsteriskToken),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),o(t.parameters,r,n,i),a(t.type,r,e.isTypeNode),c(t.body,r,n,a))},t[260]=function(t,r,n,i,a,o){return n.factory.updateClassDeclaration(t,i(t.modifiers,r,e.isModifierLike),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.heritageClauses,r,e.isHeritageClause),i(t.members,r,e.isClassElement))},t[261]=function(t,r,n,i,a,o){return n.factory.updateInterfaceDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),i(t.heritageClauses,r,e.isHeritageClause),i(t.members,r,e.isTypeElement))},t[262]=function(t,r,n,i,a,o){return n.factory.updateTypeAliasDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isIdentifier),i(t.typeParameters,r,e.isTypeParameterDeclaration),a(t.type,r,e.isTypeNode))},t[263]=function(t,r,n,i,a,o){return n.factory.updateEnumDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isIdentifier),i(t.members,r,e.isEnumMember))},t[264]=function(t,r,n,i,a,o){return n.factory.updateModuleDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.name,r,e.isModuleName),a(t.body,r,e.isModuleBody))},t[265]=function(t,r,n,i,a,o){return n.factory.updateModuleBlock(t,i(t.statements,r,e.isStatement))},t[266]=function(t,r,n,i,a,o){return n.factory.updateCaseBlock(t,i(t.clauses,r,e.isCaseOrDefaultClause))},t[267]=function(t,r,n,i,a,o){return n.factory.updateNamespaceExportDeclaration(t,a(t.name,r,e.isIdentifier))},t[268]=function(t,r,n,i,a,o){return n.factory.updateImportEqualsDeclaration(t,i(t.modifiers,r,e.isModifier),t.isTypeOnly,a(t.name,r,e.isIdentifier),a(t.moduleReference,r,e.isModuleReference))},t[269]=function(t,r,n,i,a,o){return n.factory.updateImportDeclaration(t,i(t.modifiers,r,e.isModifier),a(t.importClause,r,e.isImportClause),a(t.moduleSpecifier,r,e.isExpression),a(t.assertClause,r,e.isAssertClause))},t[296]=function(t,r,n,i,a,o){return n.factory.updateAssertClause(t,i(t.elements,r,e.isAssertEntry),t.multiLine)},t[297]=function(t,r,n,i,a,o){return n.factory.updateAssertEntry(t,a(t.name,r,e.isAssertionKey),a(t.value,r,e.isExpression))},t[270]=function(t,r,n,i,a,o){return n.factory.updateImportClause(t,t.isTypeOnly,a(t.name,r,e.isIdentifier),a(t.namedBindings,r,e.isNamedImportBindings))},t[271]=function(t,r,n,i,a,o){return n.factory.updateNamespaceImport(t,a(t.name,r,e.isIdentifier))},t[277]=function(t,r,n,i,a,o){return n.factory.updateNamespaceExport(t,a(t.name,r,e.isIdentifier))},t[272]=function(t,r,n,i,a,o){return n.factory.updateNamedImports(t,i(t.elements,r,e.isImportSpecifier))},t[273]=function(t,r,n,i,a,o){return n.factory.updateImportSpecifier(t,t.isTypeOnly,a(t.propertyName,r,e.isIdentifier),a(t.name,r,e.isIdentifier))},t[274]=function(t,r,n,i,a,o){return n.factory.updateExportAssignment(t,i(t.modifiers,r,e.isModifier),a(t.expression,r,e.isExpression))},t[275]=function(t,r,n,i,a,o){return n.factory.updateExportDeclaration(t,i(t.modifiers,r,e.isModifier),t.isTypeOnly,a(t.exportClause,r,e.isNamedExportBindings),a(t.moduleSpecifier,r,e.isExpression),a(t.assertClause,r,e.isAssertClause))},t[276]=function(t,r,n,i,a,o){return n.factory.updateNamedExports(t,i(t.elements,r,e.isExportSpecifier))},t[278]=function(t,r,n,i,a,o){return n.factory.updateExportSpecifier(t,t.isTypeOnly,a(t.propertyName,r,e.isIdentifier),a(t.name,r,e.isIdentifier))},t[280]=function(t,r,n,i,a,o){return n.factory.updateExternalModuleReference(t,a(t.expression,r,e.isExpression))},t[281]=function(t,r,n,i,a,o){return n.factory.updateJsxElement(t,a(t.openingElement,r,e.isJsxOpeningElement),i(t.children,r,e.isJsxChild),a(t.closingElement,r,e.isJsxClosingElement))},t[282]=function(t,r,n,i,a,o){return n.factory.updateJsxSelfClosingElement(t,a(t.tagName,r,e.isJsxTagNameExpression),i(t.typeArguments,r,e.isTypeNode),a(t.attributes,r,e.isJsxAttributes))},t[283]=function(t,r,n,i,a,o){return n.factory.updateJsxOpeningElement(t,a(t.tagName,r,e.isJsxTagNameExpression),i(t.typeArguments,r,e.isTypeNode),a(t.attributes,r,e.isJsxAttributes))},t[284]=function(t,r,n,i,a,o){return n.factory.updateJsxClosingElement(t,a(t.tagName,r,e.isJsxTagNameExpression))},t[285]=function(t,r,n,i,a,o){return n.factory.updateJsxFragment(t,a(t.openingFragment,r,e.isJsxOpeningFragment),i(t.children,r,e.isJsxChild),a(t.closingFragment,r,e.isJsxClosingFragment))},t[288]=function(t,r,n,i,a,o){return n.factory.updateJsxAttribute(t,a(t.name,r,e.isIdentifier),a(t.initializer,r,e.isStringLiteralOrJsxExpression))},t[289]=function(t,r,n,i,a,o){return n.factory.updateJsxAttributes(t,i(t.properties,r,e.isJsxAttributeLike))},t[290]=function(t,r,n,i,a,o){return n.factory.updateJsxSpreadAttribute(t,a(t.expression,r,e.isExpression))},t[291]=function(t,r,n,i,a,o){return n.factory.updateJsxExpression(t,a(t.expression,r,e.isExpression))},t[292]=function(t,r,n,i,a,o){return n.factory.updateCaseClause(t,a(t.expression,r,e.isExpression),i(t.statements,r,e.isStatement))},t[293]=function(t,r,n,i,a,o){return n.factory.updateDefaultClause(t,i(t.statements,r,e.isStatement))},t[294]=function(t,r,n,i,a,o){return n.factory.updateHeritageClause(t,i(t.types,r,e.isExpressionWithTypeArguments))},t[295]=function(t,r,n,i,a,o){return n.factory.updateCatchClause(t,a(t.variableDeclaration,r,e.isVariableDeclaration),a(t.block,r,e.isBlock))},t[299]=function(t,r,n,i,a,o){return n.factory.updatePropertyAssignment(t,a(t.name,r,e.isPropertyName),a(t.initializer,r,e.isExpression))},t[300]=function(t,r,n,i,a,o){return n.factory.updateShorthandPropertyAssignment(t,a(t.name,r,e.isIdentifier),a(t.objectAssignmentInitializer,r,e.isExpression))},t[301]=function(t,r,n,i,a,o){return n.factory.updateSpreadAssignment(t,a(t.expression,r,e.isExpression))},t[302]=function(t,r,n,i,a,o){return n.factory.updateEnumMember(t,a(t.name,r,e.isPropertyName),a(t.initializer,r,e.isExpression))},t[308]=function(e,t,r,n,i,o){return r.factory.updateSourceFile(e,a(e.statements,t,r))},t[353]=function(t,r,n,i,a,o){return n.factory.updatePartiallyEmittedExpression(t,a(t.expression,r,e.isExpression))},t[354]=function(t,r,n,i,a,o){return n.factory.updateCommaListExpression(t,i(t.elements,r,e.isExpression))},t);function _(t){return e.Debug.assert(t.length<=1,"Too many nodes written to output."),e.singleOrUndefined(t)}}(t),function(e){e.createSourceMapGenerator=function(t,r,n,i,o){var s,c,l=o.extendedDiagnostics?e.performance.createTimer("Source Map","beforeSourcemap","afterSourcemap"):e.performance.nullTimer,u=l.enter,_=l.exit,d=[],p=[],f=new e.Map,g=[],m=[],y="",v=0,h=0,b=0,x=0,D=0,S=0,T=!1,C=0,E=0,k=0,N=0,A=0,F=0,P=!1,w=!1,I=!1;return {getSources:function(){return d},addSource:O,setSourceContent:M,addName:L,addMapping:R,appendSourceMap:function(t,r,n,i,o,s){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),u();for(var c,l=[],d=a(n.mappings),p=d.next();!p.done;p=d.next()){var f=p.value;if(s&&(f.generatedLine>s.line||f.generatedLine===s.line&&f.generatedCharacter>s.character))break;if(!o||!(f.generatedLine<o.line||o.line===f.generatedLine&&f.generatedCharacter<o.character)){var g=void 0,m=void 0,y=void 0,v=void 0;if(void 0!==f.sourceIndex){if(void 0===(g=l[f.sourceIndex])){var h=n.sources[f.sourceIndex],b=n.sourceRoot?e.combinePaths(n.sourceRoot,h):h,x=e.combinePaths(e.getDirectoryPath(i),b);l[f.sourceIndex]=g=O(x),n.sourcesContent&&"string"==typeof n.sourcesContent[f.sourceIndex]&&M(g,n.sourcesContent[f.sourceIndex]);}m=f.sourceLine,y=f.sourceCharacter,n.names&&void 0!==f.nameIndex&&(c||(c=[]),void 0===(v=c[f.nameIndex])&&(c[f.nameIndex]=v=L(n.names[f.nameIndex])));}var D=f.generatedLine-(o?o.line:0),S=D+t,T=o&&o.line===f.generatedLine?f.generatedCharacter-o.character:f.generatedCharacter;R(S,0===D?T+r:T,g,m,y,v);}}_();},toJSON:z,toString:function(){return JSON.stringify(z())}};function O(r){u();var n=e.getRelativePathToDirectoryOrUrl(i,r,t.getCurrentDirectory(),t.getCanonicalFileName,!0),a=f.get(n);return void 0===a&&(a=p.length,p.push(n),d.push(r),f.set(n,a)),_(),a}function M(e,t){if(u(),null!==t){for(s||(s=[]);s.length<e;)s.push(null);s[e]=t;}_();}function L(t){u(),c||(c=new e.Map);var r=c.get(t);return void 0===r&&(r=g.length,g.push(t),c.set(t,r)),_(),r}function R(t,r,n,i,a,o){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),e.Debug.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),e.Debug.assert(void 0===i||i>=0,"sourceLine cannot be negative"),e.Debug.assert(void 0===a||a>=0,"sourceCharacter cannot be negative"),u(),(function(e,t){return !P||C!==e||E!==t}(t,r)||function(e,t,r){return void 0!==e&&void 0!==t&&void 0!==r&&k===e&&(N>t||N===t&&A>r)}(n,i,a))&&(j(),C=t,E=r,w=!1,I=!1,P=!0),void 0!==n&&void 0!==i&&void 0!==a&&(k=n,N=i,A=a,w=!0,void 0!==o&&(F=o,I=!0)),_();}function B(e){m.push(e),m.length>=1024&&J();}function j(){if(P&&(!T||v!==C||h!==E||b!==k||x!==N||D!==A||S!==F)){if(u(),v<C){do{B(59),v++;}while(v<C);h=0;}else e.Debug.assertEqual(v,C,"generatedLine cannot backtrack"),T&&B(44);U(E-h),h=E,w&&(U(k-b),b=k,U(N-x),x=N,U(A-D),D=A,I&&(U(F-S),S=F)),T=!0,_();}}function J(){m.length>0&&(y+=String.fromCharCode.apply(void 0,m),m.length=0);}function z(){return j(),J(),{version:3,file:r,sourceRoot:n,sources:p,names:g,mappings:y,sourcesContent:s}}function U(t){t<0?t=1+(-t<<1):t<<=1;do{var r=31&t;(t>>=5)>0&&(r|=32),B((n=r)>=0&&n<26?65+n:n>=26&&n<52?97+n-26:n>=52&&n<62?48+n-52:62===n?43:63===n?47:e.Debug.fail("".concat(n,": not a base64 value")));}while(t>0);var n;}};var t=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,r=/^\s*(\/\/[@#] .*)?$/;function n(e){return "string"==typeof e||null===e}function i(t){return null!==t&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&e.isArray(t.sources)&&e.every(t.sources,e.isString)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||e.isArray(t.sourcesContent)&&e.every(t.sourcesContent,n))&&(void 0===t.names||null===t.names||e.isArray(t.names)&&e.every(t.names,e.isString))}function a(e){var t,r=!1,n=0,i=0,a=0,o=0,s=0,c=0,l=0;return {get pos(){return n},get error(){return t},get state(){return u(!0,!0)},next:function(){for(;!r&&n<e.length;){var t=e.charCodeAt(n);if(59!==t){if(44!==t){var d=!1,y=!1;if(a+=m(),f())return _();if(a<0)return p("Invalid generatedCharacter found");if(!g()){if(d=!0,o+=m(),f())return _();if(o<0)return p("Invalid sourceIndex found");if(g())return p("Unsupported Format: No entries after sourceIndex");if(s+=m(),f())return _();if(s<0)return p("Invalid sourceLine found");if(g())return p("Unsupported Format: No entries after sourceLine");if(c+=m(),f())return _();if(c<0)return p("Invalid sourceCharacter found");if(!g()){if(y=!0,l+=m(),f())return _();if(l<0)return p("Invalid nameIndex found");if(!g())return p("Unsupported Error Format: Entries after nameIndex")}}return {value:u(d,y),done:r}}n++;}else i++,a=0,n++;}return _()}};function u(e,t){return {generatedLine:i,generatedCharacter:a,sourceIndex:e?o:void 0,sourceLine:e?s:void 0,sourceCharacter:e?c:void 0,nameIndex:t?l:void 0}}function _(){return r=!0,{value:void 0,done:!0}}function d(e){void 0===t&&(t=e);}function p(e){return d(e),_()}function f(){return void 0!==t}function g(){return n===e.length||44===e.charCodeAt(n)||59===e.charCodeAt(n)}function m(){for(var t,r=!0,i=0,a=0;r;n++){if(n>=e.length)return d("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;var o=(t=e.charCodeAt(n))>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:43===t?62:47===t?63:-1;if(-1===o)return d("Invalid character in VLQ"),-1;r=0!=(32&o),a|=(31&o)<<i,i+=5;}return 0==(1&a)?a>>=1:a=-(a>>=1),a}}function o(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function s(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function c(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function l(t,r){return e.Debug.assert(t.sourceIndex===r.sourceIndex),e.compareValues(t.sourcePosition,r.sourcePosition)}function u(t,r){return e.compareValues(t.generatedPosition,r.generatedPosition)}function _(e){return e.sourcePosition}function d(e){return e.generatedPosition}e.getLineInfo=function(e,t){return {getLineCount:function(){return t.length},getLineText:function(r){return e.substring(t[r],t[r+1])}}},e.tryGetSourceMappingURL=function(n){for(var i=n.getLineCount()-1;i>=0;i--){var a=n.getLineText(i),o=t.exec(a);if(o)return e.trimStringEnd(o[1]);if(!a.match(r))break}},e.isRawSourceMap=i,e.tryParseRawSourceMap=function(e){try{var t=JSON.parse(e);if(i(t))return t}catch(e){}},e.decodeMappings=a,e.sameMapping=function(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex},e.isSourceMapping=o,e.createDocumentPositionMapper=function(t,r,n){var i,p,f,g=e.getDirectoryPath(n),m=r.sourceRoot?e.getNormalizedAbsolutePath(r.sourceRoot,g):g,y=e.getNormalizedAbsolutePath(r.file,g),v=t.getSourceFileLike(y),h=r.sources.map((function(t){return e.getNormalizedAbsolutePath(t,m)})),b=new e.Map(h.map((function(e,r){return [t.getCanonicalFileName(e),r]})));return {getSourcePosition:function(t){var r=T();if(!e.some(r))return t;var n=e.binarySearchKey(r,t.pos,d,e.compareValues);n<0&&(n=~n);var i=r[n];return void 0!==i&&s(i)?{fileName:h[i.sourceIndex],pos:i.sourcePosition}:t},getGeneratedPosition:function(r){var n=b.get(t.getCanonicalFileName(r.fileName));if(void 0===n)return r;var i=S(n);if(!e.some(i))return r;var a=e.binarySearchKey(i,r.pos,_,e.compareValues);a<0&&(a=~a);var o=i[a];return void 0===o||o.sourceIndex!==n?r:{fileName:y,pos:o.generatedPosition}}};function x(n){var i,a,s=void 0!==v?e.getPositionOfLineAndCharacter(v,n.generatedLine,n.generatedCharacter,!0):-1;if(o(n)){var c=t.getSourceFileLike(h[n.sourceIndex]);i=r.sources[n.sourceIndex],a=void 0!==c?e.getPositionOfLineAndCharacter(c,n.sourceLine,n.sourceCharacter,!0):-1;}return {generatedPosition:s,source:i,sourceIndex:n.sourceIndex,sourcePosition:a,nameIndex:n.nameIndex}}function D(){if(void 0===i){var n=a(r.mappings),o=e.arrayFrom(n,x);void 0!==n.error?(t.log&&t.log("Encountered error while decoding sourcemap: ".concat(n.error)),i=e.emptyArray):i=o;}return i}function S(t){if(void 0===f){for(var r=[],n=0,i=D();n<i.length;n++){var a=i[n];if(s(a)){var o=r[a.sourceIndex];o||(r[a.sourceIndex]=o=[]),o.push(a);}}f=r.map((function(t){return e.sortAndDeduplicate(t,l,c)}));}return f[t]}function T(){if(void 0===p){for(var t=[],r=0,n=D();r<n.length;r++){var i=n[r];t.push(i);}p=e.sortAndDeduplicate(t,u,c);}return p}},e.identitySourceMapConsumer={getSourcePosition:e.identity,getGeneratedPosition:e.identity};}(t),function(e){function t(t){return (t=e.getOriginalNode(t))?e.getNodeId(t):0}function r(e){return void 0!==e.propertyName&&"default"===e.propertyName.escapedText}function n(t){if(e.getNamespaceDeclarationNode(t))return !0;var n=t.importClause&&t.importClause.namedBindings;if(!n)return !1;if(!e.isNamedImports(n))return !1;for(var i=0,a=0,o=n.elements;a<o.length;a++)r(o[a])&&i++;return i>0&&i!==n.elements.length||!!(n.elements.length-i)&&e.isDefaultImport(t)}function i(t){return !n(t)&&(e.isDefaultImport(t)||!!t.importClause&&e.isNamedImports(t.importClause.namedBindings)&&function(t){return !!t&&!!e.isNamedImports(t)&&e.some(t.elements,r)}(t.importClause.namedBindings))}function a(t,r,n){if(e.isBindingPattern(t.name))for(var i=0,o=t.name.elements;i<o.length;i++){var s=o[i];e.isOmittedExpression(s)||(n=a(s,r,n));}else if(!e.isGeneratedIdentifier(t.name)){var c=e.idText(t.name);r.get(c)||(r.set(c,!0),n=e.append(n,t.name));}return n}function o(e,t,r){var n=e[t];return n?n.push(r):e[t]=n=[r],n}function s(t){return e.isStringLiteralLike(t)||8===t.kind||e.isKeyword(t.kind)||e.isIdentifier(t)}function c(t){if(e.isExpressionStatement(t)){var r=e.skipParentheses(t.expression);return e.isSuperCall(r)?r:void 0}}function l(t){return r=t,e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)||e.isClassStaticBlockDeclaration(t);var r;}function u(t){var r;if(t)for(var n=t.parameters,i=n.length>0&&e.parameterIsThisKeyword(n[0]),a=i?1:0,o=i?n.length-1:n.length,s=0;s<o;s++){var c=n[s+a];(r||e.hasDecorators(c))&&(r||(r=new Array(o)),r[s]=e.getDecorators(c));}return r}e.getOriginalNodeId=t,e.chainBundle=function(t,r){return function(n){return 308===n.kind?r(n):function(n){return t.factory.createBundle(e.map(n.sourceFiles,r),n.prepends)}(n)}},e.getExportNeedsImportStarHelper=function(t){return !!e.getNamespaceDeclarationNode(t)},e.getImportNeedsImportStarHelper=n,e.getImportNeedsImportDefaultHelper=i,e.collectExternalModuleInfo=function(r,s,c,l){for(var u,_,d=[],p=e.createMultiMap(),f=[],g=new e.Map,m=!1,y=!1,v=!1,h=!1,b=0,x=s.statements;b<x.length;b++){var D=x[b];switch(D.kind){case 269:d.push(D),!v&&n(D)&&(v=!0),!h&&i(D)&&(h=!0);break;case 268:280===D.moduleReference.kind&&d.push(D);break;case 275:if(D.moduleSpecifier)if(D.exportClause)if(d.push(D),e.isNamedExports(D.exportClause))N(D);else {var S=D.exportClause.name;g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)),v=!0;}else d.push(D),y=!0;else N(D);break;case 274:D.isExportEquals&&!_&&(_=D);break;case 240:if(e.hasSyntacticModifier(D,1))for(var T=0,C=D.declarationList.declarations;T<C.length;T++){var E=C[T];u=a(E,g,u);}break;case 259:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,1024)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name,g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S))));break;case 260:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,1024)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name)&&!g.get(e.idText(S))&&(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)));}}var k=e.createExternalHelpersImportDeclarationIfNeeded(r.factory,r.getEmitHelperFactory(),s,l,y,v,h);return k&&d.unshift(k),{externalImports:d,exportSpecifiers:p,exportEquals:_,hasExportStarsToExportValues:y,exportedBindings:f,exportedNames:u,externalHelpersImportDeclaration:k};function N(r){for(var n=0,i=e.cast(r.exportClause,e.isNamedExports).elements;n<i.length;n++){var a=i[n];if(!g.get(e.idText(a.name))){var s=a.propertyName||a.name;r.moduleSpecifier||p.add(e.idText(s),a);var l=c.getReferencedImportDeclaration(s)||c.getReferencedValueDeclaration(s);l&&o(f,t(l),a.name),g.set(e.idText(a.name),!0),u=e.append(u,a.name);}}}},e.isSimpleCopiableExpression=s,e.isSimpleInlineableExpression=function(t){return !e.isIdentifier(t)&&s(t)},e.isCompoundAssignment=function(e){return e>=64&&e<=78},e.getNonAssignmentOperatorForCompoundAssignment=function(e){switch(e){case 64:return 39;case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 47;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 78:return 52;case 75:return 56;case 76:return 55;case 77:return 60}},e.getSuperCallFromStatement=c,e.findSuperStatementIndex=function(e,t){for(var r=t;r<e.length;r+=1)if(c(e[r]))return r;return -1},e.getProperties=function(t,r,n){return e.filter(t.members,(function(t){return function(t,r,n){return e.isPropertyDeclaration(t)&&(!!t.initializer||!r)&&e.hasStaticModifier(t)===n}(t,r,n)}))},e.getStaticPropertiesAndClassStaticBlock=function(t){return e.filter(t.members,l)},e.isInitializedProperty=function(e){return 169===e.kind&&void 0!==e.initializer},e.isNonStaticMethodOrAccessorWithPrivateName=function(t){return !e.isStatic(t)&&(e.isMethodOrAccessor(t)||e.isAutoAccessorPropertyDeclaration(t))&&e.isPrivateIdentifier(t.name)},e.getAllDecoratorsOfClass=function(t){var r=e.getDecorators(t),n=u(e.getFirstConstructorWithBody(t));if(e.some(r)||e.some(n))return {decorators:r,parameters:n}},e.getAllDecoratorsOfClassElement=function(t,r){switch(t.kind){case 174:case 175:return function(t,r){if(t.body){var n=e.getAllAccessorDeclarations(r.members,t),i=n.firstAccessor,a=n.secondAccessor,o=n.getAccessor,s=n.setAccessor,c=e.hasDecorators(i)?i:a&&e.hasDecorators(a)?a:void 0;if(c&&t===c){var l=e.getDecorators(c),_=u(s);if(e.some(l)||e.some(_))return {decorators:l,parameters:_,getDecorators:o&&e.getDecorators(o),setDecorators:s&&e.getDecorators(s)}}}}(t,r);case 171:return function(t){if(t.body){var r=e.getDecorators(t),n=u(t);if(e.some(r)||e.some(n))return {decorators:r,parameters:n}}}(t);case 169:return function(t){var r=e.getDecorators(t);if(e.some(r))return {decorators:r}}(t);default:return}};}(t),function(e){function t(r,n){var i=e.getTargetOfBindingOrAssignmentElement(r);return e.isBindingOrAssignmentPattern(i)?function(r,n){for(var i=0,a=e.getElementsOfBindingOrAssignmentPattern(r);i<a.length;i++)if(t(a[i],n))return !0;return !1}(i,n):!!e.isIdentifier(i)&&i.escapedText===n}function r(t){var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&e.isComputedPropertyName(n)&&!e.isLiteralExpression(n.expression))return !0;var i,a=e.getTargetOfBindingOrAssignmentElement(t);return !!a&&e.isBindingOrAssignmentPattern(a)&&(i=a,!!e.forEach(e.getElementsOfBindingOrAssignmentPattern(i),r))}function n(t,r,s,c,l){var u=e.getTargetOfBindingOrAssignmentElement(r);if(!l){var _=e.visitNode(e.getInitializerOfBindingOrAssignmentElement(r),t.visitor,e.isExpression);_?s?(s=function(e,t,r,n){return t=o(e,t,!0,n),e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,r,void 0,t)}(t,s,_,c),!e.isSimpleInlineableExpression(_)&&e.isBindingOrAssignmentPattern(u)&&(s=o(t,s,!0,c))):s=_:s||(s=t.context.factory.createVoidZero());}e.isObjectBindingOrAssignmentPattern(u)?function(t,r,i,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(i),d=_.length;1!==d&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0),m=t.context.getEmitHelperFactory().createRestHelper(s,_,u,i),n(t,f,m,f));else {var g=e.getPropertyNameOfBindingOrAssignmentElement(f);if(!(t.level>=1)||98304&f.transformFlags||98304&e.getTargetOfBindingOrAssignmentElement(f).transformFlags||e.isComputedPropertyName(g)){l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0);var m=a(t,s,g);e.isComputedPropertyName(g)&&(u=e.append(u,m.argumentExpression)),n(t,f,m,f);}else l=e.append(l,e.visitNode(f,t.visitor));}}l&&t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i);}(t,r,u,s,c):e.isArrayBindingOrAssignmentPattern(u)?function(t,r,a,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(a),d=_.length;t.level<1&&t.downlevelIteration?s=o(t,e.setTextRange(t.context.getEmitHelperFactory().createReadHelper(s,d>0&&e.getRestIndicatorOfBindingOrAssignmentElement(_[d-1])?void 0:d),c),!1,c):(1!==d&&(t.level<1||0===d)||e.every(_,e.isOmittedExpression))&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(t.level>=1)if(65536&f.transformFlags||t.hasTransformedPriorElement&&!i(f)){t.hasTransformedPriorElement=!0;var g=t.context.factory.createTempVariable(void 0);t.hoistTempVariables&&t.context.hoistVariableDeclaration(g),u=e.append(u,[g,f]),l=e.append(l,t.createArrayBindingOrAssignmentElement(g));}else l=e.append(l,f);else {if(e.isOmittedExpression(f))continue;if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(m=t.context.factory.createArraySliceCall(s,p),n(t,f,m,f));else {var m=t.context.factory.createElementAccessExpression(s,p);n(t,f,m,f);}}}if(l&&t.emitBindingOrAssignment(t.createArrayBindingOrAssignmentPattern(l),s,c,a),u)for(var y=0,v=u;y<v.length;y++){var h=v[y],b=h[0];n(t,f=h[1],b,f);}}(t,r,u,s,c):t.emitBindingOrAssignment(u,s,c,r);}function i(t){var r=e.getTargetOfBindingOrAssignmentElement(t);if(!r||e.isOmittedExpression(r))return !0;var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&!e.isPropertyNameLiteral(n))return !1;var a=e.getInitializerOfBindingOrAssignmentElement(t);return !(a&&!e.isSimpleInlineableExpression(a))&&(e.isBindingOrAssignmentPattern(r)?e.every(e.getElementsOfBindingOrAssignmentPattern(r),i):e.isIdentifier(r))}function a(t,r,n){if(e.isComputedPropertyName(n)){var i=o(t,e.visitNode(n.expression,t.visitor),!1,n);return t.context.factory.createElementAccessExpression(r,i)}if(e.isStringOrNumericLiteralLike(n))return i=e.factory.cloneNode(n),t.context.factory.createElementAccessExpression(r,i);var a=t.context.factory.createIdentifier(e.idText(n));return t.context.factory.createPropertyAccessExpression(r,a)}function o(t,r,n,i){if(e.isIdentifier(r)&&n)return r;var a=t.context.factory.createTempVariable(void 0);return t.hoistTempVariables?(t.context.hoistVariableDeclaration(a),t.emitExpression(e.setTextRange(t.context.factory.createAssignment(a,r),i))):t.emitBindingOrAssignment(a,r,i,void 0),a}function s(e){return e}var c;(c=e.FlattenLevel||(e.FlattenLevel={}))[c.All=0]="All",c[c.ObjectRest=1]="ObjectRest",e.flattenDestructuringAssignment=function(i,a,c,l,u,_){var d,p,f=i;if(e.isDestructuringAssignment(i))for(d=i.right;e.isEmptyArrayLiteral(i.left)||e.isEmptyObjectLiteral(i.left);){if(!e.isDestructuringAssignment(d))return e.visitNode(d,a,e.isExpression);f=i=d,d=i.right;}var g={context:c,level:l,downlevelIteration:!!c.getCompilerOptions().downlevelIteration,hoistTempVariables:!0,emitExpression:m,emitBindingOrAssignment:function(t,r,n,i){e.Debug.assertNode(t,_?e.isIdentifier:e.isExpression);var o=_?_(t,r,n):e.setTextRange(c.factory.createAssignment(e.visitNode(t,a,e.isExpression),r),n);o.original=i,m(o);},createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return t.createArrayLiteralExpression(e.map(r,t.converters.convertToArrayAssignmentElement))}(c.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return t.createObjectLiteralExpression(e.map(r,t.converters.convertToObjectAssignmentElement))}(c.factory,t)},createArrayBindingOrAssignmentElement:s,visitor:a};if(d&&(d=e.visitNode(d,a,e.isExpression),e.isIdentifier(d)&&t(i,d.escapedText)||r(i)?d=o(g,d,!1,f):u?d=o(g,d,!0,f):e.nodeIsSynthesized(i)&&(f=d)),n(g,i,d,f,e.isDestructuringAssignment(i)),d&&u){if(!e.some(p))return d;p.push(d);}return c.factory.inlineExpressions(p)||c.factory.createOmittedExpression();function m(t){p=e.append(p,t);}},e.flattenDestructuringBinding=function(i,a,s,c,l,u,_){var d;void 0===u&&(u=!1);var p=[],f=[],g={context:s,level:c,downlevelIteration:!!s.getCompilerOptions().downlevelIteration,hoistTempVariables:u,emitExpression:function(t){d=e.append(d,t);},emitBindingOrAssignment:N,createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isArrayBindingElement),t.createArrayBindingPattern(r)}(s.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isBindingElement),t.createObjectBindingPattern(r)}(s.factory,t)},createArrayBindingOrAssignmentElement:function(e){return function(e,t){return e.createBindingElement(void 0,void 0,t)}(s.factory,e)},visitor:a};if(e.isVariableDeclaration(i)){var m=e.getInitializerOfBindingOrAssignmentElement(i);m&&(e.isIdentifier(m)&&t(i,m.escapedText)||r(i))&&(m=o(g,e.visitNode(m,g.visitor),!1,m),i=s.factory.updateVariableDeclaration(i,i.name,void 0,void 0,m));}if(n(g,i,l,i,_),d){var y=s.factory.createTempVariable(void 0);if(u){var v=s.factory.inlineExpressions(d);d=void 0,N(y,v,void 0,void 0);}else {s.hoistVariableDeclaration(y);var h=e.last(p);h.pendingExpressions=e.append(h.pendingExpressions,s.factory.createAssignment(y,h.value)),e.addRange(h.pendingExpressions,d),h.value=y;}}for(var b=0,x=p;b<x.length;b++){var D=x[b],S=D.pendingExpressions,T=D.name,C=(v=D.value,D.location),E=D.original,k=s.factory.createVariableDeclaration(T,void 0,void 0,S?s.factory.inlineExpressions(e.append(S,v)):v);k.original=E,e.setTextRange(k,C),f.push(k);}return f;function N(t,r,n,i){e.Debug.assertNode(t,e.isBindingName),d&&(r=s.factory.inlineExpressions(e.append(d,r)),d=void 0),p.push({pendingExpressions:d,name:t,value:r,location:n,original:i});}};}(t),function(e){var t;function r(t){return t.templateFlags?e.factory.createVoidZero():e.factory.createStringLiteral(t.text)}function n(t,r){var n=t.rawText;if(void 0===n){e.Debug.assertIsDefined(r,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."),n=e.getSourceTextOfNodeFromSourceFile(r,t);var i=14===t.kind||17===t.kind;n=n.substring(1,n.length-(i?1:2));}return n=n.replace(/\r\n?/g,"\n"),e.setTextRange(e.factory.createStringLiteral(n),t)}!function(e){e[e.LiftRestriction=0]="LiftRestriction",e[e.All=1]="All";}(t=e.ProcessLevel||(e.ProcessLevel={})),e.processTaggedTemplateExpression=function(i,a,o,s,c,l){var u=e.visitNode(a.tag,o,e.isExpression),_=[void 0],d=[],p=[],f=a.template;if(l===t.LiftRestriction&&!e.hasInvalidEscape(f))return e.visitEachChild(a,o,i);if(e.isNoSubstitutionTemplateLiteral(f))d.push(r(f)),p.push(n(f,s));else {d.push(r(f.head)),p.push(n(f.head,s));for(var g=0,m=f.templateSpans;g<m.length;g++){var y=m[g];d.push(r(y.literal)),p.push(n(y.literal,s)),_.push(e.visitNode(y.expression,o,e.isExpression));}}var v=i.getEmitHelperFactory().createTemplateObjectHelper(e.factory.createArrayLiteralExpression(d),e.factory.createArrayLiteralExpression(p));if(e.isExternalModule(s)){var h=e.factory.createUniqueName("templateObject");c(h),_[0]=e.factory.createLogicalOr(h,e.factory.createAssignment(h,v));}else _[0]=v;return e.factory.createCallExpression(u,void 0,_)};}(t),function(e){var t,r;!function(e){e[e.NamespaceExports=2]="NamespaceExports",e[e.NonQualifiedEnumMembers=8]="NonQualifiedEnumMembers";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasStaticInitializedProperties=1]="HasStaticInitializedProperties",e[e.HasConstructorDecorators=2]="HasConstructorDecorators",e[e.HasMemberDecorators=4]="HasMemberDecorators",e[e.IsExportOfNamespace=8]="IsExportOfNamespace",e[e.IsNamedExternalExport=16]="IsNamedExternalExport",e[e.IsDefaultExternalExport=32]="IsDefaultExternalExport",e[e.IsDerivedClass=64]="IsDerivedClass",e[e.UseImmediatelyInvokedFunctionExpression=128]="UseImmediatelyInvokedFunctionExpression",e[e.HasAnyDecorators=6]="HasAnyDecorators",e[e.NeedsName=5]="NeedsName",e[e.MayNeedImmediatelyInvokedFunctionExpression=7]="MayNeedImmediatelyInvokedFunctionExpression",e[e.IsExported=56]="IsExported";}(r||(r={})),e.transformTypeScript=function(t){var r,i,a,o,s,c,l,u,_=t.factory,d=t.getEmitHelperFactory,p=t.startLexicalEnvironment,f=t.resumeLexicalEnvironment,g=t.endLexicalEnvironment,m=t.hoistVariableDeclaration,y=t.getEmitResolver(),v=t.getCompilerOptions(),h=e.getEmitScriptTarget(v),b=e.getEmitModuleKind(v),x=v.emitDecoratorMetadata?e.createRuntimeTypeSerializer(t):void 0,D=t.onEmitNode,S=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){var a=u,o=r;e.isSourceFile(n)&&(r=n),2&l&&function(t){return 264===e.getOriginalNode(t).kind}(n)&&(u|=2),8&l&&function(t){return 263===e.getOriginalNode(t).kind}(n)&&(u|=8),D(t,n,i),u=a,r=o;},t.onSubstituteNode=function(t,r){return r=S(t,r),1===t?function(t){switch(t.kind){case 79:return function(e){return ge(e)||e}(t);case 208:case 209:return function(t){return function(t){var r=function(t){if(!v.isolatedModules)return e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)?y.getConstantValue(t):void 0}(t);if(void 0!==r){e.setConstantValue(t,r);var n="string"==typeof r?_.createStringLiteral(r):_.createNumericLiteral(r);if(!v.removeComments){var i=e.getOriginalNode(t,e.isAccessExpression);e.addSyntheticTrailingComment(n,3," ".concat(e.getTextOfNode(i).replace(/\*\//g,"*_/")," "));}return n}return t}(t)}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){if(2&l){var r=t.name,n=ge(r);if(n){if(t.objectAssignmentInitializer){var i=_.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(_.createPropertyAssignment(r,i),t)}return e.setTextRange(_.createPropertyAssignment(r,n),t)}}return t}(r):r},t.enableSubstitution(208),t.enableSubstitution(209),function(t){return 309===t.kind?function(t){return _.createBundle(t.sourceFiles.map(T),e.mapDefined(t.prepends,(function(t){return 311===t.kind?e.createUnparsedSourceFile(t,"js"):t})))}(t):T(t)};function T(n){if(n.isDeclarationFile)return n;r=n;var i=C(n,M);return e.addEmitHelpers(i,t.readEmitHelpers()),r=void 0,i}function C(t,r){var n=o,i=s,a=c;!function(t){switch(t.kind){case 308:case 266:case 265:case 238:o=t,s=void 0;break;case 260:case 259:if(e.hasSyntacticModifier(t,2))break;t.name?Y(t):e.Debug.assert(260===t.kind||e.hasSyntacticModifier(t,1024));}}(t);var l=r(t);return o!==n&&(s=i),o=n,c=a,l}function E(e){return C(e,k)}function k(e){return 1&e.transformFlags?O(e):e}function N(e){return C(e,A)}function A(r){switch(r.kind){case 269:case 268:case 274:case 275:return function(r){if(e.getParseTreeNode(r)!==r)return 1&r.transformFlags?e.visitEachChild(r,E,t):r;switch(r.kind){case 269:return function(t){if(!t.importClause)return t;if(!t.importClause.isTypeOnly){var r=e.visitNode(t.importClause,re,e.isImportClause);return r||1===v.importsNotUsedAsValues||2===v.importsNotUsedAsValues?_.updateImportDeclaration(t,void 0,r,t.moduleSpecifier,t.assertClause):void 0}}(r);case 268:return oe(r);case 274:return function(r){return y.isValueAliasDeclaration(r)?e.visitEachChild(r,E,t):void 0}(r);case 275:return function(t){if(!t.isTypeOnly){if(!t.exportClause||e.isNamespaceExport(t.exportClause))return t;var r=!!t.moduleSpecifier&&(1===v.importsNotUsedAsValues||2===v.importsNotUsedAsValues),n=e.visitNode(t.exportClause,(function(t){return function(t,r){return e.isNamespaceExport(t)?function(t){return _.updateNamespaceExport(t,e.visitNode(t.name,E,e.isIdentifier))}(t):function(t,r){var n=e.visitNodes(t.elements,ae,e.isExportSpecifier);return r||e.some(n)?_.updateNamedExports(t,n):void 0}(t,r)}(t,r)}),e.isNamedExportBindings);return n?_.updateExportDeclaration(t,void 0,t.isTypeOnly,n,t.moduleSpecifier,t.assertClause):void 0}}(r);default:e.Debug.fail("Unhandled ellided statement");}}(r);default:return k(r)}}function F(e){return C(e,P)}function P(t){if(275!==t.kind&&269!==t.kind&&270!==t.kind&&(268!==t.kind||280!==t.moduleReference.kind))return 1&t.transformFlags||e.hasSyntacticModifier(t,1)?O(t):t}function w(r){return function(i){return C(i,(function(i){return function(r,i){switch(r.kind){case 173:return function(r){if(U(r))return _.updateConstructorDeclaration(r,void 0,e.visitParameterList(r.parameters,E,t),function(r,i){var a=i&&e.filter(i.parameters,(function(t){return e.isParameterPropertyDeclaration(t,i)}));if(!e.some(a))return e.visitFunctionBody(r,E,t);var o=[];f();var s=_.copyPrologue(r.statements,o,!1,E),c=e.findSuperStatementIndex(r.statements,s);c>=0&&e.addRange(o,e.visitNodes(r.statements,E,e.isStatement,s,c+1-s));var l=e.mapDefined(a,K);c>=0?e.addRange(o,l):o=n$4(n$4(n$4([],o.slice(0,s),!0),l,!0),o.slice(s),!0);var u=c>=0?c+1:s;e.addRange(o,e.visitNodes(r.statements,E,e.isStatement,u)),o=_.mergeLexicalEnvironment(o,g());var d=_.createBlock(e.setTextRange(_.createNodeArray(o),r.statements),!0);return e.setTextRange(d,r),e.setOriginalNode(d,r),d}(r.body,r))}(r);case 169:return function(t,r){var n=16777216&t.flags||e.hasSyntacticModifier(t,256);if(!n||e.hasDecorators(t)){var i=j(t,r,e.getAllDecoratorsOfClassElement(t,r));return n?_.updatePropertyDeclaration(t,e.concatenate(i,_.createModifiersFromModifierFlags(2)),e.visitNode(t.name,E,e.isPropertyName),void 0,void 0,void 0):_.updatePropertyDeclaration(t,e.concatenate(i,e.visitNodes(t.modifiers,I,e.isModifierLike)),z(t),void 0,void 0,e.visitNode(t.initializer,E))}}(r,i);case 174:return W(r,i);case 175:return H(r,i);case 171:return V(r,i);case 172:return e.visitEachChild(r,E,t);case 237:return r;case 178:return;default:return e.Debug.failBadSyntaxKind(r)}}(i,r)}))}}function I(t){if(!e.isDecorator(t)&&!(117086&e.modifierToFlag(t.kind)||i&&93===t.kind))return t}function O(n){if(e.isStatement(n)&&e.hasSyntacticModifier(n,2))return _.createNotEmittedStatement(n);switch(n.kind){case 93:case 88:return i?void 0:n;case 123:case 121:case 122:case 126:case 161:case 85:case 136:case 146:case 101:case 145:case 185:case 186:case 187:case 188:case 184:case 179:case 165:case 131:case 157:case 134:case 152:case 148:case 144:case 114:case 153:case 182:case 181:case 183:case 180:case 189:case 190:case 191:case 193:case 194:case 195:case 196:case 197:case 198:case 178:case 267:return;case 262:case 261:return _.createNotEmittedStatement(n);case 260:return function(n){if(!(R(n)||i&&e.hasSyntacticModifier(n,1)))return _.updateClassDeclaration(n,e.visitNodes(n.modifiers,I,e.isModifier),n.name,void 0,e.visitNodes(n.heritageClauses,E,e.isHeritageClause),e.visitNodes(n.members,w(n),e.isClassElement));var a=function(t,r){var n=0;e.some(r)&&(n|=1);var i=e.getEffectiveBaseTypeNode(t);return i&&104!==e.skipOuterExpressions(i.expression).kind&&(n|=64),e.classOrConstructorParameterIsDecorated(t)&&(n|=2),e.childIsDecorated(t)&&(n|=4),se(t)?n|=8:function(t){return ce(t)&&e.hasSyntacticModifier(t,1024)}(t)?n|=32:le(t)&&(n|=16),h<=1&&7&n&&(n|=128),n}(n,e.getProperties(n,!0,!0));128&a&&t.startLexicalEnvironment();var o=n.name||(5&a?_.getGeneratedNameForNode(n):void 0),s=j(n,n,e.getAllDecoratorsOfClass(n)),c=128&a?e.elideNodes(_,n.modifiers):e.visitNodes(n.modifiers,I,e.isModifier),l=_.updateClassDeclaration(n,e.concatenate(s,c),o,void 0,e.visitNodes(n.heritageClauses,E,e.isHeritageClause),B(n)),u=e.getEmitFlags(n);1&a&&(u|=32),e.setEmitFlags(l,u);var d=[l];if(128&a){var p=e.createTokenRange(e.skipTrivia(r.text,n.members.end),19),f=_.getInternalName(n),g=_.createPartiallyEmittedExpression(f);e.setTextRangeEnd(g,p.end),e.setEmitFlags(g,1536);var m=_.createReturnStatement(g);e.setTextRangePos(m,p.pos),e.setEmitFlags(m,1920),d.push(m),e.insertStatementsAfterStandardPrologue(d,t.endLexicalEnvironment());var y=_.createImmediatelyInvokedArrowFunction(d);e.setEmitFlags(y,33554432);var v=_.createVariableStatement(void 0,_.createVariableDeclarationList([_.createVariableDeclaration(_.getLocalName(n,!1,!1),void 0,void 0,y)]));e.setOriginalNode(v,n),e.setCommentRange(v,n),e.setSourceMapRange(v,e.moveRangePastDecorators(n)),e.startOnNewLine(v),d=[v];}return 8&a?ue(d,n):(128&a||2&a)&&(32&a?d.push(_.createExportDefault(_.getLocalName(n,!1,!0))):16&a&&d.push(_.createExternalModuleExport(_.getLocalName(n,!1,!0)))),d.length>1&&(d.push(_.createEndOfDeclarationMarker(n)),e.setEmitFlags(l,4194304|e.getEmitFlags(l))),e.singleOrMany(d)}(n);case 228:return function(t){var r=j(t,t,e.getAllDecoratorsOfClass(t));return _.updateClassExpression(t,r,t.name,void 0,e.visitNodes(t.heritageClauses,E,e.isHeritageClause),R(t)?B(t):e.visitNodes(t.members,w(t),e.isClassElement))}(n);case 294:return function(r){if(117!==r.token)return e.visitEachChild(r,E,t)}(n);case 230:return function(t){return _.updateExpressionWithTypeArguments(t,e.visitNode(t.expression,E,e.isLeftHandSideExpression),void 0)}(n);case 207:return function(t){return _.updateObjectLiteralExpression(t,e.visitNodes(t.properties,(r=t,function(t){return C(t,(function(t){return function(t,r){switch(t.kind){case 299:case 300:case 301:return E(t);case 174:return W(t,r);case 175:return H(t,r);case 171:return V(t,r);default:return e.Debug.failBadSyntaxKind(t)}}(t,r)}))}),e.isObjectLiteralElement));var r;}(n);case 173:case 169:case 171:case 174:case 175:case 172:return e.Debug.fail("Class and object literal elements must be visited with their respective visitors");case 259:return function(r){if(!U(r))return _.createNotEmittedStatement(r);var n=_.updateFunctionDeclaration(r,e.visitNodes(r.modifiers,I,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,e.visitFunctionBody(r.body,E,t)||_.createBlock([]));if(se(r)){var i=[n];return ue(i,r),i}return n}(n);case 215:return function(r){return U(r)?_.updateFunctionExpression(r,e.visitNodes(r.modifiers,I,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,e.visitFunctionBody(r.body,E,t)||_.createBlock([])):_.createOmittedExpression()}(n);case 216:return function(r){return _.updateArrowFunction(r,e.visitNodes(r.modifiers,I,e.isModifier),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,e.visitFunctionBody(r.body,E,t))}(n);case 166:return function(t){if(!e.parameterIsThisKeyword(t)){var r=_.updateParameterDeclaration(t,e.elideNodes(_,t.modifiers),t.dotDotDotToken,e.visitNode(t.name,E,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,E,e.isExpression));return r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32)),r}}(n);case 214:return function(r){var n=e.skipOuterExpressions(r.expression,-7);if(e.isAssertionExpression(n)){var i=e.visitNode(r.expression,E,e.isExpression);return _.createPartiallyEmittedExpression(i,r)}return e.visitEachChild(r,E,t)}(n);case 213:case 231:return function(t){var r=e.visitNode(t.expression,E,e.isExpression);return _.createPartiallyEmittedExpression(r,t)}(n);case 235:return function(t){var r=e.visitNode(t.expression,E,e.isExpression);return _.createPartiallyEmittedExpression(r,t)}(n);case 210:return function(t){return _.updateCallExpression(t,e.visitNode(t.expression,E,e.isExpression),void 0,e.visitNodes(t.arguments,E,e.isExpression))}(n);case 211:return function(t){return _.updateNewExpression(t,e.visitNode(t.expression,E,e.isExpression),void 0,e.visitNodes(t.arguments,E,e.isExpression))}(n);case 212:return function(t){return _.updateTaggedTemplateExpression(t,e.visitNode(t.tag,E,e.isExpression),void 0,e.visitNode(t.template,E,e.isExpression))}(n);case 232:return function(t){var r=e.visitNode(t.expression,E,e.isLeftHandSideExpression);return _.createPartiallyEmittedExpression(r,t)}(n);case 263:return function(t){if(!function(t){return !e.isEnumConst(t)||e.shouldPreserveConstEnums(v)}(t))return _.createNotEmittedStatement(t);var n=[],i=2,s=$(n,t);s&&(b===e.ModuleKind.System&&o===r||(i|=512));var c=pe(t),l=fe(t),u=e.hasSyntacticModifier(t,1)?_.getExternalModuleOrNamespaceExportName(a,t,!1,!0):_.getLocalName(t,!1,!0),d=_.createLogicalOr(u,_.createAssignment(u,_.createObjectLiteralExpression()));if(X(t)){var f=_.getLocalName(t,!1,!0);d=_.createAssignment(f,d);}var m=_.createExpressionStatement(_.createCallExpression(_.createFunctionExpression(void 0,void 0,void 0,void 0,[_.createParameterDeclaration(void 0,void 0,c)],void 0,function(t,r){var n=a;a=r;var i=[];p();var o=e.map(t.members,Q);return e.insertStatementsAfterStandardPrologue(i,g()),e.addRange(i,o),a=n,_.createBlock(e.setTextRange(_.createNodeArray(i),t.members),!0)}(t,l)),void 0,[d]));return e.setOriginalNode(m,t),s&&(e.setSyntheticLeadingComments(m,void 0),e.setSyntheticTrailingComments(m,void 0)),e.setTextRange(m,t),e.addEmitFlags(m,i),n.push(m),n.push(_.createEndOfDeclarationMarker(t)),n}(n);case 240:return function(r){if(se(r)){var n=e.getInitializedVariables(r.declarationList);if(0===n.length)return;return e.setTextRange(_.createExpressionStatement(_.inlineExpressions(e.map(n,G))),r)}return e.visitEachChild(r,E,t)}(n);case 257:return function(t){var r=_.updateVariableDeclaration(t,e.visitNode(t.name,E,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,E,e.isExpression));return t.type&&e.setTypeNode(r.name,t.type),r}(n);case 264:return ee(n);case 268:return oe(n);case 282:return function(t){return _.updateJsxSelfClosingElement(t,e.visitNode(t.tagName,E,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,E,e.isJsxAttributes))}(n);case 283:return function(t){return _.updateJsxOpeningElement(t,e.visitNode(t.tagName,E,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,E,e.isJsxAttributes))}(n);default:return e.visitEachChild(n,E,t)}}function M(r){var n=e.getStrictOptionValue(v,"alwaysStrict")&&!(e.isExternalModule(r)&&b>=e.ModuleKind.ES2015)&&!e.isJsonSourceFile(r);return _.updateSourceFile(r,e.visitLexicalEnvironment(r.statements,N,t,0,n))}function L(e){return !!(8192&e.transformFlags)}function R(t){return e.hasDecorators(t)||e.some(t.typeParameters)||e.some(t.heritageClauses,L)||e.some(t.members,L)}function B(t){var r=[],n=e.getFirstConstructorWithBody(t),i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];e.isIdentifier(s.name)&&r.push(e.setOriginalNode(_.createPropertyDeclaration(void 0,s.name,void 0,void 0,void 0),s));}return e.addRange(r,e.visitNodes(t.members,w(t),e.isClassElement)),e.setTextRange(_.createNodeArray(r),t.members)}function j(t,r,n){var i,a,s,c;if(n){var l=e.visitArray(n.decorators,E,e.isDecorator),u=e.flatMap(n.parameters,J),p=e.some(l)||e.some(u)?function(t,r){return function(t,r){if(x){var n=void 0;if(function(e){var t=e.kind;return 171===t||174===t||175===t||169===t}(t)){var i=d().createMetadataHelper("design:type",x.serializeTypeOfNode({currentLexicalScope:o,currentNameScope:r},t));n=e.append(n,_.createDecorator(i));}if(function(t){switch(t.kind){case 260:case 228:return void 0!==e.getFirstConstructorWithBody(t);case 171:case 174:case 175:return !0}return !1}(t)){var a=d().createMetadataHelper("design:paramtypes",x.serializeParameterTypesOfNode({currentLexicalScope:o,currentNameScope:r},t,r));n=e.append(n,_.createDecorator(a));}if(function(e){return 171===e.kind}(t)){var s=d().createMetadataHelper("design:returntype",x.serializeReturnTypeOfNode({currentLexicalScope:o,currentNameScope:r},t));n=e.append(n,_.createDecorator(s));}return n}}(t,r)}(t,r):void 0,f=_.createNodeArray(e.concatenate(e.concatenate(l,u),p)),g=null!==(a=null===(i=e.firstOrUndefined(n.decorators))||void 0===i?void 0:i.pos)&&void 0!==a?a:-1,m=null!==(c=null===(s=e.lastOrUndefined(n.decorators))||void 0===s?void 0:s.end)&&void 0!==c?c:-1;return e.setTextRangePosEnd(f,g,m),f}}function J(t,r){if(t){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i],s=e.visitNode(o.expression,E,e.isExpression),c=d().createParamHelper(s,r);e.setTextRange(c,o.expression),e.setEmitFlags(c,1536);var l=_.createDecorator(c);e.setSourceMapRange(l,o.expression),e.setCommentRange(l,o.expression),e.setEmitFlags(l,1536),n.push(l);}return n}}function z(t){var r=t.name;if(e.isComputedPropertyName(r)&&(!e.hasStaticModifier(t)&&c||e.hasDecorators(t))){var n=e.visitNode(r.expression,E,e.isExpression),i=e.skipPartiallyEmittedExpressions(n);if(!e.isSimpleInlineableExpression(i)){var a=_.getGeneratedNameForNode(r);return m(a),_.updateComputedPropertyName(r,_.createAssignment(a,n))}}return e.visitNode(r,E,e.isPropertyName)}function U(t){return !e.nodeIsMissing(t.body)}function K(t){var r=t.name;if(e.isIdentifier(r)){var n=e.setParent(e.setTextRange(_.cloneNode(r),r),r.parent);e.setEmitFlags(n,1584);var i=e.setParent(e.setTextRange(_.cloneNode(r),r),r.parent);return e.setEmitFlags(i,1536),e.startOnNewLine(e.removeAllComments(e.setTextRange(e.setOriginalNode(_.createExpressionStatement(_.createAssignment(e.setTextRange(_.createPropertyAccessExpression(_.createThis(),n),t.name),i)),t),e.moveRangePos(t,-1))))}}function V(r,n){if(!(1&r.transformFlags))return r;if(U(r)){var i=e.isClassLike(n)?e.getAllDecoratorsOfClassElement(r,n):void 0,a=e.isClassLike(n)?j(r,n,i):void 0;return _.updateMethodDeclaration(r,e.concatenate(a,e.visitNodes(r.modifiers,I,e.isModifierLike)),r.asteriskToken,z(r),void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,e.visitFunctionBody(r.body,E,t))}}function q(t){return !(e.nodeIsMissing(t.body)&&e.hasSyntacticModifier(t,256))}function W(r,n){if(!(1&r.transformFlags))return r;if(q(r)){var i=e.isClassLike(n)?j(r,n,e.getAllDecoratorsOfClassElement(r,n)):void 0;return _.updateGetAccessorDeclaration(r,e.concatenate(i,e.visitNodes(r.modifiers,I,e.isModifierLike)),z(r),e.visitParameterList(r.parameters,E,t),void 0,e.visitFunctionBody(r.body,E,t)||_.createBlock([]))}}function H(r,n){if(!(1&r.transformFlags))return r;if(q(r)){var i=e.isClassLike(n)?j(r,n,e.getAllDecoratorsOfClassElement(r,n)):void 0;return _.updateSetAccessorDeclaration(r,e.concatenate(i,e.visitNodes(r.modifiers,I,e.isModifierLike)),z(r),e.visitParameterList(r.parameters,E,t),e.visitFunctionBody(r.body,E,t)||_.createBlock([]))}}function G(r){var n=r.name;return e.isBindingPattern(n)?e.flattenDestructuringAssignment(r,E,t,0,!1,_e):e.setTextRange(_.createAssignment(de(n),e.visitNode(r.initializer,E,e.isExpression)),r)}function Q(r){var n=function(t,r){var n=t.name;return e.isPrivateIdentifier(n)?_.createIdentifier(""):e.isComputedPropertyName(n)?n.expression:e.isIdentifier(n)?_.createStringLiteral(e.idText(n)):_.cloneNode(n)}(r),i=function(r){var n=y.getConstantValue(r);return void 0!==n?"string"==typeof n?_.createStringLiteral(n):_.createNumericLiteral(n):(0==(8&l)&&(l|=8,t.enableSubstitution(79)),r.initializer?e.visitNode(r.initializer,E,e.isExpression):_.createVoidZero())}(r),o=_.createAssignment(_.createElementAccessExpression(a,n),i),s=10===i.kind?o:_.createAssignment(_.createElementAccessExpression(a,o),n);return e.setTextRange(_.createExpressionStatement(e.setTextRange(s,r)),r)}function X(t){return se(t)||ce(t)&&b!==e.ModuleKind.ES2015&&b!==e.ModuleKind.ES2020&&b!==e.ModuleKind.ES2022&&b!==e.ModuleKind.ESNext&&b!==e.ModuleKind.System}function Y(t){s||(s=new e.Map);var r=Z(t);s.has(r)||s.set(r,t);}function Z(t){return e.Debug.assertNode(t.name,e.isIdentifier),t.name.escapedText}function $(t,r){var n=_.createVariableStatement(e.visitNodes(r.modifiers,I,e.isModifier),_.createVariableDeclarationList([_.createVariableDeclaration(_.getLocalName(r,!1,!0))],308===o.kind?0:1));if(e.setOriginalNode(n,r),Y(r),function(e){if(s){var t=Z(e);return s.get(t)===e}return !0}(r))return 263===r.kind?e.setSourceMapRange(n.declarationList,r):e.setSourceMapRange(n,r),e.setCommentRange(n,r),e.addEmitFlags(n,4195328),t.push(n),!0;var i=_.createMergeDeclarationMarker(n);return e.setEmitFlags(i,4195840),t.push(i),!1}function ee(n){if(!function(t){var r=e.getParseTreeNode(t,e.isModuleDeclaration);return !r||e.isInstantiatedModule(r,e.shouldPreserveConstEnums(v))}(n))return _.createNotEmittedStatement(n);e.Debug.assertNode(n.name,e.isIdentifier,"A TypeScript namespace should have an Identifier name."),0==(2&l)&&(l|=2,t.enableSubstitution(79),t.enableSubstitution(300),t.enableEmitNotification(264));var c=[],u=2,d=$(c,n);d&&(b===e.ModuleKind.System&&o===r||(u|=512));var f=pe(n),m=fe(n),y=e.hasSyntacticModifier(n,1)?_.getExternalModuleOrNamespaceExportName(a,n,!1,!0):_.getLocalName(n,!1,!0),h=_.createLogicalOr(y,_.createAssignment(y,_.createObjectLiteralExpression()));if(X(n)){var x=_.getLocalName(n,!1,!0);h=_.createAssignment(x,h);}var D=_.createExpressionStatement(_.createCallExpression(_.createFunctionExpression(void 0,void 0,void 0,void 0,[_.createParameterDeclaration(void 0,void 0,f)],void 0,function(t,r){var n=a,o=i,c=s;a=r,i=t,s=void 0;var l,u,d=[];if(p(),t.body)if(265===t.body.kind)C(t.body,(function(t){return e.addRange(d,e.visitNodes(t.statements,F,e.isStatement))})),l=t.body.statements,u=t.body;else {var f=ee(t.body);f&&(e.isArray(f)?e.addRange(d,f):d.push(f));var m=te(t).body;l=e.moveRangePos(m.statements,-1);}e.insertStatementsAfterStandardPrologue(d,g()),a=n,i=o,s=c;var y=_.createBlock(e.setTextRange(_.createNodeArray(d),l),!0);return e.setTextRange(y,u),t.body&&265===t.body.kind||e.setEmitFlags(y,1536|e.getEmitFlags(y)),y}(n,m)),void 0,[h]));return e.setOriginalNode(D,n),d&&(e.setSyntheticLeadingComments(D,void 0),e.setSyntheticTrailingComments(D,void 0)),e.setTextRange(D,n),e.addEmitFlags(D,u),c.push(D),c.push(_.createEndOfDeclarationMarker(n)),c}function te(e){if(264===e.body.kind)return te(e.body)||e.body}function re(t){e.Debug.assert(!t.isTypeOnly);var r=me(t)?t.name:void 0,n=e.visitNode(t.namedBindings,ne,e.isNamedImportBindings);return r||n?_.updateImportClause(t,!1,r,n):void 0}function ne(t){if(271===t.kind)return me(t)?t:void 0;var r=v.preserveValueImports&&(1===v.importsNotUsedAsValues||2===v.importsNotUsedAsValues),n=e.visitNodes(t.elements,ie,e.isImportSpecifier);return r||e.some(n)?_.updateNamedImports(t,n):void 0}function ie(e){return !e.isTypeOnly&&me(e)?e:void 0}function ae(e){return !e.isTypeOnly&&y.isValueAliasDeclaration(e)?e:void 0}function oe(n){if(!n.isTypeOnly){if(e.isExternalModuleImportEqualsDeclaration(n)){var i=me(n);return i||1!==v.importsNotUsedAsValues?i?e.visitEachChild(n,E,t):void 0:e.setOriginalNode(e.setTextRange(_.createImportDeclaration(void 0,void 0,n.moduleReference.expression,void 0),n),n)}if(function(t){return me(t)||!e.isExternalModule(r)&&y.isTopLevelValueImportEqualsWithEntityName(t)}(n)){var o,s,c,l=e.createExpressionFromEntityName(_,n.moduleReference);return e.setEmitFlags(l,3584),le(n)||!se(n)?e.setOriginalNode(e.setTextRange(_.createVariableStatement(e.visitNodes(n.modifiers,I,e.isModifier),_.createVariableDeclarationList([e.setOriginalNode(_.createVariableDeclaration(n.name,void 0,void 0,l),n)])),n),n):e.setOriginalNode((o=n.name,s=l,c=n,e.setTextRange(_.createExpressionStatement(_.createAssignment(_.getNamespaceMemberName(a,o,!1,!0),s)),c)),n)}}}function se(t){return void 0!==i&&e.hasSyntacticModifier(t,1)}function ce(t){return void 0===i&&e.hasSyntacticModifier(t,1)}function le(t){return ce(t)&&!e.hasSyntacticModifier(t,1024)}function ue(t,r){var n=_.createAssignment(_.getExternalModuleOrNamespaceExportName(a,r,!1,!0),_.getLocalName(r));e.setSourceMapRange(n,e.createRange(r.name?r.name.pos:r.pos,r.end));var i=_.createExpressionStatement(n);e.setSourceMapRange(i,e.createRange(-1,r.end)),t.push(i);}function _e(t,r,n){return e.setTextRange(_.createAssignment(de(t),r),n)}function de(e){return _.getNamespaceMemberName(a,e,!1,!0)}function pe(t){var r=_.getGeneratedNameForNode(t);return e.setSourceMapRange(r,t.name),r}function fe(e){return _.getGeneratedNameForNode(e)}function ge(t){if(l&u&&!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var r=y.getReferencedExportContainer(t,!1);if(r&&308!==r.kind&&(2&u&&264===r.kind||8&u&&263===r.kind))return e.setTextRange(_.createPropertyAccessExpression(_.getGeneratedNameForNode(r),t),t)}}function me(t){return e.isInJSFile(t)||(v.preserveValueImports?y.isValueAliasDeclaration(t):y.isReferencedAliasDeclaration(t))}};}(t),function(e){var t,r,i;function a(t,r,n){var i,a;e.isGeneratedPrivateIdentifier(r)?(null!==(i=t.generatedIdentifiers)&&void 0!==i||(t.generatedIdentifiers=new e.Map),t.generatedIdentifiers.set(e.getNodeForGeneratedName(r),n)):(null!==(a=t.identifiers)&&void 0!==a||(t.identifiers=new e.Map),t.identifiers.set(r.escapedText,n));}function o(e,t){var r;return null===(r=e.identifiers)||void 0===r?void 0:r.get(t)}function s(e,t){var r;return null===(r=e.generatedIdentifiers)||void 0===r?void 0:r.get(t)}!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.ClassStaticThisOrSuperReference=2]="ClassStaticThisOrSuperReference";}(t||(t={})),(i=e.PrivateIdentifierKind||(e.PrivateIdentifierKind={})).Field="f",i.Method="m",i.Accessor="a",function(e){e[e.None=0]="None",e[e.ClassWasDecorated=1]="ClassWasDecorated",e[e.NeedsClassConstructorReference=2]="NeedsClassConstructorReference",e[e.NeedsClassSuperReference=4]="NeedsClassSuperReference",e[e.NeedsSubstitutionForThisInClassStaticField=8]="NeedsSubstitutionForThisInClassStaticField";}(r||(r={})),e.transformClassFields=function(t){var r=t.factory,i=t.hoistVariableDeclaration,c=t.endLexicalEnvironment,l=t.startLexicalEnvironment,u=t.resumeLexicalEnvironment,_=t.addBlockScopedVariable,d=t.getEmitResolver(),p=t.getCompilerOptions(),f=e.getEmitScriptTarget(p),g=e.getUseDefineForClassFields(p),m=!g,y=g&&f<9,v=m||y,h=f<9,b=f<99,x=f<9,D=x&&f>=2,S=v||h||b,T=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=T(t,n),1===t?function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&C&&33554432&d.getNodeCheckFlags(t)){var n=d.getReferencedValueDeclaration(t);if(n){var i=E[n.id];if(i){var a=r.cloneNode(i);return e.setSourceMapRange(a,t),e.setCommentRange(a,t),a}}}}(t)||t}(t);case 108:return function(t){if(2&C&&F){var n=F.facts,i=F.classConstructor;if(1&n)return r.createParenthesizedExpression(r.createVoidZero());if(i)return e.setTextRange(e.setOriginalNode(r.cloneNode(i),t),t)}return t}(t)}return t}(n):n};var C,E,k,N,A=t.onEmitNode;t.onEmitNode=function(t,r,n){var i=e.getOriginalNode(r);if(i.id){var a=M.get(i.id);if(a){var o=F,s=w;return F=a,w=a,A(t,r,n),F=o,void(w=s)}}switch(r.kind){case 215:if(e.isArrowFunction(i)||262144&e.getEmitFlags(r))break;case 259:case 173:return o=F,s=w,F=void 0,w=void 0,A(t,r,n),F=o,void(w=s);case 174:case 175:case 171:case 169:return o=F,s=w,w=F,F=void 0,A(t,r,n),F=o,void(w=s);case 164:return o=F,s=w,F=w,w=void 0,A(t,r,n),F=o,void(w=s)}A(t,r,n);};var F,P,w,I,O=[],M=new e.Map;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||!S)return r;var n=e.visitEachChild(r,L,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function L(a){if(!(16777216&a.transformFlags||134234112&a.transformFlags))return a;switch(a.kind){case 127:return b?void 0:a;case 260:return function(e){return te(e,re)}(a);case 228:return function(e){return te(e,ne)}(a);case 172:return function(r){if(!h)return e.visitEachChild(r,L,t)}(a);case 169:return W(a);case 240:return function(r){var i=N;N=[];var a=e.visitEachChild(r,L,t),o=e.some(N)?n$4([a],N,!0):a;return N=i,o}(a);case 80:return function(t){return h?e.isStatement(t.parent)?t:e.setOriginalNode(r.createIdentifier(""),t):t}(a);case 208:return function(n){if(h&&e.isPrivateIdentifier(n.name)){var i=he(n.name);if(i)return e.setTextRange(e.setOriginalNode(H(i,n.expression),n),n)}if(D&&e.isSuperProperty(n)&&e.isIdentifier(n.name)&&I&&F){var a=F.classConstructor,o=F.superClassReference;if(1&F.facts)return ue(n);if(a&&o){var s=r.createReflectGetCall(o,r.createStringLiteralFromNode(n.name),a);return e.setOriginalNode(s,n.expression),e.setTextRange(s,n.expression),s}}return e.visitEachChild(n,L,t)}(a);case 209:return function(n){if(D&&e.isSuperProperty(n)&&I&&F){var i=F.classConstructor,a=F.superClassReference;if(1&F.facts)return ue(n);if(i&&a){var o=r.createReflectGetCall(a,e.visitNode(n.argumentExpression,L,e.isExpression),i);return e.setOriginalNode(o,n.expression),e.setTextRange(o,n.expression),o}}return e.visitEachChild(n,L,t)}(a);case 221:case 222:return Q(a,!1);case 223:return Z(a,!1);case 210:return function(a){if(h&&e.isPrivateIdentifierPropertyAccessExpression(a.expression)){var o=r.createCallBinding(a.expression,i,f),s=o.thisArg,c=o.target;return e.isCallChain(a)?r.updateCallChain(a,r.createPropertyAccessChain(e.visitNode(c,L),a.questionDotToken,"call"),void 0,void 0,n$4([e.visitNode(s,L,e.isExpression)],e.visitNodes(a.arguments,L,e.isExpression),!0)):r.updateCallExpression(a,r.createPropertyAccessExpression(e.visitNode(c,L),"call"),void 0,n$4([e.visitNode(s,L,e.isExpression)],e.visitNodes(a.arguments,L,e.isExpression),!0))}if(D&&e.isSuperProperty(a.expression)&&I&&(null==F?void 0:F.classConstructor)){var l=r.createFunctionCallCall(e.visitNode(a.expression,L,e.isExpression),F.classConstructor,e.visitNodes(a.arguments,L,e.isExpression));return e.setOriginalNode(l,a),e.setTextRange(l,a),l}return e.visitEachChild(a,L,t)}(a);case 241:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,B,e.isExpression))}(a);case 212:return function(n){if(h&&e.isPrivateIdentifierPropertyAccessExpression(n.tag)){var a=r.createCallBinding(n.tag,i,f),o=a.thisArg,s=a.target;return r.updateTaggedTemplateExpression(n,r.createCallExpression(r.createPropertyAccessExpression(e.visitNode(s,L),"bind"),void 0,[e.visitNode(o,L,e.isExpression)]),void 0,e.visitNode(n.template,L,e.isTemplateLiteral))}if(D&&e.isSuperProperty(n.tag)&&I&&(null==F?void 0:F.classConstructor)){var c=r.createFunctionBindCall(e.visitNode(n.tag,L,e.isExpression),F.classConstructor,[]);return e.setOriginalNode(c,n),e.setTextRange(c,n),r.updateTaggedTemplateExpression(n,c,void 0,e.visitNode(n.template,L,e.isTemplateLiteral))}return e.visitEachChild(n,L,t)}(a);case 245:return function(n){return r.updateForStatement(n,e.visitNode(n.initializer,B,e.isForInitializer),e.visitNode(n.condition,L,e.isExpression),e.visitNode(n.incrementor,B,e.isExpression),e.visitIterationBody(n.statement,L,t))}(a);case 259:case 215:case 173:case 171:case 174:case 175:return V(void 0,R,a);default:return R(a)}}function R(r){return e.visitEachChild(r,L,t)}function B(e){switch(e.kind){case 221:case 222:return Q(e,!0);case 223:return Z(e,!0);default:return L(e)}}function j(n){switch(n.kind){case 294:return e.visitEachChild(n,j,t);case 230:return function(n){if(4&((null==F?void 0:F.facts)||0)){var a=r.createTempVariable(i,!0);return _e().superClassReference=a,r.updateExpressionWithTypeArguments(n,r.createAssignment(a,e.visitNode(n.expression,L,e.isExpression)),void 0)}return e.visitEachChild(n,L,t)}(n);default:return L(n)}}function J(t){switch(t.kind){case 207:case 206:return function(t){return e.isArrayLiteralExpression(t)?r.updateArrayLiteralExpression(t,e.visitNodes(t.elements,De,e.isExpression)):r.updateObjectLiteralExpression(t,e.visitNodes(t.properties,Se,e.isObjectLiteralElementLike))}(t);default:return L(t)}}function z(t){switch(t.kind){case 173:return function(e){return P?oe(e,P):R(e)}(t);case 174:case 175:case 171:return V(void 0,K,t);case 169:return V(void 0,W,t);case 164:return function(t){var i=e.visitNode(t.expression,L,e.isExpression);return e.some(k)&&(i=e.isParenthesizedExpression(i)?r.updateParenthesizedExpression(i,r.inlineExpressions(n$4(n$4([],k,!0),[i.expression],!1))):r.inlineExpressions(n$4(n$4([],k,!0),[i],!1)),k=void 0),r.updateComputedPropertyName(t,i)}(t);case 237:return t;default:return L(t)}}function U(t){switch(t.kind){case 169:return q(t);case 174:case 175:return z(t);default:e.Debug.assertMissingNode(t,"Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");}}function K(n){if(e.Debug.assert(!e.hasDecorators(n)),!h||!e.isPrivateIdentifier(n.name))return e.visitEachChild(n,z,t);var i=he(n.name);if(e.Debug.assert(i,"Undeclared private name for property declaration."),!i.isValid)return n;var a=function(t){e.Debug.assert(e.isPrivateIdentifier(t.name));var r=he(t.name);if(e.Debug.assert(r,"Undeclared private name for property declaration."),"m"===r.kind)return r.methodName;if("a"===r.kind){if(e.isGetAccessor(t))return r.getterName;if(e.isSetAccessor(t))return r.setterName}}(n);a&&pe().push(r.createAssignment(a,r.createFunctionExpression(e.filter(n.modifiers,(function(t){return e.isModifier(t)&&!e.isStaticModifier(t)&&!e.isAccessorModifier(t)})),n.asteriskToken,a,void 0,e.visitParameterList(n.parameters,L,t),void 0,e.visitFunctionBody(n.body,L,t))));}function V(e,t,r){var n=I;I=e;var i=t(r);return I=n,i}function q(n){return e.Debug.assert(!e.hasDecorators(n),"Decorators should already have been transformed and elided."),e.isPrivateIdentifierClassElementDeclaration(n)?function(n){if(h){var i=he(n.name);return e.Debug.assert(i,"Undeclared private name for property declaration."),i.isValid?void 0:n}return m&&!e.isStatic(n)?r.updatePropertyDeclaration(n,e.visitNodes(n.modifiers,L,e.isModifierLike),n.name,void 0,void 0,void 0):e.visitEachChild(n,L,t)}(n):function(n){if(!v)return e.visitEachChild(n,z,t);var a=function(t,n){if(e.isComputedPropertyName(t)){var a=e.visitNode(t.expression,L,e.isExpression),o=e.skipPartiallyEmittedExpressions(a),s=e.isSimpleInlineableExpression(o);if((!e.isAssignmentExpression(o)||!e.isGeneratedIdentifier(o.left))&&!s&&n){var c=r.getGeneratedNameForNode(t);return 524288&d.getNodeCheckFlags(t)?_(c):i(c),r.createAssignment(c,a)}return s||e.isIdentifier(o)?void 0:a}}(n.name,!!n.initializer||g);if(a&&pe().push(a),e.isStatic(n)&&!h){var o=ce(n,r.createThis());if(o){var s=r.createClassStaticBlockDeclaration(r.createBlock([o]));return e.setOriginalNode(s,n),e.setCommentRange(s,n),e.setCommentRange(o,{pos:-1,end:-1}),e.setSyntheticLeadingComments(o,void 0),e.setSyntheticTrailingComments(o,void 0),s}}}(n)}function W(t){return b&&e.isAutoAccessorPropertyDeclaration(t)?function(t){e.Debug.assertEachNode(t.modifiers,e.isModifier);var n=e.getCommentRange(t),a=e.getSourceMapRange(t),o=t.name,s=o,c=o;if(e.isComputedPropertyName(o)&&!e.isSimpleInlineableExpression(o.expression)){var l=r.createTempVariable(i);e.setSourceMapRange(l,o.expression);var u=e.visitNode(o.expression,L,e.isExpression),_=r.createAssignment(l,u);e.setSourceMapRange(_,o.expression),s=r.updateComputedPropertyName(o,r.inlineExpressions([_,l])),c=r.updateComputedPropertyName(o,l);}var d=e.createAccessorPropertyBackingField(r,t,t.modifiers,t.initializer);e.setOriginalNode(d,t),e.setEmitFlags(d,1536),e.setSourceMapRange(d,a);var p=e.createAccessorPropertyGetRedirector(r,t,t.modifiers,s);e.setOriginalNode(p,t),e.setCommentRange(p,n),e.setSourceMapRange(p,a);var f=e.createAccessorPropertySetRedirector(r,t,t.modifiers,c);return e.setOriginalNode(f,t),e.setEmitFlags(f,1536),e.setSourceMapRange(f,a),e.visitArray([d,p,f],U,e.isClassElement)}(t):q(t)}function H(t,r){return G(t,e.visitNode(r,L,e.isExpression))}function G(r,n){switch(e.setCommentRange(n,e.moveRangePos(n,-1)),r.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.getterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.methodName);case"f":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.variableName);default:e.Debug.assertNever(r,"Unknown private element type");}}function Q(n,a){if(45===n.operator||46===n.operator){var o,s=e.skipParentheses(n.operand);if(h&&e.isPrivateIdentifierPropertyAccessExpression(s)){if(o=he(s.name)){var c=X(e.visitNode(s.expression,L,e.isExpression)),l=c.readExpression,u=c.initializeExpression,_=H(o,l),d=e.isPrefixUnaryExpression(n)||a?void 0:r.createTempVariable(i);return _=$(o,u||l,_=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,_,i,d),63),e.setOriginalNode(_,n),e.setTextRange(_,n),d&&(_=r.createComma(_,d),e.setTextRange(_,n)),_}}else if(D&&e.isSuperProperty(s)&&I&&F){var p=F.classConstructor,f=F.superClassReference;if(1&F.facts)return _=ue(s),e.isPrefixUnaryExpression(n)?r.updatePrefixUnaryExpression(n,_):r.updatePostfixUnaryExpression(n,_);if(p&&f){var g=void 0,m=void 0;if(e.isPropertyAccessExpression(s)?e.isIdentifier(s.name)&&(m=g=r.createStringLiteralFromNode(s.name)):e.isSimpleInlineableExpression(s.argumentExpression)?m=g=s.argumentExpression:(m=r.createTempVariable(i),g=r.createAssignment(m,e.visitNode(s.argumentExpression,L,e.isExpression))),g&&m)return _=r.createReflectGetCall(f,m,p),e.setTextRange(_,s),d=a?void 0:r.createTempVariable(i),_=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,_,i,d),_=r.createReflectSetCall(f,g,_,p),e.setOriginalNode(_,n),e.setTextRange(_,n),d&&(_=r.createComma(_,d),e.setTextRange(_,n)),_}}}return e.visitEachChild(n,L,t)}function X(t){var n=e.nodeIsSynthesized(t)?t:r.cloneNode(t);if(e.isSimpleInlineableExpression(t))return {readExpression:n,initializeExpression:void 0};var a=r.createTempVariable(i);return {readExpression:a,initializeExpression:r.createAssignment(a,n)}}function Y(t){if(h){F&&M.set(e.getOriginalNodeId(t),F),l();var n=V(t,(function(t){return e.visitNodes(t,L,e.isStatement)}),t.body.statements);n=r.mergeLexicalEnvironment(n,c());var i=r.createImmediatelyInvokedArrowFunction(n);return e.setOriginalNode(i,t),e.setTextRange(i,t),e.addEmitFlags(i,2),i}}function Z(a,o){if(e.isDestructuringAssignment(a)){var s=k;k=void 0,a=r.updateBinaryExpression(a,e.visitNode(a.left,J),a.operatorToken,e.visitNode(a.right,L));var c=e.some(k)?r.inlineExpressions(e.compact(n$4(n$4([],k,!0),[a],!1))):a;return k=s,c}if(e.isAssignmentExpression(a))if(h&&e.isPrivateIdentifierPropertyAccessExpression(a.left)){var l=he(a.left.name);if(l)return e.setTextRange(e.setOriginalNode($(l,a.left.expression,a.right,a.operatorToken.kind),a),a)}else if(D&&e.isSuperProperty(a.left)&&I&&F){var u=F.classConstructor,_=F.superClassReference;if(1&F.facts)return r.updateBinaryExpression(a,ue(a.left),a.operatorToken,e.visitNode(a.right,L,e.isExpression));if(u&&_){var d=e.isElementAccessExpression(a.left)?e.visitNode(a.left.argumentExpression,L,e.isExpression):e.isIdentifier(a.left.name)?r.createStringLiteralFromNode(a.left.name):void 0;if(d){var p=e.visitNode(a.right,L,e.isExpression);if(e.isCompoundAssignment(a.operatorToken.kind)){var f=d;e.isSimpleInlineableExpression(d)||(f=r.createTempVariable(i),d=r.createAssignment(f,d));var g=r.createReflectGetCall(_,f,u);e.setOriginalNode(g,a.left),e.setTextRange(g,a.left),p=r.createBinaryExpression(g,e.getNonAssignmentOperatorForCompoundAssignment(a.operatorToken.kind),p),e.setTextRange(p,a);}var m=o?void 0:r.createTempVariable(i);return m&&(p=r.createAssignment(m,p),e.setTextRange(m,a)),p=r.createReflectSetCall(_,d,p,u),e.setOriginalNode(p,a),e.setTextRange(p,a),m&&(p=r.createComma(p,m),e.setTextRange(p,a)),p}}}return h&&function(t){return e.isPrivateIdentifier(t.left)&&101===t.operatorToken.kind}(a)?function(r){var n=he(r.left);if(n){var i=e.visitNode(r.right,L,e.isExpression);return e.setOriginalNode(t.getEmitHelperFactory().createClassPrivateFieldInHelper(n.brandCheckIdentifier,i),r)}return e.visitEachChild(r,L,t)}(a):e.visitEachChild(a,L,t)}function $(n,i,a,o){if(i=e.visitNode(i,L,e.isExpression),a=e.visitNode(a,L,e.isExpression),e.isCompoundAssignment(o)){var s=X(i),c=s.readExpression;i=s.initializeExpression||c,a=r.createBinaryExpression(G(n,c),e.getNonAssignmentOperatorForCompoundAssignment(o),a);}switch(e.setCommentRange(i,e.moveRangePos(i,-1)),n.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.setterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,void 0);case"f":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.variableName);default:e.Debug.assertNever(n,"Unknown private element type");}}function ee(t){return e.filter(t.members,e.isNonStaticMethodOrAccessorWithPrivateName)}function te(r,n){var i=P,a=k;if(P=r,k=void 0,O.push(F),F=void 0,h){var o=e.getNameOfDeclaration(r);o&&e.isIdentifier(o)&&(de().className=o);var s=ee(r);e.some(s)&&(de().weakSetName=ye("instances",s[0].name));}var c=function(t){var r=0,n=e.getOriginalNode(t);e.isClassDeclaration(n)&&e.classOrConstructorParameterIsDecorated(n)&&(r|=1);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.isStatic(o)&&(o.name&&(e.isPrivateIdentifier(o.name)||e.isAutoAccessorPropertyDeclaration(o))&&h&&(r|=2),(e.isPropertyDeclaration(o)||e.isClassStaticBlockDeclaration(o))&&(x&&16384&o.transformFlags&&(1&(r|=8)||(r|=2)),D&&134217728&o.transformFlags&&(1&r||(r|=6))));}return r}(r);c&&(_e().facts=c),8&c&&0==(2&C)&&(C|=2,t.enableSubstitution(108),t.enableEmitNotification(259),t.enableEmitNotification(215),t.enableEmitNotification(173),t.enableEmitNotification(174),t.enableEmitNotification(175),t.enableEmitNotification(171),t.enableEmitNotification(169),t.enableEmitNotification(164));var l=n(r,c);return F=O.pop(),P=i,k=a,l}function re(t,n){var a;if(2&n){var o=r.createTempVariable(i,!0);_e().classConstructor=r.cloneNode(o),a=r.createAssignment(o,r.getInternalName(t));}var s=e.visitNodes(t.modifiers,L,e.isModifierLike),c=e.visitNodes(t.heritageClauses,j,e.isHeritageClause),l=ie(t),u=l.members,_=l.prologue,d=r.updateClassDeclaration(t,s,t.name,void 0,c,u),p=[];if(_&&p.push(r.createExpressionStatement(_)),p.push(d),a&&pe().unshift(a),e.some(k)&&p.push(r.createExpressionStatement(r.inlineExpressions(k))),m||h){var f=e.getStaticPropertiesAndClassStaticBlock(t);e.some(f)&&se(p,f,r.getInternalName(t));}return p}function ne(n,a){var o,s=!!(1&a),c=e.getStaticPropertiesAndClassStaticBlock(n),l=16777216&d.getNodeCheckFlags(n);function u(){var e=d.getNodeCheckFlags(n),t=16777216&e,a=524288&e;return r.createTempVariable(a?_:i,!!t)}2&a&&(o=u(),_e().classConstructor=r.cloneNode(o));var p=e.visitNodes(n.modifiers,L,e.isModifierLike),f=e.visitNodes(n.heritageClauses,j,e.isHeritageClause),g=ie(n),m=g.members,y=g.prologue,b=r.updateClassExpression(n,p,n.name,void 0,f,m),x=[];y&&x.push(y);var D=h&&e.some(c,(function(t){return e.isClassStaticBlockDeclaration(t)||e.isPrivateIdentifierClassElementDeclaration(t)||v&&e.isInitializedProperty(t)}));if(D||e.some(k))if(s)e.Debug.assertIsDefined(N,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),N&&k&&e.some(k)&&N.push(r.createExpressionStatement(r.inlineExpressions(k))),N&&e.some(c)&&se(N,c,r.getInternalName(n)),o?x.push(e.startOnNewLine(r.createAssignment(o,b)),e.startOnNewLine(o)):(x.push(b),y&&e.startOnNewLine(b));else {if(o||(o=u()),l){0==(1&C)&&(C|=1,t.enableSubstitution(79),E=[]);var S=r.cloneNode(o);S.autoGenerateFlags&=-9,E[e.getOriginalNodeId(n)]=S;}e.setEmitFlags(b,65536|e.getEmitFlags(b)),x.push(e.startOnNewLine(r.createAssignment(o,b))),e.addRange(x,e.map(k,e.startOnNewLine)),e.addRange(x,function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i],s=e.isClassStaticBlockDeclaration(o)?Y(o):le(o,r);s&&(e.startOnNewLine(s),e.setOriginalNode(s,o),e.addEmitFlags(s,1536&e.getEmitFlags(o)),e.setSourceMapRange(s,e.moveRangePastModifiers(o)),e.setCommentRange(s,o),n.push(s));}return n}(c,o)),x.push(e.startOnNewLine(o));}else x.push(b),y&&e.startOnNewLine(b);return r.inlineExpressions(x)}function ie(t){if(h){for(var n=0,a=t.members;n<a.length;n++){var o=a[n];e.isPrivateIdentifierClassElementDeclaration(o)&&me(o,o.name,fe);}if(e.some(ee(t))&&(l=de().weakSetName,e.Debug.assert(l,"weakSetName should be set in private identifier environment"),pe().push(r.createAssignment(l,r.createNewExpression(r.createIdentifier("WeakSet"),void 0,[])))),b)for(var s=0,c=t.members;s<c.length;s++)o=c[s],e.isAutoAccessorPropertyDeclaration(o)&&me(o,r.getGeneratedPrivateNameForNode(o.name,void 0,"_accessor_storage"),ge);}var l,u,_,d,p=e.visitNodes(t.members,z,e.isClassElement);if(e.some(p,e.isConstructorDeclaration)||(u=oe(void 0,t)),!h&&e.some(k)){var f=r.createExpressionStatement(r.inlineExpressions(k));if(134234112&f.transformFlags){var g=r.createTempVariable(i),m=r.createArrowFunction(void 0,void 0,[],void 0,void 0,r.createBlock([f]));_=r.createAssignment(g,m),f=r.createExpressionStatement(r.createCallExpression(g,void 0,[]));}var y=r.createBlock([f]);d=r.createClassStaticBlockDeclaration(y),k=void 0;}if(u||d){var v=void 0;v=e.append(v,u),v=e.append(v,d),v=e.addRange(v,p),p=e.setTextRange(r.createNodeArray(v),t.members);}return {members:p,prologue:_}}function ae(t){return !e.isStatic(t)&&!e.hasAbstractModifier(e.getOriginalNode(t))&&(y&&e.isPropertyDeclaration(t)||m&&e.isInitializedProperty(t)||h&&e.isPrivateIdentifierClassElementDeclaration(t)||h&&b&&e.isAutoAccessorPropertyDeclaration(t))}function oe(i,a){if(i=e.visitNode(i,L,e.isConstructorDeclaration),!e.some(a.members,ae))return i;var o=e.getEffectiveBaseTypeNode(a),s=!(!o||104===e.skipOuterExpressions(o.expression).kind),l=e.visitParameterList(i?i.parameters:void 0,L,t),_=function(i,a,o){var s,l,_=e.getProperties(i,!1,!1);g||(_=e.filter(_,(function(t){return !!t.initializer||e.isPrivateIdentifier(t.name)||e.hasAccessorModifier(t)})));var d=ee(i),p=e.some(_)||e.some(d);if(!a&&!p)return e.visitFunctionBody(void 0,L,t);u();var f=!a&&o,m=0,y=0,v=-1,b=[];(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.statements)&&(y=r.copyPrologue(a.body.statements,b,!1,L),(v=e.findSuperStatementIndex(a.body.statements,y))>=0?(m=v+1,b=n$4(n$4(n$4([],b.slice(0,y),!0),e.visitNodes(a.body.statements,L,e.isStatement,y,m-y),!0),b.slice(y),!0)):y>=0&&(m=y)),f&&b.push(r.createExpressionStatement(r.createCallExpression(r.createSuper(),void 0,[r.createSpreadElement(r.createIdentifier("arguments"))])));var x=0;if(null==a?void 0:a.body)if(g)b=b.filter((function(t){return !e.isParameterPropertyDeclaration(e.getOriginalNode(t),a)}));else {for(var D=0,S=a.body.statements;D<S.length;D++){var T=S[D];e.isParameterPropertyDeclaration(e.getOriginalNode(T),a)&&x++;}if(x>0){var C=e.visitNodes(a.body.statements,L,e.isStatement,m,x);if(v>=0)e.addRange(b,C);else {var E=y;f&&E++,b=n$4(n$4(n$4([],b.slice(0,E),!0),C,!0),b.slice(E),!0);}m+=x;}}var k=r.createThis();if(function(t,n,i){if(h&&e.some(n)){var a=de().weakSetName;e.Debug.assert(a,"weakSetName should be set in private identifier environment"),t.push(r.createExpressionStatement(function(t,r){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(r,"add"),void 0,[t])}(i,a)));}}(b,d,k),se(b,_,k),a&&e.addRange(b,e.visitNodes(a.body.statements,(function(t){if(!g||!e.isParameterPropertyDeclaration(e.getOriginalNode(t),a))return L(t)}),e.isStatement,m)),0!==(b=r.mergeLexicalEnvironment(b,c())).length||a){var N=(null==a?void 0:a.body)&&a.body.statements.length>=b.length&&null!==(l=a.body.multiLine)&&void 0!==l?l:b.length>0;return e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(b),a?a.body.statements:i.members),N),a?a.body:void 0)}}(a,i,s);return _?i?(e.Debug.assert(l),r.updateConstructorDeclaration(i,void 0,l,_)):e.startOnNewLine(e.setOriginalNode(e.setTextRange(r.createConstructorDeclaration(void 0,null!=l?l:[],_),i||a),i)):i}function se(t,r,n){for(var i=0,a=r;i<a.length;i++){var o=a[i];if(!e.isStatic(o)||h||g){var s=ce(o,n);s&&t.push(s);}}}function ce(t,n){var i=e.isClassStaticBlockDeclaration(t)?Y(t):le(t,n);if(i){var a=r.createExpressionStatement(i);return e.setOriginalNode(a,t),e.addEmitFlags(a,1536&e.getEmitFlags(t)),e.setSourceMapRange(a,e.moveRangePastModifiers(t)),e.setCommentRange(a,t),e.setSyntheticLeadingComments(i,void 0),e.setSyntheticTrailingComments(i,void 0),a}}function le(t,n){var i=I,a=function(t,n){var i,a=!g,o=e.hasAccessorModifier(t)?r.getGeneratedPrivateNameForNode(t.name):e.isComputedPropertyName(t.name)&&!e.isSimpleInlineableExpression(t.name.expression)?r.updateComputedPropertyName(t.name,r.getGeneratedNameForNode(t.name)):t.name;if(e.hasStaticModifier(t)&&(I=t),h&&e.isPrivateIdentifier(o)){var s=he(o);if(s)return "f"===s.kind?s.isStatic?function(t,r){return e.factory.createAssignment(t,e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment("value",r||e.factory.createVoidZero())]))}(s.variableName,e.visitNode(t.initializer,L,e.isExpression)):function(t,r,n){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(n,"set"),void 0,[t,r||e.factory.createVoidZero()])}(n,e.visitNode(t.initializer,L,e.isExpression),s.brandCheckIdentifier):void 0;e.Debug.fail("Undeclared private name for property declaration.");}if(!e.isPrivateIdentifier(o)&&!e.hasStaticModifier(t)||t.initializer){var c=e.getOriginalNode(t);if(!e.hasSyntacticModifier(c,256)){var l=t.initializer||a?null!==(i=e.visitNode(t.initializer,L,e.isExpression))&&void 0!==i?i:r.createVoidZero():e.isParameterPropertyDeclaration(c,c.parent)&&e.isIdentifier(o)?o:r.createVoidZero();if(a||e.isPrivateIdentifier(o)){var u=e.createMemberAccessForPropertyName(r,n,o,o);return r.createAssignment(u,l)}var _=e.isComputedPropertyName(o)?o.expression:e.isIdentifier(o)?r.createStringLiteral(e.unescapeLeadingUnderscores(o.escapedText)):o,d=r.createPropertyDescriptor({value:l,configurable:!0,writable:!0,enumerable:!0});return r.createObjectDefinePropertyCall(n,_,d)}}}(t,n);return a&&e.hasStaticModifier(t)&&(null==F?void 0:F.facts)&&(e.setOriginalNode(a,t),e.addEmitFlags(a,2),M.set(e.getOriginalNodeId(a),F)),I=i,a}function ue(t){return e.isPropertyAccessExpression(t)?r.updatePropertyAccessExpression(t,r.createVoidZero(),t.name):r.updateElementAccessExpression(t,r.createVoidZero(),e.visitNode(t.argumentExpression,L,e.isExpression))}function _e(){return F||(F={facts:0,classConstructor:void 0,superClassReference:void 0,privateIdentifierEnvironment:void 0})}function de(){var e=_e();return e.privateIdentifierEnvironment||(e.privateIdentifierEnvironment={className:void 0,weakSetName:void 0,identifiers:void 0,generatedIdentifiers:void 0}),e.privateIdentifierEnvironment}function pe(){return null!=k?k:k=[]}function fe(t,r,n,i,o,s,c){e.isAutoAccessorPropertyDeclaration(t)?function(t,r,n,i,o,s,c){a(i,r,{kind:"a",getterName:ve(r,"_get"),setterName:ve(r,"_set"),brandCheckIdentifier:o?e.Debug.checkDefined(n.classConstructor,"classConstructor should be set in private identifier environment"):e.Debug.checkDefined(i.weakSetName,"weakSetName should be set in private identifier environment"),isStatic:o,isValid:s});}(0,r,n,i,o,s):e.isPropertyDeclaration(t)?ge(0,r,n,i,o,s):e.isMethodDeclaration(t)?function(t,r,n,i,o,s,c){a(i,r,{kind:"m",methodName:ve(r),brandCheckIdentifier:o?e.Debug.checkDefined(n.classConstructor,"classConstructor should be set in private identifier environment"):e.Debug.checkDefined(i.weakSetName,"weakSetName should be set in private identifier environment"),isStatic:o,isValid:s});}(0,r,n,i,o,s):e.isGetAccessorDeclaration(t)?function(t,r,n,i,o,s,c){var l=ve(r,"_get"),u=o?e.Debug.checkDefined(n.classConstructor,"classConstructor should be set in private identifier environment"):e.Debug.checkDefined(i.weakSetName,"weakSetName should be set in private identifier environment");"a"!==(null==c?void 0:c.kind)||c.isStatic!==o||c.getterName?a(i,r,{kind:"a",getterName:l,setterName:void 0,brandCheckIdentifier:u,isStatic:o,isValid:s}):c.getterName=l;}(0,r,n,i,o,s,c):e.isSetAccessorDeclaration(t)&&function(t,r,n,i,o,s,c){var l=ve(r,"_set"),u=o?e.Debug.checkDefined(n.classConstructor,"classConstructor should be set in private identifier environment"):e.Debug.checkDefined(i.weakSetName,"weakSetName should be set in private identifier environment");"a"!==(null==c?void 0:c.kind)||c.isStatic!==o||c.setterName?a(i,r,{kind:"a",getterName:void 0,setterName:l,brandCheckIdentifier:u,isStatic:o,isValid:s}):c.setterName=l;}(0,r,n,i,o,s,c);}function ge(t,n,i,o,s,c,l){if(s){e.Debug.assert(i.classConstructor,"classConstructor should be set in private identifier environment");var u=ve(n);a(o,n,{kind:"f",brandCheckIdentifier:i.classConstructor,variableName:u,isStatic:!0,isValid:c});}else {var _=ve(n);a(o,n,{kind:"f",brandCheckIdentifier:_,variableName:void 0,isStatic:!1,isValid:c}),pe().push(r.createAssignment(_,r.createNewExpression(r.createIdentifier("WeakMap"),void 0,[])));}}function me(t,r,n){var i=_e(),a=de(),c=function(t,r){return e.isGeneratedPrivateIdentifier(r)?s(t,e.getNodeForGeneratedName(r)):o(t,r.escapedText)}(a,r),l=e.hasStaticModifier(t),u=!function(t){return !e.isGeneratedPrivateIdentifier(t)&&"#constructor"===t.escapedText}(r)&&void 0===c;n(t,r,i,a,l,u,c);}function ye(e,t,n){var a=de().className,o=a?{prefix:"_",node:a,suffix:"_"}:"_",s="object"==typeof e?r.getGeneratedNameForNode(e,24,o,n):"string"==typeof e?r.createUniqueName(e,16,o,n):r.createTempVariable(void 0,!0,o,n);return 524288&d.getNodeCheckFlags(t)?_(s):i(s),s}function ve(t,r){var n,i=e.tryGetTextOfPropertyName(t);return ye(null!==(n=null==i?void 0:i.substring(1))&&void 0!==n?n:t,t,r)}function he(t){return e.isGeneratedPrivateIdentifier(t)?function(t){return be(s,e.getNodeForGeneratedName(t))}(t):be(o,t.escapedText)}function be(e,t){if((null==F?void 0:F.privateIdentifierEnvironment)&&(n=e(F.privateIdentifierEnvironment,t)))return n;for(var r=O.length-1;r>=0;--r){var n,i=O[r];if(i&&i.privateIdentifierEnvironment&&(n=e(i.privateIdentifierEnvironment,t)))return n}}function xe(n){var a=r.getGeneratedNameForNode(n),o=he(n.name);if(!o)return e.visitEachChild(n,L,t);var s=n.expression;return (e.isThisProperty(n)||e.isSuperProperty(n)||!e.isSimpleCopiableExpression(n.expression))&&(s=r.createTempVariable(i,!0),pe().push(r.createBinaryExpression(s,63,e.visitNode(n.expression,L,e.isExpression)))),r.createAssignmentTargetWrapper(a,$(o,s,a,63))}function De(t){var n=e.getTargetOfBindingOrAssignmentElement(t);if(n){var i=void 0;if(e.isPrivateIdentifierPropertyAccessExpression(n))i=xe(n);else if(D&&e.isSuperProperty(n)&&I&&F){var a=F.classConstructor,o=F.superClassReference;if(1&F.facts)i=ue(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,L,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(i)return e.isAssignmentExpression(t)?r.updateBinaryExpression(t,i,t.operatorToken,e.visitNode(t.right,L,e.isExpression)):e.isSpreadElement(t)?r.updateSpreadElement(t,i):i}return e.visitNode(t,J)}function Se(t){if(e.isObjectBindingOrAssignmentElement(t)&&!e.isShorthandPropertyAssignment(t)){var n=e.getTargetOfBindingOrAssignmentElement(t),i=void 0;if(n)if(e.isPrivateIdentifierPropertyAccessExpression(n))i=xe(n);else if(D&&e.isSuperProperty(n)&&I&&F){var a=F.classConstructor,o=F.superClassReference;if(1&F.facts)i=ue(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,L,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(e.isPropertyAssignment(t)){var l=e.getInitializerOfBindingOrAssignmentElement(t);return r.updatePropertyAssignment(t,e.visitNode(t.name,L,e.isPropertyName),i?l?r.createAssignment(i,e.visitNode(l,L)):i:e.visitNode(t.initializer,J,e.isExpression))}if(e.isSpreadAssignment(t))return r.updateSpreadAssignment(t,i||e.visitNode(t.expression,J,e.isExpression));e.Debug.assert(void 0===i,"Should not have generated a wrapped target");}return e.visitNode(t,L)}};}(t),function(e){e.createRuntimeTypeSerializer=function(t){var r,n,i=t.hoistVariableDeclaration,a=t.getEmitResolver(),o=t.getCompilerOptions(),s=e.getEmitScriptTarget(o),c=e.getStrictOptionValue(o,"strictNullChecks");return {serializeTypeNode:function(e,t){return l(e,p,t)},serializeTypeOfNode:function(e,t){return l(e,u,t)},serializeParameterTypesOfNode:function(e,t,r){return l(e,_,t,r)},serializeReturnTypeOfNode:function(e,t){return l(e,d,t)}};function l(e,t,i,a){var o=r,s=n;r=e.currentLexicalScope,n=e.currentNameScope;var c=void 0===a?t(i):t(i,a);return r=o,n=s,c}function u(t){switch(t.kind){case 169:case 166:return p(t.type);case 175:case 174:return p(function(t){var r=a.getAllAccessorDeclarations(t);return r.setAccessor&&e.getSetAccessorTypeAnnotationNode(r.setAccessor)||r.getAccessor&&e.getEffectiveReturnTypeNode(r.getAccessor)}(t));case 260:case 228:case 171:return e.factory.createIdentifier("Function");default:return e.factory.createVoidZero()}}function _(t,r){var n=e.isClassLike(t)?e.getFirstConstructorWithBody(t):e.isFunctionLike(t)&&e.nodeIsPresent(t.body)?t:void 0,i=[];if(n)for(var a=function(t,r){if(r&&174===t.kind){var n=e.getAllAccessorDeclarations(r.members,t).setAccessor;if(n)return n.parameters}return t.parameters}(n,r),o=a.length,s=0;s<o;s++){var c=a[s];0===s&&e.isIdentifier(c.name)&&"this"===c.name.escapedText||(c.dotDotDotToken?i.push(p(e.getRestParameterElementType(c.type))):i.push(u(c)));}return e.factory.createArrayLiteralExpression(i)}function d(t){return e.isFunctionLike(t)&&t.type?p(t.type):e.isAsyncFunction(t)?e.factory.createIdentifier("Promise"):e.factory.createVoidZero()}function p(t){if(void 0===t)return e.factory.createIdentifier("Object");switch((t=e.skipTypeParentheses(t)).kind){case 114:case 155:case 144:return e.factory.createVoidZero();case 181:case 182:return e.factory.createIdentifier("Function");case 185:case 186:return e.factory.createIdentifier("Array");case 179:return t.assertsModifier?e.factory.createVoidZero():e.factory.createIdentifier("Boolean");case 134:return e.factory.createIdentifier("Boolean");case 200:case 152:return e.factory.createIdentifier("String");case 149:return e.factory.createIdentifier("Object");case 198:return f(t.literal);case 148:return e.factory.createIdentifier("Number");case 160:return b("BigInt",7);case 153:return b("Symbol",2);case 180:return function(t){var o=a.getTypeReferenceSerializationKind(t.typeName,null!=n?n:r);switch(o){case e.TypeReferenceSerializationKind.Unknown:if(e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&(t.parent.trueType===t||t.parent.falseType===t)})))return e.factory.createIdentifier("Object");var s=v(t.typeName),c=e.factory.createTempVariable(i);return e.factory.createConditionalExpression(e.factory.createTypeCheck(e.factory.createAssignment(c,s),"function"),void 0,c,void 0,e.factory.createIdentifier("Object"));case e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:return h(t.typeName);case e.TypeReferenceSerializationKind.VoidNullableOrNeverType:return e.factory.createVoidZero();case e.TypeReferenceSerializationKind.BigIntLikeType:return b("BigInt",7);case e.TypeReferenceSerializationKind.BooleanType:return e.factory.createIdentifier("Boolean");case e.TypeReferenceSerializationKind.NumberLikeType:return e.factory.createIdentifier("Number");case e.TypeReferenceSerializationKind.StringLikeType:return e.factory.createIdentifier("String");case e.TypeReferenceSerializationKind.ArrayLikeType:return e.factory.createIdentifier("Array");case e.TypeReferenceSerializationKind.ESSymbolType:return b("Symbol",2);case e.TypeReferenceSerializationKind.TypeWithCallSignature:return e.factory.createIdentifier("Function");case e.TypeReferenceSerializationKind.Promise:return e.factory.createIdentifier("Promise");case e.TypeReferenceSerializationKind.ObjectType:return e.factory.createIdentifier("Object");default:return e.Debug.assertNever(o)}}(t);case 190:return g(t.types,!0);case 189:return g(t.types,!1);case 191:return g([t.trueType,t.falseType],!1);case 195:if(146===t.operator)return p(t.type);break;case 183:case 196:case 197:case 184:case 131:case 157:case 194:case 202:case 315:case 316:case 320:case 321:case 322:break;case 317:case 318:case 319:return p(t.type);default:return e.Debug.failBadSyntaxKind(t)}return e.factory.createIdentifier("Object")}function f(t){switch(t.kind){case 10:case 14:return e.factory.createIdentifier("String");case 221:var r=t.operand;switch(r.kind){case 8:case 9:return f(r);default:return e.Debug.failBadSyntaxKind(r)}case 8:return e.factory.createIdentifier("Number");case 9:return b("BigInt",7);case 110:case 95:return e.factory.createIdentifier("Boolean");case 104:return e.factory.createVoidZero();default:return e.Debug.failBadSyntaxKind(t)}}function g(t,r){for(var n,i=0,a=t;i<a.length;i++){var o=a[i];if(144!==(o=e.skipTypeParentheses(o)).kind){if(157!==o.kind){if(131===o.kind)return e.factory.createIdentifier("Object");if(c||!(e.isLiteralTypeNode(o)&&104===o.literal.kind||155===o.kind)){var s=p(o);if(e.isIdentifier(s)&&"Object"===s.escapedText)return s;if(n){if(!m(n,s))return e.factory.createIdentifier("Object")}else n=s;}}else if(!r)return e.factory.createIdentifier("Object")}else if(r)return e.factory.createVoidZero()}return null!=n?n:e.factory.createVoidZero()}function m(t,r){return e.isGeneratedIdentifier(t)?e.isGeneratedIdentifier(r):e.isIdentifier(t)?e.isIdentifier(r)&&t.escapedText===r.escapedText:e.isPropertyAccessExpression(t)?e.isPropertyAccessExpression(r)&&m(t.expression,r.expression)&&m(t.name,r.name):e.isVoidExpression(t)?e.isVoidExpression(r)&&e.isNumericLiteral(t.expression)&&"0"===t.expression.text&&e.isNumericLiteral(r.expression)&&"0"===r.expression.text:e.isStringLiteral(t)?e.isStringLiteral(r)&&t.text===r.text:e.isTypeOfExpression(t)?e.isTypeOfExpression(r)&&m(t.expression,r.expression):e.isParenthesizedExpression(t)?e.isParenthesizedExpression(r)&&m(t.expression,r.expression):e.isConditionalExpression(t)?e.isConditionalExpression(r)&&m(t.condition,r.condition)&&m(t.whenTrue,r.whenTrue)&&m(t.whenFalse,r.whenFalse):!!e.isBinaryExpression(t)&&e.isBinaryExpression(r)&&t.operatorToken.kind===r.operatorToken.kind&&m(t.left,r.left)&&m(t.right,r.right)}function y(t,r){return e.factory.createLogicalAnd(e.factory.createStrictInequality(e.factory.createTypeOfExpression(t),e.factory.createStringLiteral("undefined")),r)}function v(t){if(79===t.kind){var r=h(t);return y(r,r)}if(79===t.left.kind)return y(h(t.left),h(t));var n=v(t.left),a=e.factory.createTempVariable(i);return e.factory.createLogicalAnd(e.factory.createLogicalAnd(n.left,e.factory.createStrictInequality(e.factory.createAssignment(a,n.right),e.factory.createVoidZero())),e.factory.createPropertyAccessExpression(a,t.right))}function h(t){switch(t.kind){case 79:var n=e.setParent(e.setTextRange(e.parseNodeFactory.cloneNode(t),t),t.parent);return n.original=void 0,e.setParent(n,e.getParseTreeNode(r)),n;case 163:return function(t){return e.factory.createPropertyAccessExpression(h(t.left),t.right)}(t)}}function b(t,r){return s<r?function(t){return e.factory.createConditionalExpression(e.factory.createTypeCheck(e.factory.createIdentifier(t),"function"),void 0,e.factory.createIdentifier(t),void 0,e.factory.createIdentifier("Object"))}(t):e.factory.createIdentifier(t)}};}(t),function(e){e.transformLegacyDecorators=function(t){var r,i=t.factory,a=t.getEmitHelperFactory,o=t.hoistVariableDeclaration,s=t.getEmitResolver(),c=t.getCompilerOptions(),l=e.getEmitScriptTarget(c),u=t.onSubstituteNode;return t.onSubstituteNode=function(t,n){return n=u(t,n),1===t?function(t){return 79===t.kind?function(t){var n;return null!==(n=function(t){if(r&&33554432&s.getNodeCheckFlags(t)){var n=s.getReferencedValueDeclaration(t);if(n){var a=r[n.id];if(a){var o=i.cloneNode(a);return e.setSourceMapRange(o,t),e.setCommentRange(o,t),o}}}}(t))&&void 0!==n?n:t}(t):t}(n):n},e.chainBundle(t,(function(r){var n=e.visitEachChild(r,d,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function _(t){return e.isDecorator(t)?void 0:t}function d(n){if(!(33554432&n.transformFlags))return n;switch(n.kind){case 167:return;case 260:return function(n){if(!e.classOrConstructorParameterIsDecorated(n)&&!e.childIsDecorated(n))return e.visitEachChild(n,d,t);var c=e.hasDecorators(n)?function(n,c){var u,_,p=e.moveRangePastModifiers(n),f=function(n){if(16777216&s.getNodeCheckFlags(n)){r||(t.enableSubstitution(79),r=[]);var a=i.createUniqueName(n.name&&!e.isGeneratedIdentifier(n.name)?e.idText(n.name):"default");return r[e.getOriginalNodeId(n)]=a,o(a),a}}(n),m=l<=2?i.getInternalName(n,!1,!0):i.getLocalName(n,!1,!0),v=e.visitNodes(n.heritageClauses,d,e.isHeritageClause),h=e.visitNodes(n.members,d,e.isClassElement);h=(u=g(n,h)).members,_=u.decorationStatements;var b=i.createClassExpression(void 0,c,void 0,v,h);e.setOriginalNode(b,n),e.setTextRange(b,p);var x=i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(m,void 0,void 0,f?i.createAssignment(f,b):b)],1));e.setOriginalNode(x,n),e.setTextRange(x,p),e.setCommentRange(x,n);var D=[x];return e.addRange(D,_),function(t,n){var o=function(t){var n=y(e.getAllDecoratorsOfClass(t));if(n){var o=r&&r[e.getOriginalNodeId(t)],s=l<=2?i.getInternalName(t,!1,!0):i.getLocalName(t,!1,!0),c=a().createDecorateHelper(n,s),u=i.createAssignment(s,o?i.createAssignment(o,c):c);return e.setEmitFlags(u,1536),e.setSourceMapRange(u,e.moveRangePastModifiers(t)),u}}(n);o&&t.push(e.setOriginalNode(i.createExpressionStatement(o),n));}(D,n),D}(n,n.name):function(t,r){var n,a,o=e.visitNodes(t.modifiers,_,e.isModifier),s=e.visitNodes(t.heritageClauses,d,e.isHeritageClause),c=e.visitNodes(t.members,d,e.isClassElement);c=(n=g(t,c)).members,a=n.decorationStatements;var l=i.updateClassDeclaration(t,o,r,void 0,s,c);return e.addRange([l],a)}(n,n.name);return c.length>1&&(c.push(i.createEndOfDeclarationMarker(n)),e.setEmitFlags(c[0],4194304|e.getEmitFlags(c[0]))),e.singleOrMany(c)}(n);case 228:return function(t){return i.updateClassExpression(t,e.visitNodes(t.modifiers,_,e.isModifier),t.name,void 0,e.visitNodes(t.heritageClauses,d,e.isHeritageClause),e.visitNodes(t.members,d,e.isClassElement))}(n);case 173:return function(t){return i.updateConstructorDeclaration(t,e.visitNodes(t.modifiers,_,e.isModifier),e.visitNodes(t.parameters,d,e.isParameterDeclaration),e.visitNode(t.body,d,e.isBlock))}(n);case 171:return function(t){return m(i.updateMethodDeclaration(t,e.visitNodes(t.modifiers,_,e.isModifier),t.asteriskToken,e.visitNode(t.name,d,e.isPropertyName),void 0,void 0,e.visitNodes(t.parameters,d,e.isParameterDeclaration),void 0,e.visitNode(t.body,d,e.isBlock)),t)}(n);case 175:return function(t){return m(i.updateSetAccessorDeclaration(t,e.visitNodes(t.modifiers,_,e.isModifier),e.visitNode(t.name,d,e.isPropertyName),e.visitNodes(t.parameters,d,e.isParameterDeclaration),e.visitNode(t.body,d,e.isBlock)),t)}(n);case 174:return function(t){return m(i.updateGetAccessorDeclaration(t,e.visitNodes(t.modifiers,_,e.isModifier),e.visitNode(t.name,d,e.isPropertyName),e.visitNodes(t.parameters,d,e.isParameterDeclaration),void 0,e.visitNode(t.body,d,e.isBlock)),t)}(n);case 169:return function(t){if(!(16777216&t.flags||e.hasSyntacticModifier(t,2)))return m(i.updatePropertyDeclaration(t,e.visitNodes(t.modifiers,_,e.isModifier),e.visitNode(t.name,d,e.isPropertyName),void 0,void 0,e.visitNode(t.initializer,d,e.isExpression)),t)}(n);case 166:return function(t){var r=i.updateParameterDeclaration(t,e.elideNodes(i,t.modifiers),t.dotDotDotToken,e.visitNode(t.name,d,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,d,e.isExpression));return r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32)),r}(n);default:return e.visitEachChild(n,d,t)}}function p(e){return !!(536870912&e.transformFlags)}function f(t){return e.some(t,p)}function g(t,r){var a=[];return v(a,t,!1),v(a,t,!0),function(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r];if(e.canHaveDecorators(i)){var a=e.getAllDecoratorsOfClassElement(i,t);if(e.some(null==a?void 0:a.decorators,p))return !0;if(e.some(null==a?void 0:a.parameters,f))return !0}}return !1}(t)&&(r=e.setTextRange(i.createNodeArray(n$4(n$4([],r,!0),[i.createClassStaticBlockDeclaration(i.createBlock(a,!0))],!1)),r),a=void 0),{decorationStatements:a,members:r}}function m(t,r){return t!==r&&(e.setCommentRange(t,r),e.setSourceMapRange(t,e.moveRangePastModifiers(r))),t}function y(t){if(t){var r=[];return e.addRange(r,e.map(t.decorators,b)),e.addRange(r,e.flatMap(t.parameters,x)),r}}function v(t,r,n){e.addRange(t,e.map(function(t,r){for(var n,i=function(t,r){return e.filter(t.members,(function(n){return function(t,r,n){return e.nodeOrChildIsDecorated(t,n)&&r===e.isStatic(t)}(n,r,t)}))}(t,r),a=0,o=i;a<o.length;a++){var s=o[a];n=e.append(n,h(t,s));}return n}(r,n),(function(e){return i.createExpressionStatement(e)})));}function h(t,r){var n=y(e.getAllDecoratorsOfClassElement(r,t));if(n){var o=function(t,r){return e.isStatic(r)?i.getDeclarationName(t):function(e){return i.createPropertyAccessExpression(i.getDeclarationName(e),"prototype")}(t)}(t,r),s=function(t,r){var n=t.name;return e.isPrivateIdentifier(n)?i.createIdentifier(""):e.isComputedPropertyName(n)?r&&!e.isSimpleInlineableExpression(n.expression)?i.getGeneratedNameForNode(n):n.expression:e.isIdentifier(n)?i.createStringLiteral(e.idText(n)):i.cloneNode(n)}(r,!e.hasSyntacticModifier(r,2)),c=l>0?e.isPropertyDeclaration(r)&&!e.hasAccessorModifier(r)?i.createVoidZero():i.createNull():void 0,u=a().createDecorateHelper(n,o,s,c);return e.setEmitFlags(u,1536),e.setSourceMapRange(u,e.moveRangePastModifiers(r)),u}}function b(t){return e.visitNode(t.expression,d,e.isExpression)}function x(t,r){var n;if(t){n=[];for(var i=0,o=t;i<o.length;i++){var s=o[i],c=a().createParamHelper(b(s),r);e.setTextRange(c,s.expression),e.setEmitFlags(c,1536),n.push(c);}}return n}};}(t),function(e){var t,r;function i(t,r,n,i){var a=0!=(4096&r.getNodeCheckFlags(n)),o=[];return i.forEach((function(r,n){var i=e.unescapeLeadingUnderscores(n),s=[];s.push(t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[],void 0,void 0,e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4)))),a&&s.push(t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,t.createAssignment(e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4),t.createIdentifier("v"))))),o.push(t.createPropertyAssignment(i,t.createObjectLiteralExpression(s)));})),t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_super",48),void 0,void 0,t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[t.createNull(),t.createObjectLiteralExpression(o,!0)]))],2))}!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.NonTopLevel=1]="NonTopLevel",e[e.HasLexicalThis=2]="HasLexicalThis";}(r||(r={})),e.transformES2017=function(t){var r,a,o,s,c=t.factory,l=t.getEmitHelperFactory,u=t.resumeLexicalEnvironment,_=t.endLexicalEnvironment,d=t.hoistVariableDeclaration,p=t.getEmitResolver(),f=t.getCompilerOptions(),g=e.getEmitScriptTarget(f),m=0,y=[],v=0,h=t.onEmitNode,b=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){if(1&r&&function(e){var t=e.kind;return 260===t||173===t||171===t||174===t||175===t}(n)){var a=6144&p.getNodeCheckFlags(n);if(a!==m){var o=m;return m=a,h(t,n,i),void(m=o)}}else if(r&&y[e.getNodeId(n)])return o=m,m=0,h(t,n,i),void(m=o);h(t,n,i);},t.onSubstituteNode=function(t,r){return r=b(t,r),1===t&&m?function(t){switch(t.kind){case 208:return q(t);case 209:return W(t);case 210:return function(t){var r=t.expression;if(e.isSuperProperty(r)){var i=e.isPropertyAccessExpression(r)?q(r):W(r);return c.createCallExpression(c.createPropertyAccessExpression(i,"call"),void 0,n$4([c.createThis()],t.arguments,!0))}return t}(t)}return t}(r):r},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;x(1,!1),x(2,!e.isEffectiveStrictModeSourceFile(r,f));var n=e.visitEachChild(r,E,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function x(e,t){v=t?v|e:v&~e;}function D(e){return 0!=(v&e)}function S(){return D(2)}function T(e,t,r){var n=e&~v;if(n){x(n,!0);var i=t(r);return x(n,!1),i}return t(r)}function C(r){return e.visitEachChild(r,E,t)}function E(r){if(0==(256&r.transformFlags))return r;switch(r.kind){case 132:return;case 220:return function(r){return D(1)?e.setOriginalNode(e.setTextRange(c.createYieldExpression(void 0,e.visitNode(r.expression,E,e.isExpression)),r),r):e.visitEachChild(r,E,t)}(r);case 171:return T(3,A,r);case 259:return T(3,w,r);case 215:return T(3,I,r);case 216:return T(1,O,r);case 208:return o&&e.isPropertyAccessExpression(r)&&106===r.expression.kind&&o.add(r.name.escapedText),e.visitEachChild(r,E,t);case 209:return o&&106===r.expression.kind&&(s=!0),e.visitEachChild(r,E,t);case 174:return T(3,F,r);case 175:return T(3,P,r);case 173:return T(3,N,r);case 260:case 228:return T(3,C,r);default:return e.visitEachChild(r,E,t)}}function k(r){if(e.isNodeWithPossibleHoistedDeclaration(r))switch(r.kind){case 240:return function(r){if(L(r.declarationList)){var n=R(r.declarationList,!1);return n?c.createExpressionStatement(n):void 0}return e.visitEachChild(r,E,t)}(r);case 245:return function(r){var n=r.initializer;return c.updateForStatement(r,L(n)?R(n,!1):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.condition,E,e.isExpression),e.visitNode(r.incrementor,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 246:return function(r){return c.updateForInStatement(r,L(r.initializer)?R(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 247:return function(r){return c.updateForOfStatement(r,e.visitNode(r.awaitModifier,E,e.isToken),L(r.initializer)?R(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 295:return function(r){var n,i=new e.Set;if(M(r.variableDeclaration,i),i.forEach((function(t,r){a.has(r)&&(n||(n=new e.Set(a)),n.delete(r));})),n){var o=a;a=n;var s=e.visitEachChild(r,k,t);return a=o,s}return e.visitEachChild(r,k,t)}(r);case 238:case 252:case 266:case 292:case 293:case 255:case 243:case 244:case 242:case 251:case 253:return e.visitEachChild(r,k,t);default:return e.Debug.assertNever(r,"Unhandled node.")}return E(r)}function N(r){return c.updateConstructorDeclaration(r,e.visitNodes(r.modifiers,E,e.isModifierLike),e.visitParameterList(r.parameters,E,t),z(r))}function A(r){return c.updateMethodDeclaration(r,e.visitNodes(r.modifiers,E,e.isModifierLike),r.asteriskToken,r.name,void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?U(r):z(r))}function F(r){return c.updateGetAccessorDeclaration(r,e.visitNodes(r.modifiers,E,e.isModifierLike),r.name,e.visitParameterList(r.parameters,E,t),void 0,z(r))}function P(r){return c.updateSetAccessorDeclaration(r,e.visitNodes(r.modifiers,E,e.isModifierLike),r.name,e.visitParameterList(r.parameters,E,t),z(r))}function w(r){return c.updateFunctionDeclaration(r,e.visitNodes(r.modifiers,E,e.isModifierLike),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?U(r):e.visitFunctionBody(r.body,E,t))}function I(r){return c.updateFunctionExpression(r,e.visitNodes(r.modifiers,E,e.isModifierLike),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?U(r):e.visitFunctionBody(r.body,E,t))}function O(r){return c.updateArrowFunction(r,e.visitNodes(r.modifiers,E,e.isModifierLike),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,2&e.getFunctionFlags(r)?U(r):e.visitFunctionBody(r.body,E,t))}function M(t,r){var n=t.name;if(e.isIdentifier(n))r.add(n.escapedText);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||M(o,r);}}function L(t){return !!t&&e.isVariableDeclarationList(t)&&!(3&t.flags)&&t.declarations.some(J)}function R(t,r){!function(t){e.forEach(t.declarations,B);}(t);var n=e.getInitializedVariables(t);return 0===n.length?r?e.visitNode(c.converters.convertToAssignmentElementTarget(t.declarations[0].name),E,e.isExpression):void 0:c.inlineExpressions(e.map(n,j))}function B(t){var r=t.name;if(e.isIdentifier(r))d(r);else for(var n=0,i=r.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||B(a);}}function j(t){var r=e.setSourceMapRange(c.createAssignment(c.converters.convertToAssignmentElementTarget(t.name),t.initializer),t);return e.visitNode(r,E,e.isExpression)}function J(t){var r=t.name;if(e.isIdentifier(r))return a.has(r.escapedText);for(var n=0,i=r.elements;n<i.length;n++){var o=i[n];if(!e.isOmittedExpression(o)&&J(o))return !0}return !1}function z(r){e.Debug.assertIsDefined(r.body);var n=o,a=s;o=new e.Set,s=!1;var l=e.visitFunctionBody(r.body,E,t),u=e.getOriginalNode(r,e.isFunctionLikeDeclaration);if(g>=2&&6144&p.getNodeCheckFlags(r)&&3!=(3&e.getFunctionFlags(u))){if(V(),o.size){var _=i(c,p,r,o);y[e.getNodeId(_)]=!0;var d=l.statements.slice();e.insertStatementsAfterStandardPrologue(d,[_]),l=c.updateBlock(l,d);}s&&(4096&p.getNodeCheckFlags(r)?e.addEmitHelper(l,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(r)&&e.addEmitHelper(l,e.asyncSuperHelper));}return o=n,s=a,l}function U(t){u();var r=e.getOriginalNode(t,e.isFunctionLike).type,n=g<2?function(t){var r=t&&e.getEntityNameFromTypeNode(t);if(r&&e.isEntityName(r)){var n=p.getTypeReferenceSerializationKind(r);if(n===e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue||n===e.TypeReferenceSerializationKind.Unknown)return r}}(r):void 0,d=216===t.kind,f=0!=(8192&p.getNodeCheckFlags(t)),m=a;a=new e.Set;for(var v=0,h=t.parameters;v<h.length;v++)M(h[v],a);var b,x=o,D=s;if(d||(o=new e.Set,s=!1),d){var T=l().createAwaiterHelper(S(),f,n,K(t.body)),C=_();e.some(C)?(P=c.converters.convertToFunctionBlock(T),b=c.updateBlock(P,e.setTextRange(c.createNodeArray(e.concatenate(C,P.statements)),P.statements))):b=T;}else {var k=[],N=c.copyPrologue(t.body.statements,k,!1,E);k.push(c.createReturnStatement(l().createAwaiterHelper(S(),f,n,K(t.body,N)))),e.insertStatementsAfterStandardPrologue(k,_());var A=g>=2&&6144&p.getNodeCheckFlags(t);if(A&&(V(),o.size)){var F=i(c,p,t,o);y[e.getNodeId(F)]=!0,e.insertStatementsAfterStandardPrologue(k,[F]);}var P=c.createBlock(k,!0);e.setTextRange(P,t.body),A&&s&&(4096&p.getNodeCheckFlags(t)?e.addEmitHelper(P,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(t)&&e.addEmitHelper(P,e.asyncSuperHelper)),b=P;}return a=m,d||(o=x,s=D),b}function K(t,r){return e.isBlock(t)?c.updateBlock(t,e.visitNodes(t.statements,k,e.isStatement,r)):c.converters.convertToFunctionBlock(e.visitNode(t,k,e.isConciseBody))}function V(){0==(1&r)&&(r|=1,t.enableSubstitution(210),t.enableSubstitution(208),t.enableSubstitution(209),t.enableEmitNotification(260),t.enableEmitNotification(171),t.enableEmitNotification(174),t.enableEmitNotification(175),t.enableEmitNotification(173),t.enableEmitNotification(240));}function q(t){return 106===t.expression.kind?e.setTextRange(c.createPropertyAccessExpression(c.createUniqueName("_super",48),t.name),t):t}function W(t){return 106===t.expression.kind?(r=t.argumentExpression,n=t,4096&m?e.setTextRange(c.createPropertyAccessExpression(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),"value"),n):e.setTextRange(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),n)):t;var r,n;}},e.createSuperAccessVariableStatement=i;}(t),function(e){var t,r;!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasLexicalThis=1]="HasLexicalThis",e[e.IterationContainer=2]="IterationContainer",e[e.AncestorFactsMask=3]="AncestorFactsMask",e[e.SourceFileIncludes=1]="SourceFileIncludes",e[e.SourceFileExcludes=2]="SourceFileExcludes",e[e.StrictModeSourceFileIncludes=0]="StrictModeSourceFileIncludes",e[e.ClassOrFunctionIncludes=1]="ClassOrFunctionIncludes",e[e.ClassOrFunctionExcludes=2]="ClassOrFunctionExcludes",e[e.ArrowFunctionIncludes=0]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=2]="ArrowFunctionExcludes",e[e.IterationStatementIncludes=2]="IterationStatementIncludes",e[e.IterationStatementExcludes=0]="IterationStatementExcludes";}(r||(r={})),e.transformES2018=function(t){var r=t.factory,i=t.getEmitHelperFactory,a=t.resumeLexicalEnvironment,o=t.endLexicalEnvironment,s=t.hoistVariableDeclaration,c=t.getEmitResolver(),l=t.getCompilerOptions(),u=e.getEmitScriptTarget(l),_=t.onEmitNode;t.onEmitNode=function(t,r,n){if(1&p&&function(e){var t=e.kind;return 260===t||173===t||171===t||174===t||175===t}(r)){var i=6144&c.getNodeCheckFlags(r);if(i!==x){var a=x;return x=i,_(t,r,n),void(x=a)}}else if(p&&S[e.getNodeId(r)])return a=x,x=0,_(t,r,n),void(x=a);_(t,r,n);};var d=t.onSubstituteNode;t.onSubstituteNode=function(t,i){return i=d(t,i),1===t&&x?function(t){switch(t.kind){case 208:return X(t);case 209:return Y(t);case 210:return function(t){var i=t.expression;if(e.isSuperProperty(i)){var a=e.isPropertyAccessExpression(i)?X(i):Y(i);return r.createCallExpression(r.createPropertyAccessExpression(a,"call"),void 0,n$4([r.createThis()],t.arguments,!0))}return t}(t)}return t}(i):i};var p,f,g,m,y,v,h,b=!1,x=0,D=0,S=[];return e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;m=n;var i=function(n){var i=T(2,e.isEffectiveStrictModeSourceFile(n,l)?0:1);b=!1;var a=e.visitEachChild(n,k,t),o=e.concatenate(a.statements,y&&[r.createVariableStatement(void 0,r.createVariableDeclarationList(y))]),s=r.updateSourceFile(a,e.setTextRange(r.createNodeArray(o),n.statements));return C(i),s}(n);return e.addEmitHelpers(i,t.readEmitHelpers()),m=void 0,y=void 0,i}));function T(e,t){var r=D;return D=3&(D&~e|t),r}function C(e){D=e;}function E(t){y=e.append(y,r.createVariableDeclaration(t));}function k(e){return w(e,!1)}function N(e){return w(e,!0)}function A(e){if(132!==e.kind)return e}function F(e,t,r,n){if(function(e,t){return D!==(D&~e|t)}(r,n)){var i=T(r,n),a=e(t);return C(i),a}return e(t)}function P(r){return e.visitEachChild(r,k,t)}function w(a,o){if(0==(128&a.transformFlags))return a;switch(a.kind){case 220:return function(n){return 2&f&&1&f?e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(e.visitNode(n.expression,k,e.isExpression))),n),n):e.visitEachChild(n,k,t)}(a);case 226:return function(n){if(2&f&&1&f){if(n.asteriskToken){var a=e.visitNode(e.Debug.checkDefined(n.expression),k,e.isExpression);return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(r.updateYieldExpression(n,n.asteriskToken,e.setTextRange(i().createAsyncDelegatorHelper(e.setTextRange(i().createAsyncValuesHelper(a),a)),a)))),n),n)}return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,L(n.expression?e.visitNode(n.expression,k,e.isExpression):r.createVoidZero())),n),n)}return e.visitEachChild(n,k,t)}(a);case 250:return function(n){return 2&f&&1&f?r.updateReturnStatement(n,L(n.expression?e.visitNode(n.expression,k,e.isExpression):r.createVoidZero())):e.visitEachChild(n,k,t)}(a);case 253:return function(n){if(2&f){var i=e.unwrapInnermostStatementOfLabel(n);return 247===i.kind&&i.awaitModifier?M(i,n):r.restoreEnclosingLabel(e.visitNode(i,k,e.isStatement,r.liftToBlock),n)}return e.visitEachChild(n,k,t)}(a);case 207:return function(n){if(65536&n.transformFlags){var a=function(t){for(var n,i=[],a=0,o=t;a<o.length;a++){var s=o[a];if(301===s.kind){n&&(i.push(r.createObjectLiteralExpression(n)),n=void 0);var c=s.expression;i.push(e.visitNode(c,k,e.isExpression));}else n=e.append(n,299===s.kind?r.createPropertyAssignment(s.name,e.visitNode(s.initializer,k,e.isExpression)):e.visitNode(s,k,e.isObjectLiteralElementLike));}return n&&i.push(r.createObjectLiteralExpression(n)),i}(n.properties);a.length&&207!==a[0].kind&&a.unshift(r.createObjectLiteralExpression());var o=a[0];if(a.length>1){for(var s=1;s<a.length;s++)o=i().createAssignHelper([o,a[s]]);return o}return i().createAssignHelper(a)}return e.visitEachChild(n,k,t)}(a);case 223:return function(n,i){return e.isDestructuringAssignment(n)&&65536&n.left.transformFlags?e.flattenDestructuringAssignment(n,k,t,1,!i):27===n.operatorToken.kind?r.updateBinaryExpression(n,e.visitNode(n.left,N,e.isExpression),n.operatorToken,e.visitNode(n.right,i?N:k,e.isExpression)):e.visitEachChild(n,k,t)}(a,o);case 354:return function(n,i){if(i)return e.visitEachChild(n,N,t);for(var a,o=0;o<n.elements.length;o++){var s=n.elements[o],c=e.visitNode(s,o<n.elements.length-1?N:k,e.isExpression);(a||c!==s)&&(a||(a=n.elements.slice(0,o)),a.push(c));}var l=a?e.setTextRange(r.createNodeArray(a),n.elements):n.elements;return r.updateCommaListExpression(n,l)}(a,o);case 295:return function(i){if(i.variableDeclaration&&e.isBindingPattern(i.variableDeclaration.name)&&65536&i.variableDeclaration.name.transformFlags){var a=r.getGeneratedNameForNode(i.variableDeclaration.name),o=r.updateVariableDeclaration(i.variableDeclaration,i.variableDeclaration.name,void 0,void 0,a),s=e.flattenDestructuringBinding(o,k,t,1),c=e.visitNode(i.block,k,e.isBlock);return e.some(s)&&(c=r.updateBlock(c,n$4([r.createVariableStatement(void 0,s)],c.statements,!0))),r.updateCatchClause(i,r.updateVariableDeclaration(i.variableDeclaration,a,void 0,void 0,void 0),c)}return e.visitEachChild(i,k,t)}(a);case 240:return function(r){if(e.hasSyntacticModifier(r,1)){var n=b;b=!0;var i=e.visitEachChild(r,k,t);return b=n,i}return e.visitEachChild(r,k,t)}(a);case 257:return function(e){if(b){var t=b;b=!1;var r=I(e,!0);return b=t,r}return I(e,!1)}(a);case 243:case 244:case 246:return F(P,a,0,2);case 247:return M(a,void 0);case 245:return F(O,a,0,2);case 219:case 241:return function(r){return e.visitEachChild(r,N,t)}(a);case 173:return F(J,a,2,1);case 171:return F(K,a,2,1);case 174:return F(z,a,2,1);case 175:return F(U,a,2,1);case 259:return F(V,a,2,1);case 215:return F(W,a,2,1);case 216:return F(q,a,2,0);case 166:return B(a);case 214:return function(r,n){return e.visitEachChild(r,n?N:k,t)}(a,o);case 212:return function(r){return e.processTaggedTemplateExpression(t,r,k,m,E,e.ProcessLevel.LiftRestriction)}(a);case 208:return v&&e.isPropertyAccessExpression(a)&&106===a.expression.kind&&v.add(a.name.escapedText),e.visitEachChild(a,k,t);case 209:return v&&106===a.expression.kind&&(h=!0),e.visitEachChild(a,k,t);case 260:case 228:return F(P,a,2,1);default:return e.visitEachChild(a,k,t)}}function I(r,n){return e.isBindingPattern(r.name)&&65536&r.name.transformFlags?e.flattenDestructuringBinding(r,k,t,1,void 0,n):e.visitEachChild(r,k,t)}function O(n){return r.updateForStatement(n,e.visitNode(n.initializer,N,e.isForInitializer),e.visitNode(n.condition,k,e.isExpression),e.visitNode(n.incrementor,N,e.isExpression),e.visitIterationBody(n.statement,k,t))}function M(n,a){var o=T(0,2);65536&n.initializer.transformFlags&&(n=function(t){var n=e.skipParentheses(t.initializer);if(e.isVariableDeclarationList(n)||e.isAssignmentPattern(n)){var i=void 0,a=void 0,o=r.createTempVariable(void 0),s=[e.createForOfBindingStatement(r,n,o)];return e.isBlock(t.statement)?(e.addRange(s,t.statement.statements),i=t.statement,a=t.statement.statements):t.statement&&(e.append(s,t.statement),i=t.statement,a=t.statement),r.updateForOfStatement(t,t.awaitModifier,e.setTextRange(r.createVariableDeclarationList([e.setTextRange(r.createVariableDeclaration(o),t.initializer)],1),t.initializer),t.expression,e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(s),a),!0),i))}return t}(n));var c=n.awaitModifier?function(n,a,o){var c=e.visitNode(n.expression,k,e.isExpression),l=e.isIdentifier(c)?r.getGeneratedNameForNode(c):r.createTempVariable(void 0),u=e.isIdentifier(c)?r.getGeneratedNameForNode(l):r.createTempVariable(void 0),_=r.createTempVariable(void 0),d=r.createTempVariable(s),p=r.createUniqueName("e"),f=r.getGeneratedNameForNode(p),g=r.createTempVariable(void 0),m=e.setTextRange(i().createAsyncValuesHelper(c),n.expression),y=r.createCallExpression(r.createPropertyAccessExpression(l,"next"),void 0,[]),v=r.createPropertyAccessExpression(u,"done"),h=r.createPropertyAccessExpression(u,"value"),b=r.createFunctionCallCall(g,l,[]);s(p),s(g);var x=2&o?r.inlineExpressions([r.createAssignment(p,r.createVoidZero()),m]):m,D=e.setEmitFlags(e.setTextRange(r.createForStatement(e.setEmitFlags(e.setTextRange(r.createVariableDeclarationList([r.createVariableDeclaration(_,void 0,void 0,r.createTrue()),e.setTextRange(r.createVariableDeclaration(l,void 0,void 0,x),n.expression),r.createVariableDeclaration(u)]),n.expression),2097152),r.inlineExpressions([r.createAssignment(u,L(y)),r.createAssignment(d,v),r.createLogicalNot(d)]),void 0,function(n,i,a){var o=r.createTempVariable(s),c=r.createAssignment(o,i),l=r.createExpressionStatement(c);e.setSourceMapRange(l,n.expression);var u=r.createAssignment(a,r.createFalse()),_=r.createExpressionStatement(u);e.setSourceMapRange(_,n.expression);var d=r.createAssignment(a,r.createTrue()),p=r.createExpressionStatement(d);e.setSourceMapRange(_,n.expression);var f,g,m=[],y=e.createForOfBindingStatement(r,n.initializer,o);m.push(e.visitNode(y,k,e.isStatement));var v=e.visitIterationBody(n.statement,k,t);e.isBlock(v)?(e.addRange(m,v.statements),f=v,g=v.statements):m.push(v);var h=e.setEmitFlags(e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(m),g),!0),f),432);return r.createBlock([l,_,r.createTryStatement(h,void 0,r.createBlock([p]))])}(n,h,_)),n),256);return e.setOriginalNode(D,n),r.createTryStatement(r.createBlock([r.restoreEnclosingLabel(D,a)]),r.createCatchClause(r.createVariableDeclaration(f),e.setEmitFlags(r.createBlock([r.createExpressionStatement(r.createAssignment(p,r.createObjectLiteralExpression([r.createPropertyAssignment("error",f)])))]),1)),r.createBlock([r.createTryStatement(r.createBlock([e.setEmitFlags(r.createIfStatement(r.createLogicalAnd(r.createLogicalAnd(r.createLogicalNot(_),r.createLogicalNot(d)),r.createAssignment(g,r.createPropertyAccessExpression(l,"return"))),r.createExpressionStatement(L(b))),1)]),void 0,e.setEmitFlags(r.createBlock([e.setEmitFlags(r.createIfStatement(p,r.createThrowStatement(r.createPropertyAccessExpression(p,"error"))),1)]),1))]))}(n,a,o):r.restoreEnclosingLabel(e.visitEachChild(n,k,t),a);return C(o),c}function L(e){return 1&f?r.createYieldExpression(void 0,i().createAwaitHelper(e)):r.createAwaitExpression(e)}function R(t){return e.Debug.assertNode(t,e.isParameter),B(t)}function B(n){return (null==g?void 0:g.has(n))?r.updateParameterDeclaration(n,void 0,n.dotDotDotToken,e.isBindingPattern(n.name)?r.getGeneratedNameForNode(n):n.name,void 0,void 0,void 0):65536&n.transformFlags?r.updateParameterDeclaration(n,void 0,n.dotDotDotToken,r.getGeneratedNameForNode(n),void 0,void 0,e.visitNode(n.initializer,k,e.isExpression)):e.visitEachChild(n,k,t)}function j(t){for(var r,n=0,i=t.parameters;n<i.length;n++){var a=i[n];r?r.add(a):65536&a.transformFlags&&(r=new e.Set);}return r}function J(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateConstructorDeclaration(n,n.modifiers,e.visitParameterList(n.parameters,R,t),G(n));return f=i,g=a,o}function z(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateGetAccessorDeclaration(n,n.modifiers,e.visitNode(n.name,k,e.isPropertyName),e.visitParameterList(n.parameters,R,t),void 0,G(n));return f=i,g=a,o}function U(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateSetAccessorDeclaration(n,n.modifiers,e.visitNode(n.name,k,e.isPropertyName),e.visitParameterList(n.parameters,R,t),G(n));return f=i,g=a,o}function K(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateMethodDeclaration(n,1&f?e.visitNodes(n.modifiers,A,e.isModifierLike):n.modifiers,2&f?void 0:n.asteriskToken,e.visitNode(n.name,k,e.isPropertyName),e.visitNode(void 0,k,e.isToken),void 0,e.visitParameterList(n.parameters,R,t),void 0,2&f&&1&f?H(n):G(n));return f=i,g=a,o}function V(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateFunctionDeclaration(n,1&f?e.visitNodes(n.modifiers,A,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,R,t),void 0,2&f&&1&f?H(n):G(n));return f=i,g=a,o}function q(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateArrowFunction(n,n.modifiers,void 0,e.visitParameterList(n.parameters,R,t),void 0,n.equalsGreaterThanToken,G(n));return f=i,g=a,o}function W(n){var i=f,a=g;f=e.getFunctionFlags(n),g=j(n);var o=r.updateFunctionExpression(n,1&f?e.visitNodes(n.modifiers,A,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,R,t),void 0,2&f&&1&f?H(n):G(n));return f=i,g=a,o}function H(n){a();var s=[],l=r.copyPrologue(n.body.statements,s,!1,k);Q(s,n);var _=v,d=h;v=new e.Set,h=!1;var f=r.createReturnStatement(i().createAsyncGeneratorHelper(r.createFunctionExpression(void 0,r.createToken(41),n.name&&r.getGeneratedNameForNode(n.name),void 0,[],void 0,r.updateBlock(n.body,e.visitLexicalEnvironment(n.body.statements,k,t,l))),!!(1&D))),g=u>=2&&6144&c.getNodeCheckFlags(n);if(g){0==(1&p)&&(p|=1,t.enableSubstitution(210),t.enableSubstitution(208),t.enableSubstitution(209),t.enableEmitNotification(260),t.enableEmitNotification(171),t.enableEmitNotification(174),t.enableEmitNotification(175),t.enableEmitNotification(173),t.enableEmitNotification(240));var m=e.createSuperAccessVariableStatement(r,c,n,v);S[e.getNodeId(m)]=!0,e.insertStatementsAfterStandardPrologue(s,[m]);}s.push(f),e.insertStatementsAfterStandardPrologue(s,o());var y=r.updateBlock(n.body,s);return g&&h&&(4096&c.getNodeCheckFlags(n)?e.addEmitHelper(y,e.advancedAsyncSuperHelper):2048&c.getNodeCheckFlags(n)&&e.addEmitHelper(y,e.asyncSuperHelper)),v=_,h=d,y}function G(t){var n;a();var i=0,s=[],c=null!==(n=e.visitNode(t.body,k,e.isConciseBody))&&void 0!==n?n:r.createBlock([]);e.isBlock(c)&&(i=r.copyPrologue(c.statements,s,!1,k)),e.addRange(s,Q(void 0,t));var l=o();if(i>0||e.some(s)||e.some(l)){var u=r.converters.convertToFunctionBlock(c,!0);return e.insertStatementsAfterStandardPrologue(s,l),e.addRange(s,u.statements.slice(i)),r.updateBlock(u,e.setTextRange(r.createNodeArray(s),u.statements))}return c}function Q(n,i){for(var a=!1,o=0,s=i.parameters;o<s.length;o++){var c=s[o];if(a){if(e.isBindingPattern(c.name)){if(c.name.elements.length>0){var l=e.flattenDestructuringBinding(c,k,t,0,r.getGeneratedNameForNode(c));if(e.some(l)){var u=r.createVariableDeclarationList(l),_=r.createVariableStatement(void 0,u);e.setEmitFlags(_,1048576),n=e.append(n,_);}}else if(c.initializer){var d=r.getGeneratedNameForNode(c),p=e.visitNode(c.initializer,k,e.isExpression),f=r.createAssignment(d,p);_=r.createExpressionStatement(f),e.setEmitFlags(_,1048576),n=e.append(n,_);}}else if(c.initializer){d=r.cloneNode(c.name),e.setTextRange(d,c.name),e.setEmitFlags(d,48),p=e.visitNode(c.initializer,k,e.isExpression),e.addEmitFlags(p,1584),f=r.createAssignment(d,p),e.setTextRange(f,c),e.setEmitFlags(f,1536);var g=r.createBlock([r.createExpressionStatement(f)]);e.setTextRange(g,c),e.setEmitFlags(g,1953);var m=r.createTypeCheck(r.cloneNode(c.name),"undefined");_=r.createIfStatement(m,g),e.startOnNewLine(_),e.setTextRange(_,c),e.setEmitFlags(_,1050528),n=e.append(n,_);}}else 65536&c.transformFlags&&(a=!0,l=e.flattenDestructuringBinding(c,k,t,1,r.getGeneratedNameForNode(c),!1,!0),e.some(l)&&(u=r.createVariableDeclarationList(l),_=r.createVariableStatement(void 0,u),e.setEmitFlags(_,1048576),n=e.append(n,_)));}return n}function X(t){return 106===t.expression.kind?e.setTextRange(r.createPropertyAccessExpression(r.createUniqueName("_super",48),t.name),t):t}function Y(t){return 106===t.expression.kind?(n=t.argumentExpression,i=t,4096&x?e.setTextRange(r.createPropertyAccessExpression(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),"value"),i):e.setTextRange(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),i)):t;var n,i;}};}(t),function(e){e.transformES2019=function(t){var r=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,n,t)}));function n(i){return 0==(64&i.transformFlags)?i:295===i.kind?function(i){return i.variableDeclaration?e.visitEachChild(i,n,t):r.updateCatchClause(i,r.createVariableDeclaration(r.createTempVariable(void 0)),e.visitNode(i.block,n,e.isBlock))}(i):e.visitEachChild(i,n,t)}};}(t),function(e){e.transformES2020=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(32&a.transformFlags))return a;switch(a.kind){case 210:var u=o(a,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u;case 208:case 209:return e.isOptionalChain(a)?(u=c(a,!1,!1),e.Debug.assertNotNode(u,e.isSyntheticReference),u):e.visitEachChild(a,i,t);case 223:return 60===a.operatorToken.kind?function(t){var a=e.visitNode(t.left,i,e.isExpression),o=a;return e.isSimpleCopiableExpression(a)||(o=r.createTempVariable(n),a=r.createAssignment(o,a)),e.setTextRange(r.createConditionalExpression(l(a,o),void 0,o,void 0,e.visitNode(t.right,i,e.isExpression)),t)}(a):e.visitEachChild(a,i,t);case 217:return function(t){return e.isOptionalChain(e.skipParentheses(t.expression))?e.setOriginalNode(s(t.expression,!1,!0),t):r.updateDeleteExpression(t,e.visitNode(t.expression,i,e.isExpression))}(a);default:return e.visitEachChild(a,i,t)}}function a(t,n,i){var a=s(t.expression,n,i);return e.isSyntheticReference(a)?r.createSyntheticReferenceExpression(r.updateParenthesizedExpression(t,a.expression),a.thisArg):r.updateParenthesizedExpression(t,a)}function o(n,o){if(e.isOptionalChain(n))return c(n,o,!1);if(e.isParenthesizedExpression(n.expression)&&e.isOptionalChain(e.skipParentheses(n.expression))){var s=a(n.expression,!0,!1),l=e.visitNodes(n.arguments,i,e.isExpression);return e.isSyntheticReference(s)?e.setTextRange(r.createFunctionCallCall(s.expression,s.thisArg,l),n):r.updateCallExpression(n,s,void 0,l)}return e.visitEachChild(n,i,t)}function s(t,s,l){switch(t.kind){case 214:return a(t,s,l);case 208:case 209:return function(t,a,o){if(e.isOptionalChain(t))return c(t,a,o);var s,l=e.visitNode(t.expression,i,e.isExpression);return e.Debug.assertNotNode(l,e.isSyntheticReference),a&&(e.isSimpleCopiableExpression(l)?s=l:(s=r.createTempVariable(n),l=r.createAssignment(s,l))),l=208===t.kind?r.updatePropertyAccessExpression(t,l,e.visitNode(t.name,i,e.isIdentifier)):r.updateElementAccessExpression(t,l,e.visitNode(t.argumentExpression,i,e.isExpression)),s?r.createSyntheticReferenceExpression(l,s):l}(t,s,l);case 210:return o(t,s);default:return e.visitNode(t,i,e.isExpression)}}function c(t,a,o){var c=function(t){e.Debug.assertNotNode(t,e.isNonNullChain);for(var r=[t];!t.questionDotToken&&!e.isTaggedTemplateExpression(t);)t=e.cast(e.skipPartiallyEmittedExpressions(t.expression),e.isOptionalChain),e.Debug.assertNotNode(t,e.isNonNullChain),r.unshift(t);return {expression:t.expression,chain:r}}(t),u=c.expression,_=c.chain,d=s(e.skipPartiallyEmittedExpressions(u),e.isCallChain(_[0]),!1),p=e.isSyntheticReference(d)?d.thisArg:void 0,f=e.isSyntheticReference(d)?d.expression:d,g=r.restoreOuterExpressions(u,f,8);e.isSimpleCopiableExpression(f)||(f=r.createTempVariable(n),g=r.createAssignment(f,g));for(var m,y=f,v=0;v<_.length;v++){var h=_[v];switch(h.kind){case 208:case 209:v===_.length-1&&a&&(e.isSimpleCopiableExpression(y)?m=y:(m=r.createTempVariable(n),y=r.createAssignment(m,y))),y=208===h.kind?r.createPropertyAccessExpression(y,e.visitNode(h.name,i,e.isIdentifier)):r.createElementAccessExpression(y,e.visitNode(h.argumentExpression,i,e.isExpression));break;case 210:0===v&&p?(e.isGeneratedIdentifier(p)||(p=r.cloneNode(p),e.addEmitFlags(p,1536)),y=r.createFunctionCallCall(y,106===p.kind?r.createThis():p,e.visitNodes(h.arguments,i,e.isExpression))):y=r.createCallExpression(y,void 0,e.visitNodes(h.arguments,i,e.isExpression));}e.setOriginalNode(y,h);}var b=o?r.createConditionalExpression(l(g,f,!0),void 0,r.createTrue(),void 0,r.createDeleteExpression(y)):r.createConditionalExpression(l(g,f,!0),void 0,r.createVoidZero(),void 0,y);return e.setTextRange(b,t),m?r.createSyntheticReferenceExpression(b,m):b}function l(e,t,n){return r.createBinaryExpression(r.createBinaryExpression(e,r.createToken(n?36:37),r.createNull()),r.createToken(n?56:55),r.createBinaryExpression(t,r.createToken(n?36:37),r.createVoidZero()))}};}(t),function(e){e.transformES2021=function(t){var r=t.hoistVariableDeclaration,n=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(16&a.transformFlags))return a;if(223===a.kind){var o=a;if(e.isLogicalOrCoalescingAssignmentExpression(o))return function(t){var a=t.operatorToken,o=e.getNonAssignmentOperatorForCompoundAssignment(a.kind),s=e.skipParentheses(e.visitNode(t.left,i,e.isLeftHandSideExpression)),c=s,l=e.skipParentheses(e.visitNode(t.right,i,e.isExpression));if(e.isAccessExpression(s)){var u=e.isSimpleCopiableExpression(s.expression),_=u?s.expression:n.createTempVariable(r),d=u?s.expression:n.createAssignment(_,s.expression);if(e.isPropertyAccessExpression(s))c=n.createPropertyAccessExpression(_,s.name),s=n.createPropertyAccessExpression(d,s.name);else {var p=e.isSimpleCopiableExpression(s.argumentExpression),f=p?s.argumentExpression:n.createTempVariable(r);c=n.createElementAccessExpression(_,f),s=n.createElementAccessExpression(d,p?s.argumentExpression:n.createAssignment(f,s.argumentExpression));}}return n.createBinaryExpression(s,o,n.createParenthesizedExpression(n.createAssignment(c,l)))}(o)}return e.visitEachChild(a,i,t)}};}(t),function(e){e.transformESNext=function(t){return e.chainBundle(t,(function(n){return n.isDeclarationFile?n:e.visitEachChild(n,r,t)}));function r(n){return 0==(4&n.transformFlags)?n:(e.visitEachChild(n,r,t))}};}(t),function(e){e.transformJsx=function(r){var n,i,a=r.factory,o=r.getEmitHelperFactory,s=r.getCompilerOptions();return e.chainBundle(r,(function(t){if(t.isDeclarationFile)return t;n=t,(i={}).importSpecifier=e.getJSXImplicitImportBase(s,t);var o=e.visitEachChild(t,u,r);e.addEmitHelpers(o,r.readEmitHelpers());var c=o.statements;if(i.filenameDeclaration&&(c=e.insertStatementAfterCustomPrologue(c.slice(),a.createVariableStatement(void 0,a.createVariableDeclarationList([i.filenameDeclaration],2)))),i.utilizedImplicitRuntimeImports)for(var l=0,_=e.arrayFrom(i.utilizedImplicitRuntimeImports.entries());l<_.length;l++){var d=_[l],p=d[0],f=d[1];if(e.isExternalModule(t)){var g=a.createImportDeclaration(void 0,a.createImportClause(!1,void 0,a.createNamedImports(e.arrayFrom(f.values()))),a.createStringLiteral(p),void 0);e.setParentRecursive(g,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),g);}else if(e.isExternalOrCommonJsModule(t)){var m=a.createVariableStatement(void 0,a.createVariableDeclarationList([a.createVariableDeclaration(a.createObjectBindingPattern(e.map(e.arrayFrom(f.values()),(function(e){return a.createBindingElement(void 0,e.propertyName,e.name)}))),void 0,void 0,a.createCallExpression(a.createIdentifier("require"),void 0,[a.createStringLiteral(p)]))],2));e.setParentRecursive(m,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),m);}}return c!==o.statements&&(o=a.updateSourceFile(o,c)),i=void 0,o}));function c(){if(i.filenameDeclaration)return i.filenameDeclaration.name;var e=a.createVariableDeclaration(a.createUniqueName("_jsxFileName",48),void 0,void 0,a.createStringLiteral(n.fileName));return i.filenameDeclaration=e,i.filenameDeclaration.name}function l(t){var r,n,o="createElement"===t?i.importSpecifier:e.getJSXRuntimeImport(i.importSpecifier,s),c=null===(n=null===(r=i.utilizedImplicitRuntimeImports)||void 0===r?void 0:r.get(o))||void 0===n?void 0:n.get(t);if(c)return c.name;i.utilizedImplicitRuntimeImports||(i.utilizedImplicitRuntimeImports=new e.Map);var l=i.utilizedImplicitRuntimeImports.get(o);l||(l=new e.Map,i.utilizedImplicitRuntimeImports.set(o,l));var u=a.createUniqueName("_".concat(t),112),_=a.createImportSpecifier(!1,a.createIdentifier(t),u);return u.generatedImportReference=_,l.set(t,_),u}function u(t){return 2&t.transformFlags?function(t){switch(t.kind){case 281:return p(t,!1);case 282:return f(t,!1);case 285:return g(t,!1);case 291:return A(t);default:return e.visitEachChild(t,u,r)}}(t):t}function _(t){switch(t.kind){case 11:return function(t){var r=function(t){for(var r,n=0,i=-1,a=0;a<t.length;a++){var o=t.charCodeAt(a);e.isLineBreak(o)?(-1!==n&&-1!==i&&(r=E(r,t.substr(n,i-n+1))),n=-1):e.isWhiteSpaceSingleLine(o)||(i=a,-1===n&&(n=a));}return -1!==n?E(r,t.substr(n)):r}(t.text);return void 0===r?void 0:a.createStringLiteral(r)}(t);case 291:return A(t);case 281:return p(t,!0);case 282:return f(t,!0);case 285:return g(t,!0);default:return e.Debug.failBadSyntaxKind(t)}}function d(t){return void 0===i.importSpecifier||function(t){for(var r=!1,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(e.isJsxSpreadAttribute(a))r=!0;else if(r&&e.isJsxAttribute(a)&&"key"===a.name.escapedText)return !0}return !1}(t)}function p(e,t){return (d(e.openingElement)?h:y)(e.openingElement,e.children,t,e)}function f(e,t){return (d(e)?h:y)(e,void 0,t,e)}function g(e,t){return (void 0===i.importSpecifier?x:b)(e.openingFragment,e.children,t,e)}function m(t){var r=e.getSemanticJsxChildren(t);if(1===e.length(r)&&!r[0].dotDotDotToken){var n=_(r[0]);return n&&a.createPropertyAssignment("children",n)}var i=e.mapDefined(t,_);return e.length(i)?a.createPropertyAssignment("children",a.createArrayLiteralExpression(i)):void 0}function y(t,r,n,i){var o=N(t),s=r&&r.length?m(r):void 0,c=e.find(t.attributes.properties,(function(t){return !!t.name&&e.isIdentifier(t.name)&&"key"===t.name.escapedText})),l=c?e.filter(t.attributes.properties,(function(e){return e!==c})):t.attributes.properties;return v(o,e.length(l)?D(l,s):a.createObjectLiteralExpression(s?[s]:e.emptyArray),c,r||e.emptyArray,n,i)}function v(t,r,i,o,u,_){var d,p=e.getSemanticJsxChildren(o),f=e.length(p)>1||!!(null===(d=p[0])||void 0===d?void 0:d.dotDotDotToken),g=[t,r];if(i&&g.push(C(i.initializer)),5===s.jsx){var m=e.getOriginalNode(n);if(m&&e.isSourceFile(m)){void 0===i&&g.push(a.createVoidZero()),g.push(f?a.createTrue():a.createFalse());var y=e.getLineAndCharacterOfPosition(m,_.pos);g.push(a.createObjectLiteralExpression([a.createPropertyAssignment("fileName",c()),a.createPropertyAssignment("lineNumber",a.createNumericLiteral(y.line+1)),a.createPropertyAssignment("columnNumber",a.createNumericLiteral(y.character+1))])),g.push(a.createThis());}}var v=e.setTextRange(a.createCallExpression(function(e){var t=function(e){return 5===s.jsx?"jsxDEV":e?"jsxs":"jsx"}(e);return l(t)}(f),void 0,g),_);return u&&e.startOnNewLine(v),v}function h(t,o,c,u){var d=N(t),p=t.attributes.properties,f=e.length(p)?D(p):a.createNull(),g=void 0===i.importSpecifier?e.createJsxFactoryExpression(a,r.getEmitResolver().getJsxFactoryEntity(n),s.reactNamespace,t):l("createElement"),m=e.createExpressionForJsxElement(a,g,d,f,e.mapDefined(o,_),u);return c&&e.startOnNewLine(m),m}function b(e,t,r,n){var i;if(t&&t.length){var o=function(e){var t=m(e);return t&&a.createObjectLiteralExpression([t])}(t);o&&(i=o);}return v(l("Fragment"),i||a.createObjectLiteralExpression([]),void 0,t,r,n)}function x(t,i,o,c){var l=e.createExpressionForJsxFragment(a,r.getEmitResolver().getJsxFactoryEntity(n),r.getEmitResolver().getJsxFragmentFactoryEntity(n),s.reactNamespace,e.mapDefined(i,_),t,c);return o&&e.startOnNewLine(l),l}function D(t,r){var n=e.getEmitScriptTarget(s);return n&&n>=5?a.createObjectLiteralExpression(function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return e.map(t,(function(t){return r?(n=t,a.createSpreadAssignment(e.visitNode(n.expression,u,e.isExpression))):T(t);var n;}))})));return r&&n.push(r),n}(t,r)):function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return r?e.map(t,S):a.createObjectLiteralExpression(e.map(t,T))})));return e.isJsxSpreadAttribute(t[0])&&n.unshift(a.createObjectLiteralExpression()),r&&n.push(a.createObjectLiteralExpression([r])),e.singleOrUndefined(n)||o().createAssignHelper(n)}(t,r)}function S(t){return e.visitNode(t.expression,u,e.isExpression)}function T(t){var r=function(t){var r=t.name,n=e.idText(r);return /^[A-Za-z_]\w*$/.test(n)?r:a.createStringLiteral(n)}(t),n=C(t.initializer);return a.createPropertyAssignment(r,n)}function C(t){if(void 0===t)return a.createTrue();if(10===t.kind){var r=void 0!==t.singleQuote?t.singleQuote:!e.isStringDoubleQuoted(t,n),i=a.createStringLiteral(((s=k(o=t.text))===o?void 0:s)||t.text,r);return e.setTextRange(i,t)}var o,s;return 291===t.kind?void 0===t.expression?a.createTrue():e.visitNode(t.expression,u,e.isExpression):e.isJsxElement(t)?p(t,!1):e.isJsxSelfClosingElement(t)?f(t,!1):e.isJsxFragment(t)?g(t,!1):e.Debug.failBadSyntaxKind(t)}function E(e,t){var r=k(t);return void 0===e?r:e+" "+r}function k(r){return r.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(function(r,n,i,a,o,s,c){if(o)return e.utf16EncodeAsString(parseInt(o,10));if(s)return e.utf16EncodeAsString(parseInt(s,16));var l=t.get(c);return l?e.utf16EncodeAsString(l):r}))}function N(t){if(281===t.kind)return N(t.openingElement);var r=t.tagName;return e.isIdentifier(r)&&e.isIntrinsicJsxName(r.escapedText)?a.createStringLiteral(e.idText(r)):e.createExpressionFromEntityName(a,r)}function A(t){var r=e.visitNode(t.expression,u,e.isExpression);return t.dotDotDotToken?a.createSpreadElement(r):r}};var t=new e.Map(e.getEntries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}));}(t),function(e){e.transformES2016=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){return 0==(512&a.transformFlags)?a:223===a.kind?function(a){switch(a.operatorToken.kind){case 67:return function(t){var a,o,s=e.visitNode(t.left,i,e.isExpression),c=e.visitNode(t.right,i,e.isExpression);if(e.isElementAccessExpression(s)){var l=r.createTempVariable(n),u=r.createTempVariable(n);a=e.setTextRange(r.createElementAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),e.setTextRange(r.createAssignment(u,s.argumentExpression),s.argumentExpression)),s),o=e.setTextRange(r.createElementAccessExpression(l,u),s);}else e.isPropertyAccessExpression(s)?(l=r.createTempVariable(n),a=e.setTextRange(r.createPropertyAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),s.name),s),o=e.setTextRange(r.createPropertyAccessExpression(l,s.name),s)):(a=s,o=s);return e.setTextRange(r.createAssignment(a,e.setTextRange(r.createGlobalMethodCall("Math","pow",[o,c]),t)),t)}(a);case 42:return function(t){var n=e.visitNode(t.left,i,e.isExpression),a=e.visitNode(t.right,i,e.isExpression);return e.setTextRange(r.createGlobalMethodCall("Math","pow",[n,a]),t)}(a);default:return e.visitEachChild(a,i,t)}}(a):e.visitEachChild(a,i,t)}};}(t),function(e){var t,r,i,a,o,s;function c(e,t){return {kind:e,expression:t}}!function(e){e[e.CapturedThis=1]="CapturedThis",e[e.BlockScopedBindings=2]="BlockScopedBindings";}(t||(t={})),function(e){e[e.Body=1]="Body",e[e.Initializer=2]="Initializer";}(r||(r={})),function(e){e[e.ToOriginal=0]="ToOriginal",e[e.ToOutParameter=1]="ToOutParameter";}(i||(i={})),function(e){e[e.Break=2]="Break",e[e.Continue=4]="Continue",e[e.Return=8]="Return";}(a||(a={})),function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.ArrowFunction=2]="ArrowFunction",e[e.AsyncFunctionBody=4]="AsyncFunctionBody",e[e.NonStaticClassElement=8]="NonStaticClassElement",e[e.CapturesThis=16]="CapturesThis",e[e.ExportedVariableStatement=32]="ExportedVariableStatement",e[e.TopLevel=64]="TopLevel",e[e.Block=128]="Block",e[e.IterationStatement=256]="IterationStatement",e[e.IterationStatementBlock=512]="IterationStatementBlock",e[e.IterationContainer=1024]="IterationContainer",e[e.ForStatement=2048]="ForStatement",e[e.ForInOrForOfStatement=4096]="ForInOrForOfStatement",e[e.ConstructorWithCapturedSuper=8192]="ConstructorWithCapturedSuper",e[e.StaticInitializer=16384]="StaticInitializer",e[e.AncestorFactsMask=32767]="AncestorFactsMask",e[e.BlockScopeIncludes=0]="BlockScopeIncludes",e[e.BlockScopeExcludes=7104]="BlockScopeExcludes",e[e.SourceFileIncludes=64]="SourceFileIncludes",e[e.SourceFileExcludes=8064]="SourceFileExcludes",e[e.FunctionIncludes=65]="FunctionIncludes",e[e.FunctionExcludes=32670]="FunctionExcludes",e[e.AsyncFunctionBodyIncludes=69]="AsyncFunctionBodyIncludes",e[e.AsyncFunctionBodyExcludes=32662]="AsyncFunctionBodyExcludes",e[e.ArrowFunctionIncludes=66]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=15232]="ArrowFunctionExcludes",e[e.ConstructorIncludes=73]="ConstructorIncludes",e[e.ConstructorExcludes=32662]="ConstructorExcludes",e[e.DoOrWhileStatementIncludes=1280]="DoOrWhileStatementIncludes",e[e.DoOrWhileStatementExcludes=0]="DoOrWhileStatementExcludes",e[e.ForStatementIncludes=3328]="ForStatementIncludes",e[e.ForStatementExcludes=5056]="ForStatementExcludes",e[e.ForInOrForOfStatementIncludes=5376]="ForInOrForOfStatementIncludes",e[e.ForInOrForOfStatementExcludes=3008]="ForInOrForOfStatementExcludes",e[e.BlockIncludes=128]="BlockIncludes",e[e.BlockExcludes=6976]="BlockExcludes",e[e.IterationStatementBlockIncludes=512]="IterationStatementBlockIncludes",e[e.IterationStatementBlockExcludes=7104]="IterationStatementBlockExcludes",e[e.StaticInitializerIncludes=16449]="StaticInitializerIncludes",e[e.StaticInitializerExcludes=32670]="StaticInitializerExcludes",e[e.NewTarget=32768]="NewTarget",e[e.CapturedLexicalThis=65536]="CapturedLexicalThis",e[e.SubtreeFactsMask=-32768]="SubtreeFactsMask",e[e.ArrowFunctionSubtreeExcludes=0]="ArrowFunctionSubtreeExcludes",e[e.FunctionSubtreeExcludes=98304]="FunctionSubtreeExcludes";}(o||(o={})),function(e){e[e.None=0]="None",e[e.UnpackedSpread=1]="UnpackedSpread",e[e.PackedSpread=2]="PackedSpread";}(s||(s={})),e.transformES2015=function(t){var r,i,a,o,s,l,u=t.factory,_=t.getEmitHelperFactory,d=t.startLexicalEnvironment,p=t.resumeLexicalEnvironment,f=t.endLexicalEnvironment,g=t.hoistVariableDeclaration,m=t.getCompilerOptions(),y=t.getEmitResolver(),v=t.onSubstituteNode,h=t.onEmitNode;function b(t){o=e.append(o,u.createVariableDeclaration(t));}return t.onEmitNode=function(t,r,n){if(1&l&&e.isFunctionLike(r)){var i=x(32670,8&e.getEmitFlags(r)?81:65);return h(t,r,n),void D(i,0,0)}h(t,r,n);},t.onSubstituteNode=function(t,r){return r=v(t,r),1===t?function(t){switch(t.kind){case 79:return function(t){if(2&l&&!e.isInternalName(t)){var r=y.getReferencedDeclarationWithCollidingName(t);if(r&&(!e.isClassLike(r)||!function(t,r){var n=e.getParseTreeNode(r);if(!n||n===t||n.end<=t.pos||n.pos>=t.end)return !1;for(var i=e.getEnclosingBlockScopeContainer(t);n;){if(n===i||n===t)return !1;if(e.isClassElement(n)&&n.parent===t)return !0;n=n.parent;}return !1}(r,t)))return e.setTextRange(u.getGeneratedNameForNode(e.getNameOfDeclaration(r)),t)}return t}(t);case 108:return function(t){return 1&l&&16&a?e.setTextRange(u.createUniqueName("_this",48),t):t}(t)}return t}(r):e.isIdentifier(r)?function(t){if(2&l&&!e.isInternalName(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r&&function(e){switch(e.parent.kind){case 205:case 260:case 263:case 257:return e.parent.name===e&&y.isDeclarationWithCollidingName(e.parent)}return !1}(r))return e.setTextRange(u.getGeneratedNameForNode(r),t)}return t}(r):r},e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;r=n,i=n.text;var s=function(t){var r=x(8064,64),n=[],i=[];d();var a=u.copyPrologue(t.statements,n,!1,C);return e.addRange(i,e.visitNodes(t.statements,C,e.isStatement,a)),o&&i.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(o))),u.mergeLexicalEnvironment(n,f()),z(n,t),D(r,0,0),u.updateSourceFile(t,e.setTextRange(u.createNodeArray(e.concatenate(n,i)),t.statements))}(n);return e.addEmitHelpers(s,t.readEmitHelpers()),r=void 0,i=void 0,o=void 0,a=0,s}));function x(e,t){var r=a;return a=32767&(a&~e|t),r}function D(e,t,r){a=-32768&(a&~t|r)|e;}function S(e){return 0!=(8192&a)&&250===e.kind&&!e.expression}function T(t){return 0!=(1024&t.transformFlags)||void 0!==s||8192&a&&function(t){return 4194304&t.transformFlags&&(e.isReturnStatement(t)||e.isIfStatement(t)||e.isWithStatement(t)||e.isSwitchStatement(t)||e.isCaseBlock(t)||e.isCaseClause(t)||e.isDefaultClause(t)||e.isTryStatement(t)||e.isCatchClause(t)||e.isLabeledStatement(t)||e.isIterationStatement(t,!1)||e.isBlock(t))}(t)||e.isIterationStatement(t,!1)&&fe(t)||0!=(33554432&e.getEmitFlags(t))}function C(e){return T(e)?A(e,!1):e}function E(e){return T(e)?A(e,!0):e}function k(t){if(T(t)){var r=e.getOriginalNode(t);if(e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)){var n=x(32670,16449),i=A(t,!1);return D(n,98304,0),i}return A(t,!1)}return t}function N(e){return 106===e.kind?Ie(!0):C(e)}function A(i,o){switch(i.kind){case 124:return;case 260:return function(t){var r=u.createVariableDeclaration(u.getLocalName(t,!0),void 0,void 0,w(t));e.setOriginalNode(r,t);var n=[],i=u.createVariableStatement(void 0,u.createVariableDeclarationList([r]));if(e.setOriginalNode(i,t),e.setTextRange(i,t),e.startOnNewLine(i),n.push(i),e.hasSyntacticModifier(t,1)){var a=e.hasSyntacticModifier(t,1024)?u.createExportDefault(u.getLocalName(t)):u.createExternalModuleExport(u.getLocalName(t));e.setOriginalNode(a,i),n.push(a);}var o=e.getEmitFlags(t);return 0==(4194304&o)&&(n.push(u.createEndOfDeclarationMarker(t)),e.setEmitFlags(i,4194304|o)),e.singleOrMany(n)}(i);case 228:return function(e){return w(e)}(i);case 166:return function(t){return t.dotDotDotToken?void 0:e.isBindingPattern(t.name)?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,u.getGeneratedNameForNode(t),void 0,void 0,void 0),t),t):t.initializer?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,t.name,void 0,void 0,void 0),t),t):t}(i);case 259:return function(r){var n=s;s=void 0;var i=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(i,98304,0),s=n,u.updateFunctionDeclaration(r,e.visitNodes(r.modifiers,C,e.isModifier),r.asteriskToken,l,void 0,o,void 0,c)}(i);case 216:return function(r){16384&r.transformFlags&&!(16384&a)&&(a|=65536);var n=s;s=void 0;var i=x(15232,66),o=u.createFunctionExpression(void 0,void 0,void 0,void 0,e.visitParameterList(r.parameters,C,t),void 0,Q(r));return e.setTextRange(o,r),e.setOriginalNode(o,r),e.setEmitFlags(o,8),D(i,0,0),s=n,o}(i);case 215:return function(r){var n=262144&e.getEmitFlags(r)?x(32662,69):x(32670,65),i=s;s=void 0;var o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(n,98304,0),s=i,u.updateFunctionExpression(r,void 0,r.asteriskToken,l,void 0,o,void 0,c)}(i);case 257:return Z(i);case 79:return P(i);case 258:return function(r){if(3&r.flags||524288&r.transformFlags){3&r.flags&&Oe();var n=e.flatMap(r.declarations,1&r.flags?Y:Z),i=u.createVariableDeclarationList(n);return e.setOriginalNode(i,r),e.setTextRange(i,r),e.setCommentRange(i,r),524288&r.transformFlags&&(e.isBindingPattern(r.declarations[0].name)||e.isBindingPattern(e.last(r.declarations).name))&&e.setSourceMapRange(i,function(t){for(var r=-1,n=-1,i=0,a=t;i<a.length;i++){var o=a[i];r=-1===r?o.pos:-1===o.pos?r:Math.min(r,o.pos),n=Math.max(n,o.end);}return e.createRange(r,n)}(n)),i}return e.visitEachChild(r,C,t)}(i);case 252:return function(r){if(void 0!==s){var n=s.allowedNonLabeledJumps;s.allowedNonLabeledJumps|=2;var i=e.visitEachChild(r,C,t);return s.allowedNonLabeledJumps=n,i}return e.visitEachChild(r,C,t)}(i);case 266:return function(r){var n=x(7104,0),i=e.visitEachChild(r,C,t);return D(n,0,0),i}(i);case 238:return function(r,n){var i=256&a?x(7104,512):x(6976,128),o=e.visitEachChild(r,C,t);return D(i,0,0),o}(i);case 249:case 248:return function(r){if(s){var n=249===r.kind?2:4;if(!(r.label&&s.labels&&s.labels.get(e.idText(r.label))||!r.label&&s.allowedNonLabeledJumps&n)){var i=void 0,a=r.label;a?249===r.kind?(i="break-".concat(a.escapedText),xe(s,!0,e.idText(a),i)):(i="continue-".concat(a.escapedText),xe(s,!1,e.idText(a),i)):249===r.kind?(s.nonLocalJumps|=2,i="break"):(s.nonLocalJumps|=4,i="continue");var o=u.createStringLiteral(i);if(s.loopOutParameters.length){for(var c=s.loopOutParameters,l=void 0,_=0;_<c.length;_++){var d=he(c[_],1);l=0===_?d:u.createBinaryExpression(l,27,d);}o=u.createBinaryExpression(l,27,o);}return u.createReturnStatement(o)}}return e.visitEachChild(r,C,t)}(i);case 253:return function(t){s&&!s.labels&&(s.labels=new e.Map);var r=e.unwrapInnermostStatementOfLabel(t,s&&$);return e.isIterationStatement(r,!1)?function(e,t){switch(e.kind){case 243:case 244:return re(e,t);case 245:return ne(e,t);case 246:return ie(e,t);case 247:return ae(e,t)}}(r,t):u.restoreEnclosingLabel(e.visitNode(r,C,e.isStatement,u.liftToBlock),t,s&&ee)}(i);case 243:case 244:return re(i,void 0);case 245:return ne(i,void 0);case 246:return ie(i,void 0);case 247:return ae(i,void 0);case 241:case 219:return function(r){return e.visitEachChild(r,E,t)}(i);case 207:return function(r){for(var n=r.properties,i=-1,o=!1,s=0;s<n.length;s++){var c=n[s];if(1048576&c.transformFlags&&4&a||(o=164===e.Debug.checkDefined(c.name).kind)){i=s;break}}if(i<0)return e.visitEachChild(r,C,t);var l=u.createTempVariable(g),_=[],d=u.createAssignment(l,e.setEmitFlags(u.createObjectLiteralExpression(e.visitNodes(n,C,e.isObjectLiteralElementLike,0,i),r.multiLine),o?65536:0));return r.multiLine&&e.startOnNewLine(d),_.push(d),function(t,r,n,i){for(var a=r.properties,o=a.length,s=i;s<o;s++){var c=a[s];switch(c.kind){case 174:case 175:var l=e.getAllAccessorDeclarations(r.properties,c);c===l.firstAccessor&&t.push(H(n,l,r,!!r.multiLine));break;case 171:t.push(Ee(c,n,r,r.multiLine));break;case 299:t.push(Te(c,n,r.multiLine));break;case 300:t.push(Ce(c,n,r.multiLine));break;default:e.Debug.failBadSyntaxKind(r);}}}(_,r,l,i),_.push(r.multiLine?e.startOnNewLine(e.setParent(e.setTextRange(u.cloneNode(l),l),l.parent)):l),u.inlineExpressions(_)}(i);case 295:return function(r){var i,a,o,s,c=x(7104,0);if(e.Debug.assert(!!r.variableDeclaration,"Catch clause variable should always be present when downleveling ES2015."),e.isBindingPattern(r.variableDeclaration.name)){var l=u.createTempVariable(void 0),_=u.createVariableDeclaration(l);e.setTextRange(_,r.variableDeclaration);var d=e.flattenDestructuringBinding(r.variableDeclaration,C,t,0,l),p=u.createVariableDeclarationList(d);e.setTextRange(p,r.variableDeclaration);var f=u.createVariableStatement(void 0,p);i=u.updateCatchClause(r,_,(a=r.block,o=f,s=e.visitNodes(a.statements,C,e.isStatement),u.updateBlock(a,n$4([o],s,!0))));}else i=e.visitEachChild(r,C,t);return D(c,0,0),i}(i);case 300:return function(t){return e.setTextRange(u.createPropertyAssignment(t.name,P(u.cloneNode(t.name))),t)}(i);case 164:case 226:return function(r){return e.visitEachChild(r,C,t)}(i);case 206:return function(r){return e.some(r.elements,e.isSpreadElement)?Ne(r.elements,!1,!!r.multiLine,!!r.elements.hasTrailingComma):e.visitEachChild(r,C,t)}(i);case 210:return function(t){if(33554432&e.getEmitFlags(t))return function(t){var r=e.cast(e.cast(e.skipOuterExpressions(t.expression),e.isArrowFunction).body,e.isBlock),n=function(t){return e.isVariableStatement(t)&&!!e.first(t.declarationList.declarations).initializer},i=s;s=void 0;var a=e.visitNodes(r.statements,k,e.isStatement);s=i;var o=e.filter(a,n),c=e.filter(a,(function(e){return !n(e)})),l=e.cast(e.first(o),e.isVariableStatement).declarationList.declarations[0],_=e.skipOuterExpressions(l.initializer),d=e.tryCast(_,e.isAssignmentExpression);!d&&e.isBinaryExpression(_)&&27===_.operatorToken.kind&&(d=e.tryCast(_.left,e.isAssignmentExpression));var p=e.cast(d?e.skipOuterExpressions(d.right):_,e.isCallExpression),f=e.cast(e.skipOuterExpressions(p.expression),e.isFunctionExpression),g=f.body.statements,m=0,y=-1,v=[];if(d){var h=e.tryCast(g[m],e.isExpressionStatement);h&&(v.push(h),m++),v.push(g[m]),m++,v.push(u.createExpressionStatement(u.createAssignment(d.left,e.cast(l.name,e.isIdentifier))));}for(;!e.isReturnStatement(e.elementAt(g,y));)y--;return e.addRange(v,g,m,y),y<-1&&e.addRange(v,g,y+1),e.addRange(v,c),e.addRange(v,o,1),u.restoreOuterExpressions(t.expression,u.restoreOuterExpressions(l.initializer,u.restoreOuterExpressions(d&&d.right,u.updateCallExpression(p,u.restoreOuterExpressions(p.expression,u.updateFunctionExpression(f,void 0,void 0,void 0,void 0,f.parameters,void 0,u.updateBlock(f.body,v))),void 0,p.arguments))))}(t);var r=e.skipOuterExpressions(t.expression);return 106===r.kind||e.isSuperProperty(r)||e.some(t.arguments,e.isSpreadElement)?ke(t,!0):u.updateCallExpression(t,e.visitNode(t.expression,N,e.isExpression),void 0,e.visitNodes(t.arguments,C,e.isExpression))}(i);case 211:return function(r){if(e.some(r.arguments,e.isSpreadElement)){var i=u.createCallBinding(u.createPropertyAccessExpression(r.expression,"bind"),g),a=i.target,o=i.thisArg;return u.createNewExpression(u.createFunctionApplyCall(e.visitNode(a,C,e.isExpression),o,Ne(u.createNodeArray(n$4([u.createVoidZero()],r.arguments,!0)),!0,!1,!1)),void 0,[])}return e.visitEachChild(r,C,t)}(i);case 214:return function(r,n){return e.visitEachChild(r,n?E:C,t)}(i,o);case 223:return X(i,o);case 354:return function(r,n){if(n)return e.visitEachChild(r,E,t);for(var i,a=0;a<r.elements.length;a++){var o=r.elements[a],s=e.visitNode(o,a<r.elements.length-1?E:C,e.isExpression);(i||s!==o)&&(i||(i=r.elements.slice(0,a)),i.push(s));}var c=i?e.setTextRange(u.createNodeArray(i),r.elements):r.elements;return u.updateCommaListExpression(r,c)}(i,o);case 14:case 15:case 16:case 17:return function(t){return e.setTextRange(u.createStringLiteral(t.text),t)}(i);case 10:return function(t){return t.hasExtendedUnicodeEscape?e.setTextRange(u.createStringLiteral(t.text),t):t}(i);case 8:return function(t){return 384&t.numericLiteralFlags?e.setTextRange(u.createNumericLiteral(t.text),t):t}(i);case 212:return function(n){return e.processTaggedTemplateExpression(t,n,C,r,b,e.ProcessLevel.All)}(i);case 225:return function(t){for(var r=u.createStringLiteral(t.head.text),n=0,i=t.templateSpans;n<i.length;n++){var a=i[n],o=[e.visitNode(a.expression,C,e.isExpression)];a.literal.text.length>0&&o.push(u.createStringLiteral(a.literal.text)),r=u.createCallExpression(u.createPropertyAccessExpression(r,"concat"),void 0,o);}return e.setTextRange(r,t)}(i);case 227:return function(t){return e.visitNode(t.expression,C,e.isExpression)}(i);case 106:return Ie(!1);case 108:return function(e){return 2&a&&!(16384&a)&&(a|=65536),s?2&a?(s.containsLexicalThis=!0,e):s.thisName||(s.thisName=u.createUniqueName("this")):e}(i);case 233:return function(e){return 103===e.keywordToken&&"target"===e.name.escapedText?(a|=32768,u.createUniqueName("_newTarget",48)):e}(i);case 171:return function(t){e.Debug.assert(!e.isComputedPropertyName(t.name));var r=G(t,e.moveRangePos(t,-1),void 0,void 0);return e.setEmitFlags(r,512|e.getEmitFlags(r)),e.setTextRange(u.createPropertyAssignment(t.name,r),t)}(i);case 174:case 175:return function(r){e.Debug.assert(!e.isComputedPropertyName(r.name));var n=s;s=void 0;var i,a=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r);return i=174===r.kind?u.updateGetAccessorDeclaration(r,r.modifiers,r.name,o,r.type,c):u.updateSetAccessorDeclaration(r,r.modifiers,r.name,o,c),D(a,98304,0),s=n,i}(i);case 240:return function(r){var n,i=x(0,e.hasSyntacticModifier(r,1)?32:0);if(s&&0==(3&r.declarationList.flags)&&!function(t){return 1===t.declarationList.declarations.length&&!!t.declarationList.declarations[0].initializer&&!!(33554432&e.getEmitFlags(t.declarationList.declarations[0].initializer))}(r)){for(var a=void 0,o=0,c=r.declarationList.declarations;o<c.length;o++){var l=c[o];if(me(s,l),l.initializer){var _=void 0;e.isBindingPattern(l.name)?_=e.flattenDestructuringAssignment(l,C,t,0):(_=u.createBinaryExpression(l.name,63,e.visitNode(l.initializer,C,e.isExpression)),e.setTextRange(_,l)),a=e.append(a,_);}}n=a?e.setTextRange(u.createExpressionStatement(u.inlineExpressions(a)),r):void 0;}else n=e.visitEachChild(r,C,t);return D(i,0,0),n}(i);case 250:return function(r){return s?(s.nonLocalJumps|=8,S(r)&&(r=F(r)),u.createReturnStatement(u.createObjectLiteralExpression([u.createPropertyAssignment(u.createIdentifier("value"),r.expression?e.visitNode(r.expression,C,e.isExpression):u.createVoidZero())]))):S(r)?F(r):e.visitEachChild(r,C,t)}(i);default:return e.visitEachChild(i,C,t)}}function F(t){return e.setOriginalNode(u.createReturnStatement(u.createUniqueName("_this",48)),t)}function P(t){return s&&y.isArgumentsLocalBinding(t)?s.argumentsName||(s.argumentsName=u.createUniqueName("arguments")):t.hasExtendedUnicodeEscape?e.setOriginalNode(e.setTextRange(u.createIdentifier(e.unescapeLeadingUnderscores(t.escapedText)),t),t):t}function w(o){o.name&&Oe();var c=e.getClassExtendsHeritageElement(o),l=u.createFunctionExpression(void 0,void 0,void 0,void 0,c?[u.createParameterDeclaration(void 0,void 0,u.createUniqueName("_super",48))]:[],void 0,function(o,c){var l=[],g=u.getInternalName(o),m=e.isIdentifierANonContextualKeyword(g)?u.getGeneratedNameForNode(g):g;d(),function(t,r,n){n&&t.push(e.setTextRange(u.createExpressionStatement(_().createExtendsHelper(u.getInternalName(r))),n));}(l,o,c),function(r,i,o,c){var l=s;s=void 0;var _=x(32662,73),d=e.getFirstConstructorWithBody(i),g=function(t,r){if(!t||!r)return !1;if(e.some(t.parameters))return !1;var n=e.firstOrUndefined(t.body.statements);if(!n||!e.nodeIsSynthesized(n)||241!==n.kind)return !1;var i=n.expression;if(!e.nodeIsSynthesized(i)||210!==i.kind)return !1;var a=i.expression;if(!e.nodeIsSynthesized(a)||106!==a.kind)return !1;var o=e.singleOrUndefined(i.arguments);if(!o||!e.nodeIsSynthesized(o)||227!==o.kind)return !1;var s=o.expression;return e.isIdentifier(s)&&"arguments"===s.escapedText}(d,void 0!==c),m=u.createFunctionDeclaration(void 0,void 0,o,void 0,function(r,n){return e.visitParameterList(r&&!n?r.parameters:void 0,C,t)||[]}(d,g),void 0,function(t,r,i,o){var s=!!i&&104!==e.skipOuterExpressions(i.expression).kind;if(!t)return function(t,r){var n=[];p(),u.mergeLexicalEnvironment(n,f()),r&&n.push(u.createReturnStatement(M()));var i=u.createNodeArray(n);e.setTextRange(i,t.members);var a=u.createBlock(i,!0);return e.setTextRange(a,t),e.setEmitFlags(a,1536),a}(r,s);var c=[],l=[];p();var _,d=e.takeWhile(t.body.statements,e.isPrologueDirective),g=function(t,r){for(var n=r.length;n<t.length;n+=1){var i=e.getSuperCallFromStatement(t[n]);if(i)return {superCall:i,superStatementIndex:n}}return {superStatementIndex:-1}}(t.body.statements,d),m=g.superCall,y=g.superStatementIndex,v=-1===y?d.length:y+1,h=v;if(o||(h=u.copyStandardPrologue(t.body.statements,c,h,!1)),o||(h=u.copyCustomPrologue(t.body.statements,l,h,C,void 0)),o?_=M():m&&(_=function(e){return ke(e,!1)}(m)),_&&(a|=8192),R(c,t),J(c,t,o),e.addRange(l,e.visitNodes(t.body.statements,C,e.isStatement,h)),u.mergeLexicalEnvironment(c,f()),K(c,t,!1),s||_)if(!_||v!==t.body.statements.length||16384&t.body.transformFlags)y<=d.length?U(l,t,_||O()):(U(c,t,O()),_&&function(t,r){Me();var n=u.createExpressionStatement(u.createBinaryExpression(u.createThis(),63,r));e.insertStatementAfterCustomPrologue(t,n),e.setCommentRange(n,e.getOriginalNode(r).parent);}(l,_)),I(t.body)||l.push(u.createReturnStatement(u.createUniqueName("_this",48)));else {var b=e.cast(e.cast(_,e.isBinaryExpression).left,e.isCallExpression),x=u.createReturnStatement(_);e.setCommentRange(x,e.getCommentRange(b)),e.setEmitFlags(b,1536),l.push(x);}else z(c,t);var D=u.createBlock(e.setTextRange(u.createNodeArray(n$4(n$4(n$4(n$4([],d,!0),c,!0),y<=d.length?e.emptyArray:e.visitNodes(t.body.statements,C,e.isStatement,d.length,y-d.length),!0),l,!0)),t.body.statements),!0);return e.setTextRange(D,t.body),D}(d,i,c,g));e.setTextRange(m,d||i),c&&e.setEmitFlags(m,8),r.push(m),D(_,98304,0),s=l;}(l,o,m,c),function(t,n){for(var i=0,a=n.members;i<a.length;i++){var o=a[i];switch(o.kind){case 237:t.push(V(o));break;case 171:t.push(q(Le(n,o),o,n));break;case 174:case 175:var s=e.getAllAccessorDeclarations(n.members,o);o===s.firstAccessor&&t.push(W(Le(n,o),s,n));break;case 173:case 172:break;default:e.Debug.failBadSyntaxKind(o,r&&r.fileName);}}}(l,o);var y=e.createTokenRange(e.skipTrivia(i,o.members.end),19),v=u.createPartiallyEmittedExpression(m);e.setTextRangeEnd(v,y.end),e.setEmitFlags(v,1536);var h=u.createReturnStatement(v);e.setTextRangePos(h,y.pos),e.setEmitFlags(h,1920),l.push(h),e.insertStatementsAfterStandardPrologue(l,f());var b=u.createBlock(e.setTextRange(u.createNodeArray(l),o.members),!0);return e.setEmitFlags(b,1536),b}(o,c));e.setEmitFlags(l,65536&e.getEmitFlags(o)|524288);var g=u.createPartiallyEmittedExpression(l);e.setTextRangeEnd(g,o.end),e.setEmitFlags(g,1536);var m=u.createPartiallyEmittedExpression(g);e.setTextRangeEnd(m,e.skipTrivia(i,o.pos)),e.setEmitFlags(m,1536);var y=u.createParenthesizedExpression(u.createCallExpression(m,void 0,c?[e.visitNode(c.expression,C,e.isExpression)]:[]));return e.addSyntheticLeadingComment(y,3,"* @class "),y}function I(t){if(250===t.kind)return !0;if(242===t.kind){var r=t;if(r.elseStatement)return I(r.thenStatement)&&I(r.elseStatement)}else if(238===t.kind){var n=e.lastOrUndefined(t.statements);if(n&&I(n))return !0}return !1}function O(){return e.setEmitFlags(u.createThis(),4)}function M(){return u.createLogicalOr(u.createLogicalAnd(u.createStrictInequality(u.createUniqueName("_super",48),u.createNull()),u.createFunctionApplyCall(u.createUniqueName("_super",48),O(),u.createIdentifier("arguments"))),O())}function L(t){return void 0!==t.initializer||e.isBindingPattern(t.name)}function R(t,r){if(!e.some(r.parameters,L))return !1;for(var n=!1,i=0,a=r.parameters;i<a.length;i++){var o=a[i],s=o.name,c=o.initializer;o.dotDotDotToken||(e.isBindingPattern(s)?n=B(t,o,s,c)||n:c&&(j(t,o,s,c),n=!0));}return n}function B(r,n,i,a){return i.elements.length>0?(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(n,C,t,0,u.getGeneratedNameForNode(n)))),1048576)),!0):!!a&&(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createExpressionStatement(u.createAssignment(u.getGeneratedNameForNode(n),e.visitNode(a,C,e.isExpression))),1048576)),!0)}function j(t,r,n,i){i=e.visitNode(i,C,e.isExpression);var a=u.createIfStatement(u.createTypeCheck(u.cloneNode(n),"undefined"),e.setEmitFlags(e.setTextRange(u.createBlock([u.createExpressionStatement(e.setEmitFlags(e.setTextRange(u.createAssignment(e.setEmitFlags(e.setParent(e.setTextRange(u.cloneNode(n),n),n.parent),48),e.setEmitFlags(i,1584|e.getEmitFlags(i))),r),1536))]),r),1953));e.startOnNewLine(a),e.setTextRange(a,r),e.setEmitFlags(a,1050528),e.insertStatementAfterCustomPrologue(t,a);}function J(r,n,i){var a=[],o=e.lastOrUndefined(n.parameters);if(!function(e,t){return !(!e||!e.dotDotDotToken||t)}(o,i))return !1;var s=79===o.name.kind?e.setParent(e.setTextRange(u.cloneNode(o.name),o.name),o.name.parent):u.createTempVariable(void 0);e.setEmitFlags(s,48);var c=79===o.name.kind?u.cloneNode(o.name):s,l=n.parameters.length-1,_=u.createLoopVariable();a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(s,void 0,void 0,u.createArrayLiteralExpression([]))])),o),1048576));var d=u.createForStatement(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(_,void 0,void 0,u.createNumericLiteral(l))]),o),e.setTextRange(u.createLessThan(_,u.createPropertyAccessExpression(u.createIdentifier("arguments"),"length")),o),e.setTextRange(u.createPostfixIncrement(_),o),u.createBlock([e.startOnNewLine(e.setTextRange(u.createExpressionStatement(u.createAssignment(u.createElementAccessExpression(c,0===l?_:u.createSubtract(_,u.createNumericLiteral(l))),u.createElementAccessExpression(u.createIdentifier("arguments"),_))),o))]));return e.setEmitFlags(d,1048576),e.startOnNewLine(d),a.push(d),79!==o.name.kind&&a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(o,C,t,0,c))),o),1048576)),e.insertStatementsAfterCustomPrologue(r,a),!0}function z(e,t){return !!(65536&a&&216!==t.kind)&&(U(e,t,u.createThis()),!0)}function U(t,r,n){Me();var i=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_this",48),void 0,void 0,n)]));e.setEmitFlags(i,1050112),e.setSourceMapRange(i,r),e.insertStatementAfterCustomPrologue(t,i);}function K(t,r,n){if(32768&a){var i=void 0;switch(r.kind){case 216:return t;case 171:case 174:case 175:i=u.createVoidZero();break;case 173:i=u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor");break;case 259:case 215:i=u.createConditionalExpression(u.createLogicalAnd(e.setEmitFlags(u.createThis(),4),u.createBinaryExpression(e.setEmitFlags(u.createThis(),4),102,u.getLocalName(r))),void 0,u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor"),void 0,u.createVoidZero());break;default:return e.Debug.failBadSyntaxKind(r)}var o=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_newTarget",48),void 0,void 0,i)]));e.setEmitFlags(o,1050112),n&&(t=t.slice()),e.insertStatementAfterCustomPrologue(t,o);}return t}function V(t){return e.setTextRange(u.createEmptyStatement(),t)}function q(r,n,i){var a,o=e.getCommentRange(n),s=e.getSourceMapRange(n),c=G(n,n,void 0,i),l=e.visitNode(n.name,C,e.isPropertyName);if(!e.isPrivateIdentifier(l)&&e.getUseDefineForClassFields(t.getCompilerOptions())){var _=e.isComputedPropertyName(l)?l.expression:e.isIdentifier(l)?u.createStringLiteral(e.unescapeLeadingUnderscores(l.escapedText)):l;a=u.createObjectDefinePropertyCall(r,_,u.createPropertyDescriptor({value:c,enumerable:!1,writable:!0,configurable:!0}));}else {var d=e.createMemberAccessForPropertyName(u,r,l,n.name);a=u.createAssignment(d,c);}e.setEmitFlags(c,1536),e.setSourceMapRange(c,s);var p=e.setTextRange(u.createExpressionStatement(a),n);return e.setOriginalNode(p,n),e.setCommentRange(p,o),e.setEmitFlags(p,48),p}function W(t,r,n){var i=u.createExpressionStatement(H(t,r,n,!1));return e.setEmitFlags(i,1536),e.setSourceMapRange(i,e.getSourceMapRange(r.firstAccessor)),i}function H(t,r,n,i){var a=r.firstAccessor,o=r.getAccessor,s=r.setAccessor,c=e.setParent(e.setTextRange(u.cloneNode(t),t),t.parent);e.setEmitFlags(c,1568),e.setSourceMapRange(c,a.name);var l=e.visitNode(a.name,C,e.isPropertyName);if(e.isPrivateIdentifier(l))return e.Debug.failBadSyntaxKind(l,"Encountered unhandled private identifier while transforming ES2015.");var _=e.createExpressionForPropertyName(u,l);e.setEmitFlags(_,1552),e.setSourceMapRange(_,a.name);var d=[];if(o){var p=G(o,void 0,void 0,n);e.setSourceMapRange(p,e.getSourceMapRange(o)),e.setEmitFlags(p,512);var f=u.createPropertyAssignment("get",p);e.setCommentRange(f,e.getCommentRange(o)),d.push(f);}if(s){var g=G(s,void 0,void 0,n);e.setSourceMapRange(g,e.getSourceMapRange(s)),e.setEmitFlags(g,512);var m=u.createPropertyAssignment("set",g);e.setCommentRange(m,e.getCommentRange(s)),d.push(m);}d.push(u.createPropertyAssignment("enumerable",o||s?u.createFalse():u.createTrue()),u.createPropertyAssignment("configurable",u.createTrue()));var y=u.createCallExpression(u.createPropertyAccessExpression(u.createIdentifier("Object"),"defineProperty"),void 0,[c,_,u.createObjectLiteralExpression(d,!0)]);return i&&e.startOnNewLine(y),y}function G(r,n,i,o){var c=s;s=void 0;var l=o&&e.isClassLike(o)&&!e.isStatic(r)?x(32670,73):x(32670,65),_=e.visitParameterList(r.parameters,C,t),d=Q(r);return 32768&a&&!i&&(259===r.kind||215===r.kind)&&(i=u.getGeneratedNameForNode(r)),D(l,98304,0),s=c,e.setOriginalNode(e.setTextRange(u.createFunctionExpression(void 0,r.asteriskToken,i,void 0,_,void 0,d),n),r)}function Q(t){var n,i,a,o=!1,s=!1,c=[],l=[],_=t.body;if(p(),e.isBlock(_)&&(a=u.copyStandardPrologue(_.statements,c,0,!1),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedFunction),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedVariableStatement)),o=R(l,t)||o,o=J(l,t,!1)||o,e.isBlock(_))a=u.copyCustomPrologue(_.statements,l,a,C),n=_.statements,e.addRange(l,e.visitNodes(_.statements,C,e.isStatement,a)),!o&&_.multiLine&&(o=!0);else {e.Debug.assert(216===t.kind),n=e.moveRangeEnd(_,-1);var d=t.equalsGreaterThanToken;e.nodeIsSynthesized(d)||e.nodeIsSynthesized(_)||(e.rangeEndIsOnSameLineAsRangeStart(d,_,r)?s=!0:o=!0);var g=e.visitNode(_,C,e.isExpression),m=u.createReturnStatement(g);e.setTextRange(m,_),e.moveSyntheticComments(m,_),e.setEmitFlags(m,1440),l.push(m),i=_;}if(u.mergeLexicalEnvironment(c,f()),K(c,t,!1),z(c,t),e.some(c)&&(o=!0),l.unshift.apply(l,c),e.isBlock(_)&&e.arrayIsEqualTo(l,_.statements))return _;var y=u.createBlock(e.setTextRange(u.createNodeArray(l),n),o);return e.setTextRange(y,t.body),!o&&s&&e.setEmitFlags(y,1),i&&e.setTokenSourceMapRange(y,19,i),e.setOriginalNode(y,t.body),y}function X(r,n){return e.isDestructuringAssignment(r)?e.flattenDestructuringAssignment(r,C,t,0,!n):27===r.operatorToken.kind?u.updateBinaryExpression(r,e.visitNode(r.left,E,e.isExpression),r.operatorToken,e.visitNode(r.right,n?E:C,e.isExpression)):e.visitEachChild(r,C,t)}function Y(r){var n=r.name;return e.isBindingPattern(n)?Z(r):!r.initializer&&function(e){var t=y.getNodeCheckFlags(e),r=262144&t,n=524288&t;return !(0!=(64&a)||r&&n&&0!=(512&a))&&0==(4096&a)&&(!y.isDeclarationWithCollidingName(e)||n&&!r&&0==(6144&a))}(r)?u.updateVariableDeclaration(r,r.name,void 0,void 0,u.createVoidZero()):e.visitEachChild(r,C,t)}function Z(r){var n,i=x(32,0);return n=e.isBindingPattern(r.name)?e.flattenDestructuringBinding(r,C,t,0,void 0,0!=(32&i)):e.visitEachChild(r,C,t),D(i,0,0),n}function $(t){s.labels.set(e.idText(t.label),!0);}function ee(t){s.labels.set(e.idText(t.label),!1);}function te(r,n,i,o,c){var l=x(r,n),_=function(r,n,i,o){if(!fe(r)){var c=void 0;s&&(c=s.allowedNonLabeledJumps,s.allowedNonLabeledJumps=6);var l=o?o(r,n,void 0,i):u.restoreEnclosingLabel(e.isForStatement(r)?function(t){return u.updateForStatement(t,e.visitNode(t.initializer,E,e.isForInitializer),e.visitNode(t.condition,C,e.isExpression),e.visitNode(t.incrementor,E,e.isExpression),e.visitNode(t.statement,C,e.isStatement,u.liftToBlock))}(r):e.visitEachChild(r,C,t),n,s&&ee);return s&&(s.allowedNonLabeledJumps=c),l}var _=function(t){var r;switch(t.kind){case 245:case 246:case 247:var n=t.initializer;n&&258===n.kind&&(r=n);}var i=[],a=[];if(r&&3&e.getCombinedNodeFlags(r))for(var o=_e(t)||de(t)||pe(t),c=0,l=r.declarations;c<l.length;c++)Se(t,l[c],i,a,o);var u={loopParameters:i,loopOutParameters:a};return s&&(s.argumentsName&&(u.argumentsName=s.argumentsName),s.thisName&&(u.thisName=s.thisName),s.hoistedLocalVariables&&(u.hoistedLocalVariables=s.hoistedLocalVariables)),u}(r),p=[],g=s;s=_;var m,y,v,h,b,x=_e(r)?function(t,r){var n=u.createUniqueName("_loop_init"),i=0!=(1048576&t.initializer.transformFlags),o=0;r.containsLexicalThis&&(o|=8),i&&4&a&&(o|=262144);var s=[];return s.push(u.createVariableStatement(void 0,t.initializer)),be(r.loopOutParameters,2,1,s),{functionName:n,containsYield:i,functionDeclaration:u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(n,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,i?u.createToken(41):void 0,void 0,void 0,void 0,void 0,e.visitNode(u.createBlock(s,!0),C,e.isBlock)),o))]),2097152)),part:u.createVariableDeclarationList(e.map(r.loopOutParameters,ve))}}(r,_):void 0,D=ge(r)?function(t,r,n){var i=u.createUniqueName("_loop");d();var o=e.visitNode(t.statement,C,e.isStatement,u.liftToBlock),s=f(),c=[];(de(t)||pe(t))&&(r.conditionVariable=u.createUniqueName("inc"),t.incrementor?c.push(u.createIfStatement(r.conditionVariable,u.createExpressionStatement(e.visitNode(t.incrementor,C,e.isExpression)),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))):c.push(u.createIfStatement(u.createLogicalNot(r.conditionVariable),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))),de(t)&&c.push(u.createIfStatement(u.createPrefixUnaryExpression(53,e.visitNode(t.condition,C,e.isExpression)),e.visitNode(u.createBreakStatement(),C,e.isStatement)))),e.isBlock(o)?e.addRange(c,o.statements):c.push(o),be(r.loopOutParameters,1,1,c),e.insertStatementsAfterStandardPrologue(c,s);var l=u.createBlock(c,!0);e.isBlock(o)&&e.setOriginalNode(l,o);var _=0!=(1048576&t.statement.transformFlags),p=524288;r.containsLexicalThis&&(p|=8),_&&0!=(4&a)&&(p|=262144);var g=u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(i,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,_?u.createToken(41):void 0,void 0,void 0,r.loopParameters,void 0,l),p))]),2097152)),m=function(t,r,n,i){var a=[],o=!(-5&r.nonLocalJumps||r.labeledNonLocalBreaks||r.labeledNonLocalContinues),s=u.createCallExpression(t,void 0,e.map(r.loopParameters,(function(e){return e.name}))),c=i?u.createYieldExpression(u.createToken(41),e.setEmitFlags(s,8388608)):s;if(o)a.push(u.createExpressionStatement(c)),be(r.loopOutParameters,1,0,a);else {var l=u.createUniqueName("state"),_=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(l,void 0,void 0,c)]));if(a.push(_),be(r.loopOutParameters,1,0,a),8&r.nonLocalJumps){var d=void 0;n?(n.nonLocalJumps|=8,d=u.createReturnStatement(l)):d=u.createReturnStatement(u.createPropertyAccessExpression(l,"value")),a.push(u.createIfStatement(u.createTypeCheck(l,"object"),d));}if(2&r.nonLocalJumps&&a.push(u.createIfStatement(u.createStrictEquality(l,u.createStringLiteral("break")),u.createBreakStatement())),r.labeledNonLocalBreaks||r.labeledNonLocalContinues){var p=[];De(r.labeledNonLocalBreaks,!0,l,n,p),De(r.labeledNonLocalContinues,!1,l,n,p),a.push(u.createSwitchStatement(l,u.createCaseBlock(p)));}}return a}(i,r,n,_);return {functionName:i,containsYield:_,functionDeclaration:g,part:m}}(r,_,g):void 0;if(s=g,x&&p.push(x.functionDeclaration),D&&p.push(D.functionDeclaration),function(e,t,r){var n;if(t.argumentsName&&(r?r.argumentsName=t.argumentsName:(n||(n=[])).push(u.createVariableDeclaration(t.argumentsName,void 0,void 0,u.createIdentifier("arguments")))),t.thisName&&(r?r.thisName=t.thisName:(n||(n=[])).push(u.createVariableDeclaration(t.thisName,void 0,void 0,u.createIdentifier("this")))),t.hoistedLocalVariables)if(r)r.hoistedLocalVariables=t.hoistedLocalVariables;else {n||(n=[]);for(var i=0,a=t.hoistedLocalVariables;i<a.length;i++){var o=a[i];n.push(u.createVariableDeclaration(o));}}if(t.loopOutParameters.length){n||(n=[]);for(var s=0,c=t.loopOutParameters;s<c.length;s++){var l=c[s];n.push(u.createVariableDeclaration(l.outParamName));}}t.conditionVariable&&(n||(n=[]),n.push(u.createVariableDeclaration(t.conditionVariable,void 0,void 0,u.createFalse()))),n&&e.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(n)));}(p,_,g),x&&p.push((y=x.functionName,v=x.containsYield,h=u.createCallExpression(y,void 0,[]),b=v?u.createYieldExpression(u.createToken(41),e.setEmitFlags(h,8388608)):h,u.createExpressionStatement(b))),D)if(o)m=o(r,n,D.part,i);else {var S=ye(r,x,u.createBlock(D.part,!0));m=u.restoreEnclosingLabel(S,n,s&&ee);}else {var T=ye(r,x,e.visitNode(r.statement,C,e.isStatement,u.liftToBlock));m=u.restoreEnclosingLabel(T,n,s&&ee);}return p.push(m),p}(i,o,l,c);return D(l,0,0),_}function re(e,t){return te(0,1280,e,t)}function ne(e,t){return te(5056,3328,e,t)}function ie(e,t){return te(3008,5376,e,t)}function ae(e,t){return te(3008,5376,e,t,m.downlevelIteration?le:ce)}function oe(r,n,i){var a=[],o=r.initializer;if(e.isVariableDeclarationList(o)){3&r.initializer.flags&&Oe();var s=e.firstOrUndefined(o.declarations);if(s&&e.isBindingPattern(s.name)){var c=e.flattenDestructuringBinding(s,C,t,0,n),l=e.setTextRange(u.createVariableDeclarationList(c),r.initializer);e.setOriginalNode(l,r.initializer),e.setSourceMapRange(l,e.createRange(c[0].pos,e.last(c).end)),a.push(u.createVariableStatement(void 0,l));}else a.push(e.setTextRange(u.createVariableStatement(void 0,e.setOriginalNode(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(s?s.name:u.createTempVariable(void 0),void 0,void 0,n)]),e.moveRangePos(o,-1)),o)),e.moveRangeEnd(o,-1)));}else {var _=u.createAssignment(o,n);e.isDestructuringAssignment(_)?a.push(u.createExpressionStatement(X(_,!0))):(e.setTextRangeEnd(_,o.end),a.push(e.setTextRange(u.createExpressionStatement(e.visitNode(_,C,e.isExpression)),e.moveRangeEnd(o,-1))));}if(i)return se(e.addRange(a,i));var d=e.visitNode(r.statement,C,e.isStatement,u.liftToBlock);return e.isBlock(d)?u.updateBlock(d,e.setTextRange(u.createNodeArray(e.concatenate(a,d.statements)),d.statements)):(a.push(d),se(a))}function se(t){return e.setEmitFlags(u.createBlock(u.createNodeArray(t),!0),432)}function ce(t,r,n){var i=e.visitNode(t.expression,C,e.isExpression),a=u.createLoopVariable(),o=e.isIdentifier(i)?u.getGeneratedNameForNode(i):u.createTempVariable(void 0);e.setEmitFlags(i,48|e.getEmitFlags(i));var c=e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(a,void 0,void 0,u.createNumericLiteral(0)),e.moveRangePos(t.expression,-1)),e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,i),t.expression)]),t.expression),2097152),e.setTextRange(u.createLessThan(a,u.createPropertyAccessExpression(o,"length")),t.expression),e.setTextRange(u.createPostfixIncrement(a),t.expression),oe(t,u.createElementAccessExpression(o,a),n)),t);return e.setEmitFlags(c,256),e.setTextRange(c,t),u.restoreEnclosingLabel(c,r,s&&ee)}function le(t,r,n,i){var a=e.visitNode(t.expression,C,e.isExpression),o=e.isIdentifier(a)?u.getGeneratedNameForNode(a):u.createTempVariable(void 0),c=e.isIdentifier(a)?u.getGeneratedNameForNode(o):u.createTempVariable(void 0),l=u.createUniqueName("e"),d=u.getGeneratedNameForNode(l),p=u.createTempVariable(void 0),f=e.setTextRange(_().createValuesHelper(a),t.expression),m=u.createCallExpression(u.createPropertyAccessExpression(o,"next"),void 0,[]);g(l),g(p);var y=1024&i?u.inlineExpressions([u.createAssignment(l,u.createVoidZero()),f]):f,v=e.setEmitFlags(e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,y),t.expression),u.createVariableDeclaration(c,void 0,void 0,m)]),t.expression),2097152),u.createLogicalNot(u.createPropertyAccessExpression(c,"done")),u.createAssignment(c,m),oe(t,u.createPropertyAccessExpression(c,"value"),n)),t),256);return u.createTryStatement(u.createBlock([u.restoreEnclosingLabel(v,r,s&&ee)]),u.createCatchClause(u.createVariableDeclaration(d),e.setEmitFlags(u.createBlock([u.createExpressionStatement(u.createAssignment(l,u.createObjectLiteralExpression([u.createPropertyAssignment("error",d)])))]),1)),u.createBlock([u.createTryStatement(u.createBlock([e.setEmitFlags(u.createIfStatement(u.createLogicalAnd(u.createLogicalAnd(c,u.createLogicalNot(u.createPropertyAccessExpression(c,"done"))),u.createAssignment(p,u.createPropertyAccessExpression(o,"return"))),u.createExpressionStatement(u.createFunctionCallCall(p,o,[]))),1)]),void 0,e.setEmitFlags(u.createBlock([e.setEmitFlags(u.createIfStatement(l,u.createThrowStatement(u.createPropertyAccessExpression(l,"error"))),1)]),1))]))}function ue(e){return 0!=(131072&y.getNodeCheckFlags(e))}function _e(t){return e.isForStatement(t)&&!!t.initializer&&ue(t.initializer)}function de(t){return e.isForStatement(t)&&!!t.condition&&ue(t.condition)}function pe(t){return e.isForStatement(t)&&!!t.incrementor&&ue(t.incrementor)}function fe(e){return ge(e)||_e(e)}function ge(e){return 0!=(65536&y.getNodeCheckFlags(e))}function me(t,r){t.hoistedLocalVariables||(t.hoistedLocalVariables=[]),function r(n){if(79===n.kind)t.hoistedLocalVariables.push(n);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||r(o.name);}}(r.name);}function ye(t,r,n){switch(t.kind){case 245:return function(t,r,n){var i=t.condition&&ue(t.condition),a=i||t.incrementor&&ue(t.incrementor);return u.updateForStatement(t,e.visitNode(r?r.part:t.initializer,E,e.isForInitializer),e.visitNode(i?void 0:t.condition,C,e.isExpression),e.visitNode(a?void 0:t.incrementor,E,e.isExpression),n)}(t,r,n);case 246:return function(t,r){return u.updateForInStatement(t,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 247:return function(t,r){return u.updateForOfStatement(t,void 0,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 243:return function(t,r){return u.updateDoStatement(t,r,e.visitNode(t.expression,C,e.isExpression))}(t,n);case 244:return function(t,r){return u.updateWhileStatement(t,e.visitNode(t.expression,C,e.isExpression),r)}(t,n);default:return e.Debug.failBadSyntaxKind(t,"IterationStatement expected")}}function ve(e){return u.createVariableDeclaration(e.originalName,void 0,void 0,e.outParamName)}function he(e,t){var r=0===t?e.outParamName:e.originalName,n=0===t?e.originalName:e.outParamName;return u.createBinaryExpression(n,63,r)}function be(e,t,r,n){for(var i=0,a=e;i<a.length;i++){var o=a[i];o.flags&t&&n.push(u.createExpressionStatement(he(o,r)));}}function xe(t,r,n,i){r?(t.labeledNonLocalBreaks||(t.labeledNonLocalBreaks=new e.Map),t.labeledNonLocalBreaks.set(n,i)):(t.labeledNonLocalContinues||(t.labeledNonLocalContinues=new e.Map),t.labeledNonLocalContinues.set(n,i));}function De(e,t,r,n,i){e&&e.forEach((function(e,a){var o=[];if(!n||n.labels&&n.labels.get(a)){var s=u.createIdentifier(a);o.push(t?u.createBreakStatement(s):u.createContinueStatement(s));}else xe(n,t,a,e),o.push(u.createReturnStatement(r));i.push(u.createCaseClause(u.createStringLiteral(e),o));}));}function Se(t,r,n,i,a){var o=r.name;if(e.isBindingPattern(o))for(var s=0,c=o.elements;s<c.length;s++){var l=c[s];e.isOmittedExpression(l)||Se(t,l,n,i,a);}else {n.push(u.createParameterDeclaration(void 0,void 0,o));var _=y.getNodeCheckFlags(r);if(4194304&_||a){var d=u.createUniqueName("out_"+e.idText(o)),p=0;4194304&_&&(p|=1),e.isForStatement(t)&&(t.initializer&&y.isBindingCapturedByNode(t.initializer,r)&&(p|=2),(t.condition&&y.isBindingCapturedByNode(t.condition,r)||t.incrementor&&y.isBindingCapturedByNode(t.incrementor,r))&&(p|=1)),i.push({flags:p,originalName:o,outParamName:d});}}}function Te(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),e.visitNode(t.initializer,C,e.isExpression));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Ce(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),u.cloneNode(t.name));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Ee(t,r,n,i){var a=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),G(t,t,void 0,n));return e.setTextRange(a,t),i&&e.startOnNewLine(a),a}function ke(r,n){if(32768&r.transformFlags||106===r.expression.kind||e.isSuperProperty(e.skipOuterExpressions(r.expression))){var i=u.createCallBinding(r.expression,g),a=i.target,o=i.thisArg;106===r.expression.kind&&e.setEmitFlags(o,4);var s=void 0;if(s=32768&r.transformFlags?u.createFunctionApplyCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),Ne(r.arguments,!0,!1,!1)):e.setTextRange(u.createFunctionCallCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),e.visitNodes(r.arguments,C,e.isExpression)),r),106===r.expression.kind){var c=u.createLogicalOr(s,O());s=n?u.createAssignment(u.createUniqueName("_this",48),c):c;}return e.setOriginalNode(s,r)}return e.visitEachChild(r,C,t)}function Ne(t,r,n,i){var a=t.length,o=e.flatten(e.spanMap(t,Ae,(function(e,t,r,o){return t(e,n,i&&o===a)})));if(1===o.length){var s=o[0];if(r&&!m.downlevelIteration||e.isPackedArrayLiteral(s.expression)||e.isCallToHelper(s.expression,"___spreadArray"))return s.expression}for(var c=_(),l=0!==o[0].kind,d=l?u.createArrayLiteralExpression():o[0].expression,p=l?0:1;p<o.length;p++){var f=o[p];d=c.createSpreadArrayHelper(d,f.expression,1===f.kind&&!r);}return d}function Ae(t){return e.isSpreadElement(t)?Fe:we}function Fe(t){return e.map(t,Pe)}function Pe(t){var r=e.visitNode(t.expression,C,e.isExpression),n=e.isCallToHelper(r,"___read"),i=n||e.isPackedArrayLiteral(r)?2:1;return !m.downlevelIteration||1!==i||e.isArrayLiteralExpression(r)||n||(r=_().createReadHelper(r,void 0),i=2),c(i,r)}function we(t,r,n){return c(0,u.createArrayLiteralExpression(e.visitNodes(u.createNodeArray(t,n),C,e.isExpression),r))}function Ie(e){return 8&a&&!e?u.createPropertyAccessExpression(u.createUniqueName("_super",48),"prototype"):u.createUniqueName("_super",48)}function Oe(){0==(2&l)&&(l|=2,t.enableSubstitution(79));}function Me(){0==(1&l)&&(l|=1,t.enableSubstitution(108),t.enableEmitNotification(173),t.enableEmitNotification(171),t.enableEmitNotification(174),t.enableEmitNotification(175),t.enableEmitNotification(216),t.enableEmitNotification(215),t.enableEmitNotification(259));}function Le(t,r){return e.isStatic(r)?u.getInternalName(t):u.createPropertyAccessExpression(u.getInternalName(t),"prototype")}};}(t),function(e){e.transformES5=function(t){var r,n,i=t.factory,a=t.getCompilerOptions();1!==a.jsx&&3!==a.jsx||(r=t.onEmitNode,t.onEmitNode=function(t,i,a){switch(i.kind){case 283:case 284:case 282:var o=i.tagName;n[e.getOriginalNodeId(o)]=!0;}r(t,i,a);},t.enableEmitNotification(283),t.enableEmitNotification(284),t.enableEmitNotification(282),n=[]);var o=t.onSubstituteNode;return t.onSubstituteNode=function(t,r){return r.id&&n&&n[r.id]?o(t,r):(r=o(t,r),e.isPropertyAccessExpression(r)?function(t){if(e.isPrivateIdentifier(t.name))return t;var r=s(t.name);return r?e.setTextRange(i.createElementAccessExpression(t.expression,r),t):t}(r):e.isPropertyAssignment(r)?function(t){var r=e.isIdentifier(t.name)&&s(t.name);return r?i.updatePropertyAssignment(t,r,t.initializer):t}(r):r)},t.enableSubstitution(208),t.enableSubstitution(299),e.chainBundle(t,(function(e){return e}));function s(t){var r=t.originalKeywordKind||(e.nodeIsSynthesized(t)?e.stringToToken(e.idText(t)):void 0);if(void 0!==r&&r>=81&&r<=116)return e.setTextRange(i.createStringLiteralFromNode(t),t)}};}(t),function(e){var t,r,i,a,o;!function(e){e[e.Nop=0]="Nop",e[e.Statement=1]="Statement",e[e.Assign=2]="Assign",e[e.Break=3]="Break",e[e.BreakWhenTrue=4]="BreakWhenTrue",e[e.BreakWhenFalse=5]="BreakWhenFalse",e[e.Yield=6]="Yield",e[e.YieldStar=7]="YieldStar",e[e.Return=8]="Return",e[e.Throw=9]="Throw",e[e.Endfinally=10]="Endfinally";}(t||(t={})),function(e){e[e.Open=0]="Open",e[e.Close=1]="Close";}(r||(r={})),function(e){e[e.Exception=0]="Exception",e[e.With=1]="With",e[e.Switch=2]="Switch",e[e.Loop=3]="Loop",e[e.Labeled=4]="Labeled";}(i||(i={})),function(e){e[e.Try=0]="Try",e[e.Catch=1]="Catch",e[e.Finally=2]="Finally",e[e.Done=3]="Done";}(a||(a={})),function(e){e[e.Next=0]="Next",e[e.Throw=1]="Throw",e[e.Return=2]="Return",e[e.Break=3]="Break",e[e.Yield=4]="Yield",e[e.YieldStar=5]="YieldStar",e[e.Catch=6]="Catch",e[e.Endfinally=7]="Endfinally";}(o||(o={})),e.transformGenerators=function(t){var r,i,a,o,s,c,l,u,_,d,p=t.factory,f=t.getEmitHelperFactory,g=t.resumeLexicalEnvironment,m=t.endLexicalEnvironment,y=t.hoistFunctionDeclaration,v=t.hoistVariableDeclaration,h=t.getCompilerOptions(),b=e.getEmitScriptTarget(h),x=t.getEmitResolver(),D=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=D(t,n),1===t?function(t){return e.isIdentifier(t)?function(t){if(!e.isGeneratedIdentifier(t)&&r&&r.has(e.idText(t))){var n=e.getOriginalNode(t);if(e.isIdentifier(n)&&n.parent){var a=x.getReferencedValueDeclaration(n);if(a){var o=i[e.getOriginalNodeId(a)];if(o){var s=e.setParent(e.setTextRange(p.cloneNode(o),o),o.parent);return e.setSourceMapRange(s,t),e.setCommentRange(s,t),s}}}}return t}(t):t}(n):n};var S,T,C,E,k,N,A,F,P,w,I,O,M=1,L=0,R=0;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||0==(2048&r.transformFlags))return r;var n=e.visitEachChild(r,B,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function B(r){var n=r.transformFlags;return o?function(r){switch(r.kind){case 243:case 244:return function(r){return o?(oe(),r=e.visitEachChild(r,B,t),ce(),r):e.visitEachChild(r,B,t)}(r);case 252:return function(r){return o&&re({kind:2,isScript:!0,breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&le(),r}(r);case 253:return function(r){return o&&re({kind:4,isScript:!0,labelText:e.idText(r.label),breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&ue(),r}(r);default:return j(r)}}(r):a?j(r):e.isFunctionLikeDeclaration(r)&&r.asteriskToken?function(t){switch(t.kind){case 259:return J(t);case 215:return z(t);default:return e.Debug.failBadSyntaxKind(t)}}(r):2048&n?e.visitEachChild(r,B,t):r}function j(r){switch(r.kind){case 259:return J(r);case 215:return z(r);case 174:case 175:return function(r){var n=a,i=o;return a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i,r}(r);case 240:return function(t){if(1048576&t.transformFlags)G(t.declarationList);else {if(1048576&e.getEmitFlags(t))return t;for(var r=0,n=t.declarationList.declarations;r<n.length;r++){var i=n[r];v(i.name);}var a=e.getInitializedVariables(t.declarationList);if(0!==a.length)return e.setSourceMapRange(p.createExpressionStatement(p.inlineExpressions(e.map(a,Q))),t)}}(r);case 245:return function(r){o&&oe();var n=r.initializer;if(n&&e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}var c=e.getInitializedVariables(n);r=p.updateForStatement(r,c.length>0?p.inlineExpressions(e.map(c,Q)):void 0,e.visitNode(r.condition,B,e.isExpression),e.visitNode(r.incrementor,B,e.isExpression),e.visitIterationBody(r.statement,B,t));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 246:return function(r){o&&oe();var n=r.initializer;if(e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}r=p.updateForInStatement(r,n.declarations[0].name,e.visitNode(r.expression,B,e.isExpression),e.visitNode(r.statement,B,e.isStatement,p.liftToBlock));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 249:return function(r){if(o){var n=ge(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 248:return function(r){if(o){var n=me(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 250:return function(t){return r=e.visitNode(t.expression,B,e.isExpression),n=t,e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(r?[ve(2),r]:[ve(2)])),n);var r,n;}(r);default:return 1048576&r.transformFlags?function(r){switch(r.kind){case 223:return function(r){var n=e.getExpressionAssociativity(r);switch(n){case 0:return function(r){return X(r.right)?e.isLogicalOperator(r.operatorToken.kind)?function(t){var r=ee(),n=$();return De(n,e.visitNode(t.left,B,e.isExpression),t.left),55===t.operatorToken.kind?Ce(r,n,t.left):Te(r,n,t.left),De(n,e.visitNode(t.right,B,e.isExpression),t.right),te(r),n}(r):27===r.operatorToken.kind?K(r):p.updateBinaryExpression(r,Z(e.visitNode(r.left,B,e.isExpression)),r.operatorToken,e.visitNode(r.right,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 1:return function(r){var n=r.left,i=r.right;if(X(i)){var a=void 0;switch(n.kind){case 208:a=p.updatePropertyAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),n.name);break;case 209:a=p.updateElementAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),Z(e.visitNode(n.argumentExpression,B,e.isExpression)));break;default:a=e.visitNode(n,B,e.isExpression);}var o=r.operatorToken.kind;return e.isCompoundAssignment(o)?e.setTextRange(p.createAssignment(a,e.setTextRange(p.createBinaryExpression(Z(a),e.getNonAssignmentOperatorForCompoundAssignment(o),e.visitNode(i,B,e.isExpression)),r)),r):p.updateBinaryExpression(r,a,r.operatorToken,e.visitNode(i,B,e.isExpression))}return e.visitEachChild(r,B,t)}(r);default:return e.Debug.assertNever(n)}}(r);case 354:return function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];e.isBinaryExpression(a)&&27===a.operatorToken.kind?r.push(K(a)):(X(a)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(a,B,e.isExpression)));}return p.inlineExpressions(r)}(r);case 224:return function(r){if(X(r.whenTrue)||X(r.whenFalse)){var n=ee(),i=ee(),a=$();return Ce(n,e.visitNode(r.condition,B,e.isExpression),r.condition),De(a,e.visitNode(r.whenTrue,B,e.isExpression),r.whenTrue),Se(i),te(n),De(a,e.visitNode(r.whenFalse,B,e.isExpression),r.whenFalse),te(i),a}return e.visitEachChild(r,B,t)}(r);case 226:return function(t){var r,n=ee(),i=e.visitNode(t.expression,B,e.isExpression);return t.asteriskToken?function(e,t){Ee(7,[e],t);}(0==(8388608&e.getEmitFlags(t.expression))?e.setTextRange(f().createValuesHelper(i),t):i,t):function(e,t){Ee(6,[e],t);}(i,t),te(n),r=t,e.setTextRange(p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[]),r)}(r);case 206:return function(e){return V(e.elements,void 0,void 0,e.multiLine)}(r);case 207:return function(t){var r=t.properties,n=t.multiLine,i=Y(r),a=$();De(a,p.createObjectLiteralExpression(e.visitNodes(r,B,e.isObjectLiteralElementLike,0,i),n));var o=e.reduceLeft(r,(function(r,i){X(i)&&r.length>0&&(xe(p.createExpressionStatement(p.inlineExpressions(r))),r=[]);var o=e.createExpressionForObjectLiteralElementLike(p,t,i,a),s=e.visitNode(o,B,e.isExpression);return s&&(n&&e.startOnNewLine(s),r.push(s)),r}),[],i);return o.push(n?e.startOnNewLine(e.setParent(e.setTextRange(p.cloneNode(a),a),a.parent)):a),p.inlineExpressions(o)}(r);case 209:return function(r){return X(r.argumentExpression)?p.updateElementAccessExpression(r,Z(e.visitNode(r.expression,B,e.isLeftHandSideExpression)),e.visitNode(r.argumentExpression,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 210:return function(r){if(!e.isImportCall(r)&&e.forEach(r.arguments,X)){var n=p.createCallBinding(r.expression,v,b,!0),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isLeftHandSideExpression)),a,V(r.arguments)),r),r)}return e.visitEachChild(r,B,t)}(r);case 211:return function(r){if(e.forEach(r.arguments,X)){var n=p.createCallBinding(p.createPropertyAccessExpression(r.expression,"bind"),v),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createNewExpression(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isExpression)),a,V(r.arguments,p.createVoidZero())),void 0,[]),r),r)}return e.visitEachChild(r,B,t)}(r);default:return e.visitEachChild(r,B,t)}}(r):4196352&r.transformFlags?e.visitEachChild(r,B,t):r}}function J(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionDeclaration(r.modifiers,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return a?void y(r):r}function z(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionExpression(void 0,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return r}function U(t){var r=[],n=a,i=o,f=s,y=c,v=l,h=u,b=_,x=d,D=M,k=S,N=T,A=C,F=E;a=!0,o=!1,s=void 0,c=void 0,l=void 0,u=void 0,_=void 0,d=void 0,M=1,S=void 0,T=void 0,C=void 0,E=p.createTempVariable(void 0),g();var P=p.copyPrologue(t.statements,r,!1,B);q(t.statements,P);var w=ke();return e.insertStatementsAfterStandardPrologue(r,m()),r.push(p.createReturnStatement(w)),a=n,o=i,s=f,c=y,l=v,u=h,_=b,d=x,M=D,S=k,T=N,C=A,E=F,e.setTextRange(p.createBlock(r,t.multiLine),t)}function K(t){var r=[];return n(t.left),n(t.right),p.inlineExpressions(r);function n(t){e.isBinaryExpression(t)&&27===t.operatorToken.kind?(n(t.left),n(t.right)):(X(t)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(t,B,e.isExpression)));}}function V(t,r,i,a){var o,s=Y(t);if(s>0){o=$();var c=e.visitNodes(t,B,e.isExpression,0,s);De(o,p.createArrayLiteralExpression(r?n$4([r],c,!0):c)),r=void 0;}var l=e.reduceLeft(t,(function(t,i){if(X(i)&&t.length>0){var s=void 0!==o;o||(o=$()),De(o,s?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(t,a)]):p.createArrayLiteralExpression(r?n$4([r],t,!0):t,a)),r=void 0,t=[];}return t.push(e.visitNode(i,B,e.isExpression)),t}),[],s);return o?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(l,a)]):e.setTextRange(p.createArrayLiteralExpression(r?n$4([r],l,!0):l,a),i)}function q(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r;n++)H(e[n]);}function W(t){e.isBlock(t)?q(t.statements):H(t);}function H(n){var a=o;o||(o=X(n)),function(n){switch(n.kind){case 238:return function(t){X(t)?q(t.statements):xe(e.visitNode(t,B,e.isStatement));}(n);case 241:return function(t){xe(e.visitNode(t,B,e.isStatement));}(n);case 242:return function(t){if(X(t))if(X(t.thenStatement)||X(t.elseStatement)){var r=ee(),n=t.elseStatement?ee():void 0;Ce(t.elseStatement?n:r,e.visitNode(t.expression,B,e.isExpression),t.expression),W(t.thenStatement),t.elseStatement&&(Se(r),te(n),W(t.elseStatement)),te(r);}else xe(e.visitNode(t,B,e.isStatement));else xe(e.visitNode(t,B,e.isStatement));}(n);case 243:return function(t){if(X(t)){var r=ee(),n=ee();se(r),te(n),W(t.statement),te(r),Te(n,e.visitNode(t.expression,B,e.isExpression)),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 244:return function(t){if(X(t)){var r=ee(),n=se(r);te(r),Ce(n,e.visitNode(t.expression,B,e.isExpression)),W(t.statement),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 245:return function(t){if(X(t)){var r=ee(),n=ee(),i=se(n);if(t.initializer){var a=t.initializer;e.isVariableDeclarationList(a)?G(a):xe(e.setTextRange(p.createExpressionStatement(e.visitNode(a,B,e.isExpression)),a));}te(r),t.condition&&Ce(i,e.visitNode(t.condition,B,e.isExpression)),W(t.statement),te(n),t.incrementor&&xe(e.setTextRange(p.createExpressionStatement(e.visitNode(t.incrementor,B,e.isExpression)),t.incrementor)),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 246:return function(t){if(X(t)){var r=$(),n=$(),i=$(),a=p.createLoopVariable(),o=t.initializer;v(a),De(r,e.visitNode(t.expression,B,e.isExpression)),De(n,p.createArrayLiteralExpression()),xe(p.createForInStatement(i,r,p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(n,"push"),void 0,[i])))),De(a,p.createNumericLiteral(0));var s=ee(),c=ee(),l=se(c);te(s),Ce(l,p.createLessThan(a,p.createPropertyAccessExpression(n,"length"))),De(i,p.createElementAccessExpression(n,a)),Ce(c,p.createBinaryExpression(i,101,r));var u=void 0;if(e.isVariableDeclarationList(o)){for(var _=0,d=o.declarations;_<d.length;_++){var f=d[_];v(f.name);}u=p.cloneNode(o.declarations[0].name);}else u=e.visitNode(o,B,e.isExpression),e.Debug.assert(e.isLeftHandSideExpression(u));De(u,i),W(t.statement),te(c),xe(p.createExpressionStatement(p.createPostfixIncrement(a))),Se(s),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 248:return function(t){var r=me(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 249:return function(t){var r=ge(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 250:return function(t){Ee(8,[e.visitNode(t.expression,B,e.isExpression)],t);}(n);case 251:return function(t){var r,n,i;X(t)?(r=Z(e.visitNode(t.expression,B,e.isExpression)),n=ee(),i=ee(),te(n),re({kind:1,expression:r,startLabel:n,endLabel:i}),W(t.statement),e.Debug.assert(1===ae()),te(ne().endLabel)):xe(e.visitNode(t,B,e.isStatement));}(n);case 252:return function(t){if(X(t.caseBlock)){for(var r=t.caseBlock,n=r.clauses.length,i=(re({kind:2,isScript:!1,breakLabel:f=ee()}),f),a=Z(e.visitNode(t.expression,B,e.isExpression)),o=[],s=-1,c=0;c<n;c++){var l=r.clauses[c];o.push(ee()),293===l.kind&&-1===s&&(s=c);}for(var u=0,_=[];u<n;){var d=0;for(c=u;c<n;c++)if(292===(l=r.clauses[c]).kind){if(X(l.expression)&&_.length>0)break;_.push(p.createCaseClause(e.visitNode(l.expression,B,e.isExpression),[he(o[c],l.expression)]));}else d++;_.length&&(xe(p.createSwitchStatement(a,p.createCaseBlock(_))),u+=_.length,_=[]),d>0&&(u+=d,d=0);}for(Se(s>=0?o[s]:i),c=0;c<n;c++)te(o[c]),q(r.clauses[c].statements);le();}else xe(e.visitNode(t,B,e.isStatement));var f;}(n);case 253:return function(t){X(t)?(re({kind:4,isScript:!1,labelText:e.idText(t.label),breakLabel:ee()}),W(t.statement),ue()):xe(e.visitNode(t,B,e.isStatement));}(n);case 254:return function(t){var r;Ee(9,[e.visitNode(null!==(r=t.expression)&&void 0!==r?r:p.createVoidZero(),B,e.isExpression)],t);}(n);case 255:return function(n){var a,o;X(n)?(a=ee(),o=ee(),te(a),re({kind:0,state:0,startLabel:a,endLabel:o}),be(),W(n.tryBlock),n.catchClause&&(function(n){var a;if(e.Debug.assert(0===ae()),e.isGeneratedIdentifier(n.name))a=n.name,v(n.name);else {var o=e.idText(n.name);a=$(o),r||(r=new e.Map,i=[],t.enableSubstitution(79)),r.set(o,!0),i[e.getOriginalNodeId(n)]=a;}var s=ie();e.Debug.assert(s.state<1),Se(s.endLabel);var c=ee();te(c),s.state=1,s.catchVariable=a,s.catchLabel=c,De(a,p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[])),be();}(n.catchClause.variableDeclaration),W(n.catchClause.block)),n.finallyBlock&&(function(){e.Debug.assert(0===ae());var t=ie();e.Debug.assert(t.state<2),Se(t.endLabel);var r=ee();te(r),t.state=2,t.finallyLabel=r;}(),W(n.finallyBlock)),function(){e.Debug.assert(0===ae());var t=ne();t.state<2?Se(t.endLabel):Ee(10),te(t.endLabel),be(),t.state=3;}()):xe(e.visitEachChild(n,B,t));}(n);default:xe(e.visitNode(n,B,e.isStatement));}}(n),o=a;}function G(t){for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=p.cloneNode(i.name);e.setCommentRange(a,i.name),v(a);}for(var o=e.getInitializedVariables(t),s=o.length,c=0,l=[];c<s;){for(var u=c;u<s&&!(X((i=o[u]).initializer)&&l.length>0);u++)l.push(Q(i));l.length&&(xe(p.createExpressionStatement(p.inlineExpressions(l))),c+=l.length,l=[]);}}function Q(t){return e.setSourceMapRange(p.createAssignment(e.setSourceMapRange(p.cloneNode(t.name),t.name),e.visitNode(t.initializer,B,e.isExpression)),t)}function X(e){return !!e&&0!=(1048576&e.transformFlags)}function Y(e){for(var t=e.length,r=0;r<t;r++)if(X(e[r]))return r;return -1}function Z(t){if(e.isGeneratedIdentifier(t)||4096&e.getEmitFlags(t))return t;var r=p.createTempVariable(v);return De(r,t,t),r}function $(e){var t=e?p.createUniqueName(e):p.createTempVariable(void 0);return v(t),t}function ee(){_||(_=[]);var e=M;return M++,_[e]=-1,e}function te(t){e.Debug.assert(void 0!==_,"No labels were defined."),_[t]=S?S.length:0;}function re(e){s||(s=[],l=[],c=[],u=[]);var t=l.length;return l[t]=0,c[t]=S?S.length:0,s[t]=e,u.push(e),t}function ne(){var t=ie();if(void 0===t)return e.Debug.fail("beginBlock was never called.");var r=l.length;return l[r]=1,c[r]=S?S.length:0,s[r]=t,u.pop(),t}function ie(){return e.lastOrUndefined(u)}function ae(){var e=ie();return e&&e.kind}function oe(){re({kind:3,isScript:!0,breakLabel:-1,continueLabel:-1});}function se(e){var t=ee();return re({kind:3,isScript:!1,breakLabel:t,continueLabel:e}),t}function ce(){e.Debug.assert(3===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function le(){e.Debug.assert(2===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function ue(){e.Debug.assert(4===ae());var t=ne();t.isScript||te(t.breakLabel);}function _e(e){return 2===e.kind||3===e.kind}function de(e){return 4===e.kind}function pe(e){return 3===e.kind}function fe(e,t){for(var r=t;r>=0;r--){var n=u[r];if(!de(n))break;if(n.labelText===e)return !0}return !1}function ge(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(de(r=u[t])&&r.labelText===e)return r.breakLabel;if(_e(r)&&fe(e,t-1))return r.breakLabel}else for(t=u.length-1;t>=0;t--){var r;if(_e(r=u[t]))return r.breakLabel}return 0}function me(e){if(u)if(e){for(var t=u.length-1;t>=0;t--)if(pe(r=u[t])&&fe(e,t-1))return r.continueLabel}else for(t=u.length-1;t>=0;t--){var r;if(pe(r=u[t]))return r.continueLabel}return 0}function ye(e){if(void 0!==e&&e>0){void 0===d&&(d=[]);var t=p.createNumericLiteral(-1);return void 0===d[e]?d[e]=[t]:d[e].push(t),t}return p.createOmittedExpression()}function ve(t){var r=p.createNumericLiteral(t);return e.addSyntheticTrailingComment(r,3,function(e){switch(e){case 2:return "return";case 3:return "break";case 4:return "yield";case 5:return "yield*";case 7:return "endfinally";default:return}}(t)),r}function he(t,r){return e.Debug.assertLessThan(0,t,"Invalid label"),e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r)}function be(){Ee(0);}function xe(e){e?Ee(1,[e]):be();}function De(e,t,r){Ee(2,[e,t],r);}function Se(e,t){Ee(3,[e],t);}function Te(e,t,r){Ee(4,[e,t],r);}function Ce(e,t,r){Ee(5,[e,t],r);}function Ee(e,t,r){void 0===S&&(S=[],T=[],C=[]),void 0===_&&te(ee());var n=S.length;S[n]=e,T[n]=t,C[n]=r;}function ke(){L=0,R=0,k=void 0,N=!1,A=!1,F=void 0,P=void 0,w=void 0,I=void 0,O=void 0;var t=function(){if(S){for(var t=0;t<S.length;t++)Pe(t);Ne(S.length);}else Ne(0);if(F){var r=p.createPropertyAccessExpression(E,"label"),n=p.createSwitchStatement(r,p.createCaseBlock(F));return [e.startOnNewLine(n)]}return P||[]}();return f().createGeneratorHelper(e.setEmitFlags(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,E)],void 0,p.createBlock(t,t.length>0)),524288))}function Ne(e){(function(e){if(!A)return !0;if(!_||!d)return !1;for(var t=0;t<_.length;t++)if(_[t]===e&&d[t])return !0;return !1})(e)&&(Fe(e),O=void 0,Ie(void 0,void 0)),P&&F&&Ae(!1),function(){if(void 0!==d&&void 0!==k)for(var e=0;e<k.length;e++){var t=k[e];if(void 0!==t)for(var r=0,n=t;r<n.length;r++){var i=n[r],a=d[i];if(void 0!==a)for(var o=0,s=a;o<s.length;o++)s[o].text=String(e);}}}();}function Ae(e){if(F||(F=[]),P){if(O)for(var t=O.length-1;t>=0;t--){var r=O[t];P=[p.createWithStatement(r.expression,p.createBlock(P))];}if(I){var n=I.startLabel,i=I.catchLabel,a=I.finallyLabel,o=I.endLabel;P.unshift(p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(p.createPropertyAccessExpression(E,"trys"),"push"),void 0,[p.createArrayLiteralExpression([ye(n),ye(i),ye(a),ye(o)])]))),I=void 0;}e&&P.push(p.createExpressionStatement(p.createAssignment(p.createPropertyAccessExpression(E,"label"),p.createNumericLiteral(R+1))));}F.push(p.createCaseClause(p.createNumericLiteral(R),P||[])),P=void 0;}function Fe(e){if(_)for(var t=0;t<_.length;t++)_[t]===e&&(P&&(Ae(!N),N=!1,A=!1,R++),void 0===k&&(k=[]),void 0===k[R]?k[R]=[t]:k[R].push(t));}function Pe(t){if(Fe(t),function(e){if(s)for(;L<l.length&&c[L]<=e;L++){var t=s[L],r=l[L];switch(t.kind){case 0:0===r?(w||(w=[]),P||(P=[]),w.push(I),I=t):1===r&&(I=w.pop());break;case 1:0===r?(O||(O=[]),O.push(t)):1===r&&O.pop();}}}(t),!N){N=!1,A=!1;var r=S[t];if(0!==r){if(10===r)return N=!0,void we(p.createReturnStatement(p.createArrayLiteralExpression([ve(7)])));var n=T[t];if(1===r)return we(n[0]);var i,a,o,u=C[t];switch(r){case 2:return i=n[0],a=n[1],o=u,void we(e.setTextRange(p.createExpressionStatement(p.createAssignment(i,a)),o));case 3:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r),384));}(n[0],u);case 4:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(r,e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 5:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(p.createLogicalNot(r),e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 6:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(4),t]:[ve(4)])),r),384));}(n[0],u);case 7:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(5),t])),r),384));}(n[0],u);case 8:return Ie(n[0],u);case 9:return function(t,r){N=!0,A=!0,we(e.setTextRange(p.createThrowStatement(t),r));}(n[0],u)}}}}function we(e){e&&(P?P.push(e):P=[e]);}function Ie(t,r){N=!0,A=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(2),t]:[ve(2)])),r),384));}};}(t),function(e){e.transformModule=function(r){var i=r.factory,a=r.getEmitHelperFactory,o=r.startLexicalEnvironment,s=r.endLexicalEnvironment,c=r.hoistVariableDeclaration,l=r.getCompilerOptions(),u=r.getEmitResolver(),_=r.getEmitHost(),d=e.getEmitScriptTarget(l),p=e.getEmitModuleKind(l),f=r.onSubstituteNode,g=r.onEmitNode;r.onSubstituteNode=function(t,r){return (r=f(t,r)).id&&x[r.id]?r:1===t?function(t){switch(t.kind){case 79:return Z(t);case 210:return function(t){if(e.isIdentifier(t.expression)){var r=Z(t.expression);if(x[e.getNodeId(r)]=!0,!(e.isIdentifier(r)||4096&e.getEmitFlags(t.expression)))return e.addEmitFlags(i.updateCallExpression(t,r,void 0,t.arguments),536870912)}return t}(t);case 212:return function(t){if(e.isIdentifier(t.tag)){var r=Z(t.tag);if(x[e.getNodeId(r)]=!0,!(e.isIdentifier(r)||4096&e.getEmitFlags(t.tag)))return e.addEmitFlags(i.updateTaggedTemplateExpression(t,r,void 0,t.template),536870912)}return t}(t);case 223:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=$(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++){var o=a[i];x[e.getNodeId(n)]=!0,n=X(o,n,t);}return n}}return t}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){var r=t.name,n=Z(r);if(n!==r){if(t.objectAssignmentInitializer){var a=i.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(i.createPropertyAssignment(r,a),t)}return e.setTextRange(i.createPropertyAssignment(r,n),t)}return t}(r):r},r.onEmitNode=function(t,r,n){308===r.kind?(m=r,y=h[e.getOriginalNodeId(m)],g(t,r,n),m=void 0,y=void 0):g(t,r,n);},r.enableSubstitution(210),r.enableSubstitution(212),r.enableSubstitution(79),r.enableSubstitution(223),r.enableSubstitution(300),r.enableEmitNotification(308);var m,y,v,h=[],b=[],x=[];return e.chainBundle(r,(function(t){if(t.isDeclarationFile||!(e.isEffectiveExternalModule(t,l)||8388608&t.transformFlags||e.isJsonSourceFile(t)&&e.hasJsonModuleEmitEnabled(l)&&e.outFile(l)))return t;m=t,y=e.collectExternalModuleInfo(r,t,u,l),h[e.getOriginalNodeId(t)]=y;var n=function(t){switch(t){case e.ModuleKind.AMD:return T;case e.ModuleKind.UMD:return C;default:return S}}(p),i=n(t);return m=void 0,y=void 0,v=!1,i}));function D(){return !(y.exportEquals||!e.isExternalModule(m))}function S(t){o();var n=[],a=e.getStrictOptionValue(l,"alwaysStrict")||!l.noImplicitUseStrict&&e.isExternalModule(m),c=i.copyPrologue(t.statements,n,a&&!e.isJsonSourceFile(t),F);if(D()&&e.append(n,Q()),e.length(y.exportedNames))for(var u=0;u<y.exportedNames.length;u+=50)e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames.slice(u,u+50),(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero())));e.append(n,e.visitNode(y.externalHelpersImportDeclaration,F,e.isStatement)),e.addRange(n,e.visitNodes(t.statements,F,e.isStatement,c)),A(n,!1),e.insertStatementsAfterStandardPrologue(n,s());var _=i.updateSourceFile(t,e.setTextRange(i.createNodeArray(n),t.statements));return e.addEmitHelpers(_,r.readEmitHelpers()),_}function T(t){var a=i.createIdentifier("define"),o=e.tryGetModuleNameFromFile(i,t,_,l),s=e.isJsonSourceFile(t)&&t,c=E(t,!0),u=c.aliasedModuleNames,d=c.unaliasedModuleNames,p=c.importAliasNames,f=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(a,void 0,n$4(n$4([],o?[o]:[],!0),[i.createArrayLiteralExpression(s?e.emptyArray:n$4(n$4([i.createStringLiteral("require"),i.createStringLiteral("exports")],u,!0),d,!0)),s?s.statements.length?s.statements[0].expression:i.createObjectLiteralExpression():i.createFunctionExpression(void 0,void 0,void 0,void 0,n$4([i.createParameterDeclaration(void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,"exports")],p,!0),void 0,N(t))],!1)))]),t.statements));return e.addEmitHelpers(f,r.readEmitHelpers()),f}function C(t){var a=E(t,!1),o=a.aliasedModuleNames,s=a.unaliasedModuleNames,c=a.importAliasNames,u=e.tryGetModuleNameFromFile(i,t,_,l),d=i.createFunctionExpression(void 0,void 0,void 0,void 0,[i.createParameterDeclaration(void 0,void 0,"factory")],void 0,e.setTextRange(i.createBlock([i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("module"),"object"),i.createTypeCheck(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),"object")),i.createBlock([i.createVariableStatement(void 0,[i.createVariableDeclaration("v",void 0,void 0,i.createCallExpression(i.createIdentifier("factory"),void 0,[i.createIdentifier("require"),i.createIdentifier("exports")]))]),e.setEmitFlags(i.createIfStatement(i.createStrictInequality(i.createIdentifier("v"),i.createIdentifier("undefined")),i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),i.createIdentifier("v")))),1)]),i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("define"),"function"),i.createPropertyAccessExpression(i.createIdentifier("define"),"amd")),i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("define"),void 0,n$4(n$4([],u?[u]:[],!0),[i.createArrayLiteralExpression(n$4(n$4([i.createStringLiteral("require"),i.createStringLiteral("exports")],o,!0),s,!0)),i.createIdentifier("factory")],!1)))])))],!0),void 0)),p=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(d,void 0,[i.createFunctionExpression(void 0,void 0,void 0,void 0,n$4([i.createParameterDeclaration(void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,"exports")],c,!0),void 0,N(t))]))]),t.statements));return e.addEmitHelpers(p,r.readEmitHelpers()),p}function E(t,r){for(var n=[],a=[],o=[],s=0,c=t.amdDependencies;s<c.length;s++){var d=c[s];d.name?(n.push(i.createStringLiteral(d.path)),o.push(i.createParameterDeclaration(void 0,void 0,d.name))):a.push(i.createStringLiteral(d.path));}for(var p=0,f=y.externalImports;p<f.length;p++){var g=f[p],v=e.getExternalModuleNameLiteral(i,g,m,_,u,l),h=e.getLocalNameForExternalImport(i,g,m);v&&(r&&h?(e.setEmitFlags(h,4),n.push(v),o.push(i.createParameterDeclaration(void 0,void 0,h))):a.push(v));}return {aliasedModuleNames:n,unaliasedModuleNames:a,importAliasNames:o}}function k(t){if(!e.isImportEqualsDeclaration(t)&&!e.isExportDeclaration(t)&&e.getExternalModuleNameLiteral(i,t,m,_,u,l)){var r=e.getLocalNameForExternalImport(i,t,m),n=R(t,r);if(n!==r)return i.createExpressionStatement(i.createAssignment(r,n))}}function N(r){o();var n=[],a=i.copyPrologue(r.statements,n,!l.noImplicitUseStrict,F);D()&&e.append(n,Q()),e.length(y.exportedNames)&&e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames,(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero()))),e.append(n,e.visitNode(y.externalHelpersImportDeclaration,F,e.isStatement)),p===e.ModuleKind.AMD&&e.addRange(n,e.mapDefined(y.externalImports,k)),e.addRange(n,e.visitNodes(r.statements,F,e.isStatement,a)),A(n,!0),e.insertStatementsAfterStandardPrologue(n,s());var c=i.createBlock(n,!0);return v&&e.addEmitHelper(c,t),c}function A(t,r){if(y.exportEquals){var n=e.visitNode(y.exportEquals.expression,w);if(n)if(r){var a=i.createReturnStatement(n);e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1920),t.push(a);}else a=i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),n)),e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1536),t.push(a);}}function F(t){switch(t.kind){case 269:return function(t){var r,n=e.getNamespaceDeclarationNode(t);if(p!==e.ModuleKind.AMD){if(!t.importClause)return e.setOriginalNode(e.setTextRange(i.createExpressionStatement(B(t)),t),t);var a=[];n&&!e.isDefaultImport(t)?a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,R(t,B(t)))):(a.push(i.createVariableDeclaration(i.getGeneratedNameForNode(t),void 0,void 0,R(t,B(t)))),n&&e.isDefaultImport(t)&&a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)))),r=e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList(a,d>=2?2:0)),t),t));}else n&&e.isDefaultImport(t)&&(r=e.append(r,i.createVariableStatement(void 0,i.createVariableDeclarationList([e.setOriginalNode(e.setTextRange(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)),t),t)],d>=2?2:0))));if(z(t)){var o=e.getOriginalNodeId(t);b[o]=U(b[o],t);}else r=U(r,t);return e.singleOrMany(r)}(t);case 268:return function(t){var r;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),p!==e.ModuleKind.AMD?r=e.hasSyntacticModifier(t,1)?e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(t.name,B(t))),t),t)):e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(i.cloneNode(t.name),void 0,void 0,B(t))],d>=2?2:0)),t),t)):e.hasSyntacticModifier(t,1)&&(r=e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(t),i.getLocalName(t))),t),t))),z(t)){var n=e.getOriginalNodeId(t);b[n]=K(b[n],t);}else r=K(r,t);return e.singleOrMany(r)}(t);case 275:return function(t){if(t.moduleSpecifier){var r=i.getGeneratedNameForNode(t);if(t.exportClause&&e.isNamedExports(t.exportClause)){var n=[];p!==e.ModuleKind.AMD&&n.push(e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(r,void 0,void 0,B(t))])),t),t));for(var o=0,s=t.exportClause.elements;o<s.length;o++){var c=s[o];if(0===d)n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createCreateBindingHelper(r,i.createStringLiteralFromNode(c.propertyName||c.name),c.propertyName?i.createStringLiteralFromNode(c.name):void 0)),c),c));else {var u=!(!e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)||"default"!==e.idText(c.propertyName||c.name)),_=i.createPropertyAccessExpression(u?a().createImportDefaultHelper(r):r,c.propertyName||c.name);n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(c),_,void 0,!0)),c),c));}}return e.singleOrMany(n)}return t.exportClause?((n=[]).push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.cloneNode(t.exportClause.name),function(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getExportNeedsImportStarHelper(t)?a().createImportStarHelper(r):r}(t,p!==e.ModuleKind.AMD?B(t):e.isExportNamespaceAsDefaultDeclaration(t)?r:i.createIdentifier(e.idText(t.exportClause.name))))),t),t)),e.singleOrMany(n)):e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createExportStarHelper(p!==e.ModuleKind.AMD?B(t):r)),t),t)}}(t);case 274:return function(t){if(!t.isExportEquals){var r,n=t.original;if(n&&z(n)){var a=e.getOriginalNodeId(t);b[a]=G(b[a],i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);}else r=G(r,i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);return e.singleOrMany(r)}}(t);case 240:return function(t){var n,a,o;if(e.hasSyntacticModifier(t,1)){for(var s=void 0,c=!1,l=0,u=t.declarationList.declarations;l<u.length;l++){var _=u[l];if(e.isIdentifier(_.name)&&e.isLocalName(_.name))s||(s=e.visitNodes(t.modifiers,Y,e.isModifier)),a=e.append(a,_);else if(_.initializer)if(!e.isBindingPattern(_.name)&&(e.isArrowFunction(_.initializer)||e.isFunctionExpression(_.initializer)||e.isClassExpression(_.initializer))){var d=i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),_.name),_.name),i.createIdentifier(e.getTextOfIdentifierOrLiteral(_.name))),p=i.createVariableDeclaration(_.name,_.exclamationToken,_.type,e.visitNode(_.initializer,w));a=e.append(a,p),o=e.append(o,d),c=!0;}else o=e.append(o,J(_));}if(a&&(n=e.append(n,i.updateVariableStatement(t,s,i.updateVariableDeclarationList(t.declarationList,a)))),o){var f=e.setOriginalNode(e.setTextRange(i.createExpressionStatement(i.inlineExpressions(o)),t),t);c&&e.removeAllComments(f),n=e.append(n,f);}}else n=e.append(n,e.visitEachChild(t,w,r));if(z(t)){var g=e.getOriginalNodeId(t);b[g]=V(b[g],t);}else n=V(n,t);return e.singleOrMany(n)}(t);case 259:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createFunctionDeclaration(e.visitNodes(t.modifiers,Y,e.isModifier),t.asteriskToken,i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.parameters,w),void 0,e.visitEachChild(t.body,w,r)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 260:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createClassDeclaration(e.visitNodes(t.modifiers,Y,e.isModifierLike),i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.heritageClauses,w),e.visitNodes(t.members,w)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 355:return function(t){if(z(t)&&240===t.original.kind){var r=e.getOriginalNodeId(t);b[r]=V(b[r],t.original);}return t}(t);case 356:return function(t){var r=e.getOriginalNodeId(t),n=b[r];return n?(delete b[r],e.append(n,t)):t}(t);default:return w(t)}}function P(t,n){if(!(276828160&t.transformFlags))return t;switch(t.kind){case 245:return function(t){return i.updateForStatement(t,e.visitNode(t.initializer,I,e.isForInitializer),e.visitNode(t.condition,w,e.isExpression),e.visitNode(t.incrementor,I,e.isExpression),e.visitIterationBody(t.statement,w,r))}(t);case 241:return function(t){return i.updateExpressionStatement(t,e.visitNode(t.expression,I,e.isExpression))}(t);case 214:return function(t,r){return i.updateParenthesizedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 353:return function(t,r){return i.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 210:if(e.isImportCall(t)&&void 0===m.impliedNodeFormat)return function(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=e.visitNode(e.firstOrUndefined(t.arguments),w),a=!r||n&&e.isStringLiteral(n)&&n.text===r.text?n:r,o=!!(16384&t.transformFlags);switch(l.module){case e.ModuleKind.AMD:return M(a,o);case e.ModuleKind.UMD:return function(t,r){if(v=!0,e.isSimpleCopiableExpression(t)){var n=e.isGeneratedIdentifier(t)?t:e.isStringLiteral(t)?i.createStringLiteralFromNode(t):e.setEmitFlags(e.setTextRange(i.cloneNode(t),t),1536);return i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(t),void 0,M(n,r))}var a=i.createTempVariable(c);return i.createComma(i.createAssignment(a,t),i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(a,!0),void 0,M(a,r)))}(null!=a?a:i.createVoidZero(),o);case e.ModuleKind.CommonJS:default:return L(a)}}(t);break;case 223:if(e.isDestructuringAssignment(t))return function(t,n){return O(t.left)?e.flattenDestructuringAssignment(t,w,r,0,!n,j):e.visitEachChild(t,w,r)}(t,n);break;case 221:case 222:return function(t,n){if((45===t.operator||46===t.operator)&&e.isIdentifier(t.operand)&&!e.isGeneratedIdentifier(t.operand)&&!e.isLocalName(t.operand)&&!e.isDeclarationNameOfEnumOrNamespace(t.operand)){var a=$(t.operand);if(a){var o=void 0,s=e.visitNode(t.operand,w,e.isExpression);e.isPrefixUnaryExpression(t)?s=i.updatePrefixUnaryExpression(t,s):(s=i.updatePostfixUnaryExpression(t,s),n||(o=i.createTempVariable(c),s=i.createAssignment(o,s),e.setTextRange(s,t)),s=i.createComma(s,i.cloneNode(t.operand)),e.setTextRange(s,t));for(var l=0,u=a;l<u.length;l++){var _=u[l];x[e.getNodeId(s)]=!0,s=X(_,s),e.setTextRange(s,t);}return o&&(x[e.getNodeId(s)]=!0,s=i.createComma(s,o),e.setTextRange(s,t)),s}}return e.visitEachChild(t,w,r)}(t,n)}return e.visitEachChild(t,w,r)}function w(e){return P(e,!1)}function I(e){return P(e,!0)}function O(t){if(e.isObjectLiteralExpression(t))for(var r=0,n=t.properties;r<n.length;r++)switch((o=n[r]).kind){case 299:if(O(o.initializer))return !0;break;case 300:if(O(o.name))return !0;break;case 301:if(O(o.expression))return !0;break;case 171:case 174:case 175:return !1;default:e.Debug.assertNever(o,"Unhandled object member kind");}else if(e.isArrayLiteralExpression(t))for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(e.isSpreadElement(o)){if(O(o.expression))return !0}else if(O(o))return !0}else if(e.isIdentifier(t))return e.length($(t))>(e.isExportName(t)?1:0);return !1}function M(t,r){var n,o=i.createUniqueName("resolve"),s=i.createUniqueName("reject"),c=[i.createParameterDeclaration(void 0,void 0,o),i.createParameterDeclaration(void 0,void 0,s)],u=i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("require"),void 0,[i.createArrayLiteralExpression([t||i.createOmittedExpression()]),o,s]))]);d>=2?n=i.createArrowFunction(void 0,void 0,c,void 0,void 0,u):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,u),r&&e.setEmitFlags(n,8));var _=i.createNewExpression(i.createIdentifier("Promise"),void 0,[n]);return e.getESModuleInterop(l)?i.createCallExpression(i.createPropertyAccessExpression(_,i.createIdentifier("then")),void 0,[a().createImportStarCallbackHelper()]):_}function L(t,r){var n,o=!t||e.isSimpleInlineableExpression(t)||r?void 0:i.createTempVariable(c),s=i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Promise"),"resolve"),void 0,[]),u=i.createCallExpression(i.createIdentifier("require"),void 0,o?[o]:t?[t]:[]);e.getESModuleInterop(l)&&(u=a().createImportStarHelper(u)),n=d>=2?i.createArrowFunction(void 0,void 0,[],void 0,void 0,u):i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(u)]));var _=i.createCallExpression(i.createPropertyAccessExpression(s,"then"),void 0,[n]);return void 0===o?_:i.createCommaListExpression([i.createAssignment(o,t),_])}function R(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getImportNeedsImportStarHelper(t)?a().createImportStarHelper(r):e.getImportNeedsImportDefaultHelper(t)?a().createImportDefaultHelper(r):r}function B(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=[];return r&&n.push(r),i.createCallExpression(i.createIdentifier("require"),void 0,n)}function j(t,r,n){var a=$(t);if(a){for(var o=e.isExportName(t)?r:i.createAssignment(t,r),s=0,c=a;s<c.length;s++){var l=c[s];e.setEmitFlags(o,4),o=X(l,o,n);}return o}return i.createAssignment(t,r)}function J(t){return e.isBindingPattern(t.name)?e.flattenDestructuringAssignment(e.visitNode(t,w),void 0,r,0,!1,j):i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),t.name),t.name),t.initializer?e.visitNode(t.initializer,w):i.createVoidZero())}function z(t){return 0!=(4194304&e.getEmitFlags(t))}function U(e,t){if(y.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=H(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 271:e=H(e,n);break;case 272:for(var i=0,a=n.elements;i<a.length;i++)e=H(e,a[i],!0);}return e}function K(e,t){return y.exportEquals?e:H(e,t)}function V(e,t){if(y.exportEquals)return e;for(var r=0,n=t.declarationList.declarations;r<n.length;r++)e=q(e,n[r]);return e}function q(t,r){if(y.exportEquals)return t;if(e.isBindingPattern(r.name))for(var n=0,i=r.name.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||(t=q(t,a));}else e.isGeneratedIdentifier(r.name)||(t=H(t,r));return t}function W(t,r){return y.exportEquals||(e.hasSyntacticModifier(r,1)&&(t=G(t,e.hasSyntacticModifier(r,1024)?i.createIdentifier("default"):i.getDeclarationName(r),i.getLocalName(r),r)),r.name&&(t=H(t,r))),t}function H(t,r,n){var a=i.getDeclarationName(r),o=y.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];t=G(t,l.name,a,l.name,void 0,n);}return t}function G(t,r,n,a,o,s){return t=e.append(t,function(t,r,n,a,o){var s=e.setTextRange(i.createExpressionStatement(X(t,r,void 0,o)),n);return e.startOnNewLine(s),a||e.setEmitFlags(s,1536),s}(r,n,a,o,s)),t}function Q(){var t;return t=0===d?i.createExpressionStatement(X(i.createIdentifier("__esModule"),i.createTrue())):i.createExpressionStatement(i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteral("__esModule"),i.createObjectLiteralExpression([i.createPropertyAssignment("value",i.createTrue())])])),e.setEmitFlags(t,1048576),t}function X(t,r,n,a){return e.setTextRange(a&&0!==d?i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteralFromNode(t),i.createObjectLiteralExpression([i.createPropertyAssignment("enumerable",i.createTrue()),i.createPropertyAssignment("get",i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(r)])))])]):i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),r),n)}function Y(e){switch(e.kind){case 93:case 88:return}return e}function Z(t){var r,n;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(m);return a?i.createPropertyAccessExpression(a,t):t}if((!e.isGeneratedIdentifier(t)||64&t.autoGenerateFlags)&&!e.isLocalName(t)){var o=u.getReferencedExportContainer(t,e.isExportName(t));if(o&&308===o.kind)return e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),t);var s=u.getReferencedImportDeclaration(t);if(s){if(e.isImportClause(s))return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode(s.parent),i.createIdentifier("default")),t);if(e.isImportSpecifier(s)){var c=s.propertyName||s.name;return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode((null===(n=null===(r=s.parent)||void 0===r?void 0:r.parent)||void 0===n?void 0:n.parent)||s),i.cloneNode(c)),t)}}}return t}function $(t){if(!e.isGeneratedIdentifier(t)){var r=u.getReferencedImportDeclaration(t)||u.getReferencedValueDeclaration(t);if(r)return y&&y.exportedBindings[e.getOriginalNodeId(r)]}}};var t={name:"typescript:dynamicimport-sync-require",scoped:!0,text:'\n      var __syncRequire = typeof module === "object" && typeof module.exports === "object";'};}(t),function(e){e.transformSystemModule=function(t){var r=t.factory,n=t.startLexicalEnvironment,i=t.endLexicalEnvironment,a=t.hoistVariableDeclaration,o=t.getCompilerOptions(),s=t.getEmitResolver(),c=t.getEmitHost(),l=t.onSubstituteNode,u=t.onEmitNode;t.onSubstituteNode=function(t,n){return function(e){return y&&e.id&&y[e.id]}(n=l(t,n))?n:1===t?function(t){switch(t.kind){case 79:return function(t){var n,i;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(_);return a?r.createPropertyAccessExpression(a,t):t}if(!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var o=s.getReferencedImportDeclaration(t);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default")),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name)),t)}}return t}(t);case 223:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=X(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++)n=z(a[i],Y(n));return n}}return t}(t);case 233:return function(t){return e.isImportMeta(t)?r.createPropertyAccessExpression(f,r.createIdentifier("meta")):t}(t)}return t}(n):4===t?function(t){return 300===t.kind?function(t){var n,i,a=t.name;if(!e.isGeneratedIdentifier(a)&&!e.isLocalName(a)){var o=s.getReferencedImportDeclaration(a);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default"))),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name))),t)}}return t}(t):t}(n):n},t.onEmitNode=function(t,r,n){if(308===r.kind){var i=e.getOriginalNodeId(r);_=r,d=v[i],p=b[i],y=x[i],f=D[i],y&&delete x[i],u(t,r,n),_=void 0,d=void 0,p=void 0,f=void 0,y=void 0;}else u(t,r,n);},t.enableSubstitution(79),t.enableSubstitution(300),t.enableSubstitution(223),t.enableSubstitution(233),t.enableEmitNotification(308);var _,d,p,f,g,m,y,v=[],h=[],b=[],x=[],D=[];return e.chainBundle(t,(function(a){if(a.isDeclarationFile||!(e.isEffectiveExternalModule(a,o)||8388608&a.transformFlags))return a;var l=e.getOriginalNodeId(a);_=a,m=a,d=v[l]=e.collectExternalModuleInfo(t,a,s,o),p=r.createUniqueName("exports"),b[l]=p,f=D[l]=r.createUniqueName("context");var u=function(t){for(var n=new e.Map,i=[],a=0,l=t;a<l.length;a++){var u=l[a],d=e.getExternalModuleNameLiteral(r,u,_,c,s,o);if(d){var p=d.text,f=n.get(p);void 0!==f?i[f].externalImports.push(u):(n.set(p,i.length),i.push({name:d,externalImports:[u]}));}}return i}(d.externalImports),h=function(t,a){var s=[];n();var c=e.getStrictOptionValue(o,"alwaysStrict")||!o.noImplicitUseStrict&&e.isExternalModule(_),l=r.copyPrologue(t.statements,s,c,C);s.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration("__moduleName",void 0,void 0,r.createLogicalAnd(f,r.createPropertyAccessExpression(f,"id")))]))),e.visitNode(d.externalHelpersImportDeclaration,C,e.isStatement);var u=e.visitNodes(t.statements,C,e.isStatement,l);e.addRange(s,g),e.insertStatementsAfterStandardPrologue(s,i());var p=function(e){if(d.hasExportStarsToExportValues){if(!d.exportedNames&&0===d.exportSpecifiers.size){for(var t=!1,n=0,i=d.externalImports;n<i.length;n++){var a=i[n];if(275===a.kind&&a.exportClause){t=!0;break}}if(!t){var o=S(void 0);return e.push(o),o.name}}var s=[];if(d.exportedNames)for(var c=0,l=d.exportedNames;c<l.length;c++){var u=l[c];"default"!==u.escapedText&&s.push(r.createPropertyAssignment(r.createStringLiteralFromNode(u),r.createTrue()));}var _=r.createUniqueName("exportedNames");e.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(_,void 0,void 0,r.createObjectLiteralExpression(s,!0))])));var p=S(_);return e.push(p),p.name}}(s),m=2097152&t.transformFlags?r.createModifiersFromModifierFlags(512):void 0,y=r.createObjectLiteralExpression([r.createPropertyAssignment("setters",T(p,a)),r.createPropertyAssignment("execute",r.createFunctionExpression(m,void 0,void 0,void 0,[],void 0,r.createBlock(u,!0)))],!0);return s.push(r.createReturnStatement(y)),r.createBlock(s,!0)}(a,u),E=r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,p),r.createParameterDeclaration(void 0,void 0,f)],void 0,h),k=e.tryGetModuleNameFromFile(r,a,c,o),N=r.createArrayLiteralExpression(e.map(u,(function(e){return e.name}))),A=e.setEmitFlags(r.updateSourceFile(a,e.setTextRange(r.createNodeArray([r.createExpressionStatement(r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("System"),"register"),void 0,k?[k,N,E]:[N,E]))]),a.statements)),1024);return e.outFile(o)||e.moveEmitHelpers(A,h,(function(e){return !e.scoped})),y&&(x[l]=y,y=void 0),_=void 0,d=void 0,p=void 0,f=void 0,g=void 0,m=void 0,A}));function S(t){var n=r.createUniqueName("exportStar"),i=r.createIdentifier("m"),a=r.createIdentifier("n"),o=r.createIdentifier("exports"),s=r.createStrictInequality(a,r.createStringLiteral("default"));return t&&(s=r.createLogicalAnd(s,r.createLogicalNot(r.createCallExpression(r.createPropertyAccessExpression(t,"hasOwnProperty"),void 0,[a])))),r.createFunctionDeclaration(void 0,void 0,n,void 0,[r.createParameterDeclaration(void 0,void 0,i)],void 0,r.createBlock([r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(o,void 0,void 0,r.createObjectLiteralExpression([]))])),r.createForInStatement(r.createVariableDeclarationList([r.createVariableDeclaration(a)]),i,r.createBlock([e.setEmitFlags(r.createIfStatement(s,r.createExpressionStatement(r.createAssignment(r.createElementAccessExpression(o,a),r.createElementAccessExpression(i,a)))),1)])),r.createExpressionStatement(r.createCallExpression(p,void 0,[o]))],!0))}function T(t,n){for(var i=[],a=0,o=n;a<o.length;a++){for(var s=o[a],c=e.forEach(s.externalImports,(function(t){return e.getLocalNameForExternalImport(r,t,_)})),l=c?r.getGeneratedNameForNode(c):r.createUniqueName(""),u=[],d=0,f=s.externalImports;d<f.length;d++){var g=f[d],m=e.getLocalNameForExternalImport(r,g,_);switch(g.kind){case 269:if(!g.importClause)break;case 268:e.Debug.assert(void 0!==m),u.push(r.createExpressionStatement(r.createAssignment(m,l))),e.hasSyntacticModifier(g,1)&&u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createStringLiteral(e.idText(m)),l])));break;case 275:if(e.Debug.assert(void 0!==m),g.exportClause)if(e.isNamedExports(g.exportClause)){for(var y=[],v=0,h=g.exportClause.elements;v<h.length;v++){var b=h[v];y.push(r.createPropertyAssignment(r.createStringLiteral(e.idText(b.name)),r.createElementAccessExpression(l,r.createStringLiteral(e.idText(b.propertyName||b.name)))));}u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createObjectLiteralExpression(y,!0)])));}else u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createStringLiteral(e.idText(g.exportClause.name)),l])));else u.push(r.createExpressionStatement(r.createCallExpression(t,void 0,[l])));}}i.push(r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,l)],void 0,r.createBlock(u,!0)));}return r.createArrayLiteralExpression(i,!0)}function C(t){switch(t.kind){case 269:return function(t){var n;if(t.importClause&&a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=I(h[i],t);}else n=I(n,t);return e.singleOrMany(n)}(t);case 268:return function(t){var n;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=O(h[i],t);}else n=O(n,t);return e.singleOrMany(n)}(t);case 275:return function(t){e.Debug.assertIsDefined(t);}(t);case 274:return function(t){if(!t.isExportEquals){var n=e.visitNode(t.expression,W,e.isExpression),i=t.original;if(!i||!w(i))return J(r.createIdentifier("default"),n,!0);var a=e.getOriginalNodeId(t);h[a]=j(h[a],r.createIdentifier("default"),n,!0);}}(t);default:return U(t)}}function E(t){if(e.isBindingPattern(t.name))for(var n=0,i=t.name.elements;n<i.length;n++){var o=i[n];e.isOmittedExpression(o)||E(o);}else a(r.cloneNode(t.name));}function k(t){return 0==(2097152&e.getEmitFlags(t))&&(308===m.kind||0==(3&e.getOriginalNode(t).flags))}function N(r,n){var i=n?A:F;return e.isBindingPattern(r.name)?e.flattenDestructuringAssignment(r,W,t,0,!1,i):r.initializer?i(r.name,e.visitNode(r.initializer,W,e.isExpression)):r.name}function A(e,t,r){return P(e,t,r,!0)}function F(e,t,r){return P(e,t,r,!1)}function P(t,n,i,o){return a(r.cloneNode(t)),o?z(t,Y(e.setTextRange(r.createAssignment(t,n),i))):Y(e.setTextRange(r.createAssignment(t,n),i))}function w(t){return 0!=(4194304&e.getEmitFlags(t))}function I(e,t){if(d.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=B(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 271:e=B(e,n);break;case 272:for(var i=0,a=n.elements;i<a.length;i++)e=B(e,a[i]);}return e}function O(e,t){return d.exportEquals?e:B(e,t)}function M(e,t,r){if(d.exportEquals)return e;for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];(a.initializer||r)&&(e=L(e,a,r));}return e}function L(t,n,i){if(d.exportEquals)return t;if(e.isBindingPattern(n.name))for(var a=0,o=n.name.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(t=L(t,s,i));}else if(!e.isGeneratedIdentifier(n.name)){var c=void 0;i&&(t=j(t,n.name,r.getLocalName(n)),c=e.idText(n.name)),t=B(t,n,c);}return t}function R(t,n){if(d.exportEquals)return t;var i;if(e.hasSyntacticModifier(n,1)){var a=e.hasSyntacticModifier(n,1024)?r.createStringLiteral("default"):n.name;t=j(t,a,r.getLocalName(n)),i=e.getTextOfIdentifierOrLiteral(a);}return n.name&&(t=B(t,n,i)),t}function B(t,n,i){if(d.exportEquals)return t;var a=r.getDeclarationName(n),o=d.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];l.name.escapedText!==i&&(t=j(t,l.name,a));}return t}function j(t,r,n,i){return e.append(t,J(r,n,i))}function J(t,n,i){var a=r.createExpressionStatement(z(t,n));return e.startOnNewLine(a),i||e.setEmitFlags(a,1536),a}function z(t,n){var i=e.isIdentifier(t)?r.createStringLiteralFromNode(t):t;return e.setEmitFlags(n,1536|e.getEmitFlags(n)),e.setCommentRange(r.createCallExpression(p,void 0,[i,n]),n)}function U(n){switch(n.kind){case 240:return function(t){if(!k(t.declarationList))return e.visitNode(t,W,e.isStatement);for(var n,i,a=e.hasSyntacticModifier(t,1),o=w(t),s=0,c=t.declarationList.declarations;s<c.length;s++){var l=c[s];l.initializer?n=e.append(n,N(l,a&&!o)):E(l);}if(n&&(i=e.append(i,e.setTextRange(r.createExpressionStatement(r.inlineExpressions(n)),t))),o){var u=e.getOriginalNodeId(t);h[u]=M(h[u],t,a);}else i=M(i,t,!1);return e.singleOrMany(i)}(n);case 259:return function(n){if(g=e.hasSyntacticModifier(n,1)?e.append(g,r.updateFunctionDeclaration(n,e.visitNodes(n.modifiers,Q,e.isModifierLike),n.asteriskToken,r.getDeclarationName(n,!0,!0),void 0,e.visitNodes(n.parameters,W,e.isParameterDeclaration),void 0,e.visitNode(n.body,W,e.isBlock))):e.append(g,e.visitEachChild(n,W,t)),w(n)){var i=e.getOriginalNodeId(n);h[i]=R(h[i],n);}else g=R(g,n);}(n);case 260:return function(t){var n,i=r.getLocalName(t);if(a(i),n=e.append(n,e.setTextRange(r.createExpressionStatement(r.createAssignment(i,e.setTextRange(r.createClassExpression(e.visitNodes(t.modifiers,Q,e.isModifierLike),t.name,void 0,e.visitNodes(t.heritageClauses,W,e.isHeritageClause),e.visitNodes(t.members,W,e.isClassElement)),t))),t)),w(t)){var o=e.getOriginalNodeId(t);h[o]=R(h[o],t);}else n=R(n,t);return e.singleOrMany(n)}(n);case 245:return K(n,!0);case 246:return function(n){var i=m;return m=n,n=r.updateForInStatement(n,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 247:return function(n){var i=m;return m=n,n=r.updateForOfStatement(n,n.awaitModifier,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 243:return function(n){return r.updateDoStatement(n,e.visitIterationBody(n.statement,U,t),e.visitNode(n.expression,W,e.isExpression))}(n);case 244:return function(n){return r.updateWhileStatement(n,e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t))}(n);case 253:return function(t){return r.updateLabeledStatement(t,t.label,e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 251:return function(t){return r.updateWithStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 252:return function(t){return r.updateSwitchStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.caseBlock,U,e.isCaseBlock))}(n);case 266:return function(t){var n=m;return m=t,t=r.updateCaseBlock(t,e.visitNodes(t.clauses,U,e.isCaseOrDefaultClause)),m=n,t}(n);case 292:return function(t){return r.updateCaseClause(t,e.visitNode(t.expression,W,e.isExpression),e.visitNodes(t.statements,U,e.isStatement))}(n);case 293:case 255:return function(r){return e.visitEachChild(r,U,t)}(n);case 295:return function(t){var n=m;return m=t,t=r.updateCatchClause(t,t.variableDeclaration,e.visitNode(t.block,U,e.isBlock)),m=n,t}(n);case 238:return function(r){var n=m;return m=r,r=e.visitEachChild(r,U,t),m=n,r}(n);case 355:return function(t){if(w(t)&&240===t.original.kind){var r=e.getOriginalNodeId(t),n=e.hasSyntacticModifier(t.original,1);h[r]=M(h[r],t.original,n);}return t}(n);case 356:return function(t){var r=e.getOriginalNodeId(t),n=h[r];if(n)return delete h[r],e.append(n,t);var i=e.getOriginalNode(t);return e.isModuleOrEnumDeclaration(i)?e.append(B(n,i),t):t}(n);default:return W(n)}}function K(n,i){var a=m;return m=n,n=r.updateForStatement(n,e.visitNode(n.initializer,i?V:H,e.isForInitializer),e.visitNode(n.condition,W,e.isExpression),e.visitNode(n.incrementor,H,e.isExpression),e.visitIterationBody(n.statement,i?U:W,t)),m=a,n}function V(t){if(function(t){return e.isVariableDeclarationList(t)&&k(t)}(t)){for(var n=void 0,i=0,a=t.declarations;i<a.length;i++){var o=a[i];n=e.append(n,N(o,!1)),o.initializer||E(o);}return n?r.inlineExpressions(n):r.createOmittedExpression()}return e.visitNode(t,H,e.isExpression)}function q(n,i){if(!(276828160&n.transformFlags))return n;switch(n.kind){case 245:return K(n,!1);case 241:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,H,e.isExpression))}(n);case 214:return function(t,n){return r.updateParenthesizedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 353:return function(t,n){return r.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 223:if(e.isDestructuringAssignment(n))return function(r,n){return G(r.left)?e.flattenDestructuringAssignment(r,W,t,0,!n):e.visitEachChild(r,W,t)}(n,i);break;case 210:if(e.isImportCall(n))return function(t){var n=e.getExternalModuleNameLiteral(r,t,_,c,s,o),i=e.visitNode(e.firstOrUndefined(t.arguments),W),a=!n||i&&e.isStringLiteral(i)&&i.text===n.text?i:n;return r.createCallExpression(r.createPropertyAccessExpression(f,r.createIdentifier("import")),void 0,a?[a]:[])}(n);break;case 221:case 222:return function(n,i){if((45===n.operator||46===n.operator)&&e.isIdentifier(n.operand)&&!e.isGeneratedIdentifier(n.operand)&&!e.isLocalName(n.operand)&&!e.isDeclarationNameOfEnumOrNamespace(n.operand)){var o=X(n.operand);if(o){var s=void 0,c=e.visitNode(n.operand,W,e.isExpression);e.isPrefixUnaryExpression(n)?c=r.updatePrefixUnaryExpression(n,c):(c=r.updatePostfixUnaryExpression(n,c),i||(s=r.createTempVariable(a),c=r.createAssignment(s,c),e.setTextRange(c,n)),c=r.createComma(c,r.cloneNode(n.operand)),e.setTextRange(c,n));for(var l=0,u=o;l<u.length;l++)c=z(u[l],Y(c));return s&&(c=r.createComma(c,s),e.setTextRange(c,n)),c}}return e.visitEachChild(n,W,t)}(n,i)}return e.visitEachChild(n,W,t)}function W(e){return q(e,!1)}function H(e){return q(e,!0)}function G(t){if(e.isAssignmentExpression(t,!0))return G(t.left);if(e.isSpreadElement(t))return G(t.expression);if(e.isObjectLiteralExpression(t))return e.some(t.properties,G);if(e.isArrayLiteralExpression(t))return e.some(t.elements,G);if(e.isShorthandPropertyAssignment(t))return G(t.name);if(e.isPropertyAssignment(t))return G(t.initializer);if(e.isIdentifier(t)){var r=s.getReferencedExportContainer(t);return void 0!==r&&308===r.kind}return !1}function Q(e){switch(e.kind){case 93:case 88:return}return e}function X(t){var n;if(!e.isGeneratedIdentifier(t)){var i=s.getReferencedImportDeclaration(t)||s.getReferencedValueDeclaration(t);if(i){var a=s.getReferencedExportContainer(t,!1);a&&308===a.kind&&(n=e.append(n,r.getDeclarationName(i))),n=e.addRange(n,d&&d.exportedBindings[e.getOriginalNodeId(i)]);}}return n}function Y(t){return void 0===y&&(y=[]),y[e.getNodeId(t)]=!0,t}};}(t),function(e){e.transformECMAScriptModule=function(t){var r,i,a,o=t.factory,s=t.getEmitHelperFactory,c=t.getEmitHost(),l=t.getEmitResolver(),u=t.getCompilerOptions(),_=e.getEmitScriptTarget(u),d=t.onEmitNode,p=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){e.isSourceFile(n)?((e.isExternalModule(n)||u.isolatedModules)&&u.importHelpers&&(r=new e.Map),d(t,n,i),r=void 0):d(t,n,i);},t.onSubstituteNode=function(t,n){return n=p(t,n),r&&e.isIdentifier(n)&&4096&e.getEmitFlags(n)?function(t){var n=e.idText(t),i=r.get(n);return i||r.set(n,i=o.createUniqueName(n,48)),i}(n):n},t.enableEmitNotification(308),t.enableSubstitution(79),e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;if(e.isExternalModule(r)||u.isolatedModules){i=r,a=void 0;var c=function(r){var n=e.createExternalHelpersImportDeclarationIfNeeded(o,s(),r,u);if(n){var i=[],a=o.copyPrologue(r.statements,i);return e.append(i,n),e.addRange(i,e.visitNodes(r.statements,f,e.isStatement,a)),o.updateSourceFile(r,e.setTextRange(o.createNodeArray(i),r.statements))}return e.visitEachChild(r,f,t)}(r);return i=void 0,a&&(c=o.updateSourceFile(c,e.setTextRange(o.createNodeArray(e.insertStatementsAfterCustomPrologue(c.statements.slice(),a)),c.statements))),!e.isExternalModule(r)||e.some(c.statements,e.isExternalModuleIndicator)?c:o.updateSourceFile(c,e.setTextRange(o.createNodeArray(n$4(n$4([],c.statements,!0),[e.createEmptyExports(o)],!1)),c.statements))}return r}));function f(t){switch(t.kind){case 268:return e.getEmitModuleKind(u)>=e.ModuleKind.Node16?function(t){var r;return e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),r=function(t,r){return e.hasSyntacticModifier(r,1)&&(t=e.append(t,o.createExportDeclaration(void 0,r.isTypeOnly,o.createNamedExports([o.createExportSpecifier(!1,void 0,e.idText(r.name))])))),t}(r=e.append(r,e.setOriginalNode(e.setTextRange(o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(o.cloneNode(t.name),void 0,void 0,g(t))],_>=2?2:0)),t),t)),t),e.singleOrMany(r)}(t):void 0;case 274:return function(e){return e.isExportEquals?void 0:e}(t);case 275:return function(t){if(void 0!==u.module&&u.module>e.ModuleKind.ES2015)return t;if(!t.exportClause||!e.isNamespaceExport(t.exportClause)||!t.moduleSpecifier)return t;var r=t.exportClause.name,n=o.getGeneratedNameForNode(r),i=o.createImportDeclaration(void 0,o.createImportClause(!1,void 0,o.createNamespaceImport(n)),t.moduleSpecifier,t.assertClause);e.setOriginalNode(i,t.exportClause);var a=e.isExportNamespaceAsDefaultDeclaration(t)?o.createExportDefault(n):o.createExportDeclaration(void 0,!1,o.createNamedExports([o.createExportSpecifier(!1,n,r)]));return e.setOriginalNode(a,t),[i,a]}(t)}return t}function g(t){var r=e.getExternalModuleNameLiteral(o,t,e.Debug.checkDefined(i),c,l,u),n=[];if(r&&n.push(r),!a){var s=o.createUniqueName("_createRequire",48),d=o.createImportDeclaration(void 0,o.createImportClause(!1,void 0,o.createNamedImports([o.createImportSpecifier(!1,o.createIdentifier("createRequire"),s)])),o.createStringLiteral("module")),p=o.createUniqueName("__require",48),f=o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(p,void 0,void 0,o.createCallExpression(o.cloneNode(s),void 0,[o.createPropertyAccessExpression(o.createMetaProperty(100,o.createIdentifier("meta")),o.createIdentifier("url"))]))],_>=2?2:0));a=[d,f];}var g=a[1].declarationList.declarations[0].name;return e.Debug.assertNode(g,e.isIdentifier),o.createCallExpression(o.cloneNode(g),void 0,n)}};}(t),function(e){e.transformNodeModule=function(t){var r=t.onSubstituteNode,n=t.onEmitNode,i=e.transformECMAScriptModule(t),a=t.onSubstituteNode,o=t.onEmitNode;t.onSubstituteNode=r,t.onEmitNode=n;var s,c=e.transformModule(t),l=t.onSubstituteNode,u=t.onEmitNode;return t.onSubstituteNode=function(t,n){return e.isSourceFile(n)?(s=n,r(t,n)):s?s.impliedNodeFormat===e.ModuleKind.ESNext?a(t,n):l(t,n):r(t,n)},t.onEmitNode=function(t,r,i){return e.isSourceFile(r)&&(s=r),s?s.impliedNodeFormat===e.ModuleKind.ESNext?o(t,r,i):u(t,r,i):n(t,r,i)},t.enableSubstitution(308),t.enableEmitNotification(308),function(r){return 308===r.kind?_(r):function(r){return t.factory.createBundle(e.map(r.sourceFiles,_),r.prepends)}(r)};function _(t){if(t.isDeclarationFile)return t;s=t;var r=(t.impliedNodeFormat===e.ModuleKind.ESNext?i:c)(t);return s=void 0,e.Debug.assert(e.isSourceFile(r)),r}};}(t),function(e){function t(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isPropertyAccessExpression(t)||e.isBindingElement(t)||e.isConstructorDeclaration(t)?r:e.isSetAccessor(t)||e.isGetAccessor(t)?function(r){return {diagnosticMessage:175===t.kind?e.isStatic(t)?r.errorModuleName?e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1,errorNode:t.name,typeName:t.name}}:e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isIndexSignatureDeclaration(t)?function(r){var n;switch(t.kind){case 177:n=r.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 176:n=r.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 178:n=r.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 171:case 170:n=e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:260===t.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 259:n=r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return e.Debug.fail("This is unknown kind for signature: "+t.kind)}return {diagnosticMessage:n,errorNode:t.name||t}}:e.isParameter(t)?e.isParameterPropertyDeclaration(t,t.parent)&&e.hasSyntacticModifier(t.parent,8)?r:function(r){var n=function(r){switch(t.parent.kind){case 173:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 177:case 182:return r.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 176:return r.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 178:return r.errorModuleName?e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 171:case 170:return e.isStatic(t.parent)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:260===t.parent.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 259:case 181:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 175:case 174:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return e.Debug.fail("Unknown parent for parameter: ".concat(e.Debug.formatSyntaxKind(t.parent.kind)))}}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}:e.isTypeParameterDeclaration(t)?function(){var r;switch(t.parent.kind){case 260:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 261:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 197:r=e.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 182:case 177:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 176:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 171:case 170:r=e.isStatic(t.parent)?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:260===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 181:case 259:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 262:r=e.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return {diagnosticMessage:r,errorNode:t,typeName:t.name}}:e.isExpressionWithTypeArguments(t)?function(){return {diagnosticMessage:e.isClassDeclaration(t.parent.parent)?e.isHeritageClause(t.parent)&&117===t.parent.token?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t.parent.parent.name?e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0:e.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1,errorNode:t,typeName:e.getNameOfDeclaration(t.parent.parent)}}:e.isImportEqualsDeclaration(t)?function(){return {diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}:e.isTypeAliasDeclaration(t)||e.isJSDocTypeAlias(t)?function(r){return {diagnosticMessage:r.errorModuleName?e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:e.isJSDocTypeAlias(t)?e.Debug.checkDefined(t.typeExpression):t.type,typeName:e.isJSDocTypeAlias(t)?e.getNameOfDeclaration(t):t.name}}:e.Debug.assertNever(t,"Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(e.Debug.formatSyntaxKind(t.kind)));function r(r){var n=function(r){return 257===t.kind||205===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:169===t.kind||208===t.kind||168===t.kind||166===t.kind&&e.hasSyntacticModifier(t.parent,8)?e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:260===t.parent.kind||166===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}}e.canProduceDiagnostics=function(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isBindingElement(t)||e.isSetAccessor(t)||e.isGetAccessor(t)||e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isParameter(t)||e.isTypeParameterDeclaration(t)||e.isExpressionWithTypeArguments(t)||e.isImportEqualsDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isConstructorDeclaration(t)||e.isIndexSignatureDeclaration(t)||e.isPropertyAccessExpression(t)||e.isJSDocTypeAlias(t)},e.createGetSymbolAccessibilityDiagnosticForNodeName=function(r){return e.isSetAccessor(r)||e.isGetAccessor(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:260===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:e.isMethodSignature(r)||e.isMethodDeclaration(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:260===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:t(r)},e.createGetSymbolAccessibilityDiagnosticForNode=t;}(t),function(e){function t(t,r){var n=r.text.substring(t.pos,t.end);return e.stringContains(n,"@internal")}function r(r,n){var i=e.getParseTreeNode(r);if(i&&166===i.kind){var a=i.parent.parameters.indexOf(i),o=a>0?i.parent.parameters[a-1]:void 0,s=n.text,c=o?e.concatenate(e.getTrailingCommentRanges(s,e.skipTrivia(s,o.end+1,!1,!0)),e.getLeadingCommentRanges(s,r.pos)):e.getTrailingCommentRanges(s,e.skipTrivia(s,r.pos,!1,!0));return c&&c.length&&t(e.last(c),n)}var l=i&&e.getLeadingCommentRangesOfNode(i,n);return !!e.forEach(l,(function(e){return t(e,n)}))}e.getDeclarationDiagnostics=function(t,r,n){var i=t.getCompilerOptions();return e.transformNodes(r,t,e.factory,i,n?[n]:e.filter(t.getSourceFiles(),e.isSourceFileNotJson),[o],!1).diagnostics},e.isInternalDeclaration=r;var a=531469;function o(t){var o,l,u,_,d,p,f,g,m,y,v,h,b=function(){return e.Debug.fail("Diagnostic emitted without context")},x=b,D=!0,S=!1,T=!1,C=!1,E=!1,k=t.factory,N=t.getEmitHost(),A={trackSymbol:function(e,t,r){if(262144&e.flags)return !1;var n=M(F.isSymbolAccessible(e,t,r,!0));return O(F.getTypeReferenceDirectivesForSymbol(e,r)),n},reportInaccessibleThisError:function(){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"this"));},reportInaccessibleUniqueSymbolError:function(){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"unique symbol"));},reportCyclicStructureError:function(){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,L()));},reportPrivateInBaseOfClassExpression:function(r){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected,r));},reportLikelyUnsafeImportRequiredError:function(r){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,L(),r));},reportTruncationError:function(){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed));},moduleResolverHost:N,trackReferencedAmbientModule:function(t,r){var n=F.getTypeReferenceDirectivesForSymbol(r,67108863);if(e.length(n))return O(n);var i=e.getSourceFileOfNode(t);y.set(e.getOriginalNodeId(i),i);},trackExternalModuleSymbolOfImportTypeNode:function(e){S||(p||(p=[])).push(e);},reportNonlocalAugmentation:function(r,n,i){var a,o=null===(a=n.declarations)||void 0===a?void 0:a.find((function(t){return e.getSourceFileOfNode(t)===r})),s=e.filter(i.declarations,(function(t){return e.getSourceFileOfNode(t)!==r}));if(o&&s)for(var c=0,l=s;c<l.length;c++){var u=l[c];t.addDiagnostic(e.addRelatedInfo(e.createDiagnosticForNode(u,e.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),e.createDiagnosticForNode(o,e.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));}},reportNonSerializableProperty:function(r){(f||g)&&t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,r));},reportImportTypeNodeResolutionModeOverride:function(){e.isNightly()||!f&&!g||t.addDiagnostic(e.createDiagnosticForNode(f||g,e.Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));}},F=t.getEmitResolver(),P=t.getCompilerOptions(),w=P.noResolve,I=P.stripInternal;return function(r){if(308===r.kind&&r.isDeclarationFile)return r;if(309===r.kind){S=!0,y=new e.Map,v=new e.Map;var a=!1,s=k.createBundle(e.map(r.sourceFiles,(function(r){if(!r.isDeclarationFile){if(a=a||r.hasNoDefaultLib,m=r,o=r,u=void 0,d=!1,_=new e.Map,x=b,C=!1,E=!1,B(r,y),j(r,v),e.isExternalOrCommonJsModule(r)||e.isJsonSourceFile(r)){T=!1,D=!1;var n=e.isSourceFileJS(r)?k.createNodeArray(R(r,!0)):e.visitNodes(r.statements,ne);return k.updateSourceFile(r,[k.createModuleDeclaration([k.createModifier(136)],k.createStringLiteral(e.getResolvedExternalModuleName(t.getEmitHost(),r)),k.createModuleBlock(e.setTextRange(k.createNodeArray(te(n)),r.statements)))],!0,[],[],!1,[])}D=!0;var i=e.isSourceFileJS(r)?k.createNodeArray(R(r)):e.visitNodes(r.statements,ne);return k.updateSourceFile(r,te(i),!0,[],[],!1,[])}})),e.mapDefined(r.prepends,(function(t){if(311===t.kind){var r=e.createUnparsedSourceFile(t,"dts",I);return a=a||!!r.hasNoDefaultLib,B(r,y),O(e.map(r.typeReferenceDirectives,(function(e){return [e.fileName,e.resolutionMode]}))),j(r,v),r}return t})));s.syntheticFileReferences=[],s.syntheticTypeReferences=J(),s.syntheticLibReferences=L(),s.hasNoDefaultLib=a;var c=e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,N,!0).declarationFilePath)),f=U(s.syntheticFileReferences,c);return y.forEach(f),s}D=!0,C=!1,E=!1,o=r,m=r,x=b,S=!1,T=!1,d=!1,u=void 0,_=new e.Map,l=void 0,y=B(m,new e.Map),v=j(m,new e.Map);var g,A=[],F=U(A,e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,N,!0).declarationFilePath)));if(e.isSourceFileJS(m))g=k.createNodeArray(R(r)),y.forEach(F),h=e.filter(g,e.isAnyImportSyntax);else {var w=e.visitNodes(r.statements,ne);g=e.setTextRange(k.createNodeArray(te(w)),r.statements),y.forEach(F),h=e.filter(g,e.isAnyImportSyntax),e.isExternalModule(r)&&(!T||C&&!E)&&(g=e.setTextRange(k.createNodeArray(n$4(n$4([],g,!0),[e.createEmptyExports(k)],!1)),g));}var M=k.updateSourceFile(r,g,!0,A,J(),r.hasNoDefaultLib,L());return M.exportedModulesFromDeclarationEmit=p,M;function L(){return e.map(e.arrayFrom(v.keys()),(function(e){return {fileName:e,pos:-1,end:-1}}))}function J(){return l?e.mapDefined(e.arrayFrom(l.keys()),z):[]}function z(t){var r=t[0],n=t[1];if(h)for(var a=0,o=h;a<o.length;a++){var s=o[a];if(e.isImportEqualsDeclaration(s)&&e.isExternalModuleReference(s.moduleReference)){var c=s.moduleReference.expression;if(e.isStringLiteralLike(c)&&c.text===r)return}else if(e.isImportDeclaration(s)&&e.isStringLiteral(s.moduleSpecifier)&&s.moduleSpecifier.text===r)return}return i$1({fileName:r,pos:-1,end:-1},n?{resolutionMode:n}:void 0)}function U(t,n){return function(i){var a;if(i.isDeclarationFile)a=i.fileName;else {if(S&&e.contains(r.sourceFiles,i))return;var o=e.getOutputPathsFor(i,N,!0);a=o.declarationFilePath||o.jsFilePath||i.fileName;}if(a){var s=e.moduleSpecifiers.getModuleSpecifier(P,m,e.toPath(n,N.getCurrentDirectory(),N.getCanonicalFileName),e.toPath(a,N.getCurrentDirectory(),N.getCanonicalFileName),N);if(!e.pathIsRelative(s))return void O([[s,void 0]]);var c=e.getRelativePathToDirectoryOrUrl(n,a,N.getCurrentDirectory(),N.getCanonicalFileName,!1);if(e.startsWith(c,"./")&&e.hasExtension(c)&&(c=c.substring(2)),e.startsWith(c,"node_modules/")||e.pathContainsNodeModules(c))return;t.push({pos:-1,end:-1,fileName:c});}}}};function O(t){if(t){l=l||new e.Set;for(var r=0,n=t;r<n.length;r++){var i=n[r];l.add(i);}}}function M(r){if(0===r.accessibility){if(r&&r.aliasesToMakeVisible)if(u)for(var n=0,i=r.aliasesToMakeVisible;n<i.length;n++){var a=i[n];e.pushIfUnique(u,a);}else u=r.aliasesToMakeVisible;}else {var o=x(r);if(o)return o.typeName?t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,e.getTextOfNode(o.typeName),r.errorSymbolName,r.errorModuleName)):t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,r.errorSymbolName,r.errorModuleName)),!0}return !1}function L(){return f?e.declarationNameToString(f):g&&e.getNameOfDeclaration(g)?e.declarationNameToString(e.getNameOfDeclaration(g)):g&&e.isExportAssignment(g)?g.isExportEquals?"export=":"default":"(Missing)"}function R(t,r){var n=x;x=function(r){return r.errorNode&&e.canProduceDiagnostics(r.errorNode)?e.createGetSymbolAccessibilityDiagnosticForNode(r.errorNode)(r):{diagnosticMessage:r.errorModuleName?e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:r.errorNode||t}};var i=F.getDeclarationStatementsForSourceFile(t,a,A,r);return x=n,i}function B(t,r){return w||!e.isUnparsedSource(t)&&e.isSourceFileJS(t)||e.forEach(t.referencedFiles,(function(n){var i=N.getSourceFileFromReference(t,n);i&&r.set(e.getOriginalNodeId(i),i);})),r}function j(t,r){return e.forEach(t.libReferenceDirectives,(function(t){N.getLibFileFromReference(t)&&r.set(e.toFileNameLowerCase(t.fileName),!0);})),r}function J(t){return 79===t.kind?t:204===t.kind?k.updateArrayBindingPattern(t,e.visitNodes(t.elements,r)):k.updateObjectBindingPattern(t,e.visitNodes(t.elements,r));function r(t){return 229===t.kind?t:t.propertyName&&e.isIdentifier(t.propertyName)&&e.isIdentifier(t.name)&&!t.symbol.isReferenced?k.updateBindingElement(t,t.dotDotDotToken,void 0,t.propertyName,U(t)?t.initializer:void 0):k.updateBindingElement(t,t.dotDotDotToken,t.propertyName,J(t.name),U(t)?t.initializer:void 0)}}function z(t,r,n){var i;d||(i=x,x=e.createGetSymbolAccessibilityDiagnosticForNode(t));var a=k.updateParameterDeclaration(t,function(t,r,n){return e.factory.createModifiersFromModifierFlags(s(t,r,void 0))}(t,r),t.dotDotDotToken,J(t.name),F.isOptionalParameter(t)?t.questionToken||k.createToken(57):void 0,V(t,n||t.type,!0),K(t));return d||(x=i),a}function U(t){return function(t){switch(t.kind){case 169:case 168:return !e.hasEffectiveModifier(t,8);case 166:case 257:return !0}return !1}(t)&&F.isLiteralConstDeclaration(e.getParseTreeNode(t))}function K(t){if(U(t))return F.createLiteralConstValue(e.getParseTreeNode(t),A)}function V(t,r,n){if((n||!e.hasEffectiveModifier(t,8))&&!U(t)){var i,s=166===t.kind&&(F.isRequiredInitializedParameter(t)||F.isOptionalUninitializedParameterProperty(t));return r&&!s?e.visitNode(r,re):e.getParseTreeNode(t)?175===t.kind?k.createKeywordTypeNode(131):(f=t.name,d||(i=x,x=e.createGetSymbolAccessibilityDiagnosticForNode(t)),257===t.kind||205===t.kind?c(F.createTypeOfDeclaration(t,o,a,A)):166===t.kind||169===t.kind||168===t.kind?e.isPropertySignature(t)||!t.initializer?c(F.createTypeOfDeclaration(t,o,a,A,s)):c(F.createTypeOfDeclaration(t,o,a,A,s)||F.createTypeOfExpression(t.initializer,o,a,A)):c(F.createReturnTypeOfSignatureDeclaration(t,o,a,A))):r?e.visitNode(r,re):k.createKeywordTypeNode(131)}function c(e){return f=void 0,d||(x=i),e||k.createKeywordTypeNode(131)}}function q(t){switch((t=e.getParseTreeNode(t)).kind){case 259:case 264:case 261:case 260:case 262:case 263:return !F.isDeclarationVisible(t);case 257:return !W(t);case 268:case 269:case 275:case 274:return !1;case 172:return !0}return !1}function W(t){return !e.isOmittedExpression(t)&&(e.isBindingPattern(t.name)?e.some(t.name.elements,W):F.isDeclarationVisible(t))}function H(t,r,n){if(!e.hasEffectiveModifier(t,8)){var i=e.map(r,(function(e){return z(e,n)}));if(i)return k.createNodeArray(i,r.hasTrailingComma)}}function G(t,r){var n;if(!r){var i=e.getThisParameter(t);i&&(n=[z(i)]);}if(e.isSetAccessorDeclaration(t)){var a=void 0;if(!r){var o=e.getSetAccessorValueParameter(t);o&&(a=z(o,void 0,ue(t,F.getAllAccessorDeclarations(t))));}a||(a=k.createParameterDeclaration(void 0,void 0,"value")),n=e.append(n,a);}return k.createNodeArray(n||e.emptyArray)}function Q(t,r){return e.hasEffectiveModifier(t,8)?void 0:e.visitNodes(r,re)}function X(t){return e.isSourceFile(t)||e.isTypeAliasDeclaration(t)||e.isModuleDeclaration(t)||e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionLike(t)||e.isIndexSignatureDeclaration(t)||e.isMappedTypeNode(t)}function Y(e,t){M(F.isEntityNameVisible(e,t)),O(F.getTypeReferenceDirectivesForEntityName(e));}function Z(t,r){return e.hasJSDocNodes(t)&&e.hasJSDocNodes(r)&&(t.jsDoc=r.jsDoc),e.setCommentRange(t,e.getCommentRange(r))}function $(r,n){if(n){if(T=T||264!==r.kind&&202!==r.kind,e.isStringLiteralLike(n))if(S){var i=e.getExternalModuleNameFromDeclaration(t.getEmitHost(),F,r);if(i)return k.createStringLiteral(i)}else {var a=F.getSymbolOfExternalModuleSpecifier(n);a&&(p||(p=[])).push(a);}return n}}function ee(r){if(void 0!==e.getResolutionModeOverrideForClause(r))return e.isNightly()||t.addDiagnostic(e.createDiagnosticForNode(r,e.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)),r}function te(t){for(;e.length(u);){var r=u.shift();if(!e.isLateVisibilityPaintedStatement(r))return e.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(e.Debug.formatSyntaxKind(r.kind)));var n=D;D=r.parent&&e.isSourceFile(r.parent)&&!(e.isExternalModule(r.parent)&&S);var i=ae(r);D=n,_.set(e.getOriginalNodeId(r),i);}return e.visitNodes(t,(function(t){if(e.isLateVisibilityPaintedStatement(t)){var r=e.getOriginalNodeId(t);if(_.has(r)){var n=_.get(r);return _.delete(r),n&&((e.isArray(n)?e.some(n,e.needsScopeMarker):e.needsScopeMarker(n))&&(C=!0),e.isSourceFile(t.parent)&&(e.isArray(n)?e.some(n,e.isExternalModuleIndicator):e.isExternalModuleIndicator(n))&&(T=!0)),n}}return t}))}function re(r){if(!se(r)){if(e.isDeclaration(r)){if(q(r))return;if(e.hasDynamicName(r)&&!F.isLateBound(e.getParseTreeNode(r)))return}if(!(e.isFunctionLike(r)&&F.isImplementationOfOverload(r)||e.isSemicolonClassElement(r))){var n;X(r)&&(n=o,o=r);var i=x,a=e.canProduceDiagnostics(r),s=d,c=(184===r.kind||197===r.kind)&&262!==r.parent.kind;if((e.isMethodDeclaration(r)||e.isMethodSignature(r))&&e.hasEffectiveModifier(r,8)){if(r.symbol&&r.symbol.declarations&&r.symbol.declarations[0]!==r)return;return h(k.createPropertyDeclaration(le(r),r.name,void 0,void 0,void 0))}if(a&&!d&&(x=e.createGetSymbolAccessibilityDiagnosticForNode(r)),e.isTypeQueryNode(r)&&Y(r.exprName,o),c&&(d=!0),function(e){switch(e.kind){case 177:case 173:case 171:case 174:case 175:case 169:case 168:case 170:case 176:case 178:case 257:case 165:case 230:case 180:case 191:case 181:case 182:case 202:return !0}return !1}(r))switch(r.kind){case 230:(e.isEntityName(r.expression)||e.isEntityNameExpression(r.expression))&&Y(r.expression,o);var l=e.visitEachChild(r,re,t);return h(k.updateExpressionWithTypeArguments(l,l.expression,l.typeArguments));case 180:return Y(r.typeName,o),l=e.visitEachChild(r,re,t),h(k.updateTypeReferenceNode(l,l.typeName,l.typeArguments));case 177:return h(k.updateConstructSignature(r,Q(r,r.typeParameters),H(r,r.parameters),V(r,r.type)));case 173:return h(k.createConstructorDeclaration(le(r),H(r,r.parameters,0),void 0));case 171:return e.isPrivateIdentifier(r.name)?h(void 0):h(k.createMethodDeclaration(le(r),void 0,r.name,r.questionToken,Q(r,r.typeParameters),H(r,r.parameters),V(r,r.type),void 0));case 174:if(e.isPrivateIdentifier(r.name))return h(void 0);var u=ue(r,F.getAllAccessorDeclarations(r));return h(k.updateGetAccessorDeclaration(r,le(r),r.name,G(r,e.hasEffectiveModifier(r,8)),V(r,u),void 0));case 175:return e.isPrivateIdentifier(r.name)?h(void 0):h(k.updateSetAccessorDeclaration(r,le(r),r.name,G(r,e.hasEffectiveModifier(r,8)),void 0));case 169:return e.isPrivateIdentifier(r.name)?h(void 0):h(k.updatePropertyDeclaration(r,le(r),r.name,r.questionToken,V(r,r.type),K(r)));case 168:return e.isPrivateIdentifier(r.name)?h(void 0):h(k.updatePropertySignature(r,le(r),r.name,r.questionToken,V(r,r.type)));case 170:return e.isPrivateIdentifier(r.name)?h(void 0):h(k.updateMethodSignature(r,le(r),r.name,r.questionToken,Q(r,r.typeParameters),H(r,r.parameters),V(r,r.type)));case 176:return h(k.updateCallSignature(r,Q(r,r.typeParameters),H(r,r.parameters),V(r,r.type)));case 178:return h(k.updateIndexSignature(r,le(r),H(r,r.parameters),e.visitNode(r.type,re)||k.createKeywordTypeNode(131)));case 257:return e.isBindingPattern(r.name)?oe(r.name):(c=!0,d=!0,h(k.updateVariableDeclaration(r,r.name,void 0,V(r,r.type),K(r))));case 165:return function(t){return 171===t.parent.kind&&e.hasEffectiveModifier(t.parent,8)}(r)&&(r.default||r.constraint)?h(k.updateTypeParameterDeclaration(r,r.modifiers,r.name,void 0,void 0)):h(e.visitEachChild(r,re,t));case 191:var _=e.visitNode(r.checkType,re),p=e.visitNode(r.extendsType,re),g=o;o=r.trueType;var y=e.visitNode(r.trueType,re);o=g;var v=e.visitNode(r.falseType,re);return h(k.updateConditionalTypeNode(r,_,p,y,v));case 181:return h(k.updateFunctionTypeNode(r,e.visitNodes(r.typeParameters,re),H(r,r.parameters),e.visitNode(r.type,re)));case 182:return h(k.updateConstructorTypeNode(r,le(r),e.visitNodes(r.typeParameters,re),H(r,r.parameters),e.visitNode(r.type,re)));case 202:return e.isLiteralImportTypeNode(r)?h(k.updateImportTypeNode(r,k.updateLiteralTypeNode(r.argument,$(r,r.argument.literal)),r.assertions,r.qualifier,e.visitNodes(r.typeArguments,re,e.isTypeNode),r.isTypeOf)):h(r);default:e.Debug.assertNever(r,"Attempted to process unhandled node kind: ".concat(e.Debug.formatSyntaxKind(r.kind)));}return e.isTupleTypeNode(r)&&e.getLineAndCharacterOfPosition(m,r.pos).line===e.getLineAndCharacterOfPosition(m,r.end).line&&e.setEmitFlags(r,1),h(e.visitEachChild(r,re,t))}}function h(t){return t&&a&&e.hasDynamicName(r)&&function(t){var r;d||(r=x,x=e.createGetSymbolAccessibilityDiagnosticForNodeName(t)),f=t.name,e.Debug.assert(F.isLateBound(e.getParseTreeNode(t))),Y(t.name.expression,o),d||(x=r),f=void 0;}(r),X(r)&&(o=n),a&&!d&&(x=i),c&&(d=s),t===r?t:t&&e.setOriginalNode(Z(t,r),r)}}function ne(t){if(function(e){switch(e.kind){case 259:case 264:case 268:case 261:case 260:case 262:case 263:case 240:case 269:case 275:case 274:return !0}return !1}(t)&&!se(t)){switch(t.kind){case 275:return e.isSourceFile(t.parent)&&(T=!0),E=!0,k.updateExportDeclaration(t,t.modifiers,t.isTypeOnly,t.exportClause,$(t,t.moduleSpecifier),e.getResolutionModeOverrideForClause(t.assertClause)?t.assertClause:void 0);case 274:if(e.isSourceFile(t.parent)&&(T=!0),E=!0,79===t.expression.kind)return t;var r=k.createUniqueName("_default",16);x=function(){return {diagnosticMessage:e.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:t}},g=t;var n=k.createVariableDeclaration(r,void 0,F.createTypeOfExpression(t.expression,t,a,A),void 0);g=void 0;var i=k.createVariableStatement(D?[k.createModifier(136)]:[],k.createVariableDeclarationList([n],2));return Z(i,t),e.removeAllComments(t),[i,k.updateExportAssignment(t,t.modifiers,r)]}var o=ae(t);return _.set(e.getOriginalNodeId(t),o),t}}function ie(t){if(e.isImportEqualsDeclaration(t)||e.hasEffectiveModifier(t,1024)||!e.canHaveModifiers(t))return t;var r=k.createModifiersFromModifierFlags(258046&e.getEffectiveModifierFlags(t));return k.updateModifiers(t,r)}function ae(t){if(u)for(;e.orderedRemoveItem(u,t););if(!se(t)){switch(t.kind){case 268:return function(t){if(F.isDeclarationVisible(t)){if(280===t.moduleReference.kind){var r=e.getExternalModuleImportEqualsDeclarationExpression(t);return k.updateImportEqualsDeclaration(t,t.modifiers,t.isTypeOnly,t.name,k.updateExternalModuleReference(t.moduleReference,$(t,r)))}var n=x;return x=e.createGetSymbolAccessibilityDiagnosticForNode(t),Y(t.moduleReference,o),x=n,t}}(t);case 269:return function(t){if(!t.importClause)return k.updateImportDeclaration(t,t.modifiers,t.importClause,$(t,t.moduleSpecifier),ee(t.assertClause));var r=t.importClause&&t.importClause.name&&F.isDeclarationVisible(t.importClause)?t.importClause.name:void 0;if(!t.importClause.namedBindings)return r&&k.updateImportDeclaration(t,t.modifiers,k.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,void 0),$(t,t.moduleSpecifier),ee(t.assertClause));if(271===t.importClause.namedBindings.kind){var n=F.isDeclarationVisible(t.importClause.namedBindings)?t.importClause.namedBindings:void 0;return r||n?k.updateImportDeclaration(t,t.modifiers,k.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),$(t,t.moduleSpecifier),ee(t.assertClause)):void 0}var i=e.mapDefined(t.importClause.namedBindings.elements,(function(e){return F.isDeclarationVisible(e)?e:void 0}));return i&&i.length||r?k.updateImportDeclaration(t,t.modifiers,k.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,i&&i.length?k.updateNamedImports(t.importClause.namedBindings,i):void 0),$(t,t.moduleSpecifier),ee(t.assertClause)):F.isImportRequiredByAugmentation(t)?k.updateImportDeclaration(t,t.modifiers,void 0,$(t,t.moduleSpecifier),ee(t.assertClause)):void 0}(t)}if(!(e.isDeclaration(t)&&q(t)||e.isFunctionLike(t)&&F.isImplementationOfOverload(t))){var r;X(t)&&(r=o,o=t);var i=e.canProduceDiagnostics(t),s=x;i&&(x=e.createGetSymbolAccessibilityDiagnosticForNode(t));var c=D;switch(t.kind){case 262:D=!1;var l=ye(k.updateTypeAliasDeclaration(t,le(t),t.name,e.visitNodes(t.typeParameters,re,e.isTypeParameterDeclaration),e.visitNode(t.type,re,e.isTypeNode)));return D=c,l;case 261:return ye(k.updateInterfaceDeclaration(t,le(t),t.name,Q(t,t.typeParameters),_e(t.heritageClauses),e.visitNodes(t.members,re)));case 259:if((l=ye(k.updateFunctionDeclaration(t,le(t),void 0,t.name,Q(t,t.typeParameters),H(t,t.parameters),V(t,t.type),void 0)))&&F.isExpandoFunctionDeclaration(t)&&function(t){var r;if(t.body)return !0;var n=null===(r=t.symbol.declarations)||void 0===r?void 0:r.filter((function(t){return e.isFunctionDeclaration(t)&&!t.body}));return !n||n.indexOf(t)===n.length-1}(t)){var d=F.getPropertiesOfContainerFunction(t),p=e.parseNodeFactory.createModuleDeclaration(void 0,l.name||k.createIdentifier("_default"),k.createModuleBlock([]),16);e.setParent(p,o),p.locals=e.createSymbolTable(d),p.symbol=d[0].parent;var m=[],y=e.mapDefined(d,(function(t){if(t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)){x=e.createGetSymbolAccessibilityDiagnosticForNode(t.valueDeclaration);var r=F.createTypeOfDeclaration(t.valueDeclaration,p,a,A);x=s;var n=e.unescapeLeadingUnderscores(t.escapedName),i=e.isStringANonContextualKeyword(n),o=i?k.getGeneratedNameForNode(t.valueDeclaration):k.createIdentifier(n);i&&m.push([o,n]);var c=k.createVariableDeclaration(o,void 0,r,void 0);return k.createVariableStatement(i?void 0:[k.createToken(93)],k.createVariableDeclarationList([c]))}}));m.length?y.push(k.createExportDeclaration(void 0,!1,k.createNamedExports(e.map(m,(function(e){var t=e[0],r=e[1];return k.createExportSpecifier(!1,t,r)}))))):y=e.mapDefined(y,(function(e){return k.updateModifiers(e,0)}));var v=k.createModuleDeclaration(le(t),t.name,k.createModuleBlock(y),16);if(!e.hasEffectiveModifier(l,1024))return [l,v];var h=k.createModifiersFromModifierFlags(-1026&e.getEffectiveModifierFlags(l)|2),b=k.updateFunctionDeclaration(l,h,void 0,l.name,l.typeParameters,l.parameters,l.type,void 0),S=k.updateModuleDeclaration(v,h,v.name,v.body),N=k.createExportAssignment(void 0,!1,v.name);return e.isSourceFile(t.parent)&&(T=!0),E=!0,[b,S,N]}return l;case 264:D=!1;var P=t.body;if(P&&265===P.kind){var w=C,I=E;E=!1,C=!1;var O=te(e.visitNodes(P.statements,ne));16777216&t.flags&&(C=!1),e.isGlobalScopeAugmentation(t)||(me=O,e.some(me,ce))||E||(O=C?k.createNodeArray(n$4(n$4([],O,!0),[e.createEmptyExports(k)],!1)):e.visitNodes(O,ie));var M=k.updateModuleBlock(P,O);D=c,C=w,E=I;var L=le(t);return ye(k.updateModuleDeclaration(t,L,e.isExternalModuleAugmentation(t)?$(t,t.name):t.name,M))}D=c,L=le(t),D=!1,e.visitNode(P,ne);var R=e.getOriginalNodeId(P);return M=_.get(R),_.delete(R),ye(k.updateModuleDeclaration(t,L,t.name,M));case 260:f=t.name,g=t,h=k.createNodeArray(le(t));var B=Q(t,t.typeParameters),j=e.getFirstConstructorWithBody(t),J=void 0;if(j){var z=x;J=e.compact(e.flatMap(j.parameters,(function(t){if(e.hasSyntacticModifier(t,16476)&&!se(t))return x=e.createGetSymbolAccessibilityDiagnosticForNode(t),79===t.name.kind?Z(k.createPropertyDeclaration(le(t),t.name,t.questionToken,V(t,t.type),K(t)),t):function r(n){for(var i,a=0,o=n.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(e.isBindingPattern(s.name)&&(i=e.concatenate(i,r(s.name))),(i=i||[]).push(k.createPropertyDeclaration(le(t),s.name,void 0,V(s,void 0),void 0)));}return i}(t.name)}))),x=z;}var U=e.some(t.members,(function(t){return !!t.name&&e.isPrivateIdentifier(t.name)}))?[k.createPropertyDeclaration(void 0,k.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0,G=e.concatenate(e.concatenate(U,J),e.visitNodes(t.members,re)),ae=k.createNodeArray(G),oe=e.getEffectiveBaseTypeNode(t);if(oe&&!e.isEntityNameExpression(oe.expression)&&104!==oe.expression.kind){var ue=t.name?e.unescapeLeadingUnderscores(t.name.escapedText):"default",de=k.createUniqueName("".concat(ue,"_base"),16);x=function(){return {diagnosticMessage:e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:oe,typeName:t.name}};var pe=k.createVariableDeclaration(de,void 0,F.createTypeOfExpression(oe.expression,t,a,A),void 0),fe=k.createVariableStatement(D?[k.createModifier(136)]:[],k.createVariableDeclarationList([pe],2)),ge=k.createNodeArray(e.map(t.heritageClauses,(function(t){if(94===t.token){var r=x;x=e.createGetSymbolAccessibilityDiagnosticForNode(t.types[0]);var n=k.updateHeritageClause(t,e.map(t.types,(function(t){return k.updateExpressionWithTypeArguments(t,de,e.visitNodes(t.typeArguments,re))})));return x=r,n}return k.updateHeritageClause(t,e.visitNodes(k.createNodeArray(e.filter(t.types,(function(t){return e.isEntityNameExpression(t.expression)||104===t.expression.kind}))),re))})));return [fe,ye(k.updateClassDeclaration(t,h,t.name,B,ge,ae))]}return ge=_e(t.heritageClauses),ye(k.updateClassDeclaration(t,h,t.name,B,ge,ae));case 240:return ye(function(t){if(e.forEach(t.declarationList.declarations,W)){var r=e.visitNodes(t.declarationList.declarations,re);if(e.length(r))return k.updateVariableStatement(t,k.createNodeArray(le(t)),k.updateVariableDeclarationList(t.declarationList,r))}}(t));case 263:return ye(k.updateEnumDeclaration(t,k.createNodeArray(le(t)),t.name,k.createNodeArray(e.mapDefined(t.members,(function(e){if(!se(e)){var t=F.getConstantValue(e);return Z(k.updateEnumMember(e,e.name,void 0!==t?"string"==typeof t?k.createStringLiteral(t):k.createNumericLiteral(t):void 0),e)}})))))}return e.Debug.assertNever(t,"Unhandled top-level node in declaration emit: ".concat(e.Debug.formatSyntaxKind(t.kind)))}}var me;function ye(n){return X(t)&&(o=r),i&&(x=s),264===t.kind&&(D=c),n===t?n:(g=void 0,f=void 0,n&&e.setOriginalNode(Z(n,t),t))}}function oe(t){return e.flatten(e.mapDefined(t.elements,(function(t){return function(t){if(229!==t.kind&&t.name){if(!W(t))return;return e.isBindingPattern(t.name)?oe(t.name):k.createVariableDeclaration(t.name,void 0,V(t,void 0),void 0)}}(t)})))}function se(e){return !!I&&!!e&&r(e,m)}function ce(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function le(t){var r=e.getEffectiveModifierFlags(t),n=function(t){var r=241147,n=D&&!function(e){return 261===e.kind}(t)?2:0,i=308===t.parent.kind;return (!i||S&&i&&e.isExternalModule(t.parent))&&(r^=2,n=0),s(t,r,n)}(t);return r===n?e.visitArray(t.modifiers,(function(t){return e.tryCast(t,e.isModifier)}),e.isModifier):k.createModifiersFromModifierFlags(n)}function ue(t,r){var n=c(t);return n||t===r.firstAccessor||(n=c(r.firstAccessor),x=e.createGetSymbolAccessibilityDiagnosticForNode(r.firstAccessor)),!n&&r.secondAccessor&&t!==r.secondAccessor&&(n=c(r.secondAccessor),x=e.createGetSymbolAccessibilityDiagnosticForNode(r.secondAccessor)),n}function _e(t){return k.createNodeArray(e.filter(e.map(t,(function(t){return k.updateHeritageClause(t,e.visitNodes(k.createNodeArray(e.filter(t.types,(function(r){return e.isEntityNameExpression(r.expression)||94===t.token&&104===r.expression.kind}))),re))})),(function(e){return e.types&&!!e.types.length})))}}function s(t,r,n){void 0===r&&(r=258043),void 0===n&&(n=0);var i=e.getEffectiveModifierFlags(t)&r|n;return 1024&i&&!(1&i)&&(i^=1),1024&i&&2&i&&(i^=2),i}function c(e){if(e)return 174===e.kind?e.type:e.parameters.length>0?e.parameters[0].type:void 0}e.transformDeclarations=o;}(t),function(e){var t,r;function i(t,r,n){if(n)return e.emptyArray;var i=e.getEmitScriptTarget(t),a=e.getEmitModuleKind(t),o=[];return e.addRange(o,r&&e.map(r.before,s)),o.push(e.transformTypeScript),o.push(e.transformLegacyDecorators),o.push(e.transformClassFields),e.getJSXTransformEnabled(t)&&o.push(e.transformJsx),i<99&&o.push(e.transformESNext),i<8&&o.push(e.transformES2021),i<7&&o.push(e.transformES2020),i<6&&o.push(e.transformES2019),i<5&&o.push(e.transformES2018),i<4&&o.push(e.transformES2017),i<3&&o.push(e.transformES2016),i<2&&(o.push(e.transformES2015),o.push(e.transformGenerators)),o.push(function(t){switch(t){case e.ModuleKind.ESNext:case e.ModuleKind.ES2022:case e.ModuleKind.ES2020:case e.ModuleKind.ES2015:return e.transformECMAScriptModule;case e.ModuleKind.System:return e.transformSystemModule;case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return e.transformNodeModule;default:return e.transformModule}}(a)),i<1&&o.push(e.transformES5),e.addRange(o,r&&e.map(r.after,s)),o}function a(t){var r=[];return r.push(e.transformDeclarations),e.addRange(r,t&&e.map(t.afterDeclarations,c)),r}function o(t,r){return function(n){var i=t(n);return "function"==typeof i?r(n,i):function(t){return function(r){return e.isBundle(r)?t.transformBundle(r):t.transformSourceFile(r)}}(i)}}function s(t){return o(t,e.chainBundle)}function c(e){return o(e,(function(e,t){return t}))}function l(e,t){return t}function u(e,t,r){r(e,t);}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Completed=2]="Completed",e[e.Disposed=3]="Disposed";}(t||(t={})),function(e){e[e.Substitution=1]="Substitution",e[e.EmitNotifications=2]="EmitNotifications";}(r||(r={})),e.noTransformers={scriptTransformers:e.emptyArray,declarationTransformers:e.emptyArray},e.getTransformers=function(e,t,r){return {scriptTransformers:i(e,t,r),declarationTransformers:a(t)}},e.noEmitSubstitution=l,e.noEmitNotification=u,e.transformNodes=function(t,r,i,a,o,s,c){for(var _,d,p,f,g,m=new Array(358),y=0,v=[],h=[],b=[],x=[],D=0,S=!1,T=[],C=0,E=l,k=u,N=0,A=[],F={factory:i,getCompilerOptions:function(){return a},getEmitResolver:function(){return t},getEmitHost:function(){return r},getEmitHelperFactory:e.memoize((function(){return e.createEmitHelperFactory(F)})),startLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),v[D]=_,h[D]=d,b[D]=p,x[D]=y,D++,_=void 0,d=void 0,p=void 0,y=0;},suspendLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is already suspended."),S=!0;},resumeLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(S,"Lexical environment is not suspended."),S=!1;},endLexicalEnvironment:function(){var t;if(e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),_||d||p){if(d&&(t=n$4([],d,!0)),_){var r=i.createVariableStatement(void 0,i.createVariableDeclarationList(_));e.setEmitFlags(r,1048576),t?t.push(r):t=[r];}p&&(t=n$4(t?n$4([],t,!0):[],p,!0));}return D--,_=v[D],d=h[D],p=b[D],y=x[D],0===D&&(v=[],h=[],b=[],x=[]),t},setLexicalEnvironmentFlags:function(e,t){y=t?y|e:y&~e;},getLexicalEnvironmentFlags:function(){return y},hoistVariableDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed.");var r=e.setEmitFlags(i.createVariableDeclaration(t),64);_?_.push(r):_=[r],1&y&&(y|=2);},hoistFunctionDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),d?d.push(t):d=[t];},addInitializationStatement:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),p?p.push(t):p=[t];},startBlockScope:function(){e.Debug.assert(N>0,"Cannot start a block scope during initialization."),e.Debug.assert(N<2,"Cannot start a block scope after transformation has completed."),T[C]=f,C++,f=void 0;},endBlockScope:function(){e.Debug.assert(N>0,"Cannot end a block scope during initialization."),e.Debug.assert(N<2,"Cannot end a block scope after transformation has completed.");var t=e.some(f)?[i.createVariableStatement(void 0,i.createVariableDeclarationList(f.map((function(e){return i.createVariableDeclaration(e)})),1))]:void 0;return C--,f=T[C],0===C&&(T=[]),t},addBlockScopedVariable:function(t){e.Debug.assert(C>0,"Cannot add a block scoped variable outside of an iteration body."),(f||(f=[])).push(t);},requestEmitHelper:function t(r){if(e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),e.Debug.assert(!r.scoped,"Cannot request a scoped emit helper."),r.dependencies)for(var n=0,i=r.dependencies;n<i.length;n++){t(i[n]);}g=e.append(g,r);},readEmitHelpers:function(){e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed.");var t=g;return g=void 0,t},enableSubstitution:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=1;},enableEmitNotification:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=2;},isSubstitutionEnabled:J,isEmitNotificationEnabled:z,get onSubstituteNode(){return E},set onSubstituteNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),E=t;},get onEmitNode(){return k},set onEmitNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),k=t;},addDiagnostic:function(e){A.push(e);}},P=0,w=o;P<w.length;P++){var I=w[P];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(I)));}e.performance.mark("beforeTransform");var O=s.map((function(e){return e(F)})),M=function(e){for(var t=0,r=O;t<r.length;t++)e=(0, r[t])(e);return e};N=1;for(var L=[],R=0,B=o;R<B.length;R++)I=B[R],null===e.tracing||void 0===e.tracing||e.tracing.push("emit","transformNodes",308===I.kind?{path:I.path}:{kind:I.kind,pos:I.pos,end:I.end}),L.push((c?M:j)(I)),null===e.tracing||void 0===e.tracing||e.tracing.pop();return N=2,e.performance.mark("afterTransform"),e.performance.measure("transformTime","beforeTransform","afterTransform"),{transformed:L,substituteNode:function(t,r){return e.Debug.assert(N<3,"Cannot substitute a node after the result is disposed."),r&&J(r)&&E(t,r)||r},emitNodeWithNotification:function(t,r,n){e.Debug.assert(N<3,"Cannot invoke TransformationResult callbacks after the result is disposed."),r&&(z(r)?k(t,r,n):n(t,r));},isEmitNotificationEnabled:z,dispose:function(){if(N<3){for(var t=0,r=o;t<r.length;t++){var n=r[t];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(n)));}_=void 0,v=void 0,d=void 0,h=void 0,E=void 0,k=void 0,g=void 0,N=3;}},diagnostics:A};function j(t){return !t||e.isSourceFile(t)&&t.isDeclarationFile?t:M(t)}function J(t){return 0!=(1&m[t.kind])&&0==(4&e.getEmitFlags(t))}function z(t){return 0!=(2&m[t.kind])||0!=(2&e.getEmitFlags(t))}},e.nullTransformationContext={factory:e.factory,getCompilerOptions:function(){return {}},getEmitResolver:e.notImplemented,getEmitHost:e.notImplemented,getEmitHelperFactory:e.notImplemented,startLexicalEnvironment:e.noop,resumeLexicalEnvironment:e.noop,suspendLexicalEnvironment:e.noop,endLexicalEnvironment:e.returnUndefined,setLexicalEnvironmentFlags:e.noop,getLexicalEnvironmentFlags:function(){return 0},hoistVariableDeclaration:e.noop,hoistFunctionDeclaration:e.noop,addInitializationStatement:e.noop,startBlockScope:e.noop,endBlockScope:e.returnUndefined,addBlockScopedVariable:e.noop,requestEmitHelper:e.noop,readEmitHelpers:e.notImplemented,enableSubstitution:e.noop,enableEmitNotification:e.noop,isSubstitutionEnabled:e.notImplemented,isEmitNotificationEnabled:e.notImplemented,onSubstituteNode:l,onEmitNode:u,addDiagnostic:e.noop};}(t),function(e){var t,r,i=function(){var e=[];return e[1024]=["{","}"],e[2048]=["(",")"],e[4096]=["<",">"],e[8192]=["[","]"],e}();function a(t,r,n,i,a,s){void 0===i&&(i=!1);var l=e.isArray(n)?n:e.getSourceFilesToEmit(t,n,i),u=t.getCompilerOptions();if(e.outFile(u)){var _=t.getPrependNodes();if(l.length||_.length){var d=e.factory.createBundle(l,_);if(g=r(c(d,t,i),d))return g}}else {if(!a)for(var p=0,f=l;p<f.length;p++){var g,m=f[p];if(g=r(c(m,t,i),m))return g}if(s){var y=o(u);if(y)return r({buildInfoPath:y},void 0)}}}function o(t){var r=t.configFilePath;if(e.isIncrementalCompilation(t)){if(t.tsBuildInfoFile)return t.tsBuildInfoFile;var n,i=e.outFile(t);if(i)n=e.removeFileExtension(i);else {if(!r)return;var a=e.removeFileExtension(r);n=t.outDir?t.rootDir?e.resolvePath(t.outDir,e.getRelativePathFromDirectory(t.rootDir,a,!0)):e.combinePaths(t.outDir,e.getBaseFileName(a)):a;}return n+".tsbuildinfo"}}function s(t,r){var n=e.outFile(t),i=t.emitDeclarationOnly?void 0:n,a=i&&l(i,t),s=r||e.getEmitDeclarations(t)?e.removeFileExtension(n)+".d.ts":void 0;return {jsFilePath:i,sourceMapFilePath:a,declarationFilePath:s,declarationMapPath:s&&e.getAreDeclarationMapsEnabled(t)?s+".map":void 0,buildInfoPath:o(t)}}function c(t,r,n){var i=r.getCompilerOptions();if(309===t.kind)return s(i,n);var a=e.getOwnEmitOutputFilePath(t.fileName,r,u(t.fileName,i)),o=e.isJsonSourceFile(t),c=o&&0===e.comparePaths(t.fileName,a,r.getCurrentDirectory(),!r.useCaseSensitiveFileNames()),_=i.emitDeclarationOnly||c?void 0:a,d=!_||e.isJsonSourceFile(t)?void 0:l(_,i),p=n||e.getEmitDeclarations(i)&&!o?e.getDeclarationEmitOutputFilePath(t.fileName,r):void 0;return {jsFilePath:_,sourceMapFilePath:d,declarationFilePath:p,declarationMapPath:p&&e.getAreDeclarationMapsEnabled(i)?p+".map":void 0,buildInfoPath:void 0}}function l(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function u(t,r){return e.fileExtensionIs(t,".json")?".json":1===r.jsx&&e.fileExtensionIsOneOf(t,[".jsx",".tsx"])?".jsx":e.fileExtensionIsOneOf(t,[".mts",".mjs"])?".mjs":e.fileExtensionIsOneOf(t,[".cts",".cjs"])?".cjs":".js"}function _(t,r,n,i,a){return i?e.resolvePath(i,e.getRelativePathFromDirectory(a?a():v(r,n),t,n)):t}function d(t,r,n,i){return e.changeExtension(_(t,r,n,r.options.declarationDir||r.options.outDir,i),e.getDeclarationEmitExtensionForPath(t))}function p(t,r,n,i){if(!r.options.emitDeclarationOnly){var a=e.fileExtensionIs(t,".json"),o=e.changeExtension(_(t,r,n,r.options.outDir,i),u(t,r.options));return a&&0===e.comparePaths(t,o,e.Debug.checkDefined(r.options.configFilePath),n)?void 0:o}}function f(){var t;return {addOutput:function(e){e&&(t||(t=[])).push(e);},getOutputs:function(){return t||e.emptyArray}}}function g(e,t){var r=s(e.options,!1),n=r.jsFilePath,i=r.sourceMapFilePath,a=r.declarationFilePath,o=r.declarationMapPath,c=r.buildInfoPath;t(n),t(i),t(a),t(o),t(c);}function m(t,r,n,i,a){if(!e.isDeclarationFileName(r)){var o=p(r,t,n,a);if(i(o),!e.fileExtensionIs(r,".json")&&(o&&t.options.sourceMap&&i("".concat(o,".map")),e.getEmitDeclarations(t.options))){var s=d(r,t,n,a);i(s),t.options.declarationMap&&i("".concat(s,".map"));}}}function y(t,r,n,i,a){var o;return t.rootDir?(o=e.getNormalizedAbsolutePath(t.rootDir,n),null==a||a(t.rootDir)):t.composite&&t.configFilePath?(o=e.getDirectoryPath(e.normalizeSlashes(t.configFilePath)),null==a||a(o)):o=e.computeCommonSourceDirectoryOfFilenames(r(),n,i),o&&o[o.length-1]!==e.directorySeparator&&(o+=e.directorySeparator),o}function v(t,r){var n=t.options,i=t.fileNames;return y(n,(function(){return e.filter(i,(function(t){return !(n.noEmitForJsFiles&&e.fileExtensionIsOneOf(t,e.supportedJSExtensionsFlat)||e.isDeclarationFileName(t))}))}),e.getDirectoryPath(e.normalizeSlashes(e.Debug.checkDefined(n.configFilePath))),e.createGetCanonicalFileName(!r))}function h(t,r,n,i,o,s,c){var l,u=i.scriptTransformers,_=i.declarationTransformers,d=r.getCompilerOptions(),p=d.sourceMap||d.inlineSourceMap||e.getAreDeclarationMapsEnabled(d)?[]:void 0,f=d.listEmittedFiles?[]:void 0,g=e.createDiagnosticCollection(),m=e.getNewLineCharacter(d,(function(){return r.getNewLine()})),y=e.createTextWriter(m),v=e.performance.createTimer("printTime","beforePrint","afterPrint"),h=v.enter,x=v.exit,S=!1;return h(),a(r,(function(i,a){var s,p=i.jsFilePath,m=i.sourceMapFilePath,y=i.declarationFilePath,v=i.declarationMapPath,h=i.buildInfoPath;function x(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(s,t,r.getCanonicalFileName))}h&&a&&e.isBundle(a)&&(s=e.getDirectoryPath(e.getNormalizedAbsolutePath(h,r.getCurrentDirectory())),l={commonSourceDirectory:x(r.getCommonSourceDirectory()),sourceFiles:a.sourceFiles.map((function(t){return x(e.getNormalizedAbsolutePath(t.fileName,r.getCurrentDirectory()))}))}),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitJsFileOrBundle",{jsFilePath:p}),function(n,i,a,s){if(n&&!o&&i)if(r.isEmitBlocked(i)||d.noEmit)S=!0;else {var c=e.transformNodes(t,r,e.factory,d,[n],u,!1),_=D({removeComments:d.removeComments,newLine:d.newLine,noEmitHelpers:d.noEmitHelpers,module:d.module,target:d.target,sourceMap:d.sourceMap,inlineSourceMap:d.inlineSourceMap,inlineSources:d.inlineSources,extendedDiagnostics:d.extendedDiagnostics,writeBundleFileInfo:!!l,relativeToBuildInfo:s},{hasGlobalName:t.hasGlobalName,onEmitNode:c.emitNodeWithNotification,isEmitNotificationEnabled:c.isEmitNotificationEnabled,substituteNode:c.substituteNode});e.Debug.assert(1===c.transformed.length,"Should only see one output from the transform"),C(i,a,c,_,d),c.dispose(),l&&(l.js=_.bundleFileInfo);}}(a,p,m,x),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitDeclarationFileOrBundle",{declarationFilePath:y}),function(n,i,a,s){if(n)if(i){var u=e.isSourceFile(n)?[n]:n.sourceFiles,p=c?u:e.filter(u,e.isSourceFileNotJson),f=e.outFile(d)?[e.factory.createBundle(p,e.isSourceFile(n)?void 0:n.prepends)]:p;o&&!e.getEmitDeclarations(d)&&p.forEach(T);var m=e.transformNodes(t,r,e.factory,d,f,_,!1);if(e.length(m.diagnostics))for(var y=0,v=m.diagnostics;y<v.length;y++){var h=v[y];g.add(h);}var b={removeComments:d.removeComments,newLine:d.newLine,noEmitHelpers:!0,module:d.module,target:d.target,sourceMap:!c&&d.declarationMap,inlineSourceMap:d.inlineSourceMap,extendedDiagnostics:d.extendedDiagnostics,onlyPrintJsDocStyle:!0,writeBundleFileInfo:!!l,recordInternalSection:!!l,relativeToBuildInfo:s},x=D(b,{hasGlobalName:t.hasGlobalName,onEmitNode:m.emitNodeWithNotification,isEmitNotificationEnabled:m.isEmitNotificationEnabled,substituteNode:m.substituteNode}),E=!!m.diagnostics&&!!m.diagnostics.length||!!r.isEmitBlocked(i)||!!d.noEmit;S=S||E,(!E||c)&&(e.Debug.assert(1===m.transformed.length,"Should only see one output from the decl transform"),C(i,a,m,x,{sourceMap:b.sourceMap,sourceRoot:d.sourceRoot,mapRoot:d.mapRoot,extendedDiagnostics:d.extendedDiagnostics})),m.dispose(),l&&(l.dts=x.bundleFileInfo);}else (o||d.emitDeclarationOnly)&&(S=!0);}(a,y,v,x),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{buildInfoPath:h}),function(t,i){if(i&&!n&&!S){var a=r.getProgramBuildInfo();if(r.isEmitBlocked(i))S=!0;else {var o={bundle:t,program:a,version:e.version};e.writeFile(r,g,i,b(o),!1,void 0,{buildInfo:o});}}}(l,h),null===e.tracing||void 0===e.tracing||e.tracing.pop(),!S&&f&&(o||(p&&f.push(p),m&&f.push(m),h&&f.push(h)),y&&f.push(y),v&&f.push(v));}),e.getSourceFilesToEmit(r,n,c),c,s,!n),x(),{emitSkipped:S,diagnostics:g.getDiagnostics(),emittedFiles:f,sourceMaps:p};function T(r){e.isExportAssignment(r)?79===r.expression.kind&&t.collectLinkedAliases(r.expression,!0):e.isExportSpecifier(r)?t.collectLinkedAliases(r.propertyName||r.name,!0):e.forEachChild(r,T);}function C(t,n,i,a,o){var s,c,l=i.transformed[0],u=309===l.kind?l:void 0,_=308===l.kind?l:void 0,f=u?u.sourceFiles:[_];if(function(t,r){return (t.sourceMap||t.inlineSourceMap)&&(308!==r.kind||!e.fileExtensionIs(r.fileName,".json"))}(o,l)&&(s=e.createSourceMapGenerator(r,e.getBaseFileName(e.normalizeSlashes(t)),function(t){var r=e.normalizeSlashes(t.sourceRoot||"");return r?e.ensureTrailingDirectorySeparator(r):r}(o),function(t,n,i){if(t.sourceRoot)return r.getCommonSourceDirectory();if(t.mapRoot){var a=e.normalizeSlashes(t.mapRoot);return i&&(a=e.getDirectoryPath(e.getSourceFilePathInNewDir(i.fileName,r,a))),0===e.getRootLength(a)&&(a=e.combinePaths(r.getCommonSourceDirectory(),a)),a}return e.getDirectoryPath(e.normalizePath(n))}(o,t,_),o)),u?a.writeBundle(u,y,s):a.writeFile(_,y,s),s){p&&p.push({inputSourceFileNames:s.getSources(),sourceMap:s.toJSON()});var v=function(t,n,i,a,o){if(t.inlineSourceMap){var s=n.toString(),c=e.base64encode(e.sys,s);return "data:application/json;base64,".concat(c)}var l=e.getBaseFileName(e.normalizeSlashes(e.Debug.checkDefined(a)));if(t.mapRoot){var u=e.normalizeSlashes(t.mapRoot);return o&&(u=e.getDirectoryPath(e.getSourceFilePathInNewDir(o.fileName,r,u))),0===e.getRootLength(u)?(u=e.combinePaths(r.getCommonSourceDirectory(),u),encodeURI(e.getRelativePathToDirectoryOrUrl(e.getDirectoryPath(e.normalizePath(i)),e.combinePaths(u,l),r.getCurrentDirectory(),r.getCanonicalFileName,!0))):encodeURI(e.combinePaths(u,l))}return encodeURI(l)}(o,s,t,n,_);if(v&&(y.isAtStartOfLine()||y.rawWrite(m),c=y.getTextPos(),y.writeComment("//# ".concat("sourceMappingURL","=").concat(v))),n){var h=s.toString();e.writeFile(r,g,n,h,!1,f),a.bundleFileInfo&&(a.bundleFileInfo.mapHash=e.computeSignature(h,e.maybeBind(r,r.createHash)));}}else y.writeLine();var b=y.getText();e.writeFile(r,g,t,b,!!d.emitBOM,f,{sourceMapUrlPos:c,diagnostics:i.diagnostics}),a.bundleFileInfo&&(a.bundleFileInfo.hash=e.computeSignature(b,e.maybeBind(r,r.createHash))),y.clear();}}function b(e){return JSON.stringify(e)}function x(t,r){return e.readJsonOrUndefined(t,r)}function D(t,r){void 0===t&&(t={}),void 0===r&&(r={});var n,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x,D,E,k,N,A,F=r.hasGlobalName,P=r.onEmitNode,w=void 0===P?e.noEmitNotification:P,I=r.isEmitNotificationEnabled,O=r.substituteNode,M=void 0===O?e.noEmitSubstitution:O,L=r.onBeforeEmitNode,R=r.onAfterEmitNode,B=r.onBeforeEmitNodeArray,j=r.onAfterEmitNodeArray,J=r.onBeforeEmitToken,z=r.onAfterEmitToken,U=!!t.extendedDiagnostics,K=e.getNewLineCharacter(t),V=e.getEmitModuleKind(t),q=new e.Map,W=t.preserveSourceNewlines,H=function(e){y.write(e);},G=t.writeBundleFileInfo?{sections:[]}:void 0,Q=G?e.Debug.checkDefined(t.relativeToBuildInfo):void 0,X=t.recordInternalSection,Y=0,Z="text",$=!0,ee=-1,te=-1,re=-1,ne=-1,ie=-1,ae=!1,oe=!!t.removeComments,se=e.performance.createTimerIf(U,"commentTime","beforeComment","afterComment"),ce=se.enter,le=se.exit,ue=e.factory.parenthesizer,_e={select:function(e){return 0===e?ue.parenthesizeLeadingTypeArgument:void 0}},de=function(){return e.createBinaryExpressionTrampoline((function(e,t){if(t){t.stackIndex++,t.preserveSourceNewlinesStack[t.stackIndex]=W,t.containerPosStack[t.stackIndex]=re,t.containerEndStack[t.stackIndex]=ne,t.declarationListContainerEndStack[t.stackIndex]=ie;var r=t.shouldEmitCommentsStack[t.stackIndex]=Be(e),n=t.shouldEmitSourceMapsStack[t.stackIndex]=je(e);null==L||L(e),r&&Ur(e),n&&_n(e),Me(e);}else t={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[!1],shouldEmitSourceMapsStack:[!1]};return t}),(function(e,r,n){return t(e,n,"left")}),(function(e,t,r){var n=27!==e.kind,i=xr(r,r.left,e),a=xr(r,e,r.right);dr(i,n),en(e.pos),cr(e,101===e.kind?Yt:Zt),rn(e.end,!0),dr(a,!0);}),(function(e,r,n){return t(e,n,"right")}),(function(e,t){if(pr(xr(e,e.left,e.operatorToken),xr(e,e.operatorToken,e.right)),t.stackIndex>0){var r=t.preserveSourceNewlinesStack[t.stackIndex],n=t.containerPosStack[t.stackIndex],i=t.containerEndStack[t.stackIndex],a=t.declarationListContainerEndStack[t.stackIndex],o=t.shouldEmitCommentsStack[t.stackIndex],s=t.shouldEmitSourceMapsStack[t.stackIndex];Le(r),s&&dn(e),o&&Kr(e,n,i,a),null==R||R(e),t.stackIndex--;}}),void 0);function t(t,r,n){var i="left"===n?ue.getParenthesizeLeftSideOfBinaryForOperator(r.operatorToken.kind):ue.getParenthesizeRightSideOfBinaryForOperator(r.operatorToken.kind),a=Je(0,1,t);if(a===qe&&(e.Debug.assertIsDefined(N),a=ze(1,1,t=i(e.cast(N,e.isExpression))),N=void 0),(a===zr||a===un||a===Ke)&&e.isBinaryExpression(t))return t;A=i,a(1,t);}}();return Ae(),{printNode:function(t,r,n){switch(t){case 0:e.Debug.assert(e.isSourceFile(r),"Expected a SourceFile node.");break;case 2:e.Debug.assert(e.isIdentifier(r),"Expected an Identifier node.");break;case 1:e.Debug.assert(e.isExpression(r),"Expected an Expression node.");}switch(r.kind){case 308:return fe(r);case 309:return pe(r);case 310:return i=r,a=Te(),o=y,Ne(a,void 0),Ee(4,i,void 0),Ae(),y=o,Ce()}var i,a,o;return ge(t,r,n,Te()),Ce()},printList:function(e,t,r){return me(e,t,r,Te()),Ce()},printFile:fe,printBundle:pe,writeNode:ge,writeList:me,writeFile:Se,writeBundle:De,bundleFileInfo:G};function pe(e){return De(e,Te(),void 0),Ce()}function fe(e){return Se(e,Te(),void 0),Ce()}function ge(e,t,r,n){var i=y;Ne(n,void 0),Ee(e,t,r),Ae(),y=i;}function me(e,t,r,n){var i=y;Ne(n,void 0),r&&ke(r),Kt(void 0,t,e),Ae(),y=i;}function ye(){return y.getTextPosWithWriteLine?y.getTextPosWithWriteLine():y.getTextPos()}function ve(t,r,n){var i=e.lastOrUndefined(G.sections);i&&i.kind===n?i.end=r:G.sections.push({pos:t,end:r,kind:n});}function he(t){if(X&&G&&n&&(e.isDeclaration(t)||e.isVariableStatement(t))&&e.isInternalDeclaration(t,n)&&"internal"!==Z){var r=Z;return xe(y.getTextPos()),Y=ye(),Z="internal",r}}function be(e){e&&(xe(y.getTextPos()),Y=ye(),Z=e);}function xe(e){return Y<e&&(ve(Y,e,Z),!0)}function De(r,n,i){var a;h=!1;var o=y;Ne(n,i),At(r),Nt(r),We(r),function(t){Tt(!!t.hasNoDefaultLib,t.syntheticFileReferences||[],t.syntheticTypeReferences||[],t.syntheticLibReferences||[]);for(var r=0,n=t.prepends;r<n.length;r++){var i=n[r];if(e.isUnparsedSource(i)&&i.syntheticReferences)for(var a=0,o=i.syntheticReferences;a<o.length;a++)Pe(o[a]),ir();}}(r);for(var s=0,c=r.prepends;s<c.length;s++){var l=c[s];ir();var u=y.getTextPos(),_=G&&G.sections;if(_&&(G.sections=[]),Ee(4,l,void 0),G){var d=G.sections;G.sections=_,l.oldFileOfCurrentEmit?(a=G.sections).push.apply(a,d):(d.forEach((function(t){return e.Debug.assert(e.isBundleFileTextLike(t))})),G.sections.push({pos:u,end:y.getTextPos(),kind:"prepend",data:Q(l.fileName),texts:d}));}}Y=ye();for(var p=0,f=r.sourceFiles;p<f.length;p++){var g=f[p];Ee(0,g,g);}if(G&&r.sourceFiles.length&&xe(y.getTextPos())){var m=function(t){for(var r,n=new e.Set,i=0;i<t.sourceFiles.length;i++){for(var a=t.sourceFiles[i],o=void 0,s=0,c=0,l=a.statements;c<l.length;c++){var u=l[c];if(!e.isPrologueDirective(u))break;n.has(u.expression.text)||(n.add(u.expression.text),(o||(o=[])).push({pos:u.pos,end:u.end,expression:{pos:u.expression.pos,end:u.expression.end,text:u.expression.text}}),s=s<u.end?u.end:s);}o&&(r||(r=[])).push({file:i,text:a.text.substring(0,s),directives:o});}return r}(r);m&&(G.sources||(G.sources={}),G.sources.prologues=m);var v=function(r){var n;if(V!==e.ModuleKind.None&&!t.noEmitHelpers){for(var i=new e.Map,a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a],c=void 0!==e.getExternalHelpersModuleName(s),l=He(s);if(l)for(var u=0,_=l;u<_.length;u++){var d=_[u];d.scoped||c||i.get(d.name)||(i.set(d.name,!0),(n||(n=[])).push(d.name));}}return n}}(r);v&&(G.sources||(G.sources={}),G.sources.helpers=v);}Ae(),y=o;}function Se(e,t,r){h=!0;var n=y;Ne(t,r),At(e),Nt(e),Ee(0,e,e),Ae(),y=n;}function Te(){return v||(v=e.createTextWriter(K))}function Ce(){var e=v.getText();return v.clear(),e}function Ee(e,t,r){r&&ke(r),Re(e,t,void 0);}function ke(e){n=e,E=void 0,k=void 0,e&&mn(e);}function Ne(r,n){r&&t.omitTrailingSemicolon&&(r=e.getTrailingSemicolonDeferringWriter(r)),b=n,$=!(y=r)||!b;}function Ae(){a=[],o=[],s=new e.Set,c=[],l=new e.Map,u=[],_=0,d=[],p=0,f=[],n=void 0,E=void 0,k=void 0,Ne(void 0,void 0);}function Fe(){return E||(E=e.getLineStarts(e.Debug.checkDefined(n)))}function Pe(e,t){if(void 0!==e){var r=he(e);Re(4,e,t),be(r);}}function we(e){void 0!==e&&Re(2,e,void 0);}function Ie(e,t){void 0!==e&&Re(1,e,t);}function Oe(t){Re(e.isStringLiteral(t)?6:4,t);}function Me(t){W&&134217728&e.getEmitFlags(t)&&(W=!1);}function Le(e){W=e;}function Re(e,t,r){A=r,Je(0,e,t)(e,t),A=void 0;}function Be(t){return !oe&&!e.isSourceFile(t)}function je(t){return !($||e.isSourceFile(t)||e.isInJsonFile(t)||e.isUnparsedSource(t)||e.isUnparsedPrepend(t))}function Je(t,r,n){switch(t){case 0:if(w!==e.noEmitNotification&&(!I||I(n)))return Ue;case 1:if(M!==e.noEmitSubstitution&&(N=M(r,n)||n)!==n)return A&&(N=A(N)),qe;case 2:if(Be(n))return zr;case 3:if(je(n))return un;case 4:return Ke;default:return e.Debug.assertNever(t)}}function ze(e,t,r){return Je(e+1,t,r)}function Ue(e,t){var r=ze(0,e,t);w(e,t,r);}function Ke(e,t){if(null==L||L(t),W){var r=W;Me(t),Ve(e,t),Le(r);}else Ve(e,t);null==R||R(t),A=void 0;}function Ve(t,r,i){if(void 0===i&&(i=!0),i){var a=e.getSnippetElement(r);if(a)return function(t,r,n){switch(n.kind){case 1:!function(e,t,r){nr("${".concat(r.order,":")),Ve(e,t,!1),nr("}");}(t,r,n);break;case 0:!function(t,r,n){e.Debug.assert(239===r.kind,"A tab stop cannot be attached to a node of kind ".concat(e.Debug.formatSyntaxKind(r.kind),".")),e.Debug.assert(5!==t,"A tab stop cannot be attached to an embedded statement."),nr("$".concat(n.order));}(t,r,n);}}(t,r,a)}if(0===t)return St(e.cast(r,e.isSourceFile));if(2===t)return Xe(e.cast(r,e.isIdentifier));if(6===t)return Ge(e.cast(r,e.isStringLiteral),!0);if(3===t)return function(e){Pe(e.name),tr(),Yt("in"),tr(),Pe(e.constraint);}(e.cast(r,e.isTypeParameterDeclaration));if(5===t)return e.Debug.assertNode(r,e.isEmptyStatement),tt(!0);if(4===t){switch(r.kind){case 15:case 16:case 17:return Ge(r,!1);case 79:return Xe(r);case 80:return Ye(r);case 163:return function(e){(function(e){79===e.kind?Ie(e):Pe(e);})(e.left),Qt("."),Pe(e.right);}(r);case 164:return function(e){Qt("["),Ie(e.expression,ue.parenthesizeExpressionOfComputedPropertyName),Qt("]");}(r);case 165:return function(e){wt(e,e.modifiers),Pe(e.name),e.constraint&&(tr(),Yt("extends"),tr(),Pe(e.constraint)),e.default&&(tr(),Zt("="),tr(),Pe(e.default));}(r);case 166:return function(e){Pt(e,e.modifiers),Pe(e.dotDotDotToken),Ft(e.name,$t),Pe(e.questionToken),e.parent&&320===e.parent.kind&&!e.name?Pe(e.type):It(e.type),Ot(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name?e.name.end:e.modifiers?e.modifiers.end:e.pos,e,ue.parenthesizeExpressionForDisallowedComma);}(r);case 167:return _=r,Qt("@"),void Ie(_.expression,ue.parenthesizeLeftSideOfAccess);case 168:return function(e){wt(e,e.modifiers),Ft(e.name,rr),Pe(e.questionToken),It(e.type),Xt();}(r);case 169:return function(e){Pt(e,e.modifiers),Pe(e.name),Pe(e.questionToken),Pe(e.exclamationToken),It(e.type),Ot(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name.end,e),Xt();}(r);case 170:return function(e){Er(e),wt(e,e.modifiers),Pe(e.name),Pe(e.questionToken),jt(e,e.typeParameters),Jt(e,e.parameters),It(e.type),Xt(),kr(e);}(r);case 171:return function(e){Pt(e,e.modifiers),Pe(e.asteriskToken),Pe(e.name),Pe(e.questionToken),ut(e,_t);}(r);case 172:return function(e){Yt("static"),dt(e.body);}(r);case 173:return function(e){wt(e,e.modifiers),Yt("constructor"),ut(e,_t);}(r);case 174:case 175:return function(e){Pt(e,e.modifiers),Yt(174===e.kind?"get":"set"),tr(),Pe(e.name),ut(e,_t);}(r);case 176:return function(e){Er(e),jt(e,e.typeParameters),Jt(e,e.parameters),It(e.type),Xt(),kr(e);}(r);case 177:return function(e){Er(e),Yt("new"),tr(),jt(e,e.typeParameters),Jt(e,e.parameters),It(e.type),Xt(),kr(e);}(r);case 178:return function(e){wt(e,e.modifiers),Kt(e,e.parameters,8848),It(e.type),Xt();}(r);case 179:return function(e){e.assertsModifier&&(Pe(e.assertsModifier),tr()),Pe(e.parameterName),e.type&&(tr(),Yt("is"),tr(),Pe(e.type));}(r);case 180:return function(e){Pe(e.typeName),Bt(e,e.typeArguments);}(r);case 181:return function(e){Er(e),jt(e,e.typeParameters),zt(e,e.parameters),tr(),Qt("=>"),tr(),Pe(e.type),kr(e);}(r);case 182:return function(e){Er(e),wt(e,e.modifiers),Yt("new"),tr(),jt(e,e.typeParameters),Jt(e,e.parameters),tr(),Qt("=>"),tr(),Pe(e.type),kr(e);}(r);case 183:return function(e){Yt("typeof"),tr(),Pe(e.exprName),Bt(e,e.typeArguments);}(r);case 184:return function(t){Qt("{");var r=1&e.getEmitFlags(t)?768:32897;Kt(t,t.members,524288|r),Qt("}");}(r);case 185:return function(e){Pe(e.elementType,ue.parenthesizeNonArrayTypeOfPostfixType),Qt("["),Qt("]");}(r);case 186:return function(t){it(22,t.pos,Qt,t);var r=1&e.getEmitFlags(t)?528:657;Kt(t,t.elements,524288|r,ue.parenthesizeElementTypeOfTupleType),it(23,t.elements.end,Qt,t);}(r);case 187:return function(e){Pe(e.type,ue.parenthesizeTypeOfOptionalType),Qt("?");}(r);case 189:return function(e){Kt(e,e.types,516,ue.parenthesizeConstituentTypeOfUnionType);}(r);case 190:return function(e){Kt(e,e.types,520,ue.parenthesizeConstituentTypeOfIntersectionType);}(r);case 191:return function(e){Pe(e.checkType,ue.parenthesizeCheckTypeOfConditionalType),tr(),Yt("extends"),tr(),Pe(e.extendsType,ue.parenthesizeExtendsTypeOfConditionalType),tr(),Qt("?"),tr(),Pe(e.trueType),tr(),Qt(":"),tr(),Pe(e.falseType);}(r);case 192:return function(e){Yt("infer"),tr(),Pe(e.typeParameter);}(r);case 193:return function(e){Qt("("),Pe(e.type),Qt(")");}(r);case 230:return $e(r);case 194:return void Yt("this");case 195:return function(e){lr(e.operator,Yt),tr();var t=146===e.operator?ue.parenthesizeOperandOfReadonlyTypeOperator:ue.parenthesizeOperandOfTypeOperator;Pe(e.type,t);}(r);case 196:return function(e){Pe(e.objectType,ue.parenthesizeNonArrayTypeOfPostfixType),Qt("["),Pe(e.indexType),Qt("]");}(r);case 197:return function(t){var r=e.getEmitFlags(t);Qt("{"),1&r?tr():(ir(),ar()),t.readonlyToken&&(Pe(t.readonlyToken),146!==t.readonlyToken.kind&&Yt("readonly"),tr()),Qt("["),Re(3,t.typeParameter),t.nameType&&(tr(),Yt("as"),tr(),Pe(t.nameType)),Qt("]"),t.questionToken&&(Pe(t.questionToken),57!==t.questionToken.kind&&Qt("?")),Qt(":"),tr(),Pe(t.type),Xt(),1&r?tr():(ir(),or()),Kt(t,t.members,2),Qt("}");}(r);case 198:return function(e){Ie(e.literal);}(r);case 199:return function(e){Pe(e.dotDotDotToken),Pe(e.name),Pe(e.questionToken),it(58,e.name.end,Qt,e),tr(),Pe(e.type);}(r);case 200:return function(e){Pe(e.head),Kt(e,e.templateSpans,262144);}(r);case 201:return function(e){Pe(e.type),Pe(e.literal);}(r);case 202:return function(e){if(e.isTypeOf&&(Yt("typeof"),tr()),Yt("import"),Qt("("),Pe(e.argument),e.assertions){Qt(","),tr(),Qt("{"),tr(),Yt("assert"),Qt(":"),tr();var t=e.assertions.assertClause.elements;Kt(e.assertions.assertClause,t,526226),tr(),Qt("}");}Qt(")"),e.qualifier&&(Qt("."),Pe(e.qualifier)),Bt(e,e.typeArguments);}(r);case 203:return function(e){Qt("{"),Kt(e,e.elements,525136),Qt("}");}(r);case 204:return function(e){Qt("["),Kt(e,e.elements,524880),Qt("]");}(r);case 205:return function(e){Pe(e.dotDotDotToken),e.propertyName&&(Pe(e.propertyName),Qt(":"),tr()),Pe(e.name),Ot(e.initializer,e.name.end,e,ue.parenthesizeExpressionForDisallowedComma);}(r);case 236:return function(e){Ie(e.expression),Pe(e.literal);}(r);case 237:return void Xt();case 238:return function(e){et(e,!e.multiLine&&Dr(e));}(r);case 240:return function(e){wt(e,e.modifiers),Pe(e.declarationList),Xt();}(r);case 239:return tt(!1);case 241:return function(t){Ie(t.expression,ue.parenthesizeExpressionOfExpressionStatement),n&&e.isJsonSourceFile(n)&&!e.nodeIsSynthesized(t.expression)||Xt();}(r);case 242:return function(e){var t=it(99,e.pos,Yt,e);tr(),it(20,t,Qt,e),Ie(e.expression),it(21,e.expression.end,Qt,e),Rt(e,e.thenStatement),e.elseStatement&&(ur(e,e.thenStatement,e.elseStatement),it(91,e.thenStatement.end,Yt,e),242===e.elseStatement.kind?(tr(),Pe(e.elseStatement)):Rt(e,e.elseStatement));}(r);case 243:return function(t){it(90,t.pos,Yt,t),Rt(t,t.statement),e.isBlock(t.statement)&&!W?tr():ur(t,t.statement,t.expression),rt(t,t.statement.end),Xt();}(r);case 244:return function(e){rt(e,e.pos),Rt(e,e.statement);}(r);case 245:return function(e){var t=it(97,e.pos,Yt,e);tr();var r=it(20,t,Qt,e);nt(e.initializer),r=it(26,e.initializer?e.initializer.end:r,Qt,e),Lt(e.condition),r=it(26,e.condition?e.condition.end:r,Qt,e),Lt(e.incrementor),it(21,e.incrementor?e.incrementor.end:r,Qt,e),Rt(e,e.statement);}(r);case 246:return function(e){var t=it(97,e.pos,Yt,e);tr(),it(20,t,Qt,e),nt(e.initializer),tr(),it(101,e.initializer.end,Yt,e),tr(),Ie(e.expression),it(21,e.expression.end,Qt,e),Rt(e,e.statement);}(r);case 247:return function(e){var t=it(97,e.pos,Yt,e);tr(),function(e){e&&(Pe(e),tr());}(e.awaitModifier),it(20,t,Qt,e),nt(e.initializer),tr(),it(162,e.initializer.end,Yt,e),tr(),Ie(e.expression),it(21,e.expression.end,Qt,e),Rt(e,e.statement);}(r);case 248:return function(e){it(86,e.pos,Yt,e),Mt(e.label),Xt();}(r);case 249:return function(e){it(81,e.pos,Yt,e),Mt(e.label),Xt();}(r);case 250:return function(e){it(105,e.pos,Yt,e),Lt(e.expression&&st(e.expression),st),Xt();}(r);case 251:return function(e){var t=it(116,e.pos,Yt,e);tr(),it(20,t,Qt,e),Ie(e.expression),it(21,e.expression.end,Qt,e),Rt(e,e.statement);}(r);case 252:return function(e){var t=it(107,e.pos,Yt,e);tr(),it(20,t,Qt,e),Ie(e.expression),it(21,e.expression.end,Qt,e),tr(),Pe(e.caseBlock);}(r);case 253:return function(e){Pe(e.label),it(58,e.label.end,Qt,e),tr(),Pe(e.statement);}(r);case 254:return function(e){it(109,e.pos,Yt,e),Lt(st(e.expression),st),Xt();}(r);case 255:return function(e){it(111,e.pos,Yt,e),tr(),Pe(e.tryBlock),e.catchClause&&(ur(e,e.tryBlock,e.catchClause),Pe(e.catchClause)),e.finallyBlock&&(ur(e,e.catchClause||e.tryBlock,e.finallyBlock),it(96,(e.catchClause||e.tryBlock).end,Yt,e),tr(),Pe(e.finallyBlock));}(r);case 256:return function(e){sr(87,e.pos,Yt),Xt();}(r);case 257:return function(e){var t,r,n,i,a;Pe(e.name),Pe(e.exclamationToken),It(e.type),Ot(e.initializer,null!==(a=null!==(r=null===(t=e.type)||void 0===t?void 0:t.end)&&void 0!==r?r:null===(i=null===(n=e.name.emitNode)||void 0===n?void 0:n.typeNode)||void 0===i?void 0:i.end)&&void 0!==a?a:e.name.end,e,ue.parenthesizeExpressionForDisallowedComma);}(r);case 258:return function(t){Yt(e.isLet(t)?"let":e.isVarConst(t)?"const":"var"),tr(),Kt(t,t.declarations,528);}(r);case 259:return function(e){lt(e);}(r);case 260:return function(e){gt(e);}(r);case 261:return function(e){wt(e,e.modifiers),Yt("interface"),tr(),Pe(e.name),jt(e,e.typeParameters),Kt(e,e.heritageClauses,512),tr(),Qt("{"),Kt(e,e.members,129),Qt("}");}(r);case 262:return function(e){wt(e,e.modifiers),Yt("type"),tr(),Pe(e.name),jt(e,e.typeParameters),tr(),Qt("="),tr(),Pe(e.type),Xt();}(r);case 263:return function(e){wt(e,e.modifiers),Yt("enum"),tr(),Pe(e.name),tr(),Qt("{"),Kt(e,e.members,145),Qt("}");}(r);case 264:return function(t){wt(t,t.modifiers),1024&~t.flags&&(Yt(16&t.flags?"namespace":"module"),tr()),Pe(t.name);var r=t.body;if(!r)return Xt();for(;r&&e.isModuleDeclaration(r);)Qt("."),Pe(r.name),r=r.body;tr(),Pe(r);}(r);case 265:return function(t){Er(t),e.forEach(t.statements,Ar),et(t,Dr(t)),kr(t);}(r);case 266:return function(e){it(18,e.pos,Qt,e),Kt(e,e.clauses,129),it(19,e.clauses.end,Qt,e,!0);}(r);case 267:return function(e){var t=it(93,e.pos,Yt,e);tr(),t=it(128,t,Yt,e),tr(),t=it(143,t,Yt,e),tr(),Pe(e.name),Xt();}(r);case 268:return function(e){wt(e,e.modifiers),it(100,e.modifiers?e.modifiers.end:e.pos,Yt,e),tr(),e.isTypeOnly&&(it(154,e.pos,Yt,e),tr()),Pe(e.name),tr(),it(63,e.name.end,Qt,e),tr(),function(e){79===e.kind?Ie(e):Pe(e);}(e.moduleReference),Xt();}(r);case 269:return function(e){wt(e,e.modifiers),it(100,e.modifiers?e.modifiers.end:e.pos,Yt,e),tr(),e.importClause&&(Pe(e.importClause),tr(),it(158,e.importClause.end,Yt,e),tr()),Ie(e.moduleSpecifier),e.assertClause&&Mt(e.assertClause),Xt();}(r);case 270:return function(e){e.isTypeOnly&&(it(154,e.pos,Yt,e),tr()),Pe(e.name),e.name&&e.namedBindings&&(it(27,e.name.end,Qt,e),tr()),Pe(e.namedBindings);}(r);case 271:return function(e){var t=it(41,e.pos,Qt,e);tr(),it(128,t,Yt,e),tr(),Pe(e.name);}(r);case 277:return function(e){var t=it(41,e.pos,Qt,e);tr(),it(128,t,Yt,e),tr(),Pe(e.name);}(r);case 272:case 276:return function(e){!function(e){Qt("{"),Kt(e,e.elements,525136),Qt("}");}(e);}(r);case 273:case 278:return function(e){!function(e){e.isTypeOnly&&(Yt("type"),tr()),e.propertyName&&(Pe(e.propertyName),tr(),it(128,e.propertyName.end,Yt,e),tr()),Pe(e.name);}(e);}(r);case 274:return function(e){var t=it(93,e.pos,Yt,e);tr(),e.isExportEquals?it(63,t,Zt,e):it(88,t,Yt,e),tr(),Ie(e.expression,e.isExportEquals?ue.getParenthesizeRightSideOfBinaryForOperator(63):ue.parenthesizeExpressionOfExportDefault),Xt();}(r);case 275:return function(e){wt(e,e.modifiers);var t=it(93,e.pos,Yt,e);tr(),e.isTypeOnly&&(t=it(154,t,Yt,e),tr()),e.exportClause?Pe(e.exportClause):t=it(41,t,Qt,e),e.moduleSpecifier&&(tr(),it(158,e.exportClause?e.exportClause.end:t,Yt,e),tr(),Ie(e.moduleSpecifier)),e.assertClause&&Mt(e.assertClause),Xt();}(r);case 296:return function(e){it(130,e.pos,Yt,e),tr(),Kt(e,e.elements,526226);}(r);case 297:return function(t){Pe(t.name),Qt(":"),tr();var r=t.value;0==(512&e.getEmitFlags(r))&&rn(e.getCommentRange(r).pos),Pe(r);}(r);case 279:case 322:case 333:case 334:case 336:case 337:case 338:case 339:case 352:case 356:case 355:return;case 280:return function(e){Yt("require"),Qt("("),Ie(e.expression),Qt(")");}(r);case 11:return function(e){y.writeLiteral(e.text);}(r);case 283:case 286:return function(t){if(Qt("<"),e.isJsxOpeningElement(t)){var r=vr(t.tagName,t);mt(t.tagName),Bt(t,t.typeArguments),t.attributes.properties&&t.attributes.properties.length>0&&tr(),Pe(t.attributes),hr(t.attributes,t),pr(r);}Qt(">");}(r);case 284:case 287:return function(t){Qt("</"),e.isJsxClosingElement(t)&&mt(t.tagName),Qt(">");}(r);case 288:return function(e){Pe(e.name),function(e,t,r,n){r&&(t("="),n(r));}(0,Qt,e.initializer,Oe);}(r);case 289:return function(e){Kt(e,e.properties,262656);}(r);case 290:return function(e){Qt("{..."),Ie(e.expression),Qt("}");}(r);case 291:return function(t){var r,i;if(t.expression||!oe&&!e.nodeIsSynthesized(t)&&(function(t){var r=!1;return e.forEachTrailingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i=t.pos)||function(t){var r=!1;return e.forEachLeadingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i))){var a=n&&!e.nodeIsSynthesized(t)&&e.getLineAndCharacterOfPosition(n,t.pos).line!==e.getLineAndCharacterOfPosition(n,t.end).line;a&&y.increaseIndent();var o=it(18,t.pos,Qt,t);Pe(t.dotDotDotToken),Ie(t.expression),it(19,(null===(r=t.expression)||void 0===r?void 0:r.end)||o,Qt,t),a&&y.decreaseIndent();}}(r);case 292:return function(e){it(82,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeExpressionForDisallowedComma),yt(e,e.statements,e.expression.end);}(r);case 293:return function(e){var t=it(88,e.pos,Yt,e);yt(e,e.statements,t);}(r);case 294:return function(e){tr(),lr(e.token,Yt),tr(),Kt(e,e.types,528);}(r);case 295:return function(e){var t=it(83,e.pos,Yt,e);tr(),e.variableDeclaration&&(it(20,t,Qt,e),Pe(e.variableDeclaration),it(21,e.variableDeclaration.end,Qt,e),tr()),Pe(e.block);}(r);case 299:return function(t){Pe(t.name),Qt(":"),tr();var r=t.initializer;0==(512&e.getEmitFlags(r))&&rn(e.getCommentRange(r).pos),Ie(r,ue.parenthesizeExpressionForDisallowedComma);}(r);case 300:return function(e){Pe(e.name),e.objectAssignmentInitializer&&(tr(),Qt("="),tr(),Ie(e.objectAssignmentInitializer,ue.parenthesizeExpressionForDisallowedComma));}(r);case 301:return function(e){e.expression&&(it(25,e.pos,Qt,e),Ie(e.expression,ue.parenthesizeExpressionForDisallowedComma));}(r);case 302:return function(e){Pe(e.name),Ot(e.initializer,e.name.end,e,ue.parenthesizeExpressionForDisallowedComma);}(r);case 303:return Qe(r);case 310:case 304:return function(e){for(var t=0,r=e.texts;t<r.length;t++){var n=r[t];ir(),Pe(n);}}(r);case 305:case 306:return l=r,u=ye(),Qe(l),void(G&&ve(u,y.getTextPos(),305===l.kind?"text":"internal"));case 307:return function(t){var r=ye();if(Qe(t),G){var n=e.clone(t.section);n.pos=r,n.end=y.getTextPos(),G.sections.push(n);}}(r);case 308:return St(r);case 309:return e.Debug.fail("Bundles should be printed using printBundle");case 311:return e.Debug.fail("InputFiles should not be printed");case 312:return Dt(r);case 313:return function(e){tr(),Qt("{"),Pe(e.name),Qt("}");}(r);case 315:return Qt("*");case 316:return Qt("?");case 317:return function(e){Qt("?"),Pe(e.type);}(r);case 318:return function(e){Qt("!"),Pe(e.type);}(r);case 319:return function(e){Pe(e.type),Qt("=");}(r);case 320:return function(e){Yt("function"),Jt(e,e.parameters),Qt(":"),Pe(e.type);}(r);case 188:case 321:return function(e){Qt("..."),Pe(e.type);}(r);case 323:return function(t){if(H("/**"),t.comment){var r=e.getTextOfJSDocComment(t.comment);if(r)for(var n=0,i=r.split(/\r\n?|\n/g);n<i.length;n++){var a=i[n];ir(),tr(),Qt("*"),tr(),H(a);}}t.tags&&(1!==t.tags.length||346!==t.tags[0].kind||t.comment?Kt(t,t.tags,33):(tr(),Pe(t.tags[0]))),tr(),H("*/");}(r);case 325:return vt(r);case 326:return ht(r);case 330:case 335:case 340:return bt((c=r).tagName),void xt(c.comment);case 331:case 332:return function(e){bt(e.tagName),tr(),Qt("{"),Pe(e.class),Qt("}"),xt(e.comment);}(r);case 341:return function(e){bt(e.tagName),e.name&&(tr(),Pe(e.name)),xt(e.comment),ht(e.typeExpression);}(r);case 343:case 350:return bt((s=r).tagName),Dt(s.typeExpression),tr(),s.isBracketed&&Qt("["),Pe(s.name),s.isBracketed&&Qt("]"),void xt(s.comment);case 342:case 344:case 345:case 346:return function(e){bt(e.tagName),Dt(e.typeExpression),xt(e.comment);}(r);case 347:return function(e){bt(e.tagName),Dt(e.constraint),tr(),Kt(e,e.typeParameters,528),xt(e.comment);}(r);case 348:return function(e){bt(e.tagName),e.typeExpression&&(312===e.typeExpression.kind?Dt(e.typeExpression):(tr(),Qt("{"),H("Object"),e.typeExpression.isArrayType&&(Qt("["),Qt("]")),Qt("}"))),e.fullName&&(tr(),Pe(e.fullName)),xt(e.comment),e.typeExpression&&325===e.typeExpression.kind&&vt(e.typeExpression);}(r);case 349:return function(e){bt(e.tagName),Pe(e.name),xt(e.comment);}(r)}if(e.isExpression(r)&&(t=1,M!==e.noEmitSubstitution)){var o=M(t,r)||r;o!==r&&(r=o,A&&(r=A(r)));}}var s,c,l,u,_;if(1===t)switch(r.kind){case 8:case 9:return function(e){Ge(e,!1);}(r);case 10:case 13:case 14:return Ge(r,!1);case 79:return Xe(r);case 80:return Ye(r);case 206:return function(e){Vt(e,e.elements,8914|(e.multiLine?65536:0),ue.parenthesizeExpressionForDisallowedComma);}(r);case 207:return function(t){e.forEach(t.properties,Fr);var r=65536&e.getEmitFlags(t);r&&ar();var i=t.multiLine?65536:0,a=n&&n.languageVersion>=1&&!e.isJsonSourceFile(n)?64:0;Kt(t,t.properties,526226|a|i),r&&or();}(r);case 208:return function(t){Ie(t.expression,ue.parenthesizeLeftSideOfAccess);var r=t.questionDotToken||e.setTextRangePosEnd(e.factory.createToken(24),t.expression.end,t.name.pos),n=xr(t,t.expression,r),i=xr(t,r,t.name);dr(n,!1),28!==r.kind&&function(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isNumericLiteral(t)){var r=Cr(t,!0,!1);return !t.numericLiteralFlags&&!e.stringContains(r,e.tokenToString(24))}if(e.isAccessExpression(t)){var n=e.getConstantValue(t);return "number"==typeof n&&isFinite(n)&&Math.floor(n)===n}}(t.expression)&&!y.hasTrailingComment()&&!y.hasTrailingWhitespace()&&Qt("."),t.questionDotToken?Pe(r):it(r.kind,t.expression.end,Qt,t),dr(i,!1),Pe(t.name),pr(n,i);}(r);case 209:return function(e){Ie(e.expression,ue.parenthesizeLeftSideOfAccess),Pe(e.questionDotToken),it(22,e.expression.end,Qt,e),Ie(e.argumentExpression),it(23,e.argumentExpression.end,Qt,e);}(r);case 210:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Qt("("),Ht("0"),Qt(","),tr()),Ie(t.expression,ue.parenthesizeLeftSideOfAccess),r&&Qt(")"),Pe(t.questionDotToken),Bt(t,t.typeArguments),Vt(t,t.arguments,2576,ue.parenthesizeExpressionForDisallowedComma);}(r);case 211:return function(e){it(103,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeExpressionOfNew),Bt(e,e.typeArguments),Vt(e,e.arguments,18960,ue.parenthesizeExpressionForDisallowedComma);}(r);case 212:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Qt("("),Ht("0"),Qt(","),tr()),Ie(t.tag,ue.parenthesizeLeftSideOfAccess),r&&Qt(")"),Bt(t,t.typeArguments),tr(),Ie(t.template);}(r);case 213:return function(e){Qt("<"),Pe(e.type),Qt(">"),Ie(e.expression,ue.parenthesizeOperandOfPrefixUnary);}(r);case 214:return function(e){var t=it(20,e.pos,Qt,e),r=vr(e.expression,e);Ie(e.expression,void 0),hr(e.expression,e),pr(r),it(21,e.expression?e.expression.end:t,Qt,e);}(r);case 215:return function(e){Pr(e.name),lt(e);}(r);case 216:return function(e){wt(e,e.modifiers),ut(e,Ze);}(r);case 217:return function(e){it(89,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeOperandOfPrefixUnary);}(r);case 218:return function(e){it(112,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeOperandOfPrefixUnary);}(r);case 219:return function(e){it(114,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeOperandOfPrefixUnary);}(r);case 220:return function(e){it(133,e.pos,Yt,e),tr(),Ie(e.expression,ue.parenthesizeOperandOfPrefixUnary);}(r);case 221:return function(e){lr(e.operator,Zt),function(e){var t=e.operand;return 221===t.kind&&(39===e.operator&&(39===t.operator||45===t.operator)||40===e.operator&&(40===t.operator||46===t.operator))}(e)&&tr(),Ie(e.operand,ue.parenthesizeOperandOfPrefixUnary);}(r);case 222:return function(e){Ie(e.operand,ue.parenthesizeOperandOfPostfixUnary),lr(e.operator,Zt);}(r);case 223:return de(r);case 224:return function(e){var t=xr(e,e.condition,e.questionToken),r=xr(e,e.questionToken,e.whenTrue),n=xr(e,e.whenTrue,e.colonToken),i=xr(e,e.colonToken,e.whenFalse);Ie(e.condition,ue.parenthesizeConditionOfConditionalExpression),dr(t,!0),Pe(e.questionToken),dr(r,!0),Ie(e.whenTrue,ue.parenthesizeBranchOfConditionalExpression),pr(t,r),dr(n,!0),Pe(e.colonToken),dr(i,!0),Ie(e.whenFalse,ue.parenthesizeBranchOfConditionalExpression),pr(n,i);}(r);case 225:return function(e){Pe(e.head),Kt(e,e.templateSpans,262144);}(r);case 226:return function(e){it(125,e.pos,Yt,e),Pe(e.asteriskToken),Lt(e.expression&&st(e.expression),ct);}(r);case 227:return function(e){it(25,e.pos,Qt,e),Ie(e.expression,ue.parenthesizeExpressionForDisallowedComma);}(r);case 228:return function(e){Pr(e.name),gt(e);}(r);case 229:case 352:case 355:case 356:return;case 231:return function(e){Ie(e.expression,void 0),e.type&&(tr(),Yt("as"),tr(),Pe(e.type));}(r);case 232:return function(e){Ie(e.expression,ue.parenthesizeLeftSideOfAccess),Zt("!");}(r);case 230:return $e(r);case 235:return function(e){Ie(e.expression,void 0),e.type&&(tr(),Yt("satisfies"),tr(),Pe(e.type));}(r);case 233:return function(e){sr(e.keywordToken,e.pos,Qt),Qt("."),Pe(e.name);}(r);case 234:return e.Debug.fail("SyntheticExpression should never be printed.");case 281:return function(e){Pe(e.openingElement),Kt(e,e.children,262144),Pe(e.closingElement);}(r);case 282:return function(e){Qt("<"),mt(e.tagName),Bt(e,e.typeArguments),tr(),Pe(e.attributes),Qt("/>");}(r);case 285:return function(e){Pe(e.openingFragment),Kt(e,e.children,262144),Pe(e.closingFragment);}(r);case 351:return e.Debug.fail("SyntaxList should not be printed");case 353:return function(t){var r=e.getEmitFlags(t);512&r||t.pos===t.expression.pos||rn(t.expression.pos),Ie(t.expression),1024&r||t.end===t.expression.end||en(t.expression.end);}(r);case 354:return function(e){Vt(e,e.elements,528,void 0);}(r);case 357:return e.Debug.fail("SyntheticReferenceExpression should not be printed")}return e.isKeyword(r.kind)?cr(r,Yt):e.isTokenKind(r.kind)?cr(r,Qt):void e.Debug.fail("Unhandled SyntaxKind: ".concat(e.Debug.formatSyntaxKind(r.kind),"."))}function qe(t,r){var n=ze(1,t,r);e.Debug.assertIsDefined(N),r=N,N=void 0,n(t,r);}function We(r){var i=!1,a=309===r.kind?r:void 0;if(!a||V!==e.ModuleKind.None){for(var o=a?a.prepends.length:0,s=a?a.sourceFiles.length+o:1,c=0;c<s;c++){var l=a?c<o?a.prepends[c]:a.sourceFiles[c-o]:r,u=e.isSourceFile(l)?l:e.isUnparsedSource(l)?void 0:n,_=t.noEmitHelpers||!!u&&e.hasRecordedExternalHelpers(u),d=(e.isSourceFile(l)||e.isUnparsedSource(l))&&!h,p=e.isUnparsedSource(l)?l.helpers:He(l);if(p)for(var f=0,g=p;f<g.length;f++){var m=g[f];if(m.scoped){if(a)continue}else {if(_)continue;if(d){if(q.get(m.name))continue;q.set(m.name,!0);}}var v=ye();"string"==typeof m.text?_r(m.text):_r(m.text(Jr)),G&&G.sections.push({pos:v,end:y.getTextPos(),kind:"emitHelpers",data:m.name}),i=!0;}}return i}}function He(t){var r=e.getEmitHelpers(t);return r&&e.stableSort(r,e.compareEmitHelpers)}function Ge(r,n){var i,a=Cr(r,t.neverAsciiEscape,n);!t.sourceMap&&!t.inlineSourceMap||10!==r.kind&&!e.isTemplateLiteralKind(r.kind)?(i=a,y.writeStringLiteral(i)):Ht(a);}function Qe(e){y.rawWrite(e.parent.text.substring(e.pos,e.end));}function Xe(e){(e.symbol?Gt:H)(Tr(e,!1),e.symbol),Kt(e,e.typeArguments,53776);}function Ye(e){(e.symbol?Gt:H)(Tr(e,!1),e.symbol);}function Ze(e){jt(e,e.typeParameters),zt(e,e.parameters),It(e.type),tr(),Pe(e.equalsGreaterThanToken);}function $e(e){Ie(e.expression,ue.parenthesizeLeftSideOfAccess),Bt(e,e.typeArguments);}function et(t,r){it(18,t.pos,Qt,t);var n=r||1&e.getEmitFlags(t)?768:129;Kt(t,t.statements,n),it(19,t.statements.end,Qt,t,!!(1&n));}function tt(e){e?Qt(";"):Xt();}function rt(e,t){var r=it(115,t,Yt,e);tr(),it(20,r,Qt,e),Ie(e.expression),it(21,e.expression.end,Qt,e);}function nt(e){void 0!==e&&(258===e.kind?Pe(e):Ie(e));}function it(t,r,i,a,o){var s=e.getParseTreeNode(a),c=s&&s.kind===a.kind,l=r;if(c&&n&&(r=e.skipTrivia(n.text,r)),c&&a.pos!==l){var u=o&&n&&!e.positionsAreOnSameLine(l,r,n);u&&ar(),en(l),u&&or();}if(r=lr(t,i,r),c&&a.end!==r){var _=291===a.kind;rn(r,!_,_);}return r}function at(e){return 2===e.kind||!!e.hasTrailingNewLine}function ot(t){return !!n&&(!!e.some(e.getLeadingCommentRanges(n.text,t.pos),at)||!!e.some(e.getSyntheticLeadingComments(t),at)||!!e.isPartiallyEmittedExpression(t)&&(!(t.pos===t.expression.pos||!e.some(e.getTrailingCommentRanges(n.text,t.expression.pos),at))||ot(t.expression)))}function st(t){if(!oe&&e.isPartiallyEmittedExpression(t)&&ot(t)){var r=e.getParseTreeNode(t);if(r&&e.isParenthesizedExpression(r)){var n=e.factory.createParenthesizedExpression(t.expression);return e.setOriginalNode(n,t),e.setTextRange(n,r),n}return e.factory.createParenthesizedExpression(t)}return t}function ct(e){return st(ue.parenthesizeExpressionForDisallowedComma(e))}function lt(e){wt(e,e.modifiers),Yt("function"),Pe(e.asteriskToken),tr(),we(e.name),ut(e,_t);}function ut(t,r){var n=t.body;if(n)if(e.isBlock(n)){var i=65536&e.getEmitFlags(t);i&&ar(),Er(t),e.forEach(t.parameters,Ar),Ar(t.body),r(t),dt(n),kr(t),i&&or();}else r(t),tr(),Ie(n,ue.parenthesizeConciseBodyOfArrowFunction);else r(t),Xt();}function _t(e){jt(e,e.typeParameters),Jt(e,e.parameters),It(e.type);}function dt(t){null==L||L(t),tr(),Qt("{"),ar();var r=function(t){if(1&e.getEmitFlags(t))return !0;if(t.multiLine)return !1;if(!e.nodeIsSynthesized(t)&&n&&!e.rangeIsOnSingleLine(t,n))return !1;if(fr(t,e.firstOrUndefined(t.statements),2)||mr(t,e.lastOrUndefined(t.statements),2,t.statements))return !1;for(var r,i=0,a=t.statements;i<a.length;i++){var o=a[i];if(gr(r,o,2)>0)return !1;r=o;}return !0}(t)?pt:ft;Gr(t,t.statements,r),or(),sr(19,t.statements.end,Qt,t),null==R||R(t);}function pt(e){ft(e,!0);}function ft(e,t){var r=Et(e.statements),n=y.getTextPos();We(e),0===r&&n===y.getTextPos()&&t?(or(),Kt(e,e.statements,768),ar()):Kt(e,e.statements,1,void 0,r);}function gt(t){e.forEach(t.members,Fr),Pt(t,t.modifiers),Yt("class"),t.name&&(tr(),we(t.name));var r=65536&e.getEmitFlags(t);r&&ar(),jt(t,t.typeParameters),Kt(t,t.heritageClauses,0),tr(),Qt("{"),Kt(t,t.members,129),Qt("}"),r&&or();}function mt(e){79===e.kind?Ie(e):Pe(e);}function yt(t,r,i){var a=163969;1===r.length&&(!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r[0])||e.rangeStartPositionsAreOnSameLine(t,r[0],n))?(sr(58,i,Qt,t),tr(),a&=-130):it(58,i,Qt,t),Kt(t,r,a);}function vt(t){Kt(t,e.factory.createNodeArray(t.jsDocPropertyTags),33);}function ht(t){t.typeParameters&&Kt(t,e.factory.createNodeArray(t.typeParameters),33),t.parameters&&Kt(t,e.factory.createNodeArray(t.parameters),33),t.type&&(ir(),tr(),Qt("*"),tr(),Pe(t.type));}function bt(e){Qt("@"),Pe(e);}function xt(t){var r=e.getTextOfJSDocComment(t);r&&(tr(),H(r));}function Dt(e){e&&(tr(),Qt("{"),Pe(e.type),Qt("}"));}function St(t){ir();var r=t.statements;0===r.length||!e.isPrologueDirective(r[0])||e.nodeIsSynthesized(r[0])?Gr(t,r,Ct):Ct(t);}function Tt(t,r,i,a){if(t){var o=y.getTextPos();er('/// <reference no-default-lib="true"/>'),G&&G.sections.push({pos:o,end:y.getTextPos(),kind:"no-default-lib"}),ir();}if(n&&n.moduleName&&(er('/// <amd-module name="'.concat(n.moduleName,'" />')),ir()),n&&n.amdDependencies)for(var s=0,c=n.amdDependencies;s<c.length;s++){var l=c[s];l.name?er('/// <amd-dependency name="'.concat(l.name,'" path="').concat(l.path,'" />')):er('/// <amd-dependency path="'.concat(l.path,'" />')),ir();}for(var u=0,_=r;u<_.length;u++){var d=_[u];o=y.getTextPos(),er('/// <reference path="'.concat(d.fileName,'" />')),G&&G.sections.push({pos:o,end:y.getTextPos(),kind:"reference",data:d.fileName}),ir();}for(var p=0,f=i;p<f.length;p++){d=f[p],o=y.getTextPos();var g=d.resolutionMode&&d.resolutionMode!==(null==n?void 0:n.impliedNodeFormat)?'resolution-mode="'.concat(d.resolutionMode===e.ModuleKind.ESNext?"import":"require",'"'):"";er('/// <reference types="'.concat(d.fileName,'" ').concat(g,"/>")),G&&G.sections.push({pos:o,end:y.getTextPos(),kind:d.resolutionMode?d.resolutionMode===e.ModuleKind.ESNext?"type-import":"type-require":"type",data:d.fileName}),ir();}for(var m=0,v=a;m<v.length;m++)d=v[m],o=y.getTextPos(),er('/// <reference lib="'.concat(d.fileName,'" />')),G&&G.sections.push({pos:o,end:y.getTextPos(),kind:"lib",data:d.fileName}),ir();}function Ct(t){var r=t.statements;Er(t),e.forEach(t.statements,Ar),We(t);var n=e.findIndex(r,(function(t){return !e.isPrologueDirective(t)}));!function(e){e.isDeclarationFile&&Tt(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives);}(t),Kt(t,r,1,void 0,-1===n?r.length:n),kr(t);}function Et(t,r,n,i){for(var a=!!r,o=0;o<t.length;o++){var s=t[o];if(!e.isPrologueDirective(s))return o;if(!n||!n.has(s.expression.text)){a&&(a=!1,ke(r)),ir();var c=y.getTextPos();Pe(s),i&&G&&G.sections.push({pos:c,end:y.getTextPos(),kind:"prologue",data:s.expression.text}),n&&n.add(s.expression.text);}}return t.length}function kt(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!t.has(i.data)){ir();var a=y.getTextPos();Pe(i),G&&G.sections.push({pos:a,end:y.getTextPos(),kind:"prologue",data:i.data}),t&&t.add(i.data);}}}function Nt(t){if(e.isSourceFile(t))Et(t.statements,t);else {for(var r=new e.Set,n=0,i=t.prepends;n<i.length;n++)kt(i[n].prologues,r);for(var a=0,o=t.sourceFiles;a<o.length;a++){var s=o[a];Et(s.statements,s,r,!0);}ke(void 0);}}function At(t){if(e.isSourceFile(t)||e.isUnparsedSource(t)){var r=e.getShebang(t.text);if(r)return er(r),ir(),!0}else {for(var n=0,i=t.prepends;n<i.length;n++){var a=i[n];if(e.Debug.assertNode(a,e.isUnparsedSource),At(a))return !0}for(var o=0,s=t.sourceFiles;o<s.length;o++)if(At(s[o]))return !0}}function Ft(e,t){if(e){var r=H;H=t,Pe(e),H=r;}}function Pt(t,r){if(null==r?void 0:r.length){if(e.every(r,e.isModifier))return wt(t,r);if(e.every(r,e.isDecorator))return void Kt(t,r,2146305);null==B||B(r);for(var n=void 0,i=void 0,a=0,o=0;a<r.length;){for(;o<r.length;){var s=r[o];if(i=e.isDecorator(s)?"decorators":"modifiers",void 0===n)n=i;else if(i!==n)break;o++;}var c={pos:-1,end:-1};0===a&&(c.pos=r.pos),o===r.length-1&&(c.end=r.end),Wt(Pe,t,r,"modifiers"===n?2359808:2146305,void 0,a,o-a,!1,c),a=o,n=i,o++;}null==j||j(r);}}function wt(e,t){Kt(e,t,2359808);}function It(e){e&&(Qt(":"),tr(),Pe(e));}function Ot(e,t,r,n){e&&(tr(),it(63,t,Zt,r),tr(),Ie(e,n));}function Mt(e){e&&(tr(),Pe(e));}function Lt(e,t){e&&(tr(),Ie(e,t));}function Rt(t,r){e.isBlock(r)||1&e.getEmitFlags(t)?(tr(),Pe(r)):(ir(),ar(),e.isEmptyStatement(r)?Re(5,r):Pe(r),or());}function Bt(e,t){Kt(e,t,53776,_e);}function jt(t,r){if(e.isFunctionLike(t)&&t.typeArguments)return Bt(t,t.typeArguments);Kt(t,r,53776);}function Jt(e,t){Kt(e,t,2576);}function zt(t,r){!function(t,r){var n=e.singleOrUndefined(r);return n&&n.pos===t.pos&&e.isArrowFunction(t)&&!t.type&&!e.some(t.modifiers)&&!e.some(t.typeParameters)&&!e.some(n.modifiers)&&!n.dotDotDotToken&&!n.questionToken&&!n.type&&!n.initializer&&e.isIdentifier(n.name)}(t,r)?Jt(t,r):Kt(t,r,528);}function Ut(e){switch(60&e){case 0:break;case 16:Qt(",");break;case 4:tr(),Qt("|");break;case 32:tr(),Qt("*"),tr();break;case 8:tr(),Qt("&");}}function Kt(e,t,r,n,i,a){qt(Pe,e,t,r,n,i,a);}function Vt(e,t,r,n,i,a){qt(Ie,e,t,r,n,i,a);}function qt(t,r,a,o,s,c,l){if(void 0===c&&(c=0),void 0===l&&(l=a?a.length-c:0),!(void 0===a&&16384&o)){var u=void 0===a||c>=a.length||0===l;if(u&&32768&o)return null==B||B(a),void(null==j||j(a));15360&o&&(Qt(function(e){return i[15360&e][0]}(o)),u&&a&&rn(a.pos,!0)),null==B||B(a),u?!(1&o)||W&&(!r||n&&e.rangeIsOnSingleLine(r,n))?256&o&&!(524288&o)&&tr():ir():Wt(t,r,a,o,s,c,l,a.hasTrailingComma,a),null==j||j(a),15360&o&&(u&&a&&en(a.end),Qt(function(e){return i[15360&e][1]}(o)));}}function Wt(t,r,n,i,a,o,s,c,l){var u=0==(262144&i),_=u,d=fr(r,n[o],i);d?(ir(d),_=!1):256&i&&tr(),128&i&&ar();for(var p,f,g=function(e,t){return 1===e.length?S:"object"==typeof t?T:C}(t,a),y=!1,v=0;v<s;v++){var h=n[o+v];if(32&i)ir(),Ut(i);else if(p){60&i&&p.end!==(r?r.end:-1)&&en(p.end),Ut(i),be(f);var b=gr(p,h,i);b>0?(0==(131&i)&&(ar(),y=!0),ir(b),_=!1):p&&512&i&&tr();}f=he(h),_?rn(e.getCommentRange(h).pos):_=u,m=h.pos,g(h,t,a,v),y&&(or(),y=!1),p=h;}var x=p?e.getEmitFlags(p):0,D=oe||!!(1024&x),E=c&&64&i&&16&i;E&&(p&&!D?it(27,p.end,Qt,p):Qt(",")),p&&(r?r.end:-1)!==p.end&&60&i&&!D&&en(E&&(null==l?void 0:l.end)?l.end:p.end),128&i&&or(),be(f);var k=mr(r,n[o+s-1],i,l);k?ir(k):2097408&i&&tr();}function Ht(e){y.writeLiteral(e);}function Gt(e,t){y.writeSymbol(e,t);}function Qt(e){y.writePunctuation(e);}function Xt(){y.writeTrailingSemicolon(";");}function Yt(e){y.writeKeyword(e);}function Zt(e){y.writeOperator(e);}function $t(e){y.writeParameter(e);}function er(e){y.writeComment(e);}function tr(){y.writeSpace(" ");}function rr(e){y.writeProperty(e);}function nr(e){y.nonEscapingWrite?y.nonEscapingWrite(e):y.write(e);}function ir(e){void 0===e&&(e=1);for(var t=0;t<e;t++)y.writeLine(t>0);}function ar(){y.increaseIndent();}function or(){y.decreaseIndent();}function sr(t,r,n,i){return $?lr(t,n,r):function(t,r,n,i,a){if($||t&&e.isInJsonFile(t))return a(r,n,i);var o=t&&t.emitNode,s=o&&o.flags||0,c=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[r],l=c&&c.source||x;return i=pn(l,c?c.pos:i),0==(128&s)&&i>=0&&gn(l,i),i=a(r,n,i),c&&(i=c.end),0==(256&s)&&i>=0&&gn(l,i),i}(i,t,n,r,lr)}function cr(t,r){J&&J(t),r(e.tokenToString(t.kind)),z&&z(t);}function lr(t,r,n){var i=e.tokenToString(t);return r(i),n<0?n:n+i.length}function ur(t,r,n){if(1&e.getEmitFlags(t))tr();else if(W){var i=xr(t,r,n);i?ir(i):tr();}else ir();}function _r(t){for(var r=t.split(/\r\n?|\n/g),n=e.guessIndentation(r),i=0,a=r;i<a.length;i++){var o=a[i],s=n?o.slice(n):o;s.length&&(ir(),H(s));}}function dr(e,t){e?(ar(),ir(e)):t&&tr();}function pr(e,t){e&&or(),t&&or();}function fr(t,r,i){if(2&i||W){if(65536&i)return 1;if(void 0===r)return !t||n&&e.rangeIsOnSingleLine(t,n)?0:1;if(r.pos===m)return 0;if(11===r.kind)return 0;if(n&&t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(r)&&(!r.parent||e.getOriginalNode(r.parent)===e.getOriginalNode(t)))return W?yr((function(i){return e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(r.pos,t.pos,n,i)})):e.rangeStartPositionsAreOnSameLine(t,r,n)?0:1;if(br(r,i))return 1}return 1&i?1:0}function gr(t,r,i){if(2&i||W){if(void 0===t||void 0===r)return 0;if(11===r.kind)return 0;if(n&&!e.nodeIsSynthesized(t)&&!e.nodeIsSynthesized(r))return W&&function(t,r){if(r.pos<t.end)return !1;t=e.getOriginalNode(t),r=e.getOriginalNode(r);var n=t.parent;if(!n||n!==r.parent)return !1;var i=e.getContainingNodeArray(t),a=null==i?void 0:i.indexOf(t);return void 0!==a&&a>-1&&i.indexOf(r)===a+1}(t,r)?yr((function(i){return e.getLinesBetweenRangeEndAndRangeStart(t,r,n,i)})):!W&&(a=t,o=r,(a=e.getOriginalNode(a)).parent&&a.parent===e.getOriginalNode(o).parent)?e.rangeEndIsOnSameLineAsRangeStart(t,r,n)?0:1:65536&i?1:0;if(br(t,i)||br(r,i))return 1}else if(e.getStartsOnNewLine(r))return 1;var a,o;return 1&i?1:0}function mr(t,r,i,a){if(2&i||W){if(65536&i)return 1;if(void 0===r)return !t||n&&e.rangeIsOnSingleLine(t,n)?0:1;if(n&&t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(r)&&(!r.parent||r.parent===t)){if(W){var o=a&&!e.positionIsSynthesized(a.end)?a.end:r.end;return yr((function(r){return e.getLinesBetweenPositionAndNextNonWhitespaceCharacter(o,t.end,n,r)}))}return e.rangeEndPositionsAreOnSameLine(t,r,n)?0:1}if(br(r,i))return 1}return 1&i&&!(131072&i)?1:0}function yr(t){e.Debug.assert(!!W);var r=t(!0);return 0===r?t(!1):r}function vr(e,t){var r=W&&fr(t,e,0);return r&&dr(r,!1),!!r}function hr(e,t){var r=W&&mr(t,e,0,void 0);r&&ir(r);}function br(t,r){if(e.nodeIsSynthesized(t)){var n=e.getStartsOnNewLine(t);return void 0===n?0!=(65536&r):n}return 0!=(65536&r)}function xr(t,r,i){return 131072&e.getEmitFlags(t)?0:(t=Sr(t),r=Sr(r),i=Sr(i),e.getStartsOnNewLine(i)?1:!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r)||e.nodeIsSynthesized(i)?0:W?yr((function(t){return e.getLinesBetweenRangeEndAndRangeStart(r,i,n,t)})):e.rangeEndIsOnSameLineAsRangeStart(r,i,n)?0:1)}function Dr(t){return 0===t.statements.length&&(!n||e.rangeEndIsOnSameLineAsRangeStart(t,t,n))}function Sr(t){for(;214===t.kind&&e.nodeIsSynthesized(t);)t=t.expression;return t}function Tr(t,r){if(e.isGeneratedIdentifier(t)||e.isGeneratedPrivateIdentifier(t))return wr(t);if(e.isStringLiteral(t)&&t.textSourceNode)return Tr(t.textSourceNode,r);var i=n,a=!!i&&!!t.parent&&!e.nodeIsSynthesized(t);if(e.isMemberName(t)){if(!a||e.getSourceFileOfNode(t)!==e.getOriginalNode(i))return e.idText(t)}else if(e.Debug.assertNode(t,e.isLiteralExpression),!a)return t.text;return e.getSourceTextOfNodeFromSourceFile(i,t,r)}function Cr(r,i,a){if(10===r.kind&&r.textSourceNode){var o=r.textSourceNode;if(e.isIdentifier(o)||e.isPrivateIdentifier(o)||e.isNumericLiteral(o)){var s=e.isNumericLiteral(o)?o.text:Tr(o);return a?'"'.concat(e.escapeJsxAttributeString(s),'"'):i||16777216&e.getEmitFlags(r)?'"'.concat(e.escapeString(s),'"'):'"'.concat(e.escapeNonAsciiString(s),'"')}return Cr(o,i,a)}var c=(i?1:0)|(a?2:0)|(t.terminateUnterminatedLiterals?4:0)|(t.target&&99===t.target?8:0);return e.getLiteralText(r,n,c)}function Er(t){t&&524288&e.getEmitFlags(t)||(d.push(p),p=0,u.push(_),_=0,c.push(l),l=void 0,f.push(g));}function kr(t){t&&524288&e.getEmitFlags(t)||(p=d.pop(),_=u.pop(),l=c.pop(),g=f.pop());}function Nr(t){g&&g!==e.lastOrUndefined(f)||(g=new e.Set),g.add(t);}function Ar(t){if(t)switch(t.kind){case 238:case 292:case 293:e.forEach(t.statements,Ar);break;case 253:case 251:case 243:case 244:Ar(t.statement);break;case 242:Ar(t.thenStatement),Ar(t.elseStatement);break;case 245:case 247:case 246:Ar(t.initializer),Ar(t.statement);break;case 252:Ar(t.caseBlock);break;case 266:e.forEach(t.clauses,Ar);break;case 255:Ar(t.tryBlock),Ar(t.catchClause),Ar(t.finallyBlock);break;case 295:Ar(t.variableDeclaration),Ar(t.block);break;case 240:Ar(t.declarationList);break;case 258:e.forEach(t.declarations,Ar);break;case 257:case 166:case 205:case 260:case 271:case 277:Pr(t.name);break;case 259:Pr(t.name),524288&e.getEmitFlags(t)&&(e.forEach(t.parameters,Ar),Ar(t.body));break;case 203:case 204:case 272:e.forEach(t.elements,Ar);break;case 269:Ar(t.importClause);break;case 270:Pr(t.name),Ar(t.namedBindings);break;case 273:Pr(t.propertyName||t.name);}}function Fr(e){if(e)switch(e.kind){case 299:case 300:case 169:case 171:case 174:case 175:Pr(e.name);}}function Pr(t){t&&(e.isGeneratedIdentifier(t)||e.isGeneratedPrivateIdentifier(t)?wr(t):e.isBindingPattern(t)&&Ar(t));}function wr(t){if(4==(7&t.autoGenerateFlags))return Ir(e.getNodeForGeneratedName(t),e.isPrivateIdentifier(t),t.autoGenerateFlags,t.autoGeneratePrefix,t.autoGenerateSuffix);var r=t.autoGenerateId;return o[r]||(o[r]=function(t){var r=e.formatGeneratedNamePart(t.autoGeneratePrefix,wr),n=e.formatGeneratedNamePart(t.autoGenerateSuffix);switch(7&t.autoGenerateFlags){case 1:return Br(0,!!(8&t.autoGenerateFlags),e.isPrivateIdentifier(t),r,n);case 2:return e.Debug.assertNode(t,e.isIdentifier),Br(268435456,!!(8&t.autoGenerateFlags),!1,r,n);case 3:return jr(e.idText(t),32&t.autoGenerateFlags?Mr:Or,!!(16&t.autoGenerateFlags),!!(8&t.autoGenerateFlags),e.isPrivateIdentifier(t),r,n)}return e.Debug.fail("Unsupported GeneratedIdentifierKind: ".concat(e.Debug.formatEnum(7&t.autoGenerateFlags,e.GeneratedIdentifierFlags,!0),"."))}(t))}function Ir(t,r,n,i,o){var s=e.getNodeId(t);return a[s]||(a[s]=function(t,r,n,i,a){switch(t.kind){case 79:case 80:return jr(Tr(t),Or,!!(16&n),!!(8&n),r,i,a);case 264:case 263:return e.Debug.assert(!i&&!a&&!r),function(t){var r=Tr(t.name);return function(t,r){for(var n=r;e.isNodeDescendantOf(n,r);n=n.nextContainer)if(n.locals){var i=n.locals.get(e.escapeLeadingUnderscores(t));if(i&&3257279&i.flags)return !1}return !0}(r,t)?r:jr(r,Or,!1,!1,!1,"","")}(t);case 269:case 275:return e.Debug.assert(!i&&!a&&!r),function(t){var r=e.getExternalModuleName(t);return jr(e.isStringLiteral(r)?e.makeIdentifierFromModuleName(r.text):"module",Or,!1,!1,!1,"","")}(t);case 259:case 260:case 274:return e.Debug.assert(!i&&!a&&!r),jr("default",Or,!1,!1,!1,"","");case 228:return e.Debug.assert(!i&&!a&&!r),jr("class",Or,!1,!1,!1,"","");case 171:case 174:case 175:return function(t,r,n,i){return e.isIdentifier(t.name)?Ir(t.name,r):Br(0,!1,r,n,i)}(t,r,i,a);case 164:return Br(0,!0,r,i,a);default:return Br(0,!1,r,i,a)}}(t,r,null!=n?n:0,e.formatGeneratedNamePart(i,wr),e.formatGeneratedNamePart(o)))}function Or(e){return Mr(e)&&!s.has(e)&&!(g&&g.has(e))}function Mr(t){return !n||e.isFileLevelUniqueName(n,t,F)}function Lr(e){var t;switch(e){case"":return p;case"#":return _;default:return null!==(t=null==l?void 0:l.get(e))&&void 0!==t?t:0}}function Rr(t,r){switch(t){case"":p=r;break;case"#":_=r;break;default:null!=l||(l=new e.Map),l.set(t,r);}}function Br(t,r,n,i,a){i.length>0&&35===i.charCodeAt(0)&&(i=i.slice(1));var o=e.formatGeneratedName(n,i,"",a),s=Lr(o);if(t&&!(s&t)){var c=268435456===t?"_i":"_n";if(Or(l=e.formatGeneratedName(n,i,c,a)))return s|=t,r&&Nr(l),Rr(o,s),l}for(;;){var l,u=268435455&s;if(s++,8!==u&&13!==u)if(c=u<26?"_"+String.fromCharCode(97+u):"_"+(u-26),Or(l=e.formatGeneratedName(n,i,c,a)))return r&&Nr(l),Rr(o,s),l}}function jr(t,r,n,i,a,o,c){if(void 0===r&&(r=Or),t.length>0&&35===t.charCodeAt(0)&&(t=t.slice(1)),o.length>0&&35===o.charCodeAt(0)&&(o=o.slice(1)),n&&r(u=e.formatGeneratedName(a,o,t,c)))return i?Nr(u):s.add(u),u;95!==t.charCodeAt(t.length-1)&&(t+="_");for(var l=1;;){var u;if(r(u=e.formatGeneratedName(a,o,t+l,c)))return i?Nr(u):s.add(u),u;l++;}}function Jr(e){return jr(e,Mr,!0,!1,!1,"","")}function zr(e,t){var r=ze(2,e,t),n=re,i=ne,a=ie;Ur(t),r(e,t),Kr(t,n,i,a);}function Ur(t){var r=e.getEmitFlags(t),n=e.getCommentRange(t);!function(t,r,n,i){ce(),ae=!1;var a=n<0||0!=(512&r)||11===t.kind,o=i<0||0!=(1024&r)||11===t.kind;(n>0||i>0)&&n!==i&&(a||Qr(n,352!==t.kind),(!a||n>=0&&0!=(512&r))&&(re=n),(!o||i>=0&&0!=(1024&r))&&(ne=i,258===t.kind&&(ie=i))),e.forEach(e.getSyntheticLeadingComments(t),qr),le();}(t,r,n.pos,n.end),2048&r&&(oe=!0);}function Kr(t,r,n,i){var a=e.getEmitFlags(t),o=e.getCommentRange(t);2048&a&&(oe=!1),Vr(t,a,o.pos,o.end,r,n,i);var s=e.getTypeNode(t);s&&Vr(t,a,s.pos,s.end,r,n,i);}function Vr(t,r,n,i,a,o,s){ce();var c=i<0||0!=(1024&r)||11===t.kind;e.forEach(e.getSyntheticTrailingComments(t),Wr),(n>0||i>0)&&n!==i&&(re=a,ne=o,ie=s,c||352===t.kind||function(e){sn(e,tn);}(i)),le();}function qr(e){(e.hasLeadingNewline||2===e.kind)&&y.writeLine(),Hr(e),e.hasTrailingNewLine||2===e.kind?y.writeLine():y.writeSpace(" ");}function Wr(e){y.isAtStartOfLine()||y.writeSpace(" "),Hr(e),e.hasTrailingNewLine&&y.writeLine();}function Hr(t){var r=function(e){return 3===e.kind?"/*".concat(e.text,"*/"):"//".concat(e.text)}(t),n=3===t.kind?e.computeLineStarts(r):void 0;e.writeCommentRange(r,n,y,0,r.length,K);}function Gr(t,r,i){ce();var a,o,s=r.pos,c=r.end,l=e.getEmitFlags(t),u=oe||c<0||0!=(1024&l);s<0||0!=(512&l)||(a=r,(o=n&&e.emitDetachedComments(n.text,Fe(),y,cn,a,K,oe))&&(k?k.push(o):k=[o])),le(),2048&l&&!oe?(oe=!0,i(t),oe=!1):i(t),ce(),u||(Qr(r.end,!0),ae&&!y.isAtStartOfLine()&&y.writeLine()),le();}function Qr(e,t){ae=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?on(e,Yr):on(e,$r):0===e&&on(e,Xr);}function Xr(e,t,r,n,i){ln(e,t)&&$r(e,t,r,n,i);}function Yr(e,t,r,n,i){ln(e,t)||$r(e,t,r,n,i);}function Zr(r,n){return !t.onlyPrintJsDocStyle||e.isJSDocLikeText(r,n)||e.isPinnedComment(r,n)}function $r(t,r,i,a,o){n&&Zr(n.text,t)&&(ae||(e.emitNewLineBeforeLeadingCommentOfPosition(Fe(),y,o,t),ae=!0),fn(t),e.writeCommentRange(n.text,Fe(),y,t,r,K),fn(r),a?y.writeLine():3===i&&y.writeSpace(" "));}function en(e){oe||-1===e||Qr(e,!0);}function tn(t,r,i,a){n&&Zr(n.text,t)&&(y.isAtStartOfLine()||y.writeSpace(" "),fn(t),e.writeCommentRange(n.text,Fe(),y,t,r,K),fn(r),a&&y.writeLine());}function rn(e,t,r){oe||(ce(),sn(e,t?tn:r?nn:an),le());}function nn(t,r,i){n&&(fn(t),e.writeCommentRange(n.text,Fe(),y,t,r,K),fn(r),2===i&&y.writeLine());}function an(t,r,i,a){n&&(fn(t),e.writeCommentRange(n.text,Fe(),y,t,r,K),fn(r),a?y.writeLine():y.writeSpace(" "));}function on(t,r){!n||-1!==re&&t===re||(function(t){return void 0!==k&&e.last(k).nodePos===t}(t)?function(t){if(n){var r=e.last(k).detachedCommentEndPos;k.length-1?k.pop():k=void 0,e.forEachLeadingCommentRange(n.text,r,t,r);}}(r):e.forEachLeadingCommentRange(n.text,t,r,t));}function sn(t,r){n&&(-1===ne||t!==ne&&t!==ie)&&e.forEachTrailingCommentRange(n.text,t,r);}function cn(t,r,i,a,o,s){n&&Zr(n.text,a)&&(fn(a),e.writeCommentRange(t,r,i,a,o,s),fn(o));}function ln(t,r){return !!n&&e.isRecognizedTripleSlashComment(n.text,t,r)}function un(e,t){var r=ze(3,e,t);_n(t),r(e,t),dn(t);}function _n(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);if(e.isUnparsedNode(t)){e.Debug.assertIsDefined(t.parent,"UnparsedNodes must have parent pointers");var i=function(t){return void 0===t.parsedSourceMap&&void 0!==t.sourceMapText&&(t.parsedSourceMap=e.tryParseRawSourceMap(t.sourceMapText)||!1),t.parsedSourceMap||void 0}(t.parent);i&&b&&b.appendSourceMap(y.getLine(),y.getColumn(),i,t.parent.sourceMapPath,t.parent.getLineAndCharacterOfPosition(t.pos),t.parent.getLineAndCharacterOfPosition(t.end));}else {var a=n.source||x;352!==t.kind&&0==(16&r)&&n.pos>=0&&gn(n.source||x,pn(a,n.pos)),64&r&&($=!0);}}function dn(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);e.isUnparsedNode(t)||(64&r&&($=!1),352!==t.kind&&0==(32&r)&&n.end>=0&&gn(n.source||x,n.end));}function pn(t,r){return t.skipTrivia?t.skipTrivia(r):e.skipTrivia(t.text,r)}function fn(t){if(!($||e.positionIsSynthesized(t)||yn(x))){var r=e.getLineAndCharacterOfPosition(x,t),n=r.line,i=r.character;b.addMapping(y.getLine(),y.getColumn(),ee,n,i,void 0);}}function gn(e,t){if(e!==x){var r=x,n=ee;mn(e),fn(t),function(e,t){x=e,ee=t;}(r,n);}else fn(t);}function mn(e){$||(x=e,e!==D?yn(e)||(ee=b.addSource(e.fileName),t.inlineSources&&b.setSourceContent(ee,e.text),D=e,te=ee):ee=te);}function yn(t){return e.fileExtensionIs(t.fileName,".json")}}function S(e,t,r,n){t(e);}function T(e,t,r,n){t(e,r.select(n));}function C(e,t,r,n){t(e,r);}e.isBuildInfoFile=function(t){return e.fileExtensionIs(t,".tsbuildinfo")},e.forEachEmittedFile=a,e.getTsBuildInfoEmitOutputFilePath=o,e.getOutputPathsForBundle=s,e.getOutputPathsFor=c,e.getOutputExtension=u,e.getOutputDeclarationFileName=d,e.getCommonSourceDirectory=y,e.getCommonSourceDirectoryOfConfig=v,e.getAllProjectOutputs=function(t,r){var n=f(),i=n.addOutput,a=n.getOutputs;if(e.outFile(t.options))g(t,i);else {for(var s=e.memoize((function(){return v(t,r)})),c=0,l=t.fileNames;c<l.length;c++){var u=l[c];m(t,u,r,i,s);}i(o(t.options));}return a()},e.getOutputFileNames=function(t,r,n){r=e.normalizePath(r),e.Debug.assert(e.contains(t.fileNames,r),"Expected fileName to be present in command line");var i=f(),a=i.addOutput,o=i.getOutputs;return e.outFile(t.options)?g(t,a):m(t,r,n,a),o()},e.getFirstProjectOutput=function(t,r){if(e.outFile(t.options)){var n=s(t.options,!1).jsFilePath;return e.Debug.checkDefined(n,"project ".concat(t.options.configFilePath," expected to have at least one output"))}for(var i=e.memoize((function(){return v(t,r)})),a=0,c=t.fileNames;a<c.length;a++){var l=c[a];if(!e.isDeclarationFileName(l)){if(n=p(l,t,r,i))return n;if(!e.fileExtensionIs(l,".json")&&e.getEmitDeclarations(t.options))return d(l,t,r,i)}}return o(t.options)||e.Debug.fail("project ".concat(t.options.configFilePath," expected to have at least one output"))},e.emitFiles=h,e.getBuildInfoText=b,e.getBuildInfo=x,e.notImplementedResolver={hasGlobalName:e.notImplemented,getReferencedExportContainer:e.notImplemented,getReferencedImportDeclaration:e.notImplemented,getReferencedDeclarationWithCollidingName:e.notImplemented,isDeclarationWithCollidingName:e.notImplemented,isValueAliasDeclaration:e.notImplemented,isReferencedAliasDeclaration:e.notImplemented,isTopLevelValueImportEqualsWithEntityName:e.notImplemented,getNodeCheckFlags:e.notImplemented,isDeclarationVisible:e.notImplemented,isLateBound:function(e){return !1},collectLinkedAliases:e.notImplemented,isImplementationOfOverload:e.notImplemented,isRequiredInitializedParameter:e.notImplemented,isOptionalUninitializedParameterProperty:e.notImplemented,isExpandoFunctionDeclaration:e.notImplemented,getPropertiesOfContainerFunction:e.notImplemented,createTypeOfDeclaration:e.notImplemented,createReturnTypeOfSignatureDeclaration:e.notImplemented,createTypeOfExpression:e.notImplemented,createLiteralConstValue:e.notImplemented,isSymbolAccessible:e.notImplemented,isEntityNameVisible:e.notImplemented,getConstantValue:e.notImplemented,getReferencedValueDeclaration:e.notImplemented,getTypeReferenceSerializationKind:e.notImplemented,isOptionalParameter:e.notImplemented,moduleExportsSomeValue:e.notImplemented,isArgumentsLocalBinding:e.notImplemented,getExternalModuleFileFromDeclaration:e.notImplemented,getTypeReferenceDirectivesForEntityName:e.notImplemented,getTypeReferenceDirectivesForSymbol:e.notImplemented,isLiteralConstDeclaration:e.notImplemented,getJsxFactoryEntity:e.notImplemented,getJsxFragmentFactoryEntity:e.notImplemented,getAllAccessorDeclarations:e.notImplemented,getSymbolOfExternalModuleSpecifier:e.notImplemented,isBindingCapturedByNode:e.notImplemented,getDeclarationStatementsForSourceFile:e.notImplemented,isImportRequiredByAugmentation:e.notImplemented},e.emitUsingBuildInfo=function(t,r,i,a){var o,c=e.maybeBind(r,r.createHash),l=s(t.options,!1),u=l.buildInfoPath,_=l.jsFilePath,d=l.sourceMapFilePath,p=l.declarationFilePath,f=l.declarationMapPath;if(r.getBuildInfo)o=r.getBuildInfo(u,t.options.configFilePath);else {var g=r.readFile(u);if(!g)return u;o=x(u,g);}if(!o)return u;if(!o.bundle||!o.bundle.js||p&&!o.bundle.dts)return u;var m=r.readFile(e.Debug.checkDefined(_));if(!m)return _;if(e.computeSignature(m,c)!==o.bundle.js.hash)return _;var y=d&&r.readFile(d);if(d&&!y||t.options.inlineSourceMap)return d||"inline sourcemap decoding";if(d&&e.computeSignature(y,c)!==o.bundle.js.mapHash)return d;var v=p&&r.readFile(p);if(p&&!v)return p;if(p&&e.computeSignature(v,c)!==o.bundle.dts.hash)return p;var D=f&&r.readFile(f);if(f&&!D||t.options.inlineSourceMap)return f||"inline sourcemap decoding";if(f&&e.computeSignature(D,c)!==o.bundle.dts.mapHash)return f;var S,T,C=e.getDirectoryPath(e.getNormalizedAbsolutePath(u,r.getCurrentDirectory())),E=e.createInputFiles(m,v,d,y,f,D,_,p,u,o,!0),k=[],N=e.createPrependNodes(t.projectReferences,i,(function(e){return r.readFile(e)})),A=function(t,r,n){var i,a=e.Debug.checkDefined(t.js),o=(null===(i=a.sources)||void 0===i?void 0:i.prologues)&&e.arrayToMap(a.sources.prologues,(function(e){return e.file}));return t.sourceFiles.map((function(t,i){var a,s,c=null==o?void 0:o.get(i),l=null==c?void 0:c.directives.map((function(t){var r=e.setTextRange(e.factory.createStringLiteral(t.expression.text),t.expression),n=e.setTextRange(e.factory.createExpressionStatement(r),t);return e.setParent(r,n),n})),u=e.factory.createToken(1),_=e.factory.createSourceFile(null!=l?l:[],u,0);return _.fileName=e.getRelativePathFromDirectory(n.getCurrentDirectory(),e.getNormalizedAbsolutePath(t,r),!n.useCaseSensitiveFileNames()),_.text=null!==(a=null==c?void 0:c.text)&&void 0!==a?a:"",e.setTextRangePosWidth(_,0,null!==(s=null==c?void 0:c.text.length)&&void 0!==s?s:0),e.setEachParent(_.statements,_),e.setTextRangePosWidth(u,_.end,0),e.setParent(u,_),_}))}(o.bundle,C,r),F={getPrependNodes:e.memoize((function(){return n$4(n$4([],N,!0),[E],!1)})),getCanonicalFileName:r.getCanonicalFileName,getCommonSourceDirectory:function(){return e.getNormalizedAbsolutePath(o.bundle.commonSourceDirectory,C)},getCompilerOptions:function(){return t.options},getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.getNewLine()},getSourceFile:e.returnUndefined,getSourceFileByPath:e.returnUndefined,getSourceFiles:function(){return A},getLibFileFromReference:e.notImplemented,isSourceFileFromExternalLibrary:e.returnFalse,getResolvedProjectReferenceToRedirect:e.returnUndefined,getProjectReferenceRedirect:e.returnUndefined,isSourceOfProjectReferenceRedirect:e.returnFalse,writeFile:function(r,n,i,a,s,l){switch(r){case _:if(m===n)return;break;case d:if(y===n)return;break;case u:var g=l.buildInfo;g.program=o.program,g.program&&void 0!==S&&t.options.composite&&(g.program.outSignature=e.computeSignature(S,c,T));var h=o.bundle,x=h.js,C=h.dts,E=h.sourceFiles;return g.bundle.js.sources=x.sources,C&&(g.bundle.dts.sources=C.sources),g.bundle.sourceFiles=E,void k.push({name:r,text:b(g),writeByteOrderMark:i,buildInfo:g});case p:if(v===n)return;S=n,T=l;break;case f:if(D===n)return;break;default:e.Debug.fail("Unexpected path: ".concat(r));}k.push({name:r,text:n,writeByteOrderMark:i});},isEmitBlocked:e.returnFalse,readFile:function(e){return r.readFile(e)},fileExists:function(e){return r.fileExists(e)},useCaseSensitiveFileNames:function(){return r.useCaseSensitiveFileNames()},getProgramBuildInfo:e.returnUndefined,getSourceFileFromReference:e.returnUndefined,redirectTargetsMap:e.createMultiMap(),getFileIncludeReasons:e.notImplemented,createHash:c};return h(e.notImplementedResolver,F,void 0,e.getTransformers(t.options,a)),k},function(e){e[e.Notification=0]="Notification",e[e.Substitution=1]="Substitution",e[e.Comments=2]="Comments",e[e.SourceMaps=3]="SourceMaps",e[e.Emit=4]="Emit";}(t||(t={})),e.createPrinter=D,function(e){e[e.Auto=0]="Auto",e[e.CountMask=268435455]="CountMask",e[e._i=268435456]="_i";}(r||(r={}));}(t),function(e){var t,r;function i(e){e.watcher.close();}e.createCachedDirectoryStructureHost=function(t,r,n){if(t.getDirectories&&t.readDirectory){var i=new e.Map,a=e.createGetCanonicalFileName(n);return {useCaseSensitiveFileNames:n,fileExists:function(e){var r=c(o(e));return r&&_(r.sortedAndCanonicalizedFiles,a(l(e)))||t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:t.directoryExists&&function(r){var n=o(r);return i.has(e.ensureTrailingDirectorySeparator(n))||t.directoryExists(r)},getDirectories:function(e){var r=u(e,o(e));return r?r.directories.slice():t.getDirectories(e)},readDirectory:function(i,a,s,c,_){var p,f=o(i),g=u(i,f);return void 0!==g?e.matchFiles(i,a,s,c,n,r,_,(function(t){var r=o(t);if(r===f)return g||m(t,r);var n=u(t,r);return void 0!==n?n||m(t,r):e.emptyFileSystemEntries}),d):t.readDirectory(i,a,s,c,_);function m(r,n){if(p&&n===f)return p;var i={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||e.emptyArray,directories:t.getDirectories(r)||e.emptyArray};return n===f&&(p=i),i}},createDirectory:t.createDirectory&&function(r){var n=c(o(r));if(n){var i=l(r),s=a(i),u=n.sortedAndCanonicalizedDirectories;e.insertSorted(u,s,e.compareStringsCaseSensitive)&&n.directories.push(i);}t.createDirectory(r);},writeFile:t.writeFile&&function(e,r,n){var i=c(o(e));return i&&p(i,l(e),!0),t.writeFile(e,r,n)},addOrDeleteFileOrDirectory:function(e,r){if(void 0===s(r)){var n=c(r);if(n){if(t.directoryExists){var i=l(e),o={fileExists:t.fileExists(r),directoryExists:t.directoryExists(r)};return o.directoryExists||_(n.sortedAndCanonicalizedDirectories,a(i))?f():p(n,i,o.fileExists),o}f();}}else f();},addOrDeleteFile:function(t,r,n){if(n!==e.FileWatcherEventKind.Changed){var i=c(r);i&&p(i,l(t),n===e.FileWatcherEventKind.Created);}},clearCache:f,realpath:t.realpath&&d}}function o(t){return e.toPath(t,r,a)}function s(t){return i.get(e.ensureTrailingDirectorySeparator(t))}function c(t){var r=s(e.getDirectoryPath(t));return r?(r.sortedAndCanonicalizedFiles||(r.sortedAndCanonicalizedFiles=r.files.map(a).sort(),r.sortedAndCanonicalizedDirectories=r.directories.map(a).sort()),r):r}function l(t){return e.getBaseFileName(e.normalizePath(t))}function u(r,n){var a=s(n=e.ensureTrailingDirectorySeparator(n));if(a)return a;try{return function(r,n){var a;if(!t.realpath||e.ensureTrailingDirectorySeparator(o(t.realpath(r)))===n){var s={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||[],directories:t.getDirectories(r)||[]};return i.set(e.ensureTrailingDirectorySeparator(n),s),s}if(null===(a=t.directoryExists)||void 0===a?void 0:a.call(t,r))return i.set(n,!1),!1}(r,n)}catch(t){return void e.Debug.assert(!i.has(e.ensureTrailingDirectorySeparator(n)))}}function _(t,r){return e.binarySearch(t,r,e.identity,e.compareStringsCaseSensitive)>=0}function d(e){return t.realpath?t.realpath(e):e}function p(t,r,n){var i=t.sortedAndCanonicalizedFiles,o=a(r);if(n)e.insertSorted(i,o,e.compareStringsCaseSensitive)&&t.files.push(r);else {var s=e.binarySearch(i,o,e.identity,e.compareStringsCaseSensitive);if(s>=0){i.splice(s,1);var c=t.files.findIndex((function(e){return a(e)===o}));t.files.splice(c,1);}}}function f(){i.clear();}},(r=e.ConfigFileProgramReloadLevel||(e.ConfigFileProgramReloadLevel={}))[r.None=0]="None",r[r.Partial=1]="Partial",r[r.Full=2]="Full",e.updateSharedExtendedConfigFileWatcher=function(t,r,n,i,a){var o,s=e.arrayToMap((null===(o=null==r?void 0:r.configFile)||void 0===o?void 0:o.extendedSourceFiles)||e.emptyArray,a);n.forEach((function(e,r){s.has(r)||(e.projects.delete(t),e.close());})),s.forEach((function(r,a){var o=n.get(a);o?o.projects.add(t):n.set(a,{projects:new e.Set([t]),watcher:i(r,a),close:function(){var e=n.get(a);e&&0===e.projects.size&&(e.watcher.close(),n.delete(a));}});}));},e.clearSharedExtendedConfigFileWatcher=function(e,t){t.forEach((function(t){t.projects.delete(e)&&t.close();}));},e.cleanExtendedConfigCache=function e(t,r,n){t.delete(r)&&t.forEach((function(i,a){var o;(null===(o=i.extendedResult.extendedSourceFiles)||void 0===o?void 0:o.some((function(e){return n(e)===r})))&&e(t,a,n);}));},e.updatePackageJsonWatch=function(t,r,n){var i=new e.Map(t);e.mutateMap(r,i,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateMissingFilePathsWatch=function(t,r,n){var i=t.getMissingFilePaths(),a=e.arrayToMap(i,e.identity,e.returnTrue);e.mutateMap(r,a,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateWatchingWildcardDirectories=function(t,r,n){function a(e,t){return {watcher:n(e,t),flags:t}}e.mutateMap(t,r,{createNewValue:a,onDeleteValue:i,onExistingValue:function(e,r,n){e.flags!==r&&(e.watcher.close(),t.set(n,a(n,r)));}});},e.isIgnoredFileFromWildCardWatching=function(t){var r=t.watchedDirPath,n=t.fileOrDirectory,i=t.fileOrDirectoryPath,a=t.configFileName,o=t.options,s=t.program,c=t.extraFileExtensions,l=t.currentDirectory,u=t.useCaseSensitiveFileNames,_=t.writeLog,d=t.toPath,p=e.removeIgnoredPath(i);if(!p)return _("Project: ".concat(a," Detected ignored path: ").concat(n)),!0;if((i=p)===r)return !1;if(e.hasExtension(i)&&!e.isSupportedSourceFileName(n,o,c))return _("Project: ".concat(a," Detected file add/remove of non supported extension: ").concat(n)),!0;if(e.isExcludedFile(n,o.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(a),l),u,l))return _("Project: ".concat(a," Detected excluded file: ").concat(n)),!0;if(!s)return !1;if(e.outFile(o)||o.outDir)return !1;if(e.isDeclarationFileName(i)){if(o.declarationDir)return !1}else if(!e.fileExtensionIsOneOf(i,e.supportedJSExtensionsFlat))return !1;var f=e.removeFileExtension(i),g=e.isArray(s)?void 0:function(e){return !!e.getState}(s)?s.getProgramOrUndefined():s,m=g||e.isArray(s)?void 0:s;return !(!y(f+".ts")&&!y(f+".tsx")||(_("Project: ".concat(a," Detected output file: ").concat(n)),0));function y(t){return g?!!g.getSourceFileByPath(t):m?m.getState().fileInfos.has(t):!!e.find(s,(function(e){return d(e)===t}))}},e.isEmittedFileOfProgram=function(e,t){return !!e&&e.isEmittedFile(t)},function(e){e[e.None=0]="None",e[e.TriggerOnly=1]="TriggerOnly",e[e.Verbose=2]="Verbose";}(t=e.WatchLogLevel||(e.WatchLogLevel={})),e.getWatchFactory=function(r,i,a,o){e.setSysLog(i===t.Verbose?a:e.noop);var s={watchFile:function(e,t,n,i){return r.watchFile(e,t,n,i)},watchDirectory:function(e,t,n,i){return r.watchDirectory(e,t,0!=(1&n),i)}},c=i!==t.None?{watchFile:d("watchFile"),watchDirectory:d("watchDirectory")}:void 0,l=i===t.Verbose?{watchFile:function(e,t,r,n,i,s){a("FileWatcher:: Added:: ".concat(p(e,r,n,i,s,o)));var l=c.watchFile(e,t,r,n,i,s);return {close:function(){a("FileWatcher:: Close:: ".concat(p(e,r,n,i,s,o))),l.close();}}},watchDirectory:function(t,r,n,i,s,l){var u="DirectoryWatcher:: Added:: ".concat(p(t,n,i,s,l,o));a(u);var _=e.timestamp(),d=c.watchDirectory(t,r,n,i,s,l),f=e.timestamp()-_;return a("Elapsed:: ".concat(f,"ms ").concat(u)),{close:function(){var r="DirectoryWatcher:: Close:: ".concat(p(t,n,i,s,l,o));a(r);var c=e.timestamp();d.close();var u=e.timestamp()-c;a("Elapsed:: ".concat(u,"ms ").concat(r));}}}}:c||s,u=i===t.Verbose?function(e,t,r,n,i){return a("ExcludeWatcher:: Added:: ".concat(p(e,t,r,n,i,o))),{close:function(){return a("ExcludeWatcher:: Close:: ".concat(p(e,t,r,n,i,o)))}}}:e.returnNoopFileWatcher;return {watchFile:_("watchFile"),watchDirectory:_("watchDirectory")};function _(t){return function(n,i,a,o,s,c){var _;return e.matchesExclude(n,"watchFile"===t?null==o?void 0:o.excludeFiles:null==o?void 0:o.excludeDirectories,"boolean"==typeof r.useCaseSensitiveFileNames?r.useCaseSensitiveFileNames:r.useCaseSensitiveFileNames(),(null===(_=r.getCurrentDirectory)||void 0===_?void 0:_.call(r))||"")?u(n,a,o,s,c):l[t].call(void 0,n,i,a,o,s,c)}}function d(t){return function(r,i,c,l,u,_){return s[t].call(void 0,r,(function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];var f="".concat("watchFile"===t?"FileWatcher":"DirectoryWatcher",":: Triggered with ").concat(s[0]," ").concat(void 0!==s[1]?s[1]:"",":: ").concat(p(r,c,l,u,_,o));a(f);var g=e.timestamp();i.call.apply(i,n$4([void 0],s,!1));var m=e.timestamp()-g;a("Elapsed:: ".concat(m,"ms ").concat(f));}),c,l,u,_)}}function p(e,t,r,n,i,a){return "WatchInfo: ".concat(e," ").concat(t," ").concat(JSON.stringify(r)," ").concat(a?a(n,i):void 0===i?n:"".concat(n," ").concat(i))}},e.getFallbackOptions=function(t){var r=null==t?void 0:t.fallbackPolling;return {watchFile:void 0!==r?r:e.WatchFileKind.PriorityPollingInterval}},e.closeFileWatcherOf=i;}(t),function(e){function t(t,r){var n=e.getDirectoryPath(r),i=e.isRootedDiskPath(t)?t:e.combinePaths(n,t);return e.normalizePath(i)}function r(e,t){return a(e,t)}function a(t,r,n){void 0===n&&(n=e.sys);var i=new e.Map,a=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames);function o(){return e.getDirectoryPath(e.normalizePath(n.getExecutingFilePath()))}var s=e.getNewLineCharacter(t,(function(){return n.newLine})),c=n.realpath&&function(e){return n.realpath(e)},l={getSourceFile:function(t,n,i){var a;try{e.performance.mark("beforeIORead"),a=l.readFile(t),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){i&&i(e.message),a="";}return void 0!==a?e.createSourceFile(t,a,n,r):void 0},getDefaultLibLocation:o,getDefaultLibFileName:function(t){return e.combinePaths(o(),e.getDefaultLibFileName(t))},writeFile:function(t,r,a,o){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(t,r,a,(function(e,t,r){return n.writeFile(e,t,r)}),(function(e){return (l.createDirectory||n.createDirectory)(e)}),(function(e){return t=e,!!i.has(t)||!!(l.directoryExists||n.directoryExists)(t)&&(i.set(t,!0),!0);var t;})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){o&&o(e.message);}},getCurrentDirectory:e.memoize((function(){return n.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return n.useCaseSensitiveFileNames},getCanonicalFileName:a,getNewLine:function(){return s},fileExists:function(e){return n.fileExists(e)},readFile:function(e){return n.readFile(e)},trace:function(e){return n.write(e+s)},directoryExists:function(e){return n.directoryExists(e)},getEnvironmentVariable:function(e){return n.getEnvironmentVariable?n.getEnvironmentVariable(e):""},getDirectories:function(e){return n.getDirectories(e)},realpath:c,readDirectory:function(e,t,r,i,a){return n.readDirectory(e,t,r,i,a)},createDirectory:function(e){return n.createDirectory(e)},createHash:e.maybeBind(n,n.createHash)};return l}function o(t,r){var n="".concat(e.diagnosticCategoryName(t)," TS").concat(t.code,": ").concat(g(t.messageText,r.getNewLine())).concat(r.getNewLine());if(t.file){var i=e.getLineAndCharacterOfPosition(t.file,t.start),a=i.line,o=i.character,s=t.file.fileName,c=e.convertToRelativePath(s,r.getCurrentDirectory(),(function(e){return r.getCanonicalFileName(e)}));return "".concat(c,"(").concat(a+1,",").concat(o+1,"): ")+n}return n}var s;e.findConfigFile=function(t,r,n){return void 0===n&&(n="tsconfig.json"),e.forEachAncestorDirectory(t,(function(t){var i=e.combinePaths(t,n);return r(i)?i:void 0}))},e.resolveTripleslashReference=t,e.computeCommonSourceDirectoryOfFilenames=function(t,r,n){var i;return e.forEach(t,(function(t){var a=e.getNormalizedPathComponents(t,r);if(a.pop(),i){for(var o=Math.min(i.length,a.length),s=0;s<o;s++)if(n(i[s])!==n(a[s])){if(0===s)return !0;i.length=s;break}a.length<i.length&&(i.length=a.length);}else i=a;}))?"":i?e.getPathFromPathComponents(i):r},e.createCompilerHost=r,e.createCompilerHostWorker=a,e.changeCompilerHostLikeToUseCache=function(t,r,i){var a=t.readFile,o=t.fileExists,s=t.directoryExists,c=t.createDirectory,l=t.writeFile,u=new e.Map,_=new e.Map,d=new e.Map,p=new e.Map,f=function(e,r){var n=a.call(t,r);return u.set(e,void 0!==n&&n),n};t.readFile=function(n){var i=r(n),o=u.get(i);return void 0!==o?!1!==o?o:void 0:e.fileExtensionIs(n,".json")||e.isBuildInfoFile(n)?f(i,n):a.call(t,n)};var g=i?function(t,n,a,o){var s=r(t),c="object"==typeof n?n.impliedNodeFormat:void 0,l=p.get(c),u=null==l?void 0:l.get(s);if(u)return u;var _=i(t,n,a,o);return _&&(e.isDeclarationFileName(t)||e.fileExtensionIs(t,".json"))&&p.set(c,(l||new e.Map).set(s,_)),_}:void 0;return t.fileExists=function(e){var n=r(e),i=_.get(n);if(void 0!==i)return i;var a=o.call(t,e);return _.set(n,!!a),a},l&&(t.writeFile=function(e,i){for(var a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];var s=r(e);_.delete(s);var c=u.get(s);void 0!==c&&c!==i?(u.delete(s),p.forEach((function(e){return e.delete(s)}))):g&&p.forEach((function(e){var t=e.get(s);t&&t.text!==i&&e.delete(s);})),l.call.apply(l,n$4([t,e,i],a,!1));}),s&&(t.directoryExists=function(e){var n=r(e),i=d.get(n);if(void 0!==i)return i;var a=s.call(t,e);return d.set(n,!!a),a},c&&(t.createDirectory=function(e){var n=r(e);d.delete(n),c.call(t,e);})),{originalReadFile:a,originalFileExists:o,originalDirectoryExists:s,originalCreateDirectory:c,originalWriteFile:l,getSourceFileWithCache:g,readFileWithCache:function(e){var t=r(e),n=u.get(t);return void 0!==n?!1!==n?n:void 0:f(t,e)}}},e.getPreEmitDiagnostics=function(t,r,n){var i;return i=e.addRange(i,t.getConfigFileParsingDiagnostics()),i=e.addRange(i,t.getOptionsDiagnostics(n)),i=e.addRange(i,t.getSyntacticDiagnostics(r,n)),i=e.addRange(i,t.getGlobalDiagnostics(n)),i=e.addRange(i,t.getSemanticDiagnostics(r,n)),e.getEmitDeclarations(t.getCompilerOptions())&&(i=e.addRange(i,t.getDeclarationDiagnostics(r,n))),e.sortAndDeduplicateDiagnostics(i||e.emptyArray)},e.formatDiagnostics=function(e,t){for(var r="",n=0,i=e;n<i.length;n++)r+=o(i[n],t);return r},e.formatDiagnostic=o,function(e){e.Grey="[90m",e.Red="[91m",e.Yellow="[93m",e.Blue="[94m",e.Cyan="[96m";}(s=e.ForegroundColorEscapeSequences||(e.ForegroundColorEscapeSequences={}));var c="[7m",l="[0m",u="  ";function _(t){switch(t){case e.DiagnosticCategory.Error:return s.Red;case e.DiagnosticCategory.Warning:return s.Yellow;case e.DiagnosticCategory.Suggestion:return e.Debug.fail("Should never get an Info diagnostic on the command line.");case e.DiagnosticCategory.Message:return s.Blue}}function d(e,t){return t+e+l}function p(t,r,n,i,a,o){var s=e.getLineAndCharacterOfPosition(t,r),u=s.line,_=s.character,p=e.getLineAndCharacterOfPosition(t,r+n),f=p.line,g=p.character,m=e.getLineAndCharacterOfPosition(t,t.text.length).line,y=f-u>=4,v=(f+1+"").length;y&&(v=Math.max("...".length,v));for(var h="",b=u;b<=f;b++){h+=o.getNewLine(),y&&u+1<b&&b<f-1&&(h+=i+d(e.padLeft("...",v),c)+" "+o.getNewLine(),b=f-1);var x=e.getPositionOfLineAndCharacter(t,b,0),D=b<m?e.getPositionOfLineAndCharacter(t,b+1,0):t.text.length,S=t.text.slice(x,D);if(S=(S=e.trimStringEnd(S)).replace(/\t/g," "),h+=i+d(e.padLeft(b+1+"",v),c)+" ",h+=S+o.getNewLine(),h+=i+d(e.padLeft("",v),c)+" ",h+=a,b===u){var T=b===f?g:void 0;h+=S.slice(0,_).replace(/\S/g," "),h+=S.slice(_,T).replace(/./g,"~");}else h+=b===f?S.slice(0,g).replace(/./g,"~"):S.replace(/./g,"~");h+=l;}return h}function f(t,r,n,i){void 0===i&&(i=d);var a=e.getLineAndCharacterOfPosition(t,r),o=a.line,c=a.character,l="";return l+=i(n?e.convertToRelativePath(t.fileName,n.getCurrentDirectory(),(function(e){return n.getCanonicalFileName(e)})):t.fileName,s.Cyan),l+=":",l+=i("".concat(o+1),s.Yellow),(l+=":")+i("".concat(c+1),s.Yellow)}function g(t,r,n){if(void 0===n&&(n=0),e.isString(t))return t;if(void 0===t)return "";var i="";if(n){i+=r;for(var a=0;a<n;a++)i+="  ";}if(i+=t.messageText,n++,t.next)for(var o=0,s=t.next;o<s.length;o++)i+=g(s[o],r,n);return i}function m(t,r,n,i,a){if(0===t.length)return [];for(var o=[],s=new e.Map,c=0,l=t;c<l.length;c++){var u=l[c],_=void 0,d=y(u,i),p=e.isString(u)?u:u.fileName.toLowerCase(),f=void 0!==d?"".concat(d,"|").concat(p):p;s.has(f)?_=s.get(f):s.set(f,_=a(p,r,n,d)),o.push(_);}return o}function y(t,r){return (e.isString(t)?r:t.resolutionMode)||r}function v(e,t){if(void 0!==e.impliedNodeFormat)return b(e,M(e,t))}function h(t){var r;return e.isExportDeclaration(t)?t.isTypeOnly:!!(null===(r=t.importClause)||void 0===r?void 0:r.isTypeOnly)}function b(t,r){var n,i;if(void 0!==t.impliedNodeFormat){var a;if((e.isImportDeclaration(r.parent)||e.isExportDeclaration(r.parent))&&h(r.parent)&&(a=x(r.parent.assertClause)))return a;if(r.parent.parent&&e.isImportTypeNode(r.parent.parent)&&(a=x(null===(n=r.parent.parent.assertions)||void 0===n?void 0:n.assertClause)))return a;if(t.impliedNodeFormat!==e.ModuleKind.ESNext)return e.isImportCall(e.walkUpParenthesizedExpressions(r.parent))?e.ModuleKind.ESNext:e.ModuleKind.CommonJS;var o=null===(i=e.walkUpParenthesizedExpressions(r.parent))||void 0===i?void 0:i.parent;return o&&e.isImportEqualsDeclaration(o)?e.ModuleKind.CommonJS:e.ModuleKind.ESNext}}function x(t,r){if(t)if(1===e.length(t.elements)){var n=t.elements[0];if(e.isStringLiteralLike(n.name))if("resolution-mode"===n.name.text){if(e.isStringLiteralLike(n.value)){if("import"===n.value.text||"require"===n.value.text)return "import"===n.value.text?e.ModuleKind.ESNext:e.ModuleKind.CommonJS;null==r||r(n.value,e.Diagnostics.resolution_mode_should_be_either_require_or_import);}}else null==r||r(n.name,e.Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions);}else null==r||r(t,e.Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require);}function D(t,r,n,i,a){if(0===t.length)return [];for(var o=[],s=new e.Map,c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=void 0,p=v(r,c);c++;var f=void 0!==p?"".concat(p,"|").concat(_):_;s.has(f)?d=s.get(f):s.set(f,d=a(_,p,n,i)),o.push(d);}return o}function S(t,r,n,i){var a;return function t(r,o,s){if(i){var c=i(r,s);if(c)return c}return e.forEach(o,(function(r,i){if(!r||!(null==a?void 0:a.has(r.sourceFile.path))){var o=n(r,s,i);return o||!r?o:((a||(a=new e.Set)).add(r.sourceFile.path),t(r.commandLine.projectReferences,r.references,r))}}))}(t,r,void 0)}function T(t){switch(null==t?void 0:t.kind){case e.FileIncludeKind.Import:case e.FileIncludeKind.ReferenceFile:case e.FileIncludeKind.TypeReferenceDirective:case e.FileIncludeKind.LibReferenceDirective:return !0;default:return !1}}function C(e){return void 0!==e.pos}function E(t,r){var n,i,a,o,s,c,l,u,_,d,p,f=e.Debug.checkDefined(t(r.file)),g=r.kind,m=r.index;switch(g){case e.FileIncludeKind.Import:var y=M(f,m);if(d=null===(s=null===(o=f.resolvedModules)||void 0===o?void 0:o.get(y.text,v(f,m)))||void 0===s?void 0:s.packageId,-1===y.pos)return {file:f,packageId:d,text:y.text};u=e.skipTrivia(f.text,y.pos),_=y.end;break;case e.FileIncludeKind.ReferenceFile:u=(n=f.referencedFiles[m]).pos,_=n.end;break;case e.FileIncludeKind.TypeReferenceDirective:u=(i=f.typeReferenceDirectives[m]).pos,_=i.end,p=i.resolutionMode,d=null===(l=null===(c=f.resolvedTypeReferenceDirectiveNames)||void 0===c?void 0:c.get(e.toFileNameLowerCase(f.typeReferenceDirectives[m].fileName),p||f.impliedNodeFormat))||void 0===l?void 0:l.packageId;break;case e.FileIncludeKind.LibReferenceDirective:u=(a=f.libReferenceDirectives[m]).pos,_=a.end;break;default:return e.Debug.assertNever(g)}return {file:f,pos:u,end:_,packageId:d}}function k(t,r,n,i){switch(e.getEmitModuleResolutionKind(i)){case e.ModuleResolutionKind.Node16:case e.ModuleResolutionKind.NodeNext:return e.fileExtensionIsOneOf(t,[".d.mts",".mts",".mjs"])?e.ModuleKind.ESNext:e.fileExtensionIsOneOf(t,[".d.cts",".cts",".cjs"])?e.ModuleKind.CommonJS:e.fileExtensionIsOneOf(t,[".d.ts",".ts",".tsx",".js",".jsx"])?function(){var a=e.getTemporaryModuleResolutionState(r,n,i),o=[];a.failedLookupLocations=o,a.affectingLocations=o;var s=e.getPackageScopeForPath(t,a);return {impliedNodeFormat:"module"===(null==s?void 0:s.contents.packageJsonContent.type)?e.ModuleKind.ESNext:e.ModuleKind.CommonJS,packageJsonLocations:o,packageJsonScope:s}}():void 0;default:return}}function N(t,r,i,a){var o=t.getCompilerOptions();if(o.noEmit)return t.getSemanticDiagnostics(r,a),r||e.outFile(o)?e.emitSkippedWithNoDiagnostics:t.emitBuildInfo(i,a);if(o.noEmitOnError){var s=n$4(n$4(n$4(n$4([],t.getOptionsDiagnostics(a),!0),t.getSyntacticDiagnostics(r,a),!0),t.getGlobalDiagnostics(a),!0),t.getSemanticDiagnostics(r,a),!0);if(0===s.length&&e.getEmitDeclarations(t.getCompilerOptions())&&(s=t.getDeclarationDiagnostics(void 0,a)),s.length){var c;if(!r&&!e.outFile(o)){var l=t.emitBuildInfo(i,a);l.diagnostics&&(s=n$4(n$4([],s,!0),l.diagnostics,!0)),c=l.emittedFiles;}return {diagnostics:s,sourceMaps:void 0,emittedFiles:c,emitSkipped:!0}}}}function A(t,r){return e.filter(t,(function(e){return !e.skippedOn||!r[e.skippedOn]}))}function F(t,r){return void 0===r&&(r=t),{fileExists:function(e){return r.fileExists(e)},readDirectory:function(t,n,i,a,o){return e.Debug.assertIsDefined(r.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"),r.readDirectory(t,n,i,a,o)},readFile:function(e){return r.readFile(e)},useCaseSensitiveFileNames:t.useCaseSensitiveFileNames(),getCurrentDirectory:function(){return t.getCurrentDirectory()},onUnRecoverableConfigFileDiagnostic:t.onUnRecoverableConfigFileDiagnostic||e.returnUndefined,trace:t.trace?function(e){return t.trace(e)}:void 0}}function P(t,r,n){if(!t)return e.emptyArray;for(var i,a=0;a<t.length;a++){var o=t[a],s=r(o,a);if(o.prepend&&s&&s.options){if(!e.outFile(s.options))continue;var c=e.getOutputPathsForBundle(s.options,!0),l=c.jsFilePath,u=c.sourceMapFilePath,_=c.declarationFilePath,d=c.declarationMapPath,p=c.buildInfoPath,f=e.createInputFiles(n,l,u,_,d,p);(i||(i=[])).push(f);}}return i||e.emptyArray}function w(t,r){var n=r||t;return e.resolveConfigFileProjectName(n.path)}function I(t,r){switch(r.extension){case".ts":case".d.ts":return;case".tsx":return n();case".jsx":return n()||i();case".js":return i();case".json":return t.resolveJsonModule?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used}function n(){return t.jsx?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set}function i(){return e.getAllowJSCompilerOption(t)||!e.getStrictOptionValue(t,"noImplicitAny")?void 0:e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type}}function O(e){for(var t=e.imports,r=e.moduleAugmentations,n=t.map((function(e){return e.text})),i=0,a=r;i<a.length;i++){var o=a[i];10===o.kind&&n.push(o.text);}return n}function M(t,r){var n=t.imports,i=t.moduleAugmentations;if(r<n.length)return n[r];for(var a=n.length,o=0,s=i;o<s.length;o++){var c=s[o];if(10===c.kind){if(r===a)return c;a++;}}e.Debug.fail("should never ask for module name at index higher than possible module name");}e.formatColorAndReset=d,e.formatLocation=f,e.formatDiagnosticsWithColorAndContext=function(t,r){for(var n="",i=0,a=t;i<a.length;i++){var o=a[i];if(o.file&&(n+=f(y=o.file,v=o.start,r),n+=" - "),n+=d(e.diagnosticCategoryName(o),_(o.category)),n+=d(" TS".concat(o.code,": "),s.Grey),n+=g(o.messageText,r.getNewLine()),o.file&&(n+=r.getNewLine(),n+=p(o.file,o.start,o.length,"",_(o.category),r)),o.relatedInformation){n+=r.getNewLine();for(var c=0,l=o.relatedInformation;c<l.length;c++){var m=l[c],y=m.file,v=m.start,h=m.length,b=m.messageText;y&&(n+=r.getNewLine(),n+="  "+f(y,v,r),n+=p(y,v,h,u,s.Cyan,r)),n+=r.getNewLine(),n+=u+g(b,r.getNewLine());}}n+=r.getNewLine();}return n},e.flattenDiagnosticMessageText=g,e.loadWithTypeDirectiveCache=m,e.getModeForFileReference=y,e.getModeForResolutionAtIndex=v,e.isExclusivelyTypeOnlyImportOrExport=h,e.getModeForUsageLocation=b,e.getResolutionModeOverrideForClause=x,e.loadWithModeAwareCache=D,e.forEachResolvedProjectReference=function(e,t){return S(void 0,e,(function(e,r){return e&&t(e,r)}))},e.inferredTypesContainingFile="__inferred type names__.ts",e.isReferencedFile=T,e.isReferenceFileLocation=C,e.getReferencedFileLocation=E,e.isProgramUptoDate=function(t,r,n,i,a,o,s,c,l){if(!t||(null==s?void 0:s()))return !1;if(!e.arrayIsEqualTo(t.getRootFileNames(),r))return !1;var u;if(!e.arrayIsEqualTo(t.getProjectReferences(),l,(function(r,n,i){return e.projectReferenceIsEqualTo(r,n)&&d(t.getResolvedProjectReferences()[i],r)})))return !1;if(t.getSourceFiles().some((function(e){return !function(e){return e.version===i(e.resolvedPath,e.fileName)}(e)||o(e.path)})))return !1;if(t.getMissingFilePaths().some(a))return !1;var _=t.getCompilerOptions();return !(!e.compareDataObjects(_,n)||_.configFile&&n.configFile&&_.configFile.text!==n.configFile.text);function d(t,r){if(t){if(e.contains(u,t))return !0;var n=w(r),i=c(n);return !!i&&t.commandLine.options.configFile===i.options.configFile&&!!e.arrayIsEqualTo(t.commandLine.fileNames,i.fileNames)&&((u||(u=[])).push(t),!e.forEach(t.references,(function(e,r){return !d(e,t.commandLine.projectReferences[r])})))}var a=w(r);return !c(a)}},e.getConfigFileParsingDiagnostics=function(e){return e.options.configFile?n$4(n$4([],e.options.configFile.parseDiagnostics,!0),e.errors,!0):e.errors},e.getImpliedNodeFormatForFile=function(e,t,r,n){var i=k(e,t,r,n);return "object"==typeof i?i.impliedNodeFormat:i},e.getImpliedNodeFormatForFileWorker=k,e.plainJSErrors=new e.Set([e.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,e.Diagnostics.A_module_cannot_have_multiple_default_exports.code,e.Diagnostics.Another_export_default_is_here.code,e.Diagnostics.The_first_export_default_is_here.code,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,e.Diagnostics.constructor_is_a_reserved_word.code,e.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,e.Diagnostics.Invalid_use_of_0_in_strict_mode.code,e.Diagnostics.A_label_is_not_allowed_here.code,e.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,e.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,e.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,e.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,e.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,e.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,e.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,e.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,e.Diagnostics.A_get_accessor_cannot_have_parameters.code,e.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,e.Diagnostics.A_rest_element_cannot_have_a_property_name.code,e.Diagnostics.A_rest_element_cannot_have_an_initializer.code,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,e.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,e.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,e.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,e.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,e.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,e.Diagnostics.An_export_declaration_cannot_have_modifiers.code,e.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,e.Diagnostics.An_import_declaration_cannot_have_modifiers.code,e.Diagnostics.An_object_member_cannot_be_declared_optional.code,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,e.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,e.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,e.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,e.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,e.Diagnostics.Classes_can_only_extend_a_single_class.code,e.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,e.Diagnostics.Duplicate_label_0.code,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,e.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,e.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,e.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,e.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,e.Diagnostics.Jump_target_cannot_cross_function_boundary.code,e.Diagnostics.Line_terminator_not_permitted_before_arrow.code,e.Diagnostics.Modifiers_cannot_appear_here.code,e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,e.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,e.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,e.Diagnostics.Trailing_comma_not_allowed.code,e.Diagnostics.Variable_declaration_list_cannot_be_empty.code,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,e.Diagnostics._0_expected.code,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,e.Diagnostics._0_list_cannot_be_empty.code,e.Diagnostics._0_modifier_already_seen.code,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,e.Diagnostics._0_modifier_cannot_be_used_here.code,e.Diagnostics._0_modifier_must_precede_1_modifier.code,e.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,e.Diagnostics.const_declarations_must_be_initialized.code,e.Diagnostics.extends_clause_already_seen.code,e.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,e.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,e.Diagnostics.Class_constructor_may_not_be_a_generator.code,e.Diagnostics.Class_constructor_may_not_be_an_accessor.code,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code]),e.createProgram=function(a,o,s,c,l){var u,_,d,p,f,g,h,b,x,M,L,R,B=e.isArray(a)?function(e,t,r,n,i){return {rootNames:e,options:t,host:r,oldProgram:n,configFileParsingDiagnostics:i}}(a,o,s,c,l):a,j=B.rootNames,J=B.options,z=B.configFileParsingDiagnostics,U=B.projectReferences,K=B.oldProgram,V=new e.Map,q=e.createMultiMap(),W={},H={},G=e.createModeAwareCache(),Q="number"==typeof J.maxNodeModuleJsDepth?J.maxNodeModuleJsDepth:0,X=0,Y=new e.Map,Z=new e.Map;null===e.tracing||void 0===e.tracing||e.tracing.push("program","createProgram",{configFilePath:J.configFilePath,rootDir:J.rootDir},!0),e.performance.mark("beforeProgram");var $,ee,te,re,ne,ie=B.host||r(J),ae=F(ie),oe=J.noLib,se=e.memoize((function(){return ie.getDefaultLibFileName(J)})),ce=ie.getDefaultLibLocation?ie.getDefaultLibLocation():e.getDirectoryPath(se()),le=e.createDiagnosticCollection(),ue=ie.getCurrentDirectory(),_e=e.getSupportedExtensions(J),de=e.getSupportedExtensionsWithJsonIfResolveJsonModule(J,_e),pe=new e.Map,fe=ie.hasInvalidatedResolutions||e.returnFalse;if(ie.resolveModuleNames)re=function(t,r,n,i,a){return ie.resolveModuleNames(e.Debug.checkEachDefined(t),n,i,a,J,r).map((function(t){if(!t||void 0!==t.extension)return t;var r=e.clone(t);return r.extension=e.extensionFromPath(t.resolvedFileName),r}))},ee=null===(u=ie.getModuleResolutionCache)||void 0===u?void 0:u.call(ie);else {ee=e.createModuleResolutionCache(ue,Gt,J);var ge=function(t,r,n,i){return e.resolveModuleName(t,n,J,ie,ee,i,r).resolvedModule};re=function(t,r,n,i,a){return D(e.Debug.checkEachDefined(t),r,n,a,ge)};}if(ie.resolveTypeReferenceDirectives)ne=function(t,r,n,i){return ie.resolveTypeReferenceDirectives(e.Debug.checkEachDefined(t),r,n,J,i)};else {te=e.createTypeReferenceDirectiveResolutionCache(ue,Gt,void 0,null==ee?void 0:ee.getPackageJsonInfoCache());var me=function(t,r,n,i){return e.resolveTypeReferenceDirective(t,r,J,ie,n,te,i).resolvedTypeReferenceDirective};ne=function(t,r,n,i){return m(e.Debug.checkEachDefined(t),r,n,i,me)};}var ye,ve,he,be,xe,De=new e.Map,Se=new e.Map,Te=e.createMultiMap(),Ce=!1,Ee=new e.Map,ke=ie.useCaseSensitiveFileNames()?new e.Map:void 0,Ne=!!(null===(_=ie.useSourceOfProjectReferenceRedirect)||void 0===_?void 0:_.call(ie))&&!J.disableSourceOfProjectReferenceRedirect,Ae=function(t){var r,n,i=t.compilerHost.fileExists,a=t.compilerHost.directoryExists,o=t.compilerHost.getDirectories,s=t.compilerHost.realpath;return t.useSourceOfProjectReferenceRedirect?(t.compilerHost.fileExists=c,a&&(n=t.compilerHost.directoryExists=function(n){return a.call(t.compilerHost,n)?(function(r){var n;if(t.getResolvedProjectReferences()&&!e.containsIgnoredPath(r)&&s&&e.stringContains(r,e.nodeModulesPathPart)){var i=t.getSymlinkCache(),a=e.ensureTrailingDirectorySeparator(t.toPath(r));if(!(null===(n=i.getSymlinkedDirectories())||void 0===n?void 0:n.has(a))){var o,c=e.normalizePath(s.call(t.compilerHost,r));c!==r&&(o=e.ensureTrailingDirectorySeparator(t.toPath(c)))!==a?i.setSymlinkedDirectory(r,{real:e.ensureTrailingDirectorySeparator(c),realPath:o}):i.setSymlinkedDirectory(a,!1);}}}(n),!0):!!t.getResolvedProjectReferences()&&(r||(r=new e.Set,t.forEachResolvedProjectReference((function(n){var i=e.outFile(n.commandLine.options);if(i)r.add(e.getDirectoryPath(t.toPath(i)));else {var a=n.commandLine.options.declarationDir||n.commandLine.options.outDir;a&&r.add(t.toPath(a));}}))),l(n,!1))}),o&&(t.compilerHost.getDirectories=function(e){return !t.getResolvedProjectReferences()||a&&a.call(t.compilerHost,e)?o.call(t.compilerHost,e):[]}),s&&(t.compilerHost.realpath=function(e){var r;return (null===(r=t.getSymlinkCache().getSymlinkedFiles())||void 0===r?void 0:r.get(t.toPath(e)))||s.call(t.compilerHost,e)}),{onProgramCreateComplete:function(){t.compilerHost.fileExists=i,t.compilerHost.directoryExists=a,t.compilerHost.getDirectories=o;},fileExists:c,directoryExists:n}):{onProgramCreateComplete:e.noop,fileExists:c};function c(r){return !!i.call(t.compilerHost,r)||!!t.getResolvedProjectReferences()&&!!e.isDeclarationFileName(r)&&l(r,!0)}function l(n,a){var o,s=a?function(r){return function(r){var n=t.getSourceOfProjectReferenceRedirect(t.toPath(r));return void 0!==n?!e.isString(n)||i.call(t.compilerHost,n):void 0}(r)}:function(n){return function(n){var i=t.toPath(n),a="".concat(i).concat(e.directorySeparator);return e.forEachKey(r,(function(t){return i===t||e.startsWith(t,a)||e.startsWith(i,"".concat(t,"/"))}))}(n)},c=s(n);if(void 0!==c)return c;var l=t.getSymlinkCache(),u=l.getSymlinkedDirectories();if(!u)return !1;var _=t.toPath(n);return !!e.stringContains(_,e.nodeModulesPathPart)&&(!(!a||!(null===(o=l.getSymlinkedFiles())||void 0===o?void 0:o.has(_)))||e.firstDefinedIterator(u.entries(),(function(r){var i=r[0],o=r[1];if(o&&e.startsWith(_,i)){var c=s(_.replace(i,o.realPath));if(a&&c){var u=e.getNormalizedAbsolutePath(n,t.compilerHost.getCurrentDirectory());l.setSymlinkedFile(_,"".concat(o.real).concat(u.replace(new RegExp(i,"i"),"")));}return c}}))||!1)}}({compilerHost:ie,getSymlinkCache:pr,useSourceOfProjectReferenceRedirect:Ne,toPath:Ze,getResolvedProjectReferences:nt,getSourceOfProjectReferenceRedirect:Jt,forEachResolvedProjectReference:jt}),Fe=Ae.onProgramCreateComplete,Pe=Ae.fileExists,we=Ae.directoryExists,Ie=ie.readFile.bind(ie);null===e.tracing||void 0===e.tracing||e.tracing.push("program","shouldProgramCreateNewSourceFiles",{hasOldProgram:!!K});var Oe,Me=function(t,r){return !!t&&e.optionsHaveChanges(t.getCompilerOptions(),r,e.sourceFileAffectingCompilerOptions)}(K,J);if(null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("program","tryReuseStructureFromOldProgram",{}),Oe=function(){var t,r;if(!K)return 0;var n=K.getCompilerOptions();if(e.changesAffectModuleResolution(n,J))return 0;var i=K.getRootFileNames();if(!e.arrayIsEqualTo(i,j))return 0;if(S(K.getProjectReferences(),K.getResolvedProjectReferences(),(function(t,r,n){var i=Xt((r?r.commandLine.projectReferences:U)[n]);return t?!i||i.sourceFile!==t.sourceFile||!e.arrayIsEqualTo(t.commandLine.fileNames,i.commandLine.fileNames):void 0!==i}),(function(t,r){var n=r?Ut(r.sourceFile.path).commandLine.projectReferences:U;return !e.arrayIsEqualTo(t,n,e.projectReferenceIsEqualTo)})))return 0;U&&(ve=U.map(Xt));var a=[],o=[];if(Oe=2,K.getMissingFilePaths().some((function(e){return ie.fileExists(e)})))return 0;var s,c=K.getSourceFiles();!function(e){e[e.Exists=0]="Exists",e[e.Modified=1]="Modified";}(s||(s={}));for(var l=new e.Map,u=0,_=c;u<_.length;u++){var d=wt((A=_[u]).fileName,ee,ie,J);if(!(B=ie.getSourceFileByPath?ie.getSourceFileByPath(A.fileName,A.resolvedPath,d,void 0,Me||d.impliedNodeFormat!==A.impliedNodeFormat):ie.getSourceFile(A.fileName,d,void 0,Me||d.impliedNodeFormat!==A.impliedNodeFormat)))return 0;B.packageJsonLocations=(null===(t=d.packageJsonLocations)||void 0===t?void 0:t.length)?d.packageJsonLocations:void 0,B.packageJsonScope=d.packageJsonScope,e.Debug.assert(!B.redirectInfo,"Host should not return a redirect source file from `getSourceFile`");var p=void 0;if(A.redirectInfo){if(B!==A.redirectInfo.unredirected)return 0;p=!1,B=A;}else if(K.redirectTargetsMap.has(A.path)){if(B!==A)return 0;p=!1;}else p=B!==A;B.path=A.path,B.originalFileName=A.originalFileName,B.resolvedPath=A.resolvedPath,B.fileName=A.fileName;var f=K.sourceFileToPackageName.get(A.path);if(void 0!==f){var g=l.get(f),m=p?1:0;if(void 0!==g&&1===m||1===g)return 0;l.set(f,m);}p?(A.impliedNodeFormat!==B.impliedNodeFormat?Oe=1:e.arrayIsEqualTo(A.libReferenceDirectives,B.libReferenceDirectives,St)?A.hasNoDefaultLib!==B.hasNoDefaultLib?Oe=1:e.arrayIsEqualTo(A.referencedFiles,B.referencedFiles,St)?(Et(B),e.arrayIsEqualTo(A.imports,B.imports,Tt)&&e.arrayIsEqualTo(A.moduleAugmentations,B.moduleAugmentations,Tt)?(6291456&A.flags)!=(6291456&B.flags)?Oe=1:e.arrayIsEqualTo(A.typeReferenceDirectives,B.typeReferenceDirectives,St)||(Oe=1):Oe=1):Oe=1:Oe=1,o.push({oldFile:A,newFile:B})):fe(A.path)&&(Oe=1,o.push({oldFile:A,newFile:B})),a.push(B);}if(2!==Oe)return Oe;for(var y=o.map((function(e){return e.oldFile})),v=0,b=c;v<b.length;v++){var x=b[v];if(!e.contains(y,x))for(var D=0,T=x.ambientModuleNames;D<T.length;D++){var C=T[D];V.set(C,x.fileName);}}for(var E=0,k=o;E<k.length;E++){var N=k[E],A=N.oldFile,F=O(B=N.newFile),P=et(F,B);e.hasChangesInResolutions(F,P,A.resolvedModules,A,e.moduleResolutionIsEqualTo)?(Oe=1,B.resolvedModules=e.zipToModeAwareCache(B,F,P)):B.resolvedModules=A.resolvedModules;var w=B.typeReferenceDirectives,I=Ge(w,B);e.hasChangesInResolutions(w,I,A.resolvedTypeReferenceDirectiveNames,A,e.typeDirectiveIsEqualTo)?(Oe=1,B.resolvedTypeReferenceDirectiveNames=e.zipToModeAwareCache(B,w,I)):B.resolvedTypeReferenceDirectiveNames=A.resolvedTypeReferenceDirectiveNames;}if(2!==Oe)return Oe;if(e.changesAffectingProgramStructure(n,J)||(null===(r=ie.hasChangedAutomaticTypeDirectiveNames)||void 0===r?void 0:r.call(ie)))return 1;ye=K.getMissingFilePaths(),e.Debug.assert(a.length===K.getSourceFiles().length);for(var M=0,L=a;M<L.length;M++){var B=L[M];Ee.set(B.path,B);}return K.getFilesByNameMap().forEach((function(e,t){e?e.path!==t?Ee.set(t,Ee.get(e.path)):K.isSourceFileFromExternalLibrary(e)&&Z.set(e.path,!0):Ee.set(t,e);})),h=a,q=K.getFileIncludeReasons(),R=K.getFileProcessingDiagnostics(),G=K.getResolvedTypeReferenceDirectives(),Se=K.sourceFileToPackageName,Te=K.redirectTargetsMap,Ce=K.usesUriStyleNodeCoreModules,2}(),null===e.tracing||void 0===e.tracing||e.tracing.pop(),2!==Oe){f=[],g=[],U&&(ve||(ve=U.map(Xt)),j.length&&(null==ve||ve.forEach((function(t,r){if(t){var n=e.outFile(t.commandLine.options);if(Ne){if(n||e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var i=0,a=t.commandLine.fileNames;i<a.length;i++)At(l=a[i],{kind:e.FileIncludeKind.SourceFromProjectReference,index:r});}else if(n)At(e.changeExtension(n,".d.ts"),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});else if(e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var o=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ie.useCaseSensitiveFileNames())})),s=0,c=t.commandLine.fileNames;s<c.length;s++){var l=c[s];e.isDeclarationFileName(l)||e.fileExtensionIs(l,".json")||At(e.getOutputDeclarationFileName(l,t.commandLine,!ie.useCaseSensitiveFileNames(),o),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});}}})))),null===e.tracing||void 0===e.tracing||e.tracing.push("program","processRootFiles",{count:j.length}),e.forEach(j,(function(t,r){return Dt(t,!1,!1,{kind:e.FileIncludeKind.RootFile,index:r})})),null===e.tracing||void 0===e.tracing||e.tracing.pop();var Le=j.length?e.getAutomaticTypeDirectiveNames(J,ie):e.emptyArray;if(Le.length){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferences",{count:Le.length});for(var Re=J.configFilePath?e.getDirectoryPath(J.configFilePath):ie.getCurrentDirectory(),Be=Ge(Le,e.combinePaths(Re,e.inferredTypesContainingFile)),je=0;je<Le.length;je++)qt(Le[je],void 0,Be[je],{kind:e.FileIncludeKind.AutomaticTypeDirectiveFile,typeReference:Le[je],packageId:null===(d=Be[je])||void 0===d?void 0:d.packageId});null===e.tracing||void 0===e.tracing||e.tracing.pop();}if(j.length&&!oe){var Je=se();!J.lib&&Je?Dt(Je,!0,!1,{kind:e.FileIncludeKind.LibFile}):e.forEach(J.lib,(function(t,r){Dt(Wt(t),!0,!1,{kind:e.FileIncludeKind.LibFile,index:r});}));}ye=e.arrayFrom(e.mapDefinedIterator(Ee.entries(),(function(e){var t=e[0];return void 0===e[1]?t:void 0}))),h=e.stableSort(f,(function(t,r){return e.compareValues(Ye(t),Ye(r))})).concat(g),f=void 0,g=void 0;}if(e.Debug.assert(!!ye),K&&ie.onReleaseOldSourceFile){for(var ze=0,Ue=K.getSourceFiles();ze<Ue.length;ze++){var Ke=Ue[ze],Ve=lt(Ke.resolvedPath);(Me||!Ve||Ve.impliedNodeFormat!==Ke.impliedNodeFormat||Ke.resolvedPath===Ke.path&&Ve.resolvedPath!==Ke.path)&&ie.onReleaseOldSourceFile(Ke,K.getCompilerOptions(),!!lt(Ke.path));}ie.getParsedCommandLine||K.forEachResolvedProjectReference((function(e){Ut(e.sourceFile.path)||ie.onReleaseOldSourceFile(e.sourceFile,K.getCompilerOptions(),!1);}));}K&&ie.onReleaseParsedCommandLine&&S(K.getProjectReferences(),K.getResolvedProjectReferences(),(function(e,t,r){var n=w((null==t?void 0:t.commandLine.projectReferences[r])||K.getProjectReferences()[r]);(null==he?void 0:he.has(Ze(n)))||ie.onReleaseParsedCommandLine(n,e,K.getCompilerOptions());})),te=void 0,K=void 0;var qe={getRootFileNames:function(){return j},getSourceFile:ct,getSourceFileByPath:lt,getSourceFiles:function(){return h},getMissingFilePaths:function(){return ye},getModuleResolutionCache:function(){return ee},getFilesByNameMap:function(){return Ee},getCompilerOptions:function(){return J},getSyntacticDiagnostics:function(e,t){return ut(e,dt,t)},getOptionsDiagnostics:function(){return e.sortAndDeduplicateDiagnostics(e.concatenate(le.getGlobalDiagnostics(),function(){if(!J.configFile)return e.emptyArray;var t=le.getDiagnostics(J.configFile.fileName);return jt((function(r){t=e.concatenate(t,le.getDiagnostics(r.sourceFile.fileName));})),t}()))},getGlobalDiagnostics:function(){return j.length?e.sortAndDeduplicateDiagnostics(ot().getGlobalDiagnostics().slice()):e.emptyArray},getSemanticDiagnostics:function(e,t){return ut(e,ft,t)},getCachedSemanticDiagnostics:function(e){var t;return e?null===(t=W.perFile)||void 0===t?void 0:t.get(e.path):W.allDiagnostics},getSuggestionDiagnostics:function(e,t){return pt((function(){return ot().getSuggestionDiagnostics(e,t)}))},getDeclarationDiagnostics:function(t,r){var n=qe.getCompilerOptions();return !t||e.outFile(n)?vt(t,r):ut(t,xt,r)},getBindAndCheckDiagnostics:function(e,t){return gt(e,t)},getProgramDiagnostics:_t,getTypeChecker:ot,getClassifiableNames:function(){var t;if(!L){ot(),L=new e.Set;for(var r=0,n=h;r<n.length;r++)null===(t=n[r].classifiableNames)||void 0===t||t.forEach((function(e){return L.add(e)}));}return L},getCommonSourceDirectory:$e,emit:function(t,r,n,i,a,o){null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emit",{path:null==t?void 0:t.path},!0);var s=pt((function(){return function(t,r,n,i,a,o,s){if(!s){var c=N(t,r,n,i);if(c)return c}var l=ot().getEmitResolver(e.outFile(J)?void 0:r,i);e.performance.mark("beforeEmit");var u=e.emitFiles(l,tt(n),r,e.getTransformers(J,o,a),a,!1,s);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),u}(qe,t,r,n,i,a,o)}));return null===e.tracing||void 0===e.tracing||e.tracing.pop(),s},getCurrentDirectory:function(){return ue},getNodeCount:function(){return ot().getNodeCount()},getIdentifierCount:function(){return ot().getIdentifierCount()},getSymbolCount:function(){return ot().getSymbolCount()},getTypeCount:function(){return ot().getTypeCount()},getInstantiationCount:function(){return ot().getInstantiationCount()},getRelationCacheSizes:function(){return ot().getRelationCacheSizes()},getFileProcessingDiagnostics:function(){return R},getResolvedTypeReferenceDirectives:function(){return G},isSourceFileFromExternalLibrary:at,isSourceFileDefaultLibrary:function(t){if(!t.isDeclarationFile)return !1;if(t.hasNoDefaultLib)return !0;if(!J.noLib)return !1;var r=ie.useCaseSensitiveFileNames()?e.equateStringsCaseSensitive:e.equateStringsCaseInsensitive;return J.lib?e.some(J.lib,(function(e){return r(t.fileName,Wt(e))})):r(t.fileName,se())},getSourceFileFromReference:function(e,r){return kt(t(r.fileName,e.fileName),ct)},getLibFileFromReference:function(t){var r=e.toFileNameLowerCase(t.fileName),n=e.libMap.get(r);if(n)return ct(Wt(n))},sourceFileToPackageName:Se,redirectTargetsMap:Te,usesUriStyleNodeCoreModules:Ce,isEmittedFile:function(t){if(J.noEmit)return !1;var r=Ze(t);if(lt(r))return !1;var n=e.outFile(J);if(n)return dr(r,n)||dr(r,e.removeFileExtension(n)+".d.ts");if(J.declarationDir&&e.containsPath(J.declarationDir,r,ue,!ie.useCaseSensitiveFileNames()))return !0;if(J.outDir)return e.containsPath(J.outDir,r,ue,!ie.useCaseSensitiveFileNames());if(e.fileExtensionIsOneOf(r,e.supportedJSExtensionsFlat)||e.isDeclarationFileName(r)){var i=e.removeFileExtension(r);return !!lt(i+".ts")||!!lt(i+".tsx")}return !1},getConfigFileParsingDiagnostics:function(){return z||e.emptyArray},getResolvedModuleWithFailedLookupLocationsFromCache:function(t,r,n){return ee&&e.resolveModuleNameFromCache(t,r,ee,n)},getProjectReferences:function(){return U},getResolvedProjectReferences:nt,getProjectReferenceRedirect:Mt,getResolvedProjectReferenceToRedirect:Bt,getResolvedProjectReferenceByPath:Ut,forEachResolvedProjectReference:jt,isSourceOfProjectReferenceRedirect:zt,emitBuildInfo:function(t){e.Debug.assert(!e.outFile(J)),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{},!0),e.performance.mark("beforeEmit");var r=e.emitFiles(e.notImplementedResolver,tt(t),void 0,e.noTransformers,!1,!0);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),r},fileExists:Pe,readFile:Ie,directoryExists:we,getSymlinkCache:pr,realpath:null===(p=ie.realpath)||void 0===p?void 0:p.bind(ie),useCaseSensitiveFileNames:function(){return ie.useCaseSensitiveFileNames()},getFileIncludeReasons:function(){return q},structureIsReused:Oe,writeFile:rt};return Fe(),null==R||R.forEach((function(t){switch(t.kind){case 1:return le.add(Yt(t.file&&lt(t.file),t.fileProcessingReason,t.diagnostic,t.args||e.emptyArray));case 0:var r=E(lt,t.reason),i=r.file,a=r.pos,o=r.end;return le.add(e.createFileDiagnostic.apply(void 0,n$4([i,e.Debug.checkDefined(a),e.Debug.checkDefined(o)-a,t.diagnostic],t.args||e.emptyArray,!1)));default:e.Debug.assertNever(t);}})),function(){J.strictPropertyInitialization&&!e.getStrictOptionValue(J,"strictNullChecks")&&ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"strictPropertyInitialization","strictNullChecks"),J.exactOptionalPropertyTypes&&!e.getStrictOptionValue(J,"strictNullChecks")&&ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"exactOptionalPropertyTypes","strictNullChecks"),J.isolatedModules&&(J.out&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","isolatedModules"),J.outFile&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"outFile","isolatedModules")),J.inlineSourceMap&&(J.sourceMap&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"sourceMap","inlineSourceMap"),J.mapRoot&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"mapRoot","inlineSourceMap")),J.composite&&(!1===J.declaration&&ar(e.Diagnostics.Composite_projects_may_not_disable_declaration_emit,"declaration"),!1===J.incremental&&ar(e.Diagnostics.Composite_projects_may_not_disable_incremental_compilation,"declaration"));var t,r=e.outFile(J);if(J.tsBuildInfoFile?e.isIncrementalCompilation(J)||ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"tsBuildInfoFile","incremental","composite"):!J.incremental||r||J.configFilePath||le.add(e.createCompilerDiagnostic(e.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)),t=J.suppressOutputPathCheck?void 0:e.getTsBuildInfoEmitOutputFilePath(J),S(U,ve,(function(r,n,i){var a=(n?n.commandLine.projectReferences:U)[i],o=n&&n.sourceFile;if(r){var s=r.commandLine.options;if(s.composite&&!s.noEmit||(n?n.commandLine.fileNames:j).length&&(s.composite||sr(o,i,e.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true,a.path),s.noEmit&&sr(o,i,e.Diagnostics.Referenced_project_0_may_not_disable_emit,a.path)),a.prepend){var c=e.outFile(s);c?ie.fileExists(c)||sr(o,i,e.Diagnostics.Output_file_0_from_project_1_does_not_exist,c,a.path):sr(o,i,e.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set,a.path);}!n&&t&&t===e.getTsBuildInfoEmitOutputFilePath(s)&&(sr(o,i,e.Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,t,a.path),pe.set(Ze(t),!0));}else sr(o,i,e.Diagnostics.File_0_not_found,a.path);})),J.composite)for(var n=new e.Set(j.map(Ze)),i=0,a=h;i<a.length;i++){var o=a[i];e.sourceFileMayBeEmitted(o,qe)&&!n.has(o.path)&&$t(o,e.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,[o.fileName,J.configFilePath||""]);}if(J.paths)for(var s in J.paths)if(e.hasProperty(J.paths,s))if(e.hasZeroOrOneAsteriskCharacter(s)||tr(!0,s,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,s),e.isArray(J.paths[s])){var c=J.paths[s].length;0===c&&tr(!1,s,e.Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array,s);for(var l=0;l<c;l++){var u=J.paths[s][l],_=typeof u;"string"===_?(e.hasZeroOrOneAsteriskCharacter(u)||er(s,l,e.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character,u,s),J.baseUrl||e.pathIsRelative(u)||e.pathIsAbsolute(u)||er(s,l,e.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash)):er(s,l,e.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2,u,s,_);}}else tr(!1,s,e.Diagnostics.Substitutions_for_pattern_0_should_be_an_array,s);J.sourceMap||J.inlineSourceMap||(J.inlineSources&&ar(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"inlineSources"),J.sourceRoot&&ar(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"sourceRoot")),J.out&&J.outFile&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","outFile"),!J.mapRoot||J.sourceMap||J.declarationMap||ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"mapRoot","sourceMap","declarationMap"),J.declarationDir&&(e.getEmitDeclarations(J)||ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationDir","declaration","composite"),r&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"declarationDir",J.out?"out":"outFile")),J.declarationMap&&!e.getEmitDeclarations(J)&&ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationMap","declaration","composite"),J.lib&&J.noLib&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"lib","noLib"),J.noImplicitUseStrict&&e.getStrictOptionValue(J,"alwaysStrict")&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noImplicitUseStrict","alwaysStrict");var d=e.getEmitScriptTarget(J),p=e.find(h,(function(t){return e.isExternalModule(t)&&!t.isDeclarationFile}));if(J.isolatedModules){J.module===e.ModuleKind.None&&d<2&&ar(e.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target"),!1===J.preserveConstEnums&&ar(e.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled,"preserveConstEnums","isolatedModules");for(var f=0,g=h;f<g.length;f++)if(o=g[f],!e.isExternalModule(o)&&!e.isSourceFileJS(o)&&!o.isDeclarationFile&&6!==o.scriptKind){var m=e.getErrorSpanForNode(o,o);le.add(e.createFileDiagnostic(o,m.start,m.length,e.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module,e.getBaseFileName(o.fileName)));}}else p&&d<2&&J.module===e.ModuleKind.None&&(m=e.getErrorSpanForNode(p,"boolean"==typeof p.externalModuleIndicator?p:p.externalModuleIndicator),le.add(e.createFileDiagnostic(p,m.start,m.length,e.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)));if(r&&!J.emitDeclarationOnly&&(J.module&&J.module!==e.ModuleKind.AMD&&J.module!==e.ModuleKind.System?ar(e.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0,J.out?"out":"outFile","module"):void 0===J.module&&p&&(m=e.getErrorSpanForNode(p,"boolean"==typeof p.externalModuleIndicator?p:p.externalModuleIndicator),le.add(e.createFileDiagnostic(p,m.start,m.length,e.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,J.out?"out":"outFile")))),J.resolveJsonModule&&(e.getEmitModuleResolutionKind(J)!==e.ModuleResolutionKind.NodeJs&&e.getEmitModuleResolutionKind(J)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(J)!==e.ModuleResolutionKind.NodeNext?ar(e.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy,"resolveJsonModule"):e.hasJsonModuleEmitEnabled(J)||ar(e.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext,"resolveJsonModule","module")),J.outDir||J.rootDir||J.sourceRoot||J.mapRoot){var y=$e();J.outDir&&""===y&&h.some((function(t){return e.getRootLength(t.fileName)>1}))&&ar(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir");}if(J.useDefineForClassFields&&0===d&&ar(e.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields"),J.checkJs&&!e.getAllowJSCompilerOption(J)&&le.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs")),J.emitDeclarationOnly&&(e.getEmitDeclarations(J)||ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),J.noEmit&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit")),J.emitDecoratorMetadata&&!J.experimentalDecorators&&ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators"),J.jsxFactory?(J.reactNamespace&&ar(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==J.jsx&&5!==J.jsx||ar(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFactory,d)||or("jsxFactory",e.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFactory)):J.reactNamespace&&!e.isIdentifierText(J.reactNamespace,d)&&or("reactNamespace",e.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,J.reactNamespace),J.jsxFragmentFactory&&(J.jsxFactory||ar(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==J.jsx&&5!==J.jsx||ar(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFragmentFactory,d)||or("jsxFragmentFactory",e.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFragmentFactory)),J.reactNamespace&&(4!==J.jsx&&5!==J.jsx||ar(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e.inverseJsxOptionMap.get(""+J.jsx))),J.jsxImportSource&&2===J.jsx&&ar(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e.inverseJsxOptionMap.get(""+J.jsx)),J.preserveValueImports&&e.getEmitModuleKind(J)<e.ModuleKind.ES2015&&or("importsNotUsedAsValues",e.Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later),!J.noEmit&&!J.suppressOutputPathCheck){var v=tt(),b=new e.Set;e.forEachEmittedFile(v,(function(e){J.emitDeclarationOnly||x(e.jsFilePath,b),x(e.declarationFilePath,b);}));}function x(t,r){if(t){var n=Ze(t);if(Ee.has(n)){var i=void 0;J.configFilePath||(i=e.chainDiagnosticMessages(void 0,e.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig)),i=e.chainDiagnosticMessages(i,e.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file,t),_r(t,e.createCompilerDiagnosticFromMessageChain(i));}var a=ie.useCaseSensitiveFileNames()?n:e.toFileNameLowerCase(n);r.has(a)?_r(t,e.createCompilerDiagnostic(e.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,t)):r.add(a);}}}(),e.performance.mark("afterProgram"),e.performance.measure("Program","beforeProgram","afterProgram"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),qe;function We(e){if(e)for(var t=0,r=e;t<r.length;t++){var n=r[t];le.add(n);}}function He(t,r,n){if(!t.length)return e.emptyArray;var i=e.getNormalizedAbsolutePath(r.originalFileName,ue),a=Qe(r);null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveModuleNamesWorker",{containingFileName:i}),e.performance.mark("beforeResolveModule");var o=re(t,r,i,n,a);return e.performance.mark("afterResolveModule"),e.performance.measure("ResolveModule","beforeResolveModule","afterResolveModule"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),function(t,r){var n;if(ee)for(var i=e.getNormalizedAbsolutePath(r.originalFileName,ue),a=e.isString(r)?void 0:r.impliedNodeFormat,o=e.getDirectoryPath(i),s=Qe(r),c=0,l=0,u=t;l<u.length;l++){var _=u[l],d="string"==typeof _?v(r,c):y(_,a),p="string"==typeof _?_:_.fileName;c++,e.isExternalModuleNameRelative(p)||We(null===(n=ee.getOrCreateCacheForModuleName(p,d,s).get(o))||void 0===n?void 0:n.resolutionDiagnostics);}}(t,r),o}function Ge(t,r){if(!t.length)return [];var n=e.isString(r)?r:e.getNormalizedAbsolutePath(r.originalFileName,ue),i=e.isString(r)?void 0:Qe(r),a=e.isString(r)?void 0:r.impliedNodeFormat;null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveTypeReferenceDirectiveNamesWorker",{containingFileName:n}),e.performance.mark("beforeResolveTypeReference");var o=ne(t,n,i,a);return e.performance.mark("afterResolveTypeReference"),e.performance.measure("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function Qe(t){var r=Bt(t.originalFileName);if(r||!e.isDeclarationFileName(t.originalFileName))return r;var n=Xe(t.path);if(n)return n;if(ie.realpath&&J.preserveSymlinks&&e.stringContains(t.originalFileName,e.nodeModulesPathPart)){var i=Ze(ie.realpath(t.originalFileName));return i===t.path?void 0:Xe(i)}}function Xe(t){var r=Jt(t);return e.isString(r)?Bt(r):r?jt((function(r){var n=e.outFile(r.commandLine.options);if(n)return Ze(n)===t?r:void 0})):void 0}function Ye(t){if(e.containsPath(ce,t.fileName,!1)){var r=e.getBaseFileName(t.fileName);if("lib.d.ts"===r||"lib.es6.d.ts"===r)return 0;var n=e.removeSuffix(e.removePrefix(r,"lib."),".d.ts"),i=e.libs.indexOf(n);if(-1!==i)return i+1}return e.libs.length+2}function Ze(t){return e.toPath(t,ue,Gt)}function $e(){if(void 0===x){var t=e.filter(h,(function(t){return e.sourceFileMayBeEmitted(t,qe)}));x=e.getCommonSourceDirectory(J,(function(){return e.mapDefined(t,(function(e){return e.isDeclarationFile?void 0:e.fileName}))}),ue,Gt,(function(r){return function(t,r){for(var n=!0,i=ie.getCanonicalFileName(e.getNormalizedAbsolutePath(r,ue)),a=0,o=t;a<o.length;a++){var s=o[a];s.isDeclarationFile||0!==ie.getCanonicalFileName(e.getNormalizedAbsolutePath(s.fileName,ue)).indexOf(i)&&($t(s,e.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,[s.fileName,r]),n=!1);}return n}(t,r)}));}return x}function et(t,r){if(0===Oe&&!r.ambientModuleNames.length)return He(t,r,void 0);var n,i,a,o=K&&K.getSourceFile(r.fileName);if(o!==r&&r.resolvedModules){for(var s=[],c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=r.resolvedModules.get(_,v(r,c));c++,s.push(d);}return s}var p={};for(c=0;c<t.length;c++){if(_=t[c],r===o&&!fe(o.path)){var f=e.getResolvedModule(o,_,v(o,c));if(f){e.isTraceEnabled(J,ie)&&e.trace(ie,f.packageId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2,_,e.getNormalizedAbsolutePath(r.originalFileName,ue),f.resolvedFileName,f.packageId&&e.packageIdToString(f.packageId)),(i||(i=new Array(t.length)))[c]=f,(a||(a=[])).push(_);continue}}var g=!1;e.contains(r.ambientModuleNames,_)?(g=!0,e.isTraceEnabled(J,ie)&&e.trace(ie,e.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1,_,e.getNormalizedAbsolutePath(r.originalFileName,ue))):g=h(_,c),g?(i||(i=new Array(t.length)))[c]=p:(n||(n=[])).push(_);}var m=n&&n.length?He(n,r,a):e.emptyArray;if(!i)return e.Debug.assert(m.length===t.length),m;var y=0;for(c=0;c<i.length;c++)i[c]?i[c]===p&&(i[c]=void 0):(i[c]=m[y],y++);return e.Debug.assert(y===m.length),i;function h(t,r){if(r>=e.length(null==o?void 0:o.imports)+e.length(null==o?void 0:o.moduleAugmentations))return !1;var n=e.getResolvedModule(o,t,o&&v(o,r)),i=n&&K.getSourceFile(n.resolvedFileName);if(n&&i)return !1;var a=V.get(t);return !!a&&(e.isTraceEnabled(J,ie)&&e.trace(ie,e.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified,t,a),!0)}}function tt(t){return {getPrependNodes:it,getCanonicalFileName:Gt,getCommonSourceDirectory:qe.getCommonSourceDirectory,getCompilerOptions:qe.getCompilerOptions,getCurrentDirectory:function(){return ue},getNewLine:function(){return ie.getNewLine()},getSourceFile:qe.getSourceFile,getSourceFileByPath:qe.getSourceFileByPath,getSourceFiles:qe.getSourceFiles,getLibFileFromReference:qe.getLibFileFromReference,isSourceFileFromExternalLibrary:at,getResolvedProjectReferenceToRedirect:Bt,getProjectReferenceRedirect:Mt,isSourceOfProjectReferenceRedirect:zt,getSymlinkCache:pr,writeFile:t||rt,isEmitBlocked:st,readFile:function(e){return ie.readFile(e)},fileExists:function(t){var r=Ze(t);return !!lt(r)||!e.contains(ye,r)&&ie.fileExists(t)},useCaseSensitiveFileNames:function(){return ie.useCaseSensitiveFileNames()},getProgramBuildInfo:function(){return qe.getProgramBuildInfo&&qe.getProgramBuildInfo()},getSourceFileFromReference:function(e,t){return qe.getSourceFileFromReference(e,t)},redirectTargetsMap:Te,getFileIncludeReasons:qe.getFileIncludeReasons,createHash:e.maybeBind(ie,ie.createHash)}}function rt(e,t,r,n,i,a){ie.writeFile(e,t,r,n,i,a);}function nt(){return ve}function it(){return P(U,(function(e,t){var r;return null===(r=ve[t])||void 0===r?void 0:r.commandLine}),(function(e){var t=Ze(e),r=lt(t);return r?r.text:Ee.has(t)?void 0:ie.readFile(t)}))}function at(e){return !!Z.get(e.path)}function ot(){return M||(M=e.createTypeChecker(qe))}function st(e){return pe.has(Ze(e))}function ct(e){return lt(Ze(e))}function lt(e){return Ee.get(e)||void 0}function ut(t,r,n){return t?r(t,n):e.sortAndDeduplicateDiagnostics(e.flatMap(qe.getSourceFiles(),(function(e){return n&&n.throwIfCancellationRequested(),r(e,n)})))}function _t(t){var r;if(e.skipTypeChecking(t,J,qe))return e.emptyArray;var n=le.getDiagnostics(t.fileName);return (null===(r=t.commentDirectives)||void 0===r?void 0:r.length)?yt(t,t.commentDirectives,n).diagnostics:n}function dt(t){return e.isSourceFileJS(t)?(t.additionalSyntacticDiagnostics||(t.additionalSyntacticDiagnostics=function(t){return pt((function(){var r=[];return n(t,t),e.forEachChildRecursively(t,n,(function(t,n){switch(e.canHaveModifiers(n)&&n.modifiers===t&&e.some(t,e.isDecorator)&&!J.experimentalDecorators&&r.push(a(n,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)),n.kind){case 260:case 228:case 171:case 173:case 174:case 175:case 215:case 259:case 216:if(t===n.typeParameters)return r.push(i(t,e.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 240:if(t===n.modifiers)return function(t,n){for(var i=0,o=t;i<o.length;i++){var s=o[i];switch(s.kind){case 85:if(n)continue;case 123:case 121:case 122:case 146:case 136:case 126:case 161:case 101:case 145:r.push(a(s,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(s.kind)));}}}(n.modifiers,240===n.kind),"skip";break;case 169:if(t===n.modifiers){for(var o=0,s=t;o<s.length;o++){var c=s[o];e.isModifier(c)&&124!==c.kind&&127!==c.kind&&r.push(a(c,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(c.kind)));}return "skip"}break;case 166:if(t===n.modifiers&&e.some(t,e.isModifier))return r.push(i(t,e.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)),"skip";break;case 210:case 211:case 230:case 282:case 283:case 212:if(t===n.typeArguments)return r.push(i(t,e.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)),"skip"}})),r;function n(t,n){switch(n.kind){case 166:case 169:case 171:if(n.questionToken===t)return r.push(a(t,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 170:case 173:case 174:case 175:case 215:case 259:case 216:case 257:if(n.type===t)return r.push(a(t,e.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(t.kind){case 270:if(t.isTypeOnly)return r.push(a(n,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 275:if(t.isTypeOnly)return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 273:case 278:if(t.isTypeOnly)return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,e.isImportSpecifier(t)?"import...type":"export...type")),"skip";break;case 268:return r.push(a(t,e.Diagnostics.import_can_only_be_used_in_TypeScript_files)),"skip";case 274:if(t.isExportEquals)return r.push(a(t,e.Diagnostics.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 294:if(117===t.token)return r.push(a(t,e.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 261:var i=e.tokenToString(118);return e.Debug.assertIsDefined(i),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 264:var o=16&t.flags?e.tokenToString(143):e.tokenToString(142);return e.Debug.assertIsDefined(o),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 262:return r.push(a(t,e.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 263:var s=e.Debug.checkDefined(e.tokenToString(92));return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,s)),"skip";case 232:return r.push(a(t,e.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 231:return r.push(a(t.type,e.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 235:return r.push(a(t.type,e.Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 213:e.Debug.fail();}}function i(r,n,i,a,o){var s=r.pos;return e.createFileDiagnostic(t,s,r.end-s,n,i,a,o)}function a(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a,o)}}))}(t)),e.concatenate(t.additionalSyntacticDiagnostics,t.parseDiagnostics)):t.parseDiagnostics}function pt(t){try{return t()}catch(t){throw t instanceof e.OperationCanceledException&&(M=void 0),t}}function ft(t,r){return e.concatenate(A(gt(t,r),J),_t(t))}function gt(e,t){return bt(e,t,W,mt)}function mt(t,r){return pt((function(){if(e.skipTypeChecking(t,J,qe))return e.emptyArray;var n=ot();e.Debug.assert(!!t.bindDiagnostics);var i=(1===t.scriptKind||2===t.scriptKind)&&e.isCheckJsEnabledForFile(t,J),a=e.isPlainJsFile(t,J.checkJs),o=!(t.checkJsDirective&&!1===t.checkJsDirective.enabled)&&(3===t.scriptKind||4===t.scriptKind||5===t.scriptKind||a||i||7===t.scriptKind),s=o?t.bindDiagnostics:e.emptyArray,c=o?n.getDiagnostics(t,r):e.emptyArray;return a&&(s=e.filter(s,(function(t){return e.plainJSErrors.has(t.code)})),c=e.filter(c,(function(t){return e.plainJSErrors.has(t.code)}))),function(t,r){for(var n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o=e.flatten(i);if(!r||!(null===(n=t.commentDirectives)||void 0===n?void 0:n.length))return o;for(var s=yt(t,t.commentDirectives,o),c=s.diagnostics,l=s.directives,u=0,_=l.getUnusedExpectations();u<_.length;u++){var d=_[u];c.push(e.createDiagnosticForRange(t,d.range,e.Diagnostics.Unused_ts_expect_error_directive));}return c}(t,o&&!a,s,c,i?t.jsDocDiagnostics:void 0)}))}function yt(t,r,n){var i=e.createCommentDirectivesMap(t,r),a=n.filter((function(t){return -1===function(t,r){var n=t.file,i=t.start;if(!n)return -1;for(var a=e.getLineStarts(n),o=e.computeLineAndCharacterOfPosition(a,i).line-1;o>=0;){if(r.markUsed(o))return o;var s=n.text.slice(a[o],a[o+1]).trim();if(""!==s&&!/^(\s*)\/\/(.*)$/.test(s))return -1;o--;}return -1}(t,i)}));return {diagnostics:a,directives:i}}function vt(e,t){return bt(e,t,H,ht)}function ht(t,r){return pt((function(){var n=ot().getEmitResolver(t,r);return e.getDeclarationDiagnostics(tt(e.noop),n,t)||e.emptyArray}))}function bt(t,r,n,i){var a,o=t?null===(a=n.perFile)||void 0===a?void 0:a.get(t.path):n.allDiagnostics;if(o)return o;var s=i(t,r);return t?(n.perFile||(n.perFile=new e.Map)).set(t.path,s):n.allDiagnostics=s,s}function xt(e,t){return e.isDeclarationFile?[]:vt(e,t)}function Dt(t,r,n,i){Nt(e.normalizePath(t),r,n,void 0,i);}function St(e,t){return e.fileName===t.fileName}function Tt(e,t){return 79===e.kind?79===t.kind&&e.escapedText===t.escapedText:10===t.kind&&e.text===t.text}function Ct(t,r){var n=e.factory.createStringLiteral(t),i=e.factory.createImportDeclaration(void 0,void 0,n,void 0);return e.addEmitFlags(i,67108864),e.setParent(n,i),e.setParent(i,r),n.flags&=-9,i.flags&=-9,n}function Et(t){if(!t.imports){var r,n,i,a=e.isSourceFileJS(t),o=e.isExternalModule(t);if((J.isolatedModules||o)&&!t.isDeclarationFile){J.importHelpers&&(r=[Ct(e.externalHelpersModuleNameText,t)]);var s=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(J,t),J);s&&(r||(r=[])).push(Ct(s,t));}for(var c=0,l=t.statements;c<l.length;c++)u(l[c],!1);return (2097152&t.flags||a)&&function(t){for(var n=/import|require/g;null!==n.exec(t.text);){var i=_(t,n.lastIndex);a&&e.isRequireCall(i,!0)||e.isImportCall(i)&&i.arguments.length>=1&&e.isStringLiteralLike(i.arguments[0])?(e.setParentRecursive(i,!1),r=e.append(r,i.arguments[0])):e.isLiteralImportTypeNode(i)&&(e.setParentRecursive(i,!1),r=e.append(r,i.argument.literal));}}(t),t.imports=r||e.emptyArray,t.moduleAugmentations=n||e.emptyArray,void(t.ambientModuleNames=i||e.emptyArray)}function u(a,s){if(e.isAnyImportOrReExport(a)){var c=e.getExternalModuleName(a);!(c&&e.isStringLiteral(c)&&c.text)||s&&e.isExternalModuleNameRelative(c.text)||(e.setParentRecursive(a,!1),r=e.append(r,c),Ce||0!==X||t.isDeclarationFile||(Ce=e.startsWith(c.text,"node:")));}else if(e.isModuleDeclaration(a)&&e.isAmbientModule(a)&&(s||e.hasSyntacticModifier(a,2)||t.isDeclarationFile)){a.name.parent=a;var l=e.getTextOfIdentifierOrLiteral(a.name);if(o||s&&!e.isExternalModuleNameRelative(l))(n||(n=[])).push(a.name);else if(!s){t.isDeclarationFile&&(i||(i=[])).push(l);var _=a.body;if(_)for(var d=0,p=_.statements;d<p.length;d++)u(p[d],!0);}}}function _(t,r){for(var n=t,i=function(e){if(e.pos<=r&&(r<e.end||r===e.end&&1===e.kind))return e};;){var o=a&&e.hasJSDocNodes(n)&&e.forEach(n.jsDoc,i)||e.forEachChild(n,i);if(!o)return n;n=o;}}}function kt(t,r,n,i){if(e.hasExtension(t)){var a=ie.getCanonicalFileName(t);if(!J.allowNonTsExtensions&&!e.forEach(e.flatten(de),(function(t){return e.fileExtensionIs(a,t)})))return void(n&&(e.hasJSFileExtension(a)?n(e.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,t):n(e.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,t,"'"+e.flatten(_e).join("', '")+"'")));var o=r(t);if(n)if(o)T(i)&&a===ie.getCanonicalFileName(lt(i.file).fileName)&&n(e.Diagnostics.A_file_cannot_have_a_reference_to_itself);else {var s=Mt(t);s?n(e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,s,t):n(e.Diagnostics.File_0_not_found,t);}return o}var c=J.allowNonTsExtensions&&r(t);if(c)return c;if(!n||!J.allowNonTsExtensions){var l=e.forEach(_e[0],(function(e){return r(t+e)}));return n&&!l&&n(e.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,t,"'"+e.flatten(_e).join("', '")+"'"),l}n(e.Diagnostics.File_0_not_found,t);}function Nt(e,t,r,n,i){kt(e,(function(e){return Pt(e,t,r,i,n)}),(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Zt(void 0,i,e,t)}),i);}function At(e,t){return Nt(e,!1,!1,void 0,t)}function Ft(t,r,n){!T(n)&&e.some(q.get(r.path),T)?Zt(r,n,e.Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[r.fileName,t]):Zt(r,n,e.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[t,r.fileName]);}function Pt(t,r,n,i,a){null===e.tracing||void 0===e.tracing||e.tracing.push("program","findSourceFile",{fileName:t,isDefaultLib:r||void 0,fileIncludeKind:e.FileIncludeKind[i.kind]});var o=function(t,r,n,i,a){var o,s,c=Ze(t);if(Ne){var l=Jt(c);if(!l&&ie.realpath&&J.preserveSymlinks&&e.isDeclarationFileName(t)&&e.stringContains(t,e.nodeModulesPathPart)){var u=Ze(ie.realpath(t));u!==c&&(l=Jt(u));}if(l){var _=e.isString(l)?Pt(l,r,n,i,a):void 0;return _&&Ot(_,c,void 0),_}}var d,p=t;if(Ee.has(c)){var m=Ee.get(c);if(It(m||void 0,i),m&&J.forceConsistentCasingInFileNames){var y=m.fileName;Ze(y)!==Ze(t)&&(t=Mt(t)||t),e.getNormalizedAbsolutePathWithoutRoot(y,ue)!==e.getNormalizedAbsolutePathWithoutRoot(t,ue)&&Ft(t,m,i);}return m&&Z.get(m.path)&&0===X?(Z.set(m.path,!1),J.noResolve||(Kt(m,r),Vt(m)),J.noLib||Ht(m),Y.set(m.path,!1),Qt(m)):m&&Y.get(m.path)&&X<Q&&(Y.set(m.path,!1),Qt(m)),m||void 0}if(T(i)&&!Ne){var v=Lt(t);if(v){if(e.outFile(v.commandLine.options))return;var h=Rt(v,t);t=h,d=Ze(h);}}var b=wt(t,ee,ie,J),x=ie.getSourceFile(t,b,(function(r){return Zt(void 0,i,e.Diagnostics.Cannot_read_file_0_Colon_1,[t,r])}),Me||(null===(o=null==K?void 0:K.getSourceFileByPath(Ze(t)))||void 0===o?void 0:o.impliedNodeFormat)!==b.impliedNodeFormat);if(a){var D=e.packageIdToString(a),S=De.get(D);if(S){var C=function(e,t,r,n,i,a,o){var s,c=Object.create(e);return c.fileName=r,c.path=n,c.resolvedPath=i,c.originalFileName=a,c.redirectInfo={redirectTarget:e,unredirected:t},c.packageJsonLocations=(null===(s=o.packageJsonLocations)||void 0===s?void 0:s.length)?o.packageJsonLocations:void 0,c.packageJsonScope=o.packageJsonScope,Z.set(n,X>0),Object.defineProperties(c,{id:{get:function(){return this.redirectInfo.redirectTarget.id},set:function(e){this.redirectInfo.redirectTarget.id=e;}},symbol:{get:function(){return this.redirectInfo.redirectTarget.symbol},set:function(e){this.redirectInfo.redirectTarget.symbol=e;}}}),c}(S,x,t,c,Ze(t),p,b);return Te.add(S.path,t),Ot(C,c,d),It(C,i),Se.set(c,e.packageIdToPackageName(a)),g.push(C),C}x&&(De.set(D,x),Se.set(c,e.packageIdToPackageName(a)));}if(Ot(x,c,d),x){if(Z.set(c,X>0),x.fileName=t,x.path=c,x.resolvedPath=Ze(t),x.originalFileName=p,x.packageJsonLocations=(null===(s=b.packageJsonLocations)||void 0===s?void 0:s.length)?b.packageJsonLocations:void 0,x.packageJsonScope=b.packageJsonScope,It(x,i),ie.useCaseSensitiveFileNames()){var E=e.toFileNameLowerCase(c),k=ke.get(E);k?Ft(t,k,i):ke.set(E,x);}oe=oe||x.hasNoDefaultLib&&!n,J.noResolve||(Kt(x,r),Vt(x)),J.noLib||Ht(x),Qt(x),r?f.push(x):g.push(x);}return x}(t,r,n,i,a);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function wt(t,r,n,a){var o=k(e.getNormalizedAbsolutePath(t,ue),null==r?void 0:r.getPackageJsonInfoCache(),n,a),s=e.getEmitScriptTarget(a),c=e.getSetExternalModuleIndicator(a);return "object"==typeof o?i$1(i$1({},o),{languageVersion:s,setExternalModuleIndicator:c}):{languageVersion:s,impliedNodeFormat:o,setExternalModuleIndicator:c}}function It(e,t){e&&q.add(e.path,t);}function Ot(e,t,r){r?(Ee.set(r,e),Ee.set(t,e||!1)):Ee.set(t,e);}function Mt(e){var t=Lt(e);return t&&Rt(t,e)}function Lt(t){if(ve&&ve.length&&!e.isDeclarationFileName(t)&&!e.fileExtensionIs(t,".json"))return Bt(t)}function Rt(t,r){var n=e.outFile(t.commandLine.options);return n?e.changeExtension(n,".d.ts"):e.getOutputDeclarationFileName(r,t.commandLine,!ie.useCaseSensitiveFileNames())}function Bt(t){void 0===be&&(be=new e.Map,jt((function(e){Ze(J.configFilePath)!==e.sourceFile.path&&e.commandLine.fileNames.forEach((function(t){return be.set(Ze(t),e.sourceFile.path)}));})));var r=be.get(Ze(t));return r&&Ut(r)}function jt(t){return e.forEachResolvedProjectReference(ve,t)}function Jt(t){if(e.isDeclarationFileName(t))return void 0===xe&&(xe=new e.Map,jt((function(t){var r=e.outFile(t.commandLine.options);if(r){var n=e.changeExtension(r,".d.ts");xe.set(Ze(n),!0);}else {var i=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ie.useCaseSensitiveFileNames())}));e.forEach(t.commandLine.fileNames,(function(r){if(!e.isDeclarationFileName(r)&&!e.fileExtensionIs(r,".json")){var n=e.getOutputDeclarationFileName(r,t.commandLine,!ie.useCaseSensitiveFileNames(),i);xe.set(Ze(n),r);}}));}}))),xe.get(t)}function zt(e){return Ne&&!!Bt(e)}function Ut(e){if(he)return he.get(e)||void 0}function Kt(r,n){e.forEach(r.referencedFiles,(function(i,a){Nt(t(i.fileName,r.fileName),n,!1,void 0,{kind:e.FileIncludeKind.ReferenceFile,file:r.path,index:a});}));}function Vt(t){var r=t.typeReferenceDirectives;if(r)for(var n=Ge(r,t),i=0;i<r.length;i++){var a=t.typeReferenceDirectives[i],o=n[i],s=e.toFileNameLowerCase(a.fileName);e.setResolvedTypeReferenceDirective(t,s,o);var c=a.resolutionMode||t.impliedNodeFormat;c&&e.getEmitModuleResolutionKind(J)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(J)!==e.ModuleResolutionKind.NodeNext&&le.add(e.createDiagnosticForRange(t,a,e.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)),qt(s,c,o,{kind:e.FileIncludeKind.TypeReferenceDirective,file:t.path,index:i});}}function qt(t,r,n,i){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferenceDirective",{directive:t,hasResolved:!!n,refKind:i.kind,refPath:T(i)?i.file:void 0}),function(t,r,n,i){var a=G.get(t,r);if(!a||!a.primary){var o=!0;if(n){if(n.isExternalLibraryImport&&X++,n.primary)Nt(n.resolvedFileName,!1,!1,n.packageId,i);else if(a){if(n.resolvedFileName!==a.resolvedFileName){var s=ie.readFile(n.resolvedFileName),c=ct(a.resolvedFileName);s!==c.text&&Zt(c,i,e.Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict,[t,n.resolvedFileName,a.resolvedFileName]);}o=!1;}else Nt(n.resolvedFileName,!1,!1,n.packageId,i);n.isExternalLibraryImport&&X--;}else Zt(void 0,i,e.Diagnostics.Cannot_find_type_definition_file_for_0,[t]);o&&G.set(t,r,n);}}(t,r,n,i),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function Wt(t){for(var r=t.split("."),n=r[1],i=2;r[i]&&"d"!==r[i];)n+=(2===i?"/":"-")+r[i],i++;var a=e.combinePaths(ue,"__lib_node_modules_lookup_".concat(t,"__.ts")),o=e.resolveModuleName("@typescript/lib-"+n,a,{moduleResolution:e.ModuleResolutionKind.NodeJs},ie,ee);return (null==o?void 0:o.resolvedModule)?o.resolvedModule.resolvedFileName:e.combinePaths(ce,t)}function Ht(t){e.forEach(t.libReferenceDirectives,(function(r,n){var i=e.toFileNameLowerCase(r.fileName),a=e.libMap.get(i);if(a)Dt(Wt(a),!0,!0,{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n});else {var o=e.removeSuffix(e.removePrefix(i,"lib."),".d.ts"),s=e.getSpellingSuggestion(o,e.libs,e.identity),c=s?e.Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1:e.Diagnostics.Cannot_find_lib_definition_for_0;(R||(R=[])).push({kind:0,reason:{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n},diagnostic:c,args:[i,s]});}}));}function Gt(e){return ie.getCanonicalFileName(e)}function Qt(t){var r;if(Et(t),t.imports.length||t.moduleAugmentations.length){var n=O(t),i=et(n,t);e.Debug.assert(i.length===n.length);for(var a=(Ne?null===(r=Qe(t))||void 0===r?void 0:r.commandLine.options:void 0)||J,o=0;o<n.length;o++){var s=i[o];if(e.setResolvedModule(t,n[o],s,v(t,o)),s){var c=s.isExternalLibraryImport,l=!e.resolutionExtensionIsTSOrJson(s.extension),u=c&&l,_=s.resolvedFileName;c&&X++;var d=u&&X>Q,p=_&&!I(a,s)&&!a.noResolve&&o<t.imports.length&&!d&&!(l&&!e.getAllowJSCompilerOption(a))&&(e.isInJSFile(t.imports[o])||!(8388608&t.imports[o].flags));d?Y.set(t.path,!0):p&&Pt(_,!1,!1,{kind:e.FileIncludeKind.Import,file:t.path,index:o},s.packageId),c&&X--;}}}else t.resolvedModules=void 0;}function Xt(t){he||(he=new e.Map);var r,n,i=w(t),a=Ze(i),o=he.get(a);if(void 0!==o)return o||void 0;if(ie.getParsedCommandLine){if(!(r=ie.getParsedCommandLine(i)))return Ot(void 0,a,void 0),void he.set(a,!1);n=e.Debug.checkDefined(r.options.configFile),e.Debug.assert(!n.path||n.path===a),Ot(n,a,void 0);}else {var s=e.getNormalizedAbsolutePath(e.getDirectoryPath(i),ie.getCurrentDirectory());if(Ot(n=ie.getSourceFile(i,100),a,void 0),void 0===n)return void he.set(a,!1);r=e.parseJsonSourceFileConfigFileContent(n,ae,s,void 0,i);}n.fileName=i,n.path=a,n.resolvedPath=a,n.originalFileName=i;var c={commandLine:r,sourceFile:n};return he.set(a,c),r.projectReferences&&(c.references=r.projectReferences.map(Xt)),c}function Yt(t,r,i,a){var o,s,c,l=T(r)?r:void 0;t&&(null===(o=q.get(t.path))||void 0===o||o.forEach(f)),r&&f(r),l&&1===(null==s?void 0:s.length)&&(s=void 0);var u=l&&E(lt,l),_=s&&e.chainDiagnosticMessages(s,e.Diagnostics.The_file_is_in_the_program_because_Colon),d=t&&e.explainIfFileIsRedirectAndImpliedFormat(t),p=e.chainDiagnosticMessages.apply(void 0,n$4([d?_?n$4([_],d,!0):d:_,i],a||e.emptyArray,!1));return u&&C(u)?e.createFileDiagnosticFromMessageChain(u.file,u.pos,u.end-u.pos,p,c):e.createCompilerDiagnosticFromMessageChain(p,c);function f(t){(s||(s=[])).push(e.fileIncludeReasonToDiagnostics(qe,t)),!l&&T(t)?l=t:l!==t&&(c=e.append(c,function(t){if(T(t)){var r,n=E(lt,t);switch(t.kind){case e.FileIncludeKind.Import:r=e.Diagnostics.File_is_included_via_import_here;break;case e.FileIncludeKind.ReferenceFile:r=e.Diagnostics.File_is_included_via_reference_here;break;case e.FileIncludeKind.TypeReferenceDirective:r=e.Diagnostics.File_is_included_via_type_library_reference_here;break;case e.FileIncludeKind.LibReferenceDirective:r=e.Diagnostics.File_is_included_via_library_reference_here;break;default:e.Debug.assertNever(t);}return C(n)?e.createFileDiagnostic(n.file,n.pos,n.end-n.pos,r):void 0}if(J.configFile){var i,a,o,s;switch(t.kind){case e.FileIncludeKind.RootFile:if(!J.configFile.configFileSpecs)return;var c=e.getNormalizedAbsolutePath(j[t.index],ue),l=e.getMatchedFileSpec(qe,c);if(l){i=e.getTsConfigPropArrayElementValue(J.configFile,"files",l),a=e.Diagnostics.File_is_matched_by_files_list_specified_here;break}var u=e.getMatchedIncludeSpec(qe,c);if(!u||!e.isString(u))return;i=e.getTsConfigPropArrayElementValue(J.configFile,"include",u),a=e.Diagnostics.File_is_matched_by_include_pattern_specified_here;break;case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var _=e.Debug.checkDefined(null==ve?void 0:ve[t.index]),d=S(U,ve,(function(e,t,r){return e===_?{sourceFile:(null==t?void 0:t.sourceFile)||J.configFile,index:r}:void 0}));if(!d)return;var p=d.sourceFile,f=d.index,g=e.firstDefined(e.getTsConfigPropArray(p,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));return g&&g.elements.length>f?e.createDiagnosticForNodeInSourceFile(p,g.elements[f],t.kind===e.FileIncludeKind.OutputFromProjectReference?e.Diagnostics.File_is_output_from_referenced_project_specified_here:e.Diagnostics.File_is_source_from_referenced_project_specified_here):void 0;case e.FileIncludeKind.AutomaticTypeDirectiveFile:if(!J.types)return;i=ir("types",t.typeReference),a=e.Diagnostics.File_is_entry_point_of_type_library_specified_here;break;case e.FileIncludeKind.LibFile:if(void 0!==t.index){i=ir("lib",J.lib[t.index]),a=e.Diagnostics.File_is_library_specified_here;break}var m=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(J)?r:void 0}));i=m?(o=m,(s=rr("target"))&&e.firstDefined(s,(function(t){return e.isStringLiteral(t.initializer)&&t.initializer.text===o?t.initializer:void 0}))):void 0,a=e.Diagnostics.File_is_default_library_for_target_specified_here;break;default:e.Debug.assertNever(t);}return i&&e.createDiagnosticForNodeInSourceFile(J.configFile,i,a)}}(t))),t===r&&(r=void 0);}}function Zt(e,t,r,n){(R||(R=[])).push({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:r,args:n});}function $t(e,t,r){le.add(Yt(e,void 0,t,r));}function er(t,r,n,i,a,o){for(var s=!0,c=0,l=nr();c<l.length;c++){var u=l[c];if(e.isObjectLiteralExpression(u.initializer))for(var _=0,d=e.getPropertyAssignment(u.initializer,t);_<d.length;_++){var p=d[_].initializer;e.isArrayLiteralExpression(p)&&p.elements.length>r&&(le.add(e.createDiagnosticForNodeInSourceFile(J.configFile,p.elements[r],n,i,a,o)),s=!1);}}s&&le.add(e.createCompilerDiagnostic(n,i,a,o));}function tr(t,r,n,i){for(var a=!0,o=0,s=nr();o<s.length;o++){var c=s[o];e.isObjectLiteralExpression(c.initializer)&&ur(c.initializer,t,r,void 0,n,i)&&(a=!1);}a&&le.add(e.createCompilerDiagnostic(n,i));}function rr(t){var r=lr();return r&&e.getPropertyAssignment(r,t)}function nr(){return rr("paths")||e.emptyArray}function ir(t,r){var n=lr();return n&&e.getPropertyArrayElementValue(n,t,r)}function ar(e,t,r,n){cr(!0,t,r,e,t,r,n);}function or(e,t,r,n){cr(!1,e,void 0,t,r,n);}function sr(t,r,n,i,a){var o=e.firstDefined(e.getTsConfigPropArray(t||J.configFile,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));o&&o.elements.length>r?le.add(e.createDiagnosticForNodeInSourceFile(t||J.configFile,o.elements[r],n,i,a)):le.add(e.createCompilerDiagnostic(n,i,a));}function cr(t,r,n,i,a,o,s){var c=lr();(!c||!ur(c,t,r,n,i,a,o,s))&&le.add(e.createCompilerDiagnostic(i,a,o,s));}function lr(){if(void 0===$){$=!1;var t=e.getTsConfigObjectLiteralExpression(J.configFile);if(t)for(var r=0,n=e.getPropertyAssignment(t,"compilerOptions");r<n.length;r++){var i=n[r];if(e.isObjectLiteralExpression(i.initializer)){$=i.initializer;break}}}return $||void 0}function ur(t,r,n,i,a,o,s,c){for(var l=e.getPropertyAssignment(t,n,i),u=0,_=l;u<_.length;u++){var d=_[u];le.add(e.createDiagnosticForNodeInSourceFile(J.configFile,r?d.name:d.initializer,a,o,s,c));}return !!l.length}function _r(e,t){pe.set(Ze(e),!0),le.add(t);}function dr(t,r){return 0===e.comparePaths(t,r,ue,!ie.useCaseSensitiveFileNames())}function pr(){return ie.getSymlinkCache?ie.getSymlinkCache():(b||(b=e.createSymlinkCache(ue,Gt)),h&&G&&!b.hasProcessedResolutions()&&b.setSymlinksFromResolutions(h,G),b)}},e.emitSkippedWithNoDiagnostics={diagnostics:e.emptyArray,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:!0},e.handleNoEmitOptions=N,e.filterSemanticDiagnostics=A,e.parseConfigHostFromCompilerHostLike=F,e.createPrependNodes=P,e.resolveProjectReferencePath=w,e.getResolutionDiagnostic=I,e.getModuleNameStringLiteralAt=M;}(t),function(e){e.getFileEmitOutput=function(e,t,r,n,i,a){var o=[],s=e.emit(t,(function(e,t,r){o.push({name:e,writeByteOrderMark:r,text:t});}),n,r,i,a),c=s.emitSkipped,l=s.diagnostics;return {outputFiles:o,emitSkipped:c,diagnostics:l}},function(t){function r(){return t=new e.Map,r=new e.Map,i=void 0,a={getKeys:function(e){return r.get(e)},getValues:function(e){return t.get(e)},keys:function(){return t.keys()},deleteKey:function(a){(i||(i=new e.Set)).add(a);var o=t.get(a);return !!o&&(o.forEach((function(e){return n(r,e,a)})),t.delete(a),!0)},set:function(o,s){null==i||i.delete(o);var c=t.get(o);return t.set(o,s),null==c||c.forEach((function(e){s.has(e)||n(r,e,o);})),s.forEach((function(t){(null==c?void 0:c.has(t))||function(t,r,n){var i=t.get(r);i||(i=new e.Set,t.set(r,i)),i.add(n);}(r,t,o);})),a}};var t,r,i,a;}function n(e,t,r){var n=e.get(t);return !!(null==n?void 0:n.delete(r))&&(n.size||e.delete(t),!0)}function i(t){return e.mapDefined(t.declarations,(function(t){var r;return null===(r=e.getSourceFileOfNode(t))||void 0===r?void 0:r.resolvedPath}))}function a(e,t){var r=e.getSymbolAtLocation(t);return r&&i(r)}function o(t,r,n,i){return e.toPath(t.getProjectReferenceRedirect(r)||r,n,i)}function s(t,r,n){var i;if(r.imports&&r.imports.length>0)for(var s=t.getTypeChecker(),c=0,l=r.imports;c<l.length;c++){var u=a(s,l[c]);null==u||u.forEach(S);}var _=e.getDirectoryPath(r.resolvedPath);if(r.referencedFiles&&r.referencedFiles.length>0)for(var d=0,p=r.referencedFiles;d<p.length;d++){var f=p[d];S(o(t,f.fileName,_,n));}if(r.resolvedTypeReferenceDirectiveNames&&r.resolvedTypeReferenceDirectiveNames.forEach((function(e){if(e){var r=e.resolvedFileName;S(o(t,r,_,n));}})),r.moduleAugmentations.length){s=t.getTypeChecker();for(var g=0,m=r.moduleAugmentations;g<m.length;g++){var y=m[g];if(e.isStringLiteral(y)){var v=s.getSymbolAtLocation(y);v&&D(v);}}}for(var h=0,b=t.getTypeChecker().getAmbientModules();h<b.length;h++){var x=b[h];x.declarations&&x.declarations.length>1&&D(x);}return i;function D(t){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n],o=e.getSourceFileOfNode(a);o&&o!==r&&S(o.resolvedPath);}}function S(t){(i||(i=new e.Set)).add(t);}}function c(e,t){return t&&!t.referencedMap==!e}function l(t,r,n,i,a,o){var s=r.getSourceFileByPath(n);return s?u(t,r,s,i,a,o)?(t.referencedMap?y:m)(t,r,s,i,a,o):[s]:e.emptyArray}function u(t,r,n,i,a,o,s){var c;if(void 0===s&&(s=t.useFileVersionAsSignature),null===(c=t.hasCalledUpdateShapeSignature)||void 0===c?void 0:c.has(n.resolvedPath))return !1;var l,u=t.fileInfos.get(n.resolvedPath),d=u.signature;if(n.isDeclarationFile||s||r.emit(n,(function(r,i,s,c,u,p){e.Debug.assert(e.isDeclarationFileName(r),"File extension for signature expected to be dts: Got:: ".concat(r)),(l=e.computeSignatureWithDiagnostics(n,i,a,o,p))!==d&&_(t,n,u[0].exportedModulesFromDeclarationEmit);}),i,!0,void 0,!0),void 0===l&&(l=n.version,t.exportedModulesMap&&l!==d)){(t.oldExportedModulesMap||(t.oldExportedModulesMap=new e.Map)).set(n.resolvedPath,t.exportedModulesMap.getValues(n.resolvedPath)||!1);var p=t.referencedMap?t.referencedMap.getValues(n.resolvedPath):void 0;p?t.exportedModulesMap.set(n.resolvedPath,p):t.exportedModulesMap.deleteKey(n.resolvedPath);}return (t.oldSignatures||(t.oldSignatures=new e.Map)).set(n.resolvedPath,d||!1),(t.hasCalledUpdateShapeSignature||(t.hasCalledUpdateShapeSignature=new e.Set)).add(n.resolvedPath),u.signature=l,l!==d}function _(t,r,n){var a;t.exportedModulesMap&&((t.oldExportedModulesMap||(t.oldExportedModulesMap=new e.Map)).set(r.resolvedPath,t.exportedModulesMap.getValues(r.resolvedPath)||!1),n?(n.forEach((function(t){var r;(null==(r=i(t))?void 0:r.length)&&(a||(a=new e.Set),r.forEach((function(e){return a.add(e)})));})),a?t.exportedModulesMap.set(r.resolvedPath,a):t.exportedModulesMap.deleteKey(r.resolvedPath)):t.exportedModulesMap.deleteKey(r.resolvedPath));}function d(t,r){if(!t.allFileNames){var n=r.getSourceFiles();t.allFileNames=n===e.emptyArray?e.emptyArray:n.map((function(e){return e.fileName}));}return t.allFileNames}function p(t,r){var n=t.referencedMap.getKeys(r);return n?e.arrayFrom(n.keys()):[]}function f(t){return function(t){return e.some(t.moduleAugmentations,(function(t){return e.isGlobalScopeAugmentation(t.parent)}))}(t)||!e.isExternalOrCommonJsModule(t)&&!e.isJsonSourceFile(t)&&!function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if(!e.isModuleWithStringLiteralName(i))return !1}return !0}(t)}function g(t,r,n){if(t.allFilesExcludingDefaultLibraryFile)return t.allFilesExcludingDefaultLibraryFile;var i;n&&c(n);for(var a=0,o=r.getSourceFiles();a<o.length;a++){var s=o[a];s!==n&&c(s);}return t.allFilesExcludingDefaultLibraryFile=i||e.emptyArray,t.allFilesExcludingDefaultLibraryFile;function c(e){r.isSourceFileDefaultLibrary(e)||(i||(i=[])).push(e);}}function m(t,r,n){var i=r.getCompilerOptions();return i&&e.outFile(i)?[n]:g(t,r,n)}function y(t,r,n,i,a,o){if(f(n))return g(t,r,n);var s=r.getCompilerOptions();if(s&&(s.isolatedModules||e.outFile(s)))return [n];var c=new e.Map;c.set(n.resolvedPath,n);for(var l=p(t,n.resolvedPath);l.length>0;){var _=l.pop();if(!c.has(_)){var d=r.getSourceFileByPath(_);c.set(_,d),d&&u(t,r,d,i,a,o)&&l.push.apply(l,p(t,d.resolvedPath));}}return e.arrayFrom(e.mapDefinedIterator(c.values(),(function(e){return e})))}t.createManyToManyPathMap=r,t.canReuseOldState=c,t.create=function(t,n,i,a){var o,l,u,_=new e.Map,d=t.getCompilerOptions().module!==e.ModuleKind.None?r():void 0,p=d?r():void 0,g=c(d,i);t.getTypeChecker();for(var m=0,y=t.getSourceFiles();m<y.length;m++){var v=y[m],h=e.Debug.checkDefined(v.version,"Program intended to be used with Builder should have source files with versions set"),b=g?null===(o=i.oldSignatures)||void 0===o?void 0:o.get(v.resolvedPath):void 0,x=void 0===b?g?null===(l=i.fileInfos.get(v.resolvedPath))||void 0===l?void 0:l.signature:void 0:b||void 0;if(d){var D=s(t,v,n);if(D&&d.set(v.resolvedPath,D),g){var S=null===(u=i.oldExportedModulesMap)||void 0===u?void 0:u.get(v.resolvedPath),T=void 0===S?i.exportedModulesMap.getValues(v.resolvedPath):S||void 0;T&&p.set(v.resolvedPath,T);}}_.set(v.resolvedPath,{version:h,signature:x,affectsGlobalScope:f(v)||void 0,impliedFormat:v.impliedNodeFormat});}return {fileInfos:_,referencedMap:d,exportedModulesMap:p,useFileVersionAsSignature:!a&&!g}},t.releaseCache=function(e){e.allFilesExcludingDefaultLibraryFile=void 0,e.allFileNames=void 0;},t.getFilesAffectedBy=function(e,t,r,n,i,a){var o,s,c=l(e,t,r,n,i,a);return null===(o=e.oldSignatures)||void 0===o||o.clear(),null===(s=e.oldExportedModulesMap)||void 0===s||s.clear(),c},t.getFilesAffectedByWithOldState=l,t.updateSignatureOfFile=function(t,r,n){t.fileInfos.get(n).signature=r,(t.hasCalledUpdateShapeSignature||(t.hasCalledUpdateShapeSignature=new e.Set)).add(n);},t.updateShapeSignature=u,t.updateExportedModules=_,t.getAllDependencies=function(t,r,n){var i=r.getCompilerOptions();if(e.outFile(i))return d(t,r);if(!t.referencedMap||f(n))return d(t,r);for(var a=new e.Set,o=[n.resolvedPath];o.length;){var s=o.pop();if(!a.has(s)){a.add(s);var c=t.referencedMap.getValues(s);if(c)for(var l=c.keys(),u=l.next();!u.done;u=l.next())o.push(u.value);}}return e.arrayFrom(e.mapDefinedIterator(a.keys(),(function(e){var t,n;return null!==(n=null===(t=r.getSourceFileByPath(e))||void 0===t?void 0:t.fileName)&&void 0!==n?n:e})))},t.getReferencedByPaths=p,t.getAllFilesExcludingDefaultLibraryFile=g;}(e.BuilderState||(e.BuilderState={}));}(t),function(e){var t,r;function n(e,t,r){var n=e.file;return i$1(i$1({},e),{file:n?t.getSourceFileByPath(r(n)):void 0})}function a(t,r){e.Debug.assert(!r||!t.affectedFiles||t.affectedFiles[t.affectedFilesIndex-1]!==r||!t.semanticDiagnosticsPerFile.has(r.resolvedPath));}function o(t,r,n,i,a){for(var o,s;;){var c=t.affectedFiles;if(c){for(var u=t.seenAffectedFiles,_=t.affectedFilesIndex;_<c.length;){var d=c[_];if(!u.has(d.resolvedPath))return t.affectedFilesIndex=_,l(t,d,r,n,i,a),d;_++;}t.changedFilesSet.delete(t.currentChangedFilePath),t.currentChangedFilePath=void 0,null===(o=t.oldSignatures)||void 0===o||o.clear(),null===(s=t.oldExportedModulesMap)||void 0===s||s.clear(),t.affectedFiles=void 0;}var p=t.changedFilesSet.keys().next();if(p.done)return;var f=e.Debug.checkDefined(t.program),g=f.getCompilerOptions();if(e.outFile(g))return e.Debug.assert(!t.semanticDiagnosticsPerFile),f;t.affectedFiles=e.BuilderState.getFilesAffectedByWithOldState(t,f,p.value,r,n,i),t.currentChangedFilePath=p.value,t.affectedFilesIndex=0,t.seenAffectedFiles||(t.seenAffectedFiles=new e.Set);}}function s(e){e.affectedFilesPendingEmit=void 0,e.affectedFilesPendingEmitKind=void 0,e.affectedFilesPendingEmitIndex=void 0;}function c(t){if(!t.cleanedDiagnosticsOfLibFiles){t.cleanedDiagnosticsOfLibFiles=!0;var r=e.Debug.checkDefined(t.program),n=r.getCompilerOptions();e.forEach(r.getSourceFiles(),(function(i){return r.isSourceFileDefaultLibrary(i)&&!e.skipTypeChecking(i,n,r)&&_(t,i.resolvedPath)}));}}function l(t,r,n,i,a,o){if(_(t,r.resolvedPath),t.allFilesExcludingDefaultLibraryFile===t.affectedFiles)return c(t),void e.BuilderState.updateShapeSignature(t,e.Debug.checkDefined(t.program),r,n,i,a);t.compilerOptions.assumeChangesOnlyAffectDirectDependencies||function(t,r,n,i,a,o){var s;if(t.exportedModulesMap&&t.changedFilesSet.has(r.resolvedPath)&&d(t,r.resolvedPath)){if(t.compilerOptions.isolatedModules){var c=new e.Map;c.set(r.resolvedPath,!0);for(var l=e.BuilderState.getReferencedByPaths(t,r.resolvedPath);l.length>0;){var _=l.pop();if(!c.has(_)){if(c.set(_,!0),p(t,_,n,i,a,o))return;if(u(t,_,n,i,a,o),d(t,_)){var g=e.Debug.checkDefined(t.program).getSourceFileByPath(_);l.push.apply(l,e.BuilderState.getReferencedByPaths(t,g.resolvedPath));}}}}var m=new e.Set;null===(s=t.exportedModulesMap.getKeys(r.resolvedPath))||void 0===s||s.forEach((function(r){if(p(t,r,n,i,a,o))return !0;var s=t.referencedMap.getKeys(r);return s&&e.forEachKey(s,(function(e){return f(t,e,m,n,i,a,o)}))}));}}(t,r,n,i,a,o);}function u(t,r,n,i,a,o){if(_(t,r),!t.changedFilesSet.has(r)){var s=e.Debug.checkDefined(t.program),c=s.getSourceFileByPath(r);c&&(e.BuilderState.updateShapeSignature(t,s,c,n,i,a,!o.disableUseFileVersionAsSignature),e.getEmitDeclarations(t.compilerOptions)&&E(t,r,0));}}function _(e,t){return !e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function d(t,r){var n=e.Debug.checkDefined(t.oldSignatures).get(r)||void 0;return e.Debug.checkDefined(t.fileInfos.get(r)).signature!==n}function p(t,r,n,i,a,o){var s;return !!(null===(s=t.fileInfos.get(r))||void 0===s?void 0:s.affectsGlobalScope)&&(e.BuilderState.getAllFilesExcludingDefaultLibraryFile(t,t.program,void 0).forEach((function(e){return u(t,e.resolvedPath,n,i,a,o)})),c(t),!0)}function f(t,r,n,i,a,o,s){var c,l;if(e.tryAddToSet(n,r)){if(p(t,r,i,a,o,s))return !0;u(t,r,i,a,o,s),null===(c=t.exportedModulesMap.getKeys(r))||void 0===c||c.forEach((function(e){return f(t,e,n,i,a,o,s)})),null===(l=t.referencedMap.getKeys(r))||void 0===l||l.forEach((function(e){return !n.has(e)&&u(t,e,i,a,o,s)}));}}function g(t,r,n,i,a){a?t.buildInfoEmitPending=!1:r===t.program?(t.changedFilesSet.clear(),t.programEmitComplete=!0):(t.seenAffectedFiles.add(r.resolvedPath),t.buildInfoEmitPending=!0,void 0!==n&&(t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map)).set(r.resolvedPath,n),i?t.affectedFilesPendingEmitIndex++:t.affectedFilesIndex++);}function m(e,t,r){return g(e,r),{result:t,affected:r}}function y(e,t,r,n,i,a){return g(e,r,n,i,a),{result:t,affected:r}}function v(t,r,n){return e.concatenate(function(t,r,n){var i=r.resolvedPath;if(t.semanticDiagnosticsPerFile){var a=t.semanticDiagnosticsPerFile.get(i);if(a)return e.filterSemanticDiagnostics(a,t.compilerOptions)}var o=e.Debug.checkDefined(t.program).getBindAndCheckDiagnostics(r,n);return t.semanticDiagnosticsPerFile&&t.semanticDiagnosticsPerFile.set(i,o),e.filterSemanticDiagnostics(o,t.compilerOptions)}(t,r,n),e.Debug.checkDefined(t.program).getProgramDiagnostics(r))}function h(t){return !!e.outFile(t.options||{})}function b(e,t,r){if(e)if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function x(t,r){return e.Debug.assert(!!t.length),t.map((function(e){var t=D(e,r);t.reportsUnnecessary=e.reportsUnnecessary,t.reportDeprecated=e.reportsDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var n=e.relatedInformation;return t.relatedInformation=n?n.length?n.map((function(e){return D(e,r)})):[]:void 0,t}))}function D(e,t){var r=e.file;return i$1(i$1({},e),{file:r?t(r.resolvedPath):void 0})}function S(e,t){return void 0!==(null==t?void 0:t.sourceMapUrlPos)?e.substring(0,t.sourceMapUrlPos):e}function T(t,r,n,i,a){var o,s;return r=S(r,a),(null===(o=null==a?void 0:a.diagnostics)||void 0===o?void 0:o.length)&&(r+=a.diagnostics.map((function(r){return "".concat(function(r){return r.file.resolvedPath===t.resolvedPath?"(".concat(r.start,",").concat(r.length,")"):(void 0===s&&(s=e.getDirectoryPath(t.resolvedPath)),"".concat(e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(s,r.file.resolvedPath,i)),"(").concat(r.start,",").concat(r.length,")"))}(r)).concat(e.DiagnosticCategory[r.category]).concat(r.code,": ").concat(c(r.messageText))})).join("\n")),(null!=n?n:e.generateDjb2Hash)(r);function c(t){return e.isString(t)?t:void 0===t?"":t.next?t.messageText+t.next.map(c).join("\n"):t.messageText}}function C(t,r,n){return (null!=r?r:e.generateDjb2Hash)(S(t,n))}function E(t,r,n){t.affectedFilesPendingEmit||(t.affectedFilesPendingEmit=[]),t.affectedFilesPendingEmitKind||(t.affectedFilesPendingEmitKind=new e.Map);var i=t.affectedFilesPendingEmitKind.get(r);t.affectedFilesPendingEmit.push(r),t.affectedFilesPendingEmitKind.set(r,i||n),void 0===t.affectedFilesPendingEmitIndex&&(t.affectedFilesPendingEmitIndex=0);}function k(t){return e.isString(t)?{version:t,signature:t,affectsGlobalScope:void 0,impliedFormat:void 0}:e.isString(t.signature)?t:{version:t.version,signature:!1===t.signature?void 0:t.version,affectsGlobalScope:t.affectsGlobalScope,impliedFormat:t.impliedFormat}}function N(t,r){return {getState:e.notImplemented,saveEmitState:e.noop,restoreEmitState:e.noop,getProgram:n,getProgramOrUndefined:function(){return t().program},releaseProgram:function(){return t().program=void 0},getCompilerOptions:function(){return t().compilerOptions},getSourceFile:function(e){return n().getSourceFile(e)},getSourceFiles:function(){return n().getSourceFiles()},getOptionsDiagnostics:function(e){return n().getOptionsDiagnostics(e)},getGlobalDiagnostics:function(e){return n().getGlobalDiagnostics(e)},getConfigFileParsingDiagnostics:function(){return r},getSyntacticDiagnostics:function(e,t){return n().getSyntacticDiagnostics(e,t)},getDeclarationDiagnostics:function(e,t){return n().getDeclarationDiagnostics(e,t)},getSemanticDiagnostics:function(e,t){return n().getSemanticDiagnostics(e,t)},emit:function(e,t,r,i,a){return n().emit(e,t,r,i,a)},emitBuildInfo:function(e,t){return n().emitBuildInfo(e,t)},getAllDependencies:e.notImplemented,getCurrentDirectory:function(){return n().getCurrentDirectory()},close:e.noop};function n(){return e.Debug.checkDefined(t().program)}}(r=e.BuilderFileEmit||(e.BuilderFileEmit={}))[r.DtsOnly=0]="DtsOnly",r[r.Full=1]="Full",e.isProgramBundleEmitBuildInfo=h,function(e){e[e.SemanticDiagnosticsBuilderProgram=0]="SemanticDiagnosticsBuilderProgram",e[e.EmitAndSemanticDiagnosticsBuilderProgram=1]="EmitAndSemanticDiagnosticsBuilderProgram";}(t=e.BuilderProgramKind||(e.BuilderProgramKind={})),e.getBuilderCreationParameters=function(t,r,n,i,a,o){var s,c,l;return void 0===t?(e.Debug.assert(void 0===r),s=n,l=i,e.Debug.assert(!!l),c=l.getProgram()):e.isArray(t)?(l=i,c=e.createProgram({rootNames:t,options:r,host:n,oldProgram:l&&l.getProgramOrUndefined(),configFileParsingDiagnostics:a,projectReferences:o}),s=n):(c=t,s=r,l=n,a=i),{host:s,newProgram:c,oldProgram:l,configFileParsingDiagnostics:a||e.emptyArray}},e.computeSignatureWithDiagnostics=T,e.computeSignature=C,e.createBuilderProgram=function(r,i){var c=i.newProgram,l=i.host,u=i.oldProgram,_=i.configFileParsingDiagnostics,d=u&&u.getState();if(d&&c===d.program&&_===c.getConfigFileParsingDiagnostics())return c=void 0,d=void 0,u;var p=e.createGetCanonicalFileName(l.useCaseSensitiveFileNames()),f=e.maybeBind(l,l.createHash),h=function(t,r,i,a){var o,s,c=e.BuilderState.create(t,r,i,a);c.program=t;var l=t.getCompilerOptions();c.compilerOptions=l;var u=e.outFile(l);u?l.composite&&(null==i?void 0:i.outSignature)&&u===e.outFile(null==i?void 0:i.compilerOptions)&&(c.outSignature=null==i?void 0:i.outSignature):c.semanticDiagnosticsPerFile=new e.Map,c.changedFilesSet=new e.Set,c.latestChangedDtsFile=l.composite?null==i?void 0:i.latestChangedDtsFile:void 0;var _=e.BuilderState.canReuseOldState(c.referencedMap,i),d=_?i.compilerOptions:void 0,p=_&&i.semanticDiagnosticsPerFile&&!!c.semanticDiagnosticsPerFile&&!e.compilerOptionsAffectSemanticDiagnostics(l,d),f=l.composite&&(null==i?void 0:i.emitSignatures)&&!u&&!e.compilerOptionsAffectDeclarationPath(l,i.compilerOptions);_&&(null===(o=i.changedFilesSet)||void 0===o||o.forEach((function(e){return c.changedFilesSet.add(e)})),!u&&i.affectedFilesPendingEmit&&(c.affectedFilesPendingEmit=i.affectedFilesPendingEmit.slice(),c.affectedFilesPendingEmitKind=i.affectedFilesPendingEmitKind&&new e.Map(i.affectedFilesPendingEmitKind),c.affectedFilesPendingEmitIndex=i.affectedFilesPendingEmitIndex,c.seenAffectedFiles=new e.Set));var g=c.referencedMap,m=_?i.referencedMap:void 0,y=p&&!l.skipLibCheck==!d.skipLibCheck,v=y&&!l.skipDefaultLibCheck==!d.skipDefaultLibCheck;return c.fileInfos.forEach((function(a,o){var s,l,u,d;if(!_||!(s=i.fileInfos.get(o))||s.version!==a.version||s.impliedFormat!==a.impliedFormat||(u=l=g&&g.getValues(o))!==(d=m&&m.getValues(o))&&(void 0===u||void 0===d||u.size!==d.size||e.forEachKey(u,(function(e){return !d.has(e)})))||l&&e.forEachKey(l,(function(e){return !c.fileInfos.has(e)&&i.fileInfos.has(e)})))c.changedFilesSet.add(o);else if(p){var h=t.getSourceFileByPath(o);if(h.isDeclarationFile&&!y)return;if(h.hasNoDefaultLib&&!v)return;var b=i.semanticDiagnosticsPerFile.get(o);b&&(c.semanticDiagnosticsPerFile.set(o,i.hasReusableDiagnostic?function(t,r,i){if(!t.length)return e.emptyArray;var a=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(r.getCompilerOptions()),r.getCurrentDirectory()));return t.map((function(e){var t=n(e,r,o);t.reportsUnnecessary=e.reportsUnnecessary,t.reportsDeprecated=e.reportDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var i=e.relatedInformation;return t.relatedInformation=i?i.length?i.map((function(e){return n(e,r,o)})):[]:void 0,t}));function o(t){return e.toPath(t,a,i)}}(b,t,r):b),c.semanticDiagnosticsFromOldState||(c.semanticDiagnosticsFromOldState=new e.Set),c.semanticDiagnosticsFromOldState.add(o));}if(f){var x=i.emitSignatures.get(o);x&&(c.emitSignatures||(c.emitSignatures=new e.Map)).set(o,x);}})),_&&e.forEachEntry(i.fileInfos,(function(e,t){return e.affectsGlobalScope&&!c.fileInfos.has(t)}))?e.BuilderState.getAllFilesExcludingDefaultLibraryFile(c,t,void 0).forEach((function(e){return c.changedFilesSet.add(e.resolvedPath)})):d&&!u&&e.compilerOptionsAffectEmit(l,d)&&(t.getSourceFiles().forEach((function(e){return E(c,e.resolvedPath,1)})),e.Debug.assert(!c.seenAffectedFiles||!c.seenAffectedFiles.size),c.seenAffectedFiles=c.seenAffectedFiles||new e.Set),c.buildInfoEmitPending=!_||c.changedFilesSet.size!==((null===(s=i.changedFilesSet)||void 0===s?void 0:s.size)||0),c}(c,p,d,l.disableUseFileVersionAsSignature);c.getProgramBuildInfo=function(){return function(t,r){var n=e.outFile(t.compilerOptions);if(!n||t.compilerOptions.composite){var i=e.Debug.checkDefined(t.program).getCurrentDirectory(),a=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(t.compilerOptions),i)),o=t.latestChangedDtsFile?w(t.latestChangedDtsFile):void 0;if(n){var s=[],c=[];return t.program.getRootFileNames().forEach((function(e){var r=t.program.getSourceFile(e);r&&(s.push(I(r.resolvedPath)),c.push(r.version));})),{fileNames:s,fileInfos:c,options:L(t.compilerOptions,"affectsBundleEmitBuildInfo"),outSignature:t.outSignature,latestChangedDtsFile:o}}var l,u,_,d,p,f,g,m,y=[],v=new e.Map,h=e.arrayFrom(t.fileInfos.entries(),(function(r){var n,i,a=r[0],o=r[1],s=O(a);e.Debug.assert(y[s-1]===I(a));var c=null===(n=t.oldSignatures)||void 0===n?void 0:n.get(a),l=void 0!==c?c||void 0:o.signature;if(t.compilerOptions.composite){var u=t.program.getSourceFileByPath(a);if(!e.isJsonSourceFile(u)&&e.sourceFileMayBeEmitted(u,t.program)){var d=null===(i=t.emitSignatures)||void 0===i?void 0:i.get(a);d!==l&&(_||(_=[])).push(void 0===d?s:[s,d]);}}return o.version===l?o.affectsGlobalScope||o.impliedFormat?{version:o.version,signature:void 0,affectsGlobalScope:o.affectsGlobalScope,impliedFormat:o.impliedFormat}:o.version:void 0!==l?void 0===c?o:{version:o.version,signature:l,affectsGlobalScope:o.affectsGlobalScope,impliedFormat:o.impliedFormat}:{version:o.version,signature:!1,affectsGlobalScope:o.affectsGlobalScope,impliedFormat:o.impliedFormat}}));if(t.referencedMap&&(d=e.arrayFrom(t.referencedMap.keys()).sort(e.compareStringsCaseSensitive).map((function(e){return [O(e),M(t.referencedMap.getValues(e))]}))),t.exportedModulesMap&&(p=e.mapDefined(e.arrayFrom(t.exportedModulesMap.keys()).sort(e.compareStringsCaseSensitive),(function(e){var r,n=null===(r=t.oldExportedModulesMap)||void 0===r?void 0:r.get(e);return void 0===n?[O(e),M(t.exportedModulesMap.getValues(e))]:n?[O(e),M(n)]:void 0}))),t.semanticDiagnosticsPerFile)for(var D=0,S=e.arrayFrom(t.semanticDiagnosticsPerFile.keys()).sort(e.compareStringsCaseSensitive);D<S.length;D++){var T=S[D],C=t.semanticDiagnosticsPerFile.get(T);(f||(f=[])).push(C.length?[O(T),x(C,I)]:O(T));}if(t.affectedFilesPendingEmit)for(var E=new e.Set,k=0,N=t.affectedFilesPendingEmit.slice(t.affectedFilesPendingEmitIndex).sort(e.compareStringsCaseSensitive);k<N.length;k++){var A=N[k];e.tryAddToSet(E,A)&&(g||(g=[])).push([O(A),t.affectedFilesPendingEmitKind.get(A)]);}if(t.changedFilesSet.size)for(var F=0,P=e.arrayFrom(t.changedFilesSet.keys()).sort(e.compareStringsCaseSensitive);F<P.length;F++)A=P[F],(m||(m=[])).push(O(A));return {fileNames:y,fileInfos:h,options:L(t.compilerOptions,"affectsMultiFileEmitBuildInfo"),fileIdsList:l,referencedMap:d,exportedModulesMap:p,semanticDiagnosticsPerFile:f,affectedFilesPendingEmit:g,changeFileSet:m,emitSignatures:_,latestChangedDtsFile:o}}function w(t){return I(e.getNormalizedAbsolutePath(t,i))}function I(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(a,t,r))}function O(e){var t=v.get(e);return void 0===t&&(y.push(I(e)),v.set(e,t=y.length)),t}function M(t){var r=e.arrayFrom(t.keys(),O).sort(e.compareValues),n=r.join(),i=null==u?void 0:u.get(n);return void 0===i&&((l||(l=[])).push(r),(u||(u=new e.Map)).set(n,i=l.length)),i}function L(t,r){for(var n,i=e.getOptionsNameMap().optionsNameMap,a=0,o=e.getOwnKeys(t).sort(e.compareStringsCaseSensitive);a<o.length;a++){var s=o[a],c=i.get(s.toLowerCase());(null==c?void 0:c[r])&&((n||(n={}))[s]=b(c,t[s],w));}return n}}(h,p)},c=void 0,u=void 0,d=void 0;var D=function(){return h},S=N(D,_);return S.getState=D,S.saveEmitState=function(){return function(t){var r=e.outFile(t.compilerOptions);return e.Debug.assert(!t.changedFilesSet.size||r),{affectedFilesPendingEmit:t.affectedFilesPendingEmit&&t.affectedFilesPendingEmit.slice(),affectedFilesPendingEmitKind:t.affectedFilesPendingEmitKind&&new e.Map(t.affectedFilesPendingEmitKind),affectedFilesPendingEmitIndex:t.affectedFilesPendingEmitIndex,seenEmittedFiles:t.seenEmittedFiles&&new e.Map(t.seenEmittedFiles),programEmitComplete:t.programEmitComplete,emitSignatures:t.emitSignatures&&new e.Map(t.emitSignatures),outSignature:t.outSignature,latestChangedDtsFile:t.latestChangedDtsFile,hasChangedEmitSignature:t.hasChangedEmitSignature,changedFilesSet:r?new e.Set(t.changedFilesSet):void 0}}(h)},S.restoreEmitState=function(e){return function(e,t){e.affectedFilesPendingEmit=t.affectedFilesPendingEmit,e.affectedFilesPendingEmitKind=t.affectedFilesPendingEmitKind,e.affectedFilesPendingEmitIndex=t.affectedFilesPendingEmitIndex,e.seenEmittedFiles=t.seenEmittedFiles,e.programEmitComplete=t.programEmitComplete,e.emitSignatures=t.emitSignatures,e.outSignature=t.outSignature,e.latestChangedDtsFile=t.latestChangedDtsFile,e.hasChangedEmitSignature=t.hasChangedEmitSignature,t.changedFilesSet&&(e.changedFilesSet=t.changedFilesSet);}(h,e)},S.hasChangedEmitSignature=function(){return !!h.hasChangedEmitSignature},S.getAllDependencies=function(t){return e.BuilderState.getAllDependencies(h,e.Debug.checkDefined(h.program),t)},S.getSemanticDiagnostics=function(t,r){a(h,t);var n,i=e.Debug.checkDefined(h.program).getCompilerOptions();if(e.outFile(i))return e.Debug.assert(!h.semanticDiagnosticsPerFile),e.Debug.checkDefined(h.program).getSemanticDiagnostics(t,r);if(t)return v(h,t,r);for(;F(r););for(var o=0,s=e.Debug.checkDefined(h.program).getSourceFiles();o<s.length;o++){var c=s[o];n=e.addRange(n,v(h,c,r));}return n||e.emptyArray},S.emit=function(n,i,o,c,u){var _;r===t.EmitAndSemanticDiagnosticsBuilderProgram&&a(h,n);var d=e.handleNoEmitOptions(S,n,i,o);if(d)return d;if(!n){if(r===t.EmitAndSemanticDiagnosticsBuilderProgram){for(var p=[],f=!1,g=void 0,m=[],y=void 0;y=k(i,o,c,u);)f=f||y.result.emitSkipped,g=e.addRange(g,y.result.diagnostics),m=e.addRange(m,y.result.emittedFiles),p=e.addRange(p,y.result.sourceMaps);return {emitSkipped:f,diagnostics:g||e.emptyArray,emittedFiles:m,sourceMaps:p}}(null===(_=h.affectedFilesPendingEmitKind)||void 0===_?void 0:_.size)&&(e.Debug.assert(r===t.SemanticDiagnosticsBuilderProgram),c&&!e.every(h.affectedFilesPendingEmit,(function(e,t){return t<h.affectedFilesPendingEmitIndex||0===h.affectedFilesPendingEmitKind.get(e)}))||s(h));}return e.Debug.checkDefined(h.program).emit(n,e.getEmitDeclarations(h.compilerOptions)?A(i,u):i||e.maybeBind(l,l.writeFile),o,c,u)},S.releaseProgram=function(){return function(t){e.BuilderState.releaseCache(t),t.program=void 0;}(h)},r===t.SemanticDiagnosticsBuilderProgram?S.getSemanticDiagnosticsOfNextAffectedFile=F:r===t.EmitAndSemanticDiagnosticsBuilderProgram?(S.getSemanticDiagnosticsOfNextAffectedFile=F,S.emitNextAffectedFile=k,S.emitBuildInfo=function(t,r){if(h.buildInfoEmitPending){var n=e.Debug.checkDefined(h.program).emitBuildInfo(t||e.maybeBind(l,l.writeFile),r);return h.buildInfoEmitPending=!1,n}return e.emitSkippedWithNoDiagnostics}):e.notImplemented(),S;function k(t,r,n,i){var a=o(h,r,f,p,l),c=1,u=!1;if(!a)if(e.outFile(h.compilerOptions)){var _=e.Debug.checkDefined(h.program);if(h.programEmitComplete)return;a=_;}else {var d=function(t){var r=t.affectedFilesPendingEmit;if(r){for(var n=t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map),i=t.affectedFilesPendingEmitIndex;i<r.length;i++){var a=e.Debug.checkDefined(t.program).getSourceFileByPath(r[i]);if(a){var o=n.get(a.resolvedPath),c=e.Debug.checkDefined(e.Debug.checkDefined(t.affectedFilesPendingEmitKind).get(a.resolvedPath));if(void 0===o||o<c)return t.affectedFilesPendingEmitIndex=i,{affectedFile:a,emitKind:c}}}s(t);}}(h);if(!d){if(!h.buildInfoEmitPending)return;var g=e.Debug.checkDefined(h.program);return y(h,g.emitBuildInfo(t||e.maybeBind(l,l.writeFile),r),g,1,!1,!0)}a=d.affectedFile,c=d.emitKind,u=!0;}return y(h,e.Debug.checkDefined(h.program).emit(a===h.program?void 0:a,e.getEmitDeclarations(h.compilerOptions)?A(t,i):t||e.maybeBind(l,l.writeFile),r,n||0===c,i),a,c,u)}function A(t,r){return function(n,i,a,o,s,c){var u,_,d,g,m,y,v;if(e.isDeclarationFileName(n))if(e.outFile(h.compilerOptions)){if(h.compilerOptions.composite){var b=C(i,f,c);if(b===h.outSignature)return;h.outSignature=b,h.hasChangedEmitSignature=!0,h.latestChangedDtsFile=n;}}else {e.Debug.assert(1===(null==s?void 0:s.length));var x=void 0;if(!r){var D=s[0],S=h.fileInfos.get(D.resolvedPath);if(S.signature===D.version){var E=T(D,i,f,p,c);(null===(u=null==c?void 0:c.diagnostics)||void 0===u?void 0:u.length)||(x=E),E!==D.version&&(l.storeFilesChangingSignatureDuringEmit&&(null!==(_=h.filesChangingSignature)&&void 0!==_?_:h.filesChangingSignature=new e.Set).add(D.resolvedPath),h.exportedModulesMap&&e.BuilderState.updateExportedModules(h,D,D.exportedModulesFromDeclarationEmit),h.affectedFiles?(void 0===(null===(d=h.oldSignatures)||void 0===d?void 0:d.get(D.resolvedPath))&&(null!==(g=h.oldSignatures)&&void 0!==g?g:h.oldSignatures=new e.Map).set(D.resolvedPath,S.signature||!1),S.signature=E):(S.signature=E,null===(m=h.oldExportedModulesMap)||void 0===m||m.clear()));}}if(h.compilerOptions.composite){var k=s[0].resolvedPath,N=null===(y=h.emitSignatures)||void 0===y?void 0:y.get(k);if(null!=x||(x=C(i,f,c)),x===N)return;(null!==(v=h.emitSignatures)&&void 0!==v?v:h.emitSignatures=new e.Map).set(k,x),h.hasChangedEmitSignature=!0,h.latestChangedDtsFile=n;}}t?t(n,i,a,o,s,c):l.writeFile?l.writeFile(n,i,a,o,s,c):h.program.writeFile(n,i,a,o,s,c);}}function F(e,n){for(;;){var i=o(h,e,f,p,l);if(!i)return;if(i===h.program)return m(h,h.program.getSemanticDiagnostics(void 0,e),i);if((r===t.EmitAndSemanticDiagnosticsBuilderProgram||h.compilerOptions.noEmit||h.compilerOptions.noEmitOnError)&&E(h,i.resolvedPath,1),!n||!n(i))return m(h,v(h,i,e),i);g(h,i);}}},e.toBuilderStateFileInfo=k,e.createBuilderProgramUsingProgramBuildInfo=function(t,r,n){var i,a,o,s,c,l,u,_=e.getDirectoryPath(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory())),d=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames()),p=t.latestChangedDtsFile?m(t.latestChangedDtsFile):void 0;if(h(t))c={fileInfos:new e.Map,compilerOptions:t.options?e.convertToOptionsWithAbsolutePaths(t.options,m):{},latestChangedDtsFile:p,outSignature:t.outSignature};else {l=null===(i=t.fileNames)||void 0===i?void 0:i.map((function(t){return e.toPath(t,_,d)})),u=null===(a=t.fileIdsList)||void 0===a?void 0:a.map((function(t){return new e.Set(t.map(y))}));var f=new e.Map,g=(null===(o=t.options)||void 0===o?void 0:o.composite)&&!e.outFile(t.options)?new e.Map:void 0;t.fileInfos.forEach((function(e,t){var r=y(t+1),n=k(e);f.set(r,n),g&&n.signature&&g.set(r,n.signature);})),null===(s=t.emitSignatures)||void 0===s||s.forEach((function(t){e.isNumber(t)?g.delete(y(t)):g.set(y(t[0]),t[1]);})),c={fileInfos:f,compilerOptions:t.options?e.convertToOptionsWithAbsolutePaths(t.options,m):{},referencedMap:v(t.referencedMap),exportedModulesMap:v(t.exportedModulesMap),semanticDiagnosticsPerFile:t.semanticDiagnosticsPerFile&&e.arrayToMap(t.semanticDiagnosticsPerFile,(function(t){return y(e.isNumber(t)?t:t[0])}),(function(t){return e.isNumber(t)?e.emptyArray:t[1]})),hasReusableDiagnostic:!0,affectedFilesPendingEmit:e.map(t.affectedFilesPendingEmit,(function(e){return y(e[0])})),affectedFilesPendingEmitKind:t.affectedFilesPendingEmit&&e.arrayToMap(t.affectedFilesPendingEmit,(function(e){return y(e[0])}),(function(e){return e[1]})),affectedFilesPendingEmitIndex:t.affectedFilesPendingEmit&&0,changedFilesSet:new e.Set(e.map(t.changeFileSet,y)),latestChangedDtsFile:p,emitSignatures:(null==g?void 0:g.size)?g:void 0};}return {getState:function(){return c},saveEmitState:e.noop,restoreEmitState:e.noop,getProgram:e.notImplemented,getProgramOrUndefined:e.returnUndefined,releaseProgram:e.noop,getCompilerOptions:function(){return c.compilerOptions},getSourceFile:e.notImplemented,getSourceFiles:e.notImplemented,getOptionsDiagnostics:e.notImplemented,getGlobalDiagnostics:e.notImplemented,getConfigFileParsingDiagnostics:e.notImplemented,getSyntacticDiagnostics:e.notImplemented,getDeclarationDiagnostics:e.notImplemented,getSemanticDiagnostics:e.notImplemented,emit:e.notImplemented,getAllDependencies:e.notImplemented,getCurrentDirectory:e.notImplemented,emitNextAffectedFile:e.notImplemented,getSemanticDiagnosticsOfNextAffectedFile:e.notImplemented,emitBuildInfo:e.notImplemented,close:e.noop,hasChangedEmitSignature:e.returnFalse};function m(t){return e.getNormalizedAbsolutePath(t,_)}function y(e){return l[e-1]}function v(t){if(t){var r=e.BuilderState.createManyToManyPathMap();return t.forEach((function(e){var t=e[0],n=e[1];return r.set(y(t),u[n-1])})),r}}},e.getBuildInfoFileVersionMap=function(t,r,n){var i=e.getDirectoryPath(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory())),a=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames()),o=new e.Map;return t.fileInfos.forEach((function(r,n){var s=e.toPath(t.fileNames[n],i,a),c=e.isString(r)?r:r.version;o.set(s,c);})),o},e.createRedirectedBuilderProgram=N;}(t),function(e){e.createSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.SemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createEmitAndSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createAbstractBuilder=function(t,r,n,i,a,o){var s=e.getBuilderCreationParameters(t,r,n,i,a,o),c=s.newProgram,l=s.configFileParsingDiagnostics;return e.createRedirectedBuilderProgram((function(){return {program:c,compilerOptions:c.getCompilerOptions()}}),l)};}(t),function(e){function t(t){return e.endsWith(t,"/node_modules/.staging")?e.removeSuffix(t,"/.staging"):e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))?void 0:t}function r(t){var r=e.getRootLength(t);if(t.length===r)return !1;var n=t.indexOf(e.directorySeparator,r);if(-1===n)return !1;var i=t.substring(r,n+1),a=r>1||47!==t.charCodeAt(0);if(a&&0!==t.search(/[a-zA-Z]:/)&&0===i.search(/[a-zA-Z]\$\//)){if(-1===(n=t.indexOf(e.directorySeparator,n+1)))return !1;i=t.substring(r+i.length,n+1);}if(a&&0!==i.search(/users\//i))return !0;for(var o=n+1,s=2;s>0;s--)if(0===(o=t.indexOf(e.directorySeparator,o)+1))return !1;return !0}function n(e){var t,r;return !(!(null===(t=e.resolvedModule)||void 0===t?void 0:t.originalPath)&&!(null===(r=e.resolvedTypeReferenceDirective)||void 0===r?void 0:r.originalPath))}e.removeIgnoredPath=t,e.canWatchDirectoryOrFile=r,e.createResolutionCache=function(i,a,o){var s,c,l,u,_,d,p,f,g=e.createMultiMap(),m=[],y=[],v=e.createMultiMap(),h=new e.Map,b=!1,x=e.memoize((function(){return i.getCurrentDirectory()})),D=i.getCachedDirectoryStructureHost(),S=new e.Map,T=e.createCacheWithRedirects(),C=e.createCacheWithRedirects(),E=e.createModuleResolutionCache(x(),i.getCanonicalFileName,void 0,T,C),k=new e.Map,N=e.createCacheWithRedirects(),A=e.createTypeReferenceDirectiveResolutionCache(x(),i.getCanonicalFileName,void 0,E.getPackageJsonInfoCache(),N),F=[".ts",".tsx",".js",".jsx",".json"],P=new e.Map,w=new e.Map,I=new e.Map,O=a&&e.removeTrailingDirectorySeparator(e.getNormalizedAbsolutePath(a,x())),M=O&&i.toPath(O),L=void 0!==M?M.split(e.directorySeparator).length:0,R=new e.Map;return {getModuleResolutionCache:function(){return E},startRecordingFilesWithChangedResolutions:function(){s=[];},finishRecordingFilesWithChangedResolutions:function(){var e=s;return s=void 0,e},startCachingPerDirectoryResolution:function(){E.clearAllExceptPackageJsonInfoCache(),A.clearAllExceptPackageJsonInfoCache(),g.forEach($),g.clear();},finishCachingPerDirectoryResolution:function(t,r){l=void 0,g.forEach($),g.clear(),t!==r&&(null==t||t.getSourceFiles().forEach((function(t){for(var r,n,i,a=e.isExternalOrCommonJsModule(t)&&null!==(n=null===(r=t.packageJsonLocations)||void 0===r?void 0:r.length)&&void 0!==n?n:0,o=null!==(i=h.get(t.path))&&void 0!==i?i:e.emptyArray,s=o.length;s<a;s++)Z(t.packageJsonLocations[s],!1);if(o.length>a)for(s=a;s<o.length;s++)I.get(o[s]).files--;a?h.set(t.path,t.packageJsonLocations):h.delete(t.path);})),h.forEach((function(e,r){(null==t?void 0:t.getSourceFileByPath(r))||(e.forEach((function(e){return I.get(e).files--})),h.delete(r));}))),w.forEach((function(e,t){0===e.refCount&&(w.delete(t),e.watcher.close());})),I.forEach((function(e,t){0===e.files&&0===e.resolutions&&(I.delete(t),e.watcher.close());})),b=!1;},resolveModuleNames:function(t,r,n,i,a){return V({names:t,containingFile:r,redirectedReference:i,cache:S,perDirectoryCacheWithRedirects:T,loader:U,getResolutionWithResolvedFileName:B,shouldRetryResolution:function(t){return !t.resolvedModule||!e.resolutionExtensionIsTSOrJson(t.resolvedModule.extension)},reusedNames:n,logChanges:o,containingSourceFile:a})},getResolvedModuleWithFailedLookupLocationsFromCache:function(e,t,r){var n=S.get(i.toPath(t));return n?n.get(e,r):void 0},resolveTypeReferenceDirectives:function(e,t,r,n){return V({names:e,containingFile:t,redirectedReference:r,cache:k,perDirectoryCacheWithRedirects:N,loader:K,getResolutionWithResolvedFileName:j,shouldRetryResolution:function(e){return void 0===e.resolvedTypeReferenceDirective},containingSourceFileMode:n})},removeResolutionsFromProjectReferenceRedirects:function(t){if(e.fileExtensionIs(t,".json")){var r=i.getCurrentProgram();if(r){var n=r.getResolvedProjectReferenceByPath(t);n&&n.commandLine.fileNames.forEach((function(e){return ae(i.toPath(e))}));}}},removeResolutionsOfFile:ae,hasChangedAutomaticTypeDirectiveNames:function(){return b},invalidateResolutionOfFile:function(t){ae(t);var r=b;oe(v.get(t),e.returnTrue)&&b&&!r&&i.onChangedAutomaticTypeDirectiveNames();},invalidateResolutionsOfFailedLookupLocations:ce,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(t){e.Debug.assert(l===t||void 0===l),l=t;},createHasInvalidatedResolutions:function(e){ce();var t=c;return c=void 0,function(r){return e(r)||!!(null==t?void 0:t.has(r))||z(r)}},isFileWithInvalidatedNonRelativeUnresolvedImports:z,updateTypeRootsWatch:function(){var t=i.getCompilationSettings();if(t.types)de();else {var r=e.getEffectiveTypeRoots(t,{directoryExists:fe,getCurrentDirectory:x});r?e.mutateMap(R,e.arrayToMap(r,(function(e){return i.toPath(e)})),{createNewValue:pe,onDeleteValue:e.closeFileWatcher}):de();}},closeTypeRootsWatch:de,clear:function(){e.clearMap(w,e.closeFileWatcherOf),e.clearMap(I,e.closeFileWatcherOf),P.clear(),g.clear(),de(),S.clear(),k.clear(),v.clear(),m.length=0,y.length=0,d=void 0,p=void 0,f=void 0,_=void 0,u=void 0,E.clear(),A.clear(),h.clear(),b=!1;}};function B(e){return e.resolvedModule}function j(e){return e.resolvedTypeReferenceDirective}function J(t,r){return !(void 0===t||r.length<=t.length)&&e.startsWith(r,t)&&r[t.length]===e.directorySeparator}function z(e){if(!l)return !1;var t=l.get(e);return !!t&&!!t.length}function U(t,r,n,a,o,s,c){var l,u,_=e.resolveModuleName(t,r,n,a,E,o,c);if(!i.getGlobalCache)return _;var d=i.getGlobalCache();if(!(void 0===d||e.isExternalModuleNameRelative(t)||_.resolvedModule&&e.extensionIsTS(_.resolvedModule.extension))){var p=e.loadModuleFromGlobalCache(e.Debug.checkDefined(i.globalCacheResolutionModuleName)(t),i.projectName,n,a,d,E),f=p.resolvedModule,g=p.failedLookupLocations,m=p.affectingLocations;if(f)return _.resolvedModule=f,(l=_.failedLookupLocations).push.apply(l,g),(u=_.affectingLocations).push.apply(u,m),_}return _}function K(t,r,n,i,a,o,s){return e.resolveTypeReferenceDirective(t,r,n,i,a,A,s)}function V(t){var r,a,o,c=t.names,l=t.containingFile,u=t.redirectedReference,_=t.cache,d=t.perDirectoryCacheWithRedirects,p=t.loader,f=t.getResolutionWithResolvedFileName,g=t.shouldRetryResolution,m=t.reusedNames,y=t.logChanges,v=t.containingSourceFile,h=t.containingSourceFileMode,b=i.toPath(l),x=_.get(b)||_.set(b,e.createModeAwareCache()).get(b),D=e.getDirectoryPath(b),S=d.getOrCreateMapOfCacheRedirects(u),T=S.get(D);T||(T=e.createModeAwareCache(),S.set(D,T));for(var C=[],E=i.getCompilationSettings(),k=y&&z(b),N=i.getCurrentProgram(),A=N&&N.getResolvedProjectReferenceToRedirect(l),F=A?!u||u.sourceFile.path!==A.sourceFile.path:!!u,P=e.createModeAwareCache(),w=0,I=0,O=c;I<O.length;I++){var M=O[I],L=e.isString(M)?M:M.fileName.toLowerCase(),R=e.isString(M)?v?e.getModeForResolutionAtIndex(v,w):void 0:e.getModeForFileReference(M,h);w++;var B=x.get(L,R);if(!P.has(L,R)&&F||!B||B.isInvalidated||k&&!e.isExternalModuleNameRelative(L)&&g(B)){var j=B,J=T.get(L,R);if(J){B=J;var K=(null===(r=i.getCompilerHost)||void 0===r?void 0:r.call(i))||i;if(e.isTraceEnabled(E,K)){var V=f(B);e.trace(K,p===U?(null==V?void 0:V.resolvedFileName)?V.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:(null==V?void 0:V.resolvedFileName)?V.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved,L,l,e.getDirectoryPath(l),null==V?void 0:V.resolvedFileName,(null==V?void 0:V.packagetId)&&e.packageIdToString(V.packagetId));}}else B=p(L,l,E,(null===(a=i.getCompilerHost)||void 0===a?void 0:a.call(i))||i,u,v,R),T.set(L,R,B),i.onDiscoveredSymlink&&n(B)&&i.onDiscoveredSymlink();x.set(L,R,B),Q(L,B,b,f),j&&te(j,b,f),y&&s&&!q(j,B)&&(s.push(b),y=!1);}else K=(null===(o=i.getCompilerHost)||void 0===o?void 0:o.call(i))||i,e.isTraceEnabled(E,K)&&!P.has(L,R)&&(V=f(B),e.trace(K,p===U?(null==V?void 0:V.resolvedFileName)?V.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:(null==V?void 0:V.resolvedFileName)?V.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,L,l,null==V?void 0:V.resolvedFileName,(null==V?void 0:V.packagetId)&&e.packageIdToString(V.packagetId)));e.Debug.assert(void 0!==B&&!B.isInvalidated),P.set(L,R,!0),C.push(f(B));}return x.forEach((function(t,r,n){P.has(r,n)||e.contains(m,r)||(te(t,b,f),x.delete(r,n));})),C;function q(e,t){if(e===t)return !0;if(!e||!t)return !1;var r=f(e),n=f(t);return r===n||!(!r||!n)&&r.resolvedFileName===n.resolvedFileName}}function q(t){return e.endsWith(t,"/node_modules/@types")}function W(t,r){if(J(M,r)){t=e.isRootedDiskPath(t)?e.normalizePath(t):e.getNormalizedAbsolutePath(t,x());var n=r.split(e.directorySeparator),i=t.split(e.directorySeparator);return e.Debug.assert(i.length===n.length,"FailedLookup: ".concat(t," failedLookupLocationPath: ").concat(r)),n.length>L+1?{dir:i.slice(0,L+1).join(e.directorySeparator),dirPath:n.slice(0,L+1).join(e.directorySeparator)}:{dir:O,dirPath:M,nonRecursive:!1}}return H(e.getDirectoryPath(e.getNormalizedAbsolutePath(t,x())),e.getDirectoryPath(r))}function H(t,n){for(;e.pathContainsNodeModules(n);)t=e.getDirectoryPath(t),n=e.getDirectoryPath(n);if(e.isNodeModulesDirectory(n))return r(e.getDirectoryPath(n))?{dir:t,dirPath:n}:void 0;var i,a,o=!0;if(void 0!==M)for(;!J(n,M);){var s=e.getDirectoryPath(n);if(s===n)break;o=!1,i=n,a=t,n=s,t=e.getDirectoryPath(t);}return r(n)?{dir:a||t,dirPath:i||n,nonRecursive:o}:void 0}function G(t){return e.fileExtensionIsOneOf(t,F)}function Q(t,r,n,a){if(r.refCount)r.refCount++,e.Debug.assertIsDefined(r.files);else {r.refCount=1,e.Debug.assert(0===e.length(r.files)),e.isExternalModuleNameRelative(t)?X(r):g.add(t,r);var o=a(r);o&&o.resolvedFileName&&v.add(i.toPath(o.resolvedFileName),r);}(r.files||(r.files=[])).push(n);}function X(t){e.Debug.assert(!!t.refCount);var r=t.failedLookupLocations,n=t.affectingLocations;if(r.length||n.length){r.length&&m.push(t);for(var a=!1,o=0,s=r;o<s.length;o++){var c=s[o],l=i.toPath(c),u=W(c,l);if(u){var _=u.dir,d=u.dirPath,p=u.nonRecursive;if(!G(l)){var f=P.get(l)||0;P.set(l,f+1);}d===M?(e.Debug.assert(!p),a=!0):ee(_,d,p);}}a&&ee(O,M,!0),Y(t,!r.length);}}function Y(t,r){e.Debug.assert(!!t.refCount);var n=t.affectingLocations;if(n.length){r&&y.push(t);for(var i=0,a=n;i<a.length;i++)Z(a[i],!0);}}function Z(t,n){var a=I.get(t);if(a)n?a.resolutions++:a.files++;else {var o=t;if(i.realpath&&t!==(o=i.realpath(t))){var s=I.get(o);if(s)return n?s.resolutions++:s.files++,s.paths.add(t),void I.set(t,s)}var c=new e.Set;c.add(o);var l=r(i.toPath(o))?i.watchAffectingFileLocation(o,(function(t,r){null==D||D.addOrDeleteFile(t,i.toPath(o),r);var n=E.getPackageJsonInfoCache().getInternalMap();c.forEach((function(t){d.resolutions&&(null!=_?_:_=new e.Set).add(t),d.files&&(null!=u?u:u=new e.Set).add(t),null==n||n.delete(i.toPath(t));})),i.scheduleInvalidateResolutionsOfFailedLookupLocations();})):e.noopFileWatcher,d={watcher:l!==e.noopFileWatcher?{close:function(){l.close(),l=e.noopFileWatcher;}}:l,resolutions:n?1:0,files:n?0:1,paths:c};I.set(o,d),t!==o&&(I.set(t,d),c.add(t));}}function $(e,t){var r=i.getCurrentProgram();r&&r.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(t)?e.forEach((function(e){return Y(e,!0)})):e.forEach(X);}function ee(t,r,n){var i=w.get(r);i?(e.Debug.assert(!!n==!!i.nonRecursive),i.refCount++):w.set(r,{watcher:ne(t,r,n),refCount:1,nonRecursive:n});}function te(t,r,n){if(e.unorderedRemoveItem(e.Debug.checkDefined(t.files),r),t.refCount--,!t.refCount){var a=n(t);a&&a.resolvedFileName&&v.remove(i.toPath(a.resolvedFileName),t);var o=t.failedLookupLocations,s=t.affectingLocations;if(e.unorderedRemoveItem(m,t)){for(var c=!1,l=0,u=o;l<u.length;l++){var _=u[l],d=i.toPath(_),p=W(_,d);if(p){var f=p.dirPath,g=P.get(d);g&&(1===g?P.delete(d):(e.Debug.assert(g>1),P.set(d,g-1))),f===M?c=!0:re(f);}}c&&re(M);}else s.length&&e.unorderedRemoveItem(y,t);for(var h=0,b=s;h<b.length;h++){var x=b[h];I.get(x).resolutions--;}}}function re(e){w.get(e).refCount--;}function ne(e,t,r){return i.watchDirectoryOfFailedLookupLocation(e,(function(e){var r=i.toPath(e);D&&D.addOrDeleteFileOrDirectory(e,r),se(r,t===r);}),r?0:1)}function ie(e,t,r){var n=e.get(t);n&&(n.forEach((function(e){return te(e,t,r)})),e.delete(t));}function ae(e){ie(S,e,B),ie(k,e,j);}function oe(t,r){if(!t)return !1;for(var n=!1,i=0,a=t;i<a.length;i++){var o=a[i];if(!o.isInvalidated&&r(o)){o.isInvalidated=n=!0;for(var s=0,l=e.Debug.checkDefined(o.files);s<l.length;s++){var u=l[s];(null!=c?c:c=new e.Set).add(u),b=b||e.endsWith(u,e.inferredTypesContainingFile);}}}return n}function se(r,n){if(n)(f||(f=new e.Set)).add(r);else {var a=t(r);if(!a)return !1;if(r=a,i.fileIsOpen(r))return !1;var o=e.getDirectoryPath(r);if(q(r)||e.isNodeModulesDirectory(r)||q(o)||e.isNodeModulesDirectory(o))(d||(d=new e.Set)).add(r),(p||(p=new e.Set)).add(r);else {if(!G(r)&&!P.has(r))return !1;if(e.isEmittedFileOfProgram(i.getCurrentProgram(),r))return !1;(d||(d=new e.Set)).add(r);var s=e.parseNodeModuleFromPath(r);s&&(p||(p=new e.Set)).add(s);}}i.scheduleInvalidateResolutionsOfFailedLookupLocations();}function ce(){var t,r=!1;if(u&&(null===(t=i.getCurrentProgram())||void 0===t||t.getSourceFiles().forEach((function(t){e.some(t.packageJsonLocations,(function(e){return u.has(e)}))&&((null!=c?c:c=new e.Set).add(t.path),r=!0);})),u=void 0),!(d||p||f||_))return r;r=oe(m,le)||r;var n=E.getPackageJsonInfoCache().getInternalMap();return n&&(d||p||f)&&n.forEach((function(e,t){return ue(t)?n.delete(t):void 0})),d=void 0,p=void 0,f=void 0,r=oe(y,_e)||r,_=void 0,r}function le(e){return !!_e(e)||!!(d||p||f)&&e.failedLookupLocations.some((function(e){return ue(i.toPath(e))}))}function ue(t){return (null==d?void 0:d.has(t))||e.firstDefinedIterator((null==p?void 0:p.keys())||e.emptyIterator,(function(r){return !!e.startsWith(t,r)||void 0}))||e.firstDefinedIterator((null==f?void 0:f.keys())||e.emptyIterator,(function(e){return !!J(e,t)||void 0}))}function _e(e){return !!_&&e.affectingLocations.some((function(e){return _.has(e)}))}function de(){e.clearMap(R,e.closeFileWatcher);}function pe(e,t){return i.watchTypeRootsDirectory(t,(function(r){var n=i.toPath(r);D&&D.addOrDeleteFileOrDirectory(r,n),b=!0,i.onChangedAutomaticTypeDirectiveNames();var a=function(e,t){if(J(M,t))return M;var r=H(e,t);return r&&w.has(r.dirPath)?r.dirPath:void 0}(t,e);a&&se(n,a===n);}),1)}function fe(t){var n=e.getDirectoryPath(e.getDirectoryPath(t)),a=i.toPath(n);return a===M||r(a)}};}(t),function(e){!function(t){var r,a,o;function s(t,r,n,i){var a=r.importModuleSpecifierPreference,o=r.importModuleSpecifierEnding;return {relativePreference:"relative"===a?0:"non-relative"===a?1:"project-relative"===a?3:2,ending:function(){switch(o){case"minimal":return 0;case"index":return 1;case"js":return 2;default:return function(t){var r=t.imports;return e.firstDefined(r,(function(t){var r=t.text;return e.pathIsRelative(r)?e.hasJSFileExtension(r):void 0}))||!1}(i)||c(n,i.path,t)?2:e.getEmitModuleResolutionKind(n)!==e.ModuleResolutionKind.NodeJs?1:0}}()}}function c(t,r,n){var i;return (e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext)&&e.getImpliedNodeFormatForFile(r,null===(i=n.getPackageJsonInfoCache)||void 0===i?void 0:i.call(n),function(t){var r;return {fileExists:t.fileExists,readFile:e.Debug.checkDefined(t.readFile),directoryExists:t.directoryExists,getCurrentDirectory:t.getCurrentDirectory,realpath:t.realpath,useCaseSensitiveFileNames:null===(r=t.useCaseSensitiveFileNames)||void 0===r?void 0:r.call(t)}}(n),t)!==e.ModuleKind.CommonJS}function l(t,r,n,i,a,o,s,c){void 0===c&&(c={});var l=d(n,a),u=v(n,i,a,s,c);return e.firstDefined(u,(function(e){return S(e,l,r,a,t,s,void 0,c.overrideImportMode)}))||p(i,l,t,a,c.overrideImportMode||r.impliedNodeFormat,o)}function u(t,r,n,i,a){var o;void 0===a&&(a={});var s=e.getSourceFileOfModule(t);if(!s)return e.emptyArray;var c=null===(o=n.getModuleSpecifierCache)||void 0===o?void 0:o.call(n),l=null==c?void 0:c.get(r.path,s.path,i,a);return [null==l?void 0:l.moduleSpecifiers,s,null==l?void 0:l.modulePaths,c]}function _(t,r,n,i,a,o,c){void 0===c&&(c={});var l=!1,_=function(t,r){var n,i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isNonGlobalAmbientModule(t)&&(!e.isExternalModuleAugmentation(t)||!e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name)))}));if(i)return i.name.text;var a=e.mapDefined(t.declarations,(function(t){var n,i,a,o;if(e.isModuleDeclaration(t)){var s=function(e){for(;4&e.flags;)e=e.parent;return e}(t);if((null===(n=null==s?void 0:s.parent)||void 0===n?void 0:n.parent)&&e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)&&e.isSourceFile(s.parent.parent.parent)){var c=null===(o=null===(a=null===(i=s.parent.parent.symbol.exports)||void 0===i?void 0:i.get("export="))||void 0===a?void 0:a.valueDeclaration)||void 0===o?void 0:o.expression;if(c){var l=r.getSymbolAtLocation(c);if(l&&(2097152&(null==l?void 0:l.flags)?r.getAliasedSymbol(l):l)===t.symbol)return s.parent.parent}}}})),o=a[0];return o?o.name.text:void 0}(t,r);if(_)return {moduleSpecifiers:[_],computedWithoutCache:l};var f=u(t,i,a,o,c),g=f[0],m=f[1],y=f[2],v=f[3];if(g)return {moduleSpecifiers:g,computedWithoutCache:l};if(!m)return {moduleSpecifiers:e.emptyArray,computedWithoutCache:l};l=!0,y||(y=h(i.path,m.originalFileName,a));var b=function(t,r,n,i,a,o){void 0===o&&(o={});var c=d(n.path,i),l=s(i,a,r,n),u=e.forEach(t,(function(t){return e.forEach(i.getFileIncludeReasons().get(e.toPath(t.path,i.getCurrentDirectory(),c.getCanonicalFileName)),(function(t){if(t.kind===e.FileIncludeKind.Import&&t.file===n.path&&(!n.impliedNodeFormat||n.impliedNodeFormat===e.getModeForResolutionAtIndex(n,t.index))){var r=e.getModuleNameStringLiteralAt(n,t.index).text;return 1===l.relativePreference&&e.pathIsRelative(r)?void 0:r}}))}));if(u)return [u];for(var _,f,g,m=e.some(t,(function(e){return e.isInNodeModules})),y=0,v=t;y<v.length;y++){var h=v[y],b=S(h,c,n,i,r,a,void 0,o.overrideImportMode);if(_=e.append(_,b),b&&h.isRedirect)return _;if(!b&&!h.isRedirect){var x=p(h.path,c,r,i,o.overrideImportMode||n.impliedNodeFormat,l);e.pathIsBareSpecifier(x)?f=e.append(f,x):m&&!h.isInNodeModules||(g=e.append(g,x));}}return (null==f?void 0:f.length)?f:(null==_?void 0:_.length)?_:e.Debug.checkDefined(g)}(y,n,i,a,o,c);return null==v||v.set(i.path,m.path,o,c,y,b),{moduleSpecifiers:b,computedWithoutCache:l}}function d(t,r){return {getCanonicalFileName:e.createGetCanonicalFileName(!r.useCaseSensitiveFileNames||r.useCaseSensitiveFileNames()),importingSourceFileName:t,sourceDirectory:e.getDirectoryPath(t)}}function p(t,r,n,i,a,o){var s=o.ending,c=o.relativePreference,l=n.baseUrl,u=n.paths,_=n.rootDirs,d=r.sourceDirectory,p=r.getCanonicalFileName,g=_&&function(t,r,n,i,a,o){var s=T(r,t,i);if(void 0!==s){var c=T(n,t,i),l=e.flatMap(c,(function(t){return e.map(s,(function(r){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(t,r,i))}))})),u=e.min(l,e.compareNumberOfDirectorySeparators);if(u)return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeJs?C(u,a,o):e.removeFileExtension(u)}}(_,t,d,p,s,n)||C(e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(d,t,p)),s,n);if(!l&&!u||0===c)return g;var y=N(t,e.getNormalizedAbsolutePath(e.getPathsBasePath(n,i)||l,i.getCurrentDirectory()),p);if(!y)return g;var v=u&&x(y,u,b(s,n,a),i,n),h=void 0===v&&void 0!==l?C(y,s,n):v;if(!h)return g;if(1===c)return h;if(3===c){var D=n.configFilePath?e.toPath(e.getDirectoryPath(n.configFilePath),i.getCurrentDirectory(),r.getCanonicalFileName):r.getCanonicalFileName(i.getCurrentDirectory()),S=e.toPath(t,D,p),E=e.startsWith(d,D),k=e.startsWith(S,D);if(E&&!k||!E&&k)return h;var F=m(i,e.getDirectoryPath(S));return m(i,d)!==F?h:g}return 2!==c&&e.Debug.assertNever(c),A(h)||f(g)<f(h)?g:h}function f(t){for(var r=0,n=e.startsWith(t,"./")?2:0;n<t.length;n++)47===t.charCodeAt(n)&&r++;return r}function g(t,r){return e.compareBooleans(r.isRedirect,t.isRedirect)||e.compareNumberOfDirectorySeparators(t.path,r.path)}function m(t,r){return t.getNearestAncestorDirectoryWithPackageJson?t.getNearestAncestorDirectoryWithPackageJson(r):!!e.forEachAncestorDirectory(r,(function(r){return !!t.fileExists(e.combinePaths(r,"package.json"))||void 0}))}function y(t,r,i,a,o){var s,c=e.hostGetCanonicalFileName(i),l=i.getCurrentDirectory(),u=i.isSourceOfProjectReferenceRedirect(r)?i.getProjectReferenceRedirect(r):void 0,_=e.toPath(r,l,c),d=i.redirectTargetsMap.get(_)||e.emptyArray,p=n$4(n$4(n$4([],u?[u]:e.emptyArray,!0),[r],!1),d,!0).map((function(t){return e.getNormalizedAbsolutePath(t,l)})),f=!e.every(p,e.containsIgnoredPath);if(!a){var g=e.forEach(p,(function(t){return !(f&&e.containsIgnoredPath(t))&&o(t,u===t)}));if(g)return g}var m=null===(s=i.getSymlinkCache)||void 0===s?void 0:s.call(i).getSymlinkedDirectoriesByRealpath(),y=e.getNormalizedAbsolutePath(r,l);return m&&e.forEachAncestorDirectory(e.getDirectoryPath(y),(function(r){var n=m.get(e.ensureTrailingDirectorySeparator(e.toPath(r,l,c)));if(n)return !e.startsWithDirectory(t,r,c)&&e.forEach(p,(function(t){if(e.startsWithDirectory(t,r,c))for(var i=e.getRelativePathFromDirectory(r,t,c),a=0,s=n;a<s.length;a++){var l=s[a],_=e.resolvePath(l,i),d=o(_,t===u);if(f=!0,d)return d}}))}))||(a?e.forEach(p,(function(t){return f&&e.containsIgnoredPath(t)?void 0:o(t,t===u)})):void 0)}function v(t,r,n,i,a){var o;void 0===a&&(a={});var s=e.toPath(r,n.getCurrentDirectory(),e.hostGetCanonicalFileName(n)),c=null===(o=n.getModuleSpecifierCache)||void 0===o?void 0:o.call(n);if(c){var l=c.get(t,s,i,a);if(null==l?void 0:l.modulePaths)return l.modulePaths}var u=h(t,r,n);return c&&c.setModulePaths(t,s,i,a,u),u}function h(t,r,n){var i=e.hostGetCanonicalFileName(n),a=new e.Map,o=!1;y(t,r,n,!0,(function(t,r){var n=e.pathContainsNodeModules(t);a.set(t,{path:i(t),isRedirect:r,isInNodeModules:n}),o=o||n;}));for(var s,c=[],l=function(t){var r,n=e.ensureTrailingDirectorySeparator(t);a.forEach((function(t,i){var o=t.path,s=t.isRedirect,c=t.isInNodeModules;e.startsWith(o,n)&&((r||(r=[])).push({path:i,isRedirect:s,isInNodeModules:c}),a.delete(i));})),r&&(r.length>1&&r.sort(g),c.push.apply(c,r));var i=e.getDirectoryPath(t);if(i===t)return s=t,"break";s=t=i;},u=e.getDirectoryPath(t);0!==a.size;){var _=l(u);if(u=s,"break"===_)break}if(a.size){var d=e.arrayFrom(a.values());d.length>1&&d.sort(g),c.push.apply(c,d);}return c}function b(t,r,n){if(e.getEmitModuleResolutionKind(r)>=e.ModuleResolutionKind.Node16&&n===e.ModuleKind.ESNext)return [2];switch(t){case 2:return [2,0,1];case 1:return [1,0,2];case 0:return [0,1,2];default:e.Debug.assertNever(t);}}function x(t,r,n,i,a){for(var o in r)for(var s=function(r){var i=e.normalizePath(r),s=i.indexOf("*"),c=n.map((function(e){return {ending:e,value:C(t,e,a)}}));if(e.tryGetExtensionFromPath(i)&&c.push({ending:void 0,value:t}),-1!==s)for(var l=i.substring(0,s),u=i.substring(s+1),d=0,p=c;d<p.length;d++){var f=p[d],g=f.ending,m=f.value;if(m.length>=l.length+u.length&&e.startsWith(m,l)&&e.endsWith(m,u)&&_({ending:g,value:m})){var y=m.substring(l.length,m.length-u.length);return {value:o.replace("*",y)}}}else if(e.some(c,(function(e){return 0!==e.ending&&i===e.value}))||e.some(c,(function(e){return 0===e.ending&&i===e.value&&_(e)})))return {value:o}},c=0,l=r[o];c<l.length;c++){var u=s(l[c]);if("object"==typeof u)return u.value}function _(e){var r=e.ending,n=e.value;return 0!==r||n===C(t,r,a,i)}}function D(t,r,n,i,a,o,s){if(void 0===s&&(s=0),"string"==typeof a){var c=e.getNormalizedAbsolutePath(e.combinePaths(n,a),void 0),l=e.hasTSFileExtension(r)?e.removeFileExtension(r)+k(r,t):void 0;switch(s){case 0:if(0===e.comparePaths(r,c)||l&&0===e.comparePaths(l,c))return {moduleFileToTry:i};break;case 1:if(e.containsPath(c,r)){var u=e.getRelativePathFromDirectory(c,r,!1);return {moduleFileToTry:e.getNormalizedAbsolutePath(e.combinePaths(e.combinePaths(i,a),u),void 0)}}break;case 2:var _=c.indexOf("*"),d=c.slice(0,_),p=c.slice(_+1);if(e.startsWith(r,d)&&e.endsWith(r,p)){var f=r.slice(d.length,r.length-p.length);return {moduleFileToTry:i.replace("*",f)}}if(l&&e.startsWith(l,d)&&e.endsWith(l,p))return f=l.slice(d.length,l.length-p.length),{moduleFileToTry:i.replace("*",f)}}}else {if(Array.isArray(a))return e.forEach(a,(function(e){return D(t,r,n,i,e,o)}));if("object"==typeof a&&null!==a){if(e.allKeysStartWithDot(a))return e.forEach(e.getOwnKeys(a),(function(s){var c=e.getNormalizedAbsolutePath(e.combinePaths(i,s),void 0),l=e.endsWith(s,"/")?1:e.stringContains(s,"*")?2:0;return D(t,r,n,c,a[s],o,l)}));for(var g=0,m=e.getOwnKeys(a);g<m.length;g++){var y=m[g];if("default"===y||o.indexOf(y)>=0||e.isApplicableVersionedTypesKey(o,y)){var v=a[y],h=D(t,r,n,i,v,o);if(h)return h}}}}}function S(t,r,n,a,o,c,l,u){var _=t.path,d=t.isRedirect,p=r.getCanonicalFileName,f=r.sourceDirectory;if(a.fileExists&&a.readFile){var g=e.getNodeModulePathParts(_);if(g){var m=s(a,c,o,n),y=_,v=!1;if(!l)for(var h=g.packageRootIndex,S=void 0;;){var T=M(h),E=T.moduleFileToTry,N=T.packageRootPath,A=T.blockedByExports,F=T.verbatimFromExports;if(e.getEmitModuleResolutionKind(o)!==e.ModuleResolutionKind.Classic){if(A)return;if(F)return E}if(N){y=N,v=!0;break}if(S||(S=E),-1===(h=_.indexOf(e.directorySeparator,h+1))){y=C(S,m.ending,o,a);break}}if(!d||v){var P=a.getGlobalTypingsCacheLocation&&a.getGlobalTypingsCacheLocation(),w=p(y.substring(0,g.topLevelNodeModulesIndex));if(e.startsWith(f,w)||P&&e.startsWith(p(P),w)){var I=y.substring(g.topLevelPackageNameIndex+1),O=e.getPackageNameFromTypesPackageName(I);return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Classic&&O===I?void 0:O}}}}function M(t){var r,s,c=_.substring(0,t),l=e.combinePaths(c,"package.json"),d=_,f=!1,y=null===(s=null===(r=a.getPackageJsonInfoCache)||void 0===r?void 0:r.call(a))||void 0===s?void 0:s.getPackageJsonInfo(l);if("object"==typeof y||void 0===y&&a.fileExists(l)){var v=(null==y?void 0:y.contents.packageJsonContent)||JSON.parse(a.readFile(l)),h=u||n.impliedNodeFormat;if(e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeNext){var S=["node",h===e.ModuleKind.ESNext?"import":"require","types"],T=v.exports&&"string"==typeof v.name?D(o,_,c,e.getPackageNameFromTypesPackageName(v.name),v.exports,S):void 0;if(T){var C=e.hasTSFileExtension(T.moduleFileToTry)?{moduleFileToTry:e.removeFileExtension(T.moduleFileToTry)+k(T.moduleFileToTry,o)}:T;return i$1(i$1({},C),{verbatimFromExports:!0})}if(v.exports)return {moduleFileToTry:_,blockedByExports:!0}}var E=v.typesVersions?e.getPackageJsonTypesVersionsPaths(v.typesVersions):void 0;if(E){var N=x(_.slice(c.length+1),E.paths,b(m.ending,o,h),a,o);void 0===N?f=!0:d=e.combinePaths(c,N);}var A=v.typings||v.types||v.main||"index.js";if(e.isString(A)&&(!f||!e.matchPatternOrExact(e.tryParsePatterns(E.paths),A))){var F=e.toPath(A,c,p);if(e.removeFileExtension(F)===e.removeFileExtension(p(d)))return {packageRootPath:c,moduleFileToTry:d}}}else {var P=p(d.substring(g.packageRootIndex+1));if("index.d.ts"===P||"index.js"===P||"index.ts"===P||"index.tsx"===P)return {moduleFileToTry:d,packageRootPath:c}}return {moduleFileToTry:d}}}function T(t,r,n){return e.mapDefined(r,(function(e){var r=N(t,e,n);return void 0!==r&&A(r)?void 0:r}))}function C(t,r,n,i){if(e.fileExtensionIsOneOf(t,[".json",".mjs",".cjs"]))return t;var a=e.removeFileExtension(t);if(t===a)return t;if(e.fileExtensionIsOneOf(t,[".d.mts",".mts",".d.cts",".cts"]))return a+E(t,n);switch(r){case 0:var o=e.removeSuffix(a,"/index");return i&&o!==a&&function(t,r){if(t.fileExists)for(var n=0,i=e.flatten(e.getSupportedExtensions({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));n<i.length;n++){var a=r+i[n];if(t.fileExists(a))return a}}(i,o)?a:o;case 1:return a;case 2:return a+E(t,n);default:return e.Debug.assertNever(r)}}function E(t,r){var n;return null!==(n=k(t,r))&&void 0!==n?n:e.Debug.fail("Extension ".concat(e.extensionFromPath(t)," is unsupported:: FileName:: ").concat(t))}function k(t,r){var n=e.tryGetExtensionFromPath(t);switch(n){case".ts":case".d.ts":return ".js";case".tsx":return 1===r.jsx?".jsx":".js";case".js":case".jsx":case".json":return n;case".d.mts":case".mts":case".mjs":return ".mjs";case".d.cts":case".cts":case".cjs":return ".cjs";default:return}}function N(t,r,n){var i=e.getRelativePathToDirectoryOrUrl(r,t,r,n,!1);return e.isRootedDiskPath(i)?void 0:i}function A(t){return e.startsWith(t,"..")}!function(e){e[e.Relative=0]="Relative",e[e.NonRelative=1]="NonRelative",e[e.Shortest=2]="Shortest",e[e.ExternalNonRelative=3]="ExternalNonRelative";}(r||(r={})),function(e){e[e.Minimal=0]="Minimal",e[e.Index=1]="Index",e[e.JsExtension=2]="JsExtension";}(a||(a={})),t.updateModuleSpecifier=function(t,r,n,i,a,o,s){void 0===s&&(s={});var u=l(t,r,n,i,a,function(t,r,n,i){return {relativePreference:e.isExternalModuleNameRelative(r)?0:1,ending:e.hasJSFileExtension(r)||c(t,n,i)?2:e.getEmitModuleResolutionKind(t)!==e.ModuleResolutionKind.NodeJs||e.endsWith(r,"index")?1:0}}(t,o,n,a),{},s);if(u!==o)return u},t.getModuleSpecifier=function(e,t,r,n,i,a){return void 0===a&&(a={}),l(e,t,r,n,i,s(i,{},e,t),{},a)},t.getNodeModulesPackageName=function(t,r,n,i,a,o){void 0===o&&(o={});var s=d(r.path,i),c=v(r.path,n,i,a,o);return e.firstDefined(c,(function(e){return S(e,s,r,i,t,a,!0,o.overrideImportMode)}))},t.tryGetModuleSpecifiersFromCache=function(e,t,r,n,i){return void 0===i&&(i={}),u(e,t,r,n,i)[0]},t.getModuleSpecifiers=function(e,t,r,n,i,a,o){return void 0===o&&(o={}),_(e,t,r,n,i,a,o).moduleSpecifiers},t.getModuleSpecifiersWithCacheInfo=_,t.countPathComponents=f,t.forEachFileNameOfModule=y,function(e){e[e.Exact=0]="Exact",e[e.Directory=1]="Directory",e[e.Pattern=2]="Pattern";}(o||(o={})),t.tryGetJSExtensionForFile=k;}(e.moduleSpecifiers||(e.moduleSpecifiers={}));}(t),function(e){var t=e.sys?{getCurrentDirectory:function(){return e.sys.getCurrentDirectory()},getNewLine:function(){return e.sys.newLine},getCanonicalFileName:e.createGetCanonicalFileName(e.sys.useCaseSensitiveFileNames)}:void 0;function r(r,n){var i=r===e.sys&&t?t:{getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.newLine},getCanonicalFileName:e.createGetCanonicalFileName(r.useCaseSensitiveFileNames)};if(!n)return function(t){return r.write(e.formatDiagnostic(t,i))};var a=new Array(1);return function(t){a[0]=t,r.write(e.formatDiagnosticsWithColorAndContext(a,i)+i.getNewLine()),a[0]=void 0;}}function i(t,r,n){return !(!t.clearScreen||n.preserveWatchOutput||n.extendedDiagnostics||n.diagnostics||!e.contains(e.screenStartingMessageCodes,r.code)||(t.clearScreen(),0))}function a(e){return e.now?e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}):(new Date).toLocaleTimeString()}function o(t,r){return r?function(r,n,o){i(t,r,o);var s="[".concat(e.formatColorAndReset(a(t),e.ForegroundColorEscapeSequences.Grey),"] ");s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(n+n),t.write(s);}:function(r,n,o){var s="";i(t,r,o)||(s+=n),s+="".concat(a(t)," - "),s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(function(t,r){return e.contains(e.screenStartingMessageCodes,t.code)?r+r:r}(r,n)),t.write(s);}}function s(t){return e.countWhere(t,(function(t){return t.category===e.DiagnosticCategory.Error}))}function c(t){return e.filter(t,(function(t){return t.category===e.DiagnosticCategory.Error})).map((function(e){if(void 0!==e.file)return "".concat(e.file.fileName)})).map((function(r){var n=e.find(t,(function(e){return void 0!==e.file&&e.file.fileName===r}));if(void 0!==n){var i=e.getLineAndCharacterOfPosition(n.file,n.start).line;return {fileName:r,line:i+1}}}))}function l(t){return 1===t?e.Diagnostics.Found_1_error_Watching_for_file_changes:e.Diagnostics.Found_0_errors_Watching_for_file_changes}function u(t,r){var n=e.formatColorAndReset(":"+t.line,e.ForegroundColorEscapeSequences.Grey);return e.pathIsAbsolute(t.fileName)&&e.pathIsAbsolute(r)?e.getRelativePathFromDirectory(r,t.fileName,!1)+n:t.fileName+n}function _(t,r,n,i){if(0===t)return "";var a=r.filter((function(e){return void 0!==e})),o=a.map((function(e){return "".concat(e.fileName,":").concat(e.line)})).filter((function(e,t,r){return r.indexOf(e)===t})),s=a[0]&&u(a[0],i.getCurrentDirectory()),c=1===t?e.createCompilerDiagnostic(void 0!==r[0]?e.Diagnostics.Found_1_error_in_1:e.Diagnostics.Found_1_error,t,s):e.createCompilerDiagnostic(0===o.length?e.Diagnostics.Found_0_errors:1===o.length?e.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1:e.Diagnostics.Found_0_errors_in_1_files,t,1===o.length?s:o.length),l=o.length>1?function(t,r){var n=t.filter((function(e,t,r){return t===r.findIndex((function(t){return (null==t?void 0:t.fileName)===(null==e?void 0:e.fileName)}))}));if(0===n.length)return "";var i=function(e){return Math.log(e)*Math.LOG10E+1},a=n.map((function(r){return [r,e.countWhere(t,(function(e){return e.fileName===r.fileName}))]})),o=a.reduce((function(e,t){return Math.max(e,t[1]||0)}),0),s=e.Diagnostics.Errors_Files.message,c=s.split(" ")[0].length,l=Math.max(c,i(o)),_=Math.max(i(o)-c,0),d="";return d+=" ".repeat(_)+s+"\n",a.forEach((function(e){var t=e[0],n=e[1],i=Math.log(n)*Math.LOG10E+1|0,a=i<l?" ".repeat(l-i):"",o=u(t,r.getCurrentDirectory());d+="".concat(a).concat(n,"  ").concat(o,"\n");})),d}(a,i):"";return "".concat(n).concat(e.flattenDiagnosticMessageText(c.messageText,n)).concat(n).concat(n).concat(l)}function d(e){return !!e.getState}function p(t,r){var n=t.getCompilerOptions();n.explainFiles?f(d(t)?t.getProgram():t,r):(n.listFiles||n.listFilesOnly)&&e.forEach(t.getSourceFiles(),(function(e){r(e.fileName);}));}function f(t,r){for(var n,i,a=t.getFileIncludeReasons(),o=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),s=function(r){return e.convertToRelativePath(r,t.getCurrentDirectory(),o)},c=0,l=t.getSourceFiles();c<l.length;c++){var u=l[c];r("".concat(h(u,s))),null===(n=a.get(u.path))||void 0===n||n.forEach((function(e){return r("  ".concat(v(t,e,s).messageText))})),null===(i=g(u,s))||void 0===i||i.forEach((function(e){return r("  ".concat(e.messageText))}));}}function g(t,r){var n,i;if(t.path!==t.resolvedPath&&(null!=i?i:i=[]).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_is_output_of_project_reference_source_0,h(t.originalFileName,r))),t.redirectInfo&&(null!=i?i:i=[]).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_redirects_to_file_0,h(t.redirectInfo.redirectTarget,r))),e.isExternalOrCommonJsModule(t))switch(t.impliedNodeFormat){case e.ModuleKind.ESNext:t.packageJsonScope&&(null!=i?i:i=[]).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,h(e.last(t.packageJsonLocations),r)));break;case e.ModuleKind.CommonJS:t.packageJsonScope?(null!=i?i:i=[]).push(e.chainDiagnosticMessages(void 0,t.packageJsonScope.contents.packageJsonContent.type?e.Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:e.Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type,h(e.last(t.packageJsonLocations),r))):(null===(n=t.packageJsonLocations)||void 0===n?void 0:n.length)&&(null!=i?i:i=[]).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_is_CommonJS_module_because_package_json_was_not_found));}return i}function m(t,r){var n,i=t.getCompilerOptions().configFile;if(null===(n=null==i?void 0:i.configFileSpecs)||void 0===n?void 0:n.validatedFilesSpec){var a=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),o=a(r),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(i.fileName,t.getCurrentDirectory()));return e.find(i.configFileSpecs.validatedFilesSpec,(function(t){return a(e.getNormalizedAbsolutePath(t,s))===o}))}}function y(t,r){var n,i,a=t.getCompilerOptions().configFile;if(null===(n=null==a?void 0:a.configFileSpecs)||void 0===n?void 0:n.validatedIncludeSpecs){if(a.configFileSpecs.isDefaultIncludeSpec)return !0;var o=e.fileExtensionIs(r,".json"),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(a.fileName,t.getCurrentDirectory())),c=t.useCaseSensitiveFileNames();return e.find(null===(i=null==a?void 0:a.configFileSpecs)||void 0===i?void 0:i.validatedIncludeSpecs,(function(t){if(o&&!e.endsWith(t,".json"))return !1;var n=e.getPatternFromSpec(t,s,"files");return !!n&&e.getRegexFromPattern("(".concat(n,")$"),c).test(r)}))}}function v(t,r,n){var i,a,o=t.getCompilerOptions();if(e.isReferencedFile(r)){var s=e.getReferencedFileLocation((function(e){return t.getSourceFileByPath(e)}),r),c=e.isReferenceFileLocation(s)?s.file.text.substring(s.pos,s.end):'"'.concat(s.text,'"'),l=void 0;switch(e.Debug.assert(e.isReferenceFileLocation(s)||r.kind===e.FileIncludeKind.Import,"Only synthetic references are imports"),r.kind){case e.FileIncludeKind.Import:l=e.isReferenceFileLocation(s)?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2:e.Diagnostics.Imported_via_0_from_file_1:s.text===e.externalHelpersModuleNameText?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:e.Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:e.Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;break;case e.FileIncludeKind.ReferenceFile:e.Debug.assert(!s.packageId),l=e.Diagnostics.Referenced_via_0_from_file_1;break;case e.FileIncludeKind.TypeReferenceDirective:l=s.packageId?e.Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2:e.Diagnostics.Type_library_referenced_via_0_from_file_1;break;case e.FileIncludeKind.LibReferenceDirective:e.Debug.assert(!s.packageId),l=e.Diagnostics.Library_referenced_via_0_from_file_1;break;default:e.Debug.assertNever(r);}return e.chainDiagnosticMessages(void 0,l,c,h(s.file,n),s.packageId&&e.packageIdToString(s.packageId))}switch(r.kind){case e.FileIncludeKind.RootFile:if(!(null===(i=o.configFile)||void 0===i?void 0:i.configFileSpecs))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Root_file_specified_for_compilation);var u=e.getNormalizedAbsolutePath(t.getRootFileNames()[r.index],t.getCurrentDirectory());if(m(t,u))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Part_of_files_list_in_tsconfig_json);var _=y(t,u);return e.isString(_)?e.chainDiagnosticMessages(void 0,e.Diagnostics.Matched_by_include_pattern_0_in_1,_,h(o.configFile,n)):e.chainDiagnosticMessages(void 0,_?e.Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:e.Diagnostics.Root_file_specified_for_compilation);case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var d=r.kind===e.FileIncludeKind.OutputFromProjectReference,p=e.Debug.checkDefined(null===(a=t.getResolvedProjectReferences())||void 0===a?void 0:a[r.index]);return e.chainDiagnosticMessages(void 0,e.outFile(o)?d?e.Diagnostics.Output_from_referenced_project_0_included_because_1_specified:e.Diagnostics.Source_from_referenced_project_0_included_because_1_specified:d?e.Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none:e.Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none,h(p.sourceFile.fileName,n),o.outFile?"--outFile":"--out");case e.FileIncludeKind.AutomaticTypeDirectiveFile:return e.chainDiagnosticMessages(void 0,o.types?r.packageId?e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions:r.packageId?e.Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1:e.Diagnostics.Entry_point_for_implicit_type_library_0,r.typeReference,r.packageId&&e.packageIdToString(r.packageId));case e.FileIncludeKind.LibFile:if(void 0!==r.index)return e.chainDiagnosticMessages(void 0,e.Diagnostics.Library_0_specified_in_compilerOptions,o.lib[r.index]);var f=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(o)?r:void 0}));return e.chainDiagnosticMessages(void 0,f?e.Diagnostics.Default_library_for_target_0:e.Diagnostics.Default_library,f);default:e.Debug.assertNever(r);}}function h(t,r){var n=e.isString(t)?t:t.fileName;return r?r(n):n}function b(t,r,n,i,a,o,l,u){var _=!!t.getCompilerOptions().listFilesOnly,d=t.getConfigFileParsingDiagnostics().slice(),f=d.length;e.addRange(d,t.getSyntacticDiagnostics(void 0,o)),d.length===f&&(e.addRange(d,t.getOptionsDiagnostics(o)),_||(e.addRange(d,t.getGlobalDiagnostics(o)),d.length===f&&e.addRange(d,t.getSemanticDiagnostics(void 0,o))));var g=_?{emitSkipped:!0,diagnostics:e.emptyArray}:t.emit(void 0,a,o,l,u),m=g.emittedFiles,y=g.diagnostics;e.addRange(d,y);var v=e.sortAndDeduplicateDiagnostics(d);if(v.forEach(r),n){var h=t.getCurrentDirectory();e.forEach(m,(function(t){var r=e.getNormalizedAbsolutePath(t,h);n("TSFILE: ".concat(r));})),p(t,n);}return i&&i(s(v),c(v)),{emitResult:g,diagnostics:v}}function x(t,r,n,i,a,o,s,c){var l=b(t,r,n,i,a,o,s,c),u=l.emitResult,_=l.diagnostics;return u.emitSkipped&&_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.Success}function D(t,r){return void 0===t&&(t=e.sys),{onWatchStatusChange:r||o(t),watchFile:e.maybeBind(t,t.watchFile)||e.returnNoopFileWatcher,watchDirectory:e.maybeBind(t,t.watchDirectory)||e.returnNoopFileWatcher,setTimeout:e.maybeBind(t,t.setTimeout)||e.noop,clearTimeout:e.maybeBind(t,t.clearTimeout)||e.noop}}function S(t,r){var n=e.memoize((function(){return e.getDirectoryPath(e.normalizePath(t.getExecutingFilePath()))}));return {useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames},getNewLine:function(){return t.newLine},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),getDefaultLibLocation:n,getDefaultLibFileName:function(t){return e.combinePaths(n(),e.getDefaultLibFileName(t))},fileExists:function(e){return t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:function(e){return t.directoryExists(e)},getDirectories:function(e){return t.getDirectories(e)},readDirectory:function(e,r,n,i,a){return t.readDirectory(e,r,n,i,a)},realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable),trace:function(e){return t.write(e+t.newLine)},createDirectory:function(e){return t.createDirectory(e)},writeFile:function(e,r,n){return t.writeFile(e,r,n)},createHash:e.maybeBind(t,t.createHash),createProgram:r||e.createEmitAndSemanticDiagnosticsBuilderProgram,disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit,now:e.maybeBind(t,t.now)}}function T(t,r,n,i){void 0===t&&(t=e.sys);var a=function(e){return t.write(e+t.newLine)},o=S(t,r);return e.copyProperties(o,D(t,i)),o.afterProgramCreate=function(r){var i=r.getCompilerOptions(),s=e.getNewLineCharacter(i,(function(){return t.newLine}));b(r,n,a,(function(t){return o.onWatchStatusChange(e.createCompilerDiagnostic(l(t),t),s,i,t)}));},o}function C(t,r,n){r(n),t.exit(e.ExitStatus.DiagnosticsPresent_OutputsSkipped);}e.createDiagnosticReporter=r,e.screenStartingMessageCodes=[e.Diagnostics.Starting_compilation_in_watch_mode.code,e.Diagnostics.File_change_detected_Starting_incremental_compilation.code],e.getLocaleTimeString=a,e.createWatchStatusReporter=o,e.parseConfigFileWithSystem=function(t,r,n,i,a,o){var s=a;s.onUnRecoverableConfigFileDiagnostic=function(e){return C(a,o,e)};var c=e.getParsedCommandLineOfConfigFile(t,r,s,n,i);return s.onUnRecoverableConfigFileDiagnostic=void 0,c},e.getErrorCountForSummary=s,e.getFilesInErrorForSummary=c,e.getWatchErrorSummaryDiagnosticMessage=l,e.getErrorSummaryText=_,e.isBuilderProgram=d,e.listFiles=p,e.explainFiles=f,e.explainIfFileIsRedirectAndImpliedFormat=g,e.getMatchedFileSpec=m,e.getMatchedIncludeSpec=y,e.fileIncludeReasonToDiagnostics=v,e.emitFilesAndReportErrors=b,e.emitFilesAndReportErrorsAndGetExitStatus=x,e.noopFileWatcher={close:e.noop},e.returnNoopFileWatcher=function(){return e.noopFileWatcher},e.createWatchHost=D,e.WatchType={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",AffectingFileLocation:"File location affecting resolution",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file",ClosedScriptInfo:"Closed Script info",ConfigFileForInferredRoot:"Config file for the inferred project root",NodeModules:"node_modules for closed script infos and package.jsons affecting module specifier cache",MissingSourceMapFile:"Missing source map file",NoopConfigFileForInferredRoot:"Noop Config file for the inferred project root",MissingGeneratedFile:"Missing generated file",NodeModulesForModuleSpecifierCache:"node_modules for module specifier cache invalidation"},e.createWatchFactory=function(t,r){var n=t.trace?r.extendedDiagnostics?e.WatchLogLevel.Verbose:r.diagnostics?e.WatchLogLevel.TriggerOnly:e.WatchLogLevel.None:e.WatchLogLevel.None,i=n!==e.WatchLogLevel.None?function(e){return t.trace(e)}:e.noop,a=e.getWatchFactory(t,n,i);return a.writeLog=i,a},e.createCompilerHostFromProgramHost=function(t,r,n){void 0===n&&(n=t);var i=t.useCaseSensitiveFileNames(),a=e.memoize((function(){return t.getNewLine()})),o={getSourceFile:function(n,i,a){var s;try{e.performance.mark("beforeIORead");var c=r().charset;s=c?t.readFile(n,c):o.readFile(n),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){a&&a(e.message),s="";}return void 0!==s?e.createSourceFile(n,s,i):void 0},getDefaultLibLocation:e.maybeBind(t,t.getDefaultLibLocation),getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:function(r,n,i,a){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,n,i,(function(e,r,n){return t.writeFile(e,r,n)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){a&&a(e.message);}},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return i},getCanonicalFileName:e.createGetCanonicalFileName(i),getNewLine:function(){return e.getNewLineCharacter(r(),a)},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile(e)},trace:e.maybeBind(t,t.trace),directoryExists:e.maybeBind(n,n.directoryExists),getDirectories:e.maybeBind(n,n.getDirectories),realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable)||function(){return ""},createHash:e.maybeBind(t,t.createHash),readDirectory:e.maybeBind(t,t.readDirectory),disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit};return o},e.setGetSourceFileAsHashVersioned=function(t){var r=t.getSourceFile,i=e.maybeBind(t,t.createHash)||e.generateDjb2Hash;t.getSourceFile=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var o=r.call.apply(r,n$4([t],e,!1));return o&&(o.version=i(o.text)),o};},e.createProgramHost=S,e.createWatchCompilerHostOfConfigFile=function(e){var t=e.configFileName,n=e.optionsToExtend,i=e.watchOptionsToExtend,a=e.extraFileExtensions,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=c||r(o),_=T(o,s,u,l);return _.onUnRecoverableConfigFileDiagnostic=function(e){return C(o,u,e)},_.configFileName=t,_.optionsToExtend=n,_.watchOptionsToExtend=i,_.extraFileExtensions=a,_},e.createWatchCompilerHostOfFilesAndCompilerOptions=function(e){var t=e.rootFiles,n=e.options,i=e.watchOptions,a=e.projectReferences,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=T(o,s,c||r(o),l);return u.rootFiles=t,u.options=n,u.watchOptions=i,u.projectReferences=a,u},e.performIncrementalCompilation=function(t){var n=t.system||e.sys,i=t.host||(t.host=e.createIncrementalCompilerHost(t.options,n)),a=e.createIncrementalProgram(t),o=x(a,t.reportDiagnostic||r(n),(function(e){return i.trace&&i.trace(e)}),t.reportErrorSummary||t.options.pretty?function(e,t){return n.write(_(e,t,n.newLine,i))}:void 0);return t.afterProgramEmitAndDiagnostics&&t.afterProgramEmitAndDiagnostics(a),o};}(t),function(e){function t(t,r){var n=e.getTsBuildInfoEmitOutputFilePath(t);if(n){var i;if(r.getBuildInfo)i=r.getBuildInfo(n,t.configFilePath);else {var a=r.readFile(n);if(!a)return;i=e.getBuildInfo(n,a);}if(i&&i.version===e.version&&i.program)return e.createBuilderProgramUsingProgramBuildInfo(i.program,n,r)}}function r(t,r){void 0===r&&(r=e.sys);var n=e.createCompilerHostWorker(t,void 0,r);return n.createHash=e.maybeBind(r,r.createHash),n.disableUseFileVersionAsSignature=r.disableUseFileVersionAsSignature,n.storeFilesChangingSignatureDuringEmit=r.storeFilesChangingSignatureDuringEmit,e.setGetSourceFileAsHashVersioned(n),e.changeCompilerHostLikeToUseCache(n,(function(t){return e.toPath(t,n.getCurrentDirectory(),n.getCanonicalFileName)})),n}e.readBuilderProgram=t,e.createIncrementalCompilerHost=r,e.createIncrementalProgram=function(n){var i=n.rootNames,a=n.options,o=n.configFileParsingDiagnostics,s=n.projectReferences,c=n.host,l=n.createProgram;return c=c||r(a),(l=l||e.createEmitAndSemanticDiagnosticsBuilderProgram)(i,a,c,t(a,c),o,s)},e.createWatchCompilerHost=function(t,r,n,i,a,o,s,c){return e.isArray(t)?e.createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:t,options:r,watchOptions:c,projectReferences:s,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o}):e.createWatchCompilerHostOfConfigFile({configFileName:t,optionsToExtend:r,watchOptionsToExtend:s,extraFileExtensions:c,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o})},e.createWatchProgram=function(r){var a,o,s,c,l,u,_,d,p,f,g,m=r.extendedConfigCache,y=!1,v=new e.Map,h=!1,b=r.useCaseSensitiveFileNames(),x=r.getCurrentDirectory(),D=r.configFileName,S=r.optionsToExtend,T=void 0===S?{}:S,C=r.watchOptionsToExtend,E=r.extraFileExtensions,k=r.createProgram,N=r.rootFiles,A=r.options,F=r.watchOptions,P=r.projectReferences,w=!1,I=!1,O=void 0===D?void 0:e.createCachedDirectoryStructureHost(r,x,b),M=O||r,L=e.parseConfigHostFromCompilerHostLike(r,M),R=Z();D&&r.configFileParsingResult&&(_e(r.configFileParsingResult),R=Z()),ne(e.Diagnostics.Starting_compilation_in_watch_mode),D&&!r.configFileParsingResult&&(R=e.getNewLineCharacter(T,(function(){return r.getNewLine()})),e.Debug.assert(!N),ue(),R=Z());var B,j=e.createWatchFactory(r,A),J=j.watchFile,z=j.watchDirectory,U=j.writeLog,K=e.createGetCanonicalFileName(b);U("Current directory: ".concat(x," CaseSensitiveFileNames: ").concat(b)),D&&(B=J(D,(function(){e.Debug.assert(!!D),o=e.ConfigFileProgramReloadLevel.Full,se();}),e.PollingInterval.High,F,e.WatchType.ConfigFile));var V=e.createCompilerHostFromProgramHost(r,(function(){return A}),M);e.setGetSourceFileAsHashVersioned(V);var q=V.getSourceFile;V.getSourceFile=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return te.apply(void 0,n$4([e,$(e)],t,!1))},V.getSourceFileByPath=te,V.getNewLine=function(){return R},V.fileExists=function(e){var t=$(e);return !ee(v.get(t))&&M.fileExists(e)},V.onReleaseOldSourceFile=function(e,t,r){var n=v.get(e.resolvedPath);void 0!==n&&(ee(n)?(p||(p=[])).push(e.path):n.sourceFile===e&&(n.fileWatcher&&n.fileWatcher.close(),v.delete(e.resolvedPath),r||W.removeResolutionsOfFile(e.path)));},V.onReleaseParsedCommandLine=function(t){var r,n=$(t),i=null==_?void 0:_.get(n);i&&(_.delete(n),i.watchedDirectories&&e.clearMap(i.watchedDirectories,e.closeFileWatcherOf),null===(r=i.watcher)||void 0===r||r.close(),e.clearSharedExtendedConfigFileWatcher(n,d));},V.toPath=$,V.getCompilationSettings=function(){return A},V.useSourceOfProjectReferenceRedirect=e.maybeBind(r,r.useSourceOfProjectReferenceRedirect),V.watchDirectoryOfFailedLookupLocation=function(t,r,n){return z(t,r,n,F,e.WatchType.FailedLookupLocations)},V.watchAffectingFileLocation=function(t,r){return J(t,r,e.PollingInterval.High,F,e.WatchType.AffectingFileLocation)},V.watchTypeRootsDirectory=function(t,r,n){return z(t,r,n,F,e.WatchType.TypeRoots)},V.getCachedDirectoryStructureHost=function(){return O},V.scheduleInvalidateResolutionsOfFailedLookupLocations=function(){if(!r.setTimeout||!r.clearTimeout)return W.invalidateResolutionsOfFailedLookupLocations();var e=ae();U("Scheduling invalidateFailedLookup".concat(e?", Cancelled earlier one":"")),u=r.setTimeout(oe,250);},V.onInvalidatedResolution=se,V.onChangedAutomaticTypeDirectiveNames=se,V.fileIsOpen=e.returnFalse,V.getCurrentProgram=X,V.writeLog=U,V.getParsedCommandLine=de;var W=e.createResolutionCache(V,D?e.getDirectoryPath(e.getNormalizedAbsolutePath(D,x)):x,!1);V.resolveModuleNames=r.resolveModuleNames?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveModuleNames.apply(r,e)}:function(e,t,r,n,i,a){return W.resolveModuleNames(e,t,r,n,a)},V.resolveTypeReferenceDirectives=r.resolveTypeReferenceDirectives?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveTypeReferenceDirectives.apply(r,e)}:function(e,t,r,n,i){return W.resolveTypeReferenceDirectives(e,t,r,i)},V.getModuleResolutionCache=r.resolveModuleNames?e.maybeBind(r,r.getModuleResolutionCache):function(){return W.getModuleResolutionCache()};var H=r.resolveModuleNames||r.resolveTypeReferenceDirectives?e.maybeBind(r,r.hasInvalidatedResolutions)||e.returnTrue:e.returnFalse;return a=t(A,V),Y(),ve(),D&&be($(D),A,F,e.WatchType.ExtendedConfigFile),D?{getCurrentProgram:Q,getProgram:le,close:G}:{getCurrentProgram:Q,getProgram:le,updateRootFileNames:function(t){e.Debug.assert(!D,"Cannot update root file names with config file watch mode"),N=t,se();},close:G};function G(){ae(),W.clear(),e.clearMap(v,(function(e){e&&e.fileWatcher&&(e.fileWatcher.close(),e.fileWatcher=void 0);})),B&&(B.close(),B=void 0),null==m||m.clear(),m=void 0,d&&(e.clearMap(d,e.closeFileWatcherOf),d=void 0),c&&(e.clearMap(c,e.closeFileWatcherOf),c=void 0),s&&(e.clearMap(s,e.closeFileWatcher),s=void 0),_&&(e.clearMap(_,(function(t){var r;null===(r=t.watcher)||void 0===r||r.close(),t.watcher=void 0,t.watchedDirectories&&e.clearMap(t.watchedDirectories,e.closeFileWatcherOf),t.watchedDirectories=void 0;})),_=void 0);}function Q(){return a}function X(){return a&&a.getProgramOrUndefined()}function Y(){U("Synchronizing program"),ae();var t=Q();h&&(R=Z(),t&&e.changesAffectModuleResolution(t.getCompilerOptions(),A)&&W.clear());var n=W.createHasInvalidatedResolutions(H),i=e.changeCompilerHostLikeToUseCache(V,$),o=i.originalReadFile,c=i.originalFileExists,l=i.originalDirectoryExists,u=i.originalCreateDirectory,_=i.originalWriteFile,d=i.readFileWithCache;return e.isProgramUptoDate(X(),N,A,(function(t){return function(t,r){var n=v.get(t);if(n){if(n.version)return n.version;var i=r(t);return void 0!==i?(V.createHash||e.generateDjb2Hash)(i):void 0}}(t,d)}),(function(e){return V.fileExists(e)}),n,ie,de,P)?I&&(y&&ne(e.Diagnostics.File_change_detected_Starting_incremental_compilation),a=k(void 0,void 0,V,a,g,P),I=!1):(y&&ne(e.Diagnostics.File_change_detected_Starting_incremental_compilation),function(t){U("CreatingProgramWith::"),U("  roots: ".concat(JSON.stringify(N))),U("  options: ".concat(JSON.stringify(A))),P&&U("  projectReferences: ".concat(JSON.stringify(P)));var r=h||!X();h=!1,I=!1,W.startCachingPerDirectoryResolution(),V.hasInvalidatedResolutions=t,V.hasChangedAutomaticTypeDirectiveNames=ie;var n=X();if(a=k(N,A,V,a,g,P),W.finishCachingPerDirectoryResolution(a.getProgram(),n),e.updateMissingFilePathsWatch(a.getProgram(),s||(s=new e.Map),me),r&&W.updateTypeRootsWatch(),p){for(var i=0,o=p;i<o.length;i++){var c=o[i];s.has(c)||v.delete(c);}p=void 0;}}(n)),y=!1,r.afterProgramCreate&&t!==a&&r.afterProgramCreate(a),V.readFile=o,V.fileExists=c,V.directoryExists=l,V.createDirectory=u,V.writeFile=_,a}function Z(){return e.getNewLineCharacter(A||T,(function(){return r.getNewLine()}))}function $(t){return e.toPath(t,x,K)}function ee(e){return "boolean"==typeof e}function te(t,r,n,i,a){var o=v.get(r);if(!ee(o)){if(void 0===o||a||function(e){return "boolean"==typeof e.version}(o)){var s=q(t,n,i);if(o)s?(o.sourceFile=s,o.version=s.version,o.fileWatcher||(o.fileWatcher=pe(r,t,fe,e.PollingInterval.Low,F,e.WatchType.SourceFile))):(o.fileWatcher&&o.fileWatcher.close(),v.set(r,!1));else if(s){var c=pe(r,t,fe,e.PollingInterval.Low,F,e.WatchType.SourceFile);v.set(r,{sourceFile:s,version:s.version,fileWatcher:c});}else v.set(r,!1);return s}return o.sourceFile}}function re(e){var t=v.get(e);void 0!==t&&(ee(t)?v.set(e,{version:!1}):t.version=!1);}function ne(t){r.onWatchStatusChange&&r.onWatchStatusChange(e.createCompilerDiagnostic(t),R,A||T);}function ie(){return W.hasChangedAutomaticTypeDirectiveNames()}function ae(){return !!u&&(r.clearTimeout(u),u=void 0,!0)}function oe(){u=void 0,W.invalidateResolutionsOfFailedLookupLocations()&&se();}function se(){r.setTimeout&&r.clearTimeout&&(l&&r.clearTimeout(l),U("Scheduling update"),l=r.setTimeout(ce,250));}function ce(){l=void 0,y=!0,le();}function le(){switch(o){case e.ConfigFileProgramReloadLevel.Partial:e.perfLogger.logStartUpdateProgram("PartialConfigReload"),U("Reloading new file names and options"),o=e.ConfigFileProgramReloadLevel.None,N=e.getFileNamesFromConfigSpecs(A.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(D),x),A,L,E),e.updateErrorForNoInputFiles(N,e.getNormalizedAbsolutePath(D,x),A.configFile.configFileSpecs,g,w)&&(I=!0),Y();break;case e.ConfigFileProgramReloadLevel.Full:e.perfLogger.logStartUpdateProgram("FullConfigReload"),U("Reloading config file: ".concat(D)),o=e.ConfigFileProgramReloadLevel.None,O&&O.clearCache(),ue(),h=!0,Y(),ve(),be($(D),A,F,e.WatchType.ExtendedConfigFile);break;default:e.perfLogger.logStartUpdateProgram("SynchronizeProgram"),Y();}return e.perfLogger.logStopUpdateProgram("Done"),Q()}function ue(){_e(e.getParsedCommandLineOfConfigFile(D,T,L,m||(m=new e.Map),C,E));}function _e(t){N=t.fileNames,A=t.options,F=t.watchOptions,P=t.projectReferences,f=t.wildcardDirectories,g=e.getConfigFileParsingDiagnostics(t).slice(),w=e.canJsonReportNoInputFiles(t.raw),I=!0;}function de(t){var n=$(t),a=null==_?void 0:_.get(n);if(a){if(!a.reloadLevel)return a.parsedCommandLine;if(a.parsedCommandLine&&a.reloadLevel===e.ConfigFileProgramReloadLevel.Partial&&!r.getParsedCommandLine){U("Reloading new file names and options");var o=e.getFileNamesFromConfigSpecs(a.parsedCommandLine.options.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),x),A,L);return a.parsedCommandLine=i$1(i$1({},a.parsedCommandLine),{fileNames:o}),a.reloadLevel=void 0,a.parsedCommandLine}}U("Loading config file: ".concat(t));var s=r.getParsedCommandLine?r.getParsedCommandLine(t):function(t){var r=L.onUnRecoverableConfigFileDiagnostic;L.onUnRecoverableConfigFileDiagnostic=e.noop;var n=e.getParsedCommandLineOfConfigFile(t,void 0,L,m||(m=new e.Map),C);return L.onUnRecoverableConfigFileDiagnostic=r,n}(t);return a?(a.parsedCommandLine=s,a.reloadLevel=void 0):(_||(_=new e.Map)).set(n,a={parsedCommandLine:s}),function(t,r,n){var i,a,o,s,c;n.watcher||(n.watcher=J(t,(function(n,i){ge(t,r,i);var a=null==_?void 0:_.get(r);a&&(a.reloadLevel=e.ConfigFileProgramReloadLevel.Full),W.removeResolutionsFromProjectReferenceRedirects(r),se();}),e.PollingInterval.High,(null===(i=n.parsedCommandLine)||void 0===i?void 0:i.watchOptions)||F,e.WatchType.ConfigFileOfReferencedProject)),(null===(a=n.parsedCommandLine)||void 0===a?void 0:a.wildcardDirectories)?e.updateWatchingWildcardDirectories(n.watchedDirectories||(n.watchedDirectories=new e.Map),new e.Map(e.getEntries(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.wildcardDirectories)),(function(i,a){var o;return z(i,(function(n){var a=$(n);O&&O.addOrDeleteFileOrDirectory(n,a),re(a);var o=null==_?void 0:_.get(r);(null==o?void 0:o.parsedCommandLine)&&(e.isIgnoredFileFromWildCardWatching({watchedDirPath:$(i),fileOrDirectory:n,fileOrDirectoryPath:a,configFileName:t,options:o.parsedCommandLine.options,program:o.parsedCommandLine.fileNames,currentDirectory:x,useCaseSensitiveFileNames:b,writeLog:U,toPath:$})||o.reloadLevel!==e.ConfigFileProgramReloadLevel.Full&&(o.reloadLevel=e.ConfigFileProgramReloadLevel.Partial,se()));}),a,(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.watchOptions)||F,e.WatchType.WildcardDirectoryOfReferencedProject)})):n.watchedDirectories&&(e.clearMap(n.watchedDirectories,e.closeFileWatcherOf),n.watchedDirectories=void 0),be(r,null===(s=n.parsedCommandLine)||void 0===s?void 0:s.options,(null===(c=n.parsedCommandLine)||void 0===c?void 0:c.watchOptions)||F,e.WatchType.ExtendedConfigOfReferencedProject);}(t,n,a),s}function pe(e,t,r,n,i,a){return J(t,(function(t,n){return r(t,n,e)}),n,i,a)}function fe(t,r,n){ge(t,n,r),r===e.FileWatcherEventKind.Deleted&&v.has(n)&&W.invalidateResolutionOfFile(n),re(n),se();}function ge(e,t,r){O&&O.addOrDeleteFile(e,t,r);}function me(t){return (null==_?void 0:_.has(t))?e.noopFileWatcher:pe(t,t,ye,e.PollingInterval.Medium,F,e.WatchType.MissingFile)}function ye(t,r,n){ge(t,n,r),r===e.FileWatcherEventKind.Created&&s.has(n)&&(s.get(n).close(),s.delete(n),re(n),se());}function ve(){f?e.updateWatchingWildcardDirectories(c||(c=new e.Map),new e.Map(e.getEntries(f)),he):c&&e.clearMap(c,e.closeFileWatcherOf);}function he(t,r){return z(t,(function(r){e.Debug.assert(!!D);var n=$(r);O&&O.addOrDeleteFileOrDirectory(r,n),re(n),e.isIgnoredFileFromWildCardWatching({watchedDirPath:$(t),fileOrDirectory:r,fileOrDirectoryPath:n,configFileName:D,extraFileExtensions:E,options:A,program:Q()||N,currentDirectory:x,useCaseSensitiveFileNames:b,writeLog:U,toPath:$})||o!==e.ConfigFileProgramReloadLevel.Full&&(o=e.ConfigFileProgramReloadLevel.Partial,se());}),r,F,e.WatchType.WildcardDirectory)}function be(t,r,n,i){e.updateSharedExtendedConfigFileWatcher(t,r,d||(d=new e.Map),(function(t,r){return J(t,(function(n,i){var a;ge(t,r,i),m&&e.cleanExtendedConfigCache(m,r,$);var s=null===(a=d.get(r))||void 0===a?void 0:a.projects;(null==s?void 0:s.size)&&s.forEach((function(t){if($(D)===t)o=e.ConfigFileProgramReloadLevel.Full;else {var r=null==_?void 0:_.get(t);r&&(r.reloadLevel=e.ConfigFileProgramReloadLevel.Full),W.removeResolutionsFromProjectReferenceRedirects(t);}se();}));}),e.PollingInterval.High,n,i)}),$);}};}(t),function(e){var t;(t=e.UpToDateStatusType||(e.UpToDateStatusType={}))[t.Unbuildable=0]="Unbuildable",t[t.UpToDate=1]="UpToDate",t[t.UpToDateWithUpstreamTypes=2]="UpToDateWithUpstreamTypes",t[t.OutOfDateWithPrepend=3]="OutOfDateWithPrepend",t[t.OutputMissing=4]="OutputMissing",t[t.ErrorReadingFile=5]="ErrorReadingFile",t[t.OutOfDateWithSelf=6]="OutOfDateWithSelf",t[t.OutOfDateWithUpstream=7]="OutOfDateWithUpstream",t[t.OutOfDateBuildInfo=8]="OutOfDateBuildInfo",t[t.UpstreamOutOfDate=9]="UpstreamOutOfDate",t[t.UpstreamBlocked=10]="UpstreamBlocked",t[t.ComputingUpstream=11]="ComputingUpstream",t[t.TsVersionOutputOfDate=12]="TsVersionOutputOfDate",t[t.UpToDateWithInputFileText=13]="UpToDateWithInputFileText",t[t.ContainerOnly=14]="ContainerOnly",t[t.ForceBuild=15]="ForceBuild",e.resolveConfigFileProjectName=function(t){return e.fileExtensionIs(t,".json")?t:e.combinePaths(t,"tsconfig.json")};}(t),function(e){var t,r,i,a=new Date(-864e13),o=new Date(864e13);function s(t,r){return function(t,r,n){var i,a=t.get(r);return a||(i=new e.Map,t.set(r,i)),a||i}(t,r)}function c(e){return e.now?e.now():new Date}function l(e){return !!e&&!!e.buildOrder}function u(e){return l(e)?e.buildOrder:e}function _(t,r){return function(n){var i=r?"[".concat(e.formatColorAndReset(e.getLocaleTimeString(t),e.ForegroundColorEscapeSequences.Grey),"] "):"".concat(e.getLocaleTimeString(t)," - ");i+="".concat(e.flattenDiagnosticMessageText(n.messageText,t.newLine)).concat(t.newLine+t.newLine),t.write(i);}}function d(t,r,n,i){var a=e.createProgramHost(t,r);return a.getModifiedTime=t.getModifiedTime?function(e){return t.getModifiedTime(e)}:e.returnUndefined,a.setModifiedTime=t.setModifiedTime?function(e,r){return t.setModifiedTime(e,r)}:e.noop,a.deleteFile=t.deleteFile?function(e){return t.deleteFile(e)}:e.noop,a.reportDiagnostic=n||e.createDiagnosticReporter(t),a.reportSolutionBuilderStatus=i||_(t),a.now=e.maybeBind(t,t.now),a}function p(t,r){return e.toPath(r,t.currentDirectory,t.getCanonicalFileName)}function f(e,t){var r=e.resolvedConfigFilePaths,n=r.get(t);if(void 0!==n)return n;var i=p(e,t);return r.set(t,i),i}function g(e){return !!e.options}function m(e,t){var r=e.configFileCache.get(t);return r&&g(r)?r:void 0}function y(t,r,n){var i,a=t.configFileCache,o=a.get(n);if(o)return g(o)?o:void 0;e.performance.mark("SolutionBuilder::beforeConfigFileParsing");var s,c=t.parseConfigFileHost,l=t.baseCompilerOptions,u=t.baseWatchOptions,_=t.extendedConfigCache,d=t.host;return d.getParsedCommandLine?(s=d.getParsedCommandLine(r))||(i=e.createCompilerDiagnostic(e.Diagnostics.File_0_not_found,r)):(c.onUnRecoverableConfigFileDiagnostic=function(e){return i=e},s=e.getParsedCommandLineOfConfigFile(r,l,c,_,u),c.onUnRecoverableConfigFileDiagnostic=e.noop),a.set(n,s||i),e.performance.mark("SolutionBuilder::afterConfigFileParsing"),e.performance.measure("SolutionBuilder::Config file parsing","SolutionBuilder::beforeConfigFileParsing","SolutionBuilder::afterConfigFileParsing"),s}function v(t,r){return e.resolveConfigFileProjectName(e.resolvePath(t.currentDirectory,r))}function h(t,r){for(var n,i,a=new e.Map,o=new e.Map,s=[],c=0,l=r;c<l.length;c++)u(l[c]);return i?{buildOrder:n||e.emptyArray,circularDiagnostics:i}:n||e.emptyArray;function u(r,c){var l=f(t,r);if(!o.has(l))if(a.has(l))c||(i||(i=[])).push(e.createCompilerDiagnostic(e.Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,s.join("\r\n")));else {a.set(l,!0),s.push(r);var _=y(t,r,l);if(_&&_.projectReferences)for(var d=0,p=_.projectReferences;d<p.length;d++){var g=p[d];u(v(t,g.path),c||g.circular);}s.pop(),o.set(l,!0),(n||(n=[])).push(r);}}}function b(t){return t.buildOrder||function(t){var r=h(t,t.rootNames.map((function(e){return v(t,e)})));t.resolvedConfigFilePaths.clear();var n=new e.Map(u(r).map((function(e){return [f(t,e),!0]}))),i={onDeleteValue:e.noop};return e.mutateMapSkippingNewValues(t.configFileCache,n,i),e.mutateMapSkippingNewValues(t.projectStatus,n,i),e.mutateMapSkippingNewValues(t.builderPrograms,n,i),e.mutateMapSkippingNewValues(t.diagnostics,n,i),e.mutateMapSkippingNewValues(t.projectPendingBuild,n,i),e.mutateMapSkippingNewValues(t.projectErrorsReported,n,i),e.mutateMapSkippingNewValues(t.buildInfoCache,n,i),e.mutateMapSkippingNewValues(t.outputTimeStamps,n,i),t.watch&&(e.mutateMapSkippingNewValues(t.allWatchedConfigFiles,n,{onDeleteValue:e.closeFileWatcher}),t.allWatchedExtendedConfigFiles.forEach((function(e){e.projects.forEach((function(t){n.has(t)||e.projects.delete(t);})),e.close();})),e.mutateMapSkippingNewValues(t.allWatchedWildcardDirectories,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcherOf)}}),e.mutateMapSkippingNewValues(t.allWatchedInputFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}}),e.mutateMapSkippingNewValues(t.allWatchedPackageJsonFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}})),t.buildOrder=r}(t)}function x(t,r,n){var i=r&&v(t,r),a=b(t);if(l(a))return a;if(i){var o=f(t,i);if(-1===e.findIndex(a,(function(e){return f(t,e)===o})))return}var s=i?h(t,[i]):a;return e.Debug.assert(!l(s)),e.Debug.assert(!n||void 0!==i),e.Debug.assert(!n||s[s.length-1]===i),n?s.slice(0,s.length-1):s}function D(t){t.cache&&S(t);var r=t.compilerHost,i=t.host,a=t.readFileWithCache,o=r.getSourceFile,s=e.changeCompilerHostLikeToUseCache(i,(function(e){return p(t,e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.call.apply(o,n$4([r],e,!1))})),c=s.originalReadFile,l=s.originalFileExists,u=s.originalDirectoryExists,_=s.originalCreateDirectory,d=s.originalWriteFile,f=s.getSourceFileWithCache,g=s.readFileWithCache;t.readFileWithCache=g,r.getSourceFile=f,t.cache={originalReadFile:c,originalFileExists:l,originalDirectoryExists:u,originalCreateDirectory:_,originalWriteFile:d,originalReadFileWithCache:a,originalGetSourceFile:o};}function S(e){if(e.cache){var t=e.cache,r=e.host,n=e.compilerHost,i=e.extendedConfigCache,a=e.moduleResolutionCache,o=e.typeReferenceDirectiveResolutionCache;r.readFile=t.originalReadFile,r.fileExists=t.originalFileExists,r.directoryExists=t.originalDirectoryExists,r.createDirectory=t.originalCreateDirectory,r.writeFile=t.originalWriteFile,n.getSourceFile=t.originalGetSourceFile,e.readFileWithCache=t.originalReadFileWithCache,i.clear(),null==a||a.clear(),null==o||o.clear(),e.cache=void 0;}}function T(e,t){e.projectStatus.delete(t),e.diagnostics.delete(t);}function C(e,t,r){var n=e.projectPendingBuild,i=n.get(t);(void 0===i||i<r)&&n.set(t,r);}function E(t,r){t.allProjectBuildPending&&(t.allProjectBuildPending=!1,t.options.watch&&ue(t,e.Diagnostics.Starting_compilation_in_watch_mode),D(t),u(b(t)).forEach((function(r){return t.projectPendingBuild.set(f(t,r),e.ConfigFileProgramReloadLevel.None)})),r&&r.throwIfCancellationRequested());}function k(t,r){return t.projectPendingBuild.delete(r),t.diagnostics.has(r)?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}function N(a,o,s,l,u,_,d){var g,m,h,b=a===r.Build?i.CreateProgram:i.EmitBundle;return a===r.Build?{kind:a,project:s,projectPath:l,buildOrder:d,getCompilerOptions:function(){return _.options},getCurrentDirectory:function(){return o.currentDirectory},getBuilderProgram:function(){return D(e.identity)},getProgram:function(){return D((function(e){return e.getProgramOrUndefined()}))},getSourceFile:function(e){return D((function(t){return t.getSourceFile(e)}))},getSourceFiles:function(){return S((function(e){return e.getSourceFiles()}))},getOptionsDiagnostics:function(e){return S((function(t){return t.getOptionsDiagnostics(e)}))},getGlobalDiagnostics:function(e){return S((function(t){return t.getGlobalDiagnostics(e)}))},getConfigFileParsingDiagnostics:function(){return S((function(e){return e.getConfigFileParsingDiagnostics()}))},getSyntacticDiagnostics:function(e,t){return S((function(r){return r.getSyntacticDiagnostics(e,t)}))},getAllDependencies:function(e){return S((function(t){return t.getAllDependencies(e)}))},getSemanticDiagnostics:function(e,t){return S((function(r){return r.getSemanticDiagnostics(e,t)}))},getSemanticDiagnosticsOfNextAffectedFile:function(e,t){return D((function(r){return r.getSemanticDiagnosticsOfNextAffectedFile&&r.getSemanticDiagnosticsOfNextAffectedFile(e,t)}))},emit:function(e,t,r,n,a){return e||n?D((function(i){var c,l;return i.emit(e,t,r,n,a||(null===(l=(c=o.host).getCustomTransformers)||void 0===l?void 0:l.call(c,s)))})):(R(i.SemanticDiagnostics,r),b===i.EmitBuildInfo?P(t,r):b===i.Emit?F(t,r,a):void 0)},done:x}:{kind:a,project:s,projectPath:l,buildOrder:d,getCompilerOptions:function(){return _.options},getCurrentDirectory:function(){return o.currentDirectory},emit:function(e,t){return b!==i.EmitBundle?h:L(e,t)},done:x};function x(t,n,s){return R(i.Done,t,n,s),a===r.Build?e.performance.mark("SolutionBuilder::Projects built"):e.performance.mark("SolutionBuilder::Bundles updated"),k(o,l)}function D(e){return R(i.CreateProgram),g&&e(g)}function S(t){return D(t)||e.emptyArray}function T(){var r,n;if(e.Debug.assert(void 0===g),o.options.dry)return le(o,e.Diagnostics.A_non_dry_build_would_build_project_0,s),m=t.Success,void(b=i.QueueReferencingProjects);if(o.options.verbose&&le(o,e.Diagnostics.Building_project_0,s),0===_.fileNames.length)return de(o,l,e.getConfigFileParsingDiagnostics(_)),m=t.None,void(b=i.QueueReferencingProjects);var a=o.host,c=o.compilerHost;o.projectCompilerOptions=_.options,null===(r=o.moduleResolutionCache)||void 0===r||r.update(_.options),null===(n=o.typeReferenceDirectiveResolutionCache)||void 0===n||n.update(_.options),g=a.createProgram(_.fileNames,_.options,c,function(t,r,n){var i=t.options,a=t.builderPrograms,o=t.compilerHost;if(!i.force)return a.get(r)||e.readBuilderProgram(n.options,o)}(o,l,_),e.getConfigFileParsingDiagnostics(_),_.projectReferences),o.watch&&(o.lastCachedPackageJsonLookups.set(l,o.moduleResolutionCache&&e.map(o.moduleResolutionCache.getPackageJsonInfoCache().entries(),(function(e){var t=e[0],r=e[1];return [o.host.realpath&&r?p(o,o.host.realpath(t)):t,r]}))),o.builderPrograms.set(l,g)),b++;}function C(e,t,r){var n;e.length?(n=M(o,l,g,_,e,t,r),m=n.buildResult,b=n.step):b++;}function E(r){e.Debug.assertIsDefined(g),C(n$4(n$4(n$4(n$4([],g.getConfigFileParsingDiagnostics(),!0),g.getOptionsDiagnostics(r),!0),g.getGlobalDiagnostics(r),!0),g.getSyntacticDiagnostics(void 0,r),!0),t.SyntaxErrors,"Syntactic");}function A(r){C(e.Debug.checkDefined(g).getSemanticDiagnostics(void 0,r),t.TypeErrors,"Semantic");}function F(r,n,a){var u,d,f,y;e.Debug.assertIsDefined(g),e.Debug.assert(b===i.Emit);var v,h=g.saveEmitState(),x=[],D=e.emitFilesAndReportErrors(g,(function(e){return (v||(v=[])).push(e)}),void 0,void 0,(function(e,t,r,n,i,a){return x.push({name:e,text:t,writeByteOrderMark:r,buildInfo:null==a?void 0:a.buildInfo})}),n,!1,a||(null===(f=(d=o.host).getCustomTransformers)||void 0===f?void 0:f.call(d,s))).emitResult;if(v)return g.restoreEmitState(h),u=M(o,l,g,_,v,t.DeclarationEmitErrors,"Declaration file"),m=u.buildResult,b=u.step,{emitSkipped:!0,diagnostics:D.diagnostics};var S,T,C=o.host,E=o.compilerHost,k=(null===(y=g.hasChangedEmitSignature)||void 0===y?void 0:y.call(g))?t.None:t.DeclarationOutputUnchanged,N=e.createDiagnosticCollection(),A=new e.Map,F=g.getCompilerOptions(),P=e.isIncrementalCompilation(F);return x.forEach((function(t){var n=t.name,i=t.text,a=t.writeByteOrderMark,s=t.buildInfo,u=p(o,n);A.set(p(o,n),n),s&&J(o,s,l,F,k),e.writeFile(r?{writeFile:r}:E,N,n,i,a),!P&&o.watch&&(S||(S=j(o,l))).set(u,T||(T=c(o.host)));})),w(N,A,x.length?x[0].name:e.getFirstProjectOutput(_,!C.useCaseSensitiveFileNames()),k),D}function P(r,a){e.Debug.assertIsDefined(g),e.Debug.assert(b===i.EmitBuildInfo);var s=g.emitBuildInfo((function(e,n,i,a,s,c){(null==c?void 0:c.buildInfo)&&J(o,c.buildInfo,l,g.getCompilerOptions(),t.DeclarationOutputUnchanged),r?r(e,n,i,a,s,c):o.compilerHost.writeFile(e,n,i,a,s,c);}),a);return s.diagnostics.length&&(_e(o,s.diagnostics),o.diagnostics.set(l,n$4(n$4([],o.diagnostics.get(l),!0),s.diagnostics,!0)),m=t.EmitErrors&m),s.emittedFiles&&o.write&&s.emittedFiles.forEach((function(e){return I(o,_,e)})),O(o,g,_),b=i.QueueReferencingProjects,s}function w(r,n,a,s){var c,u=r.getDiagnostics();return u.length?(c=M(o,l,g,_,u,t.EmitErrors,"Emit"),m=c.buildResult,b=c.step,u):(o.write&&n.forEach((function(e){return I(o,_,e)})),W(o,_,l,e.Diagnostics.Updating_unchanged_output_timestamps_of_project_0,n),o.diagnostics.delete(l),o.projectStatus.set(l,{type:e.UpToDateStatusType.UpToDate,oldestOutputFileName:a}),O(o,g,_),b=i.QueueReferencingProjects,m=s,u)}function L(n,c){var g,x;if(e.Debug.assert(a===r.UpdateBundle),o.options.dry)return le(o,e.Diagnostics.A_non_dry_build_would_update_output_of_project_0,s),m=t.Success,void(b=i.QueueReferencingProjects);o.options.verbose&&le(o,e.Diagnostics.Updating_output_of_project_0,s);var D=o.compilerHost;o.projectCompilerOptions=_.options;var S=e.emitUsingBuildInfo(_,D,(function(e){var t=v(o,e.path);return y(o,t,f(o,t))}),c||(null===(x=(g=o.host).getCustomTransformers)||void 0===x?void 0:x.call(g,s)));if(e.isString(S))return le(o,e.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1,s,ce(o,S)),b=i.BuildInvalidatedProjectOfBundle,h=N(r.Build,o,s,l,u,_,d);e.Debug.assert(!!S.length);var T=e.createDiagnosticCollection(),C=new e.Map,E=t.DeclarationOutputUnchanged,k=o.buildInfoCache.get(l).buildInfo||void 0;return S.forEach((function(r){var i,a,s=r.name,c=r.text,u=r.writeByteOrderMark,d=r.buildInfo;C.set(p(o,s),s),d&&((null===(i=d.program)||void 0===i?void 0:i.outSignature)!==(null===(a=null==k?void 0:k.program)||void 0===a?void 0:a.outSignature)&&(E&=~t.DeclarationOutputUnchanged),J(o,d,l,_.options,E)),e.writeFile(n?{writeFile:n}:D,T,s,c,u);})),{emitSkipped:!1,diagnostics:w(T,C,S[0].name,E)}}function R(t,r,n,a){for(;b<=t&&b<i.Done;){var c=b;switch(b){case i.CreateProgram:T();break;case i.SyntaxDiagnostics:E(r);break;case i.SemanticDiagnostics:A(r);break;case i.Emit:F(n,r,a);break;case i.EmitBuildInfo:P(n,r);break;case i.EmitBundle:L(n,a);break;case i.BuildInvalidatedProjectOfBundle:e.Debug.checkDefined(h).done(r,n,a),b=i.Done;break;case i.QueueReferencingProjects:Q(o,s,l,u,_,d,e.Debug.checkDefined(m)),b++;break;case i.Done:default:e.assertType(b);}e.Debug.assert(b>c);}}}function A(t,r,n){var i=t.options;return !(r.type===e.UpToDateStatusType.OutOfDateWithPrepend&&!i.force&&0!==n.fileNames.length&&!e.getConfigFileParsingDiagnostics(n).length&&e.isIncrementalCompilation(n.options))}function F(t,n,i){if(t.projectPendingBuild.size&&!l(n))for(var a=t.options,o=t.projectPendingBuild,s=0;s<n.length;s++){var c=n[s],u=f(t,c),_=t.projectPendingBuild.get(u);if(void 0!==_){i&&(i=!1,ge(t,n));var d=y(t,c,u);if(d){_===e.ConfigFileProgramReloadLevel.Full?(re(t,c,u,d),ne(t,u,d),ie(t,c,u,d),ae(t,c,u,d),oe(t,c,u,d)):_===e.ConfigFileProgramReloadLevel.Partial&&(d.fileNames=e.getFileNamesFromConfigSpecs(d.options.configFile.configFileSpecs,e.getDirectoryPath(c),d.options,t.parseConfigFileHost),e.updateErrorForNoInputFiles(d.fileNames,c,d.options.configFile.configFileSpecs,d.errors,e.canJsonReportNoInputFiles(d.raw)),ae(t,c,u,d),oe(t,c,u,d));var p=q(t,d,u);if(!a.force){if(p.type===e.UpToDateStatusType.UpToDate){me(t,c,p),de(t,u,e.getConfigFileParsingDiagnostics(d)),o.delete(u),a.dry&&le(t,e.Diagnostics.Project_0_is_up_to_date,c);continue}if(p.type===e.UpToDateStatusType.UpToDateWithUpstreamTypes||p.type===e.UpToDateStatusType.UpToDateWithInputFileText)return de(t,u,e.getConfigFileParsingDiagnostics(d)),{kind:r.UpdateOutputFileStamps,status:p,project:c,projectPath:u,projectIndex:s,config:d}}if(p.type!==e.UpToDateStatusType.UpstreamBlocked){if(p.type!==e.UpToDateStatusType.ContainerOnly)return {kind:A(t,p,d)?r.Build:r.UpdateBundle,status:p,project:c,projectPath:u,projectIndex:s,config:d};me(t,c,p),de(t,u,e.getConfigFileParsingDiagnostics(d)),o.delete(u);}else me(t,c,p),de(t,u,e.getConfigFileParsingDiagnostics(d)),o.delete(u),a.verbose&&le(t,p.upstreamProjectBlocked?e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built:e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,c,p.upstreamProjectName);}else pe(t,u),o.delete(u);}}}function P(t,n,i){return me(t,n.project,n.status),n.kind!==r.UpdateOutputFileStamps?N(n.kind,t,n.project,n.projectPath,n.projectIndex,n.config,i):function(t,n,i,a,o){var s=!0;return {kind:r.UpdateOutputFileStamps,project:n,projectPath:i,buildOrder:o,getCompilerOptions:function(){return a.options},getCurrentDirectory:function(){return t.currentDirectory},updateOutputFileStatmps:function(){G(t,a,i),s=!1;},done:function(){return s&&G(t,a,i),e.performance.mark("SolutionBuilder::Timestamps only updates"),k(t,i)}}}(t,n.project,n.projectPath,n.config,i)}function w(e,t,r){var n=F(e,t,r);return n?P(e,n,t):n}function I(e,t,r){var n=e.write;n&&t.options.listEmittedFiles&&n("TSFILE: ".concat(r));}function O(t,r,n){r?(t.write&&e.listFiles(r,t.write),t.host.afterProgramEmitAndDiagnostics&&t.host.afterProgramEmitAndDiagnostics(r),r.releaseProgram()):t.host.afterEmitBundle&&t.host.afterEmitBundle(n),t.projectCompilerOptions=t.baseCompilerOptions;}function M(t,r,n,a,o,s,c){var l=n&&!e.outFile(n.getCompilerOptions());return de(t,r,o),t.projectStatus.set(r,{type:e.UpToDateStatusType.Unbuildable,reason:"".concat(c," errors")}),l?{buildResult:s,step:i.EmitBuildInfo}:(O(t,n,a),{buildResult:s,step:i.QueueReferencingProjects})}function L(e){return !!e.watcher}function R(t,r){var n=p(t,r),i=t.filesWatched.get(n);if(t.watch&&i){if(!L(i))return i;if(i.modifiedTime)return i.modifiedTime}var a=e.getModifiedTime(t.host,r);return t.watch&&(i?i.modifiedTime=a:t.filesWatched.set(n,a)),a}function B(t,r,n,i,a,o,s){var c=p(t,r),l=t.filesWatched.get(c);if(l&&L(l))l.callbacks.push(n);else {var u=t.watchFile(r,(function(r,n,i){var a=e.Debug.checkDefined(t.filesWatched.get(c));e.Debug.assert(L(a)),a.modifiedTime=i,a.callbacks.forEach((function(e){return e(r,n,i)}));}),i,a,o,s);t.filesWatched.set(c,{callbacks:[n],watcher:u,modifiedTime:l});}return {close:function(){var r=e.Debug.checkDefined(t.filesWatched.get(c));e.Debug.assert(L(r)),1===r.callbacks.length?(t.filesWatched.delete(c),e.closeFileWatcherOf(r)):e.unorderedRemoveItem(r.callbacks,n);}}}function j(t,r){if(t.watch){var n=t.outputTimeStamps.get(r);return n||t.outputTimeStamps.set(r,n=new e.Map),n}}function J(r,n,i,a,o){var s=e.getTsBuildInfoEmitOutputFilePath(a),l=z(r,s,i),u=c(r.host);l?(l.buildInfo=n,l.modifiedTime=u,o&t.DeclarationOutputUnchanged||(l.latestChangedDtsTime=u)):r.buildInfoCache.set(i,{path:p(r,s),buildInfo:n,modifiedTime:u,latestChangedDtsTime:o&t.DeclarationOutputUnchanged?void 0:u});}function z(e,t,r){var n=p(e,t),i=e.buildInfoCache.get(r);return (null==i?void 0:i.path)===n?i:void 0}function U(t,r,n,i){var a=p(t,r),o=t.buildInfoCache.get(n);if(void 0!==o&&o.path===a)return o.buildInfo||void 0;var s=t.readFileWithCache(r),c=s?e.getBuildInfo(r,s):void 0;return t.buildInfoCache.set(n,{path:a,buildInfo:c||!1,modifiedTime:i||e.missingFileModifiedTime}),c}function K(t,r,n,i){if(n<R(t,r))return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:i,newerInputFileName:r}}function V(e,t,r){return e.buildInfoCache.get(r).path===t.path}function q(t,r,n){if(void 0===r)return {type:e.UpToDateStatusType.Unbuildable,reason:"File deleted mid-build"};var i=t.projectStatus.get(n);if(void 0!==i)return i;e.performance.mark("SolutionBuilder::beforeUpToDateCheck");var s=function(t,r,n){var i,s,c;if(!r.fileNames.length&&!e.canJsonReportNoInputFiles(r.raw))return {type:e.UpToDateStatusType.ContainerOnly};var l=!!t.options.force;if(r.projectReferences){t.projectStatus.set(n,{type:e.UpToDateStatusType.ComputingUpstream});for(var u=0,_=r.projectReferences;u<_.length;u++){var d=_[u],g=e.resolveProjectReferencePath(d),m=f(t,g),v=y(t,g,m);if((oe=q(t,v,m)).type!==e.UpToDateStatusType.ComputingUpstream&&oe.type!==e.UpToDateStatusType.ContainerOnly){if(oe.type===e.UpToDateStatusType.Unbuildable||oe.type===e.UpToDateStatusType.UpstreamBlocked)return {type:e.UpToDateStatusType.UpstreamBlocked,upstreamProjectName:d.path,upstreamProjectBlocked:oe.type===e.UpToDateStatusType.UpstreamBlocked};if(oe.type!==e.UpToDateStatusType.UpToDate)return {type:e.UpToDateStatusType.UpstreamOutOfDate,upstreamProjectName:d.path};l||(c||(c=[])).push({ref:d,refStatus:oe,resolvedRefPath:m,resolvedConfig:v});}}}if(l)return {type:e.UpToDateStatusType.ForceBuild};var h,b,x,D,S=t.host,T=e.getTsBuildInfoEmitOutputFilePath(r.options),C=o;if(T){var E=z(t,T,n);if((b=(null==E?void 0:E.modifiedTime)||e.getModifiedTime(S,T))===e.missingFileModifiedTime)return E||t.buildInfoCache.set(n,{path:p(t,T),buildInfo:!1,modifiedTime:b}),{type:e.UpToDateStatusType.OutputMissing,missingOutputFileName:T};var k=U(t,T,n,b);if(!k)return {type:e.UpToDateStatusType.ErrorReadingFile,fileName:T};if((k.bundle||k.program)&&k.version!==e.version)return {type:e.UpToDateStatusType.TsVersionOutputOfDate,version:k.version};if(k.program){if((null===(i=k.program.changeFileSet)||void 0===i?void 0:i.length)||(r.options.noEmit?e.some(k.program.semanticDiagnosticsPerFile,e.isArray):null===(s=k.program.affectedFilesPendingEmit)||void 0===s?void 0:s.length))return {type:e.UpToDateStatusType.OutOfDateBuildInfo,buildInfoFile:T};x=k.program;}C=b,h=T;}for(var N=void 0,A=a,F=!1,P=0,w=r.fileNames;P<w.length;P++){var I=w[P],O=R(t,I);if(O===e.missingFileModifiedTime)return {type:e.UpToDateStatusType.Unbuildable,reason:"".concat(I," does not exist")};if(b&&b<O){var M=void 0,L=void 0;if(x){D||(D=e.getBuildInfoFileVersionMap(x,T,S));var B=(M=D.get(p(t,I)))?t.readFileWithCache(I):void 0;L=void 0!==B?(S.createHash||e.generateDjb2Hash)(B):void 0,M&&M===L&&(F=!0);}if(!M||M!==L)return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:T,newerInputFileName:I}}O>A&&(N=I,A=O);}if(!T)for(var J=e.getAllProjectOutputs(r,!S.useCaseSensitiveFileNames()),W=j(t,n),G=0,Q=J;G<Q.length;G++){var X=Q[G],Y=p(t,X),Z=null==W?void 0:W.get(Y);if(Z||(Z=e.getModifiedTime(t.host,X),null==W||W.set(Y,Z)),Z===e.missingFileModifiedTime)return {type:e.UpToDateStatusType.OutputMissing,missingOutputFileName:X};if(Z<A)return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:X,newerInputFileName:N};Z<C&&(C=Z,h=X);}var $,ee=t.buildInfoCache.get(n),te=!1,re=!1;if(c)for(var ne=0,ie=c;ne<ie.length;ne++){var ae=ie[ne],oe=(d=ae.ref,ae.refStatus);if(v=ae.resolvedConfig,m=ae.resolvedRefPath,re=re||!!d.prepend,!(oe.newestInputFileTime&&oe.newestInputFileTime<=C)){if(ee&&V(t,ee,m))return {type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:T,newerProjectName:d.path};var se=H(t,v.options,m);if(!(se&&se<=C))return e.Debug.assert(void 0!==h,"Should have an oldest output filename here"),{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:h,newerProjectName:d.path};te=!0,$=d.path;}}var ce=K(t,r.options.configFilePath,C,h);if(ce)return ce;var le=e.forEach(r.options.configFile.extendedSourceFiles||e.emptyArray,(function(e){return K(t,e,C,h)}));if(le)return le;var ue=e.forEach(t.lastCachedPackageJsonLookups.get(n)||e.emptyArray,(function(e){var r=e[0];return K(t,r,C,h)}));return ue||(re&&te?{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:h,newerProjectName:$}:{type:te?e.UpToDateStatusType.UpToDateWithUpstreamTypes:F?e.UpToDateStatusType.UpToDateWithInputFileText:e.UpToDateStatusType.UpToDate,newestInputFileTime:A,newestInputFileName:N,oldestOutputFileName:h})}(t,r,n);return e.performance.mark("SolutionBuilder::afterUpToDateCheck"),e.performance.measure("SolutionBuilder::Up-to-date check","SolutionBuilder::beforeUpToDateCheck","SolutionBuilder::afterUpToDateCheck"),t.projectStatus.set(n,s),s}function W(t,r,n,i,a){if(!r.options.noEmit){var o,s=e.getTsBuildInfoEmitOutputFilePath(r.options);if(s)return (null==a?void 0:a.has(p(t,s)))||(t.options.verbose&&le(t,i,r.options.configFilePath),t.host.setModifiedTime(s,o=c(t.host)),z(t,s,n).modifiedTime=o),void t.outputTimeStamps.delete(n);var l=t.host,u=e.getAllProjectOutputs(r,!l.useCaseSensitiveFileNames()),_=j(t,n),d=_?new e.Set:void 0;if(!a||u.length!==a.size)for(var f=!!t.options.verbose,g=0,m=u;g<m.length;g++){var y=m[g],v=p(t,y);(null==a?void 0:a.has(v))||(f&&(f=!1,le(t,i,r.options.configFilePath)),l.setModifiedTime(y,o||(o=c(t.host))),_&&(_.set(v,o),d.add(v)));}null==_||_.forEach((function(e,t){(null==a?void 0:a.has(t))||d.has(t)||_.delete(t);}));}}function H(t,r,n){if(r.composite){var i=e.Debug.checkDefined(t.buildInfoCache.get(n));if(void 0!==i.latestChangedDtsTime)return i.latestChangedDtsTime||void 0;var a=i.buildInfo&&i.buildInfo.program&&i.buildInfo.program.latestChangedDtsFile?t.host.getModifiedTime(e.getNormalizedAbsolutePath(i.buildInfo.program.latestChangedDtsFile,e.getDirectoryPath(i.path))):void 0;return i.latestChangedDtsTime=a||!1,a}}function G(t,r,n){if(t.options.dry)return le(t,e.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0,r.options.configFilePath);W(t,r,n,e.Diagnostics.Updating_output_timestamps_of_project_0),t.projectStatus.set(n,{type:e.UpToDateStatusType.UpToDate,oldestOutputFileName:e.getFirstProjectOutput(r,!t.host.useCaseSensitiveFileNames())});}function Q(r,n,i,a,o,s,c){if(!(c&t.AnyErrors)&&o.options.composite)for(var l=a+1;l<s.length;l++){var u=s[l],_=f(r,u);if(!r.projectPendingBuild.has(_)){var d=y(r,u,_);if(d&&d.projectReferences)for(var p=0,g=d.projectReferences;p<g.length;p++){var m=g[p];if(f(r,v(r,m.path))===i){var h=r.projectStatus.get(_);if(h)switch(h.type){case e.UpToDateStatusType.UpToDate:if(c&t.DeclarationOutputUnchanged){m.prepend?r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:h.oldestOutputFileName,newerProjectName:n}):h.type=e.UpToDateStatusType.UpToDateWithUpstreamTypes;break}case e.UpToDateStatusType.UpToDateWithInputFileText:case e.UpToDateStatusType.UpToDateWithUpstreamTypes:case e.UpToDateStatusType.OutOfDateWithPrepend:c&t.DeclarationOutputUnchanged||r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:h.type===e.UpToDateStatusType.OutOfDateWithPrepend?h.outOfDateOutputFileName:h.oldestOutputFileName,newerProjectName:n});break;case e.UpToDateStatusType.UpstreamBlocked:f(r,v(r,h.upstreamProjectName))===i&&T(r,_);}C(r,_,e.ConfigFileProgramReloadLevel.None);break}}}}}function X(t,r,n,i,a,o){e.performance.mark("SolutionBuilder::beforeBuild");var s=function(t,r,n,i,a,o){var s=x(t,r,o);if(!s)return e.ExitStatus.InvalidProject_OutputsSkipped;E(t,n);for(var c=!0,_=0;;){var d=w(t,s,c);if(!d)break;c=!1,d.done(n,i,null==a?void 0:a(d.project)),t.diagnostics.has(d.projectPath)||_++;}return S(t),fe(t,s),function(t,r){if(t.watchAllProjectsPending){e.performance.mark("SolutionBuilder::beforeWatcherCreation"),t.watchAllProjectsPending=!1;for(var n=0,i=u(r);n<i.length;n++){var a=i[n],o=f(t,a),s=y(t,a,o);re(t,a,o,s),ne(t,o,s),s&&(ie(t,a,o,s),ae(t,a,o,s),oe(t,a,o,s));}e.performance.mark("SolutionBuilder::afterWatcherCreation"),e.performance.measure("SolutionBuilder::Watcher creation","SolutionBuilder::beforeWatcherCreation","SolutionBuilder::afterWatcherCreation");}}(t,s),l(s)?e.ExitStatus.ProjectReferenceCycle_OutputsSkipped:s.some((function(e){return t.diagnostics.has(f(t,e))}))?_?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}(t,r,n,i,a,o);return e.performance.mark("SolutionBuilder::afterBuild"),e.performance.measure("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild"),s}function Y(t,r,n){e.performance.mark("SolutionBuilder::beforeClean");var i=function(t,r,n){var i=x(t,r,n);if(!i)return e.ExitStatus.InvalidProject_OutputsSkipped;if(l(i))return _e(t,i.circularDiagnostics),e.ExitStatus.ProjectReferenceCycle_OutputsSkipped;for(var a=t.options,o=t.host,s=a.dry?[]:void 0,c=0,u=i;c<u.length;c++){var _=u[c],d=f(t,_),g=y(t,_,d);if(void 0!==g){var m=e.getAllProjectOutputs(g,!o.useCaseSensitiveFileNames());if(m.length)for(var v=new e.Set(g.fileNames.map((function(e){return p(t,e)}))),h=0,b=m;h<b.length;h++){var D=b[h];v.has(p(t,D))||o.fileExists(D)&&(s?s.push(D):(o.deleteFile(D),Z(t,d,e.ConfigFileProgramReloadLevel.None)));}}else pe(t,d);}return s&&le(t,e.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0,s.map((function(e){return "\r\n * ".concat(e)})).join("")),e.ExitStatus.Success}(t,r,n);return e.performance.mark("SolutionBuilder::afterClean"),e.performance.measure("SolutionBuilder::Clean","SolutionBuilder::beforeClean","SolutionBuilder::afterClean"),i}function Z(t,r,n){t.host.getParsedCommandLine&&n===e.ConfigFileProgramReloadLevel.Partial&&(n=e.ConfigFileProgramReloadLevel.Full),n===e.ConfigFileProgramReloadLevel.Full&&(t.configFileCache.delete(r),t.buildOrder=void 0),t.needsSummary=!0,T(t,r),C(t,r,n),D(t);}function $(e,t,r){e.reportFileChangeDetected=!0,Z(e,t,r),ee(e,250,!0);}function ee(e,t,r){var n=e.hostWithWatch;n.setTimeout&&n.clearTimeout&&(e.timerToBuildInvalidatedProject&&n.clearTimeout(e.timerToBuildInvalidatedProject),e.timerToBuildInvalidatedProject=n.setTimeout(te,t,e,r));}function te(t,n){e.performance.mark("SolutionBuilder::beforeBuild");var i=function(t,n){t.timerToBuildInvalidatedProject=void 0,t.reportFileChangeDetected&&(t.reportFileChangeDetected=!1,t.projectErrorsReported.clear(),ue(t,e.Diagnostics.File_change_detected_Starting_incremental_compilation));var i=0,a=b(t),o=w(t,a,!1);if(o)for(o.done(),i++;t.projectPendingBuild.size;){if(t.timerToBuildInvalidatedProject)return;var s=F(t,a,!1);if(!s)break;if(s.kind!==r.UpdateOutputFileStamps&&(n||5===i))return void ee(t,100,!1);P(t,s,a).done(),s.kind!==r.UpdateOutputFileStamps&&i++;}return S(t),a}(t,n);e.performance.mark("SolutionBuilder::afterBuild"),e.performance.measure("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild"),i&&fe(t,i);}function re(t,r,n,i){t.watch&&!t.allWatchedConfigFiles.has(n)&&t.allWatchedConfigFiles.set(n,B(t,r,(function(){return $(t,n,e.ConfigFileProgramReloadLevel.Full)}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.ConfigFile,r));}function ne(t,r,n){e.updateSharedExtendedConfigFileWatcher(r,null==n?void 0:n.options,t.allWatchedExtendedConfigFiles,(function(r,i){return B(t,r,(function(){var r;return null===(r=t.allWatchedExtendedConfigFiles.get(i))||void 0===r?void 0:r.projects.forEach((function(r){return $(t,r,e.ConfigFileProgramReloadLevel.Full)}))}),e.PollingInterval.High,null==n?void 0:n.watchOptions,e.WatchType.ExtendedConfigFile)}),(function(e){return p(t,e)}));}function ie(t,r,n,i){t.watch&&e.updateWatchingWildcardDirectories(s(t.allWatchedWildcardDirectories,n),new e.Map(e.getEntries(i.wildcardDirectories)),(function(a,o){return t.watchDirectory(a,(function(o){var s;e.isIgnoredFileFromWildCardWatching({watchedDirPath:p(t,a),fileOrDirectory:o,fileOrDirectoryPath:p(t,o),configFileName:r,currentDirectory:t.currentDirectory,options:i.options,program:t.builderPrograms.get(n)||(null===(s=m(t,n))||void 0===s?void 0:s.fileNames),useCaseSensitiveFileNames:t.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:function(e){return t.writeLog(e)},toPath:function(e){return p(t,e)}})||$(t,n,e.ConfigFileProgramReloadLevel.Partial);}),o,null==i?void 0:i.watchOptions,e.WatchType.WildcardDirectory,r)}));}function ae(t,r,n,i){t.watch&&e.mutateMap(s(t.allWatchedInputFiles,n),e.arrayToMap(i.fileNames,(function(e){return p(t,e)})),{createNewValue:function(a,o){return B(t,o,(function(){return $(t,n,e.ConfigFileProgramReloadLevel.None)}),e.PollingInterval.Low,null==i?void 0:i.watchOptions,e.WatchType.SourceFile,r)},onDeleteValue:e.closeFileWatcher});}function oe(t,r,n,i){t.watch&&t.lastCachedPackageJsonLookups&&e.mutateMap(s(t.allWatchedPackageJsonFiles,n),new e.Map(t.lastCachedPackageJsonLookups.get(n)),{createNewValue:function(a,o){return B(t,a,(function(){return $(t,n,e.ConfigFileProgramReloadLevel.None)}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.PackageJson,r)},onDeleteValue:e.closeFileWatcher});}function se(t,r,n,i,a){var o=function(t,r,n,i,a){var o,s,c=r,l=r,u=c.getCurrentDirectory(),_=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),d=(o=i,s={},e.commonOptionsWithBuild.forEach((function(t){e.hasProperty(o,t.name)&&(s[t.name]=o[t.name]);})),s),p=e.createCompilerHostFromProgramHost(c,(function(){return T.projectCompilerOptions}));e.setGetSourceFileAsHashVersioned(p),p.getParsedCommandLine=function(e){return y(T,e,f(T,e))},p.resolveModuleNames=e.maybeBind(c,c.resolveModuleNames),p.resolveTypeReferenceDirectives=e.maybeBind(c,c.resolveTypeReferenceDirectives),p.getModuleResolutionCache=e.maybeBind(c,c.getModuleResolutionCache);var g=p.resolveModuleNames?void 0:e.createModuleResolutionCache(u,_),m=p.resolveTypeReferenceDirectives?void 0:e.createTypeReferenceDirectiveResolutionCache(u,_,void 0,null==g?void 0:g.getPackageJsonInfoCache());if(!p.resolveModuleNames){var v=function(t,r,n,i){return e.resolveModuleName(t,n,T.projectCompilerOptions,p,g,i,r).resolvedModule};p.resolveModuleNames=function(t,r,n,i,a,o){return e.loadWithModeAwareCache(e.Debug.checkEachDefined(t),e.Debug.checkDefined(o),r,i,v)},p.getModuleResolutionCache=function(){return g};}if(!p.resolveTypeReferenceDirectives){var h=function(t,r,n,i){return e.resolveTypeReferenceDirective(t,r,T.projectCompilerOptions,p,n,T.typeReferenceDirectiveResolutionCache,i).resolvedTypeReferenceDirective};p.resolveTypeReferenceDirectives=function(t,r,n,i,a){return e.loadWithTypeDirectiveCache(e.Debug.checkEachDefined(t),r,n,a,h)};}p.getBuildInfo=function(e,t){return U(T,e,f(T,t),void 0)};var b=e.createWatchFactory(l,i),x=b.watchFile,D=b.watchDirectory,S=b.writeLog,T={host:c,hostWithWatch:l,currentDirectory:u,getCanonicalFileName:_,parseConfigFileHost:e.parseConfigHostFromCompilerHostLike(c),write:e.maybeBind(c,c.trace),options:i,baseCompilerOptions:d,rootNames:n,baseWatchOptions:a,resolvedConfigFilePaths:new e.Map,configFileCache:new e.Map,projectStatus:new e.Map,extendedConfigCache:new e.Map,buildInfoCache:new e.Map,outputTimeStamps:new e.Map,builderPrograms:new e.Map,diagnostics:new e.Map,projectPendingBuild:new e.Map,projectErrorsReported:new e.Map,compilerHost:p,moduleResolutionCache:g,typeReferenceDirectiveResolutionCache:m,buildOrder:void 0,readFileWithCache:function(e){return c.readFile(e)},projectCompilerOptions:d,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:t,watch:t,allWatchedWildcardDirectories:new e.Map,allWatchedInputFiles:new e.Map,allWatchedConfigFiles:new e.Map,allWatchedExtendedConfigFiles:new e.Map,allWatchedPackageJsonFiles:new e.Map,filesWatched:new e.Map,lastCachedPackageJsonLookups:new e.Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:x,watchDirectory:D,writeLog:S};return T}(t,r,n,i,a);return {build:function(e,t,r,n){return X(o,e,t,r,n)},clean:function(e){return Y(o,e)},buildReferences:function(e,t,r,n){return X(o,e,t,r,n,!0)},cleanReferences:function(e){return Y(o,e,!0)},getNextInvalidatedProject:function(e){return E(o,e),w(o,b(o),!1)},getBuildOrder:function(){return b(o)},getUpToDateStatusOfProject:function(e){var t=v(o,e),r=f(o,t);return q(o,y(o,t,r),r)},invalidateProject:function(t,r){return Z(o,t,r||e.ConfigFileProgramReloadLevel.None)},close:function(){return function(t){e.clearMap(t.allWatchedConfigFiles,e.closeFileWatcher),e.clearMap(t.allWatchedExtendedConfigFiles,e.closeFileWatcherOf),e.clearMap(t.allWatchedWildcardDirectories,(function(t){return e.clearMap(t,e.closeFileWatcherOf)})),e.clearMap(t.allWatchedInputFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)})),e.clearMap(t.allWatchedPackageJsonFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)}));}(o)}}}function ce(t,r){return e.convertToRelativePath(r,t.currentDirectory,(function(e){return t.getCanonicalFileName(e)}))}function le(t,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];t.host.reportSolutionBuilderStatus(e.createCompilerDiagnostic.apply(void 0,n$4([r],i,!1)));}function ue(t,r){for(var i,a,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];null===(a=(i=t.hostWithWatch).onWatchStatusChange)||void 0===a||a.call(i,e.createCompilerDiagnostic.apply(void 0,n$4([r],o,!1)),t.host.getNewLine(),t.baseCompilerOptions);}function _e(e,t){var r=e.host;t.forEach((function(e){return r.reportDiagnostic(e)}));}function de(e,t,r){_e(e,r),e.projectErrorsReported.set(t,!0),r.length&&e.diagnostics.set(t,r);}function pe(e,t){de(e,t,[e.configFileCache.get(t)]);}function fe(t,r){if(t.needsSummary){t.needsSummary=!1;var i=t.watch||!!t.host.reportErrorSummary,a=t.diagnostics,o=0,s=[];l(r)?(ge(t,r.buildOrder),_e(t,r.circularDiagnostics),i&&(o+=e.getErrorCountForSummary(r.circularDiagnostics)),i&&(s=n$4(n$4([],s,!0),e.getFilesInErrorForSummary(r.circularDiagnostics),!0))):(r.forEach((function(r){var n=f(t,r);t.projectErrorsReported.has(n)||_e(t,a.get(n)||e.emptyArray);})),i&&a.forEach((function(t){return o+=e.getErrorCountForSummary(t)})),i&&a.forEach((function(t){return n$4(n$4([],s,!0),e.getFilesInErrorForSummary(t),!0)}))),t.watch?ue(t,e.getWatchErrorSummaryDiagnosticMessage(o),o):t.host.reportErrorSummary&&t.host.reportErrorSummary(o,s);}}function ge(t,r){t.options.verbose&&le(t,e.Diagnostics.Projects_in_this_build_Colon_0,r.map((function(e){return "\r\n  * "+ce(t,e)})).join(""));}function me(t,r,n){t.options.verbose&&function(t,r,n){switch(n.type){case e.UpToDateStatusType.OutOfDateWithSelf:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,ce(t,r),ce(t,n.outOfDateOutputFileName),ce(t,n.newerInputFileName));case e.UpToDateStatusType.OutOfDateWithUpstream:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,ce(t,r),ce(t,n.outOfDateOutputFileName),ce(t,n.newerProjectName));case e.UpToDateStatusType.OutputMissing:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist,ce(t,r),ce(t,n.missingOutputFileName));case e.UpToDateStatusType.ErrorReadingFile:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1,ce(t,r),ce(t,n.fileName));case e.UpToDateStatusType.OutOfDateBuildInfo:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,ce(t,r),ce(t,n.buildInfoFile));case e.UpToDateStatusType.UpToDate:if(void 0!==n.newestInputFileTime)return le(t,e.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,ce(t,r),ce(t,n.newestInputFileName||""),ce(t,n.oldestOutputFileName||""));break;case e.UpToDateStatusType.OutOfDateWithPrepend:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed,ce(t,r),ce(t,n.newerProjectName));case e.UpToDateStatusType.UpToDateWithUpstreamTypes:return le(t,e.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,ce(t,r));case e.UpToDateStatusType.UpToDateWithInputFileText:return le(t,e.Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,ce(t,r));case e.UpToDateStatusType.UpstreamOutOfDate:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,ce(t,r),ce(t,n.upstreamProjectName));case e.UpToDateStatusType.UpstreamBlocked:return le(t,n.upstreamProjectBlocked?e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,ce(t,r),ce(t,n.upstreamProjectName));case e.UpToDateStatusType.Unbuildable:return le(t,e.Diagnostics.Failed_to_parse_file_0_Colon_1,ce(t,r),n.reason);case e.UpToDateStatusType.TsVersionOutputOfDate:return le(t,e.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,ce(t,r),n.version,e.version);case e.UpToDateStatusType.ForceBuild:return le(t,e.Diagnostics.Project_0_is_being_forcibly_rebuilt,ce(t,r));case e.UpToDateStatusType.ContainerOnly:case e.UpToDateStatusType.ComputingUpstream:break;default:e.assertType(n);}}(t,r,n);}!function(e){e[e.None=0]="None",e[e.Success=1]="Success",e[e.DeclarationOutputUnchanged=2]="DeclarationOutputUnchanged",e[e.ConfigFileErrors=4]="ConfigFileErrors",e[e.SyntaxErrors=8]="SyntaxErrors",e[e.TypeErrors=16]="TypeErrors",e[e.DeclarationEmitErrors=32]="DeclarationEmitErrors",e[e.EmitErrors=64]="EmitErrors",e[e.AnyErrors=124]="AnyErrors";}(t||(t={})),e.getCurrentTime=c,e.isCircularBuildOrder=l,e.getBuildOrderFromAnyBuildOrder=u,e.createBuilderStatusReporter=_,e.createSolutionBuilderHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=d(t,r,n,i);return o.reportErrorSummary=a,o},e.createSolutionBuilderWithWatchHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=d(t,r,n,i),s=e.createWatchHost(t,a);return e.copyProperties(o,s),o},e.createSolutionBuilder=function(e,t,r){return se(!1,e,t,r)},e.createSolutionBuilderWithWatch=function(e,t,r,n){return se(!0,e,t,r,n)},function(e){e[e.Build=0]="Build",e[e.UpdateBundle=1]="UpdateBundle",e[e.UpdateOutputFileStamps=2]="UpdateOutputFileStamps";}(r=e.InvalidatedProjectKind||(e.InvalidatedProjectKind={})),function(e){e[e.CreateProgram=0]="CreateProgram",e[e.SyntaxDiagnostics=1]="SyntaxDiagnostics",e[e.SemanticDiagnostics=2]="SemanticDiagnostics",e[e.Emit=3]="Emit",e[e.EmitBundle=4]="EmitBundle",e[e.EmitBuildInfo=5]="EmitBuildInfo",e[e.BuildInvalidatedProjectOfBundle=6]="BuildInvalidatedProjectOfBundle",e[e.QueueReferencingProjects=7]="QueueReferencingProjects",e[e.Done=8]="Done";}(i||(i={}));}(t),function(e){var t,r;(t=e.server||(e.server={})).ActionSet="action::set",t.ActionInvalidate="action::invalidate",t.ActionPackageInstalled="action::packageInstalled",t.EventTypesRegistry="event::typesRegistry",t.EventBeginInstallTypes="event::beginInstallTypes",t.EventEndInstallTypes="event::endInstallTypes",t.EventInitializationFailed="event::initializationFailed",(r=t.Arguments||(t.Arguments={})).GlobalCacheLocation="--globalTypingsCacheLocation",r.LogFile="--logFile",r.EnableTelemetry="--enableTelemetry",r.TypingSafeListLocation="--typingSafeListLocation",r.TypesMapLocation="--typesMapLocation",r.NpmLocation="--npmLocation",r.ValidateDefaultNpmLocation="--validateDefaultNpmLocation",t.hasArgument=function(t){return e.sys.args.indexOf(t)>=0},t.findArgument=function(t){var r=e.sys.args.indexOf(t);return r>=0&&r<e.sys.args.length-1?e.sys.args[r+1]:void 0},t.nowString=function(){var t=new Date;return "".concat(e.padLeft(t.getHours().toString(),2,"0"),":").concat(e.padLeft(t.getMinutes().toString(),2,"0"),":").concat(e.padLeft(t.getSeconds().toString(),2,"0"),".").concat(e.padLeft(t.getMilliseconds().toString(),3,"0"))};}(t),function(e){!function(t){function r(t,r){return new e.Version(e.getProperty(r,"ts".concat(e.versionMajorMinor))||e.getProperty(r,"latest")).compareTo(t.version)<=0}t.isTypingUpToDate=r;var i,a=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","https","http2","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","string_decoder","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];function o(e){return t.nodeCoreModules.has(e)?"node":e}function s(e,t){if(!e)return 1;if(e.length>214)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){var r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){var n=s(r[1],!1);if(0!==n)return {name:r[1],isScopeName:!0,result:n};var i=s(r[2],!1);return 0!==i?{name:r[2],isScopeName:!1,result:i}:0}}return encodeURIComponent(e)!==e?5:0}function c(t,r,n,i){var a=i?"Scope":"Package";switch(r){case 1:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot be empty");case 2:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' should be less than ").concat(214," characters");case 3:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '.'");case 4:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '_'");case 5:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' contains non URI safe characters");case 0:return e.Debug.fail();default:throw e.Debug.assertNever(r)}}t.prefixedNodeCoreModuleList=a.map((function(e){return "node:".concat(e)})),t.nodeCoreModuleList=n$4(n$4([],a,!0),t.prefixedNodeCoreModuleList,!0),t.nodeCoreModules=new e.Set(t.nodeCoreModuleList),t.nonRelativeModuleNameForTypingCache=o,t.loadSafeList=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));return new e.Map(e.getEntries(n.config))},t.loadTypesMap=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));if(n.config)return new e.Map(e.getEntries(n.config.simpleMap))},t.discoverTypings=function(t,n,i,a,s,c,l,u,_,d){if(!l||!l.enable)return {cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]};var p=new e.Map;i=e.mapDefined(i,(function(t){var r=e.normalizePath(t);if(e.hasJSFileExtension(r))return r}));var f=[];l.include&&T(l.include,"Explicitly included types");var g=l.exclude||[];if(!d.types){var m=new e.Set(i.map(e.getDirectoryPath));m.add(a),m.forEach((function(e){C(e,"bower.json","bower_components",f),C(e,"package.json","node_modules",f);}));}l.disableFilenameBasedTypeAcquisition||function(t){var r=e.mapDefined(t,(function(t){if(e.hasJSFileExtension(t)){var r=e.removeFileExtension(e.getBaseFileName(t.toLowerCase())),n=e.removeMinAndVersionNumbers(r);return s.get(n)}}));r.length&&T(r,"Inferred typings from file names"),e.some(t,(function(t){return e.fileExtensionIs(t,".jsx")}))&&(n&&n("Inferred 'react' typings due to presence of '.jsx' extension"),S("react"));}(i),u&&T(e.deduplicate(u.map(o),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive),"Inferred typings from unresolved imports"),c.forEach((function(e,t){var n=_.get(t);p.has(t)&&void 0===p.get(t)&&void 0!==n&&r(e,n)&&p.set(t,e.typingLocation);}));for(var y=0,v=g;y<v.length;y++){var h=v[y];p.delete(h)&&n&&n("Typing for ".concat(h," is in exclude list, will be ignored."));}var b=[],x=[];p.forEach((function(e,t){void 0!==e?x.push(e):b.push(t);}));var D={cachedTypingPaths:x,newTypingNames:b,filesToWatch:f};return n&&n("Result: ".concat(JSON.stringify(D))),D;function S(e){p.has(e)||p.set(e,void 0);}function T(t,r){n&&n("".concat(r,": ").concat(JSON.stringify(t))),e.forEach(t,S);}function C(r,i,a,o){var s,c,l=e.combinePaths(r,i);t.fileExists(l)&&(o.push(l),s=e.readConfigFile(l,(function(e){return t.readFile(e)})).config,T(c=e.flatMap([s.dependencies,s.devDependencies,s.optionalDependencies,s.peerDependencies],e.getOwnKeys),"Typing names in '".concat(l,"' dependencies")));var u=e.combinePaths(r,a);if(o.push(u),t.directoryExists(u)){var _=[],d=c?c.map((function(t){return e.combinePaths(u,t,i)})):t.readDirectory(u,[".json"],void 0,void 0,3).filter((function(t){if(e.getBaseFileName(t)!==i)return !1;var r=e.getPathComponents(e.normalizePath(t)),n="@"===r[r.length-3][0];return n&&r[r.length-4].toLowerCase()===a||!n&&r[r.length-3].toLowerCase()===a}));n&&n("Searching for typing names in ".concat(u,"; all files: ").concat(JSON.stringify(d)));for(var f=0,g=d;f<g.length;f++){var m=g[f],y=e.normalizePath(m),v=e.readConfigFile(y,(function(e){return t.readFile(e)})).config;if(v.name){var h=v.types||v.typings;if(h){var b=e.getNormalizedAbsolutePath(h,e.getDirectoryPath(y));t.fileExists(b)?(n&&n("  Package '".concat(v.name,"' provides its own types.")),p.set(v.name,b)):n&&n("  Package '".concat(v.name,"' provides its own types but they are missing."));}else _.push(v.name);}}T(_,"  Found package names");}}},(i=t.NameValidationResult||(t.NameValidationResult={}))[i.Ok=0]="Ok",i[i.EmptyName=1]="EmptyName",i[i.NameTooLong=2]="NameTooLong",i[i.NameStartsWithDot=3]="NameStartsWithDot",i[i.NameStartsWithUnderscore=4]="NameStartsWithUnderscore",i[i.NameContainsNonURISafeCharacters=5]="NameContainsNonURISafeCharacters",t.validatePackageName=function(e){return s(e,!0)},t.renderPackageNameValidationFailure=function(e,t){return "object"==typeof e?c(t,e.result,e.name,e.isScopeName):c(t,e,t,!1)};}(e.JsTyping||(e.JsTyping={}));}(t),function(e){var t,r,n,i,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x,D;function S(e){return {indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:t.Smart,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:r.Ignore,trimTrailingWhitespace:!0}}x=e.ScriptSnapshot||(e.ScriptSnapshot={}),D=function(){function e(e){this.text=e;}return e.prototype.getText=function(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(){},e}(),x.fromString=function(e){return new D(e)},(b=e.PackageJsonDependencyGroup||(e.PackageJsonDependencyGroup={}))[b.Dependencies=1]="Dependencies",b[b.DevDependencies=2]="DevDependencies",b[b.PeerDependencies=4]="PeerDependencies",b[b.OptionalDependencies=8]="OptionalDependencies",b[b.All=15]="All",(h=e.PackageJsonAutoImportPreference||(e.PackageJsonAutoImportPreference={}))[h.Off=0]="Off",h[h.On=1]="On",h[h.Auto=2]="Auto",(v=e.LanguageServiceMode||(e.LanguageServiceMode={}))[v.Semantic=0]="Semantic",v[v.PartialSemantic=1]="PartialSemantic",v[v.Syntactic=2]="Syntactic",e.emptyOptions={},(y=e.SemanticClassificationFormat||(e.SemanticClassificationFormat={})).Original="original",y.TwentyTwenty="2020",(m=e.OrganizeImportsMode||(e.OrganizeImportsMode={})).All="All",m.SortAndCombine="SortAndCombine",m.RemoveUnused="RemoveUnused",(g=e.CompletionTriggerKind||(e.CompletionTriggerKind={}))[g.Invoked=1]="Invoked",g[g.TriggerCharacter=2]="TriggerCharacter",g[g.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",(f=e.InlayHintKind||(e.InlayHintKind={})).Type="Type",f.Parameter="Parameter",f.Enum="Enum",(p=e.HighlightSpanKind||(e.HighlightSpanKind={})).none="none",p.definition="definition",p.reference="reference",p.writtenReference="writtenReference",function(e){e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart";}(t=e.IndentStyle||(e.IndentStyle={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove";}(r=e.SemicolonPreference||(e.SemicolonPreference={})),e.getDefaultFormatCodeSettings=S,e.testFormatSettings=S("\n"),(d=e.SymbolDisplayPartKind||(e.SymbolDisplayPartKind={}))[d.aliasName=0]="aliasName",d[d.className=1]="className",d[d.enumName=2]="enumName",d[d.fieldName=3]="fieldName",d[d.interfaceName=4]="interfaceName",d[d.keyword=5]="keyword",d[d.lineBreak=6]="lineBreak",d[d.numericLiteral=7]="numericLiteral",d[d.stringLiteral=8]="stringLiteral",d[d.localName=9]="localName",d[d.methodName=10]="methodName",d[d.moduleName=11]="moduleName",d[d.operator=12]="operator",d[d.parameterName=13]="parameterName",d[d.propertyName=14]="propertyName",d[d.punctuation=15]="punctuation",d[d.space=16]="space",d[d.text=17]="text",d[d.typeParameterName=18]="typeParameterName",d[d.enumMemberName=19]="enumMemberName",d[d.functionName=20]="functionName",d[d.regularExpressionLiteral=21]="regularExpressionLiteral",d[d.link=22]="link",d[d.linkName=23]="linkName",d[d.linkText=24]="linkText",(_=e.CompletionInfoFlags||(e.CompletionInfoFlags={}))[_.None=0]="None",_[_.MayIncludeAutoImports=1]="MayIncludeAutoImports",_[_.IsImportStatementCompletion=2]="IsImportStatementCompletion",_[_.IsContinuation=4]="IsContinuation",_[_.ResolvedModuleSpecifiers=8]="ResolvedModuleSpecifiers",_[_.ResolvedModuleSpecifiersBeyondLimit=16]="ResolvedModuleSpecifiersBeyondLimit",_[_.MayIncludeMethodSnippets=32]="MayIncludeMethodSnippets",(u=e.OutliningSpanKind||(e.OutliningSpanKind={})).Comment="comment",u.Region="region",u.Code="code",u.Imports="imports",(l=e.OutputFileType||(e.OutputFileType={}))[l.JavaScript=0]="JavaScript",l[l.SourceMap=1]="SourceMap",l[l.Declaration=2]="Declaration",(c=e.EndOfLineState||(e.EndOfLineState={}))[c.None=0]="None",c[c.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",c[c.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",c[c.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",c[c.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",c[c.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",c[c.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",(s=e.TokenClass||(e.TokenClass={}))[s.Punctuation=0]="Punctuation",s[s.Keyword=1]="Keyword",s[s.Operator=2]="Operator",s[s.Comment=3]="Comment",s[s.Whitespace=4]="Whitespace",s[s.Identifier=5]="Identifier",s[s.NumberLiteral=6]="NumberLiteral",s[s.BigIntLiteral=7]="BigIntLiteral",s[s.StringLiteral=8]="StringLiteral",s[s.RegExpLiteral=9]="RegExpLiteral",(o=e.ScriptElementKind||(e.ScriptElementKind={})).unknown="",o.warning="warning",o.keyword="keyword",o.scriptElement="script",o.moduleElement="module",o.classElement="class",o.localClassElement="local class",o.interfaceElement="interface",o.typeElement="type",o.enumElement="enum",o.enumMemberElement="enum member",o.variableElement="var",o.localVariableElement="local var",o.functionElement="function",o.localFunctionElement="local function",o.memberFunctionElement="method",o.memberGetAccessorElement="getter",o.memberSetAccessorElement="setter",o.memberVariableElement="property",o.memberAccessorVariableElement="accessor",o.constructorImplementationElement="constructor",o.callSignatureElement="call",o.indexSignatureElement="index",o.constructSignatureElement="construct",o.parameterElement="parameter",o.typeParameterElement="type parameter",o.primitiveType="primitive type",o.label="label",o.alias="alias",o.constElement="const",o.letElement="let",o.directory="directory",o.externalModuleName="external module name",o.jsxAttribute="JSX attribute",o.string="string",o.link="link",o.linkName="link name",o.linkText="link text",(a=e.ScriptElementKindModifier||(e.ScriptElementKindModifier={})).none="",a.publicMemberModifier="public",a.privateMemberModifier="private",a.protectedMemberModifier="protected",a.exportedModifier="export",a.ambientModifier="declare",a.staticModifier="static",a.abstractModifier="abstract",a.optionalModifier="optional",a.deprecatedModifier="deprecated",a.dtsModifier=".d.ts",a.tsModifier=".ts",a.tsxModifier=".tsx",a.jsModifier=".js",a.jsxModifier=".jsx",a.jsonModifier=".json",a.dmtsModifier=".d.mts",a.mtsModifier=".mts",a.mjsModifier=".mjs",a.dctsModifier=".d.cts",a.ctsModifier=".cts",a.cjsModifier=".cjs",(i=e.ClassificationTypeNames||(e.ClassificationTypeNames={})).comment="comment",i.identifier="identifier",i.keyword="keyword",i.numericLiteral="number",i.bigintLiteral="bigint",i.operator="operator",i.stringLiteral="string",i.whiteSpace="whitespace",i.text="text",i.punctuation="punctuation",i.className="class name",i.enumName="enum name",i.interfaceName="interface name",i.moduleName="module name",i.typeParameterName="type parameter name",i.typeAliasName="type alias name",i.parameterName="parameter name",i.docCommentTagName="doc comment tag name",i.jsxOpenTagName="jsx open tag name",i.jsxCloseTagName="jsx close tag name",i.jsxSelfClosingTagName="jsx self closing tag name",i.jsxAttribute="jsx attribute",i.jsxText="jsx text",i.jsxAttributeStringLiteralValue="jsx attribute string literal value",(n=e.ClassificationType||(e.ClassificationType={}))[n.comment=1]="comment",n[n.identifier=2]="identifier",n[n.keyword=3]="keyword",n[n.numericLiteral=4]="numericLiteral",n[n.operator=5]="operator",n[n.stringLiteral=6]="stringLiteral",n[n.regularExpressionLiteral=7]="regularExpressionLiteral",n[n.whiteSpace=8]="whiteSpace",n[n.text=9]="text",n[n.punctuation=10]="punctuation",n[n.className=11]="className",n[n.enumName=12]="enumName",n[n.interfaceName=13]="interfaceName",n[n.moduleName=14]="moduleName",n[n.typeParameterName=15]="typeParameterName",n[n.typeAliasName=16]="typeAliasName",n[n.parameterName=17]="parameterName",n[n.docCommentTagName=18]="docCommentTagName",n[n.jsxOpenTagName=19]="jsxOpenTagName",n[n.jsxCloseTagName=20]="jsxCloseTagName",n[n.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",n[n.jsxAttribute=22]="jsxAttribute",n[n.jsxText=23]="jsxText",n[n.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",n[n.bigintLiteral=25]="bigintLiteral";}(t),function(e){function t(t){switch(t.kind){case 257:return e.isInJSFile(t)&&e.getJSDocEnumTag(t)?7:1;case 166:case 205:case 169:case 168:case 299:case 300:case 171:case 170:case 173:case 174:case 175:case 259:case 215:case 216:case 295:case 288:return 1;case 165:case 261:case 262:case 184:return 2;case 348:return void 0===t.name?3:2;case 302:case 260:return 3;case 264:return e.isAmbientModule(t)||1===e.getModuleInstanceState(t)?5:4;case 263:case 272:case 273:case 268:case 269:case 274:case 275:return 7;case 308:return 5}return 7}function r(t){for(;163===t.parent.kind;)t=t.parent;return e.isInternalModuleImportEqualsDeclaration(t.parent)&&t.parent.moduleReference===t}function n(e){return e.expression}function a(e){return e.tag}function o(e){return e.tagName}function s(t,r,n,i,a){var o=i?l(t):c(t);return a&&(o=e.skipOuterExpressions(o)),!!o&&!!o.parent&&r(o.parent)&&n(o.parent)===o}function c(e){return d(e)?e.parent:e}function l(e){return d(e)||p(e)?e.parent:e}function u(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isBreakOrContinueStatement))||void 0===r?void 0:r.label)===t}function _(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isLabeledStatement))||void 0===r?void 0:r.label)===t}function d(t){var r;return (null===(r=e.tryCast(t.parent,e.isPropertyAccessExpression))||void 0===r?void 0:r.name)===t}function p(t){var r;return (null===(r=e.tryCast(t.parent,e.isElementAccessExpression))||void 0===r?void 0:r.argumentExpression)===t}var f;e.scanner=e.createScanner(99,!0),(f=e.SemanticMeaning||(e.SemanticMeaning={}))[f.None=0]="None",f[f.Value=1]="Value",f[f.Type=2]="Type",f[f.Namespace=4]="Namespace",f[f.All=7]="All",e.getMeaningFromDeclaration=t,e.getMeaningFromLocation=function(n){var i=(n=w(n)).parent;return 308===n.kind?1:e.isExportAssignment(i)||e.isExportSpecifier(i)||e.isExternalModuleReference(i)||e.isImportSpecifier(i)||e.isImportClause(i)||e.isImportEqualsDeclaration(i)&&n===i.name?7:r(n)?function(t){var r=163===t.kind?t:e.isQualifiedName(t.parent)&&t.parent.right===t?t.parent:void 0;return r&&268===r.parent.kind?7:4}(n):e.isDeclarationName(n)?t(i):e.isEntityName(n)&&e.findAncestor(n,e.or(e.isJSDocNameReference,e.isJSDocLinkLike,e.isJSDocMemberName))?7:function(t){switch(e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),t.kind){case 108:return !e.isExpressionNode(t);case 194:return !0}switch(t.parent.kind){case 180:return !0;case 202:return !t.parent.isTypeOf;case 230:return e.isPartOfTypeNode(t.parent)}return !1}(n)?2:function(e){return function(e){var t=e,r=!0;if(163===t.parent.kind){for(;t.parent&&163===t.parent.kind;)t=t.parent;r=t.right===e;}return 180===t.parent.kind&&!r}(e)||function(e){var t=e,r=!0;if(208===t.parent.kind){for(;t.parent&&208===t.parent.kind;)t=t.parent;r=t.name===e;}if(!r&&230===t.parent.kind&&294===t.parent.parent.kind){var n=t.parent.parent.parent;return 260===n.kind&&117===t.parent.parent.token||261===n.kind&&94===t.parent.parent.token}return !1}(e)}(n)?4:e.isTypeParameterDeclaration(i)?(e.Debug.assert(e.isJSDocTemplateTag(i.parent)),2):e.isLiteralTypeNode(i)?3:1},e.isInRightSideOfInternalImportEqualsDeclaration=r,e.isCallExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallExpression,n,r,i)},e.isNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isNewExpression,n,r,i)},e.isCallOrNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallOrNewExpression,n,r,i)},e.isTaggedTemplateTag=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isTaggedTemplateExpression,a,r,n)},e.isDecoratorTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isDecorator,n,r,i)},e.isJsxOpeningLikeElementTagName=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isJsxOpeningLikeElement,o,r,n)},e.climbPastPropertyAccess=c,e.climbPastPropertyOrElementAccess=l,e.getTargetLabel=function(e,t){for(;e;){if(253===e.kind&&e.label.escapedText===t)return e.label;e=e.parent;}},e.hasPropertyAccessExpressionWithName=function(t,r){return !!e.isPropertyAccessExpression(t.expression)&&t.expression.name.text===r},e.isJumpStatementTarget=u,e.isLabelOfLabeledStatement=_,e.isLabelName=function(e){return _(e)||u(e)},e.isTagName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isJSDocTag))||void 0===r?void 0:r.tagName)===t},e.isRightSideOfQualifiedName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isQualifiedName))||void 0===r?void 0:r.right)===t},e.isRightSideOfPropertyAccess=d,e.isArgumentExpressionOfElementAccess=p,e.isNameOfModuleDeclaration=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isModuleDeclaration))||void 0===r?void 0:r.name)===t},e.isNameOfFunctionDeclaration=function(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isFunctionLike))||void 0===r?void 0:r.name)===t},e.isLiteralNameOfPropertyDeclarationOrIndexAccess=function(t){switch(t.parent.kind){case 169:case 168:case 299:case 302:case 171:case 170:case 174:case 175:case 264:return e.getNameOfDeclaration(t.parent)===t;case 209:return t.parent.argumentExpression===t;case 164:return !0;case 198:return 196===t.parent.parent.kind;default:return !1}},e.isExpressionOfExternalModuleImportEqualsDeclaration=function(t){return e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t},e.getContainerNode=function(t){for(e.isJSDocTypeAlias(t)&&(t=t.parent.parent);;){if(!(t=t.parent))return;switch(t.kind){case 308:case 171:case 170:case 259:case 215:case 174:case 175:case 260:case 261:case 263:case 264:return t}}},e.getNodeKind=function t(r){switch(r.kind){case 308:return e.isExternalModule(r)?"module":"script";case 264:return "module";case 260:case 228:return "class";case 261:return "interface";case 262:case 341:case 348:return "type";case 263:return "enum";case 257:return c(r);case 205:return c(e.getRootDeclaration(r));case 216:case 259:case 215:return "function";case 174:return "getter";case 175:return "setter";case 171:case 170:return "method";case 299:var n=r.initializer;return e.isFunctionLike(n)?"method":"property";case 169:case 168:case 300:case 301:return "property";case 178:return "index";case 177:return "construct";case 176:return "call";case 173:case 172:return "constructor";case 165:return "type parameter";case 302:return "enum member";case 166:return e.hasSyntacticModifier(r,16476)?"property":"parameter";case 268:case 273:case 278:case 271:case 277:return "alias";case 223:var i=e.getAssignmentDeclarationKind(r),a=r.right;switch(i){case 7:case 8:case 9:case 0:return "";case 1:case 2:var o=t(a);return ""===o?"const":o;case 3:case 5:return e.isFunctionExpression(a)?"method":"property";case 4:return "property";case 6:return "local class";default:return e.assertType(i),""}case 79:return e.isImportClause(r.parent)?"alias":"";case 274:var s=t(r.expression);return ""===s?"const":s;default:return ""}function c(t){return e.isVarConst(t)?"const":e.isLet(t)?"let":"var"}},e.isThis=function(t){switch(t.kind){case 108:return !0;case 79:return e.identifierIsThisKeyword(t)&&166===t.parent.kind;default:return !1}};var g,m=/^\/\/\/\s*</;function y(e,t){return h(e.pos,e.end,t)}function v(e,t){return e.pos<t&&t<e.end}function h(e,t,r){return e<=r.pos&&t>=r.end}function b(e,t,r,n){return Math.max(e,r)<Math.min(t,n)}function x(t,r){if(void 0===t||e.nodeIsMissing(t))return !1;switch(t.kind){case 260:case 261:case 263:case 207:case 203:case 184:case 238:case 265:case 266:case 272:case 276:return D(t,19,r);case 295:return x(t.block,r);case 211:if(!t.arguments)return !0;case 210:case 214:case 193:return D(t,21,r);case 181:case 182:return x(t.type,r);case 173:case 174:case 175:case 259:case 215:case 171:case 170:case 177:case 176:case 216:return t.body?x(t.body,r):t.type?x(t.type,r):S(t,21,r);case 264:return !!t.body&&x(t.body,r);case 242:return t.elseStatement?x(t.elseStatement,r):x(t.thenStatement,r);case 241:return x(t.expression,r)||S(t,26,r);case 206:case 204:case 209:case 164:case 186:return D(t,23,r);case 178:return t.type?x(t.type,r):S(t,23,r);case 292:case 293:return !1;case 245:case 246:case 247:case 244:return x(t.statement,r);case 243:return S(t,115,r)?D(t,21,r):x(t.statement,r);case 183:return x(t.exprName,r);case 218:case 217:case 219:case 226:case 227:return x(t.expression,r);case 212:return x(t.template,r);case 225:return x(e.lastOrUndefined(t.templateSpans),r);case 236:return e.nodeIsPresent(t.literal);case 275:case 269:return e.nodeIsPresent(t.moduleSpecifier);case 221:return x(t.operand,r);case 223:return x(t.right,r);case 224:return x(t.whenFalse,r);default:return !0}}function D(t,r,n){var i=t.getChildren(n);if(i.length){var a=e.last(i);if(a.kind===r)return !0;if(26===a.kind&&1!==i.length)return i[i.length-2].kind===r}return !1}function S(e,t,r){return !!T(e,t,r)}function T(t,r,n){return e.find(t.getChildren(n),(function(e){return e.kind===r}))}function C(t){var r=e.find(t.parent.getChildren(),(function(r){return e.isSyntaxList(r)&&y(r,t)}));return e.Debug.assert(!r||e.contains(r.getChildren(),t)),r}function E(e){return 88===e.kind}function k(e){return 84===e.kind}function N(e){return 98===e.kind}function A(t,r){if(t.importClause){if(t.importClause.name&&t.importClause.namedBindings)return;if(t.importClause.name)return t.importClause.name;if(t.importClause.namedBindings){if(e.isNamedImports(t.importClause.namedBindings)){var n=e.singleOrUndefined(t.importClause.namedBindings.elements);if(!n)return;return n.name}if(e.isNamespaceImport(t.importClause.namedBindings))return t.importClause.namedBindings.name}}if(!r)return t.moduleSpecifier}function F(t,r){if(t.exportClause){if(e.isNamedExports(t.exportClause)){if(!e.singleOrUndefined(t.exportClause.elements))return;return t.exportClause.elements[0].name}if(e.isNamespaceExport(t.exportClause))return t.exportClause.name}if(!r)return t.moduleSpecifier}function P(t,r){var n=t.parent;if((e.isModifier(t)&&(r||88!==t.kind)?e.canHaveModifiers(n)&&e.contains(n.modifiers,t):84===t.kind?e.isClassDeclaration(n)||e.isClassExpression(t):98===t.kind?e.isFunctionDeclaration(n)||e.isFunctionExpression(t):118===t.kind?e.isInterfaceDeclaration(n):92===t.kind?e.isEnumDeclaration(n):154===t.kind?e.isTypeAliasDeclaration(n):143===t.kind||142===t.kind?e.isModuleDeclaration(n):100===t.kind?e.isImportEqualsDeclaration(n):137===t.kind?e.isGetAccessorDeclaration(n):151===t.kind&&e.isSetAccessorDeclaration(n))&&(a=function(t,r){if(!r)switch(t.kind){case 260:case 228:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isClassDeclaration(t)){var r=t.modifiers&&e.find(t.modifiers,E);if(r)return r}if(e.isClassExpression(t)){var n=e.find(t.getChildren(),k);if(n)return n}}(t);case 259:case 215:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isFunctionDeclaration(t)){var r=e.find(t.modifiers,E);if(r)return r}if(e.isFunctionExpression(t)){var n=e.find(t.getChildren(),N);if(n)return n}}(t);case 173:return t}if(e.isNamedDeclaration(t))return t.name}(n,r)))return a;if((113===t.kind||85===t.kind||119===t.kind)&&e.isVariableDeclarationList(n)&&1===n.declarations.length){var i=n.declarations[0];if(e.isIdentifier(i.name))return i.name}if(154===t.kind){if(e.isImportClause(n)&&n.isTypeOnly&&(a=A(n.parent,r)))return a;if(e.isExportDeclaration(n)&&n.isTypeOnly&&(a=F(n,r)))return a}if(128===t.kind){if(e.isImportSpecifier(n)&&n.propertyName||e.isExportSpecifier(n)&&n.propertyName||e.isNamespaceImport(n)||e.isNamespaceExport(n))return n.name;if(e.isExportDeclaration(n)&&n.exportClause&&e.isNamespaceExport(n.exportClause))return n.exportClause.name}if(100===t.kind&&e.isImportDeclaration(n)&&(a=A(n,r)))return a;if(93===t.kind){if(e.isExportDeclaration(n)&&(a=F(n,r)))return a;if(e.isExportAssignment(n))return e.skipOuterExpressions(n.expression)}if(147===t.kind&&e.isExternalModuleReference(n))return n.expression;if(158===t.kind&&(e.isImportDeclaration(n)||e.isExportDeclaration(n))&&n.moduleSpecifier)return n.moduleSpecifier;if((94===t.kind||117===t.kind)&&e.isHeritageClause(n)&&n.token===t.kind){var a=function(e){if(1===e.types.length)return e.types[0].expression}(n);if(a)return a}if(94===t.kind){if(e.isTypeParameterDeclaration(n)&&n.constraint&&e.isTypeReferenceNode(n.constraint))return n.constraint.typeName;if(e.isConditionalTypeNode(n)&&e.isTypeReferenceNode(n.extendsType))return n.extendsType.typeName}if(138===t.kind&&e.isInferTypeNode(n))return n.typeParameter.name;if(101===t.kind&&e.isTypeParameterDeclaration(n)&&e.isMappedTypeNode(n.parent))return n.name;if(141===t.kind&&e.isTypeOperatorNode(n)&&141===n.operator&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(146===t.kind&&e.isTypeOperatorNode(n)&&146===n.operator&&e.isArrayTypeNode(n.type)&&e.isTypeReferenceNode(n.type.elementType))return n.type.elementType.typeName;if(!r){if((103===t.kind&&e.isNewExpression(n)||114===t.kind&&e.isVoidExpression(n)||112===t.kind&&e.isTypeOfExpression(n)||133===t.kind&&e.isAwaitExpression(n)||125===t.kind&&e.isYieldExpression(n)||89===t.kind&&e.isDeleteExpression(n))&&n.expression)return e.skipOuterExpressions(n.expression);if((101===t.kind||102===t.kind)&&e.isBinaryExpression(n)&&n.operatorToken===t)return e.skipOuterExpressions(n.right);if(128===t.kind&&e.isAsExpression(n)&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(101===t.kind&&e.isForInStatement(n)||162===t.kind&&e.isForOfStatement(n))return e.skipOuterExpressions(n.expression)}return t}function w(e){return P(e,!1)}function I(e,t,r){return M(e,t,!1,r,!1)}function O(e,t){return M(e,t,!0,void 0,!1)}function M(t,r,n,i,a){for(var o,s=t,c=function(){var a=s.getChildren(t),c=e.binarySearchKey(a,r,(function(e,t){return t}),(function(e,o){var s=a[e].getEnd();if(s<r)return -1;var c=n?a[e].getFullStart():a[e].getStart(t,!0);return c>r?1:u(a[e],c,s)?a[e-1]&&u(a[e-1])?1:0:i&&c===r&&a[e-1]&&a[e-1].getEnd()===r&&u(a[e-1])?1:-1}));return o?{value:o}:c>=0&&a[c]?(s=a[c],"continue-outer"):{value:s}};;){var l=c();if("object"==typeof l)return l.value}function u(e,s,c){if(null!=c||(c=e.getEnd()),c<r)return !1;if(null!=s||(s=n?e.getFullStart():e.getStart(t,!0)),s>r)return !1;if(r<c||r===c&&(1===e.kind||a))return !0;if(i&&c===r){var l=R(r,t,e);if(l&&i(l))return o=l,!0}return !1}}function L(t,r,n){return function r(i){return e.isToken(i)&&i.pos===t.end?i:e.firstDefined(i.getChildren(n),(function(e){return (e.pos<=t.pos&&e.end>t.end||e.pos===t.end)&&H(e,n)?r(e):void 0}))}(r)}function R(t,r,n,i){var a=function a(o){if(B(o)&&1!==o.kind)return o;var s=o.getChildren(r),c=e.binarySearchKey(s,t,(function(e,t){return t}),(function(e,r){return t<s[e].end?!s[e-1]||t>=s[e-1].end?0:1:-1}));if(c>=0&&s[c]){var l=s[c];if(t<l.end){if(l.getStart(r,!i)>=t||!H(l,r)||z(l)){var u=J(s,c,r,o.kind);return u&&j(u,r)}return a(l)}}e.Debug.assert(void 0!==n||308===o.kind||1===o.kind||e.isJSDocCommentContainingNode(o));var _=J(s,s.length,r,o.kind);return _&&j(_,r)}(n||r);return e.Debug.assert(!(a&&z(a))),a}function B(t){return e.isToken(t)&&!z(t)}function j(e,t){if(B(e))return e;var r=e.getChildren(t);if(0===r.length)return e;var n=J(r,r.length,t,e.kind);return n&&j(n,t)}function J(t,r,n,i){for(var a=r-1;a>=0;a--)if(z(t[a]))0!==a||11!==i&&282!==i||e.Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(H(t[a],n))return t[a]}function z(t){return e.isJsxText(t)&&t.containsOnlyTriviaWhiteSpaces}function U(t,r,n){var i=e.tokenToString(t.kind),a=e.tokenToString(r),o=t.getFullStart(),s=n.text.lastIndexOf(a,o);if(-1!==s){if(n.text.lastIndexOf(i,o-1)<s){var c=R(s+1,n);if(c&&c.kind===r)return c}for(var l=t.kind,u=0;;){var _=R(t.getFullStart(),n);if(!_)return;if((t=_).kind===r){if(0===u)return t;u--;}else t.kind===l&&u++;}}}function K(e,t,r){return t?e.getNonNullableType():r?e.getNonOptionalType():e}function V(t,r,n){var i=n.getTypeAtLocation(t);return e.isOptionalChain(t.parent)&&(i=K(i,e.isOptionalChainRoot(t.parent),!0)),(e.isNewExpression(t.parent)?i.getConstructSignatures():i.getCallSignatures()).filter((function(e){return !!e.typeParameters&&e.typeParameters.length>=r}))}function q(t,r){if(-1!==r.text.lastIndexOf("<",t?t.pos:r.text.length))for(var n=t,i=0,a=0;n;){switch(n.kind){case 29:if((n=R(n.getFullStart(),r))&&28===n.kind&&(n=R(n.getFullStart(),r)),!n||!e.isIdentifier(n))return;if(!i)return e.isDeclarationName(n)?void 0:{called:n,nTypeArguments:a};i--;break;case 49:i=3;break;case 48:i=2;break;case 31:i++;break;case 19:if(!(n=U(n,18,r)))return;break;case 21:if(!(n=U(n,20,r)))return;break;case 23:if(!(n=U(n,22,r)))return;break;case 27:a++;break;case 38:case 79:case 10:case 8:case 9:case 110:case 95:case 112:case 94:case 141:case 24:case 51:case 57:case 58:break;default:if(e.isTypeNode(n))break;return}n=R(n.getFullStart(),r);}}function W(t,r,n){return e.formatting.getRangeOfEnclosingComment(t,r,void 0,n)}function H(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function G(e,t,r){var n=W(e,t,void 0);return !!n&&r===m.test(e.text.substring(n.pos,n.end))}function Q(t,r,n){return e.createTextSpanFromBounds(t.getStart(r),(n||t).getEnd())}function X(t){if(!t.isUnterminated)return e.createTextSpanFromBounds(t.getStart()+1,t.getEnd()-1)}function Y(e,t){return {span:e,newText:t}}function Z(e){return 154===e.kind}function $(t,r){return {fileExists:function(e){return t.fileExists(e)},getCurrentDirectory:function(){return r.getCurrentDirectory()},readFile:e.maybeBind(r,r.readFile),useCaseSensitiveFileNames:e.maybeBind(r,r.useCaseSensitiveFileNames),getSymlinkCache:e.maybeBind(r,r.getSymlinkCache)||t.getSymlinkCache,getModuleSpecifierCache:e.maybeBind(r,r.getModuleSpecifierCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getModuleResolutionCache())||void 0===e?void 0:e.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:e.maybeBind(r,r.getGlobalTypingsCacheLocation),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},getNearestAncestorDirectoryWithPackageJson:e.maybeBind(r,r.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:function(){return t.getFileIncludeReasons()}}}function ee(e,t){return i$1(i$1({},$(e,t)),{getCommonSourceDirectory:function(){return e.getCommonSourceDirectory()}})}function te(t,r,n,i,a){return e.factory.createImportDeclaration(void 0,t||r?e.factory.createImportClause(!!a,t,r&&r.length?e.factory.createNamedImports(r):void 0):void 0,"string"==typeof n?re(n,i):n,void 0)}function re(t,r){return e.factory.createStringLiteral(t,0===r)}function ne(t,r){return e.isStringDoubleQuoted(t,r)?1:0}function ie(t,r){if(r.quotePreference&&"auto"!==r.quotePreference)return "single"===r.quotePreference?0:1;var n=t.imports&&e.find(t.imports,(function(t){return e.isStringLiteral(t)&&!e.nodeIsSynthesized(t.parent)}));return n?ne(n,t):1}function ae(t){return "default"!==t.escapedName?t.escapedName:e.firstDefined(t.declarations,(function(t){var r=e.getNameOfDeclaration(t);return r&&79===r.kind?r.escapedText:void 0}))}function oe(t,r,n){return e.textSpanContainsPosition(t,r.getStart(n))&&r.getEnd()<=e.textSpanEnd(t)}function se(e,t){return !!e&&!!t&&e.start===t.start&&e.length===t.length}function ce(t,r,n){var i=r.tryGetSourcePosition(t);return i&&(!n||n(e.normalizePath(i.fileName))?i:void 0)}function le(e,t,r){var n=e.contextSpan&&ce({fileName:e.fileName,pos:e.contextSpan.start},t,r),i=e.contextSpan&&ce({fileName:e.fileName,pos:e.contextSpan.start+e.contextSpan.length},t,r);return n&&i?{start:n.pos,length:i.pos-n.pos}:void 0}function ue(t){var r=t.declarations?e.firstOrUndefined(t.declarations):void 0;return !!e.findAncestor(r,(function(t){return !!e.isParameter(t)||!(e.isBindingElement(t)||e.isObjectBindingPattern(t)||e.isArrayBindingPattern(t))&&"quit"}))}e.getLineStartPositionForPosition=function(t,r){return e.getLineStarts(r)[r.getLineAndCharacterOfPosition(t).line]},e.rangeContainsRange=y,e.rangeContainsRangeExclusive=function(e,t){return v(e,t.pos)&&v(e,t.end)},e.rangeContainsPosition=function(e,t){return e.pos<=t&&t<=e.end},e.rangeContainsPositionExclusive=v,e.startEndContainsRange=h,e.rangeContainsStartEnd=function(e,t,r){return e.pos<=t&&e.end>=r},e.rangeOverlapsWithStartEnd=function(e,t,r){return b(e.pos,e.end,t,r)},e.nodeOverlapsWithStartEnd=function(e,t,r,n){return b(e.getStart(t),e.end,r,n)},e.startEndOverlapsWithStartEnd=b,e.positionBelongsToNode=function(t,r,n){return e.Debug.assert(t.pos<=r),r<t.end||!x(t,n)},e.findListItemInfo=function(t){var r=C(t);if(r){var n=r.getChildren();return {listItemIndex:e.indexOfNode(n,t),list:r}}},e.hasChildOfKind=S,e.findChildOfKind=T,e.findContainingList=C,e.getContextualTypeFromParentOrAncestorTypeNode=function(t,r){if(!(8388608&t.flags)){var n=Be(t,r);if(n)return n;var i=function(t){var r;return e.findAncestor(t,(function(t){return e.isTypeNode(t)&&(r=t),!e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),r}(t);return i&&r.getTypeAtLocation(i)}},e.getAdjustedReferenceLocation=w,e.getAdjustedRenameLocation=function(e){return P(e,!0)},e.getTouchingPropertyName=function(t,r){return I(t,r,(function(t){return e.isPropertyNameLiteral(t)||e.isKeyword(t.kind)||e.isPrivateIdentifier(t)}))},e.getTouchingToken=I,e.getTokenAtPosition=O,e.findFirstNonJsxWhitespaceToken=function(e,t){for(var r=O(e,t);z(r);){var n=L(r,r.parent,e);if(!n)return;r=n;}return r},e.findTokenOnLeftOfPosition=function(t,r){var n=O(t,r);return e.isToken(n)&&r>n.getStart(t)&&r<n.getEnd()?n:R(r,t)},e.findNextToken=L,e.findPrecedingToken=R,e.isInString=function(t,r,n){if(void 0===n&&(n=R(r,t)),n&&e.isStringTextContainingNode(n)){var i=n.getStart(t),a=n.getEnd();if(i<r&&r<a)return !0;if(r===a)return !!n.isUnterminated}return !1},e.isInsideJsxElementOrAttribute=function(e,t){var r=O(e,t);return !!r&&(11===r.kind||29===r.kind&&11===r.parent.kind||29===r.kind&&291===r.parent.kind||!(!r||19!==r.kind||291!==r.parent.kind)||29===r.kind&&284===r.parent.kind)},e.isInTemplateString=function(t,r){var n=O(t,r);return e.isTemplateLiteralKind(n.kind)&&r>n.getStart(t)},e.isInJSXText=function(t,r){var n=O(t,r);return !!e.isJsxText(n)||!(18!==n.kind||!e.isJsxExpression(n.parent)||!e.isJsxElement(n.parent.parent))||!(29!==n.kind||!e.isJsxOpeningLikeElement(n.parent)||!e.isJsxElement(n.parent.parent))},e.isInsideJsxElement=function(e,t){return function(r){for(;r;)if(r.kind>=282&&r.kind<=291||11===r.kind||29===r.kind||31===r.kind||79===r.kind||19===r.kind||18===r.kind||43===r.kind)r=r.parent;else {if(281!==r.kind)return !1;if(t>r.getStart(e))return !0;r=r.parent;}return !1}(O(e,t))},e.findPrecedingMatchingToken=U,e.removeOptionality=K,e.isPossiblyTypeArgumentPosition=function t(r,n,i){var a=q(r,n);return void 0!==a&&(e.isPartOfTypeNode(a.called)||0!==V(a.called,a.nTypeArguments,i).length||t(a.called,n,i))},e.getPossibleGenericSignatures=V,e.getPossibleTypeArgumentsInfo=q,e.isInComment=W,e.hasDocComment=function(t,r){var n=O(t,r);return !!e.findAncestor(n,e.isJSDoc)},e.getNodeModifiers=function(t,r){void 0===r&&(r=0);var n=[],i=e.isDeclaration(t)?e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t)&~r:0;return 8&i&&n.push("private"),16&i&&n.push("protected"),4&i&&n.push("public"),(32&i||e.isClassStaticBlockDeclaration(t))&&n.push("static"),256&i&&n.push("abstract"),1&i&&n.push("export"),8192&i&&n.push("deprecated"),16777216&t.flags&&n.push("declare"),274===t.kind&&n.push("export"),n.length>0?n.join(","):""},e.getTypeArgumentOrTypeParameterList=function(t){return 180===t.kind||210===t.kind?t.typeArguments:e.isFunctionLike(t)||260===t.kind||261===t.kind?t.typeParameters:void 0},e.isComment=function(e){return 2===e||3===e},e.isStringOrRegularExpressionOrTemplateLiteral=function(t){return !(10!==t&&13!==t&&!e.isTemplateLiteralKind(t))},e.isPunctuation=function(e){return 18<=e&&e<=78},e.isInsideTemplateLiteral=function(t,r,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart(n)<r&&r<t.end||!!t.isUnterminated&&r===t.end},e.isAccessibilityModifier=function(e){switch(e){case 123:case 121:case 122:return !0}return !1},e.cloneCompilerOptions=function(t){var r=e.clone(t);return e.setConfigFileInOptions(r,t&&t.configFile),r},e.isArrayLiteralOrObjectLiteralDestructuringPattern=function e(t){if(206===t.kind||207===t.kind){if(223===t.parent.kind&&t.parent.left===t&&63===t.parent.operatorToken.kind)return !0;if(247===t.parent.kind&&t.parent.initializer===t)return !0;if(e(299===t.parent.kind?t.parent.parent:t.parent))return !0}return !1},e.isInReferenceComment=function(e,t){return G(e,t,!0)},e.isInNonReferenceComment=function(e,t){return G(e,t,!1)},e.getReplacementSpanForContextToken=function(e){if(e)switch(e.kind){case 10:case 14:return X(e);default:return Q(e)}},e.createTextSpanFromNode=Q,e.createTextSpanFromStringLiteralLikeContent=X,e.createTextRangeFromNode=function(t,r){return e.createRange(t.getStart(r),t.end)},e.createTextSpanFromRange=function(t){return e.createTextSpanFromBounds(t.pos,t.end)},e.createTextRangeFromSpan=function(t){return e.createRange(t.start,t.start+t.length)},e.createTextChangeFromStartLength=function(t,r,n){return Y(e.createTextSpan(t,r),n)},e.createTextChange=Y,e.typeKeywords=[131,129,160,134,95,138,141,144,104,148,149,146,152,153,110,114,155,156,157],e.isTypeKeyword=function(t){return e.contains(e.typeKeywords,t)},e.isTypeKeywordToken=Z,e.isTypeKeywordTokenOrIdentifier=function(t){return Z(t)||e.isIdentifier(t)&&"type"===t.text},e.isExternalModuleSymbol=function(e){return !!(1536&e.flags)&&34===e.name.charCodeAt(0)},e.nodeSeenTracker=function(){var t=[];return function(r){var n=e.getNodeId(r);return !t[n]&&(t[n]=!0)}},e.getSnapshotText=function(e){return e.getText(0,e.getLength())},e.repeatString=function(e,t){for(var r="",n=0;n<t;n++)r+=e;return r},e.skipConstraint=function(e){return e.isTypeParameter()&&e.getConstraint()||e},e.getNameFromPropertyName=function(t){return 164===t.kind?e.isStringOrNumericLiteralLike(t.expression)?t.expression.text:void 0:e.isPrivateIdentifier(t)?e.idText(t):e.getTextOfIdentifierOrLiteral(t)},e.programContainsModules=function(e){return e.getSourceFiles().some((function(t){return !(t.isDeclarationFile||e.isSourceFileFromExternalLibrary(t)||!t.externalModuleIndicator&&!t.commonJsModuleIndicator)}))},e.programContainsEsModules=function(e){return e.getSourceFiles().some((function(t){return !t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator}))},e.compilerOptionsIndicateEsModules=function(t){return !!t.module||e.getEmitScriptTarget(t)>=2||!!t.noEmit},e.createModuleSpecifierResolutionHost=$,e.getModuleSpecifierResolverHost=ee,e.moduleResolutionRespectsExports=function(t){return t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.moduleResolutionUsesNodeModules=function(t){return t===e.ModuleResolutionKind.NodeJs||t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.makeImportIfNecessary=function(e,t,r,n){return e||t&&t.length?te(e,t,r,n):void 0},e.makeImport=te,e.makeStringLiteral=re,(g=e.QuotePreference||(e.QuotePreference={}))[g.Single=0]="Single",g[g.Double=1]="Double",e.quotePreferenceFromString=ne,e.getQuotePreference=ie,e.getQuoteFromPreference=function(t){switch(t){case 0:return "'";case 1:return '"';default:return e.Debug.assertNever(t)}},e.symbolNameNoDefault=function(t){var r=ae(t);return void 0===r?void 0:e.unescapeLeadingUnderscores(r)},e.symbolEscapedNameNoDefault=ae,e.isModuleSpecifierLike=function(t){return e.isStringLiteralLike(t)&&(e.isExternalModuleReference(t.parent)||e.isImportDeclaration(t.parent)||e.isRequireCall(t.parent,!1)&&t.parent.arguments[0]===t||e.isImportCall(t.parent)&&t.parent.arguments[0]===t)},e.isObjectBindingElementWithoutPropertyName=function(t){return e.isBindingElement(t)&&e.isObjectBindingPattern(t.parent)&&e.isIdentifier(t.name)&&!t.propertyName},e.getPropertySymbolFromBindingElement=function(e,t){var r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)},e.getParentNodeInSpan=function(t,r,n){if(t)for(;t.parent;){if(e.isSourceFile(t.parent)||!oe(n,t.parent,r))return t;t=t.parent;}},e.findModifier=function(t,r){return e.canHaveModifiers(t)?e.find(t.modifiers,(function(e){return e.kind===r})):void 0},e.insertImports=function(t,r,n,i){var a=240===(e.isArray(n)?n[0]:n).kind?e.isRequireVariableStatement:e.isAnyImportSyntax,o=e.filter(r.statements,a),s=e.isArray(n)?e.stableSort(n,e.OrganizeImports.compareImportsOrRequireStatements):[n];if(o.length)if(o&&e.OrganizeImports.importsAreSorted(o))for(var c=0,l=s;c<l.length;c++){var u=l[c],_=e.OrganizeImports.getImportDeclarationInsertionIndex(o,u);if(0===_){var d=o[0]===r.statements[0]?{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude}:{};t.insertNodeBefore(r,o[0],u,!1,d);}else {var p=o[_-1];t.insertNodeAfter(r,p,u);}}else {var f=e.lastOrUndefined(o);f?t.insertNodesAfter(r,f,s):t.insertNodesAtTopOfFile(r,s,i);}else t.insertNodesAtTopOfFile(r,s,i);},e.getTypeKeywordOfTypeOnlyImport=function(t,r){return e.Debug.assert(t.isTypeOnly),e.cast(t.getChildAt(0,r),Z)},e.textSpansEqual=se,e.documentSpansEqual=function(e,t){return e.fileName===t.fileName&&se(e.textSpan,t.textSpan)},e.forEachUnique=function(e,t){if(e)for(var r=0;r<e.length;r++)if(e.indexOf(e[r])===r){var n=t(e[r],r);if(n)return n}},e.isTextWhiteSpaceLike=function(t,r,n){for(var i=r;i<n;i++)if(!e.isWhiteSpaceLike(t.charCodeAt(i)))return !1;return !0},e.getMappedLocation=ce,e.getMappedDocumentSpan=function(e,t,r){var n=e.fileName,i=e.textSpan,a=ce({fileName:n,pos:i.start},t,r);if(a){var o=ce({fileName:n,pos:i.start+i.length},t,r),s=o?o.pos-a.pos:i.length;return {fileName:a.fileName,textSpan:{start:a.pos,length:s},originalFileName:e.fileName,originalTextSpan:e.textSpan,contextSpan:le(e,t,r),originalContextSpan:e.contextSpan}}},e.getMappedContextSpan=le,e.isFirstDeclarationOfSymbolParameter=ue;var _e=function(){var t,r,n,i,a=10*e.defaultMaximumTruncationLength;l();var o=function(t){return c(t,e.SymbolDisplayPartKind.text)};return {displayParts:function(){var r=t.length&&t[t.length-1].text;return i>a&&r&&"..."!==r&&(e.isWhiteSpaceLike(r.charCodeAt(r.length-1))||t.push(pe(" ",e.SymbolDisplayPartKind.space)),t.push(pe("...",e.SymbolDisplayPartKind.punctuation))),t},writeKeyword:function(t){return c(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return c(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeTrailingSemicolon:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return c(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return c(t,e.SymbolDisplayPartKind.parameterName)},writeProperty:function(t){return c(t,e.SymbolDisplayPartKind.propertyName)},writeLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeSymbol:function(e,r){i>a||(s(),i+=e.length,t.push(de(e,r)));},writeLine:function(){i>a||(i+=1,t.push(he()),r=!0);},write:o,writeComment:o,getText:function(){return ""},getTextPos:function(){return 0},getColumn:function(){return 0},getLine:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingWhitespace:function(){return !1},hasTrailingComment:function(){return !1},rawWrite:e.notImplemented,getIndent:function(){return n},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},clear:l,trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop};function s(){if(!(i>a)&&r){var o=e.getIndentString(n);o&&(i+=o.length,t.push(pe(o,e.SymbolDisplayPartKind.space))),r=!1;}}function c(e,r){i>a||(s(),i+=e.length,t.push(pe(e,r)));}function l(){t=[],r=!0,n=0,i=0;}}();function de(t,r){return pe(t,function(t){var r=t.flags;return 3&r?ue(t)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName:4&r||32768&r||65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r||2097152&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(r))}function pe(t,r){return {text:t,kind:e.SymbolDisplayPartKind[r]}}function fe(t){return pe(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function ge(t){return pe(t,e.SymbolDisplayPartKind.text)}function me(t){return pe(t,e.SymbolDisplayPartKind.linkText)}function ye(t,r){return {text:t,kind:e.SymbolDisplayPartKind[e.SymbolDisplayPartKind.linkName],target:{fileName:e.getSourceFileOfNode(r).fileName,textSpan:Q(r)}}}function ve(t){return pe(t,e.SymbolDisplayPartKind.link)}function he(){return pe("\n",e.SymbolDisplayPartKind.lineBreak)}function be(e){try{return e(_e),_e.displayParts()}finally{_e.clear();}}function xe(e){return 0!=(33554432&e.flags)}function De(e){return 0!=(2097152&e.flags)}function Se(e,t){void 0===t&&(t=!0);var r=e&&Ce(e);return r&&!t&&Ne(r),r}function Te(t,r,n){var i=n(t);return i?e.setOriginalNode(i,t):i=Ce(t,n),i&&!r&&Ne(i),i}function Ce(t,r){var n=r?function(e){return Te(e,!0,r)}:Se,i=r?function(e){return e&&ke(e,!0,r)}:function(e){return e&&Ee(e)},a=e.visitEachChild(t,n,e.nullTransformationContext,i,n);if(a===t){var o=e.isStringLiteral(t)?e.setOriginalNode(e.factory.createStringLiteralFromNode(t),t):e.isNumericLiteral(t)?e.setOriginalNode(e.factory.createNumericLiteral(t.text,t.numericLiteralFlags),t):e.factory.cloneNode(t);return e.setTextRange(o,t)}return a.parent=void 0,a}function Ee(t,r){return void 0===r&&(r=!0),t&&e.factory.createNodeArray(t.map((function(e){return Se(e,r)})),t.hasTrailingComma)}function ke(t,r,n){return e.factory.createNodeArray(t.map((function(e){return Te(e,r,n)})),t.hasTrailingComma)}function Ne(e){Ae(e),Fe(e);}function Ae(e){Pe(e,512,we);}function Fe(t){Pe(t,1024,e.getLastChild);}function Pe(t,r,n){e.addEmitFlags(t,r);var i=n(t);i&&Pe(i,r,n);}function we(e){return e.forEachChild((function(e){return e}))}function Ie(t,r,n,i,a){e.forEachLeadingCommentRange(n.text,t.pos,Le(r,n,i,a,e.addSyntheticLeadingComment));}function Oe(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.end,Le(r,n,i,a,e.addSyntheticTrailingComment));}function Me(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.pos,Le(r,n,i,a,e.addSyntheticLeadingComment));}function Le(e,t,r,n,i){return function(a,o,s,c){3===s?(a+=2,o-=2):a+=2,i(e,r||s,t.text.slice(a,o),void 0!==n?n:c);}}function Re(t,r){if(e.startsWith(t,r))return 0;var n=t.indexOf(" "+r);return -1===n&&(n=t.indexOf("."+r)),-1===n&&(n=t.indexOf('"'+r)),-1===n?-1:n+1}function Be(e,t){var r=e.parent;switch(r.kind){case 211:return t.getContextualType(r);case 223:var n=r,i=n.left,a=n.operatorToken,o=n.right;return je(a.kind)?t.getTypeAtLocation(e===o?i:o):t.getContextualType(e);case 292:return r.expression===e?Je(r,t):void 0;default:return t.getContextualType(e)}}function je(e){switch(e){case 36:case 34:case 37:case 35:return !0;default:return !1}}function Je(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}function ze(e){return 176===e||177===e||178===e||168===e||170===e}function Ue(e){return 259===e||173===e||171===e||174===e||175===e}function Ke(e){return 264===e}function Ve(e){return 240===e||241===e||243===e||248===e||249===e||250===e||254===e||256===e||169===e||262===e||269===e||268===e||275===e||267===e||274===e}function qe(t){var r=0,n=0;return e.forEachChild(t,(function i(a){if(Ve(a.kind))26===(null==(o=a.getLastToken(t))?void 0:o.kind)?r++:n++;else if(ze(a.kind)){var o;26===(null==(o=a.getLastToken(t))?void 0:o.kind)?r++:o&&27!==o.kind&&e.getLineAndCharacterOfPosition(t,o.getStart(t)).line!==e.getLineAndCharacterOfPosition(t,e.getSpanOfTokenAtPosition(t,o.end).start).line&&n++;}return r+n>=5||e.forEachChild(a,i)})),0===r&&n<=1||r/n>.2}function We(e,t){return Ge(e,e.fileExists,t)}function He(e){try{return e()}catch(e){return}}function Ge(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return He((function(){return t&&t.apply(e,r)}))}function Qe(t,r){if(!r.fileExists)return [];var n=[];return e.forEachAncestorDirectory(e.getDirectoryPath(t),(function(t){var i=e.combinePaths(t,"package.json");if(r.fileExists(i)){var a=Xe(i,r);a&&n.push(a);}})),n}function Xe(t,r){if(r.readFile){var n=function(e){try{return JSON.parse(e)}catch(e){return}}(r.readFile(t)||""),a={};if(n)for(var o=0,s=["dependencies","devDependencies","optionalDependencies","peerDependencies"];o<s.length;o++){var c=s[o],l=n[c];if(l){var u=new e.Map;for(var _ in l)u.set(_,l[_]);a[c]=u;}}var d=[[1,a.dependencies],[2,a.devDependencies],[8,a.optionalDependencies],[4,a.peerDependencies]];return i$1(i$1({},a),{parseable:!!n,fileName:t,get:p,has:function(e,t){return !!p(e,t)}})}function p(e,t){void 0===t&&(t=15);for(var r=0,n=d;r<n.length;r++){var i=n[r],a=i[0],o=i[1];if(o&&t&a){var s=o.get(e);if(void 0!==s)return s}}}}function Ye(t){return e.some(t.imports,(function(t){var r=t.text;return e.JsTyping.nodeCoreModules.has(r)}))}function Ze(e){return void 0!==e.file&&void 0!==e.start&&void 0!==e.length}function $e(e){return !(33554432&e.flags||"export="!==e.escapedName&&"default"!==e.escapedName)}function et(t){return e.firstDefined(t.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:void 0}))}function tt(t){var r;return e.Debug.checkDefined(t.parent,"Symbol parent was undefined. Flags: ".concat(e.Debug.formatSymbolFlags(t.flags),". ")+"Declarations: ".concat(null===(r=t.declarations)||void 0===r?void 0:r.map((function(t){var r=e.Debug.formatSyntaxKind(t.kind),n=e.isInJSFile(t),i=t.expression;return (n?"[JS]":"")+r+(i?" (expression: ".concat(e.Debug.formatSyntaxKind(i.kind),")"):"")})).join(", "),"."))}function rt(t){var r=t.getSourceFile();return !(!r.externalModuleIndicator&&!r.commonJsModuleIndicator)&&(e.isInJSFile(t)||!e.findAncestor(t,e.isGlobalScopeAugmentation))}e.symbolPart=de,e.displayPart=pe,e.spacePart=function(){return pe(" ",e.SymbolDisplayPartKind.space)},e.keywordPart=fe,e.punctuationPart=function(t){return pe(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)},e.operatorPart=function(t){return pe(e.tokenToString(t),e.SymbolDisplayPartKind.operator)},e.parameterNamePart=function(t){return pe(t,e.SymbolDisplayPartKind.parameterName)},e.propertyNamePart=function(t){return pe(t,e.SymbolDisplayPartKind.propertyName)},e.textOrKeywordPart=function(t){var r=e.stringToToken(t);return void 0===r?ge(t):fe(r)},e.textPart=ge,e.typeAliasNamePart=function(t){return pe(t,e.SymbolDisplayPartKind.aliasName)},e.typeParameterNamePart=function(t){return pe(t,e.SymbolDisplayPartKind.typeParameterName)},e.linkTextPart=me,e.linkNamePart=ye,e.linkPart=ve,e.buildLinkParts=function(t,r){var n,i=e.isJSDocLink(t)?"link":e.isJSDocLinkCode(t)?"linkcode":"linkplain",a=[ve("{@".concat(i," "))];if(t.name){var o=null==r?void 0:r.getSymbolAtLocation(t.name),s=function(e){if(0===e.indexOf("()"))return 2;if("<"!==e[0])return 0;for(var t=0,r=0;r<e.length;)if("<"===e[r]&&t++,">"===e[r]&&t--,r++,!t)return r;return 0}(t.text),c=e.getTextOfNode(t.name)+t.text.slice(0,s),l=function(e){var t=0;if(124===e.charCodeAt(t++)){for(;t<e.length&&32===e.charCodeAt(t);)t++;return e.slice(t)}return e}(t.text.slice(s)),u=(null==o?void 0:o.valueDeclaration)||(null===(n=null==o?void 0:o.declarations)||void 0===n?void 0:n[0]);u?(a.push(ye(c,u)),l&&a.push(me(l))):a.push(me(c+(s||0===l.indexOf("://")?"":" ")+l));}else t.text&&a.push(me(t.text));return a.push(ve("}")),a},e.getNewLineOrDefaultFromHost=function(e,t){var r;return (null==t?void 0:t.newLineCharacter)||(null===(r=e.getNewLine)||void 0===r?void 0:r.call(e))||"\r\n"},e.lineBreakPart=he,e.mapToDisplayParts=be,e.typeToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),be((function(i){e.writeType(t,r,17408|n,i);}))},e.symbolToDisplayParts=function(e,t,r,n,i){return void 0===i&&(i=0),be((function(a){e.writeSymbol(t,r,n,8|i,a);}))},e.signatureToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),n|=25632,be((function(i){e.writeSignature(t,r,n,void 0,i);}))},e.nodeToDisplayParts=function(t,r){var n=r.getSourceFile();return be((function(r){e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0}).writeNode(4,t,n,r);}))},e.isImportOrExportSpecifierName=function(t){return !!t.parent&&e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t},e.getScriptKind=function(t,r){return e.ensureScriptKind(t,r.getScriptKind&&r.getScriptKind(t))},e.getSymbolTarget=function(t,r){for(var n=t;De(n)||xe(n)&&n.target;)n=xe(n)&&n.target?n.target:e.skipAlias(n,r);return n},e.getUniqueSymbolId=function(t,r){return e.getSymbolId(e.skipAlias(t,r))},e.getFirstNonSpaceCharacterPosition=function(t,r){for(;e.isWhiteSpaceLike(t.charCodeAt(r));)r+=1;return r},e.getPrecedingNonSpaceCharacterPosition=function(t,r){for(;r>-1&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));)r-=1;return r+1},e.getSynthesizedDeepClone=Se,e.getSynthesizedDeepCloneWithReplacements=Te,e.getSynthesizedDeepClones=Ee,e.getSynthesizedDeepClonesWithReplacements=ke,e.suppressLeadingAndTrailingTrivia=Ne,e.suppressLeadingTrivia=Ae,e.suppressTrailingTrivia=Fe,e.copyComments=function(e,t){var r=e.getSourceFile();!function(e,t){for(var r=e.getFullStart(),n=e.getStart(),i=r;i<n;i++)if(10===t.charCodeAt(i))return !0;return !1}(e,r.text)?Me(e,t,r):Ie(e,t,r),Oe(e,t,r);},e.getUniqueName=function(t,r){for(var n=t,i=1;!e.isFileLevelUniqueName(r,n);i++)n="".concat(t,"_").concat(i);return n},e.getRenameLocation=function(t,r,n,i){for(var a=0,o=-1,s=0,c=t;s<c.length;s++){var l=c[s],u=l.fileName,_=l.textChanges;e.Debug.assert(u===r);for(var d=0,p=_;d<p.length;d++){var f=p[d],g=f.span,m=f.newText,y=Re(m,e.escapeString(n));if(-1!==y&&(o=g.start+a+y,!i))return o;a+=m.length-g.length;}}return e.Debug.assert(i),e.Debug.assert(o>=0),o},e.copyLeadingComments=Ie,e.copyTrailingComments=Oe,e.copyTrailingAsLeadingComments=Me,e.needsParentheses=function(t){return e.isBinaryExpression(t)&&27===t.operatorToken.kind||e.isObjectLiteralExpression(t)||e.isAsExpression(t)&&e.isObjectLiteralExpression(t.expression)},e.getContextualTypeFromParent=Be,e.quote=function(t,r,n){var i=ie(t,r),a=JSON.stringify(n);return 0===i?"'".concat(e.stripQuotes(a).replace(/'/g,"\\'").replace(/\\"/g,'"'),"'"):a},e.isEqualityOperatorKind=je,e.isStringLiteralOrTemplate=function(e){switch(e.kind){case 10:case 14:case 225:case 212:return !0;default:return !1}},e.hasIndexSignature=function(e){return !!e.getStringIndexType()||!!e.getNumberIndexType()},e.getSwitchedType=Je,e.ANONYMOUS="anonymous function",e.getTypeNodeIfAccessible=function(e,t,r,n){var i=r.getTypeChecker(),a=!0,o=function(){return a=!1},s=i.typeToTypeNode(e,t,1,{trackSymbol:function(e,t,r){return !(a=a&&0===i.isSymbolAccessible(e,t,r,!1).accessibility)},reportInaccessibleThisError:o,reportPrivateInBaseOfClassExpression:o,reportInaccessibleUniqueSymbolError:o,moduleResolverHost:ee(r,n)});return a?s:void 0},e.syntaxRequiresTrailingSemicolonOrASI=Ve,e.syntaxMayBeASICandidate=e.or(ze,Ue,Ke,Ve),e.positionIsASICandidate=function(t,r,n){var i=e.findAncestor(r,(function(r){return r.end!==t?"quit":e.syntaxMayBeASICandidate(r.kind)}));return !!i&&function(t,r){var n=t.getLastToken(r);if(n&&26===n.kind)return !1;if(ze(t.kind)){if(n&&27===n.kind)return !1}else if(Ke(t.kind)){if((i=e.last(t.getChildren(r)))&&e.isModuleBlock(i))return !1}else if(Ue(t.kind)){var i;if((i=e.last(t.getChildren(r)))&&e.isFunctionBlock(i))return !1}else if(!Ve(t.kind))return !1;if(243===t.kind)return !0;var a=L(t,e.findAncestor(t,(function(e){return !e.parent})),r);return !a||19===a.kind||r.getLineAndCharacterOfPosition(t.getEnd()).line!==r.getLineAndCharacterOfPosition(a.getStart(r)).line}(i,n)},e.probablyUsesSemicolons=qe,e.tryGetDirectories=function(e,t){return Ge(e,e.getDirectories,t)||[]},e.tryReadDirectory=function(t,r,n,i,a){return Ge(t,t.readDirectory,r,n,i,a)||e.emptyArray},e.tryFileExists=We,e.tryDirectoryExists=function(t,r){return He((function(){return e.directoryProbablyExists(r,t)}))||!1},e.tryAndIgnoreErrors=He,e.tryIOAndConsumeErrors=Ge,e.findPackageJsons=function(t,r,n){var i=[];return e.forEachAncestorDirectory(t,(function(t){if(t===n)return !0;var a=e.combinePaths(t,"package.json");We(r,a)&&i.push(a);})),i},e.findPackageJson=function(t,r){var n;return e.forEachAncestorDirectory(t,(function(t){return "node_modules"===t||!!(n=e.findConfigFile(t,(function(e){return We(r,e)}),"package.json"))||void 0})),n},e.getPackageJsonsVisibleToFile=Qe,e.createPackageJsonInfo=Xe,e.createPackageJsonImportFilter=function(t,r,n){var i,a=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(t.fileName)||Qe(t.fileName,n)).filter((function(e){return e.parseable}));return {allowsImportingAmbientModule:function(t,r){if(!a.length||!t.valueDeclaration)return !0;var n=c(t.valueDeclaration.getSourceFile().fileName,r);if(void 0===n)return !0;var i=e.stripQuotes(t.getName());return !!s(i)||(o(n)||o(i))},allowsImportingSourceFile:function(e,t){if(!a.length)return !0;var r=c(e.fileName,t);return !r||o(r)},allowsImportingSpecifier:function(t){return !(a.length&&!s(t))||(!(!e.pathIsRelative(t)&&!e.isRootedDiskPath(t))||o(t))}};function o(t){for(var r=l(t),n=0,i=a;n<i.length;n++){var o=i[n];if(o.has(r)||o.has(e.getTypesPackageName(r)))return !0}return !1}function s(r){return !!(e.isSourceFileJS(t)&&e.JsTyping.nodeCoreModules.has(r)&&(void 0===i&&(i=Ye(t)),i))}function c(i,a){if(e.stringContains(i,"node_modules")){var o=e.moduleSpecifiers.getNodeModulesPackageName(n.getCompilationSettings(),t,i,a,r);if(o)return e.pathIsRelative(o)||e.isRootedDiskPath(o)?void 0:l(o)}}function l(t){var r=e.getPathComponents(e.getPackageNameFromTypesPackageName(t)).slice(1);return e.startsWith(r[0],"@")?"".concat(r[0],"/").concat(r[1]):r[0]}},e.consumesNodeCoreModules=Ye,e.isInsideNodeModules=function(t){return e.contains(e.getPathComponents(t),"node_modules")},e.isDiagnosticWithLocation=Ze,e.findDiagnosticForNode=function(t,r){var n=Q(t),i=e.binarySearchKey(r,n,e.identity,e.compareTextSpans);if(i>=0){var a=r[i];return e.Debug.assertEqual(a.file,t.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),e.cast(a,Ze)}},e.getDiagnosticsWithinSpan=function(t,r){var n,i=e.binarySearchKey(r,t.start,(function(e){return e.start}),e.compareValues);for(i<0&&(i=~i);(null===(n=r[i-1])||void 0===n?void 0:n.start)===t.start;)i--;for(var a=[],o=e.textSpanEnd(t);;){var s=e.tryCast(r[i],Ze);if(!s||s.start>o)break;e.textSpanContainsTextSpan(t,s)&&a.push(s),i++;}return a},e.getRefactorContextSpan=function(t){var r=t.startPosition,n=t.endPosition;return e.createTextSpanFromBounds(r,void 0===n?r:n)},e.getFixableErrorSpanExpression=function(t,r){var n=O(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":e.isExpression(n)&&se(r,Q(n,t))}))},e.mapOneOrMany=function(t,r,n){return void 0===n&&(n=e.identity),t?e.isArray(t)?n(e.map(t,r)):r(t,0):void 0},e.firstOrOnly=function(t){return e.isArray(t)?e.first(t):t},e.getNamesForExportedSymbol=function(t,r){if($e(t)){var n=et(t);if(n)return n;var i=e.codefix.moduleSymbolToValidIdentifier(tt(t),r,!1),a=e.codefix.moduleSymbolToValidIdentifier(tt(t),r,!0);return i===a?i:[i,a]}return t.name},e.getNameForExportedSymbol=function(t,r,n){return $e(t)?et(t)||e.codefix.moduleSymbolToValidIdentifier(tt(t),r,!!n):t.name},e.stringContainsAt=function(e,t,r){var n=t.length;if(n+r>e.length)return !1;for(var i=0;i<n;i++)if(t.charCodeAt(i)!==e.charCodeAt(i+r))return !1;return !0},e.startsWithUnderscore=function(e){return 95===e.charCodeAt(0)},e.isGlobalDeclaration=function(e){return !rt(e)},e.isNonGlobalDeclaration=rt,e.isDeprecatedDeclaration=function(t){return !!(8192&e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t))},e.shouldUseUriStyleNodeCoreModules=function(t,r){var n=e.firstDefined(t.imports,(function(t){if(e.JsTyping.nodeCoreModules.has(t.text))return e.startsWith(t.text,"node:")}));return null!=n?n:r.usesUriStyleNodeCoreModules},e.getNewLineKind=function(e){return "\n"===e?1:0},e.diagnosticToString=function(t){return e.isArray(t)?e.formatStringFromArgs(e.getLocaleSpecificMessage(t[0]),t.slice(1)):e.getLocaleSpecificMessage(t)},e.getFormatCodeSettingsForWriting=function(t,r){var n=t.options,a=!n.semicolons||n.semicolons===e.SemicolonPreference.Ignore,o=n.semicolons===e.SemicolonPreference.Remove||a&&!qe(r);return i$1(i$1({},n),{semicolons:o?e.SemicolonPreference.Remove:e.SemicolonPreference.Ignore})},e.jsxModeNeedsExplicitImport=function(e){return 2===e||3===e},e.isSourceFileFromLibrary=function(e,t){return e.isSourceFileFromExternalLibrary(t)||e.isSourceFileDefaultLibrary(t)};}(t),function(e){function t(t){var r,n=1,i=e.createMultiMap(),a=new e.Map,o=new e.Map,s={isUsableByFile:function(e){return e===r},isEmpty:function(){return !i.size},clear:function(){i.clear(),a.clear(),r=void 0;},add:function(t,c,l,u,_,d,p,f){var g;if(t!==r&&(s.clear(),r=t),_){var m=e.getNodeModulePathParts(_.fileName);if(m){var y=m.topLevelNodeModulesIndex,v=m.topLevelPackageNameIndex,h=m.packageRootIndex;if(g=e.unmangleScopedPackageName(e.getPackageNameFromTypesPackageName(_.fileName.substring(v+1,h))),e.startsWith(t,_.path.substring(0,y))){var b=o.get(g),x=_.fileName.substring(0,v+1);b?y>b.indexOf(e.nodeModulesPathPart)&&o.set(g,x):o.set(g,x);}}}var D=1===d&&e.getLocalSymbolForExportDefault(c)||c,S=0===d||e.isExternalModuleSymbol(D)?e.unescapeLeadingUnderscores(l):e.getNamesForExportedSymbol(D,void 0),T="string"==typeof S?S:S[0],C="string"==typeof S?void 0:S[1],E=e.stripQuotes(u.name),k=n++,N=e.skipAlias(c,f),A=33554432&c.flags?void 0:c,F=33554432&u.flags?void 0:u;A&&F||a.set(k,[c,u]),i.add(function(t,r,n,i){var a=n||"";return "".concat(t,"|").concat(e.getSymbolId(e.skipAlias(r,i)),"|").concat(a)}(T,c,e.isExternalModuleNameRelative(E)?void 0:E,f),{id:k,symbolTableKey:l,symbolName:T,capitalizedSymbolName:C,moduleName:E,moduleFile:_,moduleFileName:null==_?void 0:_.fileName,packageName:g,exportKind:d,targetFlags:N.flags,isFromPackageJson:p,symbol:A,moduleSymbol:F});},get:function(e,t){if(e===r){var n=i.get(t);return null==n?void 0:n.map(c)}},search:function(n,a,s,l){if(n===r)return e.forEachEntry(i,(function(r,n){var i=function(e){var t=e.substring(0,e.indexOf("|")),r=e.substring(e.lastIndexOf("|")+1);return {symbolName:t,ambientModuleName:""===r?void 0:r}}(n),u=i.symbolName,_=i.ambientModuleName,d=a&&r[0].capitalizedSymbolName||u;if(s(d,r[0].targetFlags)){var p=r.map(c).filter((function(n,i){return function(r,n){if(!n||!r.moduleFileName)return !0;var i=t.getGlobalTypingsCacheLocation();if(i&&e.startsWith(r.moduleFileName,i))return !0;var a=o.get(n);return !a||e.startsWith(r.moduleFileName,a)}(n,r[i].packageName)}));if(p.length){var f=l(p,d,!!_,n);if(void 0!==f)return f}}}))},releaseSymbols:function(){a.clear();},onFileChanged:function(t,n,i){return !(l(t)&&l(n)||(r&&r!==n.path||i&&e.consumesNodeCoreModules(t)!==e.consumesNodeCoreModules(n)||!e.arrayIsEqualTo(t.moduleAugmentations,n.moduleAugmentations)||!function(t,r){if(!e.arrayIsEqualTo(t.ambientModuleNames,r.ambientModuleNames))return !1;for(var n=-1,i=-1,a=function(a){var o=function(t){return e.isNonGlobalAmbientModule(t)&&t.name.text===a};if(n=e.findIndex(t.statements,o,n+1),i=e.findIndex(r.statements,o,i+1),t.statements[n]!==r.statements[i])return {value:!1}},o=0,s=r.ambientModuleNames;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return !0}(t,n)?(s.clear(),0):(r=n.path,1)))}};return e.Debug.isDebugging&&Object.defineProperty(s,"__cache",{get:function(){return i}}),s;function c(r){if(r.symbol&&r.moduleSymbol)return r;var n=r.id,i=r.exportKind,o=r.targetFlags,s=r.isFromPackageJson,c=r.moduleFileName,l=a.get(n)||e.emptyArray,u=l[0],_=l[1];if(u&&_)return {symbol:u,moduleSymbol:_,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s};var d=(s?t.getPackageJsonAutoImportProvider():t.getCurrentProgram()).getTypeChecker(),p=r.moduleSymbol||_||e.Debug.checkDefined(r.moduleFile?d.getMergedSymbol(r.moduleFile.symbol):d.tryFindAmbientModule(r.moduleName)),f=r.symbol||u||e.Debug.checkDefined(2===i?d.resolveExternalModuleSymbol(p):d.tryGetMemberInModuleExportsAndProperties(e.unescapeLeadingUnderscores(r.symbolTableKey),p),"Could not find symbol '".concat(r.symbolName,"' by key '").concat(r.symbolTableKey,"' in module ").concat(p.name));return a.set(n,[f,p]),{symbol:f,moduleSymbol:p,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s}}function l(e){return !(e.commonJsModuleIndicator||e.externalModuleIndicator||e.moduleAugmentations||e.ambientModuleNames)}}function r(t,r,i,a,o){var s,c,l=e.hostUsesCaseSensitiveFileNames(r),u=i.autoImportFileExcludePatterns&&e.mapDefined(i.autoImportFileExcludePatterns,(function(t){var r=e.getPatternFromSpec(t,"","exclude");return r?e.getRegexFromPattern(r,l):void 0}));n(t.getTypeChecker(),t.getSourceFiles(),u,(function(e,r){return o(e,r,t,!1)}));var _=a&&(null===(s=r.getPackageJsonAutoImportProvider)||void 0===s?void 0:s.call(r));if(_){var d=e.timestamp();n(_.getTypeChecker(),_.getSourceFiles(),u,(function(e,t){return o(e,t,_,!0)})),null===(c=r.log)||void 0===c||c.call(r,"forEachExternalModuleToImportFrom autoImportProvider: ".concat(e.timestamp()-d));}}function n(t,r,n,i){for(var a,o=function(e){return null==n?void 0:n.some((function(t){return t.test(e)}))},s=0,c=t.getAmbientModules();s<c.length;s++){var l=c[s];e.stringContains(l.name,"*")||n&&(null===(a=l.declarations)||void 0===a?void 0:a.every((function(e){return o(e.getSourceFile().fileName)})))||i(l,void 0);}for(var u=0,_=r;u<_.length;u++){var d=_[u];e.isExternalOrCommonJsModule(d)&&!o(d.fileName)&&i(t.getMergedSymbol(d.symbol),d);}}function a(e,t,r){var n=function(e,t){var r=t.resolveExternalModuleSymbol(e);if(r!==e)return {symbol:r,exportKind:2};var n=t.tryGetMemberInModuleExports("default",e);return n?{symbol:n,exportKind:1}:void 0}(e,t);if(n){var a=n.symbol,o=n.exportKind,c=s(a,t,r);return c&&i$1({symbol:a,exportKind:o},c)}}function o(t,r){return !(r.isUndefinedSymbol(t)||r.isUnknownSymbol(t)||e.isKnownSymbol(t)||e.isPrivateIdentifierSymbol(t))}function s(t,r,n){var i=e.getLocalSymbolForExportDefault(t);if(i)return {symbolForMeaning:i,name:i.name};var a,o=(a=t).declarations&&e.firstDefined(a.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:e.isExportSpecifier(t)?(e.Debug.assert("default"===t.name.text,"Expected the specifier to be a default export"),t.propertyName&&t.propertyName.text):void 0}));if(void 0!==o)return {symbolForMeaning:t,name:o};if(2097152&t.flags){var c=r.getImmediateAliasedSymbol(t);if(c&&c.parent)return s(c,r,n)}return "default"!==t.escapedName&&"export="!==t.escapedName?{symbolForMeaning:t,name:t.getName()}:{symbolForMeaning:t,name:e.getNameForExportedSymbol(t,n.target)}}var c,l;(l=e.ImportKind||(e.ImportKind={}))[l.Named=0]="Named",l[l.Default=1]="Default",l[l.Namespace=2]="Namespace",l[l.CommonJS=3]="CommonJS",(c=e.ExportKind||(e.ExportKind={}))[c.Named=0]="Named",c[c.Default=1]="Default",c[c.ExportEquals=2]="ExportEquals",c[c.UMD=3]="UMD",e.createCacheableExportInfoMap=t,e.isImportableFile=function(t,r,n,i,a,o,s){var c;if(r===n)return !1;var l=null==s?void 0:s.get(r.path,n.path,i,{});if(void 0!==(null==l?void 0:l.isBlockedByPackageJsonDependencies))return !l.isBlockedByPackageJsonDependencies;var u=e.hostGetCanonicalFileName(o),_=null===(c=o.getGlobalTypingsCacheLocation)||void 0===c?void 0:c.call(o),d=!!e.moduleSpecifiers.forEachFileNameOfModule(r.fileName,n.fileName,o,!1,(function(i){var a=t.getSourceFile(i);return (a===n||!a)&&function(t,r,n,i){var a=e.forEachAncestorDirectory(r,(function(t){return "node_modules"===e.getBaseFileName(t)?t:void 0})),o=a&&e.getDirectoryPath(n(a));return void 0===o||e.startsWith(n(t),o)||!!i&&e.startsWith(n(i),o)}(r.fileName,i,u,_)}));if(a){var p=d&&a.allowsImportingSourceFile(n,o);return null==s||s.setBlockedByPackageJsonDependencies(r.path,n.path,i,{},!p),p}return d},e.forEachExternalModuleToImportFrom=r,e.getExportInfoMap=function(n,i,s,c,l){var u,_,d,p,f,g=e.timestamp();null===(u=i.getPackageJsonAutoImportProvider)||void 0===u||u.call(i);var m=(null===(_=i.getCachedExportInfoMap)||void 0===_?void 0:_.call(i))||t({getCurrentProgram:function(){return s},getPackageJsonAutoImportProvider:function(){var e;return null===(e=i.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(i)},getGlobalTypingsCacheLocation:function(){var e;return null===(e=i.getGlobalTypingsCacheLocation)||void 0===e?void 0:e.call(i)}});if(m.isUsableByFile(n.path))return null===(d=i.log)||void 0===d||d.call(i,"getExportInfoMap: cache hit"),m;null===(p=i.log)||void 0===p||p.call(i,"getExportInfoMap: cache miss or empty; calculating new results");var y=s.getCompilerOptions(),v=0;try{r(s,i,c,!0,(function(t,r,i,s){++v%100==0&&(null==l||l.throwIfCancellationRequested());var c=new e.Map,u=i.getTypeChecker(),_=a(t,u,y);_&&o(_.symbol,u)&&m.add(n.path,_.symbol,1===_.exportKind?"default":"export=",t,r,_.exportKind,s,u),u.forEachExportAndPropertyOfModule(t,(function(i,a){i!==(null==_?void 0:_.symbol)&&o(i,u)&&e.addToSeen(c,a)&&m.add(n.path,i,a,t,r,0,s,u);}));}));}catch(e){throw m.clear(),e}return null===(f=i.log)||void 0===f||f.call(i,"getExportInfoMap: done in ".concat(e.timestamp()-g," ms")),m},e.getDefaultLikeExportInfo=a;}(t),function(e){e.createClassifier=function(){var o=e.createScanner(99,!1);function s(i,s,c){var l=0,u=0,_=[],d=function(t){switch(t){case 3:return {prefix:'"\\\n'};case 2:return {prefix:"'\\\n"};case 1:return {prefix:"/*\n"};case 4:return {prefix:"`\n"};case 5:return {prefix:"}\n",pushTemplate:!0};case 6:return {prefix:"",pushTemplate:!0};case 0:return {prefix:""};default:return e.Debug.assertNever(t)}}(s),p=d.prefix,f=d.pushTemplate;i=p+i;var g=p.length;f&&_.push(15),o.setText(i);var m=0,y=[],v=0;do{l=o.scan(),e.isTrivia(l)||(x(),u=l);var h=o.getTextPos();if(n(o.getTokenPos(),h,g,a(l),y),h>=i.length){var b=r(o,l,e.lastOrUndefined(_));void 0!==b&&(m=b);}}while(1!==l);function x(){switch(l){case 43:case 68:t[u]||13!==o.reScanSlashToken()||(l=13);break;case 29:79===u&&v++;break;case 31:v>0&&v--;break;case 131:case 152:case 148:case 134:case 153:v>0&&!c&&(l=79);break;case 15:_.push(l);break;case 18:_.length>0&&_.push(l);break;case 19:if(_.length>0){var r=e.lastOrUndefined(_);15===r?17===(l=o.reScanTemplateToken(!1))?_.pop():e.Debug.assertEqual(l,16,"Should have been a template middle."):(e.Debug.assertEqual(r,18,"Should have been an open brace"),_.pop());}break;default:if(!e.isKeyword(l))break;(24===u||e.isKeyword(u)&&e.isKeyword(l)&&!function(t,r){if(!e.isAccessibilityModifier(t))return !0;switch(r){case 137:case 151:case 135:case 124:case 127:return !0;default:return !1}}(u,l))&&(l=79);}}return {endOfLineState:m,spans:y}}return {getClassificationsForLine:function(t,r,n){return function(t,r){for(var n=[],a=t.spans,o=0,s=0;s<a.length;s+=3){var c=a[s],l=a[s+1],u=a[s+2];if(o>=0){var _=c-o;_>0&&n.push({length:_,classification:e.TokenClass.Whitespace});}n.push({length:l,classification:i(u)}),o=c+l;}var d=r.length-o;return d>0&&n.push({length:d,classification:e.TokenClass.Whitespace}),{entries:n,finalLexState:t.endOfLineState}}(s(t,r,n),t)},getEncodedLexicalClassifications:s}};var t=e.arrayToNumericMap([79,10,8,9,13,108,45,46,21,23,19,110,95],(function(e){return e}),(function(){return !0}));function r(t,r,n){switch(r){case 10:if(!t.isUnterminated())return;for(var i=t.getTokenText(),a=i.length-1,o=0;92===i.charCodeAt(a-o);)o++;if(0==(1&o))return;return 34===i.charCodeAt(0)?3:2;case 3:return t.isUnterminated()?1:void 0;default:if(e.isTemplateLiteralKind(r)){if(!t.isUnterminated())return;switch(r){case 17:return 5;case 14:return 4;default:return e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+r)}}return 15===n?6:void 0}}function n(e,t,r,n,i){if(8!==n){0===e&&r>0&&(e+=r);var a=t-e;a>0&&i.push(e-r,a,n);}}function i(t){switch(t){case 1:return e.TokenClass.Comment;case 3:return e.TokenClass.Keyword;case 4:return e.TokenClass.NumberLiteral;case 25:return e.TokenClass.BigIntLiteral;case 5:return e.TokenClass.Operator;case 6:return e.TokenClass.StringLiteral;case 8:return e.TokenClass.Whitespace;case 10:return e.TokenClass.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return e.TokenClass.Identifier;default:return}}function a(t){if(e.isKeyword(t))return 3;if(function(e){switch(e){case 41:case 43:case 44:case 39:case 40:case 47:case 48:case 49:case 29:case 31:case 32:case 33:case 102:case 101:case 128:case 150:case 34:case 35:case 36:case 37:case 50:case 52:case 51:case 55:case 56:case 74:case 73:case 78:case 70:case 71:case 72:case 64:case 65:case 66:case 68:case 69:case 63:case 27:case 60:case 75:case 76:case 77:return !0;default:return !1}}(t)||function(e){switch(e){case 39:case 40:case 54:case 53:case 45:case 46:return !0;default:return !1}}(t))return 5;if(t>=18&&t<=78)return 10;switch(t){case 8:return 4;case 9:return 25;case 10:return 6;case 13:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;default:return e.isTemplateLiteralKind(t)?6:2}}function o(e,t){switch(t){case 264:case 260:case 261:case 259:case 228:case 215:case 216:e.throwIfCancellationRequested();}}function s(t,r,n,i,a){var s=[];return n.forEachChild((function l(u){if(u&&e.textSpanIntersectsWith(a,u.pos,u.getFullWidth())){if(o(r,u.kind),e.isIdentifier(u)&&!e.nodeIsMissing(u)&&i.has(u.escapedText)){var _=t.getSymbolAtLocation(u),d=_&&c(_,e.getMeaningFromLocation(u),t);d&&function(t,r,n){var i=r-t;e.Debug.assert(i>0,"Classification had non-positive length of ".concat(i)),s.push(t),s.push(i),s.push(n);}(u.getStart(n),u.getEnd(),d);}u.forEachChild(l);}})),{spans:s,endOfLineState:0}}function c(t,r,n){var i=t.getFlags();return 0==(2885600&i)?void 0:32&i?11:384&i?12:524288&i?16:1536&i?4&r||1&r&&function(t){return e.some(t.declarations,(function(t){return e.isModuleDeclaration(t)&&1===e.getModuleInstanceState(t)}))}(t)?14:void 0:2097152&i?c(n.getAliasedSymbol(t),r,n):2&r?64&i?13:262144&i?15:void 0:void 0}function l(e){switch(e){case 1:return "comment";case 2:return "identifier";case 3:return "keyword";case 4:return "number";case 25:return "bigint";case 5:return "operator";case 6:return "string";case 8:return "whitespace";case 9:return "text";case 10:return "punctuation";case 11:return "class name";case 12:return "enum name";case 13:return "interface name";case 14:return "module name";case 15:return "type parameter name";case 16:return "type alias name";case 17:return "parameter name";case 18:return "doc comment tag name";case 19:return "jsx open tag name";case 20:return "jsx close tag name";case 21:return "jsx self closing tag name";case 22:return "jsx attribute";case 23:return "jsx text";case 24:return "jsx attribute string literal value";default:return}}function u(t){e.Debug.assert(t.spans.length%3==0);for(var r=t.spans,n=[],i=0;i<r.length;i+=3)n.push({textSpan:e.createTextSpan(r[i],r[i+1]),classificationType:l(r[i+2])});return n}function _(t,r,n){var i=n.start,a=n.length,s=e.createScanner(99,!1,r.languageVariant,r.text),c=e.createScanner(99,!1,r.languageVariant,r.text),l=[];return v(r),{spans:l,endOfLineState:0};function u(e,t,r){l.push(e),l.push(t),l.push(r);}function _(t,n,i,a){if(3===n){var o=e.parseIsolatedJSDocComment(r.text,i,a);if(o&&o.jsDoc)return e.setParent(o.jsDoc,t),void function(e){var t,r,n,i,a,o,s,c=e.pos;if(e.tags)for(var l=0,_=e.tags;l<_.length;l++){var f=_[l];f.pos!==c&&d(c,f.pos-c),u(f.pos,1,10),u(f.tagName.pos,f.tagName.end-f.tagName.pos,18),c=f.tagName.end;var g=f.tagName.end;switch(f.kind){case 343:var m=f;b(m),g=m.isNameFirst&&(null===(t=m.typeExpression)||void 0===t?void 0:t.end)||m.name.end;break;case 350:var y=f;g=y.isNameFirst&&(null===(r=y.typeExpression)||void 0===r?void 0:r.end)||y.name.end;break;case 347:p(f),c=f.end,g=f.typeParameters.end;break;case 348:var h=f;g=312===(null===(n=h.typeExpression)||void 0===n?void 0:n.kind)&&(null===(i=h.fullName)||void 0===i?void 0:i.end)||(null===(a=h.typeExpression)||void 0===a?void 0:a.end)||g;break;case 341:case 345:case 342:g=f.typeExpression.end;break;case 346:v(f.typeExpression),c=f.end,g=f.typeExpression.end;break;case 344:v(f.typeExpression),c=f.end,g=(null===(o=f.typeExpression)||void 0===o?void 0:o.end)||g;break;case 349:g=(null===(s=f.name)||void 0===s?void 0:s.end)||g;break;case 331:case 332:g=f.class.end;}"object"==typeof f.comment?d(f.comment.pos,f.comment.end-f.comment.pos):"string"==typeof f.comment&&d(g,f.end-g);}return void(c!==e.end&&d(c,e.end-c));function b(e){e.isNameFirst&&(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end),e.typeExpression&&(d(c,e.typeExpression.pos-c),v(e.typeExpression),c=e.typeExpression.end),e.isNameFirst||(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end);}}(o.jsDoc)}else if(2===n&&function(t,n){var i=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/gim,a=r.text.substr(t,n),o=/^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im.exec(a);if(!o)return !1;if(!o[3]||!(o[3]in e.commentPragmas))return !1;var s=t;d(s,o[1].length),u(s+=o[1].length,o[2].length,10),u(s+=o[2].length,o[3].length,21),s+=o[3].length;for(var c=o[4],l=s;;){var _=i.exec(c);if(!_)break;var p=s+_.index+_[1].length;p>l&&(d(l,p-l),l=p),u(l,_[2].length,22),l+=_[2].length,_[3].length&&(d(l,_[3].length),l+=_[3].length),u(l,_[4].length,5),l+=_[4].length,_[5].length&&(d(l,_[5].length),l+=_[5].length),u(l,_[6].length,24),l+=_[6].length;}(s+=o[4].length)>l&&d(l,s-l),o[5]&&(u(s,o[5].length,10),s+=o[5].length);var f=t+n;return s<f&&d(s,f-s),!0}(i,a))return;d(i,a);}function d(e,t){u(e,t,1);}function p(e){for(var t=0,r=e.getChildren();t<r.length;t++)v(r[t]);}function f(t,r,n){var i;for(i=r;i<n&&!e.isLineBreak(t.charCodeAt(i));i++);for(u(r,i-r,1),c.setTextPos(i);c.getTextPos()<n;)g();}function g(){var e=c.getTextPos(),t=c.scan(),r=c.getTextPos(),n=y(t);n&&u(e,r-e,n);}function m(t){if(e.isJSDoc(t))return !0;if(e.nodeIsMissing(t))return !0;var n=function(e){switch(e.parent&&e.parent.kind){case 283:if(e.parent.tagName===e)return 19;break;case 284:if(e.parent.tagName===e)return 20;break;case 282:if(e.parent.tagName===e)return 21;break;case 288:if(e.parent.name===e)return 22}}(t);if(!e.isToken(t)&&11!==t.kind&&void 0===n)return !1;var i=11===t.kind?t.pos:function(t){for(s.setTextPos(t.pos);;){var n=s.getTextPos();if(!e.couldStartTrivia(r.text,n))return n;var i=s.scan(),a=s.getTextPos(),o=a-n;if(!e.isTrivia(i))return n;switch(i){case 4:case 5:continue;case 2:case 3:_(t,i,n,o),s.setTextPos(a);continue;case 7:var c=r.text,l=c.charCodeAt(n);if(60===l||62===l){u(n,o,1);continue}e.Debug.assert(124===l||61===l),f(c,n,a);break;case 6:break;default:e.Debug.assertNever(i);}}}(t),a=t.end-i;if(e.Debug.assert(a>=0),a>0){var o=n||y(t.kind,t);o&&u(i,a,o);}return !0}function y(t,r){if(e.isKeyword(t))return 3;if((29===t||31===t)&&r&&e.getTypeArgumentOrTypeParameterList(r.parent))return 10;if(e.isPunctuation(t)){if(r){var n=r.parent;if(63===t&&(257===n.kind||169===n.kind||166===n.kind||288===n.kind))return 5;if(223===n.kind||221===n.kind||222===n.kind||224===n.kind)return 5}return 10}if(8===t)return 4;if(9===t)return 25;if(10===t)return r&&288===r.parent.kind?24:6;if(13===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(11===t)return 23;if(79===t){if(r){switch(r.parent.kind){case 260:return r.parent.name===r?11:void 0;case 165:return r.parent.name===r?15:void 0;case 261:return r.parent.name===r?13:void 0;case 263:return r.parent.name===r?12:void 0;case 264:return r.parent.name===r?14:void 0;case 166:return r.parent.name===r?e.isThisIdentifier(r)?3:17:void 0}if(e.isConstTypeReference(r.parent))return 3}return 2}}function v(n){if(n&&e.decodedTextSpanIntersectsWith(i,a,n.pos,n.getFullWidth())){o(t,n.kind);for(var s=0,c=n.getChildren(r);s<c.length;s++){var l=c[s];m(l)||v(l);}}}}e.getSemanticClassifications=function(e,t,r,n,i){return u(s(e,t,r,n,i))},e.getEncodedSemanticClassifications=s,e.getSyntacticClassifications=function(e,t,r){return u(_(e,t,r))},e.getEncodedSyntacticClassifications=_;}(t),function(e){var t;(function(t){function r(e,t,r,i){return {spans:n(e,r,i,t),endOfLineState:0}}function n(t,r,n,o){var s=[];return t&&r&&function(t,r,n,o,s){var c=t.getTypeChecker(),u=!1;!function _(d){switch(d.kind){case 264:case 260:case 261:case 259:case 228:case 215:case 216:s.throwIfCancellationRequested();}if(d&&e.textSpanIntersectsWith(n,d.pos,d.getFullWidth())&&0!==d.getFullWidth()){var p=u;if((e.isJsxElement(d)||e.isJsxSelfClosingElement(d))&&(u=!0),e.isJsxExpression(d)&&(u=!1),e.isIdentifier(d)&&!u&&!function(t){var r=t.parent;return r&&(e.isImportClause(r)||e.isImportSpecifier(r)||e.isNamespaceImport(r))}(d)&&!e.isInfinityOrNaNString(d.escapedText)){var f=c.getSymbolAtLocation(d);if(f){2097152&f.flags&&(f=c.getAliasedSymbol(f));var g=function(t,r){var n=t.getFlags();if(32&n)return 0;if(384&n)return 1;if(524288&n)return 5;if(64&n){if(2&r)return 2}else if(262144&n)return 4;var a=t.valueDeclaration||t.declarations&&t.declarations[0];return a&&e.isBindingElement(a)&&(a=i(a)),a&&l.get(a.kind)}(f,e.getMeaningFromLocation(d));if(void 0!==g){var m=0;d.parent&&(e.isBindingElement(d.parent)||l.get(d.parent.kind)===g)&&d.parent.name===d&&(m=1),6===g&&a(d)&&(g=9),g=function(t,r,n){if(7===n||9===n||6===n){var i=t.getTypeAtLocation(r);if(i){var o=function(e){return e(i)||i.isUnion()&&i.types.some(e)};if(6!==n&&o((function(e){return e.getConstructSignatures().length>0})))return 0;if(o((function(e){return e.getCallSignatures().length>0}))&&!o((function(e){return e.getProperties().length>0}))||function(t){for(;a(t);)t=t.parent;return e.isCallExpression(t.parent)&&t.parent.expression===t}(r))return 9===n?11:10}}return n}(c,d,g);var y=f.valueDeclaration;if(y){var v=e.getCombinedModifierFlags(y),h=e.getCombinedNodeFlags(y);32&v&&(m|=2),512&v&&(m|=4),0!==g&&2!==g&&(64&v||2&h||8&f.getFlags())&&(m|=8),7!==g&&10!==g||!function(t,r){return e.isBindingElement(t)&&(t=i(t)),e.isVariableDeclaration(t)?(!e.isSourceFile(t.parent.parent.parent)||e.isCatchClause(t.parent))&&t.getSourceFile()===r:!!e.isFunctionDeclaration(t)&&!e.isSourceFile(t.parent)&&t.getSourceFile()===r}(y,r)||(m|=32),t.isSourceFileDefaultLibrary(y.getSourceFile())&&(m|=16);}else f.declarations&&f.declarations.some((function(e){return t.isSourceFileDefaultLibrary(e.getSourceFile())}))&&(m|=16);o(d,g,m);}}}e.forEachChild(d,_),u=p;}}(r);}(t,r,n,(function(e,t,n){s.push(e.getStart(r),e.getWidth(r),(t+1<<8)+n);}),o),s}function i(t){for(;;){if(!e.isBindingElement(t.parent.parent))return t.parent.parent;t=t.parent.parent;}}function a(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t}var o,s,c;(c=t.TokenEncodingConsts||(t.TokenEncodingConsts={}))[c.typeOffset=8]="typeOffset",c[c.modifierMask=255]="modifierMask",(s=t.TokenType||(t.TokenType={}))[s.class=0]="class",s[s.enum=1]="enum",s[s.interface=2]="interface",s[s.namespace=3]="namespace",s[s.typeParameter=4]="typeParameter",s[s.type=5]="type",s[s.parameter=6]="parameter",s[s.variable=7]="variable",s[s.enumMember=8]="enumMember",s[s.property=9]="property",s[s.function=10]="function",s[s.member=11]="member",(o=t.TokenModifier||(t.TokenModifier={}))[o.declaration=0]="declaration",o[o.static=1]="static",o[o.async=2]="async",o[o.readonly=3]="readonly",o[o.defaultLibrary=4]="defaultLibrary",o[o.local=5]="local",t.getSemanticClassifications=function(t,n,i,a){var o=r(t,n,i,a);e.Debug.assert(o.spans.length%3==0);for(var s=o.spans,c=[],l=0;l<s.length;l+=3)c.push({textSpan:e.createTextSpan(s[l],s[l+1]),classificationType:s[l+2]});return c},t.getEncodedSemanticClassifications=r;var l=new e.Map([[257,7],[166,6],[169,9],[264,3],[263,1],[302,8],[260,0],[171,11],[259,10],[215,10],[170,11],[174,9],[175,9],[168,9],[261,2],[262,5],[165,4],[299,9],[300,9]]);})((t=e.classifier||(e.classifier={})).v2020||(t.v2020={}));}(t),function(e){var t;(function(r){var a,o,c,l=((a={}).directory=0,a.script=1,a["external module name"]=2,a);function u(){var t=new e.Map;return {add:function(e){var r=t.get(e.name);(!r||l[r.kind]<l[e.kind])&&t.set(e.name,e);},has:t.has.bind(t),values:t.values.bind(t)}}function _(e){var r=e.map((function(e){var r=e.name,n=e.kind,i=e.span;return {name:r,kind:n,kindModifiers:d(e.extension),sortText:t.SortText.LocationPriority,replacementSpan:i}}));return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!0,entries:r}}function d(t){switch(t){case".d.ts":return ".d.ts";case".js":return ".js";case".json":return ".json";case".jsx":return ".jsx";case".ts":return ".ts";case".tsx":return ".tsx";case".d.mts":return ".d.mts";case".mjs":return ".mjs";case".mts":return ".mts";case".d.cts":return ".d.cts";case".cjs":return ".cjs";case".cts":return ".cts";case".tsbuildinfo":return e.Debug.fail("Extension ".concat(".tsbuildinfo"," is unsupported."));case void 0:return "";default:return e.Debug.assertNever(t)}}function p(r,n,i,a,o,s,c){var l,u,_=f(n.parent);switch(_.kind){case 198:var d=f(_.parent);switch(d.kind){case 230:case 180:var p=e.findAncestor(_,(function(e){return e.parent===d}));return p?{kind:2,types:m(a.getTypeArgumentConstraint(p)),isNewIdentifier:!1}:void 0;case 196:var y=d,v=y.indexType,h=y.objectType;if(!e.rangeContainsPosition(v,i))return;return g(a.getTypeFromTypeNode(h));case 202:return {kind:0,paths:b(r,n,o,s,a,c)};case 189:if(!e.isTypeReferenceNode(d.parent))return;var x=(l=d,u=_,e.mapDefined(l.types,(function(t){return t!==u&&e.isLiteralTypeNode(t)&&e.isStringLiteral(t.literal)?t.literal.text:void 0})));return {kind:2,types:m(a.getTypeArgumentConstraint(d)).filter((function(t){return !e.contains(x,t.value)})),isNewIdentifier:!1};default:return}case 299:return e.isObjectLiteralExpression(_.parent)&&_.name===n?function(r,n){var i=r.getContextualType(n);if(i){var a=r.getContextualType(n,4);return {kind:1,symbols:t.getPropertiesForObjectExpression(i,a,n,r),hasIndexSignature:e.hasIndexSignature(i)}}}(a,_.parent):E();case 209:var D=_,S=D.expression,T=D.argumentExpression;return n===e.skipParentheses(T)?g(a.getTypeAtLocation(S)):void 0;case 210:case 211:case 288:if(!function(t){return e.isCallExpression(t.parent)&&e.firstOrUndefined(t.parent.arguments)===t&&e.isIdentifier(t.parent.expression)&&"require"===t.parent.expression.escapedText}(n)&&!e.isImportCall(_)){var C=e.SignatureHelp.getArgumentInfoForCompletions(288===_.kind?_.parent:n,i,r);return C&&function(t,r,n,i){var a=!1,o=new e.Map,s=[],c=e.isJsxOpeningLikeElement(t)?e.Debug.checkDefined(e.findAncestor(r.parent,e.isJsxAttribute)):r;i.getResolvedSignatureForStringLiteralCompletions(t,c,s);var l=e.flatMap(s,(function(r){if(e.signatureHasRestParameter(r)||!(n.argumentCount>r.parameters.length)){var s=r.getTypeParameterAtPosition(n.argumentIndex);if(e.isJsxOpeningLikeElement(t)){var l=i.getTypeOfPropertyOfType(s,c.name.text);l&&(s=l);}return a=a||!!(4&s.flags),m(s,o)}}));return e.length(l)?{kind:2,types:l,isNewIdentifier:a}:void 0}(C.invocation,n,C,a)||E()}case 269:case 275:case 280:return {kind:0,paths:b(r,n,o,s,a,c)};default:return E()}function E(){return {kind:2,types:m(e.getContextualTypeFromParent(n,a)),isNewIdentifier:!1}}}function f(t){switch(t.kind){case 193:return e.walkUpParenthesizedTypes(t);case 214:return e.walkUpParenthesizedExpressions(t);default:return t}}function g(t){return t&&{kind:1,symbols:e.filter(t.getApparentProperties(),(function(t){return !(t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))})),hasIndexSignature:e.hasIndexSignature(t)}}function m(t,r){return void 0===r&&(r=new e.Map),t?(t=e.skipConstraint(t)).isUnion()?e.flatMap(t.types,(function(e){return m(e,r)})):!t.isStringLiteral()||1024&t.flags||!e.addToSeen(r,t.value)?e.emptyArray:[t]:e.emptyArray}function y(e,t,r){return {name:e,kind:t,extension:r}}function v(e){return y(e,"directory",void 0)}function h(t,r,n){var i=function(t,r){var n=Math.max(t.lastIndexOf(e.directorySeparator),t.lastIndexOf(e.altDirectorySeparator)),i=-1!==n?n+1:0,a=t.length-i;return 0===a||e.isIdentifierText(t.substr(i,a),99)?void 0:e.createTextSpan(r+i,a)}(t,r),a=0===t.length?void 0:e.createTextSpan(r,t.length);return n.map((function(t){var r=t.name,n=t.kind,o=t.extension;return -1!==Math.max(r.indexOf(e.directorySeparator),r.indexOf(e.altDirectorySeparator))?{name:r,kind:n,extension:o,span:a}:{name:r,kind:n,extension:o,span:i}}))}function b(t,r,i,a,o,s){return h(r.text,r.getStart(t)+1,function(t,r,i,a,o,s){var c=e.normalizeSlashes(r.text),l=e.isStringLiteralLike(r)?e.getModeForUsageLocation(t,r):void 0,_=t.path,d=e.getDirectoryPath(_);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){var t=e.length>=3&&46===e.charCodeAt(1)?2:1,r=e.charCodeAt(t);return 47===r||92===r}return !1}(c)||!i.baseUrl&&(e.isRootedDiskPath(c)||e.isUrl(c))?function(t,r,i,a,o,s){var c=x(i,s);return i.rootDirs?function(t,r,i,a,o,s,c){var l=function(t,r,i,a){t=t.map((function(t){return e.normalizePath(e.isRootedDiskPath(t)?t:e.combinePaths(r,t))}));var o=e.firstDefined(t,(function(t){return e.containsPath(t,i,r,a)?i.substr(t.length):void 0}));return e.deduplicate(n$4(n$4([],t.map((function(t){return e.combinePaths(t,o)})),!0),[i],!1),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive)}(t,o.project||s.getCurrentDirectory(),i,!(s.useCaseSensitiveFileNames&&s.useCaseSensitiveFileNames()));return e.flatMap(l,(function(t){return e.arrayFrom(T(r,t,a,s,c).values())}))}(i.rootDirs,t,r,c,i,a,o):e.arrayFrom(T(t,r,c,a,o).values())}(c,d,i,a,_,p()):function(t,r,n,i,a,o,s){var c=i.baseUrl,l=i.paths,_=u(),d=x(i,o);if(c){var p=i.project||a.getCurrentDirectory(),f=e.normalizePath(e.combinePaths(p,c));T(t,f,d,a,void 0,_),l&&E(_,t,f,d,a,l);}for(var g=A(t),m=0,v=function(t,r,n){var i=n.getAmbientModules().map((function(t){return e.stripQuotes(t.name)})).filter((function(r){return e.startsWith(r,t)}));if(void 0!==r){var a=e.ensureTrailingDirectorySeparator(r);return i.map((function(t){return e.removePrefix(t,a)}))}return i}(t,g,s);m<v.length;m++){var h=v[m];_.add(y(h,"external module name",void 0));}if(I(a,i,r,g,d,_),D(i)){var b=!1;if(void 0===g)for(var S=0,C=function(t,r){if(!t.readFile||!t.fileExists)return e.emptyArray;for(var n=[],i=0,a=e.findPackageJsons(r,t);i<a.length;i++)for(var o=a[i],s=e.readJson(o,t),c=0,l=M;c<l.length;c++){var u=s[l[c]];if(u)for(var _ in u)e.hasProperty(u,_)&&!e.startsWith(_,"@types/")&&n.push(_);}return n}(a,r);S<C.length;S++){var F=y(C[S],"external module name",void 0);_.has(F.name)||(b=!0,_.add(F));}if(!b){var P=function(r){var n=e.combinePaths(r,"node_modules");e.tryDirectoryExists(a,n)&&T(t,n,d,a,void 0,_);};if(g&&function(t){return e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext}(i)){var w=P;P=function(r){var i=e.getPathComponents(t);i.shift();var o=i.shift();if(!o)return w(r);if(e.startsWith(o,"@")){var s=i.shift();if(!s)return w(r);o=e.combinePaths(o,s);}var c=e.combinePaths(r,"node_modules",o),l=e.combinePaths(c,"package.json");if(e.tryFileExists(a,l)){var u=e.readJson(l,a).exports;if(u){if("object"!=typeof u||null===u)return;var p=e.getOwnKeys(u),f=i.join("/")+(i.length&&e.hasTrailingDirectorySeparator(t)?"/":""),g=n===e.ModuleKind.ESNext?["node","import","types"]:["node","require","types"];return void k(_,f,c,d,a,p,(function(t){return e.singleElementArray(N(u[t],g))}),e.comparePatternKeys)}}return w(r)};}e.forEachAncestorDirectory(r,P);}}return e.arrayFrom(_.values())}(c,d,l,i,a,p(),o);function p(){var n=e.isStringLiteralLike(r)?e.getModeForUsageLocation(t,r):void 0;return "js"===s.importModuleSpecifierEnding||n===e.ModuleKind.ESNext?2:0}}(t,r,i,a,o,s))}function x(t,r){return void 0===r&&(r=0),{extensions:e.flatten(S(t)),includeExtensionsOption:r}}function D(t){return e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeJs||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext}function S(t){var r=e.getSupportedExtensions(t);return D(t)?e.getSupportedExtensionsWithJsonIfResolveJsonModule(t,r):r}function T(t,r,n,i,a,o){var s;void 0===o&&(o=u()),void 0===t&&(t=""),t=e.normalizeSlashes(t),e.hasTrailingDirectorySeparator(t)||(t=e.getDirectoryPath(t)),""===t&&(t="."+e.directorySeparator),t=e.ensureTrailingDirectorySeparator(t);var c=e.resolvePath(r,t),l=e.hasTrailingDirectorySeparator(c)?c:e.getDirectoryPath(c),_=e.findPackageJson(l,i);if(_){var d=e.readJson(_,i).typesVersions;if("object"==typeof d){var p=null===(s=e.getPackageJsonTypesVersionsPaths(d))||void 0===s?void 0:s.paths;if(p){var f=e.getDirectoryPath(_);if(E(o,c.slice(e.ensureTrailingDirectorySeparator(f).length),f,n,i,p))return o}}}var g=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!e.tryDirectoryExists(i,l))return o;var m=e.tryReadDirectory(i,l,n.extensions,void 0,["./*"]);if(m)for(var h=0,b=m;h<b.length;h++){var x=b[h];if(x=e.normalizePath(x),!a||0!==e.comparePaths(x,a,r,g)){var D=C(e.getBaseFileName(x),i.getCompilationSettings(),n.includeExtensionsOption),S=D.name,T=D.extension;o.add(y(S,"script",T));}}var k=e.tryGetDirectories(i,l);if(k)for(var N=0,A=k;N<A.length;N++){var F=A[N],P=e.getBaseFileName(e.normalizePath(F));"@types"!==P&&o.add(v(P));}return o}function C(t,r,n){var i=e.moduleSpecifiers.tryGetJSExtensionForFile(t,r);return 0!==n||e.fileExtensionIsOneOf(t,[".json",".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])?(e.fileExtensionIsOneOf(t,[".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])||2===n)&&i?{name:e.changeExtension(t,i),extension:i}:{name:t,extension:e.tryGetExtensionFromPath(t)}:{name:e.removeFileExtension(t),extension:e.tryGetExtensionFromPath(t)}}function E(t,r,n,i,a,o){return k(t,r,n,i,a,e.getOwnKeys(o),(function(e){return o[e]}),(function(t,r){var n=e.tryParsePattern(t),i=e.tryParsePattern(r),a="object"==typeof n?n.prefix.length:t.length,o="object"==typeof i?i.prefix.length:r.length;return e.compareValues(o,a)}))}function k(t,r,n,i,a,o,s,c){for(var l,u=[],_=0,d=o;_<d.length;_++){var p=d[_];if("."!==p){var f=p.replace(/^\.\//,""),g=s(p);if(g){var m=e.tryParsePattern(f);if(!m)continue;var v="object"==typeof m&&e.isPatternMatch(m,r);v&&(void 0===l||-1===c(p,l))&&(l=p,u=u.filter((function(e){return !e.matchedPattern}))),"string"!=typeof m&&void 0!==l&&1===c(p,l)||u.push({matchedPattern:v,results:F(f,g,r,n,i,a).map((function(e){return y(e.name,e.kind,e.extension)}))});}}}return u.forEach((function(e){return e.results.forEach((function(e){return t.add(e)}))})),void 0!==l}function N(t,r){if("string"==typeof t)return t;if(t&&"object"==typeof t&&!e.isArray(t))for(var n in t)if("default"===n||r.indexOf(n)>-1||e.isApplicableVersionedTypesKey(r,n))return N(t[n],r)}function A(t){return L(t)?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0}function F(t,r,n,a,o,c){if(!e.endsWith(t,"*"))return e.stringContains(t,"*")?e.emptyArray:_(t,"script");var l=t.slice(0,t.length-1),u=e.tryRemovePrefix(n,l);return void 0===u?"/"===t[t.length-2]?_(l,"directory"):e.flatMap(r,(function(e){var t;return null===(t=P("",a,e,o,c))||void 0===t?void 0:t.map((function(e){var t=e.name,r=s(e,["name"]);return i$1({name:l+t},r)}))})):e.flatMap(r,(function(e){return P(u,a,e,o,c)}));function _(t,r){return e.startsWith(t,n)?[{name:e.removeTrailingDirectorySeparator(t),kind:r,extension:void 0}]:e.emptyArray}}function P(t,r,i,a,o){if(o.readDirectory){var s=e.tryParsePattern(i);if(void 0!==s&&!e.isString(s)){var c=e.resolvePath(s.prefix),l=e.hasTrailingDirectorySeparator(s.prefix)?c:e.getDirectoryPath(c),u=e.hasTrailingDirectorySeparator(s.prefix)?"":e.getBaseFileName(c),_=L(t),d=_?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0,p=_?e.combinePaths(l,u+d):l,f=e.normalizePath(s.suffix),g=e.normalizePath(e.combinePaths(r,p)),m=_?g:e.ensureTrailingDirectorySeparator(g)+u,h=f?"**/*"+f:"./*",b=e.mapDefined(e.tryReadDirectory(o,g,a.extensions,void 0,[h]),(function(t){var r,n,i,s,c,l=(r=t,i=e.normalizePath(r),s=m,c=f,void 0===(n=e.startsWith(i,s)&&e.endsWith(i,c)?i.slice(s.length,i.length-c.length):void 0)?void 0:w(n));if(l){if(L(l))return v(e.getPathComponents(w(l))[1]);var u=C(l,o.getCompilationSettings(),a.includeExtensionsOption);return y(u.name,"script",u.extension)}})),x=f?e.emptyArray:e.mapDefined(e.tryGetDirectories(o,g),(function(e){return "node_modules"===e?void 0:v(e)}));return n$4(n$4([],b,!0),x,!0)}}}function w(t){return t[0]===e.directorySeparator?t.slice(1):t}function I(t,r,n,i,a,o){void 0===o&&(o=u());for(var s=new e.Map,c=0,l=e.tryAndIgnoreErrors((function(){return e.getEffectiveTypeRoots(r,t)}))||e.emptyArray;c<l.length;c++)f(l[c]);for(var _=0,d=e.findPackageJsons(n,t);_<d.length;_++){var p=d[_];f(e.combinePaths(e.getDirectoryPath(p),"node_modules/@types"));}return o;function f(n){if(e.tryDirectoryExists(t,n))for(var c=0,l=e.tryGetDirectories(t,n);c<l.length;c++){var u=l[c],_=e.unmangleScopedPackageName(u);if(!r.types||e.contains(r.types,_))if(void 0===i)s.has(_)||(o.add(y(_,"external module name",void 0)),s.set(_,!0));else {var d=e.combinePaths(n,u),p=e.tryRemoveDirectoryPrefix(i,_,e.hostGetCanonicalFileName(t));void 0!==p&&T(p,d,a,t,void 0,o);}}}}r.getStringLiteralCompletions=function(r,n,i,a,o,s,c,l){if(e.isInReferenceComment(r,n)){var u=function(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=e.getLeadingCommentRanges(t.text,a.pos),s=o&&e.find(o,(function(e){return r>=e.pos&&r<=e.end}));if(s){var c=t.text.slice(s.pos,r),l=O.exec(c);if(l){var u=l[1],_=l[2],d=l[3],p=e.getDirectoryPath(t.path),f="path"===_?T(d,p,x(n,1),i,t.path):"types"===_?I(i,n,p,A(d),x(n)):e.Debug.fail();return h(d,s.pos+u.length,e.arrayFrom(f.values()))}}}(r,n,a,o);return u&&_(u)}if(e.isInString(r,n,i)){if(!i||!e.isStringLiteralLike(i))return;return function(r,n,i,a,o,s,c,l){if(void 0!==r){var u=e.createTextSpanFromStringLiteralLikeContent(n);switch(r.kind){case 0:return _(r.paths);case 1:var d=e.createSortedArray();return t.getCompletionEntriesFromSymbols(r.symbols,d,n,n,i,i,a,o,99,s,4,l,c,void 0),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:r.hasIndexSignature,optionalReplacementSpan:u,entries:d};case 2:return d=r.types.map((function(r){return {name:r.value,kindModifiers:"",kind:"string",sortText:t.SortText.LocationPriority,replacementSpan:e.getReplacementSpanForContextToken(n)}})),{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:r.isNewIdentifier,optionalReplacementSpan:u,entries:d};default:return e.Debug.assertNever(r)}}}(u=p(r,i,n,s.getTypeChecker(),a,o,l),i,r,o,s,c,a,l)}},r.getStringLiteralCompletionDetails=function(r,n,i,a,o,s,c,l,u){if(a&&e.isStringLiteralLike(a)){var _=p(n,a,i,o,s,c,u);return _&&function(r,n,i,a,o,s){switch(i.kind){case 0:return (c=e.find(i.paths,(function(e){return e.name===r})))&&t.createCompletionDetails(r,d(c.extension),c.kind,[e.textPart(r)]);case 1:var c;return (c=e.find(i.symbols,(function(e){return e.name===r})))&&t.createCompletionDetailsForSymbol(c,o,a,n,s);case 2:return e.find(i.types,(function(e){return e.value===r}))?t.createCompletionDetails(r,"","type",[e.textPart(r)]):void 0;default:return e.Debug.assertNever(i)}}(r,a,_,n,o,l)}},function(e){e[e.Paths=0]="Paths",e[e.Properties=1]="Properties",e[e.Types=2]="Types";}(o||(o={})),function(e){e[e.Exclude=0]="Exclude",e[e.Include=1]="Include",e[e.ModuleSpecifierCompletion=2]="ModuleSpecifierCompletion";}(c||(c={}));var O=/^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/,M=["dependencies","devDependencies","peerDependencies","optionalDependencies"];function L(t){return e.stringContains(t,e.directorySeparator)}})((t=e.Completions||(e.Completions={})).StringCompletions||(t.StringCompletions={}));}(t),function(e){!function(t){var r,n,a,o,s,c;function l(e){return !!(e&&4&e.kind)}function u(e){return !(!e||32!==e.kind)}function _(e){return (l(e)||u(e))&&!!e.isFromPackageJson}function d(e){return !!(e&&64&e.kind)}function p(e){return !!(e&&128&e.kind)}function f(r,n,i,a,o,s,c,l,u){var _,d,p,f=e.timestamp(),g=c||e.moduleResolutionRespectsExports(e.getEmitModuleResolutionKind(a.getCompilerOptions())),m=!1,y=0,v=0,h=0,b=0,x=u({tryResolve:function(e,r,n){if(n){var a=i.getModuleSpecifierForBestExportInfo(e,r,o,l);return a&&y++,a||"failed"}var c=g||s.allowIncompleteCompletions&&v<t.moduleSpecifierResolutionLimit,u=!c&&s.allowIncompleteCompletions&&b<t.moduleSpecifierResolutionCacheAttemptLimit,_=c||u?i.getModuleSpecifierForBestExportInfo(e,r,o,l,u):void 0;return (!c&&!u||u&&!_)&&(m=!0),v+=(null==_?void 0:_.computedWithoutCacheCount)||0,h+=e.length-((null==_?void 0:_.computedWithoutCacheCount)||0),u&&b++,_||(g?"failed":"skipped")},skippedAny:function(){return m},resolvedAny:function(){return v>0},resolvedBeyondLimit:function(){return v>t.moduleSpecifierResolutionLimit}}),D=b?" (".concat((h/b*100).toFixed(1),"% hit rate)"):"";return null===(_=n.log)||void 0===_||_.call(n,"".concat(r,": resolved ").concat(v," module specifiers, plus ").concat(y," ambient and ").concat(h," from cache").concat(D)),null===(d=n.log)||void 0===d||d.call(n,"".concat(r,": response is ").concat(m?"incomplete":"complete")),null===(p=n.log)||void 0===p||p.call(n,"".concat(r,": ").concat(e.timestamp()-f)),x}function g(t,r){var n,i,a=e.compareStringsCaseSensitiveUI(t.sortText,r.sortText);return 0===a&&(a=e.compareStringsCaseSensitiveUI(t.name,r.name)),0===a&&(null===(n=t.data)||void 0===n?void 0:n.moduleSpecifier)&&(null===(i=r.data)||void 0===i?void 0:i.moduleSpecifier)&&(a=e.compareNumberOfDirectorySeparators(t.data.moduleSpecifier,r.data.moduleSpecifier)),0===a?-1:a}function m(e){return !!(null==e?void 0:e.moduleSpecifier)}function y(e){return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function v(e,t,r){return {kind:4,keywordCompletions:V(e,t),isNewIdentifierLocation:r}}function h(t){return 79===(null==t?void 0:t.kind)?e.createTextSpanFromNode(t):void 0}function b(t,r){return !e.isSourceFileJS(t)||!!e.isCheckJsEnabledForFile(t,r)}function x(e){switch(e){case 0:case 3:case 2:return !0;default:return !1}}function D(t,r,n){return "object"==typeof n?e.pseudoBigIntToString(n)+"n":e.isString(n)?e.quote(t,r,n):JSON.stringify(n)}function S(e,r,n){return {name:D(e,r,n),kind:"string",kindModifiers:"",sortText:t.SortText.LocationPriority}}function T(n,i,a,o,s,c,d,f,g,m,y,v,h,b,x,D,S,T,E,N,w,I){var O,M,L,R,B,j,J,z,U=e.getReplacementSpanForContextToken(a),K=P(y),V=f.getTypeChecker(),q=y&&function(e){return !!(16&e.kind)}(y),W=y&&function(e){return !!(2&e.kind)}(y)||m;if(y&&function(e){return !!(1&e.kind)}(y))L=m?"this".concat(q?"?.":"","[").concat(A(c,T,g),"]"):"this".concat(q?"?.":".").concat(g);else if((W||q)&&h){L=W?"[".concat(m?A(c,T,g):g,"]"):g,(q||h.questionDotToken)&&(L="?.".concat(L));var H=e.findChildOfKind(h,24,c)||e.findChildOfKind(h,28,c);if(!H)return;var G=e.startsWith(g,h.name.text)?h.name.end:H.end;U=e.createTextSpanFromBounds(H.getStart(c),G);}if(b&&(void 0===L&&(L=g),L="{".concat(L,"}"),"boolean"!=typeof b&&(U=e.createTextSpanFromNode(b,c))),y&&function(e){return !!(8&e.kind)}(y)&&h){void 0===L&&(L=g);var Q=e.findPrecedingToken(h.pos,c),X="";Q&&e.positionIsASICandidate(Q.end,Q.parent,c)&&(X=";"),X+="(await ".concat(h.expression.getText(),")"),L=m?"".concat(X).concat(L):"".concat(X).concat(q?"?.":".").concat(L),U=e.createTextSpanFromBounds(h.getStart(c),h.end);}if(u(y)&&(j=[e.textPart(y.moduleSpecifier)],x&&(O=function(t,r,n,i,a,o,s){var c=r.replacementSpan,l=e.quote(a,s,n.moduleSpecifier),u=n.isDefaultExport?1:"export="===n.exportName?2:0,_=s.includeCompletionsWithSnippetText?"$1":"",d=e.codefix.getImportKind(a,u,o,!0),p=r.couldBeTypeOnlyImportSpecifier,f=r.isTopLevelTypeOnly?" ".concat(e.tokenToString(154)," "):" ",g=p?"".concat(e.tokenToString(154)," "):"",m=i?";":"";switch(d){case 3:return {replacementSpan:c,insertText:"import".concat(f).concat(e.escapeSnippetText(t)).concat(_," = require(").concat(l,")").concat(m)};case 1:return {replacementSpan:c,insertText:"import".concat(f).concat(e.escapeSnippetText(t)).concat(_," from ").concat(l).concat(m)};case 2:return {replacementSpan:c,insertText:"import".concat(f,"* as ").concat(e.escapeSnippetText(t)," from ").concat(l).concat(m)};case 0:return {replacementSpan:c,insertText:"import".concat(f,"{ ").concat(g).concat(e.escapeSnippetText(t)).concat(_," } from ").concat(l).concat(m)}}}(g,x,y,D,c,S,T),L=O.insertText,U=O.replacementSpan,B=!!T.includeCompletionsWithSnippetText||void 0)),64===(null==y?void 0:y.kind)&&(J=!0),T.includeCompletionsWithClassMemberSnippets&&T.includeCompletionsWithInsertText&&3===E&&function(t,r,n){if(e.isInJSFile(r))return !1;return !!(106500&t.flags)&&(e.isClassLike(r)||r.parent&&r.parent.parent&&e.isClassElement(r.parent)&&r===r.parent.name&&r.parent.getLastToken(n)===r.parent.name&&e.isClassLike(r.parent.parent)||r.parent&&e.isSyntaxList(r)&&e.isClassLike(r.parent))}(n,s,c)){var Y=void 0;L=(M=C(d,f,S,T,g,n,s,o,N)).insertText,B=M.isSnippet,Y=M.importAdder,U=M.replacementSpan,i=t.SortText.ClassMemberSnippets,(null==Y?void 0:Y.hasFixes())&&(J=!0,K=r.ClassMemberSnippet);}if(y&&p(y)&&(L=y.insertText,B=y.isSnippet,z=y.labelDetails,T.useLabelDetailsInCompletionEntries||(g+=z.detail,z=void 0),K=r.ObjectLiteralMethodSnippet,i=t.SortText.SortBelow(i)),w&&!I&&T.includeCompletionsWithSnippetText&&T.jsxAttributeCompletionStyle&&"none"!==T.jsxAttributeCompletionStyle){var Z="braces"===T.jsxAttributeCompletionStyle,$=V.getTypeOfSymbolAtLocation(n,s);"auto"!==T.jsxAttributeCompletionStyle||528&$.flags||1048576&$.flags&&e.find($.types,(function(e){return !!(528&e.flags)}))||(402653316&$.flags||1048576&$.flags&&e.every($.types,(function(e){return !!(402686084&e.flags)}))?(L="".concat(e.escapeSnippetText(g),"=").concat(e.quote(c,T,"$1")),B=!0):Z=!0),Z&&(L="".concat(e.escapeSnippetText(g),"={$1}"),B=!0);}if(void 0===L||T.includeCompletionsWithInsertText)return (l(y)||u(y))&&(R=k(y),J=!x),{name:g,kind:e.SymbolDisplay.getSymbolKind(V,n,s),kindModifiers:e.SymbolDisplay.getSymbolModifiers(V,n),sortText:i,source:K,hasAction:!!J||void 0,isRecommended:F(n,v,V)||void 0,insertText:L,replacementSpan:U,sourceDisplay:j,labelDetails:z,isSnippet:B,isPackageJsonImport:_(y)||void 0,isImportStatementCompletion:!!x||void 0,data:R}}function C(t,r,n,i,a,o,s,c,l){var u,_,d=e.findAncestor(s,e.isClassLike);if(!d)return {insertText:a};var p,f=a,g=r.getTypeChecker(),m=s.getSourceFile(),y=E({removeComments:!0,module:n.module,target:n.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(n,e.maybeBind(t,t.getNewLine)))}),v=e.codefix.createImportAdder(m,r,i,t);if(i.includeCompletionsWithSnippetText){u=!0;var h=e.factory.createEmptyStatement();p=e.factory.createBlock([h],!0),e.setSnippetElement(h,{kind:0,order:0});}else p=e.factory.createBlock([],!0);var b=0,x=function(t){if(!t)return {modifiers:0};var r,n,i,a=0;return i=t,(n=e.isModifier(i)?i.kind:e.isIdentifier(i)&&i.originalKeywordKind&&e.isModifierKind(i.originalKeywordKind)?i.originalKeywordKind:void 0)&&(a|=e.modifierToFlag(n),r=e.createTextSpanFromNode(t)),e.isPropertyDeclaration(t.parent)&&(a|=126975&e.modifiersToFlags(t.parent.modifiers),r=e.createTextSpanFromNode(t.parent)),{modifiers:a,span:r}}(c),D=x.modifiers,S=x.span,T=!!(256&D),C=[];if(e.codefix.addNewNodeForMemberSymbol(o,d,m,{program:r,host:t},i,v,(function(t){var r=0;T&&(r|=256),e.isClassElement(t)&&1===g.getMemberOverrideModifierStatus(d,t)&&(r|=16384),C.length||(b=t.modifierFlagsCache|r|D),t=e.factory.updateModifiers(t,b),C.push(t);}),p,2,T),C.length){var k=131073;_=S,f=l?y.printAndFormatSnippetList(k,e.factory.createNodeArray(C),m,l):y.printSnippetList(k,e.factory.createNodeArray(C),m);}return {insertText:f,isSnippet:u,importAdder:v,replacementSpan:_}}function E(t){var r,n=e.textChanges.createWriter(e.getNewLineCharacter(t)),a=e.createPrinter(t,n),o=i$1(i$1({},n),{write:function(e){return s(e,(function(){return n.write(e)}))},nonEscapingWrite:n.write,writeLiteral:function(e){return s(e,(function(){return n.writeLiteral(e)}))},writeStringLiteral:function(e){return s(e,(function(){return n.writeStringLiteral(e)}))},writeSymbol:function(e,t){return s(e,(function(){return n.writeSymbol(e,t)}))},writeParameter:function(e){return s(e,(function(){return n.writeParameter(e)}))},writeComment:function(e){return s(e,(function(){return n.writeComment(e)}))},writeProperty:function(e){return s(e,(function(){return n.writeProperty(e)}))}});return {printSnippetList:function(t,n,i){var a=c(t,n,i);return r?e.textChanges.applyChanges(a,r):a},printAndFormatSnippetList:function(t,n,a,o){var s={text:c(t,n,a),getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}},l=e.getFormatCodeSettingsForWriting(o,a),u=e.flatMap(n,(function(t){var r=e.textChanges.assignPositionsToNode(t);return e.formatting.formatNodeGivenIndentation(r,s,a.languageVariant,0,0,i$1(i$1({},o),{options:l}))})),_=r?e.stableSort(e.concatenate(u,r),(function(t,r){return e.compareTextSpans(t.span,r.span)})):u;return e.textChanges.applyChanges(s.text,_)}};function s(t,i){var a=e.escapeSnippetText(t);if(a!==t){var o=n.getTextPos();i();var s=n.getTextPos();r=e.append(r||(r=[]),{newText:a,span:{start:o,length:s-o}});}else i();}function c(e,t,n){return r=void 0,o.clear(),a.writeList(e,t,n,o),o.getText()}}function k(t){var r=t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),n=!!t.isFromPackageJson||void 0;return u(t)?{exportName:t.exportName,moduleSpecifier:t.moduleSpecifier,ambientModuleName:r,fileName:t.fileName,isPackageJsonImport:n}:{exportName:t.exportName,exportMapKey:t.exportMapKey,fileName:t.fileName,ambientModuleName:t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),isPackageJsonImport:!!t.isFromPackageJson||void 0}}function N(e,t,r){var n="default"===e.exportName,i=!!e.isPackageJsonImport;return m(e)?{kind:32,exportName:e.exportName,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}}function A(t,r,n){return /^\d+$/.test(n)?n:e.quote(t,r,n)}function F(e,t,r){return e===t||!!(1048576&e.flags)&&r.getExportSymbolOfSymbol(e)===t}function P(t){return l(t)?e.stripQuotes(t.moduleSymbol.name):u(t)?t.moduleSpecifier:1===(null==t?void 0:t.kind)?r.ThisProperty:64===(null==t?void 0:t.kind)?r.TypeOnlyAlias:void 0}function w(r,n,i,a,o,s,c,l,u,_,f,m,y,v,h,b,x,D,S,C,E,k,N,A){for(var F,P=e.timestamp(),w=(W=o,e.findAncestor(W,(function(t){return e.isFunctionBlock(t)||function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t}(t)||e.isBindingPattern(t)?"quit":e.isVariableDeclaration(t)}))),I=e.probablyUsesSemicolons(s),O=l.getTypeChecker(),M=new e.Map,L=0;L<r.length;L++){var R=r[L],B=null==E?void 0:E[L],j=z(R,u,B,f,!!x);if(j&&(!M.get(j.name)||B&&p(B))&&(1!==f||!k||H(R,k))){var J=j.name,U=j.needsConvertPropertyAccess,K=null!==(F=null==k?void 0:k[e.getSymbolId(R)])&&void 0!==F?F:t.SortText.LocationPriority,V=T(R,le(R,O)?t.SortText.Deprecated(K):K,i,a,o,s,c,l,J,U,B,C,b,D,S,I,y,m,f,v,N,A);if(V){var q=(!B||d(B))&&!(void 0===R.parent&&!e.some(R.declarations,(function(e){return e.getSourceFile()===o.getSourceFile()})));M.set(J,q),e.insertSorted(n,V,g,!0);}}}var W;return _("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(e.timestamp()-P)),{has:function(e){return M.has(e)},add:function(e){return M.set(e,!0)}};function H(r,n){var i=r.flags;if(!e.isSourceFile(o)){if(e.isExportAssignment(o.parent))return !0;if(w&&r.valueDeclaration===w)return !1;var a=e.skipAlias(r,O);if(s.externalModuleIndicator&&!y.allowUmdGlobalAccess&&n[e.getSymbolId(r)]===t.SortText.GlobalsOrKeywords&&(n[e.getSymbolId(a)]===t.SortText.AutoImportSuggestions||n[e.getSymbolId(a)]===t.SortText.LocationPriority))return !1;if(i|=e.getCombinedLocalAndExportSymbolFlags(a),e.isInRightSideOfInternalImportEqualsDeclaration(o))return !!(1920&i);if(h)return ce(r,O)}return !!(111551&i)}}function I(t,n,i,a,o,s,c){if(o.data){var l=J(o.name,o.data,t,s);if(l){var u=j(a,i),_=u.contextToken,d=u.previousToken;return {type:"symbol",symbol:l.symbol,location:e.getTouchingPropertyName(i,a),previousToken:d,contextToken:_,isJsxInitializer:!1,isTypeOnlyLocation:!1,origin:l.origin}}}var p=t.getCompilerOptions(),f=B(t,n,i,p,a,{includeCompletionsForModuleExports:!0,includeCompletionsWithInsertText:!0},o,s,void 0);if(!f)return {type:"none"};if(0!==f.kind)return {type:"request",request:f};var g=f.symbols,m=f.literals,y=f.location,v=f.completionKind,h=f.symbolToOriginInfoMap,b=f.contextToken,x=f.previousToken,S=f.isJsxInitializer,T=f.isTypeOnlyLocation,C=e.find(m,(function(e){return D(i,c,e)===o.name}));return void 0!==C?{type:"literal",literal:C}:e.firstDefined(g,(function(t,n){var i=h[n],a=z(t,e.getEmitScriptTarget(p),i,v,f.isJsxIdentifierExpected);return a&&a.name===o.name&&(o.source===r.ClassMemberSnippet&&106500&t.flags||o.source===r.ObjectLiteralMethodSnippet&&8196&t.flags||P(i)===o.source)?{type:"symbol",symbol:t,location:y,origin:i,contextToken:b,previousToken:x,isJsxInitializer:S,isTypeOnlyLocation:T}:void 0}))||{type:"none"}}function O(t,r,n){return L(t,"",r,[e.displayPart(t,n)])}function M(t,r,n,i,a,o,s){var c=r.runWithCancellationToken(a,(function(r){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,t,n,i,i,7)})),l=c.displayParts,u=c.documentation,_=c.symbolKind,d=c.tags;return L(t.name,e.SymbolDisplay.getSymbolModifiers(r,t),_,l,u,d,o,s)}function L(e,t,r,n,i,a,o,s){return {name:e,kindModifiers:t,kind:r,displayParts:n,documentation:i,tags:a,codeActions:o,source:s,sourceDisplay:s}}function R(t,r,n){var i=n.getAccessibleSymbolChain(t,r,67108863,!1);return i?e.first(i):t.parent&&(function(e){var t;return !!(null===(t=e.declarations)||void 0===t?void 0:t.some((function(e){return 308===e.kind})))}(t.parent)?t:R(t.parent,r,n))}function B(r,n,a,o,s,c,l,u,_,d){var p=r.getTypeChecker(),g=b(a,o),m=e.timestamp(),y=e.getTokenAtPosition(a,s);n("getCompletionData: Get current token: "+(e.timestamp()-m)),m=e.timestamp();var h=e.isInComment(a,s,y);n("getCompletionData: Is inside comment: "+(e.timestamp()-m));var x=!1,D=!1;if(h){if(e.hasDocComment(a,s)){if(64===a.text.charCodeAt(s-1))return {kind:1};var S=e.getLineStartPositionForPosition(s,a);if(!/[^\*|\s(/)]/.test(a.text.substring(S,s)))return {kind:2}}var T=function(t,r){return e.findAncestor(t,(function(t){return !(!e.isJSDocTag(t)||!e.rangeContainsPosition(t,r))||!!e.isJSDoc(t)&&"quit"}))}(y,s);if(T){if(T.tagName.pos<=s&&s<=T.tagName.end)return {kind:1};var C=function(t){if(function(e){switch(e.kind){case 343:case 350:case 344:case 346:case 348:return !0;case 347:return !!e.constraint;default:return !1}}(t)){var r=e.isJSDocTemplateTag(t)?t.constraint:t.typeExpression;return r&&312===r.kind?r:void 0}}(T);if(C&&((y=e.getTokenAtPosition(a,s))&&(e.isDeclarationName(y)||350===y.parent.kind&&y.parent.name===y)||(x=Le(C))),!x&&e.isJSDocParameterTag(T)&&(e.nodeIsMissing(T.name)||T.name.pos<=s&&s<=T.name.end))return {kind:3,tag:T}}if(!x)return void n("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.")}m=e.timestamp();var k=!x&&e.isSourceFileJS(a),N=j(s,a),A=N.previousToken,F=N.contextToken;n("getCompletionData: Get previous token: "+(e.timestamp()-m));var P,w,I,O=y,M=!1,L=!1,B=!1,J=!1,U=!1,K=!1,V=e.getTouchingPropertyName(a,s),q=0,G=!1,Y=0;if(F){var ne=re(F);if(ne.keywordCompletion){if(ne.isKeywordOnlyCompletion)return {kind:4,keywordCompletions:[(I=ne.keywordCompletion,{name:e.tokenToString(I),kind:"keyword",kindModifiers:"",sortText:t.SortText.GlobalsOrKeywords})],isNewIdentifierLocation:ne.isNewIdentifierLocation};q=function(t){if(154===t)return 8;e.Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters");}(ne.keywordCompletion);}if(ne.replacementSpan&&c.includeCompletionsForImportStatements&&c.includeCompletionsWithInsertText&&(Y|=2,w=ne,G=ne.isNewIdentifierLocation),!ne.replacementSpan&&function(t){var r=e.timestamp(),i=function(t){return (e.isRegularExpressionLiteral(t)||e.isStringTextContainingNode(t))&&(e.rangeContainsPositionExclusive(e.createTextRangeFromSpan(e.createTextSpanFromNode(t)),s)||s===t.end&&(!!t.isUnterminated||e.isRegularExpressionLiteral(t)))}(t)||function(t){var r=t.parent,n=r.kind;switch(t.kind){case 27:return 257===n||function(t){return 258===t.parent.kind&&!e.isPossiblyTypeArgumentPosition(t,a,p)}(t)||240===n||263===n||we(n)||261===n||204===n||262===n||e.isClassLike(r)&&!!r.typeParameters&&r.typeParameters.end>=t.pos;case 24:case 22:return 204===n;case 58:return 205===n;case 20:return 295===n||we(n);case 18:return 263===n;case 29:return 260===n||228===n||261===n||262===n||e.isFunctionLikeKind(n);case 124:return 169===n&&!e.isClassLike(r.parent);case 25:return 166===n||!!r.parent&&204===r.parent.kind;case 123:case 121:case 122:return 166===n&&!e.isConstructorDeclaration(r.parent);case 128:return 273===n||278===n||271===n;case 137:case 151:return !ee(t);case 79:if(273===n&&t===r.name&&"type"===t.text)return !1;break;case 84:case 92:case 118:case 98:case 113:case 100:case 119:case 85:case 138:return !0;case 154:return 273!==n;case 41:return e.isFunctionLike(t.parent)&&!e.isMethodDeclaration(t.parent)}if(H(Q(t))&&ee(t))return !1;if(Fe(t)&&(!e.isIdentifier(t)||e.isParameterPropertyModifier(Q(t))||Le(t)))return !1;switch(Q(t)){case 126:case 84:case 85:case 136:case 92:case 98:case 118:case 119:case 121:case 122:case 123:case 124:case 113:return !0;case 132:return e.isPropertyDeclaration(t.parent)}if(e.findAncestor(t.parent,e.isClassLike)&&t===A&&Pe(t,s))return !1;var i=e.getAncestor(t.parent,169);if(i&&t!==A&&e.isClassLike(A.parent.parent)&&s<=A.end){if(Pe(t,A.end))return !1;if(63!==t.kind&&(e.isInitializedProperty(i)||e.hasType(i)))return !0}return e.isDeclarationName(t)&&!e.isShorthandPropertyAssignment(t.parent)&&!e.isJsxAttribute(t.parent)&&!(e.isClassLike(t.parent)&&(t!==A||s>A.end))}(t)||function(e){if(8===e.kind){var t=e.getFullText();return "."===t.charAt(t.length-1)}return !1}(t)||function(e){if(11===e.kind)return !0;if(31===e.kind&&e.parent){if(V===e.parent&&(283===V.kind||282===V.kind))return !1;if(283===e.parent.kind)return 283!==V.parent.kind;if(284===e.parent.kind||282===e.parent.kind)return !!e.parent.parent&&281===e.parent.parent.kind}return !1}(t)||e.isBigIntLiteral(t);return n("getCompletionsAtPosition: isCompletionListBlocker: "+(e.timestamp()-r)),i}(F))return n("Returning an empty list because completion was requested in an invalid position."),q?v(q,k,Ae()):void 0;var ie=F.parent;if(24===F.kind||28===F.kind)switch(M=24===F.kind,L=28===F.kind,ie.kind){case 208:O=(P=ie).expression;var ae=e.getLeftmostAccessExpression(P);if(e.nodeIsMissing(ae)||(e.isCallExpression(O)||e.isFunctionLike(O))&&O.end===F.pos&&O.getChildCount(a)&&21!==e.last(O.getChildren(a)).kind)return;break;case 163:O=ie.left;break;case 264:O=ie.name;break;case 202:O=ie;break;case 233:O=ie.getFirstToken(a),e.Debug.assert(100===O.kind||103===O.kind);break;default:return}else if(!w){if(ie&&208===ie.kind&&(F=ie,ie=ie.parent),y.parent===V)switch(y.kind){case 31:281!==y.parent.kind&&283!==y.parent.kind||(V=y);break;case 43:282===y.parent.kind&&(V=y);}switch(ie.kind){case 284:43===F.kind&&(J=!0,V=F);break;case 223:if(!te(ie))break;case 282:case 281:case 283:K=!0,29===F.kind&&(B=!0,V=F);break;case 291:case 290:19===A.kind&&31===y.kind&&(K=!0);break;case 288:if(ie.initializer===A&&A.end<s){K=!0;break}switch(A.kind){case 63:U=!0;break;case 79:K=!0,ie!==A.parent&&!ie.initializer&&e.findChildOfKind(ie,63,a)&&(U=A);}}}}var oe,se=e.timestamp(),le=5,_e=!1,de=!1,pe=[],fe=[],ge=[],me=new e.Map,ye=x||!!w&&e.isTypeOnlyImportOrExportDeclaration(V.parent)||!function(t){return t&&(112===t.kind&&(183===t.parent.kind||e.isTypeOfExpression(t.parent))||129===t.kind&&179===t.parent.kind)}(F)&&(e.isPossiblyTypeArgumentPosition(F,a,p)||e.isPartOfTypeNode(V)||function(t){if(t){var r=t.parent.kind;switch(t.kind){case 58:return 169===r||168===r||166===r||257===r||e.isFunctionLikeKind(r);case 63:return 262===r;case 128:return 231===r;case 29:return 180===r||213===r;case 94:return 165===r;case 150:return 235===r}}return !1}(F)),ve=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?u.getPackageJsonAutoImportProvider():r,u)}));if(M||L)!function(){le=2;var t,r,n=e.isLiteralImportTypeNode(O),i=x||n&&!O.isTypeOf||e.isPartOfTypeNode(O.parent)||e.isPossiblyTypeArgumentPosition(F,a,p),o=e.isInRightSideOfInternalImportEqualsDeclaration(O);if(e.isEntityName(O)||n||e.isPropertyAccessExpression(O)){var s=e.isModuleDeclaration(O.parent);s&&(G=!0);var l=p.getSymbolAtLocation(O);if(l&&1920&(l=e.skipAlias(l,p)).flags){var u=p.getExportsOfModule(l);e.Debug.assertEachIsDefined(u,"getExportsOfModule() should all be defined");for(var _=function(e){return p.isValidPropertyAccess(n?O:O.parent,e.name)},d=function(e){return ce(e,p)},f=s?function(e){var t;return !!(1920&e.flags)&&!(null===(t=e.declarations)||void 0===t?void 0:t.every((function(e){return e.parent===O.parent})))}:o?function(e){return d(e)||_(e)}:i?d:_,g=0,m=u;g<m.length;g++){var y=m[g];f(y)&&pe.push(y);}if(!i&&l.declarations&&l.declarations.some((function(e){return 308!==e.kind&&264!==e.kind&&263!==e.kind}))){var v=!1;(t=p.getTypeOfSymbolAtLocation(l,O).getNonOptionalType()).isNullableType()&&((r=M&&!L&&!1!==c.includeAutomaticOptionalChainCompletions)||L)&&(t=t.getNonNullableType(),r&&(v=!0)),Te(t,!!(32768&O.flags),v);}return}}i||(p.tryGetThisTypeAt(O,!1),v=!1,(t=p.getTypeAtLocation(O).getNonOptionalType()).isNullableType()&&((r=M&&!L&&!1!==c.includeAutomaticOptionalChainCompletions)||L)&&(t=t.getNonNullableType(),r&&(v=!0)),Te(t,!!(32768&O.flags),v));}();else if(B)pe=p.getJsxIntrinsicTagNamesAt(V),e.Debug.assertEachIsDefined(pe,"getJsxIntrinsicTagNames() should all be defined"),ke(),le=1,q=0;else if(J){var he=F.parent.parent.openingElement.tagName,be=p.getSymbolAtLocation(he);be&&(pe=[be]),le=1,q=0;}else if(!ke())return q?v(q,k,G):void 0;n("getCompletionData: Semantic work: "+(e.timestamp()-se));var xe=A&&function(t,r,n,i){var a=t.parent;switch(t.kind){case 79:return e.getContextualTypeFromParent(t,i);case 63:switch(a.kind){case 257:return i.getContextualType(a.initializer);case 223:return i.getTypeAtLocation(a.left);case 288:return i.getContextualTypeForJsxAttribute(a);default:return}case 103:return i.getContextualType(a);case 82:var o=e.tryCast(a,e.isCaseClause);return o?e.getSwitchedType(o,i):void 0;case 18:return !e.isJsxExpression(a)||e.isJsxElement(a.parent)||e.isJsxFragment(a.parent)?void 0:i.getContextualTypeForJsxAttribute(a.parent);default:var s=e.SignatureHelp.getArgumentInfoForCompletions(t,r,n);return s?i.getContextualTypeForArgumentAtIndex(s.invocation,s.argumentIndex+(27===t.kind?1:0)):e.isEqualityOperatorKind(t.kind)&&e.isBinaryExpression(a)&&e.isEqualityOperatorKind(a.operatorToken.kind)?i.getTypeAtLocation(a.left):i.getContextualType(t)}}(A,s,a,p),De=e.mapDefined(xe&&(xe.isUnion()?xe.types:[xe]),(function(e){return !e.isLiteral()||1024&e.flags?void 0:e.value})),Se=A&&xe&&function(t,r,n){return e.firstDefined(r&&(r.isUnion()?r.types:[r]),(function(r){var i=r&&r.symbol;return i&&424&i.flags&&!e.isAbstractConstructorSymbol(i)?R(i,t,n):void 0}))}(A,xe,p);return {kind:0,symbols:pe,completionKind:le,isInSnippetScope:D,propertyAccessToConvert:P,isNewIdentifierLocation:G,location:V,keywordFilters:q,literals:De,symbolToOriginInfoMap:fe,recommendedCompletion:Se,previousToken:A,contextToken:F,isJsxInitializer:U,insideJsDocTagTypeExpression:x,symbolToSortTextMap:ge,isTypeOnlyLocation:ye,isJsxIdentifierExpected:K,isRightOfOpenTag:B,importStatementCompletion:w,hasUnresolvedAutoImports:de,flags:Y};function Te(t,r,n){G=!!t.getStringIndexType(),L&&e.some(t.getCallSignatures())&&(G=!0);var i=202===O.kind?O:O.parent;if(g)for(var a=0,o=t.getApparentProperties();a<o.length;a++){var s=o[a];p.isValidPropertyAccessForCompletions(i,t,s)&&Ce(s,!1,n);}else pe.push.apply(pe,e.filter(Z(t,p),(function(e){return p.isValidPropertyAccessForCompletions(i,t,e)})));if(r&&c.includeCompletionsWithInsertText){var l=p.getPromisedTypeOfPromise(t);if(l)for(var u=0,_=l.getApparentProperties();u<_.length;u++)s=_[u],p.isValidPropertyAccessForCompletions(i,l,s)&&Ce(s,!0,n);}}function Ce(n,i,o){var l,_=e.firstDefined(n.declarations,(function(t){return e.tryCast(e.getNameOfDeclaration(t),e.isComputedPropertyName)}));if(_){var d=Ee(_.expression),f=d&&p.getSymbolAtLocation(d),g=f&&R(f,F,p);if(g&&e.addToSeen(me,e.getSymbolId(g))){var m=pe.length;pe.push(g);var y=g.parent;if(y&&e.isExternalModuleSymbol(y)&&p.tryGetMemberInModuleExportsAndProperties(g.name,y)===g){var v=e.isExternalModuleNameRelative(e.stripQuotes(y.name))?null===(l=e.getSourceFileOfModule(y))||void 0===l?void 0:l.fileName:void 0,h=((oe||(oe=e.codefix.createImportSpecifierResolver(a,r,u,c))).getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:v,isFromPackageJson:!1,moduleSymbol:y,symbol:g,targetFlags:e.skipAlias(g,p).flags}],g.name,s,e.isValidTypeOnlyAliasUseSite(V))||{}).moduleSpecifier;if(h){var b={kind:S(6),moduleSymbol:y,isDefaultExport:!1,symbolName:g.name,exportName:g.name,fileName:v,moduleSpecifier:h};fe[m]=b;}}else fe[m]={kind:S(2)};}else c.includeCompletionsWithInsertText&&(D(n),x(n),pe.push(n));}else D(n),x(n),pe.push(n);function x(r){(function(t){return !!(t.valueDeclaration&&32&e.getEffectiveModifierFlags(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))})(r)&&(ge[e.getSymbolId(r)]=t.SortText.LocalDeclarationPriority);}function D(t){c.includeCompletionsWithInsertText&&(i&&e.addToSeen(me,e.getSymbolId(t))?fe[pe.length]={kind:S(8)}:o&&(fe[pe.length]={kind:16}));}function S(e){return o?16|e:e}}function Ee(t){return e.isIdentifier(t)?t:e.isPropertyAccessExpression(t)?Ee(t.expression):void 0}function ke(){var n=function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 18:if(e.isTypeLiteralNode(r))return r;break;case 26:case 27:case 79:if(168===r.kind&&e.isTypeLiteralNode(r.parent))return r.parent}}}(F);if(!t)return 0;var r=(e.isIntersectionTypeNode(t.parent)?t.parent:void 0)||t,n=$(r,p);if(!n)return 0;var i=p.getTypeFromTypeNode(r),a=Z(n,p),o=Z(i,p),s=new e.Set;return o.forEach((function(e){return s.add(e.escapedName)})),pe=e.concatenate(pe,e.filter(a,(function(e){return !s.has(e.escapedName)}))),le=0,G=!0,1}()||function(){var n,a,s,l,d=pe.length,f=function(t){if(t){var r=t.parent;switch(t.kind){case 18:case 27:if(e.isObjectLiteralExpression(r)||e.isObjectBindingPattern(r))return r;break;case 41:return e.isMethodDeclaration(r)?e.tryCast(r.parent,e.isObjectLiteralExpression):void 0;case 79:return "async"===t.text&&e.isShorthandPropertyAssignment(t.parent)?t.parent.parent:void 0}}}(F);if(!f)return 0;if(le=0,207===f.kind){var g=function(t,r){var n=r.getContextualType(t);if(n)return n;var i=e.walkUpParenthesizedExpressions(t.parent);return e.isBinaryExpression(i)&&63===i.operatorToken.kind&&t===i.left?r.getTypeAtLocation(i):e.isExpression(i)?r.getContextualType(i):void 0}(f,p);if(void 0===g)return 33554432&f.flags?2:(_e=!0,0);var m=p.getContextualType(f,4),y=(m||g).getStringIndexType(),v=(m||g).getNumberIndexType();if(G=!!y||!!v,n=X(g,m,f,p),a=f.properties,0===n.length&&!v)return _e=!0,0}else {e.Debug.assert(203===f.kind),G=!1;var h=e.getRootDeclaration(f.parent);if(!e.isVariableLike(h))return e.Debug.fail("Root declaration is not variable-like.");var b=e.hasInitializer(h)||!!e.getEffectiveTypeAnnotationNode(h)||247===h.parent.parent.kind;if(b||166!==h.kind||(e.isExpression(h.parent)?b=!!p.getContextualType(h.parent):171!==h.parent.kind&&175!==h.parent.kind||(b=e.isExpression(h.parent.parent)&&!!p.getContextualType(h.parent.parent))),b){var x=p.getTypeAtLocation(f);if(!x)return 2;n=p.getPropertiesOfType(x).filter((function(e){return p.isPropertyAccessible(f,!1,!1,x,e)})),a=f.elements;}}if(n&&n.length>0){var D=function(t,r){if(0===r.length)return t;for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if((299===s.kind||300===s.kind||205===s.kind||171===s.kind||174===s.kind||175===s.kind||301===s.kind)&&!Le(s)){var c=void 0;if(e.isSpreadAssignment(s))Ie(s,n);else if(e.isBindingElement(s)&&s.propertyName)79===s.propertyName.kind&&(c=s.propertyName.escapedText);else {var l=e.getNameOfDeclaration(s);c=l&&e.isPropertyNameLiteral(l)?e.getEscapedTextOfIdentifierOrLiteral(l):void 0;}void 0!==c&&i.add(c);}}var u=t.filter((function(e){return !i.has(e.escapedName)}));return Me(n,u),u}(n,e.Debug.checkDefined(a));pe=e.concatenate(pe,D),Oe(),207===f.kind&&c.includeCompletionsWithObjectLiteralMethodSnippets&&c.includeCompletionsWithInsertText&&(function(r){for(var n,i=r;i<pe.length;i++){var a=pe[i],s=e.getSymbolId(a),c=null==fe?void 0:fe[i],l=z(a,e.getEmitScriptTarget(o),c,0,!1);if(l){var u=null!==(n=ge[s])&&void 0!==n?n:t.SortText.LocationPriority,_=l.name;ge[s]=t.SortText.ObjectLiteralProperty(u,_);}}}(d),s=D,l=f,e.isInJSFile(V)||s.forEach((function(t){if(8196&t.flags){var n=z(t,e.getEmitScriptTarget(o),void 0,0,!1);if(n){var a=function(t,r,n,i,a,o,s,c){var l=s.includeCompletionsWithSnippetText||void 0,u=r,_=n.getSourceFile(),d=function(t,r,n,i,a,o){var s=t.getDeclarations();if(s&&s.length){var c=i.getTypeChecker(),l=s[0],u=e.getSynthesizedDeepClone(e.getNameOfDeclaration(l),!1),_=c.getWidenedType(c.getTypeOfSymbolAtLocation(t,r)),d=33554432|(0===e.getQuotePreference(n,o)?268435456:0);switch(l.kind){case 168:case 169:case 170:case 171:var p=1048576&_.flags&&_.types.length<10?c.getUnionType(_.types,2):_;if(1048576&p.flags){var f=e.filter(p.types,(function(e){return c.getSignaturesOfType(e,0).length>0}));if(1!==f.length)return;p=f[0];}if(1!==c.getSignaturesOfType(p,0).length)return;var g=c.typeToTypeNode(p,r,d,e.codefix.getNoopSymbolTrackerWithResolver({program:i,host:a}));if(!g||!e.isFunctionTypeNode(g))return;var m=void 0;if(o.includeCompletionsWithSnippetText){var y=e.factory.createEmptyStatement();m=e.factory.createBlock([y],!0),e.setSnippetElement(y,{kind:0,order:0});}else m=e.factory.createBlock([],!0);var v=g.parameters.map((function(t){return e.factory.createParameterDeclaration(void 0,t.dotDotDotToken,t.name,void 0,void 0,t.initializer)}));return e.factory.createMethodDeclaration(void 0,void 0,u,void 0,void 0,v,void 0,m);default:return}}}(t,n,_,i,a,s);if(d){var p=E({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(o,e.maybeBind(a,a.getNewLine)))});u=c?p.printAndFormatSnippetList(80,e.factory.createNodeArray([d],!0),_,c):p.printSnippetList(80,e.factory.createNodeArray([d],!0),_);var f=e.createPrinter({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!0}),g=e.factory.createMethodSignature(void 0,"",d.questionToken,d.typeParameters,d.parameters,d.type);return {isSnippet:l,insertText:u,labelDetails:{detail:f.printNode(4,g,_)}}}}(t,n.name,l,r,u,o,c,_);if(a){var s=i$1({kind:128},a);Y|=32,fe[pe.length]=s,pe.push(t);}}}})));}return 1}()||(w?(G=!0,Ne(),1):0)||function(){if(!F)return 0;var t=18===F.kind||27===F.kind?e.tryCast(F.parent,e.isNamedImportsOrExports):e.isTypeKeywordTokenOrIdentifier(F)?e.tryCast(F.parent.parent,e.isNamedImportsOrExports):void 0;if(!t)return 0;e.isTypeKeywordTokenOrIdentifier(F)||(q=8);var r=(272===t.kind?t.parent.parent:t.parent).moduleSpecifier;if(!r)return G=!0,272===t.kind?2:0;var n=p.getSymbolAtLocation(r);if(!n)return G=!0,2;le=3,G=!1;var i=p.getExportsAndPropertiesOfModule(n),a=new e.Set(t.elements.filter((function(e){return !Le(e)})).map((function(e){return (e.propertyName||e.name).escapedText}))),o=i.filter((function(e){return "default"!==e.escapedName&&!a.has(e.escapedName)}));return pe=e.concatenate(pe,o),o.length||(q=0),1}()||function(){var r,n=!F||18!==F.kind&&27!==F.kind?void 0:e.tryCast(F.parent,e.isNamedExports);if(!n)return 0;var i=e.findAncestor(n,e.or(e.isSourceFile,e.isModuleDeclaration));return le=5,G=!1,null===(r=i.locals)||void 0===r||r.forEach((function(r,n){var a,o;pe.push(r),(null===(o=null===(a=i.symbol)||void 0===a?void 0:a.exports)||void 0===o?void 0:o.has(n))&&(ge[e.getSymbolId(r)]=t.SortText.OptionalMember);})),1}()||(function(t){if(t){var r=t.parent;switch(t.kind){case 20:case 27:return e.isConstructorDeclaration(t.parent)?t.parent:void 0;default:if(Fe(t))return r.parent}}}(F)?(le=5,G=!0,q=4,1):0)||function(){var t=function(t,r,n,i){switch(n.kind){case 351:return e.tryCast(n.parent,e.isObjectTypeDeclaration);case 1:var a=e.tryCast(e.lastOrUndefined(e.cast(n.parent,e.isSourceFile).statements),e.isObjectTypeDeclaration);if(a&&!e.findChildOfKind(a,19,t))return a;break;case 79:var o=n.originalKeywordKind;if(o&&e.isKeyword(o))return;if(e.isPropertyDeclaration(n.parent)&&n.parent.initializer===n)return;if(ee(n))return e.findAncestor(n,e.isObjectTypeDeclaration)}if(r){if(135===n.kind||e.isIdentifier(r)&&e.isPropertyDeclaration(r.parent)&&e.isClassLike(n))return e.findAncestor(r,e.isClassLike);switch(r.kind){case 63:return;case 26:case 19:return ee(n)&&n.parent.name===n?n.parent.parent:e.tryCast(n,e.isObjectTypeDeclaration);case 18:case 27:return e.tryCast(r.parent,e.isObjectTypeDeclaration);default:if(!ee(r))return e.getLineAndCharacterOfPosition(t,r.getEnd()).line!==e.getLineAndCharacterOfPosition(t,i).line&&e.isObjectTypeDeclaration(n)?n:void 0;var s=e.isClassLike(r.parent.parent)?H:W;return s(r.kind)||41===r.kind||e.isIdentifier(r)&&s(e.stringToToken(r.text))?r.parent.parent:void 0}}}(a,F,V,s);if(!t)return 0;if(le=3,G=!0,q=41===F.kind?0:e.isClassLike(t)?2:3,!e.isClassLike(t))return 1;var r=26===F.kind?F.parent.parent:F.parent,n=e.isClassElement(r)?e.getEffectiveModifierFlags(r):0;if(79===F.kind&&!Le(F))switch(F.getText()){case"private":n|=8;break;case"static":n|=32;break;case"override":n|=16384;}if(e.isClassStaticBlockDeclaration(r)&&(n|=32),!(8&n)){var i=e.isClassLike(t)&&16384&n?e.singleElementArray(e.getEffectiveBaseTypeNode(t)):e.getAllSuperTypeNodes(t),o=e.flatMap(i,(function(e){var r=p.getTypeAtLocation(e);return 32&n?(null==r?void 0:r.symbol)&&p.getPropertiesOfType(p.getTypeOfSymbolAtLocation(r.symbol,t)):r&&p.getPropertiesOfType(r)}));pe=e.concatenate(pe,function(t,r,n){for(var i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if(!(169!==s.kind&&171!==s.kind&&174!==s.kind&&175!==s.kind||Le(s)||e.hasEffectiveModifier(s,8)||e.isStatic(s)!==!!(32&n))){var c=e.getPropertyNameForPropertyNameNode(s.name);c&&i.add(c);}}return t.filter((function(t){return !(i.has(t.escapedName)||!t.declarations||8&e.getDeclarationModifierFlagsFromSymbol(t)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))}))}(o,t.members,n));}return 1}()||function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 31:case 30:case 43:case 79:case 208:case 289:case 288:case 290:if(r&&(282===r.kind||283===r.kind)){if(31===t.kind){var n=e.findPrecedingToken(t.pos,a,void 0);if(!r.typeArguments||n&&43===n.kind)break}return r}if(288===r.kind)return r.parent.parent;break;case 10:if(r&&(288===r.kind||290===r.kind))return r.parent.parent;break;case 19:if(r&&291===r.kind&&r.parent&&288===r.parent.kind)return r.parent.parent.parent;if(r&&290===r.kind)return r.parent.parent}}}(F),r=t&&p.getContextualType(t.attributes);if(!r)return 0;var n=t&&p.getContextualType(t.attributes,4);return pe=e.concatenate(pe,function(t,r){for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];Le(s)||(288===s.kind?n.add(s.name.escapedText):e.isJsxSpreadAttribute(s)&&Ie(s,i));}var c=t.filter((function(e){return !n.has(e.escapedName)}));return Me(i,c),c}(X(r,n,t.attributes,p),t.attributes.properties)),Oe(),le=3,G=!1,1}()||(function(){q=function(t){if(t){var r,n=e.findAncestor(t.parent,(function(t){return e.isClassLike(t)?"quit":!(!e.isFunctionLikeDeclaration(t)||r!==t.body)||(r=t,!1)}));return n&&n}}(F)?5:1,le=1,G=Ae(),A!==F&&e.Debug.assert(!!A,"Expected 'contextToken' to be defined when different from 'previousToken'.");var r=A!==F?A.getStart():s,n=function(t,r,n){for(var i=t;i&&!e.positionBelongsToNode(i,r,n);)i=i.parent;return i}(F,r,a)||a;D=function(t){switch(t.kind){case 308:case 225:case 291:case 238:return !0;default:return e.isStatement(t)}}(n);var i=2887656|(ye?0:111551),o=A&&!e.isValidTypeOnlyAliasUseSite(A);pe=e.concatenate(pe,p.getSymbolsInScope(n,i)),e.Debug.assertEachIsDefined(pe,"getSymbolsInScope() should all be defined");for(var l=0;l<pe.length;l++){var u=pe[l];if(p.isArgumentsSymbol(u)||e.some(u.declarations,(function(e){return e.getSourceFile()===a}))||(ge[e.getSymbolId(u)]=t.SortText.GlobalsOrKeywords),o&&!(111551&u.flags)){var _=u.declarations&&e.find(u.declarations,e.isTypeOnlyImportOrExportDeclaration);if(_){var d={kind:64,declaration:_};fe[l]=d;}}}if(c.includeCompletionsWithInsertText&&308!==n.kind){var f=p.tryGetThisTypeAt(n,!1,e.isClassLike(n.parent)?n:void 0);if(f&&!function(e,t,r){var n=r.resolveName("self",void 0,111551,!1);if(n&&r.getTypeOfSymbolAtLocation(n,t)===e)return !0;var i=r.resolveName("global",void 0,111551,!1);if(i&&r.getTypeOfSymbolAtLocation(i,t)===e)return !0;var a=r.resolveName("globalThis",void 0,111551,!1);return !(!a||r.getTypeOfSymbolAtLocation(a,t)!==e)}(f,a,p))for(var g=0,m=Z(f,p);g<m.length;g++)u=m[g],fe[pe.length]={kind:1},pe.push(u),ge[e.getSymbolId(u)]=t.SortText.SuggestedClassMembers;}Ne(),ye&&(q=F&&e.isAssertionExpression(F.parent)?6:7);}(),1);return 1===n}function Ne(){var n,i;if((w||!_e&&c.includeCompletionsForModuleExports&&(a.externalModuleIndicator||a.commonJsModuleIndicator||e.compilerOptionsIndicateEsModules(r.getCompilerOptions())||e.programContainsModules(r)))&&(e.Debug.assert(!(null==l?void 0:l.data),"Should not run 'collectAutoImports' when faster path is available via `data`"),!l||l.source)){Y|=1;var o=A===F&&w?"":A&&e.isIdentifier(A)?A.text.toLowerCase():"",_=null===(n=u.getModuleSpecifierCache)||void 0===n?void 0:n.call(u),p=e.getExportInfoMap(a,u,r,c,d),g=null===(i=u.getPackageJsonAutoImportProvider)||void 0===i?void 0:i.call(u),m=l?void 0:e.createPackageJsonImportFilter(a,c,u);f("collectAutoImports",u,oe||(oe=e.codefix.createImportSpecifierResolver(a,r,u,c)),r,s,c,!!w,e.isValidTypeOnlyAliasUseSite(V),(function(r){p.search(a.path,B,(function(t,r){if(!e.isIdentifierText(t,e.getEmitScriptTarget(u.getCompilationSettings())))return !1;if(!l&&e.isStringANonContextualKeyword(t))return !1;if(!(ye||w||111551&r))return !1;if(ye&&!(790504&r))return !1;var n=t.charCodeAt(0);return (!B||!(n<65||n>90))&&(!!l||ue(t,o))}),(function(n,i,a,o){var s,c,u,_;if(!l||e.some(n,(function(t){return l.source===e.stripQuotes(t.moduleSymbol.name)}))){var d=e.find(n,y);if(d){var p=r.tryResolve(n,i,a)||{};if("failed"!==p){var f,g=d;"skipped"!==p&&(g=void 0===(s=p.exportInfo)?d:s,f=p.moduleSpecifier);var m=1===g.exportKind;c=m&&e.getLocalSymbolForExportDefault(g.symbol)||g.symbol,u={kind:f?32:4,moduleSpecifier:f,symbolName:i,exportMapKey:o,exportName:2===g.exportKind?"export=":g.symbol.name,fileName:g.moduleFileName,isDefaultExport:m,moduleSymbol:g.moduleSymbol,isFromPackageJson:g.isFromPackageJson},_=e.getSymbolId(c),ge[_]!==t.SortText.GlobalsOrKeywords&&(fe[pe.length]=u,ge[_]=w?t.SortText.LocationPriority:t.SortText.AutoImportSuggestions,pe.push(c));}}}})),de=r.skippedAny(),Y|=r.resolvedAny()?8:0,Y|=r.resolvedBeyondLimit()?16:0;}));}function y(t){var n=e.tryCast(t.moduleSymbol.valueDeclaration,e.isSourceFile);if(!n){var i=e.stripQuotes(t.moduleSymbol.name);return (!e.JsTyping.nodeCoreModules.has(i)||e.startsWith(i,"node:")===e.shouldUseUriStyleNodeCoreModules(a,r))&&(!m||m.allowsImportingAmbientModule(t.moduleSymbol,ve(t.isFromPackageJson)))}return e.isImportableFile(t.isFromPackageJson?g:r,a,n,c,m,ve(t.isFromPackageJson),_)}}function Ae(){if(F){var e=F.parent.kind,t=Q(F);switch(t){case 27:return 210===e||173===e||211===e||206===e||223===e||181===e||207===e;case 20:return 210===e||173===e||211===e||214===e||193===e;case 22:return 206===e||178===e||164===e;case 142:case 143:case 100:return !0;case 24:return 264===e;case 18:return 260===e||207===e;case 63:return 257===e||223===e;case 15:return 225===e;case 16:return 236===e;case 132:return 171===e||300===e;case 41:return 171===e}if(H(t))return !0}return !1}function Fe(t){return !!t.parent&&e.isParameter(t.parent)&&e.isConstructorDeclaration(t.parent.parent)&&(e.isParameterPropertyModifier(t.kind)||e.isDeclarationName(t))}function Pe(t,r){return 63!==t.kind&&(26===t.kind||!e.positionsAreOnSameLine(t.end,r,a))}function we(t){return e.isFunctionLikeKind(t)&&173!==t}function Ie(e,t){var r=e.expression,n=p.getSymbolAtLocation(r),i=n&&p.getTypeOfSymbolAtLocation(n,r),a=i&&i.properties;a&&a.forEach((function(e){t.add(e.name);}));}function Oe(){pe.forEach((function(r){var n;if(16777216&r.flags){var i=e.getSymbolId(r);ge[i]=null!==(n=ge[i])&&void 0!==n?n:t.SortText.OptionalMember;}}));}function Me(r,n){if(0!==r.size)for(var i=0,a=n;i<a.length;i++){var o=a[i];r.has(o.name)&&(ge[e.getSymbolId(o)]=t.SortText.MemberDeclaredBySpreadAssignment);}}function Le(e){return e.getStart(a)<=s&&s<=e.getEnd()}}function j(t,r){var n=e.findPrecedingToken(t,r);return n&&t<=n.end&&(e.isMemberName(n)||e.isKeyword(n.kind))?{contextToken:e.findPrecedingToken(n.getFullStart(),r,void 0),previousToken:n}:{contextToken:n,previousToken:n}}function J(t,r,n,i){var a=r.isPackageJsonImport?i.getPackageJsonAutoImportProvider():n,o=a.getTypeChecker(),s=r.ambientModuleName?o.tryFindAmbientModule(r.ambientModuleName):r.fileName?o.getMergedSymbol(e.Debug.checkDefined(a.getSourceFile(r.fileName)).symbol):void 0;if(s){var c="export="===r.exportName?o.resolveExternalModuleSymbol(s):o.tryGetMemberInModuleExportsAndProperties(r.exportName,s);if(c)return {symbol:c="default"===r.exportName&&e.getLocalSymbolForExportDefault(c)||c,origin:N(r,t,s)}}}function z(t,r,n,i,a){var o=function(e){return l(e)||u(e)}(n)?n.symbolName:t.name;if(!(void 0===o||1536&t.flags&&e.isSingleOrDoubleQuote(o.charCodeAt(0))||e.isKnownSymbol(t))){var s={name:o,needsConvertPropertyAccess:!1};if(e.isIdentifierText(o,r,a?1:0)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))return s;switch(i){case 3:return;case 0:return {name:JSON.stringify(o),needsConvertPropertyAccess:!1};case 2:case 1:return 32===o.charCodeAt(0)?void 0:{name:o,needsConvertPropertyAccess:!0};case 5:case 4:return s;default:e.Debug.assertNever(i);}}}t.moduleSpecifierResolutionLimit=100,t.moduleSpecifierResolutionCacheAttemptLimit=1e3,t.SortText={LocalDeclarationPriority:"10",LocationPriority:"11",OptionalMember:"12",MemberDeclaredBySpreadAssignment:"13",SuggestedClassMembers:"14",GlobalsOrKeywords:"15",AutoImportSuggestions:"16",ClassMemberSnippets:"17",JavascriptIdentifiers:"18",Deprecated:function(e){return "z"+e},ObjectLiteralProperty:function(e,t){return "".concat(e,"\0").concat(t,"\0")},SortBelow:function(e){return e+"1"}},function(e){e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/",e.TypeOnlyAlias="TypeOnlyAlias/",e.ObjectLiteralMethodSnippet="ObjectLiteralMethodSnippet/";}(r=t.CompletionSource||(t.CompletionSource={})),function(e){e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.TypeOnlyAlias=64]="TypeOnlyAlias",e[e.ObjectLiteralMethod=128]="ObjectLiteralMethod",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport";}(n||(n={})),function(e){e[e.None=0]="None",e[e.All=1]="All",e[e.ClassElementKeywords=2]="ClassElementKeywords",e[e.InterfaceElementKeywords=3]="InterfaceElementKeywords",e[e.ConstructorParameterKeywords=4]="ConstructorParameterKeywords",e[e.FunctionLikeBodyKeywords=5]="FunctionLikeBodyKeywords",e[e.TypeAssertionKeywords=6]="TypeAssertionKeywords",e[e.TypeKeywords=7]="TypeKeywords",e[e.TypeKeyword=8]="TypeKeyword",e[e.Last=8]="Last";}(a||(a={})),function(e){e[e.Continue=0]="Continue",e[e.Success=1]="Success",e[e.Fail=2]="Fail";}(o||(o={})),t.getCompletionsAtPosition=function(r,n,a,o,s,c,l,u,_,d){var p,v=j(s,o).previousToken;if(!l||e.isInString(o,s,v)||function(t,r,n,i){switch(r){case".":case"@":return !0;case'"':case"'":case"`":return !!n&&e.isStringLiteralOrTemplate(n)&&i===n.getStart(t)+1;case"#":return !!n&&e.isPrivateIdentifier(n)&&!!e.getContainingClass(n);case"<":return !!n&&29===n.kind&&(!e.isBinaryExpression(n.parent)||te(n.parent));case"/":return !!n&&(e.isStringLiteralLike(n)?!!e.tryGetImportFromModuleSpecifier(n):43===n.kind&&e.isJsxClosingElement(n.parent));case" ":return !!n&&e.isImportKeyword(n)&&308===n.parent.kind;default:return e.Debug.assertNever(r)}}(o,l,v,s)){if(" "===l)return c.includeCompletionsForImportStatements&&c.includeCompletionsWithInsertText?{isGlobalCompletion:!0,isMemberCompletion:!1,isNewIdentifierLocation:!0,isIncomplete:!0,entries:[]}:void 0;var D=n.getCompilerOptions(),T=c.allowIncompleteCompletions?null===(p=r.getIncompleteCompletionsCache)||void 0===p?void 0:p.call(r):void 0;if(T&&3===u&&v&&e.isIdentifier(v)){var C=function(t,r,n,a,o,s,c){var l=t.get();if(l){var u=n.text.toLowerCase(),_=e.getExportInfoMap(r,o,a,s,c),d=f("continuePreviousIncompleteResponse",o,e.codefix.createImportSpecifierResolver(r,a,o,s),a,n.getStart(),s,!1,e.isValidTypeOnlyAliasUseSite(n),(function(t){var n=e.mapDefined(l.entries,(function(n){var s;if(!n.hasAction||!n.source||!n.data||m(n.data))return n;if(ue(n.name,u)){var c=e.Debug.checkDefined(J(n.name,n.data,a,o)).origin,l=_.get(r.path,n.data.exportMapKey),d=l&&t.tryResolve(l,n.name,!e.isExternalModuleNameRelative(e.stripQuotes(c.moduleSymbol.name)));if("skipped"===d)return n;if(d&&"failed"!==d){var p=i$1(i$1({},c),{kind:32,moduleSpecifier:d.moduleSpecifier});return n.data=k(p),n.source=P(p),n.sourceDisplay=[e.textPart(p.moduleSpecifier)],n}null===(s=o.log)||void 0===s||s.call(o,"Unexpected failure resolving auto import for '".concat(n.name,"' from '").concat(n.source,"'"));}}));return t.skippedAny()||(l.isIncomplete=void 0),n}));return l.entries=d,l.flags=4|(l.flags||0),l}}(T,o,v,n,r,c,_);if(C)return C}else null==T||T.clear();var E=t.StringCompletions.getStringLiteralCompletions(o,s,v,D,r,n,a,c);if(E)return E;if(v&&e.isBreakOrContinueStatement(v.parent)&&(81===v.kind||86===v.kind||79===v.kind))return function(r){var n=function(r){for(var n=[],i=new e.Map,a=r;a&&!e.isFunctionLike(a);){if(e.isLabeledStatement(a)){var o=a.label.text;i.has(o)||(i.set(o,!0),n.push({name:o,kindModifiers:"",kind:"label",sortText:t.SortText.LocationPriority}));}a=a.parent;}return n}(r);if(n.length)return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:n}}(v.parent);var N,A=B(n,a,o,D,s,c,void 0,r,d,_);if(A)switch(A.kind){case 0:var F=function(r,n,i,a,o,s,c,l,u){var _=s.symbols,d=s.contextToken,p=s.completionKind,f=s.isInSnippetScope,m=s.isNewIdentifierLocation,y=s.location,v=s.propertyAccessToConvert,D=s.keywordFilters,T=s.literals,C=s.symbolToOriginInfoMap,E=s.recommendedCompletion,k=s.isJsxInitializer,N=s.isTypeOnlyLocation,A=s.isJsxIdentifierExpected,F=s.isRightOfOpenTag,P=s.importStatementCompletion,I=s.insideJsDocTagTypeExpression,O=s.symbolToSortTextMap,M=s.hasUnresolvedAutoImports;if(1===e.getLanguageVariant(r.scriptKind)){var L=function(r,n){var i=e.findAncestor(r,(function(e){switch(e.kind){case 284:return !0;case 43:case 31:case 79:case 208:return !1;default:return "quit"}}));if(i){var a=!!e.findChildOfKind(i,31,n),o=i.parent.openingElement.tagName.getText(n)+(a?"":">");return {isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:e.createTextSpanFromNode(i.tagName),entries:[{name:o,kind:"class",kindModifiers:void 0,sortText:t.SortText.LocationPriority}]}}}(y,r);if(L)return L}var R=e.createSortedArray(),B=b(r,a);if(!B||m||_&&0!==_.length||0!==D){var j=w(_,R,void 0,d,y,r,n,i,e.getEmitScriptTarget(a),o,p,c,a,l,N,v,A,k,P,E,C,O,A,F);if(0!==D)for(var J=0,z=V(D,!I&&e.isSourceFileJS(r));J<z.length;J++){var U=z[J];(N&&e.isTypeKeyword(e.stringToToken(U.name))||!j.has(U.name))&&(j.add(U.name),e.insertSorted(R,U,g,!0));}for(var K=0,q=function(r,n){var i=[];if(r){var a=r.getSourceFile(),o=r.parent,s=a.getLineAndCharacterOfPosition(r.end).line,c=a.getLineAndCharacterOfPosition(n).line;(e.isImportDeclaration(o)||e.isExportDeclaration(o)&&o.moduleSpecifier)&&r===o.moduleSpecifier&&s===c&&i.push({name:e.tokenToString(130),kind:"keyword",kindModifiers:"",sortText:t.SortText.GlobalsOrKeywords});}return i}(d,u);K<q.length;K++)U=q[K],j.has(U.name)||(j.add(U.name),e.insertSorted(R,U,g,!0));for(var W=0,H=T;W<H.length;W++){var G=S(r,c,H[W]);j.add(G.name),e.insertSorted(R,G,g,!0);}return B||function(r,n,i,a,o){e.getNameTable(r).forEach((function(r,s){if(r!==n){var c=e.unescapeLeadingUnderscores(s);!i.has(c)&&e.isIdentifierText(c,a)&&(i.add(c),e.insertSorted(o,{name:c,kind:"warning",kindModifiers:"",sortText:t.SortText.JavascriptIdentifiers,isFromUncheckedFile:!0},g));}}));}(r,y.pos,j,e.getEmitScriptTarget(a),R),{flags:s.flags,isGlobalCompletion:f,isIncomplete:!(!c.allowIncompleteCompletions||!M)||void 0,isMemberCompletion:x(p),isNewIdentifierLocation:m,optionalReplacementSpan:h(y),entries:R}}}(o,r,n,D,a,A,c,d,s);return (null==F?void 0:F.isIncomplete)&&(null==T||T.set(F)),F;case 1:return y(e.JsDoc.getJSDocTagNameCompletions());case 2:return y(e.JsDoc.getJSDocTagCompletions());case 3:return y(e.JsDoc.getJSDocParameterNameCompletions(A.tag));case 4:return N=A.keywordCompletions,{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:A.isNewIdentifierLocation,entries:N.slice()};default:return e.Debug.assertNever(A)}}},t.getCompletionEntriesFromSymbols=w,t.getCompletionEntryDetails=function(n,i,a,o,s,c,_,p,f){var g=n.getTypeChecker(),m=n.getCompilerOptions(),y=s.name,v=s.source,h=s.data,b=e.findPrecedingToken(o,a);if(e.isInString(a,o,b))return t.StringCompletions.getStringLiteralCompletionDetails(y,a,o,b,g,m,c,f,p);var x=I(n,i,a,o,s,c,p);switch(x.type){case"request":var S=x.request;switch(S.kind){case 1:return e.JsDoc.getJSDocTagNameCompletionDetails(y);case 2:return e.JsDoc.getJSDocTagCompletionDetails(y);case 3:return e.JsDoc.getJSDocParameterNameCompletionDetails(y);case 4:return e.some(S.keywordCompletions,(function(e){return e.name===y}))?O(y,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:return e.Debug.assertNever(S)}case"symbol":var T=x.symbol,E=x.location,k=x.contextToken,N=x.origin,A=x.previousToken,F=function(t,n,i,a,o,s,c,_,p,f,g,m,y,v,h,b){if((null==v?void 0:v.moduleSpecifier)&&g&&re(i||g).replacementSpan)return {codeActions:void 0,sourceDisplay:[e.textPart(v.moduleSpecifier)]};if(h===r.ClassMemberSnippet){var x=C(c,s,_,y,t,o,n,i,m).importAdder;if(x)return {sourceDisplay:void 0,codeActions:[{changes:e.textChanges.ChangeTracker.with({host:c,formatContext:m,preferences:y},x.writeFixes),description:e.diagnosticToString([e.Diagnostics.Includes_imports_of_types_referenced_by_0,t])}]}}if(d(a)){var D=e.codefix.getPromoteTypeOnlyCompletionAction(p,a.declaration.name,s,c,m,y);return e.Debug.assertIsDefined(D,"Expected to have a code action for promoting type-only alias"),{codeActions:[D],sourceDisplay:void 0}}if(!a||!l(a)&&!u(a))return {codeActions:void 0,sourceDisplay:void 0};var S=a.isFromPackageJson?c.getPackageJsonAutoImportProvider().getTypeChecker():s.getTypeChecker(),T=a.moduleSymbol,E=S.getMergedSymbol(e.skipAlias(o.exportSymbol||o,S)),k=29===(null==i?void 0:i.kind)&&e.isJsxOpeningLikeElement(i.parent),N=e.codefix.getImportCompletionAction(E,T,p,e.getNameForExportedSymbol(o,e.getEmitScriptTarget(_),k),k,c,s,m,g&&e.isIdentifier(g)?g.getStart(p):f,y,b),A=N.moduleSpecifier,F=N.codeAction;return e.Debug.assert(!(null==v?void 0:v.moduleSpecifier)||A===v.moduleSpecifier),{sourceDisplay:[e.textPart(A)],codeActions:[F]}}(y,E,k,N,T,n,c,m,a,o,A,_,p,h,v,f);return M(T,g,a,E,f,F.codeActions,F.sourceDisplay);case"literal":var P=x.literal;return O(D(a,p,P),"string","string"==typeof P?e.SymbolDisplayPartKind.stringLiteral:e.SymbolDisplayPartKind.numericLiteral);case"none":return K().some((function(e){return e.name===y}))?O(y,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:e.Debug.assertNever(x);}},t.createCompletionDetailsForSymbol=M,t.createCompletionDetails=L,t.getCompletionEntrySymbol=function(e,t,r,n,i,a,o){var s=I(e,t,r,n,i,a,o);return "symbol"===s.type?s.symbol:void 0},function(e){e[e.Data=0]="Data",e[e.JsDocTagName=1]="JsDocTagName",e[e.JsDocTag=2]="JsDocTag",e[e.JsDocParameterName=3]="JsDocParameterName",e[e.Keywords=4]="Keywords";}(s||(s={})),(c=t.CompletionKind||(t.CompletionKind={}))[c.ObjectPropertyDeclaration=0]="ObjectPropertyDeclaration",c[c.Global=1]="Global",c[c.PropertyAccess=2]="PropertyAccess",c[c.MemberLike=3]="MemberLike",c[c.String=4]="String",c[c.None=5]="None";var U=[],K=e.memoize((function(){for(var r=[],n=81;n<=162;n++)r.push({name:e.tokenToString(n),kind:"keyword",kindModifiers:"",sortText:t.SortText.GlobalsOrKeywords});return r}));function V(t,r){if(!r)return q(t);var n=t+8+1;return U[n]||(U[n]=q(t).filter((function(t){return !function(e){switch(e){case 126:case 131:case 160:case 134:case 136:case 92:case 159:case 117:case 138:case 118:case 140:case 141:case 142:case 143:case 144:case 148:case 149:case 161:case 121:case 122:case 123:case 146:case 152:case 153:case 154:case 156:case 157:return !0;default:return !1}}(e.stringToToken(t.name))})))}function q(t){return U[t]||(U[t]=K().filter((function(r){var n=e.stringToToken(r.name);switch(t){case 0:return !1;case 1:return G(n)||136===n||142===n||154===n||143===n||126===n||e.isTypeKeyword(n)&&155!==n;case 5:return G(n);case 2:return H(n);case 3:return W(n);case 4:return e.isParameterPropertyModifier(n);case 6:return e.isTypeKeyword(n)||85===n;case 7:return e.isTypeKeyword(n);case 8:return 154===n;default:return e.Debug.assertNever(t)}})))}function W(e){return 146===e}function H(t){switch(t){case 126:case 127:case 135:case 137:case 151:case 132:case 136:case 161:return !0;default:return e.isClassMemberModifier(t)}}function G(t){return 132===t||133===t||128===t||150===t||154===t||!e.isContextualKeyword(t)&&!H(t)}function Q(t){return e.isIdentifier(t)?t.originalKeywordKind||0:t.kind}function X(t,r,n,i){var a=r&&r!==t,o=!a||3&r.flags?t:i.getUnionType([t,r]),s=function(t,r,n){return t.isUnion()?n.getAllPossiblePropertiesOfTypes(e.filter(t.types,(function(t){return !(131068&t.flags||n.isArrayLikeType(t)||n.isTypeInvalidDueToUnionDiscriminant(t,r)||e.typeHasCallOrConstructSignatures(t,n)||t.isClass()&&Y(t.getApparentProperties()))}))):t.getApparentProperties()}(o,n,i);return o.isClass()&&Y(s)?[]:a?e.filter(s,(function(t){return !e.length(t.declarations)||e.some(t.declarations,(function(e){return e.parent!==n}))})):s}function Y(t){return e.some(t,(function(t){return !!(24&e.getDeclarationModifierFlagsFromSymbol(t))}))}function Z(t,r){return t.isUnion()?e.Debug.checkEachDefined(r.getAllPossiblePropertiesOfTypes(t.types),"getAllPossiblePropertiesOfTypes() should all be defined"):e.Debug.checkEachDefined(t.getApparentProperties(),"getApparentProperties() should all be defined")}function $(t,r){if(t){if(e.isTypeNode(t)&&e.isTypeReferenceType(t.parent))return r.getTypeArgumentConstraint(t);var n=$(t.parent,r);if(n)switch(t.kind){case 168:return r.getTypeOfPropertyOfContextualType(n,t.symbol.escapedName);case 190:case 184:case 189:return n}}}function ee(t){return t.parent&&e.isClassOrTypeElement(t.parent)&&e.isObjectTypeDeclaration(t.parent.parent)}function te(t){var r=t.left;return e.nodeIsMissing(r)}function re(t){var r,n,i,a,o=!1,s=function(){var r=t.parent;if(e.isImportEqualsDeclaration(r))return a=154===t.kind?void 0:154,se(r.moduleReference)?r:void 0;if(ae(r,t)&&oe(r.parent))return r;if(!e.isNamedImports(r)&&!e.isNamespaceImport(r))return e.isImportKeyword(t)&&e.isSourceFile(r)?(a=154,t):e.isImportKeyword(t)&&e.isImportDeclaration(r)?(a=154,se(r.moduleSpecifier)?r:void 0):void 0;if(r.parent.isTypeOnly||18!==t.kind&&100!==t.kind&&27!==t.kind||(a=154),oe(r)){if(19!==t.kind&&79!==t.kind)return r.parent.parent;o=!0,a=158;}}();return {isKeywordOnlyCompletion:o,keywordCompletion:a,isNewIdentifierLocation:!(!s&&154!==a),isTopLevelTypeOnly:!!(null===(n=null===(r=e.tryCast(s,e.isImportDeclaration))||void 0===r?void 0:r.importClause)||void 0===n?void 0:n.isTypeOnly)||!!(null===(i=e.tryCast(s,e.isImportEqualsDeclaration))||void 0===i?void 0:i.isTypeOnly),couldBeTypeOnlyImportSpecifier:!!s&&ae(s,t),replacementSpan:ne(s)}}function ne(t){var r,n,i;if(t){var a=null!==(r=e.findAncestor(t,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration)))&&void 0!==r?r:t,o=a.getSourceFile();if(e.rangeIsOnSingleLine(a,o))return e.createTextSpanFromNode(a,o);e.Debug.assert(100!==a.kind&&273!==a.kind);var s=269===a.kind?null!==(i=ie(null===(n=a.importClause)||void 0===n?void 0:n.namedBindings))&&void 0!==i?i:a.moduleSpecifier:a.moduleReference,c={pos:a.getFirstToken().getStart(),end:s.pos};return e.rangeIsOnSingleLine(c,o)?e.createTextSpanFromRange(c):void 0}}function ie(t){var r;return e.find(null===(r=e.tryCast(t,e.isNamedImports))||void 0===r?void 0:r.elements,(function(r){var n;return !r.propertyName&&e.isStringANonContextualKeyword(r.name.text)&&27!==(null===(n=e.findPrecedingToken(r.name.pos,t.getSourceFile(),t))||void 0===n?void 0:n.kind)}))}function ae(t,r){return e.isImportSpecifier(t)&&(t.isTypeOnly||r===t.name&&e.isTypeKeywordTokenOrIdentifier(r))}function oe(t){if(!se(t.parent.parent.moduleSpecifier)||t.parent.name)return !1;if(e.isNamedImports(t)){var r=ie(t);return (r?t.elements.indexOf(r):t.elements.length)<2}return !0}function se(t){var r;return !!e.nodeIsMissing(t)||!(null===(r=e.tryCast(e.isExternalModuleReference(t)?t.expression:t,e.isStringLiteralLike))||void 0===r?void 0:r.text)}function ce(t,r,n){return void 0===n&&(n=new e.Map),i(t)||i(e.skipAlias(t.exportSymbol||t,r));function i(t){return !!(788968&t.flags)||r.isUnknownSymbol(t)||!!(1536&t.flags)&&e.addToSeen(n,e.getSymbolId(t))&&r.getExportsOfModule(t).some((function(e){return ce(e,r,n)}))}}function le(t,r){var n=e.skipAlias(t,r).declarations;return !!e.length(n)&&e.every(n,e.isDeprecatedDeclaration)}function ue(e,t){if(0===t.length)return !0;for(var r,n=!1,i=0,a=e.length,o=0;o<a;o++){var s=e.charCodeAt(o),c=t.charCodeAt(i);if((s===c||s===(97<=(l=c)&&l<=122?l-32:l))&&(n||(n=void 0===r||97<=r&&r<=122&&65<=s&&s<=90||95===r&&95!==s),n&&i++,i===t.length))return !0;r=s;}var l;return !1}t.getPropertiesForObjectExpression=X;}(e.Completions||(e.Completions={}));}(t),function(e){!function(t){function r(t,r){return {fileName:r.fileName,textSpan:e.createTextSpanFromNode(t,r),kind:"none"}}function i(t){return e.isThrowStatement(t)?[t]:e.isTryStatement(t)?e.concatenate(t.catchClause?i(t.catchClause):t.tryBlock&&i(t.tryBlock),t.finallyBlock&&i(t.finallyBlock)):e.isFunctionLike(t)?void 0:o(t,i)}function a(t){return e.isBreakOrContinueStatement(t)?[t]:e.isFunctionLike(t)?void 0:o(t,a)}function o(t,r){var n=[];return t.forEachChild((function(t){var i=r(t);void 0!==i&&n.push.apply(n,e.toArray(i));})),n}function s(e,t){var r=c(t);return !!r&&r===e}function c(t){return e.findAncestor(t,(function(r){switch(r.kind){case 252:if(248===t.kind)return !1;case 245:case 246:case 247:case 244:case 243:return !t.label||function(t,r){return !!e.findAncestor(t.parent,(function(t){return e.isLabeledStatement(t)?t.label.escapedText===r:"quit"}))}(r,t.label.escapedText);default:return e.isFunctionLike(r)&&"quit"}}))}function l(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return !(!r||!e.contains(n,r.kind)||(t.push(r),0))}function u(t){var r=[];if(l(r,t.getFirstToken(),97,115,90)&&243===t.kind)for(var n=t.getChildren(),i=n.length-1;i>=0&&!l(r,n[i],115);i--);return e.forEach(a(t.statement),(function(e){s(t,e)&&l(r,e.getFirstToken(),81,86);})),r}function _(e){var t=c(e);if(t)switch(t.kind){case 245:case 246:case 247:case 243:case 244:return u(t);case 252:return d(t)}}function d(t){var r=[];return l(r,t.getFirstToken(),107),e.forEach(t.caseBlock.clauses,(function(n){l(r,n.getFirstToken(),82,88),e.forEach(a(n),(function(e){s(t,e)&&l(r,e.getFirstToken(),81);}));})),r}function p(t,r){var n=[];return l(n,t.getFirstToken(),111),t.catchClause&&l(n,t.catchClause.getFirstToken(),83),t.finallyBlock&&l(n,e.findChildOfKind(t,96,r),96),n}function f(t,r){var n=function(t){for(var r=t;r.parent;){var n=r.parent;if(e.isFunctionBlock(n)||308===n.kind)return n;if(e.isTryStatement(n)&&n.tryBlock===r&&n.catchClause)return r;r=n;}}(t);if(n){var a=[];return e.forEach(i(n),(function(t){a.push(e.findChildOfKind(t,109,r));})),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,(function(t){a.push(e.findChildOfKind(t,105,r));})),a}}function g(t,r){var n=e.getContainingFunction(t);if(n){var a=[];return e.forEachReturnStatement(e.cast(n.body,e.isBlock),(function(t){a.push(e.findChildOfKind(t,105,r));})),e.forEach(i(n.body),(function(t){a.push(e.findChildOfKind(t,109,r));})),a}}function m(t){var r=e.getContainingFunction(t);if(r){var n=[];return r.modifiers&&r.modifiers.forEach((function(e){l(n,e,132);})),e.forEachChild(r,(function(t){y(t,(function(t){e.isAwaitExpression(t)&&l(n,t.getFirstToken(),133);}));})),n}}function y(t,r){r(t),e.isFunctionLike(t)||e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isModuleDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isTypeNode(t)||e.forEachChild(t,(function(e){return y(e,r)}));}t.getDocumentHighlights=function(t,i,a,o,s){var c=e.getTouchingPropertyName(a,o);if(c.parent&&(e.isJsxOpeningElement(c.parent)&&c.parent.tagName===c||e.isJsxClosingElement(c.parent))){var v=c.parent.parent,h=[v.openingElement,v.closingElement].map((function(e){return r(e.tagName,a)}));return [{fileName:a.fileName,highlightSpans:h}]}return function(t,r,n,i,a){var o=new e.Set(a.map((function(e){return e.fileName}))),s=e.FindAllReferences.getReferenceEntriesForNode(t,r,n,a,i,void 0,o);if(s){var c=e.arrayToMultiMap(s.map(e.FindAllReferences.toHighlightSpan),(function(e){return e.fileName}),(function(e){return e.span})),l=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames());return e.mapDefined(e.arrayFrom(c.entries()),(function(t){var r=t[0],i=t[1];if(!o.has(r)){if(!n.redirectTargetsMap.has(e.toPath(r,n.getCurrentDirectory(),l)))return;var s=n.getSourceFile(r);r=e.find(a,(function(e){return !!e.redirectInfo&&e.redirectInfo.redirectTarget===s})).fileName,e.Debug.assert(o.has(r));}return {fileName:r,highlightSpans:i}}))}}(o,c,t,i,s)||function(t,i){var a=function(t,i){switch(t.kind){case 99:case 91:return e.isIfStatement(t.parent)?function(t,n){for(var i=function(t,r){for(var n=[];e.isIfStatement(t.parent)&&t.parent.elseStatement===t;)t=t.parent;for(;;){var i=t.getChildren(r);l(n,i[0],99);for(var a=i.length-1;a>=0&&!l(n,i[a],91);a--);if(!t.elseStatement||!e.isIfStatement(t.elseStatement))break;t=t.elseStatement;}return n}(t,n),a=[],o=0;o<i.length;o++){if(91===i[o].kind&&o<i.length-1){for(var s=i[o],c=i[o+1],u=!0,_=c.getStart(n)-1;_>=s.end;_--)if(!e.isWhiteSpaceSingleLine(n.text.charCodeAt(_))){u=!1;break}if(u){a.push({fileName:n.fileName,textSpan:e.createTextSpanFromBounds(s.getStart(),c.end),kind:"reference"}),o++;continue}}a.push(r(i[o],n));}return a}(t.parent,i):void 0;case 105:return c(t.parent,e.isReturnStatement,g);case 109:return c(t.parent,e.isThrowStatement,f);case 111:case 83:case 96:return c(83===t.kind?t.parent.parent:t.parent,e.isTryStatement,p);case 107:return c(t.parent,e.isSwitchStatement,d);case 82:case 88:return e.isDefaultClause(t.parent)||e.isCaseClause(t.parent)?c(t.parent.parent.parent,e.isSwitchStatement,d):void 0;case 81:case 86:return c(t.parent,e.isBreakOrContinueStatement,_);case 97:case 115:case 90:return c(t.parent,(function(t){return e.isIterationStatement(t,!0)}),u);case 135:return s(e.isConstructorDeclaration,[135]);case 137:case 151:return s(e.isAccessor,[137,151]);case 133:return c(t.parent,e.isAwaitExpression,m);case 132:return v(m(t));case 125:return v(function(t){var r=e.getContainingFunction(t);if(r){var n=[];return e.forEachChild(r,(function(t){y(t,(function(t){e.isYieldExpression(t)&&l(n,t.getFirstToken(),125);}));})),n}}(t));case 101:return;default:return e.isModifierKind(t.kind)&&(e.isDeclaration(t.parent)||e.isVariableStatement(t.parent))?v((a=t.kind,o=t.parent,e.mapDefined(function(t,r){var i=t.parent;switch(i.kind){case 265:case 308:case 238:case 292:case 293:return 256&r&&e.isClassDeclaration(t)?n$4(n$4([],t.members,!0),[t],!1):i.statements;case 173:case 171:case 259:return n$4(n$4([],i.parameters,!0),e.isClassLike(i.parent)?i.parent.members:[],!0);case 260:case 228:case 261:case 184:var a=i.members;if(92&r){var o=e.find(i.members,e.isConstructorDeclaration);if(o)return n$4(n$4([],a,!0),o.parameters,!0)}else if(256&r)return n$4(n$4([],a,!0),[i],!1);return a;case 207:return;default:e.Debug.assertNever(i,"Invalid container kind.");}}(o,e.modifierToFlag(a)),(function(t){return e.findModifier(t,a)})))):void 0}var a,o;function s(r,n){return c(t.parent,r,(function(t){return e.mapDefined(t.symbol.declarations,(function(t){return r(t)?e.find(t.getChildren(i),(function(t){return e.contains(n,t.kind)})):void 0}))}))}function c(e,t,r){return t(e)?v(r(e,i)):void 0}function v(e){return e&&e.map((function(e){return r(e,i)}))}}(t,i);return a&&[{fileName:i.fileName,highlightSpans:a}]}(c,a)};}(e.DocumentHighlights||(e.DocumentHighlights={}));}(t),function(e){function t(e){return !!e.sourceFile}function r(r,n,o){void 0===n&&(n="");var s=new e.Map,c=e.createGetCanonicalFileName(!!r);function l(e){return "function"==typeof e.getCompilationSettings?e.getCompilationSettings():e}function u(e,t,r,n,i,a,o,s){return p(e,t,r,n,i,a,!0,o,s)}function _(e,t,r,n,i,a,o,s){return p(e,t,l(r),n,i,a,!1,o,s)}function d(r,n){var i=t(r)?r:r.get(e.Debug.checkDefined(n,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return e.Debug.assert(void 0===n||!i||i.sourceFile.scriptKind===n,"Script kind should match provided ScriptKind:".concat(n," and sourceFile.scriptKind: ").concat(null==i?void 0:i.sourceFile.scriptKind,", !entry: ").concat(!i)),i}function p(r,n,i,c,u,_,p,f,g){var m,y,v,h;f=e.ensureScriptKind(r,f);var b=l(i),x=i===b?void 0:i,D=6===f?100:e.getEmitScriptTarget(b),S="object"==typeof g?g:{languageVersion:D,impliedNodeFormat:x&&e.getImpliedNodeFormatForFile(n,null===(h=null===(v=null===(y=null===(m=x.getCompilerHost)||void 0===m?void 0:m.call(x))||void 0===y?void 0:y.getModuleResolutionCache)||void 0===v?void 0:v.call(y))||void 0===h?void 0:h.getPackageJsonInfoCache(),x,b),setExternalModuleIndicator:e.getSetExternalModuleIndicator(b)};S.languageVersion=D;var T=s.size,C=a(c,S.impliedNodeFormat),E=e.getOrUpdate(s,C,(function(){return new e.Map}));if(e.tracing){s.size>T&&e.tracing.instant("session","createdDocumentRegistryBucket",{configFilePath:b.configFilePath,key:C});var k=!e.isDeclarationFileName(n)&&e.forEachEntry(s,(function(e,t){return t!==C&&e.has(n)&&t}));k&&e.tracing.instant("session","documentRegistryBucketOverlap",{path:n,key1:k,key2:C});}var N=E.get(n),A=N&&d(N,f);if(!A&&o&&(F=o.getDocument(C,n))&&(e.Debug.assert(p),A={sourceFile:F,languageServiceRefCount:0},P()),A)A.sourceFile.version!==_&&(A.sourceFile=e.updateLanguageServiceSourceFile(A.sourceFile,u,_,u.getChangeRange(A.sourceFile.scriptSnapshot)),o&&o.setDocument(C,n,A.sourceFile)),p&&A.languageServiceRefCount++;else {var F=e.createLanguageServiceSourceFile(r,u,S,_,!1,f);o&&o.setDocument(C,n,F),A={sourceFile:F,languageServiceRefCount:1},P();}return e.Debug.assert(0!==A.languageServiceRefCount),A.sourceFile;function P(){if(N)if(t(N)){var r=new e.Map;r.set(N.sourceFile.scriptKind,N),r.set(f,A),E.set(n,r);}else N.set(f,A);else E.set(n,A);}}function f(r,n,i,o){var c=e.Debug.checkDefined(s.get(a(n,o))),l=c.get(r),u=d(l,i);u.languageServiceRefCount--,e.Debug.assert(u.languageServiceRefCount>=0),0===u.languageServiceRefCount&&(t(l)?c.delete(r):(l.delete(i),1===l.size&&c.set(r,e.firstDefinedIterator(l.values(),e.identity))));}return {acquireDocument:function(t,r,a,o,s,_){return u(t,e.toPath(t,n,c),r,i(l(r)),a,o,s,_)},acquireDocumentWithKey:u,updateDocument:function(t,r,a,o,s,u){return _(t,e.toPath(t,n,c),r,i(l(r)),a,o,s,u)},updateDocumentWithKey:_,releaseDocument:function(t,r,a,o){return f(e.toPath(t,n,c),i(r),a,o)},releaseDocumentWithKey:f,getLanguageServiceRefCounts:function(t,r){return e.arrayFrom(s.entries(),(function(e){var n=e[0],i=e[1].get(t),a=i&&d(i,r);return [n,a&&a.languageServiceRefCount]}))},reportStats:function(){var r=e.arrayFrom(s.keys()).filter((function(e){return e&&"_"===e.charAt(0)})).map((function(e){var r=s.get(e),n=[];return r.forEach((function(e,r){t(e)?n.push({name:r,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((function(e,t){return n.push({name:r,scriptKind:t,refCount:e.languageServiceRefCount})}));})),n.sort((function(e,t){return t.refCount-e.refCount})),{bucket:e,sourceFiles:n}}));return JSON.stringify(r,void 0,2)},getKeyForCompilationSettings:i}}function n(t){var r;if(null===t||"object"!=typeof t)return ""+t;if(e.isArray(t))return "[".concat(null===(r=e.map(t,(function(e){return n(e)})))||void 0===r?void 0:r.join(","),"]");var i="{";for(var a in t)e.hasProperty(t,a)&&(i+="".concat(a,": ").concat(n(t[a])));return i+"}"}function i(t){return e.sourceFileAffectingCompilerOptions.map((function(r){return n(e.getCompilerOptionValue(t,r))})).join("|")+(t.pathsBasePath?"|".concat(t.pathsBasePath):void 0)}function a(e,t){return t?"".concat(e,"|").concat(t):e}e.createDocumentRegistry=function(e,t){return r(e,t)},e.createDocumentRegistryInternal=r;}(t),function(e){!function(t){function r(t,r){return e.forEach(308===t.kind?t.statements:t.body.statements,(function(t){return r(t)||c(t)&&e.forEach(t.body&&t.body.statements,r)}))}function n(t,n){if(t.externalModuleIndicator||void 0!==t.imports)for(var i=0,a=t.imports;i<a.length;i++){var o=a[i];n(e.importFromModuleSpecifier(o),o);}else r(t,(function(t){switch(t.kind){case 275:case 269:(r=t).moduleSpecifier&&e.isStringLiteral(r.moduleSpecifier)&&n(r,r.moduleSpecifier);break;case 268:var r;l(r=t)&&n(r,r.moduleReference.expression);}}));}function a(t,r,n){var i=t.parent;if(i){var a=n.getMergedSymbol(i);return e.isExternalModuleSymbol(a)?{exportingModuleSymbol:a,exportKind:r}:void 0}}function o(e,t){return t.getMergedSymbol(s(e).symbol)}function s(t){if(210===t.kind)return t.getSourceFile();var r=t.parent;return 308===r.kind?r:(e.Debug.assert(265===r.kind),e.cast(r.parent,c))}function c(e){return 264===e.kind&&10===e.name.kind}function l(e){return 280===e.moduleReference.kind&&10===e.moduleReference.expression.kind}var u,_;t.createImportTracker=function(t,a,u,_){var d=function(t,r,i){for(var a=new e.Map,o=0,s=t;o<s.length;o++){var c=s[o];i&&i.throwIfCancellationRequested(),n(c,(function(t,n){var i=r.getSymbolAtLocation(n);if(i){var o=e.getSymbolId(i).toString(),s=a.get(o);s||a.set(o,s=[]),s.push(t);}}));}return a}(t,u,_);return function(n,p,f){var g=function(t,n,i,a,l,u){var _=a.exportingModuleSymbol,d=a.exportKind,p=e.nodeSeenTracker(),f=e.nodeSeenTracker(),g=[],m=!!_.globalExports,y=m?void 0:[];return function t(r){var n=x(r);if(n)for(var i=0,a=n;i<a.length;i++){var _=a[i];if(p(_))switch(u&&u.throwIfCancellationRequested(),_.kind){case 210:if(e.isImportCall(_)){S=_,b(e.findAncestor(S,c)||S.getSourceFile(),!!v(S,!0));break}if(!m){var f=_.parent;if(2===d&&257===f.kind){var y=f.name;if(79===y.kind){g.push(y);break}}}break;case 79:break;case 268:h(_,_.name,e.hasSyntacticModifier(_,1),!1);break;case 269:g.push(_);var D=_.importClause&&_.importClause.namedBindings;D&&271===D.kind?h(_,D.name,!1,!0):!m&&e.isDefaultImport(_)&&b(s(_));break;case 275:_.exportClause?277===_.exportClause.kind?b(s(_),!0):g.push(_):t(o(_,l));break;case 202:!m&&_.isTypeOf&&!_.qualifier&&v(_)&&b(_.getSourceFile(),!0),g.push(_);break;default:e.Debug.failBadSyntaxKind(_,"Unexpected import kind.");}}var S;}(_),{directImports:g,indirectUsers:function(){if(m)return t;if(_.declarations)for(var r=0,i=_.declarations;r<i.length;r++){var a=i[r];e.isExternalModuleAugmentation(a)&&n.has(a.getSourceFile().fileName)&&b(a);}return y.map(e.getSourceFileOfNode)}()};function v(t,r){return void 0===r&&(r=!1),e.findAncestor(t,(function(t){return r&&c(t)?"quit":e.canHaveModifiers(t)&&e.some(t.modifiers,e.isExportModifier)}))}function h(t,n,i,a){if(2===d)a||g.push(t);else if(!m){var o=s(t);e.Debug.assert(308===o.kind||264===o.kind),i||function(t,n,i){var a=i.getSymbolAtLocation(n);return !!r(t,(function(t){if(e.isExportDeclaration(t)){var r=t.exportClause;return !t.moduleSpecifier&&r&&e.isNamedExports(r)&&r.elements.some((function(e){return i.getExportSpecifierLocalTargetSymbol(e)===a}))}}))}(o,n,l)?b(o,!0):b(o);}}function b(t,r){if(void 0===r&&(r=!1),e.Debug.assert(!m),f(t)&&(y.push(t),r)){var n=l.getMergedSymbol(t.symbol);if(n){e.Debug.assert(!!(1536&n.flags));var i=x(n);if(i)for(var a=0,o=i;a<o.length;a++){var c=o[a];e.isImportTypeNode(c)||b(s(c),!0);}}}}function x(t){return i.get(e.getSymbolId(t).toString())}}(t,a,d,p,u,_),m=g.directImports,y=g.indirectUsers;return i$1({indirectUsers:y},function(t,r,n,i,a){var o=[],s=[];function c(e,t){o.push([e,t]);}if(t)for(var u=0,_=t;u<_.length;u++)d(_[u]);return {importSearches:o,singleReferences:s};function d(t){if(268!==t.kind)if(79!==t.kind)if(202!==t.kind){if(10===t.moduleSpecifier.kind)if(275!==t.kind){var o=t.importClause||{name:void 0,namedBindings:void 0},u=o.name,_=o.namedBindings;if(_)switch(_.kind){case 271:p(_.name);break;case 272:0!==n&&1!==n||f(_);break;default:e.Debug.assertNever(_);}!u||1!==n&&2!==n||a&&u.escapedText!==e.symbolEscapedNameNoDefault(r)||c(u,i.getSymbolAtLocation(u));}else t.exportClause&&e.isNamedExports(t.exportClause)&&f(t.exportClause);}else if(t.qualifier){var d=e.getFirstIdentifier(t.qualifier);d.escapedText===e.symbolName(r)&&s.push(d);}else 2===n&&s.push(t.argument.literal);else p(t);else l(t)&&p(t.name);}function p(e){2!==n||a&&!g(e.escapedText)||c(e,i.getSymbolAtLocation(e));}function f(e){if(e)for(var t=0,n=e.elements;t<n.length;t++){var o=n[t],l=o.name,u=o.propertyName;g((u||l).escapedText)&&(u?(s.push(u),a&&l.escapedText!==r.escapedName||c(l,i.getSymbolAtLocation(l))):c(l,278===o.kind&&o.propertyName?i.getExportSpecifierLocalTargetSymbol(o):i.getSymbolAtLocation(l)));}}function g(e){return e===r.escapedName||0!==n&&"default"===e}}(m,n,p.exportKind,u,f))}},(_=t.ExportKind||(t.ExportKind={}))[_.Named=0]="Named",_[_.Default=1]="Default",_[_.ExportEquals=2]="ExportEquals",(u=t.ImportExport||(t.ImportExport={}))[u.Import=0]="Import",u[u.Export=1]="Export",t.findModuleReferences=function(e,t,r){for(var i=[],a=e.getTypeChecker(),o=0,s=t;o<s.length;o++){var c=s[o],l=r.valueDeclaration;if(308===(null==l?void 0:l.kind)){for(var u=0,_=c.referencedFiles;u<_.length;u++){var d=_[u];e.getSourceFileFromReference(c,d)===l&&i.push({kind:"reference",referencingFile:c,ref:d});}for(var p=0,f=c.typeReferenceDirectives;p<f.length;p++){d=f[p];var g=e.getResolvedTypeReferenceDirectives().get(d.fileName,d.resolutionMode||c.impliedNodeFormat);void 0!==g&&g.resolvedFileName===l.fileName&&i.push({kind:"reference",referencingFile:c,ref:d});}}n(c,(function(e,t){a.getSymbolAtLocation(t)===r&&i.push({kind:"import",literal:t});}));}return i},t.getImportOrExportSymbol=function(t,r,n,i){return i?o():o()||function(){if(function(t){var r=t.parent;switch(r.kind){case 268:return r.name===t&&l(r);case 273:return !r.propertyName;case 270:case 271:return e.Debug.assert(r.name===t),!0;case 205:return e.isInJSFile(t)&&e.isVariableDeclarationInitializedToBareOrAccessedRequire(r.parent.parent);default:return !1}}(t)){var i=n.getImmediateAliasedSymbol(r);if(i&&(i=function(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(e.isExportSpecifier(a)&&!a.propertyName&&!a.parent.parent.moduleSpecifier)return r.getExportSpecifierLocalTargetSymbol(a);if(e.isPropertyAccessExpression(a)&&e.isModuleExportsAccessExpression(a.expression)&&!e.isPrivateIdentifier(a.name))return r.getSymbolAtLocation(a);if(e.isShorthandPropertyAssignment(a)&&e.isBinaryExpression(a.parent.parent)&&2===e.getAssignmentDeclarationKind(a.parent.parent))return r.getExportSpecifierLocalTargetSymbol(a.name)}return t}(i,n),"export="!==i.escapedName||(i=function(t,r){if(2097152&t.flags)return r.getImmediateAliasedSymbol(t);var n=e.Debug.checkDefined(t.valueDeclaration);return e.isExportAssignment(n)?n.expression.symbol:e.isBinaryExpression(n)?n.right.symbol:e.isSourceFile(n)?n.symbol:void 0}(i,n),void 0!==i))){var a=e.symbolEscapedNameNoDefault(i);return void 0===a||"default"===a||a===r.escapedName?{kind:0,symbol:i}:void 0}}}();function o(){var a,o=t.parent,l=o.parent;if(r.exportSymbol)return 208===o.kind?(null===(a=r.declarations)||void 0===a?void 0:a.some((function(e){return e===o})))&&e.isBinaryExpression(l)?d(l,!1):void 0:s(r.exportSymbol,c(o));var u=function(t,r){var n=e.isVariableDeclaration(t)?t:e.isBindingElement(t)?e.walkUpBindingElementsAndPatterns(t):void 0;return n?t.name!==r||e.isCatchClause(n.parent)?void 0:e.isVariableStatement(n.parent.parent)?n.parent.parent:void 0:t}(o,t);if(u&&e.hasSyntacticModifier(u,1)){if(e.isImportEqualsDeclaration(u)&&u.moduleReference===t){if(i)return;return {kind:0,symbol:n.getSymbolAtLocation(u.name)}}return s(r,c(u))}if(e.isNamespaceExport(o))return s(r,0);if(e.isExportAssignment(o))return _(o);if(e.isExportAssignment(l))return _(l);if(e.isBinaryExpression(o))return d(o,!0);if(e.isBinaryExpression(l))return d(l,!0);if(e.isJSDocTypedefTag(o))return s(r,0);function _(e){if(e.symbol.parent){var t=e.isExportEquals?2:1;return {kind:1,symbol:r,exportInfo:{exportingModuleSymbol:e.symbol.parent,exportKind:t}}}}function d(t,i){var a;switch(e.getAssignmentDeclarationKind(t)){case 1:a=0;break;case 2:a=2;break;default:return}var o=i?n.getSymbolAtLocation(e.getNameOfAccessExpression(e.cast(t.left,e.isAccessExpression))):r;return o&&s(o,a)}}function s(e,t){var r=a(e,t,n);return r&&{kind:1,symbol:e,exportInfo:r}}function c(t){return e.hasSyntacticModifier(t,1024)?1:0}},t.getExportInfo=a;}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){var r,a,o,s;function c(e,t){return void 0===t&&(t=1),{kind:t,node:e.name||e,context:u(e)}}function l(e){return e&&void 0===e.kind}function u(t){if(e.isDeclaration(t))return _(t);if(t.parent){if(!e.isDeclaration(t.parent)&&!e.isExportAssignment(t.parent)){if(e.isInJSFile(t)){var r=e.isBinaryExpression(t.parent)?t.parent:e.isAccessExpression(t.parent)&&e.isBinaryExpression(t.parent.parent)&&t.parent.parent.left===t.parent?t.parent.parent:void 0;if(r&&0!==e.getAssignmentDeclarationKind(r))return _(r)}if(e.isJsxOpeningElement(t.parent)||e.isJsxClosingElement(t.parent))return t.parent.parent;if(e.isJsxSelfClosingElement(t.parent)||e.isLabeledStatement(t.parent)||e.isBreakOrContinueStatement(t.parent))return t.parent;if(e.isStringLiteralLike(t)){var n=e.tryGetImportFromModuleSpecifier(t);if(n){var i=e.findAncestor(n,(function(t){return e.isDeclaration(t)||e.isStatement(t)||e.isJSDocTag(t)}));return e.isDeclaration(i)?_(i):i}}var a=e.findAncestor(t,e.isComputedPropertyName);return a?_(a.parent):void 0}return t.parent.name===t||e.isConstructorDeclaration(t.parent)||e.isExportAssignment(t.parent)||(e.isImportOrExportSpecifier(t.parent)||e.isBindingElement(t.parent))&&t.parent.propertyName===t||88===t.kind&&e.hasSyntacticModifier(t.parent,1025)?_(t.parent):void 0}}function _(t){if(t)switch(t.kind){case 257:return e.isVariableDeclarationList(t.parent)&&1===t.parent.declarations.length?e.isVariableStatement(t.parent.parent)?t.parent.parent:e.isForInOrOfStatement(t.parent.parent)?_(t.parent.parent):t.parent:t;case 205:return _(t.parent.parent);case 273:return t.parent.parent.parent;case 278:case 271:return t.parent.parent;case 270:case 277:return t.parent;case 223:return e.isExpressionStatement(t.parent)?t.parent:t;case 247:case 246:return {start:t.initializer,end:t.expression};case 299:case 300:return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)?_(e.findAncestor(t.parent,(function(t){return e.isBinaryExpression(t)||e.isForInOrOfStatement(t)}))):t;default:return t}}function d(e,t,r){if(r){var n=l(r)?b(r.start,t,r.end):b(r,t);return n.start!==e.start||n.length!==e.length?{contextSpan:n}:void 0}}function p(t,n,i,a,o){if(308!==a.kind){var s=t.getTypeChecker();if(300===a.parent.kind){var l=[];return r.getReferenceEntriesForShorthandPropertyAssignment(a,s,(function(e){return l.push(c(e))})),l}if(106===a.kind||e.isSuperProperty(a.parent)){var u=s.getSymbolAtLocation(a);return u.valueDeclaration&&[c(u.valueDeclaration)]}return f(o,a,t,i,n,{implementations:!0,use:1})}}function f(t,n,i,a,o,s,c){return void 0===s&&(s={}),void 0===c&&(c=new e.Set(a.map((function(e){return e.fileName})))),g(r.getReferencedSymbolsForNode(t,n,i,a,o,s,c))}function g(t){return t&&e.flatMap(t,(function(e){return e.references}))}function m(t){var r=t.getSourceFile();return {sourceFile:r,textSpan:b(e.isComputedPropertyName(t)?t.expression:t,r)}}function y(t,n,i){var a=r.getIntersectingMeaningFromDeclarations(i,t),o=t.declarations&&e.firstOrUndefined(t.declarations)||i,s=e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(n,t,o.getSourceFile(),o,o,a);return {displayParts:s.displayParts,kind:s.symbolKind}}function v(e){var t=h(e);if(0===e.kind)return i$1(i$1({},t),{isWriteAccess:!1});var r=e.kind,n=e.node;return i$1(i$1({},t),{isWriteAccess:D(n),isInString:2===r||void 0})}function h(e){if(0===e.kind)return {textSpan:e.textSpan,fileName:e.fileName};var t=e.node.getSourceFile(),r=b(e.node,t);return i$1({textSpan:r,fileName:t.fileName},d(r,t,e.context))}function b(t,r,n){var i=t.getStart(r),a=(n||t).getEnd();return e.isStringLiteralLike(t)&&a-i>2&&(e.Debug.assert(void 0===n),i+=1,a-=1),e.createTextSpanFromBounds(i,a)}function x(e){return 0===e.kind?e.textSpan:b(e.node,e.node.getSourceFile())}function D(t){var r=e.getDeclarationFromName(t);return !!r&&function(t){if(16777216&t.flags)return !0;switch(t.kind){case 223:case 205:case 260:case 228:case 88:case 263:case 302:case 278:case 270:case 268:case 273:case 261:case 341:case 348:case 288:case 264:case 267:case 271:case 277:case 166:case 300:case 262:case 165:return !0;case 299:return !e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent);case 259:case 215:case 173:case 171:case 174:case 175:return !!t.body;case 257:case 169:return !!t.initializer||e.isCatchClause(t.parent);case 170:case 168:case 350:case 343:return !1;default:return e.Debug.failBadSyntaxKind(t)}}(r)||88===t.kind||e.isWriteAccess(t)}function S(t,r){var n;if(!r)return !1;var i=e.getDeclarationFromName(t)||(88===t.kind?t.parent:e.isLiteralComputedPropertyDeclarationName(t)||135===t.kind&&e.isConstructorDeclaration(t.parent)?t.parent.parent:void 0),a=i&&e.isBinaryExpression(i)?i.left:void 0;return !(!i||!(null===(n=r.declarations)||void 0===n?void 0:n.some((function(e){return e===i||e===a}))))}(s=t.DefinitionKind||(t.DefinitionKind={}))[s.Symbol=0]="Symbol",s[s.Label=1]="Label",s[s.Keyword=2]="Keyword",s[s.This=3]="This",s[s.String=4]="String",s[s.TripleSlashReference=5]="TripleSlashReference",(o=t.EntryKind||(t.EntryKind={}))[o.Span=0]="Span",o[o.Node=1]="Node",o[o.StringLiteral=2]="StringLiteral",o[o.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",o[o.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",t.nodeEntry=c,t.isContextWithStartAndEndNode=l,t.getContextNode=_,t.toContextSpan=d,(a=t.FindReferencesUse||(t.FindReferencesUse={}))[a.Other=0]="Other",a[a.References=1]="References",a[a.Rename=2]="Rename",t.findReferencedSymbols=function(t,n,a,o,s){var c=e.getTouchingPropertyName(o,s),l={use:1},u=r.getReferencedSymbolsForNode(s,c,t,a,n,l),p=t.getTypeChecker(),f=r.getAdjustedNode(c,l),g=function(t){return 88===t.kind||!!e.getDeclarationFromName(t)||e.isLiteralComputedPropertyDeclarationName(t)||135===t.kind&&e.isConstructorDeclaration(t.parent)}(f)?p.getSymbolAtLocation(f):void 0;return u&&u.length?e.mapDefined(u,(function(t){var r=t.definition,a=t.references;return r&&{definition:p.runWithCancellationToken(n,(function(t){return function(t,r,n){var a=function(){switch(t.type){case 0:var a=y(p=t.symbol,r,n),o=a.displayParts,s=a.kind,c=o.map((function(e){return e.text})).join(""),l=p.declarations&&e.firstOrUndefined(p.declarations),u=l?e.getNameOfDeclaration(l)||l:n;return i$1(i$1({},m(u)),{name:c,kind:s,displayParts:o,context:_(l)});case 1:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"label",displayParts:[e.displayPart(u.text,e.SymbolDisplayPartKind.text)]});case 2:u=t.node;var d=e.tokenToString(u.kind);return i$1(i$1({},m(u)),{name:d,kind:"keyword",displayParts:[{text:d,kind:"keyword"}]});case 3:u=t.node;var p,f=(p=r.getSymbolAtLocation(u))&&e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,p,u.getSourceFile(),e.getContainerNode(u),u).displayParts||[e.textPart("this")];return i$1(i$1({},m(u)),{name:"this",kind:"var",displayParts:f});case 4:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"var",displayParts:[e.displayPart(e.getTextOfNode(u),e.SymbolDisplayPartKind.stringLiteral)]});case 5:return {textSpan:e.createTextSpanFromRange(t.reference),sourceFile:t.file,name:t.reference.fileName,kind:"string",displayParts:[e.displayPart('"'.concat(t.reference.fileName,'"'),e.SymbolDisplayPartKind.stringLiteral)]};default:return e.Debug.assertNever(t)}}(),o=a.sourceFile,s=a.textSpan,c=a.name,l=a.kind,u=a.displayParts,p=a.context;return i$1({containerKind:"",containerName:"",fileName:o.fileName,kind:l,name:c,textSpan:s,displayParts:u},d(s,o,p))}(r,t,c)})),references:a.map((function(e){return function(e,t){var r=v(e);return t?i$1(i$1({},r),{isDefinition:0!==e.kind&&S(e.node,t)}):r}(e,g)}))}})):void 0},t.getImplementationsAtPosition=function(t,r,a,o,s){var c,l=e.getTouchingPropertyName(o,s),u=p(t,r,a,l,s);if(208===l.parent.kind||205===l.parent.kind||209===l.parent.kind||106===l.kind)c=u&&n$4([],u,!0);else if(u)for(var _=e.createQueue(u),d=new e.Map;!_.isEmpty();){var f=_.dequeue();if(e.addToSeen(d,e.getNodeId(f.node))){c=e.append(c,f);var g=p(t,r,a,f.node,f.node.pos);g&&_.enqueue.apply(_,g);}}var m=t.getTypeChecker();return e.map(c,(function(t){return function(t,r){var n=h(t);if(0!==t.kind){var a=t.node;return i$1(i$1({},n),function(t,r){var n=r.getSymbolAtLocation(e.isDeclaration(t)&&t.name?t.name:t);return n?y(n,r,t):207===t.kind?{kind:"interface",displayParts:[e.punctuationPart(20),e.textPart("object literal"),e.punctuationPart(21)]}:228===t.kind?{kind:"local class",displayParts:[e.punctuationPart(20),e.textPart("anonymous local class"),e.punctuationPart(21)]}:{kind:e.getNodeKind(t),displayParts:[]}}(a,r))}return i$1(i$1({},n),{kind:"",displayParts:[]})}(t,m)}))},t.findReferenceOrRenameEntries=function(t,n,i,a,o,s,c){return e.map(g(r.getReferencedSymbolsForNode(o,a,t,i,n,s)),(function(e){return c(e,a,t.getTypeChecker())}))},t.getReferenceEntriesForNode=f,t.toRenameLocation=function(t,r,n,a){return i$1(i$1({},h(t)),a&&function(t,r,n){if(0!==t.kind&&e.isIdentifier(r)){var i=t.node,a=t.kind,o=i.parent,s=r.text,c=e.isShorthandPropertyAssignment(o);if(c||e.isObjectBindingElementWithoutPropertyName(o)&&o.name===i&&void 0===o.dotDotDotToken){var l={prefixText:s+": "},u={suffixText:": "+s};if(3===a)return l;if(4===a)return u;if(c){var _=o.parent;return e.isObjectLiteralExpression(_)&&e.isBinaryExpression(_.parent)&&e.isModuleExportsAccessExpression(_.parent.left)?l:u}return l}if(e.isImportSpecifier(o)&&!o.propertyName){var d=e.isExportSpecifier(r.parent)?n.getExportSpecifierLocalTargetSymbol(r.parent):n.getSymbolAtLocation(r);return e.contains(d.declarations,o)?{prefixText:s+" as "}:e.emptyOptions}if(e.isExportSpecifier(o)&&!o.propertyName)return r===t.node||n.getSymbolAtLocation(r)===n.getSymbolAtLocation(t.node)?{prefixText:s+" as "}:{suffixText:" as "+s}}return e.emptyOptions}(t,r,n))},t.toReferenceEntry=v,t.toHighlightSpan=function(e){var t=h(e);if(0===e.kind)return {fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};var r=D(e.node),n=i$1({textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:2===e.kind||void 0},t.contextSpan&&{contextSpan:t.contextSpan});return {fileName:t.fileName,span:n}},t.getTextSpanOfEntry=x,t.isDeclarationOfSymbol=S,function(r){function n(t,r){return 1===r.use?t=e.getAdjustedReferenceLocation(t):2===r.use&&(t=e.getAdjustedRenameLocation(t)),t}function i(t,r,n){for(var i,a=0,o=r.get(t.path)||e.emptyArray;a<o.length;a++){var s=o[a];if(e.isReferencedFile(s)){var c=n.getSourceFileByPath(s.file),l=e.getReferencedFileLocation(n.getSourceFileByPath,s);e.isReferenceFileLocation(l)&&(i=e.append(i,{kind:0,fileName:c.fileName,textSpan:e.createTextSpanFromRange(l)}));}}return i}function a(t,r,n){if(t.parent&&e.isNamespaceExportDeclaration(t.parent)){var i=n.getAliasedSymbol(r),a=n.getMergedSymbol(i);if(i!==a)return a}}function o(t,r,n,i,a,o){var c=1536&t.flags&&t.declarations&&e.find(t.declarations,e.isSourceFile);if(c){var l=t.exports.get("export="),_=u(r,t,!!l,n,o);if(!l||!o.has(c.fileName))return _;var p=r.getTypeChecker();return s(r,_,d(t=e.skipAlias(l,p),void 0,n,o,p,i,a))}}function s(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];if(s&&s.length)if(r)for(var c=function(n){if(!n.definition||0!==n.definition.type)return r.push(n),"continue";var i=n.definition.symbol,a=e.findIndex(r,(function(e){return !!e.definition&&0===e.definition.type&&e.definition.symbol===i}));if(-1===a)return r.push(n),"continue";var o=r[a];r[a]={definition:o.definition,references:o.references.concat(n.references).sort((function(r,n){var i=l(t,r),a=l(t,n);if(i!==a)return e.compareValues(i,a);var o=x(r),s=x(n);return o.start!==s.start?e.compareValues(o.start,s.start):e.compareValues(o.length,s.length)}))};},u=0,_=s;u<_.length;u++){var d=_[u];c(d);}else r=s;}return r}function l(e,t){var r=0===t.kind?e.getSourceFile(t.fileName):t.node.getSourceFile();return e.getSourceFiles().indexOf(r)}function u(r,n,i,a,o){e.Debug.assert(!!n.valueDeclaration);var s=e.mapDefined(t.findModuleReferences(r,a,n),(function(t){if("import"===t.kind){var r=t.literal.parent;if(e.isLiteralTypeNode(r)){var n=e.cast(r.parent,e.isImportTypeNode);if(i&&!n.qualifier)return}return c(t.literal)}return {kind:0,fileName:t.referencingFile.fileName,textSpan:e.createTextSpanFromRange(t.ref)}}));if(n.declarations)for(var l=0,u=n.declarations;l<u.length;l++)switch((f=u[l]).kind){case 308:break;case 264:o.has(f.getSourceFile().fileName)&&s.push(c(f.name));break;default:e.Debug.assert(!!(33554432&n.flags),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.");}var _=n.exports.get("export=");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f,g=(f=p[d]).getSourceFile();if(o.has(g.fileName)){var m=e.isBinaryExpression(f)&&e.isPropertyAccessExpression(f.left)?f.left.expression:e.isExportAssignment(f)?e.Debug.checkDefined(e.findChildOfKind(f,93,g)):e.getNameOfDeclaration(f)||f;s.push(c(m));}}return s.length?[{definition:{type:0,symbol:n},references:s}]:e.emptyArray}function _(t){return 146===t.kind&&e.isTypeOperatorNode(t.parent)&&146===t.parent.operator}function d(t,r,n,i,a,o,s){var c=r&&function(t,r,n,i){var a=r.parent;return e.isExportSpecifier(a)&&i?F(r,t,a,n):e.firstDefined(t.declarations,(function(i){if(!i.parent){if(33554432&t.flags)return;e.Debug.fail("Unexpected symbol at ".concat(e.Debug.formatSyntaxKind(r.kind),": ").concat(e.Debug.formatSymbol(t)));}return e.isTypeLiteralNode(i.parent)&&e.isUnionTypeNode(i.parent.parent)?n.getPropertyOfType(n.getTypeFromTypeNode(i.parent.parent),t.name):void 0}))}(t,r,a,!K(s))||t,l=r?J(r,c):7,u=[],_=new g(n,i,r?function(t){switch(t.kind){case 173:case 135:return 1;case 79:if(e.isClassLike(t.parent))return e.Debug.assert(t.parent.name===t),2;default:return 0}}(r):0,a,o,l,s,u),d=K(s)&&c.declarations?e.find(c.declarations,e.isExportSpecifier):void 0;if(d)A(d.name,c,d,_.createSearch(r,t,void 0),_,!0,!0);else if(r&&88===r.kind&&"default"===c.escapedName&&c.parent)P(r,c,_),m(r,c,{exportingModuleSymbol:c.parent,exportKind:1},_);else {var f=_.createSearch(r,c,void 0,{allSearchSymbols:r?R(c,r,a,2===s.use,!!s.providePrefixAndSuffixTextForRename,!!s.implementations):[c]});p(c,_,f);}return u}function p(t,r,n){var i=function(t){var r=t.declarations,n=t.flags,i=t.parent,a=t.valueDeclaration;if(a&&(215===a.kind||228===a.kind))return a;if(r){if(8196&n){var o=e.find(r,(function(t){return e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t)}));return o?e.getAncestor(o,260):void 0}if(!r.some(e.isObjectBindingElementWithoutPropertyName)){var s,c=i&&!(262144&t.flags);if(!c||e.isExternalModuleSymbol(i)&&!i.globalExports){for(var l=0,u=r;l<u.length;l++){var _=u[l],d=e.getContainerNode(_);if(s&&s!==d)return;if(!d||308===d.kind&&!e.isExternalOrCommonJsModule(d))return;if(s=d,e.isFunctionExpression(s))for(var p=void 0;p=e.getNextJSDocCommentLocation(s);)s=p;}return c?s.getSourceFile():s}}}}(t);if(i)E(i,i.getSourceFile(),n,r,!(e.isSourceFile(i)&&!e.contains(r.sourceFiles,i)));else for(var a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a];r.cancellationToken.throwIfCancellationRequested(),h(s,n,r);}}var f;r.getReferencedSymbolsForNode=function(t,r,l,p,f,g,m){var y,v;if(void 0===g&&(g={}),void 0===m&&(m=new e.Set(p.map((function(e){return e.fileName})))),r=n(r,g),e.isSourceFile(r)){var h=e.GoToDefinition.getReferenceAtPosition(r,t,l);if(!(null==h?void 0:h.file))return;var b=l.getTypeChecker().getMergedSymbol(h.file.symbol);if(b)return u(l,b,!1,p,m);if(!(A=l.getFileIncludeReasons()))return;return [{definition:{type:5,reference:h.reference,file:r},references:i(h.file,A,l)||e.emptyArray}]}if(!g.implementations){var x=function(t,r,n){if(e.isTypeKeyword(t.kind)){if(114===t.kind&&e.isVoidExpression(t.parent))return;if(146===t.kind&&!_(t))return;return function(t,r,n,i){var a=e.flatMap(t,(function(t){return n.throwIfCancellationRequested(),e.mapDefined(D(t,e.tokenToString(r),t),(function(e){if(e.kind===r&&(!i||i(e)))return c(e)}))}));return a.length?[{definition:{type:2,node:a[0].node},references:a}]:void 0}(r,t.kind,n,146===t.kind?_:void 0)}if(e.isImportMeta(t.parent)&&t.parent.name===t)return function(t,r){var n=e.flatMap(t,(function(t){return r.throwIfCancellationRequested(),e.mapDefined(D(t,"meta",t),(function(t){var r=t.parent;if(e.isImportMeta(r))return c(r)}))}));return n.length?[{definition:{type:2,node:n[0].node},references:n}]:void 0}(r,n);if(e.isStaticModifier(t)&&e.isClassStaticBlockDeclaration(t.parent))return [{definition:{type:2,node:t},references:[c(t)]}];if(e.isJumpStatementTarget(t)){var i=e.getTargetLabel(t.parent,t.text);return i&&T(i.parent,i)}return e.isLabelOfLabeledStatement(t)?T(t.parent,t):e.isThis(t)?function(t,r,n){var i=e.getThisContainer(t,!1),a=32;switch(i.kind){case 171:case 170:if(e.isObjectLiteralMethod(i)){a&=e.getSyntacticModifierFlags(i),i=i.parent;break}case 169:case 168:case 173:case 174:case 175:a&=e.getSyntacticModifierFlags(i),i=i.parent;break;case 308:if(e.isExternalModule(i)||L(t))return;case 259:case 215:break;default:return}var o=e.flatMap(308===i.kind?r:[i.getSourceFile()],(function(t){return n.throwIfCancellationRequested(),D(t,"this",e.isSourceFile(i)?t:i).filter((function(t){if(!e.isThis(t))return !1;var r=e.getThisContainer(t,!1);switch(i.kind){case 215:case 259:return i.symbol===r.symbol;case 171:case 170:return e.isObjectLiteralMethod(i)&&i.symbol===r.symbol;case 228:case 260:case 207:return r.parent&&i.symbol===r.parent.symbol&&e.isStatic(r)===!!a;case 308:return 308===r.kind&&!e.isExternalModule(r)&&!L(t)}}))})).map((function(e){return c(e)}));return [{definition:{type:3,node:e.firstDefined(o,(function(t){return e.isParameter(t.node.parent)?t.node:void 0}))||t},references:o}]}(t,r,n):106===t.kind?function(t){var r=e.getSuperContainer(t,!1);if(r){var n=32;switch(r.kind){case 169:case 168:case 171:case 170:case 173:case 174:case 175:n&=e.getSyntacticModifierFlags(r),r=r.parent;break;default:return}var i=r.getSourceFile(),a=e.mapDefined(D(i,"super",r),(function(t){if(106===t.kind){var i=e.getSuperContainer(t,!1);return i&&e.isStatic(i)===!!n&&i.parent.symbol===r.symbol?c(t):void 0}}));return [{definition:{type:0,symbol:r.symbol},references:a}]}}(t):void 0}(r,p,f);if(x)return x}var S=l.getTypeChecker(),C=S.getSymbolAtLocation(e.isConstructorDeclaration(r)&&r.parent.name||r);if(C){if("export="===C.escapedName)return u(l,C.parent,!1,p,m);var E=o(C,l,p,f,g,m);if(E&&!(33554432&C.flags))return E;var k=a(r,C,S),N=k&&o(k,l,p,f,g,m);return s(l,E,d(C,r,p,m,S,f,g),N)}if(!g.implementations&&e.isStringLiteralLike(r)){if(e.isModuleSpecifierLike(r)){var A=l.getFileIncludeReasons(),F=null===(v=null===(y=r.getSourceFile().resolvedModules)||void 0===y?void 0:y.get(r.text,e.getModeForUsageLocation(r.getSourceFile(),r)))||void 0===v?void 0:v.resolvedFileName,P=F?l.getSourceFile(F):void 0;if(P)return [{definition:{type:4,node:r},references:i(P,A,l)||e.emptyArray}]}return function(t,r,n,i){var a=e.getContextualTypeFromParentOrAncestorTypeNode(t,n),o=e.flatMap(r,(function(r){return i.throwIfCancellationRequested(),e.mapDefined(D(r,t.text),(function(i){if(e.isStringLiteralLike(i)&&i.text===t.text){if(!a)return e.isNoSubstitutionTemplateLiteral(i)&&!e.rangeIsOnSingleLine(i,r)?void 0:c(i,2);var o=e.getContextualTypeFromParentOrAncestorTypeNode(i,n);if(a!==n.getStringType()&&a===o)return c(i,2)}}))}));return [{definition:{type:4,node:t},references:o}]}(r,p,S,f)}},r.getAdjustedNode=n,r.getReferencesForFileName=function(t,r,n,a){var o,s;void 0===a&&(a=new e.Set(n.map((function(e){return e.fileName}))));var c=null===(o=r.getSourceFile(t))||void 0===o?void 0:o.symbol;if(c)return (null===(s=u(r,c,!1,n,a)[0])||void 0===s?void 0:s.references)||e.emptyArray;var l=r.getFileIncludeReasons(),_=r.getSourceFile(t);return _&&l&&i(_,l,r)||e.emptyArray},function(e){e[e.None=0]="None",e[e.Constructor=1]="Constructor",e[e.Class=2]="Class";}(f||(f={}));var g=function(){function r(t,r,n,i,a,o,s,c){this.sourceFiles=t,this.sourceFilesSet=r,this.specialSearchKind=n,this.checker=i,this.cancellationToken=a,this.searchMeaning=o,this.options=s,this.result=c,this.inheritsFromCache=new e.Map,this.markSeenContainingTypeReference=e.nodeSeenTracker(),this.markSeenReExportRHS=e.nodeSeenTracker(),this.symbolIdToReferences=[],this.sourceFileToSeenSymbols=[];}return r.prototype.includesSourceFile=function(e){return this.sourceFilesSet.has(e.fileName)},r.prototype.getImportSearches=function(e,r){return this.importTracker||(this.importTracker=t.createImportTracker(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken)),this.importTracker(e,r,2===this.options.use)},r.prototype.createSearch=function(t,r,n,i){void 0===i&&(i={});var a=i.text,o=void 0===a?e.stripQuotes(e.symbolName(e.getLocalSymbolForExportDefault(r)||function(t){if(33555968&t.flags){var r=t.declarations&&e.find(t.declarations,(function(t){return !e.isSourceFile(t)&&!e.isModuleDeclaration(t)}));return r&&r.symbol}}(r)||r)):a,s=i.allSearchSymbols,c=void 0===s?[r]:s,l=e.escapeLeadingUnderscores(o),u=this.options.implementations&&t?function(t,r,n){var i=e.isRightSideOfPropertyAccess(t)?t.parent:void 0,a=i&&n.getTypeAtLocation(i.expression),o=e.mapDefined(a&&(a.isUnionOrIntersection()?a.types:a.symbol===r.parent?void 0:[a]),(function(e){return e.symbol&&96&e.symbol.flags?e.symbol:void 0}));return 0===o.length?void 0:o}(t,r,this.checker):void 0;return {symbol:r,comingFrom:n,text:o,escapedText:l,parents:u,allSearchSymbols:c,includes:function(t){return e.contains(c,t)}}},r.prototype.referenceAdder=function(t){var r=e.getSymbolId(t),n=this.symbolIdToReferences[r];return n||(n=this.symbolIdToReferences[r]=[],this.result.push({definition:{type:0,symbol:t},references:n})),function(e,t){return n.push(c(e,t))}},r.prototype.addStringOrCommentReference=function(e,t){this.result.push({definition:void 0,references:[{kind:0,fileName:e,textSpan:t}]});},r.prototype.markSearchedSymbols=function(t,r){for(var n=e.getNodeId(t),i=this.sourceFileToSeenSymbols[n]||(this.sourceFileToSeenSymbols[n]=new e.Set),a=!1,o=0,s=r;o<s.length;o++){var c=s[o];a=e.tryAddToSet(i,e.getSymbolId(c))||a;}return a},r}();function m(e,t,r,n){var i=n.getImportSearches(t,r),a=i.importSearches,o=i.singleReferences,s=i.indirectUsers;if(o.length)for(var c=n.referenceAdder(t),l=0,u=o;l<u.length;l++){var _=u[l];y(_,n)&&c(_);}for(var d=0,p=a;d<p.length;d++){var f=p[d],g=f[0],m=f[1];C(g.getSourceFile(),n.createSearch(g,m,1),n);}if(s.length){var v=void 0;switch(r.exportKind){case 0:v=n.createSearch(e,t,1);break;case 1:v=2===n.options.use?void 0:n.createSearch(e,t,1,{text:"default"});}if(v)for(var b=0,x=s;b<x.length;b++)h(x[b],v,n);}}function y(t,r){return !(!k(t,r)||2===r.options.use&&(!e.isIdentifier(t)||e.isImportOrExportSpecifier(t.parent)&&"default"===t.escapedText))}function v(e,t){if(e.declarations)for(var r=0,n=e.declarations;r<n.length;r++){var i=n[r],a=i.getSourceFile();C(a,t.createSearch(i,e,0),t,t.includesSourceFile(a));}}function h(t,r,n){void 0!==e.getNameTable(t).get(r.escapedText)&&C(t,r,n);}function b(t,r,n,i,a){void 0===a&&(a=n);var o=e.isParameterPropertyDeclaration(t.parent,t.parent.parent)?e.first(r.getSymbolsOfParameterPropertyDeclaration(t.parent,t.text)):r.getSymbolAtLocation(t);if(o)for(var s=0,c=D(n,o.name,a);s<c.length;s++){var l=c[s];if(e.isIdentifier(l)&&l!==t&&l.escapedText===t.escapedText){var u=r.getSymbolAtLocation(l);if(u===o||r.getShorthandAssignmentValueSymbol(l.parent)===o||e.isExportSpecifier(l.parent)&&F(l,u,l.parent,r)===o){var _=i(l);if(_)return _}}}}function D(t,r,n){return void 0===n&&(n=t),S(t,r,n).map((function(r){return e.getTouchingPropertyName(t,r)}))}function S(t,r,n){void 0===n&&(n=t);var i=[];if(!r||!r.length)return i;for(var a=t.text,o=a.length,s=r.length,c=a.indexOf(r,n.pos);c>=0&&!(c>n.end);){var l=c+s;0!==c&&e.isIdentifierPart(a.charCodeAt(c-1),99)||l!==o&&e.isIdentifierPart(a.charCodeAt(l),99)||i.push(c),c=a.indexOf(r,c+s+1);}return i}function T(t,r){var n=t.getSourceFile(),i=r.text,a=e.mapDefined(D(n,i,t),(function(t){return t===r||e.isJumpStatementTarget(t)&&e.getTargetLabel(t,i)===r?c(t):void 0}));return [{definition:{type:1,node:r},references:a}]}function C(e,t,r,n){return void 0===n&&(n=!0),r.cancellationToken.throwIfCancellationRequested(),E(e,e,t,r,n)}function E(e,t,r,n,i){if(n.markSearchedSymbols(t,r.allSearchSymbols))for(var a=0,o=S(t,r.text,e);a<o.length;a++)N(t,o[a],r,n,i);}function k(t,r){return !!(e.getMeaningFromLocation(t)&r.searchMeaning)}function N(r,n,i,a,o){var s=e.getTouchingPropertyName(r,n);if(function(t,r){switch(t.kind){case 80:if(e.isJSDocMemberName(t.parent))return !0;case 79:return t.text.length===r.length;case 14:case 10:var n=t;return (e.isLiteralNameOfPropertyDeclarationOrIndexAccess(n)||e.isNameOfModuleDeclaration(t)||e.isExpressionOfExternalModuleImportEqualsDeclaration(t)||e.isCallExpression(t.parent)&&e.isBindableObjectDefinePropertyCall(t.parent)&&t.parent.arguments[1]===t)&&n.text.length===r.length;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t)&&t.text.length===r.length;case 88:return "default".length===r.length;default:return !1}}(s,i.text)){if(k(s,a)){var c=a.checker.getSymbolAtLocation(s);if(c){var l=s.parent;if(!e.isImportSpecifier(l)||l.propertyName!==s){if(e.isExportSpecifier(l))return e.Debug.assert(79===s.kind),void A(s,c,l,i,a,o);var u=function(t,r,n,i){var a=i.checker;return B(r,n,a,!1,2!==i.options.use||!!i.options.providePrefixAndSuffixTextForRename,(function(n,i,a,o){return a&&j(r)!==j(a)&&(a=void 0),t.includes(a||i||n)?{symbol:!i||6&e.getCheckFlags(n)?n:i,kind:o}:void 0}),(function(e){return !(t.parents&&!t.parents.some((function(t){return M(e.parent,t,i.inheritsFromCache,a)})))}))}(i,c,s,a);if(u){switch(a.specialSearchKind){case 0:o&&P(s,u,a);break;case 1:!function(t,r,n,i){e.isNewExpressionTarget(t)&&P(t,n.symbol,i);var a,o=function(){return i.referenceAdder(n.symbol)};if(e.isClassLike(t.parent))e.Debug.assert(88===t.kind||t.parent.name===t),function(t,r,n){var i=w(t);if(i&&i.declarations)for(var a=0,o=i.declarations;a<o.length;a++){var s=o[a],c=e.findChildOfKind(s,135,r);e.Debug.assert(173===s.kind&&!!c),n(c);}t.exports&&t.exports.forEach((function(t){var r=t.valueDeclaration;if(r&&171===r.kind){var i=r.body;i&&U(i,108,(function(t){e.isNewExpressionTarget(t)&&n(t);}));}}));}(n.symbol,r,o());else {var s=(a=t,e.tryGetClassExtendingExpressionWithTypeArguments(e.climbPastPropertyAccess(a).parent));s&&(function(t,r){var n=w(t.symbol);if(n&&n.declarations)for(var i=0,a=n.declarations;i<a.length;i++){var o=a[i];e.Debug.assert(173===o.kind);var s=o.body;s&&U(s,106,(function(t){e.isCallExpressionTarget(t)&&r(t);}));}}(s,o()),function(e,t){if(!function(e){return !!w(e.symbol)}(e)){var r=e.symbol,n=t.createSearch(void 0,r,void 0);p(r,t,n);}}(s,i));}}(s,r,i,a);break;case 2:!function(t,r,n){P(t,r.symbol,n);var i=t.parent;if(2!==n.options.use&&e.isClassLike(i)){e.Debug.assert(i.name===t);for(var a=n.referenceAdder(r.symbol),o=0,s=i.members;o<s.length;o++){var c=s[o];e.isMethodOrAccessor(c)&&e.isStatic(c)&&c.body&&c.body.forEachChild((function t(r){108===r.kind?a(r):e.isFunctionLike(r)||e.isClassLike(r)||r.forEachChild(t);}));}}}(s,i,a);break;default:e.Debug.assertNever(a.specialSearchKind);}e.isInJSFile(s)&&205===s.parent.kind&&e.isVariableDeclarationInitializedToBareOrAccessedRequire(s.parent.parent.parent)&&!(c=s.parent.symbol)||function(e,r,n,i){var a=t.getImportOrExportSymbol(e,r,i.checker,1===n.comingFrom);if(a){var o=a.symbol;0===a.kind?K(i.options)||v(o,i):m(e,o,a.exportInfo,i);}}(s,c,i,a);}else !function(t,r,n){var i=t.flags,a=t.valueDeclaration,o=n.checker.getShorthandAssignmentValueSymbol(a),s=a&&e.getNameOfDeclaration(a);33554432&i||!s||!r.includes(o)||P(s,o,n);}(c,i,a);}}}}else !a.options.implementations&&(a.options.findInStrings&&e.isInString(r,n)||a.options.findInComments&&e.isInNonReferenceComment(r,n))&&a.addStringOrCommentReference(r.fileName,e.createTextSpan(n,i.text.length));}function A(r,n,i,a,o,s,c){e.Debug.assert(!c||!!o.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");var l=i.parent,u=i.propertyName,_=i.name,d=l.parent,p=F(r,n,i,o.checker);if(c||a.includes(p)){if(u?r===u?(d.moduleSpecifier||b(),s&&2!==o.options.use&&o.markSeenReExportRHS(_)&&P(_,e.Debug.checkDefined(i.symbol),o)):o.markSeenReExportRHS(r)&&b():2===o.options.use&&"default"===_.escapedText||b(),!K(o.options)||c){var f=88===r.originalKeywordKind||88===i.name.originalKeywordKind?1:0,g=e.Debug.checkDefined(i.symbol),y=t.getExportInfo(g,f,o.checker);y&&m(r,g,y,o);}if(1!==a.comingFrom&&d.moduleSpecifier&&!u&&!K(o.options)){var h=o.checker.getExportSpecifierLocalTargetSymbol(i);h&&v(h,o);}}function b(){s&&P(r,p,o);}}function F(t,r,n,i){return function(t,r){var n=r.parent,i=r.propertyName,a=r.name;return e.Debug.assert(i===t||a===t),i?i===t:!n.parent.moduleSpecifier}(t,n)&&i.getExportSpecifierLocalTargetSymbol(n)||r}function P(t,r,n){var i="kind"in r?r:{kind:void 0,symbol:r},a=i.kind,o=i.symbol;if(2!==n.options.use||88!==t.kind){var s=n.referenceAdder(o);n.options.implementations?function(t,r,n){var i;if(!e.isDeclarationName(t)||(16777216&(i=t.parent).flags?e.isInterfaceDeclaration(i)||e.isTypeAliasDeclaration(i):!(e.isVariableLike(i)?e.hasInitializer(i):e.isFunctionLikeDeclaration(i)?i.body:e.isClassLike(i)||e.isModuleOrEnumDeclaration(i)))){if(79===t.kind){300===t.parent.kind&&z(t,n.checker,r);var a=I(t);if(a)r(a);else {var o=e.findAncestor(t,(function(t){return !e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),s=o.parent;if(e.hasType(s)&&s.type===o&&n.markSeenContainingTypeReference(s))if(e.hasInitializer(s))l(s.initializer);else if(e.isFunctionLike(s)&&s.body){var c=s.body;238===c.kind?e.forEachReturnStatement(c,(function(e){e.expression&&l(e.expression);})):l(c);}else e.isAssertionExpression(s)&&l(s.expression);}}}else r(t);function l(e){O(e)&&r(e);}}(t,s,n):s(t,a);}}function w(e){return e.members&&e.members.get("__constructor")}function I(t){return e.isIdentifier(t)||e.isPropertyAccessExpression(t)?I(t.parent):e.isExpressionWithTypeArguments(t)?e.tryCast(t.parent.parent,e.isClassLike):void 0}function O(e){switch(e.kind){case 214:return O(e.expression);case 216:case 215:case 207:case 228:case 206:return !0;default:return !1}}function M(t,r,n,i){if(t===r)return !0;var a=e.getSymbolId(t)+","+e.getSymbolId(r),o=n.get(a);if(void 0!==o)return o;n.set(a,!1);var s=!!t.declarations&&t.declarations.some((function(t){return e.getAllSuperTypeNodes(t).some((function(e){var t=i.getTypeAtLocation(e);return !!t&&!!t.symbol&&M(t.symbol,r,n,i)}))}));return n.set(a,s),s}function L(e){return 79===e.kind&&166===e.parent.kind&&e.parent.name===e}function R(e,t,r,n,i,a){var o=[];return B(e,t,r,n,!(n&&i),(function(t,r,n){n&&j(e)!==j(n)&&(n=void 0),o.push(n||r||t);}),(function(){return !a})),o}function B(t,r,n,i,o,s,c){var l=e.getContainingObjectLiteralElement(r);if(l){var u=n.getShorthandAssignmentValueSymbol(r.parent);if(u&&i)return s(u,void 0,void 0,3);var _=n.getContextualType(l.parent),d=_&&e.firstDefined(e.getPropertySymbolsFromContextualType(l,n,_,!0),(function(e){return T(e,4)}));if(d)return d;var p=function(t,r){return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent.parent)?r.getPropertySymbolOfDestructuringAssignment(t):void 0}(r,n),f=p&&s(p,void 0,void 0,4);if(f)return f;var g=u&&s(u,void 0,void 0,3);if(g)return g}var m=a(r,t,n);if(m){var y=s(m,void 0,void 0,1);if(y)return y}var v=T(t);if(v)return v;if(t.valueDeclaration&&e.isParameterPropertyDeclaration(t.valueDeclaration,t.valueDeclaration.parent)){var h=n.getSymbolsOfParameterPropertyDeclaration(e.cast(t.valueDeclaration,e.isParameter),t.name);return e.Debug.assert(2===h.length&&!!(1&h[0].flags)&&!!(4&h[1].flags)),T(1&t.flags?h[1]:h[0])}var b=e.getDeclarationOfKind(t,278);if(!i||b&&!b.propertyName){var x=b&&n.getExportSpecifierLocalTargetSymbol(b);if(x){var D=s(x,void 0,void 0,1);if(D)return D}}if(!i){var S=void 0;return (S=o?e.isObjectBindingElementWithoutPropertyName(r.parent)?e.getPropertySymbolFromBindingElement(n,r.parent):void 0:C(t,n))&&T(S,4)}if(e.Debug.assert(i),o)return (S=C(t,n))&&T(S,4);function T(t,r){return e.firstDefined(n.getRootSymbols(t),(function(i){return s(t,i,void 0,r)||(i.parent&&96&i.parent.flags&&c(i)?function(t,r,n,i){var a=new e.Map;return function t(o){if(96&o.flags&&e.addToSeen(a,e.getSymbolId(o)))return e.firstDefined(o.declarations,(function(a){return e.firstDefined(e.getAllSuperTypeNodes(a),(function(a){var o=n.getTypeAtLocation(a),s=o&&o.symbol&&n.getPropertyOfType(o,r);return o&&s&&(e.firstDefined(n.getRootSymbols(s),i)||t(o.symbol))}))}))}(t)}(i.parent,i.name,n,(function(e){return s(t,i,e,r)})):void 0)}))}function C(t,r){var n=e.getDeclarationOfKind(t,205);if(n&&e.isObjectBindingElementWithoutPropertyName(n))return e.getPropertySymbolFromBindingElement(r,n)}}function j(t){return !!t.valueDeclaration&&!!(32&e.getEffectiveModifierFlags(t.valueDeclaration))}function J(t,r){var n=e.getMeaningFromLocation(t),i=r.declarations;if(i){var a=void 0;do{a=n;for(var o=0,s=i;o<s.length;o++){var c=s[o],l=e.getMeaningFromDeclaration(c);l&n&&(n|=l);}}while(n!==a)}return n}function z(t,r,n){var i=r.getSymbolAtLocation(t),a=r.getShorthandAssignmentValueSymbol(i.valueDeclaration);if(a)for(var o=0,s=a.getDeclarations();o<s.length;o++){var c=s[o];1&e.getMeaningFromDeclaration(c)&&n(c);}}function U(t,r,n){e.forEachChild(t,(function(e){e.kind===r&&n(e),U(e,r,n);}));}function K(e){return 2===e.use&&e.providePrefixAndSuffixTextForRename}r.eachExportReference=function(r,n,i,a,o,s,c,l){for(var u=t.createImportTracker(r,new e.Set(r.map((function(e){return e.fileName}))),n,i)(a,{exportKind:c?1:0,exportingModuleSymbol:o},!1),_=u.importSearches,d=u.indirectUsers,p=u.singleReferences,f=0,g=_;f<g.length;f++)l(g[f][0]);for(var m=0,y=p;m<y.length;m++){var v=y[m];e.isIdentifier(v)&&e.isImportTypeNode(v.parent)&&l(v);}for(var h=0,b=d;h<b.length;h++)for(var x=0,S=D(b[h],c?"default":s);x<S.length;x++){var T=S[x],C=n.getSymbolAtLocation(T),E=e.some(null==C?void 0:C.declarations,(function(t){return !!e.tryCast(t,e.isExportAssignment)}));!e.isIdentifier(T)||e.isImportOrExportSpecifier(T.parent)||C!==a&&!E||l(T);}},r.isSymbolReferencedInFile=function(e,t,r,n){return void 0===n&&(n=r),b(e,t,r,(function(){return !0}),n)||!1},r.eachSymbolReferenceInFile=b,r.getTopMostDeclarationNamesInFile=function(t,r){return e.filter(D(r,t),(function(t){return !!e.getDeclarationFromName(t)})).reduce((function(t,r){var n=function(t){for(var r=0;t;)t=e.getContainerNode(t),r++;return r}(r);return e.some(t.declarationNames)&&n!==t.depth?n<t.depth&&(t.declarationNames=[r],t.depth=n):(t.declarationNames.push(r),t.depth=n),t}),{depth:1/0,declarationNames:[]}).declarationNames},r.someSignatureUsage=function(t,r,n,i){if(!t.name||!e.isIdentifier(t.name))return !1;for(var a=e.Debug.checkDefined(n.getSymbolAtLocation(t.name)),o=0,s=r;o<s.length;o++)for(var c=0,l=D(s[o],a.name);c<l.length;c++){var u=l[c];if(e.isIdentifier(u)&&u!==t.name&&u.escapedText===t.name.escapedText){var _=e.climbPastPropertyAccess(u),d=e.isCallExpression(_.parent)&&_.parent.expression===_?_.parent:void 0,p=n.getSymbolAtLocation(u);if(p&&n.getRootSymbols(p).some((function(e){return e===a}))&&i(u,d))return !0}}return !1},r.getIntersectingMeaningFromDeclarations=J,r.getReferenceEntriesForShorthandPropertyAssignment=z;}(r=t.Core||(t.Core={}));}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){function r(t){return (e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t))&&e.isVariableDeclaration(t.parent)&&t===t.parent.initializer&&e.isIdentifier(t.parent.name)&&!!(2&e.getCombinedNodeFlags(t.parent))}function n(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isClassExpression(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)}function i(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)&&e.isIdentifier(t.name)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)||function(t){return (e.isFunctionExpression(t)||e.isClassExpression(t))&&e.isNamedDeclaration(t)}(t)||r(t)}function a(t){return e.isSourceFile(t)?t:e.isNamedDeclaration(t)?t.name:r(t)?t.parent.name:e.Debug.checkDefined(t.modifiers&&e.find(t.modifiers,o))}function o(e){return 88===e.kind}function s(e,t){var r=a(t);return r&&e.getSymbolAtLocation(r)}function c(t,r){if(r.body)return r;if(e.isConstructorDeclaration(r))return e.getFirstConstructorWithBody(r.parent);if(e.isFunctionDeclaration(r)||e.isMethodDeclaration(r)){var n=s(t,r);return n&&n.valueDeclaration&&e.isFunctionLikeDeclaration(n.valueDeclaration)&&n.valueDeclaration.body?n.valueDeclaration:void 0}return r}function l(t,r){var n,a=s(t,r);if(a&&a.declarations){var o=e.indicesOf(a.declarations),c=e.map(a.declarations,(function(e){return {file:e.getSourceFile().fileName,pos:e.pos}}));o.sort((function(t,r){return e.compareStringsCaseSensitive(c[t].file,c[r].file)||c[t].pos-c[r].pos}));for(var l=void 0,u=0,_=e.map(o,(function(e){return a.declarations[e]}));u<_.length;u++){var d=_[u];i(d)&&(l&&l.parent===d.parent&&l.end===d.pos||(n=e.append(n,d)),l=d);}}return n}function u(t,r){var n,i,a;return e.isClassStaticBlockDeclaration(r)?r:e.isFunctionLikeDeclaration(r)?null!==(i=null!==(n=c(t,r))&&void 0!==n?n:l(t,r))&&void 0!==i?i:r:null!==(a=l(t,r))&&void 0!==a?a:r}function _(t,a){for(var o=t.getTypeChecker(),s=!1;;){if(i(a))return u(o,a);var c;if(n(a))return (c=e.findAncestor(a,i))&&u(o,c);if(e.isDeclarationName(a))return i(a.parent)?u(o,a.parent):n(a.parent)?(c=e.findAncestor(a.parent,i))&&u(o,c):e.isVariableDeclaration(a.parent)&&a.parent.initializer&&r(a.parent.initializer)?a.parent.initializer:void 0;if(e.isConstructorDeclaration(a))return i(a.parent)?a.parent:void 0;if(124!==a.kind||!e.isClassStaticBlockDeclaration(a.parent)){if(e.isVariableDeclaration(a)&&a.initializer&&r(a.initializer))return a.initializer;if(!s){var l=o.getSymbolAtLocation(a);if(l&&(2097152&l.flags&&(l=o.getAliasedSymbol(l)),l.valueDeclaration)){s=!0,a=l.valueDeclaration;continue}}return}a=a.parent;}}function d(t,n){var i=n.getSourceFile(),a=function(t,n){if(e.isSourceFile(n))return {text:n.fileName,pos:0,end:0};if((e.isFunctionDeclaration(n)||e.isClassDeclaration(n))&&!e.isNamedDeclaration(n)){var i=n.modifiers&&e.find(n.modifiers,o);if(i)return {text:"default",pos:i.getStart(),end:i.getEnd()}}if(e.isClassStaticBlockDeclaration(n)){var a=n.getSourceFile(),s=e.skipTrivia(a.text,e.moveRangePastModifiers(n).pos),c=s+6,l=(_=(u=t.getTypeChecker()).getSymbolAtLocation(n.parent))?"".concat(u.symbolToString(_,n.parent)," "):"";return {text:"".concat(l,"static {}"),pos:s,end:c}}var u,_,d=r(n)?n.parent.name:e.Debug.checkDefined(e.getNameOfDeclaration(n),"Expected call hierarchy item to have a name"),p=e.isIdentifier(d)?e.idText(d):e.isStringOrNumericLiteralLike(d)?d.text:e.isComputedPropertyName(d)&&e.isStringOrNumericLiteralLike(d.expression)?d.expression.text:void 0;if(void 0===p&&(_=(u=t.getTypeChecker()).getSymbolAtLocation(d))&&(p=u.symbolToString(_,n)),void 0===p){var f=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0});p=e.usingSingleLineStringWriter((function(e){return f.writeNode(4,n,n.getSourceFile(),e)}));}return {text:p,pos:d.getStart(),end:d.getEnd()}}(t,n),s=function(t){var n,i;if(r(t))return e.isModuleBlock(t.parent.parent.parent.parent)&&e.isIdentifier(t.parent.parent.parent.parent.parent.name)?t.parent.parent.parent.parent.parent.name.getText():void 0;switch(t.kind){case 174:case 175:case 171:return 207===t.parent.kind?null===(n=e.getAssignedName(t.parent))||void 0===n?void 0:n.getText():null===(i=e.getNameOfDeclaration(t.parent))||void 0===i?void 0:i.getText();case 259:case 260:case 264:if(e.isModuleBlock(t.parent)&&e.isIdentifier(t.parent.parent.name))return t.parent.parent.name.getText()}}(n),c=e.getNodeKind(n),l=e.getNodeModifiers(n),u=e.createTextSpanFromBounds(e.skipTrivia(i.text,n.getFullStart(),!1,!0),n.getEnd()),_=e.createTextSpanFromBounds(a.pos,a.end);return {file:i.fileName,kind:c,kindModifiers:l,name:a.text,containerName:s,span:u,selectionSpan:_}}function p(e){return void 0!==e}function f(t){if(1===t.kind){var r=t.node;if(e.isCallOrNewExpressionTarget(r,!0,!0)||e.isTaggedTemplateTag(r,!0,!0)||e.isDecoratorTarget(r,!0,!0)||e.isJsxOpeningLikeElementTagName(r,!0,!0)||e.isRightSideOfPropertyAccess(r)||e.isArgumentExpressionOfElementAccess(r)){var n=r.getSourceFile();return {declaration:e.findAncestor(r,i)||n,range:e.createTextRangeFromNode(r,n)}}}}function g(t){return e.getNodeId(t.declaration)}t.resolveCallHierarchyDeclaration=_,t.createCallHierarchyItem=d,t.getIncomingCalls=function(t,r,n){if(e.isSourceFile(r)||e.isModuleDeclaration(r)||e.isClassStaticBlockDeclaration(r))return [];var i=a(r),o=e.filter(e.FindAllReferences.findReferenceOrRenameEntries(t,n,t.getSourceFiles(),i,0,{use:1},f),p);return o?e.group(o,g,(function(r){return function(t,r){return {from:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)})):[]},t.getOutgoingCalls=function(t,r){return 16777216&r.flags||e.isMethodSignature(r)?[]:e.group(function(t,r){var n=[],a=function(t,r){function n(n){var i=e.isTaggedTemplateExpression(n)?n.tag:e.isJsxOpeningLikeElement(n)?n.tagName:e.isAccessExpression(n)||e.isClassStaticBlockDeclaration(n)?n:n.expression,a=_(t,i);if(a){var o=e.createTextRangeFromNode(i,n.getSourceFile());if(e.isArray(a))for(var s=0,c=a;s<c.length;s++){var l=c[s];r.push({declaration:l,range:o});}else r.push({declaration:a,range:o});}}return function t(r){if(r&&!(16777216&r.flags))if(i(r)){if(e.isClassLike(r))for(var a=0,o=r.members;a<o.length;a++){var s=o[a];s.name&&e.isComputedPropertyName(s.name)&&t(s.name.expression);}}else {switch(r.kind){case 79:case 268:case 269:case 275:case 261:case 262:return;case 172:return void n(r);case 213:case 231:case 235:return void t(r.expression);case 257:case 166:return t(r.name),void t(r.initializer);case 210:case 211:return n(r),t(r.expression),void e.forEach(r.arguments,t);case 212:return n(r),t(r.tag),void t(r.template);case 283:case 282:return n(r),t(r.tagName),void t(r.attributes);case 167:return n(r),void t(r.expression);case 208:case 209:n(r),e.forEachChild(r,t);}e.isPartOfTypeNode(r)||e.forEachChild(r,t);}}}(t,n);switch(r.kind){case 308:!function(t,r){e.forEach(t.statements,r);}(r,a);break;case 264:!function(t,r){!e.hasSyntacticModifier(t,2)&&t.body&&e.isModuleBlock(t.body)&&e.forEach(t.body.statements,r);}(r,a);break;case 259:case 215:case 216:case 171:case 174:case 175:!function(t,r,n){var i=c(t,r);i&&(e.forEach(i.parameters,n),n(i.body));}(t.getTypeChecker(),r,a);break;case 260:case 228:!function(t,r){e.forEach(t.modifiers,r);var n=e.getClassExtendsHeritageElement(t);n&&r(n.expression);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.canHaveModifiers(o)&&e.forEach(o.modifiers,r),e.isPropertyDeclaration(o)?r(o.initializer):e.isConstructorDeclaration(o)&&o.body?(e.forEach(o.parameters,r),r(o.body)):e.isClassStaticBlockDeclaration(o)&&r(o);}}(r,a);break;case 172:!function(e,t){t(e.body);}(r,a);break;default:e.Debug.assertNever(r);}return n}(t,r),g,(function(r){return function(t,r){return {to:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)}))};}(e.CallHierarchy||(e.CallHierarchy={}));}(t),function(e){function t(t,n,i,a){var o=i(t);return function(t){var s=a&&a.tryGetSourcePosition({fileName:t,pos:0}),c=function(t){if(i(t)===o)return n;var r=e.tryRemoveDirectoryPrefix(t,o,i);return void 0===r?void 0:n+"/"+r}(s?s.fileName:t);return s?void 0===c?void 0:function(t,n,i,a){var o=e.getRelativePathFromFile(t,n,a);return r(e.getDirectoryPath(i),o)}(s.fileName,c,t,i):c}}function r(t,r){return e.ensurePathIsNonModuleName(function(t,r){return e.normalizePath(e.combinePaths(t,r))}(t,r))}function n(t,r,n,i){if(r){if(r.resolvedModule){var a=s(r.resolvedModule.resolvedFileName);if(a)return a}return e.forEach(r.failedLookupLocations,(function(t){var r=n(t);return r&&e.find(i,(function(e){return e.fileName===r}))?o(t):void 0}))||e.pathIsRelative(t.text)&&e.forEach(r.failedLookupLocations,o)||r.resolvedModule&&{newFileName:r.resolvedModule.resolvedFileName,updated:!1}}function o(t){return e.endsWith(t,"/package.json")?void 0:s(t)}function s(e){var t=n(e);return t&&{newFileName:t,updated:!0}}}function i(t,r){return e.createRange(t.getStart(r)+1,t.end-1)}function a(t,r){if(e.isObjectLiteralExpression(t))for(var n=0,i=t.properties;n<i.length;n++){var a=i[n];e.isPropertyAssignment(a)&&e.isStringLiteral(a.name)&&r(a,a.name.text);}}e.getEditsForFileRename=function(o,s,c,l,u,_,d){var p=e.hostUsesCaseSensitiveFileNames(l),f=e.createGetCanonicalFileName(p),g=t(s,c,f,d),m=t(c,s,f,d);return e.textChanges.ChangeTracker.with({host:l,formatContext:u,preferences:_},(function(t){!function(t,n,o,s,c,l,u){var _=t.getCompilerOptions().configFile;if(_){var d=e.getDirectoryPath(_.fileName),p=e.getTsConfigObjectLiteralExpression(_);p&&a(p,(function(t,r){switch(r){case"files":case"include":case"exclude":if(f(t)||"include"!==r||!e.isArrayLiteralExpression(t.initializer))return;var i=e.mapDefined(t.initializer.elements,(function(t){return e.isStringLiteral(t)?t.text:void 0}));if(0===i.length)return;var o=e.getFileMatcherPatterns(d,[],i,u,l);return void(e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(s)&&!e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(c)&&n.insertNodeAfter(_,e.last(t.initializer.elements),e.factory.createStringLiteral(m(c))));case"compilerOptions":return void a(t.initializer,(function(t,r){var n=e.getOptionFromName(r);n&&(n.isFilePath||"list"===n.type&&n.element.isFilePath)?f(t):"paths"===r&&a(t.initializer,(function(t){if(e.isArrayLiteralExpression(t.initializer))for(var r=0,n=t.initializer.elements;r<n.length;r++)g(n[r]);}));}))}}));}function f(t){for(var r=!1,n=0,i=e.isArrayLiteralExpression(t.initializer)?t.initializer.elements:[t.initializer];n<i.length;n++)r=g(i[n])||r;return r}function g(t){if(!e.isStringLiteral(t))return !1;var a=r(d,t.text),s=o(a);return void 0!==s&&(n.replaceRangeWithText(_,i(t,_),m(s)),!0)}function m(t){return e.getRelativePathFromDirectory(d,t,!u)}}(o,t,g,s,c,l.getCurrentDirectory(),p),function(t,a,o,s,c,l){for(var u=t.getSourceFiles(),_=function(_){var d=o(_.fileName),p=null!=d?d:_.fileName,f=e.getDirectoryPath(p),g=s(_.fileName),m=g||_.fileName,y=e.getDirectoryPath(m),v=void 0!==d||void 0!==g;!function(t,r,n,a){for(var o=0,s=t.referencedFiles||e.emptyArray;o<s.length;o++){var c=s[o];void 0!==(_=n(c.fileName))&&_!==t.text.slice(c.pos,c.end)&&r.replaceRangeWithText(t,c,_);}for(var l=0,u=t.imports;l<u.length;l++){var _,d=u[l];void 0!==(_=a(d))&&_!==d.text&&r.replaceRangeWithText(t,i(d,t),_);}}(_,a,(function(t){if(e.pathIsRelative(t)){var n=r(y,t),i=o(n);return void 0===i?void 0:e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(f,i,l))}}),(function(r){var i=t.getTypeChecker().getSymbolAtLocation(r);if(!(null==i?void 0:i.declarations)||!i.declarations.some((function(t){return e.isAmbientModule(t)}))){var a=void 0!==g?n(r,e.resolveModuleName(r.text,m,t.getCompilerOptions(),c),o,u):function(t,r,i,a,o,s){if(t){var c=e.find(t.declarations,e.isSourceFile).fileName,l=s(c);return void 0===l?{newFileName:c,updated:!1}:{newFileName:l,updated:!0}}var u=e.getModeForUsageLocation(i,r);return n(r,o.resolveModuleNames?o.getResolvedModuleWithFailedLookupLocationsFromCache&&o.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u):a.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u),s,a.getSourceFiles())}(i,r,_,t,c,o);return void 0!==a&&(a.updated||v&&e.pathIsRelative(r.text))?e.moduleSpecifiers.updateModuleSpecifier(t.getCompilerOptions(),_,l(p),a.newFileName,e.createModuleSpecifierResolutionHost(t,c),r.text):void 0}}));},d=0,p=u;d<p.length;d++)_(p[d]);}(o,t,g,m,l,f);}))},e.getPathUpdater=t;}(t),function(e){!function(t){function r(t,r,i,s,d){var f,g,m,y,v,h=o(r,i,t),b=h&&[(m=h.reference.fileName,y=h.fileName,v=h.unverified,{fileName:y,textSpan:e.createTextSpanFromBounds(0,0),kind:"script",name:m,containerName:void 0,containerKind:void 0,unverified:v})]||e.emptyArray;if(null==h?void 0:h.file)return b;var x=e.getTouchingPropertyName(r,i);if(x!==r){var D=x.parent,S=t.getTypeChecker();if(161===x.kind||e.isIdentifier(x)&&e.isJSDocOverrideTag(D)&&D.tagName===x)return function(t,r){var n=e.findAncestor(r,e.isClassElement);if(n&&n.name){var i=e.findAncestor(n,e.isClassLike);if(i){var a=e.getEffectiveBaseTypeNode(i);if(a){var o=e.skipParentheses(a.expression),s=e.isClassExpression(o)?o.symbol:t.getSymbolAtLocation(o);if(s){var c=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(n.name)),u=e.hasStaticModifier(n)?t.getPropertyOfType(t.getTypeOfSymbol(s),c):t.getPropertyOfType(t.getDeclaredTypeOfSymbol(s),c);if(u)return l(t,u,r)}}}}}(S,x)||e.emptyArray;if(e.isJumpStatementTarget(x)){var T=e.getTargetLabel(x.parent,x.text);return T?[_(S,T,"label",x.text,void 0)]:void 0}if(105===x.kind){var C=e.findAncestor(x.parent,(function(t){return e.isClassStaticBlockDeclaration(t)?"quit":e.isFunctionLikeDeclaration(t)}));return C?[p(S,C)]:void 0}if(e.isStaticModifier(x)&&e.isClassStaticBlockDeclaration(x.parent)){var E=x.parent.parent,k=c(E,S,d),N=k.symbol,A=k.failedAliasResolution,F=e.filter(E.members,e.isClassStaticBlockDeclaration),P=N?S.symbolToString(N,E):"",w=x.getSourceFile();return e.map(F,(function(t){var r=e.moveRangePastModifiers(t).pos;return r=e.skipTrivia(w.text,r),_(S,t,"constructor","static {}",P,!1,A,{start:r,length:"static".length})}))}var I=c(x,S,d),O=I.symbol,M=I.failedAliasResolution,L=x;if(s&&M){var R=e.forEach(n$4([x],(null==O?void 0:O.declarations)||e.emptyArray,!0),(function(t){return e.findAncestor(t,e.isAnyImportOrBareOrAccessedRequire)})),B=R&&e.tryGetModuleSpecifierFromDeclaration(R);B&&(O=(f=c(B,S,d)).symbol,M=f.failedAliasResolution,L=B);}if(!O&&e.isModuleSpecifierLike(L)){var j=null===(g=r.resolvedModules)||void 0===g?void 0:g.get(L.text,e.getModeForUsageLocation(r,L));if(j)return [{name:L.text,fileName:j.resolvedFileName,containerName:void 0,containerKind:void 0,kind:"script",textSpan:e.createTextSpan(0,0),failedAliasResolution:M,isAmbient:e.isDeclarationFileName(j.resolvedFileName),unverified:L!==x}]}if(!O)return e.concatenate(b,function(t,r){return e.mapDefined(r.getIndexInfosAtLocation(t),(function(e){return e.declaration&&p(r,e.declaration)}))}(x,S));if(!s||!e.every(O.declarations,(function(e){return e.getSourceFile().fileName===r.fileName}))){var J=function(t,r){var n=function(t){var r=e.findAncestor(t,(function(t){return !e.isRightSideOfPropertyAccess(t)})),n=null==r?void 0:r.parent;return n&&e.isCallLikeExpression(n)&&e.getInvokedExpression(n)===r?n:void 0}(r),i=n&&t.getResolvedSignature(n);return e.tryCast(i&&i.declaration,(function(t){return e.isFunctionLike(t)&&!e.isFunctionTypeNode(t)}))}(S,x);if(J&&(!e.isJsxOpeningLikeElement(x.parent)||!function(e){switch(e.kind){case 173:case 182:case 177:return !0;default:return !1}}(J))){var z=p(S,J,M);if(S.getRootSymbols(O).some((function(t){return function(t,r){return t===r.symbol||t===r.symbol.parent||e.isAssignmentExpression(r.parent)||!e.isCallLikeExpression(r.parent)&&t===r.parent.symbol}(t,J)})))return [z];var U=l(S,O,x,M,J)||e.emptyArray;return 106===x.kind?n$4([z],U,!0):n$4(n$4([],U,!0),[z],!1)}if(300===x.parent.kind){var K=S.getShorthandAssignmentValueSymbol(O.valueDeclaration),V=(null==K?void 0:K.declarations)?K.declarations.map((function(e){return u(e,S,K,x,!1,M)})):e.emptyArray;return e.concatenate(V,a(S,x)||e.emptyArray)}if(e.isPropertyName(x)&&e.isBindingElement(D)&&e.isObjectBindingPattern(D.parent)&&x===(D.propertyName||D.name)){var q=e.getNameFromPropertyName(x),W=S.getTypeAtLocation(D.parent);return void 0===q?e.emptyArray:e.flatMap(W.isUnion()?W.types:[W],(function(e){var t=e.getProperty(q);return t&&l(S,t,x)}))}return e.concatenate(b,a(S,x)||l(S,O,x,M))}}}function a(t,r){var n=e.getContainingObjectLiteralElement(r);if(n){var i=n&&t.getContextualType(n.parent);if(i)return e.flatMap(e.getPropertySymbolsFromContextualType(n,t,i,!1),(function(e){return l(t,e,r)}))}}function o(t,r,n){var i,a,o=f(t.referencedFiles,r);if(o)return (l=n.getSourceFileFromReference(t,o))&&{reference:o,fileName:l.fileName,file:l,unverified:!1};var s=f(t.typeReferenceDirectives,r);if(s){var c=n.getResolvedTypeReferenceDirectives().get(s.fileName,s.resolutionMode||t.impliedNodeFormat);return (l=c&&n.getSourceFile(c.resolvedFileName))&&{reference:s,fileName:l.fileName,file:l,unverified:!1}}var l,u=f(t.libReferenceDirectives,r);if(u)return (l=n.getLibFileFromReference(u))&&{reference:u,fileName:l.fileName,file:l,unverified:!1};if(null===(i=t.resolvedModules)||void 0===i?void 0:i.size()){var _=e.getTouchingToken(t,r);if(e.isModuleSpecifierLike(_)&&e.isExternalModuleNameRelative(_.text)&&t.resolvedModules.has(_.text,e.getModeForUsageLocation(t,_))){var d=null===(a=t.resolvedModules.get(_.text,e.getModeForUsageLocation(t,_)))||void 0===a?void 0:a.resolvedFileName,p=d||e.resolvePath(e.getDirectoryPath(t.fileName),_.text);return {file:n.getSourceFile(p),fileName:p,reference:{pos:_.getStart(),end:_.getEnd(),fileName:_.text},unverified:!d}}}}function s(t,r,n,i){return e.flatMap(!t.isUnion()||32&t.flags?[t]:t.types,(function(e){return e.symbol&&l(r,e.symbol,n,i)}))}function c(e,t,r){var n=t.getSymbolAtLocation(e),i=!1;if((null==n?void 0:n.declarations)&&2097152&n.flags&&!r&&function(e,t){return 79===e.kind&&(e.parent===t||271!==t.kind)}(e,n.declarations[0])){var a=t.getAliasedSymbol(n);if(a.declarations)return {symbol:a};i=!0;}return {symbol:n,failedAliasResolution:i}}function l(t,r,n,i,a){var o=e.filter(r.declarations,(function(e){return e!==a})),s=e.filter(o,(function(t){return !function(t){if(!e.isAssignmentDeclaration(t))return !1;var r=e.findAncestor(t,(function(t){return !!e.isAssignmentExpression(t)||!e.isAssignmentDeclaration(t)&&"quit"}));return !!r&&5===e.getAssignmentDeclarationKind(r)}(t)})),c=e.some(s)?s:o;return function(){if(32&r.flags&&!(19&r.flags)&&(e.isNewExpressionTarget(n)||135===n.kind))return l((e.find(o,e.isClassLike)||e.Debug.fail("Expected declaration to have at least one class-like declaration")).members,!0)}()||(e.isCallOrNewExpressionTarget(n)||e.isNameOfFunctionDeclaration(n)?l(o,!1):void 0)||e.map(c,(function(e){return u(e,t,r,n,!1,i)}));function l(a,o){if(a){var s=a.filter(o?e.isConstructorDeclaration:e.isFunctionLike),c=s.filter((function(e){return !!e.body}));return s.length?0!==c.length?c.map((function(e){return u(e,t,r,n)})):[u(e.last(s),t,r,n,!1,i)]:void 0}}}function u(t,r,n,i,a,o){var s=r.symbolToString(n),c=e.SymbolDisplay.getSymbolKind(r,n,i),l=n.parent?r.symbolToString(n.parent,i):"";return _(r,t,c,s,l,a,o)}function _(t,r,n,a,o,s,c,l){var u=r.getSourceFile();if(!l){var _=e.getNameOfDeclaration(r)||r;l=e.createTextSpanFromNode(_,u);}return i$1(i$1({fileName:u.fileName,textSpan:l,kind:n,name:a,containerKind:void 0,containerName:o},e.FindAllReferences.toContextSpan(l,u,e.FindAllReferences.getContextNode(r))),{isLocal:!d(t,r),isAmbient:!!(16777216&r.flags),unverified:s,failedAliasResolution:c})}function d(t,r){if(t.isDeclarationVisible(r))return !0;if(!r.parent)return !1;if(e.hasInitializer(r.parent)&&r.parent.initializer===r)return d(t,r.parent);switch(r.kind){case 169:case 174:case 175:case 171:if(e.hasEffectiveModifier(r,8))return !1;case 173:case 299:case 300:case 207:case 228:case 216:case 215:return d(t,r.parent);default:return !1}}function p(e,t,r){return u(t,e,t.symbol,t,!1,r)}function f(t,r){return e.find(t,(function(t){return e.textRangeContainsPositionInclusive(t,r)}))}t.getDefinitionAtPosition=r,t.getReferenceAtPosition=o,t.getTypeDefinitionAtPosition=function(t,r,n){var i=e.getTouchingPropertyName(r,n);if(i!==r){if(e.isImportMeta(i.parent)&&i.parent.name===i)return s(t.getTypeAtLocation(i.parent),t,i.parent,!1);var a=c(i,t,!1),o=a.symbol,u=a.failedAliasResolution;if(o){var _=t.getTypeOfSymbolAtLocation(o,i),d=function(t,r,n){if(r.symbol===t||t.valueDeclaration&&r.symbol&&e.isVariableDeclaration(t.valueDeclaration)&&t.valueDeclaration.initializer===r.symbol.valueDeclaration){var i=r.getCallSignatures();if(1===i.length)return n.getReturnTypeOfSignature(e.first(i))}}(o,_,t),p=d&&s(d,t,i,u),f=p&&0!==p.length?p:s(_,t,i,u);return f.length?f:!(111551&o.flags)&&788968&o.flags?l(t,e.skipAlias(o,t),i,u):void 0}}},t.getDefinitionAndBoundSpan=function(t,n,i){var a=r(t,n,i);if(a&&0!==a.length){var o=f(n.referencedFiles,i)||f(n.typeReferenceDirectives,i)||f(n.libReferenceDirectives,i);if(o)return {definitions:a,textSpan:e.createTextSpanFromRange(o)};var s=e.getTouchingPropertyName(n,i);return {definitions:a,textSpan:e.createTextSpan(s.getStart(),s.getWidth())}}},t.createDefinitionInfo=u,t.findReferenceInPosition=f;}(e.GoToDefinition||(e.GoToDefinition={}));}(t),function(e){!function(t){var r,i,a=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","inheritdoc","inner","instance","interface","kind","lends","license","link","listens","member","memberof","method","mixes","module","name","namespace","override","package","param","private","property","protected","public","readonly","requires","returns","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"];function o(t,r){return e.arraysEqual(t,r,(function(e,t){return e.kind===t.kind&&e.text===t.text}))}function s(t,r){return "string"==typeof t?[e.textPart(t)]:e.flatMap(t,(function(t){return 324===t.kind?[e.textPart(t.text)]:e.buildLinkParts(t,r)}))}function c(t,r){var i=t.comment,a=t.kind,o=function(t){switch(t){case 343:return e.parameterNamePart;case 350:return e.propertyNamePart;case 347:return e.typeParameterNamePart;case 348:case 341:return e.typeAliasNamePart;default:return e.textPart}}(a);switch(a){case 332:case 331:return d(t.class);case 347:var c=t,l=[];if(c.constraint&&l.push(e.textPart(c.constraint.getText())),e.length(c.typeParameters)){e.length(l)&&l.push(e.spacePart());var u=c.typeParameters[c.typeParameters.length-1];e.forEach(c.typeParameters,(function(t){l.push(o(t.getText())),u!==t&&l.push.apply(l,[e.punctuationPart(27),e.spacePart()]);}));}return i&&l.push.apply(l,n$4([e.spacePart()],s(i,r),!0)),l;case 346:return d(t.typeExpression);case 348:case 341:case 350:case 343:case 349:var _=t.name;return _?d(_):void 0===i?void 0:s(i,r);default:return void 0===i?void 0:s(i,r)}function d(t){return a=t.getText(),i?a.match(/^https?$/)?n$4([e.textPart(a)],s(i,r),!0):n$4([o(a),e.spacePart()],s(i,r),!0):[e.textPart(a)];var a;}}function l(t){return {name:t,kind:"",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}}function u(t,r){switch(t.kind){case 259:case 215:case 171:case 173:case 170:case 216:var n=t;return {commentOwner:t,parameters:n.parameters,hasReturn:_(n,r)};case 299:return u(t.initializer,r);case 260:case 261:case 263:case 302:case 262:return {commentOwner:t};case 168:var i=t;return i.type&&e.isFunctionTypeNode(i.type)?{commentOwner:t,parameters:i.type.parameters,hasReturn:_(i.type,r)}:{commentOwner:t};case 240:var a=t.declarationList.declarations,o=1===a.length&&a[0].initializer?function(t){for(;214===t.kind;)t=t.expression;switch(t.kind){case 215:case 216:return t;case 228:return e.find(t.members,e.isConstructorDeclaration)}}(a[0].initializer):void 0;return o?{commentOwner:t,parameters:o.parameters,hasReturn:_(o,r)}:{commentOwner:t};case 308:return "quit";case 264:return 264===t.parent.kind?void 0:{commentOwner:t};case 241:return u(t.expression,r);case 223:var s=t;return 0===e.getAssignmentDeclarationKind(s)?"quit":e.isFunctionLike(s.right)?{commentOwner:t,parameters:s.right.parameters,hasReturn:_(s.right,r)}:{commentOwner:t};case 169:var c=t.initializer;if(c&&(e.isFunctionExpression(c)||e.isArrowFunction(c)))return {commentOwner:t,parameters:c.parameters,hasReturn:_(c,r)}}}function _(t,r){return !!(null==r?void 0:r.generateReturnInDocTemplate)&&(e.isFunctionTypeNode(t)||e.isArrowFunction(t)&&e.isExpression(t.body)||e.isFunctionLikeDeclaration(t)&&t.body&&e.isBlock(t.body)&&!!e.forEachReturnStatement(t.body,(function(e){return e})))}t.getJsDocCommentsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){for(var i=0,a=function(t){switch(t.kind){case 343:case 350:return [t];case 341:case 348:return [t,t.parent];default:return e.getJSDocCommentsAndTags(t)}}(t);i<a.length;i++){var c=a[i],l=e.isJSDoc(c)&&c.tags&&e.find(c.tags,(function(e){return 330===e.kind&&("inheritDoc"===e.tagName.escapedText||"inheritdoc"===e.tagName.escapedText)}));if(!(void 0===c.comment&&!l||e.isJSDoc(c)&&348!==t.kind&&341!==t.kind&&c.tags&&c.tags.some((function(e){return 348===e.kind||341===e.kind}))&&!c.tags.some((function(e){return 343===e.kind||344===e.kind})))){var u=c.comment?s(c.comment,r):[];l&&l.comment&&(u=u.concat(s(l.comment,r))),e.contains(n,u,o)||n.push(u);}}})),e.flatten(e.intersperse(n,[e.lineBreakPart()]))},t.getJsDocTagsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){var i=e.getJSDocTags(t);if(!i.some((function(e){return 348===e.kind||341===e.kind}))||i.some((function(e){return 343===e.kind||344===e.kind})))for(var a=0,o=i;a<o.length;a++){var s=o[a];n.push({name:s.tagName.text,text:c(s,r)});}})),n},t.getJSDocTagNameCompletions=function(){return r||(r=e.map(a,(function(t){return {name:t,kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagNameCompletionDetails=l,t.getJSDocTagCompletions=function(){return i||(i=e.map(a,(function(t){return {name:"@".concat(t),kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagCompletionDetails=l,t.getJSDocParameterNameCompletions=function(t){if(!e.isIdentifier(t.name))return e.emptyArray;var r=t.name.text,n=t.parent,i=n.parent;return e.isFunctionLike(i)?e.mapDefined(i.parameters,(function(i){if(e.isIdentifier(i.name)){var a=i.name.text;if(!n.tags.some((function(r){return r!==t&&e.isJSDocParameterTag(r)&&e.isIdentifier(r.name)&&r.name.escapedText===a}))&&(void 0===r||e.startsWith(a,r)))return {name:a,kind:"parameter",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}}})):[]},t.getJSDocParameterNameCompletionDetails=function(t){return {name:t,kind:"parameter",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}},t.getDocCommentTemplateAtPosition=function(t,r,n,i){var a=e.getTokenAtPosition(r,n),o=e.findAncestor(a,e.isJSDoc);if(!o||void 0===o.comment&&!e.length(o.tags)){var s=a.getStart(r);if(o||!(s<n)){var c=function(t,r){return e.forEachAncestor(t,(function(e){return u(e,r)}))}(a,i);if(c){var l=c.commentOwner,_=c.parameters,d=c.hasReturn,p=e.hasJSDocNodes(l)&&l.jsDoc?l.jsDoc:void 0,f=e.lastOrUndefined(p);if(!(l.getStart(r)<n||f&&o&&f!==o)){var g=function(t,r){for(var n=t.text,i=e.getLineStartPositionForPosition(r,t),a=i;a<=r&&e.isWhiteSpaceSingleLine(n.charCodeAt(a));a++);return n.slice(i,a)}(r,n),m=e.hasJSFileExtension(r.fileName),y=(_?function(e,t,r,n){return e.map((function(e,i){var a=e.name,o=e.dotDotDotToken,s=79===a.kind?a.text:"param"+i,c=t?o?"{...any} ":"{any} ":"";return "".concat(r," * @param ").concat(c).concat(s).concat(n)})).join("")}(_||[],m,g,t):"")+(d?function(e,t){return "".concat(e," * @returns").concat(t)}(g,t):""),v=(p||[]).some((function(e){return !!e.tags}));if(y&&!v){var h="/**"+t+g+" * ";return {newText:h+t+y+g+" */"+(s===n?t+g:""),caretOffset:h.length}}return {newText:"/** */",caretOffset:3}}}}}};}(e.JsDoc||(e.JsDoc={}));}(t),function(e){!function(t){function r(e,t){switch(e.kind){case 270:case 273:case 268:var r=t.getSymbolAtLocation(e.name),n=t.getAliasedSymbol(r);return r.escapedName!==n.escapedName;default:return !0}}function n(t,r){var n=e.getNameOfDeclaration(t);return !!n&&(a(n,r)||164===n.kind&&i(n.expression,r))}function i(t,r){return a(t,r)||e.isPropertyAccessExpression(t)&&(r.push(t.name.text),!0)&&i(t.expression,r)}function a(t,r){return e.isPropertyNameLiteral(t)&&(r.push(e.getTextOfIdentifierOrLiteral(t)),!0)}function o(t){var r=[],a=e.getNameOfDeclaration(t);if(a&&164===a.kind&&!i(a.expression,r))return e.emptyArray;r.shift();for(var o=e.getContainerNode(t);o;){if(!n(o,r))return e.emptyArray;o=e.getContainerNode(o);}return r.reverse()}function s(t,r){return e.compareValues(t.matchKind,r.matchKind)||e.compareStringsCaseSensitiveUI(t.name,r.name)}function c(t){var r=t.declaration,n=e.getContainerNode(r),i=n&&e.getNameOfDeclaration(n);return {name:t.name,kind:e.getNodeKind(r),kindModifiers:e.getNodeModifiers(r),matchKind:e.PatternMatchKind[t.matchKind],isCaseSensitive:t.isCaseSensitive,fileName:t.fileName,textSpan:e.createTextSpanFromNode(r),containerName:i?i.text:"",containerKind:i?e.getNodeKind(n):""}}t.getNavigateToItems=function(t,n,i,a,l,u){var _=e.createPatternMatcher(a);if(!_)return e.emptyArray;for(var d=[],p=function(e){if(i.throwIfCancellationRequested(),u&&e.isDeclarationFile)return "continue";e.getNamedDeclarations().forEach((function(t,i){!function(e,t,n,i,a,s){var c=e.getMatchForLastSegmentOfPattern(t);if(c)for(var l=0,u=n;l<u.length;l++){var _=u[l];if(r(_,i))if(e.patternContainsDots){var d=e.getFullMatch(o(_),t);d&&s.push({name:t,fileName:a,matchKind:d.kind,isCaseSensitive:d.isCaseSensitive,declaration:_});}else s.push({name:t,fileName:a,matchKind:c.kind,isCaseSensitive:c.isCaseSensitive,declaration:_});}}(_,i,t,n,e.fileName,d);}));},f=0,g=t;f<g.length;f++)p(g[f]);return d.sort(s),(void 0===l?d:d.slice(0,l)).map(c)};}(e.NavigateTo||(e.NavigateTo={}));}(t),function(e){!function(t){var r,n,a,o,s,c=/\s+/g,l=[],u=[],_=[];function d(){a=void 0,n=void 0,l=[],o=void 0,_=[];}function p(e){return Q(e.getText(a))}function f(e){return e.node.kind}function g(e,t){e.children?e.children.push(t):e.children=[t];}function m(t){e.Debug.assert(!l.length);var r={node:t,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};o=r;for(var n=0,i=t.statements;n<i.length;n++)k(i[n]);return S(),e.Debug.assert(!o&&!l.length),r}function y(e,t){g(o,v(e,t));}function v(t,r){return {node:t,name:r||(e.isDeclaration(t)||e.isExpression(t)?e.getNameOfDeclaration(t):void 0),additionalNodes:void 0,parent:o,children:void 0,indent:o.indent+1}}function h(t){s||(s=new e.Map),s.set(t,!0);}function b(e){for(var t=0;t<e;t++)S();}function x(t,r){for(var n=[];!e.isPropertyNameLiteral(r);){var i=e.getNameOrArgument(r),a=e.getElementOrPropertyAccessName(r);r=r.expression,"prototype"===a||e.isPrivateIdentifier(i)||n.push(i);}n.push(r);for(var o=n.length-1;o>0;o--)D(t,i=n[o]);return [n.length-1,n[0]]}function D(e,t){var r=v(e,t);g(o,r),l.push(o),u.push(s),s=void 0,o=r;}function S(){o.children&&(N(o.children,o),O(o.children)),o=l.pop(),s=u.pop();}function T(e,t,r){D(e,r),k(t),S();}function C(t){t.initializer&&function(e){switch(e.kind){case 216:case 215:case 228:return !0;default:return !1}}(t.initializer)?(D(t),e.forEachChild(t.initializer,k),S()):T(t,t.initializer);}function E(t){return !e.hasDynamicName(t)||223!==t.kind&&e.isPropertyAccessExpression(t.name.expression)&&e.isIdentifier(t.name.expression.expression)&&"Symbol"===e.idText(t.name.expression.expression)}function k(t){var r;if(n.throwIfCancellationRequested(),t&&!e.isToken(t))switch(t.kind){case 173:var i=t;T(i,i.body);for(var a=0,o=i.parameters;a<o.length;a++){var c=o[a];e.isParameterPropertyDeclaration(c,i)&&y(c);}break;case 171:case 174:case 175:case 170:E(t)&&T(t,t.body);break;case 169:E(t)&&C(t);break;case 168:E(t)&&y(t);break;case 270:var l=t;l.name&&y(l.name);var u=l.namedBindings;if(u)if(271===u.kind)y(u);else for(var _=0,d=u.elements;_<d.length;_++)y(d[_]);break;case 300:T(t,t.name);break;case 301:var p=t.expression;e.isIdentifier(p)?y(t,p):y(t);break;case 205:case 299:case 257:var f=t;e.isBindingPattern(f.name)?k(f.name):C(f);break;case 259:var g=t.name;g&&e.isIdentifier(g)&&h(g.text),T(t,t.body);break;case 216:case 215:T(t,t.body);break;case 263:D(t);for(var m=0,v=t.members;m<v.length;m++)V(F=v[m])||y(F);S();break;case 260:case 228:case 261:D(t);for(var N=0,A=t.members;N<A.length;N++){var F;k(F=A[N]);}S();break;case 264:T(t,K(t).body);break;case 274:var P=t.expression;(f=e.isObjectLiteralExpression(P)||e.isCallExpression(P)?P:e.isArrowFunction(P)||e.isFunctionExpression(P)?P.body:void 0)?(D(t),k(f),S()):y(t);break;case 278:case 268:case 178:case 176:case 177:case 262:y(t);break;case 210:case 223:var w=e.getAssignmentDeclarationKind(t);switch(w){case 1:case 2:return void T(t,t.right);case 6:case 3:var I=(J=t).left,O=3===w?I.expression:I,M=0,L=void 0;return e.isIdentifier(O.expression)?(h(O.expression.text),L=O.expression):(M=(r=x(J,O.expression))[0],L=r[1]),6===w?e.isObjectLiteralExpression(J.right)&&J.right.properties.length>0&&(D(J,L),e.forEachChild(J.right,k),S()):e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,L):(D(J,L),T(t,J.right,I.name),S()),void b(M);case 7:case 9:var R=t,B=(L=7===w?R.arguments[0]:R.arguments[0].expression,R.arguments[1]),j=x(t,L);return M=j[0],D(t,j[1]),D(t,e.setTextRange(e.factory.createIdentifier(B.text),B)),k(t.arguments[2]),S(),S(),void b(M);case 5:var J,z=(I=(J=t).left).expression;if(e.isIdentifier(z)&&"prototype"!==e.getElementOrPropertyAccessName(I)&&s&&s.has(z.text))return void(e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,z):e.isBindableStaticAccessExpression(I)&&(D(J,z),T(J.left,J.right,e.getNameOrArgument(I)),S()));break;case 4:case 0:case 8:break;default:e.Debug.assertNever(w);}default:e.hasJSDocNodes(t)&&e.forEach(t.jsDoc,(function(t){e.forEach(t.tags,(function(t){e.isJSDocTypeAlias(t)&&y(t);}));})),e.forEachChild(t,k);}}function N(t,r){var n=new e.Map;e.filterMutate(t,(function(t,i){var a=t.name||e.getNameOfDeclaration(t.node),o=a&&p(a);if(!o)return !0;var s=n.get(o);if(!s)return n.set(o,t),!0;if(s instanceof Array){for(var c=0,l=s;c<l.length;c++){var u;if(F(u=l[c],t,i,r))return !1}return s.push(t),!0}return !F(u=s,t,i,r)&&(n.set(o,[u,t]),!0)}));}t.getNavigationBarItems=function(t,r){n=r,a=t;try{return e.map((i=m(t),o=[],function e(t){if(function(e){if(e.children)return !0;switch(f(e)){case 260:case 228:case 263:case 261:case 264:case 308:case 262:case 348:case 341:return !0;case 216:case 259:case 215:return t(e);default:return !1}function t(e){if(!e.node.body)return !1;switch(f(e.parent)){case 265:case 308:case 171:case 173:return !0;default:return !1}}}(t)&&(o.push(t),t.children))for(var r=0,n=t.children;r<n.length;r++)e(n[r]);}(i),o),j)}finally{d();}var i,o;},t.getNavigationTree=function(e,t){n=t,a=e;try{return B(m(e))}finally{d();}};var A=((r={})[5]=!0,r[3]=!0,r[7]=!0,r[9]=!0,r[0]=!1,r[1]=!1,r[2]=!1,r[8]=!1,r[6]=!0,r[4]=!1,r);function F(t,r,n,a){return !!function(t,r,n,a){function o(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isVariableDeclaration(t)}var s=e.isBinaryExpression(r.node)||e.isCallExpression(r.node)?e.getAssignmentDeclarationKind(r.node):0,c=e.isBinaryExpression(t.node)||e.isCallExpression(t.node)?e.getAssignmentDeclarationKind(t.node):0;if(A[s]&&A[c]||o(t.node)&&A[s]||o(r.node)&&A[c]||e.isClassDeclaration(t.node)&&P(t.node)&&A[s]||e.isClassDeclaration(r.node)&&A[c]||e.isClassDeclaration(t.node)&&P(t.node)&&o(r.node)||e.isClassDeclaration(r.node)&&o(t.node)&&P(t.node)){var l=t.additionalNodes&&e.lastOrUndefined(t.additionalNodes)||t.node;if(!e.isClassDeclaration(t.node)&&!e.isClassDeclaration(r.node)||o(t.node)||o(r.node)){var u=o(t.node)?t.node:o(r.node)?r.node:void 0;if(void 0!==u){var _=v(e.setTextRange(e.factory.createConstructorDeclaration(void 0,[],void 0),u));_.indent=t.indent+1,_.children=t.node===u?t.children:r.children,t.children=t.node===u?e.concatenate([_],r.children||[r]):e.concatenate(t.children||[i$1({},t)],[_]);}else (t.children||r.children)&&(t.children=e.concatenate(t.children||[i$1({},t)],r.children||[r]),t.children&&(N(t.children,t),O(t.children)));l=t.node=e.setTextRange(e.factory.createClassDeclaration(void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),t.node);}else t.children=e.concatenate(t.children,r.children),t.children&&N(t.children,t);var d=r.node;return a.children[n-1].node.end===l.end?e.setTextRange(l,{pos:l.pos,end:d.end}):(t.additionalNodes||(t.additionalNodes=[]),t.additionalNodes.push(e.setTextRange(e.factory.createClassDeclaration(void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),r.node))),!0}return 0!==s}(t,r,n,a)||!!function(t,r,n){if(t.kind!==r.kind||t.parent!==r.parent&&(!w(t,n)||!w(r,n)))return !1;switch(t.kind){case 169:case 171:case 174:case 175:return e.isStatic(t)===e.isStatic(r);case 264:return I(t,r)&&U(t)===U(r);default:return !0}}(t.node,r.node,a)&&(function(t,r){var n;t.additionalNodes=t.additionalNodes||[],t.additionalNodes.push(r.node),r.additionalNodes&&(n=t.additionalNodes).push.apply(n,r.additionalNodes),t.children=e.concatenate(t.children,r.children),t.children&&(N(t.children,t),O(t.children));}(t,r),!0)}function P(e){return !!(8&e.flags)}function w(t,r){var n=e.isModuleBlock(t.parent)?t.parent.parent:t.parent;return n===r.node||e.contains(r.additionalNodes,n)}function I(e,t){return e.body&&t.body?e.body.kind===t.body.kind&&(264!==e.body.kind||I(e.body,t.body)):e.body===t.body}function O(e){e.sort(M);}function M(t,r){return e.compareStringsCaseSensitiveUI(L(t.node),L(r.node))||e.compareValues(f(t),f(r))}function L(t){if(264===t.kind)return z(t);var r=e.getNameOfDeclaration(t);if(r&&e.isPropertyName(r)){var n=e.getPropertyNameForPropertyNameNode(r);return n&&e.unescapeLeadingUnderscores(n)}switch(t.kind){case 215:case 216:case 228:return H(t);default:return}}function R(t,r){if(264===t.kind)return Q(z(t));if(r){var n=e.isIdentifier(r)?r.text:e.isElementAccessExpression(r)?"[".concat(p(r.argumentExpression),"]"):p(r);if(n.length>0)return Q(n)}switch(t.kind){case 308:var i=t;return e.isExternalModule(i)?'"'.concat(e.escapeString(e.getBaseFileName(e.removeFileExtension(e.normalizePath(i.fileName)))),'"'):"<global>";case 274:return e.isExportAssignment(t)&&t.isExportEquals?"export=":"default";case 216:case 259:case 215:case 260:case 228:return 1024&e.getSyntacticModifierFlags(t)?"default":H(t);case 173:return "constructor";case 177:return "new()";case 176:return "()";case 178:return "[]";default:return "<unknown>"}}function B(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),nameSpan:t.name&&q(t.name),childItems:e.map(t.children,B)}}function j(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),childItems:e.map(t.children,(function(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:e.getNodeModifiers(t.node),spans:J(t),childItems:_,indent:0,bolded:!1,grayed:!1}}))||_,indent:t.indent,bolded:!1,grayed:!1}}function J(e){var t=[q(e.node)];if(e.additionalNodes)for(var r=0,n=e.additionalNodes;r<n.length;r++){var i=n[r];t.push(q(i));}return t}function z(t){return e.isAmbientModule(t)?e.getTextOfNode(t.name):U(t)}function U(t){for(var r=[e.getTextOfIdentifierOrLiteral(t.name)];t.body&&264===t.body.kind;)t=t.body,r.push(e.getTextOfIdentifierOrLiteral(t.name));return r.join(".")}function K(t){return t.body&&e.isModuleDeclaration(t.body)?K(t.body):t}function V(e){return !e.name||164===e.name.kind}function q(t){return 308===t.kind?e.createTextSpanFromRange(t):e.createTextSpanFromNode(t,a)}function W(t){return t.parent&&257===t.parent.kind&&(t=t.parent),e.getNodeModifiers(t)}function H(t){var r=t.parent;if(t.name&&e.getFullWidth(t.name)>0)return Q(e.declarationNameToString(t.name));if(e.isVariableDeclaration(r))return Q(e.declarationNameToString(r.name));if(e.isBinaryExpression(r)&&63===r.operatorToken.kind)return p(r.left).replace(c,"");if(e.isPropertyAssignment(r))return p(r.name);if(1024&e.getSyntacticModifierFlags(t))return "default";if(e.isClassLike(t))return "<class>";if(e.isCallExpression(r)){var n=G(r.expression);if(void 0!==n){if((n=Q(n)).length>150)return "".concat(n," callback");var i=Q(e.mapDefined(r.arguments,(function(t){return e.isStringLiteralLike(t)?t.getText(a):void 0})).join(", "));return "".concat(n,"(").concat(i,") callback")}}return "<function>"}function G(t){if(e.isIdentifier(t))return t.text;if(e.isPropertyAccessExpression(t)){var r=G(t.expression),n=t.name.text;return void 0===r?n:"".concat(r,".").concat(n)}}function Q(e){return (e=e.length>150?e.substring(0,150)+"...":e).replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}}(e.NavigationBar||(e.NavigationBar={}));}(t),function(e){!function(t){function r(t,r){for(var i=e.createScanner(t.languageVersion,!1,t.languageVariant),a=[],o=0,s=0,c=r;s<c.length;s++){var l=c[s];n(t,l,i)&&o++,a[o]||(a[o]=[]),a[o].push(l);}return a}function n(e,t,r){var n=t.getFullStart(),i=t.getStart();r.setText(e.text,n,i-n);for(var a=0;r.getTokenPos()<i;)if(4===r.scan()&&++a>=2)return !0;return !1}function i(t,r,n){for(var i=n.getTypeChecker(),o=n.getCompilerOptions(),s=i.getJsxNamespace(r),c=i.getJsxFragmentFactory(r),u=!!(2&r.transformFlags),_=[],d=0,p=t;d<p.length;d++){var f=p[d],g=f.importClause,m=f.moduleSpecifier;if(g){var y=g.name,v=g.namedBindings;if(y&&!b(y)&&(y=void 0),v)if(e.isNamespaceImport(v))b(v.name)||(v=void 0);else {var h=v.elements.filter((function(e){return b(e.name)}));h.length<v.elements.length&&(v=h.length?e.factory.updateNamedImports(v,h):void 0);}y||v?_.push(l(f,y,v)):a(r,m)&&(r.isDeclarationFile?_.push(e.factory.createImportDeclaration(f.modifiers,void 0,m,void 0)):_.push(f));}else _.push(f);}return _;function b(t){return u&&(t.text===s||c&&t.text===c)&&e.jsxModeNeedsExplicitImport(o.jsx)||e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,r)}}function a(t,r){var n=e.isStringLiteral(r)&&r.text;return e.isString(n)&&e.some(t.moduleAugmentations,(function(t){return e.isStringLiteral(t)&&t.text===n}))}function o(t){return void 0!==t&&e.isStringLiteralLike(t)?t.text:void 0}function s(t){var r;if(0===t.length)return t;var n=function(t){for(var r,n={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]},a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s.importClause){var c=s.importClause.isTypeOnly?n:i,l=s.importClause,u=l.name,_=l.namedBindings;u&&c.defaultImports.push(s),_&&(e.isNamespaceImport(_)?c.namespaceImports.push(s):c.namedImports.push(s));}else r=r||s;}return {importWithoutClause:r,typeOnlyImports:n,regularImports:i}}(t),i=n.importWithoutClause,a=n.typeOnlyImports,o=n.regularImports,s=[];i&&s.push(i);for(var c=0,_=[o,a];c<_.length;c++){var d=_[c],f=d===a,g=d.defaultImports,m=d.namespaceImports,v=d.namedImports;if(f||1!==g.length||1!==m.length||0!==v.length){for(var h=0,b=e.stableSort(m,(function(e,t){return p(e.importClause.namedBindings.name,t.importClause.namedBindings.name)}));h<b.length;h++){var x=b[h];s.push(l(x,void 0,x.importClause.namedBindings));}if(0!==g.length||0!==v.length){var D=void 0,S=[];if(1===g.length)D=g[0].importClause.name;else for(var T=0,C=g;T<C.length;T++)A=C[T],S.push(e.factory.createImportSpecifier(!1,e.factory.createIdentifier("default"),A.importClause.name));S.push.apply(S,y(v));var E=u(S),k=g.length>0?g[0]:v[0],N=0===E.length?D?void 0:e.factory.createNamedImports(e.emptyArray):0===v.length?e.factory.createNamedImports(E):e.factory.updateNamedImports(v[0].importClause.namedBindings,E);f&&D&&N?(s.push(l(k,D,void 0)),s.push(l(null!==(r=v[0])&&void 0!==r?r:k,void 0,N))):s.push(l(k,D,N));}}else {var A=g[0];s.push(l(A,A.importClause.name,m[0].importClause.namedBindings));}}return s}function c(t){if(0===t.length)return t;var r=function(e){for(var t,r=[],n=[],i=0,a=e;i<a.length;i++){var o=a[i];void 0===o.exportClause?t=t||o:o.isTypeOnly?n.push(o):r.push(o);}return {exportWithoutClause:t,namedExports:r,typeOnlyExports:n}}(t),n=r.exportWithoutClause,i=r.namedExports,a=r.typeOnlyExports,o=[];n&&o.push(n);for(var s=0,c=[i,a];s<c.length;s++){var l=c[s];if(0!==l.length){var _=[];_.push.apply(_,e.flatMap(l,(function(t){return t.exportClause&&e.isNamedExports(t.exportClause)?t.exportClause.elements:e.emptyArray})));var d=u(_),p=l[0];o.push(e.factory.updateExportDeclaration(p,p.modifiers,p.isTypeOnly,p.exportClause&&(e.isNamedExports(p.exportClause)?e.factory.updateNamedExports(p.exportClause,d):e.factory.updateNamespaceExport(p.exportClause,p.exportClause.name)),p.moduleSpecifier,p.assertClause));}}return o}function l(t,r,n){return e.factory.updateImportDeclaration(t,t.modifiers,e.factory.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),t.moduleSpecifier,t.assertClause)}function u(t){return e.stableSort(t,_)}function _(t,r){return e.compareBooleans(t.isTypeOnly,r.isTypeOnly)||p(t.propertyName||t.name,r.propertyName||r.name)||p(t.name,r.name)}function d(t,r){var n=void 0===t?void 0:o(t),i=void 0===r?void 0:o(r);return e.compareBooleans(void 0===n,void 0===i)||e.compareBooleans(e.isExternalModuleNameRelative(n),e.isExternalModuleNameRelative(i))||e.compareStringsCaseInsensitive(n,i)}function p(t,r){return e.compareStringsCaseInsensitive(t.text,r.text)}function f(t){var r;switch(t.kind){case 268:return null===(r=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===r?void 0:r.expression;case 269:return t.moduleSpecifier;case 240:return t.declarationList.declarations[0].initializer.arguments[0]}}function g(t,r){return d(f(t),f(r))||function(t,r){return e.compareValues(m(t),m(r))}(t,r)}function m(e){var t;switch(e.kind){case 269:return e.importClause?e.importClause.isTypeOnly?1:271===(null===(t=e.importClause.namedBindings)||void 0===t?void 0:t.kind)?2:e.importClause.name?3:4:0;case 268:return 5;case 240:return 6}}function y(t){return e.flatMap(t,(function(t){return e.map(function(t){var r;return (null===(r=t.importClause)||void 0===r?void 0:r.namedBindings)&&e.isNamedImports(t.importClause.namedBindings)?t.importClause.namedBindings.elements:void 0}(t),(function(t){return t.name&&t.propertyName&&t.name.escapedText===t.propertyName.escapedText?e.factory.updateImportSpecifier(t,t.isTypeOnly,void 0,t.name):t}))}))}t.organizeImports=function(t,n,a,l,u,_){var p=e.textChanges.ChangeTracker.fromContext({host:a,formatContext:n,preferences:u}),f="SortAndCombine"===_||"All"===_,m=f,y="RemoveUnused"===_||"All"===_?i:e.identity,v=m?s:e.identity,h=function(r){var n=v(y(r,t,l));return f?e.stableSort(n,(function(e,t){return g(e,t)})):n};r(t,t.statements.filter(e.isImportDeclaration)).forEach((function(e){return S(e,h)})),"RemoveUnused"!==_&&S(t.statements.filter(e.isExportDeclaration),c);for(var b=0,x=t.statements.filter(e.isAmbientModule);b<x.length;b++){var D=x[b];D.body&&(r(t,D.body.statements.filter(e.isImportDeclaration)).forEach((function(e){return S(e,h)})),"RemoveUnused"!==_&&S(D.body.statements.filter(e.isExportDeclaration),c));}return p.getChanges();function S(r,i){if(0!==e.length(r)){e.suppressLeadingTrivia(r[0]);var s=m?e.group(r,(function(e){return o(e.moduleSpecifier)})):[r],c=f?e.stableSort(s,(function(e,t){return d(e[0].moduleSpecifier,t[0].moduleSpecifier)})):s,l=e.flatMap(c,(function(e){return o(e[0].moduleSpecifier)?i(e):e}));if(0===l.length)p.deleteNodes(t,r,{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},!0);else {var u={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include,suffix:e.getNewLineOrDefaultFromHost(a,n.options)};p.replaceNodeWithNodes(t,r[0],l,u);var _=p.nodeHasTrailingComment(t,r[0],u);p.deleteNodes(t,r.slice(1),{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},_);}}}},t.coalesceImports=s,t.coalesceExports=c,t.compareImportOrExportSpecifiers=_,t.compareModuleSpecifiers=d,t.importsAreSorted=function(t){return e.arrayIsSorted(t,g)},t.importSpecifiersAreSorted=function(t){return e.arrayIsSorted(t,_)},t.getImportDeclarationInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,g);return n<0?~n:n},t.getImportSpecifierInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,_);return n<0?~n:n},t.compareImportsOrRequireStatements=g;}(e.OrganizeImports||(e.OrganizeImports={}));}(t),function(e){!function(t){t.collectElements=function(t,r){var u=[];return function(t,r,i){for(var u=40,_=0,d=n$4(n$4([],t.statements,!0),[t.endOfFileToken],!1),p=d.length;_<p;){for(;_<p&&!e.isAnyImportSyntax(d[_]);)m(d[_]),_++;if(_===p)break;for(var f=_;_<p&&e.isAnyImportSyntax(d[_]);)o(d[_],t,r,i),_++;var g=_-1;g!==f&&i.push(s(e.findChildOfKind(d[f],100,t).getStart(t),d[g].getEnd(),"imports"));}function m(n){var _;if(0!==u){r.throwIfCancellationRequested(),(e.isDeclaration(n)||e.isVariableStatement(n)||e.isReturnStatement(n)||e.isCallOrNewExpression(n)||1===n.kind)&&o(n,t,r,i),e.isFunctionLike(n)&&e.isBinaryExpression(n.parent)&&e.isPropertyAccessExpression(n.parent.left)&&o(n.parent.left,t,r,i),(e.isBlock(n)||e.isModuleBlock(n))&&a(n.statements.end,t,r,i),(e.isClassLike(n)||e.isInterfaceDeclaration(n))&&a(n.members.end,t,r,i);var d=function(t,r){switch(t.kind){case 238:if(e.isFunctionLike(t.parent))return function(t,r,n){var i=function(t,r,n){if(e.isNodeArrayMultiLine(t.parameters,n)){var i=e.findChildOfKind(t,20,n);if(i)return i}return e.findChildOfKind(r,18,n)}(t,r,n),a=e.findChildOfKind(r,19,n);return i&&a&&c(i,a,t,n,216!==t.kind)}(t.parent,t,r);switch(t.parent.kind){case 243:case 246:case 247:case 245:case 242:case 244:case 251:case 295:return u(t.parent);case 255:var n=t.parent;if(n.tryBlock===t)return u(t.parent);if(n.finallyBlock===t){var i=e.findChildOfKind(n,96,r);if(i)return u(i)}default:return l(e.createTextSpanFromNode(t,r),"code")}case 265:return u(t.parent);case 260:case 228:case 261:case 263:case 266:case 184:case 203:return u(t);case 186:return u(t,!1,!e.isTupleTypeNode(t.parent),22);case 292:case 293:return (a=t.statements).length?l(e.createTextSpanFromRange(a),"code"):void 0;case 207:return o(t);case 206:return o(t,22);case 281:return function(t){var n=e.createTextSpanFromBounds(t.openingElement.getStart(r),t.closingElement.getEnd()),i=t.openingElement.tagName.getText(r);return l(n,"code",n,!1,"<"+i+">...</"+i+">")}(t);case 285:return function(t){var n=e.createTextSpanFromBounds(t.openingFragment.getStart(r),t.closingFragment.getEnd());return l(n,"code",n,!1,"<>...</>")}(t);case 282:case 283:return function(e){if(0!==e.properties.length)return s(e.getStart(r),e.getEnd(),"code")}(t.attributes);case 225:case 14:return function(e){if(14!==e.kind||0!==e.text.length)return s(e.getStart(r),e.getEnd(),"code")}(t);case 204:return u(t,!1,!e.isBindingElement(t.parent),22);case 216:return function(t){if(!(e.isBlock(t.body)||e.isParenthesizedExpression(t.body)||e.positionsAreOnSameLine(t.body.getFullStart(),t.body.getEnd(),r)))return l(e.createTextSpanFromBounds(t.body.getFullStart(),t.body.getEnd()),"code",e.createTextSpanFromNode(t))}(t);case 210:return function(t){if(t.arguments.length){var n=e.findChildOfKind(t,20,r),i=e.findChildOfKind(t,21,r);if(n&&i&&!e.positionsAreOnSameLine(n.pos,i.pos,r))return c(n,i,t,r,!1,!0)}}(t);case 214:return function(t){if(!e.positionsAreOnSameLine(t.getStart(),t.getEnd(),r))return l(e.createTextSpanFromBounds(t.getStart(),t.getEnd()),"code",e.createTextSpanFromNode(t))}(t)}var a;function o(t,r){return void 0===r&&(r=18),u(t,!1,!e.isArrayLiteralExpression(t.parent)&&!e.isCallExpression(t.parent),r)}function u(n,i,a,o,s){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=18),void 0===s&&(s=18===o?19:23);var l=e.findChildOfKind(t,o,r),u=e.findChildOfKind(t,s,r);return l&&u&&c(l,u,n,r,i,a)}}(n,t);d&&i.push(d),u--,e.isCallExpression(n)?(u++,m(n.expression),u--,n.arguments.forEach(m),null===(_=n.typeArguments)||void 0===_||_.forEach(m)):e.isIfStatement(n)&&n.elseStatement&&e.isIfStatement(n.elseStatement)?(m(n.expression),m(n.thenStatement),u++,m(n.elseStatement),u--):n.forEachChild(m),u++;}}}(t,r,u),function(t,r){for(var n=[],a=0,o=t.getLineStarts();a<o.length;a++){var s=o[a],c=t.getLineEndOfPosition(s),u=i(t.text.substring(s,c));if(u&&!e.isInComment(t,s))if(u[1]){var _=n.pop();_&&(_.textSpan.length=c-_.textSpan.start,_.hintSpan.length=c-_.textSpan.start,r.push(_));}else {var d=e.createTextSpanFromBounds(t.text.indexOf("//",s),c);n.push(l(d,"region",d,!1,u[2]||"#region"));}}}(t,u),u.sort((function(e,t){return e.textSpan.start-t.textSpan.start}))};var r=/^#(end)?region(?:\s+(.*))?(?:\r)?$/;function i(t){return t=e.trimStringStart(t),e.startsWith(t,"//")?(t=e.trimString(t.slice(2)),r.exec(t)):null}function a(t,r,n,a){var o=e.getLeadingCommentRanges(r.text,t);if(o){for(var c=-1,l=-1,u=0,_=r.getFullText(),d=0,p=o;d<p.length;d++){var f=p[d],g=f.kind,m=f.pos,y=f.end;switch(n.throwIfCancellationRequested(),g){case 2:if(i(_.slice(m,y))){v(),u=0;break}0===u&&(c=m),l=y,u++;break;case 3:v(),a.push(s(m,y,"comment")),u=0;break;default:e.Debug.assertNever(g);}}v();}function v(){u>1&&a.push(s(c,l,"comment"));}}function o(t,r,n,i){e.isJsxText(t)||a(t.pos,r,n,i);}function s(t,r,n){return l(e.createTextSpanFromBounds(t,r),n)}function c(t,r,n,i,a,o){return void 0===a&&(a=!1),void 0===o&&(o=!0),l(e.createTextSpanFromBounds(o?t.getFullStart():t.getStart(i),r.getEnd()),"code",e.createTextSpanFromNode(n,i),a)}function l(e,t,r,n,i){return void 0===r&&(r=e),void 0===n&&(n=!1),void 0===i&&(i="..."),{textSpan:e,kind:t,hintSpan:r,bannerText:i,autoCollapse:n}}}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}));}(t),function(e){var t;function r(e,t){return {kind:e,isCaseSensitive:t}}function n(e,t){var r=t.get(e);return r||t.set(e,r=y(e)),r}function i(i,a,o){var s=function(e,t){for(var r=e.length-t.length,n=function(r){if(T(t,(function(t,n){return d(e.charCodeAt(n+r))===t})))return {value:r}},i=0;i<=r;i++){var a=n(i);if("object"==typeof a)return a.value}return -1}(i,a.textLowerCase);if(0===s)return r(a.text.length===i.length?t.exact:t.prefix,e.startsWith(i,a.text));if(a.isLowerCase){if(-1===s)return;for(var _=0,p=n(i,o);_<p.length;_++){var f=p[_];if(c(i,f,a.text,!0))return r(t.substring,c(i,f,a.text,!1))}if(a.text.length<i.length&&u(i.charCodeAt(s)))return r(t.substring,!1)}else {if(i.indexOf(a.text)>0)return r(t.substring,!0);if(a.characterSpans.length>0){var g=n(i,o),m=!!l(i,g,a,!1)||!l(i,g,a,!0)&&void 0;if(void 0!==m)return r(t.camelCase,m)}}}function a(e,t,r){if(T(t.totalTextChunk.text,(function(e){return 32!==e&&42!==e}))){var n=i(e,t.totalTextChunk,r);if(n)return n}for(var a,s=0,c=t.subWordTextChunks;s<c.length;s++)a=o(a,i(e,c[s],r));return a}function o(t,r){return e.min([t,r],s)}function s(t,r){return void 0===t?1:void 0===r?-1:e.compareValues(t.kind,r.kind)||e.compareBooleans(!t.isCaseSensitive,!r.isCaseSensitive)}function c(e,t,r,n,i){return void 0===i&&(i={start:0,length:r.length}),i.length<=t.length&&S(0,i.length,(function(a){return function(e,t,r){return r?d(e)===d(t):e===t}(r.charCodeAt(i.start+a),e.charCodeAt(t.start+a),n)}))}function l(t,r,n,i){for(var s=n.characterSpans,l=0,_=0;;){if(_===s.length)return !0;if(l===r.length)return !1;for(var d=r[l],p=!1;_<s.length;_++){var f=s[_];if(p&&(!u(n.text.charCodeAt(s[_-1].start))||!u(n.text.charCodeAt(s[_].start))))break;if(!c(t,d,n.text,i,f))break;p=!0,d=e.createTextSpan(d.start+f.length,d.length-f.length);}l++;}}function u(t){if(t>=65&&t<=90)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toUpperCase()}function _(t){if(t>=97&&t<=122)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toLowerCase()}function d(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){for(var t=[],r=0,n=0,i=0;i<e.length;i++)u(a=e.charCodeAt(i))||_(a)||p(a)||95===a||36===a?(0===n&&(r=i),n++):n>0&&(t.push(g(e.substr(r,n))),n=0);var a;return n>0&&t.push(g(e.substr(r,n))),t}function g(e){var t=e.toLowerCase();return {text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:m(e)}}function m(e){return v(e,!1)}function y(e){return v(e,!0)}function v(t,r){for(var n=[],i=0,a=1;a<t.length;a++){var o=p(t.charCodeAt(a-1)),s=p(t.charCodeAt(a)),c=D(t,r,a),l=r&&x(t,a,i);(h(t.charCodeAt(a-1))||h(t.charCodeAt(a))||o!==s||c||l)&&(b(t,i,a)||n.push(e.createTextSpan(i,a-i)),i=a);}return b(t,i,t.length)||n.push(e.createTextSpan(i,t.length-i)),n}function h(e){switch(e){case 33:case 34:case 35:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 45:case 46:case 47:case 58:case 59:case 63:case 64:case 91:case 92:case 93:case 95:case 123:case 125:return !0}return !1}function b(e,t,r){return T(e,(function(e){return h(e)&&95!==e}),t,r)}function x(e,t,r){return t!==r&&t+1<e.length&&u(e.charCodeAt(t))&&_(e.charCodeAt(t+1))&&T(e,u,r,t)}function D(e,t,r){var n=u(e.charCodeAt(r-1));return u(e.charCodeAt(r))&&(!t||!n)}function S(e,t,r){for(var n=e;n<t;n++)if(!r(n))return !1;return !0}function T(e,t,r,n){return void 0===r&&(r=0),void 0===n&&(n=e.length),S(r,n,(function(r){return t(e.charCodeAt(r),r)}))}!function(e){e[e.exact=0]="exact",e[e.prefix=1]="prefix",e[e.substring=2]="substring",e[e.camelCase=3]="camelCase";}(t=e.PatternMatchKind||(e.PatternMatchKind={})),e.createPatternMatcher=function(t){var r=new e.Map,n=t.trim().split(".").map((function(e){return {totalTextChunk:g(t=e.trim()),subWordTextChunks:f(t)};var t;}));if(!n.some((function(e){return !e.subWordTextChunks.length})))return {getFullMatch:function(t,i){return function(t,r,n,i){var s;if(a(r,e.last(n),i)&&!(n.length-1>t.length)){for(var c=n.length-2,l=t.length-1;c>=0;c-=1,l-=1)s=o(s,a(t[l],n[c],i));return s}}(t,i,n,r)},getMatchForLastSegmentOfPattern:function(t){return a(t,e.last(n),r)},patternContainsDots:n.length>1}},e.breakIntoCharacterSpans=m,e.breakIntoWordSpans=y;}(t),function(e){e.preProcessFile=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i,a,o,s={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},c=[],l=0,u=!1;function _(){return a=o,18===(o=e.scanner.scan())?l++:19===o&&l--,o}function d(){var t=e.scanner.getTokenValue(),r=e.scanner.getTokenPos();return {fileName:t,pos:r,end:r+t.length}}function p(){c.push(d()),f();}function f(){0===l&&(u=!0);}function g(){var t=e.scanner.getToken();return 136===t&&(142===(t=_())&&10===(t=_())&&(i||(i=[]),i.push({ref:d(),depth:l})),!0)}function m(){if(24===a)return !1;var t=e.scanner.getToken();if(100===t){if(20===(t=_())){if(10===(t=_())||14===t)return p(),!0}else {if(10===t)return p(),!0;if(154===t){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 158!==t&&(41===t||18===t||79===t||e.isKeyword(t))}));r&&(t=_());}if(79===t||e.isKeyword(t))if(158===(t=_())){if(10===(t=_()))return p(),!0}else if(63===t){if(v(!0))return !0}else {if(27!==t)return !0;t=_();}if(18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&158===(t=_())&&10===(t=_())&&p();}else 41===t&&128===(t=_())&&(79===(t=_())||e.isKeyword(t))&&158===(t=_())&&10===(t=_())&&p();}return !0}return !1}function y(){var t=e.scanner.getToken();if(93===t){if(f(),154===(t=_())){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 41===t||18===t}));r&&(t=_());}if(18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&158===(t=_())&&10===(t=_())&&p();}else if(41===t)158===(t=_())&&10===(t=_())&&p();else if(100===t&&(154===(t=_())&&(r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 79===t||e.isKeyword(t)})),r&&(t=_())),(79===t||e.isKeyword(t))&&63===(t=_())&&v(!0)))return !0;return !0}return !1}function v(t,r){void 0===r&&(r=!1);var n=t?_():e.scanner.getToken();return 147===n&&(20===(n=_())&&(10===(n=_())||r&&14===n)&&p(),!0)}function h(){var t=e.scanner.getToken();if(79===t&&"define"===e.scanner.getTokenValue()){if(20!==(t=_()))return !0;if(10===(t=_())||14===t){if(27!==(t=_()))return !0;t=_();}if(22!==t)return !0;for(t=_();23!==t&&1!==t;)10!==t&&14!==t||p(),t=_();return !0}return !1}if(r&&function(){for(e.scanner.setText(t),_();1!==e.scanner.getToken();){if(15===e.scanner.getToken()){var r=[e.scanner.getToken()];e:for(;e.length(r);){var i=e.scanner.scan();switch(i){case 1:break e;case 100:m();break;case 15:r.push(i);break;case 18:e.length(r)&&r.push(i);break;case 19:e.length(r)&&(15===e.lastOrUndefined(r)?17===e.scanner.reScanTemplateToken(!1)&&r.pop():r.pop());}}_();}g()||m()||y()||n&&(v(!1,!0)||h())||_();}e.scanner.setText(void 0);}(),e.processCommentPragmas(s,t),e.processPragmasIntoFields(s,e.noop),u){if(i)for(var b=0,x=i;b<x.length;b++){var D=x[b];c.push(D.ref);}return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:void 0}}var S=void 0;if(i)for(var T=0,C=i;T<C.length;T++)0===(D=C[T]).depth?(S||(S=[]),S.push(D.ref.fileName)):c.push(D.ref);return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:S}};}(t),function(e){!function(t){function r(t){var r=e.getPathComponents(t),n=r.lastIndexOf("node_modules");if(-1!==n)return r.slice(0,n+2)}function n(e,t,r,n,i,o){return {canRename:!0,fileToRename:void 0,kind:r,displayName:e,fullDisplayName:t,kindModifiers:n,triggerSpan:a(i,o)}}function i(t){return {canRename:!1,localizedErrorMessage:e.getLocaleSpecificMessage(t)}}function a(t,r){var n=t.getStart(r),i=t.getWidth(r);return e.isStringLiteralLike(t)&&(n+=1,i-=2),e.createTextSpan(n,i)}function o(t){switch(t.kind){case 79:case 80:case 10:case 14:case 108:return !0;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t);default:return !1}}t.getRenameInfo=function(t,a,s,c){var l=e.getAdjustedRenameLocation(e.getTouchingPropertyName(a,s));if(o(l)){var u=function(t,a,o,s,c){var l=a.getSymbolAtLocation(t);if(l){var u=l.declarations;if(u&&0!==u.length){if(u.some((function(t){return function(t,r){var n=r.getSourceFile();return t.isSourceFileDefaultLibrary(n)&&e.fileExtensionIs(n.fileName,".d.ts")}(s,t)})))return i(e.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);if(!(e.isIdentifier(t)&&88===t.originalKeywordKind&&l.parent&&1536&l.parent.flags)){if(e.isStringLiteralLike(t)&&e.tryGetImportFromModuleSpecifier(t))return c.allowRenameOfImportPath?function(t,r,n){if(!e.isExternalModuleNameRelative(t.text))return i(e.Diagnostics.You_cannot_rename_a_module_via_a_global_import);var a=n.declarations&&e.find(n.declarations,e.isSourceFile);if(a){var o=e.endsWith(t.text,"/index")||e.endsWith(t.text,"/index.js")?void 0:e.tryRemoveSuffix(e.removeFileExtension(a.fileName),"/index"),s=void 0===o?a.fileName:o,c=void 0===o?"module":"directory",l=t.text.lastIndexOf("/")+1;return {canRename:!0,fileToRename:s,kind:c,displayName:s,fullDisplayName:s,kindModifiers:"",triggerSpan:e.createTextSpan(t.getStart(r)+1+l,t.text.length-l)}}}(t,o,l):void 0;var _=function(t,n,i,a){if(!a.providePrefixAndSuffixTextForRename&&2097152&n.flags){var o=n.declarations&&e.find(n.declarations,(function(t){return e.isImportSpecifier(t)}));o&&!o.propertyName&&(n=i.getAliasedSymbol(n));}var s=n.declarations;if(s){var c=r(t.path);if(void 0===c)return e.some(s,(function(t){return e.isInsideNodeModules(t.getSourceFile().path)}))?e.Diagnostics.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:void 0;for(var l=0,u=s;l<u.length;l++){var _=r(u[l].getSourceFile().path);if(_)for(var d=Math.min(c.length,_.length),p=0;p<=d;p++)if(0!==e.compareStringsCaseSensitive(c[p],_[p]))return e.Diagnostics.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder}}}(o,l,a,c);if(_)return i(_);var d=e.SymbolDisplay.getSymbolKind(a,l,t),p=e.isImportOrExportSpecifierName(t)||e.isStringOrNumericLiteralLike(t)&&164===t.parent.kind?e.stripQuotes(e.getTextOfIdentifierOrLiteral(t)):void 0;return n(p||a.symbolToString(l),p||a.getFullyQualifiedName(l),d,e.SymbolDisplay.getSymbolModifiers(a,l),t,o)}}}else if(e.isStringLiteralLike(t)){var f=e.getContextualTypeFromParentOrAncestorTypeNode(t,a);if(f&&(128&f.flags||1048576&f.flags&&e.every(f.types,(function(e){return !!(128&e.flags)}))))return n(t.text,t.text,"string","",t,o)}else if(e.isLabelName(t)){var g=e.getTextOfNode(t);return n(g,g,"label","",t,o)}}(l,t.getTypeChecker(),a,t,c);if(u)return u}return i(e.Diagnostics.You_cannot_rename_this_element)},t.nodeIsEligibleForRename=o;}(e.Rename||(e.Rename={}));}(t),function(e){!function(t){function r(t,r,n){return e.Debug.assert(n.pos<=r),r<n.end||n.getEnd()===r&&e.getTouchingPropertyName(t,r).pos<n.end}t.getSmartSelectionRange=function(t,n){var o,s,c,_,d={textSpan:e.createTextSpanFromBounds(n.getFullStart(),n.getEnd())},p=n;e:for(;;){var f=a(p);if(!f.length)break;for(var g=0;g<f.length;g++){var m=f[g-1],y=f[g],v=f[g+1];if(e.getTokenPosOfNode(y,n,!0)>t)break e;var h=e.singleOrUndefined(e.getTrailingCommentRanges(n.text,y.end));if(h&&2===h.kind&&C(h.pos,h.end),r(n,t,y)){if(e.isFunctionBody(y)&&e.isFunctionLikeDeclaration(p)&&!e.positionsAreOnSameLine(y.getStart(n),y.getEnd(),n)&&T(y.getStart(n),y.getEnd()),e.isBlock(y)||e.isTemplateSpan(y)||e.isTemplateHead(y)||e.isTemplateTail(y)||m&&e.isTemplateHead(m)||e.isVariableDeclarationList(y)&&e.isVariableStatement(p)||e.isSyntaxList(y)&&e.isVariableDeclarationList(p)||e.isVariableDeclaration(y)&&e.isSyntaxList(p)&&1===f.length||e.isJSDocTypeExpression(y)||e.isJSDocSignature(y)||e.isJSDocTypeLiteral(y)){p=y;break}e.isTemplateSpan(p)&&v&&e.isTemplateMiddleOrTemplateTail(v)&&T(y.getFullStart()-"${".length,v.getStart()+"}".length);var b=e.isSyntaxList(y)&&(18===(_=(c=m)&&c.kind)||22===_||20===_||283===_)&&l(v)&&!e.positionsAreOnSameLine(m.getStart(),v.getStart(),n),x=b?m.getEnd():y.getStart(),D=b?v.getStart():u(n,y);if(e.hasJSDocNodes(y)&&(null===(o=y.jsDoc)||void 0===o?void 0:o.length)&&T(e.first(y.jsDoc).getStart(),D),e.isSyntaxList(y)){var S=y.getChildren()[0];S&&e.hasJSDocNodes(S)&&(null===(s=S.jsDoc)||void 0===s?void 0:s.length)&&S.getStart()!==y.pos&&(x=Math.min(x,e.first(S.jsDoc).getStart()));}T(x,D),(e.isStringLiteral(y)||e.isTemplateLiteral(y))&&T(x+1,D-1),p=y;break}if(g===f.length-1)break e}}return d;function T(r,n){if(r!==n){var a=e.createTextSpanFromBounds(r,n);(!d||!e.textSpansEqual(a,d.textSpan)&&e.textSpanIntersectsWithPosition(a,t))&&(d=i$1({textSpan:a},d&&{parent:d}));}}function C(e,t){T(e,t);for(var r=e;47===n.text.charCodeAt(r);)r++;T(r,t);}};var n=e.or(e.isImportDeclaration,e.isImportEqualsDeclaration);function a(t){var r;if(e.isSourceFile(t))return o(t.getChildAt(0).getChildren(),n);if(e.isMappedTypeNode(t)){var i=t.getChildren(),a=i[0],l=i.slice(1),u=e.Debug.checkDefined(l.pop());e.Debug.assertEqual(a.kind,18),e.Debug.assertEqual(u.kind,19);var _=o(l,(function(e){return e===t.readonlyToken||146===e.kind||e===t.questionToken||57===e.kind})),d=o(_,(function(e){var t=e.kind;return 22===t||165===t||23===t}));return [a,c(s(d,(function(e){return 58===e.kind}))),u]}if(e.isPropertySignature(t)){var p=323===(null===(r=(l=o(t.getChildren(),(function(r){return r===t.name||e.contains(t.modifiers,r)})))[0])||void 0===r?void 0:r.kind)?l[0]:void 0,f=s(p?l.slice(1):l,(function(e){return 58===e.kind}));return p?[p,c(f)]:f}if(e.isParameter(t)){var g=o(t.getChildren(),(function(e){return e===t.dotDotDotToken||e===t.name}));return s(o(g,(function(e){return e===g[0]||e===t.questionToken})),(function(e){return 63===e.kind}))}return e.isBindingElement(t)?s(t.getChildren(),(function(e){return 63===e.kind})):t.getChildren()}function o(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=a[i];t(o)?(r=r||[]).push(o):(r&&(n.push(c(r)),r=void 0),n.push(o));}return r&&n.push(c(r)),n}function s(t,r,n){if(void 0===n&&(n=!0),t.length<2)return t;var i=e.findIndex(t,r);if(-1===i)return t;var a=t.slice(0,i),o=t[i],s=e.last(t),l=n&&26===s.kind,u=t.slice(i+1,l?t.length-1:void 0),_=e.compact([a.length?c(a):void 0,o,u.length?c(u):void 0]);return l?_.concat(s):_}function c(t){return e.Debug.assertGreaterThanOrEqual(t.length,1),e.setTextRangePosEnd(e.parseNodeFactory.createSyntaxList(t),t[0].pos,e.last(t).end)}function l(e){var t=e&&e.kind;return 19===t||23===t||21===t||284===t}function u(e,t){switch(t.kind){case 343:case 341:case 350:case 348:case 345:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}}(e.SmartSelectionRange||(e.SmartSelectionRange={}));}(t),function(e){!function(t){var r,i;function a(t,r,n){for(var i=t.getFullStart(),a=t.parent;a;){var o=e.findPrecedingToken(i,r,a,!0);if(o)return e.rangeContainsRange(n,o);a=a.parent;}return e.Debug.fail("Could not find preceding token")}function o(t,r,n){var i=function(t,r){if(29===t.kind||20===t.kind)return {list:p(t.parent,t,r),argumentIndex:0};var n=e.findContainingList(t);return n&&{list:n,argumentIndex:u(n,t)}}(t,n);if(i){var a=i.list,o=i.argumentIndex,s=function(t,r){var n=t.getChildren(),i=e.countWhere(n,(function(e){return 27!==e.kind}));return !r&&n.length>0&&27===e.last(n).kind&&i++,i}(a,e.isInString(n,r,t));0!==o&&e.Debug.assertLessThan(o,s);var c=function(t,r){var n=t.getFullStart(),i=e.skipTrivia(r.text,t.getEnd(),!1);return e.createTextSpan(n,i-n)}(a,n);return {list:a,argumentIndex:o,argumentCount:s,argumentsSpan:c}}}function s(t,r,n){var i=t.parent;if(e.isCallOrNewExpression(i)){var a=i,s=o(t,r,n);if(!s)return;var c=s.list,l=s.argumentIndex,u=s.argumentCount,d=s.argumentsSpan;return {isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:a},argumentsSpan:d,argumentIndex:l,argumentCount:u}}if(e.isNoSubstitutionTemplateLiteral(t)&&e.isTaggedTemplateExpression(i))return e.isInsideTemplateLiteral(t,r,n)?_(i,0,n):void 0;if(e.isTemplateHead(t)&&212===i.parent.kind){var p=i,f=p.parent;return e.Debug.assert(225===p.kind),_(f,l=e.isInsideTemplateLiteral(t,r,n)?0:1,n)}if(e.isTemplateSpan(i)&&e.isTaggedTemplateExpression(i.parent.parent)){var g=i;if(f=i.parent.parent,e.isTemplateTail(t)&&!e.isInsideTemplateLiteral(t,r,n))return;return l=function(t,r,n,i){return e.Debug.assert(n>=r.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralToken(r)?e.isInsideTemplateLiteral(r,n,i)?0:t+2:t+1}(g.parent.templateSpans.indexOf(g),t,r,n),_(f,l,n)}if(e.isJsxOpeningLikeElement(i)){var m=i.attributes.pos,y=e.skipTrivia(n.text,i.attributes.end,!1);return {isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:e.createTextSpan(m,y-m),argumentIndex:0,argumentCount:1}}var v=e.getPossibleTypeArgumentsInfo(t,n);if(v){var h=v.called,b=v.nTypeArguments;return {isTypeParameterList:!0,invocation:a={kind:1,called:h},argumentsSpan:d=e.createTextSpanFromBounds(h.getStart(n),t.end),argumentIndex:b,argumentCount:b+1}}}function c(t){return e.isBinaryExpression(t.parent)?c(t.parent):t}function l(t){return e.isBinaryExpression(t.left)?l(t.left)+1:2}function u(e,t){for(var r=0,n=0,i=e.getChildren();n<i.length;n++){var a=i[n];if(a===t)break;27!==a.kind&&r++;}return r}function _(t,r,n){var i=e.isNoSubstitutionTemplateLiteral(t.template)?1:t.template.templateSpans.length+1;return 0!==r&&e.Debug.assertLessThan(r,i),{isTypeParameterList:!1,invocation:{kind:0,node:t},argumentsSpan:d(t,n),argumentIndex:r,argumentCount:i}}function d(t,r){var n=t.template,i=n.getStart(),a=n.getEnd();return 225===n.kind&&0===e.last(n.templateSpans).literal.getFullWidth()&&(a=e.skipTrivia(r.text,a,!1)),e.createTextSpan(i,a-i)}function p(t,r,n){var i=t.getChildren(n),a=i.indexOf(r);return e.Debug.assert(a>=0&&i.length>a+1),i[a+1]}function f(t){return 0===t.kind?e.getInvokedExpression(t.node):t.called}function g(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}!function(e){e[e.Call=0]="Call",e[e.TypeArgs=1]="TypeArgs",e[e.Contextual=2]="Contextual";}(r||(r={})),t.getSignatureHelpItems=function(t,r,n,i,u){var _=t.getTypeChecker(),d=e.findTokenOnLeftOfPosition(r,n);if(d){var p=!!i&&"characterTyped"===i.kind;if(!p||!e.isInString(r,n,d)&&!e.isInComment(r,n)){var m=!!i&&"invoked"===i.kind,h=function(t,r,n,i,a){for(var u=function(t){e.Debug.assert(e.rangeContainsRange(t.parent,t),"Not a subspan",(function(){return "Child: ".concat(e.Debug.formatSyntaxKind(t.kind),", parent: ").concat(e.Debug.formatSyntaxKind(t.parent.kind))}));var a=function(t,r,n,i){return function(t,r,n,i){var a=function(t,r,n,i){if(20===t.kind||27===t.kind){var a=t.parent;switch(a.kind){case 214:case 171:case 215:case 216:var s=o(t,n,r);if(!s)return;var u=s.argumentIndex,_=s.argumentCount,d=s.argumentsSpan,p=e.isMethodDeclaration(a)?i.getContextualTypeForObjectLiteralElement(a):i.getContextualType(a);return p&&{contextualType:p,argumentIndex:u,argumentCount:_,argumentsSpan:d};case 223:var f=c(a),g=i.getContextualType(f),m=20===t.kind?0:l(a)-1,y=l(f);return g&&{contextualType:g,argumentIndex:m,argumentCount:y,argumentsSpan:e.createTextSpanFromNode(a)};default:return}}}(t,n,r,i);if(a){var s=a.contextualType,u=a.argumentIndex,_=a.argumentCount,d=a.argumentsSpan,p=s.getNonNullableType(),f=p.symbol;if(void 0!==f){var g,m=e.lastOrUndefined(p.getCallSignatures());if(void 0!==m)return {isTypeParameterList:!1,invocation:{kind:2,signature:m,node:t,symbol:(g=f,"__type"===g.name&&e.firstDefined(g.declarations,(function(t){return e.isFunctionTypeNode(t)?t.parent.symbol:void 0}))||g)},argumentsSpan:d,argumentIndex:u,argumentCount:_}}}}(t,r,n,i)||s(t,r,n)}(t,r,n,i);if(a)return {value:a}},_=t;!e.isSourceFile(_)&&(a||!e.isBlock(_));_=_.parent){var d=u(_);if("object"==typeof d)return d.value}}(d,n,r,_,m);if(h){u.throwIfCancellationRequested();var b=function(t,r,n,i,o){var s=t.invocation,c=t.argumentCount;switch(s.kind){case 0:if(o&&!function(t,r,n){if(!e.isCallOrNewExpression(r))return !1;var i=r.getChildren(n);switch(t.kind){case 20:return e.contains(i,t);case 27:var o=e.findContainingList(t);return !!o&&e.contains(i,o);case 29:return a(t,n,r.expression);default:return !1}}(i,s.node,n))return;var l=[],u=r.getResolvedSignatureForSignatureHelp(s.node,l,c);return 0===l.length?void 0:{kind:0,candidates:l,resolvedSignature:u};case 1:var _=s.called;if(o&&!a(i,n,e.isIdentifier(_)?_.parent:_))return;if(0!==(l=e.getPossibleGenericSignatures(_,c,r)).length)return {kind:0,candidates:l,resolvedSignature:e.first(l)};var d=r.getSymbolAtLocation(_);return d&&{kind:1,symbol:d};case 2:return {kind:0,candidates:[s.signature],resolvedSignature:s.signature};default:return e.Debug.assertNever(s)}}(h,_,r,d,p);return u.throwIfCancellationRequested(),b?_.runWithCancellationToken(u,(function(e){return 0===b.kind?y(b.candidates,b.resolvedSignature,h,r,e):function(e,t,r,n){var i=t.argumentCount,a=t.argumentsSpan,o=t.invocation,s=t.argumentIndex,c=n.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);if(c)return {items:[v(e,c,n,g(o),r)],applicableSpan:a,selectedItemIndex:0,argumentIndex:s,argumentCount:i}}(b.symbol,h,r,e)})):e.isSourceFileJS(r)?function(t,r,n){if(2!==t.invocation.kind){var i=f(t.invocation),a=e.isPropertyAccessExpression(i)?i.name.text:void 0,o=r.getTypeChecker();return void 0===a?void 0:e.firstDefined(r.getSourceFiles(),(function(r){return e.firstDefined(r.getNamedDeclarations().get(a),(function(e){var i=e.symbol&&o.getTypeOfSymbolAtLocation(e.symbol,e),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,(function(e){return y(a,a[0],t,r,e,!0)}))}))}))}}(h,t,u):void 0}}}},function(e){e[e.Candidate=0]="Candidate",e[e.Type=1]="Type";}(i||(i={})),t.getArgumentInfoForCompletions=function(e,t,r){var n=s(e,t,r);return !n||n.isTypeParameterList||0!==n.invocation.kind?void 0:{invocation:n.invocation.node,argumentCount:n.argumentCount,argumentIndex:n.argumentIndex}};var m=70246400;function y(t,r,i,a,o,s){var c,l=i.isTypeParameterList,u=i.argumentCount,_=i.argumentsSpan,d=i.invocation,p=i.argumentIndex,m=g(d),y=2===d.kind?d.symbol:o.getSymbolAtLocation(f(d))||s&&(null===(c=r.declaration)||void 0===c?void 0:c.symbol),v=y?e.symbolToDisplayParts(o,y,s?a:void 0,void 0):e.emptyArray,D=e.map(t,(function(t){return function(t,r,i,a,o,s){var c=(i?b:x)(t,a,o,s);return e.map(c,(function(i){var s=i.isVariadic,c=i.parameters,l=i.prefix,u=i.suffix,_=n$4(n$4([],r,!0),l,!0),d=n$4(n$4([],u,!0),function(t,r,n){return e.mapToDisplayParts((function(e){e.writePunctuation(":"),e.writeSpace(" ");var i=n.getTypePredicateOfSignature(t);i?n.writeTypePredicate(i,r,void 0,e):n.writeType(n.getReturnTypeOfSignature(t),r,void 0,e);}))}(t,o,a),!0),p=t.getDocumentationComment(a),f=t.getJsDocTags();return {isVariadic:s,prefixDisplayParts:_,suffixDisplayParts:d,separatorDisplayParts:h,parameters:c,documentation:p,tags:f}}))}(t,v,l,o,m,a)}));0!==p&&e.Debug.assertLessThan(p,u);for(var S=0,T=0,C=0;C<D.length;C++){var E=D[C];if(t[C]===r&&(S=T,E.length>1))for(var k=0,N=0,A=E;N<A.length;N++){var F=A[N];if(F.isVariadic||F.parameters.length>=u){S=T+k;break}k++;}T+=E.length;}e.Debug.assert(-1!==S);var P={items:e.flatMapToMutable(D,e.identity),applicableSpan:_,selectedItemIndex:S,argumentIndex:p,argumentCount:u},w=P.items[S];if(w.isVariadic){var I=e.findIndex(w.parameters,(function(e){return !!e.isRest}));-1<I&&I<w.parameters.length-1?P.argumentIndex=w.parameters.length:P.argumentIndex=Math.min(P.argumentIndex,w.parameters.length-1);}return P}function v(t,r,i,a,o){var s=e.symbolToDisplayParts(i,t),c=e.createPrinter({removeComments:!0}),l=r.map((function(e){return D(e,i,a,o,c)})),u=t.getDocumentationComment(i),_=t.getJsDocTags(i);return {isVariadic:!1,prefixDisplayParts:n$4(n$4([],s,!0),[e.punctuationPart(29)],!1),suffixDisplayParts:[e.punctuationPart(31)],separatorDisplayParts:h,parameters:l,documentation:u,tags:_}}var h=[e.punctuationPart(27),e.spacePart()];function b(t,r,i,a){var o=(t.target||t).typeParameters,s=e.createPrinter({removeComments:!0}),c=(o||e.emptyArray).map((function(e){return D(e,r,i,a,s)})),l=t.thisParameter?[r.symbolToParameterDeclaration(t.thisParameter,i,m)]:[];return r.getExpandedParameters(t).map((function(t){var o=e.factory.createNodeArray(n$4(n$4([],l,!0),e.map(t,(function(e){return r.symbolToParameterDeclaration(e,i,m)})),!0)),u=e.mapToDisplayParts((function(e){s.writeList(2576,o,a,e);}));return {isVariadic:!1,parameters:c,prefix:[e.punctuationPart(29)],suffix:n$4([e.punctuationPart(31)],u,!0)}}))}function x(t,r,i,a){var o=e.createPrinter({removeComments:!0}),s=e.mapToDisplayParts((function(n){if(t.typeParameters&&t.typeParameters.length){var s=e.factory.createNodeArray(t.typeParameters.map((function(e){return r.typeParameterToDeclaration(e,i,m)})));o.writeList(53776,s,a,n);}})),c=r.getExpandedParameters(t),l=r.hasEffectiveRestParameter(t)?1===c.length?function(e){return !0}:function(e){return !!(e.length&&32768&e[e.length-1].checkFlags)}:function(e){return !1};return c.map((function(t){return {isVariadic:l(t),parameters:t.map((function(t){return function(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.symbolToParameterDeclaration(t,n,m);a.writeNode(4,o,i,e);})),s=r.isOptionalParameter(t.valueDeclaration),c=!!(32768&t.checkFlags);return {name:t.name,documentation:t.getDocumentationComment(r),displayParts:o,isOptional:s,isRest:c}}(t,r,i,a,o)})),prefix:n$4(n$4([],s,!0),[e.punctuationPart(20)],!1),suffix:[e.punctuationPart(21)]}}))}function D(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.typeParameterToDeclaration(t,n,m);a.writeNode(4,o,i,e);}));return {name:t.symbol.name,documentation:t.symbol.getDocumentationComment(r),displayParts:o,isOptional:!1,isRest:!1}}}(e.SignatureHelp||(e.SignatureHelp={}));}(t),function(e){!function(t){function r(e){return "literals"===e.includeInlayParameterNameHints}t.provideInlayHints=function(t){var n=t.file,i=t.program,a=t.span,o=t.cancellationToken,s=t.preferences,c=n.text,l=i.getCompilerOptions(),u=i.getTypeChecker(),_=[];return function t(i){if(i&&0!==i.getFullWidth()){switch(i.kind){case 264:case 260:case 261:case 259:case 228:case 215:case 171:case 216:o.throwIfCancellationRequested();}if(e.textSpanIntersectsWith(a,i.pos,i.getFullWidth())&&(!e.isTypeNode(i)||e.isExpressionWithTypeArguments(i)))return s.includeInlayVariableTypeHints&&e.isVariableDeclaration(i)||s.includeInlayPropertyDeclarationTypeHints&&e.isPropertyDeclaration(i)?function(t){if(t.initializer&&!e.isBindingPattern(t.name)&&(!e.isVariableDeclaration(t)||x(t))&&!e.getEffectiveTypeAnnotationNode(t)){var r=u.getTypeAtLocation(t);if(!f(r)){var n=b(r);if(n){if(!1===s.includeInlayVariableTypeHintsWhenTypeMatchesName&&e.equateStringsCaseInsensitive(t.name.getText(),n))return;p(n,t.name.end);}}}}(i):s.includeInlayEnumMemberValueHints&&e.isEnumMember(i)?function(e){if(!e.initializer){var t,r,n=u.getConstantValue(e);void 0!==n&&(t=n.toString(),r=e.end,_.push({text:"= ".concat(h(t,30)),position:r,kind:"Enum",whitespaceBefore:!0}));}}(i):function(e){return "literals"===e.includeInlayParameterNameHints||"all"===e.includeInlayParameterNameHints}(s)&&(e.isCallExpression(i)||e.isNewExpression(i))?function(t){var n=t.arguments;if(n&&n.length){var i=[],a=u.getResolvedSignatureForSignatureHelp(t,i);if(a&&i.length)for(var o=0;o<n.length;++o){var c=n[o],l=e.skipParentheses(c);if(!r(s)||y(l)){var _=u.getParameterIdentifierNameAtPosition(a,o);if(_){var p=_[0],f=_[1];if(!s.includeInlayParameterNameHintsWhenArgumentMatchesName&&g(l,p)&&!f)continue;var v=e.unescapeLeadingUnderscores(p);if(m(l,v))continue;d(v,c.getStart(),f);}}}}}(i):(s.includeInlayFunctionParameterTypeHints&&e.isFunctionLikeDeclaration(i)&&e.hasContextSensitiveParameters(i)&&function(t){var r=u.getSignatureFromDeclaration(t);if(r)for(var n=0;n<t.parameters.length&&n<r.parameters.length;++n){var i=t.parameters[n];if(x(i)&&!e.getEffectiveTypeAnnotationNode(i)){var a=v(r.parameters[n]);a&&p(a,i.questionToken?i.questionToken.end:i.name.end);}}}(i),s.includeInlayFunctionLikeReturnTypeHints&&function(t){return e.isArrowFunction(t)||e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isMethodDeclaration(t)||e.isGetAccessorDeclaration(t)}(i)&&function(t){if((!e.isArrowFunction(t)||e.findChildOfKind(t,20,n))&&!e.getEffectiveReturnTypeNode(t)&&t.body){var r=u.getSignatureFromDeclaration(t);if(r){var i=u.getReturnTypeOfSignature(r);if(!f(i)){var a=b(i);a&&p(a,function(t){var r=e.findChildOfKind(t,21,n);return r?r.end:t.parameters.end}(t));}}}}(i)),e.forEachChild(i,t)}}(n),_;function d(e,t,r){_.push({text:"".concat(r?"...":"").concat(h(e,30),":"),position:t,kind:"Parameter",whitespaceAfter:!0});}function p(e,t){_.push({text:": ".concat(h(e,30)),position:t,kind:"Type",whitespaceBefore:!0});}function f(e){return e.symbol&&1536&e.symbol.flags}function g(t,r){return e.isIdentifier(t)?t.text===r:!!e.isPropertyAccessExpression(t)&&t.name.text===r}function m(t,r){if(!e.isIdentifierText(r,l.target,e.getLanguageVariant(n.scriptKind)))return !1;var i=e.getLeadingCommentRanges(c,t.pos);if(!(null==i?void 0:i.length))return !1;var a=function(e){return new RegExp("^\\s?/\\*\\*?\\s?".concat(e,"\\s?\\*\\/\\s?$"))}(r);return e.some(i,(function(e){return a.test(c.substring(e.pos,e.end))}))}function y(t){switch(t.kind){case 221:var r=t.operand;return e.isLiteralExpression(r)||e.isIdentifier(r)&&e.isInfinityOrNaNString(r.escapedText);case 110:case 95:case 104:case 14:case 225:return !0;case 79:var n=t.escapedText;return function(e){return "undefined"===e}(n)||e.isInfinityOrNaNString(n)}return e.isLiteralExpression(t)}function v(t){var r=t.valueDeclaration;if(r&&e.isParameter(r)){var n=u.getTypeOfSymbolAtLocation(t,r);if(!f(n))return b(n)}}function h(e,t){return e.length>t?e.substr(0,t-"...".length)+"...":e}function b(t){var r=e.createPrinter({removeComments:!0});return e.usingSingleLineStringWriter((function(i){var a=u.typeToTypeNode(t,void 0,71286784,i);e.Debug.assertIsDefined(a,"should always get typenode"),r.writeNode(4,a,n,i);}))}function x(t){if((e.isParameterDeclaration(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&t.initializer){var r=e.skipParentheses(t.initializer);return !(y(r)||e.isNewExpression(r)||e.isObjectLiteralExpression(r)||e.isAssertionExpression(r))}return !0}};}(e.InlayHints||(e.InlayHints={}));}(t),function(e){var t=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;function r(t,r,n){var i=e.tryParseRawSourceMap(r);if(i&&i.sources&&i.file&&i.mappings&&(!i.sourcesContent||!i.sourcesContent.some(e.isString)))return e.createDocumentPositionMapper(t,i,n)}e.getSourceMapper=function(t){var r=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),n=t.getCurrentDirectory(),i=new e.Map,a=new e.Map;return {tryGetSourcePosition:function t(r){if(e.isDeclarationFileName(r.fileName)&&c(r.fileName)){var n=s(r.fileName).getSourcePosition(r);return n&&n!==r?t(n)||n:void 0}},tryGetGeneratedPosition:function(i){if(!e.isDeclarationFileName(i.fileName)){var a=c(i.fileName);if(a){var o=t.getProgram();if(!o.isSourceOfProjectReferenceRedirect(a.fileName)){var l=o.getCompilerOptions(),u=e.outFile(l),_=u?e.removeFileExtension(u)+".d.ts":e.getDeclarationEmitOutputFilePathWorker(i.fileName,o.getCompilerOptions(),n,o.getCommonSourceDirectory(),r);if(void 0!==_){var d=s(_,i.fileName).getGeneratedPosition(i);return d===i?void 0:d}}}}},toLineColumnOffset:function(e,t){return l(e).getLineAndCharacterOfPosition(t)},clearCache:function(){i.clear(),a.clear();}};function o(t){return e.toPath(t,n,r)}function s(n,i){var s,c=o(n),u=a.get(c);if(u)return u;if(t.getDocumentPositionMapper)s=t.getDocumentPositionMapper(n,i);else if(t.readFile){var _=l(n);s=_&&e.getDocumentPositionMapper({getSourceFileLike:l,getCanonicalFileName:r,log:function(e){return t.log(e)}},n,e.getLineInfo(_.text,e.getLineStarts(_)),(function(e){return !t.fileExists||t.fileExists(e)?t.readFile(e):void 0}));}return a.set(c,s||e.identitySourceMapConsumer),s||e.identitySourceMapConsumer}function c(e){var r=t.getProgram();if(r){var n=o(e),i=r.getSourceFileByPath(n);return i&&i.resolvedPath===n?i:void 0}}function l(r){return t.getSourceFileLike?t.getSourceFileLike(r):c(r)||function(r){var n=o(r),a=i.get(n);if(void 0!==a)return a||void 0;if(t.readFile&&(!t.fileExists||t.fileExists(n))){var s=t.readFile(n),c=!!s&&function(t,r){return {text:t,lineMap:void 0,getLineAndCharacterOfPosition:function(t){return e.computeLineAndCharacterOfPosition(e.getLineStarts(this),t)}}}(s);return i.set(n,c),c||void 0}i.set(n,!1);}(r)}},e.getDocumentPositionMapper=function(n,i,a,o){var s=e.tryGetSourceMappingURL(a);if(s){var c=t.exec(s);if(c){if(c[1]){var l=c[1];return r(n,e.base64decode(e.sys,l),i)}s=void 0;}}var u=[];s&&u.push(s),u.push(i+".map");for(var _=s&&e.getNormalizedAbsolutePath(s,e.getDirectoryPath(i)),d=0,p=u;d<p.length;d++){var f=p[d],g=e.getNormalizedAbsolutePath(f,e.getDirectoryPath(i)),m=o(g,_);if(e.isString(m))return r(n,m,g);if(void 0!==m)return m||void 0}};}(t),function(e){var t=new e.Map;function r(t){return e.isPropertyAccessExpression(t)?r(t.expression):t}function n(t){switch(t.kind){case 269:var r=t.importClause,n=t.moduleSpecifier;return r&&!r.name&&r.namedBindings&&271===r.namedBindings.kind&&e.isStringLiteral(n)?r.namedBindings.name:void 0;case 268:return t.name;default:return}}function i(e,t){var r=t.getSignatureFromDeclaration(e),n=r?t.getReturnTypeOfSignature(r):void 0;return !!n&&!!t.getPromisedTypeOfPromise(n)}function a(t,r){return e.isReturnStatement(t)&&!!t.expression&&o(t.expression,r)}function o(t,r){if(!s(t)||!c(t)||!t.arguments.every((function(e){return l(e,r)})))return !1;for(var n=t.expression.expression;s(n)||e.isPropertyAccessExpression(n);)if(e.isCallExpression(n)){if(!c(n)||!n.arguments.every((function(e){return l(e,r)})))return !1;n=n.expression.expression;}else n=n.expression;return !0}function s(t){return e.isCallExpression(t)&&(e.hasPropertyAccessExpressionWithName(t,"then")||e.hasPropertyAccessExpressionWithName(t,"catch")||e.hasPropertyAccessExpressionWithName(t,"finally"))}function c(t){var r=t.expression.name.text,n="then"===r?2:"catch"===r||"finally"===r?1:0;return !(t.arguments.length>n)&&(t.arguments.length<n||1===n||e.some(t.arguments,(function(t){return 104===t.kind||e.isIdentifier(t)&&"undefined"===t.text})))}function l(r,n){switch(r.kind){case 259:case 215:if(1&e.getFunctionFlags(r))return !1;case 216:t.set(u(r),!0);case 104:return !0;case 79:case 208:var i=n.getSymbolAtLocation(r);return !!i&&(n.isUndefinedSymbol(i)||e.some(e.skipAlias(i,n).declarations,(function(t){return e.isFunctionLike(t)||e.hasInitializer(t)&&!!t.initializer&&e.isFunctionLike(t.initializer)})));default:return !1}}function u(e){return "".concat(e.pos.toString(),":").concat(e.end.toString())}function _(e){switch(e.kind){case 259:case 171:case 215:case 216:return !0;default:return !1}}e.computeSuggestionDiagnostics=function(o,s,c){s.getSemanticDiagnostics(o,c);var l,d=[],p=s.getTypeChecker();o.impliedNodeFormat!==e.ModuleKind.CommonJS&&!e.fileExtensionIsOneOf(o.fileName,[".cts",".cjs"])&&o.commonJsModuleIndicator&&(e.programContainsEsModules(s)||e.compilerOptionsIndicateEsModules(s.getCompilerOptions()))&&function(t){return t.statements.some((function(t){switch(t.kind){case 240:return t.declarationList.declarations.some((function(t){return !!t.initializer&&e.isRequireCall(r(t.initializer),!0)}));case 241:var n=t.expression;if(!e.isBinaryExpression(n))return e.isRequireCall(n,!0);var i=e.getAssignmentDeclarationKind(n);return 1===i||2===i;default:return !1}}))}(o)&&d.push(e.createDiagnosticForNode((l=o.commonJsModuleIndicator,e.isBinaryExpression(l)?l.left:l),e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));var f=e.isSourceFileJS(o);if(t.clear(),function r(n){if(f)(function(t,r){var n,i,a,o;if(215===t.kind){if(e.isVariableDeclaration(t.parent)&&(null===(n=t.symbol.members)||void 0===n?void 0:n.size))return !0;var s=r.getSymbolOfExpando(t,!1);return !(!s||!(null===(i=s.exports)||void 0===i?void 0:i.size)&&!(null===(a=s.members)||void 0===a?void 0:a.size))}return 259===t.kind&&!!(null===(o=t.symbol.members)||void 0===o?void 0:o.size)})(n,p)&&d.push(e.createDiagnosticForNode(e.isVariableDeclaration(n.parent)?n.parent.name:n,e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));else {if(e.isVariableStatement(n)&&n.parent===o&&2&n.declarationList.flags&&1===n.declarationList.declarations.length){var s=n.declarationList.declarations[0].initializer;s&&e.isRequireCall(s,!0)&&d.push(e.createDiagnosticForNode(s,e.Diagnostics.require_call_may_be_converted_to_an_import));}e.codefix.parameterShouldGetTypeFromJSDoc(n)&&d.push(e.createDiagnosticForNode(n.name||n,e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));}_(n)&&function(r,n,o){(function(t,r){return !e.isAsyncFunction(t)&&t.body&&e.isBlock(t.body)&&function(t,r){return !!e.forEachReturnStatement(t,(function(e){return a(e,r)}))}(t.body,r)&&i(t,r)})(r,n)&&!t.has(u(r))&&o.push(e.createDiagnosticForNode(!r.name&&e.isVariableDeclaration(r.parent)&&e.isIdentifier(r.parent.name)?r.parent.name:r,e.Diagnostics.This_may_be_converted_to_an_async_function));}(n,p,d),n.forEachChild(r);}(o),e.getAllowSyntheticDefaultImports(s.getCompilerOptions()))for(var g=0,m=o.imports;g<m.length;g++){var y=m[g],v=n(e.importFromModuleSpecifier(y));if(v){var h=e.getResolvedModule(o,y.text,e.getModeForUsageLocation(o,y)),b=h&&s.getSourceFile(h.resolvedFileName);b&&b.externalModuleIndicator&&!0!==b.externalModuleIndicator&&e.isExportAssignment(b.externalModuleIndicator)&&b.externalModuleIndicator.isExportEquals&&d.push(e.createDiagnosticForNode(v,e.Diagnostics.Import_may_be_converted_to_a_default_import));}}return e.addRange(d,o.bindSuggestionDiagnostics),e.addRange(d,s.getSuggestionDiagnostics(o,c)),d.sort((function(e,t){return e.start-t.start}))},e.returnsPromise=i,e.isReturnStatementWithFixablePromiseHandler=a,e.isFixablePromiseHandler=o,e.canBeConvertedToAsync=_;}(t),function(e){!function(t){var r=70246400;function n(t,r,n){var a=i(t,r,n);if(""!==a)return a;var o=e.getCombinedLocalAndExportSymbolFlags(r);return 32&o?e.getDeclarationOfKind(r,228)?"local class":"class":384&o?"enum":524288&o?"type":64&o?"interface":262144&o?"type parameter":8&o?"enum member":2097152&o?"alias":1536&o?"module":a}function i(t,r,n){var i=t.getRootSymbols(r);if(1===i.length&&8192&e.first(i).flags&&0!==t.getTypeOfSymbolAtLocation(r,n).getNonNullableType().getCallSignatures().length)return "method";if(t.isUndefinedSymbol(r))return "var";if(t.isArgumentsSymbol(r))return "local var";if(108===n.kind&&e.isExpression(n)||e.isThisInTypeQuery(n))return "parameter";var a=e.getCombinedLocalAndExportSymbolFlags(r);return 3&a?e.isFirstDeclarationOfSymbolParameter(r)?"parameter":r.valueDeclaration&&e.isVarConst(r.valueDeclaration)?"const":e.forEach(r.declarations,e.isLet)?"let":o(r)?"local var":"var":16&a?o(r)?"local function":"function":32768&a?"getter":65536&a?"setter":8192&a?"method":16384&a?"constructor":131072&a?"index":4&a?33554432&a&&6&r.checkFlags?e.forEach(t.getRootSymbols(r),(function(e){if(98311&e.getFlags())return "property"}))||(t.getTypeOfSymbolAtLocation(r,n).getCallSignatures().length?"method":"property"):"property":""}function a(t){if(t.declarations&&t.declarations.length){var r=t.declarations,n=r[0],i=r.slice(1),a=e.length(i)&&e.isDeprecatedDeclaration(n)&&e.some(i,(function(t){return !e.isDeprecatedDeclaration(t)}))?8192:0,o=e.getNodeModifiers(n,a);if(o)return o.split(",")}return []}function o(t){return !t.parent&&e.forEach(t.declarations,(function(t){if(215===t.kind)return !0;if(257!==t.kind&&259!==t.kind)return !1;for(var r=t.parent;!e.isFunctionBlock(r);r=r.parent)if(308===r.kind||265===r.kind)return !1;return !0}))}t.getSymbolKind=n,t.getSymbolModifiers=function(t,r){if(!r)return "";var n=new e.Set(a(r));if(2097152&r.flags){var i=t.getAliasedSymbol(r);i!==r&&e.forEach(a(i),(function(e){n.add(e);}));}return 16777216&r.flags&&n.add("optional"),n.size>0?e.arrayFrom(n.values()).join(","):""},t.getSymbolDisplayPartsDocumentationAndSymbolKind=function t(a,o,s,c,l,u,_){var d;void 0===u&&(u=e.getMeaningFromLocation(l));var p,f,g,m,y=[],v=[],h=[],b=e.getCombinedLocalAndExportSymbolFlags(o),x=1&u?i(a,o,l):"",D=!1,S=108===l.kind&&e.isInExpressionContext(l)||e.isThisInTypeQuery(l),T=!1;if(108===l.kind&&!S)return {displayParts:[e.keywordPart(108)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==x||32&b||2097152&b){if("getter"===x||"setter"===x)if(W=e.find(o.declarations,(function(e){return e.name===l})))switch(W.kind){case 174:x="getter";break;case 175:x="setter";break;case 169:x="accessor";break;default:e.Debug.assertNever(W);}else x="property";var C=void 0;if(p=S?a.getTypeAtLocation(l):a.getTypeOfSymbolAtLocation(o,l),l.parent&&208===l.parent.kind){var E=l.parent.name;(E===l||E&&0===E.getFullWidth())&&(l=l.parent);}var k=void 0;if(e.isCallOrNewExpression(l)?k=l:(e.isCallExpressionTarget(l)||e.isNewExpressionTarget(l)||l.parent&&(e.isJsxOpeningLikeElement(l.parent)||e.isTaggedTemplateExpression(l.parent))&&e.isFunctionLike(o.valueDeclaration))&&(k=l.parent),k){C=a.getResolvedSignature(k);var N=211===k.kind||e.isCallExpression(k)&&106===k.expression.kind,A=N?p.getConstructSignatures():p.getCallSignatures();if(!C||e.contains(A,C.target)||e.contains(A,C)||(C=A.length?A[0]:void 0),C){switch(N&&32&b?(x="constructor",te(p.symbol,x)):2097152&b?(re(x="alias"),y.push(e.spacePart()),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ee(o)):te(o,x),x){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":y.push(e.punctuationPart(58)),y.push(e.spacePart()),16&e.getObjectFlags(p)||!p.symbol||(e.addRange(y,e.symbolToDisplayParts(a,p.symbol,c,void 0,5)),y.push(e.lineBreakPart())),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ne(C,A,262144);break;default:ne(C,A);}D=!0,T=A.length>1;}}else if(e.isNameOfFunctionDeclaration(l)&&!(98304&b)||135===l.kind&&173===l.parent.kind){var F=l.parent,P=o.declarations&&e.find(o.declarations,(function(e){return e===(135===l.kind?F.parent:F)}));P&&(A=173===F.kind?p.getNonNullableType().getConstructSignatures():p.getNonNullableType().getCallSignatures(),C=a.isImplementationOfOverload(F)?A[0]:a.getSignatureFromDeclaration(F),173===F.kind?(x="constructor",te(p.symbol,x)):te(176!==F.kind||2048&p.symbol.flags||4096&p.symbol.flags?o:p.symbol,x),C&&ne(C,A),D=!0,T=A.length>1);}}if(32&b&&!D&&!S&&(Z(),e.getDeclarationOfKind(o,228)?re("local class"):y.push(e.keywordPart(84)),y.push(e.spacePart()),ee(o),ie(o,s)),64&b&&2&u&&(Y(),y.push(e.keywordPart(118)),y.push(e.spacePart()),ee(o),ie(o,s)),524288&b&&2&u&&(Y(),y.push(e.keywordPart(154)),y.push(e.spacePart()),ee(o),ie(o,s),y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(a,e.isConstTypeReference(l.parent)?a.getTypeAtLocation(l.parent):a.getDeclaredTypeOfSymbol(o),c,8388608))),384&b&&(Y(),e.some(o.declarations,(function(t){return e.isEnumDeclaration(t)&&e.isEnumConst(t)}))&&(y.push(e.keywordPart(85)),y.push(e.spacePart())),y.push(e.keywordPart(92)),y.push(e.spacePart()),ee(o)),1536&b&&!S){Y();var w=(W=e.getDeclarationOfKind(o,264))&&W.name&&79===W.name.kind;y.push(e.keywordPart(w?143:142)),y.push(e.spacePart()),ee(o);}if(262144&b&&2&u)if(Y(),y.push(e.punctuationPart(20)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(21)),y.push(e.spacePart()),ee(o),o.parent)$(),ee(o.parent,c),ie(o.parent,c);else {var I=e.getDeclarationOfKind(o,165);if(void 0===I)return e.Debug.fail();(W=I.parent)&&(e.isFunctionLikeKind(W.kind)?($(),C=a.getSignatureFromDeclaration(W),177===W.kind?(y.push(e.keywordPart(103)),y.push(e.spacePart())):176!==W.kind&&W.name&&ee(W.symbol),e.addRange(y,e.signatureToDisplayParts(a,C,s,32))):262===W.kind&&($(),y.push(e.keywordPart(154)),y.push(e.spacePart()),ee(W.symbol),ie(W.symbol,s)));}if(8&b&&(x="enum member",te(o,"enum member"),302===(null==(W=null===(d=o.declarations)||void 0===d?void 0:d[0])?void 0:W.kind))){var O=a.getConstantValue(W);void 0!==O&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.displayPart(e.getTextOfConstantValue(O),"number"==typeof O?e.SymbolDisplayPartKind.numericLiteral:e.SymbolDisplayPartKind.stringLiteral)));}if(2097152&o.flags){if(Y(),!D){var M=a.getAliasedSymbol(o);if(M!==o&&M.declarations&&M.declarations.length>0){var L=M.declarations[0],R=e.getNameOfDeclaration(L);if(R){var B=e.isModuleWithStringLiteralName(L)&&e.hasSyntacticModifier(L,2),j="default"!==o.name&&!B,J=t(a,M,e.getSourceFileOfNode(L),L,R,u,j?o:M);y.push.apply(y,J.displayParts),y.push(e.lineBreakPart()),g=J.documentation,m=J.tags;}else g=M.getContextualDocumentationComment(L,a),m=M.getJsDocTags(a);}}if(o.declarations)switch(o.declarations[0].kind){case 267:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(143));break;case 274:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(o.declarations[0].isExportEquals?63:88));break;case 278:y.push(e.keywordPart(93));break;default:y.push(e.keywordPart(100));}y.push(e.spacePart()),ee(o),e.forEach(o.declarations,(function(t){if(268===t.kind){var r=t;if(e.isExternalModuleImportEqualsDeclaration(r))y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.keywordPart(147)),y.push(e.punctuationPart(20)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(r)),e.SymbolDisplayPartKind.stringLiteral)),y.push(e.punctuationPart(21));else {var n=a.getSymbolAtLocation(r.moduleReference);n&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),ee(n,c));}return !0}}));}if(!D)if(""!==x){if(p)if(S?(Y(),y.push(e.keywordPart(108))):te(o,x),"property"===x||"accessor"===x||"getter"===x||"setter"===x||"JSX attribute"===x||3&b||"local var"===x||"index"===x||S){if(y.push(e.punctuationPart(58)),y.push(e.spacePart()),p.symbol&&262144&p.symbol.flags&&"index"!==x){var z=e.mapToDisplayParts((function(t){var n=a.typeParameterToDeclaration(p,c,r);X().writeNode(4,n,e.getSourceFileOfNode(e.getParseTreeNode(c)),t);}));e.addRange(y,z);}else e.addRange(y,e.typeToDisplayParts(a,p,c));if(o.target&&o.target.tupleLabelDeclaration){var U=o.target.tupleLabelDeclaration;e.Debug.assertNode(U.name,e.isIdentifier),y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.textPart(e.idText(U.name))),y.push(e.punctuationPart(21));}}else (16&b||8192&b||16384&b||131072&b||98304&b||"method"===x)&&(A=p.getNonNullableType().getCallSignatures()).length&&(ne(A[0],A),T=A.length>1);}else x=n(a,o,l);if(0!==v.length||T||(v=o.getContextualDocumentationComment(c,a)),0===v.length&&4&b&&o.parent&&o.declarations&&e.forEach(o.parent.declarations,(function(e){return 308===e.kind})))for(var K=0,V=o.declarations;K<V.length;K++)if((W=V[K]).parent&&223===W.parent.kind){var q=a.getSymbolAtLocation(W.parent.right);if(q&&(v=q.getDocumentationComment(a),h=q.getJsDocTags(a),v.length>0))break}if(0===v.length&&e.isIdentifier(l)&&o.valueDeclaration&&e.isBindingElement(o.valueDeclaration)){var W,H=(W=o.valueDeclaration).parent;if(e.isIdentifier(W.name)&&e.isObjectBindingPattern(H)){var G=e.getTextOfIdentifierOrLiteral(W.name),Q=a.getTypeAtLocation(H);v=e.firstDefined(Q.isUnion()?Q.types:[Q],(function(e){var t=e.getProperty(G);return t?t.getDocumentationComment(a):void 0}))||e.emptyArray;}}return 0!==h.length||T||(h=o.getContextualJsDocTags(c,a)),0===v.length&&g&&(v=g),0===h.length&&m&&(h=m),{displayParts:y,documentation:v,symbolKind:x,tags:0===h.length?void 0:h};function X(){return f||(f=e.createPrinter({removeComments:!0})),f}function Y(){y.length&&y.push(e.lineBreakPart()),Z();}function Z(){_&&(re("alias"),y.push(e.spacePart()));}function $(){y.push(e.spacePart()),y.push(e.keywordPart(101)),y.push(e.spacePart());}function ee(t,r){var n;_&&t===o&&(t=_),"index"===x&&(n=a.getIndexInfosOfIndexSymbol(t));var i=[];131072&t.flags&&n?(t.parent&&(i=e.symbolToDisplayParts(a,t.parent)),i.push(e.punctuationPart(22)),n.forEach((function(t,r){i.push.apply(i,e.typeToDisplayParts(a,t.keyType)),r!==n.length-1&&(i.push(e.spacePart()),i.push(e.punctuationPart(51)),i.push(e.spacePart()));})),i.push(e.punctuationPart(23))):i=e.symbolToDisplayParts(a,t,r||s,void 0,7),e.addRange(y,i),16777216&o.flags&&y.push(e.punctuationPart(57));}function te(t,r){Y(),r&&(re(r),t&&!e.some(t.declarations,(function(t){return e.isArrowFunction(t)||(e.isFunctionExpression(t)||e.isClassExpression(t))&&!t.name}))&&(y.push(e.spacePart()),ee(t)));}function re(t){switch(t){case"var":case"function":case"let":case"const":case"constructor":return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(20)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(21))}}function ne(t,r,n){void 0===n&&(n=0),e.addRange(y,e.signatureToDisplayParts(a,t,c,32|n)),r.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.operatorPart(39)),y.push(e.displayPart((r.length-1).toString(),e.SymbolDisplayPartKind.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===r.length?"overload":"overloads")),y.push(e.punctuationPart(21))),v=t.getDocumentationComment(a),h=t.getJsDocTags(),r.length>1&&0===v.length&&0===h.length&&(v=r[0].getDocumentationComment(a),h=r[0].getJsDocTags().filter((function(e){return "deprecated"!==e.name})));}function ie(t,n){var i=e.mapToDisplayParts((function(i){var o=a.symbolToTypeParameterDeclarations(t,n,r);X().writeList(53776,o,e.getSourceFileOfNode(e.getParseTreeNode(n)),i);}));e.addRange(y,i);}};}(e.SymbolDisplay||(e.SymbolDisplay={}));}(t),function(e){function t(t,r){var i=[],a=r.compilerOptions?n(r.compilerOptions,i):{},o=e.getDefaultCompilerOptions();for(var s in o)e.hasProperty(o,s)&&void 0===a[s]&&(a[s]=o[s]);for(var c=0,l=e.transpileOptionValueCompilerOptions;c<l.length;c++){var u=l[c];a[u.name]=u.transpileOptionValue;}a.suppressOutputPathCheck=!0,a.allowNonTsExtensions=!0;var _,d,p=e.getNewLineCharacter(a),f={getSourceFile:function(t){return t===e.normalizePath(g)?m:void 0},writeFile:function(t,r){e.fileExtensionIs(t,".map")?(e.Debug.assertEqual(d,void 0,"Unexpected multiple source map outputs, file:",t),d=r):(e.Debug.assertEqual(_,void 0,"Unexpected multiple outputs, file:",t),_=r);},getDefaultLibFileName:function(){return "lib.d.ts"},useCaseSensitiveFileNames:function(){return !1},getCanonicalFileName:function(e){return e},getCurrentDirectory:function(){return ""},getNewLine:function(){return p},fileExists:function(e){return e===g},readFile:function(){return ""},directoryExists:function(){return !0},getDirectories:function(){return []}},g=r.fileName||(r.compilerOptions&&r.compilerOptions.jsx?"module.tsx":"module.ts"),m=e.createSourceFile(g,t,{languageVersion:e.getEmitScriptTarget(a),impliedNodeFormat:e.getImpliedNodeFormatForFile(e.toPath(g,"",f.getCanonicalFileName),void 0,f,a),setExternalModuleIndicator:e.getSetExternalModuleIndicator(a)});r.moduleName&&(m.moduleName=r.moduleName),r.renamedDependencies&&(m.renamedDependencies=new e.Map(e.getEntries(r.renamedDependencies)));var y=e.createProgram([g],a,f);return r.reportDiagnostics&&(e.addRange(i,y.getSyntacticDiagnostics(m)),e.addRange(i,y.getOptionsDiagnostics())),y.emit(void 0,void 0,void 0,void 0,r.transformers),void 0===_?e.Debug.fail("Output generation failed"):{outputText:_,diagnostics:i,sourceMapText:d}}var r;function n(t,n){r=r||e.filter(e.optionDeclarations,(function(t){return "object"==typeof t.type&&!e.forEachEntry(t.type,(function(e){return "number"!=typeof e}))})),t=e.cloneCompilerOptions(t);for(var i=function(r){if(!e.hasProperty(t,r.name))return "continue";var i=t[r.name];e.isString(i)?t[r.name]=e.parseCustomTypeOption(r,i,n):e.forEachEntry(r.type,(function(e){return e===i}))||n.push(e.createCompilerDiagnosticForInvalidCustomType(r));},a=0,o=r;a<o.length;a++)i(o[a]);return t}e.transpileModule=t,e.transpile=function(r,n,i,a,o){var s=t(r,{compilerOptions:n,fileName:i,reportDiagnostics:!!a,moduleName:o});return e.addRange(a,s.diagnostics),s.outputText},e.fixupCompilerOptions=n;}(t),function(e){!function(t){var r;(r=t.FormattingRequestKind||(t.FormattingRequestKind={}))[r.FormatDocument=0]="FormatDocument",r[r.FormatSelection=1]="FormatSelection",r[r.FormatOnEnter=2]="FormatOnEnter",r[r.FormatOnSemicolon=3]="FormatOnSemicolon",r[r.FormatOnOpeningCurlyBrace=4]="FormatOnOpeningCurlyBrace",r[r.FormatOnClosingCurlyBrace=5]="FormatOnClosingCurlyBrace";var n=function(){function t(e,t,r){this.sourceFile=e,this.formattingRequestKind=t,this.options=r;}return t.prototype.updateContext=function(t,r,n,i,a){this.currentTokenSpan=e.Debug.checkDefined(t),this.currentTokenParent=e.Debug.checkDefined(r),this.nextTokenSpan=e.Debug.checkDefined(n),this.nextTokenParent=e.Debug.checkDefined(i),this.contextNode=e.Debug.checkDefined(a),this.contextNodeAllOnSameLine=void 0,this.nextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.contextNodeBlockIsOnOneLine=void 0,this.nextNodeBlockIsOnOneLine=void 0;},t.prototype.ContextNodeAllOnSameLine=function(){return void 0===this.contextNodeAllOnSameLine&&(this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)),this.contextNodeAllOnSameLine},t.prototype.NextNodeAllOnSameLine=function(){return void 0===this.nextNodeAllOnSameLine&&(this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)),this.nextNodeAllOnSameLine},t.prototype.TokensAreOnSameLine=function(){if(void 0===this.tokensAreOnSameLine){var e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line,t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t;}return this.tokensAreOnSameLine},t.prototype.ContextNodeBlockIsOnOneLine=function(){return void 0===this.contextNodeBlockIsOnOneLine&&(this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)),this.contextNodeBlockIsOnOneLine},t.prototype.NextNodeBlockIsOnOneLine=function(){return void 0===this.nextNodeBlockIsOnOneLine&&(this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)),this.nextNodeBlockIsOnOneLine},t.prototype.NodeIsOnOneLine=function(e){return this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line===this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line},t.prototype.BlockIsOnOneLine=function(t){var r=e.findChildOfKind(t,18,this.sourceFile),n=e.findChildOfKind(t,19,this.sourceFile);return !(!r||!n)&&this.sourceFile.getLineAndCharacterOfPosition(r.getEnd()).line===this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line},t}();t.FormattingContext=n;}(e.formatting||(e.formatting={}));}(t),function(e){var t,r,n,i;t=e.formatting||(e.formatting={}),n=e.createScanner(99,!1,0),i=e.createScanner(99,!1,1),function(e){e[e.Scan=0]="Scan",e[e.RescanGreaterThanToken=1]="RescanGreaterThanToken",e[e.RescanSlashToken=2]="RescanSlashToken",e[e.RescanTemplateToken=3]="RescanTemplateToken",e[e.RescanJsxIdentifier=4]="RescanJsxIdentifier",e[e.RescanJsxText=5]="RescanJsxText",e[e.RescanJsxAttributeValue=6]="RescanJsxAttributeValue";}(r||(r={})),t.getFormattingScanner=function(r,a,o,s,c){var l=1===a?i:n;l.setText(r),l.setTextPos(o);var u,_,d,p,f,g=!0,m=c({advance:function(){f=void 0,l.getStartPos()!==o?g=!!_&&4===e.last(_).kind:l.scan(),u=void 0,_=void 0;for(var t=l.getStartPos();t<s;){var r=l.getToken();if(!e.isTrivia(r))break;l.scan();var n={pos:t,end:l.getStartPos(),kind:r};t=l.getStartPos(),u=e.append(u,n);}d=l.getStartPos();},readTokenInfo:function(r){e.Debug.assert(y());var n,i=function(e){switch(e.kind){case 33:case 71:case 72:case 49:case 48:return !0}return !1}(r)?1:13===r.kind?2:function(e){return 16===e.kind||17===e.kind}(r)?3:function(t){if(t.parent)switch(t.parent.kind){case 288:case 283:case 284:case 282:return e.isKeyword(t.kind)||79===t.kind}return !1}(r)?4:(n=r,e.isJsxText(n)||e.isJsxElement(n)&&11===(null==f?void 0:f.token.kind)?5:function(t){return t.parent&&e.isJsxAttribute(t.parent)&&t.parent.initializer===t}(r)?6:0);if(f&&i===p)return h(f,r);l.getStartPos()!==d&&(e.Debug.assert(void 0!==f),l.setTextPos(d),l.scan());var a=function(t,r){var n,i=l.getToken();switch(p=0,r){case 1:if(31===i){p=1;var a=l.reScanGreaterToken();return e.Debug.assert(t.kind===a),a}break;case 2:if(43===(n=i)||68===n)return p=2,a=l.reScanSlashToken(),e.Debug.assert(t.kind===a),a;break;case 3:if(19===i)return p=3,l.reScanTemplateToken(!1);break;case 4:return p=4,l.scanJsxIdentifier();case 5:return p=5,l.reScanJsxToken(!1);case 6:return p=6,l.reScanJsxAttributeValue();case 0:break;default:e.Debug.assertNever(r);}return i}(r,i),o=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);for(_&&(_=void 0);l.getStartPos()<s&&(a=l.scan(),e.isTrivia(a));){var c=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);if(_||(_=[]),_.push(c),4===a){l.scan();break}}return h(f={leadingTrivia:u,trailingTrivia:_,token:o},r)},readEOFTokenRange:function(){return e.Debug.assert(v()),t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),1)},isOnToken:y,isOnEOF:v,getCurrentLeadingTrivia:function(){return u},lastTrailingTriviaWasNewLine:function(){return g},skipToEndOf:function(e){l.setTextPos(e.end),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;},skipToStartOf:function(e){l.setTextPos(e.pos),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;},getStartPos:function(){var e;return null!==(e=null==f?void 0:f.token.pos)&&void 0!==e?e:l.getTokenPos()}});return f=void 0,l.setText(void 0),m;function y(){var t=f?f.token.kind:l.getToken();return 1!==t&&!e.isTrivia(t)}function v(){return 1===(f?f.token.kind:l.getToken())}function h(t,r){return e.isToken(r)&&t.token.kind!==r.kind&&(t.token.kind=r.kind),t}};}(t),function(e){var t,r,n;(t=e.formatting||(e.formatting={})).anyContext=e.emptyArray,(n=t.RuleAction||(t.RuleAction={}))[n.StopProcessingSpaceActions=1]="StopProcessingSpaceActions",n[n.StopProcessingTokenActions=2]="StopProcessingTokenActions",n[n.InsertSpace=4]="InsertSpace",n[n.InsertNewLine=8]="InsertNewLine",n[n.DeleteSpace=16]="DeleteSpace",n[n.DeleteToken=32]="DeleteToken",n[n.InsertTrailingSemicolon=64]="InsertTrailingSemicolon",n[n.StopAction=3]="StopAction",n[n.ModifySpaceAction=28]="ModifySpaceAction",n[n.ModifyTokenAction=96]="ModifyTokenAction",(r=t.RuleFlags||(t.RuleFlags={}))[r.None=0]="None",r[r.CanDeleteNewLines=1]="CanDeleteNewLines";}(t),function(e){!function(t){function r(e,t,r,n,i,o){return void 0===o&&(o=0),{leftTokenRange:a(t),rightTokenRange:a(r),rule:{debugName:e,context:n,action:i,flags:o}}}function i(e){return {tokens:e,isSpecific:!0}}function a(t){return "number"==typeof t?i([t]):e.isArray(t)?i(t):t}function o(t,r,n){void 0===n&&(n=[]);for(var a=[],o=t;o<=r;o++)e.contains(n,o)||a.push(o);return i(a)}function s(e,t){return function(r){return r.options&&r.options[e]===t}}function c(t){return function(r){return r.options&&e.hasProperty(r.options,t)&&!!r.options[t]}}function l(t){return function(r){return r.options&&e.hasProperty(r.options,t)&&!r.options[t]}}function u(t){return function(r){return !r.options||!e.hasProperty(r.options,t)||!r.options[t]}}function _(t){return function(r){return !r.options||!e.hasProperty(r.options,t)||!r.options[t]||r.TokensAreOnSameLine()}}function d(t){return function(r){return !r.options||!e.hasProperty(r.options,t)||!!r.options[t]}}function p(e){return 245===e.contextNode.kind}function f(e){return !p(e)}function g(e){switch(e.contextNode.kind){case 223:return 27!==e.contextNode.operatorToken.kind;case 224:case 191:case 231:case 278:case 273:case 179:case 189:case 190:case 235:return !0;case 205:case 262:case 268:case 274:case 257:case 166:case 302:case 169:case 168:return 63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 246:case 165:return 101===e.currentTokenSpan.kind||101===e.nextTokenSpan.kind||63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 247:return 162===e.currentTokenSpan.kind||162===e.nextTokenSpan.kind}return !1}function m(e){return !g(e)}function y(e){return !v(e)}function v(t){var r=t.contextNode.kind;return 169===r||168===r||166===r||257===r||e.isFunctionLikeKind(r)}function h(e){return 224===e.contextNode.kind||191===e.contextNode.kind}function b(e){return e.TokensAreOnSameLine()||C(e)}function x(e){return 203===e.contextNode.kind||197===e.contextNode.kind||function(e){return T(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}(e)}function D(e){return C(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function S(e){return T(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function T(e){return E(e.contextNode)}function C(e){return E(e.nextTokenParent)}function E(e){if(P(e))return !0;switch(e.kind){case 238:case 266:case 207:case 265:return !0}return !1}function k(e){switch(e.contextNode.kind){case 259:case 171:case 170:case 174:case 175:case 176:case 215:case 173:case 216:case 261:return !0}return !1}function N(e){return !k(e)}function A(e){return 259===e.contextNode.kind||215===e.contextNode.kind}function F(e){return P(e.contextNode)}function P(e){switch(e.kind){case 260:case 228:case 261:case 263:case 184:case 264:case 275:case 276:case 269:case 272:return !0}return !1}function w(e){switch(e.currentTokenParent.kind){case 260:case 264:case 263:case 295:case 265:case 252:return !0;case 238:var t=e.currentTokenParent.parent;if(!t||216!==t.kind&&215!==t.kind)return !0}return !1}function I(e){switch(e.contextNode.kind){case 242:case 252:case 245:case 246:case 247:case 244:case 255:case 243:case 251:case 295:return !0;default:return !1}}function O(e){return 207===e.contextNode.kind}function M(e){return function(e){return 210===e.contextNode.kind}(e)||function(e){return 211===e.contextNode.kind}(e)}function L(e){return 27!==e.currentTokenSpan.kind}function R(e){return 23!==e.nextTokenSpan.kind}function B(e){return 21!==e.nextTokenSpan.kind}function j(e){return 216===e.contextNode.kind}function J(e){return 202===e.contextNode.kind}function z(e){return e.TokensAreOnSameLine()&&11!==e.contextNode.kind}function U(e){return 11!==e.contextNode.kind}function K(e){return 281!==e.contextNode.kind&&285!==e.contextNode.kind}function V(e){return 291===e.contextNode.kind||290===e.contextNode.kind}function q(e){return 288===e.nextTokenParent.kind}function W(e){return 288===e.contextNode.kind}function H(e){return 282===e.contextNode.kind}function G(e){return !k(e)&&!C(e)}function Q(t){return t.TokensAreOnSameLine()&&e.hasDecorators(t.contextNode)&&X(t.currentTokenParent)&&!X(t.nextTokenParent)}function X(t){for(;t&&e.isExpression(t);)t=t.parent;return t&&167===t.kind}function Y(e){return 258===e.currentTokenParent.kind&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function Z(e){return 2!==e.formattingRequestKind}function $(e){return 264===e.contextNode.kind}function ee(e){return 184===e.contextNode.kind}function te(e){return 177===e.contextNode.kind}function re(e,t){if(29!==e.kind&&31!==e.kind)return !1;switch(t.kind){case 180:case 213:case 262:case 260:case 228:case 261:case 259:case 215:case 216:case 171:case 170:case 176:case 177:case 210:case 211:case 230:return !0;default:return !1}}function ne(e){return re(e.currentTokenSpan,e.currentTokenParent)||re(e.nextTokenSpan,e.nextTokenParent)}function ie(e){return 213===e.contextNode.kind}function ae(e){return 114===e.currentTokenSpan.kind&&219===e.currentTokenParent.kind}function oe(e){return 226===e.contextNode.kind&&void 0!==e.contextNode.expression}function se(e){return 232===e.contextNode.kind}function ce(e){return !function(e){switch(e.contextNode.kind){case 242:case 245:case 246:case 247:case 243:case 244:return !0;default:return !1}}(e)}function le(t){var r=t.nextTokenSpan.kind,n=t.nextTokenSpan.pos;if(e.isTrivia(r)){var i=t.nextTokenParent===t.currentTokenParent?e.findNextToken(t.currentTokenParent,e.findAncestor(t.currentTokenParent,(function(e){return !e.parent})),t.sourceFile):t.nextTokenParent.getFirstToken(t.sourceFile);if(!i)return !0;r=i.kind,n=i.getStart(t.sourceFile);}return t.sourceFile.getLineAndCharacterOfPosition(t.currentTokenSpan.pos).line===t.sourceFile.getLineAndCharacterOfPosition(n).line?19===r||1===r:237!==r&&26!==r&&(261===t.contextNode.kind||262===t.contextNode.kind?!e.isPropertySignature(t.currentTokenParent)||!!t.currentTokenParent.type||20!==r:e.isPropertyDeclaration(t.currentTokenParent)?!t.currentTokenParent.initializer:245!==t.currentTokenParent.kind&&239!==t.currentTokenParent.kind&&237!==t.currentTokenParent.kind&&22!==r&&20!==r&&39!==r&&40!==r&&43!==r&&13!==r&&27!==r&&225!==r&&15!==r&&14!==r&&24!==r)}function ue(t){return e.positionIsASICandidate(t.currentTokenSpan.end,t.currentTokenParent,t.sourceFile)}function _e(t){return !e.isPropertyAccessExpression(t.contextNode)||!e.isNumericLiteral(t.contextNode.expression)||-1!==t.contextNode.expression.getText().indexOf(".")}t.getAllRules=function(){for(var a=[],T=0;T<=162;T++)1!==T&&a.push(T);function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return {tokens:a.filter((function(t){return !e.some((function(e){return e===t}))})),isSpecific:!1}}var P={tokens:a,isSpecific:!1},X=i(n$4(n$4([],a,!0),[3],!1)),re=i(n$4(n$4([],a,!0),[1],!1)),de=o(81,162),pe=o(29,78),fe=[101,102,162,128,140],ge=n$4([79],e.typeKeywords,!0),me=X,ye=i([79,3,84,93,100]),ve=i([21,3,90,111,96,91]),he=[r("IgnoreBeforeComment",P,[2,3],t.anyContext,1),r("IgnoreAfterLineComment",2,P,t.anyContext,1),r("NotSpaceBeforeColon",P,58,[z,m,y],16),r("SpaceAfterColon",58,P,[z,m],4),r("NoSpaceBeforeQuestionMark",P,57,[z,m,y],16),r("SpaceAfterQuestionMarkInConditionalOperator",57,P,[z,h],4),r("NoSpaceAfterQuestionMark",57,P,[z],16),r("NoSpaceBeforeDot",P,[24,28],[z,_e],16),r("NoSpaceAfterDot",[24,28],P,[z],16),r("NoSpaceBetweenImportParenInImportType",100,20,[z,J],16),r("NoSpaceAfterUnaryPrefixOperator",[45,46,54,53],[8,9,79,20,22,18,108,103],[z,m],16),r("NoSpaceAfterUnaryPreincrementOperator",45,[79,20,108,103],[z],16),r("NoSpaceAfterUnaryPredecrementOperator",46,[79,20,108,103],[z],16),r("NoSpaceBeforeUnaryPostincrementOperator",[79,21,23,103],45,[z,ce],16),r("NoSpaceBeforeUnaryPostdecrementOperator",[79,21,23,103],46,[z,ce],16),r("SpaceAfterPostincrementWhenFollowedByAdd",45,39,[z,g],4),r("SpaceAfterAddWhenFollowedByUnaryPlus",39,39,[z,g],4),r("SpaceAfterAddWhenFollowedByPreincrement",39,45,[z,g],4),r("SpaceAfterPostdecrementWhenFollowedBySubtract",46,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByUnaryMinus",40,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByPredecrement",40,46,[z,g],4),r("NoSpaceAfterCloseBrace",19,[27,26],[z],16),r("NewLineBeforeCloseBraceInBlockContext",X,19,[S],8),r("SpaceAfterCloseBrace",19,E(21),[z,w],4),r("SpaceBetweenCloseBraceAndElse",19,91,[z],4),r("SpaceBetweenCloseBraceAndWhile",19,115,[z],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("SpaceAfterConditionalClosingParen",21,22,[I],4),r("NoSpaceBetweenFunctionKeywordAndStar",98,41,[A],16),r("SpaceAfterStarInGeneratorDeclaration",41,79,[A],4),r("SpaceAfterFunctionInFuncDecl",98,P,[k],4),r("NewLineAfterOpenBraceInBlockContext",18,P,[S],8),r("SpaceAfterGetSetInMember",[137,151],79,[k],4),r("NoSpaceBetweenYieldKeywordAndStar",125,41,[z,oe],16),r("SpaceBetweenYieldOrYieldStarAndOperand",[125,41],P,[z,oe],4),r("NoSpaceBetweenReturnAndSemicolon",105,26,[z],16),r("SpaceAfterCertainKeywords",[113,109,103,89,105,112,133],P,[z],4),r("SpaceAfterLetConstInVariableDeclaration",[119,85],P,[z,Y],4),r("NoSpaceBeforeOpenParenInFuncCall",P,20,[z,M,L],16),r("SpaceBeforeBinaryKeywordOperator",P,fe,[z,g],4),r("SpaceAfterBinaryKeywordOperator",fe,P,[z,g],4),r("SpaceAfterVoidOperator",114,P,[z,ae],4),r("SpaceBetweenAsyncAndOpenParen",132,20,[j,z],4),r("SpaceBetweenAsyncAndFunctionKeyword",132,[98,79],[z],4),r("NoSpaceBetweenTagAndTemplateString",[79,21],[14,15],[z],16),r("SpaceBeforeJsxAttribute",P,79,[q,z],4),r("SpaceBeforeSlashInJsxOpeningElement",P,43,[H,z],4),r("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",43,31,[H,z],16),r("NoSpaceBeforeEqualInJsxAttribute",P,63,[W,z],16),r("NoSpaceAfterEqualInJsxAttribute",63,P,[W,z],16),r("NoSpaceAfterModuleImport",[142,147],20,[z],16),r("SpaceAfterCertainTypeScriptKeywords",[126,127,84,136,88,92,93,94,137,117,100,118,142,143,121,123,122,146,151,124,154,158,141,138],P,[z],4),r("SpaceBeforeCertainTypeScriptKeywords",P,[94,117,158],[z],4),r("SpaceAfterModuleName",10,18,[$],4),r("SpaceBeforeArrow",P,38,[z],4),r("SpaceAfterArrow",38,P,[z],4),r("NoSpaceAfterEllipsis",25,79,[z],16),r("NoSpaceAfterOptionalParameters",57,[21,27],[z,m],16),r("NoSpaceBetweenEmptyInterfaceBraceBrackets",18,19,[z,ee],16),r("NoSpaceBeforeOpenAngularBracket",ge,29,[z,ne],16),r("NoSpaceBetweenCloseParenAndAngularBracket",21,29,[z,ne],16),r("NoSpaceAfterOpenAngularBracket",29,P,[z,ne],16),r("NoSpaceBeforeCloseAngularBracket",P,31,[z,ne],16),r("NoSpaceAfterCloseAngularBracket",31,[20,22,31,27],[z,ne,N],16),r("SpaceBeforeAt",[21,79],59,[z],4),r("NoSpaceAfterAt",59,P,[z],16),r("SpaceAfterDecorator",P,[126,79,93,88,84,124,123,121,122,137,151,22,41],[Q],4),r("NoSpaceBeforeNonNullAssertionOperator",P,53,[z,se],16),r("NoSpaceAfterNewKeywordOnConstructorSignature",103,20,[z,te],16),r("SpaceLessThanAndNonJSXTypeAnnotation",29,29,[z],4)],be=[r("SpaceAfterConstructor",135,20,[c("insertSpaceAfterConstructor"),z],4),r("NoSpaceAfterConstructor",135,20,[u("insertSpaceAfterConstructor"),z],16),r("SpaceAfterComma",27,P,[c("insertSpaceAfterCommaDelimiter"),z,K,R,B],4),r("NoSpaceAfterComma",27,P,[u("insertSpaceAfterCommaDelimiter"),z,K],16),r("SpaceAfterAnonymousFunctionKeyword",[98,41],20,[c("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],4),r("NoSpaceAfterAnonymousFunctionKeyword",[98,41],20,[u("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],16),r("SpaceAfterKeywordInControl",de,20,[c("insertSpaceAfterKeywordsInControlFlowStatements"),I],4),r("NoSpaceAfterKeywordInControl",de,20,[u("insertSpaceAfterKeywordsInControlFlowStatements"),I],16),r("SpaceAfterOpenParen",20,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBeforeCloseParen",P,21,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBetweenOpenParens",20,20,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("NoSpaceBetweenParens",20,21,[z],16),r("NoSpaceAfterOpenParen",20,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("NoSpaceBeforeCloseParen",P,21,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("SpaceAfterOpenBracket",22,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("SpaceBeforeCloseBracket",P,23,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("NoSpaceBetweenBrackets",22,23,[z],16),r("NoSpaceAfterOpenBracket",22,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("NoSpaceBeforeCloseBracket",P,23,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("SpaceAfterOpenBrace",18,P,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("SpaceBeforeCloseBrace",P,19,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("NoSpaceAfterOpenBrace",18,P,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("NoSpaceBeforeCloseBrace",P,19,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("SpaceBetweenEmptyBraceBrackets",18,19,[c("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[l("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),z],16),r("SpaceAfterTemplateHeadAndMiddle",[15,16],P,[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],4,1),r("SpaceBeforeTemplateMiddleAndTail",P,[16,17],[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],4),r("NoSpaceAfterTemplateHeadAndMiddle",[15,16],P,[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],16,1),r("NoSpaceBeforeTemplateMiddleAndTail",P,[16,17],[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],16),r("SpaceAfterOpenBraceInJsxExpression",18,P,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("SpaceBeforeCloseBraceInJsxExpression",P,19,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("NoSpaceAfterOpenBraceInJsxExpression",18,P,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("NoSpaceBeforeCloseBraceInJsxExpression",P,19,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("SpaceAfterSemicolonInFor",26,P,[c("insertSpaceAfterSemicolonInForStatements"),z,p],4),r("NoSpaceAfterSemicolonInFor",26,P,[u("insertSpaceAfterSemicolonInForStatements"),z,p],16),r("SpaceBeforeBinaryOperator",P,pe,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("SpaceAfterBinaryOperator",pe,P,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("NoSpaceBeforeBinaryOperator",P,pe,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("NoSpaceAfterBinaryOperator",pe,P,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("SpaceBeforeOpenParenInFuncDecl",P,20,[c("insertSpaceBeforeFunctionParenthesis"),z,k],4),r("NoSpaceBeforeOpenParenInFuncDecl",P,20,[u("insertSpaceBeforeFunctionParenthesis"),z,k],16),r("NewLineBeforeOpenBraceInControl",ve,18,[c("placeOpenBraceOnNewLineForControlBlocks"),I,D],8,1),r("NewLineBeforeOpenBraceInFunction",me,18,[c("placeOpenBraceOnNewLineForFunctions"),k,D],8,1),r("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",ye,18,[c("placeOpenBraceOnNewLineForFunctions"),F,D],8,1),r("SpaceAfterTypeAssertion",31,P,[c("insertSpaceAfterTypeAssertion"),z,ie],4),r("NoSpaceAfterTypeAssertion",31,P,[u("insertSpaceAfterTypeAssertion"),z,ie],16),r("SpaceBeforeTypeAnnotation",P,[57,58],[c("insertSpaceBeforeTypeAnnotation"),z,v],4),r("NoSpaceBeforeTypeAnnotation",P,[57,58],[u("insertSpaceBeforeTypeAnnotation"),z,v],16),r("NoOptionalSemicolon",26,re,[s("semicolons",e.SemicolonPreference.Remove),le],32),r("OptionalSemicolon",P,re,[s("semicolons",e.SemicolonPreference.Insert),ue],64)],xe=[r("NoSpaceBeforeSemicolon",P,26,[z],16),r("SpaceBeforeOpenBraceInControl",ve,18,[_("placeOpenBraceOnNewLineForControlBlocks"),I,Z,b],4,1),r("SpaceBeforeOpenBraceInFunction",me,18,[_("placeOpenBraceOnNewLineForFunctions"),k,C,Z,b],4,1),r("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",ye,18,[_("placeOpenBraceOnNewLineForFunctions"),F,Z,b],4,1),r("NoSpaceBeforeComma",P,27,[z],16),r("NoSpaceBeforeOpenBracket",E(132,82),22,[z],16),r("NoSpaceAfterCloseBracket",23,P,[z,G],16),r("SpaceAfterSemicolon",26,P,[z],4),r("SpaceBetweenForAndAwaitKeyword",97,133,[z],4),r("SpaceBetweenStatements",[21,90,91,82],P,[z,K,f],4),r("SpaceAfterTryCatchFinally",[111,83,96],18,[z],4)];return n$4(n$4(n$4([],he,!0),be,!0),xe,!0)};}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r;function n(e){var t=0;return 1&e&&(t|=28),2&e&&(t|=96),28&e&&(t|=28),96&e&&(t|=96),t}function i(t,r){return e.Debug.assert(t<=162&&r<=162,"Must compute formatting context from tokens"),t*o+r}t.getFormatContext=function(a,c){return {options:a,getRules:(void 0===r&&(l=t.getAllRules(),u=function(e){for(var t=new Array(o*o),r=new Array(t.length),n=0,a=e;n<a.length;n++)for(var c=a[n],l=c.leftTokenRange.isSpecific&&c.rightTokenRange.isSpecific,u=0,_=c.leftTokenRange.tokens;u<_.length;u++)for(var d=_[u],p=0,f=c.rightTokenRange.tokens;p<f.length;p++){var g=i(d,f[p]),m=t[g];void 0===m&&(m=t[g]=[]),s(m,c.rule,l,r,g);}return t}(l),r=function(t){var r=u[i(t.currentTokenSpan.kind,t.nextTokenSpan.kind)];if(r){for(var a=[],o=0,s=0,c=r;s<c.length;s++){var l=c[s],_=~n(o);l.action&_&&e.every(l.context,(function(e){return e(t)}))&&(a.push(l),o|=l.action);}if(a.length)return a}}),r),host:c};var l,u;};var a,o=163;function s(r,n,i,o,s){var c,l,u,_=3&n.action?i?a.StopRulesSpecific:a.StopRulesAny:n.context!==t.anyContext?i?a.ContextRulesSpecific:a.ContextRulesAny:i?a.NoContextRulesSpecific:a.NoContextRulesAny,d=o[s]||0;r.splice(function(e,t){for(var r=0,n=0;n<=t;n+=5)r+=31&e,e>>=5;return r}(d,_),0,n),o[s]=(u=1+((c=d)>>(l=_)&31),e.Debug.assert((31&u)===u,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),c&~(31<<l)|u<<l);}!function(e){e[e.StopRulesSpecific=0]="StopRulesSpecific",e[e.StopRulesAny=5]="StopRulesAny",e[e.ContextRulesSpecific=10]="ContextRulesSpecific",e[e.ContextRulesAny=15]="ContextRulesAny",e[e.NoContextRulesSpecific=20]="NoContextRulesSpecific",e[e.NoContextRulesAny=25]="NoContextRulesAny";}(a||(a={}));}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r,n,i,a,o;function s(t,r,n){var i=e.findPrecedingToken(t,n);return i&&i.kind===r&&t===i.getEnd()?i:void 0}function c(e){for(var t=e;t&&t.parent&&t.parent.end===e.end&&!l(t.parent,t);)t=t.parent;return t}function l(t,r){switch(t.kind){case 260:case 261:return e.rangeContainsRange(t.members,r);case 264:var n=t.body;return !!n&&265===n.kind&&e.rangeContainsRange(n.statements,r);case 308:case 238:case 265:return e.rangeContainsRange(t.statements,r);case 295:return e.rangeContainsRange(t.block.statements,r)}return !1}function u(t,r,n,i){return t?_({pos:e.getLineStartPositionForPosition(t.getStart(r),r),end:t.end},r,n,i):[]}function _(r,n,i,a){var o=function(t,r){return function n(i){var a=e.forEachChild(i,(function(n){return e.startEndContainsRange(n.getStart(r),n.end,t)&&n}));if(a){var o=n(a);if(o)return o}return i}(r)}(r,n);return t.getFormattingScanner(n.text,n.languageVariant,function(t,r,n){var i=t.getStart(n);if(i===r.pos&&t.end===r.end)return i;var a=e.findPrecedingToken(r.pos,n);return a?a.end>=r.pos?t.pos:a.end:t.pos}(o,r,n),r.end,(function(s){return d(r,o,t.SmartIndenter.getIndentationForNode(o,r,n,i.options),function(e,r,n){for(var i,a=-1;e;){var o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==a&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(r,e,i,n))return r.indentSize;a=o,i=e,e=e.parent;}return 0}(o,i.options,n),s,i,a,function(t,r){if(!t.length)return a;var n=t.filter((function(t){return e.rangeOverlapsWithStartEnd(r,t.start,t.start+t.length)})).sort((function(e,t){return e.start-t.start}));if(!n.length)return a;var i=0;return function(t){for(;;){if(i>=n.length)return !1;var r=n[i];if(t.end<=r.start)return !1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,r.start,r.start+r.length))return !0;i++;}};function a(){return !1}}(n.parseDiagnostics,r),n)}))}function d(r,n,i,a,o,s,c,l,u){var _,d,f,g,m,y,v=s.options,h=s.getRules,b=s.host,x=new t.FormattingContext(u,c,v),D=-1,S=[];if(o.advance(),o.isOnToken()){var T=u.getLineAndCharacterOfPosition(n.getStart(u)).line,C=T;e.hasDecorators(n)&&(C=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(n,u)).line),function n(i,a,s,c,_,p){if(e.rangeOverlapsWithStartEnd(r,i.getStart(u),i.getEnd())){var g=F(i,s,_,p),m=a;for(e.forEachChild(i,(function(e){b(e,-1,i,g,s,c,!1);}),(function(n){!function(n,a,s,c){e.Debug.assert(e.isNodeArray(n)),e.Debug.assert(!e.nodeIsSynthesized(n));var l=function(e,t){switch(e.kind){case 173:case 259:case 215:case 171:case 170:case 216:case 176:case 177:case 181:case 182:case 174:case 175:if(e.typeParameters===t)return 29;if(e.parameters===t)return 20;break;case 210:case 211:if(e.typeArguments===t)return 29;if(e.arguments===t)return 20;break;case 260:case 228:case 261:case 262:if(e.typeParameters===t)return 29;break;case 180:case 212:case 183:case 230:case 202:if(e.typeArguments===t)return 29;break;case 184:return 18}return 0}(a,n),_=c,d=s;if(e.rangeOverlapsWithStartEnd(r,n.pos,n.end)){if(0!==l)for(;o.isOnToken()&&o.getStartPos()<r.end&&!((y=o.readTokenInfo(a)).token.end>n.pos);)if(y.token.kind===l){d=u.getLineAndCharacterOfPosition(y.token.pos).line,x(y,a,c,a);var p=void 0;if(-1!==D)p=D;else {var f=e.getLineStartPositionForPosition(y.token.pos,u);p=t.SmartIndenter.findFirstNonWhitespaceColumn(f,y.token.pos,u,v);}_=F(a,s,p,v.indentSize);}else x(y,a,c,a);for(var g=-1,m=0;m<n.length;m++)g=b(n[m],g,i,_,d,d,!0,0===m);var y,h=function(e){switch(e){case 20:return 21;case 29:return 31;case 18:return 19}return 0}(l);0!==h&&o.isOnToken()&&o.getStartPos()<r.end&&(27===(y=o.readTokenInfo(a)).token.kind&&(x(y,a,_,a),y=o.isOnToken()?o.readTokenInfo(a):void 0),y&&y.token.kind===h&&e.rangeContainsRange(a,y.token)&&x(y,a,_,a,!0));}else n.end<r.pos&&o.skipToEndOf(n);}(n,i,s,g);}));o.isOnToken()&&o.getStartPos()<r.end;){var h=o.readTokenInfo(i);if(h.token.end>Math.min(i.end,r.end))break;x(h,i,g,i);}}function b(a,s,c,l,_,d,p,f){if(e.Debug.assert(!e.nodeIsSynthesized(a)),e.nodeIsMissing(a))return s;var g=a.getStart(u),h=u.getLineAndCharacterOfPosition(g).line,b=h;e.hasDecorators(a)&&(b=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(a,u)).line);var S=-1;if(p&&e.rangeContainsRange(r,c)&&(S=function(r,n,i,a,o){if(e.rangeOverlapsWithStartEnd(a,r,n)||e.rangeContainsStartEnd(a,r,n)){if(-1!==o)return o}else {var s=u.getLineAndCharacterOfPosition(r).line,c=e.getLineStartPositionForPosition(r,u),l=t.SmartIndenter.findFirstNonWhitespaceColumn(c,r,u,v);if(s!==i||r===l){var _=t.SmartIndenter.getBaseIndentation(v);return _>l?_:l}}return -1}(g,a.end,_,r,s),-1!==S&&(s=S)),!e.rangeOverlapsWithStartEnd(r,a.pos,a.end))return a.end<r.pos&&o.skipToEndOf(a),s;if(0===a.getFullWidth())return s;for(;o.isOnToken()&&o.getStartPos()<r.end;){if((T=o.readTokenInfo(i)).token.end>r.end)return s;if(T.token.end>g){T.token.pos>g&&o.skipToStartOf(a);break}x(T,i,l,i);}if(!o.isOnToken()||o.getStartPos()>=r.end)return s;if(e.isToken(a)){var T=o.readTokenInfo(a);if(11!==a.kind)return e.Debug.assert(T.token.end===a.end,"Token end is child end"),x(T,i,l,a),s}var C=167===a.kind?h:d,E=function(e,r,n,i,a,o){var s=t.SmartIndenter.shouldIndentChildNode(v,e)?v.indentSize:0;return o===r?{indentation:r===y?D:a.getIndentation(),delta:Math.min(v.indentSize,a.getDelta(e)+s)}:-1===n?20===e.kind&&r===y?{indentation:D,delta:a.getDelta(e)}:t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(i,e,r,u)||t.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(i,e,r,u)||t.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(i,e,r,u)?{indentation:a.getIndentation(),delta:s}:{indentation:a.getIndentation()+a.getDelta(e),delta:s}:{indentation:n,delta:s}}(a,h,S,i,l,C);return n(a,m,h,b,E.indentation,E.delta),m=i,f&&206===c.kind&&-1===s&&(s=E.indentation),s}function x(t,n,i,a,s){e.Debug.assert(e.rangeContainsRange(n,t.token));var c=o.lastTrailingTriviaWasNewLine(),_=!1;t.leadingTrivia&&w(t.leadingTrivia,n,m,i);var p=0,g=e.rangeContainsRange(r,t.token),v=u.getLineAndCharacterOfPosition(t.token.pos);if(g){var h=l(t.token),b=f;if(p=I(t.token,v,n,m,i),!h)if(0===p){var x=b&&u.getLineAndCharacterOfPosition(b.end).line;_=c&&v.line!==x;}else _=1===p;}if(t.trailingTrivia&&(d=e.last(t.trailingTrivia).end,w(t.trailingTrivia,n,m,i)),_){var S=g&&!l(t.token)?i.getIndentationForToken(v.line,t.token.kind,a,!!s):-1,T=!0;if(t.leadingTrivia){var C=i.getIndentationForComment(t.token.kind,S,a);T=P(t.leadingTrivia,C,T,(function(e){return M(e.pos,C,!1)}));}-1!==S&&T&&(M(t.token.pos,S,1===p),y=v.line,D=S);}o.advance(),m=n;}}(n,n,T,C,i,a);}if(!o.isOnToken()){var E=t.SmartIndenter.nodeWillIndentChild(v,n,void 0,u,!1)?i+v.indentSize:i,k=o.getCurrentLeadingTrivia();k&&(P(k,E,!1,(function(e){return I(e,u.getLineAndCharacterOfPosition(e.pos),n,n,void 0)})),!1!==v.trimTrailingWhitespace&&function(t){for(var n=f?f.end:r.pos,i=0,a=t;i<a.length;i++){var o=a[i];e.isComment(o.kind)&&(n<o.pos&&j(n,o.pos-1,f),n=o.end+1);}n<r.end&&j(n,r.end,f);}(k));}if(f&&o.getStartPos()>=r.end){var N=o.isOnEOF()?o.readEOFTokenRange():o.isOnToken()?o.readTokenInfo(n).token:void 0;if(N&&N.pos===d){var A=(null===(_=e.findPrecedingToken(N.end,u,n))||void 0===_?void 0:_.parent)||g;O(N,u.getLineAndCharacterOfPosition(N.pos).line,A,f,m,g,A,void 0);}}return S;function F(r,n,i,a){return {getIndentationForComment:function(e,t,r){switch(e){case 19:case 23:case 21:return i+o(r)}return -1!==t?t:i},getIndentationForToken:function(t,a,s,c){return !c&&function(t,i,a){switch(i){case 18:case 19:case 21:case 91:case 115:case 59:return !1;case 43:case 31:switch(a.kind){case 283:case 284:case 282:return !1}break;case 22:case 23:if(197!==a.kind)return !1}return n!==t&&!(e.hasDecorators(r)&&i===function(t){if(e.canHaveModifiers(t)){var r=e.find(t.modifiers,e.isModifier,e.findIndex(t.modifiers,e.isDecorator));if(r)return r.kind}switch(t.kind){case 260:return 84;case 261:return 118;case 259:return 98;case 263:return 263;case 174:return 137;case 175:return 151;case 171:if(t.asteriskToken)return 41;case 169:case 166:var n=e.getNameOfDeclaration(t);if(n)return n.kind}}(r))}(t,a,s)?i+o(s):i},getIndentation:function(){return i},getDelta:o,recomputeIndentation:function(e,n){t.SmartIndenter.shouldIndentChildNode(v,n,r,u)&&(i+=e?v.indentSize:-v.indentSize,a=t.SmartIndenter.shouldIndentChildNode(v,r)?v.indentSize:0);}};function o(e){return t.SmartIndenter.nodeWillIndentChild(v,r,e,u,!0)?a:0}}function P(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=e.rangeContainsRange(r,c);switch(c.kind){case 3:l&&L(c,n,!i),i=!1;break;case 2:i&&l&&a(c),i=!1;break;case 4:i=!0;}}return i}function w(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o];e.isComment(c.kind)&&e.rangeContainsRange(r,c)&&I(c,u.getLineAndCharacterOfPosition(c.pos),n,i,a);}}function I(e,t,n,i,a){var o=0;return l(e)||(f?o=O(e,t.line,n,f,m,g,i,a):R(u.getLineAndCharacterOfPosition(r.pos).line,t.line)),f=e,d=e.end,g=n,m=t.line,o}function O(t,r,n,i,a,o,s,c){x.updateContext(i,o,t,n,s);var l=h(x),_=!1!==x.options.trimTrailingWhitespace,d=0;return l?e.forEachRight(l,(function(o){if(d=function(t,r,n,i,a){var o,s=a!==n;switch(t.action){case 1:return 0;case 16:if(r.end!==i.pos)return J(r.end,i.pos-r.end),s?2:0;break;case 32:J(r.pos,r.end-r.pos);break;case 8:if(1!==t.flags&&n!==a)return 0;if(1!=a-n)return z(r.end,i.pos-r.end,e.getNewLineOrDefaultFromHost(b,v)),s?0:1;break;case 4:if(1!==t.flags&&n!==a)return 0;if(1!=i.pos-r.end||32!==u.text.charCodeAt(r.end))return z(r.end,i.pos-r.end," "),s?2:0;break;case 64:o=r.end,S.push(e.createTextChangeFromStartLength(o,0,";"));}return 0}(o,i,a,t,r),c)switch(d){case 2:n.getStart(u)===t.pos&&c.recomputeIndentation(!1,s);break;case 1:n.getStart(u)===t.pos&&c.recomputeIndentation(!0,s);break;default:e.Debug.assert(0===d);}_=_&&!(16&o.action)&&1!==o.flags;})):_=_&&1!==t.kind,r!==a&&_&&R(a,r,i),d}function M(t,r,n){var i=p(r,v);if(n)z(t,0,i);else {var a=u.getLineAndCharacterOfPosition(t),o=e.getStartPositionOfLine(a.line,u);(r!==function(e,t){for(var r=0,n=0;n<t;n++)9===u.text.charCodeAt(e+n)?r+=v.tabSize-r%v.tabSize:r++;return r}(o,a.character)||function(e,t){return e!==u.text.substr(t,e.length)}(i,o))&&z(o,a.character,i);}}function L(r,n,i,a){void 0===a&&(a=!0);var o=u.getLineAndCharacterOfPosition(r.pos).line,s=u.getLineAndCharacterOfPosition(r.end).line;if(o!==s){for(var c=[],l=r.pos,_=o;_<s;_++){var d=e.getEndLinePosition(_,u);c.push({pos:l,end:d}),l=e.getStartPositionOfLine(_+1,u);}if(a&&c.push({pos:l,end:r.end}),0!==c.length){var f=e.getStartPositionOfLine(o,u),g=t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(f,c[0].pos,u,v),m=0;i&&(m=1,o++);for(var y=n-g.column,h=m;h<c.length;h++,o++){var b=e.getStartPositionOfLine(o,u),x=0===h?g:t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(c[h].pos,c[h].end,u,v),D=x.column+y;if(D>0){var S=p(D,v);z(b,x.character,S);}else J(b,x.character);}}}else i||M(r.pos,n,!1);}function R(t,r,n){for(var i=t;i<r;i++){var a=e.getStartPositionOfLine(i,u),o=e.getEndLinePosition(i,u);if(!(n&&(e.isComment(n.kind)||e.isStringOrRegularExpressionOrTemplateLiteral(n.kind))&&n.pos<=o&&n.end>o)){var s=B(a,o);-1!==s&&(e.Debug.assert(s===a||!e.isWhiteSpaceSingleLine(u.text.charCodeAt(s-1))),J(s,o+1-s));}}}function B(t,r){for(var n=r;n>=t&&e.isWhiteSpaceSingleLine(u.text.charCodeAt(n));)n--;return n!==r?n+1:-1}function j(e,t,r){R(u.getLineAndCharacterOfPosition(e).line,u.getLineAndCharacterOfPosition(t).line+1,r);}function J(t,r){r&&S.push(e.createTextChangeFromStartLength(t,r,""));}function z(t,r,n){(r||n)&&S.push(e.createTextChangeFromStartLength(t,r,n));}}function p(t,r){if((!i||i.tabSize!==r.tabSize||i.indentSize!==r.indentSize)&&(i={tabSize:r.tabSize,indentSize:r.indentSize},a=o=void 0),r.convertTabsToSpaces){var n=void 0,s=Math.floor(t/r.indentSize),c=t%r.indentSize;return o||(o=[]),void 0===o[s]?(n=e.repeatString(" ",r.indentSize*s),o[s]=n):n=o[s],c?n+e.repeatString(" ",c):n}var l=Math.floor(t/r.tabSize),u=t-l*r.tabSize,_=void 0;return a||(a=[]),void 0===a[l]?a[l]=_=e.repeatString("\t",l):_=a[l],u?_+e.repeatString(" ",u):_}t.createTextRangeWithKind=function(t,r,n){var i={pos:t,end:r,kind:n};return e.Debug.isDebugging&&Object.defineProperty(i,"__debugKind",{get:function(){return e.Debug.formatSyntaxKind(n)}}),i},function(e){e[e.Unknown=-1]="Unknown";}(r||(r={})),t.formatOnEnter=function(t,r,n){var i=r.getLineAndCharacterOfPosition(t).line;if(0===i)return [];for(var a=e.getEndLinePosition(i,r);e.isWhiteSpaceSingleLine(r.text.charCodeAt(a));)a--;return e.isLineBreak(r.text.charCodeAt(a))&&a--,_({pos:e.getStartPositionOfLine(i-1,r),end:a+1},r,n,2)},t.formatOnSemicolon=function(e,t,r){return u(c(s(e,26,t)),t,r,3)},t.formatOnOpeningCurly=function(t,r,n){var i=s(t,18,r);if(!i)return [];var a=c(i.parent);return _({pos:e.getLineStartPositionForPosition(a.getStart(r),r),end:t},r,n,4)},t.formatOnClosingCurly=function(e,t,r){return u(c(s(e,19,t)),t,r,5)},t.formatDocument=function(e,t){return _({pos:0,end:e.text.length},e,t,0)},t.formatSelection=function(t,r,n,i){return _({pos:e.getLineStartPositionForPosition(t,n),end:r},n,i,1)},t.formatNodeGivenIndentation=function(e,r,n,i,a,o){var s={pos:e.pos,end:e.end};return t.getFormattingScanner(r.text,n,s.pos,s.end,(function(t){return d(s,e,i,a,t,o,1,(function(e){return !1}),r)}))},function(e){e[e.None=0]="None",e[e.LineAdded=1]="LineAdded",e[e.LineRemoved=2]="LineRemoved";}(n||(n={})),t.getRangeOfEnclosingComment=function(t,r,n,i){void 0===i&&(i=e.getTokenAtPosition(t,r));var a=e.findAncestor(i,e.isJSDoc);if(a&&(i=a.parent),!(i.getStart(t)<=r&&r<i.getEnd())){var o=(n=null===n?void 0:void 0===n?e.findPrecedingToken(r,t):n)&&e.getTrailingCommentRanges(t.text,n.end),s=e.getLeadingCommentRangesOfNode(i,t),c=e.concatenate(o,s);return c&&e.find(c,(function(n){return e.rangeContainsPositionExclusive(n,r)||r===n.end&&(2===n.kind||r===t.getFullWidth())}))}},t.getIndentationString=p;}(e.formatting||(e.formatting={}));}(t),function(e){var t;(function(r){var n,i;function a(e){return e.baseIndentSize||0}function o(e,t,r,n,i,o,l){for(var f,g=e.parent;g;){var y=!0;if(r){var v=e.getStart(i);y=v<r.pos||v>r.end;}var h=s(g,e,i),b=h.line===t.line||d(g,e,t.line,i);if(y){var x=null===(f=p(e,i))||void 0===f?void 0:f[0],S=m(e,i,l,!!x&&u(x,i).line>h.line);if(-1!==S)return S+n;if(-1!==(S=c(e,g,t,b,i,l)))return S+n}D(l,g,e,i,o)&&!b&&(n+=l.indentSize);var T=_(g,e,t.line,i);g=(e=g).parent,t=T?i.getLineAndCharacterOfPosition(e.getStart(i)):h;}return n+a(l)}function s(e,t,r){var n=p(t,r),i=n?n.pos:e.getStart(r);return r.getLineAndCharacterOfPosition(i)}function c(t,r,n,i,a,o){return !e.isDeclaration(t)&&!e.isStatementButNotDeclaration(t)||308!==r.kind&&i?-1:v(n,a,o)}function l(t,r,n,i){var a=e.findNextToken(t,r,i);return a?18===a.kind?1:19===a.kind&&n===u(a,i).line?2:0:0}function u(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function _(t,r,n,i){if(!e.isCallExpression(t)||!e.contains(t.arguments,r))return !1;var a=t.expression.getEnd();return e.getLineAndCharacterOfPosition(i,a).line===n}function d(t,r,n,i){if(242===t.kind&&t.elseStatement===r){var a=e.findChildOfKind(t,91,i);return e.Debug.assert(void 0!==a),u(a,i).line===n}return !1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(t,r,n,i){switch(n.kind){case 180:return a(n.typeArguments);case 207:return a(n.properties);case 206:case 272:case 276:case 203:case 204:return a(n.elements);case 184:return a(n.members);case 259:case 215:case 216:case 171:case 170:case 176:case 173:case 182:case 177:return a(n.typeParameters)||a(n.parameters);case 174:return a(n.parameters);case 260:case 228:case 261:case 262:case 347:return a(n.typeParameters);case 211:case 210:return a(n.typeArguments)||a(n.arguments);case 258:return a(n.declarations)}function a(a){return a&&e.rangeContainsStartEnd(function(e,t,r){for(var n=e.getChildren(r),i=1;i<n.length-1;i++)if(n[i].pos===t.pos&&n[i].end===t.end)return {pos:n[i-1].end,end:n[i+1].getStart(r)};return t}(n,a,i),t,r)?a:void 0}}function g(e,t,r){return e?v(t.getLineAndCharacterOfPosition(e.pos),t,r):-1}function m(e,t,r,n){if(e.parent&&258===e.parent.kind)return -1;var i=p(e,t);if(i){var a=i.indexOf(e);if(-1!==a){var o=y(i,a,t,r);if(-1!==o)return o}return g(i,t,r)+(n?r.indentSize:0)}return -1}function y(t,r,n,i){e.Debug.assert(r>=0&&r<t.length);for(var a=u(t[r],n),o=r-1;o>=0;o--)if(27!==t[o].kind){if(n.getLineAndCharacterOfPosition(t[o].end).line!==a.line)return v(a,n,i);a=u(t[o],n);}return -1}function v(e,t,r){var n=t.getPositionOfLineAndCharacter(e.line,0);return b(n,n+e.character,t,r)}function h(t,r,n,i){for(var a=0,o=0,s=t;s<r;s++){var c=n.text.charCodeAt(s);if(!e.isWhiteSpaceSingleLine(c))break;9===c?o+=i.tabSize+o%i.tabSize:o++,a++;}return {column:o,character:a}}function b(e,t,r,n){return h(e,t,r,n).column}function x(t,r,n,i,a){var o=n?n.kind:0;switch(r.kind){case 241:case 260:case 228:case 261:case 263:case 262:case 206:case 238:case 265:case 207:case 184:case 197:case 186:case 266:case 293:case 292:case 214:case 208:case 210:case 211:case 240:case 274:case 250:case 224:case 204:case 203:case 283:case 286:case 282:case 291:case 170:case 176:case 177:case 166:case 181:case 182:case 193:case 212:case 220:case 276:case 272:case 278:case 273:case 169:return !0;case 257:case 299:case 223:if(!t.indentMultiLineObjectLiteralBeginningOnBlankLine&&i&&207===o)return S(i,n);if(223===r.kind&&i&&n&&281===o)return i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,r.pos)).line!==i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,n.pos)).line;if(223!==r.kind)return !0;break;case 243:case 244:case 246:case 247:case 245:case 242:case 259:case 215:case 171:case 173:case 174:case 175:return 238!==o;case 216:return i&&214===o?S(i,n):238!==o;case 275:return 276!==o;case 269:return 270!==o||!!n.namedBindings&&272!==n.namedBindings.kind;case 281:return 284!==o;case 285:return 287!==o;case 190:case 189:if(184===o||186===o)return !1}return a}function D(e,t,r,n,i){return void 0===i&&(i=!1),x(e,t,r,n,!1)&&!(i&&r&&function(e,t){switch(e){case 250:case 254:case 248:case 249:return 238!==t.kind;default:return !1}}(r.kind,t))}function S(t,r){var n=e.skipTrivia(t.text,r.pos);return t.getLineAndCharacterOfPosition(n).line===t.getLineAndCharacterOfPosition(r.end).line}!function(e){e[e.Unknown=-1]="Unknown";}(n||(n={})),r.getIndentation=function(r,n,i,s){if(void 0===s&&(s=!1),r>n.text.length)return a(i);if(i.indentStyle===e.IndentStyle.None)return 0;var c=e.findPrecedingToken(r,n,void 0,!0),_=t.getRangeOfEnclosingComment(n,r,c||null);if(_&&3===_.kind)return function(t,r,n,i){var a=e.getLineAndCharacterOfPosition(t,r).line-1,o=e.getLineAndCharacterOfPosition(t,i.pos).line;if(e.Debug.assert(o>=0),a<=o)return b(e.getStartPositionOfLine(o,t),r,t,n);var s=e.getStartPositionOfLine(a,t),c=h(s,r,t,n),l=c.column,u=c.character;return 0===l?l:42===t.text.charCodeAt(s+u)?l-1:l}(n,r,i,_);if(!c)return a(i);if(e.isStringOrRegularExpressionOrTemplateLiteral(c.kind)&&c.getStart(n)<=r&&r<c.end)return 0;var d=n.getLineAndCharacterOfPosition(r).line,p=e.getTokenAtPosition(n,r),v=18===p.kind&&207===p.parent.kind;if(i.indentStyle===e.IndentStyle.Block||v)return function(t,r,n){for(var i=r;i>0;){var a=t.text.charCodeAt(i);if(!e.isWhiteSpaceLike(a))break;i--;}return b(e.getLineStartPositionForPosition(i,t),i,t,n)}(n,r,i);if(27===c.kind&&223!==c.parent.kind){var x=function(t,r,n){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?y(i.list.getChildren(),i.listItemIndex-1,r,n):-1}(c,n,i);if(-1!==x)return x}var S=function(e,t,r){return t&&f(e,e,t,r)}(r,c.parent,n);if(S&&!e.rangeContainsRange(S,c)){var T=-1!==[215,216].indexOf(p.parent.kind)?0:i.indentSize;return g(S,n,i)+T}return function(t,r,n,i,s,c){for(var _,d=n;d;){if(e.positionBelongsToNode(d,r,t)&&D(c,d,_,t,!0)){var p=u(d,t),f=l(n,d,i,t);return o(d,p,void 0,0!==f?s&&2===f?c.indentSize:0:i!==p.line?c.indentSize:0,t,!0,c)}var g=m(d,t,c,!0);if(-1!==g)return g;_=d,d=d.parent;}return a(c)}(n,r,c,d,s,i)},r.getIndentationForNode=function(e,t,r,n){var i=r.getLineAndCharacterOfPosition(e.getStart(r));return o(e,i,t,0,r,!1,n)},r.getBaseIndentation=a,function(e){e[e.Unknown=0]="Unknown",e[e.OpenBrace=1]="OpenBrace",e[e.CloseBrace=2]="CloseBrace";}(i||(i={})),r.isArgumentAndStartLineOverlapsExpressionBeingCalled=_,r.childStartsOnTheSameLineWithElseInIfStatement=d,r.childIsUnindentedBranchOfConditionalExpression=function(t,r,n,i){if(e.isConditionalExpression(t)&&(r===t.whenTrue||r===t.whenFalse)){var a=e.getLineAndCharacterOfPosition(i,t.condition.end).line;if(r===t.whenTrue)return n===a;var o=u(t.whenTrue,i).line,s=e.getLineAndCharacterOfPosition(i,t.whenTrue.end).line;return a===o&&s===n}return !1},r.argumentStartsOnSameLineAsPreviousArgument=function(t,r,n,i){if(e.isCallOrNewExpression(t)){if(!t.arguments)return !1;var a=e.find(t.arguments,(function(e){return e.pos===r.pos}));if(!a)return !1;var o=t.arguments.indexOf(a);if(0===o)return !1;var s=t.arguments[o-1];if(n===e.getLineAndCharacterOfPosition(i,s.getEnd()).line)return !0}return !1},r.getContainingList=p,r.findFirstNonWhitespaceCharacterAndColumn=h,r.findFirstNonWhitespaceColumn=b,r.nodeWillIndentChild=x,r.shouldIndentChildNode=D;})((t=e.formatting||(e.formatting={})).SmartIndenter||(t.SmartIndenter={}));}(t),function(e){!function(t){function r(t){var r=t.__pos;return e.Debug.assert("number"==typeof r),r}function a(t,r){e.Debug.assert("number"==typeof r),t.__pos=r;}function o(t){var r=t.__end;return e.Debug.assert("number"==typeof r),r}function s(t,r){e.Debug.assert("number"==typeof r),t.__end=r;}var c,l;function u(t,r){return e.skipTrivia(t,r,!1,!0)}!function(e){e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine";}(c=t.LeadingTriviaOption||(t.LeadingTriviaOption={})),function(e){e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include";}(l=t.TrailingTriviaOption||(t.TrailingTriviaOption={}));var _,d={leadingTriviaOption:c.Exclude,trailingTriviaOption:l.Exclude};function p(e,t,r,n){return {pos:f(e,t,n),end:m(e,r,n)}}function f(t,r,n,i){var a,o;void 0===i&&(i=!1);var s=n.leadingTriviaOption;if(s===c.Exclude)return r.getStart(t);if(s===c.StartLine){var l=r.getStart(t),_=e.getLineStartPositionForPosition(l,t);return e.rangeContainsPosition(r,_)?_:l}if(s===c.JSDoc){var d=e.getJSDocCommentRanges(r,t.text);if(null==d?void 0:d.length)return e.getLineStartPositionForPosition(d[0].pos,t)}var p=r.getFullStart(),f=r.getStart(t);if(p===f)return f;var g=e.getLineStartPositionForPosition(p,t);if(e.getLineStartPositionForPosition(f,t)===g)return s===c.IncludeAll?p:f;if(i){var m=(null===(a=e.getLeadingCommentRanges(t.text,p))||void 0===a?void 0:a[0])||(null===(o=e.getTrailingCommentRanges(t.text,p))||void 0===o?void 0:o[0]);if(m)return e.skipTrivia(t.text,m.end,!0,!0)}var y=p>0?1:0,v=e.getStartPositionOfLine(e.getLineOfLocalPosition(t,g)+y,t);return v=u(t.text,v),e.getStartPositionOfLine(e.getLineOfLocalPosition(t,v),t)}function g(t,r,n){var i=r.end;if(n.trailingTriviaOption===l.Include){var a=e.getTrailingCommentRanges(t.text,i);if(a)for(var o=e.getLineOfLocalPosition(t,r.end),s=0,c=a;s<c.length;s++){var u=c[s];if(2===u.kind||e.getLineOfLocalPosition(t,u.pos)>o)break;if(e.getLineOfLocalPosition(t,u.end)>o)return e.skipTrivia(t.text,u.end,!0,!0)}}}function m(t,r,n){var i,a=r.end,o=n.trailingTriviaOption;if(o===l.Exclude)return a;if(o===l.ExcludeWhitespace){var s=e.concatenate(e.getTrailingCommentRanges(t.text,a),e.getLeadingCommentRanges(t.text,a));return (null===(i=null==s?void 0:s[s.length-1])||void 0===i?void 0:i.end)||a}var c=g(t,r,n);if(c)return c;var u=e.skipTrivia(t.text,a,!0);return u===a||o!==l.Include&&!e.isLineBreak(t.text.charCodeAt(u-1))?a:u}function y(e,t){return !!t&&!!e.parent&&(27===t.kind||26===t.kind&&207===e.parent.kind)}!function(e){e[e.Remove=0]="Remove",e[e.ReplaceWithSingleNode=1]="ReplaceWithSingleNode",e[e.ReplaceWithMultipleNodes=2]="ReplaceWithMultipleNodes",e[e.Text=3]="Text";}(_||(_={})),t.isThisTypeAnnotatable=function(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)};var v,h=function(){function t(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.newFiles=[],this.classesWithNodesInsertedAtStart=new e.Map,this.deletedNodes=[];}return t.fromContext=function(r){return new t(e.getNewLineOrDefaultFromHost(r.host,r.formatContext.options),r.formatContext)},t.with=function(e,r){var n=t.fromContext(e);return r(n),n.getChanges()},t.prototype.pushRaw=function(t,r){e.Debug.assertEqual(t.fileName,r.fileName);for(var n=0,i=r.textChanges;n<i.length;n++){var a=i[n];this.changes.push({kind:_.Text,sourceFile:t,text:a.newText,range:e.createTextRangeFromSpan(a.span)});}},t.prototype.deleteRange=function(e,t){this.changes.push({kind:_.Remove,sourceFile:e,range:t});},t.prototype.delete=function(e,t){this.deletedNodes.push({sourceFile:e,node:t});},t.prototype.deleteNode=function(e,t,r){void 0===r&&(r={leadingTriviaOption:c.IncludeAll}),this.deleteRange(e,p(e,t,t,r));},t.prototype.deleteNodes=function(e,t,r,n){void 0===r&&(r={leadingTriviaOption:c.IncludeAll});for(var i=0,a=t;i<a.length;i++){var o=a[i],s=f(e,o,r,n),l=m(e,o,r);this.deleteRange(e,{pos:s,end:l}),n=!!g(e,o,r);}},t.prototype.deleteModifier=function(t,r){this.deleteRange(t,{pos:r.getStart(t),end:e.skipTrivia(t.text,r.end,!0)});},t.prototype.deleteNodeRange=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=m(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.deleteNodeRangeExcludingEnd=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=void 0===r?e.text.length:f(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.replaceRange=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithSingleNode,sourceFile:e,range:t,options:n,node:r});},t.prototype.replaceNode=function(e,t,r,n){void 0===n&&(n=d),this.replaceRange(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeRange=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRange(e,p(e,t,r,i),n,i);},t.prototype.replaceRangeWithNodes=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithMultipleNodes,sourceFile:e,range:t,options:n,nodes:r});},t.prototype.replaceNodeWithNodes=function(e,t,r,n){void 0===n&&(n=d),this.replaceRangeWithNodes(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeWithText=function(e,t,r){this.replaceRangeWithText(e,p(e,t,t,d),r);},t.prototype.replaceNodeRangeWithNodes=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRangeWithNodes(e,p(e,t,r,i),n,i);},t.prototype.nodeHasTrailingComment=function(e,t,r){return void 0===r&&(r=d),!!g(e,t,r)},t.prototype.nextCommaToken=function(t,r){var n=e.findNextToken(r,r.parent,t);return n&&27===n.kind?n:void 0},t.prototype.replacePropertyAssignment=function(e,t,r){var n=this.nextCommaToken(e,t)?"":","+this.newLineCharacter;this.replaceNode(e,t,r,{suffix:n});},t.prototype.insertNodeAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRange(t,e.createRange(r),n,i);},t.prototype.insertNodesAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRangeWithNodes(t,e.createRange(r),n,i);},t.prototype.insertNodeAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertNodesAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertAtTopOfFile=function(t,r,n){var i=function(t){for(var r,n=0,i=t.statements;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))break;r=a;}var o=0,s=t.text;if(r)return o=r.end,g(),o;var c=e.getShebang(s);void 0!==c&&(o=c.length,g());var l,u,_=e.getLeadingCommentRanges(s,o);if(!_)return o;for(var d=0,p=_;d<p.length;d++){var f=p[d];if(3===f.kind){if(e.isPinnedComment(s,f.pos)){l={range:f,pinnedOrTripleSlash:!0};continue}}else if(e.isRecognizedTripleSlashComment(s,f.pos,f.end)){l={range:f,pinnedOrTripleSlash:!0};continue}if(l){if(l.pinnedOrTripleSlash)break;if(t.getLineAndCharacterOfPosition(f.pos).line>=t.getLineAndCharacterOfPosition(l.range.end).line+2)break}if(t.statements.length&&(void 0===u&&(u=t.getLineAndCharacterOfPosition(t.statements[0].getStart()).line),u<t.getLineAndCharacterOfPosition(f.end).line+2))break;l={range:f,pinnedOrTripleSlash:!1};}return l&&(o=l.range.end,g()),o;function g(){if(o<s.length){var t=s.charCodeAt(o);e.isLineBreak(t)&&++o<s.length&&13===t&&10===s.charCodeAt(o)&&o++;}}}(t),a={prefix:0===i?void 0:this.newLineCharacter,suffix:(e.isLineBreak(t.text.charCodeAt(i))?"":this.newLineCharacter)+(n?this.newLineCharacter:"")};e.isArray(r)?this.insertNodesAt(t,i,r,a):this.insertNodeAt(t,i,r,a);},t.prototype.insertFirstParameter=function(t,r,n){var i=e.firstOrUndefined(r);i?this.insertNodeBefore(t,i,n):this.insertNodeAt(t,r.pos,n);},t.prototype.insertNodeBefore=function(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i={}),this.insertNodeAt(e,f(e,t,i),r,this.getOptionsForInsertNodeBefore(t,r,n));},t.prototype.insertModifierAt=function(t,r,n,i){void 0===i&&(i={}),this.insertNodeAt(t,r,e.factory.createToken(n),i);},t.prototype.insertModifierBefore=function(e,t,r){return this.insertModifierAt(e,r.getStart(e),t,{suffix:" "})},t.prototype.insertCommentBeforeLine=function(t,r,n,i){var a=e.getStartPositionOfLine(r,t),o=e.getFirstNonSpaceCharacterPosition(t.text,a),s=A(t,o),c=e.getTouchingToken(t,s?o:n),l=t.text.slice(a,o),u="".concat(s?"":this.newLineCharacter,"//").concat(i).concat(this.newLineCharacter).concat(l);this.insertText(t,c.getStart(t),u);},t.prototype.insertJsdocCommentBefore=function(t,r,n){var i=r.getStart(t);if(r.jsDoc)for(var a=0,o=r.jsDoc;a<o.length;a++){var s=o[a];this.deleteRange(t,{pos:e.getLineStartPositionForPosition(s.getStart(t),t),end:m(t,s,{})});}var c=e.getPrecedingNonSpaceCharacterPosition(t.text,i-1),l=t.text.slice(c,i);this.insertNodeAt(t,i,n,{suffix:this.newLineCharacter+l});},t.prototype.createJSDocText=function(t,r){var n=e.flatMap(r.jsDoc,(function(t){return e.isString(t.comment)?e.factory.createJSDocText(t.comment):t.comment})),i=e.singleOrUndefined(r.jsDoc);return i&&e.positionsAreOnSameLine(i.pos,i.end,t)&&0===e.length(n)?void 0:e.factory.createNodeArray(e.intersperse(n,e.factory.createJSDocText("\n")))},t.prototype.replaceJSDocComment=function(t,r,n){this.insertJsdocCommentBefore(t,function(e){if(216!==e.kind)return e;var t=169===e.parent.kind?e.parent:e.parent.parent;return t.jsDoc=e.jsDoc,t.jsDocCache=e.jsDocCache,t}(r),e.factory.createJSDocComment(this.createJSDocText(t,r),e.factory.createNodeArray(n)));},t.prototype.addJSDocTags=function(t,r,i){var a=e.flatMapToMutable(r.jsDoc,(function(e){return e.tags})),o=i.filter((function(t){return !a.some((function(r,n){var i=function(t,r){if(t.kind===r.kind)switch(t.kind){case 343:var n=t,i=r;return e.isIdentifier(n.name)&&e.isIdentifier(i.name)&&n.name.escapedText===i.name.escapedText?e.factory.createJSDocParameterTag(void 0,i.name,!1,i.typeExpression,i.isNameFirst,n.comment):void 0;case 344:return e.factory.createJSDocReturnTag(void 0,r.typeExpression,t.comment);case 346:return e.factory.createJSDocTypeTag(void 0,r.typeExpression,t.comment)}}(r,t);return i&&(a[n]=i),!!i}))}));this.replaceJSDocComment(t,r,n$4(n$4([],a,!0),o,!0));},t.prototype.filterJSDocTags=function(t,r,n){this.replaceJSDocComment(t,r,e.filter(e.flatMapToMutable(r.jsDoc,(function(e){return e.tags})),n));},t.prototype.replaceRangeWithText=function(e,t,r){this.changes.push({kind:_.Text,sourceFile:e,range:t,text:r});},t.prototype.insertText=function(t,r,n){this.replaceRangeWithText(t,e.createRange(r),n);},t.prototype.tryInsertTypeAnnotation=function(t,r,n){var i,a;if(e.isFunctionLike(r)){if(!(a=e.findChildOfKind(r,21,t))){if(!e.isArrowFunction(r))return !1;a=e.first(r.parameters);}}else a=null!==(i=257===r.kind?r.exclamationToken:r.questionToken)&&void 0!==i?i:r.name;return this.insertNodeAt(t,a.end,n,{prefix:": "}),!0},t.prototype.tryInsertThisTypeAnnotation=function(t,r,n){var i=e.findChildOfKind(r,20,t).getStart(t)+1,a=r.parameters.length?", ":"";this.insertNodeAt(t,i,n,{prefix:"this: ",suffix:a});},t.prototype.insertTypeParameters=function(t,r,n){var i=(e.findChildOfKind(r,20,t)||e.first(r.parameters)).getStart(t);this.insertNodesAt(t,i,n,{prefix:"<",suffix:">",joiner:", "});},t.prototype.getOptionsForInsertNodeBefore=function(t,r,n){return e.isStatement(t)||e.isClassElement(t)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:e.isVariableDeclaration(t)?{suffix:", "}:e.isParameter(t)?e.isParameter(r)?{suffix:", "}:{}:e.isStringLiteral(t)&&e.isImportDeclaration(t.parent)||e.isNamedImports(t)?{suffix:", "}:e.isImportSpecifier(t)?{suffix:","+(n?this.newLineCharacter:" ")}:e.Debug.failBadSyntaxKind(t)},t.prototype.insertNodeAtConstructorStart=function(t,r,i){var a=e.firstOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeBefore(t,a,i):this.replaceConstructorBody(t,r,n$4([i],r.body.statements,!0));},t.prototype.insertNodeAtConstructorStartAfterSuperCall=function(t,r,i){var a=e.find(r.body.statements,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}));a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$4(n$4([],r.body.statements,!0),[i],!1));},t.prototype.insertNodeAtConstructorEnd=function(t,r,i){var a=e.lastOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$4(n$4([],r.body.statements,!0),[i],!1));},t.prototype.replaceConstructorBody=function(t,r,n){this.replaceNode(t,r.body,e.factory.createBlock(n,!0));},t.prototype.insertNodeAtEndOfScope=function(t,r,n){var i=f(t,r.getLastToken(),{});this.insertNodeAt(t,i,n,{prefix:e.isLineBreak(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter});},t.prototype.insertMemberAtStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtObjectStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtStartWorker=function(e,t,r){var n,i=null!==(n=this.guessIndentationFromExistingMembers(e,t))&&void 0!==n?n:this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,D(t).pos,r,this.getInsertNodeAtStartInsertOptions(e,t,i));},t.prototype.guessIndentationFromExistingMembers=function(t,r){for(var n,i=r,a=0,o=D(r);a<o.length;a++){var s=o[a];if(e.rangeStartPositionsAreOnSameLine(i,s,t))return;var c=s.getStart(t),l=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(c,t),c,t,this.formatContext.options);if(void 0===n)n=l;else if(l!==n)return;i=s;}return n},t.prototype.computeIndentationForNewMember=function(t,r){var n,i=r.getStart(t);return e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(i,t),i,t,this.formatContext.options)+(null!==(n=this.formatContext.options.indentSize)&&void 0!==n?n:4)},t.prototype.getInsertNodeAtStartInsertOptions=function(t,r,n){var i=0===D(r).length,a=e.addToSeen(this.classesWithNodesInsertedAtStart,e.getNodeId(r),{node:r,sourceFile:t}),o=e.isObjectLiteralExpression(r)&&(!e.isJsonSourceFile(t)||!i);return {indentation:n,prefix:(e.isObjectLiteralExpression(r)&&e.isJsonSourceFile(t)&&i&&!a?",":"")+this.newLineCharacter,suffix:o?",":e.isInterfaceDeclaration(r)&&i?";":""}},t.prototype.insertNodeAfterComma=function(e,t,r){var n=this.insertNodeAfterWorker(e,this.nextCommaToken(e,t)||t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAfter=function(e,t,r){var n=this.insertNodeAfterWorker(e,t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAtEndOfList=function(e,t,r){this.insertNodeAt(e,t.end,r,{prefix:", "});},t.prototype.insertNodesAfter=function(t,r,n){var i=this.insertNodeAfterWorker(t,r,e.first(n));this.insertNodesAt(t,i,n,this.getInsertNodeAfterOptions(t,r));},t.prototype.insertNodeAfterWorker=function(t,r,n){var i,a;return i=r,a=n,((e.isPropertySignature(i)||e.isPropertyDeclaration(i))&&e.isClassOrTypeElement(a)&&164===a.name.kind||e.isStatementButNotDeclaration(i)&&e.isStatementButNotDeclaration(a))&&59!==t.text.charCodeAt(r.end-1)&&this.replaceRange(t,e.createRange(r.end),e.factory.createToken(26)),m(t,r,{})},t.prototype.getInsertNodeAfterOptions=function(t,r){var n=this.getInsertNodeAfterOptionsWorker(r);return i$1(i$1({},n),{prefix:r.end===t.end&&e.isStatement(r)?n.prefix?"\n".concat(n.prefix):"\n":n.prefix})},t.prototype.getInsertNodeAfterOptionsWorker=function(t){switch(t.kind){case 260:case 264:return {prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 257:case 10:case 79:return {prefix:", "};case 299:return {suffix:","+this.newLineCharacter};case 93:return {prefix:" "};case 166:return {};default:return e.Debug.assert(e.isStatement(t)||e.isClassOrTypeElement(t)),{suffix:this.newLineCharacter}}},t.prototype.insertName=function(t,r,n){if(e.Debug.assert(!r.name),216===r.kind){var i=e.findChildOfKind(r,38,t),a=e.findChildOfKind(r,20,t);a?(this.insertNodesAt(t,a.getStart(t),[e.factory.createToken(98),e.factory.createIdentifier(n)],{joiner:" "}),F(this,t,i)):(this.insertText(t,e.first(r.parameters).getStart(t),"function ".concat(n,"(")),this.replaceRange(t,i,e.factory.createToken(21))),238!==r.body.kind&&(this.insertNodesAt(t,r.body.getStart(t),[e.factory.createToken(18),e.factory.createToken(105)],{joiner:" ",suffix:" "}),this.insertNodesAt(t,r.body.end,[e.factory.createToken(26),e.factory.createToken(19)],{joiner:" "}));}else {var o=e.findChildOfKind(r,215===r.kind?98:84,t).end;this.insertNodeAt(t,o,e.factory.createIdentifier(n),{prefix:" "});}},t.prototype.insertExportModifier=function(e,t){this.insertText(e,t.getStart(e),"export ");},t.prototype.insertImportSpecifierAtIndex=function(t,r,n,i){var a=n.elements[i-1];a?this.insertNodeInListAfter(t,a,r):this.insertNodeBefore(t,n.elements[0],r,!e.positionsAreOnSameLine(n.elements[0].getStart(),n.parent.parent.getStart(),t));},t.prototype.insertNodeInListAfter=function(t,r,n,i){if(void 0===i&&(i=e.formatting.SmartIndenter.getContainingList(r,t)),i){var a=e.indexOfNode(i,r);if(!(a<0)){var o=r.getEnd();if(a!==i.length-1){var s=e.getTokenAtPosition(t,r.end);if(s&&y(r,s)){var c=i[a+1],l=u(t.text,c.getFullStart()),_="".concat(e.tokenToString(s.kind)).concat(t.text.substring(s.end,l));this.insertNodesAt(t,l,[n],{suffix:_});}}else {var d=r.getStart(t),p=e.getLineStartPositionForPosition(d,t),f=void 0,g=!1;if(1===i.length)f=27;else {var m=e.findPrecedingToken(r.pos,t);f=y(r,m)?m.kind:27,g=e.getLineStartPositionForPosition(i[a-1].getStart(t),t)!==p;}if(function(t,r){for(var n=r;n<t.length;){var i=t.charCodeAt(n);if(!e.isWhiteSpaceSingleLine(i))return 47===i;n++;}return !1}(t.text,r.end)&&(g=!0),g){this.replaceRange(t,e.createRange(o),e.factory.createToken(f));for(var v=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(p,d,t,this.formatContext.options),h=e.skipTrivia(t.text,o,!0,!1);h!==o&&e.isLineBreak(t.text.charCodeAt(h-1));)h--;this.replaceRange(t,e.createRange(h),n,{indentation:v,prefix:this.newLineCharacter});}else this.replaceRange(t,e.createRange(o),n,{prefix:"".concat(e.tokenToString(f)," ")});}}}else e.Debug.fail("node is not a list element");},t.prototype.parenthesizeExpression=function(t,r){this.replaceRange(t,e.rangeOfNode(r),e.factory.createParenthesizedExpression(r));},t.prototype.finishClassesWithNodesInsertedAtStart=function(){var t=this;this.classesWithNodesInsertedAtStart.forEach((function(r){var n=r.node,i=r.sourceFile,a=function(t,r){var n=e.findChildOfKind(t,18,r),i=e.findChildOfKind(t,19,r);return [null==n?void 0:n.end,null==i?void 0:i.end]}(n,i),o=a[0],s=a[1];if(void 0!==o&&void 0!==s){var c=0===D(n).length,l=e.positionsAreOnSameLine(o,s,i);c&&l&&o!==s-1&&t.deleteRange(i,e.createRange(o,s-1)),l&&t.insertText(i,s-1,t.newLineCharacter);}}));},t.prototype.finishDeleteDeclarations=function(){for(var t=this,r=new e.Set,n=function(t,n){i.deletedNodes.some((function(r){return r.sourceFile===t&&e.rangeContainsRangeExclusive(r.node,n)}))||(e.isArray(n)?i.deleteRange(t,e.rangeOfTypeParameters(t,n)):T.deleteDeclaration(i,r,t,n));},i=this,a=0,o=this.deletedNodes;a<o.length;a++){var s=o[a];n(s.sourceFile,s.node);}r.forEach((function(n){var i=n.getSourceFile(),a=e.formatting.SmartIndenter.getContainingList(n,i);if(n===e.last(a)){var o=e.findLastIndex(a,(function(e){return !r.has(e)}),a.length-2);-1!==o&&t.deleteRange(i,{pos:a[o].end,end:b(i,a[o+1])});}}));},t.prototype.getChanges=function(e){this.finishDeleteDeclarations(),this.finishClassesWithNodesInsertedAtStart();for(var t=v.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,e),r=0,n=this.newFiles;r<n.length;r++){var i=n[r],a=i.oldFile,o=i.fileName,s=i.statements;t.push(v.newFileChanges(a,o,s,this.newLineCharacter,this.formatContext));}return t},t.prototype.createNewFile=function(e,t,r){this.newFiles.push({oldFile:e,fileName:t,statements:r});},t}();function b(t,r){return e.skipTrivia(t.text,f(t,r,{leadingTriviaOption:c.IncludeAll}),!1,!0)}function x(t,r,n,i){var a=b(t,i);if(void 0===n||e.positionsAreOnSameLine(m(t,r,{}),a,t))return a;var o=e.findPrecedingToken(i.getStart(t),t);if(y(r,o)){var s=e.findPrecedingToken(r.getStart(t),t);if(y(n,s)){var c=e.skipTrivia(t.text,o.getEnd(),!0,!0);if(e.positionsAreOnSameLine(s.getStart(t),o.getStart(t),t))return e.isLineBreak(t.text.charCodeAt(c-1))?c-1:c;if(e.isLineBreak(t.text.charCodeAt(c)))return c}}return a}function D(t){return e.isObjectLiteralExpression(t)?t.properties:t.members}function S(t,r){for(var n=r.length-1;n>=0;n--){var i=r[n],a=i.span,o=i.newText;t="".concat(t.substring(0,a.start)).concat(o).concat(t.substring(e.textSpanEnd(a)));}return t}t.ChangeTracker=h,t.getNewFileText=function(e,t,r,n){return v.newFileChangesWorker(void 0,t,e,r,n)},function(t){function r(t,r,i,a,o){var s=i.map((function(e){return 4===e?"":n(e,t,a).text})).join(a),c=e.createSourceFile("any file name",s,99,!0,r);return S(s,e.formatting.formatDocument(c,o))+a}function n(t,r,n){var i=N(n),a=e.getNewLineKind(n);return e.createPrinter({newLine:a,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},i).writeNode(4,t,r,i),{text:i.getText(),node:E(t)}}t.getTextChangesFromChanges=function(t,r,a,o){return e.mapDefined(e.group(t,(function(e){return e.sourceFile.path})),(function(t){for(var s=t[0].sourceFile,c=e.stableSort(t,(function(e,t){return e.range.pos-t.range.pos||e.range.end-t.range.end})),l=function(t){e.Debug.assert(c[t].range.end<=c[t+1].range.pos,"Changes overlap",(function(){return "".concat(JSON.stringify(c[t].range)," and ").concat(JSON.stringify(c[t+1].range))}));},u=0;u<c.length-1;u++)l(u);var d=e.mapDefined(c,(function(t){var c=e.createTextSpanFromRange(t.range),l=function(t,r,a,o,s){var c;if(t.kind===_.Remove)return "";if(t.kind===_.Text)return t.text;var l=t.options,u=void 0===l?{}:l,d=t.range.pos,p=function(t){return function(t,r,a,o,s,c,l){var u=o.indentation,_=o.prefix,d=o.delta,p=n(t,r,s),f=p.node,g=p.text;l&&l(f,g);var m=e.getFormatCodeSettingsForWriting(c,r),y=void 0!==u?u:e.formatting.SmartIndenter.getIndentation(a,r,m,_===s||e.getLineStartPositionForPosition(a,r)===a);void 0===d&&(d=e.formatting.SmartIndenter.shouldIndentChildNode(m,t)&&m.indentSize||0);var v={text:g,getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}};return S(g,e.formatting.formatNodeGivenIndentation(f,v,r.languageVariant,y,d,i$1(i$1({},c),{options:m})))}(t,r,d,u,a,o,s)},f=t.kind===_.ReplaceWithMultipleNodes?t.nodes.map((function(t){return e.removeSuffix(p(t),a)})).join((null===(c=t.options)||void 0===c?void 0:c.joiner)||a):p(t.node),g=void 0!==u.indentation||e.getLineStartPositionForPosition(d,r)===d?f:f.replace(/^\s+/,"");return (u.prefix||"")+g+(!u.suffix||e.endsWith(g,u.suffix)?"":u.suffix)}(t,s,r,a,o);if(c.length!==l.length||!e.stringContainsAt(s.text,l,c.start))return e.createTextChange(c,l)}));return d.length>0?{fileName:s.fileName,textChanges:d}:void 0}))},t.newFileChanges=function(t,n,i,a,o){var s=r(t,e.getScriptKindFromFileName(n),i,a,o);return {fileName:n,textChanges:[e.createTextChange(e.createTextSpan(0,0),s)],isNewFile:!0}},t.newFileChangesWorker=r,t.getNonformattedText=n;}(v||(v={})),t.applyChanges=S;var T,C=i$1(i$1({},e.nullTransformationContext),{factory:e.createNodeFactory(1|e.nullTransformationContext.factory.flags,e.nullTransformationContext.factory.baseFactory)});function E(t){var n=e.visitEachChild(t,E,C,k,E),i=e.nodeIsSynthesized(n)?n:Object.create(n);return e.setTextRangePosEnd(i,r(t),o(t)),i}function k(t,n,i,a,s){var c=e.visitNodes(t,n,i,a,s);if(!c)return c;var l=c===t?e.factory.createNodeArray(c.slice(0)):c;return e.setTextRangePosEnd(l,r(t),o(t)),l}function N(t){var r=0,n=e.createTextWriter(t);function i(t,i){if(i||!function(t){return e.skipTrivia(t,0)===t.length}(t)){r=n.getTextPos();for(var a=0;e.isWhiteSpaceLike(t.charCodeAt(t.length-a-1));)a++;r-=a;}}return {onBeforeEmitNode:function(e){e&&a(e,r);},onAfterEmitNode:function(e){e&&s(e,r);},onBeforeEmitNodeArray:function(e){e&&a(e,r);},onAfterEmitNodeArray:function(e){e&&s(e,r);},onBeforeEmitToken:function(e){e&&a(e,r);},onAfterEmitToken:function(e){e&&s(e,r);},write:function(e){n.write(e),i(e,!1);},writeComment:function(e){n.writeComment(e);},writeKeyword:function(e){n.writeKeyword(e),i(e,!1);},writeOperator:function(e){n.writeOperator(e),i(e,!1);},writePunctuation:function(e){n.writePunctuation(e),i(e,!1);},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),i(e,!1);},writeParameter:function(e){n.writeParameter(e),i(e,!1);},writeProperty:function(e){n.writeProperty(e),i(e,!1);},writeSpace:function(e){n.writeSpace(e),i(e,!1);},writeStringLiteral:function(e){n.writeStringLiteral(e),i(e,!1);},writeSymbol:function(e,t){n.writeSymbol(e,t),i(e,!1);},writeLine:function(e){n.writeLine(e);},increaseIndent:function(){n.increaseIndent();},decreaseIndent:function(){n.decreaseIndent();},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),i(e,!1);},writeLiteral:function(e){n.writeLiteral(e),i(e,!0);},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:function(){return n.hasTrailingComment()},hasTrailingWhitespace:function(){return n.hasTrailingWhitespace()},clear:function(){n.clear(),r=0;}}}function A(t,r){return !(e.isInComment(t,r)||e.isInString(t,r)||e.isInTemplateString(t,r)||e.isInJSXText(t,r))}function F(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(t,r,n),a=m(t,r,n);e.deleteRange(t,{pos:i,end:a});}function P(t,r,n,i){var a=e.Debug.checkDefined(e.formatting.SmartIndenter.getContainingList(i,n)),o=e.indexOfNode(a,i);e.Debug.assert(-1!==o),1!==a.length?(e.Debug.assert(!r.has(i),"Deleting a node twice"),r.add(i),t.deleteRange(n,{pos:b(n,i),end:o===a.length-1?m(n,i,{}):x(n,i,a[o-1],a[o+1])})):F(t,n,i);}t.assignPositionsToNode=E,t.createWriter=N,t.isValidLocationToAddComment=A,function(t){function r(t,r,n){if(n.parent.name){var i=e.Debug.checkDefined(e.getTokenAtPosition(r,n.pos-1));t.deleteRange(r,{pos:i.getStart(r),end:n.end});}else F(t,r,e.getAncestor(n,269));}t.deleteDeclaration=function(t,n,i,a){switch(a.kind){case 166:var o=a.parent;e.isArrowFunction(o)&&1===o.parameters.length&&!e.findChildOfKind(o,20,i)?t.replaceNodeWithText(i,a,"()"):P(t,n,i,a);break;case 269:case 268:F(t,i,a,{leadingTriviaOption:i.imports.length&&a===e.first(i.imports).parent||a===e.find(i.statements,e.isAnyImportSyntax)?c.Exclude:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;case 205:var s=a.parent;204===s.kind&&a!==e.last(s.elements)?F(t,i,a):P(t,n,i,a);break;case 257:!function(t,r,n,i){var a=i.parent;if(295!==a.kind)if(1===a.declarations.length){var o=a.parent;switch(o.kind){case 247:case 246:t.replaceNode(n,i,e.factory.createObjectLiteralExpression());break;case 245:F(t,n,a);break;case 240:F(t,n,o,{leadingTriviaOption:e.hasJSDocNodes(o)?c.JSDoc:c.StartLine});break;default:e.Debug.assertNever(o);}}else P(t,r,n,i);else t.deleteNodeRange(n,e.findChildOfKind(a,20,n),e.findChildOfKind(a,21,n));}(t,n,i,a);break;case 165:P(t,n,i,a);break;case 273:var u=a.parent;1===u.elements.length?r(t,i,u):P(t,n,i,a);break;case 271:r(t,i,a);break;case 26:F(t,i,a,{trailingTriviaOption:l.Exclude});break;case 98:F(t,i,a,{leadingTriviaOption:c.Exclude});break;case 260:case 259:F(t,i,a,{leadingTriviaOption:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;default:a.parent?e.isImportClause(a.parent)&&a.parent.name===a?function(t,r,n){if(n.namedBindings){var i=n.name.getStart(r),a=e.getTokenAtPosition(r,n.name.end);if(a&&27===a.kind){var o=e.skipTrivia(r.text,a.end,!1,!0);t.deleteRange(r,{pos:i,end:o});}else F(t,r,n.name);}else F(t,r,n.parent);}(t,i,a.parent):e.isCallExpression(a.parent)&&e.contains(a.parent.arguments,a)?P(t,n,i,a):F(t,i,a):F(t,i,a);}};}(T||(T={})),t.deleteNode=F;}(e.textChanges||(e.textChanges={}));}(t),function(e){!function(t){var r=e.createMultiMap(),a=new e.Map;function o(e,t,r,n,i,a){return {fixName:e,description:t,changes:r,fixId:n,fixAllDescription:i,commands:a?[a]:void 0}}function c(e,t){return {changes:e,commands:t}}function l(t,r,n){for(var i=0,a=u(t);i<a.length;i++){var o=a[i];e.contains(r,o.code)&&n(o);}}function u(t){var r=t.program,i=t.sourceFile,a=t.cancellationToken;return n$4(n$4(n$4([],r.getSemanticDiagnostics(i,a),!0),r.getSyntacticDiagnostics(i,a),!0),e.computeSuggestionDiagnostics(i,r,a),!0)}t.createCodeFixActionWithoutFixAll=function(t,r,n){return o(t,e.diagnosticToString(n),r,void 0,void 0)},t.createCodeFixAction=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,e.diagnosticToString(a),s)},t.createCodeFixActionMaybeFixAll=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,a&&e.diagnosticToString(a),s)},t.registerCodeFix=function(t){for(var n=0,i=t.errorCodes;n<i.length;n++){var o=i[n];r.add(String(o),t);}if(t.fixIds)for(var s=0,c=t.fixIds;s<c.length;s++){var l=c[s];e.Debug.assert(!a.has(l)),a.set(l,t);}},t.getSupportedErrorCodes=function(){return e.arrayFrom(r.keys())},t.getFixes=function(t){var n=u(t),a=r.get(String(t.errorCode));return e.flatMap(a,(function(r){return e.map(r.getCodeActions(t),function(t,r){for(var n=t.errorCodes,a=0,o=0,c=r;o<c.length;o++){var l=c[o];if(e.contains(n,l.code)&&a++,a>1)break}var u=a<2;return function(e){var t=e.fixId,r=e.fixAllDescription,n=s(e,["fixId","fixAllDescription"]);return u?n:i$1(i$1({},n),{fixId:t,fixAllDescription:r})}}(r,n))}))},t.getAllFixes=function(t){return a.get(e.cast(t.fixId,e.isString)).getAllCodeActions(t)},t.createCombinedCodeActions=c,t.createFileTextChanges=function(e,t){return {fileName:e,textChanges:t}},t.codeFixAll=function(t,r,n){var i=[];return c(e.textChanges.ChangeTracker.with(t,(function(e){return l(t,r,(function(t){return n(e,t,i)}))})),0===i.length?void 0:i)},t.eachDiagnostic=l;}(e.codefix||(e.codefix={}));}(t),function(e){var t,r;t=e.refactor||(e.refactor={}),r=new e.Map,t.registerRefactor=function(e,t){r.set(e,t);},t.getApplicableRefactors=function(n){return e.arrayFrom(e.flatMapIterator(r.values(),(function(e){var r;return n.cancellationToken&&n.cancellationToken.isCancellationRequested()||!(null===(r=e.kinds)||void 0===r?void 0:r.some((function(e){return t.refactorKindBeginsWith(e,n.kind)})))?void 0:e.getAvailableActions(n)})))},t.getEditsForRefactor=function(e,t,n){var i=r.get(t);return i&&i.getEditsForAction(e,n)};}(t),function(e){!function(t){var r="addConvertToUnknownForNonOverlappingTypes",n=[e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];function i(t,r,n){var i=e.isAsExpression(n)?e.factory.createAsExpression(n.expression,e.factory.createKeywordTypeNode(157)):e.factory.createTypeAssertion(e.factory.createKeywordTypeNode(157),n.expression);t.replaceNode(r,n.expression,i);}function a(t,r){if(!e.isInJSFile(t))return e.findAncestor(e.getTokenAtPosition(t,r),(function(t){return e.isAsExpression(t)||e.isTypeAssertionExpression(t)}))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(void 0!==o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_unknown_conversion_for_non_overlapping_types,r,e.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(r){var n=r.sourceFile,i=e.textChanges.ChangeTracker.with(r,(function(t){var r=e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([]),void 0);t.insertNodeAtEndOfScope(n,n,r);}));return [t.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",i,e.Diagnostics.Add_export_to_make_this_file_into_a_module)]}});}(t),function(e){!function(t){var r="addMissingAsync",n=[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_comparable_to_type_1.code];function i(n,i,a,o){var s=a((function(t){return function(t,r,n,i){if(!i||!i.has(e.getNodeId(n))){null==i||i.add(e.getNodeId(n));var a=e.factory.updateModifiers(e.getSynthesizedDeepClone(n,!0),e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(512|e.getSyntacticModifierFlags(n))));t.replaceNode(r,n,a);}}(t,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)}function a(t,r){if(r){var n=e.getTokenAtPosition(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":(e.isArrowFunction(n)||e.isMethodDeclaration(n)||e.isFunctionExpression(n)||e.isFunctionDeclaration(n))&&e.textSpansEqual(r,e.createTextSpanFromNode(n,t))}))}}t.registerCodeFix({fixIds:[r],errorCodes:n,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,o=t.cancellationToken,s=t.program,c=t.span,l=e.find(s.getTypeChecker().getDiagnostics(r,o),function(t,r){return function(n){var i=n.start,a=n.length,o=n.relatedInformation,s=n.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},t)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code}))}}(c,n)),u=a(r,l&&l.relatedInformation&&e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})));if(u)return [i(t,u,(function(r){return e.textChanges.ChangeTracker.with(t,r)}))]},getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Set;return t.codeFixAll(r,n,(function(t,n){var c=n.relatedInformation&&e.find(n.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),l=a(o,c);if(l)return i(r,l,(function(e){return e(t),[]}),s)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingAwait",i=e.Diagnostics.Property_0_does_not_exist_on_type_1.code,a=[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],o=n$4([e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,e.Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,e.Diagnostics.Type_0_is_not_an_array_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,i],a,!0);function s(t,r,n,i,a){var o=e.getFixableErrorSpanExpression(t,n);return o&&function(t,r,n,i,a){var o=a.getTypeChecker().getDiagnostics(t,i);return e.some(o,(function(t){var i=t.start,a=t.length,o=t.relatedInformation,s=t.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},n)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_forget_to_use_await.code}))}))}(t,r,n,i,a)&&u(o)?o:void 0}function c(r,n,i,a,s,c){var l=r.sourceFile,d=r.program,p=r.cancellationToken,f=function(t,r,n,i,a){var s=function(t,r){if(e.isPropertyAccessExpression(t.parent)&&e.isIdentifier(t.parent.expression))return {identifiers:[t.parent.expression],isCompleteFix:!0};if(e.isIdentifier(t))return {identifiers:[t],isCompleteFix:!0};if(e.isBinaryExpression(t)){for(var n=void 0,i=!0,a=0,o=[t.left,t.right];a<o.length;a++){var s=o[a],c=r.getTypeAtLocation(s);if(r.getPromisedTypeOfPromise(c)){if(!e.isIdentifier(s)){i=!1;continue}(n||(n=[])).push(s);}}return n&&{identifiers:n,isCompleteFix:i}}}(t,a);if(s){for(var c,l=s.isCompleteFix,_=function(t){var s=a.getSymbolAtLocation(t);if(!s)return "continue";var _=e.tryCast(s.valueDeclaration,e.isVariableDeclaration),d=_&&e.tryCast(_.name,e.isIdentifier),p=e.getAncestor(_,240);if(!_||!p||_.type||!_.initializer||p.getSourceFile()!==r||e.hasSyntacticModifier(p,1)||!d||!u(_.initializer))return l=!1,"continue";var f=i.getSemanticDiagnostics(r,n),g=e.FindAllReferences.Core.eachSymbolReferenceInFile(d,a,r,(function(n){return t!==n&&!function(t,r,n,i){var a=e.isPropertyAccessExpression(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)?t.parent:t,s=e.find(r,(function(e){return e.start===a.getStart(n)&&e.start+e.length===a.getEnd()}));return s&&e.contains(o,s.code)||1&i.getTypeAtLocation(a).flags}(n,f,r,a)}));if(g)return l=!1,"continue";(c||(c=[])).push({expression:_.initializer,declarationSymbol:s});},d=0,p=s.identifiers;d<p.length;d++)_(p[d]);return c&&{initializers:c,needsSecondPassForFixAll:!l}}}(n,l,p,d,a);if(f){var g=s((function(t){e.forEach(f.initializers,(function(e){var r=e.expression;return _(t,i,l,a,r,c)})),c&&f.needsSecondPassForFixAll&&_(t,i,l,a,n,c);}));return t.createCodeFixActionWithoutFixAll("addMissingAwaitToInitializer",g,1===f.initializers.length?[e.Diagnostics.Add_await_to_initializer_for_0,f.initializers[0].declarationSymbol.name]:e.Diagnostics.Add_await_to_initializers)}}function l(n,i,a,o,s,c){var l=s((function(e){return _(e,a,n.sourceFile,o,i,c)}));return t.createCodeFixAction(r,l,e.Diagnostics.Add_await,r,e.Diagnostics.Fix_all_expressions_possibly_missing_await)}function u(t){return 32768&t.kind||!!e.findAncestor(t,(function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t||e.isBlock(t)&&(259===t.parent.kind||215===t.parent.kind||216===t.parent.kind||171===t.parent.kind)}))}function _(t,r,n,o,s,c){if(e.isForOfStatement(s.parent)&&!s.parent.awaitModifier){var l=o.getTypeAtLocation(s),u=o.getAsyncIterableType();if(u&&o.isTypeAssignableTo(l,u)){var _=s.parent;return void t.replaceNode(n,_,e.factory.updateForOfStatement(_,e.factory.createToken(133),_.initializer,_.expression,_.statement))}}if(e.isBinaryExpression(s))for(var p=0,f=[s.left,s.right];p<f.length;p++){var g=f[p];if(!(c&&e.isIdentifier(g)&&(v=o.getSymbolAtLocation(g))&&c.has(e.getSymbolId(v)))){var m=o.getTypeAtLocation(g),y=o.getPromisedTypeOfPromise(m)?e.factory.createAwaitExpression(g):g;t.replaceNode(n,g,y);}}else if(r===i&&e.isPropertyAccessExpression(s.parent)){if(c&&e.isIdentifier(s.parent.expression)&&(v=o.getSymbolAtLocation(s.parent.expression))&&c.has(e.getSymbolId(v)))return;t.replaceNode(n,s.parent.expression,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s.parent.expression))),d(t,s.parent.expression,n);}else if(e.contains(a,r)&&e.isCallOrNewExpression(s.parent)){if(c&&e.isIdentifier(s)&&(v=o.getSymbolAtLocation(s))&&c.has(e.getSymbolId(v)))return;t.replaceNode(n,s,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s))),d(t,s,n);}else {var v;if(c&&e.isVariableDeclaration(s.parent)&&e.isIdentifier(s.parent.name)&&(v=o.getSymbolAtLocation(s.parent.name))&&!e.tryAddToSet(c,e.getSymbolId(v)))return;t.replaceNode(n,s,e.factory.createAwaitExpression(s));}}function d(t,r,n){var i=e.findPrecedingToken(r.pos,n);i&&e.positionIsASICandidate(i.end,i.parent,n)&&t.insertText(n,r.getStart(n),";");}t.registerCodeFix({fixIds:[r],errorCodes:o,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,i=s(r,n,t.span,t.cancellationToken,t.program);if(i){var a=t.program.getTypeChecker(),o=function(r){return e.textChanges.ChangeTracker.with(t,r)};return e.compact([c(t,i,n,a,o),l(t,i,n,a,o)])}},getAllCodeActions:function(r){var n=r.sourceFile,i=r.program,a=r.cancellationToken,u=r.program.getTypeChecker(),_=new e.Set;return t.codeFixAll(r,o,(function(e,t){var o=s(n,t.code,t,a,i);if(o){var d=function(t){return t(e),[]};return c(r,o,t.code,u,d,_)||l(r,o,t.code,u,d,_)}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingConst",n=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function i(t,r,n,i,s){var c=e.getTokenAtPosition(r,n),l=e.findAncestor(c,(function(t){return e.isForInOrOfStatement(t.parent)?t.parent.initializer===t:!function(e){switch(e.kind){case 79:case 206:case 207:case 299:case 300:return !0;default:return !1}}(t)&&"quit"}));if(l)return a(t,l,r,s);var u=c.parent;if(e.isBinaryExpression(u)&&63===u.operatorToken.kind&&e.isExpressionStatement(u.parent))return a(t,c,r,s);if(e.isArrayLiteralExpression(u)){var _=i.getTypeChecker();if(!e.every(u.elements,(function(t){return r=t,n=_,!!(i=e.isIdentifier(r)?r:e.isAssignmentExpression(r,!0)&&e.isIdentifier(r.left)?r.left:void 0)&&!n.getSymbolAtLocation(i);var r,n,i;})))return;return a(t,u,r,s)}var d=e.findAncestor(c,(function(t){return !!e.isExpressionStatement(t.parent)||!function(e){switch(e.kind){case 79:case 223:case 27:return !0;default:return !1}}(t)&&"quit"}));if(d){if(!o(d,i.getTypeChecker()))return;return a(t,d,r,s)}}function a(t,r,n,i){i&&!e.tryAddToSet(i,r)||t.insertModifierBefore(n,85,r);}function o(t,r){return !!e.isBinaryExpression(t)&&(27===t.operatorToken.kind?e.every([t.left,t.right],(function(e){return o(e,r)})):63===t.operatorToken.kind&&e.isIdentifier(t.left)&&!r.getSymbolAtLocation(t.left))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Add_const_to_unresolved_variable,r,e.Diagnostics.Add_const_to_all_unresolved_variables)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,r.program,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingDeclareProperty",n=[e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isIdentifier(a)){var o=a.parent;169!==o.kind||i&&!e.tryAddToSet(i,o)||t.insertModifierBefore(r,136,o);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Prefix_with_declare,r,e.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingInvocationForDecorator",n=[e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.findAncestor(i,e.isDecorator);e.Debug.assert(!!a,"Expected position to be owned by a decorator.");var o=e.factory.createCallExpression(a.expression,void 0,void 0);t.replaceNode(r,a.expression,o);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Call_decorator_expression,r,e.Diagnostics.Add_to_all_uncalled_decorators)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addNameToNamelessParameter",n=[e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=i.parent;if(!e.isParameter(a))return e.Debug.fail("Tried to add a parameter name to a non-parameter: "+e.Debug.formatSyntaxKind(i.kind));var o=a.parent.parameters.indexOf(a);e.Debug.assert(!a.type,"Tried to add a parameter name to a parameter that already had one."),e.Debug.assert(o>-1,"Parameter not found in parent parameter list.");var s=e.factory.createTypeReferenceNode(a.name,void 0),c=e.factory.createParameterDeclaration(a.modifiers,a.dotDotDotToken,"arg"+o,a.questionToken,a.dotDotDotToken?e.factory.createArrayTypeNode(s):s,a.initializer);t.replaceNode(r,a,c);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Add_parameter_name,r,e.Diagnostics.Add_names_to_all_parameters_without_names)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addOptionalPropertyUndefined",i=[e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];function a(t,r){var n;if(t){if(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind)return {source:t.parent.right,target:t.parent.left};if(e.isVariableDeclaration(t.parent)&&t.parent.initializer)return {source:t.parent.initializer,target:t.parent.name};if(e.isCallExpression(t.parent)){var i=r.getSymbolAtLocation(t.parent.expression);if(!(null==i?void 0:i.valueDeclaration)||!e.isFunctionLikeKind(i.valueDeclaration.kind))return;if(!e.isExpression(t))return;var o=t.parent.arguments.indexOf(t);if(-1===o)return;var s=i.valueDeclaration.parameters[o].name;if(e.isIdentifier(s))return {source:t,target:s}}else if(e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)||e.isShorthandPropertyAssignment(t.parent)){var c=a(t.parent.parent,r);if(!c)return;var l=r.getPropertyOfType(r.getTypeAtLocation(c.target),t.parent.name.text),u=null===(n=null==l?void 0:l.declarations)||void 0===n?void 0:n[0];if(!u)return;return {source:e.isPropertyAssignment(t.parent)?t.parent.initializer:t.parent.name,target:u}}}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.program.getTypeChecker(),s=function(t,r,n){var i,o,s=a(e.getFixableErrorSpanExpression(t,r),n);if(!s)return e.emptyArray;var c=s.source,l=s.target,u=function(t,r,n){return e.isPropertyAccessExpression(r)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(r.expression)).length&&n.getTypeAtLocation(t)===n.getUndefinedType()}(c,l,n)?n.getTypeAtLocation(l.expression):n.getTypeAtLocation(l);return (null===(o=null===(i=u.symbol)||void 0===i?void 0:i.declarations)||void 0===o?void 0:o.some((function(t){return e.getSourceFileOfNode(t).fileName.match(/\.d\.ts$/)})))?e.emptyArray:n.getExactOptionalProperties(u)}(i.sourceFile,i.span,o);if(s.length){var c=e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r){for(var i=0,a=r;i<a.length;i++){var o=a[i].valueDeclaration;if(o&&(e.isPropertySignature(o)||e.isPropertyDeclaration(o))&&o.type){var s=e.factory.createUnionTypeNode(n$4(n$4([],189===o.type.kind?o.type.types:[o.type],!0),[e.factory.createTypeReferenceNode("undefined")],!1));t.replaceNode(o.getSourceFile(),o.type,s);}}}(t,s)}));return [t.createCodeFixActionWithoutFixAll(r,c,e.Diagnostics.Add_undefined_to_optional_property_type)]}},fixIds:[r]});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="annotateWithTypeFromJSDoc",n=[e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.tryCast(e.isParameter(n.parent)?n.parent.parent:n.parent,a)}function a(t){return function(t){return e.isFunctionLikeDeclaration(t)||257===t.kind||168===t.kind||169===t.kind}(t)&&o(t)}function o(t){return e.isFunctionLikeDeclaration(t)?t.parameters.some(o)||!t.type&&!!e.getJSDocReturnType(t):!t.type&&!!e.getJSDocType(t)}function s(t,r,n){if(e.isFunctionLikeDeclaration(n)&&(e.getJSDocReturnType(n)||n.parameters.some((function(t){return !!e.getJSDocType(t)})))){if(!n.typeParameters){var i=e.getJSDocTypeParameterDeclarations(n);i.length&&t.insertTypeParameters(r,n,i);}var a=e.isArrowFunction(n)&&!e.findChildOfKind(n,20,r);a&&t.insertNodeBefore(r,e.first(n.parameters),e.factory.createToken(20));for(var o=0,s=n.parameters;o<s.length;o++){var l=s[o];if(!l.type){var u=e.getJSDocType(l);u&&t.tryInsertTypeAnnotation(r,l,c(u));}}if(a&&t.insertNodeAfter(r,e.last(n.parameters),e.factory.createToken(21)),!n.type){var _=e.getJSDocReturnType(n);_&&t.tryInsertTypeAnnotation(r,n,c(_));}}else {var d=e.Debug.checkDefined(e.getJSDocType(n),"A JSDocType for this declaration should exist");e.Debug.assert(!n.type,"The JSDocType decl should have a type"),t.tryInsertTypeAnnotation(r,n,c(d));}}function c(t){switch(t.kind){case 315:case 316:return e.factory.createTypeReferenceNode("any",e.emptyArray);case 319:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("undefined",e.emptyArray)])}(t);case 318:return c(t.type);case 317:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("null",e.emptyArray)])}(t);case 321:return function(t){return e.factory.createArrayTypeNode(e.visitNode(t.type,c))}(t);case 320:return function(t){var r;return e.factory.createFunctionTypeNode(e.emptyArray,t.parameters.map(l),null!==(r=t.type)&&void 0!==r?r:e.factory.createKeywordTypeNode(131))}(t);case 180:return function(t){var r=t.typeName,n=t.typeArguments;if(e.isIdentifier(t.typeName)){if(e.isJSDocIndexSignature(t))return function(t){var r=e.factory.createParameterDeclaration(void 0,void 0,148===t.typeArguments[0].kind?"n":"s",void 0,e.factory.createTypeReferenceNode(148===t.typeArguments[0].kind?"number":"string",[]),void 0),n=e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,[r],t.typeArguments[1])]);return e.setEmitFlags(n,1),n}(t);var i=t.typeName.text;switch(t.typeName.text){case"String":case"Boolean":case"Object":case"Number":i=i.toLowerCase();break;case"array":case"date":case"promise":i=i[0].toUpperCase()+i.slice(1);}r=e.factory.createIdentifier(i),n="Array"!==i&&"Promise"!==i||t.typeArguments?e.visitNodes(t.typeArguments,c):e.factory.createNodeArray([e.factory.createTypeReferenceNode("any",e.emptyArray)]);}return e.factory.createTypeReferenceNode(r,n)}(t);default:var r=e.visitEachChild(t,c,e.nullTransformationContext);return e.setEmitFlags(r,1),r}}function l(t){var r=t.parent.parameters.indexOf(t),n=321===t.type.kind&&r===t.parent.parameters.length-1,i=t.name||(n?"rest":"arg"+r),a=n?e.factory.createToken(25):t.dotDotDotToken;return e.factory.createParameterDeclaration(t.modifiers,a,i,t.questionToken,e.visitNode(t.type,c),t.initializer)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=i(n.sourceFile,n.span.start);if(a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return s(e,n.sourceFile,a)}));return [t.createCodeFixAction(r,o,e.Diagnostics.Annotate_with_type_from_JSDoc,r,e.Diagnostics.Annotate_everything_with_types_from_JSDoc)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&s(e,t.file,r);}))}}),t.parameterShouldGetTypeFromJSDoc=a;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertFunctionToEs6Class",n=[e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code];function i(t,r,n,i,s,c){var l=i.getSymbolAtLocation(e.getTokenAtPosition(r,n));if(l&&l.valueDeclaration&&19&l.flags){var u=l.valueDeclaration;if(e.isFunctionDeclaration(u)||e.isFunctionExpression(u))t.replaceNode(r,u,function(t){var r=p(l);t.body&&r.unshift(e.factory.createConstructorDeclaration(void 0,t.parameters,t.body));var n=a(t,93);return e.factory.createClassDeclaration(n,t.name,void 0,void 0,r)}(u));else if(e.isVariableDeclaration(u)){var _=function(t){var r=t.initializer;if(r&&e.isFunctionExpression(r)&&e.isIdentifier(t.name)){var n=p(t.symbol);r.body&&n.unshift(e.factory.createConstructorDeclaration(void 0,r.parameters,r.body));var i=a(t.parent.parent,93);return e.factory.createClassDeclaration(i,t.name,void 0,void 0,n)}}(u);if(!_)return;var d=u.parent.parent;e.isVariableDeclarationList(u.parent)&&u.parent.declarations.length>1?(t.delete(r,u),t.insertNodeAfter(r,d,_)):t.replaceNode(r,d,_);}}function p(n){var i=[];return n.exports&&n.exports.forEach((function(t){if("prototype"===t.name&&t.declarations){var r=t.declarations[0];1===t.declarations.length&&e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind&&e.isObjectLiteralExpression(r.parent.right)&&l(r.parent.right.symbol,void 0,i);}else l(t,[e.factory.createToken(124)],i);})),n.members&&n.members.forEach((function(a,s){var c,u,_,d;if("constructor"===s&&a.valueDeclaration){var p=null===(d=null===(_=null===(u=null===(c=n.exports)||void 0===c?void 0:c.get("prototype"))||void 0===u?void 0:u.declarations)||void 0===_?void 0:_[0])||void 0===d?void 0:d.parent;p&&e.isBinaryExpression(p)&&e.isObjectLiteralExpression(p.right)&&e.some(p.right.properties,o)||t.delete(r,a.valueDeclaration.parent);}else l(a,void 0,i);})),i;function l(n,i,l){if(8192&n.flags||4096&n.flags){var u,_,d=n.valueDeclaration,p=d.parent,f=p.right;if(u=d,_=f,(e.isAccessExpression(u)?e.isPropertyAccessExpression(u)&&o(u)||e.isFunctionLike(_):e.every(u.properties,(function(t){return !!(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)||e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&t.name||o(t))})))&&!e.some(l,(function(t){var r=e.getNameOfDeclaration(t);return !(!r||!e.isIdentifier(r)||e.idText(r)!==e.symbolName(n))}))){var g=p.parent&&241===p.parent.kind?p.parent:p;if(t.delete(r,g),f){if(e.isAccessExpression(d)&&(e.isFunctionExpression(f)||e.isArrowFunction(f))){var m=e.getQuotePreference(r,s),y=function(t,r,n){if(e.isPropertyAccessExpression(t))return t.name;var i=t.argumentExpression;return e.isNumericLiteral(i)?i:e.isStringLiteralLike(i)?e.isIdentifierText(i.text,e.getEmitScriptTarget(r))?e.factory.createIdentifier(i.text):e.isNoSubstitutionTemplateLiteral(i)?e.factory.createStringLiteral(i.text,0===n):i:void 0}(d,c,m);y&&h(l,f,y);}else if(e.isObjectLiteralExpression(f))e.forEach(f.properties,(function(t){(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t))&&l.push(t),e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&h(l,t.initializer,t.name),o(t);}));else if(!e.isSourceFileJS(r)&&e.isPropertyAccessExpression(d)){var v=e.factory.createPropertyDeclaration(i,d.name,void 0,void 0,f);return e.copyLeadingComments(p.parent,v,r),void l.push(v)}}else l.push(e.factory.createPropertyDeclaration(i,n.name,void 0,void 0,void 0));}}function h(t,n,o){return e.isFunctionExpression(n)?function(t,n,o){var s=e.concatenate(i,a(n,132)),c=e.factory.createMethodDeclaration(s,void 0,o,void 0,void 0,n.parameters,void 0,n.body);return e.copyLeadingComments(p,c,r),void t.push(c)}(t,n,o):function(t,n,o){var s,c=n.body;s=238===c.kind?c:e.factory.createBlock([e.factory.createReturnStatement(c)]);var l=e.concatenate(i,a(n,132)),u=e.factory.createMethodDeclaration(l,void 0,o,void 0,void 0,n.parameters,void 0,s);e.copyLeadingComments(p,u,r),t.push(u);}(t,n,o)}}}}function a(t,r){return e.canHaveModifiers(t)?e.filter(t.modifiers,(function(e){return e.kind===r})):void 0}function o(t){return !!t.name&&!(!e.isIdentifier(t.name)||"constructor"!==t.name.text)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program.getTypeChecker(),n.preferences,n.program.getCompilerOptions())}));return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_function_to_an_ES2015_class,r,e.Diagnostics.Convert_all_constructor_functions_to_classes)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="convertToAsyncFunction",a=[e.Diagnostics.This_may_be_converted_to_an_async_function.code],o=!0;function s(t,r,n,i){var a,o=e.getTokenAtPosition(r,n);if(a=e.isIdentifier(o)&&e.isVariableDeclaration(o.parent)&&o.parent.initializer&&e.isFunctionLikeDeclaration(o.parent.initializer)?o.parent.initializer:e.tryCast(e.getContainingFunction(e.getTokenAtPosition(r,n)),e.canBeConvertedToAsync)){var s=new e.Map,l=e.isInJSFile(a),u=function(t,r){if(!t.body)return new e.Set;var n=new e.Set;return e.forEachChild(t.body,(function t(i){c(i,r,"then")?(n.add(e.getNodeId(i)),e.forEach(i.arguments,t)):c(i,r,"catch")||c(i,r,"finally")?(n.add(e.getNodeId(i)),e.forEachChild(i,t)):_(i,r)?n.add(e.getNodeId(i)):e.forEachChild(i,t);})),n}(a,i),f=function(t,r,n){var i=new e.Map,a=e.createMultiMap();return e.forEachChild(t,(function t(o){if(e.isIdentifier(o)){var s=r.getSymbolAtLocation(o);if(s){var c=T(r.getTypeAtLocation(o),r),l=e.getSymbolId(s).toString();if(!c||e.isParameter(o.parent)||e.isFunctionLikeDeclaration(o.parent)||n.has(l)){if(o.parent&&(e.isParameter(o.parent)||e.isVariableDeclaration(o.parent)||e.isBindingElement(o.parent))){var u=o.text,_=a.get(u);if(_&&_.some((function(e){return e!==s}))){var p=d(o,a);i.set(l,p.identifier),n.set(l,p),a.add(u,s);}else {var f=e.getSynthesizedDeepClone(o);n.set(l,N(f)),a.add(u,s);}}}else {var g=e.firstOrUndefined(c.parameters),m=(null==g?void 0:g.valueDeclaration)&&e.isParameter(g.valueDeclaration)&&e.tryCast(g.valueDeclaration.name,e.isIdentifier)||e.factory.createUniqueName("result",16),y=d(m,a);n.set(l,y),a.add(m.text,s);}}}else e.forEachChild(o,t);})),e.getSynthesizedDeepCloneWithReplacements(t,!0,(function(t){if(e.isBindingElement(t)&&e.isIdentifier(t.name)&&e.isObjectBindingPattern(t.parent)){if((a=(n=r.getSymbolAtLocation(t.name))&&i.get(String(e.getSymbolId(n))))&&a.text!==(t.name||t.propertyName).getText())return e.factory.createBindingElement(t.dotDotDotToken,t.propertyName||t.name,a,t.initializer)}else if(e.isIdentifier(t)){var n,a;if(a=(n=r.getSymbolAtLocation(t))&&i.get(String(e.getSymbolId(n))))return e.factory.createIdentifier(a.text)}}))}(a,i,s);if(e.returnsPromise(f,i)){var m=f.body&&e.isBlock(f.body)?function(t,r){var n=[];return e.forEachReturnStatement(t,(function(t){e.isReturnStatementWithFixablePromiseHandler(t,r)&&n.push(t);})),n}(f.body,i):e.emptyArray,y={checker:i,synthNamesMap:s,setOfExpressionsToReturn:u,isInJSFile:l};if(m.length){var v=e.skipTrivia(r.text,e.moveRangePastModifiers(a).pos);t.insertModifierAt(r,v,132,{suffix:" "});for(var h=function(n){if(e.forEachChild(n,(function i(a){if(e.isCallExpression(a)){var o=g(a,a,y,!1);if(p())return !0;t.replaceNodeWithNodes(r,n,o);}else if(!e.isFunctionLike(a)&&(e.forEachChild(a,i),p()))return !0})),p())return {value:void 0}},b=0,x=m;b<x.length;b++){var D=h(x[b]);if("object"==typeof D)return D.value}}}}}function c(t,r,n){if(!e.isCallExpression(t))return !1;var i=e.hasPropertyAccessExpressionWithName(t,n)&&r.getTypeAtLocation(t);return !(!i||!r.getPromisedTypeOfPromise(i))}function l(t,r){return 0!=(4&e.getObjectFlags(t))&&t.target===r}function u(t,r,n){if("finally"!==t.expression.name.escapedText){var i=n.getTypeAtLocation(t.expression.expression);if(l(i,n.getPromiseType())||l(i,n.getPromiseLikeType())){if("then"!==t.expression.name.escapedText)return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,0))return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,1))return e.elementAt(t.typeArguments,1)}}}function _(t,r){return !!e.isExpression(t)&&!!r.getPromisedTypeOfPromise(r.getTypeAtLocation(t))}function d(t,r){var n=(r.get(t.text)||e.emptyArray).length;return N(0===n?t:e.factory.createIdentifier(t.text+"_"+n))}function p(){return !o}function f(){return o=!1,e.emptyArray}function g(t,r,n,i,a){if(c(r,n.checker,"then"))return function(t,r,n,i,a,o){if(!r||m(i,r))return h(t,n,i,a,o);if(n&&!m(i,n))return f();var s=E(r,i),c=g(t.expression.expression,t.expression.expression,i,!0,s);if(p())return f();var l=D(r,a,o,s,t,i);return p()?f():e.concatenate(c,l)}(r,e.elementAt(r.arguments,0),e.elementAt(r.arguments,1),n,i,a);if(c(r,n.checker,"catch"))return h(r,e.elementAt(r.arguments,0),n,i,a);if(c(r,n.checker,"finally"))return function(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=y(t,n,a),s=g(t,t.expression.expression,n,!0,o);if(p())return f();var c=D(r,i,void 0,void 0,t,n);if(p())return f();var l=e.factory.createBlock(s),u=e.factory.createBlock(c);return v(t,n,e.factory.createTryStatement(l,void 0,u),o,a)}(r,e.elementAt(r.arguments,0),n,i,a);if(e.isPropertyAccessExpression(r))return g(t,r.expression,n,i,a);var o=n.checker.getTypeAtLocation(r);return o&&n.checker.getPromisedTypeOfPromise(o)?(e.Debug.assertNode(e.getOriginalNode(r).parent,e.isPropertyAccessExpression),function(t,r,n,i,a){if(O(t,n)){var o=e.getSynthesizedDeepClone(r);return i&&(o=e.factory.createAwaitExpression(o)),[e.factory.createReturnStatement(o)]}return b(a,e.factory.createAwaitExpression(r),void 0)}(t,r,n,i,a)):f()}function m(t,r){var n=t.checker;if(104===r.kind)return !0;if(e.isIdentifier(r)&&!e.isGeneratedIdentifier(r)&&"undefined"===e.idText(r)){var i=n.getSymbolAtLocation(r);return !i||n.isUndefinedSymbol(i)}return !1}function y(t,r,n){var i;return n&&!O(t,r)&&(I(n)?(i=n,r.synthNamesMap.forEach((function(t,i){if(t.identifier.text===n.identifier.text){var a=(o=n,N(e.factory.createUniqueName(o.identifier.text,16)));r.synthNamesMap.set(i,a);}var o;}))):i=N(e.factory.createUniqueName("result",16),n.types),w(i)),i}function v(t,r,n,i,a){var o,s=[];if(i&&!O(t,r)){o=e.getSynthesizedDeepClone(w(i));var c=i.types,l=r.checker.getUnionType(c,2),u=r.isInJSFile?void 0:r.checker.typeToTypeNode(l,void 0,void 0),_=[e.factory.createVariableDeclaration(o,void 0,u)],d=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList(_,1));s.push(d);}return s.push(n),a&&o&&1===a.kind&&s.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(P(a)),void 0,void 0,o)],2))),s}function h(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=E(r,n),s=y(t,n,a),c=g(t,t.expression.expression,n,!0,s);if(p())return f();var l=D(r,i,s,o,t,n);if(p())return f();var u=e.factory.createBlock(c),_=e.factory.createCatchClause(o&&e.getSynthesizedDeepClone(F(o)),e.factory.createBlock(l));return v(t,n,e.factory.createTryStatement(u,_,void 0),s,a)}function b(t,r,n){return !t||k(t)?[e.factory.createExpressionStatement(r)]:I(t)&&t.hasBeenDeclared?[e.factory.createExpressionStatement(e.factory.createAssignment(e.getSynthesizedDeepClone(A(t)),r))]:[e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(F(t)),void 0,n,r)],2))]}function x(t,r){if(r&&t){var i=e.factory.createUniqueName("result",16);return n$4(n$4([],b(N(i),t,r),!0),[e.factory.createReturnStatement(i)],!1)}return [e.factory.createReturnStatement(t)]}function D(t,r,n,i,a,o){var s;switch(t.kind){case 104:break;case 208:case 79:if(!i)break;var c=e.factory.createCallExpression(e.getSynthesizedDeepClone(t),void 0,I(i)?[A(i)]:[]);if(O(a,o))return x(c,u(a,t,o.checker));var l=o.checker.getTypeAtLocation(t),d=o.checker.getSignaturesOfType(l,0);if(!d.length)return f();var p=d[0].getReturnType(),g=b(n,e.factory.createAwaitExpression(c),u(a,t,o.checker));return n&&n.types.push(o.checker.getAwaitedType(p)||p),g;case 215:case 216:var m=t.body,y=null===(s=T(o.checker.getTypeAtLocation(t),o.checker))||void 0===s?void 0:s.getReturnType();if(e.isBlock(m)){for(var v=[],h=!1,D=0,E=m.statements;D<E.length;D++){var k=E[D];if(e.isReturnStatement(k))if(h=!0,e.isReturnStatementWithFixablePromiseHandler(k,o.checker))v=v.concat(C(o,k,r,n));else {var N=y&&k.expression?S(o.checker,y,k.expression):k.expression;v.push.apply(v,x(N,u(a,t,o.checker)));}else {if(r&&e.forEachReturnStatement(k,e.returnTrue))return f();v.push(k);}}return O(a,o)?v.map((function(t){return e.getSynthesizedDeepClone(t)})):function(t,r,n,i){for(var a=[],o=0,s=t;o<s.length;o++){var c=s[o];if(e.isReturnStatement(c)){if(c.expression){var l=_(c.expression,n.checker)?e.factory.createAwaitExpression(c.expression):c.expression;void 0===r?a.push(e.factory.createExpressionStatement(l)):I(r)&&r.hasBeenDeclared?a.push(e.factory.createExpressionStatement(e.factory.createAssignment(A(r),l))):a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(F(r),void 0,void 0,l)],2)));}}else a.push(e.getSynthesizedDeepClone(c));}return i||void 0===r||a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(F(r),void 0,void 0,e.factory.createIdentifier("undefined"))],2))),a}(v,n,o,h)}var P=e.isFixablePromiseHandler(m,o.checker)?C(o,e.factory.createReturnStatement(m),r,n):e.emptyArray;if(P.length>0)return P;if(y){if(N=S(o.checker,y,m),O(a,o))return x(N,u(a,t,o.checker));var w=b(n,N,void 0);return n&&n.types.push(o.checker.getAwaitedType(y)||y),w}return f();default:return f()}return e.emptyArray}function S(t,r,n){var i=e.getSynthesizedDeepClone(n);return t.getPromisedTypeOfPromise(r)?e.factory.createAwaitExpression(i):i}function T(t,r){var n=r.getSignaturesOfType(t,0);return e.lastOrUndefined(n)}function C(t,r,n,i){var a=[];return e.forEachChild(r,(function r(o){if(e.isCallExpression(o)){var s=g(o,o,t,n,i);if((a=a.concat(s)).length>0)return}else e.isFunctionLike(o)||e.forEachChild(o,r);})),a}function E(t,r){var n,i=[];if(e.isFunctionLikeDeclaration(t)?t.parameters.length>0&&(n=function t(r){return e.isIdentifier(r)?a(r):function(t,r,n){return void 0===r&&(r=e.emptyArray),void 0===n&&(n=[]),{kind:1,bindingPattern:t,elements:r,types:n}}(r,e.flatMap(r.elements,(function(r){return e.isOmittedExpression(r)?[]:[t(r.name)]})))}(t.parameters[0].name)):e.isIdentifier(t)?n=a(t):e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&(n=a(t.name)),n&&(!("identifier"in n)||"undefined"!==n.identifier.text))return n;function a(t){var n,a=function(e){return e.symbol?e.symbol:r.checker.getSymbolAtLocation(e)}((n=t).original?n.original:n);return a&&r.synthNamesMap.get(e.getSymbolId(a).toString())||N(t,i)}}function k(t){return !t||(I(t)?!t.identifier.text:e.every(t.elements,k))}function N(e,t){return void 0===t&&(t=[]),{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function A(e){return e.hasBeenReferenced=!0,e.identifier}function F(e){return I(e)?w(e):P(e)}function P(e){for(var t=0,r=e.elements;t<r.length;t++)F(r[t]);return e.bindingPattern}function w(e){return e.hasBeenDeclared=!0,e.identifier}function I(e){return 0===e.kind}function O(t,r){return !!t.original&&r.setOfExpressionsToReturn.has(e.getNodeId(t.original))}t.registerCodeFix({errorCodes:a,getCodeActions:function(r){o=!0;var n=e.textChanges.ChangeTracker.with(r,(function(e){return s(e,r.sourceFile,r.span.start,r.program.getTypeChecker())}));return o?[t.createCodeFixAction(i,n,e.Diagnostics.Convert_to_async_function,i,e.Diagnostics.Convert_all_to_async_functions)]:[]},fixIds:[i],getAllCodeActions:function(e){return t.codeFixAll(e,a,(function(t,r){return s(t,r.file,r.start,e.program.getTypeChecker())}))}}),function(e){e[e.Identifier=0]="Identifier",e[e.BindingPattern=1]="BindingPattern";}(r||(r={}));}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t,r,n,i){for(var a=0,o=t.imports;a<o.length;a++){var s=o[a],c=e.getResolvedModule(t,s.text,e.getModeForUsageLocation(t,s));if(c&&c.resolvedFileName===r.fileName){var l=e.importFromModuleSpecifier(s);switch(l.kind){case 268:n.replaceNode(t,l,e.makeImport(l.name,void 0,s,i));break;case 210:e.isRequireCall(l,!1)&&n.replaceNode(t,l,e.factory.createPropertyAccessExpression(e.getSynthesizedDeepClone(l),"default"));}}}}function n(t,r){t.forEachChild((function n(i){if(e.isPropertyAccessExpression(i)&&e.isExportsOrModuleExportsOrAlias(t,i.expression)&&e.isIdentifier(i.name)){var a=i.parent;r(i,e.isBinaryExpression(a)&&a.left===i&&63===a.operatorToken.kind);}i.forEachChild(n);}));}function i(t,r,n,i,l,u,_,p,f){switch(r.kind){case 240:return a(t,r,i,n,l,u,f),!1;case 241:var y=r.expression;switch(y.kind){case 210:return e.isRequireCall(y,!0)&&i.replaceNode(t,r,e.makeImport(void 0,void 0,y.arguments[0],f)),!1;case 223:return 63===y.operatorToken.kind&&function(t,r,n,i,a,l){var u=n.left,_=n.right;if(!e.isPropertyAccessExpression(u))return !1;if(e.isExportsOrModuleExportsOrAlias(t,u)){if(!e.isExportsOrModuleExportsOrAlias(t,_)){var p=e.isObjectLiteralExpression(_)?function(t,r){var n=e.mapAllOrFail(t.properties,(function(t){switch(t.kind){case 174:case 175:case 300:case 301:return;case 299:return e.isIdentifier(t.name)?function(t,r,n){var i=[e.factory.createToken(93)];switch(r.kind){case 215:var a=r.name;if(a&&a.text!==t)return o();case 216:return d(t,i,r,n);case 228:return function(t,r,n,i){return e.factory.createClassDeclaration(e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.heritageClauses),c(n.members,i))}(t,i,r,n);default:return o()}function o(){return g(i,e.factory.createIdentifier(t),c(r,n))}}(t.name.text,t.initializer,r):void 0;case 171:return e.isIdentifier(t.name)?d(t.name.text,[e.factory.createToken(93)],t,r):void 0;default:e.Debug.assertNever(t,"Convert to ES6 got invalid prop kind ".concat(t.kind));}}));return n&&[n,!1]}(_,l):e.isRequireCall(_,!0)?function(t,r){var n=t.text,i=r.getSymbolAtLocation(t),a=i?i.exports:e.emptyMap;return a.has("export=")?[[s(n)],!0]:a.has("default")?a.size>1?[[o(n),s(n)],!0]:[[s(n)],!0]:[[o(n)],!1]}(_.arguments[0],r):void 0;return p?(i.replaceNodeWithNodes(t,n.parent,p[0]),p[1]):(i.replaceRangeWithText(t,e.createRange(u.getStart(t),_.pos),"export default"),!0)}i.delete(t,n.parent);}else e.isExportsOrModuleExportsOrAlias(t,u.expression)&&function(t,r,n,i){var a=r.left.name.text,o=i.get(a);if(void 0!==o){var s=[g(void 0,o,r.right),m([e.factory.createExportSpecifier(!1,o,a)])];n.replaceNodeWithNodes(t,r.parent,s);}else !function(t,r,n){var i=t.left,a=t.right,o=t.parent,s=i.name.text;if(!(e.isFunctionExpression(a)||e.isArrowFunction(a)||e.isClassExpression(a))||a.name&&a.name.text!==s)n.replaceNodeRangeWithNodes(r,i.expression,e.findChildOfKind(i,24,r),[e.factory.createToken(93),e.factory.createToken(85)],{joiner:" ",suffix:" "});else {n.replaceRange(r,{pos:i.getStart(r),end:a.getStart(r)},e.factory.createToken(93),{suffix:" "}),a.name||n.insertName(r,a,s);var c=e.findChildOfKind(o,26,r);c&&n.delete(r,c);}}(r,t,n);}(t,n,i,a);return !1}(t,n,y,i,_,p)}default:return !1}}function a(r,n,i,a,o,s,c){var u,_=n.declarationList,d=!1,m=e.map(_.declarations,(function(n){var i=n.name,u=n.initializer;if(u){if(e.isExportsOrModuleExportsOrAlias(r,u))return d=!0,y([]);if(e.isRequireCall(u,!0))return d=!0,function(r,n,i,a,o,s){switch(r.kind){case 203:var c=e.mapAllOrFail(r.elements,(function(t){return t.dotDotDotToken||t.initializer||t.propertyName&&!e.isIdentifier(t.propertyName)||!e.isIdentifier(t.name)?void 0:f(t.propertyName&&t.propertyName.text,t.name.text)}));if(c)return y([e.makeImport(void 0,c,n,s)]);case 204:var u=l(t.moduleSpecifierToValidIdentifier(n.text,o),a);return y([e.makeImport(e.factory.createIdentifier(u),void 0,n,s),g(void 0,e.getSynthesizedDeepClone(r),e.factory.createIdentifier(u))]);case 79:return function(t,r,n,i,a){for(var o,s=n.getSymbolAtLocation(t),c=new e.Map,u=!1,_=0,d=i.original.get(t.text);_<d.length;_++){var p=d[_];if(n.getSymbolAtLocation(p)===s&&p!==t){var f=p.parent;if(e.isPropertyAccessExpression(f)){var g=f.name.text;if("default"===g){u=!0;var m=p.getText();(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(m));}else {e.Debug.assert(f.expression===p,"Didn't expect expression === use");var v=c.get(g);void 0===v&&(v=l(g,i),c.set(g,v)),(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(v));}}else u=!0;}}var h=0===c.size?void 0:e.arrayFrom(e.mapIterator(c.entries(),(function(t){var r=t[0],n=t[1];return e.factory.createImportSpecifier(!1,r===n?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(n))})));return h||(u=!0),y([e.makeImport(u?e.getSynthesizedDeepClone(t):void 0,h,r,a)],o)}(r,n,i,a,s);default:return e.Debug.assertNever(r,"Convert to ES module got invalid name kind ".concat(r.kind))}}(i,u.arguments[0],a,o,s,c);if(e.isPropertyAccessExpression(u)&&e.isRequireCall(u.expression,!0))return d=!0,function(t,r,n,i,a){switch(t.kind){case 203:case 204:var o=l(r,i);return y([p(o,r,n,a),g(void 0,t,e.factory.createIdentifier(o))]);case 79:return y([p(t.text,r,n,a)]);default:return e.Debug.assertNever(t,"Convert to ES module got invalid syntax form ".concat(t.kind))}}(i,u.name.text,u.expression.arguments[0],o,c)}return y([e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([n],_.flags))])}));if(d)return i.replaceNodeWithNodes(r,n,e.flatMap(m,(function(e){return e.newImports}))),e.forEach(m,(function(t){t.useSitesToUnqualify&&e.copyEntries(t.useSitesToUnqualify,null!=u?u:u=new e.Map);})),u}function o(e){return m(void 0,e)}function s(t){return m([e.factory.createExportSpecifier(!1,void 0,"default")],t)}function c(t,r){return r&&e.some(e.arrayFrom(r.keys()),(function(r){return e.rangeContainsRange(t,r)}))?e.isArray(t)?e.getSynthesizedDeepClonesWithReplacements(t,!0,n):e.getSynthesizedDeepCloneWithReplacements(t,!0,n):t;function n(e){if(208===e.kind){var t=r.get(e);return r.delete(e),t}}}function l(e,t){for(;t.original.has(e)||t.additional.has(e);)e="_".concat(e);return t.additional.add(e),e}function u(t){var r=e.createMultiMap();return _(t,(function(e){return r.add(e.text,e)})),r}function _(t,r){e.isIdentifier(t)&&function(e){var t=e.parent;switch(t.kind){case 208:return t.name!==e;case 205:case 273:return t.propertyName!==e;default:return !0}}(t)&&r(t),t.forEachChild((function(e){return _(e,r)}));}function d(t,r,n,i){return e.factory.createFunctionDeclaration(e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),e.getSynthesizedDeepClone(n.asteriskToken),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.parameters),e.getSynthesizedDeepClone(n.type),e.factory.converters.convertToFunctionBlock(c(n.body,i)))}function p(t,r,n,i){return "default"===r?e.makeImport(e.factory.createIdentifier(t),void 0,n,i):e.makeImport(void 0,[f(r,t)],n,i)}function f(t,r){return e.factory.createImportSpecifier(!1,void 0!==t&&t!==r?e.factory.createIdentifier(t):void 0,e.factory.createIdentifier(r))}function g(t,r,n){return e.factory.createVariableStatement(t,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(r,void 0,void 0,n)],2))}function m(t,r){return e.factory.createExportDeclaration(void 0,!1,t&&e.factory.createNamedExports(t),void 0===r?void 0:e.factory.createStringLiteral(r))}function y(e,t){return {newImports:e,useSitesToUnqualify:t}}t.registerCodeFix({errorCodes:[e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions:function(o){var s=o.sourceFile,c=o.program,_=o.preferences,d=e.textChanges.ChangeTracker.with(o,(function(t){var o=function(t,r,o,s,c){var _={original:u(t),additional:new e.Set},d=function(t,r,i){var a=new e.Map;return n(t,(function(t){var n=t.name,o=n.text,s=n.originalKeywordKind;!a.has(o)&&(void 0!==s&&e.isNonContextualKeyword(s)||r.resolveName(o,t,111551,!0))&&a.set(o,l("_".concat(o),i));})),a}(t,r,_);!function(t,r,i){n(t,(function(n,a){if(!a){var o=n.name.text;i.replaceNode(t,n,e.factory.createIdentifier(r.get(o)||o));}}));}(t,d,o);for(var p,f=!1,g=0,m=e.filter(t.statements,e.isVariableStatement);g<m.length;g++){var y=m[g],v=a(t,y,o,r,_,s,c);v&&e.copyEntries(v,null!=p?p:p=new e.Map);}for(var h=0,b=e.filter(t.statements,(function(t){return !e.isVariableStatement(t)}));h<b.length;h++){y=b[h];var x=i(t,y,r,o,_,s,d,p,c);f=f||x;}return null==p||p.forEach((function(e,r){o.replaceNode(t,r,e);})),f}(s,c.getTypeChecker(),t,e.getEmitScriptTarget(c.getCompilerOptions()),e.getQuotePreference(s,_));if(o)for(var d=0,p=c.getSourceFiles();d<p.length;d++){var f=p[d];r(f,s,t,e.getQuotePreference(f,_));}}));return [t.createCodeFixActionWithoutFixAll("convertToEsModule",d,e.Diagnostics.Convert_to_ES_module)]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="correctQualifiedNameToIndexedAccessType",n=[e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];function i(t,r){var n=e.findAncestor(e.getTokenAtPosition(t,r),e.isQualifiedName);return e.Debug.assert(!!n,"Expected position to be owned by a qualified name."),e.isIdentifier(n.left)?n:void 0}function a(t,r,n){var i=n.right.text,a=e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(n.left,void 0),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(i)));t.replaceNode(r,n,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=i(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,n.sourceFile,o)})),c="".concat(o.left.text,'["').concat(o.right.text,'"]');return [t.createCodeFixAction(r,s,[e.Diagnostics.Rewrite_as_the_indexed_access_type_0,c],r,e.Diagnostics.Rewrite_all_as_indexed_access_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code],n="convertToTypeOnlyExport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isExportSpecifier)}function a(t,n,i){if(n){var a=n.parent,o=a.parent,s=function(t,n){var i=t.parent;if(1===i.elements.length)return i.elements;var a=e.getDiagnosticsWithinSpan(e.createTextSpanFromNode(i),n.program.getSemanticDiagnostics(n.sourceFile,n.cancellationToken));return e.filter(i.elements,(function(n){var i;return n===t||(null===(i=e.findDiagnosticForNode(n,a))||void 0===i?void 0:i.code)===r[0]}))}(n,i);if(s.length===a.elements.length)t.insertModifierBefore(i.sourceFile,154,a);else {var c=e.factory.updateExportDeclaration(o,o.modifiers,!1,e.factory.updateNamedExports(a,e.filter(a.elements,(function(t){return !e.contains(s,t)}))),o.moduleSpecifier,void 0),l=e.factory.createExportDeclaration(void 0,!0,e.factory.createNamedExports(s),o.moduleSpecifier,void 0);t.replaceNode(i.sourceFile,o,c,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude}),t.insertNodeAfter(i.sourceFile,o,l);}}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.span,r.sourceFile),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_export,n,e.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r,n.sourceFile);s&&e.addToSeen(o,e.getNodeId(s.parent.parent))&&a(t,s,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code],n="convertToTypeOnlyImport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isImportDeclaration)}function a(t,r,n){if(null==r?void 0:r.importClause){var i=r.importClause;t.insertText(n.sourceFile,r.getStart()+"import".length," type"),i.name&&i.namedBindings&&(t.deleteNodeRangeExcludingEnd(n.sourceFile,i.name,r.importClause.namedBindings),t.insertNodeBefore(n.sourceFile,r,e.factory.updateImportDeclaration(r,void 0,e.factory.createImportClause(!0,i.name,void 0),r.moduleSpecifier,void 0)));}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){a(e,i(r.span,r.sourceFile),r);}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_import,n,e.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(r,e.sourceFile),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertLiteralTypeToMappedType",n=[e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=e.cast(n.parent.parent,e.isPropertySignature),a=n.getText(t);return {container:e.cast(i.parent,e.isTypeLiteralNode),typeNode:i.type,constraint:a,name:"K"===a?"P":"K"}}}function a(t,r,n){var i=n.container,a=n.typeNode,o=n.constraint,s=n.name;t.replaceNode(r,i,e.factory.createMappedTypeNode(void 0,e.factory.createTypeParameterDeclaration(void 0,s,e.factory.createTypeReferenceNode(o)),void 0,void 0,a,void 0));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=c.name,u=c.constraint,_=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,_,[e.Diagnostics.Convert_0_to_1_in_0,u,l],r,e.Diagnostics.Convert_all_type_literals_to_mapped_type)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Class_0_incorrectly_implements_interface_1.code,e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],n="fixClassIncorrectlyImplementsInterface";function i(t,r){return e.Debug.checkDefined(e.getContainingClass(e.getTokenAtPosition(t,r)),"There should be a containing class")}function a(t){return !(t.valueDeclaration&&8&e.getEffectiveModifierFlags(t.valueDeclaration))}function o(r,n,i,o,s,c){var l=r.program.getTypeChecker(),u=function(t,r){var n=e.getEffectiveBaseTypeNode(t);if(!n)return e.createSymbolTable();var i=r.getTypeAtLocation(n),o=r.getPropertiesOfType(i);return e.createSymbolTable(o.filter(a))}(o,l),_=l.getTypeAtLocation(n),d=l.getPropertiesOfType(_).filter(e.and(a,(function(e){return !u.has(e.escapedName)}))),p=l.getTypeAtLocation(o),f=e.find(o.members,(function(t){return e.isConstructorDeclaration(t)}));p.getNumberIndexType()||m(_,1),p.getStringIndexType()||m(_,0);var g=t.createImportAdder(i,r.program,c,r.host);function m(e,n){var a=l.getIndexInfoOfType(e,n);a&&y(i,o,l.indexInfoToIndexSignatureDeclaration(a,o,void 0,t.getNoopSymbolTrackerWithResolver(r)));}function y(e,t,r){f?s.insertNodeAfter(e,f,r):s.insertMemberAtStart(e,t,r);}t.createMissingMemberNodes(o,d,i,r,c,g,(function(e){return y(i,o,e)})),g.writeFixes(s);}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=r.sourceFile,s=r.span,c=i(a,s.start);return e.mapDefined(e.getEffectiveImplementsTypeNodes(c),(function(i){var s=e.textChanges.ChangeTracker.with(r,(function(e){return o(r,i,a,c,e,r.preferences)}));return 0===s.length?void 0:t.createCodeFixAction(n,s,[e.Diagnostics.Implement_interface_0,i.getText(a)],n,e.Diagnostics.Implement_all_unimplemented_interfaces)}))},fixIds:[n],getAllCodeActions:function(n){var a=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);if(e.addToSeen(a,e.getNodeId(s)))for(var c=0,l=e.getEffectiveImplementsTypeNodes(s);c<l.length;c++){var u=l[c];o(n,u,r.file,s,t,n.preferences);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){t.importFixName="import";var r,a,o="fixMissingImport",s=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics.Cannot_find_namespace_0.code,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code];function c(t,r,n,i,a,o){var s=r.getCompilerOptions(),c=[],u=[],d=new e.Map,p=new e.Map;return {addImportFromDiagnostic:function(t,r){var i=v(r,t.code,t.start,n);i&&i.length&&f(e.first(i));},addImportFromExportedSymbol:function(n,c){var u=e.Debug.checkDefined(n.parent),d=e.getNameForExportedSymbol(n,e.getEmitScriptTarget(s)),p=r.getTypeChecker(),g=p.getMergedSymbol(e.skipAlias(n,p)),y=_(t,g,d,!1,r,a,i,o),v=m(t,r),h=l(t,e.Debug.checkDefined(y),u,r,void 0,!!c,v,a,i);h&&f({fix:h,symbolName:d,errorIdentifierText:void 0});},writeFixes:function(r){for(var n,a=e.getQuotePreference(t,i),o=0,l=c;o<l.length;o++){var _=l[o];N(r,t,_);}for(var f=0,g=u;f<g.length;f++)_=g[f],A(r,t,_,a);d.forEach((function(n){var i=n.importClauseOrBindingPattern,a=n.defaultImport,o=n.namedImports;k(r,t,i,a,e.arrayFrom(o.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),s);})),p.forEach((function(t,r){var i=t.useRequire,o=t.defaultImport,s=t.namedImports,c=t.namespaceLikeImport,l=(i?I:w)(r.slice(2),a,o,s&&e.arrayFrom(s.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),c);n=e.combine(n,l);})),n&&e.insertImports(r,t,n,!0);},hasFixes:function(){return c.length>0||u.length>0||d.size>0||p.size>0}};function f(t){var r,n,i=t.fix,a=t.symbolName;switch(i.kind){case 0:c.push(i);break;case 1:u.push(i);break;case 2:var o=i.importClauseOrBindingPattern,s=i.importKind,l=i.addAsTypeOnly,_=String(e.getNodeId(o));if((y=d.get(_))||d.set(_,y={importClauseOrBindingPattern:o,defaultImport:void 0,namedImports:new e.Map}),0===s){var f=null==y?void 0:y.namedImports.get(a);y.namedImports.set(a,v(f,l));}else e.Debug.assert(void 0===y.defaultImport||y.defaultImport.name===a,"(Add to Existing) Default import should be missing or match symbolName"),y.defaultImport={name:a,addAsTypeOnly:v(null===(r=y.defaultImport)||void 0===r?void 0:r.addAsTypeOnly,l)};break;case 3:var g=i.moduleSpecifier,m=(s=i.importKind,i.useRequire),y=function(e,t,r,n){var i=h(e,!0),a=h(e,!1),o=p.get(i),s=p.get(a),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:r};return 1===t&&2===n?o||(p.set(i,c),c):1===n&&(o||s)?o||s:s||(p.set(a,c),c)}(g,s,m,l=i.addAsTypeOnly);switch(e.Debug.assert(y.useRequire===m,"(Add new) Tried to add an `import` and a `require` for the same module"),s){case 1:e.Debug.assert(void 0===y.defaultImport||y.defaultImport.name===a,"(Add new) Default import should be missing or match symbolName"),y.defaultImport={name:a,addAsTypeOnly:v(null===(n=y.defaultImport)||void 0===n?void 0:n.addAsTypeOnly,l)};break;case 0:f=(y.namedImports||(y.namedImports=new e.Map)).get(a),y.namedImports.set(a,v(f,l));break;case 3:case 2:e.Debug.assert(void 0===y.namespaceLikeImport||y.namespaceLikeImport.name===a,"Namespacelike import shoudl be missing or match symbolName"),y.namespaceLikeImport={importKind:s,name:a,addAsTypeOnly:l};}break;case 4:break;default:e.Debug.assertNever(i,"fix wasn't never - got kind ".concat(i.kind));}function v(e,t){return Math.max(null!=e?e:0,t)}function h(e,t){return "".concat(t?1:0,"|").concat(e)}}}function l(t,r,n,i,a,o,s,c,l){e.Debug.assert(r.some((function(e){return e.moduleSymbol===n||e.symbol.parent===n})),"Some exportInfo should match the specified moduleSymbol");var u=e.createPackageJsonImportFilter(t,l,c);return h(p(r,a,o,s,i,t,c,l).fixes,t,i,u,c)}function u(e){return {description:e.description,changes:e.changes,commands:e.commands}}function _(t,r,n,i,a,o,s,c){var l=y(a,o);return e.getExportInfoMap(t,o,a,s,c).search(t.path,i,(function(e){return e===n}),(function(t){if(e.skipAlias(t[0].symbol,l(t[0].isFromPackageJson))===r)return t}))}function d(t,r,n,i){var a,o,s=n.getCompilerOptions(),c=u(n.getTypeChecker(),!1);if(c)return c;var l=null===(o=null===(a=i.getPackageJsonAutoImportProvider)||void 0===a?void 0:a.call(i))||void 0===o?void 0:o.getTypeChecker();return e.Debug.checkDefined(l&&u(l,!0),"Could not find symbol in specified module for code actions");function u(n,i){var a=e.getDefaultLikeExportInfo(r,n,s);if(a&&e.skipAlias(a.symbol,n)===t)return {symbol:a.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:a.exportKind,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i};var o=n.tryGetMemberInModuleExportsAndProperties(t.name,r);return o&&e.skipAlias(o,n)===t?{symbol:o,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i}:void 0}}function p(t,r,i,a,o,s,c,l,u,_){void 0===u&&(u=g(o.getTypeChecker(),s,o.getCompilerOptions()));var d=o.getTypeChecker(),p=e.flatMap(t,u.getImportsForExportInfo),m=r&&function(t,r,n,i){return e.firstDefined(t,(function(t){var a,o=t.declaration,s=function(t){var r,n,i;switch(t.kind){case 257:return null===(r=e.tryCast(t.name,e.isIdentifier))||void 0===r?void 0:r.text;case 268:return t.name.text;case 269:return null===(i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport))||void 0===i?void 0:i.name.text;default:return e.Debug.assertNever(t)}}(o),c=null===(a=e.tryGetModuleSpecifierFromDeclaration(o))||void 0===a?void 0:a.text;if(s&&c){var l=function(t,r){var n;switch(t.kind){case 257:return r.resolveExternalModuleName(t.initializer.arguments[0]);case 268:return r.getAliasedSymbol(t.symbol);case 269:var i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport);return i&&r.getAliasedSymbol(i.symbol);default:return e.Debug.assertNever(t)}}(o,i);if(l&&l.exports.has(e.escapeLeadingUnderscores(r)))return {kind:0,namespacePrefix:s,position:n,moduleSpecifier:c}}}))}(p,r.symbolName,r.position,d),v=function(t,r,n,i){return e.firstDefined(t,(function(t){var a=t.declaration,o=t.importKind,s=t.symbol,c=t.targetFlags;if(3!==o&&2!==o&&268!==a.kind){if(257===a.kind)return 0!==o&&1!==o||203!==a.name.kind?void 0:{kind:2,importClauseOrBindingPattern:a.name,importKind:o,moduleSpecifier:a.initializer.arguments[0].text,addAsTypeOnly:4};var l=a.importClause;if(l&&e.isStringLiteralLike(a.moduleSpecifier)){var u=l.name,_=l.namedBindings;if(!l.isTypeOnly||0===o&&_){var d=f(r,!1,s,c,n,i);if(!(1===o&&(u||2===d&&_)||0===o&&271===(null==_?void 0:_.kind)))return {kind:2,importClauseOrBindingPattern:l,importKind:o,moduleSpecifier:a.moduleSpecifier.text,addAsTypeOnly:d}}}}}))}(p,i,d,o.getCompilerOptions());if(v)return {computedWithoutCacheCount:0,fixes:n$4(n$4([],m?[m]:e.emptyArray,!0),[v],!1)};var h=function(t,r,n,i,a,o,s,c,l,u){var _=e.firstDefined(r,(function(t){return function(t,r,n,i,a){var o,s=t.declaration,c=t.importKind,l=t.symbol,u=t.targetFlags,_=null===(o=e.tryGetModuleSpecifierFromDeclaration(s))||void 0===o?void 0:o.text;if(_)return {kind:3,moduleSpecifier:_,importKind:c,addAsTypeOnly:n?4:f(r,!0,l,u,i,a),useRequire:n}}(t,o,s,n.getTypeChecker(),n.getCompilerOptions())}));return _?{fixes:[_]}:function(t,r,n,i,a,o,s,c,l){var u=e.isSourceFileJS(r),_=t.getCompilerOptions(),d=e.createModuleSpecifierResolutionHost(t,s),p=y(t,s),g=e.moduleResolutionUsesNodeModules(e.getEmitModuleResolutionKind(_)),m=l?function(t){return {moduleSpecifiers:e.moduleSpecifiers.tryGetModuleSpecifiersFromCache(t,r,d,c),computedWithoutCache:!1}}:function(t,n){return e.moduleSpecifiers.getModuleSpecifiersWithCacheInfo(t,n,_,r,d,c)},v=0,h=e.flatMap(o,(function(t,o){var s=p(t.isFromPackageJson),c=m(t.moduleSymbol,s),l=c.computedWithoutCache,d=c.moduleSpecifiers,y=!!(111551&t.targetFlags),h=f(i,!0,t.symbol,t.targetFlags,s,_);return v+=l?1:0,e.mapDefined(d,(function(i){return g&&e.pathContainsNodeModules(i)?void 0:!y&&u&&void 0!==n?{kind:1,moduleSpecifier:i,position:n,exportInfo:t,isReExport:o>0}:{kind:3,moduleSpecifier:i,importKind:D(r,t.exportKind,_),useRequire:a,addAsTypeOnly:h,exportInfo:t,isReExport:o>0}}))}));return {computedWithoutCacheCount:v,fixes:h}}(n,i,a,o,s,t,c,l,u)}(t,p,o,s,null==r?void 0:r.position,i,a,c,l,_),b=h.fixes,x=h.computedWithoutCacheCount;return {computedWithoutCacheCount:void 0===x?0:x,fixes:n$4(n$4([],m?[m]:e.emptyArray,!0),b,!0)}}function f(e,t,r,n,i,a){return e?t&&2===a.importsNotUsedAsValues?2:!a.isolatedModules||!a.preserveValueImports||111551&n&&!i.getTypeOnlyAliasDeclaration(r)?1:2:4}function g(t,r,n){for(var i,a=0,o=r.imports;a<o.length;a++){var s=o[a],c=e.importFromModuleSpecifier(s);if(e.isVariableDeclarationInitializedToRequire(c.parent))(l=t.resolveExternalModuleName(s))&&(i||(i=e.createMultiMap())).add(e.getSymbolId(l),c.parent);else if(269===c.kind||268===c.kind){var l;(l=t.getSymbolAtLocation(s))&&(i||(i=e.createMultiMap())).add(e.getSymbolId(l),c);}}return {getImportsForExportInfo:function(t){var a=t.moduleSymbol,o=t.exportKind,s=t.targetFlags,c=t.symbol;if(!(111551&s)&&e.isSourceFileJS(r))return e.emptyArray;var l=null==i?void 0:i.get(e.getSymbolId(a));if(!l)return e.emptyArray;var u=D(r,o,n);return l.map((function(e){return {declaration:e,importKind:u,symbol:c,targetFlags:s}}))}}}function m(t,r){if(!e.isSourceFileJS(t))return !1;if(t.commonJsModuleIndicator&&!t.externalModuleIndicator)return !0;if(t.externalModuleIndicator&&!t.commonJsModuleIndicator)return !1;var n=r.getCompilerOptions();if(n.configFile)return e.getEmitModuleKind(n)<e.ModuleKind.ES2015;for(var i=0,a=r.getSourceFiles();i<a.length;i++){var o=a[i];if(o!==t&&e.isSourceFileJS(o)&&!r.isSourceFileFromExternalLibrary(o)){if(o.commonJsModuleIndicator&&!o.externalModuleIndicator)return !0;if(o.externalModuleIndicator&&!o.commonJsModuleIndicator)return !1}}return !0}function y(t,r){return e.memoizeOne((function(e){return e?r.getPackageJsonAutoImportProvider().getTypeChecker():t.getTypeChecker()}))}function v(t,r,n,i){var a,o=e.getTokenAtPosition(t.sourceFile,n);if(r===e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code)a=function(t,r){var n=t.sourceFile,i=t.program,a=t.host,o=t.preferences,s=i.getTypeChecker(),c=function(t,r){var n=e.isIdentifier(t)?r.getSymbolAtLocation(t):void 0;if(e.isUMDExportSymbol(n))return n;var i=t.parent;return e.isJsxOpeningLikeElement(i)&&i.tagName===t||e.isJsxOpeningFragment(i)?e.tryCast(r.resolveName(r.getJsxNamespace(i),e.isJsxOpeningLikeElement(i)?t:i,111551,!1),e.isUMDExportSymbol):void 0}(r,s);if(c){var l=s.getAliasedSymbol(c),u=c.name,_=[{symbol:c,moduleSymbol:l,moduleFileName:void 0,exportKind:3,targetFlags:l.flags,isFromPackageJson:!1}],d=m(n,i),f=e.isIdentifier(r)?r.getStart(n):void 0;return p(_,f?{position:f,symbolName:u}:void 0,!1,d,i,n,a,o).fixes.map((function(t){var n;return {fix:t,symbolName:u,errorIdentifierText:null===(n=e.tryCast(r,e.isIdentifier))||void 0===n?void 0:n.text}}))}}(t,o);else {if(!e.isIdentifier(o))return;if(r===e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code){var s=e.single(T(t.sourceFile,t.program.getTypeChecker(),o,t.program.getCompilerOptions())),c=S(t.sourceFile,o,s,t.program);return c&&[{fix:c,symbolName:s,errorIdentifierText:o.text}]}a=function(t,r,n){var i=t.sourceFile,a=t.program,o=t.cancellationToken,s=t.host,c=t.preferences,l=a.getTypeChecker(),u=a.getCompilerOptions();return e.flatMap(T(i,l,r,u),(function(t){if("default"!==t){var l=e.isValidTypeOnlyAliasUseSite(r),u=m(i,a),_=function(t,r,n,i,a,o,s,c,l){var u,_=e.createMultiMap(),d=e.createPackageJsonImportFilter(a,l,c),p=null===(u=c.getModuleSpecifierCache)||void 0===u?void 0:u.call(c),f=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?c.getPackageJsonAutoImportProvider():o,c)}));function g(t,r,n,i,o,s){var c=f(s);if(r&&e.isImportableFile(o,a,r,l,d,c,p)||!r&&d.allowsImportingAmbientModule(t,c)){var u=o.getTypeChecker();_.add(e.getUniqueSymbolId(n,u).toString(),{symbol:n,moduleSymbol:t,moduleFileName:null==r?void 0:r.fileName,exportKind:i,targetFlags:e.skipAlias(n,u).flags,isFromPackageJson:s});}}return e.forEachExternalModuleToImportFrom(o,c,l,s,(function(a,o,s,c){var l=s.getTypeChecker();i.throwIfCancellationRequested();var u=s.getCompilerOptions(),_=e.getDefaultLikeExportInfo(a,l,u);_&&(_.name===t||L(a,e.getEmitScriptTarget(u),r)===t)&&M(_.symbolForMeaning,n)&&g(a,o,_.symbol,_.exportKind,s,c);var d=l.tryGetMemberInModuleExportsAndProperties(t,a);d&&M(d,n)&&g(a,o,d,0,s,c);})),_}(t,e.isJSXTagName(r),e.getMeaningFromLocation(r),o,i,a,n,s,c),d=e.arrayFrom(e.flatMapIterator(_.entries(),(function(e){return p(e[1],{symbolName:t,position:r.getStart(i)},l,u,a,i,s,c).fixes})));return d.map((function(e){return {fix:e,symbolName:t,errorIdentifierText:r.text,isJsxNamespaceFix:t!==r.text}}))}}))}(t,o,i);}var l=e.createPackageJsonImportFilter(t.sourceFile,t.preferences,t.host);return a&&function(t,r,n,i,a){var o=function(t){return e.toPath(t,a.getCurrentDirectory(),e.hostGetCanonicalFileName(a))};return e.sort(t,(function(t,a){return e.compareBooleans(!!t.isJsxNamespaceFix,!!a.isJsxNamespaceFix)||e.compareValues(t.fix.kind,a.fix.kind)||b(t.fix,a.fix,r,n,i.allowsImportingSpecifier,o)}))}(a,t.sourceFile,t.program,l,t.host)}function h(t,r,n,i,a){if(e.some(t))return 0===t[0].kind||2===t[0].kind?t[0]:t.reduce((function(t,o){return -1===b(o,t,r,n,i.allowsImportingSpecifier,(function(t){return e.toPath(t,a.getCurrentDirectory(),e.hostGetCanonicalFileName(a))}))?o:t}))}function b(t,r,n,i,a,o){return 0!==t.kind&&0!==r.kind?e.compareBooleans(a(r.moduleSpecifier),a(t.moduleSpecifier))||function(t,r,n,i){return e.startsWith(t,"node:")&&!e.startsWith(r,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?-1:1:e.startsWith(r,"node:")&&!e.startsWith(t,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?1:-1:0}(t.moduleSpecifier,r.moduleSpecifier,n,i)||e.compareBooleans(x(t,n,i.getCompilerOptions(),o),x(r,n,i.getCompilerOptions(),o))||e.compareNumberOfDirectorySeparators(t.moduleSpecifier,r.moduleSpecifier):0}function x(t,r,n,i){var a,o;if(t.isReExport&&(null===(a=t.exportInfo)||void 0===a?void 0:a.moduleFileName)&&e.getEmitModuleResolutionKind(n)===e.ModuleResolutionKind.NodeJs&&(o=t.exportInfo.moduleFileName,"index"===e.getBaseFileName(o,[".js",".jsx",".d.ts",".ts",".tsx"],!0))){var s=i(e.getDirectoryPath(t.exportInfo.moduleFileName));return e.startsWith(r.path,s)}return !1}function D(t,r,n,i){switch(r){case 0:return 0;case 1:return 1;case 2:return function(t,r,n){var i=e.getAllowSyntheticDefaultImports(r),a=e.isInJSFile(t);if(!a&&e.getEmitModuleKind(r)>=e.ModuleKind.ES2015)return i?1:2;if(a)return e.isExternalModule(t)||n?i?1:2:3;for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];if(e.isImportEqualsDeclaration(c)&&!e.nodeIsMissing(c.moduleReference))return 3}return i?1:3}(t,n,!!i);case 3:return function(t,r,n){if(e.getAllowSyntheticDefaultImports(r))return 1;var i=e.getEmitModuleKind(r);switch(i){case e.ModuleKind.AMD:case e.ModuleKind.CommonJS:case e.ModuleKind.UMD:return e.isInJSFile(t)&&(e.isExternalModule(t)||n)?2:3;case e.ModuleKind.System:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.None:return 2;case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return t.impliedNodeFormat===e.ModuleKind.ESNext?2:3;default:return e.Debug.assertNever(i,"Unexpected moduleKind ".concat(i))}}(t,n,!!i);default:return e.Debug.assertNever(r)}}function S(t,r,n,i){var a=i.getTypeChecker(),o=a.resolveName(n,r,111551,!0);if(o){var s=a.getTypeOnlyAliasDeclaration(o);if(s&&e.getSourceFileOfNode(s)===t)return {kind:4,typeOnlyAliasDeclaration:s}}}function T(t,r,n,i){var a=n.parent;if((e.isJsxOpeningLikeElement(a)||e.isJsxClosingElement(a))&&a.tagName===n&&e.jsxModeNeedsExplicitImport(i.jsx)){var o=r.getJsxNamespace(t);if(function(t,r,n){if(e.isIntrinsicJsxName(r.text))return !0;var i=n.resolveName(t,r,111551,!0);return !i||e.some(i.declarations,e.isTypeOnlyImportOrExportDeclaration)&&!(111551&i.flags)}(o,n,r))return e.isIntrinsicJsxName(n.text)||r.resolveName(n.text,n,111551,!1)?[o]:[n.text,o]}return [n.text]}function C(r,n,i,a,s,c,l){var u,_=e.textChanges.ChangeTracker.with(r,(function(t){u=function(t,r,n,i,a,o,s){switch(i.kind){case 0:return N(t,r,i),[e.Diagnostics.Change_0_to_1,n,"".concat(i.namespacePrefix,".").concat(n)];case 1:return A(t,r,i,o),[e.Diagnostics.Change_0_to_1,n,F(i.moduleSpecifier,o)+n];case 2:var c=i.importClauseOrBindingPattern,l=i.importKind,u=i.addAsTypeOnly,_=i.moduleSpecifier;k(t,r,c,1===l?{name:n,addAsTypeOnly:u}:void 0,0===l?[{name:n,addAsTypeOnly:u}]:e.emptyArray,s);var d=e.stripQuotes(_);return a?[e.Diagnostics.Import_0_from_1,n,d]:[e.Diagnostics.Update_import_from_0,d];case 3:l=i.importKind,_=i.moduleSpecifier,u=i.addAsTypeOnly;var p=i.useRequire?I:w,f=1===l?{name:n,addAsTypeOnly:u}:void 0,g=0===l?[{name:n,addAsTypeOnly:u}]:void 0,m=2===l||3===l?{importKind:l,name:n,addAsTypeOnly:u}:void 0;return e.insertImports(t,r,p(_,o,f,g,m),!0),a?[e.Diagnostics.Import_0_from_1,n,_]:[e.Diagnostics.Add_import_from_0,_];case 4:var y=function(t,r,n,i){var a=n.preserveValueImports&&n.isolatedModules;switch(r.kind){case 273:if(r.isTypeOnly){if(r.parent.elements.length>1&&e.OrganizeImports.importSpecifiersAreSorted(r.parent.elements)){t.delete(i,r);var o=e.factory.updateImportSpecifier(r,!1,r.propertyName,r.name),s=e.OrganizeImports.getImportSpecifierInsertionIndex(r.parent.elements,o);t.insertImportSpecifierAtIndex(i,o,r.parent,s);}else t.deleteRange(i,r.getFirstToken());return r}return e.Debug.assert(r.parent.parent.isTypeOnly),c(r.parent.parent),r.parent.parent;case 270:return c(r),r;case 271:return c(r.parent),r.parent;case 268:return t.deleteRange(i,r.getChildAt(1)),r;default:e.Debug.failBadSyntaxKind(r);}function c(n){if(t.delete(i,e.getTypeKeywordOfTypeOnlyImport(n,i)),a){var o=e.tryCast(n.namedBindings,e.isNamedImports);if(o&&o.elements.length>1){e.OrganizeImports.importSpecifiersAreSorted(o.elements)&&273===r.kind&&0!==o.elements.indexOf(r)&&(t.delete(i,r),t.insertImportSpecifierAtIndex(i,r,o,0));for(var s=0,c=o.elements;s<c.length;s++){var l=c[s];l===r||l.isTypeOnly||t.insertModifierBefore(i,154,l);}}}}}(t,i.typeOnlyAliasDeclaration,s,r);return 273===y.kind?[e.Diagnostics.Remove_type_from_import_of_0_from_1,n,E(y.parent.parent)]:[e.Diagnostics.Remove_type_from_import_declaration_from_0,E(y)];default:return e.Debug.assertNever(i,"Unexpected fix kind ".concat(i.kind))}}(t,n,i,a,s,c,l);}));return t.createCodeFixAction(t.importFixName,_,u,o,e.Diagnostics.Add_all_missing_imports)}function E(t){var r,n;return 268===t.kind?(null===(n=e.tryCast(null===(r=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===r?void 0:r.expression,e.isStringLiteralLike))||void 0===n?void 0:n.text)||t.moduleReference.getText():e.cast(t.parent.moduleSpecifier,e.isStringLiteral).text}function k(t,r,i,a,o,s){var c;if(203!==i.kind){var l=i.isTypeOnly&&e.some(n$4([a],o,!0),(function(e){return 4===(null==e?void 0:e.addAsTypeOnly)})),u=i.namedBindings&&(null===(c=e.tryCast(i.namedBindings,e.isNamedImports))||void 0===c?void 0:c.elements),_=l&&s.preserveValueImports&&s.isolatedModules;if(a&&(e.Debug.assert(!i.name,"Cannot add a default import to an import clause that already has one"),t.insertNodeAt(r,i.getStart(r),e.factory.createIdentifier(a.name),{suffix:", "})),o.length){var d=e.stableSort(o.map((function(t){return e.factory.createImportSpecifier((!i.isTypeOnly||l)&&P(t),void 0,e.factory.createIdentifier(t.name))})),e.OrganizeImports.compareImportOrExportSpecifiers);if((null==u?void 0:u.length)&&e.OrganizeImports.importSpecifiersAreSorted(u))for(var p=0,f=d;p<f.length;p++){var g=f[p],m=_&&!g.isTypeOnly?0:e.OrganizeImports.getImportSpecifierInsertionIndex(u,g);t.insertImportSpecifierAtIndex(r,g,i.namedBindings,m);}else if(null==u?void 0:u.length)for(var y=0,v=d;y<v.length;y++)g=v[y],t.insertNodeInListAfter(r,e.last(u),g,u);else if(d.length){var h=e.factory.createNamedImports(d);i.namedBindings?t.replaceNode(r,i.namedBindings,h):t.insertNodeAfter(r,e.Debug.checkDefined(i.name,"Import clause must have either named imports or a default import"),h);}}if(l&&(t.delete(r,e.getTypeKeywordOfTypeOnlyImport(i,r)),_&&u))for(var b=0,x=u;b<x.length;b++)T=x[b],t.insertModifierBefore(r,154,T);}else {a&&C(i,a.name,"default");for(var D=0,S=o;D<S.length;D++){var T=S[D];C(i,T.name,void 0);}}function C(n,i,a){var o=e.factory.createBindingElement(void 0,a,i);n.elements.length?t.insertNodeInListAfter(r,e.last(n.elements),o):t.replaceNode(r,n,e.factory.createObjectBindingPattern([o]));}}function N(e,t,r){var n=r.namespacePrefix,i=r.position;e.insertText(t,i,n+".");}function A(e,t,r,n){var i=r.moduleSpecifier,a=r.position;e.insertText(t,a,F(i,n));}function F(t,r){var n=e.getQuoteFromPreference(r);return "import(".concat(n).concat(t).concat(n,").")}function P(e){return 2===e.addAsTypeOnly}function w(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(void 0!==n||(null==i?void 0:i.length)){var c=(!n||P(n))&&e.every(i,P);o=e.combine(o,e.makeImport(n&&e.factory.createIdentifier(n.name),null==i?void 0:i.map((function(t){var r=t.addAsTypeOnly,n=t.name;return e.factory.createImportSpecifier(!c&&2===r,void 0,e.factory.createIdentifier(n))})),t,r,c));}if(a){var l=3===a.importKind?e.factory.createImportEqualsDeclaration(void 0,P(a),e.factory.createIdentifier(a.name),e.factory.createExternalModuleReference(s)):e.factory.createImportDeclaration(void 0,e.factory.createImportClause(P(a),void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(a.name))),s,void 0);o=e.combine(o,l);}return e.Debug.checkDefined(o)}function I(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(n||(null==i?void 0:i.length)){var c=(null==i?void 0:i.map((function(t){var r=t.name;return e.factory.createBindingElement(void 0,void 0,r)})))||[];n&&c.unshift(e.factory.createBindingElement(void 0,"default",n.name));var l=O(e.factory.createObjectBindingPattern(c),s);o=e.combine(o,l);}return a&&(l=O(a.name,s),o=e.combine(o,l)),e.Debug.checkDefined(o)}function O(t,r){return e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration("string"==typeof t?e.factory.createIdentifier(t):t,void 0,void 0,e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[r]))],2))}function M(t,r){var n=t.declarations;return e.some(n,(function(t){return !!(e.getMeaningFromDeclaration(t)&r)}))}function L(t,r,n){return R(e.removeFileExtension(e.stripQuotes(t.name)),r,n)}function R(t,r,n){var i=e.getBaseFileName(e.removeSuffix(t,"/index")),a="",o=!0,s=i.charCodeAt(0);e.isIdentifierStart(s,r)?(a+=String.fromCharCode(s),n&&(a=a.toUpperCase())):o=!1;for(var c=1;c<i.length;c++){var l=i.charCodeAt(c),u=e.isIdentifierPart(l,r);if(u){var _=String.fromCharCode(l);o||(_=_.toUpperCase()),a+=_;}o=u;}return e.isStringANonContextualKeyword(a)?"_".concat(a):a||"_"}t.registerCodeFix({errorCodes:s,getCodeActions:function(t){var r=t.errorCode,n=t.preferences,i=t.sourceFile,a=t.span,o=t.program,s=v(t,r,a.start,!0);if(s){var c=e.getQuotePreference(i,n);return s.map((function(e){var r=e.fix,n=e.symbolName,a=e.errorIdentifierText;return C(t,i,n,r,n!==a,c,o.getCompilerOptions())}))}},fixIds:[o],getAllCodeActions:function(r){var n=c(r.sourceFile,r.program,!0,r.preferences,r.host,r.cancellationToken);return t.eachDiagnostic(r,s,(function(e){return n.addImportFromDiagnostic(e,r)})),t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,n.writeFixes))}}),t.createImportAdder=function(e,t,r,n,i){return c(e,t,!1,r,n,i)},t.createImportSpecifierResolver=function(t,r,n,a){var o=e.createPackageJsonImportFilter(t,a,n),s=g(r.getTypeChecker(),t,r.getCompilerOptions());return {getModuleSpecifierForBestExportInfo:function(e,c,l,u,_){var d=p(e,{symbolName:c,position:l},u,!1,r,t,n,a,s,_),f=d.fixes,g=d.computedWithoutCacheCount,m=h(f,t,r,o,n);return m&&i$1(i$1({},m),{computedWithoutCacheCount:g})}}},function(e){e[e.UseNamespace=0]="UseNamespace",e[e.JsdocTypeImport=1]="JsdocTypeImport",e[e.AddToExisting=2]="AddToExisting",e[e.AddNew=3]="AddNew",e[e.PromoteTypeOnly=4]="PromoteTypeOnly";}(r||(r={})),function(e){e[e.Allowed=1]="Allowed",e[e.Required=2]="Required",e[e.NotAllowed=4]="NotAllowed";}(a||(a={})),t.getImportCompletionAction=function(t,r,n,i,a,o,s,c,p,f,g){var y=s.getCompilerOptions(),v=e.pathIsBareSpecifier(e.stripQuotes(r.name))?[d(t,r,s,o)]:_(n,t,i,a,s,o,f,g);e.Debug.assertIsDefined(v);var h=m(n,s),b=e.isValidTypeOnlyAliasUseSite(e.getTokenAtPosition(n,p)),x=e.Debug.checkDefined(l(n,v,r,s,{symbolName:i,position:p},b,h,o,f));return {moduleSpecifier:x.moduleSpecifier,codeAction:u(C({host:o,formatContext:c,preferences:f},n,i,x,!1,e.getQuotePreference(n,f),y))}},t.getPromoteTypeOnlyCompletionAction=function(t,r,n,i,a,o){var s=n.getCompilerOptions(),c=e.single(T(t,n.getTypeChecker(),r,s)),l=S(t,r,c,n),_=c!==r.text;return l&&u(C({host:i,formatContext:a,preferences:o},t,c,l,_,1,s))},t.getImportKind=D,t.moduleSymbolToValidIdentifier=L,t.moduleSpecifierToValidIdentifier=R;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingConstraint",n=[e.Diagnostics.Type_0_is_not_comparable_to_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Property_0_is_incompatible_with_index_signature.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code];function i(r,n,i){var a,o,s,c,l=e.find(r.getSemanticDiagnostics(n),(function(e){return e.start===i.start&&e.length===i.length}));if(void 0!==l&&void 0!==l.relatedInformation){var u=e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code}));if(void 0!==u&&void 0!==u.file&&void 0!==u.start&&void 0!==u.length){var _=t.findAncestorMatchingSpan(u.file,e.createTextSpan(u.start,u.length));if(void 0!==_&&(e.isIdentifier(_)&&e.isTypeParameterDeclaration(_.parent)&&(_=_.parent),e.isTypeParameterDeclaration(_))){if(e.isMappedTypeNode(_.parent))return;var d=e.getTokenAtPosition(n,i.start);return {constraint:(s=r.getTypeChecker(),c=d,(e.isTypeNode(c.parent)?s.getTypeArgumentConstraint(c.parent):(e.isExpression(c)?s.getContextualType(c):void 0)||s.getTypeAtLocation(c))||(a=u.messageText,(o=e.flattenDiagnosticMessageText(a,"\n",0).match(/`extends (.*)`/)||[])[0],o[1])),declaration:_,token:d}}}}}function a(r,n,i,a,o,s){var c=s.declaration,l=s.constraint,u=n.getTypeChecker();if(e.isString(l))r.insertText(o,c.name.end," extends ".concat(l));else {var _=e.getEmitScriptTarget(n.getCompilerOptions()),d=t.getNoopSymbolTrackerWithResolver({program:n,host:a}),p=t.createImportAdder(o,n,i,a),f=t.typeToAutoImportableTypeNode(u,p,l,void 0,_,void 0,d);f&&(r.replaceNode(o,c,e.factory.updateTypeParameterDeclaration(c,void 0,c.name,f,c.default)),p.writeFixes(r));}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=n.program,l=n.preferences,u=n.host,_=i(c,o,s);if(void 0!==_){var d=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,c,l,u,o,_)}));return [t.createCodeFixAction(r,d,e.Diagnostics.Add_extends_constraint,r,e.Diagnostics.Add_extends_constraint_to_all_type_parameters)]}},fixIds:[r],getAllCodeActions:function(r){var o=r.program,s=r.preferences,c=r.host,l=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,(function(u){t.eachDiagnostic(r,n,(function(t){var r=i(o,t.file,e.createTextSpan(t.start,t.length));if(r&&e.addToSeen(l,e.getNodeId(r.declaration)))return a(u,o,s,c,t.file,r)}));})))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="fixOverrideModifier",i="fixAddOverrideModifier",a="fixRemoveOverrideModifier",o=[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code],s=((r={})[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]={descriptions:e.Diagnostics.Add_override_modifier,fixId:i,fixAllDescriptions:e.Diagnostics.Add_all_missing_override_modifiers},r[e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]={descriptions:e.Diagnostics.Add_override_modifier,fixId:i,fixAllDescriptions:e.Diagnostics.Add_all_missing_override_modifiers},r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]={descriptions:e.Diagnostics.Remove_override_modifier,fixId:a,fixAllDescriptions:e.Diagnostics.Remove_all_unnecessary_override_modifiers},r[e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]={descriptions:e.Diagnostics.Remove_override_modifier,fixId:a,fixAllDescriptions:e.Diagnostics.Remove_override_modifier},r[e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]={descriptions:e.Diagnostics.Add_override_modifier,fixId:i,fixAllDescriptions:e.Diagnostics.Add_all_missing_override_modifiers},r[e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]={descriptions:e.Diagnostics.Add_override_modifier,fixId:i,fixAllDescriptions:e.Diagnostics.Add_all_missing_override_modifiers},r[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]={descriptions:e.Diagnostics.Add_override_modifier,fixId:i,fixAllDescriptions:e.Diagnostics.Remove_all_unnecessary_override_modifiers},r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]={descriptions:e.Diagnostics.Remove_override_modifier,fixId:a,fixAllDescriptions:e.Diagnostics.Remove_all_unnecessary_override_modifiers},r[e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]={descriptions:e.Diagnostics.Remove_override_modifier,fixId:a,fixAllDescriptions:e.Diagnostics.Remove_all_unnecessary_override_modifiers},r);function c(t,r,n,i){switch(n){case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:case e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:return function(t,r,n){var i=u(r,n);if(e.isSourceFileJS(r))t.addJSDocTags(r,i,[e.factory.createJSDocOverrideTag(e.factory.createIdentifier("override"))]);else {var a=i.modifiers||e.emptyArray,o=e.find(a,e.isStaticModifier),s=e.find(a,e.isAbstractModifier),c=e.find(a,(function(t){return e.isAccessibilityModifier(t.kind)})),l=e.findLast(a,e.isDecorator),_=s?s.end:o?o.end:c?c.end:l?e.skipTrivia(r.text,l.end):i.getStart(r),d=c||o||s?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,_,161,d);}}(t,r.sourceFile,i);case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:case e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:return function(t,r,n){var i=u(r,n);if(e.isSourceFileJS(r))t.filterJSDocTags(r,i,e.not(e.isJSDocOverrideTag));else {var a=e.find(i.modifiers,e.isOverrideModifier);e.Debug.assertIsDefined(a),t.deleteModifier(r,a);}}(t,r.sourceFile,i);default:e.Debug.fail("Unexpected error code: "+n);}}function l(t){switch(t.kind){case 173:case 169:case 171:case 174:case 175:return !0;case 166:return e.isParameterPropertyDeclaration(t,t.parent);default:return !1}}function u(t,r){var n=e.getTokenAtPosition(t,r),i=e.findAncestor(n,(function(t){return e.isClassLike(t)?"quit":l(t)}));return e.Debug.assert(i&&l(i)),i}t.registerCodeFix({errorCodes:o,getCodeActions:function(r){var i=r.errorCode,a=r.span,o=s[i];if(!o)return e.emptyArray;var l=o.descriptions,u=o.fixId,_=o.fixAllDescriptions,d=e.textChanges.ChangeTracker.with(r,(function(e){return c(e,r,i,a.start)}));return [t.createCodeFixActionMaybeFixAll(n,d,l,u,_)]},fixIds:[n,i,a],getAllCodeActions:function(e){return t.codeFixAll(e,o,(function(t,r){var n=r.code,i=r.start,a=s[n];a&&a.fixId===e.fixId&&c(t,e,n,i);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixNoPropertyAccessFromIndexSignature",n=[e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];function i(t,r,n,i){var a=e.getQuotePreference(r,i),o=e.factory.createStringLiteral(n.name.text,0===a);t.replaceNode(r,n,e.isPropertyAccessChain(n)?e.factory.createElementAccessChain(n.expression,n.questionDotToken,o):e.factory.createElementAccessExpression(n.expression,o));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isPropertyAccessExpression)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=n.preferences,l=a(o,s.start),u=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,l,c)}));return [t.createCodeFixAction(r,u,[e.Diagnostics.Use_element_access_for_0,l.name.text],r,e.Diagnostics.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,a(r.file,r.start),e.preferences)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixImplicitThis",n=[e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isThis(a)){var o=e.getThisContainer(a,!1);if((e.isFunctionDeclaration(o)||e.isFunctionExpression(o))&&!e.isSourceFile(e.getThisContainer(o,!1))){var s=e.Debug.checkDefined(e.findChildOfKind(o,98,r)),c=o.name,l=e.Debug.checkDefined(o.body);if(e.isFunctionExpression(o)){if(c&&e.FindAllReferences.Core.isSymbolReferencedInFile(c,i,r,l))return;return t.delete(r,s),c&&t.delete(r,c),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_expression_0_to_arrow_function,c?c.text:e.ANONYMOUS]}return t.replaceNode(r,s,e.factory.createToken(85)),t.insertText(r,c.end," = "),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_declaration_0_to_arrow_function,c.text]}}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a,o=n.sourceFile,s=n.program,c=n.span,l=e.textChanges.ChangeTracker.with(n,(function(e){a=i(e,o,c.start,s.getTypeChecker());}));return a?[t.createCodeFixAction(r,l,a,r,e.Diagnostics.Fix_all_implicit_this_errors)]:e.emptyArray},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){i(t,r.file,r.start,e.program.getTypeChecker());}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixImportNonExportedMember",i=[e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported.code];function a(t,r,n){var i,a=e.getTokenAtPosition(t,r);if(e.isIdentifier(a)){var o=e.findAncestor(a,e.isImportDeclaration);if(void 0===o)return;var s=e.isStringLiteral(o.moduleSpecifier)?o.moduleSpecifier.text:void 0;if(void 0===s)return;var c=e.getResolvedModule(t,s,void 0);if(void 0===c)return;var l=n.getSourceFile(c.resolvedFileName);if(void 0===l||e.isSourceFileFromLibrary(n,l))return;var u=null===(i=l.symbol.valueDeclaration)||void 0===i?void 0:i.locals;if(void 0===u)return;var _=u.get(a.escapedText);if(void 0===_)return;var d=function(t){if(void 0===t.valueDeclaration)return e.firstOrUndefined(t.declarations);var r=t.valueDeclaration,n=e.isVariableDeclaration(r)?e.tryCast(r.parent.parent,e.isVariableStatement):void 0;return n&&1===e.length(n.declarationList.declarations)?n:r}(_);if(void 0===d)return;return {exportName:{node:a,isTypeOnly:e.isTypeDeclaration(d)},node:d,moduleSourceFile:l,moduleSpecifier:s}}}function o(t,r,n,i,a){e.length(i)&&(a?c(t,r,n,a,i):l(t,r,n,i));}function s(t,r){return e.findLast(t.statements,(function(t){return e.isExportDeclaration(t)&&(r&&t.isTypeOnly||!t.isTypeOnly)}))}function c(t,r,i,a,o){var s=a.exportClause&&e.isNamedExports(a.exportClause)?a.exportClause.elements:e.factory.createNodeArray([]),c=!(a.isTypeOnly||!r.getCompilerOptions().isolatedModules&&!e.find(s,(function(e){return e.isTypeOnly})));t.replaceNode(i,a,e.factory.updateExportDeclaration(a,a.modifiers,a.isTypeOnly,e.factory.createNamedExports(e.factory.createNodeArray(n$4(n$4([],s,!0),u(o,c),!0),s.hasTrailingComma)),a.moduleSpecifier,a.assertClause));}function l(t,r,n,i){t.insertNodeAtEndOfScope(n,n,e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports(u(i,!!r.getCompilerOptions().isolatedModules)),void 0,void 0));}function u(t,r){return e.factory.createNodeArray(e.map(t,(function(t){return e.factory.createExportSpecifier(r&&t.isTypeOnly,void 0,t.node)})))}t.registerCodeFix({errorCodes:i,fixIds:[r],getCodeActions:function(n){var i=n.sourceFile,o=n.span,u=n.program,_=a(i,o.start,u);if(void 0!==_){var d=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){var i=n.exportName,a=n.node,o=n.moduleSourceFile,u=s(o,i.isTypeOnly);u?c(t,r,o,u,[i]):e.canHaveExportModifier(a)?t.insertExportModifier(o,a):l(t,r,o,[i]);}(t,u,_)}));return [t.createCodeFixAction(r,d,[e.Diagnostics.Export_0_from_module_1,_.exportName.node.text,_.moduleSpecifier],r,e.Diagnostics.Export_all_referenced_locals)]}},getAllCodeActions:function(r){var c=r.program;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,(function(l){var u=new e.Map;t.eachDiagnostic(r,i,(function(t){var r=a(t.file,t.start,c);if(void 0!==r){var n=r.exportName,i=r.node,o=r.moduleSourceFile;if(void 0===s(o,n.isTypeOnly)&&e.canHaveExportModifier(i))l.insertExportModifier(o,i);else {var _=u.get(o)||{typeOnlyExports:[],exports:[]};n.isTypeOnly?_.typeOnlyExports.push(n):_.exports.push(n),u.set(o,_);}}})),u.forEach((function(e,t){var r=s(t,!0);r&&r.isTypeOnly?(o(l,c,t,e.typeOnlyExports,r),o(l,c,t,e.exports,s(t,!1))):o(l,c,t,n$4(n$4([],e.exports,!0),e.typeOnlyExports,!0),r);}));})))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixIncorrectNamedTupleSyntax",n=[e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=function(t,r){var n=e.getTokenAtPosition(t,r);return e.findAncestor(n,(function(e){return 199===e.kind}))}(i,a.start),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){if(n){for(var i=n.type,a=!1,o=!1;187===i.kind||188===i.kind||193===i.kind;)187===i.kind?a=!0:188===i.kind&&(o=!0),i=i.type;var s=e.factory.updateNamedTupleMember(n,n.dotDotDotToken||(o?e.factory.createToken(25):void 0),n.name,n.questionToken||(a?e.factory.createToken(57):void 0),i);s!==n&&t.replaceNode(r,n,s);}}(t,i,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels,r,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[r]});}(t),function(e){!function(t){var r="fixSpelling",n=[e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.No_overload_matches_this_call.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code];function i(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=a.parent;if(i!==e.Diagnostics.No_overload_matches_this_call.code&&i!==e.Diagnostics.Type_0_is_not_assignable_to_type_1.code||e.isJsxAttribute(o)){var s,c=n.program.getTypeChecker();if(e.isPropertyAccessExpression(o)&&o.name===a){e.Debug.assert(e.isMemberName(a),"Expected an identifier for spelling (property access)");var l=c.getTypeAtLocation(o.expression);32&o.flags&&(l=c.getNonNullableType(l)),s=c.getSuggestedSymbolForNonexistentProperty(a,l);}else if(e.isBinaryExpression(o)&&101===o.operatorToken.kind&&o.left===a&&e.isPrivateIdentifier(a)){var u=c.getTypeAtLocation(o.right);s=c.getSuggestedSymbolForNonexistentProperty(a,u);}else if(e.isQualifiedName(o)&&o.right===a){var _=c.getSymbolAtLocation(o.left);_&&1536&_.flags&&(s=c.getSuggestedSymbolForNonexistentModule(o.right,_));}else if(e.isImportSpecifier(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for spelling (import)");var d=function(t,r,n){if(n&&e.isStringLiteralLike(n.moduleSpecifier)){var i=e.getResolvedModule(t,n.moduleSpecifier.text,e.getModeForUsageLocation(t,n.moduleSpecifier));return i?r.program.getSourceFile(i.resolvedFileName):void 0}}(t,n,e.findAncestor(a,e.isImportDeclaration));d&&d.symbol&&(s=c.getSuggestedSymbolForNonexistentModule(a,d.symbol));}else if(e.isJsxAttribute(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for JSX attribute");var p=e.findAncestor(a,e.isJsxOpeningLikeElement),f=c.getContextualTypeForArgumentAtIndex(p,0);s=c.getSuggestedSymbolForNonexistentJSXAttribute(a,f);}else if(e.hasSyntacticModifier(o,16384)&&e.isClassElement(o)&&o.name===a){var g=e.findAncestor(a,e.isClassLike),m=g?e.getEffectiveBaseTypeNode(g):void 0,y=m?c.getTypeAtLocation(m):void 0;y&&(s=c.getSuggestedSymbolForNonexistentClassMember(e.getTextOfNode(a),y));}else {var v=e.getMeaningFromLocation(a),h=e.getTextOfNode(a);e.Debug.assert(void 0!==h,"name should be defined"),s=c.getSuggestedSymbolForNonexistentSymbol(a,h,function(e){var t=0;return 4&e&&(t|=1920),2&e&&(t|=788968),1&e&&(t|=111551),t}(v));}return void 0===s?void 0:{node:a,suggestedSymbol:s}}}function a(t,r,n,i,a){var o=e.symbolName(i);if(!e.isIdentifierText(o,a)&&e.isPropertyAccessExpression(n.parent)){var s=i.valueDeclaration;s&&e.isNamedDeclaration(s)&&e.isPrivateIdentifier(s.name)?t.replaceNode(r,n,e.factory.createIdentifier(o)):t.replaceNode(r,n.parent,e.factory.createElementAccessExpression(n.parent.expression,e.factory.createStringLiteral(o)));}else t.replaceNode(r,n,e.factory.createIdentifier(o));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.errorCode,c=i(o,n.span.start,n,s);if(c){var l=c.node,u=c.suggestedSymbol,_=e.getEmitScriptTarget(n.host.getCompilationSettings()),d=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l,u,_)}));return [t.createCodeFixAction("spelling",d,[e.Diagnostics.Change_spelling_to_0,e.symbolName(u)],r,e.Diagnostics.Fix_all_detected_spelling_errors)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(n.file,n.start,r,n.code),s=e.getEmitScriptTarget(r.host.getCompilationSettings());o&&a(t,r.sourceFile,o.node,o.suggestedSymbol,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="returnValueCorrect",i="fixAddReturnStatement",a="fixRemoveBracesFromArrowFunctionBody",o="fixWrapTheBlockWithParen",s=[e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function c(t,r,n){var i=t.createSymbol(4,r.escapedText);i.type=t.getTypeAtLocation(n);var a=e.createSymbolTable([i]);return t.createAnonymousType(void 0,a,[],[],[])}function l(t,n,i,a){if(n.body&&e.isBlock(n.body)&&1===e.length(n.body.statements)){var o=e.first(n.body.statements);if(e.isExpressionStatement(o)&&u(t,n,t.getTypeAtLocation(o.expression),i,a))return {declaration:n,kind:r.MissingReturnStatement,expression:o.expression,statement:o,commentSource:o.expression};if(e.isLabeledStatement(o)&&e.isExpressionStatement(o.statement)){var s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(o.label,o.statement.expression)]);if(u(t,n,c(t,o.label,o.statement.expression),i,a))return e.isArrowFunction(n)?{declaration:n,kind:r.MissingParentheses,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:o.statement.expression}}else if(e.isBlock(o)&&1===e.length(o.statements)){var l=e.first(o.statements);if(e.isLabeledStatement(l)&&e.isExpressionStatement(l.statement)&&(s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(l.label,l.statement.expression)]),u(t,n,c(t,l.label,l.statement.expression),i,a)))return {declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:l}}}}function u(t,r,n,i,a){if(a){var o=t.getSignatureFromDeclaration(r);if(o){e.hasSyntacticModifier(r,512)&&(n=t.createPromiseType(n));var s=t.createSignature(r,o.typeParameters,o.thisParameter,o.parameters,n,void 0,o.minArgumentCount,o.flags);n=t.createAnonymousType(void 0,e.createSymbolTable(),[s],[],[]);}else n=t.getAnyType();}return t.isTypeAssignableTo(n,i)}function _(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(a.parent){var o=e.findAncestor(a.parent,e.isFunctionLikeDeclaration);switch(i){case e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&e.rangeContainsRange(o.type,a)))return;return l(t,o,t.getTypeFromTypeNode(o.type),!1);case e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!e.isCallExpression(o.parent)||!o.body)return;var s=o.parent.arguments.indexOf(o),c=t.getContextualTypeForArgumentAtIndex(o.parent,s);if(!c)return;return l(t,o,c,!0);case e.Diagnostics.Type_0_is_not_assignable_to_type_1.code:if(!e.isDeclarationName(a)||!e.isVariableLike(a.parent)&&!e.isJsxAttribute(a.parent))return;var u=function(t){switch(t.kind){case 257:case 166:case 205:case 169:case 299:return t.initializer;case 288:return t.initializer&&(e.isJsxExpression(t.initializer)?t.initializer.expression:void 0);case 300:case 168:case 302:case 350:case 343:return}}(a.parent);if(!u||!e.isFunctionLikeDeclaration(u)||!u.body)return;return l(t,u,t.getTypeAtLocation(a.parent),!0)}}}function d(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.probablyUsesSemicolons(r);t.replaceNode(r,i,e.factory.createReturnStatement(n),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,suffix:a?";":void 0});}function p(t,r,n,i,a,o){var s=o||e.needsParentheses(i)?e.factory.createParenthesizedExpression(i):i;e.suppressLeadingAndTrailingTrivia(a),e.copyComments(a,s),t.replaceNode(r,n.body,s);}function f(t,r,n,i){t.replaceNode(r,n.body,e.factory.createParenthesizedExpression(i));}function g(r,a,o){var s=e.textChanges.ChangeTracker.with(r,(function(e){return d(e,r.sourceFile,a,o)}));return t.createCodeFixAction(n,s,e.Diagnostics.Add_a_return_statement,i,e.Diagnostics.Add_all_missing_return_statement)}function m(r,i,a){var s=e.textChanges.ChangeTracker.with(r,(function(e){return f(e,r.sourceFile,i,a)}));return t.createCodeFixAction(n,s,e.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,o,e.Diagnostics.Wrap_all_object_literal_with_parentheses)}!function(e){e[e.MissingReturnStatement=0]="MissingReturnStatement",e[e.MissingParentheses=1]="MissingParentheses";}(r||(r={})),t.registerCodeFix({errorCodes:s,fixIds:[i,a,o],getCodeActions:function(i){var o=i.program,s=i.sourceFile,c=i.span.start,l=i.errorCode,u=_(o.getTypeChecker(),s,c,l);if(u)return u.kind===r.MissingReturnStatement?e.append([g(i,u.expression,u.statement)],e.isArrowFunction(u.declaration)?function(r,i,o,s){var c=e.textChanges.ChangeTracker.with(r,(function(e){return p(e,r.sourceFile,i,o,s,!1)}));return t.createCodeFixAction(n,c,e.Diagnostics.Remove_braces_from_arrow_function_body,a,e.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(i,u.declaration,u.expression,u.commentSource):void 0):[m(i,u.declaration,u.expression)]},getAllCodeActions:function(r){return t.codeFixAll(r,s,(function(t,n){var s=_(r.program.getTypeChecker(),n.file,n.start,n.code);if(s)switch(r.fixId){case i:d(t,n.file,s.expression,s.statement);break;case a:if(!e.isArrowFunction(s.declaration))return;p(t,n.file,s.declaration,s.expression,s.commentSource,!1);break;case o:if(!e.isArrowFunction(s.declaration))return;f(t,n.file,s.declaration,s.expression);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="fixMissingMember",a="fixMissingProperties",o="fixMissingAttributes",s="fixMissingFunctionDeclaration",c=[e.Diagnostics.Property_0_does_not_exist_on_type_1.code,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Cannot_find_name_0.code];function l(t,n,i,a,o){var s=e.getTokenAtPosition(t,n),c=s.parent;if(i===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(18!==s.kind||!e.isObjectLiteralExpression(c)||!e.isCallExpression(c.parent))return;var l=e.findIndex(c.parent.arguments,(function(e){return e===c}));if(l<0)return;if(!((f=a.getResolvedSignature(c.parent))&&f.declaration&&f.parameters[l]))return;var u=f.parameters[l].valueDeclaration;if(!(u&&e.isParameter(u)&&e.isIdentifier(u.name)))return;var _=e.arrayFrom(a.getUnmatchedProperties(a.getTypeAtLocation(c),a.getParameterType(f,l),!1,!1));if(!e.length(_))return;return {kind:r.ObjectLiteral,token:u.name,properties:_,parentDeclaration:c}}if(e.isMemberName(s)){if(e.isIdentifier(s)&&e.hasInitializer(c)&&c.initializer&&e.isObjectLiteralExpression(c.initializer)){if(_=e.arrayFrom(a.getUnmatchedProperties(a.getTypeAtLocation(c.initializer),a.getTypeAtLocation(s),!1,!1)),!e.length(_))return;return {kind:r.ObjectLiteral,token:s,properties:_,parentDeclaration:c.initializer}}if(e.isIdentifier(s)&&e.isJsxOpeningLikeElement(s.parent)){var d=function(t,r,n){var i=t.getContextualType(n.attributes);if(void 0===i)return e.emptyArray;var a=i.getProperties();if(!e.length(a))return e.emptyArray;for(var o=new e.Set,s=0,c=n.attributes.properties;s<c.length;s++){var l=c[s];if(e.isJsxAttribute(l)&&o.add(l.name.escapedText),e.isJsxSpreadAttribute(l))for(var u=0,_=t.getTypeAtLocation(l.expression).getProperties();u<_.length;u++){var d=_[u];o.add(d.escapedName);}}return e.filter(a,(function(t){return e.isIdentifierText(t.name,r,1)&&!(16777216&t.flags||48&e.getCheckFlags(t)||o.has(t.escapedName))}))}(a,e.getEmitScriptTarget(o.getCompilerOptions()),s.parent);if(!e.length(d))return;return {kind:r.JsxAttributes,token:s,attributes:d,parentDeclaration:s.parent}}if(e.isIdentifier(s)){var p=a.getContextualType(s);if(p&&16&e.getObjectFlags(p)){var f;if(void 0===(f=e.firstOrUndefined(a.getSignaturesOfType(p,0))))return;return {kind:r.Signature,token:s,signature:f,sourceFile:t,parentDeclaration:D(s)}}if(e.isCallExpression(c)&&c.expression===s)return {kind:r.Function,token:s,call:c,sourceFile:t,modifierFlags:0,parentDeclaration:D(s)}}if(e.isPropertyAccessExpression(c)){var g=e.skipConstraint(a.getTypeAtLocation(c.expression)),m=g.symbol;if(m&&m.declarations){if(e.isIdentifier(s)&&e.isCallExpression(c.parent)){var y=e.find(m.declarations,e.isModuleDeclaration),v=null==y?void 0:y.getSourceFile();if(y&&v&&!e.isSourceFileFromLibrary(o,v))return {kind:r.Function,token:s,call:c.parent,sourceFile:t,modifierFlags:1,parentDeclaration:y};var h=e.find(m.declarations,e.isSourceFile);if(t.commonJsModuleIndicator)return;if(h&&!e.isSourceFileFromLibrary(o,h))return {kind:r.Function,token:s,call:c.parent,sourceFile:h,modifierFlags:1,parentDeclaration:h}}var b=e.find(m.declarations,e.isClassLike);if(b||!e.isPrivateIdentifier(s)){var x=b||e.find(m.declarations,(function(t){return e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)}));if(x&&!e.isSourceFileFromLibrary(o,x.getSourceFile())){var S=!e.isTypeLiteralNode(x)&&(g.target||g)!==a.getDeclaredTypeOfSymbol(m);if(S&&(e.isPrivateIdentifier(s)||e.isInterfaceDeclaration(x)))return;var T=x.getSourceFile(),C=e.isTypeLiteralNode(x)?0:(S?32:0)|(e.startsWithUnderscore(s.text)?8:0),E=e.isSourceFileJS(T),k=e.tryCast(c.parent,e.isCallExpression);return {kind:r.TypeLikeDeclaration,token:s,call:k,modifierFlags:C,parentDeclaration:x,declSourceFile:T,isJSFile:E}}var N=e.find(m.declarations,e.isEnumDeclaration);return !N||1056&g.flags||e.isPrivateIdentifier(s)||e.isSourceFileFromLibrary(o,N.getSourceFile())?void 0:{kind:r.Enum,token:s,parentDeclaration:N}}}}}}function u(t,r,n,i,a){var o=i.text;if(a){if(228===n.kind)return;var s=n.name.getText(),c=_(e.factory.createIdentifier(s),o);t.insertNodeAfter(r,n,c);}else if(e.isPrivateIdentifier(i)){var l=e.factory.createPropertyDeclaration(void 0,o,void 0,void 0,void 0),u=f(n);u?t.insertNodeAfter(r,u,l):t.insertMemberAtStart(r,n,l);}else {var d=e.getFirstConstructorWithBody(n);if(!d)return;var p=_(e.factory.createThis(),o);t.insertNodeAtConstructorEnd(r,d,p);}}function _(t,r){return e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createPropertyAccessExpression(t,r),x()))}function d(t,r,n){var i;if(223===n.parent.parent.kind){var a=n.parent.parent,o=n.parent===a.left?a.right:a.left,s=t.getWidenedType(t.getBaseTypeOfLiteralType(t.getTypeAtLocation(o)));i=t.typeToTypeNode(s,r,1);}else {var c=t.getContextualType(n.parent);i=c?t.typeToTypeNode(c,void 0,1):void 0;}return i||e.factory.createKeywordTypeNode(131)}function p(t,r,n,i,a,o){var s=o?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(o)):void 0,c=e.isClassLike(n)?e.factory.createPropertyDeclaration(s,i,void 0,a,void 0):e.factory.createPropertySignature(void 0,i,void 0,a),l=f(n);l?t.insertNodeAfter(r,l,c):t.insertMemberAtStart(r,n,c);}function f(t){for(var r,n=0,i=t.members;n<i.length;n++){var a=i[n];if(!e.isPropertyDeclaration(a))break;r=a;}return r}function g(r,n,i,a,o,s,c){var l=t.createImportAdder(c,r.program,r.preferences,r.host),u=e.isClassLike(s)?171:170,_=t.createSignatureDeclarationFromCallExpression(u,r,l,i,a,o,s),d=function(t,r){if(!e.isTypeLiteralNode(t)){var n=e.findAncestor(r,(function(t){return e.isMethodDeclaration(t)||e.isConstructorDeclaration(t)}));return n&&n.parent===t?n:void 0}}(s,i);d?n.insertNodeAfter(c,d,_):n.insertMemberAtStart(c,s,_),l.writeFixes(n);}function m(t,r,n){var i=n.token,a=n.parentDeclaration,o=e.some(a.members,(function(e){var t=r.getTypeAtLocation(e);return !!(t&&402653316&t.flags)})),s=e.factory.createEnumMember(i,o?e.factory.createStringLiteral(i.text):void 0);t.replaceNode(a.getSourceFile(),a,e.factory.updateEnumDeclaration(a,a.modifiers,a.name,e.concatenate(a.members,e.singleElementArray(s))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude});}function y(n,i,a){var o=e.getQuotePreference(i.sourceFile,i.preferences),s=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),c=a.kind===r.Function?t.createSignatureDeclarationFromCallExpression(259,i,s,a.call,e.idText(a.token),a.modifierFlags,a.parentDeclaration):t.createSignatureDeclarationFromSignature(259,i,o,a.signature,t.createStubbedBody(e.Diagnostics.Function_not_implemented.message,o),a.token,void 0,void 0,void 0,s);void 0===c&&e.Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error."),e.isReturnStatement(a.parentDeclaration)?n.insertNodeBefore(a.sourceFile,a.parentDeclaration,c,!0):n.insertNodeAtEndOfScope(a.sourceFile,a.parentDeclaration,c),s.writeFixes(n);}function v(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=i.program.getTypeChecker(),l=a.parentDeclaration.attributes,u=e.some(l.properties,e.isJsxSpreadAttribute),_=e.map(a.attributes,(function(t){var r=b(i,c,o,s,c.getTypeOfSymbol(t),a.parentDeclaration),n=e.factory.createIdentifier(t.name),l=e.factory.createJsxAttribute(n,e.factory.createJsxExpression(void 0,r));return e.setParent(n,l),l})),d=e.factory.createJsxAttributes(u?n$4(n$4([],_,!0),l.properties,!0):n$4(n$4([],l.properties,!0),_,!0)),p={prefix:l.pos===l.end?" ":void 0};r.replaceNode(i.sourceFile,l,d,p),o.writeFixes(r);}function h(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=e.getEmitScriptTarget(i.program.getCompilerOptions()),l=i.program.getTypeChecker(),u=e.map(a.properties,(function(t){var r=b(i,l,o,s,l.getTypeOfSymbol(t),a.parentDeclaration);return e.factory.createPropertyAssignment(function(t,r,n,i){if(e.isTransientSymbol(t)){var a=i.symbolToNode(t,111551,void 0,1073741824);if(a&&e.isComputedPropertyName(a))return a}return e.createPropertyNameNodeForIdentifierOrLiteral(t.name,r,0===n)}(t,c,s,l),r)})),_={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,indentation:a.indentation};r.replaceNode(i.sourceFile,a.parentDeclaration,e.factory.createObjectLiteralExpression(n$4(n$4([],a.parentDeclaration.properties,!0),u,!0),!0),_),o.writeFixes(r);}function b(r,n,i,a,o,s){if(3&o.flags)return x();if(134217732&o.flags)return e.factory.createStringLiteral("",0===a);if(8&o.flags)return e.factory.createNumericLiteral(0);if(64&o.flags)return e.factory.createBigIntLiteral("0n");if(16&o.flags)return e.factory.createFalse();if(1056&o.flags){var c=o.symbol.exports?e.firstOrUndefined(e.arrayFrom(o.symbol.exports.values())):o.symbol,l=n.symbolToExpression(o.symbol.parent?o.symbol.parent:o.symbol,111551,void 0,void 0);return void 0===c||void 0===l?e.factory.createNumericLiteral(0):e.factory.createPropertyAccessExpression(l,n.symbolToString(c))}if(256&o.flags)return e.factory.createNumericLiteral(o.value);if(2048&o.flags)return e.factory.createBigIntLiteral(o.value);if(128&o.flags)return e.factory.createStringLiteral(o.value,0===a);if(512&o.flags)return o===n.getFalseType()||o===n.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(65536&o.flags)return e.factory.createNull();if(1048576&o.flags){var u=e.firstDefined(o.types,(function(e){return b(r,n,i,a,e,s)}));return null!=u?u:x()}if(n.isArrayLikeType(o))return e.factory.createArrayLiteralExpression();if(function(t){return 524288&t.flags&&(128&e.getObjectFlags(t)||t.symbol&&e.tryCast(e.singleOrUndefined(t.symbol.declarations),e.isTypeLiteralNode))}(o)){var _=e.map(n.getPropertiesOfType(o),(function(t){var o=t.valueDeclaration?b(r,n,i,a,n.getTypeAtLocation(t.valueDeclaration),s):x();return e.factory.createPropertyAssignment(t.name,o)}));return e.factory.createObjectLiteralExpression(_,!0)}if(16&e.getObjectFlags(o)){if(void 0===e.find(o.symbol.declarations||e.emptyArray,e.or(e.isFunctionTypeNode,e.isMethodSignature,e.isMethodDeclaration)))return x();var d=n.getSignaturesOfType(o,0);if(void 0===d)return x();var p=t.createSignatureDeclarationFromSignature(215,r,a,d[0],t.createStubbedBody(e.Diagnostics.Function_not_implemented.message,a),void 0,void 0,void 0,s,i);return null!=p?p:x()}if(1&e.getObjectFlags(o)){var f=e.getClassLikeDeclarationOfSymbol(o.symbol);if(void 0===f||e.hasAbstractModifier(f))return x();var g=e.getFirstConstructorWithBody(f);return g&&e.length(g.parameters)?x():e.factory.createNewExpression(e.factory.createIdentifier(o.symbol.name),void 0,void 0)}return x()}function x(){return e.factory.createIdentifier("undefined")}function D(t){if(e.findAncestor(t,e.isJsxExpression)){var r=e.findAncestor(t.parent,e.isReturnStatement);if(r)return r}return e.getSourceFileOfNode(t)}!function(e){e[e.TypeLikeDeclaration=0]="TypeLikeDeclaration",e[e.Enum=1]="Enum",e[e.Function=2]="Function",e[e.ObjectLiteral=3]="ObjectLiteral",e[e.JsxAttributes=4]="JsxAttributes",e[e.Signature=5]="Signature";}(r||(r={})),t.registerCodeFix({errorCodes:c,getCodeActions:function(n){var c=n.program.getTypeChecker(),_=l(n.sourceFile,n.span.start,n.errorCode,c,n.program);if(_){if(_.kind===r.ObjectLiteral){var f=e.textChanges.ChangeTracker.with(n,(function(e){return h(e,n,_)}));return [t.createCodeFixAction(a,f,e.Diagnostics.Add_missing_properties,a,e.Diagnostics.Add_all_missing_properties)]}return _.kind===r.JsxAttributes?(f=e.textChanges.ChangeTracker.with(n,(function(e){return v(e,n,_)})),[t.createCodeFixAction(o,f,e.Diagnostics.Add_missing_attributes,o,e.Diagnostics.Add_all_missing_attributes)]):_.kind===r.Function||_.kind===r.Signature?(f=e.textChanges.ChangeTracker.with(n,(function(e){return y(e,n,_)})),[t.createCodeFixAction(s,f,[e.Diagnostics.Add_missing_function_declaration_0,_.token.text],s,e.Diagnostics.Add_all_missing_function_declarations)]):_.kind===r.Enum?(f=e.textChanges.ChangeTracker.with(n,(function(e){return m(e,n.program.getTypeChecker(),_)})),[t.createCodeFixAction(i,f,[e.Diagnostics.Add_missing_enum_member_0,_.token.text],i,e.Diagnostics.Add_all_missing_members)]):e.concatenate(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=n.call;if(void 0!==l&&!e.isPrivateIdentifier(c)){var u=c.text,_=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return g(r,e,l,c,t,a,o)}))},d=[t.createCodeFixAction(i,_(32&s),[32&s?e.Diagnostics.Declare_static_method_0:e.Diagnostics.Declare_method_0,u],i,e.Diagnostics.Add_all_missing_members)];return 8&s&&d.unshift(t.createCodeFixActionWithoutFixAll(i,_(8),[e.Diagnostics.Declare_private_method_0,u])),d}}(n,_),function(r,n){return n.isJSFile?e.singleElementArray(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token;if(!e.isInterfaceDeclaration(a)&&!e.isTypeLiteralNode(a)){var l=e.textChanges.ChangeTracker.with(r,(function(e){return u(e,o,a,c,!!(32&s))}));if(0!==l.length){var _=32&s?e.Diagnostics.Initialize_static_property_0:e.isPrivateIdentifier(c)?e.Diagnostics.Declare_a_private_field_named_0:e.Diagnostics.Initialize_property_0_in_the_constructor;return t.createCodeFixAction(i,l,[_,c.text],i,e.Diagnostics.Add_all_missing_members)}}}(r,n)):function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=c.text,u=32&s,_=d(r.program.getTypeChecker(),a,c),f=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return p(e,o,a,l,_,t)}))},g=[t.createCodeFixAction(i,f(32&s),[u?e.Diagnostics.Declare_static_property_0:e.Diagnostics.Declare_property_0,l],i,e.Diagnostics.Add_all_missing_members)];return u||e.isPrivateIdentifier(c)||(8&s&&g.unshift(t.createCodeFixActionWithoutFixAll(i,f(8),[e.Diagnostics.Declare_private_property_0,l])),g.push(function(r,n,a,o,s){var c=e.factory.createKeywordTypeNode(152),l=e.factory.createParameterDeclaration(void 0,void 0,"x",void 0,c,void 0),u=e.factory.createIndexSignature(void 0,[l],s),_=e.textChanges.ChangeTracker.with(r,(function(e){return e.insertMemberAtStart(n,a,u)}));return t.createCodeFixActionWithoutFixAll(i,_,[e.Diagnostics.Add_index_signature_for_property_0,o])}(r,o,a,c.text,_))),g}(r,n)}(n,_))}},fixIds:[i,s,a,o],getAllCodeActions:function(n){var i=n.program,_=n.fixId,f=i.getTypeChecker(),b=new e.Map,x=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(n,(function(i){t.eachDiagnostic(n,c,(function(t){var c=l(t.file,t.start,t.code,f,n.program);if(c&&e.addToSeen(b,e.getNodeId(c.parentDeclaration)+"#"+c.token.text))if(_!==s||c.kind!==r.Function&&c.kind!==r.Signature){if(_===a&&c.kind===r.ObjectLiteral)h(i,n,c);else if(_===o&&c.kind===r.JsxAttributes)v(i,n,c);else if(c.kind===r.Enum&&m(i,f,c),c.kind===r.TypeLikeDeclaration){var u=c.parentDeclaration,d=c.token,p=e.getOrUpdate(x,u,(function(){return []}));p.some((function(e){return e.token.text===d.text}))||p.push(c);}}else y(i,n,c);})),x.forEach((function(r,a){for(var o=e.isTypeLiteralNode(a)?void 0:t.getAllSupers(a,f),s=function(t){if(null==o?void 0:o.some((function(e){var r=x.get(e);return !!r&&r.some((function(e){return e.token.text===t.token.text}))})))return "continue";var r=t.parentDeclaration,a=t.declSourceFile,s=t.modifierFlags,c=t.token,l=t.call,_=t.isJSFile;if(l&&!e.isPrivateIdentifier(c))g(n,i,l,c,32&s,r,a);else if(!_||e.isInterfaceDeclaration(r)||e.isTypeLiteralNode(r)){var m=d(f,r,c);p(i,a,r,c.text,m,32&s);}else u(i,a,r,c,!!(32&s));},c=0,l=r;c<l.length;c++)s(l[c]);}));})))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingNewOperator",n=[e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];function i(t,r,n){var i=e.cast(function(t,r){for(var n=e.getTokenAtPosition(t,r.start),i=e.textSpanEnd(r);n.end<i;)n=n.parent;return n}(r,n),e.isCallExpression),a=e.factory.createNewExpression(i.expression,i.typeArguments,i.arguments);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.sourceFile,o=n.span,s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_new_operator_to_call,r,e.Diagnostics.Add_missing_new_operator_to_all_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,e.sourceFile,r)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="installTypesPackage",n=e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code,i=[n,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code];function a(e,t){return {type:"install package",file:e,packageName:t}}function o(t,r){var n=e.tryCast(e.getTokenAtPosition(t,r),e.isStringLiteral);if(n){var i=n.text,a=e.parsePackageName(i).packageName;return e.isExternalModuleNameRelative(a)?void 0:a}}function s(t,r,i){var a;return i===n?e.JsTyping.nodeCoreModules.has(t)?"@types/node":void 0:(null===(a=r.isKnownTypesPackageName)||void 0===a?void 0:a.call(r,t))?e.getTypesPackageName(t):void 0}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.host,c=n.sourceFile,l=o(c,n.span.start);if(void 0!==l){var u=s(l,i,n.errorCode);return void 0===u?[]:[t.createCodeFixAction("fixCannotFindModule",[],[e.Diagnostics.Install_0,u],r,e.Diagnostics.Install_all_missing_types_packages,a(c.fileName,u))]}},fixIds:[r],getAllCodeActions:function(n){return t.codeFixAll(n,i,(function(t,i,c){var l=o(i.file,i.start);if(void 0!==l)if(n.fixId===r){var u=s(l,n.host,i.code);u&&c.push(a(i.file.fileName,u));}else e.Debug.fail("Bad fixId: ".concat(n.fixId));}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code],n="fixClassDoesntImplementInheritedAbstractMember";function i(t,r){var n=e.getTokenAtPosition(t,r);return e.cast(n.parent,e.isClassLike)}function a(r,n,i,a,s){var c=e.getEffectiveBaseTypeNode(r),l=i.program.getTypeChecker(),u=l.getTypeAtLocation(c),_=l.getPropertiesOfType(u).filter(o),d=t.createImportAdder(n,i.program,s,i.host);t.createMissingMemberNodes(r,_,n,i,s,d,(function(e){return a.insertMemberAtStart(n,r,e)})),d.writeFixes(a);}function o(t){var r=e.getSyntacticModifierFlags(e.first(t.getDeclarations()));return !(8&r||!(256&r))}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=r.sourceFile,s=r.span,c=e.textChanges.ChangeTracker.with(r,(function(e){return a(i(o,s.start),o,r,e,r.preferences)}));return 0===c.length?void 0:[t.createCodeFixAction(n,c,e.Diagnostics.Implement_inherited_abstract_class,n,e.Diagnostics.Implement_all_inherited_abstract_classes)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);e.addToSeen(o,e.getNodeId(s))&&a(s,n.sourceFile,n,t,n.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="classSuperMustPrecedeThisAccess",n=[e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];function i(e,t,r,n){e.insertNodeAtConstructorStart(t,r,n),e.delete(t,n);}function a(t,r){var n=e.getTokenAtPosition(t,r);if(108===n.kind){var i=e.getContainingFunction(n),a=o(i.body);return a&&!a.expression.arguments.some((function(t){return e.isPropertyAccessExpression(t)&&t.expression===n}))?{constructor:i,superCall:a}:void 0}}function o(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,o)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=a(o,s.start);if(c){var l=c.constructor,u=c.superCall,_=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,o,l,u)}));return [t.createCodeFixAction(r,_,e.Diagnostics.Make_super_call_the_first_statement_in_the_constructor,r,e.Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]}},fixIds:[r],getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Map;return t.codeFixAll(r,n,(function(t,r){var n=a(r.file,r.start);if(n){var c=n.constructor,l=n.superCall;e.addToSeen(s,e.getNodeId(c.parent))&&i(t,o,c,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="constructorForDerivedNeedSuperCall",n=[e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(e.isConstructorDeclaration(n.parent),"token should be at the constructor declaration"),n.parent}function a(t,r,n){var i=e.factory.createExpressionStatement(e.factory.createCallExpression(e.factory.createSuper(),void 0,e.emptyArray));t.insertNodeAtConstructorStart(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_super_call,r,e.Diagnostics.Add_all_missing_super_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="enableExperimentalDecorators",n=[e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"experimentalDecorators",e.factory.createTrue());}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixEnableJsxFlag",n=[e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"jsx",e.factory.createStringLiteral("react"));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_jsx_flag_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixNaNEquality",n=[e.Diagnostics.This_condition_will_always_return_0.code];function i(r,n,i){var a=e.find(r.getSemanticDiagnostics(n),(function(e){return e.start===i.start&&e.length===i.length}));if(void 0!==a&&void 0!==a.relatedInformation){var o=e.find(a.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_0.code}));if(void 0!==o&&void 0!==o.file&&void 0!==o.start&&void 0!==o.length){var s,c,l,u=t.findAncestorMatchingSpan(o.file,e.createTextSpan(o.start,o.length));if(void 0!==u)return e.isExpression(u)&&e.isBinaryExpression(u.parent)?{suggestion:(s=o.messageText,c=e.flattenDiagnosticMessageText(s,"\n",0).match(/\'(.*)\'/)||[],l=c[1],l),expression:u.parent,arg:u}:void 0}}}function a(t,r,n,i){var a=e.factory.createCallExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("Number"),e.factory.createIdentifier("isNaN")),void 0,[n]),o=i.operatorToken.kind;t.replaceNode(r,i,37===o||35===o?e.factory.createPrefixUnaryExpression(53,a):a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(n.program,o,s);if(void 0!==c){var l=c.suggestion,u=c.expression,_=c.arg,d=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,_,u)}));return [t.createCodeFixAction(r,d,[e.Diagnostics.Use_0,l],r,e.Diagnostics.Use_Number_isNaN_in_all_conditions)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(r.program,n.file,e.createTextSpan(n.start,n.length));o&&a(t,n.file,o.arg,o.expression);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(r){var n=r.program.getCompilerOptions(),i=n.configFile;if(void 0!==i){var a=[],o=e.getEmitModuleKind(n);if(o>=e.ModuleKind.ES2015&&o<e.ModuleKind.ESNext){var s=e.textChanges.ChangeTracker.with(r,(function(r){t.setJsonCompilerOptionValue(r,i,"module",e.factory.createStringLiteral("esnext"));}));a.push(t.createCodeFixActionWithoutFixAll("fixModuleOption",s,[e.Diagnostics.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]));}var c=e.getEmitScriptTarget(n);return (c<4||c>99)&&(s=e.textChanges.ChangeTracker.with(r,(function(r){if(e.getTsConfigObjectLiteralExpression(i)){var n=[["target",e.factory.createStringLiteral("es2017")]];o===e.ModuleKind.CommonJS&&n.push(["module",e.factory.createStringLiteral("commonjs")]),t.setJsonCompilerOptionValues(r,i,n);}})),a.push(t.createCodeFixActionWithoutFixAll("fixTargetOption",s,[e.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))),a.length?a:void 0}}});}(t),function(e){!function(t){var r="fixPropertyAssignment",n=[e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];function i(t,r,n){t.replaceNode(r,n,e.factory.createPropertyAssignment(n.name,n.objectAssignmentInitializer));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isShorthandPropertyAssignment)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start),s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,[e.Diagnostics.Change_0_to_1,"=",":"],r,[e.Diagnostics.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,a(t.file,t.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="extendsInterfaceBecomesImplements",n=[e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingClass(n).heritageClauses,a=i[0].getFirstToken();return 94===a.kind?{extendsToken:a,heritageClauses:i}:void 0}function a(t,r,n,i){if(t.replaceNode(r,n,e.factory.createToken(117)),2===i.length&&94===i[0].token&&117===i[1].token){var a=i[1].getFirstToken(),o=a.getFullStart();t.replaceRange(r,{pos:o,end:o},e.factory.createToken(27));for(var s=r.text,c=a.end;c<s.length&&e.isWhiteSpaceSingleLine(s.charCodeAt(c));)c++;t.deleteRange(r,{pos:a.getStart(),end:c});}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=s.extendsToken,l=s.heritageClauses,u=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,l)}));return [t.createCodeFixAction(r,u,e.Diagnostics.Change_extends_to_implements,r,e.Diagnostics.Change_all_extended_interfaces_to_implements)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r.extendsToken,r.heritageClauses);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="forgottenThisPropertyAccess",n=e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,i=[e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,n];function a(t,r,i){var a=e.getTokenAtPosition(t,r);if(e.isIdentifier(a)||e.isPrivateIdentifier(a))return {node:a,className:i===n?e.getContainingClass(a).name.text:void 0}}function o(t,r,n){var i=n.node,a=n.className;e.suppressLeadingAndTrailingTrivia(i),t.replaceNode(r,i,e.factory.createPropertyAccessExpression(a?e.factory.createIdentifier(a):e.factory.createThis(),i));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=a(i,n.span.start,n.errorCode);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Add_0_to_unresolved_variable,s.className||"this"],r,e.Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){var n=a(r.file,r.start,r.code);n&&o(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixInvalidJsxCharacters_expression",n="fixInvalidJsxCharacters_htmlEntity",i=[e.Diagnostics.Unexpected_token_Did_you_mean_or_gt.code,e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code];t.registerCodeFix({errorCodes:i,fixIds:[r,n],getCodeActions:function(i){var a=i.sourceFile,s=i.preferences,c=i.span,l=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!1)})),u=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!0)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_invalid_character_in_an_expression_container,r,e.Diagnostics.Wrap_all_invalid_characters_in_an_expression_container),t.createCodeFixAction(n,u,e.Diagnostics.Convert_invalid_character_to_its_html_entity_code,n,e.Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){return o(t,e.preferences,r.file,r.start,e.fixId===n)}))}});var a={">":"&gt;","}":"&rbrace;"};function o(t,r,n,i,o){var s=n.getText()[i];if(function(t){return e.hasProperty(a,t)}(s)){var c=o?a[s]:"{".concat(e.quote(n,r,s),"}");t.replaceRangeWithText(n,{pos:i,end:i+1},c);}}}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="deleteUnmatchedParameter",n="renameUnmatchedParameter",i=[e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];function a(t,r){var n=e.getTokenAtPosition(t,r);if(n.parent&&e.isJSDocParameterTag(n.parent)&&e.isIdentifier(n.parent.name)){var i=n.parent,a=e.getHostSignatureFromJSDoc(i);if(a)return {signature:a,name:n.parent.name,jsDocParameterTag:i}}}t.registerCodeFix({fixIds:[r,n],errorCodes:i,getCodeActions:function(i){var o=[],s=a(i.sourceFile,i.span.start);if(s)return e.append(o,function(n,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag,c=e.textChanges.ChangeTracker.with(n,(function(e){return e.filterJSDocTags(n.sourceFile,o,(function(e){return e!==s}))}));return t.createCodeFixAction(r,c,[e.Diagnostics.Delete_unused_param_tag_0,a.getText(n.sourceFile)],r,e.Diagnostics.Delete_all_unused_param_tags)}(i,s)),e.append(o,function(r,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag;if(e.length(o.parameters)){for(var c=r.sourceFile,l=e.getJSDocTags(o),u=new e.Set,_=0,d=l;_<d.length;_++){var p=d[_];e.isJSDocParameterTag(p)&&e.isIdentifier(p.name)&&u.add(p.name.escapedText);}var f=e.firstDefined(o.parameters,(function(t){return e.isIdentifier(t.name)&&!u.has(t.name.escapedText)?t.name.getText(c):void 0}));if(void 0!==f){var g=e.factory.updateJSDocParameterTag(s,s.tagName,e.factory.createIdentifier(f),s.isBracketed,s.typeExpression,s.isNameFirst,s.comment),m=e.textChanges.ChangeTracker.with(r,(function(t){return t.replaceJSDocComment(c,o,e.map(l,(function(e){return e===s?g:e})))}));return t.createCodeFixActionWithoutFixAll(n,m,[e.Diagnostics.Rename_param_tag_name_0_to_1,a.getText(c),f])}}}(i,s)),o},getAllCodeActions:function(n){var o=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(n,(function(s){t.eachDiagnostic(n,i,(function(t){var r=a(t.file,t.start);r&&o.set(r.signature,e.append(o.get(r.signature),r.jsDocParameterTag));})),o.forEach((function(t,i){if(n.fixId===r){var a=new e.Set(t);s.filterJSDocTags(i.getSourceFile(),i,(function(e){return !a.has(e)}));}}));})))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixUnreferenceableDecoratorMetadata",n=[e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=function(t,r,n){var i=e.tryCast(e.getTokenAtPosition(t,n),e.isIdentifier);if(i&&180===i.parent.kind){var a=r.getTypeChecker().getSymbolAtLocation(i);return e.find((null==a?void 0:a.declarations)||e.emptyArray,e.or(e.isImportClause,e.isImportSpecifier,e.isImportEqualsDeclaration))}}(n.sourceFile,n.program,n.span.start);if(i){var a,o=e.textChanges.ChangeTracker.with(n,(function(t){return 273===i.kind&&function(t,r,n,i){e.refactor.doChangeNamedToNamespaceOrDefault(r,i,t,n.parent);}(t,n.sourceFile,i,n.program)})),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n,i){if(268!==n.kind){var a=270===n.kind?n:n.parent.parent;if(!a.name||!a.namedBindings){var o=i.getTypeChecker();e.forEachImportClauseDeclaration(a,(function(t){if(111551&e.skipAlias(t.symbol,o).flags)return !0}))||t.insertModifierBefore(r,154,a);}}else t.insertModifierBefore(r,154,n.name);}(t,n.sourceFile,i,n.program)}));return o.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Convert_named_imports_to_namespace_import))),s.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,s,e.Diagnostics.Convert_to_type_only_import))),a}},fixIds:[r]});}(t),function(e){!function(t){var r="unusedIdentifier",n="unusedIdentifier_prefix",i="unusedIdentifier_delete",a="unusedIdentifier_deleteImports",o="unusedIdentifier_infer",s=[e.Diagnostics._0_is_declared_but_its_value_is_never_read.code,e.Diagnostics._0_is_declared_but_never_used.code,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,e.Diagnostics.All_imports_in_import_declaration_are_unused.code,e.Diagnostics.All_destructured_elements_are_unused.code,e.Diagnostics.All_variables_are_unused.code,e.Diagnostics.All_type_parameters_are_unused.code];function c(t,r,n){t.replaceNode(r,n.parent,e.factory.createKeywordTypeNode(157));}function l(n,a){return t.createCodeFixAction(r,n,a,i,e.Diagnostics.Delete_all_unused_declarations)}function u(t,r,n){t.delete(r,e.Debug.checkDefined(e.cast(n.parent,e.isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"));}function _(e){return 100===e.kind||79===e.kind&&(273===e.parent.kind||270===e.parent.kind)}function d(t){return 100===t.kind?e.tryCast(t.parent,e.isImportDeclaration):void 0}function p(t,r){return e.isVariableDeclarationList(r.parent)&&e.first(r.parent.getChildren(t))===r}function f(e,t,r){e.delete(t,240===r.parent.kind?r.parent:r);}function g(t,r,n,i){r!==e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code&&(138===i.kind&&(i=e.cast(i.parent,e.isInferTypeNode).typeParameter.name),e.isIdentifier(i)&&function(e){switch(e.parent.kind){case 166:case 165:return !0;case 257:switch(e.parent.parent.parent.kind){case 247:case 246:return !0}}return !1}(i)&&(t.replaceNode(n,i,e.factory.createIdentifier("_".concat(i.text))),e.isParameter(i.parent)&&e.getJSDocParameterTags(i.parent).forEach((function(r){e.isIdentifier(r.name)&&t.replaceNode(n,r.name,e.factory.createIdentifier("_".concat(r.name.text)));}))));}function m(t,r,n,i,a,o,s,c){!function(t,r,n,i,a,o,s,c){var l=t.parent;if(e.isParameter(l))!function(t,r,n,i,a,o,s,c){if(void 0===c&&(c=!1),function(t,r,n,i,a,o,s){var c=n.parent;switch(c.kind){case 171:case 173:var l=c.parameters.indexOf(n),u=e.isMethodDeclaration(c)?c.name:c,_=e.FindAllReferences.Core.getReferencedSymbolsForNode(c.pos,u,a,i,o);if(_)for(var d=0,p=_;d<p.length;d++)for(var f=0,g=p[d].references;f<g.length;f++){var m=g[f];if(1===m.kind){var y=e.isSuperKeyword(m.node)&&e.isCallExpression(m.node.parent)&&m.node.parent.arguments.length>l,h=e.isPropertyAccessExpression(m.node.parent)&&e.isSuperKeyword(m.node.parent.expression)&&e.isCallExpression(m.node.parent.parent)&&m.node.parent.parent.arguments.length>l,b=(e.isMethodDeclaration(m.node.parent)||e.isMethodSignature(m.node.parent))&&m.node.parent!==n.parent&&m.node.parent.parameters.length>l;if(y||h||b)return !1}}return !0;case 259:return !c.name||!function(t,r,n){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(n,t,r,(function(t){return e.isIdentifier(t)&&e.isCallExpression(t.parent)&&t.parent.arguments.indexOf(t)>=0}))}(t,r,c.name)||v(c,n,s);case 215:case 216:return v(c,n,s);case 175:return !1;case 174:return !0;default:return e.Debug.failBadSyntaxKind(c)}}(i,r,n,a,o,s,c))if(n.modifiers&&n.modifiers.length>0&&(!e.isIdentifier(n.name)||e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,i,r)))for(var l=0,u=n.modifiers;l<u.length;l++){var _=u[l];e.isModifier(_)&&t.deleteModifier(r,_);}else !n.initializer&&y(n,i,a)&&t.delete(r,n);}(r,n,l,i,a,o,s,c);else if(!(c&&e.isIdentifier(t)&&e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,n))){var u=e.isImportClause(l)?t:e.isComputedPropertyName(l)?l.parent:l;e.Debug.assert(u!==n,"should not delete whole source file"),r.delete(n,u);}}(r,n,t,i,a,o,s,c),e.isIdentifier(r)&&e.FindAllReferences.Core.eachSymbolReferenceInFile(r,i,t,(function(r){var i;e.isPropertyAccessExpression(r.parent)&&r.parent.name===r&&(r=r.parent),!c&&(i=r,(e.isBinaryExpression(i.parent)&&i.parent.left===i||(e.isPostfixUnaryExpression(i.parent)||e.isPrefixUnaryExpression(i.parent))&&i.parent.operand===i)&&e.isExpressionStatement(i.parent.parent))&&n.delete(t,r.parent.parent);}));}function y(t,r,n){var i=t.parent.parameters.indexOf(t);return !e.FindAllReferences.Core.someSignatureUsage(t.parent,n,r,(function(e,t){return !t||t.arguments.length>i}))}function v(t,r,n){var i=t.parameters,a=i.indexOf(r);return e.Debug.assert(-1!==a,"The parameter should already be in the list"),n?i.slice(a+1).every((function(t){return e.isIdentifier(t.name)&&!t.symbol.isReferenced})):a===i.length-1}t.registerCodeFix({errorCodes:s,getCodeActions:function(i){var s=i.errorCode,y=i.sourceFile,v=i.program,h=i.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles(),D=e.getTokenAtPosition(y,i.span.start);if(e.isJSDocTemplateTag(D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D)})),e.Diagnostics.Remove_template_tag)];if(29===D.kind)return [l(T=e.textChanges.ChangeTracker.with(i,(function(e){return u(e,y,D)})),e.Diagnostics.Remove_type_parameters)];var S=d(D);if(S){var T=e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S)}));return [t.createCodeFixAction(r,T,[e.Diagnostics.Remove_import_from_0,e.showModuleSpecifier(S)],a,e.Diagnostics.Delete_all_unused_imports)]}if(_(D)&&(A=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length)return [t.createCodeFixAction(r,A,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,D.getText(y)],a,e.Diagnostics.Delete_all_unused_imports)];if(e.isObjectBindingPattern(D.parent)||e.isArrayBindingPattern(D.parent)){if(e.isParameter(D.parent.parent)){var C=D.parent.elements,E=[C.length>1?e.Diagnostics.Remove_unused_declarations_for_Colon_0:e.Diagnostics.Remove_unused_declaration_for_Colon_0,e.map(C,(function(e){return e.getText(y)})).join(", ")];return [l(e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r,n){e.forEach(n.elements,(function(e){return t.delete(r,e)}));}(t,y,D.parent)})),E)]}return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D.parent.parent)})),e.Diagnostics.Remove_unused_destructuring_declaration)]}if(p(y,D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return f(e,y,D.parent)})),e.Diagnostics.Remove_variable_statement)];var k=[];if(138===D.kind){T=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,y,D)}));var N=e.cast(D.parent,e.isInferTypeNode).typeParameter.name.text;k.push(t.createCodeFixAction(r,T,[e.Diagnostics.Replace_infer_0_with_unknown,N],o,e.Diagnostics.Replace_all_unused_infer_with_unknown));}else {var A;(A=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length&&(N=e.isComputedPropertyName(D.parent)?D.parent:D,k.push(l(A,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,N.getText(y)])));}var F=e.textChanges.ChangeTracker.with(i,(function(e){return g(e,s,y,D)}));return F.length&&k.push(t.createCodeFixAction(r,F,[e.Diagnostics.Prefix_0_with_an_underscore,D.getText(y)],n,e.Diagnostics.Prefix_all_unused_declarations_with_where_possible)),k},fixIds:[n,i,a,o],getAllCodeActions:function(r){var l=r.sourceFile,v=r.program,h=r.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles();return t.codeFixAll(r,s,(function(t,s){var D=e.getTokenAtPosition(l,s.start);switch(r.fixId){case n:g(t,s.code,l,D);break;case a:var S=d(D);S?t.delete(l,S):_(D)&&m(l,D,t,b,x,v,h,!0);break;case i:if(138===D.kind||_(D))break;if(e.isJSDocTemplateTag(D))t.delete(l,D);else if(29===D.kind)u(t,l,D);else if(e.isObjectBindingPattern(D.parent)){if(D.parent.parent.initializer)break;e.isParameter(D.parent.parent)&&!y(D.parent.parent,b,x)||t.delete(l,D.parent.parent);}else {if(e.isArrayBindingPattern(D.parent.parent)&&D.parent.parent.parent.initializer)break;p(l,D)?f(t,l,D.parent):m(l,D,t,b,x,v,h,!0);}break;case o:138===D.kind&&c(t,l,D);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnreachableCode",n=[e.Diagnostics.Unreachable_code_detected.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n),s=e.findAncestor(o,e.isStatement);if(s.getStart(r)!==o.getStart(r)){var c=JSON.stringify({statementKind:e.Debug.formatSyntaxKind(s.kind),tokenKind:e.Debug.formatSyntaxKind(o.kind),errorCode:a,start:n,length:i});e.Debug.fail("Token and statement should start at the same point. "+c);}var l=(e.isBlock(s.parent)?s.parent:s).parent;if(!e.isBlock(s.parent)||s===e.first(s.parent.statements))switch(l.kind){case 242:if(l.elseStatement){if(e.isBlock(s.parent))break;return void t.replaceNode(r,s,e.factory.createBlock(e.emptyArray))}case 244:case 245:return void t.delete(r,l)}if(e.isBlock(s.parent)){var u=n+i,_=e.Debug.checkDefined(function(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(!(a.pos<u))break;r=a;}return r}(e.sliceAfter(s.parent.statements,s)),"Some statement should be last");t.deleteNodeRange(r,s,_);}else t.delete(r,s);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){if(!n.program.getSyntacticDiagnostics(n.sourceFile,n.cancellationToken).length){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.span.length,n.errorCode)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unreachable_code,r,e.Diagnostics.Remove_all_unreachable_code)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start,t.length,t.code)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnusedLabel",n=[e.Diagnostics.Unused_label.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.cast(i.parent,e.isLabeledStatement),o=i.getStart(r),s=a.statement.getStart(r),c=e.positionsAreOnSameLine(o,s,r)?s:e.skipTrivia(r.text,e.findChildOfKind(a,58,r).end,!0);t.deleteRange(r,{pos:o,end:c});}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unused_label,r,e.Diagnostics.Remove_all_unused_labels)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixJSDocTypes_plain",n="fixJSDocTypes_nullable",i=[e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code];function a(e,t,r,n,i){e.replaceNode(t,r,i.typeToTypeNode(n,r,void 0));}function o(t,r,n){var i=e.findAncestor(e.getTokenAtPosition(t,r),s),a=i&&i.type;return a&&{typeNode:a,type:n.getTypeFromTypeNode(a)}}function s(e){switch(e.kind){case 231:case 176:case 177:case 259:case 174:case 178:case 197:case 171:case 170:case 166:case 169:case 168:case 175:case 262:case 213:case 257:return !0;default:return !1}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var s=i.sourceFile,c=i.program.getTypeChecker(),l=o(s,i.span.start,c);if(l){var u=l.typeNode,_=l.type,d=u.getText(s),p=[f(_,r,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];return 317===u.kind&&p.push(f(c.getNullableType(_,32768),n,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),p}function f(r,n,o){var l=e.textChanges.ChangeTracker.with(i,(function(e){return a(e,s,u,r,c)}));return t.createCodeFixAction("jdocTypes",l,[e.Diagnostics.Change_0_to_1,d,c.typeToString(r)],n,o)}},fixIds:[r,n],getAllCodeActions:function(e){var r=e.fixId,s=e.program,c=e.sourceFile,l=s.getTypeChecker();return t.codeFixAll(e,i,(function(e,t){var i=o(t.file,t.start,l);if(i){var s=i.typeNode,u=i.type,_=317===s.kind&&r===n?l.getNullableType(u,32768):u;a(e,c,s,_,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixMissingCallParentheses",n=[e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];function i(e,t,r){e.replaceNodeWithText(t,r,"".concat(r.text,"()"));}function a(t,r){var n=e.getTokenAtPosition(t,r);if(e.isPropertyAccessExpression(n.parent)){for(var i=n.parent;e.isPropertyAccessExpression(i.parent);)i=i.parent;return i.name}if(e.isIdentifier(n))return n}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_call_parentheses,r,e.Diagnostics.Add_all_missing_call_parentheses)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAwaitInSyncFunction",n=[e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingFunction(n);if(i){var a,o;switch(i.kind){case 171:a=i.name;break;case 259:case 215:a=e.findChildOfKind(i,98,t);break;case 216:var s=i.typeParameters?29:20;a=e.findChildOfKind(i,s,t)||e.first(i.parameters);break;default:return}return a&&{insertBefore:a,returnType:(o=i,o.type?o.type:e.isVariableDeclaration(o.parent)&&o.parent.type&&e.isFunctionTypeNode(o.parent.type)?o.parent.type.type:void 0)}}}function a(t,r,n){var i=n.insertBefore,a=n.returnType;if(a){var o=e.getEntityNameFromTypeNode(a);o&&79===o.kind&&"Promise"===o.text||t.replaceNode(r,a,e.factory.createTypeReferenceNode("Promise",e.factory.createNodeArray([a])));}t.insertModifierBefore(r,132,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)]}},fixIds:[r],getAllCodeActions:function(r){var o=new e.Map;return t.codeFixAll(r,n,(function(t,n){var s=i(n.file,n.start);s&&e.addToSeen(o,e.getNodeId(s.insertBefore))&&a(t,r.sourceFile,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],n="fixPropertyOverrideAccessor";function i(r,n,i,a,o){var s,c;if(a===e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)s=n,c=n+i;else if(a===e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){var l=o.program.getTypeChecker(),u=e.getTokenAtPosition(r,n).parent;e.Debug.assert(e.isAccessor(u),"error span of fixPropertyOverrideAccessor should only be on an accessor");var _=u.parent;e.Debug.assert(e.isClassLike(_),"erroneous accessors should only be inside classes");var d=e.singleOrUndefined(t.getAllSupers(_,l));if(!d)return [];var p=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(u.name)),f=l.getPropertyOfType(l.getTypeAtLocation(d),p);if(!f||!f.valueDeclaration)return [];s=f.valueDeclaration.pos,c=f.valueDeclaration.end,r=e.getSourceFileOfNode(f.valueDeclaration);}else e.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+a);return t.generateAccessorFromProperty(r,o.program,s,c,o,e.Diagnostics.Generate_get_and_set_accessors.message)}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=i(r.sourceFile,r.span.start,r.span.length,r.errorCode,r);if(a)return [t.createCodeFixAction(n,a,e.Diagnostics.Generate_get_and_set_accessors,n,e.Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){var n=i(r.file,r.start,r.length,r.code,e);if(n)for(var a=0,o=n;a<o.length;a++){var s=o[a];t.pushRaw(e.sourceFile,s);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="inferFromUsage",i=[e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,e.Diagnostics.Member_0_implicitly_has_an_1_type.code,e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function a(t,r){switch(t){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.isSetAccessorDeclaration(e.getContainingFunction(r))?e.Diagnostics.Infer_type_of_0_from_usage:e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return e.Diagnostics.Infer_this_type_of_0_from_usage;default:return e.Diagnostics.Infer_type_of_0_from_usage}}function o(r,n,i,a,o,_,g,m,y){if(e.isParameterPropertyModifier(i.kind)||79===i.kind||25===i.kind||108===i.kind){var v=i.parent,h=t.createImportAdder(n,o,y,m);switch(a=function(t){switch(t){case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_an_1_type.code;case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Member_0_implicitly_has_an_1_type.code}return t}(a)){case e.Diagnostics.Member_0_implicitly_has_an_1_type.code:case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(e.isVariableDeclaration(v)&&g(v)||e.isPropertyDeclaration(v)||e.isPropertySignature(v))return s(r,h,n,v,o,m,_),h.writeFixes(r),v;if(e.isPropertyAccessExpression(v)){var b=d(v.name,o,_),x=e.getTypeNodeIfAccessible(b,v,o,m);if(x){var D=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(x),void 0);r.addJSDocTags(n,e.cast(v.parent.parent,e.isExpressionStatement),[D]);}return h.writeFixes(r),v}return;case e.Diagnostics.Variable_0_implicitly_has_an_1_type.code:var S=o.getTypeChecker().getSymbolAtLocation(i);return S&&S.valueDeclaration&&e.isVariableDeclaration(S.valueDeclaration)&&g(S.valueDeclaration)?(s(r,h,e.getSourceFileOfNode(S.valueDeclaration),S.valueDeclaration,o,m,_),h.writeFixes(r),S.valueDeclaration):void 0}var T=e.getContainingFunction(i);if(void 0!==T){var C;switch(a){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:if(e.isSetAccessorDeclaration(T)){c(r,h,n,T,o,m,_),C=T;break}case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:if(g(T)){var E=e.cast(v,e.isParameter);!function(t,r,n,i,a,o,s,c){if(e.isIdentifier(i.name)){var _=function(t,r,n,i){var a=p(t,r,n,i);return a&&f(n,a,i).parameters(t)||t.parameters.map((function(t){return {declaration:t,type:e.isIdentifier(t.name)?d(t.name,n,i):n.getTypeChecker().getAnyType()}}))}(a,n,o,c);if(e.Debug.assert(a.parameters.length===_.length,"Parameter count and inference count should match"),e.isInJSFile(a))u(t,n,_,o,s);else {var g=e.isArrowFunction(a)&&!e.findChildOfKind(a,20,n);g&&t.insertNodeBefore(n,e.first(a.parameters),e.factory.createToken(20));for(var m=0,y=_;m<y.length;m++){var v=y[m],h=v.declaration,b=v.type;!h||h.type||h.initializer||l(t,r,n,h,b,o,s);}g&&t.insertNodeAfter(n,e.last(a.parameters),e.factory.createToken(21));}}}(r,h,n,E,T,o,m,_),C=E;}break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:e.isGetAccessorDeclaration(T)&&e.isIdentifier(T.name)&&(l(r,h,n,T,d(T.name,o,_),o,m),C=T);break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:e.isSetAccessorDeclaration(T)&&(c(r,h,n,T,o,m,_),C=T);break;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:e.textChanges.isThisTypeAnnotatable(T)&&g(T)&&(function(t,r,n,i,a,o){var s=p(n,r,i,o);if(s&&s.length){var c=f(i,s,o).thisParameter(),l=e.getTypeNodeIfAccessible(c,n,i,a);l&&(e.isInJSFile(n)?function(t,r,n,i){t.addJSDocTags(r,n,[e.factory.createJSDocThisTag(void 0,e.factory.createJSDocTypeExpression(i))]);}(t,r,n,l):t.tryInsertThisTypeAnnotation(r,n,l));}}(r,n,T,o,m,_),C=T);break;default:return e.Debug.fail(String(a))}return h.writeFixes(r),C}}}function s(t,r,n,i,a,o,s){e.isIdentifier(i.name)&&l(t,r,n,i,d(i.name,a,s),a,o);}function c(t,r,n,i,a,o,s){var c=e.firstOrUndefined(i.parameters);if(c&&e.isIdentifier(i.name)&&e.isIdentifier(c.name)){var _=d(i.name,a,s);_===a.getTypeChecker().getAnyType()&&(_=d(c.name,a,s)),e.isInJSFile(i)?u(t,n,[{declaration:c,type:_}],a,o):l(t,r,n,c,_,a,o);}}function l(r,n,i,a,o,s,c){var l=e.getTypeNodeIfAccessible(o,a,s,c);if(l)if(e.isInJSFile(i)&&168!==a.kind){var u=e.isVariableDeclaration(a)?e.tryCast(a.parent.parent,e.isVariableStatement):a;if(!u)return;var _=e.factory.createJSDocTypeExpression(l),d=e.isGetAccessorDeclaration(a)?e.factory.createJSDocReturnTag(void 0,_,void 0):e.factory.createJSDocTypeTag(void 0,_,void 0);r.addJSDocTags(i,u,[d]);}else (function(r,n,i,a,o,s){var c=t.tryGetAutoImportableReferenceFromTypeNode(r,s);return !(!c||!a.tryInsertTypeAnnotation(i,n,c.typeNode))&&(e.forEach(c.symbols,(function(e){return o.addImportFromExportedSymbol(e,!0)})),!0)})(l,a,i,r,n,e.getEmitScriptTarget(s.getCompilerOptions()))||r.tryInsertTypeAnnotation(i,a,l);}function u(t,r,n,i,a){var o=n.length&&n[0].declaration.parent;if(o){var s=e.mapDefined(n,(function(t){var r=t.declaration;if(!r.initializer&&!e.getJSDocType(r)&&e.isIdentifier(r.name)){var n=t.type&&e.getTypeNodeIfAccessible(t.type,r,i,a);if(n){var o=e.factory.cloneNode(r.name);return e.setEmitFlags(o,3584),{name:e.factory.cloneNode(r.name),param:r,isOptional:!!t.isOptional,typeNode:n}}}}));if(s.length)if(e.isArrowFunction(o)||e.isFunctionExpression(o)){var c=e.isArrowFunction(o)&&!e.findChildOfKind(o,20,r);c&&t.insertNodeBefore(r,e.first(o.parameters),e.factory.createToken(20)),e.forEach(s,(function(n){var i=n.typeNode,a=n.param,o=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(i)),s=e.factory.createJSDocComment(void 0,[o]);t.insertNodeAt(r,a.getStart(r),s,{suffix:" "});})),c&&t.insertNodeAfter(r,e.last(o.parameters),e.factory.createToken(21));}else {var l=e.map(s,(function(t){var r=t.name,n=t.typeNode,i=t.isOptional;return e.factory.createJSDocParameterTag(void 0,r,!!i,e.factory.createJSDocTypeExpression(n),!1,void 0)}));t.addJSDocTags(r,o,l);}}}function _(t,r,n){return e.mapDefined(e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),n),(function(t){return 0!==t.kind?e.tryCast(t.node,e.isIdentifier):void 0}))}function d(e,t,r){return f(t,_(e,t,r),r).single()}function p(t,r,n,i){var a;switch(t.kind){case 173:a=e.findChildOfKind(t,135,r);break;case 216:case 215:var o=t.parent;a=(e.isVariableDeclaration(o)||e.isPropertyDeclaration(o))&&e.isIdentifier(o.name)?o.name:t.name;break;case 259:case 171:case 170:a=t.name;}if(a)return _(a,n,i)}function f(t,r,i){var a=t.getTypeChecker(),o={string:function(){return a.getStringType()},number:function(){return a.getNumberType()},Array:function(e){return a.createArrayType(e)},Promise:function(e){return a.createPromiseType(e)}},s=[a.getStringType(),a.getNumberType(),a.createArrayType(a.getAnyType()),a.createPromiseType(a.getAnyType())];return {single:function(){return f(l(r))},parameters:function(o){if(0!==r.length&&o.parameters){for(var s={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},c=0,d=r;c<d.length;c++){var p=d[c];i.throwIfCancellationRequested(),u(p,s);}var g=n$4(n$4([],s.constructs||[],!0),s.calls||[],!0);return o.parameters.map((function(r,n){for(var s=[],c=e.isRestParameter(r),u=!1,d=0,p=g;d<p.length;d++){var m=p[d];if(m.argumentTypes.length<=n)u=e.isInJSFile(o),s.push(a.getUndefinedType());else if(c)for(var y=n;y<m.argumentTypes.length;y++)s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[y]));else s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[n]));}if(e.isIdentifier(r.name)){var v=l(_(r.name,t,i));s.push.apply(s,c?e.mapDefined(v,a.getElementTypeOfArrayType):v);}var h=f(s);return {type:c?a.createArrayType(h):h,isOptional:u&&!c,declaration:r}}))}},thisParameter:function(){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},n=0,a=r;n<a.length;n++){var o=a[n];i.throwIfCancellationRequested(),u(o,t);}return f(t.candidateThisTypes||e.emptyArray)}};function c(t){for(var r=new e.Map,n=0,i=t;n<i.length;n++){var a=i[n];a.properties&&a.properties.forEach((function(e,t){r.has(t)||r.set(t,[]),r.get(t).push(e);}));}var o=new e.Map;return r.forEach((function(e,t){o.set(t,c(e));})),{isNumber:t.some((function(e){return e.isNumber})),isString:t.some((function(e){return e.isString})),isNumberOrString:t.some((function(e){return e.isNumberOrString})),candidateTypes:e.flatMap(t,(function(e){return e.candidateTypes})),properties:o,calls:e.flatMap(t,(function(e){return e.calls})),constructs:e.flatMap(t,(function(e){return e.constructs})),numberIndex:e.forEach(t,(function(e){return e.numberIndex})),stringIndex:e.forEach(t,(function(e){return e.stringIndex})),candidateThisTypes:e.flatMap(t,(function(e){return e.candidateThisTypes})),inferredTypes:void 0}}function l(e){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},r=0,n=e;r<n.length;r++){var a=n[r];i.throwIfCancellationRequested(),u(a,t);}return g(t)}function u(t,r){for(;e.isRightSideOfQualifiedNameOrPropertyAccess(t);)t=t.parent;switch(t.parent.kind){case 241:!function(t,r){h(r,e.isCallExpression(t)?a.getVoidType():a.getAnyType());}(t,r);break;case 222:r.isNumber=!0;break;case 221:!function(e,t){switch(e.operator){case 45:case 46:case 40:case 54:t.isNumber=!0;break;case 39:t.isNumberOrString=!0;}}(t.parent,r);break;case 223:!function(t,r,n){switch(r.operatorToken.kind){case 42:case 41:case 43:case 44:case 47:case 48:case 49:case 50:case 51:case 52:case 65:case 67:case 66:case 68:case 69:case 73:case 74:case 78:case 70:case 72:case 71:case 40:case 29:case 32:case 31:case 33:var i=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&i.flags?h(n,i):n.isNumber=!0;break;case 64:case 39:var o=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&o.flags?h(n,o):296&o.flags?n.isNumber=!0:402653316&o.flags?n.isString=!0:1&o.flags||(n.isNumberOrString=!0);break;case 63:case 34:case 36:case 37:case 35:h(n,a.getTypeAtLocation(r.left===t?r.right:r.left));break;case 101:t===r.left&&(n.isString=!0);break;case 56:case 60:t!==r.left||257!==t.parent.parent.kind&&!e.isAssignmentExpression(t.parent.parent,!0)||h(n,a.getTypeAtLocation(r.right));}}(t,t.parent,r);break;case 292:case 293:!function(e,t){h(t,a.getTypeAtLocation(e.parent.parent.expression));}(t.parent,r);break;case 210:case 211:t.parent.expression===t?function(e,t){var r={argumentTypes:[],return_:{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}};if(e.arguments)for(var n=0,i=e.arguments;n<i.length;n++){var o=i[n];r.argumentTypes.push(a.getTypeAtLocation(o));}u(e,r.return_),210===e.kind?(t.calls||(t.calls=[])).push(r):(t.constructs||(t.constructs=[])).push(r);}(t.parent,r):d(t,r);break;case 208:!function(t,r){var n=e.escapeLeadingUnderscores(t.name.text);r.properties||(r.properties=new e.Map);var i=r.properties.get(n)||{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(t,i),r.properties.set(n,i);}(t.parent,r);break;case 209:!function(e,t,r){if(t!==e.argumentExpression){var n=a.getTypeAtLocation(e.argumentExpression),i={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(e,i),296&n.flags?r.numberIndex=i:r.stringIndex=i;}else r.isNumberOrString=!0;}(t.parent,t,r);break;case 299:case 300:!function(t,r){var n=e.isVariableDeclaration(t.parent.parent)?t.parent.parent:t.parent;b(r,a.getTypeAtLocation(n));}(t.parent,r);break;case 169:!function(e,t){b(t,a.getTypeAtLocation(e.parent));}(t.parent,r);break;case 257:var n=t.parent,i=n.name,o=n.initializer;if(t===i){o&&h(r,a.getTypeAtLocation(o));break}default:return d(t,r)}}function d(t,r){e.isExpressionNode(t)&&h(r,a.getContextualType(t));}function p(e){return f(g(e))}function f(t){if(!t.length)return a.getAnyType();var r=a.getUnionType([a.getStringType(),a.getNumberType()]),n=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++)for(var o=a[i],s=0,c=r;s<c.length;s++){var l=c[s],u=l.high,_=l.low;u(o)&&(e.Debug.assert(!_(o),"Priority can't have both low and high"),n.push(_));}return t.filter((function(e){return n.every((function(t){return !t(e)}))}))}(t,[{high:function(e){return e===a.getStringType()||e===a.getNumberType()},low:function(e){return e===r}},{high:function(e){return !(16385&e.flags)},low:function(e){return !!(16385&e.flags)}},{high:function(t){return !(114689&t.flags||16&e.getObjectFlags(t))},low:function(t){return !!(16&e.getObjectFlags(t))}}]),i=n.filter((function(t){return 16&e.getObjectFlags(t)}));return i.length&&(n=n.filter((function(t){return !(16&e.getObjectFlags(t))}))).push(function(t){if(1===t.length)return t[0];for(var r=[],n=[],i=[],o=[],s=!1,c=!1,l=e.createMultiMap(),u=0,_=t;u<_.length;u++){for(var d=_[u],p=0,f=a.getPropertiesOfType(d);p<f.length;p++){var g=f[p];l.add(g.name,g.valueDeclaration?a.getTypeOfSymbolAtLocation(g,g.valueDeclaration):a.getAnyType());}r.push.apply(r,a.getSignaturesOfType(d,0)),n.push.apply(n,a.getSignaturesOfType(d,1));var m=a.getIndexInfoOfType(d,0);m&&(i.push(m.type),s=s||m.isReadonly);var y=a.getIndexInfoOfType(d,1);y&&(o.push(y.type),c=c||y.isReadonly);}var v=e.mapEntries(l,(function(e,r){var n=r.length<t.length?16777216:0,i=a.createSymbol(4|n,e);return i.type=a.getUnionType(r),[e,i]})),h=[];return i.length&&h.push(a.createIndexInfo(a.getStringType(),a.getUnionType(i),s)),o.length&&h.push(a.createIndexInfo(a.getNumberType(),a.getUnionType(o),c)),a.createAnonymousType(t[0].symbol,v,r,n,h)}(i)),a.getWidenedType(a.getUnionType(n.map(a.getBaseTypeOfLiteralType),2))}function g(t){var r,i,c,l=[];t.isNumber&&l.push(a.getNumberType()),t.isString&&l.push(a.getStringType()),t.isNumberOrString&&l.push(a.getUnionType([a.getStringType(),a.getNumberType()])),t.numberIndex&&l.push(a.createArrayType(p(t.numberIndex))),((null===(r=t.properties)||void 0===r?void 0:r.size)||(null===(i=t.constructs)||void 0===i?void 0:i.length)||t.stringIndex)&&l.push(m(t));var u=(t.candidateTypes||[]).map((function(e){return a.getBaseTypeOfLiteralType(e)})),_=(null===(c=t.calls)||void 0===c?void 0:c.length)?m(t):void 0;return _&&u?l.push(a.getUnionType(n$4([_],u,!0),2)):(_&&l.push(_),e.length(u)&&l.push.apply(l,u)),l.push.apply(l,function(t){if(!t.properties||!t.properties.size)return [];var r=s.filter((function(r){return function(t,r){return !!r.properties&&!e.forEachEntry(r.properties,(function(r,n){var i,o=a.getTypeOfPropertyOfType(t,n);return !(o&&(r.calls?a.getSignaturesOfType(o,0).length&&a.isTypeAssignableTo(o,(i=r.calls,a.createAnonymousType(void 0,e.createSymbolTable(),[v(i)],e.emptyArray,e.emptyArray))):a.isTypeAssignableTo(o,p(r))))}))}(r,t)}));return 0<r.length&&r.length<3?r.map((function(r){return function(t,r){if(!(4&e.getObjectFlags(t)&&r.properties))return t;var n=t.target,i=e.singleOrUndefined(n.typeParameters);if(!i)return t;var s=[];return r.properties.forEach((function(t,r){var o=a.getTypeOfPropertyOfType(n,r);e.Debug.assert(!!o,"generic should have all the properties of its reference."),s.push.apply(s,y(o,p(t),i));})),o[t.symbol.escapedName](f(s))}(r,t)})):[]}(t)),l}function m(t){var r=new e.Map;t.properties&&t.properties.forEach((function(e,t){var n=a.createSymbol(4,t);n.type=p(e),r.set(t,n);}));var n=t.calls?[v(t.calls)]:[],i=t.constructs?[v(t.constructs)]:[],o=t.stringIndex?[a.createIndexInfo(a.getStringType(),p(t.stringIndex),!1)]:[];return a.createAnonymousType(void 0,r,n,i,o)}function y(t,r,n){if(t===n)return [r];if(3145728&t.flags)return e.flatMap(t.types,(function(e){return y(e,r,n)}));if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)){var i=a.getTypeArguments(t),o=a.getTypeArguments(r),s=[];if(i&&o)for(var c=0;c<i.length;c++)o[c]&&s.push.apply(s,y(i[c],o[c],n));return s}var l=a.getSignaturesOfType(t,0),u=a.getSignaturesOfType(r,0);return 1===l.length&&1===u.length?function(t,r,n){for(var i=[],o=0;o<t.parameters.length;o++){var s=t.parameters[o],c=r.parameters[o],l=t.declaration&&e.isRestParameter(t.declaration.parameters[o]);if(!c)break;var u=s.valueDeclaration?a.getTypeOfSymbolAtLocation(s,s.valueDeclaration):a.getAnyType(),_=l&&a.getElementTypeOfArrayType(u);_&&(u=_);var d=c.type||(c.valueDeclaration?a.getTypeOfSymbolAtLocation(c,c.valueDeclaration):a.getAnyType());i.push.apply(i,y(u,d,n));}var p=a.getReturnTypeOfSignature(t),f=a.getReturnTypeOfSignature(r);return i.push.apply(i,y(p,f,n)),i}(l[0],u[0],n):[]}function v(t){for(var r=[],n=Math.max.apply(Math,t.map((function(e){return e.argumentTypes.length}))),i=function(n){var i=a.createSymbol(1,e.escapeLeadingUnderscores("arg".concat(n)));i.type=f(t.map((function(e){return e.argumentTypes[n]||a.getUndefinedType()}))),t.some((function(e){return void 0===e.argumentTypes[n]}))&&(i.flags|=16777216),r.push(i);},o=0;o<n;o++)i(o);var s=p(c(t.map((function(e){return e.return_}))));return a.createSignature(void 0,void 0,void 0,r,s,void 0,n,0)}function h(e,t){!t||1&t.flags||131072&t.flags||(e.candidateTypes||(e.candidateTypes=[])).push(t);}function b(e,t){!t||1&t.flags||131072&t.flags||(e.candidateThisTypes||(e.candidateThisTypes=[])).push(t);}}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i,s=n.sourceFile,c=n.program,l=n.span.start,u=n.errorCode,_=n.cancellationToken,d=n.host,p=n.preferences,f=e.getTokenAtPosition(s,l),g=e.textChanges.ChangeTracker.with(n,(function(t){i=o(t,s,f,u,c,_,e.returnTrue,d,p);})),m=i&&e.getNameOfDeclaration(i);return m&&0!==g.length?[t.createCodeFixAction(r,g,[a(u,f),e.getTextOfNode(m)],r,e.Diagnostics.Infer_all_types_from_usage)]:void 0},fixIds:[r],getAllCodeActions:function(r){var n=r.sourceFile,a=r.program,s=r.cancellationToken,c=r.host,l=r.preferences,u=e.nodeSeenTracker();return t.codeFixAll(r,i,(function(t,r){o(t,n,e.getTokenAtPosition(r.file,r.start),r.code,a,s,u,c,l);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixReturnTypeInAsyncFunction",n=[e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];function i(t,r,n){if(!e.isInJSFile(t)){var i=e.getTokenAtPosition(t,n),a=e.findAncestor(i,e.isFunctionLikeDeclaration),o=null==a?void 0:a.type;if(o){var s=r.getTypeFromTypeNode(o),c=r.getAwaitedType(s)||r.getVoidType(),l=r.typeToTypeNode(c,o,void 0);return l?{returnTypeNode:o,returnType:s,promisedTypeNode:l,promisedType:c}:void 0}}}function a(t,r,n,i){t.replaceNode(r,n,e.factory.createTypeReferenceNode("Promise",[i]));}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.program,c=n.span,l=s.getTypeChecker(),u=i(o,s.getTypeChecker(),c.start);if(u){var _=u.returnTypeNode,d=u.returnType,p=u.promisedTypeNode,f=u.promisedType,g=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,_,p)}));return [t.createCodeFixAction(r,g,[e.Diagnostics.Replace_0_with_Promise_1,l.typeToString(d),l.typeToString(f)],r,e.Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,e.program.getTypeChecker(),r.start);n&&a(t,r.file,n.returnTypeNode,n.promisedTypeNode);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="disableJsDiagnostics",n="disableJsDiagnostics",i=e.mapDefined(Object.keys(e.Diagnostics),(function(t){var r=e.Diagnostics[t];return r.category===e.DiagnosticCategory.Error?r.code:void 0}));function a(t,r,n,i){var a=e.getLineAndCharacterOfPosition(r,n).line;i&&!e.tryAddToSet(i,a)||t.insertCommentBeforeLine(r,a,n," @ts-ignore");}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.sourceFile,s=i.program,c=i.span,l=i.host,u=i.formatContext;if(e.isInJSFile(o)&&e.isCheckJsEnabledForFile(o,s.getCompilerOptions())){var _=o.checkJsDirective?"":e.getNewLineOrDefaultFromHost(l,u.options),d=[t.createCodeFixActionWithoutFixAll(r,[t.createFileTextChanges(o.fileName,[e.createTextChange(o.checkJsDirective?e.createTextSpanFromBounds(o.checkJsDirective.pos,o.checkJsDirective.end):e.createTextSpan(0,0),"// @ts-nocheck".concat(_))])],e.Diagnostics.Disable_checking_for_this_file)];return e.textChanges.isValidLocationToAddComment(o,c.start)&&d.unshift(t.createCodeFixAction(r,e.textChanges.ChangeTracker.with(i,(function(e){return a(e,o,c.start)})),e.Diagnostics.Ignore_this_error_message,n,e.Diagnostics.Add_ts_ignore_to_all_error_messages)),d}},fixIds:[n],getAllCodeActions:function(r){var n=new e.Set;return t.codeFixAll(r,i,(function(t,r){e.textChanges.isValidLocationToAddComment(r.file,r.start)&&a(t,r.file,r.start,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return {trackSymbol:function(){return !1},moduleResolverHost:e.getModuleSpecifierResolverHost(t.program,t.host)}}function n(t,n,a,o,s,c,l,d,p,f){var g;void 0===p&&(p=3),void 0===f&&(f=!1);var y=t.getDeclarations(),h=null==y?void 0:y[0],b=o.program.getTypeChecker(),x=e.getEmitScriptTarget(o.program.getCompilerOptions()),D=null!==(g=null==h?void 0:h.kind)&&void 0!==g?g:168,S=e.getSynthesizedDeepClone(e.getNameOfDeclaration(h),!1),T=h?e.getEffectiveModifierFlags(h):0,C=4&T?4:16&T?16:0;h&&e.isAutoAccessorPropertyDeclaration(h)&&(C|=128);var E=C?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(C)):void 0,k=b.getWidenedType(b.getTypeOfSymbolAtLocation(t,n)),N=!!(16777216&t.flags),A=!!(16777216&n.flags)||f,F=e.getQuotePreference(a,s);switch(D){case 168:case 169:var P=0===F?268435456:void 0,w=b.typeToTypeNode(k,n,P,r(o));c&&(I=m(w,x))&&(w=I.typeNode,v(c,I.symbols)),l(e.factory.createPropertyDeclaration(E,h?W(S):t.getName(),N&&2&p?e.factory.createToken(57):void 0,w,void 0));break;case 174:case 175:e.Debug.assertIsDefined(y);var I,O=b.typeToTypeNode(k,n,void 0,r(o)),M=e.getAllAccessorDeclarations(y,h),L=M.secondAccessor?[M.firstAccessor,M.secondAccessor]:[M.firstAccessor];c&&(I=m(O,x))&&(O=I.typeNode,v(c,I.symbols));for(var R=0,B=L;R<B.length;R++){var j=B[R];if(e.isGetAccessorDeclaration(j))l(e.factory.createGetAccessorDeclaration(E,W(S),e.emptyArray,G(O),H(d,F,A)));else {e.Debug.assertNode(j,e.isSetAccessorDeclaration,"The counterpart to a getter should be a setter");var J=e.getSetAccessorValueParameter(j),z=J&&e.isIdentifier(J.name)?e.idText(J.name):void 0;l(e.factory.createSetAccessorDeclaration(E,W(S),u(1,[z],[G(O)],1,!1),H(d,F,A)));}}break;case 170:case 171:e.Debug.assertIsDefined(y);var U=k.isUnion()?e.flatMap(k.types,(function(e){return e.getCallSignatures()})):k.getCallSignatures();if(!e.some(U))break;if(1===y.length){e.Debug.assert(1===U.length,"One declaration implies one signature"),q(F,U[0],E,W(S),H(d,F,A));break}for(var K=0,V=U;K<V.length;K++)q(F,V[K],E,W(S));A||(y.length>U.length?q(F,b.getSignatureFromDeclaration(y[y.length-1]),E,W(S),H(d,F)):(e.Debug.assert(y.length===U.length,"Declarations and signatures should match count"),l(function(t,n,i,a,o,s,c,l,d){for(var p=a[0],f=a[0].minArgumentCount,g=!1,m=0,y=a;m<y.length;m++){var v=y[m];f=Math.min(v.minArgumentCount,f),e.signatureHasRestParameter(v)&&(g=!0),v.parameters.length>=p.parameters.length&&(!e.signatureHasRestParameter(v)||e.signatureHasRestParameter(p))&&(p=v);}var h=p.parameters.length-(e.signatureHasRestParameter(p)?1:0),b=p.parameters.map((function(e){return e.name})),x=u(h,b,void 0,f,!1);if(g){var D=e.factory.createParameterDeclaration(void 0,e.factory.createToken(25),b[h]||"rest",h>=f?e.factory.createToken(57):void 0,e.factory.createArrayTypeNode(e.factory.createKeywordTypeNode(157)),void 0);x.push(D);}return function(t,r,n,i,a,o,s,c){return e.factory.createMethodDeclaration(t,void 0,r,n?e.factory.createToken(57):void 0,void 0,a,o,c||_(s))}(c,o,s,0,x,function(t,n,i,a){if(e.length(t)){var o=n.getUnionType(e.map(t,n.getReturnTypeOfSignature));return n.typeToTypeNode(o,a,void 0,r(i))}}(a,t,n,i),l,d)}(b,o,n,U,W(S),N&&!!(1&p),E,F,d))));}function q(e,t,r,a,s){var u=i(171,o,e,t,s,a,r,N&&!!(1&p),n,c);u&&l(u);}function W(t){return e.getSynthesizedDeepClone(t,!1)}function H(t,r,n){return n?void 0:e.getSynthesizedDeepClone(t,!1)||_(r)}function G(t){return e.getSynthesizedDeepClone(t,!1)}}function i(t,n,i,a,o,s,c,l,u,_){var d=n.program,p=d.getTypeChecker(),f=e.getEmitScriptTarget(d.getCompilerOptions()),g=524545|(0===i?268435456:0),y=p.signatureToSignatureDeclaration(a,t,u,g,r(n));if(y){var h=y.typeParameters,b=y.parameters,x=y.type;if(_){if(h){var D=e.sameMap(h,(function(t){var r,n=t.constraint,i=t.default;return n&&(r=m(n,f))&&(n=r.typeNode,v(_,r.symbols)),i&&(r=m(i,f))&&(i=r.typeNode,v(_,r.symbols)),e.factory.updateTypeParameterDeclaration(t,t.modifiers,t.name,n,i)}));h!==D&&(h=e.setTextRange(e.factory.createNodeArray(D,h.hasTrailingComma),h));}var S=e.sameMap(b,(function(t){var r=m(t.type,f),n=t.type;return r&&(n=r.typeNode,v(_,r.symbols)),e.factory.updateParameterDeclaration(t,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,n,t.initializer)}));if(b!==S&&(b=e.setTextRange(e.factory.createNodeArray(S,b.hasTrailingComma),b)),x){var T=m(x,f);T&&(x=T.typeNode,v(_,T.symbols));}}var C=l?e.factory.createToken(57):void 0,E=y.asteriskToken;return e.isFunctionExpression(y)?e.factory.updateFunctionExpression(y,c,y.asteriskToken,e.tryCast(s,e.isIdentifier),h,b,x,null!=o?o:y.body):e.isArrowFunction(y)?e.factory.updateArrowFunction(y,c,h,b,x,y.equalsGreaterThanToken,null!=o?o:y.body):e.isMethodDeclaration(y)?e.factory.updateMethodDeclaration(y,c,E,null!=s?s:e.factory.createIdentifier(""),C,h,b,x,o):e.isFunctionDeclaration(y)?e.factory.updateFunctionDeclaration(y,c,y.asteriskToken,e.tryCast(s,e.isIdentifier),h,b,x,null!=o?o:y.body):void 0}}function a(e){return 84+e<=90?String.fromCharCode(84+e):"T".concat(e)}function o(t,r,n,i,a,o,s){var c=t.typeToTypeNode(n,i,o,s);if(c&&e.isImportTypeNode(c)){var l=m(c,a);l&&(v(r,l.symbols),c=l.typeNode);}return e.getSynthesizedDeepClone(c)}function s(e){return e.isUnionOrIntersection()?e.types.some(s):262144&e.flags}function c(t,r,n,i,c,u,_){for(var d,p=[],f=new e.Map,g=0;g<n.length;g+=1){var m=n[g];if(m.isUnionOrIntersection()&&m.types.some(s)){var y=a(g);p.push(e.factory.createTypeReferenceNode(y)),f.set(y,void 0);}else {var v=t.getBaseTypeOfLiteralType(m),h=o(t,r,v,i,c,u,_);if(h){p.push(h);var b=l(m),x=!m.isTypeParameter()||!m.constraint||524288&(d=m.constraint).flags&&16===d.objectFlags?void 0:o(t,r,m.constraint,i,c,u,_);b&&f.set(b,{argumentType:m,constraint:x});}}}return {argumentTypeNodes:p,argumentTypeParameters:e.arrayFrom(f.entries())}}function l(e){var t;if(3145728&e.flags)for(var r=0,n=e.types;r<n.length;r++){var i=l(n[r]);if(i)return i}return 262144&e.flags?null===(t=e.getSymbol())||void 0===t?void 0:t.getName():void 0}function u(t,r,n,i,a){for(var o=[],s=new e.Map,c=0;c<t;c++){var l=(null==r?void 0:r[c])||"arg".concat(c),u=s.get(l);s.set(l,(u||0)+1);var _=e.factory.createParameterDeclaration(void 0,void 0,l+(u||""),void 0!==i&&c>=i?e.factory.createToken(57):void 0,a?void 0:(null==n?void 0:n[c])||e.factory.createKeywordTypeNode(157),void 0);o.push(_);}return o}function _(t){return d(e.Diagnostics.Method_not_implemented.message,t)}function d(t,r){return e.factory.createBlock([e.factory.createThrowStatement(e.factory.createNewExpression(e.factory.createIdentifier("Error"),void 0,[e.factory.createStringLiteral(t,0===r)]))],!0)}function p(t,r,n){var i=e.getTsConfigObjectLiteralExpression(r);if(i){var a=g(i,"compilerOptions");if(void 0!==a){var o=a.initializer;if(e.isObjectLiteralExpression(o))for(var s=0,c=n;s<c.length;s++){var l=c[s],u=l[0],_=l[1],d=g(o,u);void 0===d?t.insertNodeAtObjectStart(r,o,f(u,_)):t.replaceNode(r,d.initializer,_);}}else t.insertNodeAtObjectStart(r,i,f("compilerOptions",e.factory.createObjectLiteralExpression(n.map((function(e){return f(e[0],e[1])})),!0)));}}function f(t,r){return e.factory.createPropertyAssignment(e.factory.createStringLiteral(t),r)}function g(t,r){return e.find(t.properties,(function(t){return e.isPropertyAssignment(t)&&!!t.name&&e.isStringLiteral(t.name)&&t.name.text===r}))}function m(t,r){var n,i=e.visitNode(t,(function t(i){var a;if(e.isLiteralImportTypeNode(i)&&i.qualifier){var o=e.getFirstIdentifier(i.qualifier),s=e.getNameForExportedSymbol(o.symbol,r),c=s!==o.text?y(i.qualifier,e.factory.createIdentifier(s)):i.qualifier;n=e.append(n,o.symbol);var l=null===(a=i.typeArguments)||void 0===a?void 0:a.map(t);return e.factory.createTypeReferenceNode(c,l)}return e.visitEachChild(i,t,e.nullTransformationContext)}));if(n&&i)return {typeNode:i,symbols:n}}function y(t,r){return 79===t.kind?r:e.factory.createQualifiedName(y(t.left,r),t.right)}function v(e,t){t.forEach((function(t){return e.addImportFromExportedSymbol(t,!0)}));}var h;t.createMissingMemberNodes=function(e,t,r,i,a,o,s){for(var c=e.symbol.members,l=0,u=t;l<u.length;l++){var _=u[l];c.has(_.escapedName)||n(_,e,r,i,a,o,s,void 0);}},t.getNoopSymbolTrackerWithResolver=r,(h=t.PreserveOptionalFlags||(t.PreserveOptionalFlags={}))[h.Method=1]="Method",h[h.Property=2]="Property",h[h.All=3]="All",t.addNewNodeForMemberSymbol=n,t.createSignatureDeclarationFromSignature=i,t.createSignatureDeclarationFromCallExpression=function(t,n,i,o,s,l,p){var f=e.getQuotePreference(n.sourceFile,n.preferences),g=e.getEmitScriptTarget(n.program.getCompilerOptions()),m=r(n),y=n.program.getTypeChecker(),v=e.isInJSFile(p),h=o.typeArguments,b=o.arguments,x=o.parent,D=v?void 0:y.getContextualType(o),S=e.map(b,(function(t){return e.isIdentifier(t)?t.text:e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)?t.name.text:void 0})),T=v?[]:e.map(b,(function(e){return y.getTypeAtLocation(e)})),C=c(y,i,T,p,g,void 0,m),E=C.argumentTypeNodes,k=C.argumentTypeParameters,N=l?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(l)):void 0,A=e.isYieldExpression(x)?e.factory.createToken(41):void 0,F=v?void 0:function(t,r,n){var i=new e.Set(r.map((function(e){return e[0]}))),o=new e.Map(r);if(n)for(var s=n.filter((function(e){return !r.some((function(r){var n;return t.getTypeAtLocation(e)===(null===(n=r[1])||void 0===n?void 0:n.argumentType)}))})),c=i.size+s.length,l=0;i.size<c;l+=1)i.add(a(l));return e.map(e.arrayFrom(i.values()),(function(t){var r;return e.factory.createTypeParameterDeclaration(void 0,t,null===(r=o.get(t))||void 0===r?void 0:r.constraint)}))}(y,k,h),P=u(b.length,S,E,void 0,v),w=v||void 0===D?void 0:y.typeToTypeNode(D,p,void 0,m);switch(t){case 171:return e.factory.createMethodDeclaration(N,A,s,void 0,F,P,w,_(f));case 170:return e.factory.createMethodSignature(N,s,void 0,F,P,void 0===w?e.factory.createKeywordTypeNode(157):w);case 259:return e.factory.createFunctionDeclaration(N,A,s,F,P,w,d(e.Diagnostics.Function_not_implemented.message,f));default:e.Debug.fail("Unexpected kind");}},t.typeToAutoImportableTypeNode=o,t.getArgumentTypesAndTypeParameters=c,t.createStubbedBody=d,t.setJsonCompilerOptionValues=p,t.setJsonCompilerOptionValue=function(e,t,r,n){p(e,t,[[r,n]]);},t.createJsonPropertyAssignment=f,t.findJsonProperty=g,t.tryGetAutoImportableReferenceFromTypeNode=m,t.importSymbols=v,t.findAncestorMatchingSpan=function(t,r){for(var n=e.textSpanEnd(r),i=e.getTokenAtPosition(t,r.start);i.end<n;)i=i.parent;return i};}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return e.isParameterPropertyDeclaration(t,t.parent)||e.isPropertyDeclaration(t)||e.isPropertyAssignment(t)}function i(t,r){return e.isIdentifier(r)?e.factory.createIdentifier(t):e.factory.createStringLiteral(t)}function a(t,r,n){var i=r?n.name:e.factory.createThis();return e.isIdentifier(t)?e.factory.createPropertyAccessExpression(i,t):e.factory.createElementAccessExpression(i,e.factory.createStringLiteralFromNode(t))}function o(t,n,a,o,s){void 0===s&&(s=!0);var l=e.getTokenAtPosition(t,a),u=a===o&&s,_=e.findAncestor(l.parent,r);if(!_||!e.nodeOverlapsWithStartEnd(_.name,t,a,o)&&!u)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_property_for_which_to_generate_accessor)};if(!function(t){return e.isIdentifier(t)||e.isStringLiteral(t)}(_.name))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Name_is_not_valid)};if(124!=(126975&e.getEffectiveModifierFlags(_)|124))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_property_with_modifier)};var d=_.name.text,p=e.startsWithUnderscore(d),f=i(p?d:e.getUniqueName("_".concat(d),t),_.name),g=i(p?e.getUniqueName(d.substring(1),t):d,_.name);return {isStatic:e.hasStaticModifier(_),isReadonly:e.hasEffectiveReadonlyModifier(_),type:c(_,n),container:166===_.kind?_.parent.parent:_.parent,originalName:_.name.text,declaration:_,fieldName:f,accessorName:g,renameAccessor:p}}function s(t,r,n,i,a){e.isParameterPropertyDeclaration(i,i.parent)?t.insertMemberAtStart(r,a,n):e.isPropertyAssignment(i)?t.insertNodeAfterComma(r,i,n):t.insertNodeAfter(r,i,n);}function c(t,r){var i=e.getTypeAnnotationNode(t);if(e.isPropertyDeclaration(t)&&i&&t.questionToken){var a=r.getTypeChecker(),o=a.getTypeFromTypeNode(i);if(!a.isTypeAssignableTo(a.getUndefinedType(),o)){var s=e.isUnionTypeNode(i)?i.types:[i];return e.factory.createUnionTypeNode(n$4(n$4([],s,!0),[e.factory.createKeywordTypeNode(155)],!1))}}return i}t.generateAccessorFromProperty=function(t,r,n,i,c,l){var u=o(t,r,n,i);if(u&&!e.refactor.isRefactorErrorInfo(u)){var _,d,p=e.textChanges.ChangeTracker.fromContext(c),f=u.isStatic,g=u.isReadonly,m=u.fieldName,y=u.accessorName,v=u.originalName,h=u.type,b=u.container,x=u.declaration;if(e.suppressLeadingAndTrailingTrivia(m),e.suppressLeadingAndTrailingTrivia(y),e.suppressLeadingAndTrailingTrivia(x),e.suppressLeadingAndTrailingTrivia(b),e.isClassLike(b)){var D=e.getEffectiveModifierFlags(x);if(e.isSourceFileJS(t)){var S=e.factory.createModifiersFromModifierFlags(D);_=S,d=S;}else _=e.factory.createModifiersFromModifierFlags(function(e){return e&=-65,16&(e&=-9)||(e|=4),e}(D)),d=e.factory.createModifiersFromModifierFlags(function(e){return e&=-5,e&=-17,e|=8}(D));e.canHaveDecorators(x)&&(d=e.concatenate(e.getDecorators(x),d));}!function(t,r,n,i,a,o){e.isPropertyDeclaration(n)?function(t,r,n,i,a,o){var s=e.factory.updatePropertyDeclaration(n,o,a,n.questionToken||n.exclamationToken,i,n.initializer);t.replaceNode(r,n,s);}(t,r,n,i,a,o):e.isPropertyAssignment(n)?function(t,r,n,i){var a=e.factory.updatePropertyAssignment(n,i,n.initializer);t.replacePropertyAssignment(r,n,a);}(t,r,n,a):t.replaceNode(r,n,e.factory.updateParameterDeclaration(n,o,n.dotDotDotToken,e.cast(a,e.isIdentifier),n.questionToken,n.type,n.initializer));}(p,t,x,h,m,d);var T=function(t,r,n,i,o,s){return e.factory.createGetAccessorDeclaration(i,r,void 0,n,e.factory.createBlock([e.factory.createReturnStatement(a(t,o,s))],!0))}(m,y,h,_,f,b);if(e.suppressLeadingAndTrailingTrivia(T),s(p,t,T,x,b),g){var C=e.getFirstConstructorWithBody(b);C&&function(t,r,n,i,a){n.body&&n.body.forEachChild((function n(o){e.isElementAccessExpression(o)&&108===o.expression.kind&&e.isStringLiteral(o.argumentExpression)&&o.argumentExpression.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.argumentExpression,e.factory.createStringLiteral(i)),e.isPropertyAccessExpression(o)&&108===o.expression.kind&&o.name.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.name,e.factory.createIdentifier(i)),e.isFunctionLike(o)||e.isClassLike(o)||o.forEachChild(n);}));}(p,t,C,m.text,v);}else {var E=function(t,r,n,i,o,s){return e.factory.createSetAccessorDeclaration(i,r,[e.factory.createParameterDeclaration(void 0,void 0,e.factory.createIdentifier("value"),void 0,n)],e.factory.createBlock([e.factory.createExpressionStatement(e.factory.createAssignment(a(t,o,s),e.factory.createIdentifier("value")))],!0))}(m,y,h,_,f,b);e.suppressLeadingAndTrailingTrivia(E),s(p,t,E,x,b);}return p.getChanges()}},t.getAccessorConvertiblePropertyAtPosition=o,t.getAllSupers=function(t,r){for(var n=[];t;){var i=e.getClassExtendsHeritageElement(t),a=i&&r.getSymbolAtLocation(i.expression);if(!a)break;var o=2097152&a.flags?r.getAliasedSymbol(a):a,s=o.declarations&&e.find(o.declarations,e.isClassLike);if(!s)break;n.push(s),t=s;}return n};}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="invalidImportSyntax";function n(n,i,a,o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return e.replaceNode(i,a,o)}));return t.createCodeFixActionWithoutFixAll(r,s,[e.Diagnostics.Replace_import_with_0,s[0].textChanges[0].newText])}function i(i,a){var o=i.program.getTypeChecker().getTypeAtLocation(a);if(!o.symbol||!o.symbol.originatingImport)return [];var s=[],c=o.symbol.originatingImport;if(e.isImportCall(c)||e.addRange(s,function(t,r){var i=e.getSourceFileOfNode(r),a=e.getNamespaceDeclarationNode(r),o=t.program.getCompilerOptions(),s=[];return s.push(n(t,i,r,e.makeImport(a.name,void 0,r.moduleSpecifier,e.getQuotePreference(i,t.preferences)))),e.getEmitModuleKind(o)===e.ModuleKind.CommonJS&&s.push(n(t,i,r,e.factory.createImportEqualsDeclaration(void 0,!1,a.name,e.factory.createExternalModuleReference(r.moduleSpecifier)))),s}(i,c)),e.isExpression(a)&&(!e.isNamedDeclaration(a.parent)||a.parent.name!==a)){var l=i.sourceFile,u=e.textChanges.ChangeTracker.with(i,(function(t){return t.replaceNode(l,a,e.factory.createPropertyAccessExpression(a,"default"),{})}));s.push(t.createCodeFixActionWithoutFixAll(r,u,e.Diagnostics.Use_synthetic_default_member));}return s}t.registerCodeFix({errorCodes:[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],getCodeActions:function(t){var r=t.sourceFile,n=e.Diagnostics.This_expression_is_not_callable.code===t.errorCode?210:211,a=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.kind===n}));return a?i(t,a.expression):[]}}),t.registerCodeFix({errorCodes:[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,e.Diagnostics.Type_predicate_0_is_not_assignable_to_1.code,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code,e.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:function(t){var r=t.sourceFile,n=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.getStart()===t.span.start&&e.getEnd()===t.span.start+t.span.length}));return n?i(t,n):[]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="strictClassInitialization",n="addMissingPropertyDefiniteAssignmentAssertions",i="addMissingPropertyUndefinedType",a="addMissingPropertyInitializer",o=[e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];function s(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)&&e.isPropertyDeclaration(n.parent)){var i=e.getEffectiveTypeAnnotationNode(n.parent);if(i)return {type:i,prop:n.parent,isJs:e.isInJSFile(n.parent)}}}function c(t,r,n){e.suppressLeadingAndTrailingTrivia(n);var i=e.factory.updatePropertyDeclaration(n,n.modifiers,n.name,e.factory.createToken(53),n.type,n.initializer);t.replaceNode(r,n,i);}function l(t,r,n){var i=e.factory.createKeywordTypeNode(155),a=e.isUnionTypeNode(n.type)?n.type.types.concat(i):[n.type,i],o=e.factory.createUnionTypeNode(a);n.isJs?t.addJSDocTags(r,n.prop,[e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(o))]):t.replaceNode(r,n.type,o);}function u(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.factory.updatePropertyDeclaration(n,n.modifiers,n.name,n.questionToken,n.type,i);t.replaceNode(r,n,a);}function _(e,t){return d(e,e.getTypeFromTypeNode(t.type))}function d(t,r){if(512&r.flags)return r===t.getFalseType()||r===t.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(r.isStringLiteral())return e.factory.createStringLiteral(r.value);if(r.isNumberLiteral())return e.factory.createNumericLiteral(r.value);if(2048&r.flags)return e.factory.createBigIntLiteral(r.value);if(r.isUnion())return e.firstDefined(r.types,(function(e){return d(t,e)}));if(r.isClass()){var n=e.getClassLikeDeclarationOfSymbol(r.symbol);if(!n||e.hasSyntacticModifier(n,256))return;var i=e.getFirstConstructorWithBody(n);if(i&&i.parameters.length)return;return e.factory.createNewExpression(e.factory.createIdentifier(r.symbol.name),void 0,void 0)}return t.isArrayLikeType(r)?e.factory.createArrayLiteralExpression():void 0}t.registerCodeFix({errorCodes:o,getCodeActions:function(o){var d=s(o.sourceFile,o.span.start);if(d){var p=[];return e.append(p,function(n,a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return l(e,n.sourceFile,a)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_undefined_type_to_property_0,a.prop.name.getText()],i,e.Diagnostics.Add_undefined_type_to_all_uninitialized_properties)}(o,d)),e.append(p,function(i,a){if(!a.isJs){var o=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,i.sourceFile,a.prop)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_definite_assignment_assertion_to_property_0,a.prop.getText()],n,e.Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties)}}(o,d)),e.append(p,function(n,i){if(!i.isJs){var o=_(n.program.getTypeChecker(),i.prop);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return u(e,n.sourceFile,i.prop,o)}));return t.createCodeFixAction(r,s,[e.Diagnostics.Add_initializer_to_property_0,i.prop.name.getText()],a,e.Diagnostics.Add_initializers_to_all_uninitialized_properties)}}}(o,d)),p}},fixIds:[n,i,a],getAllCodeActions:function(r){return t.codeFixAll(r,o,(function(t,o){var d=s(o.file,o.start);if(d)switch(r.fixId){case n:c(t,o.file,d.prop);break;case i:l(t,o.file,d);break;case a:var p=_(r.program.getTypeChecker(),d.prop);if(!p)return;u(t,o.file,d.prop,p);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="requireInTs",n=[e.Diagnostics.require_call_may_be_converted_to_an_import.code];function i(t,r,n){var i=n.allowSyntheticDefaults,a=n.defaultImportName,o=n.namedImports,s=n.statement,c=n.required;t.replaceNode(r,s,a&&!i?e.factory.createImportEqualsDeclaration(void 0,!1,a,e.factory.createExternalModuleReference(c)):e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,a,o),c,void 0));}function a(t,r,n){var i=e.getTokenAtPosition(t,n).parent;if(!e.isRequireCall(i,!0))throw e.Debug.failBadSyntaxKind(i);var a=e.cast(i.parent,e.isVariableDeclaration),o=e.tryCast(a.name,e.isIdentifier),s=e.isObjectBindingPattern(a.name)?function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];if(!e.isIdentifier(a.name)||a.initializer)return;r.push(e.factory.createImportSpecifier(!1,e.tryCast(a.propertyName,e.isIdentifier),a.name));}if(r.length)return e.factory.createNamedImports(r)}(a.name):void 0;if(o||s)return {allowSyntheticDefaults:e.getAllowSyntheticDefaultImports(r.getCompilerOptions()),defaultImportName:o,namedImports:s,statement:e.cast(a.parent.parent,e.isVariableStatement),required:e.first(i.arguments)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.program,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Convert_require_to_import,r,e.Diagnostics.Convert_all_require_to_import)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=a(r.file,e.program,r.start);n&&i(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useDefaultImport",n=[e.Diagnostics.Import_may_be_converted_to_a_default_import.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=n.parent;if(e.isImportEqualsDeclaration(i)&&e.isExternalModuleReference(i.moduleReference))return {importNode:i,name:n,moduleSpecifier:i.moduleReference.expression};if(e.isNamespaceImport(i)){var a=i.parent.parent;return {importNode:a,name:n,moduleSpecifier:a.moduleSpecifier}}}}function a(t,r,n,i){t.replaceNode(r,n.importNode,e.makeImport(n.name,void 0,n.moduleSpecifier,e.getQuotePreference(r,i)));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span.start,c=i(o,s);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,n.preferences)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Convert_to_default_import,r,e.Diagnostics.Convert_all_to_default_imports)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,r.file,n,e.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useBigintLiteral",n=[e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),e.isNumericLiteral);if(i){var a=i.getText(r)+"n";t.replaceNode(r,i,e.factory.createBigIntLiteral(a));}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_to_a_bigint_numeric_literal,r,e.Diagnostics.Convert_all_to_bigint_numeric_literals)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAddModuleReferTypeMissingTypeof",n=[e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(100===n.kind,"This token should be an ImportKeyword"),e.Debug.assert(202===n.parent.kind,"Token parent should be an ImportType"),n.parent}function a(t,r,n){var i=e.factory.updateImportTypeNode(n,n.argument,n.assertions,n.qualifier,n.typeArguments,!0);t.replaceNode(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_typeof,r,e.Diagnostics.Add_missing_typeof)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="wrapJsxInFragment",n=[e.Diagnostics.JSX_expressions_must_have_one_parent_element.code];function i(t,r){var n=e.getTokenAtPosition(t,r).parent.parent;if((e.isBinaryExpression(n)||(n=n.parent,e.isBinaryExpression(n)))&&e.nodeIsMissing(n.operatorToken))return n}function a(t,r,n){var i=function(t){for(var r=[],n=t;;){if(e.isBinaryExpression(n)&&e.nodeIsMissing(n.operatorToken)&&27===n.operatorToken.kind){if(r.push(n.left),e.isJsxChild(n.right))return r.push(n.right),r;if(e.isBinaryExpression(n.right)){n=n.right;continue}return}return}}(n);i&&t.replaceNode(r,n,e.factory.createJsxFragment(e.factory.createJsxOpeningFragment(),i,e.factory.createJsxJsxClosingFragment()));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_in_JSX_fragment,r,e.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(e.sourceFile,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixConvertToMappedObjectType",i=[e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function a(t,r){var n=e.getTokenAtPosition(t,r),i=e.tryCast(n.parent.parent,e.isIndexSignatureDeclaration);if(i){var a=e.isInterfaceDeclaration(i.parent)?i.parent:e.tryCast(i.parent.parent,e.isTypeAliasDeclaration);if(a)return {indexSignature:i,container:a}}}function o(t,r,i){var a,o,s=i.indexSignature,c=i.container,l=(e.isInterfaceDeclaration(c)?c.members:c.type.members).filter((function(t){return !e.isIndexSignatureDeclaration(t)})),u=e.first(s.parameters),_=e.factory.createTypeParameterDeclaration(void 0,e.cast(u.name,e.isIdentifier),u.type),d=e.factory.createMappedTypeNode(e.hasEffectiveReadonlyModifier(s)?e.factory.createModifier(146):void 0,_,void 0,s.questionToken,s.type,void 0),p=e.factory.createIntersectionTypeNode(n$4(n$4(n$4([],e.getAllSuperTypeNodes(c),!0),[d],!1),l.length?[e.factory.createTypeLiteralNode(l)]:e.emptyArray,!0));t.replaceNode(r,c,(a=c,o=p,e.factory.createTypeAliasDeclaration(a.modifiers,a.name,a.typeParameters,o)));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=n.span,c=a(i,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,c)})),u=e.idText(c.container.name);return [t.createCodeFixAction(r,l,[e.Diagnostics.Convert_0_to_mapped_object_type,u],r,[e.Diagnostics.Convert_0_to_mapped_object_type,u])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(e,t){var r=a(t.file,t.start);r&&o(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="removeAccidentalCallParentheses",n=[e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=e.findAncestor(e.getTokenAtPosition(n.sourceFile,n.span.start),e.isCallExpression);if(i){var a=e.textChanges.ChangeTracker.with(n,(function(e){e.deleteRange(n.sourceFile,{pos:i.expression.end,end:i.end});}));return [t.createCodeFixActionWithoutFixAll(r,a,e.Diagnostics.Remove_parentheses)]}},fixIds:[r]});}(t),function(e){!function(t){var r="removeUnnecessaryAwait",n=[e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),(function(e){return 133===e.kind})),a=i&&e.tryCast(i.parent,e.isAwaitExpression);if(a){var o=a;if(e.isParenthesizedExpression(a.parent)){var s=e.getLeftmostExpression(a.expression,!1);if(e.isIdentifier(s)){var c=e.findPrecedingToken(a.parent.pos,r);c&&103!==c.kind&&(o=a.parent);}}t.replaceNode(r,o,a.expression);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unnecessary_await,r,e.Diagnostics.Remove_all_unnecessary_uses_of_await)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],n="splitTypeOnlyImport";function i(t,r){return e.findAncestor(e.getTokenAtPosition(t,r.start),e.isImportDeclaration)}function a(t,r,n){if(r){var i=e.Debug.checkDefined(r.importClause);t.replaceNode(n.sourceFile,r,e.factory.updateImportDeclaration(r,r.modifiers,e.factory.updateImportClause(i,i.isTypeOnly,i.name,void 0),r.moduleSpecifier,r.assertClause)),t.insertNodeAfter(n.sourceFile,r,e.factory.createImportDeclaration(void 0,e.factory.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),r.moduleSpecifier,r.assertClause));}}t.registerCodeFix({errorCodes:r,fixIds:[n],getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.sourceFile,r.span),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Split_into_two_separate_import_declarations,n,e.Diagnostics.Split_all_invalid_type_only_imports)]},getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(e.sourceFile,r),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixConvertConstToLet",n=[e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];function i(t,r,n){var i,a=n.getTypeChecker().getSymbolAtLocation(e.getTokenAtPosition(t,r));if(void 0!==a){var o=e.tryCast(null===(i=null==a?void 0:a.valueDeclaration)||void 0===i?void 0:i.parent,e.isVariableDeclarationList);if(void 0!==o){var s=e.findChildOfKind(o,85,t);if(void 0!==s)return {symbol:a,token:s}}}}function a(t,r,n){t.replaceNode(r,n,e.factory.createToken(119));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=n.program,l=i(o,s.start,c);if(void 0!==l){var u=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l.token)}));return [t.createCodeFixActionMaybeFixAll(r,u,e.Diagnostics.Convert_const_to_let,r,e.Diagnostics.Convert_all_const_to_let)]}},getAllCodeActions:function(r){var o=r.program,s=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,(function(c){t.eachDiagnostic(r,n,(function(t){var r=i(t.file,t.start,o);if(r&&e.addToSeen(s,e.getSymbolId(r.symbol)))return a(c,t.file,r.token)}));})))},fixIds:[r]});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixExpectedComma",n=[e.Diagnostics._0_expected.code];function i(t,r,n){var i=e.getTokenAtPosition(t,r);return 26===i.kind&&i.parent&&(e.isObjectLiteralExpression(i.parent)||e.isArrayLiteralExpression(i.parent))?{node:i}:void 0}function a(t,r,n){var i=n.node,a=e.factory.createToken(27);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Change_0_to_1,";",","],r,[e.Diagnostics.Change_0_to_1,";",","])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addVoidToPromise",n=[e.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n.start);if(e.isIdentifier(o)&&e.isCallExpression(o.parent)&&o.parent.expression===o&&0===o.parent.arguments.length){var s=i.getTypeChecker(),c=s.getSymbolAtLocation(o),l=null==c?void 0:c.valueDeclaration;if(l&&e.isParameter(l)&&e.isNewExpression(l.parent.parent)&&!(null==a?void 0:a.has(l))){null==a||a.add(l);var u=function(t){var r;if(!e.isInJSFile(t))return t.typeArguments;if(e.isParenthesizedExpression(t.parent)){var n=null===(r=e.getJSDocTypeTag(t.parent))||void 0===r?void 0:r.typeExpression.type;if(n&&e.isTypeReferenceNode(n)&&e.isIdentifier(n.typeName)&&"Promise"===e.idText(n.typeName))return n.typeArguments}}(l.parent.parent);if(e.some(u)){var _=u[0],d=!e.isUnionTypeNode(_)&&!e.isParenthesizedTypeNode(_)&&e.isParenthesizedTypeNode(e.factory.createUnionTypeNode([_,e.factory.createKeywordTypeNode(114)]).types[0]);d&&t.insertText(r,_.pos,"("),t.insertText(r,_.end,d?") | void":" | void");}else {var p=s.getResolvedSignature(o.parent),f=null==p?void 0:p.parameters[0],g=f&&s.getTypeOfSymbolAtLocation(f,l.parent.parent);e.isInJSFile(l)?(!g||3&g.flags)&&(t.insertText(r,l.parent.parent.end,")"),t.insertText(r,e.skipTrivia(r.text,l.parent.parent.pos),"/** @type {Promise<void>} */(")):(!g||2&g.flags)&&t.insertText(r,l.parent.parent.expression.end,"<void>");}}}}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span,n.program)}));if(a.length>0)return [t.createCodeFixAction("addVoidToPromise",a,e.Diagnostics.Add_void_to_Promise_resolved_without_a_value,r,e.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){return i(t,n.file,n,r.program,new e.Set)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="Convert export",n={name:"Convert default export to named export",description:e.Diagnostics.Convert_default_export_to_named_export.message,kind:"refactor.rewrite.export.named"},a={name:"Convert named export to default export",description:e.Diagnostics.Convert_named_export_to_default_export.message,kind:"refactor.rewrite.export.default"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=e.getTokenAtPosition(n,a.start),s=o.parent&&1&e.getSyntacticModifierFlags(o.parent)&&r?o.parent:e.getParentNodeInSpan(o,n,a);if(!s||!(e.isSourceFile(s.parent)||e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_export_statement)};var c=i.getTypeChecker(),l=function(t,r){var n=t.parent;if(e.isSourceFile(n))return n.symbol;var i=n.parent.symbol;return i.valueDeclaration&&e.isExternalModuleAugmentation(i.valueDeclaration)?r.getMergedSymbol(i):i}(s,c),u=e.getSyntacticModifierFlags(s)||(e.isExportAssignment(s)&&!s.isExportEquals?1025:0),_=!!(1024&u);if(!(1&u)||!_&&l.exports.has("default"))return {error:e.getLocaleSpecificMessage(e.Diagnostics.This_file_already_has_a_default_export)};var d=function(t){return e.isIdentifier(t)&&c.getSymbolAtLocation(t)?void 0:{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_named_export)}};switch(s.kind){case 259:case 260:case 261:case 263:case 262:case 264:if(!(g=s).name)return;return d(g.name)||{exportNode:g,exportName:g.name,wasDefault:_,exportingModuleSymbol:l};case 240:var p=s;if(!(2&p.declarationList.flags)||1!==p.declarationList.declarations.length)return;var f=e.first(p.declarationList.declarations);if(!f.initializer)return;return e.Debug.assert(!_,"Can't have a default flag here"),d(f.name)||{exportNode:p,exportName:f.name,wasDefault:_,exportingModuleSymbol:l};case 274:var g;if((g=s).isExportEquals)return;return d(g.expression)||{exportNode:g,exportName:g.expression,wasDefault:_,exportingModuleSymbol:l};default:return}}function s(t,r){return e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}function c(t,r){return e.factory.createExportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}t.registerRefactor(r,{kinds:[n.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=c.wasDefault?n:a;return [{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.Diagnostics.Convert_default_export_to_named_export.message,actions:[i$1(i$1({},n),{notApplicableReason:c.error}),i$1(i$1({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,i){e.Debug.assert(i===n.name||i===a.name,"Unexpected action name");var l=o(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u=e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){(function(t,r,n,i){var a=r.wasDefault,o=r.exportNode,s=r.exportName;if(a)if(e.isExportAssignment(o)&&!o.isExportEquals){var l=o.expression,u=c(l.text,l.text);n.replaceNode(t,o,e.factory.createExportDeclaration(void 0,!1,e.factory.createNamedExports([u])));}else n.delete(t,e.Debug.checkDefined(e.findModifier(o,88),"Should find a default keyword in modifier list"));else {var _=e.Debug.checkDefined(e.findModifier(o,93),"Should find an export keyword in modifier list");switch(o.kind){case 259:case 260:case 261:n.insertNodeAfter(t,_,e.factory.createToken(88));break;case 240:var d=e.first(o.declarationList.declarations);if(!e.FindAllReferences.Core.isSymbolReferencedInFile(s,i,t)&&!d.type){n.replaceNode(t,o,e.factory.createExportDefault(e.Debug.checkDefined(d.initializer,"Initializer was previously known to be present")));break}case 263:case 262:case 264:n.deleteModifier(t,_),n.insertNodeAfter(t,o,e.factory.createExportDefault(e.factory.createIdentifier(s.text)));break;default:e.Debug.fail("Unexpected exportNode kind ".concat(o.kind));}}})(t,n,i,r.getTypeChecker()),function(t,r,n,i){var a=r.wasDefault,o=r.exportName,l=r.exportingModuleSymbol,u=t.getTypeChecker(),_=e.Debug.checkDefined(u.getSymbolAtLocation(o),"Export name should resolve to a symbol");e.FindAllReferences.Core.eachExportReference(t.getSourceFiles(),u,i,_,l,o.text,a,(function(t){if(o!==t){var r=t.getSourceFile();a?function(t,r,n,i){var a=r.parent;switch(a.kind){case 208:n.replaceNode(t,r,e.factory.createIdentifier(i));break;case 273:case 278:var o=a;n.replaceNode(t,o,s(i,o.name.text));break;case 270:var c=a;e.Debug.assert(c.name===r,"Import clause name should match provided ref"),o=s(i,r.text);var l=c.namedBindings;if(l)if(271===l.kind){n.deleteRange(t,{pos:r.getStart(t),end:l.getStart(t)});var u=e.isStringLiteral(c.parent.moduleSpecifier)?e.quotePreferenceFromString(c.parent.moduleSpecifier,t):1,_=e.makeImport(void 0,[s(i,r.text)],c.parent.moduleSpecifier,u);n.insertNodeAfter(t,c.parent,_);}else n.delete(t,r),n.insertNodeAtEndOfList(t,l.elements,o);else n.replaceNode(t,r,e.factory.createNamedImports([o]));break;case 202:var d=a;n.replaceNode(t,a,e.factory.createImportTypeNode(d.argument,d.assertions,e.factory.createIdentifier(i),d.typeArguments,d.isTypeOf));break;default:e.Debug.failBadSyntaxKind(a);}}(r,t,n,o.text):function(t,r,n){var i=r.parent;switch(i.kind){case 208:n.replaceNode(t,r,e.factory.createIdentifier("default"));break;case 273:var a=e.factory.createIdentifier(i.name.text);1===i.parent.elements.length?n.replaceNode(t,i.parent,a):(n.delete(t,i),n.insertNodeBefore(t,i.parent,a));break;case 278:n.replaceNode(t,i,c("default",i.name.text));break;default:e.Debug.assertNever(i,"Unexpected parent kind ".concat(i.kind));}}(r,t,n);}}));}(r,n,i,a);}(r.file,r.program,l,t,r.cancellationToken)}));return {edits:u,renameFilename:void 0,renameLocation:void 0}}});}(e.refactor||(e.refactor={}));}(t),function(e){!function(t){var r,n="Convert import",a=((r={})[0]={name:"Convert namespace import to named imports",description:e.Diagnostics.Convert_namespace_import_to_named_imports.message,kind:"refactor.rewrite.import.named"},r[2]={name:"Convert named imports to namespace import",description:e.Diagnostics.Convert_named_imports_to_namespace_import.message,kind:"refactor.rewrite.import.namespace"},r[1]={name:"Convert named imports to default import",description:e.Diagnostics.Convert_named_imports_to_default_import.message,kind:"refactor.rewrite.import.default"},r);function o(t,r){void 0===r&&(r=!0);var n=t.file,i=e.getRefactorContextSpan(t),a=e.getTokenAtPosition(n,i.start),o=r?e.findAncestor(a,e.isImportDeclaration):e.getParentNodeInSpan(a,n,i);if(!o||!e.isImportDeclaration(o))return {error:"Selection is not an import declaration."};var c=i.start+i.length,l=e.findNextToken(o,o.parent,n);if(!(l&&c>l.getStart())){var u=o.importClause;return u?u.namedBindings?271===u.namedBindings.kind?{convertTo:0,import:u.namedBindings}:s(t.program,u)?{convertTo:1,import:u.namedBindings}:{convertTo:2,import:u.namedBindings}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_namespace_import_or_named_imports)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_import_clause)}}}function s(t,r){return e.getAllowSyntheticDefaultImports(t.getCompilerOptions())&&(n=r.parent.moduleSpecifier,i=t.getTypeChecker(),!!(a=i.resolveExternalModuleName(n))&&a!==i.resolveExternalModuleSymbol(a));var n,i,a;}function c(t){return e.isPropertyAccessExpression(t)?t.name:t.right}function l(t,r,n,i,a){void 0===a&&(a=s(r,i.parent));var o=r.getTypeChecker(),c=i.parent.parent,l=c.moduleSpecifier,_=new e.Set;i.elements.forEach((function(e){var t=o.getSymbolAtLocation(e.name);t&&_.add(t);}));for(var d=l&&e.isStringLiteral(l)?e.codefix.moduleSpecifierToValidIdentifier(l.text,99):"module",p=i.elements.some((function(r){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(t){var r=o.resolveName(d,t,67108863,!0);return !!r&&(!_.has(r)||e.isExportSpecifier(t.parent))}))}))?e.getUniqueName(d,t):d,f=new e.Set,g=function(r){var i=(r.propertyName||r.name).text;e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(a){var o=e.factory.createPropertyAccessExpression(e.factory.createIdentifier(p),i);e.isShorthandPropertyAssignment(a.parent)?n.replaceNode(t,a.parent,e.factory.createPropertyAssignment(a.text,o)):e.isExportSpecifier(a.parent)?f.add(r):n.replaceNode(t,a,o);}));},m=0,y=i.elements;m<y.length;m++)g(y[m]);if(n.replaceNode(t,i,a?e.factory.createIdentifier(p):e.factory.createNamespaceImport(e.factory.createIdentifier(p))),f.size){var v=e.arrayFrom(f.values()).map((function(t){return e.factory.createImportSpecifier(t.isTypeOnly,t.propertyName&&e.factory.createIdentifier(t.propertyName.text),e.factory.createIdentifier(t.name.text))}));n.insertNodeAfter(t,i.parent.parent,u(c,void 0,v));}}function u(t,r,n){return e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,r,n&&n.length?e.factory.createNamedImports(n):void 0),t.moduleSpecifier,void 0)}t.registerRefactor(n,{kinds:e.getOwnValues(a).map((function(e){return e.kind})),getAvailableActions:function(r){var s=o(r,"invoked"===r.triggerReason);if(!s)return e.emptyArray;if(!t.isRefactorErrorInfo(s)){var c=a[s.convertTo];return [{name:n,description:c.description,actions:[c]}]}return r.preferences.provideRefactorNotApplicableReason?e.getOwnValues(a).map((function(e){return {name:n,description:e.description,actions:[i$1(i$1({},e),{notApplicableReason:s.error})]}})):e.emptyArray},getEditsForAction:function(r,n){e.Debug.assert(e.some(e.getOwnValues(a),(function(e){return e.name===n})),"Unexpected action name");var i=o(r);e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info");var s=e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i){var a=r.getTypeChecker();0===i.convertTo?function(t,r,n,i,a){var o=!1,s=[],l=new e.Map;e.FindAllReferences.Core.eachSymbolReferenceInFile(i.name,r,t,(function(t){if(e.isPropertyAccessOrQualifiedName(t.parent)){var n=c(t.parent).text;r.resolveName(n,t,67108863,!0)&&l.set(n,!0),e.Debug.assert(function(t){return e.isPropertyAccessExpression(t)?t.expression:t.left}(t.parent)===t,"Parent expression should match id"),s.push(t.parent);}else o=!0;}));for(var _=new e.Map,d=0,p=s;d<p.length;d++){var f=p[d],g=c(f).text,m=_.get(g);void 0===m&&_.set(g,m=l.has(g)?e.getUniqueName(g,t):g),n.replaceNode(t,f,e.factory.createIdentifier(m));}var y=[];_.forEach((function(t,r){y.push(e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(t)));}));var v=i.parent.parent;o&&!a?n.insertNodeAfter(t,v,u(v,void 0,y)):n.replaceNode(t,v,u(v,o?e.factory.createIdentifier(i.name.text):void 0,y));}(t,a,n,i.import,e.getAllowSyntheticDefaultImports(r.getCompilerOptions())):l(t,r,n,i.import,1===i.convertTo);}(r.file,r.program,t,i)}));return {edits:s,renameFilename:void 0,renameLocation:void 0}}}),t.doChangeNamedToNamespaceOrDefault=l;}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Convert to optional chain expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_optional_chain_expression),o={name:n,description:a,kind:"refactor.rewrite.expression.optionalChain"};function s(t){return e.isBinaryExpression(t)||e.isConditionalExpression(t)}function c(t){return s(t)||function(t){return e.isExpressionStatement(t)||e.isReturnStatement(t)||e.isVariableStatement(t)}(t)}function l(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=0===a.length;if(!o||r){var l=e.getTokenAtPosition(n,a.start),d=e.findTokenOnLeftOfPosition(n,a.start+a.length),f=e.createTextSpanFromBounds(l.pos,d&&d.end>=l.pos?d.getEnd():l.getEnd()),g=o?function(e){for(;e.parent;){if(c(e)&&!c(e.parent))return e;e=e.parent;}}(l):function(e,t){for(;e.parent;){if(c(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent;}}(l,f),m=g&&c(g)?function(t){if(s(t))return t;if(e.isVariableStatement(t)){var r=e.getSingleVariableOfVariableStatement(t),n=null==r?void 0:r.initializer;return n&&s(n)?n:void 0}return t.expression&&s(t.expression)?t.expression:void 0}(g):void 0;if(!m)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var y=i.getTypeChecker();return e.isConditionalExpression(m)?function(t,r){var n=t.condition,i=p(t.whenTrue);if(!i||r.isNullableType(r.getTypeAtLocation(i)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};if((e.isPropertyAccessExpression(n)||e.isIdentifier(n))&&_(n,i.expression))return {finalExpression:i,occurrences:[n],expression:t};if(e.isBinaryExpression(n)){var a=u(i.expression,n);return a?{finalExpression:i,occurrences:a,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}}(m,y):function(t){if(55!==t.operatorToken.kind)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_logical_AND_access_chains)};var r=p(t.right);if(!r)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var n=u(r.expression,t.left);return n?{finalExpression:r,occurrences:n,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}(m)}}function u(t,r){for(var n=[];e.isBinaryExpression(r)&&55===r.operatorToken.kind;){var i=_(e.skipParentheses(t),e.skipParentheses(r.right));if(!i)break;n.push(i),t=i,r=r.left;}var a=_(t,r);return a&&n.push(a),n.length>0?n:void 0}function _(t,r){if(e.isIdentifier(r)||e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r))return function(t,r){for(;(e.isCallExpression(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&d(t)!==d(r);)t=t.expression;for(;e.isPropertyAccessExpression(t)&&e.isPropertyAccessExpression(r)||e.isElementAccessExpression(t)&&e.isElementAccessExpression(r);){if(d(t)!==d(r))return !1;t=t.expression,r=r.expression;}return e.isIdentifier(t)&&e.isIdentifier(r)&&t.getText()===r.getText()}(t,r)?r:void 0}function d(t){return e.isIdentifier(t)||e.isStringOrNumericLiteralLike(t)?t.getText():e.isPropertyAccessExpression(t)?d(t.name):e.isElementAccessExpression(t)?d(t.argumentExpression):void 0}function p(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)?p(t.left):(e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)||e.isCallExpression(t))&&!e.isOptionalChain(t)?t:void 0}function f(t,r,n){if(e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r)||e.isCallExpression(r)){var i=f(t,r.expression,n),a=n.length>0?n[n.length-1]:void 0,o=(null==a?void 0:a.getText())===r.expression.getText();if(o&&n.pop(),e.isCallExpression(r))return o?e.factory.createCallChain(i,e.factory.createToken(28),r.typeArguments,r.arguments):e.factory.createCallChain(i,r.questionDotToken,r.typeArguments,r.arguments);if(e.isPropertyAccessExpression(r))return o?e.factory.createPropertyAccessChain(i,e.factory.createToken(28),r.name):e.factory.createPropertyAccessChain(i,r.questionDotToken,r.name);if(e.isElementAccessExpression(r))return o?e.factory.createElementAccessChain(i,e.factory.createToken(28),r.argumentExpression):e.factory.createElementAccessChain(i,r.questionDotToken,r.argumentExpression)}return r}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(r,n){var i=l(r);return e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){var o=i.finalExpression,s=i.occurrences,c=i.expression,l=s[s.length-1],u=f(r,o,s);u&&(e.isPropertyAccessExpression(u)||e.isElementAccessExpression(u)||e.isCallExpression(u))&&(e.isBinaryExpression(c)?n.replaceNodeRange(t,l,o,u):e.isConditionalExpression(c)&&n.replaceNode(t,c,e.factory.createBinaryExpression(u,e.factory.createToken(60),c.whenFalse)));}(r.file,r.program.getTypeChecker(),t,i)})),renameFilename:void 0,renameLocation:void 0}},getAvailableActions:function(r){var s=l(r,"invoked"===r.triggerReason);return s?t.isRefactorErrorInfo(s)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertToOptionalChainExpression||(t.convertToOptionalChainExpression={}));}(t),function(e){var t;(function(r){var n="Convert overload list to single signature",i=e.Diagnostics.Convert_overload_list_to_single_signature.message,a={name:n,description:i,kind:"refactor.rewrite.function.overloadList"};function o(e){switch(e.kind){case 170:case 171:case 176:case 173:case 177:case 259:return !0}return !1}function s(t,r,n){var i=e.getTokenAtPosition(t,r),a=e.findAncestor(i,o);if(a&&!(e.isFunctionLikeDeclaration(a)&&a.body&&e.rangeContainsPosition(a.body,r))){var s=n.getTypeChecker(),c=a.symbol;if(c){var l=c.declarations;if(!(e.length(l)<=1)&&e.every(l,(function(r){return e.getSourceFileOfNode(r)===t}))&&o(l[0])){var u=l[0].kind;if(e.every(l,(function(e){return e.kind===u}))){var _=l;if(!e.some(_,(function(t){return !!t.typeParameters||e.some(t.parameters,(function(t){return !!t.modifiers||!e.isIdentifier(t.name)}))}))){var d=e.mapDefined(_,(function(e){return s.getSignatureFromDeclaration(e)}));if(e.length(d)===e.length(l)){var p=s.getReturnTypeOfSignature(d[0]);if(e.every(d,(function(e){return s.getReturnTypeOfSignature(e)===p})))return _}}}}}}}t.registerRefactor(n,{kinds:[a.kind],getEditsForAction:function(t){var r=t.file,n=t.startPosition,i=t.program,a=s(r,n,i);if(a){var o=i.getTypeChecker(),c=a[a.length-1],l=c;switch(c.kind){case 170:l=e.factory.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,u(a),c.type);break;case 171:l=e.factory.updateMethodDeclaration(c,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,u(a),c.type,c.body);break;case 176:l=e.factory.updateCallSignature(c,c.typeParameters,u(a),c.type);break;case 173:l=e.factory.updateConstructorDeclaration(c,c.modifiers,u(a),c.body);break;case 177:l=e.factory.updateConstructSignature(c,c.typeParameters,u(a),c.type);break;case 259:l=e.factory.updateFunctionDeclaration(c,c.modifiers,c.asteriskToken,c.name,c.typeParameters,u(a),c.type,c.body);break;default:return e.Debug.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(l!==c)return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(t,(function(e){e.replaceNodeRange(r,a[0],a[a.length-1],l);}))}}function u(t){var r=t[t.length-1];return e.isFunctionLikeDeclaration(r)&&r.body&&(t=t.slice(0,t.length-1)),e.factory.createNodeArray([e.factory.createParameterDeclaration(void 0,e.factory.createToken(25),"args",void 0,e.factory.createUnionTypeNode(e.map(t,_)))])}function _(t){var r=e.map(t.parameters,d);return e.setEmitFlags(e.factory.createTupleTypeNode(r),e.some(r,(function(t){return !!e.length(e.getSyntheticLeadingComments(t))}))?0:1)}function d(t){e.Debug.assert(e.isIdentifier(t.name));var r=e.setTextRange(e.factory.createNamedTupleMember(t.dotDotDotToken,t.name,t.questionToken,t.type||e.factory.createKeywordTypeNode(131)),t),n=t.symbol&&t.symbol.getDocumentationComment(o);if(n){var i=e.displayPartsToString(n);i.length&&e.setSyntheticLeadingComments(r,[{text:"*\n".concat(i.split("\n").map((function(e){return " * ".concat(e)})).join("\n"),"\n "),kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}]);}return r}},getAvailableActions:function(t){return s(t.file,t.startPosition,t.program)?[{name:n,description:i,actions:[a]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var n,a,o,s,c="Extract Symbol",l={name:"Extract Constant",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),kind:"refactor.extract.constant"},u={name:"Extract Function",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),kind:"refactor.extract.function"};function _(r){var n=r.kind,a=p(r.file,e.getRefactorContextSpan(r),"invoked"===r.triggerReason),o=a.targetRange;if(void 0===o){if(!a.errors||0===a.errors.length||!r.preferences.provideRefactorNotApplicableReason)return e.emptyArray;var s=[];return t.refactorKindBeginsWith(u.kind,n)&&s.push({name:c,description:u.description,actions:[i$1(i$1({},u),{notApplicableReason:N(a.errors)})]}),t.refactorKindBeginsWith(l.kind,n)&&s.push({name:c,description:l.description,actions:[i$1(i$1({},l),{notApplicableReason:N(a.errors)})]}),s}var _=function(t,r){var n=m(t,r),i=n.scopes,a=n.readsAndWrites,o=a.functionErrorsPerScope,s=a.constantErrorsPerScope,c=i.map((function(t,r){var n,i,a=function(t){return e.isFunctionLikeDeclaration(t)?"inner function":e.isClassLike(t)?"method":"function"}(t),c=function(t){return e.isClassLike(t)?"readonly field":"constant"}(t),l=e.isFunctionLikeDeclaration(t)?function(t){switch(t.kind){case 173:return "constructor";case 215:case 259:return t.name?"function '".concat(t.name.text,"'"):e.ANONYMOUS;case 216:return "arrow function";case 171:return "method '".concat(t.name.getText(),"'");case 174:return "'get ".concat(t.name.getText(),"'");case 175:return "'set ".concat(t.name.getText(),"'");default:throw e.Debug.assertNever(t,"Unexpected scope kind ".concat(t.kind))}}(t):e.isClassLike(t)?function(e){return 260===e.kind?e.name?"class '".concat(e.name.text,"'"):"anonymous class declaration":e.name?"class expression '".concat(e.name.text,"'"):"anonymous class expression"}(t):function(e){return 265===e.kind?"namespace '".concat(e.parent.name.getText(),"'"):e.externalModuleIndicator?0:1}(t);return 1===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"global"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"global"])):0===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"module"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"module"])):(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[a,l]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[c,l])),0!==r||e.isClassLike(t)||(i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_enclosing_scope),[c])),{functionExtraction:{description:n,errors:o[r]},constantExtraction:{description:i,errors:s[r]}}}));return c}(o,r);if(void 0===_)return e.emptyArray;for(var d,f,g=[],y=new e.Map,v=[],h=new e.Map,b=0,x=0,D=_;x<D.length;x++){var S=D[x],T=S.functionExtraction,C=S.constantExtraction;if(t.refactorKindBeginsWith(u.kind,n)){var E=T.description;0===T.errors.length?y.has(E)||(y.set(E,!0),g.push({description:E,name:"function_scope_".concat(b),kind:u.kind})):d||(d={description:E,name:"function_scope_".concat(b),notApplicableReason:N(T.errors),kind:u.kind});}t.refactorKindBeginsWith(l.kind,n)&&(E=C.description,0===C.errors.length?h.has(E)||(h.set(E,!0),v.push({description:E,name:"constant_scope_".concat(b),kind:l.kind})):f||(f={description:E,name:"constant_scope_".concat(b),notApplicableReason:N(C.errors),kind:l.kind})),b++;}var k=[];return g.length?k.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:g}):r.preferences.provideRefactorNotApplicableReason&&d&&k.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:[d]}),v.length?k.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:v}):r.preferences.provideRefactorNotApplicableReason&&f&&k.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:[f]}),k.length?k:e.emptyArray;function N(e){var t=e[0].messageText;return "string"!=typeof t&&(t=t.messageText),t}}function d(t,r){var n=p(t.file,e.getRefactorContextSpan(t)).targetRange,i=/^function_scope_(\d+)$/.exec(r);if(i){var o=+i[1];return e.Debug.assert(isFinite(o),"Expected to parse a finite number from the function scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.functionErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o,s){var c,l,u=n.usages,_=n.typeParameterUsages,d=n.substitutions,p=s.program.getTypeChecker(),f=e.getEmitScriptTarget(s.program.getCompilerOptions()),g=e.codefix.createImportAdder(s.file,s.program,s.preferences,s.host),m=r.getSourceFile(),x=e.getUniqueName(e.isClassLike(r)?"newMethod":"newFunction",m),D=e.isInJSFile(r),T=e.factory.createIdentifier(x),C=[],E=[];u.forEach((function(t,n){var i;if(!D){var a=p.getTypeOfSymbolAtLocation(t.symbol,t.node);a=p.getBaseTypeOfLiteralType(a),i=e.codefix.typeToAutoImportableTypeNode(p,g,a,r,f,1);}var o=e.factory.createParameterDeclaration(void 0,void 0,n,void 0,i);C.push(o),2===t.usage&&(l||(l=[])).push(t),E.push(e.factory.createIdentifier(n));}));var k=e.arrayFrom(_.values()).map((function(e){return {type:e,declaration:y(e)}})).sort(v),N=0===k.length?void 0:k.map((function(e){return e.declaration})),A=void 0!==N?N.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)})):void 0;if(e.isExpression(t)&&!D){var F=p.getContextualType(t);c=p.typeToTypeNode(F,r,1);}var P,w=function(t,r,n,i,a){var o,s=void 0!==n||r.length>0;if(e.isBlock(t)&&!s&&0===i.size)return {body:e.factory.createBlock(t.statements,!0),returnValueProperty:void 0};var c=!1,l=e.factory.createNodeArray(e.isBlock(t)?t.statements.slice(0):[e.isStatement(t)?t:e.factory.createReturnStatement(e.skipParentheses(t))]);if(s||i.size){var u=e.visitNodes(l,(function t(a){if(!c&&e.isReturnStatement(a)&&s){var l=h(r,n);return a.expression&&(o||(o="__return"),l.unshift(e.factory.createPropertyAssignment(o,e.visitNode(a.expression,t)))),1===l.length?e.factory.createReturnStatement(l[0].name):e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(l))}var u=c;c=c||e.isFunctionLikeDeclaration(a)||e.isClassLike(a);var _=i.get(e.getNodeId(a).toString()),d=_?e.getSynthesizedDeepClone(_):e.visitEachChild(a,t,e.nullTransformationContext);return c=u,d})).slice();if(s&&!a&&e.isStatement(t)){var _=h(r,n);1===_.length?u.push(e.factory.createReturnStatement(_[0].name)):u.push(e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(_)));}return {body:e.factory.createBlock(u,!0),returnValueProperty:o}}return {body:e.factory.createBlock(l,!0),returnValueProperty:void 0}}(t,i,l,d,!!(o.facts&a.HasReturn)),I=w.body,O=w.returnValueProperty;e.suppressLeadingAndTrailingTrivia(I);var M=!!(o.facts&a.UsesThisInFunction);if(e.isClassLike(r)){var L=D?[]:[e.factory.createModifier(121)];o.facts&a.InStaticRegion&&L.push(e.factory.createModifier(124)),o.facts&a.IsAsyncFunction&&L.push(e.factory.createModifier(132)),P=e.factory.createMethodDeclaration(L.length?L:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,void 0,N,C,c,I);}else M&&C.unshift(e.factory.createParameterDeclaration(void 0,void 0,"this",void 0,p.typeToTypeNode(p.getTypeAtLocation(o.thisNode),r,1),void 0)),P=e.factory.createFunctionDeclaration(o.facts&a.IsAsyncFunction?[e.factory.createToken(132)]:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,N,C,c,I);var R=e.textChanges.ChangeTracker.fromContext(s),B=function(t,r){return e.find(function(t){if(e.isFunctionLikeDeclaration(t)){var r=t.body;if(e.isBlock(r))return r.statements}else {if(e.isModuleBlock(t)||e.isSourceFile(t))return t.statements;if(e.isClassLike(t))return t.members;e.assertType(t);}return e.emptyArray}(r),(function(r){return r.pos>=t&&e.isFunctionLikeDeclaration(r)&&!e.isConstructorDeclaration(r)}))}((b(o.range)?e.last(o.range):o.range).end,r);B?R.insertNodeBefore(s.file,B,P,!0):R.insertNodeAtEndOfScope(s.file,r,P),g.writeFixes(R);var j=[],J=function(t,r,n){var i=e.factory.createIdentifier(n);if(e.isClassLike(t)){var o=r.facts&a.InStaticRegion?e.factory.createIdentifier(t.name.text):e.factory.createThis();return e.factory.createPropertyAccessExpression(o,i)}return i}(r,o,x);M&&E.unshift(e.factory.createIdentifier("this"));var z=e.factory.createCallExpression(M?e.factory.createPropertyAccessExpression(J,"call"):J,A,E);if(o.facts&a.IsGenerator&&(z=e.factory.createYieldExpression(e.factory.createToken(41),z)),o.facts&a.IsAsyncFunction&&(z=e.factory.createAwaitExpression(z)),S(t)&&(z=e.factory.createJsxExpression(void 0,z)),i.length&&!l)if(e.Debug.assert(!O,"Expected no returnValueProperty"),e.Debug.assert(!(o.facts&a.HasReturn),"Expected RangeFacts.HasReturn flag to be unset"),1===i.length){var U=i[0];j.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(U.name),void 0,e.getSynthesizedDeepClone(U.type),z)],U.parent.flags)));}else {for(var K=[],V=[],q=i[0].parent.flags,W=!1,H=0,G=i;H<G.length;H++){U=G[H],K.push(e.factory.createBindingElement(void 0,void 0,e.getSynthesizedDeepClone(U.name)));var Q=p.typeToTypeNode(p.getBaseTypeOfLiteralType(p.getTypeAtLocation(U)),r,1);V.push(e.factory.createPropertySignature(void 0,U.symbol.name,void 0,Q)),W=W||void 0!==U.type,q&=U.parent.flags;}var X=W?e.factory.createTypeLiteralNode(V):void 0;X&&e.setEmitFlags(X,1),j.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.factory.createObjectBindingPattern(K),void 0,X,z)],q)));}else if(i.length||l){if(i.length)for(var Y=0,Z=i;Y<Z.length;Y++){var $=(U=Z[Y]).parent.flags;2&$&&($=-3&$|1),j.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(U.symbol.name,void 0,ne(U.type))],$)));}O&&j.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(O,void 0,ne(c))],1)));var ee=h(i,l);O&&ee.unshift(e.factory.createShorthandPropertyAssignment(O)),1===ee.length?(e.Debug.assert(!O,"Shouldn't have returnValueProperty here"),j.push(e.factory.createExpressionStatement(e.factory.createAssignment(ee[0].name,z))),o.facts&a.HasReturn&&j.push(e.factory.createReturnStatement())):(j.push(e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createObjectLiteralExpression(ee),z))),O&&j.push(e.factory.createReturnStatement(e.factory.createIdentifier(O))));}else o.facts&a.HasReturn?j.push(e.factory.createReturnStatement(z)):b(o.range)?j.push(e.factory.createExpressionStatement(z)):j.push(z);b(o.range)?R.replaceNodeRangeWithNodes(s.file,e.first(o.range),e.last(o.range),j):R.replaceNodeWithNodes(s.file,o.range,j);var te=R.getChanges(),re=(b(o.range)?e.first(o.range):o.range).getSourceFile().fileName;return {renameFilename:re,renameLocation:e.getRenameLocation(te,re,x,!1),edits:te};function ne(t){if(void 0!==t){for(var r=e.getSynthesizedDeepClone(t),n=r;e.isParenthesizedTypeNode(n);)n=n.type;return e.isUnionTypeNode(n)&&e.find(n.types,(function(e){return 155===e.kind}))?r:e.factory.createUnionTypeNode([r,e.factory.createKeywordTypeNode(155)])}}}(c,o[n],l[n],_,t,r)}(n,t,o)}var s=/^constant_scope_(\d+)$/.exec(r);if(s)return o=+s[1],e.Debug.assert(isFinite(o),"Expected to parse a finite number from the constant scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.constantErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),e.Debug.assert(0===_.length,"Extract constant accepted a range containing a variable declaration?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o){var s,c=n.substitutions,l=o.program.getTypeChecker(),u=r.getSourceFile(),_=!e.isPropertyAccessExpression(t)||e.isClassLike(r)||l.resolveName(t.name.text,t,111551,!1)||e.isPrivateIdentifier(t.name)||e.isKeyword(t.name.originalKeywordKind)?e.getUniqueName(e.isClassLike(r)?"newProperty":"newLocal",u):t.name.text,d=e.isInJSFile(r),p=d||!l.isContextSensitive(t)?void 0:l.typeToTypeNode(l.getContextualType(t),r,1),f=function(t,r){return r.size?function t(n){var i=r.get(e.getNodeId(n).toString());return i?e.getSynthesizedDeepClone(i):e.visitEachChild(n,t,e.nullTransformationContext)}(t):t}(e.skipParentheses(t),c);s=function(n,i){if(void 0===n)return {variableType:n,initializer:i};if(!e.isFunctionExpression(i)&&!e.isArrowFunction(i)||i.typeParameters)return {variableType:n,initializer:i};var a=l.getTypeAtLocation(t),o=e.singleOrUndefined(l.getSignaturesOfType(a,0));if(!o)return {variableType:n,initializer:i};if(o.getTypeParameters())return {variableType:n,initializer:i};for(var s=[],c=!1,u=0,_=i.parameters;u<_.length;u++){var d=_[u];if(d.type)s.push(d);else {var p=l.getTypeAtLocation(d);p===l.getAnyType()&&(c=!0),s.push(e.factory.updateParameterDeclaration(d,d.modifiers,d.dotDotDotToken,d.name,d.questionToken,d.type||l.typeToTypeNode(p,r,1),d.initializer));}}if(c)return {variableType:n,initializer:i};if(n=void 0,e.isArrowFunction(i))i=e.factory.updateArrowFunction(i,e.canHaveModifiers(t)?e.getModifiers(t):void 0,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.equalsGreaterThanToken,i.body);else {if(o&&o.thisParameter){var f=e.firstOrUndefined(s);if(!f||e.isIdentifier(f.name)&&"this"!==f.name.escapedText){var g=l.getTypeOfSymbolAtLocation(o.thisParameter,t);s.splice(0,0,e.factory.createParameterDeclaration(void 0,void 0,"this",void 0,l.typeToTypeNode(g,r,1)));}}i=e.factory.updateFunctionExpression(i,e.canHaveModifiers(t)?e.getModifiers(t):void 0,i.asteriskToken,i.name,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.body);}return {variableType:n,initializer:i}}(p,f),p=s.variableType,f=s.initializer,e.suppressLeadingAndTrailingTrivia(f);var m=e.textChanges.ChangeTracker.fromContext(o);if(e.isClassLike(r)){e.Debug.assert(!d,"Cannot extract to a JS class");var y=[];y.push(e.factory.createModifier(121)),i&a.InStaticRegion&&y.push(e.factory.createModifier(124)),y.push(e.factory.createModifier(146));var v=e.factory.createPropertyDeclaration(y,_,void 0,p,f),h=e.factory.createPropertyAccessExpression(i&a.InStaticRegion?e.factory.createIdentifier(r.name.getText()):e.factory.createThis(),e.factory.createIdentifier(_));S(t)&&(h=e.factory.createJsxExpression(void 0,h));var b=function(t,r){var n,i=r.members;e.Debug.assert(i.length>0,"Found no members");for(var a=!0,o=0,s=i;o<s.length;o++){var c=s[o];if(c.pos>t)return n||i[0];if(a&&!e.isPropertyDeclaration(c)){if(void 0!==n)return c;a=!1;}n=c;}return void 0===n?e.Debug.fail():n}(t.pos,r);m.insertNodeBefore(o.file,b,v,!0),m.replaceNode(o.file,t,h);}else {var x=e.factory.createVariableDeclaration(_,void 0,p,f),T=function(t,r){for(var n;void 0!==t&&t!==r;){if(e.isVariableDeclaration(t)&&t.initializer===n&&e.isVariableDeclarationList(t.parent)&&t.parent.declarations.length>1)return t;n=t,t=t.parent;}}(t,r);if(T)m.insertNodeBefore(o.file,T,x),h=e.factory.createIdentifier(_),m.replaceNode(o.file,t,h);else if(241===t.parent.kind&&r===e.findAncestor(t,g)){var C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2));m.replaceNode(o.file,t.parent,C);}else C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2)),b=function(t,r){var n;e.Debug.assert(!e.isClassLike(r));for(var i=t;i!==r;i=i.parent)g(i)&&(n=i);for(i=(n||t).parent;;i=i.parent){if(D(i)){for(var a=void 0,o=0,s=i.statements;o<s.length;o++){var c=s[o];if(c.pos>t.pos)break;a=c;}return !a&&e.isCaseClause(i)?(e.Debug.assert(e.isSwitchStatement(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):e.Debug.checkDefined(a,"prevStatement failed to get set")}e.Debug.assert(i!==r,"Didn't encounter a block-like before encountering scope");}}(t,r),0===b.pos?m.insertNodeAtTopOfFile(o.file,C,!1):m.insertNodeBefore(o.file,b,C,!1),241===t.parent.kind?m.delete(o.file,t.parent):(h=e.factory.createIdentifier(_),S(t)&&(h=e.factory.createJsxExpression(void 0,h)),m.replaceNode(o.file,t,h));}var E=m.getChanges(),k=t.getSourceFile().fileName;return {renameFilename:k,renameLocation:e.getRenameLocation(E,k,_,!0),edits:E}}(e.isExpression(c)?c:c.statements[0].expression,o[n],l[n],t.facts,r)}(n,t,o);e.Debug.fail("Unrecognized action name");}function p(t,r,i){void 0===i&&(i=!0);var o=r.length;if(0===o&&!i)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractEmpty)]};var s,c=0===o&&i,l=e.findFirstNonJsxWhitespaceToken(t,r.start),u=e.findTokenOnLeftOfPosition(t,e.textSpanEnd(r)),_=l&&u&&i?function(e,t,r){var n=e.getStart(r),i=t.getEnd();return 59===r.text.charCodeAt(i)&&i++,{start:n,length:i-n}}(l,u,t):r,d=c?function(t){return e.findAncestor(t,(function(t){return t.parent&&x(t)&&!e.isBinaryExpression(t.parent)}))}(l):e.getParentNodeInSpan(l,t,_),p=c?d:e.getParentNodeInSpan(u,t,_),g=a.None;if(!d||!p)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(8388608&d.flags)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractJSDoc)]};if(d.parent!==p.parent)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(d!==p){if(!D(d.parent))return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};for(var m=[],y=0,v=d.parent.statements;y<v.length;y++){var h=v[y];if(h===d||m.length){var b=E(h);if(b)return {errors:b};m.push(h);}if(h===p)break}return m.length?{targetRange:{range:m,facts:g,thisNode:s}}:{errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]}}if(e.isReturnStatement(d)&&!d.expression)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};var S=function(t){if(e.isReturnStatement(t)){if(t.expression)return t.expression}else if(e.isVariableStatement(t)||e.isVariableDeclarationList(t)){for(var r=0,n=void 0,i=0,a=e.isVariableStatement(t)?t.declarationList.declarations:t.declarations;i<a.length;i++){var o=a[i];o.initializer&&(r++,n=o.initializer);}if(1===r)return n}else if(e.isVariableDeclaration(t)&&t.initializer)return t.initializer;return t}(d),C=function(t){if(e.isIdentifier(e.isExpressionStatement(t)?t.expression:t))return [e.createDiagnosticForNode(t,n.cannotExtractIdentifier)]}(S)||E(S);return C?{errors:C}:{targetRange:{range:f(S),facts:g,thisNode:s}};function E(t){var i;if(function(e){e[e.None=0]="None",e[e.Break=1]="Break",e[e.Continue=2]="Continue",e[e.Return=4]="Return";}(i||(i={})),e.Debug.assert(t.pos<=t.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),e.Debug.assert(!e.positionIsSynthesized(t.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!(e.isStatement(t)||e.isExpressionNode(t)&&x(t)||T(t)))return [e.createDiagnosticForNode(t,n.statementOrExpressionExpected)];if(16777216&t.flags)return [e.createDiagnosticForNode(t,n.cannotExtractAmbientBlock)];var o,c=e.getContainingClass(t);c&&function(t,r){for(var n=t;n!==r;){if(169===n.kind){e.isStatic(n)&&(g|=a.InStaticRegion);break}if(166===n.kind){173===e.getContainingFunction(n).kind&&(g|=a.InStaticRegion);break}171===n.kind&&e.isStatic(n)&&(g|=a.InStaticRegion),n=n.parent;}}(t,c);var l,u=4;if(function t(i){if(o)return !0;if(e.isDeclaration(i)){var c=257===i.kind?i.parent.parent:i;if(e.hasSyntacticModifier(c,1))return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0}switch(i.kind){case 269:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractImport)),!0;case 274:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0;case 106:if(210===i.parent.kind){var _=e.getContainingClass(i);if(void 0===_||_.pos<r.start||_.end>=r.start+r.length)return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractSuper)),!0}else g|=a.UsesThis,s=i;break;case 216:e.forEachChild(i,(function t(r){if(e.isThis(r))g|=a.UsesThis,s=i;else {if(e.isClassLike(r)||e.isFunctionLike(r)&&!e.isArrowFunction(r))return !1;e.forEachChild(r,t);}}));case 260:case 259:e.isSourceFile(i.parent)&&void 0===i.parent.externalModuleIndicator&&(o||(o=[])).push(e.createDiagnosticForNode(i,n.functionWillNotBeVisibleInTheNewScope));case 228:case 215:case 171:case 173:case 174:case 175:return !1}var d=u;switch(i.kind){case 242:u&=-5;break;case 255:u=0;break;case 238:i.parent&&255===i.parent.kind&&i.parent.finallyBlock===i&&(u=4);break;case 293:case 292:u|=1;break;default:e.isIterationStatement(i,!1)&&(u|=3);}switch(i.kind){case 194:case 108:g|=a.UsesThis,s=i;break;case 253:var p=i.label;(l||(l=[])).push(p.escapedText),e.forEachChild(i,t),l.pop();break;case 249:case 248:(p=i.label)?e.contains(l,p.escapedText)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):u&(249===i.kind?1:2)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break;case 220:g|=a.IsAsyncFunction;break;case 226:g|=a.IsGenerator;break;case 250:4&u?g|=a.HasReturn:(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalReturnStatement));break;default:e.forEachChild(i,t);}u=d;}(t),g&a.UsesThis){var _=e.getThisContainer(t,!1);(259===_.kind||171===_.kind&&207===_.parent.kind||215===_.kind)&&(g|=a.UsesThisInFunction);}return o}}function f(t){return e.isStatement(t)?[t]:e.isExpressionNode(t)?e.isExpressionStatement(t.parent)?[t.parent]:t:T(t)?t:void 0}function g(t){return e.isArrowFunction(t)?e.isFunctionBody(t.body):e.isFunctionLikeDeclaration(t)||e.isSourceFile(t)||e.isModuleBlock(t)||e.isClassLike(t)}function m(t,r){var i=r.file,o=function(t){var r=b(t.range)?e.first(t.range):t.range;if(t.facts&a.UsesThis&&!(t.facts&a.UsesThisInFunction)){var n=e.getContainingClass(r);if(n){var i=e.findAncestor(r,e.isFunctionLikeDeclaration);return i?[i,n]:[n]}}for(var o=[];;)if(166===(r=r.parent).kind&&(r=e.findAncestor(r,(function(t){return e.isFunctionLikeDeclaration(t)})).parent),g(r)&&(o.push(r),308===r.kind))return o}(t),s=function(t,r){return b(t.range)?{pos:e.first(t.range).getStart(r),end:e.last(t.range).getEnd()}:t.range}(t,i),c=function(t,r,i,o,s,c){var l,u,_=new e.Map,d=[],p=[],f=[],g=[],m=[],y=new e.Map,v=[],h=b(t.range)?1===t.range.length&&e.isExpressionStatement(t.range[0])?t.range[0].expression:void 0:t.range;if(void 0===h){var x=t.range,D=e.first(x).getStart(),S=e.last(x).end;u=e.createFileDiagnostic(o,D,S-D,n.expressionExpected);}else 147456&s.getTypeAtLocation(h).flags&&(u=e.createDiagnosticForNode(h,n.uselessConstantType));for(var T=0,C=r;T<C.length;T++){var E=C[T];d.push({usages:new e.Map,typeParameterUsages:new e.Map,substitutions:new e.Map}),p.push(new e.Map),f.push([]);var k=[];u&&k.push(u),e.isClassLike(E)&&e.isInJSFile(E)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToJSClass)),e.isArrowFunction(E)&&!e.isBlock(E.body)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToExpressionArrowFunction)),g.push(k);}var N,A=new e.Map,F=b(t.range)?e.factory.createBlock(t.range):t.range,P=b(t.range)?e.first(t.range):t.range,w=(N=P,!!e.findAncestor(N,(function(t){return e.isDeclarationWithTypeParameters(t)&&0!==e.getEffectiveTypeParameterDeclarations(t).length})));if(function c(l,u){if(void 0===u&&(u=1),w&&K(s.getTypeAtLocation(l)),e.isDeclaration(l)&&l.symbol&&m.push(l),e.isAssignmentExpression(l))c(l.left,2),c(l.right);else if(e.isUnaryExpressionWithWrite(l))c(l.operand,2);else if(e.isPropertyAccessExpression(l)||e.isElementAccessExpression(l))e.forEachChild(l,c);else if(e.isIdentifier(l)){if(!l.parent)return;if(e.isQualifiedName(l.parent)&&l!==l.parent.left)return;if(e.isPropertyAccessExpression(l.parent)&&l!==l.parent.expression)return;!function(c,l,u){var _=function(c,l,u){var _=V(c);if(_){var m=e.getSymbolId(_).toString(),y=A.get(m);if(y&&y>=l)return m;if(A.set(m,l),y){for(var v=0,h=d;v<h.length;v++){var b=h[v];b.usages.get(c.text)&&b.usages.set(c.text,{usage:l,symbol:_,node:c});}return m}var x=_.getDeclarations(),D=x&&e.find(x,(function(e){return e.getSourceFile()===o}));if(D&&!e.rangeContainsStartEnd(i,D.getStart(),D.end)){if(t.facts&a.IsGenerator&&2===l){for(var S=e.createDiagnosticForNode(c,n.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators),T=0,C=f;T<C.length;T++)C[T].push(S);for(var E=0,k=g;E<k.length;E++)k[E].push(S);}for(var N=0;N<r.length;N++){var F=r[N];if(s.resolveName(_.name,F,_.flags,!1)!==_&&!p[N].has(m)){var P=q(_.exportSymbol||_,F,u);P?p[N].set(m,P):u?262144&_.flags||(S=e.createDiagnosticForNode(c,n.typeWillNotBeVisibleInTheNewScope),f[N].push(S),g[N].push(S)):d[N].usages.set(c.text,{usage:l,symbol:_,node:c});}}return m}}}(c,l,u);if(_)for(var m=0;m<r.length;m++){var y=p[m].get(_);y&&d[m].substitutions.set(e.getNodeId(c).toString(),y);}}(l,u,e.isPartOfTypeNode(l));}else e.forEachChild(l,c);}(F),!w||b(t.range)||e.isJsxAttribute(t.range)||K(s.getContextualType(t.range)),_.size>0){for(var I=new e.Map,O=0,M=P;void 0!==M&&O<r.length;M=M.parent)if(M===r[O]&&(I.forEach((function(e,t){d[O].typeParameterUsages.set(t,e);})),O++),e.isDeclarationWithTypeParameters(M))for(var L=0,R=e.getEffectiveTypeParameterDeclarations(M);L<R.length;L++){var B=R[L],j=s.getTypeAtLocation(B);_.has(j.id.toString())&&I.set(j.id.toString(),j);}e.Debug.assert(O===r.length,"Should have iterated all scopes");}if(m.length){var J=e.isBlockScope(r[0],r[0].parent)?r[0]:e.getEnclosingBlockScopeContainer(r[0]);e.forEachChild(J,(function r(n){if(!(n===t.range||b(t.range)&&t.range.indexOf(n)>=0)){var i=e.isIdentifier(n)?V(n):s.getSymbolAtLocation(n);if(i){var a=e.find(m,(function(e){return e.symbol===i}));if(a)if(e.isVariableDeclaration(a)){var o=a.symbol.id.toString();y.has(o)||(v.push(a),y.set(o,!0));}else l=l||a;}e.forEachChild(n,r);}}));}for(var z=function(i){var o=d[i];if(i>0&&(o.usages.size>0||o.typeParameterUsages.size>0)){var s=b(t.range)?t.range[0]:t.range;g[i].push(e.createDiagnosticForNode(s,n.cannotAccessVariablesFromNestedScopes));}t.facts&a.UsesThisInFunction&&e.isClassLike(r[i])&&f[i].push(e.createDiagnosticForNode(t.thisNode,n.cannotExtractFunctionsContainingThisToMethod));var c,u=!1;if(d[i].usages.forEach((function(t){2===t.usage&&(u=!0,106500&t.symbol.flags&&t.symbol.valueDeclaration&&e.hasEffectiveModifier(t.symbol.valueDeclaration,64)&&(c=t.symbol.valueDeclaration));})),e.Debug.assert(b(t.range)||0===v.length,"No variable declarations expected if something was extracted"),u&&!b(t.range)){var _=e.createDiagnosticForNode(t.range,n.cannotWriteInExpression);f[i].push(_),g[i].push(_);}else c&&i>0?(_=e.createDiagnosticForNode(c,n.cannotExtractReadonlyPropertyInitializerOutsideConstructor),f[i].push(_),g[i].push(_)):l&&(_=e.createDiagnosticForNode(l,n.cannotExtractExportedEntity),f[i].push(_),g[i].push(_));},U=0;U<r.length;U++)z(U);return {target:F,usagesPerScope:d,functionErrorsPerScope:f,constantErrorsPerScope:g,exposedVariableDeclarations:v};function K(e){for(var t=0,r=s.getSymbolWalker((function(){return c.throwIfCancellationRequested(),!0})).walkType(e).visitedTypes;t<r.length;t++){var n=r[t];n.isTypeParameter()&&_.set(n.id.toString(),n);}}function V(t){return t.parent&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?s.getShorthandAssignmentValueSymbol(t.parent):s.getSymbolAtLocation(t)}function q(t,r,n){if(t){var i=t.getDeclarations();if(i&&i.some((function(e){return e.parent===r})))return e.factory.createIdentifier(t.name);var a=q(t.parent,r,n);if(void 0!==a)return n?e.factory.createQualifiedName(a,e.factory.createIdentifier(t.name)):e.factory.createPropertyAccessExpression(a,t.name)}}}(t,o,s,i,r.program.getTypeChecker(),r.cancellationToken);return {scopes:o,readsAndWrites:c}}function y(e){var t,r=e.symbol;if(r&&r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];(void 0===t||a.pos<t.pos)&&(t=a);}return t}function v(t,r){var n=t.type,i=t.declaration,a=r.type,o=r.declaration;return e.compareProperties(i,o,"pos",e.compareValues)||e.compareStringsCaseSensitive(n.symbol?n.symbol.getName():"",a.symbol?a.symbol.getName():"")||e.compareValues(n.id,a.id)}function h(t,r){var n=e.map(t,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)})),i=e.map(r,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)}));return void 0===n?i:void 0===i?n:n.concat(i)}function b(t){return e.isArray(t)}function x(e){var t=e.parent;if(302===t.kind)return !1;switch(e.kind){case 10:return 269!==t.kind&&273!==t.kind;case 227:case 203:case 205:return !1;case 79:return 205!==t.kind&&273!==t.kind&&278!==t.kind}return !0}function D(e){switch(e.kind){case 238:case 308:case 265:case 292:return !0;default:return !1}}function S(t){return T(t)||(e.isJsxElement(t)||e.isJsxSelfClosingElement(t)||e.isJsxFragment(t))&&(e.isJsxElement(t.parent)||e.isJsxFragment(t.parent))}function T(t){return e.isStringLiteral(t)&&t.parent&&e.isJsxAttribute(t.parent)}t.registerRefactor(c,{kinds:[l.kind,u.kind],getEditsForAction:d,getAvailableActions:_}),r.getRefactorActionsToExtractSymbol=_,r.getRefactorEditsToExtractSymbol=d,function(t){function r(t){return {message:t,code:0,category:e.DiagnosticCategory.Message,key:t}}t.cannotExtractRange=r("Cannot extract range."),t.cannotExtractImport=r("Cannot extract import statement."),t.cannotExtractSuper=r("Cannot extract super call."),t.cannotExtractJSDoc=r("Cannot extract JSDoc."),t.cannotExtractEmpty=r("Cannot extract empty range."),t.expressionExpected=r("expression expected."),t.uselessConstantType=r("No reason to extract constant of type."),t.statementOrExpressionExpected=r("Statement or expression expected."),t.cannotExtractRangeContainingConditionalBreakOrContinueStatements=r("Cannot extract range containing conditional break or continue statements."),t.cannotExtractRangeContainingConditionalReturnStatement=r("Cannot extract range containing conditional return statement."),t.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=r("Cannot extract range containing labeled break or continue with target outside of the range."),t.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=r("Cannot extract range containing writes to references located outside of the target range in generators."),t.typeWillNotBeVisibleInTheNewScope=r("Type will not visible in the new scope."),t.functionWillNotBeVisibleInTheNewScope=r("Function will not visible in the new scope."),t.cannotExtractIdentifier=r("Select more than a single identifier."),t.cannotExtractExportedEntity=r("Cannot extract exported declaration"),t.cannotWriteInExpression=r("Cannot write back side-effects when extracting an expression"),t.cannotExtractReadonlyPropertyInitializerOutsideConstructor=r("Cannot move initialization of read-only class property outside of the constructor"),t.cannotExtractAmbientBlock=r("Cannot extract code from ambient contexts"),t.cannotAccessVariablesFromNestedScopes=r("Cannot access variables from nested scopes"),t.cannotExtractToJSClass=r("Cannot extract constant to a class scope in JS"),t.cannotExtractToExpressionArrowFunction=r("Cannot extract constant to an arrow function without a block"),t.cannotExtractFunctionsContainingThisToMethod=r("Cannot extract functions containing this to method");}(n=r.Messages||(r.Messages={})),function(e){e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.UsesThisInFunction=16]="UsesThisInFunction",e[e.InStaticRegion=32]="InStaticRegion";}(a||(a={})),r.getRangeToExtract=p,function(e){e[e.Module=0]="Module",e[e.Global=1]="Global";}(o||(o={})),function(e){e[e.Read=1]="Read",e[e.Write=2]="Write";}(s||(s={}));})((t=e.refactor||(e.refactor={})).extractSymbol||(t.extractSymbol={}));}(t),function(e){!function(t){var r="Extract type",n={name:"Extract to type alias",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_type_alias),kind:"refactor.extract.type"},a={name:"Extract to interface",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_interface),kind:"refactor.extract.interface"},o={name:"Extract to typedef",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_typedef),kind:"refactor.extract.typedef"};function s(t,r){void 0===r&&(r=!0);var n=t.file,i=t.startPosition,a=e.isSourceFileJS(n),o=e.getTokenAtPosition(n,i),s=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),u=s.pos===s.end&&r,_=e.findAncestor(o,(function(t){return t.parent&&e.isTypeNode(t)&&!l(s,t.parent,n)&&(u||e.nodeOverlapsWithStartEnd(o,n,s.pos,s.end))}));if(!_||!e.isTypeNode(_))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_type_node)};var d=t.program.getTypeChecker(),p=e.Debug.checkDefined(e.findAncestor(_,e.isStatement),"Should find a statement"),f=function(t,r,n,i){var a=[];return function o(s){if(e.isTypeReferenceNode(s)){if(e.isIdentifier(s.typeName))for(var c=s.typeName,u=0,_=(null==(g=t.resolveName(c.text,c,262144,!0))?void 0:g.declarations)||e.emptyArray;u<_.length;u++){var d=_[u];if(e.isTypeParameterDeclaration(d)&&d.getSourceFile()===i){if(d.name.escapedText===c.escapedText&&l(d,r,i))return !0;if(l(n,d,i)&&!l(r,d,i)){e.pushIfUnique(a,d);break}}}}else if(e.isInferTypeNode(s)){var p=e.findAncestor(s,(function(t){return e.isConditionalTypeNode(t)&&l(t.extendsType,s,i)}));if(!p||!l(r,p,i))return !0}else if(e.isTypePredicateNode(s)||e.isThisTypeNode(s)){var f=e.findAncestor(s.parent,e.isFunctionLike);if(f&&f.type&&l(f.type,s,i)&&!l(r,f,i))return !0}else if(e.isTypeQueryNode(s)){var g;if(e.isIdentifier(s.exprName)){if((null==(g=t.resolveName(s.exprName.text,s.exprName,111551,!1))?void 0:g.valueDeclaration)&&l(n,g.valueDeclaration,i)&&!l(r,g.valueDeclaration,i))return !0}else if(e.isThisIdentifier(s.exprName.left)&&!l(r,s.parent,i))return !0}return i&&e.isTupleTypeNode(s)&&e.getLineAndCharacterOfPosition(i,s.pos).line===e.getLineAndCharacterOfPosition(i,s.end).line&&e.setEmitFlags(s,1),e.forEachChild(s,o)}(r)?void 0:a}(d,_,p,n);return f?{isJS:a,selection:_,firstStatement:p,typeParameters:f,typeElements:c(d,_)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.No_type_could_be_extracted_from_this_type_node)}}function c(t,r){if(r){if(e.isIntersectionTypeNode(r)){for(var n=[],i=new e.Map,a=0,o=r.types;a<o.length;a++){var s=c(t,o[a]);if(!s||!s.every((function(t){return t.name&&e.addToSeen(i,e.getNameFromPropertyName(t.name))})))return;e.addRange(n,s);}return n}return e.isParenthesizedTypeNode(r)?c(t,r.type):e.isTypeLiteralNode(r)?r.members:void 0}}function l(t,r,n){return e.rangeContainsStartEnd(t,e.skipTrivia(n.text,r.pos),r.end)}t.registerRefactor(r,{kinds:[n.kind,a.kind,o.kind],getAvailableActions:function(c){var l=s(c,"invoked"===c.triggerReason);return l?t.isRefactorErrorInfo(l)?c.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},n),{notApplicableReason:l.error}),i$1(i$1({},a),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:l.isJS?[o]:e.append([n],l.typeElements&&a)}]:e.emptyArray},getEditsForAction:function(r,i){var c=r.file,l=s(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected to find a range to extract");var u=e.getUniqueName("NewType",c),_=e.textChanges.ChangeTracker.with(r,(function(t){switch(i){case n.name:return e.Debug.assert(!l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters,c=e.factory.createTypeAliasDeclaration(void 0,n,s.map((function(t){return e.factory.updateTypeParameterDeclaration(t,t.modifiers,t.name,t.constraint,void 0)})),o);t.insertNodeBefore(r,a,e.ignoreSourceNewlines(c),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);case o.name:return e.Debug.assert(l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters;e.setEmitFlags(o,3584);var c=e.factory.createJSDocTypedefTag(e.factory.createIdentifier("typedef"),e.factory.createJSDocTypeExpression(o),e.factory.createIdentifier(n)),l=[];e.forEach(s,(function(t){var r=e.getEffectiveConstraintOfTypeParameter(t),n=e.factory.createTypeParameterDeclaration(void 0,t.name),i=e.factory.createJSDocTemplateTag(e.factory.createIdentifier("template"),r&&e.cast(r,e.isJSDocTypeExpression),[n]);l.push(i);})),t.insertNodeBefore(r,a,e.factory.createJSDocComment(void 0,e.factory.createNodeArray(e.concatenate(l,[c]))),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))));}(t,c,u,l);case a.name:return e.Debug.assert(!l.isJS&&!!l.typeElements,"Invalid actionName/JS combo"),function(t,r,n,i){var a,o=i.firstStatement,s=i.selection,c=i.typeParameters,l=i.typeElements,u=e.factory.createInterfaceDeclaration(void 0,n,c,void 0,l);e.setTextRange(u,null===(a=l[0])||void 0===a?void 0:a.parent),t.insertNodeBefore(r,o,e.ignoreSourceNewlines(u),!0),t.replaceNode(r,s,e.factory.createTypeReferenceNode(n,c.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);default:e.Debug.fail("Unexpected action name");}})),d=c.fileName;return {edits:_,renameFilename:d,renameLocation:e.getRenameLocation(_,d,u,!1)}}});}(e.refactor||(e.refactor={}));}(t),function(e){var t,r,n,a;(t=e.refactor||(e.refactor={})).generateGetAccessorAndSetAccessor||(t.generateGetAccessorAndSetAccessor={}),r="Generate 'get' and 'set' accessors",n=e.Diagnostics.Generate_get_and_set_accessors.message,a={name:r,description:n,kind:"refactor.rewrite.property.generateAccessors"},t.registerRefactor(r,{kinds:[a.kind],getEditsForAction:function(r,n){if(r.endPosition){var i=e.codefix.getAccessorConvertiblePropertyAtPosition(r.file,r.program,r.startPosition,r.endPosition);e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info");var a=e.codefix.generateAccessorFromProperty(r.file,r.program,r.startPosition,r.endPosition,r,n);if(a){var o=r.file.fileName,s=i.renameAccessor?i.accessorName:i.fieldName;return {renameFilename:o,renameLocation:(e.isIdentifier(s)?0:-1)+e.getRenameLocation(a,o,s.text,e.isParameter(i.declaration)),edits:a}}}},getAvailableActions:function(o){if(!o.endPosition)return e.emptyArray;var s=e.codefix.getAccessorConvertiblePropertyAtPosition(o.file,o.program,o.startPosition,o.endPosition,"invoked"===o.triggerReason);return s?t.isRefactorErrorInfo(s)?o.preferences.provideRefactorNotApplicableReason?[{name:r,description:n,actions:[i$1(i$1({},a),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:r,description:n,actions:[a]}]:e.emptyArray}});}(t),function(e){var t;(t=e.refactor||(e.refactor={})).isRefactorErrorInfo=function(e){return void 0!==e.error},t.refactorKindBeginsWith=function(e,t){return !t||e.substr(0,t.length)===t};}(t),function(e){!function(t){var r="Move to a new file",a=e.getLocaleSpecificMessage(e.Diagnostics.Move_to_a_new_file),o={name:r,description:a,kind:"refactor.move.newFile"};function s(t){var r=function(t){var r=t.file,n=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),i=r.statements,a=e.findIndex(i,(function(e){return e.end>n.pos}));if(-1!==a){var o=i[a];if(e.isNamedDeclaration(o)&&o.name&&e.rangeContainsRange(o.name,n))return {toMove:[i[a]],afterLast:i[a+1]};if(!(n.pos>o.getStart(r))){var s=e.findIndex(i,(function(e){return e.end>n.end}),a);if(-1===s||!(0===s||i[s].getStart(r)<n.end))return {toMove:i.slice(a,-1===s?i.length:s),afterLast:-1===s?void 0:i[s]}}}}(t);if(void 0!==r){var n=[],i=[],a=r.toMove,o=r.afterLast;return e.getRangesWhere(a,c,(function(e,t){for(var r=e;r<t;r++)n.push(a[r]);i.push({first:a[e],afterLast:o});})),0===n.length?void 0:{all:n,ranges:i}}}function c(t){return !function(t){switch(t.kind){case 269:return !0;case 268:return !e.hasSyntacticModifier(t,1);case 240:return t.declarationList.declarations.every((function(t){return !!t.initializer&&e.isRequireCall(t.initializer,!0)}));default:return !1}}(t)&&!e.isPrologueDirective(t)}function l(e,t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n],o=a.first,s=a.afterLast;r.deleteNodeRangeExcludingEnd(e,o,s);}}function u(e){return 269===e.kind?e.moduleSpecifier:268===e.kind?e.moduleReference.expression:e.initializer.arguments[0]}function _(t,r){if(e.isImportDeclaration(t))e.isStringLiteral(t.moduleSpecifier)&&r(t);else if(e.isImportEqualsDeclaration(t))e.isExternalModuleReference(t.moduleReference)&&e.isStringLiteralLike(t.moduleReference.expression)&&r(t);else if(e.isVariableStatement(t))for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];a.initializer&&e.isRequireCall(a.initializer,!0)&&r(a);}}function d(t,r,n,i,a){if(n=e.ensurePathIsNonModuleName(n),i){var o=r.map((function(t){return e.factory.createImportSpecifier(!1,void 0,e.factory.createIdentifier(t))}));return e.makeImportIfNecessary(t,o,n,a)}e.Debug.assert(!t,"No default import should exist");var s=r.map((function(t){return e.factory.createBindingElement(void 0,void 0,t)}));return s.length?p(e.factory.createObjectBindingPattern(s),void 0,f(e.factory.createStringLiteral(n))):void 0}function p(t,r,n,i){return void 0===i&&(i=2),e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(t,void 0,r,n)],i))}function f(t){return e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[t])}function g(t,r,n,i){switch(r.kind){case 269:!function(t,r,n,i){if(r.importClause){var a=r.importClause,o=a.name,s=a.namedBindings,c=!o||i(o),l=!s||(271===s.kind?i(s.name):0!==s.elements.length&&s.elements.every((function(e){return i(e.name)})));if(c&&l)n.delete(t,r);else if(o&&c&&n.delete(t,o),s)if(l)n.replaceNode(t,r.importClause,e.factory.updateImportClause(r.importClause,r.importClause.isTypeOnly,o,void 0));else if(272===s.kind)for(var u=0,_=s.elements;u<_.length;u++){var d=_[u];i(d.name)&&n.delete(t,d);}}}(t,r,n,i);break;case 268:i(r.name)&&n.delete(t,r);break;case 257:!function(t,r,n,i){var a=r.name;switch(a.kind){case 79:i(a)&&(r.initializer&&e.isRequireCall(r.initializer,!0)?n.delete(t,e.isVariableDeclarationList(r.parent)&&1===e.length(r.parent.declarations)?r.parent.parent:r):n.delete(t,a));break;case 204:break;case 203:if(a.elements.every((function(t){return e.isIdentifier(t.name)&&i(t.name)})))n.delete(t,e.isVariableDeclarationList(r.parent)&&1===r.parent.declarations.length?r.parent.parent:r);else for(var o=0,s=a.elements;o<s.length;o++){var c=s[o];e.isIdentifier(c.name)&&i(c.name)&&n.delete(t,c.name);}}}(t,r,n,i);break;default:e.Debug.assertNever(r,"Unexpected import decl kind ".concat(r.kind));}}function m(t){switch(t.kind){case 268:case 273:case 270:case 271:return !0;case 257:return y(t);case 205:return e.isVariableDeclaration(t.parent.parent)&&y(t.parent.parent);default:return !1}}function y(t){return e.isSourceFile(t.parent.parent.parent)&&!!t.initializer&&e.isRequireCall(t.initializer,!0)}function v(t,r,n){switch(t.kind){case 269:var i=t.importClause;if(!i)return;var a=i.name&&n(i.name)?i.name:void 0,o=i.namedBindings&&function(t,r){if(271===t.kind)return r(t.name)?t:void 0;var n=t.elements.filter((function(e){return r(e.name)}));return n.length?e.factory.createNamedImports(n):void 0}(i.namedBindings,n);return a||o?e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,a,o),r,void 0):void 0;case 268:return n(t.name)?t:void 0;case 257:var s=function(t,r){switch(t.kind){case 79:return r(t)?t:void 0;case 204:return t;case 203:var n=t.elements.filter((function(t){return t.propertyName||!e.isIdentifier(t.name)||r(t.name)}));return n.length?e.factory.createObjectBindingPattern(n):void 0}}(t.name,n);return s?p(s,t.type,f(r),t.parent.flags):void 0;default:return e.Debug.assertNever(t,"Unexpected import kind ".concat(t.kind))}}function h(t,r,n){t.forEachChild((function t(i){if(e.isIdentifier(i)&&!e.isDeclarationName(i)){var a=r.getSymbolAtLocation(i);a&&n(a);}else i.forEachChild(t);}));}t.registerRefactor(r,{kinds:[o.kind],getAvailableActions:function(t){var n=s(t);return t.preferences.allowTextChangesInNewFiles&&n?[{name:r,description:a,actions:[o]}]:t.preferences.provideRefactorNotApplicableReason?[{name:r,description:a,actions:[i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_statement_or_statements)})]}]:e.emptyArray},getEditsForAction:function(t,i){e.Debug.assert(i===r,"Wrong refactor invoked");var a=e.Debug.checkDefined(s(t));return {edits:e.textChanges.ChangeTracker.with(t,(function(r){return i=t.file,o=t.program,s=a,c=r,p=t.host,y=t.preferences,T=o.getTypeChecker(),P=function(t,r,n){var i=new b,a=new b,o=new b,s=e.find(r,(function(e){return !!(2&e.transformFlags)})),c=function(t){if(void 0!==t){var r=n.getJsxNamespace(t),i=n.resolveName(r,t,1920,!0);return i&&e.some(i.declarations,m)?i:void 0}}(s);c&&a.add(c);for(var l=0,u=r;l<u.length;l++)S(v=u[l],(function(t){i.add(e.Debug.checkDefined(e.isExpressionStatement(t)?n.getSymbolAtLocation(t.expression.left):t.symbol,"Need a symbol here"));}));for(var _=0,d=r;_<d.length;_++)h(v=d[_],n,(function(r){if(r.declarations)for(var n=0,s=r.declarations;n<s.length;n++){var c=s[n];m(c)?a.add(r):x(c)&&(l=c,(e.isVariableDeclaration(l)?l.parent.parent.parent:l.parent)===t)&&!i.has(r)&&o.add(r);}var l;}));for(var p=a.clone(),f=new b,g=0,y=t.statements;g<y.length;g++){var v=y[g];e.contains(r,v)||(c&&2&v.transformFlags&&p.delete(c),h(v,n,(function(e){i.has(e)&&f.add(e),p.delete(e);})));}return {movedSymbols:i,newFileImportsFromOldFile:o,oldFileImportsFromNewFile:f,oldImportsNeededByNewFile:a,unusedImportsFromOldFile:p}}(i,s.all,T),w=e.getDirectoryPath(i.fileName),I=e.extensionFromPath(i.fileName),O=function(t,r,n,i){for(var a=t,o=1;;o++){var s=e.combinePaths(n,a+r);if(!i.fileExists(s))return a;a="".concat(t,".").concat(o);}}((L=P.oldFileImportsFromNewFile,R=P.movedSymbols,L.forEachEntry(e.symbolNameNoDefault)||R.forEachEntry(e.symbolNameNoDefault)||"newFile"),I,w,p),M=O+I,c.createNewFile(i,e.combinePaths(w,M),function(t,r,i,a,o,s,c){var p=o.getTypeChecker(),m=e.takeWhile(t.statements,e.isPrologueDirective);if(void 0===t.externalModuleIndicator&&void 0===t.commonJsModuleIndicator&&0===r.oldImportsNeededByNewFile.size())return l(t,a.ranges,i),n$4(n$4([],m,!0),a.all,!0);var y=!!t.externalModuleIndicator,h=e.getQuotePreference(t,c),b=function(t,r,n,i){var a,o=[];return t.forEach((function(t){"default"===t.escapedName?a=e.factory.createIdentifier(e.symbolNameNoDefault(t)):o.push(t.name);})),d(a,o,r,n,i)}(r.oldFileImportsFromNewFile,s,y,h);b&&e.insertImports(i,t,b,!0),function(t,r,n,i,a){for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];e.contains(r,c)||_(c,(function(e){return g(t,e,n,(function(e){return i.has(a.getSymbolAtLocation(e))}))}));}}(t,a.all,i,r.unusedImportsFromOldFile,p),l(t,a.ranges,i),function(t,r,n,i,a){for(var o=r.getTypeChecker(),s=function(r){if(r===n)return "continue";for(var s=function(s){_(s,(function(c){if(o.getSymbolAtLocation(u(c))===n.symbol){var l=function(t){var r=e.isBindingElement(t.parent)?e.getPropertySymbolFromBindingElement(o,t.parent):e.skipAlias(o.getSymbolAtLocation(t),o);return !!r&&i.has(r)};g(r,c,t,l);var _=e.combinePaths(e.getDirectoryPath(u(c).text),a),d=v(c,e.factory.createStringLiteral(_),l);d&&t.insertNodeAfter(r,s,d);var p=function(t){switch(t.kind){case 269:return t.importClause&&t.importClause.namedBindings&&271===t.importClause.namedBindings.kind?t.importClause.namedBindings.name:void 0;case 268:return t.name;case 257:return e.tryCast(t.name,e.isIdentifier);default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c);p&&function(t,r,n,i,a,o,s,c){var l=e.codefix.moduleSpecifierToValidIdentifier(a,99),u=!1,_=[];if(e.FindAllReferences.Core.eachSymbolReferenceInFile(s,n,r,(function(t){e.isPropertyAccessExpression(t.parent)&&(u=u||!!n.resolveName(l,t,67108863,!0),i.has(n.getSymbolAtLocation(t.parent.name))&&_.push(t));})),_.length){for(var d=u?e.getUniqueName(l,r):l,p=0,g=_;p<g.length;p++){var m=g[p];t.replaceNode(r,m,e.factory.createIdentifier(d));}t.insertNodeAfter(r,c,function(t,r,n){var i=e.factory.createIdentifier(r),a=e.factory.createStringLiteral(n);switch(t.kind){case 269:return e.factory.createImportDeclaration(void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(i)),a,void 0);case 268:return e.factory.createImportEqualsDeclaration(void 0,!1,i,e.factory.createExternalModuleReference(a));case 257:return e.factory.createVariableDeclaration(i,void 0,void 0,f(a));default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c,a,o));}}(t,r,o,i,a,_,p,c);}}));},c=0,l=r.statements;c<l.length;c++)s(l[c]);},c=0,l=r.getSourceFiles();c<l.length;c++)s(l[c]);}(i,o,t,r.movedSymbols,s);var T=function(t,r,n,i,a,o,s){for(var c,l=[],p=0,f=t.statements;p<f.length;p++)_(f[p],(function(t){e.append(l,v(t,u(t),(function(e){return r.has(a.getSymbolAtLocation(e))})));}));var g=[],m=e.nodeSeenTracker();return n.forEach((function(r){if(r.declarations)for(var n=0,a=r.declarations;n<a.length;n++){var s=a[n];if(x(s)){var l=(_=s,e.isExpressionStatement(_)?e.tryCast(_.expression.left.name,e.isIdentifier):e.tryCast(_.name,e.isIdentifier));if(l){var u=C(s);m(u)&&E(t,u,l,i,o),e.hasSyntacticModifier(s,1024)?c=l:g.push(l.text);}}}var _;})),e.append(l,d(c,g,e.removeFileExtension(e.getBaseFileName(t.fileName)),o,s)),l}(t,r.oldImportsNeededByNewFile,r.newFileImportsFromOldFile,i,p,y,h),P=function(t,r,i,a){return e.flatMap(r,(function(r){if(s=r,e.Debug.assert(e.isSourceFile(s.parent),"Node parent should be a SourceFile"),(D(s)||e.isVariableStatement(s))&&!k(t,r,a)&&S(r,(function(t){return i.has(e.Debug.checkDefined(t.symbol))}))){var o=function(e,t){return t?[N(e)]:function(e){return n$4([e],A(e).map(F),!0)}(e)}(r,a);if(o)return o}var s;return r}))}(t,a.all,r.oldFileImportsFromNewFile,y);return T.length&&P.length?n$4(n$4(n$4(n$4([],m,!0),T,!0),[4],!1),P,!0):n$4(n$4(n$4([],m,!0),T,!0),P,!0)}(i,P,c,s,o,O,y)),void function(t,r,n,i,a){var o=t.getCompilerOptions().configFile;if(o){var s=e.normalizePath(e.combinePaths(n,"..",i)),c=e.getRelativePathFromFile(o.fileName,s,a),l=o.statements[0]&&e.tryCast(o.statements[0].expression,e.isObjectLiteralExpression),u=l&&e.find(l.properties,(function(t){return e.isPropertyAssignment(t)&&e.isStringLiteral(t.name)&&"files"===t.name.text}));u&&e.isArrayLiteralExpression(u.initializer)&&r.insertNodeInListAfter(o,e.last(u.initializer.elements),e.factory.createStringLiteral(c),u.initializer.elements);}}(o,c,i.fileName,M,e.hostGetCanonicalFileName(p));var i,o,s,c,p,y,T,P,w,I,O,M,L,R;})),renameFilename:void 0,renameLocation:void 0}}});var b=function(){function t(){this.map=new e.Map;}return t.prototype.add=function(t){this.map.set(String(e.getSymbolId(t)),t);},t.prototype.has=function(t){return this.map.has(String(e.getSymbolId(t)))},t.prototype.delete=function(t){this.map.delete(String(e.getSymbolId(t)));},t.prototype.forEach=function(e){this.map.forEach(e);},t.prototype.forEachEntry=function(t){return e.forEachEntry(this.map,t)},t.prototype.clone=function(){var r=new t;return e.copyEntries(this.map,r.map),r},t.prototype.size=function(){return this.map.size},t}();function x(t){return D(t)&&e.isSourceFile(t.parent)||e.isVariableDeclaration(t)&&e.isSourceFile(t.parent.parent.parent)}function D(e){switch(e.kind){case 259:case 260:case 264:case 263:case 262:case 261:case 268:return !0;default:return !1}}function S(t,r){switch(t.kind){case 259:case 260:case 264:case 263:case 262:case 261:case 268:return r(t);case 240:return e.firstDefined(t.declarationList.declarations,(function(e){return T(e.name,r)}));case 241:var n=t.expression;return e.isBinaryExpression(n)&&1===e.getAssignmentDeclarationKind(n)?r(t):void 0}}function T(t,r){switch(t.kind){case 79:return r(e.cast(t.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));case 204:case 203:return e.firstDefined(t.elements,(function(t){return e.isOmittedExpression(t)?void 0:T(t.name,r)}));default:return e.Debug.assertNever(t,"Unexpected name kind ".concat(t.kind))}}function C(t){switch(t.kind){case 257:return t.parent.parent;case 205:return C(e.cast(t.parent.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));default:return t}}function E(t,r,n,i,a){if(!k(t,r,a,n))if(a)e.isExpressionStatement(r)||i.insertExportModifier(t,r);else {var o=A(r);0!==o.length&&i.insertNodesAfter(t,r,o.map(F));}}function k(t,r,n,i){var a;return n?!e.isExpressionStatement(r)&&e.hasSyntacticModifier(r,1)||!(!i||!(null===(a=t.symbol.exports)||void 0===a?void 0:a.has(i.escapedText))):!!t.symbol&&!!t.symbol.exports&&A(r).some((function(r){return t.symbol.exports.has(e.escapeLeadingUnderscores(r))}))}function N(t){var r=e.canHaveModifiers(t)?e.concatenate([e.factory.createModifier(93)],e.getModifiers(t)):void 0;switch(t.kind){case 259:return e.factory.updateFunctionDeclaration(t,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body);case 260:var n=e.canHaveDecorators(t)?e.getDecorators(t):void 0;return e.factory.updateClassDeclaration(t,e.concatenate(n,r),t.name,t.typeParameters,t.heritageClauses,t.members);case 240:return e.factory.updateVariableStatement(t,r,t.declarationList);case 264:return e.factory.updateModuleDeclaration(t,r,t.name,t.body);case 263:return e.factory.updateEnumDeclaration(t,r,t.name,t.members);case 262:return e.factory.updateTypeAliasDeclaration(t,r,t.name,t.typeParameters,t.type);case 261:return e.factory.updateInterfaceDeclaration(t,r,t.name,t.typeParameters,t.heritageClauses,t.members);case 268:return e.factory.updateImportEqualsDeclaration(t,r,t.isTypeOnly,t.name,t.moduleReference);case 241:return e.Debug.fail();default:return e.Debug.assertNever(t,"Unexpected declaration kind ".concat(t.kind))}}function A(t){switch(t.kind){case 259:case 260:return [t.name.text];case 240:return e.mapDefined(t.declarationList.declarations,(function(t){return e.isIdentifier(t.name)?t.name.text:void 0}));case 264:case 263:case 262:case 261:case 268:return e.emptyArray;case 241:return e.Debug.fail("Can't export an ExpressionStatement");default:return e.Debug.assertNever(t,"Unexpected decl kind ".concat(t.kind))}}function F(t){return e.factory.createExpressionStatement(e.factory.createBinaryExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),e.factory.createIdentifier(t)),63,e.factory.createIdentifier(t)))}}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Add or remove braces in an arrow function",a=e.Diagnostics.Add_or_remove_braces_in_an_arrow_function.message,o={name:"Add braces to arrow function",description:e.Diagnostics.Add_braces_to_arrow_function.message,kind:"refactor.rewrite.arrow.braces.add"},s={name:"Remove braces from arrow function",description:e.Diagnostics.Remove_braces_from_arrow_function.message,kind:"refactor.rewrite.arrow.braces.remove"};function c(r,n,i,a){void 0===i&&(i=!0);var c=e.getTokenAtPosition(r,n),l=e.getContainingFunction(c);if(!l)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_a_containing_arrow_function)};if(!e.isArrowFunction(l))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Containing_function_is_not_an_arrow_function)};if(e.rangeContainsRange(l,c)&&(!e.rangeContainsRange(l.body,c)||i)){if(t.refactorKindBeginsWith(o.kind,a)&&e.isExpression(l.body))return {func:l,addBraces:!0,expression:l.body};if(t.refactorKindBeginsWith(s.kind,a)&&e.isBlock(l.body)&&1===l.body.statements.length){var u=e.first(l.body.statements);if(e.isReturnStatement(u))return {func:l,addBraces:!1,expression:u.expression,returnStatement:u}}}}t.registerRefactor(n,{kinds:[s.kind],getEditsForAction:function(r,n){var i=r.file,a=r.startPosition,l=c(i,a);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u,_=l.expression,d=l.returnStatement,p=l.func;if(n===o.name){var f=e.factory.createReturnStatement(_);u=e.factory.createBlock([f],!0),e.copyLeadingComments(_,f,i,3,!0);}else if(n===s.name&&d){var g=_||e.factory.createVoidZero();u=e.needsParentheses(g)?e.factory.createParenthesizedExpression(g):g,e.copyTrailingAsLeadingComments(d,u,i,3,!1),e.copyLeadingComments(d,u,i,3,!1),e.copyTrailingComments(d,u,i,3,!1);}else e.Debug.fail("invalid action");return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(e){e.replaceNode(i,p.body,u);}))}},getAvailableActions:function(r){var l=c(r.file,r.startPosition,"invoked"===r.triggerReason);return l?t.isRefactorErrorInfo(l)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},s),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:n,description:a,actions:[l.addBraces?o:s]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var i="Convert parameters to destructured object",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_parameters_to_destructured_object),o={name:i,description:a,kind:"refactor.rewrite.parameters.toDestructured"};function s(t,r){var n=e.getContainingObjectLiteralElement(t);if(n){var i=r.getContextualTypeForObjectLiteralElement(n),a=null==i?void 0:i.getSymbol();if(a&&!(6&e.getCheckFlags(a)))return a}}function c(t){var r=t.node;return e.isImportSpecifier(r.parent)||e.isImportClause(r.parent)||e.isImportEqualsDeclaration(r.parent)||e.isNamespaceImport(r.parent)||e.isExportSpecifier(r.parent)||e.isExportAssignment(r.parent)?r:void 0}function l(t){if(e.isDeclaration(t.node.parent))return t.node}function u(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 210:case 211:var i=e.tryCast(n,e.isCallOrNewExpression);if(i&&i.expression===r)return i;break;case 208:var a=e.tryCast(n,e.isPropertyAccessExpression);if(a&&a.parent&&a.name===r){var o=e.tryCast(a.parent,e.isCallOrNewExpression);if(o&&o.expression===a)return o}break;case 209:var s=e.tryCast(n,e.isElementAccessExpression);if(s&&s.parent&&s.argumentExpression===r){var c=e.tryCast(s.parent,e.isCallOrNewExpression);if(c&&c.expression===s)return c}}}}function _(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 208:var i=e.tryCast(n,e.isPropertyAccessExpression);if(i&&i.expression===r)return i;break;case 209:var a=e.tryCast(n,e.isElementAccessExpression);if(a&&a.expression===r)return a}}}function d(t){var r=t.node;if(2===e.getMeaningFromLocation(r)||e.isExpressionWithTypeArgumentsInClassExtendsClause(r.parent))return r}function p(t,r,n){var i=e.getTouchingToken(t,r),a=e.getContainingFunctionDeclaration(i);if(!function(t){var r=e.findAncestor(t,e.isJSDocNode);if(r){var n=e.findAncestor(r,(function(t){return !e.isJSDocNode(t)}));return !!n&&e.isFunctionLikeDeclaration(n)}return !1}(i))return !(a&&function(t,r){var n;if(!function(t,r){return function(e){return y(e)?e.length-1:e.length}(t)>=1&&e.every(t,(function(t){return function(t,r){if(e.isRestParameter(t)){var n=r.getTypeAtLocation(t);if(!r.isArrayType(n)&&!r.isTupleType(n))return !1}return !t.modifiers&&e.isIdentifier(t.name)}(t,r)}))}(t.parameters,r))return !1;switch(t.kind){case 259:return g(t)&&f(t,r);case 171:if(e.isObjectLiteralExpression(t.parent)){var i=s(t.name,r);return 1===(null===(n=null==i?void 0:i.declarations)||void 0===n?void 0:n.length)&&f(t,r)}return f(t,r);case 173:return e.isClassDeclaration(t.parent)?g(t.parent)&&f(t,r):m(t.parent.parent)&&f(t,r);case 215:case 216:return m(t.parent)}return !1}(a,n)&&e.rangeContainsRange(a,i))||a.body&&e.rangeContainsRange(a.body,i)?void 0:a}function f(e,t){return !!e.body&&!t.isImplementationOfOverload(e)}function g(t){return !!t.name||!!e.findModifier(t,88)}function m(t){return e.isVariableDeclaration(t)&&e.isVarConst(t)&&e.isIdentifier(t.name)&&!t.type}function y(t){return t.length>0&&e.isThis(t[0].name)}function v(t){return y(t)&&(t=e.factory.createNodeArray(t.slice(1),t.hasTrailingComma)),t}function h(t,r){var n=v(t.parameters),i=e.isRestParameter(e.last(n)),a=i?r.slice(0,n.length-1):r,o=e.map(a,(function(t,r){var i,a,o=(i=x(n[r]),a=t,e.isIdentifier(a)&&e.getTextOfIdentifierOrLiteral(a)===i?e.factory.createShorthandPropertyAssignment(i):e.factory.createPropertyAssignment(i,a));return e.suppressLeadingAndTrailingTrivia(o.name),e.isPropertyAssignment(o)&&e.suppressLeadingAndTrailingTrivia(o.initializer),e.copyComments(t,o),o}));if(i&&r.length>=n.length){var s=r.slice(n.length-1),c=e.factory.createPropertyAssignment(x(e.last(n)),e.factory.createArrayLiteralExpression(s));o.push(c);}return e.factory.createObjectLiteralExpression(o,!1)}function b(t,r,n){var i,a,o,s=r.getTypeChecker(),c=v(t.parameters),l=e.map(c,(function(t){var r=e.factory.createBindingElement(void 0,void 0,x(t),e.isRestParameter(t)&&g(t)?e.factory.createArrayLiteralExpression():t.initializer);return e.suppressLeadingAndTrailingTrivia(r),t.initializer&&r.initializer&&e.copyComments(t.initializer,r.initializer),r})),u=e.factory.createObjectBindingPattern(l),_=(i=c,a=e.map(i,(function(t){var i,a,o=t.type;o||!t.initializer&&!e.isRestParameter(t)||(i=t,a=s.getTypeAtLocation(i),o=e.getTypeNodeIfAccessible(a,i,r,n));var c=e.factory.createPropertySignature(void 0,x(t),g(t)?e.factory.createToken(57):t.questionToken,o);return e.suppressLeadingAndTrailingTrivia(c),e.copyComments(t.name,c.name),t.type&&c.type&&e.copyComments(t.type,c.type),c})),e.addEmitFlags(e.factory.createTypeLiteralNode(a),1));e.every(c,g)&&(o=e.factory.createObjectLiteralExpression());var d=e.factory.createParameterDeclaration(void 0,void 0,u,void 0,_,o);if(y(t.parameters)){var p=t.parameters[0],f=e.factory.createParameterDeclaration(void 0,void 0,p.name,void 0,p.type);return e.suppressLeadingAndTrailingTrivia(f.name),e.copyComments(p.name,f.name),p.type&&(e.suppressLeadingAndTrailingTrivia(f.type),e.copyComments(p.type,f.type)),e.factory.createNodeArray([f,d])}return e.factory.createNodeArray([d]);function g(t){if(e.isRestParameter(t)){var r=s.getTypeAtLocation(t);return !s.isTupleType(r)}return s.isOptionalParameter(t)}}function x(t){return e.getTextOfIdentifierOrLiteral(t.name)}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(t,r){e.Debug.assert(r===i,"Unexpected action name");var a=t.file,o=t.startPosition,f=t.program,g=t.cancellationToken,m=t.host,y=p(a,o,f.getTypeChecker());if(y&&g){var v=function(t,r,i){var a=function(t){switch(t.kind){case 259:return t.name?[t.name]:[e.Debug.checkDefined(e.findModifier(t,88),"Nameless function declaration should be a default export")];case 171:return [t.name];case 173:var r=e.Debug.checkDefined(e.findChildOfKind(t,135,t.getSourceFile()),"Constructor declaration should have constructor keyword");return 228===t.parent.kind?[t.parent.parent.name,r]:[r];case 216:return [t.parent.name];case 215:return t.name?[t.name,t.parent.name]:[t.parent.name];default:return e.Debug.assertNever(t,"Unexpected function declaration kind ".concat(t.kind))}}(t),o=e.isConstructorDeclaration(t)?function(t){switch(t.parent.kind){case 260:var r=t.parent;return r.name?[r.name]:[e.Debug.checkDefined(e.findModifier(r,88),"Nameless class declaration should be a default export")];case 228:var n=t.parent,i=t.parent.parent,a=n.name;return a?[a,i.name]:[i.name]}}(t):[],p=e.deduplicate(n$4(n$4([],a,!0),o,!0),e.equateValues),f=r.getTypeChecker(),g=function(r){for(var n={accessExpressions:[],typeUsages:[]},i={functionCalls:[],declarations:[],classReferences:n,valid:!0},p=e.map(a,m),g=e.map(o,m),y=e.isConstructorDeclaration(t),v=e.map(a,(function(e){return s(e,f)})),h=0,b=r;h<b.length;h++){var x=b[h];if(0!==x.kind){if(e.contains(v,m(x.node))){if(k=x.node.parent,e.isMethodSignature(k)&&(e.isInterfaceDeclaration(k.parent)||e.isTypeLiteralNode(k.parent))){i.signature=x.node.parent;continue}if(S=u(x)){i.functionCalls.push(S);continue}}var D=s(x.node,f);if(D&&e.contains(v,D)&&(T=l(x))){i.declarations.push(T);continue}if(e.contains(p,m(x.node))||e.isNewExpressionTarget(x.node)){var S;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}if(S=u(x)){i.functionCalls.push(S);continue}}if(y&&e.contains(g,m(x.node))){var T;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}var C=_(x);if(C){n.accessExpressions.push(C);continue}if(e.isClassDeclaration(t.parent)){var E=d(x);if(E){n.typeUsages.push(E);continue}}}i.valid=!1;}else i.valid=!1;}var k;return i}(e.flatMap(p,(function(t){return e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),i)})));return e.every(g.declarations,(function(t){return e.contains(p,t)}))||(g.valid=!1),g;function m(t){var r=f.getSymbolAtLocation(t);return r&&e.getSymbolTarget(r,f)}}(y,f,g);if(v.valid){var x=e.textChanges.ChangeTracker.with(t,(function(t){return function(t,r,n,i,a,o){var s=o.signature,c=e.map(b(a,r,n),(function(t){return e.getSynthesizedDeepClone(t)}));s&&p(s,e.map(b(s,r,n),(function(t){return e.getSynthesizedDeepClone(t)}))),p(a,c);for(var l=0,u=e.sortAndDeduplicate(o.functionCalls,(function(t,r){return e.compareValues(t.pos,r.pos)}));l<u.length;l++){var _=u[l];if(_.arguments&&_.arguments.length){var d=e.getSynthesizedDeepClone(h(a,_.arguments),!0);i.replaceNodeRange(e.getSourceFileOfNode(_),e.first(_.arguments),e.last(_.arguments),d,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}function p(r,n){i.replaceNodeRangeWithNodes(t,e.first(r.parameters),e.last(r.parameters),n,{joiner:", ",indentation:0,leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}(a,f,m,t,y,v)}));return {renameFilename:void 0,renameLocation:void 0,edits:x}}return {edits:[]}}},getAvailableActions:function(t){var r=t.file,n=t.startPosition;return e.isSourceFileJS(r)?e.emptyArray:p(r,n,t.program.getTypeChecker())?[{name:i,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertParamsToDestructuredObject||(t.convertParamsToDestructuredObject={}));}(t),function(e){var t;(function(r){var n="Convert to template string",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_template_string),o={name:n,description:a,kind:"refactor.rewrite.string"};function s(t,r){var n=e.getTokenAtPosition(t,r),i=l(n);return !u(i).isValidConcatenation&&e.isParenthesizedExpression(i.parent)&&e.isBinaryExpression(i.parent.parent)?i.parent.parent:n}function c(t,r){var n=l(r),i=t.file,a=function(t,r){var n=t.nodes,i=function(t,r){return function(n,i){n<t.length&&e.copyTrailingComments(t[n],i,r,3,!1);}}(t.operators,r),a=function(t,r,n){return function(i,a){for(;i.length>0;){var o=i.shift();e.copyTrailingComments(t[o],a,r,3,!1),n(o,a);}}}(n,r,i),o=d(0,n),s=o[0],c=o[1],l=o[2],u=o[3];if(s===n.length){var f=e.factory.createNoSubstitutionTemplateLiteral(c,l);return a(u,f),f}var g=[],m=e.factory.createTemplateHead(c,l);a(u,m);for(var y,v=function(t){var r=function(t){return e.isParenthesizedExpression(t)&&(p(t),t=t.expression),t}(n[t]);i(t,r);var o=d(t+1,n),s=o[0],c=o[1],l=o[2],u=o[3],f=(t=s-1)==n.length-1;if(e.isTemplateExpression(r)){var m=e.map(r.templateSpans,(function(t,n){p(t);var i=n===r.templateSpans.length-1,a=t.literal.text+(i?c:""),o=_(t.literal)+(i?l:"");return e.factory.createTemplateSpan(t.expression,f&&i?e.factory.createTemplateTail(a,o):e.factory.createTemplateMiddle(a,o))}));g.push.apply(g,m);}else {var v=f?e.factory.createTemplateTail(c,l):e.factory.createTemplateMiddle(c,l);a(u,v),g.push(e.factory.createTemplateSpan(r,v));}y=t;},h=s;h<n.length;h++)v(h),h=y;return e.factory.createTemplateExpression(m,g)}(u(n),i),o=e.getTrailingCommentRanges(i.text,n.end);if(o){var s=o[o.length-1],c={pos:o[0].pos,end:s.end};return e.textChanges.ChangeTracker.with(t,(function(e){e.deleteRange(i,c),e.replaceNode(i,n,a);}))}return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,n,a)}))}function l(t){return e.findAncestor(t.parent,(function(t){switch(t.kind){case 208:case 209:return !1;case 225:case 223:return !(e.isBinaryExpression(t.parent)&&(r=t.parent,63!==r.operatorToken.kind));default:return "quit"}var r;}))||t}function u(t){var r=function(t){if(!e.isBinaryExpression(t))return {nodes:[t],operators:[],validOperators:!0,hasString:e.isStringLiteral(t)||e.isNoSubstitutionTemplateLiteral(t)};var n=r(t.left),i=n.nodes,a=n.operators,o=n.hasString,s=n.validOperators;if(!(o||e.isStringLiteral(t.right)||e.isTemplateExpression(t.right)))return {nodes:[t],operators:[],hasString:!1,validOperators:!0};var c=39===t.operatorToken.kind,l=s&&c;return i.push(t.right),a.push(t.operatorToken),{nodes:i,operators:a,hasString:!0,validOperators:l}},n=r(t),i=n.nodes,a=n.operators,o=n.validOperators,s=n.hasString;return {nodes:i,operators:a,isValidConcatenation:o&&s}}function _(t){var r=e.isTemplateHead(t)||e.isTemplateMiddle(t)?-2:-1;return e.getTextOfNode(t).slice(1,r)}function d(t,r){for(var n=[],i="",a="";t<r.length;){var o=r[t];if(!e.isStringLiteralLike(o)){if(e.isTemplateExpression(o)){i+=o.head.text,a+=_(o.head);break}break}i+=o.text,a+=e.getTextOfNode(o).slice(1,-1).replace(/\\.|[$`]/g,(function(e){return "\\"===e[0]?e:"\\"+e})),n.push(t),t++;}return [t,i,a,n]}function p(t){var r=t.getSourceFile();e.copyTrailingComments(t,t.expression,r,3,!1),e.copyTrailingAsLeadingComments(t.expression,t.expression,r,3,!1);}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(t,r){var n=s(t.file,t.startPosition);return r===a?{edits:c(t,n)}:e.Debug.fail("invalid action")},getAvailableActions:function(t){var r=l(s(t.file,t.startPosition)),c={name:n,description:a,actions:[]};return e.isBinaryExpression(r)&&u(r).isValidConcatenation?(c.actions.push(o),[c]):t.preferences.provideRefactorNotApplicableReason?(c.actions.push(i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_string_concatenation)})),[c]):e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertStringOrTemplateLiteral||(t.convertStringOrTemplateLiteral={}));}(t),function(e){var t;(function(r){var n="Convert arrow function or function expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_arrow_function_or_function_expression),o={name:"Convert to anonymous function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},s={name:"Convert to named function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_named_function),kind:"refactor.rewrite.function.named"},c={name:"Convert to arrow function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};function l(t){var r=!1;return t.forEachChild((function t(n){e.isThis(n)?r=!0:e.isClassLike(n)||e.isFunctionDeclaration(n)||e.isFunctionExpression(n)||e.forEachChild(n,t);})),r}function u(t,r,n){var i=e.getTokenAtPosition(t,r),a=n.getTypeChecker(),o=function(t,r,n){if(function(t){return e.isVariableDeclaration(t)||e.isVariableDeclarationList(t)&&1===t.declarations.length}(n)){var i=(e.isVariableDeclaration(n)?n:e.first(n.declarations)).initializer;return i&&(e.isArrowFunction(i)||e.isFunctionExpression(i)&&!d(t,r,i))?i:void 0}}(t,a,i.parent);if(o&&!l(o.body)&&!a.containsArgumentsReference(o))return {selectedVariableDeclaration:!0,func:o};var s=e.getContainingFunction(i);if(s&&(e.isFunctionExpression(s)||e.isArrowFunction(s))&&!e.rangeContainsRange(s.body,i)&&!l(s.body)&&!a.containsArgumentsReference(s)){if(e.isFunctionExpression(s)&&d(t,a,s))return;return {selectedVariableDeclaration:!1,func:s}}}function _(t){if(e.isExpression(t)){var r=e.factory.createReturnStatement(t),n=t.getSourceFile();return e.suppressLeadingAndTrailingTrivia(r),e.copyTrailingAsLeadingComments(t,r,n,void 0,!0),e.factory.createBlock([r],!0)}return t}function d(t,r,n){return !!n.name&&e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,r,t)}t.registerRefactor(n,{kinds:[o.kind,s.kind,c.kind],getEditsForAction:function(t,r){var n=u(t.file,t.startPosition,t.program);if(n){var i=n.func,a=[];switch(r){case o.name:a.push.apply(a,function(t,r){var n=t.file,i=_(r.body),a=e.factory.createFunctionExpression(r.modifiers,r.asteriskToken,void 0,r.typeParameters,r.parameters,r.type,i);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(n,r,a)}))}(t,i));break;case s.name:var l=function(t){var r=t.parent;if(e.isVariableDeclaration(r)&&e.isVariableDeclarationInVariableStatement(r)){var n=r.parent,i=n.parent;return e.isVariableDeclarationList(n)&&e.isVariableStatement(i)&&e.isIdentifier(r.name)?{variableDeclaration:r,variableDeclarationList:n,statement:i,name:r.name}:void 0}}(i);if(!l)return;a.push.apply(a,function(t,r,n){var i=t.file,a=_(r.body),o=n.variableDeclaration,s=n.variableDeclarationList,c=n.statement,l=n.name;e.suppressLeadingTrivia(c);var u=1&e.getCombinedModifierFlags(o)|e.getEffectiveModifierFlags(r),d=e.factory.createModifiersFromModifierFlags(u),p=e.factory.createFunctionDeclaration(e.length(d)?d:void 0,r.asteriskToken,l,r.typeParameters,r.parameters,r.type,a);return 1===s.declarations.length?e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,c,p)})):e.textChanges.ChangeTracker.with(t,(function(e){e.delete(i,o),e.insertNodeAfter(i,c,p);}))}(t,i,l));break;case c.name:if(!e.isFunctionExpression(i))return;a.push.apply(a,function(t,r){var n,i=t.file,a=r.body.statements[0];!function(t,r){return 1===t.statements.length&&e.isReturnStatement(r)&&!!r.expression}(r.body,a)?n=r.body:(n=a.expression,e.suppressLeadingAndTrailingTrivia(n),e.copyComments(a,n));var o=e.factory.createArrowFunction(r.modifiers,r.typeParameters,r.parameters,r.type,e.factory.createToken(38),n);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,r,o)}))}(t,i));break;default:return e.Debug.fail("invalid action")}return {renameFilename:void 0,renameLocation:void 0,edits:a}}},getAvailableActions:function(r){var l=r.file,_=r.startPosition,d=r.program,p=r.kind,f=u(l,_,d);if(!f)return e.emptyArray;var g,m=f.selectedVariableDeclaration,y=f.func,v=[],h=[];return t.refactorKindBeginsWith(s.kind,p)&&((g=m||e.isArrowFunction(y)&&e.isVariableDeclaration(y.parent)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_named_function))?h.push(i$1(i$1({},s),{notApplicableReason:g})):v.push(s)),t.refactorKindBeginsWith(o.kind,p)&&((g=!m&&e.isArrowFunction(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_anonymous_function))?h.push(i$1(i$1({},o),{notApplicableReason:g})):v.push(o)),t.refactorKindBeginsWith(c.kind,p)&&((g=e.isFunctionExpression(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_arrow_function))?h.push(i$1(i$1({},c),{notApplicableReason:g})):v.push(c)),[{name:n,description:a,actions:0===v.length&&r.preferences.provideRefactorNotApplicableReason?h:v}]}});})((t=e.refactor||(e.refactor={})).convertArrowFunctionOrFunctionExpression||(t.convertArrowFunctionOrFunctionExpression={}));}(t),function(e){var t;(function(r){var n="Infer function return type",a=e.Diagnostics.Infer_function_return_type.message,o={name:n,description:a,kind:"refactor.rewrite.function.returnType"};function s(r){if(!e.isInJSFile(r.file)&&t.refactorKindBeginsWith(o.kind,r.kind)){var n=e.getTokenAtPosition(r.file,r.startPosition),i=e.findAncestor(n,(function(t){return e.isBlock(t)||t.parent&&e.isArrowFunction(t.parent)&&(38===t.kind||t.parent.body===t)?"quit":function(e){switch(e.kind){case 259:case 215:case 216:case 171:return !0;default:return !1}}(t)}));if(!i||!i.body||i.type)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Return_type_must_be_inferred_from_a_function)};var a=r.program.getTypeChecker(),s=function(t,r){if(t.isImplementationOfOverload(r)){var n=t.getTypeAtLocation(r).getCallSignatures();if(n.length>1)return t.getUnionType(e.mapDefined(n,(function(e){return e.getReturnType()})))}var i=t.getSignatureFromDeclaration(r);if(i)return t.getReturnTypeOfSignature(i)}(a,i);if(!s)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_determine_function_return_type)};var c=a.typeToTypeNode(s,i,1);return c?{declaration:i,returnTypeNode:c}:void 0}}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(r){var n=s(r);if(n&&!t.isRefactorErrorInfo(n))return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(t){return i=r.file,a=t,o=n.declaration,s=n.returnTypeNode,c=e.findChildOfKind(o,21,i),void((u=(l=e.isArrowFunction(o)&&void 0===c)?e.first(o.parameters):c)&&(l&&(a.insertNodeBefore(i,u,e.factory.createToken(20)),a.insertNodeAfter(i,u,e.factory.createToken(21))),a.insertNodeAt(i,u.end,s,{prefix:": "})));var i,a,o,s,c,l,u;}))}},getAvailableActions:function(r){var c=s(r);return c?t.isRefactorErrorInfo(c)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:c.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).inferFunctionReturnType||(t.inferFunctionReturnType={}));}(t),function(e){function t(t,n,i,a){var o=e.isNodeKind(t)?new r(t,n,i):79===t?new u(79,n,i):80===t?new _(80,n,i):new l(t,n,i);return o.parent=a,o.flags=50720768&a.flags,o}e.servicesVersion="0.8";var r=function(){function r(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e;}return r.prototype.assertHasRealPosition=function(t){e.Debug.assert(!e.positionIsSynthesized(this.pos)&&!e.positionIsSynthesized(this.end),t||"Node must have a real position for this operation");},r.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},r.prototype.getStart=function(t,r){return this.assertHasRealPosition(),e.getTokenPosOfNode(this,t,r)},r.prototype.getFullStart=function(){return this.assertHasRealPosition(),this.pos},r.prototype.getEnd=function(){return this.assertHasRealPosition(),this.end},r.prototype.getWidth=function(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)},r.prototype.getFullWidth=function(){return this.assertHasRealPosition(),this.end-this.pos},r.prototype.getLeadingTriviaWidth=function(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos},r.prototype.getFullText=function(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)},r.prototype.getText=function(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},r.prototype.getChildCount=function(e){return this.getChildren(e).length},r.prototype.getChildAt=function(e,t){return this.getChildren(t)[e]},r.prototype.getChildren=function(r){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=function(r,n){if(!e.isNodeKind(r.kind))return e.emptyArray;var i=[];if(e.isJSDocCommentContainingNode(r))return r.forEachChild((function(e){i.push(e);})),i;e.scanner.setText((n||r.getSourceFile()).text);var o=r.pos,s=function(e){a(i,o,e.pos,r),i.push(e),o=e.end;};return e.forEach(r.jsDoc,s),o=r.pos,r.forEachChild(s,(function(e){a(i,o,e.pos,r),i.push(function(e,r){var n=t(351,e.pos,e.end,r);n._children=[];for(var i=e.pos,o=0,s=e;o<s.length;o++){var c=s[o];a(n._children,i,c.pos,r),n._children.push(c),i=c.end;}return a(n._children,i,e.end,r),n}(e,r)),o=e.end;})),a(i,o,r.end,r),e.scanner.setText(void 0),i}(this,r))},r.prototype.getFirstToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t);if(r.length){var n=e.find(r,(function(e){return e.kind<312||e.kind>350}));return n.kind<163?n:n.getFirstToken(t)}},r.prototype.getLastToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t),n=e.lastOrUndefined(r);if(n)return n.kind<163?n:n.getLastToken(t)},r.prototype.forEachChild=function(t,r){return e.forEachChild(this,t,r)},r}();function a(r,n,i,a){for(e.scanner.setTextPos(n);n<i;){var o=e.scanner.scan(),s=e.scanner.getTextPos();if(s<=i&&(79===o&&e.Debug.fail("Did not expect ".concat(e.Debug.formatSyntaxKind(a.kind)," to have an Identifier in its trivia")),r.push(t(o,n,s,a))),n=s,1===o)break}}var o=function(){function t(e,t){this.pos=e,this.end=t,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0;}return t.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},t.prototype.getStart=function(t,r){return e.getTokenPosOfNode(this,t,r)},t.prototype.getFullStart=function(){return this.pos},t.prototype.getEnd=function(){return this.end},t.prototype.getWidth=function(e){return this.getEnd()-this.getStart(e)},t.prototype.getFullWidth=function(){return this.end-this.pos},t.prototype.getLeadingTriviaWidth=function(e){return this.getStart(e)-this.pos},t.prototype.getFullText=function(e){return (e||this.getSourceFile()).text.substring(this.pos,this.end)},t.prototype.getText=function(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},t.prototype.getChildCount=function(){return this.getChildren().length},t.prototype.getChildAt=function(e){return this.getChildren()[e]},t.prototype.getChildren=function(){return 1===this.kind&&this.jsDoc||e.emptyArray},t.prototype.getFirstToken=function(){},t.prototype.getLastToken=function(){},t.prototype.forEachChild=function(){},t}(),s=function(){function t(e,t){this.flags=e,this.escapedName=t;}return t.prototype.getFlags=function(){return this.flags},Object.defineProperty(t.prototype,"name",{get:function(){return e.symbolName(this)},enumerable:!1,configurable:!0}),t.prototype.getEscapedName=function(){return this.escapedName},t.prototype.getName=function(){return this.name},t.prototype.getDeclarations=function(){return this.declarations},t.prototype.getDocumentationComment=function(t){if(!this.documentationComment)if(this.documentationComment=e.emptyArray,!this.declarations&&this.target&&this.target.tupleLabelDeclaration){var r=this.target.tupleLabelDeclaration;this.documentationComment=m([r],t);}else this.documentationComment=m(this.declarations,t);return this.documentationComment},t.prototype.getContextualDocumentationComment=function(t,r){if(t){if(e.isGetAccessor(t)&&(this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=m(e.filter(this.declarations,e.isGetAccessor),r)),e.length(this.contextualGetAccessorDocumentationComment)))return this.contextualGetAccessorDocumentationComment;if(e.isSetAccessor(t)&&(this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=m(e.filter(this.declarations,e.isSetAccessor),r)),e.length(this.contextualSetAccessorDocumentationComment)))return this.contextualSetAccessorDocumentationComment}return this.getDocumentationComment(r)},t.prototype.getJsDocTags=function(e){return void 0===this.tags&&(this.tags=g(this.declarations,e)),this.tags},t.prototype.getContextualJsDocTags=function(t,r){if(t){if(e.isGetAccessor(t)&&(this.contextualGetAccessorTags||(this.contextualGetAccessorTags=g(e.filter(this.declarations,e.isGetAccessor),r)),e.length(this.contextualGetAccessorTags)))return this.contextualGetAccessorTags;if(e.isSetAccessor(t)&&(this.contextualSetAccessorTags||(this.contextualSetAccessorTags=g(e.filter(this.declarations,e.isSetAccessor),r)),e.length(this.contextualSetAccessorTags)))return this.contextualSetAccessorTags}return this.getJsDocTags(r)},t}(),l=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i.kind=t,i}return c(t,e),t}(o),u=function(t){function r(e,r,n){var i=t.call(this,r,n)||this;return i.kind=79,i}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);u.prototype.kind=79;var _=function(t){function r(e,r,n){return t.call(this,r,n)||this}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);_.prototype.kind=80;var d=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getFlags=function(){return this.flags},t.prototype.getSymbol=function(){return this.symbol},t.prototype.getProperties=function(){return this.checker.getPropertiesOfType(this)},t.prototype.getProperty=function(e){return this.checker.getPropertyOfType(this,e)},t.prototype.getApparentProperties=function(){return this.checker.getAugmentedPropertiesOfType(this)},t.prototype.getCallSignatures=function(){return this.checker.getSignaturesOfType(this,0)},t.prototype.getConstructSignatures=function(){return this.checker.getSignaturesOfType(this,1)},t.prototype.getStringIndexType=function(){return this.checker.getIndexTypeOfType(this,0)},t.prototype.getNumberIndexType=function(){return this.checker.getIndexTypeOfType(this,1)},t.prototype.getBaseTypes=function(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0},t.prototype.isNullableType=function(){return this.checker.isNullableType(this)},t.prototype.getNonNullableType=function(){return this.checker.getNonNullableType(this)},t.prototype.getNonOptionalType=function(){return this.checker.getNonOptionalType(this)},t.prototype.getConstraint=function(){return this.checker.getBaseConstraintOfType(this)},t.prototype.getDefault=function(){return this.checker.getDefaultFromTypeParameter(this)},t.prototype.isUnion=function(){return !!(1048576&this.flags)},t.prototype.isIntersection=function(){return !!(2097152&this.flags)},t.prototype.isUnionOrIntersection=function(){return !!(3145728&this.flags)},t.prototype.isLiteral=function(){return !!(384&this.flags)},t.prototype.isStringLiteral=function(){return !!(128&this.flags)},t.prototype.isNumberLiteral=function(){return !!(256&this.flags)},t.prototype.isTypeParameter=function(){return !!(262144&this.flags)},t.prototype.isClassOrInterface=function(){return !!(3&e.getObjectFlags(this))},t.prototype.isClass=function(){return !!(1&e.getObjectFlags(this))},t.prototype.isIndexType=function(){return !!(4194304&this.flags)},Object.defineProperty(t.prototype,"typeArguments",{get:function(){if(4&e.getObjectFlags(this))return this.checker.getTypeArguments(this)},enumerable:!1,configurable:!0}),t}(),p=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getDeclaration=function(){return this.declaration},t.prototype.getTypeParameters=function(){return this.typeParameters},t.prototype.getParameters=function(){return this.parameters},t.prototype.getReturnType=function(){return this.checker.getReturnTypeOfSignature(this)},t.prototype.getTypeParameterAtPosition=function(t){var r=this.checker.getParameterType(this,t);if(r.isIndexType()&&e.isThisTypeParameter(r.type)){var n=r.type.getConstraint();if(n)return this.checker.getIndexType(n)}return r},t.prototype.getDocumentationComment=function(){return this.documentationComment||(this.documentationComment=m(e.singleElementArray(this.declaration),this.checker))},t.prototype.getJsDocTags=function(){return this.jsDocTags||(this.jsDocTags=g(e.singleElementArray(this.declaration),this.checker))},t}();function f(t){return e.getJSDocTags(t).some((function(e){return "inheritDoc"===e.tagName.text||"inheritdoc"===e.tagName.text}))}function g(t,r){if(!t)return e.emptyArray;var i=e.JsDoc.getJsDocTagsFromDeclarations(t,r);if(r&&(0===i.length||t.some(f)))for(var a=new e.Set,o=function(e){var t=y(r,e,(function(t){var n;if(!a.has(t))return a.add(t),174===e.kind||175===e.kind?t.getContextualJsDocTags(e,r):1===(null===(n=t.declarations)||void 0===n?void 0:n.length)?t.getJsDocTags():void 0}));t&&(i=n$4(n$4([],t,!0),i,!0));},s=0,c=t;s<c.length;s++)o(c[s]);return i}function m(t,r){if(!t)return e.emptyArray;var n=e.JsDoc.getJsDocCommentsFromDeclarations(t,r);if(r&&(0===n.length||t.some(f)))for(var i=new e.Set,a=function(t){var a=y(r,t,(function(e){if(!i.has(e))return i.add(e),174===t.kind||175===t.kind?e.getContextualDocumentationComment(t,r):e.getDocumentationComment(r)}));a&&(n=0===n.length?a.slice():a.concat(e.lineBreakPart(),n));},o=0,s=t;o<s.length;o++)a(s[o]);return n}function y(t,r,n){var i,a=173===(null===(i=r.parent)||void 0===i?void 0:i.kind)?r.parent.parent:r.parent;if(a){var o=e.hasStaticModifier(r);return e.firstDefined(e.getAllSuperTypeNodes(a),(function(e){var i=t.getTypeAtLocation(e),a=o&&i.symbol?t.getTypeOfSymbol(i.symbol):i,s=t.getPropertyOfType(a,r.symbol.name);return s?n(s):void 0}))}}var v=function(t){function r(e,r,n){var i=t.call(this,e,r,n)||this;return i.kind=308,i}return c(r,t),r.prototype.update=function(t,r){return e.updateSourceFile(this,t,r)},r.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},r.prototype.getLineStarts=function(){return e.getLineStarts(this)},r.prototype.getPositionOfLineAndCharacter=function(t,r,n){return e.computePositionOfLineAndCharacter(e.getLineStarts(this),t,r,this.text,n)},r.prototype.getLineEndOfPosition=function(e){var t,r=this.getLineAndCharacterOfPosition(e).line,n=this.getLineStarts();r+1>=n.length&&(t=this.getEnd()),t||(t=n[r+1]-1);var i=this.getFullText();return "\n"===i[t]&&"\r"===i[t-1]?t-1:t},r.prototype.getNamedDeclarations=function(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations},r.prototype.computeNamedDeclarations=function(){var t=e.createMultiMap();return this.forEachChild((function i(a){switch(a.kind){case 259:case 215:case 171:case 170:var o=a,s=n(o);if(s){var c=function(e){var r=t.get(e);return r||t.set(e,r=[]),r}(s),l=e.lastOrUndefined(c);l&&o.parent===l.parent&&o.symbol===l.symbol?o.body&&!l.body&&(c[c.length-1]=o):c.push(o);}e.forEachChild(a,i);break;case 260:case 228:case 261:case 262:case 263:case 264:case 268:case 278:case 273:case 270:case 271:case 174:case 175:case 184:r(a),e.forEachChild(a,i);break;case 166:if(!e.hasSyntacticModifier(a,16476))break;case 257:case 205:var u=a;if(e.isBindingPattern(u.name)){e.forEachChild(u.name,i);break}u.initializer&&i(u.initializer);case 302:case 169:case 168:r(a);break;case 275:var _=a;_.exportClause&&(e.isNamedExports(_.exportClause)?e.forEach(_.exportClause.elements,i):i(_.exportClause.name));break;case 269:var d=a.importClause;d&&(d.name&&r(d.name),d.namedBindings&&(271===d.namedBindings.kind?r(d.namedBindings):e.forEach(d.namedBindings.elements,i)));break;case 223:0!==e.getAssignmentDeclarationKind(a)&&r(a);default:e.forEachChild(a,i);}})),t;function r(e){var r=n(e);r&&t.add(r,e);}function n(t){var r=e.getNonAssignedNameOfDeclaration(t);return r&&(e.isComputedPropertyName(r)&&e.isPropertyAccessExpression(r.expression)?r.expression.name.text:e.isPropertyName(r)?e.getNameFromPropertyName(r):void 0)}},r}(r),h=function(){function t(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r;}return t.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},t}();function b(t){var r=!0;for(var n in t)if(e.hasProperty(t,n)&&!x(n)){r=!1;break}if(r)return t;var i={};for(var n in t)e.hasProperty(t,n)&&(i[x(n)?n:n.charAt(0).toLowerCase()+n.substr(1)]=t[n]);return i}function x(e){return !e.length||e.charAt(0)===e.charAt(0).toLowerCase()}e.toEditorSettings=b,e.displayPartsToString=function(t){return t?e.map(t,(function(e){return e.text})).join(""):""},e.getDefaultCompilerOptions=function(){return {target:1,jsx:1}},e.getSupportedCodeFixes=function(){return e.codefix.getSupportedErrorCodes()};var D=function(){function t(e){this.host=e;}return t.prototype.getCurrentSourceFile=function(t){var r,n,i,a,o,s,c,l,u=this.host.getScriptSnapshot(t);if(!u)throw new Error("Could not find file: '"+t+"'.");var _,d=e.getScriptKind(t,this.host),p=this.host.getScriptVersion(t);if(this.currentFileName!==t)_=T(t,u,{languageVersion:99,impliedNodeFormat:e.getImpliedNodeFormatForFile(e.toPath(t,this.host.getCurrentDirectory(),(null===(i=null===(n=(r=this.host).getCompilerHost)||void 0===n?void 0:n.call(r))||void 0===i?void 0:i.getCanonicalFileName)||e.hostGetCanonicalFileName(this.host)),null===(l=null===(c=null===(s=null===(o=(a=this.host).getCompilerHost)||void 0===o?void 0:o.call(a))||void 0===s?void 0:s.getModuleResolutionCache)||void 0===c?void 0:c.call(s))||void 0===l?void 0:l.getPackageJsonInfoCache(),this.host,this.host.getCompilationSettings()),setExternalModuleIndicator:e.getSetExternalModuleIndicator(this.host.getCompilationSettings())},p,!0,d);else if(this.currentFileVersion!==p){var f=u.getChangeRange(this.currentFileScriptSnapshot);_=C(this.currentSourceFile,u,p,f);}return _&&(this.currentFileVersion=p,this.currentFileName=t,this.currentFileScriptSnapshot=u,this.currentSourceFile=_),this.currentSourceFile},t}();function S(e,t,r){e.version=r,e.scriptSnapshot=t;}function T(t,r,n,i,a,o){var s=e.createSourceFile(t,e.getSnapshotText(r),n,a,o);return S(s,r,i),s}function C(t,r,n,i,a){if(i&&n!==t.version){var o=void 0,s=0!==i.span.start?t.text.substr(0,i.span.start):"",c=e.textSpanEnd(i.span)!==t.text.length?t.text.substr(e.textSpanEnd(i.span)):"";if(0===i.newLength)o=s&&c?s+c:s||c;else {var l=r.getText(i.span.start,i.span.start+i.newLength);o=s&&c?s+l+c:s?s+l:l+c;}var u=e.updateSourceFile(t,o,i,a);return S(u,r,n),u.nameTable=void 0,t!==u&&t.scriptSnapshot&&(t.scriptSnapshot.dispose&&t.scriptSnapshot.dispose(),t.scriptSnapshot=void 0),u}var _={languageVersion:t.languageVersion,impliedNodeFormat:t.impliedNodeFormat,setExternalModuleIndicator:t.setExternalModuleIndicator};return T(t.fileName,r,_,n,!0,t.scriptKind)}e.createLanguageServiceSourceFile=T,e.updateLanguageServiceSourceFile=C;var E={isCancellationRequested:e.returnFalse,throwIfCancellationRequested:e.noop},k=function(){function t(e){this.cancellationToken=e;}return t.prototype.isCancellationRequested=function(){return this.cancellationToken.isCancellationRequested()},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"CancellationTokenObject"}),new e.OperationCanceledException},t}(),N=function(){function t(e,t){void 0===t&&(t=20),this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0;}return t.prototype.isCancellationRequested=function(){var t=e.timestamp();return Math.abs(t-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=t,this.hostCancellationToken.isCancellationRequested())},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"ThrottledCancellationToken"}),new e.OperationCanceledException},t}();e.ThrottledCancellationToken=N;var A=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints"],F=n$4(n$4([],A,!0),["getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getOccurrencesAtPosition","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],!1);function P(t){var r=function(t){switch(t.kind){case 10:case 14:case 8:if(164===t.parent.kind)return e.isObjectLiteralElement(t.parent.parent)?t.parent.parent:void 0;case 79:return !e.isObjectLiteralElement(t.parent)||207!==t.parent.parent.kind&&289!==t.parent.parent.kind||t.parent.name!==t?void 0:t.parent}}(t);return r&&(e.isObjectLiteralExpression(r.parent)||e.isJsxAttributes(r.parent))?r:void 0}function w(t,r,n,i){var a=e.getNameFromPropertyName(t.name);if(!a)return e.emptyArray;if(!n.isUnion())return (o=n.getProperty(a))?[o]:e.emptyArray;var o,s=e.mapDefined(n.types,(function(n){return (e.isObjectLiteralExpression(t.parent)||e.isJsxAttributes(t.parent))&&r.isTypeInvalidDueToUnionDiscriminant(n,t.parent)?void 0:n.getProperty(a)}));return i&&(0===s.length||s.length===n.types.length)&&(o=n.getProperty(a))?[o]:0===s.length?e.mapDefined(n.types,(function(e){return e.getProperty(a)})):s}e.createLanguageService=function(t,r,a){var o,s,c;void 0===r&&(r=e.createDocumentRegistry(t.useCaseSensitiveFileNames&&t.useCaseSensitiveFileNames(),t.getCurrentDirectory())),c=void 0===a?e.LanguageServiceMode.Semantic:"boolean"==typeof a?a?e.LanguageServiceMode.Syntactic:e.LanguageServiceMode.Semantic:a;var l,u,_=new D(t),d=0,p=t.getCancellationToken?new k(t.getCancellationToken()):E,f=t.getCurrentDirectory();function g(e){t.log&&t.log(e);}e.maybeSetLocalizedDiagnosticMessages(null===(s=t.getLocalizedDiagnosticMessages)||void 0===s?void 0:s.bind(t));var m=e.hostUsesCaseSensitiveFileNames(t),y=e.createGetCanonicalFileName(m),v=e.getSourceMapper({useCaseSensitiveFileNames:function(){return m},getCurrentDirectory:function(){return f},getProgram:S,fileExists:e.maybeBind(t,t.fileExists),readFile:e.maybeBind(t,t.readFile),getDocumentPositionMapper:e.maybeBind(t,t.getDocumentPositionMapper),getSourceFileLike:e.maybeBind(t,t.getSourceFileLike),log:g});function h(e){var t=l.getSourceFile(e);if(!t){var r=new Error("Could not find source file: '".concat(e,"'."));throw r.ProgramFiles=l.getSourceFiles().map((function(e){return e.fileName})),r}return t}function x(){var i,a,o;if(e.Debug.assert(c!==e.LanguageServiceMode.Syntactic),t.getProjectVersion){var s=t.getProjectVersion();if(s){if(u===s&&!(null===(i=t.hasChangedAutomaticTypeDirectiveNames)||void 0===i?void 0:i.call(t)))return;u=s;}}var _=t.getTypeRootsVersion?t.getTypeRootsVersion():0;d!==_&&(g("TypeRoots version has changed; provide new program"),l=void 0,d=_);var h,b=t.getScriptFileNames().slice(),x=t.getCompilationSettings()||{target:1,jsx:1},D=t.hasInvalidatedResolutions||e.returnFalse,S=e.maybeBind(t,t.hasChangedAutomaticTypeDirectiveNames),T=null===(a=t.getProjectReferences)||void 0===a?void 0:a.call(t),C={getSourceFile:I,getSourceFileByPath:O,getCancellationToken:function(){return p},getCanonicalFileName:y,useCaseSensitiveFileNames:function(){return m},getNewLine:function(){return e.getNewLineCharacter(x,(function(){return e.getNewLineOrDefaultFromHost(t)}))},getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:e.noop,getCurrentDirectory:function(){return f},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile&&t.readFile(e)},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),realpath:e.maybeBind(t,t.realpath),directoryExists:function(r){return e.directoryProbablyExists(r,t)},getDirectories:function(e){return t.getDirectories?t.getDirectories(e):[]},readDirectory:function(r,n,i,a,o){return e.Debug.checkDefined(t.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,n,i,a,o)},onReleaseOldSourceFile:w,onReleaseParsedCommandLine:function(e,r,n){var i;t.getParsedCommandLine?null===(i=t.onReleaseParsedCommandLine)||void 0===i||i.call(t,e,r,n):r&&w(r.sourceFile,n);},hasInvalidatedResolutions:D,hasChangedAutomaticTypeDirectiveNames:S,trace:e.maybeBind(t,t.trace),resolveModuleNames:e.maybeBind(t,t.resolveModuleNames),getModuleResolutionCache:e.maybeBind(t,t.getModuleResolutionCache),resolveTypeReferenceDirectives:e.maybeBind(t,t.resolveTypeReferenceDirectives),useSourceOfProjectReferenceRedirect:e.maybeBind(t,t.useSourceOfProjectReferenceRedirect),getParsedCommandLine:P},E=C.getSourceFile,k=e.changeCompilerHostLikeToUseCache(C,(function(t){return e.toPath(t,f,y)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return E.call.apply(E,n$4([C],e,!1))})).getSourceFileWithCache;C.getSourceFile=k,null===(o=t.setCompilerHost)||void 0===o||o.call(t,C);var N={useCaseSensitiveFileNames:m,fileExists:function(e){return C.fileExists(e)},readFile:function(e){return C.readFile(e)},readDirectory:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return (e=C).readDirectory.apply(e,t)},trace:C.trace,getCurrentDirectory:C.getCurrentDirectory,onUnRecoverableConfigFileDiagnostic:e.noop},A=r.getKeyForCompilationSettings(x);if(!e.isProgramUptoDate(l,b,x,(function(e,r){return t.getScriptVersion(r)}),(function(e){return C.fileExists(e)}),D,S,P,T)){var F={rootNames:b,options:x,host:C,oldProgram:l,projectReferences:T};return l=e.createProgram(F),C=void 0,h=void 0,v.clearCache(),void l.getTypeChecker()}function P(r){var n=e.toPath(r,f,y),i=null==h?void 0:h.get(n);if(void 0!==i)return i||void 0;var a=t.getParsedCommandLine?t.getParsedCommandLine(r):function(t){var r=I(t,100);return r?(r.path=e.toPath(t,f,y),r.resolvedPath=r.path,r.originalFileName=r.fileName,e.parseJsonSourceFileConfigFileContent(r,N,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),f),void 0,e.getNormalizedAbsolutePath(t,f))):void 0}(r);return (h||(h=new e.Map)).set(n,a||!1),a}function w(e,t){var n=r.getKeyForCompilationSettings(t);r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind,e.impliedNodeFormat);}function I(t,r,n,i){return O(t,e.toPath(t,f,y),r,0,i)}function O(n,i,a,o,s){e.Debug.assert(C,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");var c=t.getScriptSnapshot(n);if(c){var u=e.getScriptKind(n,t),_=t.getScriptVersion(n);if(!s){var d=l&&l.getSourceFileByPath(i);if(d){if(u===d.scriptKind)return r.updateDocumentWithKey(n,i,t,A,c,_,u,a);r.releaseDocumentWithKey(d.resolvedPath,r.getKeyForCompilationSettings(l.getCompilerOptions()),d.scriptKind,d.impliedNodeFormat);}}return r.acquireDocumentWithKey(n,i,t,A,c,_,u,a)}}}function S(){if(c!==e.LanguageServiceMode.Syntactic)return x(),l;e.Debug.assert(void 0===l);}function T(t,r,n){var i=e.normalizePath(t);e.Debug.assert(n.some((function(t){return e.normalizePath(t)===i}))),x();var a=e.mapDefined(n,(function(e){return l.getSourceFile(e)})),o=h(t);return e.DocumentHighlights.getDocumentHighlights(l,p,o,r,a)}function C(t,r,n,i){x();var a=n&&2===n.use?l.getSourceFiles().filter((function(e){return !l.isSourceFileDefaultLibrary(e)})):l.getSourceFiles();return e.FindAllReferences.findReferenceOrRenameEntries(l,p,a,t,r,n,i)}var N=new e.Map(e.getEntries(((o={})[18]=19,o[20]=21,o[22]=23,o[31]=29,o)));function I(r){var n;return e.Debug.assertEqual(r.type,"install package"),t.installPackage?t.installPackage({fileName:(n=r.file,e.toPath(n,f,y)),packageName:r.packageName}):Promise.reject("Host does not implement `installPackage`")}function O(e,t){return {lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function M(t,r,n){for(var i=_.getCurrentSourceFile(t),a=[],o=O(i,r),s=o.lineStarts,c=o.firstLine,l=o.lastLine,u=n||!1,d=Number.MAX_VALUE,p=new e.Map,f=new RegExp(/\S/),g=e.isInsideJsxElement(i,s[c]),m=g?"{/*":"//",y=c;y<=l;y++){var v=i.text.substring(s[y],i.getLineEndOfPosition(s[y])),h=f.exec(v);h&&(d=Math.min(d,h.index),p.set(y.toString(),h.index),v.substr(h.index,m.length)!==m&&(u=void 0===n||n));}for(y=c;y<=l;y++)if(c===l||s[y]!==r.end){var b=p.get(y.toString());void 0!==b&&(g?a.push.apply(a,L(t,{pos:s[y]+d,end:i.getLineEndOfPosition(s[y])},u,g)):u?a.push({newText:m,span:{length:0,start:s[y]+d}}):i.text.substr(s[y]+b,m.length)===m&&a.push({newText:"",span:{length:m.length,start:s[y]+b}}));}return a}function L(t,r,n,i){for(var a,o=_.getCurrentSourceFile(t),s=[],c=o.text,l=!1,u=n||!1,d=[],p=r.pos,f=void 0!==i?i:e.isInsideJsxElement(o,p),g=f?"{/*":"/*",m=f?"*/}":"*/",y=f?"\\{\\/\\*":"\\/\\*",v=f?"\\*\\/\\}":"\\*\\/";p<=r.end;){var h=c.substr(p,g.length)===g?g.length:0,b=e.isInComment(o,p+h);if(b)f&&(b.pos--,b.end++),d.push(b.pos),3===b.kind&&d.push(b.end),l=!0,p=b.end+1;else {var x=c.substring(p,r.end).search("(".concat(y,")|(").concat(v,")"));u=void 0!==n?n:u||!e.isTextWhiteSpaceLike(c,p,-1===x?r.end:p+x),p=-1===x?r.end+1:p+x+m.length;}}if(u||!l){2!==(null===(a=e.isInComment(o,r.pos))||void 0===a?void 0:a.kind)&&e.insertSorted(d,r.pos,e.compareValues),e.insertSorted(d,r.end,e.compareValues);var D=d[0];c.substr(D,g.length)!==g&&s.push({newText:g,span:{length:0,start:D}});for(var S=1;S<d.length-1;S++)c.substr(d[S]-m.length,m.length)!==m&&s.push({newText:m,span:{length:0,start:d[S]}}),c.substr(d[S],g.length)!==g&&s.push({newText:g,span:{length:0,start:d[S]}});s.length%2!=0&&s.push({newText:m,span:{length:0,start:d[d.length-1]}});}else for(var T=0,C=d;T<C.length;T++){var E=C[T],k=E-m.length>0?E-m.length:0;h=c.substr(k,m.length)===m?m.length:0,s.push({newText:"",span:{length:g.length,start:E-h}});}return s}function R(t){var r=t.openingElement,n=t.closingElement,i=t.parent;return !e.tagNamesAreEquivalent(r.tagName,n.tagName)||e.isJsxElement(i)&&e.tagNamesAreEquivalent(r.tagName,i.openingElement.tagName)&&R(i)}function B(t){var r=t.closingFragment,n=t.parent;return !!(131072&r.flags)||e.isJsxFragment(n)&&B(n)}function j(r,n,i,a,o,s){var c="number"==typeof n?[n,void 0]:[n.pos,n.end];return {file:r,startPosition:c[0],endPosition:c[1],program:S(),host:t,formatContext:e.formatting.getFormatContext(a,t),cancellationToken:p,preferences:i,triggerReason:o,kind:s}}N.forEach((function(e,t){return N.set(e.toString(),Number(t))}));var J={dispose:function(){if(l){var n=r.getKeyForCompilationSettings(l.getCompilerOptions());e.forEach(l.getSourceFiles(),(function(e){return r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind,e.impliedNodeFormat)})),l=void 0;}t=void 0;},cleanupSemanticCache:function(){l=void 0;},getSyntacticDiagnostics:function(e){return x(),l.getSyntacticDiagnostics(h(e),p).slice()},getSemanticDiagnostics:function(t){x();var r=h(t),i=l.getSemanticDiagnostics(r,p);if(!e.getEmitDeclarations(l.getCompilerOptions()))return i.slice();var a=l.getDeclarationDiagnostics(r,p);return n$4(n$4([],i,!0),a,!0)},getSuggestionDiagnostics:function(t){return x(),e.computeSuggestionDiagnostics(h(t),l,p)},getCompilerOptionsDiagnostics:function(){return x(),n$4(n$4([],l.getOptionsDiagnostics(p),!0),l.getGlobalDiagnostics(p),!0)},getSyntacticClassifications:function(t,r){return e.getSyntacticClassifications(p,_.getCurrentSourceFile(t),r)},getSemanticClassifications:function(t,r,n){return x(),"2020"===(n||"original")?e.classifier.v2020.getSemanticClassifications(l,p,h(t),r):e.getSemanticClassifications(l.getTypeChecker(),p,h(t),l.getClassifiableNames(),r)},getEncodedSyntacticClassifications:function(t,r){return e.getEncodedSyntacticClassifications(p,_.getCurrentSourceFile(t),r)},getEncodedSemanticClassifications:function(t,r,n){return x(),"original"===(n||"original")?e.getEncodedSemanticClassifications(l.getTypeChecker(),p,h(t),l.getClassifiableNames(),r):e.classifier.v2020.getEncodedSemanticClassifications(l,p,h(t),r)},getCompletionsAtPosition:function(r,n,a,o){void 0===a&&(a=e.emptyOptions);var s=i$1(i$1({},e.identity(a)),{includeCompletionsForModuleExports:a.includeCompletionsForModuleExports||a.includeExternalModuleExports,includeCompletionsWithInsertText:a.includeCompletionsWithInsertText||a.includeInsertTextCompletions});return x(),e.Completions.getCompletionsAtPosition(t,l,g,h(r),n,s,a.triggerCharacter,a.triggerKind,p,o&&e.formatting.getFormatContext(o,t))},getCompletionEntryDetails:function(r,n,i,a,o,s,c){return void 0===s&&(s=e.emptyOptions),x(),e.Completions.getCompletionEntryDetails(l,g,h(r),n,{name:i,source:o,data:c},t,a&&e.formatting.getFormatContext(a,t),s,p)},getCompletionEntrySymbol:function(r,n,i,a,o){return void 0===o&&(o=e.emptyOptions),x(),e.Completions.getCompletionEntrySymbol(l,g,h(r),n,{name:i,source:a},t,o)},getSignatureHelpItems:function(t,r,n){var i=(void 0===n?e.emptyOptions:n).triggerReason;x();var a=h(t);return e.SignatureHelp.getSignatureHelpItems(l,a,r,i,p)},getQuickInfoAtPosition:function(t,r){x();var n=h(t),i=e.getTouchingPropertyName(n,r);if(i!==n){var a=l.getTypeChecker(),o=function(t){return e.isNewExpression(t.parent)&&t.pos===t.parent.pos?t.parent.expression:e.isNamedTupleMember(t.parent)&&t.pos===t.parent.pos||e.isImportMeta(t.parent)&&t.parent.name===t?t.parent:t}(i),s=function(t,r){var n=P(t);if(n){var i=r.getContextualType(n.parent),a=i&&w(n,r,i,!1);if(a&&1===a.length)return e.first(a)}return r.getSymbolAtLocation(t)}(o,a);if(!s||a.isUnknownSymbol(s)){var c=function(t,r,n){switch(r.kind){case 79:return !e.isLabelName(r)&&!e.isTagName(r)&&!e.isConstTypeReference(r.parent);case 208:case 163:return !e.isInComment(t,n);case 108:case 194:case 106:case 199:return !0;case 233:return e.isImportMeta(r);default:return !1}}(n,o,r)?a.getTypeAtLocation(o):void 0;return c&&{kind:"",kindModifiers:"",textSpan:e.createTextSpanFromNode(o,n),displayParts:a.runWithCancellationToken(p,(function(t){return e.typeToDisplayParts(t,c,e.getContainerNode(o))})),documentation:c.symbol?c.symbol.getDocumentationComment(a):void 0,tags:c.symbol?c.symbol.getJsDocTags(a):void 0}}var u=a.runWithCancellationToken(p,(function(t){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(t,s,n,e.getContainerNode(o),o)})),_=u.symbolKind,d=u.displayParts,f=u.documentation,g=u.tags;return {kind:_,kindModifiers:e.SymbolDisplay.getSymbolModifiers(a,s),textSpan:e.createTextSpanFromNode(o,n),displayParts:d,documentation:f,tags:g}}},getDefinitionAtPosition:function(t,r,n,i){return x(),e.GoToDefinition.getDefinitionAtPosition(l,h(t),r,n,i)},getDefinitionAndBoundSpan:function(t,r){return x(),e.GoToDefinition.getDefinitionAndBoundSpan(l,h(t),r)},getImplementationAtPosition:function(t,r){return x(),e.FindAllReferences.getImplementationsAtPosition(l,p,l.getSourceFiles(),h(t),r)},getTypeDefinitionAtPosition:function(t,r){return x(),e.GoToDefinition.getTypeDefinitionAtPosition(l.getTypeChecker(),h(t),r)},getReferencesAtPosition:function(t,r){return x(),C(e.getTouchingPropertyName(h(t),r),r,{use:1},e.FindAllReferences.toReferenceEntry)},findReferences:function(t,r){return x(),e.FindAllReferences.findReferencedSymbols(l,p,l.getSourceFiles(),h(t),r)},getFileReferences:function(t){return x(),e.FindAllReferences.Core.getReferencesForFileName(t,l,l.getSourceFiles()).map(e.FindAllReferences.toReferenceEntry)},getOccurrencesAtPosition:function(t,r){return e.flatMap(T(t,r,[t]),(function(e){return e.highlightSpans.map((function(t){return i$1(i$1({fileName:e.fileName,textSpan:t.textSpan,isWriteAccess:"writtenReference"===t.kind},t.isInString&&{isInString:!0}),t.contextSpan&&{contextSpan:t.contextSpan})}))}))},getDocumentHighlights:T,getNameOrDottedNameSpan:function(t,r,n){var i=_.getCurrentSourceFile(t),a=e.getTouchingPropertyName(i,r);if(a!==i){switch(a.kind){case 208:case 163:case 10:case 95:case 110:case 104:case 106:case 108:case 194:case 79:break;default:return}for(var o=a;;)if(e.isRightSideOfPropertyAccess(o)||e.isRightSideOfQualifiedName(o))o=o.parent;else {if(!e.isNameOfModuleDeclaration(o))break;if(264!==o.parent.parent.kind||o.parent.parent.body!==o.parent)break;o=o.parent.parent.name;}return e.createTextSpanFromBounds(o.getStart(),a.getEnd())}},getBreakpointStatementAtPosition:function(t,r){var n=_.getCurrentSourceFile(t);return e.BreakpointResolver.spanInSourceFileAtLocation(n,r)},getNavigateToItems:function(t,r,n,i){void 0===i&&(i=!1),x();var a=n?[h(n)]:l.getSourceFiles();return e.NavigateTo.getNavigateToItems(a,l.getTypeChecker(),p,t,r,i)},getRenameInfo:function(t,r,n){return x(),e.Rename.getRenameInfo(l,h(t),r,n||{})},getSmartSelectionRange:function(t,r){return e.SmartSelectionRange.getSmartSelectionRange(r,_.getCurrentSourceFile(t))},findRenameLocations:function(t,r,n,a,o){x();var s=h(t),c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(s,r));if(e.Rename.nodeIsEligibleForRename(c)){if(e.isIdentifier(c)&&(e.isJsxOpeningElement(c.parent)||e.isJsxClosingElement(c.parent))&&e.isIntrinsicJsxName(c.escapedText)){var l=c.parent.parent;return [l.openingElement,l.closingElement].map((function(t){var r=e.createTextSpanFromNode(t.tagName,s);return i$1({fileName:s.fileName,textSpan:r},e.FindAllReferences.toContextSpan(r,s,t.parent))}))}return C(c,r,{findInStrings:n,findInComments:a,providePrefixAndSuffixTextForRename:o,use:2},(function(t,r,n){return e.FindAllReferences.toRenameLocation(t,r,n,o||!1)}))}},getNavigationBarItems:function(t){return e.NavigationBar.getNavigationBarItems(_.getCurrentSourceFile(t),p)},getNavigationTree:function(t){return e.NavigationBar.getNavigationTree(_.getCurrentSourceFile(t),p)},getOutliningSpans:function(t){var r=_.getCurrentSourceFile(t);return e.OutliningElementsCollector.collectElements(r,p)},getTodoComments:function(t,r){x();var n=h(t);p.throwIfCancellationRequested();var i,a,o=n.text,s=[];if(r.length>0&&(a=n.fileName,!e.stringContains(a,"/node_modules/")))for(var c=function(){var t="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/\/+\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+e.map(r,(function(e){return "("+e.text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+")"})).join("|")+")";return new RegExp(t+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}(),l=void 0;l=c.exec(o);){p.throwIfCancellationRequested(),e.Debug.assert(l.length===r.length+3);var u=l[1],_=l.index+u.length;if(e.isInComment(n,_)){for(var d=void 0,f=0;f<r.length;f++)l[f+3]&&(d=r[f]);if(void 0===d)return e.Debug.fail();if(!((i=o.charCodeAt(_+d.text.length))>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)){var g=l[2];s.push({descriptor:d,message:g,position:_});}}}return s},getBraceMatchingAtPosition:function(t,r){var n=_.getCurrentSourceFile(t),i=e.getTouchingToken(n,r),a=i.getStart(n)===r?N.get(i.kind.toString()):void 0,o=a&&e.findChildOfKind(i.parent,a,n);return o?[e.createTextSpanFromNode(i,n),e.createTextSpanFromNode(o,n)].sort((function(e,t){return e.start-t.start})):e.emptyArray},getIndentationAtPosition:function(t,r,n){var i=e.timestamp(),a=b(n),o=_.getCurrentSourceFile(t);g("getIndentationAtPosition: getCurrentSourceFile: "+(e.timestamp()-i)),i=e.timestamp();var s=e.formatting.SmartIndenter.getIndentation(r,o,a);return g("getIndentationAtPosition: computeIndentation  : "+(e.timestamp()-i)),s},getFormattingEditsForRange:function(r,n,i,a){var o=_.getCurrentSourceFile(r);return e.formatting.formatSelection(n,i,o,e.formatting.getFormatContext(b(a),t))},getFormattingEditsForDocument:function(r,n){return e.formatting.formatDocument(_.getCurrentSourceFile(r),e.formatting.getFormatContext(b(n),t))},getFormattingEditsAfterKeystroke:function(r,n,i,a){var o=_.getCurrentSourceFile(r),s=e.formatting.getFormatContext(b(a),t);if(!e.isInComment(o,n))switch(i){case"{":return e.formatting.formatOnOpeningCurly(n,o,s);case"}":return e.formatting.formatOnClosingCurly(n,o,s);case";":return e.formatting.formatOnSemicolon(n,o,s);case"\n":return e.formatting.formatOnEnter(n,o,s)}return []},getDocCommentTemplateAtPosition:function(r,n,i){return e.JsDoc.getDocCommentTemplateAtPosition(e.getNewLineOrDefaultFromHost(t),_.getCurrentSourceFile(r),n,i)},isValidBraceCompletionAtPosition:function(t,r,n){if(60===n)return !1;var i=_.getCurrentSourceFile(t);if(e.isInString(i,r))return !1;if(e.isInsideJsxElementOrAttribute(i,r))return 123===n;if(e.isInTemplateString(i,r))return !1;switch(n){case 39:case 34:case 96:return !e.isInComment(i,r)}return !0},getJsxClosingTagAtPosition:function(t,r){var n=_.getCurrentSourceFile(t),i=e.findPrecedingToken(r,n);if(i){var a=31===i.kind&&e.isJsxOpeningElement(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxElement(i.parent)?i.parent:void 0;if(a&&R(a))return {newText:"</".concat(a.openingElement.tagName.getText(n),">")};var o=31===i.kind&&e.isJsxOpeningFragment(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxFragment(i.parent)?i.parent:void 0;return o&&B(o)?{newText:"</>"}:void 0}},getSpanOfEnclosingComment:function(t,r,n){var i=_.getCurrentSourceFile(t),a=e.formatting.getRangeOfEnclosingComment(i,r);return !a||n&&3!==a.kind?void 0:e.createTextSpanFromRange(a)},getCodeFixesAtPosition:function(r,n,i,a,o,s){void 0===s&&(s=e.emptyOptions),x();var c=h(r),u=e.createTextSpanFromBounds(n,i),_=e.formatting.getFormatContext(o,t);return e.flatMap(e.deduplicate(a,e.equateValues,e.compareValues),(function(r){return p.throwIfCancellationRequested(),e.codefix.getFixes({errorCode:r,sourceFile:c,span:u,program:l,host:t,cancellationToken:p,formatContext:_,preferences:s})}))},getCombinedCodeFix:function(r,n,i,a){void 0===a&&(a=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var o=h(r.fileName),s=e.formatting.getFormatContext(i,t);return e.codefix.getAllFixes({fixId:n,sourceFile:o,program:l,host:t,cancellationToken:p,formatContext:s,preferences:a})},applyCodeActionCommand:function(t,r){var n="string"==typeof t?r:t;return e.isArray(n)?Promise.all(n.map((function(e){return I(e)}))):I(n)},organizeImports:function(r,n,i){var a;void 0===i&&(i=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var o=h(r.fileName),s=e.formatting.getFormatContext(n,t),c=null!==(a=r.mode)&&void 0!==a?a:r.skipDestructiveCodeActions?"SortAndCombine":"All";return e.OrganizeImports.organizeImports(o,s,t,l,i,c)},getEditsForFileRename:function(r,n,i,a){return void 0===a&&(a=e.emptyOptions),e.getEditsForFileRename(S(),r,n,t,e.formatting.getFormatContext(i,t),a,v)},getEmitOutput:function(r,n,i){x();var a=h(r),o=t.getCustomTransformers&&t.getCustomTransformers();return e.getFileEmitOutput(l,a,!!n,p,o,i)},getNonBoundSourceFile:function(e){return _.getCurrentSourceFile(e)},getProgram:S,getCurrentProgram:function(){return l},getAutoImportProvider:function(){var e;return null===(e=t.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(t)},updateIsDefinitionOfReferencedSymbols:function(r,n){var i=l.getTypeChecker(),a=function(){for(var a=0,o=r;a<o.length;a++)for(var s=0,c=o[a].references;s<c.length;s++){var l=c[s];if(n.has(l)){var u=f(l);return e.Debug.assertIsDefined(u),i.getSymbolAtLocation(u)}var _=e.getMappedDocumentSpan(l,v,e.maybeBind(t,t.fileExists));if(_&&n.has(_)&&(u=f(_)))return i.getSymbolAtLocation(u)}}();if(!a)return !1;for(var o=0,s=r;o<s.length;o++)for(var c=0,u=s[o].references;c<u.length;c++){var _=u[c],d=f(_);if(e.Debug.assertIsDefined(d),n.has(_)||e.FindAllReferences.isDeclarationOfSymbol(d,a)){n.add(_),_.isDefinition=!0;var p=e.getMappedDocumentSpan(_,v,e.maybeBind(t,t.fileExists));p&&n.add(p);}else _.isDefinition=!1;}return !0;function f(t){var r=l.getSourceFile(t.fileName);if(r){var n=e.getTouchingPropertyName(r,t.textSpan.start);return e.FindAllReferences.Core.getAdjustedNode(n,{use:1})}}},getApplicableRefactors:function(t,r,n,i,a){void 0===n&&(n=e.emptyOptions),x();var o=h(t);return e.refactor.getApplicableRefactors(j(o,r,n,e.emptyOptions,i,a))},getEditsForRefactor:function(t,r,n,i,a,o){void 0===o&&(o=e.emptyOptions),x();var s=h(t);return e.refactor.getEditsForRefactor(j(s,n,o,r),i,a)},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:v.toLineColumnOffset(e,t)},getSourceMapper:function(){return v},clearSourceMapperCache:function(){return v.clearCache()},prepareCallHierarchy:function(t,r){x();var n=e.CallHierarchy.resolveCallHierarchyDeclaration(l,e.getTouchingPropertyName(h(t),r));return n&&e.mapOneOrMany(n,(function(t){return e.CallHierarchy.createCallHierarchyItem(l,t)}))},provideCallHierarchyIncomingCalls:function(t,r){x();var n=h(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getIncomingCalls(l,i,p):[]},provideCallHierarchyOutgoingCalls:function(t,r){x();var n=h(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getOutgoingCalls(l,i):[]},toggleLineComment:M,toggleMultilineComment:L,commentSelection:function(e,t){var r=O(_.getCurrentSourceFile(e),t);return r.firstLine===r.lastLine&&t.pos!==t.end?L(e,t,!0):M(e,t,!0)},uncommentSelection:function(t,r){var n=_.getCurrentSourceFile(t),i=[],a=r.pos,o=r.end;a===o&&(o+=e.isInsideJsxElement(n,a)?2:1);for(var s=a;s<=o;s++){var c=e.isInComment(n,s);if(c){switch(c.kind){case 2:i.push.apply(i,M(t,{end:c.end,pos:c.pos+1},!1));break;case 3:i.push.apply(i,L(t,{end:c.end,pos:c.pos+1},!1));}s=c.end+1;}}return i},provideInlayHints:function(r,n,i){void 0===i&&(i=e.emptyOptions),x();var a=h(r);return e.InlayHints.provideInlayHints(function(e,r,n){return {file:e,program:S(),host:t,span:r,preferences:n,cancellationToken:p}}(a,n,i))}};switch(c){case e.LanguageServiceMode.Semantic:break;case e.LanguageServiceMode.PartialSemantic:A.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.PartialSemantic"))}}));break;case e.LanguageServiceMode.Syntactic:F.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.Syntactic"))}}));break;default:e.Debug.assertNever(c);}return J},e.getNameTable=function(t){return t.nameTable||function(t){var r=t.nameTable=new e.Map;t.forEachChild((function t(n){if(e.isIdentifier(n)&&!e.isTagName(n)&&n.escapedText||e.isStringOrNumericLiteralLike(n)&&function(t){return e.isDeclarationName(t)||280===t.parent.kind||function(e){return e&&e.parent&&209===e.parent.kind&&e.parent.argumentExpression===e}(t)||e.isLiteralComputedPropertyDeclarationName(t)}(n)){var i=e.getEscapedTextOfIdentifierOrLiteral(n);r.set(i,void 0===r.get(i)?n.pos:-1);}else e.isPrivateIdentifier(n)&&(i=n.escapedText,r.set(i,void 0===r.get(i)?n.pos:-1));if(e.forEachChild(n,t),e.hasJSDocNodes(n))for(var a=0,o=n.jsDoc;a<o.length;a++){var s=o[a];e.forEachChild(s,t);}}));}(t),t.nameTable},e.getContainingObjectLiteralElement=P,e.getPropertySymbolsFromContextualType=w,e.setObjectAllocator({getNodeConstructor:function(){return r},getTokenConstructor:function(){return l},getIdentifierConstructor:function(){return u},getPrivateIdentifierConstructor:function(){return _},getSourceFileConstructor:function(){return v},getSymbolConstructor:function(){return s},getTypeConstructor:function(){return d},getSignatureConstructor:function(){return p},getSourceMapSourceConstructor:function(){return h}});}(t),function(e){(e.BreakpointResolver||(e.BreakpointResolver={})).spanInSourceFileAtLocation=function(t,r){if(!t.isDeclarationFile){var n=e.getTokenAtPosition(t,r),i=t.getLineAndCharacterOfPosition(r).line;if(t.getLineAndCharacterOfPosition(n.getStart(t)).line>i){var a=e.findPrecedingToken(n.pos,t);if(!a||t.getLineAndCharacterOfPosition(a.getEnd()).line!==i)return;n=a;}if(!(16777216&n.flags))return _(n)}function o(r,n){var i=e.canHaveDecorators(r)?e.findLast(r.modifiers,e.isDecorator):void 0,a=i?e.skipTrivia(t.text,i.end):r.getStart(t);return e.createTextSpanFromBounds(a,(n||r).getEnd())}function s(r,n){return o(r,e.findNextToken(n,n.parent,t))}function c(e,r){return e&&i===t.getLineAndCharacterOfPosition(e.getStart(t)).line?_(e):_(r)}function l(r){return _(e.findPrecedingToken(r.pos,t))}function u(r){return _(e.findNextToken(r,r.parent,t))}function _(r){if(r){var n=r.parent;switch(r.kind){case 240:return b(r.declarationList.declarations[0]);case 257:case 169:case 168:return b(r);case 166:return function t(r){if(e.isBindingPattern(r.name))return T(r.name);if(function(t){return !!t.initializer||void 0!==t.dotDotDotToken||e.hasSyntacticModifier(t,12)}(r))return o(r);var n=r.parent,i=n.parameters.indexOf(r);return e.Debug.assert(-1!==i),0!==i?t(n.parameters[i-1]):_(n.body)}(r);case 259:case 171:case 170:case 174:case 175:case 173:case 215:case 216:return function(e){if(e.body)return x(e)?o(e):_(e.body)}(r);case 238:if(e.isFunctionBlock(r))return v=(y=r).statements.length?y.statements[0]:y.getLastToken(),x(y.parent)?c(y.parent,v):_(v);case 265:return D(r);case 295:return D(r.block);case 241:return o(r.expression);case 250:return o(r.getChildAt(0),r.expression);case 244:return s(r,r.expression);case 243:return _(r.statement);case 256:return o(r.getChildAt(0));case 242:return s(r,r.expression);case 253:return _(r.statement);case 249:case 248:return o(r.getChildAt(0),r.label);case 245:return (m=r).initializer?S(m):m.condition?o(m.condition):m.incrementor?o(m.incrementor):void 0;case 246:return s(r,r.expression);case 247:return S(r);case 252:return s(r,r.expression);case 292:case 293:return _(r.statements[0]);case 255:return D(r.tryBlock);case 254:case 274:return o(r,r.expression);case 268:return o(r,r.moduleReference);case 269:case 275:return o(r,r.moduleSpecifier);case 264:if(1!==e.getModuleInstanceState(r))return;case 260:case 263:case 302:case 205:return o(r);case 251:return _(r.statement);case 167:return function(r,n,i){if(r){var a=r.indexOf(n);if(a>=0){for(var s=a,c=a+1;s>0&&i(r[s-1]);)s--;for(;c<r.length&&i(r[c]);)c++;return e.createTextSpanFromBounds(e.skipTrivia(t.text,r[s].pos),r[c-1].end)}}return o(n)}(n.modifiers,r,e.isDecorator);case 203:case 204:return T(r);case 261:case 262:return;case 26:case 1:return c(e.findPrecedingToken(r.pos,t));case 27:return l(r);case 18:return function(r){switch(r.parent.kind){case 263:var n=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),n.members.length?n.members[0]:n.getLastToken(t));case 260:var i=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),i.members.length?i.members[0]:i.getLastToken(t));case 266:return c(r.parent.parent,r.parent.clauses[0])}return _(r.parent)}(r);case 19:return function(t){switch(t.parent.kind){case 265:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 263:case 260:return o(t);case 238:if(e.isFunctionBlock(t.parent))return o(t);case 295:return _(e.lastOrUndefined(t.parent.statements));case 266:var r=t.parent,n=e.lastOrUndefined(r.clauses);return n?_(e.lastOrUndefined(n.statements)):void 0;case 203:var i=t.parent;return _(e.lastOrUndefined(i.elements)||i);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var a=t.parent;return o(e.lastOrUndefined(a.properties)||a)}return _(t.parent)}}(r);case 23:return function(t){if(204===t.parent.kind){var r=t.parent;return o(e.lastOrUndefined(r.elements)||r)}if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var n=t.parent;return o(e.lastOrUndefined(n.elements)||n)}return _(t.parent)}(r);case 20:return function(e){return 243===e.parent.kind||210===e.parent.kind||211===e.parent.kind?l(e):214===e.parent.kind?u(e):_(e.parent)}(r);case 21:return function(e){switch(e.parent.kind){case 215:case 259:case 216:case 171:case 170:case 174:case 175:case 173:case 244:case 243:case 245:case 247:case 210:case 211:case 214:return l(e);default:return _(e.parent)}}(r);case 58:return function(t){return e.isFunctionLike(t.parent)||299===t.parent.kind||166===t.parent.kind?l(t):_(t.parent)}(r);case 31:case 29:return function(e){return 213===e.parent.kind?u(e):_(e.parent)}(r);case 115:return function(e){return 243===e.parent.kind?s(e,e.parent.expression):_(e.parent)}(r);case 91:case 83:case 96:return u(r);case 162:return function(e){return 247===e.parent.kind?u(e):_(e.parent)}(r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(r))return C(r);if((79===r.kind||227===r.kind||299===r.kind||300===r.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return o(r);if(223===r.kind){var i=r,a=i.left,d=i.operatorToken;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(a))return C(a);if(63===d.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent))return o(r);if(27===d.kind)return _(a)}if(e.isExpressionNode(r))switch(n.kind){case 243:return l(r);case 167:return _(r.parent);case 245:case 247:return o(r);case 223:if(27===r.parent.operatorToken.kind)return o(r);break;case 216:if(r.parent.body===r)return o(r)}switch(r.parent.kind){case 299:if(r.parent.name===r&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent.parent))return _(r.parent.initializer);break;case 213:if(r.parent.type===r)return u(r.parent.type);break;case 257:case 166:var p=r.parent,f=p.initializer,g=p.type;if(f===r||g===r||e.isAssignmentOperator(r.kind))return l(r);break;case 223:if(a=r.parent.left,e.isArrayLiteralOrObjectLiteralDestructuringPattern(a)&&r!==a)return l(r);break;default:if(e.isFunctionLike(r.parent)&&r.parent.type===r)return l(r)}return _(r.parent)}}var m,y,v;function h(r){return e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]===r?o(e.findPrecedingToken(r.pos,t,r.parent),r):o(r)}function b(r){if(246===r.parent.parent.kind)return _(r.parent.parent);var n=r.parent;return e.isBindingPattern(r.name)?T(r.name):e.hasOnlyExpressionInitializer(r)&&r.initializer||e.hasSyntacticModifier(r,1)||247===n.parent.kind?h(r):e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]!==r?_(e.findPrecedingToken(r.pos,t,r.parent)):void 0}function x(t){return e.hasSyntacticModifier(t,1)||260===t.parent.kind&&173!==t.kind}function D(r){switch(r.parent.kind){case 264:if(1!==e.getModuleInstanceState(r.parent))return;case 244:case 242:case 246:return c(r.parent,r.statements[0]);case 245:case 247:return c(e.findPrecedingToken(r.pos,t,r.parent),r.statements[0])}return _(r.statements[0])}function S(e){if(258!==e.initializer.kind)return _(e.initializer);var t=e.initializer;return t.declarations.length>0?_(t.declarations[0]):void 0}function T(t){var r=e.forEach(t.elements,(function(e){return 229!==e.kind?e:void 0}));return r?_(r):205===t.parent.kind?o(t.parent):h(t.parent)}function C(t){e.Debug.assert(204!==t.kind&&203!==t.kind);var r=206===t.kind?t.elements:t.properties,n=e.forEach(r,(function(e){return 229!==e.kind?e:void 0}));return n?_(n):o(223===t.parent.kind?t.parent:t)}}};}(t),function(e){e.transform=function(t,r,n){var i=[];n=e.fixupCompilerOptions(n,i);var a=e.isArray(t)?t:[t],o=e.transformNodes(void 0,void 0,e.factory,n,a,r,!0);return o.diagnostics=e.concatenate(o.diagnostics,i),o};}(t);var l=function(){return this}();!function(e){function t(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message);}var r=function(){function t(e){this.scriptSnapshotShim=e;}return t.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},t.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},t.prototype.getChangeRange=function(t){var r=t,n=this.scriptSnapshotShim.getChangeRange(r.scriptSnapshotShim);if(null===n)return null;var i=JSON.parse(n);return e.createTextChangeRange(e.createTextSpan(i.span.start,i.span.length),i.newLength)},t.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose();},t}(),a=function(){function t(t){var r=this;this.shimHost=t,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(t,n){var i=JSON.parse(r.shimHost.getModuleResolutionsForFile(n));return e.map(t,(function(t){var r=e.getProperty(i,t);return r?{resolvedFileName:r,extension:e.extensionFromPath(r),isExternalLibraryImport:!1}:void 0}))}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return r.shimHost.directoryExists(e)}),"getTypeReferenceDirectiveResolutionsForFile"in this.shimHost&&(this.resolveTypeReferenceDirectives=function(t,n){var i=JSON.parse(r.shimHost.getTypeReferenceDirectiveResolutionsForFile(n));return e.map(t,(function(t){return e.getProperty(i,e.isString(t)?t:t.fileName.toLowerCase())}))});}return t.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e);},t.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e);},t.prototype.error=function(e){this.shimHost.error(e);},t.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},t.prototype.getTypeRootsVersion=function(){return this.shimHost.getTypeRootsVersion?this.shimHost.getTypeRootsVersion():0},t.prototype.useCaseSensitiveFileNames=function(){return !!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},t.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null===e||""===e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");var t=JSON.parse(e);return t.allowNonTsExtensions=!0,t},t.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return JSON.parse(e)},t.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new r(t)},t.prototype.getScriptKind=function(e){return "getScriptKind"in this.shimHost?this.shimHost.getScriptKind(e):0},t.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},t.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null===e||""===e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},t.prototype.getCancellationToken=function(){var t=this.shimHost.getCancellationToken();return new e.ThrottledCancellationToken(t)},t.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.readFile=function(e,t){return this.shimHost.readFile(e,t)},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t}();e.LanguageServiceShimHostAdapter=a;var o=function(){function t(e){var t=this;this.shimHost=e,this.useCaseSensitiveFileNames=!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames(),"directoryExists"in this.shimHost?this.directoryExists=function(e){return t.shimHost.directoryExists(e)}:this.directoryExists=void 0,"realpath"in this.shimHost?this.realpath=function(e){return t.shimHost.realpath(e)}:this.realpath=void 0;}return t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t.prototype.readFile=function(e){return this.shimHost.readFile(e)},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t}();function u(e,t,r,n){return _(e,t,!0,r,n)}function _(r,n,i,a,o){try{var s=function(t,r,n,i){var a;i&&(t.log(r),a=e.timestamp());var o=n();if(i){var s=e.timestamp();if(t.log("".concat(r," completed in ").concat(s-a," msec")),e.isString(o)){var c=o;c.length>128&&(c=c.substring(0,128)+"..."),t.log("  result.length=".concat(c.length,", result='").concat(JSON.stringify(c),"'"));}}return o}(r,n,a,o);return i?JSON.stringify({result:s}):s}catch(i){return i instanceof e.OperationCanceledException?JSON.stringify({canceled:!0}):(t(r,i),i.description=n,JSON.stringify({error:i}))}}e.CoreServicesShimHostAdapter=o;var d=function(){function e(e){this.factory=e,e.registerShim(this);}return e.prototype.dispose=function(e){this.factory.unregisterShim(this);},e}();function p(t,r){return t.map((function(t){return function(t,r){return {message:e.flattenDiagnosticMessageText(t.messageText,r),start:t.start,length:t.length,category:e.diagnosticCategoryName(t),code:t.code,reportsUnnecessary:t.reportsUnnecessary,reportsDeprecated:t.reportsDeprecated}}(t,r)}))}e.realizeDiagnostics=p;var f=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.host=r,i.languageService=n,i.logPerformance=!1,i.logger=i.host,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.dispose=function(e){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,l&&l.CollectGarbage&&(l.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,t.prototype.dispose.call(this,e);},r.prototype.refresh=function(e){this.forwardJSONCall("refresh(".concat(e,")"),(function(){return null}));},r.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",(function(){return e.languageService.cleanupSemanticCache(),null}));},r.prototype.realizeDiagnostics=function(t){return p(t,e.getNewLineOrDefaultFromHost(this.host))},r.prototype.getSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSyntacticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSemanticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getEncodedSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSyntacticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getEncodedSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSemanticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSuggestionDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSuggestionDiagnostics('".concat(e,"')"),(function(){return t.realizeDiagnostics(t.languageService.getSuggestionDiagnostics(e))}))},r.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",(function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)}))},r.prototype.getQuickInfoAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getQuickInfoAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getQuickInfoAtPosition(e,t)}))},r.prototype.getNameOrDottedNameSpan=function(e,t,r){var n=this;return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNameOrDottedNameSpan(e,t,r)}))},r.prototype.getBreakpointStatementAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBreakpointStatementAtPosition(e,t)}))},r.prototype.getSignatureHelpItems=function(e,t,r){var n=this;return this.forwardJSONCall("getSignatureHelpItems('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSignatureHelpItems(e,t,r)}))},r.prototype.getDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAtPosition(e,t)}))},r.prototype.getDefinitionAndBoundSpan=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAndBoundSpan(e,t)}))},r.prototype.getTypeDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getTypeDefinitionAtPosition(e,t)}))},r.prototype.getImplementationAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getImplementationAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getImplementationAtPosition(e,t)}))},r.prototype.getRenameInfo=function(e,t,r){var n=this;return this.forwardJSONCall("getRenameInfo('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getRenameInfo(e,t,r)}))},r.prototype.getSmartSelectionRange=function(e,t){var r=this;return this.forwardJSONCall("getSmartSelectionRange('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getSmartSelectionRange(e,t)}))},r.prototype.findRenameLocations=function(e,t,r,n,i){var a=this;return this.forwardJSONCall("findRenameLocations('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,", ").concat(i,")"),(function(){return a.languageService.findRenameLocations(e,t,r,n,i)}))},r.prototype.getBraceMatchingAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBraceMatchingAtPosition(e,t)}))},r.prototype.isValidBraceCompletionAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.isValidBraceCompletionAtPosition(e,t,r)}))},r.prototype.getSpanOfEnclosingComment=function(e,t,r){var n=this;return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSpanOfEnclosingComment(e,t,r)}))},r.prototype.getIndentationAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getIndentationAtPosition('".concat(e,"', ").concat(t,")"),(function(){var i=JSON.parse(r);return n.languageService.getIndentationAtPosition(e,t,i)}))},r.prototype.getReferencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getReferencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getReferencesAtPosition(e,t)}))},r.prototype.findReferences=function(e,t){var r=this;return this.forwardJSONCall("findReferences('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.findReferences(e,t)}))},r.prototype.getFileReferences=function(e){var t=this;return this.forwardJSONCall("getFileReferences('".concat(e,")"),(function(){return t.languageService.getFileReferences(e)}))},r.prototype.getOccurrencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getOccurrencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getOccurrencesAtPosition(e,t)}))},r.prototype.getDocumentHighlights=function(t,r,n){var i=this;return this.forwardJSONCall("getDocumentHighlights('".concat(t,"', ").concat(r,")"),(function(){var a=i.languageService.getDocumentHighlights(t,r,JSON.parse(n)),o=e.toFileNameLowerCase(e.normalizeSlashes(t));return e.filter(a,(function(t){return e.toFileNameLowerCase(e.normalizeSlashes(t.fileName))===o}))}))},r.prototype.getCompletionsAtPosition=function(e,t,r,n){var i=this;return this.forwardJSONCall("getCompletionsAtPosition('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getCompletionsAtPosition(e,t,r,n)}))},r.prototype.getCompletionEntryDetails=function(e,t,r,n,i,a,o){var s=this;return this.forwardJSONCall("getCompletionEntryDetails('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var c=void 0===n?void 0:JSON.parse(n);return s.languageService.getCompletionEntryDetails(e,t,r,c,i,a,o)}))},r.prototype.getFormattingEditsForRange=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsForRange(e,t,r,a)}))},r.prototype.getFormattingEditsForDocument=function(e,t){var r=this;return this.forwardJSONCall("getFormattingEditsForDocument('".concat(e,"')"),(function(){var n=JSON.parse(t);return r.languageService.getFormattingEditsForDocument(e,n)}))},r.prototype.getFormattingEditsAfterKeystroke=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsAfterKeystroke(e,t,r,a)}))},r.prototype.getDocCommentTemplateAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getDocCommentTemplateAtPosition(e,t,r)}))},r.prototype.getNavigateToItems=function(e,t,r){var n=this;return this.forwardJSONCall("getNavigateToItems('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNavigateToItems(e,t,r)}))},r.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('".concat(e,"')"),(function(){return t.languageService.getNavigationBarItems(e)}))},r.prototype.getNavigationTree=function(e){var t=this;return this.forwardJSONCall("getNavigationTree('".concat(e,"')"),(function(){return t.languageService.getNavigationTree(e)}))},r.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('".concat(e,"')"),(function(){return t.languageService.getOutliningSpans(e)}))},r.prototype.getTodoComments=function(e,t){var r=this;return this.forwardJSONCall("getTodoComments('".concat(e,"')"),(function(){return r.languageService.getTodoComments(e,JSON.parse(t))}))},r.prototype.prepareCallHierarchy=function(e,t){var r=this;return this.forwardJSONCall("prepareCallHierarchy('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.prepareCallHierarchy(e,t)}))},r.prototype.provideCallHierarchyIncomingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyIncomingCalls(e,t)}))},r.prototype.provideCallHierarchyOutgoingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyOutgoingCalls(e,t)}))},r.prototype.provideInlayHints=function(e,t,r){var n=this;return this.forwardJSONCall("provideInlayHints('".concat(e,"', '").concat(JSON.stringify(t),"', ").concat(JSON.stringify(r),")"),(function(){return n.languageService.provideInlayHints(e,t,r)}))},r.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('".concat(e,"')"),(function(){var r=t.languageService.getEmitOutput(e),n=r.diagnostics,a=s(r,["diagnostics"]);return i$1(i$1({},a),{diagnostics:t.realizeDiagnostics(n)})}))},r.prototype.getEmitOutputObject=function(e){var t=this;return _(this.logger,"getEmitOutput('".concat(e,"')"),!1,(function(){return t.languageService.getEmitOutput(e)}),this.logPerformance)},r.prototype.toggleLineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleLineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleLineComment(e,t)}))},r.prototype.toggleMultilineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleMultilineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleMultilineComment(e,t)}))},r.prototype.commentSelection=function(e,t){var r=this;return this.forwardJSONCall("commentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.commentSelection(e,t)}))},r.prototype.uncommentSelection=function(e,t){var r=this;return this.forwardJSONCall("uncommentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.uncommentSelection(e,t)}))},r}(d);function g(e){return {spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var m=function(t){function r(r,n){var i=t.call(this,r)||this;return i.logger=n,i.logPerformance=!1,i.classifier=e.createClassifier(),i}return c(r,t),r.prototype.getEncodedLexicalClassifications=function(e,t,r){var n=this;return void 0===r&&(r=!1),u(this.logger,"getEncodedLexicalClassifications",(function(){return g(n.classifier.getEncodedLexicalClassifications(e,t,r))}),this.logPerformance)},r.prototype.getClassificationsForLine=function(e,t,r){void 0===r&&(r=!1);for(var n=this.classifier.getClassificationsForLine(e,t,r),i="",a=0,o=n.entries;a<o.length;a++){var s=o[a];i+=s.length+"\n",i+=s.classification+"\n";}return i+n.finalLexState},r}(d),y=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.logger=r,i.host=n,i.logPerformance=!1,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.resolveModuleName=function(t,r,n){var i=this;return this.forwardJSONCall("resolveModuleName('".concat(t,"')"),(function(){var a=JSON.parse(n),o=e.resolveModuleName(r,e.normalizeSlashes(t),a,i.host),s=o.resolvedModule?o.resolvedModule.resolvedFileName:void 0;return o.resolvedModule&&".ts"!==o.resolvedModule.extension&&".tsx"!==o.resolvedModule.extension&&".d.ts"!==o.resolvedModule.extension&&(s=void 0),{resolvedFileName:s,failedLookupLocations:o.failedLookupLocations,affectingLocations:o.affectingLocations}}))},r.prototype.resolveTypeReferenceDirective=function(t,r,n){var i=this;return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(t,")"),(function(){var a=JSON.parse(n),o=e.resolveTypeReferenceDirective(r,e.normalizeSlashes(t),a,i.host);return {resolvedFileName:o.resolvedTypeReferenceDirective?o.resolvedTypeReferenceDirective.resolvedFileName:void 0,primary:!o.resolvedTypeReferenceDirective||o.resolvedTypeReferenceDirective.primary,failedLookupLocations:o.failedLookupLocations}}))},r.prototype.getPreProcessedFileInfo=function(t,r){var n=this;return this.forwardJSONCall("getPreProcessedFileInfo('".concat(t,"')"),(function(){var t=e.preProcessFile(e.getSnapshotText(r),!0,!0);return {referencedFiles:n.convertFileReferences(t.referencedFiles),importedFiles:n.convertFileReferences(t.importedFiles),ambientExternalModules:t.ambientExternalModules,isLibFile:t.isLibFile,typeReferenceDirectives:n.convertFileReferences(t.typeReferenceDirectives),libReferenceDirectives:n.convertFileReferences(t.libReferenceDirectives)}}))},r.prototype.getAutomaticTypeDirectiveNames=function(t){var r=this;return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(t,"')"),(function(){var n=JSON.parse(t);return e.getAutomaticTypeDirectiveNames(n,r.host)}))},r.prototype.convertFileReferences=function(t){if(t){for(var r=[],n=0,i=t;n<i.length;n++){var a=i[n];r.push({path:e.normalizeSlashes(a.fileName),position:a.pos,length:a.end-a.pos});}return r}},r.prototype.getTSConfigFileInfo=function(t,r){var i=this;return this.forwardJSONCall("getTSConfigFileInfo('".concat(t,"')"),(function(){var a=e.parseJsonText(t,e.getSnapshotText(r)),o=e.normalizeSlashes(t),s=e.parseJsonSourceFileConfigFileContent(a,i.host,e.getDirectoryPath(o),{},o);return {options:s.options,typeAcquisition:s.typeAcquisition,files:s.fileNames,raw:s.raw,errors:p(n$4(n$4([],a.parseDiagnostics,!0),s.errors,!0),"\r\n")}}))},r.prototype.getDefaultCompilationSettings=function(){return this.forwardJSONCall("getDefaultCompilationSettings()",(function(){return e.getDefaultCompilerOptions()}))},r.prototype.discoverTypings=function(t){var r=this,n=e.createGetCanonicalFileName(!1);return this.forwardJSONCall("discoverTypings()",(function(){var i=JSON.parse(t);return void 0===r.safeList&&(r.safeList=e.JsTyping.loadSafeList(r.host,e.toPath(i.safeListPath,i.safeListPath,n))),e.JsTyping.discoverTypings(r.host,(function(e){return r.logger.log(e)}),i.fileNames,e.toPath(i.projectRootPath,i.projectRootPath,n),r.safeList,i.packageNameToTypingLocation,i.typeAcquisition,i.unresolvedImports,i.typesRegistry,e.emptyOptions)}))},r}(d),v=function(){function r(){this._shims=[];}return r.prototype.getServicesVersion=function(){return e.servicesVersion},r.prototype.createLanguageServiceShim=function(r){try{void 0===this.documentRegistry&&(this.documentRegistry=e.createDocumentRegistry(r.useCaseSensitiveFileNames&&r.useCaseSensitiveFileNames(),r.getCurrentDirectory()));var n=new a(r),i=e.createLanguageService(n,this.documentRegistry,!1);return new f(this,r,i)}catch(e){throw t(r,e),e}},r.prototype.createClassifierShim=function(e){try{return new m(this,e)}catch(r){throw t(e,r),r}},r.prototype.createCoreServicesShim=function(e){try{var r=new o(e);return new y(this,e,r)}catch(r){throw t(e,r),r}},r.prototype.close=function(){e.clear(this._shims),this.documentRegistry=void 0;},r.prototype.registerShim=function(e){this._shims.push(e);},r.prototype.unregisterShim=function(e){for(var t=0;t<this._shims.length;t++)if(this._shims[t]===e)return void delete this._shims[t];throw new Error("Invalid operation")},r}();e.TypeScriptServicesFactory=v;}(t),function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,"undefined"==typeof globalThis&&(window.globalThis=window),delete Object.prototype.__magic__;}catch(e){window.globalThis=window;}}(),("undefined"==typeof process||process.browser)&&(globalThis.TypeScript=globalThis.TypeScript||{},globalThis.TypeScript.Services=globalThis.TypeScript.Services||{},globalThis.TypeScript.Services.TypeScriptServicesFactory=t.TypeScriptServicesFactory,globalThis.toolsVersion=t.versionMajorMinor),"undefined"!=typeof module&&module.exports&&(module.exports=t),function(e){function t(t,r,n,a){if(Object.defineProperty(u,"name",i$1(i$1({},Object.getOwnPropertyDescriptor(u,"name")),{value:t})),a)for(var o=0,s=Object.keys(a);o<s.length;o++){var c=+s[o];!isNaN(c)&&e.hasProperty(r,"".concat(c))&&(r[c]=e.Debug.deprecate(r[c],i$1(i$1({},a[c]),{name:t})));}var l=function(t,r){return function(n){for(var i=0;e.hasProperty(t,"".concat(i))&&e.hasProperty(r,"".concat(i));i++)if((0, r[i])(n))return i}}(r,n);return u;function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l(e),i=void 0!==n?r[n]:void 0;if("function"==typeof i)return i.apply(void 0,e);throw new TypeError("Invalid arguments")}}e.createOverload=t,e.buildOverload=function(e){return {overload:function(r){return {bind:function(n){return {finish:function(){return t(e,r,n)},deprecate:function(i){return {finish:function(){return t(e,r,n,i)}}}}}}}}};}(t),function(e){var t={since:"4.0",warnAfter:"4.1",message:"Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead."};e.createNodeArray=e.Debug.deprecate(e.factory.createNodeArray,t),e.createNumericLiteral=e.Debug.deprecate(e.factory.createNumericLiteral,t),e.createBigIntLiteral=e.Debug.deprecate(e.factory.createBigIntLiteral,t),e.createStringLiteral=e.Debug.deprecate(e.factory.createStringLiteral,t),e.createStringLiteralFromNode=e.Debug.deprecate(e.factory.createStringLiteralFromNode,t),e.createRegularExpressionLiteral=e.Debug.deprecate(e.factory.createRegularExpressionLiteral,t),e.createLoopVariable=e.Debug.deprecate(e.factory.createLoopVariable,t),e.createUniqueName=e.Debug.deprecate(e.factory.createUniqueName,t),e.createPrivateIdentifier=e.Debug.deprecate(e.factory.createPrivateIdentifier,t),e.createSuper=e.Debug.deprecate(e.factory.createSuper,t),e.createThis=e.Debug.deprecate(e.factory.createThis,t),e.createNull=e.Debug.deprecate(e.factory.createNull,t),e.createTrue=e.Debug.deprecate(e.factory.createTrue,t),e.createFalse=e.Debug.deprecate(e.factory.createFalse,t),e.createModifier=e.Debug.deprecate(e.factory.createModifier,t),e.createModifiersFromModifierFlags=e.Debug.deprecate(e.factory.createModifiersFromModifierFlags,t),e.createQualifiedName=e.Debug.deprecate(e.factory.createQualifiedName,t),e.updateQualifiedName=e.Debug.deprecate(e.factory.updateQualifiedName,t),e.createComputedPropertyName=e.Debug.deprecate(e.factory.createComputedPropertyName,t),e.updateComputedPropertyName=e.Debug.deprecate(e.factory.updateComputedPropertyName,t),e.createTypeParameterDeclaration=e.Debug.deprecate(e.factory.createTypeParameterDeclaration,t),e.updateTypeParameterDeclaration=e.Debug.deprecate(e.factory.updateTypeParameterDeclaration,t),e.createParameter=e.Debug.deprecate(e.factory.createParameterDeclaration,t),e.updateParameter=e.Debug.deprecate(e.factory.updateParameterDeclaration,t),e.createDecorator=e.Debug.deprecate(e.factory.createDecorator,t),e.updateDecorator=e.Debug.deprecate(e.factory.updateDecorator,t),e.createProperty=e.Debug.deprecate(e.factory.createPropertyDeclaration,t),e.updateProperty=e.Debug.deprecate(e.factory.updatePropertyDeclaration,t),e.createMethod=e.Debug.deprecate(e.factory.createMethodDeclaration,t),e.updateMethod=e.Debug.deprecate(e.factory.updateMethodDeclaration,t),e.createConstructor=e.Debug.deprecate(e.factory.createConstructorDeclaration,t),e.updateConstructor=e.Debug.deprecate(e.factory.updateConstructorDeclaration,t),e.createGetAccessor=e.Debug.deprecate(e.factory.createGetAccessorDeclaration,t),e.updateGetAccessor=e.Debug.deprecate(e.factory.updateGetAccessorDeclaration,t),e.createSetAccessor=e.Debug.deprecate(e.factory.createSetAccessorDeclaration,t),e.updateSetAccessor=e.Debug.deprecate(e.factory.updateSetAccessorDeclaration,t),e.createCallSignature=e.Debug.deprecate(e.factory.createCallSignature,t),e.updateCallSignature=e.Debug.deprecate(e.factory.updateCallSignature,t),e.createConstructSignature=e.Debug.deprecate(e.factory.createConstructSignature,t),e.updateConstructSignature=e.Debug.deprecate(e.factory.updateConstructSignature,t),e.updateIndexSignature=e.Debug.deprecate(e.factory.updateIndexSignature,t),e.createKeywordTypeNode=e.Debug.deprecate(e.factory.createKeywordTypeNode,t),e.createTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.createTypePredicateNode,t),e.updateTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.updateTypePredicateNode,t),e.createTypeReferenceNode=e.Debug.deprecate(e.factory.createTypeReferenceNode,t),e.updateTypeReferenceNode=e.Debug.deprecate(e.factory.updateTypeReferenceNode,t),e.createFunctionTypeNode=e.Debug.deprecate(e.factory.createFunctionTypeNode,t),e.updateFunctionTypeNode=e.Debug.deprecate(e.factory.updateFunctionTypeNode,t),e.createConstructorTypeNode=e.Debug.deprecate((function(t,r,n){return e.factory.createConstructorTypeNode(void 0,t,r,n)}),t),e.updateConstructorTypeNode=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateConstructorTypeNode(t,t.modifiers,r,n,i)}),t),e.createTypeQueryNode=e.Debug.deprecate(e.factory.createTypeQueryNode,t),e.updateTypeQueryNode=e.Debug.deprecate(e.factory.updateTypeQueryNode,t),e.createTypeLiteralNode=e.Debug.deprecate(e.factory.createTypeLiteralNode,t),e.updateTypeLiteralNode=e.Debug.deprecate(e.factory.updateTypeLiteralNode,t),e.createArrayTypeNode=e.Debug.deprecate(e.factory.createArrayTypeNode,t),e.updateArrayTypeNode=e.Debug.deprecate(e.factory.updateArrayTypeNode,t),e.createTupleTypeNode=e.Debug.deprecate(e.factory.createTupleTypeNode,t),e.updateTupleTypeNode=e.Debug.deprecate(e.factory.updateTupleTypeNode,t),e.createOptionalTypeNode=e.Debug.deprecate(e.factory.createOptionalTypeNode,t),e.updateOptionalTypeNode=e.Debug.deprecate(e.factory.updateOptionalTypeNode,t),e.createRestTypeNode=e.Debug.deprecate(e.factory.createRestTypeNode,t),e.updateRestTypeNode=e.Debug.deprecate(e.factory.updateRestTypeNode,t),e.createUnionTypeNode=e.Debug.deprecate(e.factory.createUnionTypeNode,t),e.updateUnionTypeNode=e.Debug.deprecate(e.factory.updateUnionTypeNode,t),e.createIntersectionTypeNode=e.Debug.deprecate(e.factory.createIntersectionTypeNode,t),e.updateIntersectionTypeNode=e.Debug.deprecate(e.factory.updateIntersectionTypeNode,t),e.createConditionalTypeNode=e.Debug.deprecate(e.factory.createConditionalTypeNode,t),e.updateConditionalTypeNode=e.Debug.deprecate(e.factory.updateConditionalTypeNode,t),e.createInferTypeNode=e.Debug.deprecate(e.factory.createInferTypeNode,t),e.updateInferTypeNode=e.Debug.deprecate(e.factory.updateInferTypeNode,t),e.createImportTypeNode=e.Debug.deprecate(e.factory.createImportTypeNode,t),e.updateImportTypeNode=e.Debug.deprecate(e.factory.updateImportTypeNode,t),e.createParenthesizedType=e.Debug.deprecate(e.factory.createParenthesizedType,t),e.updateParenthesizedType=e.Debug.deprecate(e.factory.updateParenthesizedType,t),e.createThisTypeNode=e.Debug.deprecate(e.factory.createThisTypeNode,t),e.updateTypeOperatorNode=e.Debug.deprecate(e.factory.updateTypeOperatorNode,t),e.createIndexedAccessTypeNode=e.Debug.deprecate(e.factory.createIndexedAccessTypeNode,t),e.updateIndexedAccessTypeNode=e.Debug.deprecate(e.factory.updateIndexedAccessTypeNode,t),e.createMappedTypeNode=e.Debug.deprecate(e.factory.createMappedTypeNode,t),e.updateMappedTypeNode=e.Debug.deprecate(e.factory.updateMappedTypeNode,t),e.createLiteralTypeNode=e.Debug.deprecate(e.factory.createLiteralTypeNode,t),e.updateLiteralTypeNode=e.Debug.deprecate(e.factory.updateLiteralTypeNode,t),e.createObjectBindingPattern=e.Debug.deprecate(e.factory.createObjectBindingPattern,t),e.updateObjectBindingPattern=e.Debug.deprecate(e.factory.updateObjectBindingPattern,t),e.createArrayBindingPattern=e.Debug.deprecate(e.factory.createArrayBindingPattern,t),e.updateArrayBindingPattern=e.Debug.deprecate(e.factory.updateArrayBindingPattern,t),e.createBindingElement=e.Debug.deprecate(e.factory.createBindingElement,t),e.updateBindingElement=e.Debug.deprecate(e.factory.updateBindingElement,t),e.createArrayLiteral=e.Debug.deprecate(e.factory.createArrayLiteralExpression,t),e.updateArrayLiteral=e.Debug.deprecate(e.factory.updateArrayLiteralExpression,t),e.createObjectLiteral=e.Debug.deprecate(e.factory.createObjectLiteralExpression,t),e.updateObjectLiteral=e.Debug.deprecate(e.factory.updateObjectLiteralExpression,t),e.createPropertyAccess=e.Debug.deprecate(e.factory.createPropertyAccessExpression,t),e.updatePropertyAccess=e.Debug.deprecate(e.factory.updatePropertyAccessExpression,t),e.createPropertyAccessChain=e.Debug.deprecate(e.factory.createPropertyAccessChain,t),e.updatePropertyAccessChain=e.Debug.deprecate(e.factory.updatePropertyAccessChain,t),e.createElementAccess=e.Debug.deprecate(e.factory.createElementAccessExpression,t),e.updateElementAccess=e.Debug.deprecate(e.factory.updateElementAccessExpression,t),e.createElementAccessChain=e.Debug.deprecate(e.factory.createElementAccessChain,t),e.updateElementAccessChain=e.Debug.deprecate(e.factory.updateElementAccessChain,t),e.createCall=e.Debug.deprecate(e.factory.createCallExpression,t),e.updateCall=e.Debug.deprecate(e.factory.updateCallExpression,t),e.createCallChain=e.Debug.deprecate(e.factory.createCallChain,t),e.updateCallChain=e.Debug.deprecate(e.factory.updateCallChain,t),e.createNew=e.Debug.deprecate(e.factory.createNewExpression,t),e.updateNew=e.Debug.deprecate(e.factory.updateNewExpression,t),e.createTypeAssertion=e.Debug.deprecate(e.factory.createTypeAssertion,t),e.updateTypeAssertion=e.Debug.deprecate(e.factory.updateTypeAssertion,t),e.createParen=e.Debug.deprecate(e.factory.createParenthesizedExpression,t),e.updateParen=e.Debug.deprecate(e.factory.updateParenthesizedExpression,t),e.createFunctionExpression=e.Debug.deprecate(e.factory.createFunctionExpression,t),e.updateFunctionExpression=e.Debug.deprecate(e.factory.updateFunctionExpression,t),e.createDelete=e.Debug.deprecate(e.factory.createDeleteExpression,t),e.updateDelete=e.Debug.deprecate(e.factory.updateDeleteExpression,t),e.createTypeOf=e.Debug.deprecate(e.factory.createTypeOfExpression,t),e.updateTypeOf=e.Debug.deprecate(e.factory.updateTypeOfExpression,t),e.createVoid=e.Debug.deprecate(e.factory.createVoidExpression,t),e.updateVoid=e.Debug.deprecate(e.factory.updateVoidExpression,t),e.createAwait=e.Debug.deprecate(e.factory.createAwaitExpression,t),e.updateAwait=e.Debug.deprecate(e.factory.updateAwaitExpression,t),e.createPrefix=e.Debug.deprecate(e.factory.createPrefixUnaryExpression,t),e.updatePrefix=e.Debug.deprecate(e.factory.updatePrefixUnaryExpression,t),e.createPostfix=e.Debug.deprecate(e.factory.createPostfixUnaryExpression,t),e.updatePostfix=e.Debug.deprecate(e.factory.updatePostfixUnaryExpression,t),e.createBinary=e.Debug.deprecate(e.factory.createBinaryExpression,t),e.updateConditional=e.Debug.deprecate(e.factory.updateConditionalExpression,t),e.createTemplateExpression=e.Debug.deprecate(e.factory.createTemplateExpression,t),e.updateTemplateExpression=e.Debug.deprecate(e.factory.updateTemplateExpression,t),e.createTemplateHead=e.Debug.deprecate(e.factory.createTemplateHead,t),e.createTemplateMiddle=e.Debug.deprecate(e.factory.createTemplateMiddle,t),e.createTemplateTail=e.Debug.deprecate(e.factory.createTemplateTail,t),e.createNoSubstitutionTemplateLiteral=e.Debug.deprecate(e.factory.createNoSubstitutionTemplateLiteral,t),e.updateYield=e.Debug.deprecate(e.factory.updateYieldExpression,t),e.createSpread=e.Debug.deprecate(e.factory.createSpreadElement,t),e.updateSpread=e.Debug.deprecate(e.factory.updateSpreadElement,t),e.createOmittedExpression=e.Debug.deprecate(e.factory.createOmittedExpression,t),e.createAsExpression=e.Debug.deprecate(e.factory.createAsExpression,t),e.updateAsExpression=e.Debug.deprecate(e.factory.updateAsExpression,t),e.createNonNullExpression=e.Debug.deprecate(e.factory.createNonNullExpression,t),e.updateNonNullExpression=e.Debug.deprecate(e.factory.updateNonNullExpression,t),e.createNonNullChain=e.Debug.deprecate(e.factory.createNonNullChain,t),e.updateNonNullChain=e.Debug.deprecate(e.factory.updateNonNullChain,t),e.createMetaProperty=e.Debug.deprecate(e.factory.createMetaProperty,t),e.updateMetaProperty=e.Debug.deprecate(e.factory.updateMetaProperty,t),e.createTemplateSpan=e.Debug.deprecate(e.factory.createTemplateSpan,t),e.updateTemplateSpan=e.Debug.deprecate(e.factory.updateTemplateSpan,t),e.createSemicolonClassElement=e.Debug.deprecate(e.factory.createSemicolonClassElement,t),e.createBlock=e.Debug.deprecate(e.factory.createBlock,t),e.updateBlock=e.Debug.deprecate(e.factory.updateBlock,t),e.createVariableStatement=e.Debug.deprecate(e.factory.createVariableStatement,t),e.updateVariableStatement=e.Debug.deprecate(e.factory.updateVariableStatement,t),e.createEmptyStatement=e.Debug.deprecate(e.factory.createEmptyStatement,t),e.createExpressionStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateExpressionStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createIf=e.Debug.deprecate(e.factory.createIfStatement,t),e.updateIf=e.Debug.deprecate(e.factory.updateIfStatement,t),e.createDo=e.Debug.deprecate(e.factory.createDoStatement,t),e.updateDo=e.Debug.deprecate(e.factory.updateDoStatement,t),e.createWhile=e.Debug.deprecate(e.factory.createWhileStatement,t),e.updateWhile=e.Debug.deprecate(e.factory.updateWhileStatement,t),e.createFor=e.Debug.deprecate(e.factory.createForStatement,t),e.updateFor=e.Debug.deprecate(e.factory.updateForStatement,t),e.createForIn=e.Debug.deprecate(e.factory.createForInStatement,t),e.updateForIn=e.Debug.deprecate(e.factory.updateForInStatement,t),e.createForOf=e.Debug.deprecate(e.factory.createForOfStatement,t),e.updateForOf=e.Debug.deprecate(e.factory.updateForOfStatement,t),e.createContinue=e.Debug.deprecate(e.factory.createContinueStatement,t),e.updateContinue=e.Debug.deprecate(e.factory.updateContinueStatement,t),e.createBreak=e.Debug.deprecate(e.factory.createBreakStatement,t),e.updateBreak=e.Debug.deprecate(e.factory.updateBreakStatement,t),e.createReturn=e.Debug.deprecate(e.factory.createReturnStatement,t),e.updateReturn=e.Debug.deprecate(e.factory.updateReturnStatement,t),e.createWith=e.Debug.deprecate(e.factory.createWithStatement,t),e.updateWith=e.Debug.deprecate(e.factory.updateWithStatement,t),e.createSwitch=e.Debug.deprecate(e.factory.createSwitchStatement,t),e.updateSwitch=e.Debug.deprecate(e.factory.updateSwitchStatement,t),e.createLabel=e.Debug.deprecate(e.factory.createLabeledStatement,t),e.updateLabel=e.Debug.deprecate(e.factory.updateLabeledStatement,t),e.createThrow=e.Debug.deprecate(e.factory.createThrowStatement,t),e.updateThrow=e.Debug.deprecate(e.factory.updateThrowStatement,t),e.createTry=e.Debug.deprecate(e.factory.createTryStatement,t),e.updateTry=e.Debug.deprecate(e.factory.updateTryStatement,t),e.createDebuggerStatement=e.Debug.deprecate(e.factory.createDebuggerStatement,t),e.createVariableDeclarationList=e.Debug.deprecate(e.factory.createVariableDeclarationList,t),e.updateVariableDeclarationList=e.Debug.deprecate(e.factory.updateVariableDeclarationList,t),e.createFunctionDeclaration=e.Debug.deprecate(e.factory.createFunctionDeclaration,t),e.updateFunctionDeclaration=e.Debug.deprecate(e.factory.updateFunctionDeclaration,t),e.createClassDeclaration=e.Debug.deprecate(e.factory.createClassDeclaration,t),e.updateClassDeclaration=e.Debug.deprecate(e.factory.updateClassDeclaration,t),e.createInterfaceDeclaration=e.Debug.deprecate(e.factory.createInterfaceDeclaration,t),e.updateInterfaceDeclaration=e.Debug.deprecate(e.factory.updateInterfaceDeclaration,t),e.createTypeAliasDeclaration=e.Debug.deprecate(e.factory.createTypeAliasDeclaration,t),e.updateTypeAliasDeclaration=e.Debug.deprecate(e.factory.updateTypeAliasDeclaration,t),e.createEnumDeclaration=e.Debug.deprecate(e.factory.createEnumDeclaration,t),e.updateEnumDeclaration=e.Debug.deprecate(e.factory.updateEnumDeclaration,t),e.createModuleDeclaration=e.Debug.deprecate(e.factory.createModuleDeclaration,t),e.updateModuleDeclaration=e.Debug.deprecate(e.factory.updateModuleDeclaration,t),e.createModuleBlock=e.Debug.deprecate(e.factory.createModuleBlock,t),e.updateModuleBlock=e.Debug.deprecate(e.factory.updateModuleBlock,t),e.createCaseBlock=e.Debug.deprecate(e.factory.createCaseBlock,t),e.updateCaseBlock=e.Debug.deprecate(e.factory.updateCaseBlock,t),e.createNamespaceExportDeclaration=e.Debug.deprecate(e.factory.createNamespaceExportDeclaration,t),e.updateNamespaceExportDeclaration=e.Debug.deprecate(e.factory.updateNamespaceExportDeclaration,t),e.createImportEqualsDeclaration=e.Debug.deprecate(e.factory.createImportEqualsDeclaration,t),e.updateImportEqualsDeclaration=e.Debug.deprecate(e.factory.updateImportEqualsDeclaration,t),e.createImportDeclaration=e.Debug.deprecate(e.factory.createImportDeclaration,t),e.updateImportDeclaration=e.Debug.deprecate(e.factory.updateImportDeclaration,t),e.createNamespaceImport=e.Debug.deprecate(e.factory.createNamespaceImport,t),e.updateNamespaceImport=e.Debug.deprecate(e.factory.updateNamespaceImport,t),e.createNamedImports=e.Debug.deprecate(e.factory.createNamedImports,t),e.updateNamedImports=e.Debug.deprecate(e.factory.updateNamedImports,t),e.createImportSpecifier=e.Debug.deprecate(e.factory.createImportSpecifier,t),e.updateImportSpecifier=e.Debug.deprecate(e.factory.updateImportSpecifier,t),e.createExportAssignment=e.Debug.deprecate(e.factory.createExportAssignment,t),e.updateExportAssignment=e.Debug.deprecate(e.factory.updateExportAssignment,t),e.createNamedExports=e.Debug.deprecate(e.factory.createNamedExports,t),e.updateNamedExports=e.Debug.deprecate(e.factory.updateNamedExports,t),e.createExportSpecifier=e.Debug.deprecate(e.factory.createExportSpecifier,t),e.updateExportSpecifier=e.Debug.deprecate(e.factory.updateExportSpecifier,t),e.createExternalModuleReference=e.Debug.deprecate(e.factory.createExternalModuleReference,t),e.updateExternalModuleReference=e.Debug.deprecate(e.factory.updateExternalModuleReference,t),e.createJSDocTypeExpression=e.Debug.deprecate(e.factory.createJSDocTypeExpression,t),e.createJSDocTypeTag=e.Debug.deprecate(e.factory.createJSDocTypeTag,t),e.createJSDocReturnTag=e.Debug.deprecate(e.factory.createJSDocReturnTag,t),e.createJSDocThisTag=e.Debug.deprecate(e.factory.createJSDocThisTag,t),e.createJSDocComment=e.Debug.deprecate(e.factory.createJSDocComment,t),e.createJSDocParameterTag=e.Debug.deprecate(e.factory.createJSDocParameterTag,t),e.createJSDocClassTag=e.Debug.deprecate(e.factory.createJSDocClassTag,t),e.createJSDocAugmentsTag=e.Debug.deprecate(e.factory.createJSDocAugmentsTag,t),e.createJSDocEnumTag=e.Debug.deprecate(e.factory.createJSDocEnumTag,t),e.createJSDocTemplateTag=e.Debug.deprecate(e.factory.createJSDocTemplateTag,t),e.createJSDocTypedefTag=e.Debug.deprecate(e.factory.createJSDocTypedefTag,t),e.createJSDocCallbackTag=e.Debug.deprecate(e.factory.createJSDocCallbackTag,t),e.createJSDocSignature=e.Debug.deprecate(e.factory.createJSDocSignature,t),e.createJSDocPropertyTag=e.Debug.deprecate(e.factory.createJSDocPropertyTag,t),e.createJSDocTypeLiteral=e.Debug.deprecate(e.factory.createJSDocTypeLiteral,t),e.createJSDocImplementsTag=e.Debug.deprecate(e.factory.createJSDocImplementsTag,t),e.createJSDocAuthorTag=e.Debug.deprecate(e.factory.createJSDocAuthorTag,t),e.createJSDocPublicTag=e.Debug.deprecate(e.factory.createJSDocPublicTag,t),e.createJSDocPrivateTag=e.Debug.deprecate(e.factory.createJSDocPrivateTag,t),e.createJSDocProtectedTag=e.Debug.deprecate(e.factory.createJSDocProtectedTag,t),e.createJSDocReadonlyTag=e.Debug.deprecate(e.factory.createJSDocReadonlyTag,t),e.createJSDocTag=e.Debug.deprecate(e.factory.createJSDocUnknownTag,t),e.createJsxElement=e.Debug.deprecate(e.factory.createJsxElement,t),e.updateJsxElement=e.Debug.deprecate(e.factory.updateJsxElement,t),e.createJsxSelfClosingElement=e.Debug.deprecate(e.factory.createJsxSelfClosingElement,t),e.updateJsxSelfClosingElement=e.Debug.deprecate(e.factory.updateJsxSelfClosingElement,t),e.createJsxOpeningElement=e.Debug.deprecate(e.factory.createJsxOpeningElement,t),e.updateJsxOpeningElement=e.Debug.deprecate(e.factory.updateJsxOpeningElement,t),e.createJsxClosingElement=e.Debug.deprecate(e.factory.createJsxClosingElement,t),e.updateJsxClosingElement=e.Debug.deprecate(e.factory.updateJsxClosingElement,t),e.createJsxFragment=e.Debug.deprecate(e.factory.createJsxFragment,t),e.createJsxText=e.Debug.deprecate(e.factory.createJsxText,t),e.updateJsxText=e.Debug.deprecate(e.factory.updateJsxText,t),e.createJsxOpeningFragment=e.Debug.deprecate(e.factory.createJsxOpeningFragment,t),e.createJsxJsxClosingFragment=e.Debug.deprecate(e.factory.createJsxJsxClosingFragment,t),e.updateJsxFragment=e.Debug.deprecate(e.factory.updateJsxFragment,t),e.createJsxAttribute=e.Debug.deprecate(e.factory.createJsxAttribute,t),e.updateJsxAttribute=e.Debug.deprecate(e.factory.updateJsxAttribute,t),e.createJsxAttributes=e.Debug.deprecate(e.factory.createJsxAttributes,t),e.updateJsxAttributes=e.Debug.deprecate(e.factory.updateJsxAttributes,t),e.createJsxSpreadAttribute=e.Debug.deprecate(e.factory.createJsxSpreadAttribute,t),e.updateJsxSpreadAttribute=e.Debug.deprecate(e.factory.updateJsxSpreadAttribute,t),e.createJsxExpression=e.Debug.deprecate(e.factory.createJsxExpression,t),e.updateJsxExpression=e.Debug.deprecate(e.factory.updateJsxExpression,t),e.createCaseClause=e.Debug.deprecate(e.factory.createCaseClause,t),e.updateCaseClause=e.Debug.deprecate(e.factory.updateCaseClause,t),e.createDefaultClause=e.Debug.deprecate(e.factory.createDefaultClause,t),e.updateDefaultClause=e.Debug.deprecate(e.factory.updateDefaultClause,t),e.createHeritageClause=e.Debug.deprecate(e.factory.createHeritageClause,t),e.updateHeritageClause=e.Debug.deprecate(e.factory.updateHeritageClause,t),e.createCatchClause=e.Debug.deprecate(e.factory.createCatchClause,t),e.updateCatchClause=e.Debug.deprecate(e.factory.updateCatchClause,t),e.createPropertyAssignment=e.Debug.deprecate(e.factory.createPropertyAssignment,t),e.updatePropertyAssignment=e.Debug.deprecate(e.factory.updatePropertyAssignment,t),e.createShorthandPropertyAssignment=e.Debug.deprecate(e.factory.createShorthandPropertyAssignment,t),e.updateShorthandPropertyAssignment=e.Debug.deprecate(e.factory.updateShorthandPropertyAssignment,t),e.createSpreadAssignment=e.Debug.deprecate(e.factory.createSpreadAssignment,t),e.updateSpreadAssignment=e.Debug.deprecate(e.factory.updateSpreadAssignment,t),e.createEnumMember=e.Debug.deprecate(e.factory.createEnumMember,t),e.updateEnumMember=e.Debug.deprecate(e.factory.updateEnumMember,t),e.updateSourceFileNode=e.Debug.deprecate(e.factory.updateSourceFile,t),e.createNotEmittedStatement=e.Debug.deprecate(e.factory.createNotEmittedStatement,t),e.createPartiallyEmittedExpression=e.Debug.deprecate(e.factory.createPartiallyEmittedExpression,t),e.updatePartiallyEmittedExpression=e.Debug.deprecate(e.factory.updatePartiallyEmittedExpression,t),e.createCommaList=e.Debug.deprecate(e.factory.createCommaListExpression,t),e.updateCommaList=e.Debug.deprecate(e.factory.updateCommaListExpression,t),e.createBundle=e.Debug.deprecate(e.factory.createBundle,t),e.updateBundle=e.Debug.deprecate(e.factory.updateBundle,t),e.createImmediatelyInvokedFunctionExpression=e.Debug.deprecate(e.factory.createImmediatelyInvokedFunctionExpression,t),e.createImmediatelyInvokedArrowFunction=e.Debug.deprecate(e.factory.createImmediatelyInvokedArrowFunction,t),e.createVoidZero=e.Debug.deprecate(e.factory.createVoidZero,t),e.createExportDefault=e.Debug.deprecate(e.factory.createExportDefault,t),e.createExternalModuleExport=e.Debug.deprecate(e.factory.createExternalModuleExport,t),e.createNamespaceExport=e.Debug.deprecate(e.factory.createNamespaceExport,t),e.updateNamespaceExport=e.Debug.deprecate(e.factory.updateNamespaceExport,t),e.createToken=e.Debug.deprecate((function(t){return e.factory.createToken(t)}),t),e.createIdentifier=e.Debug.deprecate((function(t){return e.factory.createIdentifier(t,void 0,void 0)}),t),e.createTempVariable=e.Debug.deprecate((function(t){return e.factory.createTempVariable(t,void 0)}),t),e.getGeneratedNameForNode=e.Debug.deprecate((function(t){return e.factory.getGeneratedNameForNode(t,void 0)}),t),e.createOptimisticUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,16)}),t),e.createFileLevelUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,48)}),t),e.createIndexSignature=e.Debug.deprecate((function(t,r,n,i){return e.factory.createIndexSignature(t,r,n,i)}),t),e.createTypePredicateNode=e.Debug.deprecate((function(t,r){return e.factory.createTypePredicateNode(void 0,t,r)}),t),e.updateTypePredicateNode=e.Debug.deprecate((function(t,r,n){return e.factory.updateTypePredicateNode(t,void 0,r,n)}),t),e.createLiteral=e.Debug.deprecate((function(t){return "number"==typeof t?e.factory.createNumericLiteral(t):"object"==typeof t&&"base10Value"in t?e.factory.createBigIntLiteral(t):"boolean"==typeof t?t?e.factory.createTrue():e.factory.createFalse():"string"==typeof t?e.factory.createStringLiteral(t,void 0):e.factory.createStringLiteralFromNode(t)}),{since:"4.0",warnAfter:"4.1",message:"Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead."}),e.createMethodSignature=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createMethodSignature(void 0,i,a,t,r,n)}),t),e.updateMethodSignature=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateMethodSignature(t,t.modifiers,a,o,r,n,i)}),t),e.createTypeOperatorNode=e.Debug.deprecate((function(t,r){var n;return r?n=t:(r=t,n=141),e.factory.createTypeOperatorNode(n,r)}),t),e.createTaggedTemplate=e.Debug.deprecate((function(t,r,n){var i;return n?i=r:n=r,e.factory.createTaggedTemplateExpression(t,i,n)}),t),e.updateTaggedTemplate=e.Debug.deprecate((function(t,r,n,i){var a;return i?a=n:i=n,e.factory.updateTaggedTemplateExpression(t,r,a,i)}),t),e.updateBinary=e.Debug.deprecate((function(t,r,n,i){return void 0===i&&(i=t.operatorToken),"number"==typeof i&&(i=i===t.operatorToken.kind?t.operatorToken:e.factory.createToken(i)),e.factory.updateBinaryExpression(t,r,i,n)}),t),e.createConditional=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.createConditionalExpression(t,r,n,i,a):3===arguments.length?e.factory.createConditionalExpression(t,e.factory.createToken(57),r,e.factory.createToken(58),n):e.Debug.fail("Argument count mismatch")}),t),e.createYield=e.Debug.deprecate((function(t,r){var n;return r?n=t:r=t,e.factory.createYieldExpression(n,r)}),t),e.createClassExpression=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createClassExpression(void 0,t,r,n,i,a)}),t),e.updateClassExpression=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateClassExpression(t,void 0,r,n,i,a,o)}),t),e.createPropertySignature=e.Debug.deprecate((function(t,r,n,i,a){var o=e.factory.createPropertySignature(t,r,n,i);return o.initializer=a,o}),t),e.updatePropertySignature=e.Debug.deprecate((function(t,r,n,i,a,o){var s=e.factory.updatePropertySignature(t,r,n,i,a);return t.initializer!==o&&(s===t&&(s=e.factory.cloneNode(t)),s.initializer=o),s}),t),e.createExpressionWithTypeArguments=e.Debug.deprecate((function(t,r){return e.factory.createExpressionWithTypeArguments(r,t)}),t),e.updateExpressionWithTypeArguments=e.Debug.deprecate((function(t,r,n){return e.factory.updateExpressionWithTypeArguments(t,n,r)}),t),e.createArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o){return 6===arguments.length?e.factory.createArrowFunction(t,r,n,i,a,o):5===arguments.length?e.factory.createArrowFunction(t,r,n,i,void 0,a):e.Debug.fail("Argument count mismatch")}),t),e.updateArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o,s){return 7===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,o,s):6===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,t.equalsGreaterThanToken,o):e.Debug.fail("Argument count mismatch")}),t),e.createVariableDeclaration=e.Debug.deprecate((function(t,r,n,i){return 4===arguments.length?e.factory.createVariableDeclaration(t,r,n,i):arguments.length>=1&&arguments.length<=3?e.factory.createVariableDeclaration(t,void 0,r,n):e.Debug.fail("Argument count mismatch")}),t),e.updateVariableDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.updateVariableDeclaration(t,r,n,i,a):4===arguments.length?e.factory.updateVariableDeclaration(t,r,t.exclamationToken,n,i):e.Debug.fail("Argument count mismatch")}),t),e.createImportClause=e.Debug.deprecate((function(t,r,n){return void 0===n&&(n=!1),e.factory.createImportClause(n,t,r)}),t),e.updateImportClause=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateImportClause(t,i,r,n)}),t),e.createExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return void 0===a&&(a=!1),e.factory.createExportDeclaration(t,r,a,n,i)}),t),e.updateExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateExportDeclaration(t,r,n,o,i,a,t.assertClause)}),t),e.createJSDocParamTag=e.Debug.deprecate((function(t,r,n,i){return e.factory.createJSDocParameterTag(void 0,t,r,n,!1,i?e.factory.createNodeArray([e.factory.createJSDocText(i)]):void 0)}),t),e.createComma=e.Debug.deprecate((function(t,r){return e.factory.createComma(t,r)}),t),e.createLessThan=e.Debug.deprecate((function(t,r){return e.factory.createLessThan(t,r)}),t),e.createAssignment=e.Debug.deprecate((function(t,r){return e.factory.createAssignment(t,r)}),t),e.createStrictEquality=e.Debug.deprecate((function(t,r){return e.factory.createStrictEquality(t,r)}),t),e.createStrictInequality=e.Debug.deprecate((function(t,r){return e.factory.createStrictInequality(t,r)}),t),e.createAdd=e.Debug.deprecate((function(t,r){return e.factory.createAdd(t,r)}),t),e.createSubtract=e.Debug.deprecate((function(t,r){return e.factory.createSubtract(t,r)}),t),e.createLogicalAnd=e.Debug.deprecate((function(t,r){return e.factory.createLogicalAnd(t,r)}),t),e.createLogicalOr=e.Debug.deprecate((function(t,r){return e.factory.createLogicalOr(t,r)}),t),e.createPostfixIncrement=e.Debug.deprecate((function(t){return e.factory.createPostfixIncrement(t)}),t),e.createLogicalNot=e.Debug.deprecate((function(t){return e.factory.createLogicalNot(t)}),t),e.createNode=e.Debug.deprecate((function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),e.setTextRangePosEnd(308===t?e.parseBaseNodeFactory.createBaseSourceFileNode(t):79===t?e.parseBaseNodeFactory.createBaseIdentifierNode(t):80===t?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(t):e.isNodeKind(t)?e.parseBaseNodeFactory.createBaseNode(t):e.parseBaseNodeFactory.createBaseTokenNode(t),r,n)}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate((function(t){var r=e.factory.cloneNode(t);return e.setTextRange(r,t),e.setParent(r,t.parent),r}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."});}(t),function(e){e.isTypeAssertion=e.Debug.deprecate((function(e){return 213===e.kind}),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."});}(t),function(e){e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate((function(t){return e.isMemberName(t)}),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."});}(t),function(e){function t(t){var r=t.createConstructorTypeNode,n=t.updateConstructorTypeNode;t.createConstructorTypeNode=e.buildOverload("createConstructorTypeNode").overload({0:function(e,t,n,i){return r(e,t,n,i)},1:function(e,t,n){return r(void 0,e,t,n)}}).bind({0:function(e){return 4===e.length},1:function(e){return 3===e.length}}).deprecate({1:{since:"4.2",warnAfter:"4.3",message:"Use the overload that accepts 'modifiers'"}}).finish(),t.updateConstructorTypeNode=e.buildOverload("updateConstructorTypeNode").overload({0:function(e,t,r,i,a){return n(e,t,r,i,a)},1:function(e,t,r,i){return n(e,e.modifiers,t,r,i)}}).bind({0:function(e){return 5===e.length},1:function(e){return 4===e.length}}).deprecate({1:{since:"4.2",warnAfter:"4.3",message:"Use the overload that accepts 'modifiers'"}}).finish();}var r=e.createNodeFactory;e.createNodeFactory=function(e,n){var i=r(e,n);return t(i),i},t(e.factory);}(t),function(e){function t(t){var r=t.createImportTypeNode,n=t.updateImportTypeNode;t.createImportTypeNode=e.buildOverload("createImportTypeNode").overload({0:function(e,t,n,i,a){return r(e,t,n,i,a)},1:function(e,t,n,i){return r(e,void 0,t,n,i)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||e.isImportTypeAssertionContainer(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||"boolean"==typeof a)},1:function(t){var r=t[1],n=t[2],i=t[3];return void 0===t[4]&&(void 0===r||e.isEntityName(r))&&(void 0===n||e.isArray(n))&&(void 0===i||"boolean"==typeof i)}}).deprecate({1:{since:"4.6",warnAfter:"4.7",message:"Use the overload that accepts 'assertions'"}}).finish(),t.updateImportTypeNode=e.buildOverload("updateImportTypeNode").overload({0:function(e,t,r,i,a,o){return n(e,t,r,i,a,o)},1:function(e,t,r,i,a){return n(e,t,e.assertions,r,i,a)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return (void 0===r||e.isImportTypeAssertionContainer(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||"boolean"==typeof a)},1:function(t){var r=t[2],n=t[3],i=t[4];return void 0===t[5]&&(void 0===r||e.isEntityName(r))&&(void 0===n||e.isArray(n))&&(void 0===i||"boolean"==typeof i)}}).deprecate({1:{since:"4.6",warnAfter:"4.7",message:"Use the overload that accepts 'assertions'"}}).finish();}var r=e.createNodeFactory;e.createNodeFactory=function(e,n){var i=r(e,n);return t(i),i},t(e.factory);}(t),function(e){function t(t){var r=t.createTypeParameterDeclaration,n=t.updateTypeParameterDeclaration;t.createTypeParameterDeclaration=e.buildOverload("createTypeParameterDeclaration").overload({0:function(e,t,n,i){return r(e,t,n,i)},1:function(e,t,n){return r(void 0,e,t,n)}}).bind({0:function(t){var r=t[0];return void 0===r||e.isArray(r)},1:function(t){var r=t[0];return void 0!==r&&!e.isArray(r)}}).deprecate({1:{since:"4.7",warnAfter:"4.8",message:"Use the overload that accepts 'modifiers'"}}).finish(),t.updateTypeParameterDeclaration=e.buildOverload("updateTypeParameterDeclaration").overload({0:function(e,t,r,i,a){return n(e,t,r,i,a)},1:function(e,t,r,i){return n(e,e.modifiers,t,r,i)}}).bind({0:function(t){var r=t[1];return void 0===r||e.isArray(r)},1:function(t){var r=t[1];return void 0!==r&&!e.isArray(r)}}).deprecate({1:{since:"4.7",warnAfter:"4.8",message:"Use the overload that accepts 'modifiers'"}}).finish();}var r=e.createNodeFactory;e.createNodeFactory=function(e,n){var i=r(e,n);return t(i),i},t(e.factory);}(t),function(e){var t={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter."},r={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter."},n={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters."};function i(i){var a=i.createParameterDeclaration,o=i.updateParameterDeclaration,s=i.createPropertyDeclaration,c=i.updatePropertyDeclaration,l=i.createMethodDeclaration,u=i.updateMethodDeclaration,_=i.createConstructorDeclaration,d=i.updateConstructorDeclaration,p=i.createGetAccessorDeclaration,f=i.updateGetAccessorDeclaration,g=i.createSetAccessorDeclaration,m=i.updateSetAccessorDeclaration,y=i.createIndexSignature,v=i.updateIndexSignature,h=i.createClassStaticBlockDeclaration,b=i.updateClassStaticBlockDeclaration,x=i.createClassExpression,D=i.updateClassExpression,S=i.createFunctionDeclaration,T=i.updateFunctionDeclaration,C=i.createClassDeclaration,E=i.updateClassDeclaration,k=i.createInterfaceDeclaration,N=i.updateInterfaceDeclaration,A=i.createTypeAliasDeclaration,F=i.updateTypeAliasDeclaration,P=i.createEnumDeclaration,w=i.updateEnumDeclaration,I=i.createModuleDeclaration,O=i.updateModuleDeclaration,M=i.createImportEqualsDeclaration,L=i.updateImportEqualsDeclaration,R=i.createImportDeclaration,B=i.updateImportDeclaration,j=i.createExportAssignment,J=i.updateExportAssignment,z=i.createExportDeclaration,U=i.updateExportDeclaration;i.createParameterDeclaration=e.buildOverload("createParameterDeclaration").overload({0:function(e,t,r,n,i,o){return a(e,t,r,n,i,o)},1:function(t,r,n,i,o,s,c){return a(e.concatenate(t,r),n,i,o,s,c)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return void 0===t[6]&&(void 0===r||!e.isArray(r))&&(void 0===n||"string"==typeof n||e.isBindingName(n))&&(void 0===i||"object"==typeof i&&e.isQuestionToken(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isExpression(o))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6];return (void 0===r||e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isDotDotDotToken(n))&&(void 0===i||"string"==typeof i||e.isBindingName(i))&&(void 0===a||e.isQuestionToken(a))&&(void 0===o||e.isTypeNode(o))&&(void 0===s||e.isExpression(s))}}).deprecate({1:t}).finish(),i.updateParameterDeclaration=e.buildOverload("updateParameterDeclaration").overload({0:function(e,t,r,n,i,a,s){return o(e,t,r,n,i,a,s)},1:function(t,r,n,i,a,s,c,l){return o(t,e.concatenate(r,n),i,a,s,c,l)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6];return void 0===t[7]&&(void 0===r||!e.isArray(r))&&(void 0===n||"string"==typeof n||e.isBindingName(n))&&(void 0===i||"object"==typeof i&&e.isQuestionToken(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isExpression(o))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6],s=t[7];return (void 0===r||e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isDotDotDotToken(n))&&(void 0===i||"string"==typeof i||e.isBindingName(i))&&(void 0===a||e.isQuestionToken(a))&&(void 0===o||e.isTypeNode(o))&&(void 0===s||e.isExpression(s))}}).deprecate({1:t}).finish(),i.createPropertyDeclaration=e.buildOverload("createPropertyDeclaration").overload({0:function(e,t,r,n,i){return s(e,t,r,n,i)},1:function(t,r,n,i,a,o){return s(e.concatenate(t,r),n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||!e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isQuestionOrExclamationToken(n))&&(void 0===i||e.isTypeNode(i))&&(void 0===a||e.isExpression(a))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.isArray(r))&&(void 0===n||"string"==typeof n||e.isPropertyName(n))&&(void 0===i||e.isQuestionOrExclamationToken(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isExpression(o))}}).deprecate({1:t}).finish(),i.updatePropertyDeclaration=e.buildOverload("updatePropertyDeclaration").overload({0:function(e,t,r,n,i,a){return c(e,t,r,n,i,a)},1:function(t,r,n,i,a,o,s){return c(t,e.concatenate(r,n),i,a,o,s)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return void 0===t[6]&&(void 0===r||!e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isQuestionOrExclamationToken(n))&&(void 0===i||e.isTypeNode(i))&&(void 0===a||e.isExpression(a))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6];return (void 0===r||e.isArray(r))&&(void 0===n||"string"==typeof n||e.isPropertyName(n))&&(void 0===i||e.isQuestionOrExclamationToken(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isExpression(o))}}).deprecate({1:t}).finish(),i.createMethodDeclaration=e.buildOverload("createMethodDeclaration").overload({0:function(e,t,r,n,i,a,o,s){return l(e,t,r,n,i,a,o,s)},1:function(t,r,n,i,a,o,s,c,u){return l(e.concatenate(t,r),n,i,a,o,s,c,u)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7];return void 0===t[8]&&(void 0===r||!e.isArray(r))&&(void 0===n||"string"==typeof n||e.isPropertyName(n))&&(void 0===i||"object"==typeof i&&e.isQuestionToken(i))&&(void 0===a||e.isArray(a))&&(void 0===o||!e.some(o,e.isTypeParameterDeclaration))&&(void 0===s||!e.isArray(s))&&(void 0===c||e.isBlock(c))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return (void 0===r||e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isAsteriskToken(n))&&(void 0===i||"string"==typeof i||e.isPropertyName(i))&&(void 0===a||!e.isArray(a))&&(void 0===o||!e.some(o,e.isParameter))&&(void 0===s||e.isArray(s))&&(void 0===c||e.isTypeNode(c))&&(void 0===l||e.isBlock(l))}}).deprecate({1:t}).finish(),i.updateMethodDeclaration=e.buildOverload("updateMethodDeclaration").overload({0:function(e,t,r,n,i,a,o,s,c){return u(e,t,r,n,i,a,o,s,c)},1:function(t,r,n,i,a,o,s,c,l,_){return u(t,e.concatenate(r,n),i,a,o,s,c,l,_)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6],s=t[7],c=t[8];return void 0===t[9]&&(void 0===r||!e.isArray(r))&&(void 0===n||"string"==typeof n||e.isPropertyName(n))&&(void 0===i||"object"==typeof i&&e.isQuestionToken(i))&&(void 0===a||e.isArray(a))&&(void 0===o||!e.some(o,e.isTypeParameterDeclaration))&&(void 0===s||!e.isArray(s))&&(void 0===c||e.isBlock(c))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6],s=t[7],c=t[8],l=t[9];return (void 0===r||e.isArray(r))&&(void 0===n||"object"==typeof n&&e.isAsteriskToken(n))&&(void 0===i||"string"==typeof i||e.isPropertyName(i))&&(void 0===a||!e.isArray(a))&&(void 0===o||!e.some(o,e.isParameter))&&(void 0===s||e.isArray(s))&&(void 0===c||e.isTypeNode(c))&&(void 0===l||e.isBlock(l))}}).deprecate({1:t}).finish(),i.createConstructorDeclaration=e.buildOverload("createConstructorDeclaration").overload({0:function(e,t,r){return _(e,t,r)},1:function(e,t,r,n){return _(t,r,n)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2];return !(void 0!==t[3]||void 0!==r&&e.some(r,e.isDecorator)||void 0!==n&&e.some(n,e.isModifier)||void 0!==i&&e.isArray(i))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return (void 0===r||!e.some(r,e.isModifier))&&(void 0===n||!e.some(n,e.isParameter))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isBlock(a))}}).deprecate({1:r}).finish(),i.updateConstructorDeclaration=e.buildOverload("updateConstructorDeclaration").overload({0:function(e,t,r,n){return d(e,t,r,n)},1:function(e,t,r,n,i){return d(e,r,n,i)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return !(void 0!==t[4]||void 0!==r&&e.some(r,e.isDecorator)||void 0!==n&&e.some(n,e.isModifier)||void 0!==i&&e.isArray(i))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||!e.some(r,e.isModifier))&&(void 0===n||!e.some(n,e.isParameter))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isBlock(a))}}).deprecate({1:r}).finish(),i.createGetAccessorDeclaration=e.buildOverload("createGetAccessorDeclaration").overload({0:function(e,t,r,n,i){return p(e,t,r,n,i)},1:function(t,r,n,i,a,o){return p(e.concatenate(t,r),n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isBlock(a))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isBlock(o))}}).deprecate({1:t}).finish(),i.updateGetAccessorDeclaration=e.buildOverload("updateGetAccessorDeclaration").overload({0:function(e,t,r,n,i,a){return f(e,t,r,n,i,a)},1:function(t,r,n,i,a,o,s){return f(t,e.concatenate(r,n),i,a,o,s)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return void 0===t[6]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isBlock(a))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isTypeNode(a))&&(void 0===o||e.isBlock(o))}}).deprecate({1:t}).finish(),i.createSetAccessorDeclaration=e.buildOverload("createSetAccessorDeclaration").overload({0:function(e,t,r,n){return g(e,t,r,n)},1:function(t,r,n,i,a){return g(e.concatenate(t,r),n,i,a)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return void 0===t[4]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isBlock(a))}}).deprecate({1:t}).finish(),i.updateSetAccessorDeclaration=e.buildOverload("updateSetAccessorDeclaration").overload({0:function(e,t,r,n,i){return m(e,t,r,n,i)},1:function(t,r,n,i,a,o){return m(t,e.concatenate(r,n),i,a,o)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4];return void 0===t[5]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isBlock(a))}}).deprecate({1:t}).finish(),i.createIndexSignature=e.buildOverload("createIndexSignature").overload({0:function(e,t,r){return y(e,t,r)},1:function(e,t,r,n){return y(t,r,n)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2];return void 0===t[3]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||e.every(n,e.isParameter))&&(void 0===i||!e.isArray(i))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.every(n,e.isModifier))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isTypeNode(a))}}).deprecate({1:r}).finish(),i.updateIndexSignature=e.buildOverload("updateIndexSignature").overload({0:function(e,t,r,n){return v(e,t,r,n)},1:function(e,t,r,n,i){return v(e,r,n,i)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||e.every(n,e.isParameter))&&(void 0===i||!e.isArray(i))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.every(n,e.isModifier))&&(void 0===i||e.isArray(i))&&(void 0===a||e.isTypeNode(a))}}).deprecate({1:r}).finish(),i.createClassStaticBlockDeclaration=e.buildOverload("createClassStaticBlockDeclaration").overload({0:function(e){return h(e)},1:function(e,t,r){return h(r)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2];return void 0===n&&void 0===i&&(void 0===r||!e.isArray(r))},1:function(t){var r=t[0],n=t[1],i=t[2];return (void 0===r||e.isArray(r))&&(void 0===n||e.isArray(r))&&(void 0===i||e.isBlock(i))}}).deprecate({1:n}).finish(),i.updateClassStaticBlockDeclaration=e.buildOverload("updateClassStaticBlockDeclaration").overload({0:function(e,t){return b(e,t)},1:function(e,t,r,n){return b(e,n)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return void 0===n&&void 0===i&&(void 0===r||!e.isArray(r))},1:function(t){var r=t[1],n=t[2],i=t[3];return (void 0===r||e.isArray(r))&&(void 0===n||e.isArray(r))&&(void 0===i||e.isBlock(i))}}).deprecate({1:n}).finish(),i.createClassExpression=e.buildOverload("createClassExpression").overload({0:function(e,t,r,n,i){return x(e,t,r,n,i)},1:function(t,r,n,i,a,o){return x(e.concatenate(t,r),n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||e.every(i,e.isHeritageClause))&&(void 0===a||e.every(a,e.isClassElement))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.every(i,e.isTypeParameterDeclaration))&&(void 0===a||e.every(a,e.isHeritageClause))&&(void 0===o||e.isArray(o))}}).deprecate({1:r}).finish(),i.updateClassExpression=e.buildOverload("updateClassExpression").overload({0:function(e,t,r,n,i,a){return D(e,t,r,n,i,a)},1:function(t,r,n,i,a,o,s){return D(t,e.concatenate(r,n),i,a,o,s)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return void 0===t[6]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||e.every(i,e.isHeritageClause))&&(void 0===a||e.every(a,e.isClassElement))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.every(i,e.isTypeParameterDeclaration))&&(void 0===a||e.every(a,e.isHeritageClause))&&(void 0===o||e.isArray(o))}}).deprecate({1:r}).finish(),i.createFunctionDeclaration=e.buildOverload("createFunctionDeclaration").overload({0:function(e,t,r,n,i,a,o){return S(e,t,r,n,i,a,o)},1:function(e,t,r,n,i,a,o,s){return S(t,r,n,i,a,o,s)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6];return void 0===t[7]&&(void 0===r||!e.isArray(r))&&(void 0===n||"string"==typeof n||e.isIdentifier(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.every(a,e.isParameter))&&(void 0===o||!e.isArray(o))&&(void 0===s||e.isBlock(s))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7];return (void 0===r||e.isArray(r))&&(void 0===n||"string"!=typeof n&&e.isAsteriskToken(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.every(a,e.isTypeParameterDeclaration))&&(void 0===o||e.isArray(o))&&(void 0===s||e.isTypeNode(s))&&(void 0===c||e.isBlock(c))}}).deprecate({1:r}).finish(),i.updateFunctionDeclaration=e.buildOverload("updateFunctionDeclaration").overload({0:function(e,t,r,n,i,a,o,s){return T(e,t,r,n,i,a,o,s)},1:function(e,t,r,n,i,a,o,s,c){return T(e,r,n,i,a,o,s,c)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6],s=t[7];return void 0===t[8]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isIdentifier(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.every(a,e.isParameter))&&(void 0===o||!e.isArray(o))&&(void 0===s||e.isBlock(s))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6],s=t[7],c=t[8];return (void 0===r||e.isArray(r))&&(void 0===n||"string"!=typeof n&&e.isAsteriskToken(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.every(a,e.isTypeParameterDeclaration))&&(void 0===o||e.isArray(o))&&(void 0===s||e.isTypeNode(s))&&(void 0===c||e.isBlock(c))}}).deprecate({1:r}).finish(),i.createClassDeclaration=e.buildOverload("createClassDeclaration").overload({0:function(e,t,r,n,i){return C(e,t,r,n,i)},1:function(t,r,n,i,a,o){return C(e.concatenate(t,r),n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||e.every(i,e.isHeritageClause))&&(void 0===a||e.every(a,e.isClassElement))},1:function(){return !0}}).deprecate({1:t}).finish(),i.updateClassDeclaration=e.buildOverload("updateClassDeclaration").overload({0:function(e,t,r,n,i,a){return E(e,t,r,n,i,a)},1:function(t,r,n,i,a,o,s){return E(t,e.concatenate(r,n),i,a,o,s)}}).bind({0:function(t){var r=t[2],n=t[3],i=t[4],a=t[5];return void 0===t[6]&&(void 0===r||!e.isArray(r))&&(void 0===n||e.isArray(n))&&(void 0===i||e.every(i,e.isHeritageClause))&&(void 0===a||e.every(a,e.isClassElement))},1:function(t){var r=t[2],n=t[3],i=t[4],a=t[5],o=t[6];return (void 0===r||e.isArray(r))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.every(i,e.isTypeParameterDeclaration))&&(void 0===a||e.every(a,e.isHeritageClause))&&(void 0===o||e.isArray(o))}}).deprecate({1:t}).finish(),i.createInterfaceDeclaration=e.buildOverload("createInterfaceDeclaration").overload({0:function(e,t,r,n,i){return k(e,t,r,n,i)},1:function(e,t,r,n,i,a){return k(t,r,n,i,a)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return void 0===t[5]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.every(a,e.isHeritageClause))&&(void 0===o||e.every(o,e.isTypeElement))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.every(a,e.isTypeParameterDeclaration))&&(void 0===o||e.every(o,e.isHeritageClause))&&(void 0===s||e.every(s,e.isTypeElement))}}).deprecate({1:r}).finish(),i.updateInterfaceDeclaration=e.buildOverload("updateInterfaceDeclaration").overload({0:function(e,t,r,n,i,a){return N(e,t,r,n,i,a)},1:function(e,t,r,n,i,a,o){return N(e,r,n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return void 0===t[6]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||e.every(a,e.isHeritageClause))&&(void 0===o||e.every(o,e.isTypeElement))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.every(a,e.isTypeParameterDeclaration))&&(void 0===o||e.every(o,e.isHeritageClause))&&(void 0===s||e.every(s,e.isTypeElement))}}).deprecate({1:r}).finish(),i.createTypeAliasDeclaration=e.buildOverload("createTypeAliasDeclaration").overload({0:function(e,t,r,n){return A(e,t,r,n)},1:function(e,t,r,n,i){return A(t,r,n,i)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||!e.isArray(a))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isArray(a))&&(void 0===o||e.isTypeNode(o))}}).deprecate({1:r}).finish(),i.updateTypeAliasDeclaration=e.buildOverload("updateTypeAliasDeclaration").overload({0:function(e,t,r,n,i){return F(e,t,r,n,i)},1:function(e,t,r,n,i,a){return F(e,r,n,i,a)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))&&(void 0===a||!e.isArray(a))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isArray(a))&&(void 0===o||e.isTypeNode(o))}}).deprecate({1:r}).finish(),i.createEnumDeclaration=e.buildOverload("createEnumDeclaration").overload({0:function(e,t,r){return P(e,t,r)},1:function(e,t,r,n){return P(t,r,n)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2];return void 0===t[3]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isArray(a))}}).deprecate({1:r}).finish(),i.updateEnumDeclaration=e.buildOverload("updateEnumDeclaration").overload({0:function(e,t,r,n){return w(e,t,r,n)},1:function(e,t,r,n,i){return w(e,r,n,i)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isArray(i))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||!e.isArray(i))&&(void 0===a||e.isArray(a))}}).deprecate({1:r}).finish(),i.createModuleDeclaration=e.buildOverload("createModuleDeclaration").overload({0:function(e,t,r,n){return I(e,t,r,n)},1:function(e,t,r,n,i){return I(t,r,n,i)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&void 0!==n&&!e.isArray(n)&&(void 0===i||e.isModuleBody(i))&&(void 0===a||"number"==typeof a)},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&void 0!==i&&e.isModuleName(i)&&(void 0===a||"object"==typeof a)&&(void 0===o||"number"==typeof o)}}).deprecate({1:r}).finish(),i.updateModuleDeclaration=e.buildOverload("updateModuleDeclaration").overload({0:function(e,t,r,n){return O(e,t,r,n)},1:function(e,t,r,n,i){return O(e,r,n,i)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isModuleBody(i))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&void 0!==i&&e.isModuleName(i)&&(void 0===a||e.isModuleBody(a))}}).deprecate({1:r}).finish(),i.createImportEqualsDeclaration=e.buildOverload("createImportEqualsDeclaration").overload({0:function(e,t,r,n){return M(e,t,r,n)},1:function(e,t,r,n,i){return M(t,r,n,i)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||"boolean"==typeof n)&&"boolean"!=typeof i&&"string"!=typeof a},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||"boolean"==typeof i)&&("string"==typeof a||e.isIdentifier(a))&&void 0!==o&&e.isModuleReference(o)}}).deprecate({1:r}).finish(),i.updateImportEqualsDeclaration=e.buildOverload("updateImportEqualsDeclaration").overload({0:function(e,t,r,n,i){return L(e,t,r,n,i)},1:function(e,t,r,n,i,a){return L(e,r,n,i,a)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||"boolean"==typeof n)&&"boolean"!=typeof i&&"string"!=typeof a},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||"boolean"==typeof i)&&("string"==typeof a||e.isIdentifier(a))&&void 0!==o&&e.isModuleReference(o)}}).deprecate({1:r}).finish(),i.createImportDeclaration=e.buildOverload("createImportDeclaration").overload({0:function(e,t,r,n){return R(e,t,r,n)},1:function(e,t,r,n,i){return R(t,r,n,i)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return void 0===t[4]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&void 0!==i&&e.isExpression(i)&&(void 0===a||e.isAssertClause(a))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||e.isImportClause(i))&&void 0!==a&&e.isExpression(a)&&(void 0===o||e.isAssertClause(o))}}).deprecate({1:r}).finish(),i.updateImportDeclaration=e.buildOverload("updateImportDeclaration").overload({0:function(e,t,r,n,i){return B(e,t,r,n,i)},1:function(e,t,r,n,i,a){return B(e,r,n,i,a)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4];return void 0===t[5]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||!e.isArray(n))&&(void 0===i||e.isExpression(i))&&(void 0===a||e.isAssertClause(a))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||e.isImportClause(i))&&void 0!==a&&e.isExpression(a)&&(void 0===o||e.isAssertClause(o))}}).deprecate({1:r}).finish(),i.createExportAssignment=e.buildOverload("createExportAssignment").overload({0:function(e,t,r){return j(e,t,r)},1:function(e,t,r,n){return j(t,r,n)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2];return void 0===t[3]&&(void 0===r||e.every(r,e.isModifier))&&(void 0===n||"boolean"==typeof n)&&"object"==typeof i},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&(void 0===i||"boolean"==typeof i)&&void 0!==a&&e.isExpression(a)}}).deprecate({1:r}).finish(),i.updateExportAssignment=e.buildOverload("updateExportAssignment").overload({0:function(e,t,r){return J(e,t,r)},1:function(e,t,r,n){return J(e,r,n)}}).bind({0:function(t){var r=t[1],n=t[2];return void 0===t[3]&&(void 0===r||e.every(r,e.isModifier))&&void 0!==n&&!e.isArray(n)},1:function(t){var r=t[1],n=t[2],i=t[3];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&void 0!==i&&e.isExpression(i)}}).deprecate({1:r}).finish(),i.createExportDeclaration=e.buildOverload("createExportDeclaration").overload({0:function(e,t,r,n,i){return z(e,t,r,n,i)},1:function(e,t,r,n,i,a){return z(t,r,n,i,a)}}).bind({0:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4];return void 0===t[5]&&(void 0===r||e.every(r,e.isModifier))&&"boolean"==typeof n&&"boolean"!=typeof i&&(void 0===a||e.isExpression(a))&&(void 0===o||e.isAssertClause(o))},1:function(t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&"boolean"==typeof i&&(void 0===a||e.isNamedExportBindings(a))&&(void 0===o||e.isExpression(o))&&(void 0===s||e.isAssertClause(s))}}).deprecate({1:r}).finish(),i.updateExportDeclaration=e.buildOverload("updateExportDeclaration").overload({0:function(e,t,r,n,i,a){return U(e,t,r,n,i,a)},1:function(e,t,r,n,i,a,o){return U(e,r,n,i,a,o)}}).bind({0:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5];return void 0===t[6]&&(void 0===r||e.every(r,e.isModifier))&&"boolean"==typeof n&&"boolean"!=typeof i&&(void 0===a||e.isExpression(a))&&(void 0===o||e.isAssertClause(o))},1:function(t){var r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6];return (void 0===r||e.every(r,e.isDecorator))&&(void 0===n||e.isArray(n))&&"boolean"==typeof i&&(void 0===a||e.isNamedExportBindings(a))&&(void 0===o||e.isExpression(o))&&(void 0===s||e.isAssertClause(s))}}).deprecate({1:r}).finish();}var a=e.createNodeFactory;e.createNodeFactory=function(e,t){var r=a(e,t);return i(r),r},i(e.factory);}(t),function(e){"undefined"!=typeof console&&(e.Debug.loggingHost={log:function(t,r){switch(t){case e.LogLevel.Error:return console.error(r);case e.LogLevel.Warning:return console.warn(r);case e.LogLevel.Info:case e.LogLevel.Verbose:return console.log(r)}}});}(t);

/**
 * Used to learn the size of a string in bytes.
 *
 * @param str The string to measure
 * @returns number
 */
const byteSize = (str) => Buffer.byteLength(str, 'utf8');

/**
 * Default style mode id
 */
const DEFAULT_STYLE_MODE = '$';
/**
 * File names and value
 */
const COLLECTION_MANIFEST_FILE_NAME = 'collection-manifest.json';

/**
 * Transform metadata about a component from the compiler to a compact form for
 * use at runtime.
 *
 * @param compilerMeta component metadata gathered during compilation
 * @param includeMethods include methods in the component's members or not
 * @returns a compact format for component metadata, intended for runtime use
 */
const formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
  let flags = 0;
  if (compilerMeta.encapsulation === 'shadow') {
    flags |= 1 /* CMP_FLAGS.shadowDomEncapsulation */;
    if (compilerMeta.shadowDelegatesFocus) {
      flags |= 16 /* CMP_FLAGS.shadowDelegatesFocus */;
    }
  }
  else if (compilerMeta.encapsulation === 'scoped') {
    flags |= 2 /* CMP_FLAGS.scopedCssEncapsulation */;
  }
  if (compilerMeta.encapsulation !== 'shadow' && compilerMeta.htmlTagNames.includes('slot')) {
    flags |= 4 /* CMP_FLAGS.hasSlotRelocation */;
  }
  if (compilerMeta.hasMode) {
    flags |= 32 /* CMP_FLAGS.hasMode */;
  }
  const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
  const hostListeners = formatHostListeners(compilerMeta);
  return trimFalsy([
    flags,
    compilerMeta.tagName,
    Object.keys(members).length > 0 ? members : undefined,
    hostListeners.length > 0 ? hostListeners : undefined,
  ]);
};
const stringifyRuntimeData = (data) => {
  const json = JSON.stringify(data);
  if (json.length > 10000) {
    // JSON metadata is big, JSON.parse() is faster
    // https://twitter.com/mathias/status/1143551692732030979
    return `JSON.parse(${JSON.stringify(json)})`;
  }
  return json;
};
const formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
  return {
    ...formatPropertiesRuntimeMember(compilerMeta.properties),
    ...formatStatesRuntimeMember(compilerMeta.states),
    ...(includeMethods ? formatMethodsRuntimeMember(compilerMeta.methods) : {}),
  };
};
const formatPropertiesRuntimeMember = (properties) => {
  const runtimeMembers = {};
  properties.forEach((member) => {
    runtimeMembers[member.name] = trimFalsy([
      /**
       * [0] member type
       */
      formatFlags(member),
      formatAttrName(member),
    ]);
  });
  return runtimeMembers;
};
const formatFlags = (compilerProperty) => {
  let type = formatPropType(compilerProperty.type);
  if (compilerProperty.mutable) {
    type |= 1024 /* MEMBER_FLAGS.Mutable */;
  }
  if (compilerProperty.reflect) {
    type |= 512 /* MEMBER_FLAGS.ReflectAttr */;
  }
  return type;
};
const formatAttrName = (compilerProperty) => {
  if (typeof compilerProperty.attribute === 'string') {
    // string attr name means we should observe this attribute
    if (compilerProperty.name === compilerProperty.attribute) {
      // property name and attribute name are the exact same
      // true value means to use the property name for the attribute name
      return undefined;
    }
    // property name and attribute name are not the same
    // so we need to return the actual string value
    // example: "multiWord" !== "multi-word"
    return compilerProperty.attribute;
  }
  // we shouldn't even observe an attribute for this property
  return undefined;
};
const formatPropType = (type) => {
  if (type === 'string') {
    return 1 /* MEMBER_FLAGS.String */;
  }
  if (type === 'number') {
    return 2 /* MEMBER_FLAGS.Number */;
  }
  if (type === 'boolean') {
    return 4 /* MEMBER_FLAGS.Boolean */;
  }
  if (type === 'any') {
    return 8 /* MEMBER_FLAGS.Any */;
  }
  return 16 /* MEMBER_FLAGS.Unknown */;
};
const formatStatesRuntimeMember = (states) => {
  const runtimeMembers = {};
  states.forEach((member) => {
    runtimeMembers[member.name] = [
      32 /* MEMBER_FLAGS.State */,
    ];
  });
  return runtimeMembers;
};
const formatMethodsRuntimeMember = (methods) => {
  const runtimeMembers = {};
  methods.forEach((member) => {
    runtimeMembers[member.name] = [
      64 /* MEMBER_FLAGS.Method */,
    ];
  });
  return runtimeMembers;
};
const formatHostListeners = (compilerMeta) => {
  return compilerMeta.listeners.map((compilerListener) => {
    const hostListener = [
      computeListenerFlags(compilerListener),
      compilerListener.name,
      compilerListener.method,
    ];
    return hostListener;
  });
};
const computeListenerFlags = (listener) => {
  let flags = 0;
  if (listener.capture) {
    flags |= 2 /* LISTENER_FLAGS.Capture */;
  }
  if (listener.passive) {
    flags |= 1 /* LISTENER_FLAGS.Passive */;
  }
  switch (listener.target) {
    case 'document':
      flags |= 4 /* LISTENER_FLAGS.TargetDocument */;
      break;
    case 'window':
      flags |= 8 /* LISTENER_FLAGS.TargetWindow */;
      break;
    case 'body':
      flags |= 16 /* LISTENER_FLAGS.TargetBody */;
      break;
    case 'parent':
      flags |= 32 /* LISTENER_FLAGS.TargetParent */;
      break;
  }
  return flags;
};
const trimFalsy = (data) => {
  const arr = data;
  for (let i = arr.length - 1; i >= 0; i--) {
    if (arr[i]) {
      break;
    }
    // if falsy, safe to pop()
    arr.pop();
  }
  return arr;
};

/**
 * Convert a string from PascalCase to dash-case
 *
 * @param str the string to convert
 * @returns a converted string
 */
const toDashCase = (str) => str
  .replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`)
  .trim()
  .split(' ')
  .join('-')
  .toLowerCase();
/**
 * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
 * or whatever you call it!)
 *
 * @param str a string to convert
 * @returns a converted string
 */
const dashToPascalCase$1 = (str) => str
  .toLowerCase()
  .split('-')
  .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
  .join('');
const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
const noop$1 = () => {
  /* noop*/
};
const sortBy = (array, prop) => {
  return array.slice().sort((a, b) => {
    const nameA = prop(a);
    const nameB = prop(b);
    if (nameA < nameB)
      return -1;
    if (nameA > nameB)
      return 1;
    return 0;
  });
};
const flatOne = (array) => {
  if (array.flat) {
    return array.flat(1);
  }
  return array.reduce((result, item) => {
    result.push(...item);
    return result;
  }, []);
};
const unique = (array, predicate = (i) => i) => {
  const set = new Set();
  return array.filter((item) => {
    const key = predicate(item);
    if (key == null) {
      return true;
    }
    if (set.has(key)) {
      return false;
    }
    set.add(key);
    return true;
  });
};
const fromEntries = (entries) => {
  const object = {};
  for (const [key, value] of entries) {
    object[key] = value;
  }
  return object;
};
const pluck = (obj, keys) => {
  return keys.reduce((final, key) => {
    if (obj[key]) {
      final[key] = obj[key];
    }
    return final;
  }, {});
};
const isDefined = (v) => v !== null && v !== undefined;
const isBoolean$1 = (v) => typeof v === 'boolean';
const isFunction = (v) => typeof v === 'function';
const isNumber$1 = (v) => typeof v === 'number';
const isObject$5 = (val) => val != null && typeof val === 'object' && Array.isArray(val) === false;
const isString$1 = (v) => typeof v === 'string';
const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
const isPromise = (v) => !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function';

/**
 * Check if a string is a glob pattern (e.g. 'src/*.js' or something like that)
 *
 * @param str a string to check
 * @returns whether the string is a glob pattern or not
 */
const isGlob = (str) => {
  const chars = { '{': '}', '(': ')', '[': ']' };
  /* eslint-disable-next-line max-len */
  const regex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
  if (str === '') {
    return false;
  }
  let match;
  while ((match = regex.exec(str))) {
    if (match[2])
      return true;
    let idx = match.index + match[0].length;
    // if an open bracket/brace/paren is escaped,
    // set the index to the next closing character
    const open = match[1];
    const close = open ? chars[open] : null;
    if (open && close) {
      const n = str.indexOf(close, idx);
      if (n !== -1) {
        idx = n + 1;
      }
    }
    str = str.slice(idx);
  }
  return false;
};

/**
 * Checks if the path is the Operating System (OS) root path, such as "/" or "C:\". This function does not take the OS
 * the code is running on into account when performing this evaluation.
 * @param p the path to check
 * @returns `true` if the path is an OS root path, `false` otherwise
 */
const isRootPath = (p) => p === '/' || windowsPathRegex.test(p);
// https://github.com/nodejs/node/blob/5883a59b21a97e8b7339f435c977155a2c29ba8d/lib/path.js#L43
const windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/;

/**
 * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
 * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
 * to attach the specifics of the error message.
 *
 * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
 *
 * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
 * @returns the created `Diagnostic`
 */
const buildError = (diagnostics) => {
  const diagnostic = {
    level: 'error',
    type: 'build',
    header: 'Build Error',
    messageText: 'build error',
    relFilePath: null,
    absFilePath: null,
    lines: [],
  };
  if (diagnostics) {
    diagnostics.push(diagnostic);
  }
  return diagnostic;
};
/**
 * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little
 * detail attached to it regarding the specifics of the warning - it is the responsibility of the caller of this method
 * to attach the specifics of the warning message.
 *
 * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
 *
 * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
 * @returns the created `Diagnostic`
 */
const buildWarn = (diagnostics) => {
  const diagnostic = {
    level: 'warn',
    type: 'build',
    header: 'Build Warn',
    messageText: 'build warn',
    relFilePath: null,
    absFilePath: null,
    lines: [],
  };
  diagnostics.push(diagnostic);
  return diagnostic;
};
/**
 * Create a diagnostic message suited for representing an error in a JSON
 * file. This includes information about the exact lines in the JSON file which
 * caused the error and the path to the file.
 *
 * @param compilerCtx the current compiler context
 * @param diagnostics a list of diagnostics used as a return param
 * @param jsonFilePath the path to the JSON file where the error occurred
 * @param msg the error message
 * @param jsonField the key for the field which caused the error, used for finding
 * the error line in the original JSON file
 * @returns a reference to the newly-created diagnostic
 */
const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, jsonField) => {
  const err = buildError(diagnostics);
  err.messageText = msg;
  err.absFilePath = jsonFilePath;
  if (typeof jsonField === 'string') {
    try {
      const jsonStr = compilerCtx.fs.readFileSync(jsonFilePath);
      const lines = jsonStr.replace(/\r/g, '\n').split('\n');
      for (let i = 0; i < lines.length; i++) {
        const txtLine = lines[i];
        const txtIndex = txtLine.indexOf(jsonField);
        if (txtIndex > -1) {
          const warnLine = {
            lineIndex: i,
            lineNumber: i + 1,
            text: txtLine,
            errorCharStart: txtIndex,
            errorLength: jsonField.length,
          };
          err.lineNumber = warnLine.lineNumber;
          err.columnNumber = txtIndex + 1;
          err.lines.push(warnLine);
          if (i >= 0) {
            const beforeWarnLine = {
              lineIndex: warnLine.lineIndex - 1,
              lineNumber: warnLine.lineNumber - 1,
              text: lines[i - 1],
              errorCharStart: -1,
              errorLength: -1,
            };
            err.lines.unshift(beforeWarnLine);
          }
          if (i < lines.length) {
            const afterWarnLine = {
              lineIndex: warnLine.lineIndex + 1,
              lineNumber: warnLine.lineNumber + 1,
              text: lines[i + 1],
              errorCharStart: -1,
              errorLength: -1,
            };
            err.lines.push(afterWarnLine);
          }
          break;
        }
      }
    }
    catch (e) { }
  }
  return err;
};
/**
 * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
 * @param diagnostics the series of diagnostics the newly created diagnostics should be added to
 * @param err the error to derive information from in generating the diagnostic
 * @param msg an optional message to use in place of `err` to generate the diagnostic
 * @returns the generated diagnostic
 */
const catchError = (diagnostics, err, msg) => {
  const diagnostic = {
    level: 'error',
    type: 'build',
    header: 'Build Error',
    messageText: 'build error',
    relFilePath: null,
    absFilePath: null,
    lines: [],
  };
  if (isString$1(msg)) {
    diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
  }
  else if (err != null) {
    if (err.stack != null) {
      diagnostic.messageText = err.stack.toString();
    }
    else {
      if (err.message != null) {
        diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
      }
      else {
        diagnostic.messageText = err.toString();
      }
    }
  }
  if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) {
    diagnostics.push(diagnostic);
  }
  return diagnostic;
};
/**
 * Determine if the provided diagnostics have any build errors
 * @param diagnostics the diagnostics to inspect
 * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
 * otherwise.
 */
const hasError = (diagnostics) => {
  if (diagnostics == null || diagnostics.length === 0) {
    return false;
  }
  return diagnostics.some((d) => d.level === 'error' && d.type !== 'runtime');
};
/**
 * Determine if the provided diagnostics have any warnings
 * @param diagnostics the diagnostics to inspect
 * @returns true if any of the diagnostics in the list provided are warnings. false otherwise.
 */
const hasWarning = (diagnostics) => {
  if (diagnostics == null || diagnostics.length === 0) {
    return false;
  }
  return diagnostics.some((d) => d.level === 'warn');
};
const shouldIgnoreError = (msg) => {
  return msg === TASK_CANCELED_MSG;
};
const TASK_CANCELED_MSG = `task canceled`;

/**
 * Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
 * @param compilerCtx the current compiler context
 * @param diagnostics the diagnostics to normalize
 * @returns the normalize documents
 */
const normalizeDiagnostics = (compilerCtx, diagnostics) => {
  const maxErrorsToNormalize = 25;
  const normalizedErrors = [];
  const normalizedOthers = [];
  const dups = new Set();
  for (let i = 0; i < diagnostics.length; i++) {
    const d = normalizeDiagnostic(compilerCtx, diagnostics[i]);
    const key = d.absFilePath + d.code + d.messageText + d.type;
    if (dups.has(key)) {
      continue;
    }
    dups.add(key);
    const total = normalizedErrors.length + normalizedOthers.length;
    if (d.level === 'error') {
      normalizedErrors.push(d);
    }
    else if (total < maxErrorsToNormalize) {
      normalizedOthers.push(d);
    }
  }
  return [...normalizedErrors, ...normalizedOthers];
};
/**
 * Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
 * updating build failure contexts
 * @param compilerCtx the current compiler
 * @param diagnostic the diagnostic to normalize
 * @returns the altered diagnostic
 */
const normalizeDiagnostic = (compilerCtx, diagnostic) => {
  if (diagnostic.messageText) {
    if (typeof diagnostic.messageText.message === 'string') {
      diagnostic.messageText = diagnostic.messageText.message;
    }
    else if (typeof diagnostic.messageText === 'string' && diagnostic.messageText.indexOf('Error: ') === 0) {
      diagnostic.messageText = diagnostic.messageText.slice(7);
    }
  }
  if (diagnostic.messageText) {
    if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
      diagnostic.header = `Missing "h" import for JSX types`;
      diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
      try {
        const sourceText = compilerCtx.fs.readFileSync(diagnostic.absFilePath);
        const srcLines = splitLineBreaks(sourceText);
        for (let i = 0; i < srcLines.length; i++) {
          const srcLine = srcLines[i];
          if (srcLine.includes('@stencil/core')) {
            const msgLines = [];
            const beforeLineIndex = i - 1;
            if (beforeLineIndex > -1) {
              const beforeLine = {
                lineIndex: beforeLineIndex,
                lineNumber: beforeLineIndex + 1,
                text: srcLines[beforeLineIndex],
                errorCharStart: -1,
                errorLength: -1,
              };
              msgLines.push(beforeLine);
            }
            const errorLine = {
              lineIndex: i,
              lineNumber: i + 1,
              text: srcLine,
              errorCharStart: 0,
              errorLength: -1,
            };
            msgLines.push(errorLine);
            diagnostic.lineNumber = errorLine.lineNumber;
            diagnostic.columnNumber = srcLine.indexOf('}');
            const afterLineIndex = i + 1;
            if (afterLineIndex < srcLines.length) {
              const afterLine = {
                lineIndex: afterLineIndex,
                lineNumber: afterLineIndex + 1,
                text: srcLines[afterLineIndex],
                errorCharStart: -1,
                errorLength: -1,
              };
              msgLines.push(afterLine);
            }
            diagnostic.lines = msgLines;
            break;
          }
        }
      }
      catch (e) { }
    }
  }
  return diagnostic;
};
/**
 * Split a corpus by newlines. Carriage returns are treated a newlines.
 * @param sourceText the corpus to split
 * @returns the split text
 */
const splitLineBreaks = (sourceText) => {
  if (typeof sourceText !== 'string')
    return [];
  sourceText = sourceText.replace(/\\r/g, '\n');
  return sourceText.split('\n');
};
const escapeHtml = (unsafe) => {
  if (unsafe === undefined)
    return 'undefined';
  if (unsafe === null)
    return 'null';
  if (typeof unsafe !== 'string') {
    unsafe = unsafe.toString();
  }
  return unsafe
    .replace(/&/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;')
    .replace(/'/g, '&#039;');
};

const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
  const formattedCode = formatErrorCode(rollupError.code);
  const diagnostic = {
    level: 'error',
    type: 'bundling',
    language: 'javascript',
    code: rollupError.code,
    header: `Rollup${formattedCode.length > 0 ? ': ' + formattedCode : ''}`,
    messageText: formattedCode,
    relFilePath: null,
    absFilePath: null,
    lines: [],
  };
  if (config.logLevel === 'debug' && rollupError.stack) {
    diagnostic.messageText = rollupError.stack;
  }
  else if (rollupError.message) {
    diagnostic.messageText = rollupError.message;
  }
  if (rollupError.plugin) {
    diagnostic.messageText += ` (plugin: ${rollupError.plugin}${rollupError.hook ? `, ${rollupError.hook}` : ''})`;
  }
  const loc = rollupError.loc;
  if (loc != null) {
    const srcFile = loc.file || rollupError.id;
    if (isString$1(srcFile)) {
      try {
        const sourceText = compilerCtx.fs.readFileSync(srcFile);
        if (sourceText) {
          diagnostic.absFilePath = srcFile;
          try {
            const srcLines = splitLineBreaks(sourceText);
            const errorLine = {
              lineIndex: loc.line - 1,
              lineNumber: loc.line,
              text: srcLines[loc.line - 1],
              errorCharStart: loc.column,
              errorLength: 0,
            };
            diagnostic.lineNumber = errorLine.lineNumber;
            diagnostic.columnNumber = errorLine.errorCharStart;
            const highlightLine = errorLine.text.slice(loc.column);
            for (let i = 0; i < highlightLine.length; i++) {
              if (charBreak.has(highlightLine.charAt(i))) {
                break;
              }
              errorLine.errorLength++;
            }
            diagnostic.lines.push(errorLine);
            if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
              errorLine.errorLength = 1;
              errorLine.errorCharStart--;
            }
            if (errorLine.lineIndex > 0) {
              const previousLine = {
                lineIndex: errorLine.lineIndex - 1,
                lineNumber: errorLine.lineNumber - 1,
                text: srcLines[errorLine.lineIndex - 1],
                errorCharStart: -1,
                errorLength: -1,
              };
              diagnostic.lines.unshift(previousLine);
            }
            if (errorLine.lineIndex + 1 < srcLines.length) {
              const nextLine = {
                lineIndex: errorLine.lineIndex + 1,
                lineNumber: errorLine.lineNumber + 1,
                text: srcLines[errorLine.lineIndex + 1],
                errorCharStart: -1,
                errorLength: -1,
              };
              diagnostic.lines.push(nextLine);
            }
          }
          catch (e) {
            diagnostic.messageText += `\nError parsing: ${diagnostic.absFilePath}, line: ${loc.line}, column: ${loc.column}`;
            diagnostic.debugText = sourceText;
          }
        }
        else if (typeof rollupError.frame === 'string') {
          diagnostic.messageText += '\n' + rollupError.frame;
        }
      }
      catch (e) { }
    }
  }
  buildCtx.diagnostics.push(diagnostic);
};
const createOnWarnFn = (diagnostics, bundleModulesFiles) => {
  const previousWarns = new Set();
  return function onWarningMessage(warning) {
    if (warning == null || ignoreWarnCodes.has(warning.code) || previousWarns.has(warning.message)) {
      return;
    }
    previousWarns.add(warning.message);
    let label = '';
    if (bundleModulesFiles) {
      label = bundleModulesFiles
        .reduce((cmps, m) => {
        cmps.push(...m.cmps);
        return cmps;
      }, [])
        .join(', ')
        .trim();
      if (label.length) {
        label += ': ';
      }
    }
    const diagnostic = buildWarn(diagnostics);
    diagnostic.header = `Bundling Warning ${warning.code}`;
    diagnostic.messageText = label + (warning.message || warning);
  };
};
const ignoreWarnCodes = new Set([
  'THIS_IS_UNDEFINED',
  'NON_EXISTENT_EXPORT',
  'CIRCULAR_DEPENDENCY',
  'EMPTY_BUNDLE',
  'UNUSED_EXTERNAL_IMPORT',
]);
const charBreak = new Set([' ', '=', '.', ',', '?', ':', ';', '(', ')', '{', '}', '[', ']', '|', `'`, `"`, '`']);
const formatErrorCode = (errorCode) => {
  if (typeof errorCode === 'string') {
    return errorCode
      .split('_')
      .map((c) => {
      return toTitleCase(c.toLowerCase());
    })
      .join(' ');
  }
  return (errorCode || '').trim();
};

/**
 * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
 * Forward-slash paths can be used in Windows as long as they're not
 * extended-length paths and don't contain any non-ascii characters.
 * This was created since the path methods in Node.js outputs \\ paths on Windows.
 * @param path the Windows-based path to convert
 * @returns the converted path
 */
const normalizePath$2 = (path) => {
  if (typeof path !== 'string') {
    throw new Error(`invalid path to normalize`);
  }
  path = normalizeSlashes(path.trim());
  const components = pathComponents(path, getRootLength(path));
  const reducedComponents = reducePathComponents(components);
  const rootPart = reducedComponents[0];
  const secondPart = reducedComponents[1];
  const normalized = rootPart + reducedComponents.slice(1).join('/');
  if (normalized === '') {
    return '.';
  }
  if (rootPart === '' &&
    secondPart &&
    path.includes('/') &&
    !secondPart.startsWith('.') &&
    !secondPart.startsWith('@')) {
    return './' + normalized;
  }
  return normalized;
};
const normalizeSlashes = (path) => path.replace(backslashRegExp, '/');
const altDirectorySeparator = '\\';
const urlSchemeSeparator = '://';
const backslashRegExp = /\\/g;
const reducePathComponents = (components) => {
  if (!Array.isArray(components) || components.length === 0) {
    return [];
  }
  const reduced = [components[0]];
  for (let i = 1; i < components.length; i++) {
    const component = components[i];
    if (!component)
      continue;
    if (component === '.')
      continue;
    if (component === '..') {
      if (reduced.length > 1) {
        if (reduced[reduced.length - 1] !== '..') {
          reduced.pop();
          continue;
        }
      }
      else if (reduced[0])
        continue;
    }
    reduced.push(component);
  }
  return reduced;
};
const getRootLength = (path) => {
  const rootLength = getEncodedRootLength(path);
  return rootLength < 0 ? ~rootLength : rootLength;
};
const getEncodedRootLength = (path) => {
  if (!path)
    return 0;
  const ch0 = path.charCodeAt(0);
  // POSIX or UNC
  if (ch0 === 47 /* CharacterCodes.slash */ || ch0 === 92 /* CharacterCodes.backslash */) {
    if (path.charCodeAt(1) !== ch0)
      return 1; // POSIX: "/" (or non-normalized "\")
    const p1 = path.indexOf(ch0 === 47 /* CharacterCodes.slash */ ? '/' : altDirectorySeparator, 2);
    if (p1 < 0)
      return path.length; // UNC: "//server" or "\\server"
    return p1 + 1; // UNC: "//server/" or "\\server\"
  }
  // DOS
  if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* CharacterCodes.colon */) {
    const ch2 = path.charCodeAt(2);
    if (ch2 === 47 /* CharacterCodes.slash */ || ch2 === 92 /* CharacterCodes.backslash */)
      return 3; // DOS: "c:/" or "c:\"
    if (path.length === 2)
      return 2; // DOS: "c:" (but not "c:d")
  }
  // URL
  const schemeEnd = path.indexOf(urlSchemeSeparator);
  if (schemeEnd !== -1) {
    const authorityStart = schemeEnd + urlSchemeSeparator.length;
    const authorityEnd = path.indexOf('/', authorityStart);
    if (authorityEnd !== -1) {
      // URL: "file:///", "file://server/", "file://server/path"
      // For local "file" URLs, include the leading DOS volume (if present).
      // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a
      // special case interpreted as "the machine from which the URL is being interpreted".
      const scheme = path.slice(0, schemeEnd);
      const authority = path.slice(authorityStart, authorityEnd);
      if (scheme === 'file' &&
        (authority === '' || authority === 'localhost') &&
        isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
        const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
        if (volumeSeparatorEnd !== -1) {
          if (path.charCodeAt(volumeSeparatorEnd) === 47 /* CharacterCodes.slash */) {
            // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/"
            return ~(volumeSeparatorEnd + 1);
          }
          if (volumeSeparatorEnd === path.length) {
            // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a"
            // but not "file:///c:d" or "file:///c%3ad"
            return ~volumeSeparatorEnd;
          }
        }
      }
      return ~(authorityEnd + 1); // URL: "file://server/", "http://server/"
    }
    return ~path.length; // URL: "file://server", "http://server"
  }
  // relative
  return 0;
};
const isVolumeCharacter = (charCode) => (charCode >= 97 /* CharacterCodes.a */ && charCode <= 122 /* CharacterCodes.z */) ||
  (charCode >= 65 /* CharacterCodes.A */ && charCode <= 90 /* CharacterCodes.Z */);
const getFileUrlVolumeSeparatorEnd = (url, start) => {
  const ch0 = url.charCodeAt(start);
  if (ch0 === 58 /* CharacterCodes.colon */)
    return start + 1;
  if (ch0 === 37 /* CharacterCodes.percent */ && url.charCodeAt(start + 1) === 51 /* CharacterCodes._3 */) {
    const ch2 = url.charCodeAt(start + 2);
    if (ch2 === 97 /* CharacterCodes.a */ || ch2 === 65 /* CharacterCodes.A */)
      return start + 3;
  }
  return -1;
};
const pathComponents = (path, rootLength) => {
  const root = path.substring(0, rootLength);
  const rest = path.substring(rootLength).split('/');
  const restLen = rest.length;
  if (restLen > 0 && !rest[restLen - 1]) {
    rest.pop();
  }
  return [root, ...rest];
};
/**
 * Same as normalizePath(), expect it'll also strip any query strings
 * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
 * @param p the path to normalize
 * @returns the normalized path, sans any query strings
 */
const normalizeFsPath = (p) => normalizePath$2(p.split('?')[0].replace(/\0/g, ''));
const normalizeFsPathQuery = (importPath) => {
  const pathParts = importPath.split('?');
  const filePath = normalizePath$2(pathParts[0]);
  const ext = filePath.split('.').pop().toLowerCase();
  const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
  const format = params ? params.get('format') : null;
  return {
    filePath,
    ext,
    params,
    format,
  };
};

/**
 * Augment a `Diagnostic` with information from a `Node` in the AST to provide richer error information
 * @param d the diagnostic to augment
 * @param node the node to augment with additional information
 * @returns the augmented diagnostic
 */
const augmentDiagnosticWithNode = (d, node) => {
  if (!node) {
    return d;
  }
  const sourceFile = node.getSourceFile();
  if (!sourceFile) {
    return d;
  }
  d.absFilePath = normalizePath$2(sourceFile.fileName);
  const sourceText = sourceFile.text;
  const srcLines = splitLineBreaks(sourceText);
  const start = node.getStart();
  const end = node.getEnd();
  const posStart = sourceFile.getLineAndCharacterOfPosition(start);
  const errorLine = {
    lineIndex: posStart.line,
    lineNumber: posStart.line + 1,
    text: srcLines[posStart.line],
    errorCharStart: posStart.character,
    errorLength: Math.max(end - start, 1),
  };
  // store metadata for line number and character index where the error occurred
  d.lineNumber = errorLine.lineNumber;
  d.columnNumber = errorLine.errorCharStart + 1;
  d.lines.push(errorLine);
  if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
    errorLine.errorLength = 1;
    errorLine.errorCharStart--;
  }
  // if the error did not occur on the first line of the file, add metadata for the line of code preceding the line
  // where the error was detected to provide the user with additional context
  if (errorLine.lineIndex > 0) {
    const previousLine = {
      lineIndex: errorLine.lineIndex - 1,
      lineNumber: errorLine.lineNumber - 1,
      text: srcLines[errorLine.lineIndex - 1],
      errorCharStart: -1,
      errorLength: -1,
    };
    d.lines.unshift(previousLine);
  }
  // if the error did not occur on the last line of the file, add metadata for the line of code following the line
  // where the error was detected to provide the user with additional context
  if (errorLine.lineIndex + 1 < srcLines.length) {
    const nextLine = {
      lineIndex: errorLine.lineIndex + 1,
      lineNumber: errorLine.lineNumber + 1,
      text: srcLines[errorLine.lineIndex + 1],
      errorCharStart: -1,
      errorLength: -1,
    };
    d.lines.push(nextLine);
  }
  return d;
};
/**
 * Ok, so formatting overkill, we know. But whatever, it makes for great
 * error reporting within a terminal. So, yeah, let's code it up, shall we?
 */
const loadTypeScriptDiagnostics = (tsDiagnostics) => {
  const diagnostics = [];
  const maxErrors = Math.min(tsDiagnostics.length, 50);
  for (let i = 0; i < maxErrors; i++) {
    diagnostics.push(loadTypeScriptDiagnostic(tsDiagnostics[i]));
  }
  return diagnostics;
};
/**
 * Convert a TypeScript diagnostic object into our internal, Stencil-specific
 * diagnostic format
 *
 * @param tsDiagnostic a TypeScript diagnostic message record
 * @returns a Stencil diagnostic, suitable for showing an error to the user
 */
const loadTypeScriptDiagnostic = (tsDiagnostic) => {
  const d = {
    level: 'warn',
    type: 'typescript',
    language: 'typescript',
    header: 'TypeScript',
    code: tsDiagnostic.code.toString(),
    messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
    relFilePath: null,
    absFilePath: null,
    lines: [],
  };
  if (tsDiagnostic.category === 1) {
    d.level = 'error';
  }
  if (tsDiagnostic.file) {
    d.absFilePath = tsDiagnostic.file.fileName;
    const sourceText = tsDiagnostic.file.text;
    const srcLines = splitLineBreaks(sourceText);
    const posData = tsDiagnostic.file.getLineAndCharacterOfPosition(tsDiagnostic.start);
    const errorLine = {
      lineIndex: posData.line,
      lineNumber: posData.line + 1,
      text: srcLines[posData.line],
      errorCharStart: posData.character,
      errorLength: Math.max(tsDiagnostic.length, 1),
    };
    d.lineNumber = errorLine.lineNumber;
    d.columnNumber = errorLine.errorCharStart + 1;
    d.lines.push(errorLine);
    if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
      errorLine.errorLength = 1;
      errorLine.errorCharStart--;
    }
    if (errorLine.lineIndex > 0) {
      const previousLine = {
        lineIndex: errorLine.lineIndex - 1,
        lineNumber: errorLine.lineNumber - 1,
        text: srcLines[errorLine.lineIndex - 1],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.unshift(previousLine);
    }
    if (errorLine.lineIndex + 1 < srcLines.length) {
      const nextLine = {
        lineIndex: errorLine.lineIndex + 1,
        lineNumber: errorLine.lineNumber + 1,
        text: srcLines[errorLine.lineIndex + 1],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.push(nextLine);
    }
  }
  return d;
};
/**
 * Flatten a TypeScript diagnostic object into a string which can be easily
 * included in a Stencil diagnostic record.
 *
 * @param tsDiagnostic a TypeScript diagnostic record
 * @param diag a {@link DiagnosticMessageChain} or a string with further info
 * @returns a string with the relevant error message
 */
const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
  var _a, _b;
  if (typeof diag === 'string') {
    return diag;
  }
  else if (diag === undefined) {
    return '';
  }
  const ignoreCodes = [];
  // `tsDiagnostic.file` can be `undefined`, so we need to be a little careful here
  const isStencilConfig = ((_b = (_a = tsDiagnostic.file) === null || _a === void 0 ? void 0 : _a.fileName) !== null && _b !== void 0 ? _b : '').includes('stencil.config');
  if (isStencilConfig) {
    ignoreCodes.push(2322);
  }
  let result = '';
  if (!ignoreCodes.includes(diag.code)) {
    result = diag.messageText;
    if (isIterable(diag.next)) {
      for (const kid of diag.next) {
        result += flattenDiagnosticMessageText(tsDiagnostic, kid);
      }
    }
  }
  if (isStencilConfig) {
    result = result.replace(`type 'StencilConfig'`, `Stencil Config`);
    result = result.replace(`Object literal may only specify known properties, but `, ``);
    result = result.replace(`Object literal may only specify known properties, and `, ``);
  }
  return result.trim();
};

/**
 * Converts a rollup provided source map to one that Stencil can easily understand
 * @param rollupSourceMap the sourcemap to transform
 * @returns the transformed sourcemap
 */
const rollupToStencilSourceMap = (rollupSourceMap) => {
  if (!rollupSourceMap) {
    return null;
  }
  return {
    file: rollupSourceMap.file,
    mappings: rollupSourceMap.mappings,
    names: rollupSourceMap.names,
    sources: rollupSourceMap.sources,
    sourcesContent: rollupSourceMap.sourcesContent,
    version: rollupSourceMap.version,
  };
};
/**
 * A JavaScript formatted string used to link generated code back to the original. This string follows the guidelines
 * found in the [Linking generated code to source maps](https://sourcemaps.info/spec.html#h.lmz475t4mvbx) section of
 * the Sourcemaps V3 specification proposal.
 */
const JS_SOURCE_MAPPING_URL_LINKER = '//# sourceMappingURL=';
/**
 * Generates an RFC-3986 compliant string for the given input.
 * More information about RFC-3986 can be found [here](https://datatracker.ietf.org/doc/html/rfc3986)
 * This function's original source is derived from
 * [MDN's encodeURIComponent documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#description)
 * @param filename the filename to encode
 * @returns the encoded URI
 */
const encodeToRfc3986 = (filename) => {
  const encodedUri = encodeURIComponent(filename);
  // replace all '!', single quotes, '(', ')', and '*' with their hexadecimal values (UTF-16)
  return encodedUri.replace(/[!'()*]/g, (matchedCharacter) => {
    return '%' + matchedCharacter.charCodeAt(0).toString(16);
  });
};
/**
 * Generates a string used to link generated code with the original source, to be placed at the end of the generated
 * code.
 * @param url the url of the source map
 * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>
 */
const getSourceMappingUrlLinker = (url) => {
  return `${JS_SOURCE_MAPPING_URL_LINKER}${encodeToRfc3986(url)}`;
};
/**
 * Generates a string used to link generated code with the original source, to be placed at the end of the generated
 * code as an inline source map.
 * @param sourceMapContents the sourceMapContents of the source map
 * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}<dataUriPrefixAndMime><sourceMapContents>
 */
const getInlineSourceMappingUrlLinker = (sourceMapContents) => {
  const mapBase64 = Buffer.from(sourceMapContents, 'utf8').toString('base64');
  // do not RFC-3986 encode an already valid base64 string. the sourcemaps will not resolve correctly when there is an
  // allowed base64 character is encoded (because it is a disallowed RFC-3986 character)
  return `${JS_SOURCE_MAPPING_URL_LINKER}data:application/json;charset=utf-8;base64,${mapBase64}`;
};
/**
 * Generates a string used to link generated code with the original source, to be placed at the end of the generated
 * code. This function prepends a newline to the string.
 * @param url the url of the source map
 * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>.map, prepended with a newline
 */
const getSourceMappingUrlForEndOfFile = (url) => {
  return `\n${getSourceMappingUrlLinker(url)}.map`;
};

/**
 * Determines whether a string should be considered a remote url or not.
 *
 * This helper only checks the provided string to evaluate is one of a few pre-defined schemes, and should not be
 * considered all-encompassing
 *
 * @param p the string to evaluate
 * @returns `true` if the provided string is a remote url, `false` otherwise
 */
const isRemoteUrl = (p) => {
  if (isString$1(p)) {
    p = p.toLowerCase();
    return p.startsWith('https://') || p.startsWith('http://');
  }
  return false;
};

/**
 * A set of JSDoc tags which should be excluded from JSDoc comments
 * included in output typedefs.
 */
const SUPPRESSED_JSDOC_TAGS = ['virtualProp', 'slot', 'part', 'internal'];
/**
 * Create a stylistically-appropriate JS variable name from a filename
 *
 * If the filename has any of the special characters "?", "#", "&" and "=" it
 * will take the string before the left-most instance of one of those
 * characters.
 *
 * @param fileName the filename which serves as starting material
 * @returns a JS variable name based on the filename
 */
const createJsVarName = (fileName) => {
  if (isString$1(fileName)) {
    fileName = fileName.split('?')[0];
    fileName = fileName.split('#')[0];
    fileName = fileName.split('&')[0];
    fileName = fileName.split('=')[0];
    fileName = toDashCase(fileName);
    fileName = fileName.replace(/[|;$%@"<>()+,.{}_\!\/\\]/g, '-');
    fileName = dashToPascalCase$1(fileName);
    if (fileName.length > 1) {
      fileName = fileName[0].toLowerCase() + fileName.slice(1);
    }
    else {
      fileName = fileName.toLowerCase();
    }
    if (fileName.length > 0 && !isNaN(fileName[0])) {
      fileName = '_' + fileName;
    }
  }
  return fileName;
};
/**
 * Determines if a given file path points to a type declaration file (ending in .d.ts) or not. This function is
 * case-insensitive in its heuristics.
 * @param filePath the path to check
 * @returns `true` if the given `filePath` points to a type declaration file, `false` otherwise
 */
const isDtsFile$1 = (filePath) => {
  const parts = filePath.toLowerCase().split('.');
  if (parts.length > 2) {
    return parts[parts.length - 2] === 'd' && parts[parts.length - 1] === 'ts';
  }
  return false;
};
/**
 * Generate the preamble to be placed atop the main file of the build
 * @param config the Stencil configuration file
 * @returns the generated preamble
 */
const generatePreamble = (config) => {
  const { preamble } = config;
  if (!preamble) {
    return '';
  }
  // generate the body of the JSDoc-style comment
  const preambleComment = preamble.split('\n').map((l) => ` * ${l}`);
  preambleComment.unshift(`/*!`);
  preambleComment.push(` */`);
  return preambleComment.join('\n');
};
const lineBreakRegex = /\r?\n|\r/g;
function getTextDocs(docs) {
  if (docs == null) {
    return '';
  }
  return `${docs.text.replace(lineBreakRegex, ' ')}
${docs.tags
    .filter((tag) => tag.name !== 'internal')
    .map((tag) => `@${tag.name} ${(tag.text || '').replace(lineBreakRegex, ' ')}`)
    .join('\n')}`.trim();
}
/**
 * Adds a doc block to a string
 * @param str the string to add a doc block to
 * @param docs the compiled JS docs
 * @param indentation number of spaces to indent the block with
 * @returns the doc block
 */
function addDocBlock(str, docs, indentation = 0) {
  if (!docs) {
    return str;
  }
  return [formatDocBlock(docs, indentation), str].filter(Boolean).join(`\n`);
}
/**
 * Formats the given compiled docs to a JavaScript doc block
 * @param docs the compiled JS docs
 * @param indentation number of spaces to indent the block with
 * @returns the formatted doc block
 */
function formatDocBlock(docs, indentation = 0) {
  const textDocs = getDocBlockLines(docs);
  if (!textDocs.filter(Boolean).length) {
    return '';
  }
  const spaces = new Array(indentation + 1).join(' ');
  return [spaces + '/**', ...textDocs.map((line) => spaces + ` * ${line}`), spaces + ' */'].join(`\n`);
}
/**
 * Get all lines which are part of the doc block
 *
 * @param docs the compiled JS docs
 * @returns list of lines part of the doc block
 */
function getDocBlockLines(docs) {
  return [
    ...docs.text.split(lineBreakRegex),
    ...docs.tags
      .filter((tag) => !SUPPRESSED_JSDOC_TAGS.includes(tag.name))
      .map((tag) => `@${tag.name} ${tag.text || ''}`.split(lineBreakRegex)),
  ]
    .flat()
    .filter(Boolean);
}
/**
 * Retrieve a project's dependencies from the current build context
 * @param buildCtx the current build context to query for a specific package
 * @returns a list of package names the project is dependent on
 */
const getDependencies = (buildCtx) => {
  if (buildCtx.packageJson != null && buildCtx.packageJson.dependencies != null) {
    return Object.keys(buildCtx.packageJson.dependencies).filter((pkgName) => !SKIP_DEPS.includes(pkgName));
  }
  return [];
};
/**
 * Utility to determine whether a project has a dependency on a package
 * @param buildCtx the current build context to query for a specific package
 * @param depName the name of the dependency/package
 * @returns `true` if the project has a dependency a packaged with the provided name, `false` otherwise
 */
const hasDependency = (buildCtx, depName) => {
  return getDependencies(buildCtx).includes(depName);
};
const getDynamicImportFunction$1 = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
const readPackageJson = async (config, compilerCtx, buildCtx) => {
  try {
    const pkgJson = await compilerCtx.fs.readFile(config.packageJsonFilePath);
    if (pkgJson) {
      const parseResults = parsePackageJson(pkgJson, config.packageJsonFilePath);
      if (parseResults.diagnostic) {
        buildCtx.diagnostics.push(parseResults.diagnostic);
      }
      else {
        buildCtx.packageJson = parseResults.data;
      }
    }
  }
  catch (e) {
    if (!config.outputTargets.some((o) => o.type.includes('dist'))) {
      const diagnostic = buildError(buildCtx.diagnostics);
      diagnostic.header = `Missing "package.json"`;
      diagnostic.messageText = `Valid "package.json" file is required for distribution: ${config.packageJsonFilePath}`;
    }
  }
};
/**
 * Parse a string read from a `package.json` file
 * @param pkgJsonStr the string read from a `package.json` file
 * @param pkgJsonFilePath the path to the already read `package.json` file
 * @returns the results of parsing the provided contents of the `package.json` file
 */
const parsePackageJson = (pkgJsonStr, pkgJsonFilePath) => {
  const parseResult = {
    diagnostic: null,
    data: null,
    filePath: pkgJsonFilePath,
  };
  try {
    parseResult.data = JSON.parse(pkgJsonStr);
  }
  catch (e) {
    parseResult.diagnostic = buildError();
    parseResult.diagnostic.absFilePath = isString$1(pkgJsonFilePath) ? pkgJsonFilePath : undefined;
    parseResult.diagnostic.header = `Error Parsing JSON`;
    if (e instanceof Error) {
      parseResult.diagnostic.messageText = e.message;
    }
  }
  return parseResult;
};
const SKIP_DEPS = ['@stencil/core'];
/**
 * Check whether a string is a member of a ReadonlyArray<string>
 *
 * We need a little helper for this because unfortunately `includes` is typed
 * on `ReadonlyArray<T>` as `(el: T): boolean` so a `string` cannot be passed
 * to `includes` on a `ReadonlyArray` 😢 thus we have a little helper function
 * where we do the type coercion just once.
 *
 * see microsoft/TypeScript#31018 for some discussion of this
 *
 * @param readOnlyArray the array we're checking
 * @param maybeMember a value which is possibly a member of the array
 * @returns whether the array contains the member or not
 */
const readOnlyArrayHasStringMember = (readOnlyArray, maybeMember) => readOnlyArray.includes(maybeMember);

/**
 * Validates that a component tag meets required naming conventions to be used for a web component
 * @param tag the tag to validate
 * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
 */
const validateComponentTag = (tag) => {
  // we want to check this first since we call some String.prototype methods below
  if (typeof tag !== 'string') {
    return `Tag "${tag}" must be a string type`;
  }
  if (tag !== tag.trim()) {
    return `Tag can not contain white spaces`;
  }
  if (tag !== tag.toLowerCase()) {
    return `Tag can not contain upper case characters`;
  }
  if (tag.length === 0) {
    return `Received empty tag value`;
  }
  if (tag.indexOf(' ') > -1) {
    return `"${tag}" tag cannot contain a space`;
  }
  if (tag.indexOf(',') > -1) {
    return `"${tag}" tag cannot be used for multiple tags`;
  }
  const invalidChars = tag.replace(/\w|-/g, '');
  if (invalidChars !== '') {
    return `"${tag}" tag contains invalid characters: ${invalidChars}`;
  }
  if (tag.indexOf('-') === -1) {
    return `"${tag}" tag must contain a dash (-) to work as a valid web component`;
  }
  if (tag.indexOf('--') > -1) {
    return `"${tag}" tag cannot contain multiple dashes (--) next to each other`;
  }
  if (tag.indexOf('-') === 0) {
    return `"${tag}" tag cannot start with a dash (-)`;
  }
  if (tag.lastIndexOf('-') === tag.length - 1) {
    return `"${tag}" tag cannot end with a dash (-)`;
  }
  return undefined;
};

const EOL = '\n';
const platform = () => OS_PLATFORM;
const os$2 = {
  EOL,
  platform,
};

const os$3 = {
  __proto__: null,
  EOL: EOL,
  platform: platform,
  'default': os$2
};

// 'path' module extracted from Node.js v8.11.1 (only the posix part)

function assertPath(path) {
  if (typeof path !== 'string') {
  throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
  }
}

// Resolves . and .. elements in a path with directory names
function normalizeStringPosix(path, allowAboveRoot) {
  var res = '';
  var lastSegmentLength = 0;
  var lastSlash = -1;
  var dots = 0;
  var code;
  for (var i = 0; i <= path.length; ++i) {
  if (i < path.length)
    code = path.charCodeAt(i);
  else if (code === 47 /*/*/)
    break;
  else
    code = 47 /*/*/;
  if (code === 47 /*/*/) {
    if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
    if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
      if (res.length > 2) {
      var lastSlashIndex = res.lastIndexOf('/');
      if (lastSlashIndex !== res.length - 1) {
        if (lastSlashIndex === -1) {
        res = '';
        lastSegmentLength = 0;
        } else {
        res = res.slice(0, lastSlashIndex);
        lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
        }
        lastSlash = i;
        dots = 0;
        continue;
      }
      } else if (res.length === 2 || res.length === 1) {
      res = '';
      lastSegmentLength = 0;
      lastSlash = i;
      dots = 0;
      continue;
      }
    }
    if (allowAboveRoot) {
      if (res.length > 0)
      res += '/..';
      else
      res = '..';
      lastSegmentLength = 2;
    }
    } else {
    if (res.length > 0)
      res += '/' + path.slice(lastSlash + 1, i);
    else
      res = path.slice(lastSlash + 1, i);
    lastSegmentLength = i - lastSlash - 1;
    }
    lastSlash = i;
    dots = 0;
  } else if (code === 46 /*.*/ && dots !== -1) {
    ++dots;
  } else {
    dots = -1;
  }
  }
  return res;
}

function _format(sep, pathObject) {
  var dir = pathObject.dir || pathObject.root;
  var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
  if (!dir) {
  return base;
  }
  if (dir === pathObject.root) {
  return dir + base;
  }
  return dir + sep + base;
}

var posix$2 = {
  // path.resolve([from ...], to)
  resolve: function resolve() {
  var resolvedPath = '';
  var resolvedAbsolute = false;
  var cwd;

  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
    var path;
    if (i >= 0)
    path = arguments[i];
    else {
    if (cwd === undefined)
      cwd = process.cwd();
    path = cwd;
    }

    assertPath(path);

    // Skip empty entries
    if (path.length === 0) {
    continue;
    }

    resolvedPath = path + '/' + resolvedPath;
    resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
  }

  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when process.cwd() fails)

  // Normalize the path
  resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);

  if (resolvedAbsolute) {
    if (resolvedPath.length > 0)
    return '/' + resolvedPath;
    else
    return '/';
  } else if (resolvedPath.length > 0) {
    return resolvedPath;
  } else {
    return '.';
  }
  },

  normalize: function normalize(path) {
  assertPath(path);

  if (path.length === 0) return '.';

  var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
  var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;

  // Normalize the path
  path = normalizeStringPosix(path, !isAbsolute);

  if (path.length === 0 && !isAbsolute) path = '.';
  if (path.length > 0 && trailingSeparator) path += '/';

  if (isAbsolute) return '/' + path;
  return path;
  },

  isAbsolute: function isAbsolute(path) {
  assertPath(path);
  return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
  },

  join: function join() {
  if (arguments.length === 0)
    return '.';
  var joined;
  for (var i = 0; i < arguments.length; ++i) {
    var arg = arguments[i];
    assertPath(arg);
    if (arg.length > 0) {
    if (joined === undefined)
      joined = arg;
    else
      joined += '/' + arg;
    }
  }
  if (joined === undefined)
    return '.';
  return posix$2.normalize(joined);
  },

  relative: function relative(from, to) {
  assertPath(from);
  assertPath(to);

  if (from === to) return '';

  from = posix$2.resolve(from);
  to = posix$2.resolve(to);

  if (from === to) return '';

  // Trim any leading backslashes
  var fromStart = 1;
  for (; fromStart < from.length; ++fromStart) {
    if (from.charCodeAt(fromStart) !== 47 /*/*/)
    break;
  }
  var fromEnd = from.length;
  var fromLen = fromEnd - fromStart;

  // Trim any leading backslashes
  var toStart = 1;
  for (; toStart < to.length; ++toStart) {
    if (to.charCodeAt(toStart) !== 47 /*/*/)
    break;
  }
  var toEnd = to.length;
  var toLen = toEnd - toStart;

  // Compare paths to find the longest common path from root
  var length = fromLen < toLen ? fromLen : toLen;
  var lastCommonSep = -1;
  var i = 0;
  for (; i <= length; ++i) {
    if (i === length) {
    if (toLen > length) {
      if (to.charCodeAt(toStart + i) === 47 /*/*/) {
      // We get here if `from` is the exact base path for `to`.
      // For example: from='/foo/bar'; to='/foo/bar/baz'
      return to.slice(toStart + i + 1);
      } else if (i === 0) {
      // We get here if `from` is the root
      // For example: from='/'; to='/foo'
      return to.slice(toStart + i);
      }
    } else if (fromLen > length) {
      if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
      // We get here if `to` is the exact base path for `from`.
      // For example: from='/foo/bar/baz'; to='/foo/bar'
      lastCommonSep = i;
      } else if (i === 0) {
      // We get here if `to` is the root.
      // For example: from='/foo'; to='/'
      lastCommonSep = 0;
      }
    }
    break;
    }
    var fromCode = from.charCodeAt(fromStart + i);
    var toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode)
    break;
    else if (fromCode === 47 /*/*/)
    lastCommonSep = i;
  }

  var out = '';
  // Generate the relative path based on the path difference between `to`
  // and `from`
  for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
    if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
    if (out.length === 0)
      out += '..';
    else
      out += '/..';
    }
  }

  // Lastly, append the rest of the destination (`to`) path that comes after
  // the common path parts
  if (out.length > 0)
    return out + to.slice(toStart + lastCommonSep);
  else {
    toStart += lastCommonSep;
    if (to.charCodeAt(toStart) === 47 /*/*/)
    ++toStart;
    return to.slice(toStart);
  }
  },

  _makeLong: function _makeLong(path) {
  return path;
  },

  dirname: function dirname(path) {
  assertPath(path);
  if (path.length === 0) return '.';
  var code = path.charCodeAt(0);
  var hasRoot = code === 47 /*/*/;
  var end = -1;
  var matchedSlash = true;
  for (var i = path.length - 1; i >= 1; --i) {
    code = path.charCodeAt(i);
    if (code === 47 /*/*/) {
      if (!matchedSlash) {
      end = i;
      break;
      }
    } else {
    // We saw the first non-path separator
    matchedSlash = false;
    }
  }

  if (end === -1) return hasRoot ? '/' : '.';
  if (hasRoot && end === 1) return '//';
  return path.slice(0, end);
  },

  basename: function basename(path, ext) {
  if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
  assertPath(path);

  var start = 0;
  var end = -1;
  var matchedSlash = true;
  var i;

  if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
    if (ext.length === path.length && ext === path) return '';
    var extIdx = ext.length - 1;
    var firstNonSlashEnd = -1;
    for (i = path.length - 1; i >= 0; --i) {
    var code = path.charCodeAt(i);
    if (code === 47 /*/*/) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        start = i + 1;
        break;
      }
      } else {
      if (firstNonSlashEnd === -1) {
      // We saw the first non-path separator, remember this index in case
      // we need it if the extension ends up not matching
      matchedSlash = false;
      firstNonSlashEnd = i + 1;
      }
      if (extIdx >= 0) {
      // Try to match the explicit extension
      if (code === ext.charCodeAt(extIdx)) {
        if (--extIdx === -1) {
        // We matched the extension, so mark this as the end of our path
        // component
        end = i;
        }
      } else {
        // Extension does not match, so our result is the entire path
        // component
        extIdx = -1;
        end = firstNonSlashEnd;
      }
      }
    }
    }

    if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
    return path.slice(start, end);
  } else {
    for (i = path.length - 1; i >= 0; --i) {
    if (path.charCodeAt(i) === 47 /*/*/) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        start = i + 1;
        break;
      }
      } else if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // path component
      matchedSlash = false;
      end = i + 1;
    }
    }

    if (end === -1) return '';
    return path.slice(start, end);
  }
  },

  extname: function extname(path) {
  assertPath(path);
  var startDot = -1;
  var startPart = 0;
  var end = -1;
  var matchedSlash = true;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  var preDotState = 0;
  for (var i = path.length - 1; i >= 0; --i) {
    var code = path.charCodeAt(i);
    if (code === 47 /*/*/) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
      startPart = i + 1;
      break;
      }
      continue;
    }
    if (end === -1) {
    // We saw the first non-path separator, mark this as the end of our
    // extension
    matchedSlash = false;
    end = i + 1;
    }
    if (code === 46 /*.*/) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1)
      startDot = i;
      else if (preDotState !== 1)
      preDotState = 1;
    } else if (startDot !== -1) {
    // We saw a non-dot and non-path separator before our dot, so we should
    // have a good chance at having a non-empty extension
    preDotState = -1;
    }
  }

  if (startDot === -1 || end === -1 ||
    // We saw a non-dot character immediately before the dot
    preDotState === 0 ||
    // The (right-most) trimmed path component is exactly '..'
    preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    return '';
  }
  return path.slice(startDot, end);
  },

  format: function format(pathObject) {
  if (pathObject === null || typeof pathObject !== 'object') {
    throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  }
  return _format('/', pathObject);
  },

  parse: function parse(path) {
  assertPath(path);

  var ret = { root: '', dir: '', base: '', ext: '', name: '' };
  if (path.length === 0) return ret;
  var code = path.charCodeAt(0);
  var isAbsolute = code === 47 /*/*/;
  var start;
  if (isAbsolute) {
    ret.root = '/';
    start = 1;
  } else {
    start = 0;
  }
  var startDot = -1;
  var startPart = 0;
  var end = -1;
  var matchedSlash = true;
  var i = path.length - 1;

  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  var preDotState = 0;

  // Get non-dir info
  for (; i >= start; --i) {
    code = path.charCodeAt(i);
    if (code === 47 /*/*/) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
      startPart = i + 1;
      break;
      }
      continue;
    }
    if (end === -1) {
    // We saw the first non-path separator, mark this as the end of our
    // extension
    matchedSlash = false;
    end = i + 1;
    }
    if (code === 46 /*.*/) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
    // We saw a non-dot and non-path separator before our dot, so we should
    // have a good chance at having a non-empty extension
    preDotState = -1;
    }
  }

  if (startDot === -1 || end === -1 ||
  // We saw a non-dot character immediately before the dot
  preDotState === 0 ||
  // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1) {
    if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
    }
  } else {
    if (startPart === 0 && isAbsolute) {
    ret.name = path.slice(1, startDot);
    ret.base = path.slice(1, end);
    } else {
    ret.name = path.slice(startPart, startDot);
    ret.base = path.slice(startPart, end);
    }
    ret.ext = path.slice(startDot, end);
  }

  if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';

  return ret;
  },

  sep: '/',
  delimiter: ':',
  win32: null,
  posix: null
};

posix$2.posix = posix$2;

var pathBrowserify = posix$2;

let basename;
let dirname;
let extname$1;
let isAbsolute$1;
let join;
let normalize$1;
let parse$6;
let relative$1;
let resolve$3;
let sep;
let delimiter;
let posix$1;
let win32$1;
const path$5 = {};
const setPlatformPath = (platformPath) => {
  if (!platformPath) {
    platformPath = pathBrowserify;
  }
  Object.assign(path$5, platformPath);
  const normalizeOrg = path$5.normalize;
  const joinOrg = path$5.join;
  const relativeOrg = path$5.relative;
  const resolveOrg = path$5.resolve;
  normalize$1 = path$5.normalize = (...args) => normalizePath$2(normalizeOrg.apply(path$5, args));
  join = path$5.join = (...args) => normalizePath$2(joinOrg.apply(path$5, args));
  relative$1 = path$5.relative = (...args) => normalizePath$2(relativeOrg.apply(path$5, args));
  resolve$3 = path$5.resolve = (...args) => normalizePath$2(resolveOrg.apply(path$5, args));
  basename = path$5.basename;
  dirname = path$5.dirname;
  extname$1 = path$5.extname;
  isAbsolute$1 = path$5.isAbsolute;
  parse$6 = path$5.parse;
  sep = path$5.sep;
  delimiter = path$5.delimiter;
  posix$1 = path$5.posix;
  if (path$5.win32) {
    win32$1 = path$5.win32;
  }
  else {
    win32$1 = { ...posix$1 };
    win32$1.sep = '\\';
  }
};
setPlatformPath(IS_NODE_ENV ? requireFunc('path') : pathBrowserify);

const path$6 = {
  __proto__: null,
  get basename () { return basename; },
  get dirname () { return dirname; },
  get extname () { return extname$1; },
  get isAbsolute () { return isAbsolute$1; },
  get join () { return join; },
  get normalize () { return normalize$1; },
  get parse () { return parse$6; },
  get relative () { return relative$1; },
  get resolve () { return resolve$3; },
  get sep () { return sep; },
  get delimiter () { return delimiter; },
  get posix () { return posix$1; },
  get win32 () { return win32$1; },
  path: path$5,
  setPlatformPath: setPlatformPath,
  'default': path$5
};

var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

function createCommonjsModule$1(fn, basedir, module) {
	return module = {
		path: basedir,
		exports: {},
		require: function (path, base) {
			return commonjsRequire$1();
		}
	}, fn(module, module.exports), module.exports;
}

function getAugmentedNamespace$1(n) {
	if (n.__esModule) return n;
	var a = Object.defineProperty({}, '__esModule', {value: true});
	Object.keys(n).forEach(function (k) {
		var d = Object.getOwnPropertyDescriptor(n, k);
		Object.defineProperty(a, k, d.get ? d : {
			enumerable: true,
			get: function () {
				return n[k];
			}
		});
	});
	return a;
}

function commonjsRequire$1 () {
	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
}

// for now just expose the builtin process global from node.js
var process_1 = commonjsGlobal$1.process;

const process$3 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), process_1, {
  'default': process_1
});

const buildId = '1678806593';
const minfyJsId = 'terser5.16.1_7';
const optimizeCssId = 'autoprefixer10.4.13_postcss8.4.21_7';
const parse5Version = '7.1.2';
const rollupVersion = '2.42.3';
const sizzleVersion = '2.42.3';
const terserVersion = '5.16.1';
const typescriptVersion = '4.9.4';
const vermoji = '🎆';
const version$3 = '2.22.3';
const versions = {
  stencil: version$3,
  parse5: parse5Version,
  rollup: rollupVersion,
  sizzle: sizzleVersion,
  terser: terserVersion,
  typescript: typescriptVersion,
};

const buildEvents = () => {
  const evCallbacks = [];
  const off = (callback) => {
    const index = evCallbacks.findIndex((ev) => ev.callback === callback);
    if (index > -1) {
      evCallbacks.splice(index, 1);
      return true;
    }
    return false;
  };
  const on = (arg0, arg1) => {
    if (typeof arg0 === 'function') {
      const eventName = null;
      const callback = arg0;
      evCallbacks.push({
        eventName,
        callback,
      });
      return () => off(callback);
    }
    else if (typeof arg0 === 'string' && typeof arg1 === 'function') {
      const eventName = arg0.toLowerCase().trim();
      const callback = arg1;
      evCallbacks.push({
        eventName,
        callback,
      });
      return () => off(callback);
    }
    return () => false;
  };
  const emit = (eventName, data) => {
    const normalizedEventName = eventName.toLowerCase().trim();
    const callbacks = evCallbacks.slice();
    for (const ev of callbacks) {
      if (ev.eventName == null) {
        try {
          ev.callback(eventName, data);
        }
        catch (e) {
          console.error(e);
        }
      }
      else if (ev.eventName === normalizedEventName) {
        try {
          ev.callback(data);
        }
        catch (e) {
          console.error(e);
        }
      }
    }
  };
  const unsubscribeAll = () => {
    evCallbacks.length = 0;
  };
  return {
    emit,
    on,
    unsubscribeAll,
  };
};

/**
 * Creates an instance of a logger
 * @returns the new logger instance
 */
const createLogger = () => {
  let useColors = IS_BROWSER_ENV;
  let level = 'info';
  return {
    enableColors: (uc) => (useColors = uc),
    getLevel: () => level,
    setLevel: (l) => (level = l),
    emoji: (e) => e,
    info: console.log.bind(console),
    warn: console.warn.bind(console),
    error: console.error.bind(console),
    debug: console.debug.bind(console),
    red: (msg) => msg,
    green: (msg) => msg,
    yellow: (msg) => msg,
    blue: (msg) => msg,
    magenta: (msg) => msg,
    cyan: (msg) => msg,
    gray: (msg) => msg,
    bold: (msg) => msg,
    dim: (msg) => msg,
    bgRed: (msg) => msg,
    createTimeSpan: (_startMsg, _debug = false) => ({
      duration: () => 0,
      finish: () => 0,
    }),
    printDiagnostics(diagnostics) {
      diagnostics.forEach((diagnostic) => logDiagnostic(diagnostic, useColors));
    },
  };
};
const logDiagnostic = (diagnostic, useColors) => {
  let color = BLUE;
  let prefix = 'Build';
  let msg = '';
  if (diagnostic.level === 'error') {
    color = RED;
    prefix = 'Error';
  }
  else if (diagnostic.level === 'warn') {
    color = YELLOW;
    prefix = 'Warning';
  }
  if (diagnostic.header) {
    prefix = diagnostic.header;
  }
  const filePath = diagnostic.relFilePath || diagnostic.absFilePath;
  if (filePath) {
    msg += filePath;
    if (typeof diagnostic.lineNumber === 'number' && diagnostic.lineNumber > 0) {
      msg += ', line ' + diagnostic.lineNumber;
      if (typeof diagnostic.columnNumber === 'number' && diagnostic.columnNumber > 0) {
        msg += ', column ' + diagnostic.columnNumber;
      }
    }
    msg += '\n';
  }
  msg += diagnostic.messageText;
  if (diagnostic.lines && diagnostic.lines.length > 0) {
    diagnostic.lines.forEach((l) => {
      msg += '\n' + l.lineNumber + ':  ' + l.text;
    });
    msg += '\n';
  }
  if (useColors) {
    const styledPrefix = [
      '%c' + prefix,
      `background: ${color}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`,
    ];
    console.log(...styledPrefix, msg);
  }
  else if (diagnostic.level === 'error') {
    console.error(msg);
  }
  else if (diagnostic.level === 'warn') {
    console.warn(msg);
  }
  else {
    console.log(msg);
  }
};
const YELLOW = `#f39c12`;
const RED = `#c0392b`;
const BLUE = `#3498db`;

const inherits$3 = (ctor, superCtor) => {
  if (superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
      constructor: {
        value: ctor,
        enumerable: false,
        writable: true,
        configurable: true,
      },
    });
  }
};
const inspect = (...args) => args.forEach((arg) => console.log(arg));
const promisify = (fn) => {
  if (typeof fn[promisify.custom] === 'function') {
    // https://nodejs.org/api/util.html#util_custom_promisified_functions
    return function (...args) {
      return fn[promisify.custom].apply(this, args);
    };
  }
  return function (...args) {
    return new Promise((resolve, reject) => {
      args.push((err, result) => {
        if (err != null) {
          reject(err);
        }
        else {
          resolve(result);
        }
      });
      fn.apply(this, args);
    });
  };
};
promisify.custom = Symbol('promisify.custom');
const require$$0$1 = {
  inherits: inherits$3,
  inspect,
  promisify,
};

const util$4 = {
  __proto__: null,
  inherits: inherits$3,
  inspect: inspect,
  promisify: promisify,
  'default': require$$0$1
};

class FsError extends Error {
  constructor(syscall, path, code = 'ENOENT', errno = -2) {
    super(`ENOENT: no such file or directory, ${syscall} '${path}'`);
    this.syscall = syscall;
    this.path = path;
    this.code = code;
    this.errno = errno;
  }
}
const fs$3 = {
  __sys: {},
};
const exists$1 = (fs$3.exists = (p, cb) => {
  fs$3.__sys
    .access(p)
    .then(cb)
    .catch(() => cb(false));
});
// https://nodejs.org/api/util.html#util_custom_promisified_functions
exists$1[promisify.custom] = (p) => fs$3.__sys.access(p);
const existsSync = (fs$3.existsSync = (p) => {
  // https://nodejs.org/api/fs.html#fs_fs_existssync_path
  return fs$3.__sys.accessSync(p);
});
const mkdir = (fs$3.mkdir = (p, opts, cb) => {
  cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  opts = typeof opts === 'function' ? undefined : opts;
  fs$3.__sys
    .createDir(p, opts)
    .then((results) => {
    if (cb) {
      if (results.error) {
        cb(new FsError('mkdir', p));
      }
      else {
        cb(null);
      }
    }
  })
    .catch((e) => {
    cb && cb(e);
  });
});
const mkdirSync = (fs$3.mkdirSync = (p, opts) => {
  const results = fs$3.__sys.createDirSync(p, opts);
  if (results.error) {
    throw new FsError('mkdir', p);
  }
});
const readdirSync = (fs$3.readdirSync = (p) => {
  // sys.readdirSync includes full paths
  // but if fs.readdirSync was called, the expected
  // nodejs results are of just the basename for each dir item
  const dirItems = fs$3.__sys.readDirSync(p);
  return dirItems.map((dirItem) => basename(dirItem));
});
const readFile$2 = (fs$3.readFile = async (p, opts, cb) => {
  const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
  cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  fs$3.__sys
    .readFile(p, encoding)
    .then((data) => {
    if (cb) {
      if (typeof data === 'string') {
        cb(null, data);
      }
      else {
        cb(new FsError('open', p), data);
      }
    }
  })
    .catch((e) => {
    cb && cb(e);
  });
});
const readFileSync = (fs$3.readFileSync = (p, opts) => {
  const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
  const data = fs$3.__sys.readFileSync(p, encoding);
  if (typeof data !== 'string') {
    throw new FsError('open', p);
  }
  return data;
});
const realpath$3 = (fs$3.realpath = (p, opts, cb) => {
  cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  fs$3.__sys
    .realpath(p)
    .then((results) => {
    cb && cb(results.error, results.path);
  })
    .catch((e) => {
    cb && cb(e);
  });
});
const realpathSync$2 = (fs$3.realpathSync = (p) => {
  const results = fs$3.__sys.realpathSync(p);
  if (results.error) {
    throw results.error;
  }
  return normalizePath$2(results.path);
});
const statSync = (fs$3.statSync = (p) => {
  const fsStats = fs$3.__sys.statSync(p);
  if (fsStats.error) {
    throw new FsError('statSync', p);
  }
  return {
    isDirectory: () => fsStats.isDirectory,
    isFile: () => fsStats.isFile,
    isSymbolicLink: () => fsStats.isSymbolicLink,
    size: fsStats.size,
    mtimeMs: fsStats.mtimeMs,
  };
});
const lstatSync = (fs$3.lstatSync = statSync);
const stat$1 = (fs$3.stat = (p, opts, cb) => {
  cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  fs$3.__sys
    .stat(p)
    .then((fsStats) => {
    if (cb) {
      if (fsStats.error) {
        cb(new FsError('stat', p));
      }
      else {
        cb({
          isDirectory: () => fsStats.isDirectory,
          isFile: () => fsStats.isFile,
          isSymbolicLink: () => fsStats.isSymbolicLink,
          size: fsStats.size,
          mtimeMs: fsStats.mtimeMs,
        });
      }
    }
  })
    .catch((e) => {
    cb && cb(e);
  });
});
const watch = (fs$3.watch = () => {
  throw new Error(`fs.watch() not implemented`);
});
const writeFile$1 = (fs$3.writeFile = (p, data, opts, cb) => {
  cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  fs$3.__sys
    .writeFile(p, data)
    .then((writeResults) => {
    if (cb) {
      if (writeResults.error) {
        cb(new FsError('writeFile', p));
      }
      else {
        cb(null);
      }
    }
  })
    .catch((e) => {
    cb && cb(e);
  });
});

const fs$4 = {
  __proto__: null,
  exists: exists$1,
  existsSync: existsSync,
  mkdir: mkdir,
  mkdirSync: mkdirSync,
  readdirSync: readdirSync,
  readFile: readFile$2,
  readFileSync: readFileSync,
  realpath: realpath$3,
  realpathSync: realpathSync$2,
  statSync: statSync,
  lstatSync: lstatSync,
  stat: stat$1,
  watch: watch,
  writeFile: writeFile$1,
  'default': fs$3
};

var caller = function () {
  // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
  var origPrepareStackTrace = Error.prepareStackTrace;
  Error.prepareStackTrace = function (_, stack) { return stack; };
  var stack = (new Error()).stack;
  Error.prepareStackTrace = origPrepareStackTrace;
  return stack[2].getFileName();
};

var pathParse = createCommonjsModule$1(function (module) {

var isWindows = process.platform === 'win32';

// Regex to split a windows path into into [dir, root, basename, name, ext]
var splitWindowsRe =
  /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;

var win32 = {};

function win32SplitPath(filename) {
  return splitWindowsRe.exec(filename).slice(1);
}

win32.parse = function(pathString) {
  if (typeof pathString !== 'string') {
  throw new TypeError(
    "Parameter 'pathString' must be a string, not " + typeof pathString
  );
  }
  var allParts = win32SplitPath(pathString);
  if (!allParts || allParts.length !== 5) {
  throw new TypeError("Invalid path '" + pathString + "'");
  }
  return {
  root: allParts[1],
  dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
  base: allParts[2],
  ext: allParts[4],
  name: allParts[3]
  };
};



// Split a filename into [dir, root, basename, name, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
  /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
var posix = {};


function posixSplitPath(filename) {
  return splitPathRe.exec(filename).slice(1);
}


posix.parse = function(pathString) {
  if (typeof pathString !== 'string') {
  throw new TypeError(
    "Parameter 'pathString' must be a string, not " + typeof pathString
  );
  }
  var allParts = posixSplitPath(pathString);
  if (!allParts || allParts.length !== 5) {
  throw new TypeError("Invalid path '" + pathString + "'");
  }

  return {
  root: allParts[1],
  dir: allParts[0].slice(0, -1),
  base: allParts[2],
  ext: allParts[4],
  name: allParts[3],
  };
};


if (isWindows)
  module.exports = win32.parse;
else /* posix */
  module.exports = posix.parse;

module.exports.posix = posix.parse;
module.exports.win32 = win32.parse;
});

const path$4 = /*@__PURE__*/getAugmentedNamespace$1(path$6);

var parse$5 = path$4.parse || pathParse;

var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
  var prefix = '/';
  if ((/^([A-Za-z]:)/).test(absoluteStart)) {
    prefix = '';
  } else if ((/^\\\\/).test(absoluteStart)) {
    prefix = '\\\\';
  }

  var paths = [absoluteStart];
  var parsed = parse$5(absoluteStart);
  while (parsed.dir !== paths[paths.length - 1]) {
    paths.push(parsed.dir);
    parsed = parse$5(parsed.dir);
  }

  return paths.reduce(function (dirs, aPath) {
    return dirs.concat(modules.map(function (moduleDir) {
      return path$4.resolve(prefix, aPath, moduleDir);
    }));
  }, []);
};

var nodeModulesPaths = function nodeModulesPaths(start, opts, request) {
  var modules = opts && opts.moduleDirectory
    ? [].concat(opts.moduleDirectory)
    : ['node_modules'];

  if (opts && typeof opts.paths === 'function') {
    return opts.paths(
      request,
      start,
      function () { return getNodeModulesDirs(start, modules); },
      opts
    );
  }

  var dirs = getNodeModulesDirs(start, modules);
  return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
};

var normalizeOptions = function (x, opts) {
  /**
   * This file is purposefully a passthrough. It's expected that third-party
   * environments will override it at runtime in order to inject special logic
   * into `resolve` (by manipulating the options). One such example is the PnP
   * code path in Yarn.
   */

  return opts || {};
};

/* eslint no-invalid-this: 1 */

var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice$1 = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';

var implementation = function bind(that) {
  var target = this;
  if (typeof target !== 'function' || toStr.call(target) !== funcType) {
    throw new TypeError(ERROR_MESSAGE + target);
  }
  var args = slice$1.call(arguments, 1);

  var bound;
  var binder = function () {
    if (this instanceof bound) {
      var result = target.apply(
        this,
        args.concat(slice$1.call(arguments))
      );
      if (Object(result) === result) {
        return result;
      }
      return this;
    } else {
      return target.apply(
        that,
        args.concat(slice$1.call(arguments))
      );
    }
  };

  var boundLength = Math.max(0, target.length - args.length);
  var boundArgs = [];
  for (var i = 0; i < boundLength; i++) {
    boundArgs.push('$' + i);
  }

  bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);

  if (target.prototype) {
    var Empty = function Empty() {};
    Empty.prototype = target.prototype;
    bound.prototype = new Empty();
    Empty.prototype = null;
  }

  return bound;
};

var functionBind = Function.prototype.bind || implementation;

var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);

const assert$2 = true;
const async_hooks$1 = ">= 8";
const buffer_ieee754$1 = "< 0.9.7";
const buffer$1 = true;
const child_process$1 = true;
const cluster$1 = true;
const console$2 = true;
const constants$2 = true;
const crypto$2 = true;
const _debug_agent$1 = ">= 1 && < 8";
const _debugger$1 = "< 8";
const dgram$1 = true;
const diagnostics_channel$1 = ">= 15.1";
const dns$1 = true;
const domain$1 = ">= 0.7.12";
const events$2 = true;
const freelist$1 = "< 6";
const fs$2 = true;
const _http_agent$1 = ">= 0.11.1";
const _http_client$1 = ">= 0.11.1";
const _http_common$1 = ">= 0.11.1";
const _http_incoming$1 = ">= 0.11.1";
const _http_outgoing$1 = ">= 0.11.1";
const _http_server$1 = ">= 0.11.1";
const http$1 = true;
const http2$1 = ">= 8.8";
const https$1 = true;
const inspector$1 = ">= 8.0.0";
const _linklist$1 = "< 8";
const module$2 = true;
const net$1 = true;
const os$1 = true;
const path$3 = true;
const perf_hooks$1 = ">= 8.5";
const process$2 = ">= 1";
const punycode$1 = true;
const querystring$1 = true;
const readline$1 = true;
const repl$1 = true;
const smalloc$1 = ">= 0.11.5 && < 3";
const _stream_duplex$1 = ">= 0.9.4";
const _stream_transform$1 = ">= 0.9.4";
const _stream_wrap$1 = ">= 1.4.1";
const _stream_passthrough$1 = ">= 0.9.4";
const _stream_readable$1 = ">= 0.9.4";
const _stream_writable$1 = ">= 0.9.4";
const stream$1 = true;
const string_decoder$1 = true;
const sys$1 = [
	">= 0.6 && < 0.7",
	">= 0.8"
];
const timers$2 = true;
const _tls_common$1 = ">= 0.11.13";
const _tls_legacy$1 = ">= 0.11.3 && < 10";
const _tls_wrap$1 = ">= 0.11.3";
const tls$1 = true;
const trace_events$1 = ">= 10";
const tty$1 = true;
const url$1 = true;
const util$3 = true;
const v8$1 = ">= 1";
const vm$1 = true;
const wasi$1 = ">= 13.4 && < 13.5";
const worker_threads$1 = ">= 11.7";
const zlib$1 = true;
const data$2 = {
	assert: assert$2,
	"assert/strict": ">= 15",
	async_hooks: async_hooks$1,
	buffer_ieee754: buffer_ieee754$1,
	buffer: buffer$1,
	child_process: child_process$1,
	cluster: cluster$1,
	console: console$2,
	constants: constants$2,
	crypto: crypto$2,
	_debug_agent: _debug_agent$1,
	_debugger: _debugger$1,
	dgram: dgram$1,
	diagnostics_channel: diagnostics_channel$1,
	dns: dns$1,
	"dns/promises": ">= 15",
	domain: domain$1,
	events: events$2,
	freelist: freelist$1,
	fs: fs$2,
	"fs/promises": [
	">= 10 && < 10.1",
	">= 14"
],
	_http_agent: _http_agent$1,
	_http_client: _http_client$1,
	_http_common: _http_common$1,
	_http_incoming: _http_incoming$1,
	_http_outgoing: _http_outgoing$1,
	_http_server: _http_server$1,
	http: http$1,
	http2: http2$1,
	https: https$1,
	inspector: inspector$1,
	_linklist: _linklist$1,
	module: module$2,
	net: net$1,
	"node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
	"node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
	"node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
	os: os$1,
	path: path$3,
	"path/posix": ">= 15.3",
	"path/win32": ">= 15.3",
	perf_hooks: perf_hooks$1,
	process: process$2,
	punycode: punycode$1,
	querystring: querystring$1,
	readline: readline$1,
	repl: repl$1,
	smalloc: smalloc$1,
	_stream_duplex: _stream_duplex$1,
	_stream_transform: _stream_transform$1,
	_stream_wrap: _stream_wrap$1,
	_stream_passthrough: _stream_passthrough$1,
	_stream_readable: _stream_readable$1,
	_stream_writable: _stream_writable$1,
	stream: stream$1,
	"stream/promises": ">= 15",
	string_decoder: string_decoder$1,
	sys: sys$1,
	timers: timers$2,
	"timers/promises": ">= 15",
	_tls_common: _tls_common$1,
	_tls_legacy: _tls_legacy$1,
	_tls_wrap: _tls_wrap$1,
	tls: tls$1,
	trace_events: trace_events$1,
	tty: tty$1,
	url: url$1,
	util: util$3,
	"util/types": ">= 15.3",
	"v8/tools/arguments": ">= 10 && < 12",
	"v8/tools/codemap": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/consarray": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/csvparser": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/logreader": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/profile_view": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/splaytree": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	v8: v8$1,
	vm: vm$1,
	wasi: wasi$1,
	worker_threads: worker_threads$1,
	zlib: zlib$1
};

function specifierIncluded$1(current, specifier) {
	var nodeParts = current.split('.');
	var parts = specifier.split(' ');
	var op = parts.length > 1 ? parts[0] : '=';
	var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');

	for (var i = 0; i < 3; ++i) {
		var cur = parseInt(nodeParts[i] || 0, 10);
		var ver = parseInt(versionParts[i] || 0, 10);
		if (cur === ver) {
			continue; // eslint-disable-line no-restricted-syntax, no-continue
		}
		if (op === '<') {
			return cur < ver;
		}
		if (op === '>=') {
			return cur >= ver;
		}
		return false;
	}
	return op === '>=';
}

function matchesRange$1(current, range) {
	var specifiers = range.split(/ ?&& ?/);
	if (specifiers.length === 0) {
		return false;
	}
	for (var i = 0; i < specifiers.length; ++i) {
		if (!specifierIncluded$1(current, specifiers[i])) {
			return false;
		}
	}
	return true;
}

function versionIncluded$1(nodeVersion, specifierValue) {
	if (typeof specifierValue === 'boolean') {
		return specifierValue;
	}

	var current = typeof nodeVersion === 'undefined'
		? process.versions && process.versions.node && process.versions.node
		: nodeVersion;

	if (typeof current !== 'string') {
		throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
	}

	if (specifierValue && typeof specifierValue === 'object') {
		for (var i = 0; i < specifierValue.length; ++i) {
			if (matchesRange$1(current, specifierValue[i])) {
				return true;
			}
		}
		return false;
	}
	return matchesRange$1(current, specifierValue);
}



var isCoreModule = function isCore(x, nodeVersion) {
	return src(data$2, x) && versionIncluded$1(nodeVersion, data$2[x]);
};

const fs$1 = /*@__PURE__*/getAugmentedNamespace$1(fs$4);

var realpathFS$1 = fs$1.realpath && typeof fs$1.realpath.native === 'function' ? fs$1.realpath.native : fs$1.realpath;

var defaultIsFile$1 = function isFile(file, cb) {
  fs$1.stat(file, function (err, stat) {
    if (!err) {
      return cb(null, stat.isFile() || stat.isFIFO());
    }
    if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
    return cb(err);
  });
};

var defaultIsDir$1 = function isDirectory(dir, cb) {
  fs$1.stat(dir, function (err, stat) {
    if (!err) {
      return cb(null, stat.isDirectory());
    }
    if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
    return cb(err);
  });
};

var defaultRealpath = function realpath(x, cb) {
  realpathFS$1(x, function (realpathErr, realPath) {
    if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
    else cb(null, realpathErr ? x : realPath);
  });
};

var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
  if (opts && opts.preserveSymlinks === false) {
    realpath(x, cb);
  } else {
    cb(null, x);
  }
};

var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
  readFile(pkgfile, function (readFileErr, body) {
    if (readFileErr) cb(readFileErr);
    else {
      try {
        var pkg = JSON.parse(body);
        cb(null, pkg);
      } catch (jsonErr) {
        cb(null);
      }
    }
  });
};

var getPackageCandidates$1 = function getPackageCandidates(x, start, opts) {
  var dirs = nodeModulesPaths(start, opts, x);
  for (var i = 0; i < dirs.length; i++) {
    dirs[i] = path$4.join(dirs[i], x);
  }
  return dirs;
};

var async = function resolve(x, options, callback) {
  var cb = callback;
  var opts = options;
  if (typeof options === 'function') {
    cb = opts;
    opts = {};
  }
  if (typeof x !== 'string') {
    var err = new TypeError('Path must be a string.');
    return process.nextTick(function () {
      cb(err);
    });
  }

  opts = normalizeOptions(x, opts);

  var isFile = opts.isFile || defaultIsFile$1;
  var isDirectory = opts.isDirectory || defaultIsDir$1;
  var readFile = opts.readFile || fs$1.readFile;
  var realpath = opts.realpath || defaultRealpath;
  var readPackage = opts.readPackage || defaultReadPackage;
  if (opts.readFile && opts.readPackage) {
    var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
    return process.nextTick(function () {
      cb(conflictErr);
    });
  }
  var packageIterator = opts.packageIterator;

  var extensions = opts.extensions || ['.js'];
  var includeCoreModules = opts.includeCoreModules !== false;
  var basedir = opts.basedir || path$4.dirname(caller());
  var parent = opts.filename || basedir;

  opts.paths = opts.paths || [];

  // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
  var absoluteStart = path$4.resolve(basedir);

  maybeRealpath(
    realpath,
    absoluteStart,
    opts,
    function (err, realStart) {
      if (err) cb(err);
      else init(realStart);
    }
  );

  var res;
  function init(basedir) {
    if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
      res = path$4.resolve(basedir, x);
      if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
      if ((/\/$/).test(x) && res === basedir) {
        loadAsDirectory(res, opts.package, onfile);
      } else loadAsFile(res, opts.package, onfile);
    } else if (includeCoreModules && isCoreModule(x)) {
      return cb(null, x);
    } else loadNodeModules(x, basedir, function (err, n, pkg) {
      if (err) cb(err);
      else if (n) {
        return maybeRealpath(realpath, n, opts, function (err, realN) {
          if (err) {
            cb(err);
          } else {
            cb(null, realN, pkg);
          }
        });
      } else {
        var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
        moduleError.code = 'MODULE_NOT_FOUND';
        cb(moduleError);
      }
    });
  }

  function onfile(err, m, pkg) {
    if (err) cb(err);
    else if (m) cb(null, m, pkg);
    else loadAsDirectory(res, function (err, d, pkg) {
      if (err) cb(err);
      else if (d) {
        maybeRealpath(realpath, d, opts, function (err, realD) {
          if (err) {
            cb(err);
          } else {
            cb(null, realD, pkg);
          }
        });
      } else {
        var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
        moduleError.code = 'MODULE_NOT_FOUND';
        cb(moduleError);
      }
    });
  }

  function loadAsFile(x, thePackage, callback) {
    var loadAsFilePackage = thePackage;
    var cb = callback;
    if (typeof loadAsFilePackage === 'function') {
      cb = loadAsFilePackage;
      loadAsFilePackage = undefined;
    }

    var exts = [''].concat(extensions);
    load(exts, x, loadAsFilePackage);

    function load(exts, x, loadPackage) {
      if (exts.length === 0) return cb(null, undefined, loadPackage);
      var file = x + exts[0];

      var pkg = loadPackage;
      if (pkg) onpkg(null, pkg);
      else loadpkg(path$4.dirname(file), onpkg);

      function onpkg(err, pkg_, dir) {
        pkg = pkg_;
        if (err) return cb(err);
        if (dir && pkg && opts.pathFilter) {
          var rfile = path$4.relative(dir, file);
          var rel = rfile.slice(0, rfile.length - exts[0].length);
          var r = opts.pathFilter(pkg, x, rel);
          if (r) return load(
            [''].concat(extensions.slice()),
            path$4.resolve(dir, r),
            pkg
          );
        }
        isFile(file, onex);
      }
      function onex(err, ex) {
        if (err) return cb(err);
        if (ex) return cb(null, file, pkg);
        load(exts.slice(1), x, pkg);
      }
    }
  }

  function loadpkg(dir, cb) {
    if (dir === '' || dir === '/') return cb(null);
    if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
      return cb(null);
    }
    if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);

    maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
      if (unwrapErr) return loadpkg(path$4.dirname(dir), cb);
      var pkgfile = path$4.join(pkgdir, 'package.json');
      isFile(pkgfile, function (err, ex) {
        // on err, ex is false
        if (!ex) return loadpkg(path$4.dirname(dir), cb);

        readPackage(readFile, pkgfile, function (err, pkgParam) {
          if (err) cb(err);

          var pkg = pkgParam;

          if (pkg && opts.packageFilter) {
            pkg = opts.packageFilter(pkg, pkgfile);
          }
          cb(null, pkg, dir);
        });
      });
    });
  }

  function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
    var cb = callback;
    var fpkg = loadAsDirectoryPackage;
    if (typeof fpkg === 'function') {
      cb = fpkg;
      fpkg = opts.package;
    }

    maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
      if (unwrapErr) return cb(unwrapErr);
      var pkgfile = path$4.join(pkgdir, 'package.json');
      isFile(pkgfile, function (err, ex) {
        if (err) return cb(err);
        if (!ex) return loadAsFile(path$4.join(x, 'index'), fpkg, cb);

        readPackage(readFile, pkgfile, function (err, pkgParam) {
          if (err) return cb(err);

          var pkg = pkgParam;

          if (pkg && opts.packageFilter) {
            pkg = opts.packageFilter(pkg, pkgfile);
          }

          if (pkg && pkg.main) {
            if (typeof pkg.main !== 'string') {
              var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
              mainError.code = 'INVALID_PACKAGE_MAIN';
              return cb(mainError);
            }
            if (pkg.main === '.' || pkg.main === './') {
              pkg.main = 'index';
            }
            loadAsFile(path$4.resolve(x, pkg.main), pkg, function (err, m, pkg) {
              if (err) return cb(err);
              if (m) return cb(null, m, pkg);
              if (!pkg) return loadAsFile(path$4.join(x, 'index'), pkg, cb);

              var dir = path$4.resolve(x, pkg.main);
              loadAsDirectory(dir, pkg, function (err, n, pkg) {
                if (err) return cb(err);
                if (n) return cb(null, n, pkg);
                loadAsFile(path$4.join(x, 'index'), pkg, cb);
              });
            });
            return;
          }

          loadAsFile(path$4.join(x, '/index'), pkg, cb);
        });
      });
    });
  }

  function processDirs(cb, dirs) {
    if (dirs.length === 0) return cb(null, undefined);
    var dir = dirs[0];

    isDirectory(path$4.dirname(dir), isdir);

    function isdir(err, isdir) {
      if (err) return cb(err);
      if (!isdir) return processDirs(cb, dirs.slice(1));
      loadAsFile(dir, opts.package, onfile);
    }

    function onfile(err, m, pkg) {
      if (err) return cb(err);
      if (m) return cb(null, m, pkg);
      loadAsDirectory(dir, opts.package, ondir);
    }

    function ondir(err, n, pkg) {
      if (err) return cb(err);
      if (n) return cb(null, n, pkg);
      processDirs(cb, dirs.slice(1));
    }
  }
  function loadNodeModules(x, start, cb) {
    var thunk = function () { return getPackageCandidates$1(x, start, opts); };
    processDirs(
      cb,
      packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
    );
  }
};

const assert$1 = true;
const async_hooks = ">= 8";
const buffer_ieee754 = "< 0.9.7";
const buffer = true;
const child_process = true;
const cluster = true;
const console$1 = true;
const constants$1 = true;
const crypto$1 = true;
const _debug_agent = ">= 1 && < 8";
const _debugger = "< 8";
const dgram = true;
const diagnostics_channel = ">= 15.1";
const dns = true;
const domain = ">= 0.7.12";
const events$1 = true;
const freelist = "< 6";
const fs = true;
const _http_agent = ">= 0.11.1";
const _http_client = ">= 0.11.1";
const _http_common = ">= 0.11.1";
const _http_incoming = ">= 0.11.1";
const _http_outgoing = ">= 0.11.1";
const _http_server = ">= 0.11.1";
const http = true;
const http2 = ">= 8.8";
const https = true;
const inspector = ">= 8.0.0";
const _linklist = "< 8";
const module$1 = true;
const net = true;
const os = true;
const path$2 = true;
const perf_hooks = ">= 8.5";
const process$1 = ">= 1";
const punycode = true;
const querystring = true;
const readline = true;
const repl = true;
const smalloc = ">= 0.11.5 && < 3";
const _stream_duplex = ">= 0.9.4";
const _stream_transform = ">= 0.9.4";
const _stream_wrap = ">= 1.4.1";
const _stream_passthrough = ">= 0.9.4";
const _stream_readable = ">= 0.9.4";
const _stream_writable = ">= 0.9.4";
const stream = true;
const string_decoder = true;
const sys = [
	">= 0.6 && < 0.7",
	">= 0.8"
];
const timers$1 = true;
const _tls_common = ">= 0.11.13";
const _tls_legacy = ">= 0.11.3 && < 10";
const _tls_wrap = ">= 0.11.3";
const tls = true;
const trace_events = ">= 10";
const tty = true;
const url = true;
const util$2 = true;
const v8 = ">= 1";
const vm = true;
const wasi = ">= 13.4 && < 13.5";
const worker_threads = ">= 11.7";
const zlib = true;
const data$1 = {
	assert: assert$1,
	"assert/strict": ">= 15",
	async_hooks: async_hooks,
	buffer_ieee754: buffer_ieee754,
	buffer: buffer,
	child_process: child_process,
	cluster: cluster,
	console: console$1,
	constants: constants$1,
	crypto: crypto$1,
	_debug_agent: _debug_agent,
	_debugger: _debugger,
	dgram: dgram,
	diagnostics_channel: diagnostics_channel,
	dns: dns,
	"dns/promises": ">= 15",
	domain: domain,
	events: events$1,
	freelist: freelist,
	fs: fs,
	"fs/promises": [
	">= 10 && < 10.1",
	">= 14"
],
	_http_agent: _http_agent,
	_http_client: _http_client,
	_http_common: _http_common,
	_http_incoming: _http_incoming,
	_http_outgoing: _http_outgoing,
	_http_server: _http_server,
	http: http,
	http2: http2,
	https: https,
	inspector: inspector,
	_linklist: _linklist,
	module: module$1,
	net: net,
	"node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
	"node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
	"node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
	os: os,
	path: path$2,
	"path/posix": ">= 15.3",
	"path/win32": ">= 15.3",
	perf_hooks: perf_hooks,
	process: process$1,
	punycode: punycode,
	querystring: querystring,
	readline: readline,
	repl: repl,
	smalloc: smalloc,
	_stream_duplex: _stream_duplex,
	_stream_transform: _stream_transform,
	_stream_wrap: _stream_wrap,
	_stream_passthrough: _stream_passthrough,
	_stream_readable: _stream_readable,
	_stream_writable: _stream_writable,
	stream: stream,
	"stream/promises": ">= 15",
	string_decoder: string_decoder,
	sys: sys,
	timers: timers$1,
	"timers/promises": ">= 15",
	_tls_common: _tls_common,
	_tls_legacy: _tls_legacy,
	_tls_wrap: _tls_wrap,
	tls: tls,
	trace_events: trace_events,
	tty: tty,
	url: url,
	util: util$2,
	"util/types": ">= 15.3",
	"v8/tools/arguments": ">= 10 && < 12",
	"v8/tools/codemap": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/consarray": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/csvparser": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/logreader": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/profile_view": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	"v8/tools/splaytree": [
	">= 4.4.0 && < 5",
	">= 5.2.0 && < 12"
],
	v8: v8,
	vm: vm,
	wasi: wasi,
	worker_threads: worker_threads,
	zlib: zlib
};

var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];

function specifierIncluded(specifier) {
  var parts = specifier.split(' ');
  var op = parts.length > 1 ? parts[0] : '=';
  var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');

  for (var i = 0; i < 3; ++i) {
    var cur = parseInt(current[i] || 0, 10);
    var ver = parseInt(versionParts[i] || 0, 10);
    if (cur === ver) {
      continue; // eslint-disable-line no-restricted-syntax, no-continue
    }
    if (op === '<') {
      return cur < ver;
    } else if (op === '>=') {
      return cur >= ver;
    } else {
      return false;
    }
  }
  return op === '>=';
}

function matchesRange(range) {
  var specifiers = range.split(/ ?&& ?/);
  if (specifiers.length === 0) { return false; }
  for (var i = 0; i < specifiers.length; ++i) {
    if (!specifierIncluded(specifiers[i])) { return false; }
  }
  return true;
}

function versionIncluded(specifierValue) {
  if (typeof specifierValue === 'boolean') { return specifierValue; }
  if (specifierValue && typeof specifierValue === 'object') {
    for (var i = 0; i < specifierValue.length; ++i) {
      if (matchesRange(specifierValue[i])) { return true; }
    }
    return false;
  }
  return matchesRange(specifierValue);
}



var core = {};
for (var mod in data$1) { // eslint-disable-line no-restricted-syntax
  if (Object.prototype.hasOwnProperty.call(data$1, mod)) {
    core[mod] = versionIncluded(data$1[mod]);
  }
}
var core_1 = core;

var isCore = function isCore(x) {
  return isCoreModule(x);
};

var realpathFS = fs$1.realpathSync && typeof fs$1.realpathSync.native === 'function' ? fs$1.realpathSync.native : fs$1.realpathSync;

var defaultIsFile = function isFile(file) {
  try {
    var stat = fs$1.statSync(file);
  } catch (e) {
    if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
    throw e;
  }
  return stat.isFile() || stat.isFIFO();
};

var defaultIsDir = function isDirectory(dir) {
  try {
    var stat = fs$1.statSync(dir);
  } catch (e) {
    if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
    throw e;
  }
  return stat.isDirectory();
};

var defaultRealpathSync = function realpathSync(x) {
  try {
    return realpathFS(x);
  } catch (realpathErr) {
    if (realpathErr.code !== 'ENOENT') {
      throw realpathErr;
    }
  }
  return x;
};

var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
  if (opts && opts.preserveSymlinks === false) {
    return realpathSync(x);
  }
  return x;
};

var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
  var body = readFileSync(pkgfile);
  try {
    var pkg = JSON.parse(body);
    return pkg;
  } catch (jsonErr) {}
};

var getPackageCandidates = function getPackageCandidates(x, start, opts) {
  var dirs = nodeModulesPaths(start, opts, x);
  for (var i = 0; i < dirs.length; i++) {
    dirs[i] = path$4.join(dirs[i], x);
  }
  return dirs;
};

var sync$1 = function resolveSync(x, options) {
  if (typeof x !== 'string') {
    throw new TypeError('Path must be a string.');
  }
  var opts = normalizeOptions(x, options);

  var isFile = opts.isFile || defaultIsFile;
  var readFileSync = opts.readFileSync || fs$1.readFileSync;
  var isDirectory = opts.isDirectory || defaultIsDir;
  var realpathSync = opts.realpathSync || defaultRealpathSync;
  var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
  if (opts.readFileSync && opts.readPackageSync) {
    throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
  }
  var packageIterator = opts.packageIterator;

  var extensions = opts.extensions || ['.js'];
  var includeCoreModules = opts.includeCoreModules !== false;
  var basedir = opts.basedir || path$4.dirname(caller());
  var parent = opts.filename || basedir;

  opts.paths = opts.paths || [];

  // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
  var absoluteStart = maybeRealpathSync(realpathSync, path$4.resolve(basedir), opts);

  if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
    var res = path$4.resolve(absoluteStart, x);
    if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
    var m = loadAsFileSync(res) || loadAsDirectorySync(res);
    if (m) return maybeRealpathSync(realpathSync, m, opts);
  } else if (includeCoreModules && isCoreModule(x)) {
    return x;
  } else {
    var n = loadNodeModulesSync(x, absoluteStart);
    if (n) return maybeRealpathSync(realpathSync, n, opts);
  }

  var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  err.code = 'MODULE_NOT_FOUND';
  throw err;

  function loadAsFileSync(x) {
    var pkg = loadpkg(path$4.dirname(x));

    if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
      var rfile = path$4.relative(pkg.dir, x);
      var r = opts.pathFilter(pkg.pkg, x, rfile);
      if (r) {
        x = path$4.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
      }
    }

    if (isFile(x)) {
      return x;
    }

    for (var i = 0; i < extensions.length; i++) {
      var file = x + extensions[i];
      if (isFile(file)) {
        return file;
      }
    }
  }

  function loadpkg(dir) {
    if (dir === '' || dir === '/') return;
    if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
      return;
    }
    if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;

    var pkgfile = path$4.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');

    if (!isFile(pkgfile)) {
      return loadpkg(path$4.dirname(dir));
    }

    var pkg = readPackageSync(readFileSync, pkgfile);

    if (pkg && opts.packageFilter) {
      // v2 will pass pkgfile
      pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
    }

    return { pkg: pkg, dir: dir };
  }

  function loadAsDirectorySync(x) {
    var pkgfile = path$4.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
    if (isFile(pkgfile)) {
      try {
        var pkg = readPackageSync(readFileSync, pkgfile);
      } catch (e) {}

      if (pkg && opts.packageFilter) {
        // v2 will pass pkgfile
        pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
      }

      if (pkg && pkg.main) {
        if (typeof pkg.main !== 'string') {
          var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
          mainError.code = 'INVALID_PACKAGE_MAIN';
          throw mainError;
        }
        if (pkg.main === '.' || pkg.main === './') {
          pkg.main = 'index';
        }
        try {
          var m = loadAsFileSync(path$4.resolve(x, pkg.main));
          if (m) return m;
          var n = loadAsDirectorySync(path$4.resolve(x, pkg.main));
          if (n) return n;
        } catch (e) {}
      }
    }

    return loadAsFileSync(path$4.join(x, '/index'));
  }

  function loadNodeModulesSync(x, start) {
    var thunk = function () { return getPackageCandidates(x, start, opts); };
    var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();

    for (var i = 0; i < dirs.length; i++) {
      var dir = dirs[i];
      if (isDirectory(path$4.dirname(dir))) {
        var m = loadAsFileSync(dir);
        if (m) return m;
        var n = loadAsDirectorySync(dir);
        if (n) return n;
      }
    }
  }
};

async.core = core_1;
async.isCore = isCore;
async.sync = sync$1;

var resolve$2 = async;

const COMMON_DIR_MODULE_EXTS = ['.tsx', '.ts', '.mjs', '.js', '.jsx', '.json', '.md'];
const COMMON_DIR_FILENAMES = ['package.json', 'index.js', 'index.mjs'];
/**
 * Determine if a stringified file path is a TypeScript declaration file based on the extension at the end of the path.
 * @param p the path to evaluate
 * @returns `true` if the path ends in `.d.ts` (case-sensitive), `false` otherwise.
 */
const isDtsFile = (p) => p.endsWith('.d.ts');
/**
 * Determine if a stringified file path is a TypeScript file based on the extension at the end of the path. This
 * function does _not_ consider type declaration files (`.d.ts` files) to be TypeScript files.
 * @param p the path to evaluate
 * @returns `true` if the path ends in `.ts` (case-sensitive) but does _not_ end in `.d.ts`, `false` otherwise.
 */
const isTsFile = (p) => !isDtsFile(p) && p.endsWith('.ts');
/**
 * Determine if a stringified file path is a TSX file based on the extension at the end of the path
 * @param p the path to evaluate
 * @returns `true` if the path ends in `.tsx` (case-sensitive), `false` otherwise.
 */
const isTsxFile = (p) => p.endsWith('.tsx');
/**
 * Determine if a stringified file path is a JSX file based on the extension at the end of the path
 * @param p the path to evaluate
 * @returns `true` if the path ends in `.jsx` (case-sensitive), `false` otherwise.
 */
const isJsxFile = (p) => p.endsWith('.jsx');
/**
 * Determine if a stringified file path is a JavaScript file based on the extension at the end of the path
 * @param p the path to evaluate
 * @returns `true` if the path ends in `.js` (case-sensitive), `false` otherwise.
 */
const isJsFile = (p) => p.endsWith('.js');
const isJsonFile = (p) => p.endsWith('.json');
const getCommonDirName = (dirPath, fileName) => dirPath + '/' + fileName;
const isCommonDirModuleFile = (p) => COMMON_DIR_MODULE_EXTS.some((ext) => p.endsWith(ext));
const setPackageVersion = (pkgVersions, pkgName, pkgVersion) => {
  pkgVersions.set(pkgName, pkgVersion);
};
const setPackageVersionByContent = (pkgVersions, pkgContent) => {
  try {
    const pkg = JSON.parse(pkgContent);
    if (pkg.name && pkg.version) {
      setPackageVersion(pkgVersions, pkg.name, pkg.version);
    }
  }
  catch (e) { }
};
const isLocalModule = (p) => p.startsWith('.') || p.startsWith('/');
const isStencilCoreImport = (p) => p.startsWith('@stencil/core');
const shouldFetchModule = (p) => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(p);
const isNodeModulePath = (p) => normalizePath$2(p).split('/').includes('node_modules');
const getModuleId = (orgImport) => {
  if (orgImport.startsWith('~')) {
    orgImport = orgImport.substring(1);
  }
  const splt = orgImport.split('/');
  const m = {
    moduleId: null,
    filePath: null,
    scope: null,
    scopeSubModuleId: null,
  };
  if (orgImport.startsWith('@') && splt.length > 1) {
    m.moduleId = splt.slice(0, 2).join('/');
    m.filePath = splt.slice(2).join('/');
    m.scope = splt[0];
    m.scopeSubModuleId = splt[1];
  }
  else {
    m.moduleId = splt[0];
    m.filePath = splt.slice(1).join('/');
  }
  return m;
};
const getPackageDirPath = (p, moduleId) => {
  const parts = normalizePath$2(p).split('/');
  const m = getModuleId(moduleId);
  for (let i = parts.length - 1; i >= 1; i--) {
    if (parts[i - 1] === 'node_modules') {
      if (m.scope) {
        if (parts[i] === m.scope && parts[i + 1] === m.scopeSubModuleId) {
          return parts.slice(0, i + 2).join('/');
        }
      }
      else if (parts[i] === m.moduleId) {
        return parts.slice(0, i + 1).join('/');
      }
    }
  }
  return null;
};

/**
 * A fetch wrapper which dispatches to `sys.fetch` if present, and otherwise
 * uses `global.fetch`.
 *
 * @param sys a compiler system object
 * @param input a `RequestInfo` object
 * @param init an optional `RequestInit` object
 * @returns a Promise wrapping a response
 */
const httpFetch = (sys, input, init) => {
  if (sys && isFunction(sys.fetch)) {
    return sys.fetch(input, init);
  }
  return fetch(input, init);
};
const packageVersions = new Map();
const known404Urls = new Set();
/**
 * Get the URL for a Stencil module given the path to the compiler
 *
 * @param compilerExe the path to the compiler executable
 * @param path the path to the module or file in question
 * @returns a URL for the file of interest
 */
const getStencilModuleUrl = (compilerExe, path) => {
  path = normalizePath$2(path);
  let parts = path.split('/');
  const nmIndex = parts.lastIndexOf('node_modules');
  if (nmIndex > -1 && nmIndex < parts.length - 1) {
    parts = parts.slice(nmIndex + 1);
    if (parts[0].startsWith('@')) {
      parts = parts.slice(2);
    }
    else {
      parts = parts.slice(1);
    }
    path = parts.join('/');
  }
  const stencilRootUrl = new URL('../', compilerExe).href;
  return new URL('./' + path, stencilRootUrl).href;
};
const getCommonDirUrl = (sys, pkgVersions, dirPath, fileName) => getNodeModuleFetchUrl(sys, pkgVersions, dirPath) + '/' + fileName;
const getNodeModuleFetchUrl = (sys, pkgVersions, filePath) => {
  // /node_modules/lodash/package.json
  filePath = normalizePath$2(filePath);
  // ["node_modules", "lodash", "package.json"]
  let pathParts = filePath.split('/').filter((p) => p.length);
  const nmIndex = pathParts.lastIndexOf('node_modules');
  if (nmIndex > -1 && nmIndex < pathParts.length - 1) {
    pathParts = pathParts.slice(nmIndex + 1);
  }
  let moduleId = pathParts.shift();
  if (moduleId.startsWith('@')) {
    moduleId += '/' + pathParts.shift();
  }
  const path = pathParts.join('/');
  if (moduleId === '@stencil/core') {
    const compilerExe = sys.getCompilerExecutingPath();
    return getStencilModuleUrl(compilerExe, path);
  }
  return sys.getRemoteModuleUrl({
    moduleId,
    version: pkgVersions.get(moduleId),
    path,
  });
};
const skipFilePathFetch = (filePath) => {
  if (isTsFile(filePath) || isTsxFile(filePath)) {
    // don't bother trying to resolve  node_module packages w/ typescript files
    // they should already be .js files
    return true;
  }
  const pathParts = filePath.split('/');
  const secondToLast = pathParts[pathParts.length - 2];
  const lastPart = pathParts[pathParts.length - 1];
  if (secondToLast === 'node_modules' && isCommonDirModuleFile(lastPart)) {
    // /node_modules/index.js
    // /node_modules/lodash.js
    // we just already know this is bogus, so don't bother
    return true;
  }
  return false;
};
const skipUrlFetch = (url) =>
// files we just already know not to try to resolve request
knownUrlSkips.some((knownSkip) => url.endsWith(knownSkip));
const knownUrlSkips = [
  '/@stencil/core/internal.js',
  '/@stencil/core/internal.json',
  '/@stencil/core/internal.mjs',
  '/@stencil/core/internal/stencil-core.js/index.json',
  '/@stencil/core/internal/stencil-core.js.json',
  '/@stencil/core/internal/stencil-core.js/package.json',
  '/@stencil/core.js',
  '/@stencil/core.json',
  '/@stencil/core.mjs',
  '/@stencil/core.css',
  '/@stencil/core/index.js',
  '/@stencil/core/index.json',
  '/@stencil/core/index.mjs',
  '/@stencil/core/index.css',
  '/@stencil/package.json',
];

const writeFetchSuccessSync = (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
  if (url.endsWith('package.json')) {
    setPackageVersionByContent(pkgVersions, content);
  }
  let dir = dirname(filePath);
  while (dir !== '/' && dir !== '') {
    if (inMemoryFs) {
      inMemoryFs.clearFileCache(dir);
      inMemoryFs.sys.createDirSync(dir);
    }
    else {
      sys.createDirSync(dir);
    }
    dir = dirname(dir);
  }
  if (inMemoryFs) {
    inMemoryFs.clearFileCache(filePath);
    inMemoryFs.sys.writeFileSync(filePath, content);
  }
  else {
    sys.writeFileSync(filePath, content);
  }
};
const writeFetchSuccessAsync = async (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
  if (url.endsWith('package.json')) {
    setPackageVersionByContent(pkgVersions, content);
  }
  let dir = dirname(filePath);
  while (dir !== '/' && dir !== '') {
    if (inMemoryFs) {
      inMemoryFs.clearFileCache(dir);
      await inMemoryFs.sys.createDir(dir);
    }
    else {
      await sys.createDir(dir);
    }
    dir = dirname(dir);
  }
  if (inMemoryFs) {
    inMemoryFs.clearFileCache(filePath);
    await inMemoryFs.sys.writeFile(filePath, content);
  }
  else {
    await sys.writeFile(filePath, content);
  }
};

const fetchModuleAsync = async (sys, inMemoryFs, pkgVersions, url, filePath) => {
  if (skipFilePathFetch(filePath) || known404Urls.has(url) || skipUrlFetch(url)) {
    return undefined;
  }
  try {
    const rsp = await httpFetch(sys, url);
    if (rsp) {
      if (rsp.ok) {
        const content = await rsp.clone().text();
        await writeFetchSuccessAsync(sys, inMemoryFs, url, filePath, content, pkgVersions);
        return content;
      }
      if (rsp.status === 404) {
        known404Urls.add(url);
      }
    }
  }
  catch (e) {
    console.error(e);
  }
  return undefined;
};

const resolveModuleIdAsync = (sys, inMemoryFs, opts) => {
  const resolverOpts = createCustomResolverAsync(sys, inMemoryFs, opts.exts);
  resolverOpts.basedir = dirname(normalizeFsPath(opts.containingFile));
  if (opts.packageFilter) {
    resolverOpts.packageFilter = opts.packageFilter;
  }
  else if (opts.packageFilter !== null) {
    resolverOpts.packageFilter = (pkg) => {
      if (!isString$1(pkg.main) || pkg.main === '') {
        pkg.main = 'package.json';
      }
      return pkg;
    };
  }
  return new Promise((resolvePromise, rejectPromise) => {
    resolve$2(opts.moduleId, resolverOpts, (err, resolveId, pkgData) => {
      if (err) {
        rejectPromise(err);
      }
      else {
        resolveId = normalizePath$2(resolveId);
        const results = {
          moduleId: opts.moduleId,
          resolveId,
          pkgData,
          pkgDirPath: getPackageDirPath(resolveId, opts.moduleId),
        };
        resolvePromise(results);
      }
    });
  });
};
const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
  return {
    async isFile(filePath, cb) {
      const fsFilePath = normalizeFsPath(filePath);
      const stat = await inMemoryFs.stat(fsFilePath);
      if (stat.isFile) {
        cb(null, true);
        return;
      }
      if (shouldFetchModule(fsFilePath)) {
        const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
        if (endsWithExt) {
          const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
          const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, fsFilePath);
          const checkFileExists = typeof content === 'string';
          cb(null, checkFileExists);
          return;
        }
      }
      cb(null, false);
    },
    async isDirectory(dirPath, cb) {
      const fsDirPath = normalizeFsPath(dirPath);
      const stat = await inMemoryFs.stat(fsDirPath);
      if (stat.isDirectory) {
        cb(null, true);
        return;
      }
      if (shouldFetchModule(fsDirPath)) {
        if (basename(fsDirPath) === 'node_modules') {
          // just the /node_modules directory
          inMemoryFs.sys.createDirSync(fsDirPath);
          inMemoryFs.clearFileCache(fsDirPath);
          cb(null, true);
          return;
        }
        if (isCommonDirModuleFile(fsDirPath)) {
          // don't bother seeing if it's a directory if it has a common file extension
          cb(null, false);
          return;
        }
        for (const fileName of COMMON_DIR_FILENAMES) {
          const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
          const filePath = getCommonDirName(fsDirPath, fileName);
          const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, filePath);
          if (isString$1(content)) {
            cb(null, true);
            return;
          }
        }
      }
      cb(null, false);
    },
    async readFile(p, cb) {
      const fsFilePath = normalizeFsPath(p);
      const data = await inMemoryFs.readFile(fsFilePath);
      if (isString$1(data)) {
        return cb(null, data);
      }
      return cb(`readFile not found: ${p}`);
    },
    async realpath(p, cb) {
      const fsFilePath = normalizeFsPath(p);
      const results = await sys.realpath(fsFilePath);
      if (results.error && results.error.code !== 'ENOENT') {
        cb(results.error);
      }
      else {
        cb(null, results.error ? fsFilePath : results.path);
      }
    },
    extensions: exts,
  };
};

const createWebWorkerMainController = (sys, maxConcurrentWorkers) => {
  let msgIds = 0;
  let isDestroyed = false;
  let isQueued = false;
  let workerIds = 0;
  let workerBlob;
  const tasks = new Map();
  const queuedSendMsgs = [];
  const workers = [];
  const maxWorkers = Math.max(Math.min(maxConcurrentWorkers, sys.hardwareConcurrency), 2) - 1;
  const tick = Promise.resolve();
  const onMsgsFromWorker = (worker, ev) => {
    if (!isDestroyed) {
      const msgsFromWorker = ev.data;
      if (Array.isArray(msgsFromWorker)) {
        for (const msgFromWorker of msgsFromWorker) {
          if (msgFromWorker) {
            const task = tasks.get(msgFromWorker.stencilId);
            if (task) {
              tasks.delete(msgFromWorker.stencilId);
              if (msgFromWorker.stencilRtnError) {
                task.reject(msgFromWorker.stencilRtnError);
              }
              else {
                task.resolve(msgFromWorker.stencilRtnValue);
              }
              worker.activeTasks--;
              if (worker.activeTasks < 0 || worker.activeTasks > 50) {
                worker.activeTasks = 0;
              }
            }
            else if (msgFromWorker.stencilRtnError) {
              console.error(msgFromWorker.stencilRtnError);
            }
          }
        }
      }
    }
  };
  const onWorkerError = (e) => console.error(e);
  const createWorkerMain = () => {
    let worker = null;
    const workerUrl = sys.getCompilerExecutingPath();
    const workerOpts = {
      name: `stencil.worker.${workerIds++}`,
    };
    try {
      // first try directly starting the worker with the URL
      worker = new Worker(workerUrl, workerOpts);
    }
    catch (e) {
      // probably a cross-origin issue, try using a Blob instead
      if (workerBlob == null) {
        workerBlob = new Blob([`importScripts('${workerUrl}');`], { type: 'application/javascript' });
      }
      worker = new Worker(URL.createObjectURL(workerBlob), workerOpts);
    }
    const workerChild = {
      worker,
      activeTasks: 0,
      sendQueue: [],
    };
    worker.onerror = onWorkerError;
    worker.onmessage = (ev) => onMsgsFromWorker(workerChild, ev);
    return workerChild;
  };
  const sendMsgsToWorkers = (w) => {
    if (w.sendQueue.length > 0) {
      w.worker.postMessage(w.sendQueue);
      w.sendQueue.length = 0;
    }
  };
  const queueMsgToWorker = (msg) => {
    let theChosenOne;
    if (workers.length > 0) {
      theChosenOne = workers[0];
      if (maxWorkers > 1) {
        for (const worker of workers) {
          if (worker.activeTasks < theChosenOne.activeTasks) {
            theChosenOne = worker;
          }
        }
        if (theChosenOne.activeTasks > 0 && workers.length < maxWorkers) {
          theChosenOne = createWorkerMain();
          workers.push(theChosenOne);
        }
      }
    }
    else {
      theChosenOne = createWorkerMain();
      workers.push(theChosenOne);
    }
    theChosenOne.activeTasks++;
    theChosenOne.sendQueue.push(msg);
  };
  const flushSendQueue = () => {
    isQueued = false;
    queuedSendMsgs.forEach(queueMsgToWorker);
    queuedSendMsgs.length = 0;
    workers.forEach(sendMsgsToWorkers);
  };
  const send = (...args) => new Promise((resolve, reject) => {
    if (isDestroyed) {
      reject(TASK_CANCELED_MSG);
    }
    else {
      const msg = {
        stencilId: msgIds++,
        args,
      };
      queuedSendMsgs.push(msg);
      tasks.set(msg.stencilId, {
        resolve,
        reject,
      });
      if (!isQueued) {
        isQueued = true;
        tick.then(flushSendQueue);
      }
    }
  });
  const destroy = () => {
    isDestroyed = true;
    tasks.forEach((t) => t.reject(TASK_CANCELED_MSG));
    tasks.clear();
    workers.forEach((w) => w.worker.terminate());
    workers.length = 0;
  };
  const handler = (name) => {
    return function (...args) {
      return send(name, ...args);
    };
  };
  return {
    send,
    destroy,
    handler,
    maxWorkers,
  };
};

/**
 * Create an in-memory `CompilerSystem` object, optionally using a supplied
 * logger instance
 *
 * This particular system being an 'in-memory' `CompilerSystem` is intended for
 * use in the browser. In most cases, for instance when using Stencil through
 * the CLI, a Node.js-specific `CompilerSystem` will be used instead. See
 * {@link CompilerSystem} for more details.
 *
 * @param c an object wrapping a logger instance
 * @returns a complete CompilerSystem, ready for use!
 */
const createSystem = (c) => {
  var _a;
  const logger = (_a = c === null || c === void 0 ? void 0 : c.logger) !== null && _a !== void 0 ? _a : createLogger();
  const items = new Map();
  const destroys = new Set();
  const addDestory = (cb) => destroys.add(cb);
  const removeDestory = (cb) => destroys.delete(cb);
  const events = buildEvents();
  const hardwareConcurrency = (IS_BROWSER_ENV && navigator.hardwareConcurrency) || 1;
  const destroy = async () => {
    const waits = [];
    destroys.forEach((cb) => {
      try {
        const rtn = cb();
        if (rtn && rtn.then) {
          waits.push(rtn);
        }
      }
      catch (e) {
        logger.error(`stencil sys destroy: ${e}`);
      }
    });
    await Promise.all(waits);
    destroys.clear();
  };
  const normalize = (p) => {
    if (p === '/' || p === '') {
      return '/';
    }
    const dir = dirname(p);
    const base = basename(p);
    if (dir.endsWith('/')) {
      return normalizePath$2(`${dir}${base}`);
    }
    return normalizePath$2(`${dir}/${base}`);
  };
  const accessSync = (p) => {
    const item = items.get(normalize(p));
    return !!(item && (item.isDirectory || (item.isFile && typeof item.data === 'string')));
  };
  const access = async (p) => accessSync(p);
  const copyFile = async (src, dest) => {
    writeFileSync(dest, readFileSync(src));
    return true;
  };
  const isTTY = () => {
    var _a;
    return !!((_a = process$3 === null || process$3 === void 0 ? void 0 : process_1.stdout) === null || _a === void 0 ? void 0 : _a.isTTY);
  };
  const homeDir = () => {
    return undefined();
  };
  const createDirSync = (p, opts) => {
    p = normalize(p);
    const results = {
      basename: basename(p),
      dirname: dirname(p),
      path: p,
      newDirs: [],
      error: null,
    };
    createDirRecursiveSync(p, opts, results);
    return results;
  };
  const createDirRecursiveSync = (p, opts, results) => {
    const parentDir = dirname(p);
    if (opts && opts.recursive && !isRootPath(parentDir)) {
      createDirRecursiveSync(parentDir, opts, results);
    }
    const item = items.get(p);
    if (!item) {
      items.set(p, {
        basename: basename(p),
        dirname: parentDir,
        isDirectory: true,
        isFile: false,
        watcherCallbacks: null,
        data: undefined,
      });
      results.newDirs.push(p);
      emitDirectoryWatch(p, new Set());
    }
    else {
      item.isDirectory = true;
      item.isFile = false;
    }
  };
  const createDir = async (p, opts) => createDirSync(p, opts);
  const encodeToBase64 = (str) => btoa(unescape(encodeURIComponent(str)));
  const getCurrentDirectory = () => '/';
  const getCompilerExecutingPath = () => {
    if (IS_WEB_WORKER_ENV) {
      return location.href;
    }
    return sys.getRemoteModuleUrl({ moduleId: '@stencil/core', path: 'compiler/stencil.min.js' });
  };
  const isSymbolicLink = async (_p) => false;
  const readDirSync = (p) => {
    p = normalize(p);
    const dirItems = [];
    const dir = items.get(p);
    if (dir && dir.isDirectory) {
      items.forEach((item, itemPath) => {
        if (itemPath !== '/' && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
          if (p.endsWith('/') && `${p}${item.basename}` === itemPath) {
            dirItems.push(itemPath);
          }
          else if (`${p}/${item.basename}` === itemPath) {
            dirItems.push(itemPath);
          }
        }
      });
    }
    return dirItems.sort();
  };
  const readDir = async (p) => readDirSync(p);
  const readFileSync = (p) => {
    p = normalize(p);
    const item = items.get(p);
    if (item && item.isFile) {
      return item.data;
    }
    return undefined;
  };
  const readFile = async (p) => readFileSync(p);
  const realpathSync = (p) => {
    const results = {
      path: normalize(p),
      error: null,
    };
    return results;
  };
  const realpath = async (p) => realpathSync(p);
  const rename = async (oldPath, newPath) => {
    oldPath = normalizePath$2(oldPath);
    newPath = normalizePath$2(newPath);
    const results = {
      oldPath,
      newPath,
      renamed: [],
      oldDirs: [],
      oldFiles: [],
      newDirs: [],
      newFiles: [],
      isFile: false,
      isDirectory: false,
      error: null,
    };
    const stats = statSync(oldPath);
    if (!stats.error) {
      if (stats.isFile) {
        results.isFile = true;
      }
      else if (stats.isDirectory) {
        results.isDirectory = true;
      }
      renameNewRecursiveSync(oldPath, newPath, results);
      if (!results.error) {
        if (results.isDirectory) {
          const rmdirResults = removeDirSync(oldPath, { recursive: true });
          if (rmdirResults.error) {
            results.error = rmdirResults.error;
          }
          else {
            results.oldDirs.push(...rmdirResults.removedDirs);
            results.oldFiles.push(...rmdirResults.removedFiles);
          }
        }
        else if (results.isFile) {
          const removeFileResults = removeFileSync(oldPath);
          if (removeFileResults.error) {
            results.error = removeFileResults.error;
          }
          else {
            results.oldFiles.push(oldPath);
          }
        }
      }
    }
    else {
      results.error = `${oldPath} does not exist`;
    }
    return results;
  };
  const renameNewRecursiveSync = (oldPath, newPath, results) => {
    const itemStat = statSync(oldPath);
    if (!itemStat.error && !results.error) {
      if (itemStat.isFile) {
        const newFileParentDir = dirname(newPath);
        const createDirResults = createDirSync(newFileParentDir, { recursive: true });
        const fileContent = items.get(oldPath).data;
        const writeResults = writeFileSync(newPath, fileContent);
        results.newDirs.push(...createDirResults.newDirs);
        results.renamed.push({
          oldPath,
          newPath,
          isDirectory: false,
          isFile: true,
        });
        if (writeResults.error) {
          results.error = writeResults.error;
        }
        else {
          results.newFiles.push(newPath);
        }
      }
      else if (itemStat.isDirectory) {
        const oldDirItemChildPaths = readDirSync(oldPath);
        const createDirResults = createDirSync(newPath, { recursive: true });
        results.newDirs.push(...createDirResults.newDirs);
        results.renamed.push({
          oldPath,
          newPath,
          isDirectory: true,
          isFile: false,
        });
        for (const oldDirItemChildPath of oldDirItemChildPaths) {
          const newDirItemChildPath = oldDirItemChildPath.replace(oldPath, newPath);
          renameNewRecursiveSync(oldDirItemChildPath, newDirItemChildPath, results);
        }
      }
    }
  };
  const resolvePath = (p) => normalize(p);
  const removeDirSync = (p, opts = {}) => {
    const results = {
      basename: basename(p),
      dirname: dirname(p),
      path: p,
      removedDirs: [],
      removedFiles: [],
      error: null,
    };
    remoreDirSyncRecursive(p, opts, results);
    return results;
  };
  const remoreDirSyncRecursive = (p, opts, results) => {
    if (!results.error) {
      p = normalize(p);
      const dirItemPaths = readDirSync(p);
      if (opts && opts.recursive) {
        for (const dirItemPath of dirItemPaths) {
          const item = items.get(dirItemPath);
          if (item) {
            if (item.isDirectory) {
              remoreDirSyncRecursive(dirItemPath, opts, results);
            }
            else if (item.isFile) {
              const removeFileResults = removeFileSync(dirItemPath);
              if (removeFileResults.error) {
                results.error = removeFileResults.error;
              }
              else {
                results.removedFiles.push(dirItemPath);
              }
            }
          }
        }
      }
      else {
        if (dirItemPaths.length > 0) {
          results.error = `cannot delete directory that contains files/subdirectories`;
          return;
        }
      }
      items.delete(p);
      emitDirectoryWatch(p, new Set());
      results.removedDirs.push(p);
    }
  };
  const removeDir = async (p, opts = {}) => removeDirSync(p, opts);
  const statSync = (p) => {
    p = normalize(p);
    const item = items.get(p);
    if (item && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
      return {
        isDirectory: item.isDirectory,
        isFile: item.isFile,
        isSymbolicLink: false,
        size: item.isFile && item.data ? item.data.length : 0,
        error: null,
      };
    }
    return {
      isDirectory: false,
      isFile: false,
      isSymbolicLink: false,
      size: 0,
      error: `ENOENT: no such file or directory, statSync '${p}'`,
    };
  };
  const stat = async (p) => statSync(p);
  const removeFileSync = (p) => {
    p = normalize(p);
    const results = {
      basename: basename(p),
      dirname: dirname(p),
      path: p,
      error: null,
    };
    const item = items.get(p);
    if (item) {
      if (item.watcherCallbacks) {
        for (const watcherCallback of item.watcherCallbacks) {
          watcherCallback(p, 'fileDelete');
        }
      }
      items.delete(p);
      emitDirectoryWatch(p, new Set());
    }
    return results;
  };
  const removeFile = async (p) => removeFileSync(p);
  const watchDirectory = (p, dirWatcherCallback) => {
    p = normalize(p);
    const item = items.get(p);
    const close = () => {
      const closeItem = items.get(p);
      if (closeItem && closeItem.watcherCallbacks) {
        const index = closeItem.watcherCallbacks.indexOf(dirWatcherCallback);
        if (index > -1) {
          closeItem.watcherCallbacks.splice(index, 1);
        }
      }
    };
    addDestory(close);
    if (item) {
      item.isDirectory = true;
      item.isFile = false;
      item.watcherCallbacks = item.watcherCallbacks || [];
      item.watcherCallbacks.push(dirWatcherCallback);
    }
    else {
      items.set(p, {
        basename: basename(p),
        dirname: dirname(p),
        isDirectory: true,
        isFile: false,
        watcherCallbacks: [dirWatcherCallback],
        data: undefined,
      });
    }
    return {
      close() {
        removeDestory(close);
        close();
      },
    };
  };
  const watchFile = (p, fileWatcherCallback) => {
    p = normalize(p);
    const item = items.get(p);
    const close = () => {
      const closeItem = items.get(p);
      if (closeItem && closeItem.watcherCallbacks) {
        const index = closeItem.watcherCallbacks.indexOf(fileWatcherCallback);
        if (index > -1) {
          closeItem.watcherCallbacks.splice(index, 1);
        }
      }
    };
    addDestory(close);
    if (item) {
      item.isDirectory = false;
      item.isFile = true;
      item.watcherCallbacks = item.watcherCallbacks || [];
      item.watcherCallbacks.push(fileWatcherCallback);
    }
    else {
      items.set(p, {
        basename: basename(p),
        dirname: dirname(p),
        isDirectory: false,
        isFile: true,
        watcherCallbacks: [fileWatcherCallback],
        data: undefined,
      });
    }
    return {
      close() {
        removeDestory(close);
        close();
      },
    };
  };
  const emitDirectoryWatch = (p, emitted) => {
    const parentDir = normalize(dirname(p));
    const dirItem = items.get(parentDir);
    if (dirItem && dirItem.isDirectory && dirItem.watcherCallbacks) {
      for (const watcherCallback of dirItem.watcherCallbacks) {
        watcherCallback(p, null);
      }
    }
    if (!emitted.has(parentDir)) {
      emitted.add(parentDir);
      emitDirectoryWatch(parentDir, emitted);
    }
  };
  const writeFileSync = (p, data) => {
    p = normalize(p);
    const results = {
      path: p,
      error: null,
    };
    const item = items.get(p);
    if (item) {
      const hasChanged = item.data !== data;
      item.data = data;
      if (hasChanged && item.watcherCallbacks) {
        for (const watcherCallback of item.watcherCallbacks) {
          watcherCallback(p, 'fileUpdate');
        }
      }
    }
    else {
      items.set(p, {
        basename: basename(p),
        dirname: dirname(p),
        isDirectory: false,
        isFile: true,
        watcherCallbacks: null,
        data,
      });
      emitDirectoryWatch(p, new Set());
    }
    return results;
  };
  /**
   * `self` is the global namespace object used within a web worker.
   * `window` is the browser's global namespace object (I reorganized this to check the reference on that second)
   * `global` is Node's global namespace object. https://nodejs.org/api/globals.html#globals_global
   *
   * loading in this order should allow workers, which are most common, then browser,
   * then Node to grab the reference to fetch correctly.
   */
  const fetch = typeof self !== 'undefined'
    ? self === null || self === void 0 ? void 0 : self.fetch
    : typeof window !== 'undefined'
      ? window === null || window === void 0 ? void 0 : window.fetch
      : typeof global !== 'undefined'
        ? global === null || global === void 0 ? void 0 : global.fetch
        : undefined;
  const writeFile = async (p, data) => writeFileSync(p, data);
  const tmpDirSync = () => '/.tmp';
  const tick = Promise.resolve();
  const nextTick = (cb) => tick.then(cb);
  const generateContentHash = async (content, hashLength) => {
    const arrayBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(content));
    const hashArray = Array.from(new Uint8Array(arrayBuffer)); // convert buffer to byte array
    let hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); // convert bytes to hex string
    if (typeof hashLength === 'number') {
      hashHex = hashHex.slice(0, hashLength);
    }
    return hashHex;
  };
  const copy = async (copyTasks, srcDir) => {
    const results = {
      diagnostics: [],
      dirPaths: [],
      filePaths: [],
    };
    logger.info('todo, copy task', copyTasks.length, srcDir);
    return results;
  };
  const getEnvironmentVar = (key) => {
    return process$3 === null || process$3 === void 0 ? void 0 : process_1.env[key];
  };
  const getLocalModulePath = (opts) => join(opts.rootDir, 'node_modules', opts.moduleId, opts.path);
  const getRemoteModuleUrl = (opts) => {
    const npmBaseUrl = 'https://cdn.jsdelivr.net/npm/';
    const path = `${opts.moduleId}${opts.version ? '@' + opts.version : ''}/${opts.path}`;
    return new URL(path, npmBaseUrl).href;
  };
  const fileWatchTimeout = 32;
  createDirSync('/');
  const sys = {
    name: 'in-memory',
    version: version$3,
    events,
    access,
    accessSync,
    addDestory,
    copyFile,
    createDir,
    createDirSync,
    homeDir,
    isTTY,
    getEnvironmentVar,
    destroy,
    encodeToBase64,
    exit: async (exitCode) => logger.warn(`exit ${exitCode}`),
    getCurrentDirectory,
    getCompilerExecutingPath,
    getLocalModulePath,
    getRemoteModuleUrl,
    hardwareConcurrency,
    isSymbolicLink,
    nextTick,
    normalizePath: normalize,
    platformPath: pathBrowserify,
    readDir,
    readDirSync,
    readFile,
    readFileSync,
    realpath,
    realpathSync,
    removeDestory,
    rename,
    fetch,
    resolvePath,
    removeDir,
    removeDirSync,
    stat,
    statSync,
    tmpDirSync,
    removeFile,
    removeFileSync,
    watchDirectory,
    watchFile,
    watchTimeout: fileWatchTimeout,
    writeFile,
    writeFileSync,
    generateContentHash,
    createWorkerController: HAS_WEB_WORKER
      ? (maxConcurrentWorkers) => createWebWorkerMainController(sys, maxConcurrentWorkers)
      : null,
    details: {
      cpuModel: '',
      freemem: () => 0,
      platform: '',
      release: '',
      totalmem: 0,
    },
    copy,
  };
  sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, null, opts);
  return sys;
};

const initWebWorkerThread = (msgHandler) => {
  let isQueued = false;
  const tick = Promise.resolve();
  const msgsFromWorkerQueue = [];
  const drainMsgQueueFromWorkerToMain = () => {
    isQueued = false;
    self.postMessage(msgsFromWorkerQueue);
    msgsFromWorkerQueue.length = 0;
  };
  const queueMsgFromWorkerToMain = (msgFromWorkerToMain) => {
    msgsFromWorkerQueue.push(msgFromWorkerToMain);
    if (!isQueued) {
      isQueued = true;
      tick.then(drainMsgQueueFromWorkerToMain);
    }
  };
  const error = (stencilMsgId, err) => {
    const errMsgFromWorkerToMain = {
      stencilId: stencilMsgId,
      stencilRtnValue: null,
      stencilRtnError: 'Error',
    };
    if (isString$1(err)) {
      errMsgFromWorkerToMain.stencilRtnError += ': ' + err;
    }
    else if (err) {
      if (err.stack) {
        errMsgFromWorkerToMain.stencilRtnError += ': ' + err.stack;
      }
      else if (err.message) {
        errMsgFromWorkerToMain.stencilRtnError += ': ' + err.message;
      }
    }
    queueMsgFromWorkerToMain(errMsgFromWorkerToMain);
  };
  const receiveMsgFromMainToWorker = async (msgToWorker) => {
    if (msgToWorker && isNumber$1(msgToWorker.stencilId)) {
      try {
        // run the handler to get the data
        const msgFromWorkerToMain = {
          stencilId: msgToWorker.stencilId,
          stencilRtnValue: await msgHandler(msgToWorker),
          stencilRtnError: null,
        };
        queueMsgFromWorkerToMain(msgFromWorkerToMain);
      }
      catch (e) {
        // error occurred while running the task
        error(msgToWorker.stencilId, e);
      }
    }
  };
  self.onmessage = (ev) => {
    // message from the main thread
    const msgsFromMainToWorker = ev.data;
    if (Array.isArray(msgsFromMainToWorker)) {
      for (const msgFromMainToWorker of msgsFromMainToWorker) {
        receiveMsgFromMainToWorker(msgFromMainToWorker);
      }
    }
  };
  self.onerror = (e) => {
    // uncaught error occurred on the worker thread
    error(-1, e);
  };
};

let cssProcessor;
/**
 * Autoprefix a CSS string, adding vendor prefixes to make sure that what
 * is written in the CSS will render correctly in our range of supported browsers.
 * This function uses PostCSS in compbination with the Autoprefix plugin to
 * automatically add vendor prefixes based on a list of browsers which we want
 * to support.
 *
 * @param cssText the text to be prefixed
 * @param opts an optional param with options for Autoprefixer
 * @returns a Promise wrapping some prefixed CSS as well as diagnostics
 */
const autoprefixCss = async (cssText, opts) => {
  const output = {
    output: cssText,
    diagnostics: [],
  };
  if (!IS_NODE_ENV) {
    return output;
  }
  try {
    const autoprefixerOpts = opts != null && typeof opts === 'object' ? opts : DEFAULT_AUTOPREFIX_OPTIONS;
    const processor = getProcessor(autoprefixerOpts);
    const result = await processor.process(cssText, { map: null });
    result.warnings().forEach((warning) => {
      output.diagnostics.push({
        header: `Autoprefix CSS: ${warning.plugin}`,
        messageText: warning.text,
        level: 'warn',
        type: 'css',
      });
    });
    output.output = result.css;
  }
  catch (e) {
    const diagnostic = {
      header: `Autoprefix CSS`,
      messageText: `CSS Error` + e,
      level: `error`,
      type: `css`,
    };
    if (typeof e.name === 'string') {
      diagnostic.header = e.name;
    }
    if (typeof e.reason === 'string') {
      diagnostic.messageText = e.reason;
    }
    if (typeof e.source === 'string' && typeof e.line === 'number') {
      const lines = e.source.replace(/\r/g, '\n').split('\n');
      if (lines.length > 0) {
        const addLine = (lineNumber) => {
          const line = lines[lineNumber];
          if (typeof line === 'string') {
            const printLine = {
              lineIndex: -1,
              lineNumber: -1,
              text: line,
              errorCharStart: -1,
              errorLength: -1,
            };
            diagnostic.lines = diagnostic.lines || [];
            diagnostic.lines.push(printLine);
          }
        };
        addLine(e.line - 3);
        addLine(e.line - 2);
        addLine(e.line - 1);
        addLine(e.line);
        addLine(e.line + 1);
        addLine(e.line + 2);
        addLine(e.line + 3);
      }
    }
    output.diagnostics.push(diagnostic);
  }
  return output;
};
/**
 * Get the processor for PostCSS and the Autoprefixer plugin
 *
 * @param autoprefixerOpts Options for Autoprefixer
 * @returns postCSS with the Autoprefixer plugin applied
 */
const getProcessor = (autoprefixerOpts) => {
  const { postcss, autoprefixer } = requireFunc('../sys/node/autoprefixer.js');
  if (!cssProcessor) {
    cssProcessor = postcss([autoprefixer(autoprefixerOpts)]);
  }
  return cssProcessor;
};
/**
 * Default options for the Autoprefixer PostCSS plugin. See the documentation:
 * https://github.com/postcss/autoprefixer#options for a complete list.
 *
 * This default option set will:
 *
 * - override the default browser list (`overrideBrowserslist`)
 * - turn off the visual cascade (`cascade`)
 * - disable auto-removing outdated prefixes (`remove`)
 * - set `flexbox` to `"no-2009"`, which limits prefixing for flexbox to the
 *   final and IE 10 versions of the specification
 */
const DEFAULT_AUTOPREFIX_OPTIONS = {
  overrideBrowserslist: ['last 2 versions', 'iOS >= 9', 'Android >= 4.4', 'Explorer >= 11', 'ExplorerMobile >= 11'],
  cascade: false,
  remove: false,
  flexbox: 'no-2009',
};

const parseCss = (css, filePath) => {
  let lineno = 1;
  let column = 1;
  const diagnostics = [];
  const updatePosition = (str) => {
    const lines = str.match(/\n/g);
    if (lines)
      lineno += lines.length;
    const i = str.lastIndexOf('\n');
    column = ~i ? str.length - i : column + str.length;
  };
  const position = () => {
    const start = { line: lineno, column: column };
    return (node) => {
      node.position = new ParsePosition(start);
      whitespace();
      return node;
    };
  };
  const error = (msg) => {
    const srcLines = css.split('\n');
    const d = {
      level: 'error',
      type: 'css',
      language: 'css',
      header: 'CSS Parse',
      messageText: msg,
      absFilePath: filePath,
      lines: [
        {
          lineIndex: lineno - 1,
          lineNumber: lineno,
          errorCharStart: column,
          text: css[lineno - 1],
        },
      ],
    };
    if (lineno > 1) {
      const previousLine = {
        lineIndex: lineno - 1,
        lineNumber: lineno - 1,
        text: css[lineno - 2],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.unshift(previousLine);
    }
    if (lineno + 2 < srcLines.length) {
      const nextLine = {
        lineIndex: lineno,
        lineNumber: lineno + 1,
        text: srcLines[lineno],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.push(nextLine);
    }
    diagnostics.push(d);
    return null;
  };
  const stylesheet = () => {
    const rulesList = rules();
    return {
      type: 14 /* CssNodeType.StyleSheet */,
      stylesheet: {
        source: filePath,
        rules: rulesList,
      },
    };
  };
  const open = () => match(/^{\s*/);
  const close = () => match(/^}/);
  const match = (re) => {
    const m = re.exec(css);
    if (!m)
      return;
    const str = m[0];
    updatePosition(str);
    css = css.slice(str.length);
    return m;
  };
  const rules = () => {
    let node;
    const rules = [];
    whitespace();
    comments(rules);
    while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
      rules.push(node);
      comments(rules);
    }
    return rules;
  };
  /**
   * Parse whitespace.
   */
  const whitespace = () => match(/^\s*/);
  const comments = (rules) => {
    let c;
    rules = rules || [];
    while ((c = comment())) {
      rules.push(c);
    }
    return rules;
  };
  const comment = () => {
    const pos = position();
    if ('/' !== css.charAt(0) || '*' !== css.charAt(1))
      return null;
    let i = 2;
    while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1)))
      ++i;
    i += 2;
    if ('' === css.charAt(i - 1)) {
      return error('End of comment missing');
    }
    const comment = css.slice(2, i - 2);
    column += 2;
    updatePosition(comment);
    css = css.slice(i);
    column += 2;
    return pos({
      type: 1 /* CssNodeType.Comment */,
      comment,
    });
  };
  const selector = () => {
    const m = match(/^([^{]+)/);
    if (!m)
      return null;
    return trim$1(m[0])
      .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
      .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
      return m.replace(/,/g, '\u200C');
    })
      .split(/\s*(?![^(]*\)),\s*/)
      .map(function (s) {
      return s.replace(/\u200C/g, ',');
    });
  };
  const declaration = () => {
    const pos = position();
    // prop
    let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
    if (!prop)
      return null;
    prop = trim$1(prop[0]);
    // :
    if (!match(/^:\s*/))
      return error(`property missing ':'`);
    // val
    const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
    const ret = pos({
      type: 4 /* CssNodeType.Declaration */,
      property: prop.replace(commentre, ''),
      value: val ? trim$1(val[0]).replace(commentre, '') : '',
    });
    match(/^[;\s]*/);
    return ret;
  };
  const declarations = () => {
    const decls = [];
    if (!open())
      return error(`missing '{'`);
    comments(decls);
    // declarations
    let decl;
    while ((decl = declaration())) {
      decls.push(decl);
      comments(decls);
    }
    if (!close())
      return error(`missing '}'`);
    return decls;
  };
  const keyframe = () => {
    let m;
    const values = [];
    const pos = position();
    while ((m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/))) {
      values.push(m[1]);
      match(/^,\s*/);
    }
    if (!values.length)
      return null;
    return pos({
      type: 9 /* CssNodeType.KeyFrame */,
      values,
      declarations: declarations(),
    });
  };
  const atkeyframes = () => {
    const pos = position();
    let m = match(/^@([-\w]+)?keyframes\s*/);
    if (!m)
      return null;
    const vendor = m[1];
    // identifier
    m = match(/^([-\w]+)\s*/);
    if (!m)
      return error(`@keyframes missing name`);
    const name = m[1];
    if (!open())
      return error(`@keyframes missing '{'`);
    let frame;
    let frames = comments();
    while ((frame = keyframe())) {
      frames.push(frame);
      frames = frames.concat(comments());
    }
    if (!close())
      return error(`@keyframes missing '}'`);
    return pos({
      type: 8 /* CssNodeType.KeyFrames */,
      name: name,
      vendor: vendor,
      keyframes: frames,
    });
  };
  const atsupports = () => {
    const pos = position();
    const m = match(/^@supports *([^{]+)/);
    if (!m)
      return null;
    const supports = trim$1(m[1]);
    if (!open())
      return error(`@supports missing '{'`);
    const style = comments().concat(rules());
    if (!close())
      return error(`@supports missing '}'`);
    return pos({
      type: 15 /* CssNodeType.Supports */,
      supports: supports,
      rules: style,
    });
  };
  const athost = () => {
    const pos = position();
    const m = match(/^@host\s*/);
    if (!m)
      return null;
    if (!open())
      return error(`@host missing '{'`);
    const style = comments().concat(rules());
    if (!close())
      return error(`@host missing '}'`);
    return pos({
      type: 6 /* CssNodeType.Host */,
      rules: style,
    });
  };
  const atmedia = () => {
    const pos = position();
    const m = match(/^@media *([^{]+)/);
    if (!m)
      return null;
    const media = trim$1(m[1]);
    if (!open())
      return error(`@media missing '{'`);
    const style = comments().concat(rules());
    if (!close())
      return error(`@media missing '}'`);
    return pos({
      type: 10 /* CssNodeType.Media */,
      media: media,
      rules: style,
    });
  };
  const atcustommedia = () => {
    const pos = position();
    const m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
    if (!m)
      return null;
    return pos({
      type: 2 /* CssNodeType.CustomMedia */,
      name: trim$1(m[1]),
      media: trim$1(m[2]),
    });
  };
  const atpage = () => {
    const pos = position();
    const m = match(/^@page */);
    if (!m)
      return null;
    const sel = selector() || [];
    if (!open())
      return error(`@page missing '{'`);
    let decls = comments();
    let decl;
    while ((decl = declaration())) {
      decls.push(decl);
      decls = decls.concat(comments());
    }
    if (!close())
      return error(`@page missing '}'`);
    return pos({
      type: 12 /* CssNodeType.Page */,
      selectors: sel,
      declarations: decls,
    });
  };
  const atdocument = () => {
    const pos = position();
    const m = match(/^@([-\w]+)?document *([^{]+)/);
    if (!m)
      return null;
    const vendor = trim$1(m[1]);
    const doc = trim$1(m[2]);
    if (!open())
      return error(`@document missing '{'`);
    const style = comments().concat(rules());
    if (!close())
      return error(`@document missing '}'`);
    return pos({
      type: 3 /* CssNodeType.Document */,
      document: doc,
      vendor: vendor,
      rules: style,
    });
  };
  const atfontface = () => {
    const pos = position();
    const m = match(/^@font-face\s*/);
    if (!m)
      return null;
    if (!open())
      return error(`@font-face missing '{'`);
    let decls = comments();
    let decl;
    while ((decl = declaration())) {
      decls.push(decl);
      decls = decls.concat(comments());
    }
    if (!close())
      return error(`@font-face missing '}'`);
    return pos({
      type: 5 /* CssNodeType.FontFace */,
      declarations: decls,
    });
  };
  const compileAtrule = (nodeName, nodeType) => {
    const re = new RegExp('^@' + nodeName + '\\s*([^;]+);');
    return () => {
      const pos = position();
      const m = match(re);
      if (!m)
        return null;
      const node = {
        type: nodeType,
      };
      node[nodeName] = m[1].trim();
      return pos(node);
    };
  };
  const atimport = compileAtrule('import', 7 /* CssNodeType.Import */);
  const atcharset = compileAtrule('charset', 0 /* CssNodeType.Charset */);
  const atnamespace = compileAtrule('namespace', 11 /* CssNodeType.Namespace */);
  const atrule = () => {
    if (css[0] !== '@')
      return null;
    return (atkeyframes() ||
      atmedia() ||
      atcustommedia() ||
      atsupports() ||
      atimport() ||
      atcharset() ||
      atnamespace() ||
      atdocument() ||
      atpage() ||
      athost() ||
      atfontface());
  };
  const rule = () => {
    const pos = position();
    const sel = selector();
    if (!sel)
      return error('selector missing');
    comments();
    return pos({
      type: 13 /* CssNodeType.Rule */,
      selectors: sel,
      declarations: declarations(),
    });
  };
  class ParsePosition {
    constructor(start) {
      this.start = start;
      this.end = { line: lineno, column: column };
      this.source = filePath;
    }
  }
  ParsePosition.prototype.content = css;
  return {
    diagnostics,
    ...addParent(stylesheet()),
  };
};
const trim$1 = (str) => (str ? str.trim() : '');
/**
 * Adds non-enumerable parent node reference to each node.
 */
const addParent = (obj, parent) => {
  const isNode = obj && typeof obj.type === 'string';
  const childParent = isNode ? obj : parent;
  for (const k in obj) {
    const value = obj[k];
    if (Array.isArray(value)) {
      value.forEach(function (v) {
        addParent(v, childParent);
      });
    }
    else if (value && typeof value === 'object') {
      addParent(value, childParent);
    }
  }
  if (isNode) {
    Object.defineProperty(obj, 'parent', {
      configurable: true,
      writable: true,
      enumerable: false,
      value: parent || null,
    });
  }
  return obj;
};
// http://www.w3.org/TR/CSS21/grammar.html
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;

const getCssSelectors = (sel) => {
  // reusing global SELECTORS since this is a synchronous operation
  SELECTORS.all.length =
    SELECTORS.tags.length =
      SELECTORS.classNames.length =
        SELECTORS.ids.length =
          SELECTORS.attrs.length =
            0;
  sel = sel
    .replace(/\./g, ' .')
    .replace(/\#/g, ' #')
    .replace(/\[/g, ' [')
    .replace(/\>/g, ' > ')
    .replace(/\+/g, ' + ')
    .replace(/\~/g, ' ~ ')
    .replace(/\*/g, ' * ')
    .replace(/\:not\((.*?)\)/g, ' ');
  const items = sel.split(' ');
  for (let i = 0, l = items.length; i < l; i++) {
    items[i] = items[i].split(':')[0];
    if (items[i].length === 0)
      continue;
    if (items[i].charAt(0) === '.') {
      SELECTORS.classNames.push(items[i].slice(1));
    }
    else if (items[i].charAt(0) === '#') {
      SELECTORS.ids.push(items[i].slice(1));
    }
    else if (items[i].charAt(0) === '[') {
      items[i] = items[i].slice(1).split('=')[0].split(']')[0].trim();
      SELECTORS.attrs.push(items[i].toLowerCase());
    }
    else if (/[a-z]/g.test(items[i].charAt(0))) {
      SELECTORS.tags.push(items[i].toLowerCase());
    }
  }
  SELECTORS.classNames = SELECTORS.classNames.sort((a, b) => {
    if (a.length < b.length)
      return -1;
    if (a.length > b.length)
      return 1;
    return 0;
  });
  return SELECTORS;
};
const SELECTORS = {
  all: [],
  tags: [],
  classNames: [],
  ids: [],
  attrs: [],
};

const serializeCss = (stylesheet, serializeOpts) => {
  const usedSelectors = serializeOpts.usedSelectors || null;
  const opts = {
    usedSelectors: usedSelectors || null,
    hasUsedAttrs: !!usedSelectors && usedSelectors.attrs.size > 0,
    hasUsedClassNames: !!usedSelectors && usedSelectors.classNames.size > 0,
    hasUsedIds: !!usedSelectors && usedSelectors.ids.size > 0,
    hasUsedTags: !!usedSelectors && usedSelectors.tags.size > 0,
  };
  const rules = stylesheet.rules;
  if (!rules) {
    return '';
  }
  const rulesLen = rules.length;
  const out = [];
  for (let i = 0; i < rulesLen; i++) {
    out.push(serializeCssVisitNode(opts, rules[i], i, rulesLen));
  }
  return out.join('');
};
const serializeCssVisitNode = (opts, node, index, len) => {
  const nodeType = node.type;
  if (nodeType === 4 /* CssNodeType.Declaration */) {
    return serializeCssDeclaration(node, index, len);
  }
  if (nodeType === 13 /* CssNodeType.Rule */) {
    return serializeCssRule(opts, node);
  }
  if (nodeType === 1 /* CssNodeType.Comment */) {
    if (node.comment[0] === '!') {
      return `/*${node.comment}*/`;
    }
    else {
      return '';
    }
  }
  if (nodeType === 10 /* CssNodeType.Media */) {
    return serializeCssMedia(opts, node);
  }
  if (nodeType === 8 /* CssNodeType.KeyFrames */) {
    return serializeCssKeyframes(opts, node);
  }
  if (nodeType === 9 /* CssNodeType.KeyFrame */) {
    return serializeCssKeyframe(opts, node);
  }
  if (nodeType === 5 /* CssNodeType.FontFace */) {
    return serializeCssFontFace(opts, node);
  }
  if (nodeType === 15 /* CssNodeType.Supports */) {
    return serializeCssSupports(opts, node);
  }
  if (nodeType === 7 /* CssNodeType.Import */) {
    return '@import ' + node.import + ';';
  }
  if (nodeType === 0 /* CssNodeType.Charset */) {
    return '@charset ' + node.charset + ';';
  }
  if (nodeType === 12 /* CssNodeType.Page */) {
    return serializeCssPage(opts, node);
  }
  if (nodeType === 6 /* CssNodeType.Host */) {
    return '@host{' + serializeCssMapVisit(opts, node.rules) + '}';
  }
  if (nodeType === 2 /* CssNodeType.CustomMedia */) {
    return '@custom-media ' + node.name + ' ' + node.media + ';';
  }
  if (nodeType === 3 /* CssNodeType.Document */) {
    return serializeCssDocument(opts, node);
  }
  if (nodeType === 11 /* CssNodeType.Namespace */) {
    return '@namespace ' + node.namespace + ';';
  }
  return '';
};
const serializeCssRule = (opts, node) => {
  const decls = node.declarations;
  const usedSelectors = opts.usedSelectors;
  const selectors = node.selectors.slice();
  if (decls == null || decls.length === 0) {
    return '';
  }
  if (usedSelectors) {
    let i;
    let j;
    let include = true;
    for (i = selectors.length - 1; i >= 0; i--) {
      const sel = getCssSelectors(selectors[i]);
      include = true;
      // classes
      let jlen = sel.classNames.length;
      if (jlen > 0 && opts.hasUsedClassNames) {
        for (j = 0; j < jlen; j++) {
          if (!usedSelectors.classNames.has(sel.classNames[j])) {
            include = false;
            break;
          }
        }
      }
      // tags
      if (include && opts.hasUsedTags) {
        jlen = sel.tags.length;
        if (jlen > 0) {
          for (j = 0; j < jlen; j++) {
            if (!usedSelectors.tags.has(sel.tags[j])) {
              include = false;
              break;
            }
          }
        }
      }
      // attrs
      if (include && opts.hasUsedAttrs) {
        jlen = sel.attrs.length;
        if (jlen > 0) {
          for (j = 0; j < jlen; j++) {
            if (!usedSelectors.attrs.has(sel.attrs[j])) {
              include = false;
              break;
            }
          }
        }
      }
      // ids
      if (include && opts.hasUsedIds) {
        jlen = sel.ids.length;
        if (jlen > 0) {
          for (j = 0; j < jlen; j++) {
            if (!usedSelectors.ids.has(sel.ids[j])) {
              include = false;
              break;
            }
          }
        }
      }
      if (!include) {
        selectors.splice(i, 1);
      }
    }
  }
  if (selectors.length === 0) {
    return '';
  }
  const cleanedSelectors = [];
  let cleanedSelector = '';
  for (const selector of node.selectors) {
    cleanedSelector = removeSelectorWhitespace(selector);
    if (!cleanedSelectors.includes(cleanedSelector)) {
      cleanedSelectors.push(cleanedSelector);
    }
  }
  return `${cleanedSelectors}{${serializeCssMapVisit(opts, decls)}}`;
};
const serializeCssDeclaration = (node, index, len) => {
  if (node.value === '') {
    return '';
  }
  if (len - 1 === index) {
    return node.property + ':' + node.value;
  }
  return node.property + ':' + node.value + ';';
};
const serializeCssMedia = (opts, node) => {
  const mediaCss = serializeCssMapVisit(opts, node.rules);
  if (mediaCss === '') {
    return '';
  }
  return '@media ' + removeMediaWhitespace(node.media) + '{' + mediaCss + '}';
};
const serializeCssKeyframes = (opts, node) => {
  const keyframesCss = serializeCssMapVisit(opts, node.keyframes);
  if (keyframesCss === '') {
    return '';
  }
  return '@' + (node.vendor || '') + 'keyframes ' + node.name + '{' + keyframesCss + '}';
};
const serializeCssKeyframe = (opts, node) => {
  return node.values.join(',') + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
};
const serializeCssFontFace = (opts, node) => {
  const fontCss = serializeCssMapVisit(opts, node.declarations);
  if (fontCss === '') {
    return '';
  }
  return '@font-face{' + fontCss + '}';
};
const serializeCssSupports = (opts, node) => {
  const supportsCss = serializeCssMapVisit(opts, node.rules);
  if (supportsCss === '') {
    return '';
  }
  return '@supports ' + node.supports + '{' + supportsCss + '}';
};
const serializeCssPage = (opts, node) => {
  const sel = node.selectors.join(', ');
  return '@page ' + sel + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
};
const serializeCssDocument = (opts, node) => {
  const documentCss = serializeCssMapVisit(opts, node.rules);
  const doc = '@' + (node.vendor || '') + 'document ' + node.document;
  if (documentCss === '') {
    return '';
  }
  return doc + '{' + documentCss + '}';
};
const serializeCssMapVisit = (opts, nodes) => {
  let rtn = '';
  if (nodes) {
    for (let i = 0, len = nodes.length; i < len; i++) {
      rtn += serializeCssVisitNode(opts, nodes[i], i, len);
    }
  }
  return rtn;
};
const removeSelectorWhitespace = (selector) => {
  let rtn = '';
  let char = '';
  let inAttr = false;
  selector = selector.trim();
  for (let i = 0, l = selector.length; i < l; i++) {
    char = selector[i];
    if (char === '[' && rtn[rtn.length - 1] !== '\\') {
      inAttr = true;
    }
    else if (char === ']' && rtn[rtn.length - 1] !== '\\') {
      inAttr = false;
    }
    if (!inAttr && CSS_WS_REG.test(char)) {
      if (CSS_NEXT_CHAR_REG.test(selector[i + 1])) {
        continue;
      }
      if (CSS_PREV_CHAR_REG.test(rtn[rtn.length - 1])) {
        continue;
      }
      rtn += ' ';
    }
    else {
      rtn += char;
    }
  }
  return rtn;
};
const removeMediaWhitespace = (media) => {
  let rtn = '';
  let char = '';
  media = media.trim();
  for (let i = 0, l = media.length; i < l; i++) {
    char = media[i];
    if (CSS_WS_REG.test(char)) {
      if (CSS_WS_REG.test(rtn[rtn.length - 1])) {
        continue;
      }
      rtn += ' ';
    }
    else {
      rtn += char;
    }
  }
  return rtn;
};
const CSS_WS_REG = /\s/;
const CSS_NEXT_CHAR_REG = /[>\(\)\~\,\+\s]/;
const CSS_PREV_CHAR_REG = /[>\(\~\,\+]/;

const minifyCss = async (input) => {
  const parseResults = parseCss(input.css);
  if (hasError(parseResults.diagnostics)) {
    return input.css;
  }
  if (isFunction(input.resolveUrl) && parseResults.stylesheet && Array.isArray(parseResults.stylesheet.rules)) {
    await resolveStylesheetUrl(parseResults.stylesheet.rules, input.resolveUrl);
  }
  return serializeCss(parseResults.stylesheet, {});
};
const resolveStylesheetUrl = async (nodes, resolveUrl, resolved) => {
  for (const node of nodes) {
    if (node.type === 4 /* CssNodeType.Declaration */ && isString$1(node.value) && node.value.includes('url(')) {
      const urlSplt = node.value.split(',').map((n) => n.trim());
      for (let i = 0; i < urlSplt.length; i++) {
        const r = /url\((.*?)\)/.exec(urlSplt[i]);
        if (r) {
          try {
            const orgUrl = r[1].replace(/(\'|\")/g, '');
            const newUrl = await resolveUrl(orgUrl);
            urlSplt[i] = urlSplt[i].replace(orgUrl, newUrl);
          }
          catch (e) { }
        }
      }
      node.value = urlSplt.join(',');
    }
    if (Array.isArray(node.declarations)) {
      await resolveStylesheetUrl(node.declarations, resolveUrl);
    }
    if (Array.isArray(node.rules)) {
      await resolveStylesheetUrl(node.rules, resolveUrl);
    }
    if (Array.isArray(node.keyframes)) {
      await resolveStylesheetUrl(node.keyframes, resolveUrl);
    }
  }
};

/**
 * Optimize a CSS file, optionally running an autoprefixer and a minifier
 * depending on the options set on the input options argument.
 *
 * @param inputOpts input CSS options
 * @returns a promise wrapping the optimized output
 */
const optimizeCss$1 = async (inputOpts) => {
  let result = {
    output: inputOpts.input,
    diagnostics: [],
  };
  if (inputOpts.autoprefixer !== false && inputOpts.autoprefixer !== null) {
    result = await autoprefixCss(inputOpts.input, inputOpts.autoprefixer);
    if (hasError(result.diagnostics)) {
      return result;
    }
  }
  if (inputOpts.minify !== false) {
    result.output = await minifyCss({
      css: result.output,
      resolveUrl: inputOpts.resolveUrl,
    });
  }
  return result;
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');

/**
 * Encode an integer in the range of 0 to 63 to a single base 64 digit.
 */
var encode$5 = function (number) {
  if (0 <= number && number < intToCharMap.length) {
  return intToCharMap[number];
  }
  throw new TypeError("Must be between 0 and 63: " + number);
};

/**
 * Decode a single base 64 character code digit to an integer. Returns -1 on
 * failure.
 */
var decode$3 = function (charCode) {
  var bigA = 65;   // 'A'
  var bigZ = 90;   // 'Z'

  var littleA = 97;  // 'a'
  var littleZ = 122; // 'z'

  var zero = 48;   // '0'
  var nine = 57;   // '9'

  var plus = 43;   // '+'
  var slash = 47;  // '/'

  var littleOffset = 26;
  var numberOffset = 52;

  // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  if (bigA <= charCode && charCode <= bigZ) {
  return (charCode - bigA);
  }

  // 26 - 51: abcdefghijklmnopqrstuvwxyz
  if (littleA <= charCode && charCode <= littleZ) {
  return (charCode - littleA + littleOffset);
  }

  // 52 - 61: 0123456789
  if (zero <= charCode && charCode <= nine) {
  return (charCode - zero + numberOffset);
  }

  // 62: +
  if (charCode == plus) {
  return 62;
  }

  // 63: /
  if (charCode == slash) {
  return 63;
  }

  // Invalid base64 digit.
  return -1;
};

var base64 = {
	encode: encode$5,
	decode: decode$3
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 *
 * Based on the Base 64 VLQ implementation in Closure Compiler:
 * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
 *
 * Copyright 2011 The Closure Compiler Authors. All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *  * Redistributions of source code must retain the above copyright
 *  notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above
 *  copyright notice, this list of conditions and the following
 *  disclaimer in the documentation and/or other materials provided
 *  with the distribution.
 *  * Neither the name of Google Inc. nor the names of its
 *  contributors may be used to endorse or promote products derived
 *  from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */



// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
//   Continuation
//   |  Sign
//   |  |
//   V  V
//   101011

var VLQ_BASE_SHIFT = 5;

// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;

// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;

// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;

/**
 * Converts from a two-complement value to a value where the sign bit is
 * placed in the least significant bit.  For example, as decimals:
 *   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
 *   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
 */
function toVLQSigned(aValue) {
  return aValue < 0
  ? ((-aValue) << 1) + 1
  : (aValue << 1) + 0;
}

/**
 * Converts to a two-complement value from a value where the sign bit is
 * placed in the least significant bit.  For example, as decimals:
 *   2 (10 binary) becomes 1, 3 (11 binary) becomes -1
 *   4 (100 binary) becomes 2, 5 (101 binary) becomes -2
 */
function fromVLQSigned(aValue) {
  var isNegative = (aValue & 1) === 1;
  var shifted = aValue >> 1;
  return isNegative
  ? -shifted
  : shifted;
}

/**
 * Returns the base 64 VLQ encoded value.
 */
var encode$4 = function base64VLQ_encode(aValue) {
  var encoded = "";
  var digit;

  var vlq = toVLQSigned(aValue);

  do {
  digit = vlq & VLQ_BASE_MASK;
  vlq >>>= VLQ_BASE_SHIFT;
  if (vlq > 0) {
    // There are still more digits in this value, so we must make sure the
    // continuation bit is marked.
    digit |= VLQ_CONTINUATION_BIT;
  }
  encoded += base64.encode(digit);
  } while (vlq > 0);

  return encoded;
};

/**
 * Decodes the next base 64 VLQ value from the given string and returns the
 * value and the rest of the string via the out parameter.
 */
var decode$2 = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  var strLen = aStr.length;
  var result = 0;
  var shift = 0;
  var continuation, digit;

  do {
  if (aIndex >= strLen) {
    throw new Error("Expected more digits in base 64 VLQ value.");
  }

  digit = base64.decode(aStr.charCodeAt(aIndex++));
  if (digit === -1) {
    throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  }

  continuation = !!(digit & VLQ_CONTINUATION_BIT);
  digit &= VLQ_BASE_MASK;
  result = result + (digit << shift);
  shift += VLQ_BASE_SHIFT;
  } while (continuation);

  aOutParam.value = fromVLQSigned(result);
  aOutParam.rest = aIndex;
};

var base64Vlq = {
	encode: encode$4,
	decode: decode$2
};

var util$1 = createCommonjsModule$1(function (module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

/**
 * This is a helper function for getting values from parameter/options
 * objects.
 *
 * @param args The object we are extracting values from
 * @param name The name of the property we are getting.
 * @param defaultValue An optional value to return if the property is missing
 * from the object. If this is not specified and the property is missing, an
 * error will be thrown.
 */
function getArg(aArgs, aName, aDefaultValue) {
  if (aName in aArgs) {
  return aArgs[aName];
  } else if (arguments.length === 3) {
  return aDefaultValue;
  } else {
  throw new Error('"' + aName + '" is a required argument.');
  }
}
exports.getArg = getArg;

var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;

function urlParse(aUrl) {
  var match = aUrl.match(urlRegexp);
  if (!match) {
  return null;
  }
  return {
  scheme: match[1],
  auth: match[2],
  host: match[3],
  port: match[4],
  path: match[5]
  };
}
exports.urlParse = urlParse;

function urlGenerate(aParsedUrl) {
  var url = '';
  if (aParsedUrl.scheme) {
  url += aParsedUrl.scheme + ':';
  }
  url += '//';
  if (aParsedUrl.auth) {
  url += aParsedUrl.auth + '@';
  }
  if (aParsedUrl.host) {
  url += aParsedUrl.host;
  }
  if (aParsedUrl.port) {
  url += ":" + aParsedUrl.port;
  }
  if (aParsedUrl.path) {
  url += aParsedUrl.path;
  }
  return url;
}
exports.urlGenerate = urlGenerate;

/**
 * Normalizes a path, or the path portion of a URL:
 *
 * - Replaces consecutive slashes with one slash.
 * - Removes unnecessary '.' parts.
 * - Removes unnecessary '<dir>/..' parts.
 *
 * Based on code in the Node.js 'path' core module.
 *
 * @param aPath The path or url to normalize.
 */
function normalize(aPath) {
  var path = aPath;
  var url = urlParse(aPath);
  if (url) {
  if (!url.path) {
    return aPath;
  }
  path = url.path;
  }
  var isAbsolute = exports.isAbsolute(path);

  var parts = path.split(/\/+/);
  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  part = parts[i];
  if (part === '.') {
    parts.splice(i, 1);
  } else if (part === '..') {
    up++;
  } else if (up > 0) {
    if (part === '') {
    // The first part is blank if the path is absolute. Trying to go
    // above the root is a no-op. Therefore we can remove all '..' parts
    // directly after the root.
    parts.splice(i + 1, up);
    up = 0;
    } else {
    parts.splice(i, 2);
    up--;
    }
  }
  }
  path = parts.join('/');

  if (path === '') {
  path = isAbsolute ? '/' : '.';
  }

  if (url) {
  url.path = path;
  return urlGenerate(url);
  }
  return path;
}
exports.normalize = normalize;

/**
 * Joins two paths/URLs.
 *
 * @param aRoot The root path or URL.
 * @param aPath The path or URL to be joined with the root.
 *
 * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
 *   scheme-relative URL: Then the scheme of aRoot, if any, is prepended
 *   first.
 * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
 *   is updated with the result and aRoot is returned. Otherwise the result
 *   is returned.
 *   - If aPath is absolute, the result is aPath.
 *   - Otherwise the two paths are joined with a slash.
 * - Joining for example 'http://' and 'www.example.com' is also supported.
 */
function join(aRoot, aPath) {
  if (aRoot === "") {
  aRoot = ".";
  }
  if (aPath === "") {
  aPath = ".";
  }
  var aPathUrl = urlParse(aPath);
  var aRootUrl = urlParse(aRoot);
  if (aRootUrl) {
  aRoot = aRootUrl.path || '/';
  }

  // `join(foo, '//www.example.org')`
  if (aPathUrl && !aPathUrl.scheme) {
  if (aRootUrl) {
    aPathUrl.scheme = aRootUrl.scheme;
  }
  return urlGenerate(aPathUrl);
  }

  if (aPathUrl || aPath.match(dataUrlRegexp)) {
  return aPath;
  }

  // `join('http://', 'www.example.com')`
  if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  aRootUrl.host = aPath;
  return urlGenerate(aRootUrl);
  }

  var joined = aPath.charAt(0) === '/'
  ? aPath
  : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);

  if (aRootUrl) {
  aRootUrl.path = joined;
  return urlGenerate(aRootUrl);
  }
  return joined;
}
exports.join = join;

exports.isAbsolute = function (aPath) {
  return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
};

/**
 * Make a path relative to a URL or another path.
 *
 * @param aRoot The root path or URL.
 * @param aPath The path or URL to be made relative to aRoot.
 */
function relative(aRoot, aPath) {
  if (aRoot === "") {
  aRoot = ".";
  }

  aRoot = aRoot.replace(/\/$/, '');

  // It is possible for the path to be above the root. In this case, simply
  // checking whether the root is a prefix of the path won't work. Instead, we
  // need to remove components from the root one by one, until either we find
  // a prefix that fits, or we run out of components to remove.
  var level = 0;
  while (aPath.indexOf(aRoot + '/') !== 0) {
  var index = aRoot.lastIndexOf("/");
  if (index < 0) {
    return aPath;
  }

  // If the only part of the root that is left is the scheme (i.e. http://,
  // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  // have exhausted all components, so the path is not relative to the root.
  aRoot = aRoot.slice(0, index);
  if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
    return aPath;
  }

  ++level;
  }

  // Make sure we add a "../" for each component we removed from the root.
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;

var supportsNullProto = (function () {
  var obj = Object.create(null);
  return !('__proto__' in obj);
}());

function identity (s) {
  return s;
}

/**
 * Because behavior goes wacky when you set `__proto__` on objects, we
 * have to prefix all the strings in our set with an arbitrary character.
 *
 * See https://github.com/mozilla/source-map/pull/31 and
 * https://github.com/mozilla/source-map/issues/30
 *
 * @param String aStr
 */
function toSetString(aStr) {
  if (isProtoString(aStr)) {
  return '$' + aStr;
  }

  return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;

function fromSetString(aStr) {
  if (isProtoString(aStr)) {
  return aStr.slice(1);
  }

  return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;

function isProtoString(s) {
  if (!s) {
  return false;
  }

  var length = s.length;

  if (length < 9 /* "__proto__".length */) {
  return false;
  }

  if (s.charCodeAt(length - 1) !== 95  /* '_' */ ||
    s.charCodeAt(length - 2) !== 95  /* '_' */ ||
    s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
    s.charCodeAt(length - 4) !== 116 /* 't' */ ||
    s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
    s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
    s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
    s.charCodeAt(length - 8) !== 95  /* '_' */ ||
    s.charCodeAt(length - 9) !== 95  /* '_' */) {
  return false;
  }

  for (var i = length - 10; i >= 0; i--) {
  if (s.charCodeAt(i) !== 36 /* '$' */) {
    return false;
  }
  }

  return true;
}

/**
 * Comparator between two mappings where the original positions are compared.
 *
 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
 * mappings with the same original source/line/column, but different generated
 * line and column the same. Useful when searching for a mapping with a
 * stubbed out mapping.
 */
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  var cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0 || onlyCompareOriginal) {
  return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
  return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositions = compareByOriginalPositions;

/**
 * Comparator between two mappings with deflated source and name indices where
 * the generated positions are compared.
 *
 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
 * mappings with the same generated line and column, but different
 * source/name/original line and column the same. Useful when searching for a
 * mapping with a stubbed out mapping.
 */
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  var cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0 || onlyCompareGenerated) {
  return cmp;
  }

  cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0) {
  return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;

function strcmp(aStr1, aStr2) {
  if (aStr1 === aStr2) {
  return 0;
  }

  if (aStr1 === null) {
  return 1; // aStr2 !== null
  }

  if (aStr2 === null) {
  return -1; // aStr1 !== null
  }

  if (aStr1 > aStr2) {
  return 1;
  }

  return -1;
}

/**
 * Comparator between two mappings with inflated source and name strings where
 * the generated positions are compared.
 */
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  var cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
  return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0) {
  return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;

/**
 * Strip any JSON XSSI avoidance prefix from the string (as documented
 * in the source maps specification), and then parse the string as
 * JSON.
 */
function parseSourceMapInput(str) {
  return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
}
exports.parseSourceMapInput = parseSourceMapInput;

/**
 * Compute the URL of a source given the the source root, the source's
 * URL, and the source map's URL.
 */
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  sourceURL = sourceURL || '';

  if (sourceRoot) {
  // This follows what Chrome does.
  if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
    sourceRoot += '/';
  }
  // The spec says:
  //   Line 4: An optional source root, useful for relocating source
  //   files on a server or removing repeated values in the
  //   “sources” entry.  This value is prepended to the individual
  //   entries in the “source” field.
  sourceURL = sourceRoot + sourceURL;
  }

  // Historically, SourceMapConsumer did not take the sourceMapURL as
  // a parameter.  This mode is still somewhat supported, which is why
  // this code block is conditional.  However, it's preferable to pass
  // the source map URL to SourceMapConsumer, so that this function
  // can implement the source URL resolution algorithm as outlined in
  // the spec.  This block is basically the equivalent of:
  //  new URL(sourceURL, sourceMapURL).toString()
  // ... except it avoids using URL, which wasn't available in the
  // older releases of node still supported by this library.
  //
  // The spec says:
  //   If the sources are not absolute URLs after prepending of the
  //   “sourceRoot”, the sources are resolved relative to the
  //   SourceMap (like resolving script src in a html document).
  if (sourceMapURL) {
  var parsed = urlParse(sourceMapURL);
  if (!parsed) {
    throw new Error("sourceMapURL could not be parsed");
  }
  if (parsed.path) {
    // Strip the last path component, but keep the "/".
    var index = parsed.path.lastIndexOf('/');
    if (index >= 0) {
    parsed.path = parsed.path.substring(0, index + 1);
    }
  }
  sourceURL = join(urlGenerate(parsed), sourceURL);
  }

  return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
});

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */


var has$1 = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";

/**
 * A data structure which is a combination of an array and a set. Adding a new
 * member is O(1), testing for membership is O(1), and finding the index of an
 * element is O(1). Removing elements from the set is not supported. Only
 * strings are supported for membership.
 */
function ArraySet$2() {
  this._array = [];
  this._set = hasNativeMap ? new Map() : Object.create(null);
}

/**
 * Static method for creating ArraySet instances from an existing array.
 */
ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  var set = new ArraySet$2();
  for (var i = 0, len = aArray.length; i < len; i++) {
  set.add(aArray[i], aAllowDuplicates);
  }
  return set;
};

/**
 * Return how many unique items are in this ArraySet. If duplicates have been
 * added, than those do not count towards the size.
 *
 * @returns Number
 */
ArraySet$2.prototype.size = function ArraySet_size() {
  return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};

/**
 * Add the given string to this set.
 *
 * @param String aStr
 */
ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  var sStr = hasNativeMap ? aStr : util$1.toSetString(aStr);
  var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
  var idx = this._array.length;
  if (!isDuplicate || aAllowDuplicates) {
  this._array.push(aStr);
  }
  if (!isDuplicate) {
  if (hasNativeMap) {
    this._set.set(aStr, idx);
  } else {
    this._set[sStr] = idx;
  }
  }
};

/**
 * Is the given string a member of this set?
 *
 * @param String aStr
 */
ArraySet$2.prototype.has = function ArraySet_has(aStr) {
  if (hasNativeMap) {
  return this._set.has(aStr);
  } else {
  var sStr = util$1.toSetString(aStr);
  return has$1.call(this._set, sStr);
  }
};

/**
 * What is the index of the given string in the array?
 *
 * @param String aStr
 */
ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
  if (hasNativeMap) {
  var idx = this._set.get(aStr);
  if (idx >= 0) {
    return idx;
  }
  } else {
  var sStr = util$1.toSetString(aStr);
  if (has$1.call(this._set, sStr)) {
    return this._set[sStr];
  }
  }

  throw new Error('"' + aStr + '" is not in the set.');
};

/**
 * What is the element at the given index?
 *
 * @param Number aIdx
 */
ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
  if (aIdx >= 0 && aIdx < this._array.length) {
  return this._array[aIdx];
  }
  throw new Error('No element indexed by ' + aIdx);
};

/**
 * Returns the array representation of this set (which has the proper indices
 * indicated by indexOf). Note that this is a copy of the internal array used
 * for storing the members so that no one can mess with internal state.
 */
ArraySet$2.prototype.toArray = function ArraySet_toArray() {
  return this._array.slice();
};

var ArraySet_1 = ArraySet$2;

var arraySet = {
	ArraySet: ArraySet_1
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2014 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */



/**
 * Determine whether mappingB is after mappingA with respect to generated
 * position.
 */
function generatedPositionAfter(mappingA, mappingB) {
  // Optimized for most common case
  var lineA = mappingA.generatedLine;
  var lineB = mappingB.generatedLine;
  var columnA = mappingA.generatedColumn;
  var columnB = mappingB.generatedColumn;
  return lineB > lineA || lineB == lineA && columnB >= columnA ||
     util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}

/**
 * A data structure to provide a sorted view of accumulated mappings in a
 * performance conscious manner. It trades a neglibable overhead in general
 * case for a large speedup in case of mappings being added in order.
 */
function MappingList$1() {
  this._array = [];
  this._sorted = true;
  // Serves as infimum
  this._last = {generatedLine: -1, generatedColumn: 0};
}

/**
 * Iterate through internal items. This method takes the same arguments that
 * `Array.prototype.forEach` takes.
 *
 * NOTE: The order of the mappings is NOT guaranteed.
 */
MappingList$1.prototype.unsortedForEach =
  function MappingList_forEach(aCallback, aThisArg) {
  this._array.forEach(aCallback, aThisArg);
  };

/**
 * Add the given source mapping.
 *
 * @param Object aMapping
 */
MappingList$1.prototype.add = function MappingList_add(aMapping) {
  if (generatedPositionAfter(this._last, aMapping)) {
  this._last = aMapping;
  this._array.push(aMapping);
  } else {
  this._sorted = false;
  this._array.push(aMapping);
  }
};

/**
 * Returns the flat, sorted array of mappings. The mappings are sorted by
 * generated position.
 *
 * WARNING: This method returns internal data without copying, for
 * performance. The return value must NOT be mutated, and should be treated as
 * an immutable borrow. If you want to take ownership, you must make your own
 * copy.
 */
MappingList$1.prototype.toArray = function MappingList_toArray() {
  if (!this._sorted) {
  this._array.sort(util$1.compareByGeneratedPositionsInflated);
  this._sorted = true;
  }
  return this._array;
};

var MappingList_1 = MappingList$1;

var mappingList = {
	MappingList: MappingList_1
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */



var ArraySet$1 = arraySet.ArraySet;
var MappingList = mappingList.MappingList;

/**
 * An instance of the SourceMapGenerator represents a source map which is
 * being built incrementally. You may pass an object with the following
 * properties:
 *
 *   - file: The filename of the generated source.
 *   - sourceRoot: A root for all relative URLs in this source map.
 */
function SourceMapGenerator$4(aArgs) {
  if (!aArgs) {
  aArgs = {};
  }
  this._file = util$1.getArg(aArgs, 'file', null);
  this._sourceRoot = util$1.getArg(aArgs, 'sourceRoot', null);
  this._skipValidation = util$1.getArg(aArgs, 'skipValidation', false);
  this._sources = new ArraySet$1();
  this._names = new ArraySet$1();
  this._mappings = new MappingList();
  this._sourcesContents = null;
}

SourceMapGenerator$4.prototype._version = 3;

/**
 * Creates a new SourceMapGenerator based on a SourceMapConsumer
 *
 * @param aSourceMapConsumer The SourceMap.
 */
SourceMapGenerator$4.fromSourceMap =
  function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  var sourceRoot = aSourceMapConsumer.sourceRoot;
  var generator = new SourceMapGenerator$4({
    file: aSourceMapConsumer.file,
    sourceRoot: sourceRoot
  });
  aSourceMapConsumer.eachMapping(function (mapping) {
    var newMapping = {
    generated: {
      line: mapping.generatedLine,
      column: mapping.generatedColumn
    }
    };

    if (mapping.source != null) {
    newMapping.source = mapping.source;
    if (sourceRoot != null) {
      newMapping.source = util$1.relative(sourceRoot, newMapping.source);
    }

    newMapping.original = {
      line: mapping.originalLine,
      column: mapping.originalColumn
    };

    if (mapping.name != null) {
      newMapping.name = mapping.name;
    }
    }

    generator.addMapping(newMapping);
  });
  aSourceMapConsumer.sources.forEach(function (sourceFile) {
    var sourceRelative = sourceFile;
    if (sourceRoot !== null) {
    sourceRelative = util$1.relative(sourceRoot, sourceFile);
    }

    if (!generator._sources.has(sourceRelative)) {
    generator._sources.add(sourceRelative);
    }

    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
    if (content != null) {
    generator.setSourceContent(sourceFile, content);
    }
  });
  return generator;
  };

/**
 * Add a single mapping from original source line and column to the generated
 * source's line and column for this source map being created. The mapping
 * object should have the following properties:
 *
 *   - generated: An object with the generated line and column positions.
 *   - original: An object with the original line and column positions.
 *   - source: The original source file (relative to the sourceRoot).
 *   - name: An optional original token name for this mapping.
 */
SourceMapGenerator$4.prototype.addMapping =
  function SourceMapGenerator_addMapping(aArgs) {
  var generated = util$1.getArg(aArgs, 'generated');
  var original = util$1.getArg(aArgs, 'original', null);
  var source = util$1.getArg(aArgs, 'source', null);
  var name = util$1.getArg(aArgs, 'name', null);

  if (!this._skipValidation) {
    this._validateMapping(generated, original, source, name);
  }

  if (source != null) {
    source = String(source);
    if (!this._sources.has(source)) {
    this._sources.add(source);
    }
  }

  if (name != null) {
    name = String(name);
    if (!this._names.has(name)) {
    this._names.add(name);
    }
  }

  this._mappings.add({
    generatedLine: generated.line,
    generatedColumn: generated.column,
    originalLine: original != null && original.line,
    originalColumn: original != null && original.column,
    source: source,
    name: name
  });
  };

/**
 * Set the source content for a source file.
 */
SourceMapGenerator$4.prototype.setSourceContent =
  function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  var source = aSourceFile;
  if (this._sourceRoot != null) {
    source = util$1.relative(this._sourceRoot, source);
  }

  if (aSourceContent != null) {
    // Add the source content to the _sourcesContents map.
    // Create a new _sourcesContents map if the property is null.
    if (!this._sourcesContents) {
    this._sourcesContents = Object.create(null);
    }
    this._sourcesContents[util$1.toSetString(source)] = aSourceContent;
  } else if (this._sourcesContents) {
    // Remove the source file from the _sourcesContents map.
    // If the _sourcesContents map is empty, set the property to null.
    delete this._sourcesContents[util$1.toSetString(source)];
    if (Object.keys(this._sourcesContents).length === 0) {
    this._sourcesContents = null;
    }
  }
  };

/**
 * Applies the mappings of a sub-source-map for a specific source file to the
 * source map being generated. Each mapping to the supplied source file is
 * rewritten using the supplied source map. Note: The resolution for the
 * resulting mappings is the minimium of this map and the supplied map.
 *
 * @param aSourceMapConsumer The source map to be applied.
 * @param aSourceFile Optional. The filename of the source file.
 *    If omitted, SourceMapConsumer's file property will be used.
 * @param aSourceMapPath Optional. The dirname of the path to the source map
 *    to be applied. If relative, it is relative to the SourceMapConsumer.
 *    This parameter is needed when the two source maps aren't in the same
 *    directory, and the source map to be applied contains relative source
 *    paths. If so, those relative source paths need to be rewritten
 *    relative to the SourceMapGenerator.
 */
SourceMapGenerator$4.prototype.applySourceMap =
  function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  var sourceFile = aSourceFile;
  // If aSourceFile is omitted, we will use the file property of the SourceMap
  if (aSourceFile == null) {
    if (aSourceMapConsumer.file == null) {
    throw new Error(
      'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
      'or the source map\'s "file" property. Both were omitted.'
    );
    }
    sourceFile = aSourceMapConsumer.file;
  }
  var sourceRoot = this._sourceRoot;
  // Make "sourceFile" relative if an absolute Url is passed.
  if (sourceRoot != null) {
    sourceFile = util$1.relative(sourceRoot, sourceFile);
  }
  // Applying the SourceMap can add and remove items from the sources and
  // the names array.
  var newSources = new ArraySet$1();
  var newNames = new ArraySet$1();

  // Find mappings for the "sourceFile"
  this._mappings.unsortedForEach(function (mapping) {
    if (mapping.source === sourceFile && mapping.originalLine != null) {
    // Check if it can be mapped by the source map, then update the mapping.
    var original = aSourceMapConsumer.originalPositionFor({
      line: mapping.originalLine,
      column: mapping.originalColumn
    });
    if (original.source != null) {
      // Copy mapping
      mapping.source = original.source;
      if (aSourceMapPath != null) {
      mapping.source = util$1.join(aSourceMapPath, mapping.source);
      }
      if (sourceRoot != null) {
      mapping.source = util$1.relative(sourceRoot, mapping.source);
      }
      mapping.originalLine = original.line;
      mapping.originalColumn = original.column;
      if (original.name != null) {
      mapping.name = original.name;
      }
    }
    }

    var source = mapping.source;
    if (source != null && !newSources.has(source)) {
    newSources.add(source);
    }

    var name = mapping.name;
    if (name != null && !newNames.has(name)) {
    newNames.add(name);
    }

  }, this);
  this._sources = newSources;
  this._names = newNames;

  // Copy sourcesContents of applied map.
  aSourceMapConsumer.sources.forEach(function (sourceFile) {
    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
    if (content != null) {
    if (aSourceMapPath != null) {
      sourceFile = util$1.join(aSourceMapPath, sourceFile);
    }
    if (sourceRoot != null) {
      sourceFile = util$1.relative(sourceRoot, sourceFile);
    }
    this.setSourceContent(sourceFile, content);
    }
  }, this);
  };

/**
 * A mapping can have one of the three levels of data:
 *
 *   1. Just the generated position.
 *   2. The Generated position, original position, and original source.
 *   3. Generated and original position, original source, as well as a name
 *    token.
 *
 * To maintain consistency, we validate that any new mapping being added falls
 * in to one of these categories.
 */
SourceMapGenerator$4.prototype._validateMapping =
  function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
                        aName) {
  // When aOriginal is truthy but has empty values for .line and .column,
  // it is most likely a programmer error. In this case we throw a very
  // specific error message to try to guide them the right way.
  // For example: https://github.com/Polymer/polymer-bundler/pull/519
  if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
    throw new Error(
      'original.line and original.column are not numbers -- you probably meant to omit ' +
      'the original mapping entirely and only map the generated position. If so, pass ' +
      'null for the original mapping instead of an object with empty or null values.'
    );
  }

  if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
    && aGenerated.line > 0 && aGenerated.column >= 0
    && !aOriginal && !aSource && !aName) {
    // Case 1.
    return;
  }
  else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
       && aOriginal && 'line' in aOriginal && 'column' in aOriginal
       && aGenerated.line > 0 && aGenerated.column >= 0
       && aOriginal.line > 0 && aOriginal.column >= 0
       && aSource) {
    // Cases 2 and 3.
    return;
  }
  else {
    throw new Error('Invalid mapping: ' + JSON.stringify({
    generated: aGenerated,
    source: aSource,
    original: aOriginal,
    name: aName
    }));
  }
  };

/**
 * Serialize the accumulated mappings in to the stream of base 64 VLQs
 * specified by the source map format.
 */
SourceMapGenerator$4.prototype._serializeMappings =
  function SourceMapGenerator_serializeMappings() {
  var previousGeneratedColumn = 0;
  var previousGeneratedLine = 1;
  var previousOriginalColumn = 0;
  var previousOriginalLine = 0;
  var previousName = 0;
  var previousSource = 0;
  var result = '';
  var next;
  var mapping;
  var nameIdx;
  var sourceIdx;

  var mappings = this._mappings.toArray();
  for (var i = 0, len = mappings.length; i < len; i++) {
    mapping = mappings[i];
    next = '';

    if (mapping.generatedLine !== previousGeneratedLine) {
    previousGeneratedColumn = 0;
    while (mapping.generatedLine !== previousGeneratedLine) {
      next += ';';
      previousGeneratedLine++;
    }
    }
    else {
    if (i > 0) {
      if (!util$1.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
      continue;
      }
      next += ',';
    }
    }

    next += base64Vlq.encode(mapping.generatedColumn
                 - previousGeneratedColumn);
    previousGeneratedColumn = mapping.generatedColumn;

    if (mapping.source != null) {
    sourceIdx = this._sources.indexOf(mapping.source);
    next += base64Vlq.encode(sourceIdx - previousSource);
    previousSource = sourceIdx;

    // lines are stored 0-based in SourceMap spec version 3
    next += base64Vlq.encode(mapping.originalLine - 1
                   - previousOriginalLine);
    previousOriginalLine = mapping.originalLine - 1;

    next += base64Vlq.encode(mapping.originalColumn
                   - previousOriginalColumn);
    previousOriginalColumn = mapping.originalColumn;

    if (mapping.name != null) {
      nameIdx = this._names.indexOf(mapping.name);
      next += base64Vlq.encode(nameIdx - previousName);
      previousName = nameIdx;
    }
    }

    result += next;
  }

  return result;
  };

SourceMapGenerator$4.prototype._generateSourcesContent =
  function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  return aSources.map(function (source) {
    if (!this._sourcesContents) {
    return null;
    }
    if (aSourceRoot != null) {
    source = util$1.relative(aSourceRoot, source);
    }
    var key = util$1.toSetString(source);
    return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
    ? this._sourcesContents[key]
    : null;
  }, this);
  };

/**
 * Externalize the source map.
 */
SourceMapGenerator$4.prototype.toJSON =
  function SourceMapGenerator_toJSON() {
  var map = {
    version: this._version,
    sources: this._sources.toArray(),
    names: this._names.toArray(),
    mappings: this._serializeMappings()
  };
  if (this._file != null) {
    map.file = this._file;
  }
  if (this._sourceRoot != null) {
    map.sourceRoot = this._sourceRoot;
  }
  if (this._sourcesContents) {
    map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  }

  return map;
  };

/**
 * Render the source map being generated to a string.
 */
SourceMapGenerator$4.prototype.toString =
  function SourceMapGenerator_toString() {
  return JSON.stringify(this.toJSON());
  };

var SourceMapGenerator_1 = SourceMapGenerator$4;

var sourceMapGenerator = {
	SourceMapGenerator: SourceMapGenerator_1
};

var binarySearch$1 = createCommonjsModule$1(function (module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

exports.GREATEST_LOWER_BOUND = 1;
exports.LEAST_UPPER_BOUND = 2;

/**
 * Recursive implementation of binary search.
 *
 * @param aLow Indices here and lower do not contain the needle.
 * @param aHigh Indices here and higher do not contain the needle.
 * @param aNeedle The element being searched for.
 * @param aHaystack The non-empty array being searched.
 * @param aCompare Function which takes two elements and returns -1, 0, or 1.
 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
 *   'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
 *   closest element that is smaller than or greater than the one we are
 *   searching for, respectively, if the exact element cannot be found.
 */
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  // This function terminates when one of the following is true:
  //
  //   1. We find the exact element we are looking for.
  //
  //   2. We did not find the exact element, but we can return the index of
  //    the next-closest element.
  //
  //   3. We did not find the exact element, and there is no next-closest
  //    element than the one we are searching for, so we return -1.
  var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  var cmp = aCompare(aNeedle, aHaystack[mid], true);
  if (cmp === 0) {
  // Found the element we are looking for.
  return mid;
  }
  else if (cmp > 0) {
  // Our needle is greater than aHaystack[mid].
  if (aHigh - mid > 1) {
    // The element is in the upper half.
    return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  }

  // The exact needle element was not found in this haystack. Determine if
  // we are in termination case (3) or (2) and return the appropriate thing.
  if (aBias == exports.LEAST_UPPER_BOUND) {
    return aHigh < aHaystack.length ? aHigh : -1;
  } else {
    return mid;
  }
  }
  else {
  // Our needle is less than aHaystack[mid].
  if (mid - aLow > 1) {
    // The element is in the lower half.
    return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  }

  // we are in termination case (3) or (2) and return the appropriate thing.
  if (aBias == exports.LEAST_UPPER_BOUND) {
    return mid;
  } else {
    return aLow < 0 ? -1 : aLow;
  }
  }
}

/**
 * This is an implementation of binary search which will always try and return
 * the index of the closest element if there is no exact hit. This is because
 * mappings between original and generated line/col pairs are single points,
 * and there is an implicit region between each of them, so a miss just means
 * that you aren't on the very start of a region.
 *
 * @param aNeedle The element you are looking for.
 * @param aHaystack The array that is being searched.
 * @param aCompare A function which takes the needle and an element in the
 *   array and returns -1, 0, or 1 depending on whether the needle is less
 *   than, equal to, or greater than the element, respectively.
 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
 *   'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
 *   closest element that is smaller than or greater than the one we are
 *   searching for, respectively, if the exact element cannot be found.
 *   Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
 */
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  if (aHaystack.length === 0) {
  return -1;
  }

  var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
                aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  if (index < 0) {
  return -1;
  }

  // We have found either the exact element, or the next-closest element than
  // the one we are searching for. However, there may be more than one such
  // element. Make sure we always return the smallest of these.
  while (index - 1 >= 0) {
  if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
    break;
  }
  --index;
  }

  return index;
};
});

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

// It turns out that some (most?) JavaScript engines don't self-host
// `Array.prototype.sort`. This makes sense because C++ will likely remain
// faster than JS when doing raw CPU-intensive sorting. However, when using a
// custom comparator function, calling back and forth between the VM's C++ and
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
// worse generated code for the comparator function than would be optimal. In
// fact, when sorting with a comparator, these costs outweigh the benefits of
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
// a ~3500ms mean speed-up in `bench/bench.html`.

/**
 * Swap the elements indexed by `x` and `y` in the array `ary`.
 *
 * @param {Array} ary
 *    The array.
 * @param {Number} x
 *    The index of the first item.
 * @param {Number} y
 *    The index of the second item.
 */
function swap(ary, x, y) {
  var temp = ary[x];
  ary[x] = ary[y];
  ary[y] = temp;
}

/**
 * Returns a random integer within the range `low .. high` inclusive.
 *
 * @param {Number} low
 *    The lower bound on the range.
 * @param {Number} high
 *    The upper bound on the range.
 */
function randomIntInRange(low, high) {
  return Math.round(low + (Math.random() * (high - low)));
}

/**
 * The Quick Sort algorithm.
 *
 * @param {Array} ary
 *    An array to sort.
 * @param {function} comparator
 *    Function to use to compare two items.
 * @param {Number} p
 *    Start index of the array
 * @param {Number} r
 *    End index of the array
 */
function doQuickSort(ary, comparator, p, r) {
  // If our lower bound is less than our upper bound, we (1) partition the
  // array into two pieces and (2) recurse on each half. If it is not, this is
  // the empty array and our base case.

  if (p < r) {
  // (1) Partitioning.
  //
  // The partitioning chooses a pivot between `p` and `r` and moves all
  // elements that are less than or equal to the pivot to the before it, and
  // all the elements that are greater than it after it. The effect is that
  // once partition is done, the pivot is in the exact place it will be when
  // the array is put in sorted order, and it will not need to be moved
  // again. This runs in O(n) time.

  // Always choose a random pivot so that an input array which is reverse
  // sorted does not cause O(n^2) running time.
  var pivotIndex = randomIntInRange(p, r);
  var i = p - 1;

  swap(ary, pivotIndex, r);
  var pivot = ary[r];

  // Immediately after `j` is incremented in this loop, the following hold
  // true:
  //
  //   * Every element in `ary[p .. i]` is less than or equal to the pivot.
  //
  //   * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  for (var j = p; j < r; j++) {
    if (comparator(ary[j], pivot) <= 0) {
    i += 1;
    swap(ary, i, j);
    }
  }

  swap(ary, i + 1, j);
  var q = i + 1;

  // (2) Recurse on each half.

  doQuickSort(ary, comparator, p, q - 1);
  doQuickSort(ary, comparator, q + 1, r);
  }
}

/**
 * Sort the given array in-place with the given comparator function.
 *
 * @param {Array} ary
 *    An array to sort.
 * @param {function} comparator
 *    Function to use to compare two items.
 */
var quickSort_1 = function (ary, comparator) {
  doQuickSort(ary, comparator, 0, ary.length - 1);
};

var quickSort$1 = {
	quickSort: quickSort_1
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */



var ArraySet = arraySet.ArraySet;

var quickSort = quickSort$1.quickSort;

function SourceMapConsumer$3(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
  sourceMap = util$1.parseSourceMapInput(aSourceMap);
  }

  return sourceMap.sections != null
  ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
  : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
}

SourceMapConsumer$3.fromSourceMap = function(aSourceMap, aSourceMapURL) {
  return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
};

/**
 * The version of the source mapping spec that we are consuming.
 */
SourceMapConsumer$3.prototype._version = 3;

// `__generatedMappings` and `__originalMappings` are arrays that hold the
// parsed mapping coordinates from the source map's "mappings" attribute. They
// are lazily instantiated, accessed via the `_generatedMappings` and
// `_originalMappings` getters respectively, and we only parse the mappings
// and create these arrays once queried for a source location. We jump through
// these hoops because there can be many thousands of mappings, and parsing
// them is expensive, so we only want to do it if we must.
//
// Each object in the arrays is of the form:
//
//   {
//     generatedLine: The line number in the generated code,
//     generatedColumn: The column number in the generated code,
//     source: The path to the original source file that generated this
//         chunk of code,
//     originalLine: The line number in the original source that
//           corresponds to this chunk of generated code,
//     originalColumn: The column number in the original source that
//             corresponds to this chunk of generated code,
//     name: The name of the original symbol which generated this chunk of
//       code.
//   }
//
// All properties except for `generatedLine` and `generatedColumn` can be
// `null`.
//
// `_generatedMappings` is ordered by the generated positions.
//
// `_originalMappings` is ordered by the original positions.

SourceMapConsumer$3.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer$3.prototype, '_generatedMappings', {
  configurable: true,
  enumerable: true,
  get: function () {
  if (!this.__generatedMappings) {
    this._parseMappings(this._mappings, this.sourceRoot);
  }

  return this.__generatedMappings;
  }
});

SourceMapConsumer$3.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer$3.prototype, '_originalMappings', {
  configurable: true,
  enumerable: true,
  get: function () {
  if (!this.__originalMappings) {
    this._parseMappings(this._mappings, this.sourceRoot);
  }

  return this.__originalMappings;
  }
});

SourceMapConsumer$3.prototype._charIsMappingSeparator =
  function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  var c = aStr.charAt(index);
  return c === ";" || c === ",";
  };

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */
SourceMapConsumer$3.prototype._parseMappings =
  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  throw new Error("Subclasses must implement _parseMappings");
  };

SourceMapConsumer$3.GENERATED_ORDER = 1;
SourceMapConsumer$3.ORIGINAL_ORDER = 2;

SourceMapConsumer$3.GREATEST_LOWER_BOUND = 1;
SourceMapConsumer$3.LEAST_UPPER_BOUND = 2;

/**
 * Iterate over each mapping between an original source/line/column and a
 * generated line/column in this source map.
 *
 * @param Function aCallback
 *    The function that is called with each mapping.
 * @param Object aContext
 *    Optional. If specified, this object will be the value of `this` every
 *    time that `aCallback` is called.
 * @param aOrder
 *    Either `SourceMapConsumer.GENERATED_ORDER` or
 *    `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
 *    iterate over the mappings sorted by the generated file's line/column
 *    order or the original's source/line/column order, respectively. Defaults to
 *    `SourceMapConsumer.GENERATED_ORDER`.
 */
SourceMapConsumer$3.prototype.eachMapping =
  function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  var context = aContext || null;
  var order = aOrder || SourceMapConsumer$3.GENERATED_ORDER;

  var mappings;
  switch (order) {
  case SourceMapConsumer$3.GENERATED_ORDER:
    mappings = this._generatedMappings;
    break;
  case SourceMapConsumer$3.ORIGINAL_ORDER:
    mappings = this._originalMappings;
    break;
  default:
    throw new Error("Unknown order of iteration.");
  }

  var sourceRoot = this.sourceRoot;
  mappings.map(function (mapping) {
    var source = mapping.source === null ? null : this._sources.at(mapping.source);
    source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
    return {
    source: source,
    generatedLine: mapping.generatedLine,
    generatedColumn: mapping.generatedColumn,
    originalLine: mapping.originalLine,
    originalColumn: mapping.originalColumn,
    name: mapping.name === null ? null : this._names.at(mapping.name)
    };
  }, this).forEach(aCallback, context);
  };

/**
 * Returns all generated line and column information for the original source,
 * line, and column provided. If no column is provided, returns all mappings
 * corresponding to a either the line we are searching for or the next
 * closest line that has any mappings. Otherwise, returns all mappings
 * corresponding to the given line and either the column we are searching for
 * or the next closest column that has any offsets.
 *
 * The only argument is an object with the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number is 1-based.
 *   - column: Optional. the column number in the original source.
 *  The column number is 0-based.
 *
 * and an array of objects is returned, each with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *  line number is 1-based.
 *   - column: The column number in the generated source, or null.
 *  The column number is 0-based.
 */
SourceMapConsumer$3.prototype.allGeneratedPositionsFor =
  function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  var line = util$1.getArg(aArgs, 'line');

  // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  // returns the index of the closest mapping less than the needle. By
  // setting needle.originalColumn to 0, we thus find the last mapping for
  // the given line, provided such a mapping exists.
  var needle = {
    source: util$1.getArg(aArgs, 'source'),
    originalLine: line,
    originalColumn: util$1.getArg(aArgs, 'column', 0)
  };

  needle.source = this._findSourceIndex(needle.source);
  if (needle.source < 0) {
    return [];
  }

  var mappings = [];

  var index = this._findMapping(needle,
                  this._originalMappings,
                  "originalLine",
                  "originalColumn",
                  util$1.compareByOriginalPositions,
                  binarySearch$1.LEAST_UPPER_BOUND);
  if (index >= 0) {
    var mapping = this._originalMappings[index];

    if (aArgs.column === undefined) {
    var originalLine = mapping.originalLine;

    // Iterate until either we run out of mappings, or we run into
    // a mapping for a different line than the one we found. Since
    // mappings are sorted, this is guaranteed to find all mappings for
    // the line we found.
    while (mapping && mapping.originalLine === originalLine) {
      mappings.push({
      line: util$1.getArg(mapping, 'generatedLine', null),
      column: util$1.getArg(mapping, 'generatedColumn', null),
      lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
      });

      mapping = this._originalMappings[++index];
    }
    } else {
    var originalColumn = mapping.originalColumn;

    // Iterate until either we run out of mappings, or we run into
    // a mapping for a different line than the one we were searching for.
    // Since mappings are sorted, this is guaranteed to find all mappings for
    // the line we are searching for.
    while (mapping &&
         mapping.originalLine === line &&
         mapping.originalColumn == originalColumn) {
      mappings.push({
      line: util$1.getArg(mapping, 'generatedLine', null),
      column: util$1.getArg(mapping, 'generatedColumn', null),
      lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
      });

      mapping = this._originalMappings[++index];
    }
    }
  }

  return mappings;
  };

var SourceMapConsumer_1 = SourceMapConsumer$3;

/**
 * A BasicSourceMapConsumer instance represents a parsed source map which we can
 * query for information about the original file positions by giving it a file
 * position in the generated source.
 *
 * The first parameter is the raw source map (either as a JSON string, or
 * already parsed to an object). According to the spec, source maps have the
 * following attributes:
 *
 *   - version: Which version of the source map spec this map is following.
 *   - sources: An array of URLs to the original source files.
 *   - names: An array of identifiers which can be referrenced by individual mappings.
 *   - sourceRoot: Optional. The URL root from which all sources are relative.
 *   - sourcesContent: Optional. An array of contents of the original source files.
 *   - mappings: A string of base64 VLQs which contain the actual mappings.
 *   - file: Optional. The generated file this source map is associated with.
 *
 * Here is an example source map, taken from the source map spec[0]:
 *
 *   {
 *     version : 3,
 *     file: "out.js",
 *     sourceRoot : "",
 *     sources: ["foo.js", "bar.js"],
 *     names: ["src", "maps", "are", "fun"],
 *     mappings: "AA,AB;;ABCDE;"
 *   }
 *
 * The second parameter, if given, is a string whose value is the URL
 * at which the source map was found.  This URL is used to compute the
 * sources array.
 *
 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
 */
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
  sourceMap = util$1.parseSourceMapInput(aSourceMap);
  }

  var version = util$1.getArg(sourceMap, 'version');
  var sources = util$1.getArg(sourceMap, 'sources');
  // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  // requires the array) to play nice here.
  var names = util$1.getArg(sourceMap, 'names', []);
  var sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null);
  var sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null);
  var mappings = util$1.getArg(sourceMap, 'mappings');
  var file = util$1.getArg(sourceMap, 'file', null);

  // Once again, Sass deviates from the spec and supplies the version as a
  // string rather than a number, so we use loose equality checking here.
  if (version != this._version) {
  throw new Error('Unsupported version: ' + version);
  }

  if (sourceRoot) {
  sourceRoot = util$1.normalize(sourceRoot);
  }

  sources = sources
  .map(String)
  // Some source maps produce relative source paths like "./foo.js" instead of
  // "foo.js".  Normalize these first so that future comparisons will succeed.
  // See bugzil.la/1090768.
  .map(util$1.normalize)
  // Always ensure that absolute sources are internally stored relative to
  // the source root, if the source root is absolute. Not doing this would
  // be particularly problematic when the source root is a prefix of the
  // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  .map(function (source) {
    return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source)
    ? util$1.relative(sourceRoot, source)
    : source;
  });

  // Pass `true` below to allow duplicate names and sources. While source maps
  // are intended to be compressed and deduplicated, the TypeScript compiler
  // sometimes generates source maps with duplicates in them. See Github issue
  // #72 and bugzil.la/889492.
  this._names = ArraySet.fromArray(names.map(String), true);
  this._sources = ArraySet.fromArray(sources, true);

  this._absoluteSources = this._sources.toArray().map(function (s) {
  return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
  });

  this.sourceRoot = sourceRoot;
  this.sourcesContent = sourcesContent;
  this._mappings = mappings;
  this._sourceMapURL = aSourceMapURL;
  this.file = file;
}

BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$3.prototype);
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$3;

/**
 * Utility function to find the index of a source.  Returns -1 if not
 * found.
 */
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
  var relativeSource = aSource;
  if (this.sourceRoot != null) {
  relativeSource = util$1.relative(this.sourceRoot, relativeSource);
  }

  if (this._sources.has(relativeSource)) {
  return this._sources.indexOf(relativeSource);
  }

  // Maybe aSource is an absolute URL as returned by |sources|.  In
  // this case we can't simply undo the transform.
  var i;
  for (i = 0; i < this._absoluteSources.length; ++i) {
  if (this._absoluteSources[i] == aSource) {
    return i;
  }
  }

  return -1;
};

/**
 * Create a BasicSourceMapConsumer from a SourceMapGenerator.
 *
 * @param SourceMapGenerator aSourceMap
 *    The source map that will be consumed.
 * @param String aSourceMapURL
 *    The URL at which the source map can be found (optional)
 * @returns BasicSourceMapConsumer
 */
BasicSourceMapConsumer.fromSourceMap =
  function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
  var smc = Object.create(BasicSourceMapConsumer.prototype);

  var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  smc.sourceRoot = aSourceMap._sourceRoot;
  smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
                              smc.sourceRoot);
  smc.file = aSourceMap._file;
  smc._sourceMapURL = aSourceMapURL;
  smc._absoluteSources = smc._sources.toArray().map(function (s) {
    return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
  });

  // Because we are modifying the entries (by converting string sources and
  // names to indices into the sources and names ArraySets), we have to make
  // a copy of the entry or else bad things happen. Shared mutable state
  // strikes again! See github issue #191.

  var generatedMappings = aSourceMap._mappings.toArray().slice();
  var destGeneratedMappings = smc.__generatedMappings = [];
  var destOriginalMappings = smc.__originalMappings = [];

  for (var i = 0, length = generatedMappings.length; i < length; i++) {
    var srcMapping = generatedMappings[i];
    var destMapping = new Mapping;
    destMapping.generatedLine = srcMapping.generatedLine;
    destMapping.generatedColumn = srcMapping.generatedColumn;

    if (srcMapping.source) {
    destMapping.source = sources.indexOf(srcMapping.source);
    destMapping.originalLine = srcMapping.originalLine;
    destMapping.originalColumn = srcMapping.originalColumn;

    if (srcMapping.name) {
      destMapping.name = names.indexOf(srcMapping.name);
    }

    destOriginalMappings.push(destMapping);
    }

    destGeneratedMappings.push(destMapping);
  }

  quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);

  return smc;
  };

/**
 * The version of the source mapping spec that we are consuming.
 */
BasicSourceMapConsumer.prototype._version = 3;

/**
 * The list of original sources.
 */
Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  get: function () {
  return this._absoluteSources.slice();
  }
});

/**
 * Provide the JIT with a nice shape / hidden class.
 */
function Mapping() {
  this.generatedLine = 0;
  this.generatedColumn = 0;
  this.source = null;
  this.originalLine = null;
  this.originalColumn = null;
  this.name = null;
}

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */
BasicSourceMapConsumer.prototype._parseMappings =
  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  var generatedLine = 1;
  var previousGeneratedColumn = 0;
  var previousOriginalLine = 0;
  var previousOriginalColumn = 0;
  var previousSource = 0;
  var previousName = 0;
  var length = aStr.length;
  var index = 0;
  var cachedSegments = {};
  var temp = {};
  var originalMappings = [];
  var generatedMappings = [];
  var mapping, str, segment, end, value;

  while (index < length) {
    if (aStr.charAt(index) === ';') {
    generatedLine++;
    index++;
    previousGeneratedColumn = 0;
    }
    else if (aStr.charAt(index) === ',') {
    index++;
    }
    else {
    mapping = new Mapping();
    mapping.generatedLine = generatedLine;

    // Because each offset is encoded relative to the previous one,
    // many segments often have the same encoding. We can exploit this
    // fact by caching the parsed variable length fields of each segment,
    // allowing us to avoid a second parse if we encounter the same
    // segment again.
    for (end = index; end < length; end++) {
      if (this._charIsMappingSeparator(aStr, end)) {
      break;
      }
    }
    str = aStr.slice(index, end);

    segment = cachedSegments[str];
    if (segment) {
      index += str.length;
    } else {
      segment = [];
      while (index < end) {
      base64Vlq.decode(aStr, index, temp);
      value = temp.value;
      index = temp.rest;
      segment.push(value);
      }

      if (segment.length === 2) {
      throw new Error('Found a source, but no line and column');
      }

      if (segment.length === 3) {
      throw new Error('Found a source and line, but no column');
      }

      cachedSegments[str] = segment;
    }

    // Generated column.
    mapping.generatedColumn = previousGeneratedColumn + segment[0];
    previousGeneratedColumn = mapping.generatedColumn;

    if (segment.length > 1) {
      // Original source.
      mapping.source = previousSource + segment[1];
      previousSource += segment[1];

      // Original line.
      mapping.originalLine = previousOriginalLine + segment[2];
      previousOriginalLine = mapping.originalLine;
      // Lines are stored 0-based
      mapping.originalLine += 1;

      // Original column.
      mapping.originalColumn = previousOriginalColumn + segment[3];
      previousOriginalColumn = mapping.originalColumn;

      if (segment.length > 4) {
      // Original name.
      mapping.name = previousName + segment[4];
      previousName += segment[4];
      }
    }

    generatedMappings.push(mapping);
    if (typeof mapping.originalLine === 'number') {
      originalMappings.push(mapping);
    }
    }
  }

  quickSort(generatedMappings, util$1.compareByGeneratedPositionsDeflated);
  this.__generatedMappings = generatedMappings;

  quickSort(originalMappings, util$1.compareByOriginalPositions);
  this.__originalMappings = originalMappings;
  };

/**
 * Find the mapping that best matches the hypothetical "needle" mapping that
 * we are searching for in the given "haystack" of mappings.
 */
BasicSourceMapConsumer.prototype._findMapping =
  function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
                     aColumnName, aComparator, aBias) {
  // To return the position we are searching for, we must first find the
  // mapping for the given position and then return the opposite position it
  // points to. Because the mappings are sorted, we can use binary search to
  // find the best mapping.

  if (aNeedle[aLineName] <= 0) {
    throw new TypeError('Line must be greater than or equal to 1, got '
              + aNeedle[aLineName]);
  }
  if (aNeedle[aColumnName] < 0) {
    throw new TypeError('Column must be greater than or equal to 0, got '
              + aNeedle[aColumnName]);
  }

  return binarySearch$1.search(aNeedle, aMappings, aComparator, aBias);
  };

/**
 * Compute the last column for each generated mapping. The last column is
 * inclusive.
 */
BasicSourceMapConsumer.prototype.computeColumnSpans =
  function SourceMapConsumer_computeColumnSpans() {
  for (var index = 0; index < this._generatedMappings.length; ++index) {
    var mapping = this._generatedMappings[index];

    // Mappings do not contain a field for the last generated columnt. We
    // can come up with an optimistic estimate, however, by assuming that
    // mappings are contiguous (i.e. given two consecutive mappings, the
    // first mapping ends where the second one starts).
    if (index + 1 < this._generatedMappings.length) {
    var nextMapping = this._generatedMappings[index + 1];

    if (mapping.generatedLine === nextMapping.generatedLine) {
      mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
      continue;
    }
    }

    // The last mapping for each line spans the entire line.
    mapping.lastGeneratedColumn = Infinity;
  }
  };

/**
 * Returns the original source, line, and column information for the generated
 * source's line and column positions provided. The only argument is an object
 * with the following properties:
 *
 *   - line: The line number in the generated source.  The line number
 *   is 1-based.
 *   - column: The column number in the generated source.  The column
 *   number is 0-based.
 *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
 *   'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
 *   closest element that is smaller than or greater than the one we are
 *   searching for, respectively, if the exact element cannot be found.
 *   Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
 *
 * and an object is returned with the following properties:
 *
 *   - source: The original source file, or null.
 *   - line: The line number in the original source, or null.  The
 *   line number is 1-based.
 *   - column: The column number in the original source, or null.  The
 *   column number is 0-based.
 *   - name: The original identifier, or null.
 */
BasicSourceMapConsumer.prototype.originalPositionFor =
  function SourceMapConsumer_originalPositionFor(aArgs) {
  var needle = {
    generatedLine: util$1.getArg(aArgs, 'line'),
    generatedColumn: util$1.getArg(aArgs, 'column')
  };

  var index = this._findMapping(
    needle,
    this._generatedMappings,
    "generatedLine",
    "generatedColumn",
    util$1.compareByGeneratedPositionsDeflated,
    util$1.getArg(aArgs, 'bias', SourceMapConsumer$3.GREATEST_LOWER_BOUND)
  );

  if (index >= 0) {
    var mapping = this._generatedMappings[index];

    if (mapping.generatedLine === needle.generatedLine) {
    var source = util$1.getArg(mapping, 'source', null);
    if (source !== null) {
      source = this._sources.at(source);
      source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
    }
    var name = util$1.getArg(mapping, 'name', null);
    if (name !== null) {
      name = this._names.at(name);
    }
    return {
      source: source,
      line: util$1.getArg(mapping, 'originalLine', null),
      column: util$1.getArg(mapping, 'originalColumn', null),
      name: name
    };
    }
  }

  return {
    source: null,
    line: null,
    column: null,
    name: null
  };
  };

/**
 * Return true if we have the source content for every source in the source
 * map, false otherwise.
 */
BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  function BasicSourceMapConsumer_hasContentsOfAllSources() {
  if (!this.sourcesContent) {
    return false;
  }
  return this.sourcesContent.length >= this._sources.size() &&
    !this.sourcesContent.some(function (sc) { return sc == null; });
  };

/**
 * Returns the original source content. The only argument is the url of the
 * original source file. Returns null if no original source content is
 * available.
 */
BasicSourceMapConsumer.prototype.sourceContentFor =
  function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  if (!this.sourcesContent) {
    return null;
  }

  var index = this._findSourceIndex(aSource);
  if (index >= 0) {
    return this.sourcesContent[index];
  }

  var relativeSource = aSource;
  if (this.sourceRoot != null) {
    relativeSource = util$1.relative(this.sourceRoot, relativeSource);
  }

  var url;
  if (this.sourceRoot != null
    && (url = util$1.urlParse(this.sourceRoot))) {
    // XXX: file:// URIs and absolute paths lead to unexpected behavior for
    // many users. We can help them out when they expect file:// URIs to
    // behave like it would if they were running a local HTTP server. See
    // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
    var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
    if (url.scheme == "file"
      && this._sources.has(fileUriAbsPath)) {
    return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
    }

    if ((!url.path || url.path == "/")
      && this._sources.has("/" + relativeSource)) {
    return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
    }
  }

  // This function is used recursively from
  // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  // don't want to throw if we can't find the source - we just want to
  // return null, so we provide a flag to exit gracefully.
  if (nullOnMissing) {
    return null;
  }
  else {
    throw new Error('"' + relativeSource + '" is not in the SourceMap.');
  }
  };

/**
 * Returns the generated line and column information for the original source,
 * line, and column positions provided. The only argument is an object with
 * the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number
 *   is 1-based.
 *   - column: The column number in the original source.  The column
 *   number is 0-based.
 *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
 *   'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
 *   closest element that is smaller than or greater than the one we are
 *   searching for, respectively, if the exact element cannot be found.
 *   Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
 *
 * and an object is returned with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *   line number is 1-based.
 *   - column: The column number in the generated source, or null.
 *   The column number is 0-based.
 */
BasicSourceMapConsumer.prototype.generatedPositionFor =
  function SourceMapConsumer_generatedPositionFor(aArgs) {
  var source = util$1.getArg(aArgs, 'source');
  source = this._findSourceIndex(source);
  if (source < 0) {
    return {
    line: null,
    column: null,
    lastColumn: null
    };
  }

  var needle = {
    source: source,
    originalLine: util$1.getArg(aArgs, 'line'),
    originalColumn: util$1.getArg(aArgs, 'column')
  };

  var index = this._findMapping(
    needle,
    this._originalMappings,
    "originalLine",
    "originalColumn",
    util$1.compareByOriginalPositions,
    util$1.getArg(aArgs, 'bias', SourceMapConsumer$3.GREATEST_LOWER_BOUND)
  );

  if (index >= 0) {
    var mapping = this._originalMappings[index];

    if (mapping.source === needle.source) {
    return {
      line: util$1.getArg(mapping, 'generatedLine', null),
      column: util$1.getArg(mapping, 'generatedColumn', null),
      lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
    };
    }
  }

  return {
    line: null,
    column: null,
    lastColumn: null
  };
  };

var BasicSourceMapConsumer_1 = BasicSourceMapConsumer;

/**
 * An IndexedSourceMapConsumer instance represents a parsed source map which
 * we can query for information. It differs from BasicSourceMapConsumer in
 * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
 * input.
 *
 * The first parameter is a raw source map (either as a JSON string, or already
 * parsed to an object). According to the spec for indexed source maps, they
 * have the following attributes:
 *
 *   - version: Which version of the source map spec this map is following.
 *   - file: Optional. The generated file this source map is associated with.
 *   - sections: A list of section definitions.
 *
 * Each value under the "sections" field has two fields:
 *   - offset: The offset into the original specified at which this section
 *     begins to apply, defined as an object with a "line" and "column"
 *     field.
 *   - map: A source map definition. This source map could also be indexed,
 *     but doesn't have to be.
 *
 * Instead of the "map" field, it's also possible to have a "url" field
 * specifying a URL to retrieve a source map from, but that's currently
 * unsupported.
 *
 * Here's an example source map, taken from the source map spec[0], but
 * modified to omit a section which uses the "url" field.
 *
 *  {
 *  version : 3,
 *  file: "app.js",
 *  sections: [{
 *    offset: {line:100, column:10},
 *    map: {
 *    version : 3,
 *    file: "section.js",
 *    sources: ["foo.js", "bar.js"],
 *    names: ["src", "maps", "are", "fun"],
 *    mappings: "AAAA,E;;ABCDE;"
 *    }
 *  }],
 *  }
 *
 * The second parameter, if given, is a string whose value is the URL
 * at which the source map was found.  This URL is used to compute the
 * sources array.
 *
 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
 */
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
  sourceMap = util$1.parseSourceMapInput(aSourceMap);
  }

  var version = util$1.getArg(sourceMap, 'version');
  var sections = util$1.getArg(sourceMap, 'sections');

  if (version != this._version) {
  throw new Error('Unsupported version: ' + version);
  }

  this._sources = new ArraySet();
  this._names = new ArraySet();

  var lastOffset = {
  line: -1,
  column: 0
  };
  this._sections = sections.map(function (s) {
  if (s.url) {
    // The url field will require support for asynchronicity.
    // See https://github.com/mozilla/source-map/issues/16
    throw new Error('Support for url field in sections not implemented.');
  }
  var offset = util$1.getArg(s, 'offset');
  var offsetLine = util$1.getArg(offset, 'line');
  var offsetColumn = util$1.getArg(offset, 'column');

  if (offsetLine < lastOffset.line ||
    (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
    throw new Error('Section offsets must be ordered and non-overlapping.');
  }
  lastOffset = offset;

  return {
    generatedOffset: {
    // The offset fields are 0-based, but we use 1-based indices when
    // encoding/decoding from VLQ.
    generatedLine: offsetLine + 1,
    generatedColumn: offsetColumn + 1
    },
    consumer: new SourceMapConsumer$3(util$1.getArg(s, 'map'), aSourceMapURL)
  }
  });
}

IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$3.prototype);
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$3;

/**
 * The version of the source mapping spec that we are consuming.
 */
IndexedSourceMapConsumer.prototype._version = 3;

/**
 * The list of original sources.
 */
Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  get: function () {
  var sources = [];
  for (var i = 0; i < this._sections.length; i++) {
    for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
    sources.push(this._sections[i].consumer.sources[j]);
    }
  }
  return sources;
  }
});

/**
 * Returns the original source, line, and column information for the generated
 * source's line and column positions provided. The only argument is an object
 * with the following properties:
 *
 *   - line: The line number in the generated source.  The line number
 *   is 1-based.
 *   - column: The column number in the generated source.  The column
 *   number is 0-based.
 *
 * and an object is returned with the following properties:
 *
 *   - source: The original source file, or null.
 *   - line: The line number in the original source, or null.  The
 *   line number is 1-based.
 *   - column: The column number in the original source, or null.  The
 *   column number is 0-based.
 *   - name: The original identifier, or null.
 */
IndexedSourceMapConsumer.prototype.originalPositionFor =
  function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  var needle = {
    generatedLine: util$1.getArg(aArgs, 'line'),
    generatedColumn: util$1.getArg(aArgs, 'column')
  };

  // Find the section containing the generated position we're trying to map
  // to an original position.
  var sectionIndex = binarySearch$1.search(needle, this._sections,
    function(needle, section) {
    var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
    if (cmp) {
      return cmp;
    }

    return (needle.generatedColumn -
        section.generatedOffset.generatedColumn);
    });
  var section = this._sections[sectionIndex];

  if (!section) {
    return {
    source: null,
    line: null,
    column: null,
    name: null
    };
  }

  return section.consumer.originalPositionFor({
    line: needle.generatedLine -
    (section.generatedOffset.generatedLine - 1),
    column: needle.generatedColumn -
    (section.generatedOffset.generatedLine === needle.generatedLine
     ? section.generatedOffset.generatedColumn - 1
     : 0),
    bias: aArgs.bias
  });
  };

/**
 * Return true if we have the source content for every source in the source
 * map, false otherwise.
 */
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  return this._sections.every(function (s) {
    return s.consumer.hasContentsOfAllSources();
  });
  };

/**
 * Returns the original source content. The only argument is the url of the
 * original source file. Returns null if no original source content is
 * available.
 */
IndexedSourceMapConsumer.prototype.sourceContentFor =
  function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  for (var i = 0; i < this._sections.length; i++) {
    var section = this._sections[i];

    var content = section.consumer.sourceContentFor(aSource, true);
    if (content) {
    return content;
    }
  }
  if (nullOnMissing) {
    return null;
  }
  else {
    throw new Error('"' + aSource + '" is not in the SourceMap.');
  }
  };

/**
 * Returns the generated line and column information for the original source,
 * line, and column positions provided. The only argument is an object with
 * the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number
 *   is 1-based.
 *   - column: The column number in the original source.  The column
 *   number is 0-based.
 *
 * and an object is returned with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *   line number is 1-based.
 *   - column: The column number in the generated source, or null.
 *   The column number is 0-based.
 */
IndexedSourceMapConsumer.prototype.generatedPositionFor =
  function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  for (var i = 0; i < this._sections.length; i++) {
    var section = this._sections[i];

    // Only consider this section if the requested source is in the list of
    // sources of the consumer.
    if (section.consumer._findSourceIndex(util$1.getArg(aArgs, 'source')) === -1) {
    continue;
    }
    var generatedPosition = section.consumer.generatedPositionFor(aArgs);
    if (generatedPosition) {
    var ret = {
      line: generatedPosition.line +
      (section.generatedOffset.generatedLine - 1),
      column: generatedPosition.column +
      (section.generatedOffset.generatedLine === generatedPosition.line
       ? section.generatedOffset.generatedColumn - 1
       : 0)
    };
    return ret;
    }
  }

  return {
    line: null,
    column: null
  };
  };

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */
IndexedSourceMapConsumer.prototype._parseMappings =
  function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  this.__generatedMappings = [];
  this.__originalMappings = [];
  for (var i = 0; i < this._sections.length; i++) {
    var section = this._sections[i];
    var sectionMappings = section.consumer._generatedMappings;
    for (var j = 0; j < sectionMappings.length; j++) {
    var mapping = sectionMappings[j];

    var source = section.consumer._sources.at(mapping.source);
    source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
    this._sources.add(source);
    source = this._sources.indexOf(source);

    var name = null;
    if (mapping.name) {
      name = section.consumer._names.at(mapping.name);
      this._names.add(name);
      name = this._names.indexOf(name);
    }

    // The mappings coming from the consumer for the section have
    // generated positions relative to the start of the section, so we
    // need to offset them to be relative to the start of the concatenated
    // generated file.
    var adjustedMapping = {
      source: source,
      generatedLine: mapping.generatedLine +
      (section.generatedOffset.generatedLine - 1),
      generatedColumn: mapping.generatedColumn +
      (section.generatedOffset.generatedLine === mapping.generatedLine
      ? section.generatedOffset.generatedColumn - 1
      : 0),
      originalLine: mapping.originalLine,
      originalColumn: mapping.originalColumn,
      name: name
    };

    this.__generatedMappings.push(adjustedMapping);
    if (typeof adjustedMapping.originalLine === 'number') {
      this.__originalMappings.push(adjustedMapping);
    }
    }
  }

  quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
  quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
  };

var IndexedSourceMapConsumer_1 = IndexedSourceMapConsumer;

var sourceMapConsumer = {
	SourceMapConsumer: SourceMapConsumer_1,
	BasicSourceMapConsumer: BasicSourceMapConsumer_1,
	IndexedSourceMapConsumer: IndexedSourceMapConsumer_1
};

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var SourceMapGenerator$3 = sourceMapGenerator.SourceMapGenerator;


// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
var REGEX_NEWLINE = /(\r?\n)/;

// Newline character code for charCodeAt() comparisons
var NEWLINE_CODE = 10;

// Private symbol for identifying `SourceNode`s when multiple versions of
// the source-map library are loaded. This MUST NOT CHANGE across
// versions!
var isSourceNode = "$$$isSourceNode$$$";

/**
 * SourceNodes provide a way to abstract over interpolating/concatenating
 * snippets of generated JavaScript source code while maintaining the line and
 * column information associated with the original source code.
 *
 * @param aLine The original line number.
 * @param aColumn The original column number.
 * @param aSource The original source's filename.
 * @param aChunks Optional. An array of strings which are snippets of
 *    generated JS, or other SourceNodes.
 * @param aName The original identifier.
 */
function SourceNode$1(aLine, aColumn, aSource, aChunks, aName) {
  this.children = [];
  this.sourceContents = {};
  this.line = aLine == null ? null : aLine;
  this.column = aColumn == null ? null : aColumn;
  this.source = aSource == null ? null : aSource;
  this.name = aName == null ? null : aName;
  this[isSourceNode] = true;
  if (aChunks != null) this.add(aChunks);
}

/**
 * Creates a SourceNode from generated code and a SourceMapConsumer.
 *
 * @param aGeneratedCode The generated code
 * @param aSourceMapConsumer The SourceMap for the generated code
 * @param aRelativePath Optional. The path that relative sources in the
 *    SourceMapConsumer should be relative to.
 */
SourceNode$1.fromStringWithSourceMap =
  function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  // The SourceNode we want to fill with the generated code
  // and the SourceMap
  var node = new SourceNode$1();

  // All even indices of this array are one line of the generated code,
  // while all odd indices are the newlines between two adjacent lines
  // (since `REGEX_NEWLINE` captures its match).
  // Processed fragments are accessed by calling `shiftNextLine`.
  var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  var remainingLinesIndex = 0;
  var shiftNextLine = function() {
    var lineContents = getNextLine();
    // The last line of a file might not have a newline.
    var newLine = getNextLine() || "";
    return lineContents + newLine;

    function getNextLine() {
    return remainingLinesIndex < remainingLines.length ?
      remainingLines[remainingLinesIndex++] : undefined;
    }
  };

  // We need to remember the position of "remainingLines"
  var lastGeneratedLine = 1, lastGeneratedColumn = 0;

  // The generate SourceNodes we need a code range.
  // To extract it current and last mapping is used.
  // Here we store the last mapping.
  var lastMapping = null;

  aSourceMapConsumer.eachMapping(function (mapping) {
    if (lastMapping !== null) {
    // We add the code from "lastMapping" to "mapping":
    // First check if there is a new line in between.
    if (lastGeneratedLine < mapping.generatedLine) {
      // Associate first line with "lastMapping"
      addMappingWithCode(lastMapping, shiftNextLine());
      lastGeneratedLine++;
      lastGeneratedColumn = 0;
      // The remaining code is added without mapping
    } else {
      // There is no new line in between.
      // Associate the code between "lastGeneratedColumn" and
      // "mapping.generatedColumn" with "lastMapping"
      var nextLine = remainingLines[remainingLinesIndex] || '';
      var code = nextLine.substr(0, mapping.generatedColumn -
                    lastGeneratedColumn);
      remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
                        lastGeneratedColumn);
      lastGeneratedColumn = mapping.generatedColumn;
      addMappingWithCode(lastMapping, code);
      // No more remaining code, continue
      lastMapping = mapping;
      return;
    }
    }
    // We add the generated code until the first mapping
    // to the SourceNode without any mapping.
    // Each line is added as separate string.
    while (lastGeneratedLine < mapping.generatedLine) {
    node.add(shiftNextLine());
    lastGeneratedLine++;
    }
    if (lastGeneratedColumn < mapping.generatedColumn) {
    var nextLine = remainingLines[remainingLinesIndex] || '';
    node.add(nextLine.substr(0, mapping.generatedColumn));
    remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
    lastGeneratedColumn = mapping.generatedColumn;
    }
    lastMapping = mapping;
  }, this);
  // We have processed all mappings.
  if (remainingLinesIndex < remainingLines.length) {
    if (lastMapping) {
    // Associate the remaining code in the current line with "lastMapping"
    addMappingWithCode(lastMapping, shiftNextLine());
    }
    // and add the remaining lines without any mapping
    node.add(remainingLines.splice(remainingLinesIndex).join(""));
  }

  // Copy sourcesContent into SourceNode
  aSourceMapConsumer.sources.forEach(function (sourceFile) {
    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
    if (content != null) {
    if (aRelativePath != null) {
      sourceFile = util$1.join(aRelativePath, sourceFile);
    }
    node.setSourceContent(sourceFile, content);
    }
  });

  return node;

  function addMappingWithCode(mapping, code) {
    if (mapping === null || mapping.source === undefined) {
    node.add(code);
    } else {
    var source = aRelativePath
      ? util$1.join(aRelativePath, mapping.source)
      : mapping.source;
    node.add(new SourceNode$1(mapping.originalLine,
                mapping.originalColumn,
                source,
                code,
                mapping.name));
    }
  }
  };

/**
 * Add a chunk of generated JS to this source node.
 *
 * @param aChunk A string snippet of generated JS code, another instance of
 *    SourceNode, or an array where each member is one of those things.
 */
SourceNode$1.prototype.add = function SourceNode_add(aChunk) {
  if (Array.isArray(aChunk)) {
  aChunk.forEach(function (chunk) {
    this.add(chunk);
  }, this);
  }
  else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  if (aChunk) {
    this.children.push(aChunk);
  }
  }
  else {
  throw new TypeError(
    "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  );
  }
  return this;
};

/**
 * Add a chunk of generated JS to the beginning of this source node.
 *
 * @param aChunk A string snippet of generated JS code, another instance of
 *    SourceNode, or an array where each member is one of those things.
 */
SourceNode$1.prototype.prepend = function SourceNode_prepend(aChunk) {
  if (Array.isArray(aChunk)) {
  for (var i = aChunk.length-1; i >= 0; i--) {
    this.prepend(aChunk[i]);
  }
  }
  else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  this.children.unshift(aChunk);
  }
  else {
  throw new TypeError(
    "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  );
  }
  return this;
};

/**
 * Walk over the tree of JS snippets in this node and its children. The
 * walking function is called once for each snippet of JS and is passed that
 * snippet and the its original associated source's line/column location.
 *
 * @param aFn The traversal function.
 */
SourceNode$1.prototype.walk = function SourceNode_walk(aFn) {
  var chunk;
  for (var i = 0, len = this.children.length; i < len; i++) {
  chunk = this.children[i];
  if (chunk[isSourceNode]) {
    chunk.walk(aFn);
  }
  else {
    if (chunk !== '') {
    aFn(chunk, { source: this.source,
           line: this.line,
           column: this.column,
           name: this.name });
    }
  }
  }
};

/**
 * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
 * each of `this.children`.
 *
 * @param aSep The separator.
 */
SourceNode$1.prototype.join = function SourceNode_join(aSep) {
  var newChildren;
  var i;
  var len = this.children.length;
  if (len > 0) {
  newChildren = [];
  for (i = 0; i < len-1; i++) {
    newChildren.push(this.children[i]);
    newChildren.push(aSep);
  }
  newChildren.push(this.children[i]);
  this.children = newChildren;
  }
  return this;
};

/**
 * Call String.prototype.replace on the very right-most source snippet. Useful
 * for trimming whitespace from the end of a source node, etc.
 *
 * @param aPattern The pattern to replace.
 * @param aReplacement The thing to replace the pattern with.
 */
SourceNode$1.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  var lastChild = this.children[this.children.length - 1];
  if (lastChild[isSourceNode]) {
  lastChild.replaceRight(aPattern, aReplacement);
  }
  else if (typeof lastChild === 'string') {
  this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  }
  else {
  this.children.push(''.replace(aPattern, aReplacement));
  }
  return this;
};

/**
 * Set the source content for a source file. This will be added to the SourceMapGenerator
 * in the sourcesContent field.
 *
 * @param aSourceFile The filename of the source file
 * @param aSourceContent The content of the source file
 */
SourceNode$1.prototype.setSourceContent =
  function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  this.sourceContents[util$1.toSetString(aSourceFile)] = aSourceContent;
  };

/**
 * Walk over the tree of SourceNodes. The walking function is called for each
 * source file content and is passed the filename and source content.
 *
 * @param aFn The traversal function.
 */
SourceNode$1.prototype.walkSourceContents =
  function SourceNode_walkSourceContents(aFn) {
  for (var i = 0, len = this.children.length; i < len; i++) {
    if (this.children[i][isSourceNode]) {
    this.children[i].walkSourceContents(aFn);
    }
  }

  var sources = Object.keys(this.sourceContents);
  for (var i = 0, len = sources.length; i < len; i++) {
    aFn(util$1.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  }
  };

/**
 * Return the string representation of this source node. Walks over the tree
 * and concatenates all the various snippets together to one string.
 */
SourceNode$1.prototype.toString = function SourceNode_toString() {
  var str = "";
  this.walk(function (chunk) {
  str += chunk;
  });
  return str;
};

/**
 * Returns the string representation of this source node along with a source
 * map.
 */
SourceNode$1.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  var generated = {
  code: "",
  line: 1,
  column: 0
  };
  var map = new SourceMapGenerator$3(aArgs);
  var sourceMappingActive = false;
  var lastOriginalSource = null;
  var lastOriginalLine = null;
  var lastOriginalColumn = null;
  var lastOriginalName = null;
  this.walk(function (chunk, original) {
  generated.code += chunk;
  if (original.source !== null
    && original.line !== null
    && original.column !== null) {
    if(lastOriginalSource !== original.source
     || lastOriginalLine !== original.line
     || lastOriginalColumn !== original.column
     || lastOriginalName !== original.name) {
    map.addMapping({
      source: original.source,
      original: {
      line: original.line,
      column: original.column
      },
      generated: {
      line: generated.line,
      column: generated.column
      },
      name: original.name
    });
    }
    lastOriginalSource = original.source;
    lastOriginalLine = original.line;
    lastOriginalColumn = original.column;
    lastOriginalName = original.name;
    sourceMappingActive = true;
  } else if (sourceMappingActive) {
    map.addMapping({
    generated: {
      line: generated.line,
      column: generated.column
    }
    });
    lastOriginalSource = null;
    sourceMappingActive = false;
  }
  for (var idx = 0, length = chunk.length; idx < length; idx++) {
    if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
    generated.line++;
    generated.column = 0;
    // Mappings end at eol
    if (idx + 1 === length) {
      lastOriginalSource = null;
      sourceMappingActive = false;
    } else if (sourceMappingActive) {
      map.addMapping({
      source: original.source,
      original: {
        line: original.line,
        column: original.column
      },
      generated: {
        line: generated.line,
        column: generated.column
      },
      name: original.name
      });
    }
    } else {
    generated.column++;
    }
  }
  });
  this.walkSourceContents(function (sourceFile, sourceContent) {
  map.setSourceContent(sourceFile, sourceContent);
  });

  return { code: generated.code, map: map };
};

var SourceNode_1 = SourceNode$1;

var sourceNode = {
	SourceNode: SourceNode_1
};

/*
 * Copyright 2009-2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE.txt or:
 * http://opensource.org/licenses/BSD-3-Clause
 */
var SourceMapGenerator$2 = sourceMapGenerator.SourceMapGenerator;
var SourceMapConsumer$2 = sourceMapConsumer.SourceMapConsumer;
var SourceNode = sourceNode.SourceNode;

var sourceMap = {
	SourceMapGenerator: SourceMapGenerator$2,
	SourceMapConsumer: SourceMapConsumer$2,
	SourceNode: SourceNode
};

var SourceMapConsumer$1 = sourceMap.SourceMapConsumer;
var SourceMapGenerator$1 = sourceMap.SourceMapGenerator;

var mergeSourceMap = merge;

/**
 * Merge old source map and new source map and return merged.
 * If old or new source map value is falsy, return another one as it is.
 *
 * @param {object|string} [oldMap] old source map object
 * @param {object|string} [newmap] new source map object
 * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined
 */
function merge(oldMap, newMap) {
  if (!oldMap) return newMap
  if (!newMap) return oldMap

  var oldMapConsumer = new SourceMapConsumer$1(oldMap);
  var newMapConsumer = new SourceMapConsumer$1(newMap);
  var mergedMapGenerator = new SourceMapGenerator$1();

  // iterate on new map and overwrite original position of new map with one of old map
  newMapConsumer.eachMapping(function(m) {
  // pass when `originalLine` is null.
  // It occurs in case that the node does not have origin in original code.
  if (m.originalLine == null) return

  var origPosInOldMap = oldMapConsumer.originalPositionFor({
    line: m.originalLine,
    column: m.originalColumn
  });

  if (origPosInOldMap.source == null) return

  mergedMapGenerator.addMapping({
    original: {
    line: origPosInOldMap.line,
    column: origPosInOldMap.column
    },
    generated: {
    line: m.generatedLine,
    column: m.generatedColumn
    },
    source: origPosInOldMap.source,
    name: origPosInOldMap.name
  });
  });

  var consumers = [oldMapConsumer, newMapConsumer];
  consumers.forEach(function(consumer) {
  consumer.sources.forEach(function(sourceFile) {
    mergedMapGenerator._sources.add(sourceFile);
    var sourceContent = consumer.sourceContentFor(sourceFile);
    if (sourceContent != null) {
    mergedMapGenerator.setSourceContent(sourceFile, sourceContent);
    }
  });
  });

  mergedMapGenerator._sourceRoot = oldMap.sourceRoot;
  mergedMapGenerator._file = oldMap.file;

  return JSON.parse(mergedMapGenerator.toString())
}

const comma$1 = ','.charCodeAt(0);
const semicolon$1 = ';'.charCodeAt(0);
const chars$4 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const intToChar$1 = new Uint8Array(64); // 64 possible chars.
const charToInteger$1 = new Uint8Array(128); // z is 122 in ASCII
for (let i = 0; i < chars$4.length; i++) {
  const c = chars$4.charCodeAt(i);
  charToInteger$1[c] = i;
  intToChar$1[i] = c;
}
// Provide a fallback for older environments.
const td$1 = typeof TextDecoder !== 'undefined'
  ? new TextDecoder()
  : typeof Buffer !== 'undefined'
    ? {
      decode(buf) {
        const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
        return out.toString();
      },
    }
    : {
      decode(buf) {
        let out = '';
        for (let i = 0; i < buf.length; i++) {
          out += String.fromCharCode(buf[i]);
        }
        return out;
      },
    };
function decode$1(mappings) {
  const state = new Int32Array(5);
  const decoded = [];
  let line = [];
  let sorted = true;
  let lastCol = 0;
  for (let i = 0; i < mappings.length;) {
    const c = mappings.charCodeAt(i);
    if (c === comma$1) {
      i++;
    }
    else if (c === semicolon$1) {
      state[0] = lastCol = 0;
      if (!sorted)
        sort(line);
      sorted = true;
      decoded.push(line);
      line = [];
      i++;
    }
    else {
      i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn
      const col = state[0];
      if (col < lastCol)
        sorted = false;
      lastCol = col;
      if (!hasMoreSegments(mappings, i)) {
        line.push([col]);
        continue;
      }
      i = decodeInteger(mappings, i, state, 1); // sourceFileIndex
      i = decodeInteger(mappings, i, state, 2); // sourceCodeLine
      i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn
      if (!hasMoreSegments(mappings, i)) {
        line.push([col, state[1], state[2], state[3]]);
        continue;
      }
      i = decodeInteger(mappings, i, state, 4); // nameIndex
      line.push([col, state[1], state[2], state[3], state[4]]);
    }
  }
  if (!sorted)
    sort(line);
  decoded.push(line);
  return decoded;
}
function decodeInteger(mappings, pos, state, j) {
  let value = 0;
  let shift = 0;
  let integer = 0;
  do {
    const c = mappings.charCodeAt(pos++);
    integer = charToInteger$1[c];
    value |= (integer & 31) << shift;
    shift += 5;
  } while (integer & 32);
  const shouldNegate = value & 1;
  value >>>= 1;
  if (shouldNegate) {
    value = -0x80000000 | -value;
  }
  state[j] += value;
  return pos;
}
function hasMoreSegments(mappings, i) {
  if (i >= mappings.length)
    return false;
  const c = mappings.charCodeAt(i);
  if (c === comma$1 || c === semicolon$1)
    return false;
  return true;
}
function sort(line) {
  line.sort(sortComparator$1);
}
function sortComparator$1(a, b) {
  return a[0] - b[0];
}
function encode$3(decoded) {
  const state = new Int32Array(5);
  let buf = new Uint8Array(1024);
  let pos = 0;
  for (let i = 0; i < decoded.length; i++) {
    const line = decoded[i];
    if (i > 0) {
      buf = reserve(buf, pos, 1);
      buf[pos++] = semicolon$1;
    }
    if (line.length === 0)
      continue;
    state[0] = 0;
    for (let j = 0; j < line.length; j++) {
      const segment = line[j];
      // We can push up to 5 ints, each int can take at most 7 chars, and we
      // may push a comma.
      buf = reserve(buf, pos, 36);
      if (j > 0)
        buf[pos++] = comma$1;
      pos = encodeInteger$3(buf, pos, state, segment, 0); // generatedCodeColumn
      if (segment.length === 1)
        continue;
      pos = encodeInteger$3(buf, pos, state, segment, 1); // sourceFileIndex
      pos = encodeInteger$3(buf, pos, state, segment, 2); // sourceCodeLine
      pos = encodeInteger$3(buf, pos, state, segment, 3); // sourceCodeColumn
      if (segment.length === 4)
        continue;
      pos = encodeInteger$3(buf, pos, state, segment, 4); // nameIndex
    }
  }
  return td$1.decode(buf.subarray(0, pos));
}
function reserve(buf, pos, count) {
  if (buf.length > pos + count)
    return buf;
  const swap = new Uint8Array(buf.length * 2);
  swap.set(buf);
  return swap;
}
function encodeInteger$3(buf, pos, state, segment, j) {
  const next = segment[j];
  let num = next - state[j];
  state[j] = next;
  num = num < 0 ? (-num << 1) | 1 : num << 1;
  do {
    let clamped = num & 0b011111;
    num >>>= 5;
    if (num > 0)
      clamped |= 0b100000;
    buf[pos++] = intToChar$1[clamped];
  } while (num > 0);
  return pos;
}

// Matches the scheme of a URL, eg "http://"
const schemeRegex = /^[\w+.-]+:\/\//;
/**
 * Matches the parts of a URL:
 * 1. Scheme, including ":", guaranteed.
 * 2. User/password, including "@", optional.
 * 3. Host, guaranteed.
 * 4. Port, including ":", optional.
 * 5. Path, including "/", optional.
 */
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/;
/**
 * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
 * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
 *
 * 1. Host, optional.
 * 2. Path, which may inclue "/", guaranteed.
 */
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i;
function isAbsoluteUrl(input) {
  return schemeRegex.test(input);
}
function isSchemeRelativeUrl(input) {
  return input.startsWith('//');
}
function isAbsolutePath(input) {
  return input.startsWith('/');
}
function isFileUrl(input) {
  return input.startsWith('file:');
}
function parseAbsoluteUrl(input) {
  const match = urlRegex.exec(input);
  return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/');
}
function parseFileUrl(input) {
  const match = fileRegex.exec(input);
  const path = match[2];
  return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path);
}
function makeUrl(scheme, user, host, port, path) {
  return {
    scheme,
    user,
    host,
    port,
    path,
    relativePath: false,
  };
}
function parseUrl(input) {
  if (isSchemeRelativeUrl(input)) {
    const url = parseAbsoluteUrl('http:' + input);
    url.scheme = '';
    return url;
  }
  if (isAbsolutePath(input)) {
    const url = parseAbsoluteUrl('http://foo.com' + input);
    url.scheme = '';
    url.host = '';
    return url;
  }
  if (isFileUrl(input))
    return parseFileUrl(input);
  if (isAbsoluteUrl(input))
    return parseAbsoluteUrl(input);
  const url = parseAbsoluteUrl('http://foo.com/' + input);
  url.scheme = '';
  url.host = '';
  url.relativePath = true;
  return url;
}
function stripPathFilename(path) {
  // If a path ends with a parent directory "..", then it's a relative path with excess parent
  // paths. It's not a file, so we can't strip it.
  if (path.endsWith('/..'))
    return path;
  const index = path.lastIndexOf('/');
  return path.slice(0, index + 1);
}
function mergePaths(url, base) {
  // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is.
  if (!url.relativePath)
    return;
  normalizePath$1(base);
  // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
  // path).
  if (url.path === '/') {
    url.path = base.path;
  }
  else {
    // Resolution happens relative to the base path's directory, not the file.
    url.path = stripPathFilename(base.path) + url.path;
  }
  // If the base path is absolute, then our path is now absolute too.
  url.relativePath = base.relativePath;
}
/**
 * The path can have empty directories "//", unneeded parents "foo/..", or current directory
 * "foo/.". We need to normalize to a standard representation.
 */
function normalizePath$1(url) {
  const { relativePath } = url;
  const pieces = url.path.split('/');
  // We need to preserve the first piece always, so that we output a leading slash. The item at
  // pieces[0] is an empty string.
  let pointer = 1;
  // Positive is the number of real directories we've output, used for popping a parent directory.
  // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
  let positive = 0;
  // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
  // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
  // real directory, we won't need to append, unless the other conditions happen again.
  let addTrailingSlash = false;
  for (let i = 1; i < pieces.length; i++) {
    const piece = pieces[i];
    // An empty directory, could be a trailing slash, or just a double "//" in the path.
    if (!piece) {
      addTrailingSlash = true;
      continue;
    }
    // If we encounter a real directory, then we don't need to append anymore.
    addTrailingSlash = false;
    // A current directory, which we can always drop.
    if (piece === '.')
      continue;
    // A parent directory, we need to see if there are any real directories we can pop. Else, we
    // have an excess of parents, and we'll need to keep the "..".
    if (piece === '..') {
      if (positive) {
        addTrailingSlash = true;
        positive--;
        pointer--;
      }
      else if (relativePath) {
        // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
        // URL, protocol relative URL, or an absolute path, we don't need to keep excess.
        pieces[pointer++] = piece;
      }
      continue;
    }
    // We've encountered a real directory. Move it to the next insertion pointer, which accounts for
    // any popped or dropped directories.
    pieces[pointer++] = piece;
    positive++;
  }
  let path = '';
  for (let i = 1; i < pointer; i++) {
    path += '/' + pieces[i];
  }
  if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
    path += '/';
  }
  url.path = path;
}
/**
 * Attempts to resolve `input` URL/path relative to `base`.
 */
function resolve$1(input, base) {
  if (!input && !base)
    return '';
  const url = parseUrl(input);
  // If we have a base, and the input isn't already an absolute URL, then we need to merge.
  if (base && !url.scheme) {
    const baseUrl = parseUrl(base);
    url.scheme = baseUrl.scheme;
    // If there's no host, then we were just a path.
    if (!url.host) {
      // The host, user, and port are joined, you can't copy one without the others.
      url.user = baseUrl.user;
      url.host = baseUrl.host;
      url.port = baseUrl.port;
    }
    mergePaths(url, baseUrl);
  }
  normalizePath$1(url);
  // If the input (and base, if there was one) are both relative, then we need to output a relative.
  if (url.relativePath) {
    // The first char is always a "/".
    const path = url.path.slice(1);
    if (!path)
      return '.';
    // If base started with a leading ".", or there is no base and input started with a ".", then we
    // need to ensure that the relative path starts with a ".". We don't know if relative starts
    // with a "..", though, so check before prepending.
    const keepRelative = (base || input).startsWith('.');
    return !keepRelative || path.startsWith('.') ? path : './' + path;
  }
  // If there's no host (and no scheme/user/port), then we need to output an absolute path.
  if (!url.scheme && !url.host)
    return url.path;
  // We're outputting either an absolute URL, or a protocol relative one.
  return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;
}

function resolve(input, base) {
  // The base is always treated as a directory, if it's not empty.
  // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327
  // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401
  if (base && !base.endsWith('/'))
    base += '/';
  return resolve$1(input, base);
}

/**
 * Removes everything after the last "/", but leaves the slash.
 */
function stripFilename(path) {
  if (!path)
    return '';
  const index = path.lastIndexOf('/');
  return path.slice(0, index + 1);
}

const COLUMN$1 = 0;
const SOURCES_INDEX$1 = 1;
const SOURCE_LINE$1 = 2;
const SOURCE_COLUMN$1 = 3;
const NAMES_INDEX$1 = 4;

function maybeSort(mappings, owned) {
  const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
  if (unsortedIndex === mappings.length)
    return mappings;
  // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If
  // not, we do not want to modify the consumer's input array.
  if (!owned)
    mappings = mappings.slice();
  for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
    mappings[i] = sortSegments(mappings[i], owned);
  }
  return mappings;
}
function nextUnsortedSegmentLine(mappings, start) {
  for (let i = start; i < mappings.length; i++) {
    if (!isSorted(mappings[i]))
      return i;
  }
  return mappings.length;
}
function isSorted(line) {
  for (let j = 1; j < line.length; j++) {
    if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) {
      return false;
    }
  }
  return true;
}
function sortSegments(line, owned) {
  if (!owned)
    line = line.slice();
  return line.sort(sortComparator);
}
function sortComparator(a, b) {
  return a[COLUMN$1] - b[COLUMN$1];
}

let found = false;
/**
 * A binary search implementation that returns the index if a match is found.
 * If no match is found, then the left-index (the index associated with the item that comes just
 * before the desired index) is returned. To maintain proper sort order, a splice would happen at
 * the next index:
 *
 * ```js
 * const array = [1, 3];
 * const needle = 2;
 * const index = binarySearch(array, needle, (item, needle) => item - needle);
 *
 * assert.equal(index, 0);
 * array.splice(index + 1, 0, needle);
 * assert.deepEqual(array, [1, 2, 3]);
 * ```
 */
function binarySearch(haystack, needle, low, high) {
  while (low <= high) {
    const mid = low + ((high - low) >> 1);
    const cmp = haystack[mid][COLUMN$1] - needle;
    if (cmp === 0) {
      found = true;
      return mid;
    }
    if (cmp < 0) {
      low = mid + 1;
    }
    else {
      high = mid - 1;
    }
  }
  found = false;
  return low - 1;
}
function upperBound(haystack, needle, index) {
  for (let i = index + 1; i < haystack.length; i++, index++) {
    if (haystack[i][COLUMN$1] !== needle)
      break;
  }
  return index;
}
function lowerBound(haystack, needle, index) {
  for (let i = index - 1; i >= 0; i--, index--) {
    if (haystack[i][COLUMN$1] !== needle)
      break;
  }
  return index;
}
function memoizedState() {
  return {
    lastKey: -1,
    lastNeedle: -1,
    lastIndex: -1,
  };
}
/**
 * This overly complicated beast is just to record the last tested line/column and the resulting
 * index, allowing us to skip a few tests if mappings are monotonically increasing.
 */
function memoizedBinarySearch(haystack, needle, state, key) {
  const { lastKey, lastNeedle, lastIndex } = state;
  let low = 0;
  let high = haystack.length - 1;
  if (key === lastKey) {
    if (needle === lastNeedle) {
      found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
      return lastIndex;
    }
    if (needle >= lastNeedle) {
      // lastIndex may be -1 if the previous needle was not found.
      low = lastIndex === -1 ? 0 : lastIndex;
    }
    else {
      high = lastIndex;
    }
  }
  state.lastKey = key;
  state.lastNeedle = needle;
  return (state.lastIndex = binarySearch(haystack, needle, low, high));
}

const AnyMap = function (map, mapUrl) {
  const parsed = typeof map === 'string' ? JSON.parse(map) : map;
  if (!('sections' in parsed))
    return new TraceMap(parsed, mapUrl);
  const mappings = [];
  const sources = [];
  const sourcesContent = [];
  const names = [];
  const { sections } = parsed;
  let i = 0;
  for (; i < sections.length - 1; i++) {
    const no = sections[i + 1].offset;
    addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column);
  }
  if (sections.length > 0) {
    addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity);
  }
  const joined = {
    version: 3,
    file: parsed.file,
    names,
    sources,
    sourcesContent,
    mappings,
  };
  return presortedDecodedMap(joined);
};
function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) {
  const map = AnyMap(section.map, mapUrl);
  const { line: lineOffset, column: columnOffset } = section.offset;
  const sourcesOffset = sources.length;
  const namesOffset = names.length;
  const decoded = decodedMappings(map);
  const { resolvedSources } = map;
  append(sources, resolvedSources);
  append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length));
  append(names, map.names);
  // If this section jumps forwards several lines, we need to add lines to the output mappings catch up.
  for (let i = mappings.length; i <= lineOffset; i++)
    mappings.push([]);
  // We can only add so many lines before we step into the range that the next section's map
  // controls. When we get to the last line, then we'll start checking the segments to see if
  // they've crossed into the column range.
  const stopI = stopLine - lineOffset;
  const len = Math.min(decoded.length, stopI + 1);
  for (let i = 0; i < len; i++) {
    const line = decoded[i];
    // On the 0th loop, the line will already exist due to a previous section, or the line catch up
    // loop above.
    const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []);
    // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the
    // map can be multiple lines), it doesn't.
    const cOffset = i === 0 ? columnOffset : 0;
    for (let j = 0; j < line.length; j++) {
      const seg = line[j];
      const column = cOffset + seg[COLUMN$1];
      // If this segment steps into the column range that the next section's map controls, we need
      // to stop early.
      if (i === stopI && column >= stopColumn)
        break;
      if (seg.length === 1) {
        out.push([column]);
        continue;
      }
      const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1];
      const sourceLine = seg[SOURCE_LINE$1];
      const sourceColumn = seg[SOURCE_COLUMN$1];
      if (seg.length === 4) {
        out.push([column, sourcesIndex, sourceLine, sourceColumn]);
        continue;
      }
      out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]);
    }
  }
}
function append(arr, other) {
  for (let i = 0; i < other.length; i++)
    arr.push(other[i]);
}
// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of
// equal length to the sources. This is because the sources and sourcesContent are paired arrays,
// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined
// sourcemap would desynchronize the sources/contents.
function fillSourcesContent(len) {
  const sourcesContent = [];
  for (let i = 0; i < len; i++)
    sourcesContent[i] = null;
  return sourcesContent;
}

const INVALID_ORIGINAL_MAPPING = Object.freeze({
  source: null,
  line: null,
  column: null,
  name: null,
});
Object.freeze({
  line: null,
  column: null,
});
const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
const LEAST_UPPER_BOUND = -1;
const GREATEST_LOWER_BOUND = 1;
/**
 * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
 */
let decodedMappings;
/**
 * A higher-level API to find the source/line/column associated with a generated line/column
 * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
 * `source-map` library.
 */
let originalPositionFor;
/**
 * A helper that skips sorting of the input map's mappings array, which can be expensive for larger
 * maps.
 */
let presortedDecodedMap;
class TraceMap {
  constructor(map, mapUrl) {
    this._decodedMemo = memoizedState();
    this._bySources = undefined;
    this._bySourceMemos = undefined;
    const isString = typeof map === 'string';
    if (!isString && map.constructor === TraceMap)
      return map;
    const parsed = (isString ? JSON.parse(map) : map);
    const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
    this.version = version;
    this.file = file;
    this.names = names;
    this.sourceRoot = sourceRoot;
    this.sources = sources;
    this.sourcesContent = sourcesContent;
    if (sourceRoot || mapUrl) {
      const from = resolve(sourceRoot || '', stripFilename(mapUrl));
      this.resolvedSources = sources.map((s) => resolve(s || '', from));
    }
    else {
      this.resolvedSources = sources.map((s) => s || '');
    }
    const { mappings } = parsed;
    if (typeof mappings === 'string') {
      this._encoded = mappings;
      this._decoded = undefined;
    }
    else {
      this._encoded = undefined;
      this._decoded = maybeSort(mappings, isString);
    }
  }
}
(() => {
  decodedMappings = (map) => {
    return (map._decoded || (map._decoded = decode$1(map._encoded)));
  };
  originalPositionFor = (map, { line, column, bias }) => {
    line--;
    if (line < 0)
      throw new Error(LINE_GTR_ZERO);
    if (column < 0)
      throw new Error(COL_GTR_EQ_ZERO);
    const decoded = decodedMappings(map);
    // It's common for parent source maps to have pointers to lines that have no
    // mapping (like a "//# sourceMappingURL=") at the end of the child file.
    if (line >= decoded.length)
      return INVALID_ORIGINAL_MAPPING;
    const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
    if (segment == null)
      return INVALID_ORIGINAL_MAPPING;
    if (segment.length == 1)
      return INVALID_ORIGINAL_MAPPING;
    const { names, resolvedSources } = map;
    return {
      source: resolvedSources[segment[SOURCES_INDEX$1]],
      line: segment[SOURCE_LINE$1] + 1,
      column: segment[SOURCE_COLUMN$1],
      name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null,
    };
  };
  presortedDecodedMap = (map, mapUrl) => {
    const clone = Object.assign({}, map);
    clone.mappings = [];
    const tracer = new TraceMap(clone, mapUrl);
    tracer._decoded = map.mappings;
    return tracer;
  };
})();
function traceSegmentInternal(segments, memo, line, column, bias) {
  let index = memoizedBinarySearch(segments, column, memo, line);
  if (found) {
    index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
  }
  else if (bias === LEAST_UPPER_BOUND)
    index++;
  if (index === -1 || index === segments.length)
    return null;
  return segments[index];
}

/**
 * Gets the index associated with `key` in the backing array, if it is already present.
 */
let get;
/**
 * Puts `key` into the backing array, if it is not already present. Returns
 * the index of the `key` in the backing array.
 */
let put;
/**
 * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
 * index of the `key` in the backing array.
 *
 * This is designed to allow synchronizing a second array with the contents of the backing array,
 * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
 * and there are never duplicates.
 */
class SetArray {
  constructor() {
    this._indexes = { __proto__: null };
    this.array = [];
  }
}
(() => {
  get = (strarr, key) => strarr._indexes[key];
  put = (strarr, key) => {
    // The key may or may not be present. If it is present, it's a number.
    const index = get(strarr, key);
    if (index !== undefined)
      return index;
    const { array, _indexes: indexes } = strarr;
    return (indexes[key] = array.push(key) - 1);
  };
})();

const COLUMN = 0;
const SOURCES_INDEX = 1;
const SOURCE_LINE = 2;
const SOURCE_COLUMN = 3;
const NAMES_INDEX = 4;

const NO_NAME = -1;
/**
 * Same as `addMapping`, but will only add the mapping if it generates useful information in the
 * resulting map. This only works correctly if mappings are added **in order**, meaning you should
 * not add a mapping with a lower generated line/column than one that came before.
 */
let maybeAddMapping;
/**
 * Adds/removes the content of the source file to the source map.
 */
let setSourceContent;
/**
 * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
 * a sourcemap, or to JSON.stringify.
 */
let toDecodedMap;
/**
 * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
 * a sourcemap, or to JSON.stringify.
 */
let toEncodedMap;
// This split declaration is only so that terser can elminiate the static initialization block.
let addSegmentInternal;
/**
 * Provides the state to generate a sourcemap.
 */
class GenMapping {
  constructor({ file, sourceRoot } = {}) {
    this._names = new SetArray();
    this._sources = new SetArray();
    this._sourcesContent = [];
    this._mappings = [];
    this.file = file;
    this.sourceRoot = sourceRoot;
  }
}
(() => {
  maybeAddMapping = (map, mapping) => {
    return addMappingInternal(true, map, mapping);
  };
  setSourceContent = (map, source, content) => {
    const { _sources: sources, _sourcesContent: sourcesContent } = map;
    sourcesContent[put(sources, source)] = content;
  };
  toDecodedMap = (map) => {
    const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
    removeEmptyFinalLines(mappings);
    return {
      version: 3,
      file: file || undefined,
      names: names.array,
      sourceRoot: sourceRoot || undefined,
      sources: sources.array,
      sourcesContent,
      mappings,
    };
  };
  toEncodedMap = (map) => {
    const decoded = toDecodedMap(map);
    return Object.assign(Object.assign({}, decoded), { mappings: encode$3(decoded.mappings) });
  };
  // Internal helpers
  addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {
    const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
    const line = getLine(mappings, genLine);
    const index = getColumnIndex(line, genColumn);
    if (!source) {
      if (skipable && skipSourceless(line, index))
        return;
      return insert(line, index, [genColumn]);
    }
    const sourcesIndex = put(sources, source);
    const namesIndex = name ? put(names, name) : NO_NAME;
    if (sourcesIndex === sourcesContent.length)
      sourcesContent[sourcesIndex] = null;
    if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
      return;
    }
    return insert(line, index, name
      ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
      : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
  };
})();
function getLine(mappings, index) {
  for (let i = mappings.length; i <= index; i++) {
    mappings[i] = [];
  }
  return mappings[index];
}
function getColumnIndex(line, genColumn) {
  let index = line.length;
  for (let i = index - 1; i >= 0; index = i--) {
    const current = line[i];
    if (genColumn >= current[COLUMN])
      break;
  }
  return index;
}
function insert(array, index, value) {
  for (let i = array.length; i > index; i--) {
    array[i] = array[i - 1];
  }
  array[index] = value;
}
function removeEmptyFinalLines(mappings) {
  const { length } = mappings;
  let len = length;
  for (let i = len - 1; i >= 0; len = i, i--) {
    if (mappings[i].length > 0)
      break;
  }
  if (len < length)
    mappings.length = len;
}
function skipSourceless(line, index) {
  // The start of a line is already sourceless, so adding a sourceless segment to the beginning
  // doesn't generate any useful information.
  if (index === 0)
    return true;
  const prev = line[index - 1];
  // If the previous segment is also sourceless, then adding another sourceless segment doesn't
  // genrate any new information. Else, this segment will end the source/named segment and point to
  // a sourceless position, which is useful.
  return prev.length === 1;
}
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
  // A source/named segment at the start of a line gives position at that genColumn
  if (index === 0)
    return false;
  const prev = line[index - 1];
  // If the previous segment is sourceless, then we're transitioning to a source.
  if (prev.length === 1)
    return false;
  // If the previous segment maps to the exact same source position, then this segment doesn't
  // provide any new position information.
  return (sourcesIndex === prev[SOURCES_INDEX] &&
    sourceLine === prev[SOURCE_LINE] &&
    sourceColumn === prev[SOURCE_COLUMN] &&
    namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
}
function addMappingInternal(skipable, map, mapping) {
  const { generated, source, original, name } = mapping;
  if (!source) {
    return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null);
  }
  const s = source;
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name);
}

class SourceMapConsumer {
  constructor(map, mapUrl) {
    const trace = (this._map = new AnyMap(map, mapUrl));
    this.file = trace.file;
    this.names = trace.names;
    this.sourceRoot = trace.sourceRoot;
    this.sources = trace.resolvedSources;
    this.sourcesContent = trace.sourcesContent;
  }
  originalPositionFor(needle) {
    return originalPositionFor(this._map, needle);
  }
  destroy() {
    // noop.
  }
}
class SourceMapGenerator {
  constructor(opts) {
    this._map = new GenMapping(opts);
  }
  addMapping(mapping) {
    maybeAddMapping(this._map, mapping);
  }
  setSourceContent(source, content) {
    setSourceContent(this._map, source, content);
  }
  toJSON() {
    return toEncodedMap(this._map);
  }
  toDecodedMap() {
    return toDecodedMap(this._map);
  }
}

// Terser 5.16.1
function characters(e){return e.split("")}function member(e,t){return t.includes(e)}class DefaultsError extends Error{constructor(e,t){super(),this.name="DefaultsError",this.message=e,this.defs=t;}}function defaults$1(e,t,n){!0===e?e={}:null!=e&&"object"==typeof e&&(e={...e});const i=e||{};if(n)for(const e in i)if(HOP(i,e)&&!HOP(t,e))throw new DefaultsError("`"+e+"` is not a supported option",t);for(const n in t)if(HOP(t,n))if(e&&HOP(e,n))if("ecma"===n){let t=0|e[n];t>5&&t<2015&&(t+=2009),i[n]=t;}else i[n]=e&&HOP(e,n)?e[n]:t[n];else i[n]=t[n];return i}function noop(){}function return_false(){return !1}function return_true(){return !0}function return_this(){return this}function return_null(){return null}var MAP=function(){function e(e,r,a){var s,u=[],l=[];function c(){var c=r(e[s],s),_=c instanceof o;return _&&(c=c.v),c instanceof n?(c=c.v)instanceof i?l.push.apply(l,a?c.v.slice().reverse():c.v):l.push(c):c!==t&&(c instanceof i?u.push.apply(u,a?c.v.slice().reverse():c.v):u.push(c)),_}if(Array.isArray(e))if(a){for(s=e.length;--s>=0&&!c(););u.reverse(),l.reverse();}else for(s=0;s<e.length&&!c();++s);else for(s in e)if(HOP(e,s)&&c())break;return l.concat(u)}e.at_top=function(e){return new n(e)},e.splice=function(e){return new i(e)},e.last=function(e){return new o(e)};var t=e.skip={};function n(e){this.v=e;}function i(e){this.v=e;}function o(e){this.v=e;}return e}();function make_node(e,t,n){return n||(n={}),t&&(n.start||(n.start=t.start),n.end||(n.end=t.end)),new e(n)}function push_uniq(e,t){e.includes(t)||e.push(t);}function string_template(e,t){return e.replace(/{(.+?)}/g,(function(e,n){return t&&t[n]}))}function remove$1(e,t){for(var n=e.length;--n>=0;)e[n]===t&&e.splice(n,1);}function mergeSort(e,t){return e.length<2?e.slice():function e(n){if(n.length<=1)return n;var i=Math.floor(n.length/2),o=n.slice(0,i),r=n.slice(i);return function(e,n){for(var i=[],o=0,r=0,a=0;o<e.length&&r<n.length;)t(e[o],n[r])<=0?i[a++]=e[o++]:i[a++]=n[r++];return o<e.length&&i.push.apply(i,e.slice(o)),r<n.length&&i.push.apply(i,n.slice(r)),i}(o=e(o),r=e(r))}(e)}function makePredicate(e){return Array.isArray(e)||(e=e.split(" ")),new Set(e.sort())}function map_add(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n]);}function map_from_object(e){var t=new Map;for(var n in e)HOP(e,n)&&"$"===n.charAt(0)&&t.set(n.substr(1),e[n]);return t}function map_to_object(e){var t=Object.create(null);return e.forEach((function(e,n){t["$"+n]=e;})),t}function HOP(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function keep_name(e,t){return !0===e||e instanceof RegExp&&e.test(t)}var lineTerminatorEscape={"\0":"0","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function regexp_source_fix(e){return e.replace(/[\0\n\r\u2028\u2029]/g,(function(t,n){return ("\\"!=e[n-1]||"\\"==e[n-2]&&!/(?:^|[^\\])(?:\\{2})*$/.test(e.slice(0,n-1))?"\\":"")+lineTerminatorEscape[t]}))}const re_safe_regexp=/^[\\/|\0\s\w^$.[\]()]*$/,regexp_is_safe=e=>re_safe_regexp.test(e);function sort_regexp_flags(e){const t=new Set(e.split(""));let n="";for(const e of "dgimsuy")t.has(e)&&(n+=e,t.delete(e));return t.size&&t.forEach((e=>{n+=e;})),n}function has_annotation(e,t){return e._annotations&t}function set_annotation(e,t){e._annotations|=t;}var LATEST_RAW="",TEMPLATE_RAWS=new Map,KEYWORDS="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with",KEYWORDS_ATOM="false null true",RESERVED_WORDS="enum import super this "+KEYWORDS_ATOM+" "+KEYWORDS,ALL_RESERVED_WORDS="implements interface package private protected public static "+RESERVED_WORDS,KEYWORDS_BEFORE_EXPRESSION="return new delete throw else case yield await";KEYWORDS=makePredicate(KEYWORDS),RESERVED_WORDS=makePredicate(RESERVED_WORDS),KEYWORDS_BEFORE_EXPRESSION=makePredicate(KEYWORDS_BEFORE_EXPRESSION),KEYWORDS_ATOM=makePredicate(KEYWORDS_ATOM),ALL_RESERVED_WORDS=makePredicate(ALL_RESERVED_WORDS);var OPERATOR_CHARS=makePredicate(characters("+-*&%=<>!?|~^")),RE_NUM_LITERAL=/[0-9a-f]/i,RE_HEX_NUMBER=/^0x[0-9a-f]+$/i,RE_OCT_NUMBER=/^0[0-7]+$/,RE_ES6_OCT_NUMBER=/^0o[0-7]+$/i,RE_BIN_NUMBER=/^0b[01]+$/i,RE_DEC_NUMBER=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,RE_BIG_INT=/^(0[xob])?[0-9a-f]+n$/i,OPERATORS=makePredicate(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]),WHITESPACE_CHARS=makePredicate(characters("  \n\r\t\f\v​           \u2028\u2029  　\ufeff")),NEWLINE_CHARS=makePredicate(characters("\n\r\u2028\u2029")),PUNC_AFTER_EXPRESSION=makePredicate(characters(";]),:")),PUNC_BEFORE_EXPRESSION=makePredicate(characters("[{(,;:")),PUNC_CHARS=makePredicate(characters("[]{}(),;:")),UNICODE={ID_Start:/[$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function get_full_char(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){if(is_surrogate_pair_tail(e.charCodeAt(t+1)))return e.charAt(t)+e.charAt(t+1)}else if(is_surrogate_pair_tail(e.charCodeAt(t))&&is_surrogate_pair_head(e.charCodeAt(t-1)))return e.charAt(t-1)+e.charAt(t);return e.charAt(t)}function get_full_char_code(e,t){return is_surrogate_pair_head(e.charCodeAt(t))?65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320:e.charCodeAt(t)}function get_full_char_length(e){for(var t=0,n=0;n<e.length;n++)is_surrogate_pair_head(e.charCodeAt(n))&&is_surrogate_pair_tail(e.charCodeAt(n+1))&&(t++,n++);return e.length-t}function from_char_code(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function is_surrogate_pair_head(e){return e>=55296&&e<=56319}function is_surrogate_pair_tail(e){return e>=56320&&e<=57343}function is_digit(e){return e>=48&&e<=57}function is_identifier_start(e){return UNICODE.ID_Start.test(e)}function is_identifier_char(e){return UNICODE.ID_Continue.test(e)}const BASIC_IDENT=/^[a-z_$][a-z0-9_$]*$/i;function is_basic_identifier_string(e){return BASIC_IDENT.test(e)}function is_identifier_string(e,t){if(BASIC_IDENT.test(e))return !0;if(!t&&/[\ud800-\udfff]/.test(e))return !1;var n=UNICODE.ID_Start.exec(e);return !(!n||0!==n.index||(e=e.slice(n[0].length))&&(!(n=UNICODE.ID_Continue.exec(e))||n[0].length!==e.length))}function parse_js_number(e,t=!0){if(!t&&e.includes("e"))return NaN;if(RE_HEX_NUMBER.test(e))return parseInt(e.substr(2),16);if(RE_OCT_NUMBER.test(e))return parseInt(e.substr(1),8);if(RE_ES6_OCT_NUMBER.test(e))return parseInt(e.substr(2),8);if(RE_BIN_NUMBER.test(e))return parseInt(e.substr(2),2);if(RE_DEC_NUMBER.test(e))return parseFloat(e);var n=parseFloat(e);return n==e?n:void 0}class JS_Parse_Error extends Error{constructor(e,t,n,i,o){super(),this.name="SyntaxError",this.message=e,this.filename=t,this.line=n,this.col=i,this.pos=o;}}function js_error(e,t,n,i,o){throw new JS_Parse_Error(e,t,n,i,o)}function is_token(e,t,n){return e.type==t&&(null==n||e.value==n)}var EX_EOF={};function tokenizer$1(e,t,n,i){var o={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function r(){return get_full_char(o.text,o.pos)}function a(){if(46!==o.text.charCodeAt(o.pos+1))return !1;const e=o.text.charCodeAt(o.pos+2);return e<48||e>57}function s(e,t){var n=get_full_char(o.text,o.pos++);if(e&&!n)throw EX_EOF;return NEWLINE_CHARS.has(n)?(o.newline_before=o.newline_before||!t,++o.line,o.col=0,"\r"==n&&"\n"==r()&&(++o.pos,n="\n")):(n.length>1&&(++o.pos,++o.col),++o.col),n}function u(e){for(;e--;)s();}function l(e){return o.text.substr(o.pos,e.length)==e}function c(e,t){var n=o.text.indexOf(e,o.pos);if(t&&-1==n)throw EX_EOF;return n}function _(){o.tokline=o.line,o.tokcol=o.col,o.tokpos=o.pos;}var f=!1,p=null;function d(e,n,i){o.regex_allowed="operator"==e&&!UNARY_POSTFIX.has(n)||"keyword"==e&&KEYWORDS_BEFORE_EXPRESSION.has(n)||"punc"==e&&PUNC_BEFORE_EXPRESSION.has(n)||"arrow"==e,"punc"!=e||"."!=n&&"?."!=n?i||(f=!1):f=!0;const r=o.tokline,a=o.tokcol,s=o.tokpos,u=o.newline_before,l=t;let c=[],_=[];i||(c=o.comments_before,_=o.comments_before=[]),o.newline_before=!1;const d=new AST_Token(e,n,r,a,s,u,c,_,l);return i||(p=d),d}function m(){for(;WHITESPACE_CHARS.has(r());)s();}function S(e){js_error(e,t,o.tokline,o.tokcol,o.tokpos);}function h(e){var t=!1,n=!1,i=!1,o="."==e,a=!1,u=!1,l=function(e){for(var t,n="",i=0;(t=r())&&e(t,i++);)n+=s();return n}((function(r,s){if(a)return !1;switch(r.charCodeAt(0)){case 95:return u=!0;case 98:case 66:return i=!0;case 111:case 79:case 120:case 88:return !i&&(i=!0);case 101:case 69:return !!i||!t&&(t=n=!0);case 45:return n||0==s&&!e;case 43:return n;case n=!1,46:return !(o||i||t)&&(o=!0)}return "n"===r?(a=!0,!0):RE_NUM_LITERAL.test(r)}));if(e&&(l=e+l),LATEST_RAW=l,RE_OCT_NUMBER.test(l)&&F.has_directive("use strict")&&S("Legacy octal literals are not allowed in strict mode"),u&&(l.endsWith("_")?S("Numeric separators are not allowed at the end of numeric literals"):l.includes("__")&&S("Only one underscore is allowed as numeric separator"),l=l.replace(/_/g,"")),l.endsWith("n")){const e=l.slice(0,-1),t=parse_js_number(e,RE_HEX_NUMBER.test(e));if(!o&&RE_BIG_INT.test(l)&&!isNaN(t))return d("big_int",e);S("Invalid or unexpected token");}var c=parse_js_number(l);if(!isNaN(c))return d("num",c);S("Invalid syntax: "+l);}function A(e){return e>="0"&&e<="7"}function T(e,t,n){var i=s(!0,e);switch(i.charCodeAt(0)){case 110:return "\n";case 114:return "\r";case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 120:return String.fromCharCode(E(2,t));case 117:if("{"==r()){for(s(!0),"}"===r()&&S("Expecting hex-character between {}");"0"==r();)s(!0);var a,u=c("}",!0)-o.pos;return (u>6||(a=E(u,t))>1114111)&&S("Unicode reference out of bounds"),s(!0),from_char_code(a)}return String.fromCharCode(E(4,t));case 10:return "";case 13:if("\n"==r())return s(!0,e),""}return A(i)?(n&&t&&("0"===i&&!A(r())||S("Octal escape sequences are not allowed in template strings")),function(e,t){var n=r();return n>="0"&&n<="7"&&(e+=s(!0))[0]<="3"&&(n=r())>="0"&&n<="7"&&(e+=s(!0)),"0"===e?"\0":(e.length>0&&F.has_directive("use strict")&&t&&S("Legacy octal escape sequences are not allowed in strict mode"),String.fromCharCode(parseInt(e,8)))}(i,t)):i}function E(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(r(),16)))return parseInt(n,16)||"";var i=s(!0);isNaN(parseInt(i,16))&&S("Invalid hex-character pattern in string"),n+=i;}return parseInt(n,16)}var g=O("Unterminated string constant",(function(){const e=o.pos;for(var t=s(),n=[];;){var i=s(!0,!0);if("\\"==i)i=T(!0,!0);else if("\r"==i||"\n"==i)S("Unterminated string constant");else if(i==t)break;n.push(i);}var r=d("string",n.join(""));return LATEST_RAW=o.text.slice(e,o.pos),r.quote=t,r})),b=O("Unterminated template",(function(e){e&&o.template_braces.push(o.brace_counter);var t,n,i="",a="";for(s(!0,!0);"`"!=(t=s(!0,!0));){if("\r"==t)"\n"==r()&&++o.pos,t="\n";else if("$"==t&&"{"==r())return s(!0,!0),o.brace_counter++,n=d(e?"template_head":"template_substitution",i),TEMPLATE_RAWS.set(n,a),n.template_end=!1,n;if(a+=t,"\\"==t){var u=o.pos;t=T(!0,!(p&&("name"===p.type||"punc"===p.type&&(")"===p.value||"]"===p.value))),!0),a+=o.text.substr(u,o.pos-u);}i+=t;}return o.template_braces.pop(),n=d(e?"template_head":"template_substitution",i),TEMPLATE_RAWS.set(n,a),n.template_end=!0,n}));function D(e){var t,n=o.regex_allowed,i=function(){for(var e=o.text,t=o.pos,n=o.text.length;t<n;++t){var i=e[t];if(NEWLINE_CHARS.has(i))return t}return -1}();return -1==i?(t=o.text.substr(o.pos),o.pos=o.text.length):(t=o.text.substring(o.pos,i),o.pos=i),o.col=o.tokcol+(o.pos-o.tokpos),o.comments_before.push(d(e,t,!0)),o.regex_allowed=n,F}var y=O("Unterminated multiline comment",(function(){var e=o.regex_allowed,t=c("*/",!0),n=o.text.substring(o.pos,t).replace(/\r\n|\r|\u2028|\u2029/g,"\n");return u(get_full_char_length(n)+2),o.comments_before.push(d("comment2",n,!0)),o.newline_before=o.newline_before||n.includes("\n"),o.regex_allowed=e,F})),v=O("Unterminated identifier name",(function(){var e,t=[],n=!1,i=function(){return n=!0,s(),"u"!==r()&&S("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"),T(!1,!0)};if("\\"===(e=r()))is_identifier_start(e=i())||S("First identifier char is an invalid identifier char");else {if(!is_identifier_start(e))return "";s();}for(t.push(e);null!=(e=r());){if("\\"===(e=r()))is_identifier_char(e=i())||S("Invalid escaped identifier char");else {if(!is_identifier_char(e))break;s();}t.push(e);}const o=t.join("");return RESERVED_WORDS.has(o)&&n&&S("Escaped characters are not allowed in keywords"),o})),C=O("Unterminated regular expression",(function(e){for(var t,n=!1,i=!1;t=s(!0);)if(NEWLINE_CHARS.has(t))S("Unexpected line terminator");else if(n)e+="\\"+t,n=!1;else if("["==t)i=!0,e+=t;else if("]"==t&&i)i=!1,e+=t;else {if("/"==t&&!i)break;"\\"==t?n=!0:e+=t;}return d("regexp","/"+e+"/"+v())}));function k(e){return d("operator",function e(t){if(!r())return t;var n=t+r();return OPERATORS.has(n)?(s(),e(n)):t}(e||s()))}function R(){switch(s(),r()){case"/":return s(),D("comment1");case"*":return s(),y()}return o.regex_allowed?C(""):k("/")}function O(e,t){return function(n){try{return t(n)}catch(t){if(t!==EX_EOF)throw t;S(e);}}}function F(e){if(null!=e)return C(e);for(i&&0==o.pos&&l("#!")&&(_(),u(2),D("comment5"));;){if(m(),_(),n){if(l("\x3c!--")){u(4),D("comment3");continue}if(l("--\x3e")&&o.newline_before){u(3),D("comment4");continue}}var t=r();if(!t)return d("eof");var c=t.charCodeAt(0);switch(c){case 34:case 39:return g();case 46:return s(),is_digit(r().charCodeAt(0))?h("."):"."===r()?(s(),s(),d("expand","...")):d("punc",".");case 47:var p=R();if(p===F)continue;return p;case 61:return s(),">"===r()?(s(),d("arrow","=>")):k("=");case 63:if(!a())break;return s(),s(),d("punc","?.");case 96:return b(!0);case 123:o.brace_counter++;break;case 125:if(o.brace_counter--,o.template_braces.length>0&&o.template_braces[o.template_braces.length-1]===o.brace_counter)return b(!1)}if(is_digit(c))return h();if(PUNC_CHARS.has(t))return d("punc",s());if(OPERATOR_CHARS.has(t))return k();if(92==c||is_identifier_start(t))return A=v(),f?d("name",A):KEYWORDS_ATOM.has(A)?d("atom",A):KEYWORDS.has(A)?OPERATORS.has(A)?d("operator",A):d("keyword",A):d("name",A);if(35==c)return s(),d("privatename",v());break}var A;S("Unexpected character '"+t+"'");}return F.next=s,F.peek=r,F.context=function(e){return e&&(o=e),o},F.add_directive=function(e){o.directive_stack[o.directive_stack.length-1].push(e),void 0===o.directives[e]?o.directives[e]=1:o.directives[e]++;},F.push_directives_stack=function(){o.directive_stack.push([]);},F.pop_directives_stack=function(){for(var e=o.directive_stack[o.directive_stack.length-1],t=0;t<e.length;t++)o.directives[e[t]]--;o.directive_stack.pop();},F.has_directive=function(e){return o.directives[e]>0},F}var UNARY_PREFIX=makePredicate(["typeof","void","delete","--","++","!","~","-","+"]),UNARY_POSTFIX=makePredicate(["--","++"]),ASSIGNMENT=makePredicate(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),LOGICAL_ASSIGNMENT=makePredicate(["??=","&&=","||="]),PRECEDENCE=function(e,t){for(var n=0;n<e.length;++n)for(var i=e[n],o=0;o<i.length;++o)t[i[o]]=n+1;return t}([["||"],["??"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),ATOMIC_START_TOKEN=makePredicate(["atom","num","big_int","string","regexp","name"]);function parse$4(e,t){const n=new WeakMap;t=defaults$1(t,{bare_returns:!1,ecma:null,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var i={input:"string"==typeof e?tokenizer$1(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function o(e,t){return is_token(i.token,e,t)}function r(){return i.peeked||(i.peeked=i.input())}function a(){return i.prev=i.token,i.peeked||r(),i.token=i.peeked,i.peeked=null,i.in_directives=i.in_directives&&("string"==i.token.type||o("punc",";")),i.token}function s(){return i.prev}function u(e,t,n,o){var r=i.input.context();js_error(e,r.filename,null!=t?t:r.tokline,null!=n?n:r.tokcol,null!=o?o:r.tokpos);}function l(e,t){u(t,e.line,e.col);}function c(e){null==e&&(e=i.token),l(e,"Unexpected token: "+e.type+" ("+e.value+")");}function _(e,t){if(o(e,t))return a();l(i.token,"Unexpected token "+i.token.type+" «"+i.token.value+"», expected "+e+" «"+t+"»");}function f(e){return _("punc",e)}function p(e){return e.nlb||!e.comments_before.every((e=>!e.nlb))}function d(){return !t.strict&&(o("eof")||o("punc","}")||p(i.token))}function m(){return i.in_generator===i.in_function}function S(){return i.in_async===i.in_function||0===i.in_function&&i.input.has_directive("use strict")}function h(e){o("punc",";")?a():e||d()||c();}function A(){f("(");var e=Se(!0);return f(")"),e}function T(e){return function(...t){const n=i.token,o=e(...t);return o.start=n,o.end=s(),o}}function E(){(o("operator","/")||o("operator","/="))&&(i.peeked=null,i.token=i.input(i.token.value.substr(1)));}i.token=a();var g=T((function e(n,m,T){switch(E(),i.token.type){case"string":if(i.in_directives){var g=r();!LATEST_RAW.includes("\\")&&(is_token(g,"punc",";")||is_token(g,"punc","}")||p(g)||is_token(g,"eof"))?i.input.add_directive(i.token.value):i.in_directives=!1;}var R=i.in_directives,F=D();return R&&F.body instanceof AST_String?new AST_Directive(F.body):F;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return D();case"name":case"privatename":if(o("privatename")&&!i.in_class&&u("Private field must be used in an enclosing class"),"async"==i.token.value&&is_token(r(),"keyword","function"))return a(),a(),m&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!0,n);if("import"==i.token.value&&!is_token(r(),"punc","(")&&!is_token(r(),"punc",".")){a();var M=function(){var e,t,n=s();o("name")&&(e=ae(AST_SymbolImport)),o("punc",",")&&a(),((t=ee(!0))||e)&&_("name","from");var r=i.token;"string"!==r.type&&c(),a();const u=Z();return new AST_Import({start:n,imported_name:e,imported_names:t,module_name:new AST_String({start:r,value:r.value,quote:r.quote,end:r}),assert_clause:u,end:i.token})}();return h(),M}return is_token(r(),"punc",":")?b():D();case"punc":switch(i.token.value){case"{":return new AST_BlockStatement({start:i.token,body:I(),end:s()});case"[":case"(":return D();case";":return i.in_directives=!1,a(),new AST_EmptyStatement;default:c();}case"keyword":switch(i.token.value){case"break":return a(),y(AST_Break);case"continue":return a(),y(AST_Continue);case"debugger":return a(),h(),new AST_Debugger;case"do":a();var x=he(e);_("keyword","while");var B=A();return h(!0),new AST_Do({body:x,condition:B});case"while":return a(),new AST_While({condition:A(),body:he((function(){return e(!1,!0)}))});case"for":return a(),function(){var e="`for await` invalid in this context",t=i.token;"name"==t.type&&"await"==t.value?(S()||l(t,e),a()):t=!1,f("(");var n=null;if(o("punc",";"))t&&l(t,e);else {n=o("keyword","var")?(a(),L(!0)):o("keyword","let")?(a(),V(!0)):o("keyword","const")?(a(),U(!0)):Se(!0,!0);var r=o("operator","in"),s=o("name","of");if(t&&!s&&l(t,e),r||s)return n instanceof AST_Definitions?n.definitions.length>1&&l(n.start,"Only one variable declaration allowed in for..in loop"):pe(n)||(n=de(n))instanceof AST_Destructuring||l(n.start,"Invalid left-hand side in for..in loop"),a(),r?k(n):C(n,!!t)}return v(n)}();case"class":return a(),m&&u("classes are not allowed as the body of a loop"),T&&u("classes are not allowed as the body of an if"),j(AST_DefClass,n);case"function":return a(),m&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!1,n);case"if":return a(),w();case"return":0!=i.in_function||t.bare_returns||u("'return' outside of function"),a();var K=null;return o("punc",";")?a():d()||(K=Se(!0),h()),new AST_Return({value:K});case"switch":return a(),new AST_Switch({expression:A(),body:he(P)});case"throw":return a(),p(i.token)&&u("Illegal newline after 'throw'"),K=Se(!0),h(),new AST_Throw({value:K});case"try":return a(),function(){var e=I(),t=null,n=null;if(o("keyword","catch")){var r=i.token;if(a(),o("punc","{"))var l=null;else f("("),l=N(void 0,AST_SymbolCatch),f(")");t=new AST_Catch({start:r,argname:l,body:I(),end:s()});}return o("keyword","finally")&&(r=i.token,a(),n=new AST_Finally({start:r,body:I(),end:s()})),t||n||u("Missing catch/finally blocks"),new AST_Try({body:e,bcatch:t,bfinally:n})}();case"var":return a(),M=L(),h(),M;case"let":return a(),M=V(),h(),M;case"const":return a(),M=U(),h(),M;case"with":return i.input.has_directive("use strict")&&u("Strict mode may not include a with statement"),a(),new AST_With({expression:A(),body:e()});case"export":if(!is_token(r(),"punc","("))return a(),M=te(),o("punc",";")&&h(),M}}c();}));function b(){var e=ae(AST_Label);"await"===e.name&&i.in_async===i.in_function&&l(i.prev,"await cannot be used as label inside async function"),i.labels.some((t=>t.name===e.name))&&u("Label "+e.name+" defined twice"),f(":"),i.labels.push(e);var t=g();return i.labels.pop(),t instanceof AST_IterationStatement||e.references.forEach((function(t){t instanceof AST_Continue&&(t=t.label.start,u("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos));})),new AST_LabeledStatement({body:t,label:e})}function D(e){return new AST_SimpleStatement({body:(e=Se(!0),h(),e)})}function y(e){var t,n=null;d()||(n=ae(AST_LabelRef,!0)),null!=n?((t=i.labels.find((e=>e.name===n.name)))||u("Undefined label "+n.name),n.thedef=t):0==i.in_loop&&u(e.TYPE+" not inside a loop or switch"),h();var o=new e({label:n});return t&&t.references.push(o),o}function v(e){f(";");var t=o("punc",";")?null:Se(!0);f(";");var n=o("punc",")")?null:Se(!0);return f(")"),new AST_For({init:e,condition:t,step:n,body:he((function(){return g(!1,!0)}))})}function C(e,t){var n=e instanceof AST_Definitions?e.definitions[0].name:null,i=Se(!0);return f(")"),new AST_ForOf({await:t,init:e,name:n,object:i,body:he((function(){return g(!1,!0)}))})}function k(e){var t=Se(!0);return f(")"),new AST_ForIn({init:e,object:t,body:he((function(){return g(!1,!0)}))})}var R=function(e,t,n){p(i.token)&&u("Unexpected newline before arrow (=>)"),_("arrow","=>");var r=x(o("punc","{"),!1,n),a=r instanceof Array&&r.length?r[r.length-1].end:r instanceof Array?e:r.end;return new AST_Arrow({start:e,end:a,async:n,argnames:t,body:r})},O=function(e,t,n,i){var r=e===AST_Defun,u=o("operator","*");u&&a();var l=o("name")?ae(r?AST_SymbolDefun:AST_SymbolLambda):null;r&&!l&&(i?e=AST_Function:c()),!l||e===AST_Accessor||l instanceof AST_SymbolDeclaration||c(s());var _=[],f=x(!0,u||t,n,l,_);return new e({start:_.start,end:f.end,is_generator:u,async:n,name:l,argnames:_,body:f})};class F{constructor(e,t,n=!1){this.is_parameter=e,this.duplicates_ok=n,this.parameters=new Set,this.duplicate=null,this.default_assignment=!1,this.spread=!1,this.strict_mode=!!t;}add_parameter(e){if(this.parameters.has(e.value))null===this.duplicate&&(this.duplicate=e),this.check_strict();else if(this.parameters.add(e.value),this.is_parameter)switch(e.value){case"arguments":case"eval":case"yield":this.strict_mode&&l(e,"Unexpected "+e.value+" identifier as parameter inside strict mode");break;default:RESERVED_WORDS.has(e.value)&&c();}}mark_default_assignment(e){!1===this.default_assignment&&(this.default_assignment=e);}mark_spread(e){!1===this.spread&&(this.spread=e);}mark_strict_mode(){this.strict_mode=!0;}is_strict(){return !1!==this.default_assignment||!1!==this.spread||this.strict_mode}check_strict(){this.is_strict()&&null!==this.duplicate&&!this.duplicates_ok&&l(this.duplicate,"Parameter "+this.duplicate.value+" was used already");}}function N(e,t){var n,r=!1;return void 0===e&&(e=new F(!0,i.input.has_directive("use strict"))),o("expand","...")&&(r=i.token,e.mark_spread(i.token),a()),n=M(e,t),o("operator","=")&&!1===r&&(e.mark_default_assignment(i.token),a(),n=new AST_DefaultAssign({start:n.start,left:n,operator:"=",right:Se(!1),end:i.token})),!1!==r&&(o("punc",")")||c(),n=new AST_Expansion({start:r,expression:n,end:r})),e.check_strict(),n}function M(e,t){var n,l=[],_=!0,p=!1,d=i.token;if(void 0===e){const n=i.input.has_directive("use strict");e=new F(!1,n,t===AST_SymbolVar);}if(t=void 0===t?AST_SymbolFunarg:t,o("punc","[")){for(a();!o("punc","]");){if(_?_=!1:f(","),o("expand","...")&&(p=!0,n=i.token,e.mark_spread(i.token),a()),o("punc"))switch(i.token.value){case",":l.push(new AST_Hole({start:i.token,end:i.token}));continue;case"]":break;case"[":case"{":l.push(M(e,t));break;default:c();}else o("name")?(e.add_parameter(i.token),l.push(ae(t))):u("Invalid function parameter");o("operator","=")&&!1===p&&(e.mark_default_assignment(i.token),a(),l[l.length-1]=new AST_DefaultAssign({start:l[l.length-1].start,left:l[l.length-1],operator:"=",right:Se(!1),end:i.token})),p&&(o("punc","]")||u("Rest element must be last element"),l[l.length-1]=new AST_Expansion({start:n,expression:l[l.length-1],end:n}));}return f("]"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!0,end:s()})}if(o("punc","{")){for(a();!o("punc","}");){if(_?_=!1:f(","),o("expand","...")&&(p=!0,n=i.token,e.mark_spread(i.token),a()),o("name")&&(is_token(r(),"punc")||is_token(r(),"operator"))&&[",","}","="].includes(r().value)){e.add_parameter(i.token);var m=s(),S=ae(t);p?l.push(new AST_Expansion({start:n,expression:S,end:S.end})):l.push(new AST_ObjectKeyVal({start:m,key:S.name,value:S,end:S.end}));}else {if(o("punc","}"))continue;var h=i.token,A=ne();null===A?c(s()):"name"!==s().type||o("punc",":")?(f(":"),l.push(new AST_ObjectKeyVal({start:h,quote:h.quote,key:A,value:M(e,t),end:s()}))):l.push(new AST_ObjectKeyVal({start:s(),key:A,value:new t({start:s(),name:A,end:s()}),end:s()}));}p?o("punc","}")||u("Rest element must be last element"):o("operator","=")&&(e.mark_default_assignment(i.token),a(),l[l.length-1].value=new AST_DefaultAssign({start:l[l.length-1].value.start,left:l[l.length-1].value,operator:"=",right:Se(!1),end:i.token}));}return f("}"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!1,end:s()})}if(o("name"))return e.add_parameter(i.token),ae(t);u("Invalid function parameter");}function x(e,t,n,r,s){var u=i.in_loop,l=i.labels,c=i.in_generator,_=i.in_async;if(++i.in_function,t&&(i.in_generator=i.in_function),n&&(i.in_async=i.in_function),s&&function(e){var t=new F(!0,i.input.has_directive("use strict"));for(f("(");!o("punc",")");){var n=N(t);if(e.push(n),o("punc",")")||f(","),n instanceof AST_Expansion)break}a();}(s),e&&(i.in_directives=!0),i.in_loop=0,i.labels=[],e){i.input.push_directives_stack();var p=I();r&&re(r),s&&s.forEach(re),i.input.pop_directives_stack();}else p=[new AST_Return({start:i.token,value:Se(!1),end:i.token})];return --i.in_function,i.in_loop=u,i.labels=l,i.in_generator=c,i.in_async=_,p}function w(){var e=A(),t=g(!1,!1,!0),n=null;return o("keyword","else")&&(a(),n=g(!1,!1,!0)),new AST_If({condition:e,body:t,alternative:n})}function I(){f("{");for(var e=[];!o("punc","}");)o("eof")&&c(),e.push(g());return a(),e}function P(){f("{");for(var e,t=[],n=null,r=null;!o("punc","}");)o("eof")&&c(),o("keyword","case")?(r&&(r.end=s()),n=[],r=new AST_Case({start:(e=i.token,a(),e),expression:Se(!0),body:n}),t.push(r),f(":")):o("keyword","default")?(r&&(r.end=s()),n=[],r=new AST_Default({start:(e=i.token,a(),f(":"),e),body:n}),t.push(r)):(n||c(),n.push(g()));return r&&(r.end=s()),a(),t}function B(e,t){for(var n,r=[];;){var l="var"===t?AST_SymbolVar:"const"===t?AST_SymbolConst:"let"===t?AST_SymbolLet:null;if(o("punc","{")||o("punc","[")?n=new AST_VarDef({start:i.token,name:M(void 0,l),value:o("operator","=")?(_("operator","="),Se(!1,e)):null,end:s()}):"import"==(n=new AST_VarDef({start:i.token,name:ae(l),value:o("operator","=")?(a(),Se(!1,e)):e||"const"!==t?null:u("Missing initializer in const declaration"),end:s()})).name.name&&u("Unexpected token: import"),r.push(n),!o("punc",","))break;a();}return r}var L=function(e){return new AST_Var({start:s(),definitions:B(e,"var"),end:s()})},V=function(e){return new AST_Let({start:s(),definitions:B(e,"let"),end:s()})},U=function(e){return new AST_Const({start:s(),definitions:B(e,"const"),end:s()})};function K(){var e,t=i.token;switch(t.type){case"name":e=oe(AST_SymbolRef);break;case"num":e=new AST_Number({start:t,end:t,value:t.value,raw:LATEST_RAW});break;case"big_int":e=new AST_BigInt({start:t,end:t,value:t.value});break;case"string":e=new AST_String({start:t,end:t,value:t.value,quote:t.quote});break;case"regexp":const[n,i,o]=t.value.match(/^\/(.*)\/(\w*)$/);e=new AST_RegExp({start:t,end:t,value:{source:i,flags:o}});break;case"atom":switch(t.value){case"false":e=new AST_False({start:t,end:t});break;case"true":e=new AST_True({start:t,end:t});break;case"null":e=new AST_Null({start:t,end:t});}}return a(),e}function G(e,t){var n=function(e,t){return t?new AST_DefaultAssign({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof AST_Object?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!1,names:e.properties.map((e=>G(e)))}),t):e instanceof AST_ObjectKeyVal?(e.value=G(e.value),n(e,t)):e instanceof AST_Hole?e:e instanceof AST_Destructuring?(e.names=e.names.map((e=>G(e))),n(e,t)):e instanceof AST_SymbolRef?n(new AST_SymbolFunarg({name:e.name,start:e.start,end:e.end}),t):e instanceof AST_Expansion?(e.expression=G(e.expression),n(e,t)):e instanceof AST_Array?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!0,names:e.elements.map((e=>G(e)))}),t):e instanceof AST_Assign?n(G(e.left,e.right),t):e instanceof AST_DefaultAssign?(e.left=G(e.left),e):void u("Invalid function parameter",e.start.line,e.start.col)}var H=function(e,t){if(o("operator","new"))return function(e){var t=i.token;if(_("operator","new"),o("punc","."))return a(),_("name","target"),ue(new AST_NewTarget({start:t,end:s()}),e);var n,r=H(!1);o("punc","(")?(a(),n=z(")",!0)):n=[];var u=new AST_New({start:t,expression:r,args:n,end:s()});return se(u),ue(u,e)}(e);if(o("operator","import"))return function(){var e=i.token;return _("operator","import"),_("punc","."),_("name","meta"),ue(new AST_ImportMeta({start:e,end:s()}),!1)}();var l,p=i.token,d=o("name","async")&&"["!=(l=r()).value&&"arrow"!=l.type&&K();if(o("punc")){switch(i.token.value){case"(":if(d&&!e)break;var m=function(e,t){var n,r,u,l=[];for(f("(");!o("punc",")");)n&&c(n),o("expand","...")?(n=i.token,t&&(r=i.token),a(),l.push(new AST_Expansion({start:s(),expression:Se(),end:i.token}))):l.push(Se()),o("punc",")")||(f(","),o("punc",")")&&(u=s(),t&&(r=u)));return f(")"),e&&o("arrow","=>")?n&&u&&c(u):r&&c(r),l}(t,!d);if(t&&o("arrow","=>"))return R(p,m.map((e=>G(e))),!!d);var S=d?new AST_Call({expression:d,args:m}):1==m.length?m[0]:new AST_Sequence({expressions:m});if(S.start){const e=p.comments_before.length;if(n.set(p,e),S.start.comments_before.unshift(...p.comments_before),p.comments_before=S.start.comments_before,0==e&&p.comments_before.length>0){var h=p.comments_before[0];h.nlb||(h.nlb=p.nlb,p.nlb=!1);}p.comments_after=S.start.comments_after;}S.start=p;var A=s();return S.end&&(A.comments_before=S.end.comments_before,S.end.comments_after.push(...A.comments_after),A.comments_after=S.end.comments_after),S.end=A,S instanceof AST_Call&&se(S),ue(S,e);case"[":return ue(W(),e);case"{":return ue(Y(),e)}d||c();}if(t&&o("name")&&is_token(r(),"arrow")){var T=new AST_SymbolFunarg({name:i.token.value,start:p,end:p});return a(),R(p,[T],!!d)}if(o("keyword","function")){a();var E=O(AST_Function,!1,!!d);return E.start=p,E.end=s(),ue(E,e)}if(d)return ue(d,e);if(o("keyword","class")){a();var g=j(AST_ClassExpression);return g.start=p,g.end=s(),ue(g,e)}if(o("template_head"))return ue(X(),e);if(o("privatename")){i.in_class||u("Private field must be used in an enclosing class");const t=i.token,n=new AST_SymbolPrivateProperty({start:t,name:t.value,end:t});a(),_("operator","in");const o=new AST_PrivateIn({start:t,key:n,value:ue(K(),e),end:s()});return ue(o,e)}if(ATOMIC_START_TOKEN.has(i.token.type))return ue(K(),e);c();};function X(){var e=[],t=i.token;for(e.push(new AST_TemplateSegment({start:i.token,raw:TEMPLATE_RAWS.get(i.token),value:i.token.value,end:i.token}));!i.token.template_end;)a(),E(),e.push(Se(!0)),e.push(new AST_TemplateSegment({start:i.token,raw:TEMPLATE_RAWS.get(i.token),value:i.token.value,end:i.token}));return a(),new AST_TemplateString({start:t,segments:e,end:i.token})}function z(e,t,n){for(var r=!0,u=[];!o("punc",e)&&(r?r=!1:f(","),!t||!o("punc",e));)o("punc",",")&&n?u.push(new AST_Hole({start:i.token,end:i.token})):o("expand","...")?(a(),u.push(new AST_Expansion({start:s(),expression:Se(),end:i.token}))):u.push(Se(!1));return a(),u}var W=T((function(){return f("["),new AST_Array({elements:z("]",!t.strict,!0)})})),q=T(((e,t)=>O(AST_Accessor,e,t))),Y=T((function(){var e=i.token,n=!0,r=[];for(f("{");!o("punc","}")&&(n?n=!1:f(","),t.strict||!o("punc","}"));)if("expand"!=(e=i.token).type){o("privatename")&&u("private fields are not allowed in an object");var l,_=ne();if(o("punc",":"))null===_?c(s()):(a(),l=Se(!1));else {var p=$(_,e);if(p){r.push(p);continue}l=new AST_SymbolRef({start:s(),name:_,end:s()});}o("operator","=")&&(a(),l=new AST_Assign({start:e,left:l,operator:"=",right:Se(!1),logical:!1,end:s()})),r.push(new AST_ObjectKeyVal({start:e,quote:e.quote,key:_ instanceof AST_Node?_:""+_,value:l,end:s()}));}else a(),r.push(new AST_Expansion({start:e,expression:Se(!1),end:s()}));return a(),new AST_Object({properties:r})}));function j(e,t){var n,r,u,l,_=[];i.input.push_directives_stack(),i.input.add_directive("use strict"),"name"==i.token.type&&"extends"!=i.token.value&&(u=ae(e===AST_DefClass?AST_SymbolDefClass:AST_SymbolClass)),e!==AST_DefClass||u||(t?e=AST_ClassExpression:c()),"extends"==i.token.value&&(a(),l=Se(!0)),f("{");const p=i.in_class;for(i.in_class=!0;o("punc",";");)a();for(;!o("punc","}");)for(n=i.token,(r=$(ne(),n,!0))||c(),_.push(r);o("punc",";");)a();return i.in_class=p,i.input.pop_directives_stack(),a(),new e({start:n,name:u,extends:l,properties:_,end:s()})}function $(e,t,n){const r=(e,n=AST_SymbolMethod)=>"string"==typeof e||"number"==typeof e?new n({start:t,name:""+e,end:s()}):(null===e&&c(),e),u=()=>!(o("punc","(")||o("punc",",")||o("punc","}")||o("punc",";")||o("operator","="));var l=!1,_=!1,f=!1,p=!1,d=null;if(n&&"static"===e&&u()){const t=function(){if(!o("punc","{"))return null;const e=i.token,t=[];for(a();!o("punc","}");)t.push(g());return a(),new AST_ClassStaticBlock({start:e,body:t,end:s()})}();if(null!=t)return t;_=!0,e=ne();}"async"===e&&u()&&(l=!0,e=ne()),"operator"===s().type&&"*"===s().value&&(f=!0,e=ne()),"get"!==e&&"set"!==e||!u()||(d=e,e=ne()),"privatename"===s().type&&(p=!0);const m=s();if(null!=d){if(p)return new("get"===d?AST_PrivateGetter:AST_PrivateSetter)({start:t,static:_,key:r(e),value:q(),end:s()});{const n="get"===d?AST_ObjectGetter:AST_ObjectSetter;return e=r(e),new n({start:t,static:_,key:e,quote:e instanceof AST_SymbolMethod?m.quote:void 0,value:q(),end:s()})}}if(o("punc","("))return e=r(e),new(p?AST_PrivateMethod:AST_ConciseMethod)({start:t,static:_,is_generator:f,async:l,key:e,quote:e instanceof AST_SymbolMethod?m.quote:void 0,value:q(f,l),end:s()});if(n){const n=r(e,AST_SymbolClassProperty),i=n instanceof AST_SymbolClassProperty?m.quote:void 0,u=p?AST_ClassPrivateProperty:AST_ClassProperty;if(o("operator","="))return a(),new u({start:t,static:_,quote:i,key:n,value:Se(!1),end:s()});if(o("name")||o("privatename")||o("operator","*")||o("punc",";")||o("punc","}"))return new u({start:t,static:_,quote:i,key:n,end:s()})}}function Z(){return o("name","assert")&&!p(i.token)?(a(),Y()):null}function Q(e){function t(e){return new e({name:ne(),start:s(),end:s()})}var n,r,u=e?AST_SymbolImportForeign:AST_SymbolExportForeign,l=e?AST_SymbolImport:AST_SymbolExport,c=i.token;return e?n=t(u):r=t(l),o("name","as")?(a(),e?r=t(l):n=t(u)):e?r=new l(n):n=new u(r),new AST_NameMapping({start:c,foreign_name:n,name:r,end:s()})}function J(e,t){var n,o=e?AST_SymbolImportForeign:AST_SymbolExportForeign,r=e?AST_SymbolImport:AST_SymbolExport,a=i.token,u=s();return t=t||new r({start:a,name:"*",end:u}),n=new o({start:a,name:"*",end:u}),new AST_NameMapping({start:a,foreign_name:n,name:t,end:u})}function ee(e){var t;if(o("punc","{")){for(a(),t=[];!o("punc","}");)t.push(Q(e)),o("punc",",")&&a();a();}else if(o("operator","*")){var n;a(),e&&o("name","as")&&(a(),n=ae(e?AST_SymbolImport:AST_SymbolExportForeign)),t=[J(e,n)];}return t}function te(){var e,t,n,u,l,_=i.token;if(o("keyword","default"))e=!0,a();else if(t=ee(!1)){if(o("name","from")){a();var f=i.token;"string"!==f.type&&c(),a();const n=Z();return new AST_Export({start:_,is_default:e,exported_names:t,module_name:new AST_String({start:f,value:f.value,quote:f.quote,end:f}),end:s(),assert_clause:n})}return new AST_Export({start:_,is_default:e,exported_names:t,end:s()})}return o("punc","{")||e&&(o("keyword","class")||o("keyword","function"))&&is_token(r(),"punc")?(u=Se(!1),h()):(n=g(e))instanceof AST_Definitions&&e?c(n.start):n instanceof AST_Definitions||n instanceof AST_Defun||n instanceof AST_DefClass?l=n:n instanceof AST_ClassExpression||n instanceof AST_Function?u=n:n instanceof AST_SimpleStatement?u=n.body:c(n.start),new AST_Export({start:_,is_default:e,exported_value:u,exported_definition:l,end:s(),assert_clause:null})}function ne(){var e=i.token;switch(e.type){case"punc":if("["===e.value){a();var t=Se(!1);return f("]"),t}c(e);case"operator":if("*"===e.value)return a(),null;["delete","in","instanceof","new","typeof","void"].includes(e.value)||c(e);case"name":case"privatename":case"string":case"num":case"big_int":case"keyword":case"atom":return a(),e.value;default:c(e);}}function ie(){var e=i.token;return "name"!=e.type&&"privatename"!=e.type&&c(),a(),e.value}function oe(e){var t=i.token.value;return new("this"==t?AST_This:"super"==t?AST_Super:e)({name:String(t),start:i.token,end:i.token})}function re(e){var t=e.name;m()&&"yield"==t&&l(e.start,"Yield cannot be used as identifier inside generators"),i.input.has_directive("use strict")&&("yield"==t&&l(e.start,"Unexpected yield identifier inside strict mode"),e instanceof AST_SymbolDeclaration&&("arguments"==t||"eval"==t)&&l(e.start,"Unexpected "+t+" in strict mode"));}function ae(e,t){if(!o("name"))return t||u("Name expected"),null;var n=oe(e);return re(n),a(),n}function se(e){var t=e.start,i=t.comments_before;const o=n.get(t);for(var r=null!=o?o:i.length;--r>=0;){var a=i[r];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){set_annotation(e,_PURE);break}if(/[@#]__INLINE__/.test(a.value)){set_annotation(e,_INLINE);break}if(/[@#]__NOINLINE__/.test(a.value)){set_annotation(e,_NOINLINE);break}}}}var ue=function(e,t,n){var r=e.start;if(o("punc",".")){a(),o("privatename")&&!i.in_class&&u("Private field must be used in an enclosing class");const l=o("privatename")?AST_DotHash:AST_Dot;return ue(new l({start:r,expression:e,optional:!1,property:ie(),end:s()}),t,n)}if(o("punc","[")){a();var l=Se(!0);return f("]"),ue(new AST_Sub({start:r,expression:e,optional:!1,property:l,end:s()}),t,n)}if(t&&o("punc","(")){a();var _=new AST_Call({start:r,expression:e,optional:!1,args:le(),end:s()});return se(_),ue(_,!0,n)}if(o("punc","?.")){let n;if(a(),t&&o("punc","(")){a();const t=new AST_Call({start:r,optional:!0,expression:e,args:le(),end:s()});se(t),n=ue(t,!0,!0);}else if(o("name")||o("privatename")){o("privatename")&&!i.in_class&&u("Private field must be used in an enclosing class");const a=o("privatename")?AST_DotHash:AST_Dot;n=ue(new a({start:r,expression:e,optional:!0,property:ie(),end:s()}),t,!0);}else if(o("punc","[")){a();const i=Se(!0);f("]"),n=ue(new AST_Sub({start:r,expression:e,optional:!0,property:i,end:s()}),t,!0);}return n||c(),n instanceof AST_Chain?n:new AST_Chain({start:r,expression:n,end:s()})}return o("template_head")?(n&&c(),ue(new AST_PrefixedTemplateString({start:r,prefix:e,template_string:X(),end:s()}),t)):e};function le(){for(var e=[];!o("punc",")");)o("expand","...")?(a(),e.push(new AST_Expansion({start:s(),expression:Se(!1),end:s()}))):e.push(Se(!1)),o("punc",")")||f(",");return a(),e}var ce=function(e,t){var n=i.token;if("name"==n.type&&"await"==n.value&&S())return a(),S()||u("Unexpected await expression outside async function",i.prev.line,i.prev.col,i.prev.pos),new AST_Await({start:s(),end:i.token,expression:ce(!0)});if(o("operator")&&UNARY_PREFIX.has(n.value)){a(),E();var r=_e(AST_UnaryPrefix,n,ce(e));return r.start=n,r.end=s(),r}for(var l=H(e,t);o("operator")&&UNARY_POSTFIX.has(i.token.value)&&!p(i.token);)l instanceof AST_Arrow&&c(),(l=_e(AST_UnaryPostfix,i.token,l)).start=n,l.end=i.token,a();return l};function _e(e,t,n){var o=t.value;switch(o){case"++":case"--":pe(n)||u("Invalid use of "+o+" operator",t.line,t.col,t.pos);break;case"delete":n instanceof AST_SymbolRef&&i.input.has_directive("use strict")&&u("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos);}return new e({operator:o,expression:n})}var fe=function(e,t,n){var r=o("operator")?i.token.value:null;"in"==r&&n&&(r=null),"**"==r&&e instanceof AST_UnaryPrefix&&!is_token(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&c(e.start);var s=null!=r?PRECEDENCE[r]:null;if(null!=s&&(s>t||"**"===r&&t===s)){a();var u=fe(ce(!0),s,n);return fe(new AST_Binary({start:e.start,left:e,operator:r,right:u,end:u.end}),t,n)}return e};function pe(e){return e instanceof AST_PropAccess||e instanceof AST_SymbolRef}function de(e){if(e instanceof AST_Object)e=new AST_Destructuring({start:e.start,names:e.properties.map(de),is_array:!1,end:e.end});else if(e instanceof AST_Array){for(var t=[],n=0;n<e.elements.length;n++)e.elements[n]instanceof AST_Expansion&&(n+1!==e.elements.length&&l(e.elements[n].start,"Spread must the be last element in destructuring array"),e.elements[n].expression=de(e.elements[n].expression)),t.push(de(e.elements[n]));e=new AST_Destructuring({start:e.start,names:t,is_array:!0,end:e.end});}else e instanceof AST_ObjectProperty?e.value=de(e.value):e instanceof AST_Assign&&(e=new AST_DefaultAssign({start:e.start,left:e.left,operator:"=",right:e.right,end:e.end}));return e}var me=function(e){E();var t=i.token;if("name"==t.type&&"yield"==t.value){if(m())return a(),function(){m()||u("Unexpected yield expression outside generator function",i.prev.line,i.prev.col,i.prev.pos);var e=i.token,t=!1,n=!0;return d()||o("punc")&&PUNC_AFTER_EXPRESSION.has(i.token.value)?n=!1:o("operator","*")&&(t=!0,a()),new AST_Yield({start:e,is_star:t,expression:n?Se():null,end:s()})}();i.input.has_directive("use strict")&&l(i.token,"Unexpected yield identifier inside strict mode");}var n=function(e){var t=i.token,n=function(e){return fe(ce(!0,!0),0,e)}(e);if(o("operator","?")){a();var r=Se(!1);return f(":"),new AST_Conditional({start:t,condition:n,consequent:r,alternative:Se(!1,e),end:s()})}return n}(e),r=i.token.value;if(o("operator")&&ASSIGNMENT.has(r)){if(pe(n)||(n=de(n))instanceof AST_Destructuring)return a(),new AST_Assign({start:t,left:n,operator:r,right:me(e),logical:LOGICAL_ASSIGNMENT.has(r),end:s()});u("Invalid assignment");}return n},Se=function(e,t){for(var n=i.token,s=[];s.push(me(t)),e&&o("punc",",");)a(),e=!0;return 1==s.length?s[0]:new AST_Sequence({start:n,expressions:s,end:r()})};function he(e){++i.in_loop;var t=e();return --i.in_loop,t}return t.expression?Se(!0):function(){var e=i.token,n=[];for(i.input.push_directives_stack(),t.module&&i.input.add_directive("use strict");!o("eof");)n.push(g());i.input.pop_directives_stack();var r=s(),a=t.toplevel;return a?(a.body=a.body.concat(n),a.end=r):a=new AST_Toplevel({start:e,body:n,end:r}),TEMPLATE_RAWS=new Map,a}()}function DEFNODE(e,t,n,i,o=AST_Node){var r=t=t?t.split(/\s+/):[];o&&o.PROPS&&(t=t.concat(o.PROPS));const a=o&&Object.create(o.prototype);if(a&&(n.prototype=a,n.BASE=o),o&&o.SUBCLASSES.push(n),n.prototype.CTOR=n,n.prototype.constructor=n,n.PROPS=t||null,n.SELF_PROPS=r,n.SUBCLASSES=[],e&&(n.prototype.TYPE=n.TYPE=e),i)for(let e in i)HOP(i,e)&&("$"===e[0]?n[e.substr(1)]=i[e]:n.prototype[e]=i[e]);return n.DEFMETHOD=function(e,t){this.prototype[e]=t;},n}const has_tok_flag=(e,t)=>Boolean(e.flags&t),set_tok_flag=(e,t,n)=>{n?e.flags|=t:e.flags&=~t;};class AST_Token{constructor(e,t,n,i,o,r,a,s,u){this.flags=r?1:0,this.type=e,this.value=t,this.line=n,this.col=i,this.pos=o,this.comments_before=a,this.comments_after=s,this.file=u,Object.seal(this);}get nlb(){return has_tok_flag(this,1)}set nlb(e){set_tok_flag(this,1,e);}get quote(){return has_tok_flag(this,4)?has_tok_flag(this,2)?"'":'"':""}set quote(e){set_tok_flag(this,2,"'"===e),set_tok_flag(this,4,!!e);}get template_end(){return has_tok_flag(this,8)}set template_end(e){set_tok_flag(this,8,e);}}var AST_Node=DEFNODE("Node","start end",(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{_clone:function(e){if(e){var t=this.clone();return t.transform(new TreeTransformer((function(e){if(e!==t)return e.clone(!0)})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null),AST_Statement=DEFNODE("Statement",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class of all statements"}),AST_Debugger=DEFNODE("Debugger",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Represents a debugger statement"},AST_Statement),AST_Directive=DEFNODE("Directive","value quote",(function(e){e&&(this.value=e.value,this.quote=e.quote,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},AST_Statement),AST_SimpleStatement=DEFNODE("SimpleStatement","body",(function(e){e&&(this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e);}))},_children_backwards(e){e(this.body);}},AST_Statement);function walk_body(e,t){const n=e.body;for(var i=0,o=n.length;i<o;i++)n[i]._walk(t);}function clone_block_scope(e){var t=this._clone(e);return this.block_scope&&(t.block_scope=this.block_scope.clone()),t}var AST_Block=DEFNODE("Block","body block_scope",(function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A body of statements (usually braced)",$propdoc:{body:"[AST_Statement*] an array of statements",block_scope:"[AST_Scope] the block scope"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);},clone:clone_block_scope},AST_Statement),AST_BlockStatement=DEFNODE("BlockStatement",null,(function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A block statement"},AST_Block),AST_EmptyStatement=DEFNODE("EmptyStatement",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The empty statement (empty block or simply a semicolon)"},AST_Statement),AST_StatementWithBody=DEFNODE("StatementWithBody","body",(function(e){e&&(this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",$propdoc:{body:"[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"}},AST_Statement),AST_LabeledStatement=DEFNODE("LabeledStatement","label",(function(e){e&&(this.label=e.label,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Statement with a label",$propdoc:{label:"[AST_Label] a label definition"},_walk:function(e){return e._visit(this,(function(){this.label._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.label);},clone:function(e){var t=this._clone(e);if(e){var n=t.label,i=this.label;t.walk(new TreeWalker((function(e){e instanceof AST_LoopControl&&e.label&&e.label.thedef===i&&(e.label.thedef=n,n.references.push(e));})));}return t}},AST_StatementWithBody),AST_IterationStatement=DEFNODE("IterationStatement","block_scope",(function(e){e&&(this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Internal class.  All loops inherit from it.",$propdoc:{block_scope:"[AST_Scope] the block scope for this iteration statement."},clone:clone_block_scope},AST_StatementWithBody),AST_DWLoop=DEFNODE("DWLoop","condition",(function(e){e&&(this.condition=e.condition,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for do/while statements",$propdoc:{condition:"[AST_Node] the loop condition.  Should not be instanceof AST_Statement"}},AST_IterationStatement),AST_Do=DEFNODE("Do",null,(function(e){e&&(this.condition=e.condition,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `do` statement",_walk:function(e){return e._visit(this,(function(){this.body._walk(e),this.condition._walk(e);}))},_children_backwards(e){e(this.condition),e(this.body);}},AST_DWLoop),AST_While=DEFNODE("While",null,(function(e){e&&(this.condition=e.condition,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `while` statement",_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.condition);}},AST_DWLoop),AST_For=DEFNODE("For","init condition step",(function(e){e&&(this.init=e.init,this.condition=e.condition,this.step=e.step,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `for` statement",$propdoc:{init:"[AST_Node?] the `for` initialization code, or null if empty",condition:"[AST_Node?] the `for` termination clause, or null if empty",step:"[AST_Node?] the `for` update clause, or null if empty"},_walk:function(e){return e._visit(this,(function(){this.init&&this.init._walk(e),this.condition&&this.condition._walk(e),this.step&&this.step._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.step&&e(this.step),this.condition&&e(this.condition),this.init&&e(this.init);}},AST_IterationStatement),AST_ForIn=DEFNODE("ForIn","init object",(function(e){e&&(this.init=e.init,this.object=e.object,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `for ... in` statement",$propdoc:{init:"[AST_Node] the `for/in` initialization code",object:"[AST_Node] the object that we're looping through"},_walk:function(e){return e._visit(this,(function(){this.init._walk(e),this.object._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.object&&e(this.object),this.init&&e(this.init);}},AST_IterationStatement),AST_ForOf=DEFNODE("ForOf","await",(function(e){e&&(this.await=e.await,this.init=e.init,this.object=e.object,this.block_scope=e.block_scope,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `for ... of` statement"},AST_ForIn),AST_With=DEFNODE("With","expression",(function(e){e&&(this.expression=e.expression,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `with` statement",$propdoc:{expression:"[AST_Node] the `with` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.expression);}},AST_StatementWithBody),AST_Scope=DEFNODE("Scope","variables uses_with uses_eval parent_scope enclosed cname",(function(e){e&&(this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for all statements introducing a lexical scope",$propdoc:{variables:"[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e,t){var n=this._clone(e);return e&&this.variables&&t&&!this._block_scope?n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope}):(this.variables&&(n.variables=new Map(this.variables)),this.enclosed&&(n.enclosed=this.enclosed.slice()),this._block_scope&&(n._block_scope=this._block_scope)),n},pinned:function(){return this.uses_eval||this.uses_with}},AST_Block),AST_Toplevel=DEFNODE("Toplevel","globals",(function(e){e&&(this.globals=e.globals,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return (n=parse$4(n)).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(t)})))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return parse$4(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(n)})))}},AST_Scope),AST_Expansion=DEFNODE("Expansion","expression",(function(e){e&&(this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Lambda=DEFNODE("Lambda","name argnames uses_arguments is_generator async",(function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t<this.argnames.length;t++)this.argnames[t]instanceof AST_Destructuring?e.push(...this.argnames[t].all_symbols()):e.push(this.argnames[t]);return e},_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e);for(var t=this.argnames,n=0,i=t.length;n<i;n++)t[n]._walk(e);walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);for(t=this.argnames.length;t--;)e(this.argnames[t]);this.name&&e(this.name);},is_braceless(){return this.body[0]instanceof AST_Return&&this.body[0].value},length_property(){let e=0;for(const t of this.argnames)(t instanceof AST_SymbolFunarg||t instanceof AST_Destructuring)&&e++;return e}},AST_Scope),AST_Accessor=DEFNODE("Accessor",null,(function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A setter/getter function.  The `name` property is always null."},AST_Lambda),AST_Function=DEFNODE("Function",null,(function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A function expression"},AST_Lambda),AST_Arrow=DEFNODE("Arrow",null,(function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An ES6 Arrow function ((a) => b)"},AST_Lambda),AST_Defun=DEFNODE("Defun",null,(function(e){e&&(this.name=e.name,this.argnames=e.argnames,this.uses_arguments=e.uses_arguments,this.is_generator=e.is_generator,this.async=e.async,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A function definition"},AST_Lambda),AST_Destructuring=DEFNODE("Destructuring","names is_array",(function(e){e&&(this.names=e.names,this.is_array=e.is_array,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.names.length;for(;t--;)e(this.names[t]);},all_symbols:function(){var e=[];return this.walk(new TreeWalker((function(t){t instanceof AST_Symbol&&e.push(t);}))),e}}),AST_PrefixedTemplateString=DEFNODE("PrefixedTemplateString","template_string prefix",(function(e){e&&(this.template_string=e.template_string,this.prefix=e.prefix,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e),this.template_string._walk(e);}))},_children_backwards(e){e(this.template_string),e(this.prefix);}}),AST_TemplateString=DEFNODE("TemplateString","segments",(function(e){e&&(this.segments=e.segments,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.segments.length;for(;t--;)e(this.segments[t]);}}),AST_TemplateSegment=DEFNODE("TemplateSegment","value raw",(function(e){e&&(this.value=e.value,this.raw=e.raw,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}}),AST_Jump=DEFNODE("Jump",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},AST_Statement),AST_Exit=DEFNODE("Exit","value",(function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e);})},_children_backwards(e){this.value&&e(this.value);}},AST_Jump),AST_Return=DEFNODE("Return",null,(function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `return` statement"},AST_Exit),AST_Throw=DEFNODE("Throw",null,(function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `throw` statement"},AST_Exit),AST_LoopControl=DEFNODE("LoopControl","label",(function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e);})},_children_backwards(e){this.label&&e(this.label);}},AST_Jump),AST_Break=DEFNODE("Break",null,(function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `break` statement"},AST_LoopControl),AST_Continue=DEFNODE("Continue",null,(function(e){e&&(this.label=e.label,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `continue` statement"},AST_LoopControl),AST_Await=DEFNODE("Await","expression",(function(e){e&&(this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Yield=DEFNODE("Yield","expression is_star",(function(e){e&&(this.expression=e.expression,this.is_star=e.is_star,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e);})},_children_backwards(e){this.expression&&e(this.expression);}}),AST_If=DEFNODE("If","condition alternative",(function(e){e&&(this.condition=e.condition,this.alternative=e.alternative,this.body=e.body,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e);}))},_children_backwards(e){this.alternative&&e(this.alternative),e(this.body),e(this.condition);}},AST_StatementWithBody),AST_Switch=DEFNODE("Switch","expression",(function(e){e&&(this.expression=e.expression,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_Block),AST_SwitchBranch=DEFNODE("SwitchBranch",null,(function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for `switch` branches"},AST_Block),AST_Default=DEFNODE("Default",null,(function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `default` switch branch"},AST_SwitchBranch),AST_Case=DEFNODE("Case","expression",(function(e){e&&(this.expression=e.expression,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_SwitchBranch),AST_Try=DEFNODE("Try","bcatch bfinally",(function(e){e&&(this.bcatch=e.bcatch,this.bfinally=e.bfinally,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e);}))},_children_backwards(e){this.bfinally&&e(this.bfinally),this.bcatch&&e(this.bcatch);let t=this.body.length;for(;t--;)e(this.body[t]);}},AST_Block),AST_Catch=DEFNODE("Catch","argname",(function(e){e&&(this.argname=e.argname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){this.argname&&this.argname._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);this.argname&&e(this.argname);}},AST_Block),AST_Finally=DEFNODE("Finally",null,(function(e){e&&(this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},AST_Block),AST_Definitions=DEFNODE("Definitions","definitions",(function(e){e&&(this.definitions=e.definitions,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){for(var t=this.definitions,n=0,i=t.length;n<i;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.definitions.length;for(;t--;)e(this.definitions[t]);}},AST_Statement),AST_Var=DEFNODE("Var",null,(function(e){e&&(this.definitions=e.definitions,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `var` statement"},AST_Definitions),AST_Let=DEFNODE("Let",null,(function(e){e&&(this.definitions=e.definitions,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `let` statement"},AST_Definitions),AST_Const=DEFNODE("Const",null,(function(e){e&&(this.definitions=e.definitions,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A `const` statement"},AST_Definitions),AST_VarDef=DEFNODE("VarDef","name value",(function(e){e&&(this.name=e.name,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A variable declaration; only appears in a AST_Definitions node",$propdoc:{name:"[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable",value:"[AST_Node?] initializer, or null of there's no initializer"},_walk:function(e){return e._visit(this,(function(){this.name._walk(e),this.value&&this.value._walk(e);}))},_children_backwards(e){this.value&&e(this.value),e(this.name);}}),AST_NameMapping=DEFNODE("NameMapping","foreign_name name",(function(e){e&&(this.foreign_name=e.foreign_name,this.name=e.name,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The part of the export/import statement that declare names from a module.",$propdoc:{foreign_name:"[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)",name:"[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module."},_walk:function(e){return e._visit(this,(function(){this.foreign_name._walk(e),this.name._walk(e);}))},_children_backwards(e){e(this.name),e(this.foreign_name);}}),AST_Import=DEFNODE("Import","imported_name imported_names module_name assert_clause",(function(e){e&&(this.imported_name=e.imported_name,this.imported_names=e.imported_names,this.module_name=e.module_name,this.assert_clause=e.assert_clause,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An `import` statement",$propdoc:{imported_name:"[AST_SymbolImport] The name of the variable holding the module's default export.",imported_names:"[AST_NameMapping*] The names of non-default imported variables",module_name:"[AST_String] String literal describing where this module came from",assert_clause:"[AST_Object?] The import assertion"},_walk:function(e){return e._visit(this,(function(){this.imported_name&&this.imported_name._walk(e),this.imported_names&&this.imported_names.forEach((function(t){t._walk(e);})),this.module_name._walk(e);}))},_children_backwards(e){if(e(this.module_name),this.imported_names){let t=this.imported_names.length;for(;t--;)e(this.imported_names[t]);}this.imported_name&&e(this.imported_name);}}),AST_ImportMeta=DEFNODE("ImportMeta",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A reference to import.meta"}),AST_Export=DEFNODE("Export","exported_definition exported_value is_default exported_names module_name assert_clause",(function(e){e&&(this.exported_definition=e.exported_definition,this.exported_value=e.exported_value,this.is_default=e.is_default,this.exported_names=e.exported_names,this.module_name=e.module_name,this.assert_clause=e.assert_clause,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An `export` statement",$propdoc:{exported_definition:"[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition",exported_value:"[AST_Node?] An exported value",exported_names:"[AST_NameMapping*?] List of exported names",module_name:"[AST_String?] Name of the file to load exports from",is_default:"[Boolean] Whether this is the default exported value of this module",assert_clause:"[AST_Object?] The import assertion"},_walk:function(e){return e._visit(this,(function(){this.exported_definition&&this.exported_definition._walk(e),this.exported_value&&this.exported_value._walk(e),this.exported_names&&this.exported_names.forEach((function(t){t._walk(e);})),this.module_name&&this.module_name._walk(e);}))},_children_backwards(e){if(this.module_name&&e(this.module_name),this.exported_names){let t=this.exported_names.length;for(;t--;)e(this.exported_names[t]);}this.exported_value&&e(this.exported_value),this.exported_definition&&e(this.exported_definition);}},AST_Statement),AST_Call=DEFNODE("Call","expression args optional _annotations",(function(e){e&&(this.expression=e.expression,this.args=e.args,this.optional=e.optional,this._annotations=e._annotations,this.start=e.start,this.end=e.end,this.initialize()),this.flags=0;}),{$documentation:"A function call expression",$propdoc:{expression:"[AST_Node] expression to invoke as function",args:"[AST_Node*] array of arguments",optional:"[boolean] whether this is an optional call (IE ?.() )",_annotations:"[number] bitfield containing information about the call"},initialize(){null==this._annotations&&(this._annotations=0);},_walk(e){return e._visit(this,(function(){for(var t=this.args,n=0,i=t.length;n<i;n++)t[n]._walk(e);this.expression._walk(e);}))},_children_backwards(e){let t=this.args.length;for(;t--;)e(this.args[t]);e(this.expression);}}),AST_New=DEFNODE("New",null,(function(e){e&&(this.expression=e.expression,this.args=e.args,this.optional=e.optional,this._annotations=e._annotations,this.start=e.start,this.end=e.end,this.initialize()),this.flags=0;}),{$documentation:"An object instantiation.  Derives from a function call since it has exactly the same properties"},AST_Call),AST_Sequence=DEFNODE("Sequence","expressions",(function(e){e&&(this.expressions=e.expressions,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A sequence expression (comma-separated expressions)",$propdoc:{expressions:"[AST_Node*] array of expressions (at least two)"},_walk:function(e){return e._visit(this,(function(){this.expressions.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.expressions.length;for(;t--;)e(this.expressions[t]);}}),AST_PropAccess=DEFNODE("PropAccess","expression property optional",(function(e){e&&(this.expression=e.expression,this.property=e.property,this.optional=e.optional,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:'Base class for property access expressions, i.e. `a.foo` or `a["foo"]`',$propdoc:{expression:"[AST_Node] the “container” expression",property:"[AST_Node|string] the property to access.  For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node",optional:"[boolean] whether this is an optional property access (IE ?.)"}}),AST_Dot=DEFNODE("Dot","quote",(function(e){e&&(this.quote=e.quote,this.expression=e.expression,this.property=e.property,this.optional=e.optional,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A dotted property access expression",$propdoc:{quote:"[string] the original quote character when transformed from AST_Sub"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_DotHash=DEFNODE("DotHash","",(function(e){e&&(this.expression=e.expression,this.property=e.property,this.optional=e.optional,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A dotted property access to a private property",_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_Sub=DEFNODE("Sub",null,(function(e){e&&(this.expression=e.expression,this.property=e.property,this.optional=e.optional,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:'Index-style property access, i.e. `a["foo"]`',_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.property._walk(e);}))},_children_backwards(e){e(this.property),e(this.expression);}},AST_PropAccess),AST_Chain=DEFNODE("Chain","expression",(function(e){e&&(this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A chain expression like a?.b?.(c)?.[d]",$propdoc:{expression:"[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element."},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Unary=DEFNODE("Unary","operator expression",(function(e){e&&(this.operator=e.operator,this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for unary expressions",$propdoc:{operator:"[string] the operator",expression:"[AST_Node] expression that this unary operator applies to"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_UnaryPrefix=DEFNODE("UnaryPrefix",null,(function(e){e&&(this.operator=e.operator,this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Unary prefix expression, i.e. `typeof i` or `++i`"},AST_Unary),AST_UnaryPostfix=DEFNODE("UnaryPostfix",null,(function(e){e&&(this.operator=e.operator,this.expression=e.expression,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Unary postfix expression, i.e. `i++`"},AST_Unary),AST_Binary=DEFNODE("Binary","operator left right",(function(e){e&&(this.operator=e.operator,this.left=e.left,this.right=e.right,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Binary expression, i.e. `a + b`",$propdoc:{left:"[AST_Node] left-hand side expression",operator:"[string] the operator",right:"[AST_Node] right-hand side expression"},_walk:function(e){return e._visit(this,(function(){this.left._walk(e),this.right._walk(e);}))},_children_backwards(e){e(this.right),e(this.left);}}),AST_Conditional=DEFNODE("Conditional","condition consequent alternative",(function(e){e&&(this.condition=e.condition,this.consequent=e.consequent,this.alternative=e.alternative,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Conditional expression using the ternary operator, i.e. `a ? b : c`",$propdoc:{condition:"[AST_Node]",consequent:"[AST_Node]",alternative:"[AST_Node]"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.consequent._walk(e),this.alternative._walk(e);}))},_children_backwards(e){e(this.alternative),e(this.consequent),e(this.condition);}}),AST_Assign=DEFNODE("Assign","logical",(function(e){e&&(this.logical=e.logical,this.operator=e.operator,this.left=e.left,this.right=e.right,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An assignment expression — `a = b + 5`",$propdoc:{logical:"Whether it's a logical assignment"}},AST_Binary),AST_DefaultAssign=DEFNODE("DefaultAssign",null,(function(e){e&&(this.operator=e.operator,this.left=e.left,this.right=e.right,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A default assignment expression like in `(a = 3) => a`"},AST_Binary),AST_Array=DEFNODE("Array","elements",(function(e){e&&(this.elements=e.elements,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){for(var t=this.elements,n=0,i=t.length;n<i;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.elements.length;for(;t--;)e(this.elements[t]);}}),AST_Object=DEFNODE("Object","properties",(function(e){e&&(this.properties=e.properties,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An object literal",$propdoc:{properties:"[AST_ObjectProperty*] array of properties"},_walk:function(e){return e._visit(this,(function(){for(var t=this.properties,n=0,i=t.length;n<i;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);}}),AST_ObjectProperty=DEFNODE("ObjectProperty","key value",(function(e){e&&(this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for literal object properties",$propdoc:{key:"[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.",value:"[AST_Node] property value.  For getters and setters this is an AST_Accessor."},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value._walk(e);}))},_children_backwards(e){e(this.value),this.key instanceof AST_Node&&e(this.key);}}),AST_ObjectKeyVal=DEFNODE("ObjectKeyVal","quote",(function(e){e&&(this.quote=e.quote,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A key: value object property",$propdoc:{quote:"[string] the original quote character"},computed_key(){return this.key instanceof AST_Node}},AST_ObjectProperty),AST_PrivateSetter=DEFNODE("PrivateSetter","static",(function(e){e&&(this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{static:"[boolean] whether this is a static private setter"},$documentation:"A private setter property",computed_key:()=>!1},AST_ObjectProperty),AST_PrivateGetter=DEFNODE("PrivateGetter","static",(function(e){e&&(this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{static:"[boolean] whether this is a static private getter"},$documentation:"A private getter property",computed_key:()=>!1},AST_ObjectProperty),AST_ObjectSetter=DEFNODE("ObjectSetter","quote static",(function(e){e&&(this.quote=e.quote,this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static setter (classes only)"},$documentation:"An object setter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ObjectGetter=DEFNODE("ObjectGetter","quote static",(function(e){e&&(this.quote=e.quote,this.static=e.static,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static getter (classes only)"},$documentation:"An object getter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ConciseMethod=DEFNODE("ConciseMethod","quote static is_generator async",(function(e){e&&(this.quote=e.quote,this.static=e.static,this.is_generator=e.is_generator,this.async=e.async,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] is this method static (classes only)",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},$documentation:"An ES6 concise method inside an object or class",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_PrivateMethod=DEFNODE("PrivateMethod","",(function(e){e&&(this.quote=e.quote,this.static=e.static,this.is_generator=e.is_generator,this.async=e.async,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A private class method inside a class"},AST_ConciseMethod),AST_Class=DEFNODE("Class","name extends properties",(function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{name:"[AST_SymbolClass|AST_SymbolDefClass?] optional class name.",extends:"[AST_Node]? optional parent class",properties:"[AST_ObjectProperty*] array of properties"},$documentation:"An ES6 class",_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e),this.extends&&this.extends._walk(e),this.properties.forEach((t=>t._walk(e)));}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);this.extends&&e(this.extends),this.name&&e(this.name);}},AST_Scope),AST_ClassProperty=DEFNODE("ClassProperty","static quote",(function(e){e&&(this.static=e.static,this.quote=e.quote,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value instanceof AST_Node&&this.value._walk(e);}))},_children_backwards(e){this.value instanceof AST_Node&&e(this.value),this.key instanceof AST_Node&&e(this.key);},computed_key(){return !(this.key instanceof AST_SymbolClassProperty)}},AST_ObjectProperty),AST_ClassPrivateProperty=DEFNODE("ClassPrivateProperty","",(function(e){e&&(this.static=e.static,this.quote=e.quote,this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A class property for a private property"},AST_ClassProperty),AST_PrivateIn=DEFNODE("PrivateIn","key value",(function(e){e&&(this.key=e.key,this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"An `in` binop when the key is private, eg #x in this",_walk:function(e){return e._visit(this,(function(){this.key._walk(e),this.value._walk(e);}))},_children_backwards(e){e(this.value),e(this.key);}}),AST_DefClass=DEFNODE("DefClass",null,(function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A class definition"},AST_Class),AST_ClassStaticBlock=DEFNODE("ClassStaticBlock","body block_scope",(function(e){this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end;}),{$documentation:"A block containing statements to be executed in the context of the class",$propdoc:{body:"[AST_Statement*] an array of statements"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);},clone:clone_block_scope},AST_Scope),AST_ClassExpression=DEFNODE("ClassExpression",null,(function(e){e&&(this.name=e.name,this.extends=e.extends,this.properties=e.properties,this.variables=e.variables,this.uses_with=e.uses_with,this.uses_eval=e.uses_eval,this.parent_scope=e.parent_scope,this.enclosed=e.enclosed,this.cname=e.cname,this.body=e.body,this.block_scope=e.block_scope,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A class expression."},AST_Class),AST_Symbol=DEFNODE("Symbol","scope name thedef",(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"}),AST_NewTarget=DEFNODE("NewTarget",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A reference to new.target"}),AST_SymbolDeclaration=DEFNODE("SymbolDeclaration","init",(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},AST_Symbol),AST_SymbolVar=DEFNODE("SymbolVar",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol defining a variable"},AST_SymbolDeclaration),AST_SymbolBlockDeclaration=DEFNODE("SymbolBlockDeclaration",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for block-scoped declaration symbols"},AST_SymbolDeclaration),AST_SymbolConst=DEFNODE("SymbolConst",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A constant declaration"},AST_SymbolBlockDeclaration),AST_SymbolLet=DEFNODE("SymbolLet",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A block-scoped `let` declaration"},AST_SymbolBlockDeclaration),AST_SymbolFunarg=DEFNODE("SymbolFunarg",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol naming a function argument"},AST_SymbolVar),AST_SymbolDefun=DEFNODE("SymbolDefun",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol defining a function"},AST_SymbolDeclaration),AST_SymbolMethod=DEFNODE("SymbolMethod",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol in an object defining a method"},AST_Symbol),AST_SymbolClassProperty=DEFNODE("SymbolClassProperty",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol for a class property"},AST_Symbol),AST_SymbolLambda=DEFNODE("SymbolLambda",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol naming a function expression"},AST_SymbolDeclaration),AST_SymbolDefClass=DEFNODE("SymbolDefClass",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},AST_SymbolBlockDeclaration),AST_SymbolClass=DEFNODE("SymbolClass",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},AST_SymbolDeclaration),AST_SymbolCatch=DEFNODE("SymbolCatch",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol naming the exception in catch"},AST_SymbolBlockDeclaration),AST_SymbolImport=DEFNODE("SymbolImport",null,(function(e){e&&(this.init=e.init,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol referring to an imported name"},AST_SymbolBlockDeclaration),AST_SymbolImportForeign=DEFNODE("SymbolImportForeign",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_Label=DEFNODE("Label","references",(function(e){e&&(this.references=e.references,this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end,this.initialize()),this.flags=0;}),{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[],this.thedef=this;}},AST_Symbol),AST_SymbolRef=DEFNODE("SymbolRef",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Reference to some symbol (not definition/declaration)"},AST_Symbol),AST_SymbolExport=DEFNODE("SymbolExport",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Symbol referring to a name to export"},AST_SymbolRef),AST_SymbolExportForeign=DEFNODE("SymbolExportForeign",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_LabelRef=DEFNODE("LabelRef",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Reference to a label symbol"},AST_Symbol),AST_SymbolPrivateProperty=DEFNODE("SymbolPrivateProperty",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A symbol that refers to a private property"},AST_Symbol),AST_This=DEFNODE("This",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `this` symbol"},AST_Symbol),AST_Super=DEFNODE("Super",null,(function(e){e&&(this.scope=e.scope,this.name=e.name,this.thedef=e.thedef,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `super` symbol"},AST_This),AST_Constant=DEFNODE("Constant",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for all constants",getValue:function(){return this.value}}),AST_String=DEFNODE("String","value quote",(function(e){e&&(this.value=e.value,this.quote=e.quote,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},AST_Constant),AST_Number=DEFNODE("Number","value raw",(function(e){e&&(this.value=e.value,this.raw=e.raw,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},AST_Constant),AST_BigInt=DEFNODE("BigInt","value",(function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},AST_Constant),AST_RegExp=DEFNODE("RegExp","value",(function(e){e&&(this.value=e.value,this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},AST_Constant),AST_Atom=DEFNODE("Atom",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for atoms"},AST_Constant),AST_Null=DEFNODE("Null",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `null` atom",value:null},AST_Atom),AST_NaN=DEFNODE("NaN",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The impossible value",value:NaN},AST_Atom),AST_Undefined=DEFNODE("Undefined",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `undefined` value",value:void 0},AST_Atom),AST_Hole=DEFNODE("Hole",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"A hole in an array",value:void 0},AST_Atom),AST_Infinity=DEFNODE("Infinity",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `Infinity` value",value:1/0},AST_Atom),AST_Boolean=DEFNODE("Boolean",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"Base class for booleans"},AST_Atom),AST_False=DEFNODE("False",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `false` atom",value:!1},AST_Boolean),AST_True=DEFNODE("True",null,(function(e){e&&(this.start=e.start,this.end=e.end),this.flags=0;}),{$documentation:"The `true` atom",value:!0},AST_Boolean);function walk$2(e,t,n=[e]){const i=n.push.bind(n);for(;n.length;){const e=n.pop(),o=t(e,n);if(o){if(o===walk_abort)return !0}else e._children_backwards(i);}return !1}function walk_parent(e,t,n){const i=[e],o=i.push.bind(i),r=n?n.slice():[],a=[];let s;const u={parent:(e=0)=>-1===e?s:n&&e>=r.length?(e-=r.length,n[n.length-(e+1)]):r[r.length-(1+e)]};for(;i.length;){for(s=i.pop();a.length&&i.length==a[a.length-1];)r.pop(),a.pop();const e=t(s,u);if(e){if(e===walk_abort)return !0;continue}const n=i.length;s._children_backwards(o),i.length>n&&(r.push(s),a.push(n-1));}return !1}const walk_abort=Symbol("abort walk");class TreeWalker{constructor(e){this.visit=e,this.stack=[],this.directives=Object.create(null);}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e);}:noop);return !n&&t&&t.call(e),this.pop(),n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){e instanceof AST_Lambda?this.directives=Object.create(this.directives):e instanceof AST_Directive&&!this.directives[e.value]?this.directives[e.value]=e:e instanceof AST_Class&&(this.directives=Object.create(this.directives),this.directives["use strict"]||(this.directives["use strict"]=e)),this.stack.push(e);}pop(){var e=this.stack.pop();(e instanceof AST_Lambda||e instanceof AST_Class)&&(this.directives=Object.getPrototypeOf(this.directives));}self(){return this.stack[this.stack.length-1]}find_parent(e){for(var t=this.stack,n=t.length;--n>=0;){var i=t[n];if(i instanceof e)return i}}find_scope(){for(var e=this.stack,t=e.length;--t>=0;){const n=e[t];if(n instanceof AST_Toplevel)return n;if(n instanceof AST_Lambda)return n;if(n.block_scope)return n.block_scope}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof AST_Scope&&n.body)for(var i=0;i<n.body.length;++i){var o=n.body[i];if(!(o instanceof AST_Directive))break;if(o.value==e)return o}}loopcontrol_target(e){var t=this.stack;if(e.label){for(var n=t.length;--n>=0;)if((i=t[n])instanceof AST_LabeledStatement&&i.label.name==e.label.name)return i.body}else for(n=t.length;--n>=0;){var i;if((i=t[n])instanceof AST_IterationStatement||e instanceof AST_Break&&i instanceof AST_Switch)return i}}}class TreeTransformer extends TreeWalker{constructor(e,t){super(),this.before=e,this.after=t;}}const _PURE=1,_INLINE=2,_NOINLINE=4;function def_transform(e,t){e.DEFMETHOD("transform",(function(e,n){let i;if(e.push(this),e.before&&(i=e.before(this,t,n)),void 0===i&&(i=this,t(i,e),e.after)){const t=e.after(i,n);void 0!==t&&(i=t);}return e.pop(),i}));}function do_list(e,t){return MAP(e,(function(e){return e.transform(t,!0)}))}function first_in_statement(e){let t=e.parent(-1);for(let n,i=0;n=e.parent(i);i++){if(n instanceof AST_Statement&&n.body===t)return !0;if(!(n instanceof AST_Sequence&&n.expressions[0]===t||"Call"===n.TYPE&&n.expression===t||n instanceof AST_PrefixedTemplateString&&n.prefix===t||n instanceof AST_Dot&&n.expression===t||n instanceof AST_Sub&&n.expression===t||n instanceof AST_Chain&&n.expression===t||n instanceof AST_Conditional&&n.condition===t||n instanceof AST_Binary&&n.left===t||n instanceof AST_UnaryPostfix&&n.expression===t))return !1;t=n;}}function left_is_object(e){return e instanceof AST_Object||(e instanceof AST_Sequence?left_is_object(e.expressions[0]):"Call"===e.TYPE?left_is_object(e.expression):e instanceof AST_PrefixedTemplateString?left_is_object(e.prefix):e instanceof AST_Dot||e instanceof AST_Sub||e instanceof AST_Chain?left_is_object(e.expression):e instanceof AST_Conditional?left_is_object(e.condition):e instanceof AST_Binary?left_is_object(e.left):e instanceof AST_UnaryPostfix&&left_is_object(e.expression))}def_transform(AST_Node,noop),def_transform(AST_LabeledStatement,(function(e,t){e.label=e.label.transform(t),e.body=e.body.transform(t);})),def_transform(AST_SimpleStatement,(function(e,t){e.body=e.body.transform(t);})),def_transform(AST_Block,(function(e,t){e.body=do_list(e.body,t);})),def_transform(AST_Do,(function(e,t){e.body=e.body.transform(t),e.condition=e.condition.transform(t);})),def_transform(AST_While,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t);})),def_transform(AST_For,(function(e,t){e.init&&(e.init=e.init.transform(t)),e.condition&&(e.condition=e.condition.transform(t)),e.step&&(e.step=e.step.transform(t)),e.body=e.body.transform(t);})),def_transform(AST_ForIn,(function(e,t){e.init=e.init.transform(t),e.object=e.object.transform(t),e.body=e.body.transform(t);})),def_transform(AST_With,(function(e,t){e.expression=e.expression.transform(t),e.body=e.body.transform(t);})),def_transform(AST_Exit,(function(e,t){e.value&&(e.value=e.value.transform(t));})),def_transform(AST_LoopControl,(function(e,t){e.label&&(e.label=e.label.transform(t));})),def_transform(AST_If,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t),e.alternative&&(e.alternative=e.alternative.transform(t));})),def_transform(AST_Switch,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Case,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Try,(function(e,t){e.body=do_list(e.body,t),e.bcatch&&(e.bcatch=e.bcatch.transform(t)),e.bfinally&&(e.bfinally=e.bfinally.transform(t));})),def_transform(AST_Catch,(function(e,t){e.argname&&(e.argname=e.argname.transform(t)),e.body=do_list(e.body,t);})),def_transform(AST_Definitions,(function(e,t){e.definitions=do_list(e.definitions,t);})),def_transform(AST_VarDef,(function(e,t){e.name=e.name.transform(t),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Destructuring,(function(e,t){e.names=do_list(e.names,t);})),def_transform(AST_Lambda,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.argnames=do_list(e.argnames,t),e.body instanceof AST_Node?e.body=e.body.transform(t):e.body=do_list(e.body,t);})),def_transform(AST_Call,(function(e,t){e.expression=e.expression.transform(t),e.args=do_list(e.args,t);})),def_transform(AST_Sequence,(function(e,t){const n=do_list(e.expressions,t);e.expressions=n.length?n:[new AST_Number({value:0})];})),def_transform(AST_PropAccess,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Sub,(function(e,t){e.expression=e.expression.transform(t),e.property=e.property.transform(t);})),def_transform(AST_Chain,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Yield,(function(e,t){e.expression&&(e.expression=e.expression.transform(t));})),def_transform(AST_Await,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Unary,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Binary,(function(e,t){e.left=e.left.transform(t),e.right=e.right.transform(t);})),def_transform(AST_PrivateIn,(function(e,t){e.key=e.key.transform(t),e.value=e.value.transform(t);})),def_transform(AST_Conditional,(function(e,t){e.condition=e.condition.transform(t),e.consequent=e.consequent.transform(t),e.alternative=e.alternative.transform(t);})),def_transform(AST_Array,(function(e,t){e.elements=do_list(e.elements,t);})),def_transform(AST_Object,(function(e,t){e.properties=do_list(e.properties,t);})),def_transform(AST_ObjectProperty,(function(e,t){e.key instanceof AST_Node&&(e.key=e.key.transform(t)),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Class,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.extends&&(e.extends=e.extends.transform(t)),e.properties=do_list(e.properties,t);})),def_transform(AST_ClassStaticBlock,(function(e,t){e.body=do_list(e.body,t);})),def_transform(AST_Expansion,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_NameMapping,(function(e,t){e.foreign_name=e.foreign_name.transform(t),e.name=e.name.transform(t);})),def_transform(AST_Import,(function(e,t){e.imported_name&&(e.imported_name=e.imported_name.transform(t)),e.imported_names&&do_list(e.imported_names,t),e.module_name=e.module_name.transform(t);})),def_transform(AST_Export,(function(e,t){e.exported_definition&&(e.exported_definition=e.exported_definition.transform(t)),e.exported_value&&(e.exported_value=e.exported_value.transform(t)),e.exported_names&&do_list(e.exported_names,t),e.module_name&&(e.module_name=e.module_name.transform(t));})),def_transform(AST_TemplateString,(function(e,t){e.segments=do_list(e.segments,t);})),def_transform(AST_PrefixedTemplateString,(function(e,t){e.prefix=e.prefix.transform(t),e.template_string=e.template_string.transform(t);})),function(){var e=function(e){for(var t=!0,n=0;n<e.length;n++)t&&e[n]instanceof AST_Statement&&e[n].body instanceof AST_String?e[n]=new AST_Directive({start:e[n].start,end:e[n].end,value:e[n].body.value}):!t||e[n]instanceof AST_Statement&&e[n].body instanceof AST_String||(t=!1);return e};const t=e=>e&&e.length>0?new AST_Object({start:o(e),end:r(e),properties:e.map((e=>new AST_ObjectKeyVal({start:o(e),end:r(e),key:e.key.name||e.key.value,value:s(e.value)})))}):null;var n={Program:function(t){return new AST_Toplevel({start:o(t),end:r(t),body:e(t.body.map(s))})},ArrayPattern:function(e){return new AST_Destructuring({start:o(e),end:r(e),names:e.elements.map((function(e){return null===e?new AST_Hole:s(e)})),is_array:!0})},ObjectPattern:function(e){return new AST_Destructuring({start:o(e),end:r(e),names:e.properties.map(s),is_array:!1})},AssignmentPattern:function(e){return new AST_DefaultAssign({start:o(e),end:r(e),left:s(e.left),operator:"=",right:s(e.right)})},SpreadElement:function(e){return new AST_Expansion({start:o(e),end:r(e),expression:s(e.argument)})},RestElement:function(e){return new AST_Expansion({start:o(e),end:r(e),expression:s(e.argument)})},TemplateElement:function(e){return new AST_TemplateSegment({start:o(e),end:r(e),value:e.value.cooked,raw:e.value.raw})},TemplateLiteral:function(e){for(var t=[],n=0;n<e.quasis.length;n++)t.push(s(e.quasis[n])),e.expressions[n]&&t.push(s(e.expressions[n]));return new AST_TemplateString({start:o(e),end:r(e),segments:t})},TaggedTemplateExpression:function(e){return new AST_PrefixedTemplateString({start:o(e),end:r(e),template_string:s(e.quasi),prefix:s(e.tag)})},FunctionDeclaration:function(t){return new AST_Defun({start:o(t),end:r(t),name:s(t.id),argnames:t.params.map(s),is_generator:t.generator,async:t.async,body:e(s(t.body).body)})},FunctionExpression:function(t){return new AST_Function({start:o(t),end:r(t),name:s(t.id),argnames:t.params.map(s),is_generator:t.generator,async:t.async,body:e(s(t.body).body)})},ArrowFunctionExpression:function(e){const t="BlockStatement"===e.body.type?s(e.body).body:[make_node(AST_Return,{},{value:s(e.body)})];return new AST_Arrow({start:o(e),end:r(e),argnames:e.params.map(s),body:t,async:e.async})},ExpressionStatement:function(e){return new AST_SimpleStatement({start:o(e),end:r(e),body:s(e.expression)})},TryStatement:function(e){var t=e.handlers||[e.handler];if(t.length>1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new AST_Try({start:o(e),end:r(e),body:s(e.block).body,bcatch:s(t[0]),bfinally:e.finalizer?new AST_Finally(s(e.finalizer)):null})},Property:function(e){var t=e.key,n={start:o(t||e.value),end:r(e.value),key:"Identifier"==t.type?t.name:t.value,value:s(e.value)};return e.computed&&(n.key=s(e.key)),e.method?(n.is_generator=e.value.generator,n.async=e.value.async,e.computed?n.key=s(e.key):n.key=new AST_SymbolMethod({name:n.key}),new AST_ConciseMethod(n)):"init"==e.kind?("Identifier"!=t.type&&"Literal"!=t.type&&(n.key=s(t)),new AST_ObjectKeyVal(n)):("string"!=typeof n.key&&"number"!=typeof n.key||(n.key=new AST_SymbolMethod({name:n.key})),n.value=new AST_Accessor(n.value),"get"==e.kind?new AST_ObjectGetter(n):"set"==e.kind?new AST_ObjectSetter(n):"method"==e.kind?(n.async=e.value.async,n.is_generator=e.value.generator,n.quote=e.computed?'"':null,new AST_ConciseMethod(n)):void 0)},MethodDefinition:function(e){var t={start:o(e),end:r(e),key:e.computed?s(e.key):new AST_SymbolMethod({name:e.key.name||e.key.value}),value:s(e.value),static:e.static};return "get"==e.kind?new AST_ObjectGetter(t):"set"==e.kind?new AST_ObjectSetter(t):(t.is_generator=e.value.generator,t.async=e.value.async,new AST_ConciseMethod(t))},FieldDefinition:function(e){let t;if(e.computed)t=s(e.key);else {if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=s(e.key);}return new AST_ClassProperty({start:o(e),end:r(e),key:t,value:s(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed)t=s(e.key);else {if("Identifier"!==e.key.type&&"PrivateIdentifier"!==e.key.type)throw new Error("Non-Identifier key in PropertyDefinition");t=s(e.key);}return new AST_ClassProperty({start:o(e),end:r(e),key:t,value:s(e.value),static:e.static})},StaticBlock:function(e){return new AST_ClassStaticBlock({start:o(e),end:r(e),body:e.body.map(s)})},ArrayExpression:function(e){return new AST_Array({start:o(e),end:r(e),elements:e.elements.map((function(e){return null===e?new AST_Hole:s(e)}))})},ObjectExpression:function(e){return new AST_Object({start:o(e),end:r(e),properties:e.properties.map((function(e){return "SpreadElement"===e.type||(e.type="Property"),s(e)}))})},SequenceExpression:function(e){return new AST_Sequence({start:o(e),end:r(e),expressions:e.expressions.map(s)})},MemberExpression:function(e){return new(e.computed?AST_Sub:AST_Dot)({start:o(e),end:r(e),property:e.computed?s(e.property):e.property.name,expression:s(e.object),optional:e.optional||!1})},ChainExpression:function(e){return new AST_Chain({start:o(e),end:r(e),expression:s(e.expression)})},SwitchCase:function(e){return new(e.test?AST_Case:AST_Default)({start:o(e),end:r(e),expression:s(e.test),body:e.consequent.map(s)})},VariableDeclaration:function(e){return new("const"===e.kind?AST_Const:"let"===e.kind?AST_Let:AST_Var)({start:o(e),end:r(e),definitions:e.declarations.map(s)})},ImportDeclaration:function(e){var n=null,i=null;return e.specifiers.forEach((function(e){"ImportSpecifier"===e.type?(i||(i=[]),i.push(new AST_NameMapping({start:o(e),end:r(e),foreign_name:s(e.imported),name:s(e.local)}))):"ImportDefaultSpecifier"===e.type?n=s(e.local):"ImportNamespaceSpecifier"===e.type&&(i||(i=[]),i.push(new AST_NameMapping({start:o(e),end:r(e),foreign_name:new AST_SymbolImportForeign({name:"*"}),name:s(e.local)})));})),new AST_Import({start:o(e),end:r(e),imported_name:n,imported_names:i,module_name:s(e.source),assert_clause:t(e.assertions)})},ExportAllDeclaration:function(e){return new AST_Export({start:o(e),end:r(e),exported_names:[new AST_NameMapping({name:new AST_SymbolExportForeign({name:"*"}),foreign_name:new AST_SymbolExportForeign({name:"*"})})],module_name:s(e.source),assert_clause:t(e.assertions)})},ExportNamedDeclaration:function(e){return new AST_Export({start:o(e),end:r(e),exported_definition:s(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new AST_NameMapping({foreign_name:s(e.exported),name:s(e.local)})})):null,module_name:s(e.source),assert_clause:t(e.assertions)})},ExportDefaultDeclaration:function(e){return new AST_Export({start:o(e),end:r(e),exported_value:s(e.declaration),is_default:!0})},Literal:function(e){var t=e.value,n={start:o(e),end:r(e)},i=e.regex;if(i&&i.pattern)return n.value={source:i.pattern,flags:i.flags},new AST_RegExp(n);if(i){const i=e.raw||t,o=i.match(/^\/(.*)\/(\w*)$/);if(!o)throw new Error("Invalid regex source "+i);const[r,a,s]=o;return n.value={source:a,flags:s},new AST_RegExp(n)}if(null===t)return new AST_Null(n);switch(typeof t){case"string":return n.value=t,new AST_String(n);case"number":return n.value=t,n.raw=e.raw||t.toString(),new AST_Number(n);case"boolean":return new(t?AST_True:AST_False)(n)}},MetaProperty:function(e){return "new"===e.meta.name&&"target"===e.property.name?new AST_NewTarget({start:o(e),end:r(e)}):"import"===e.meta.name&&"meta"===e.property.name?new AST_ImportMeta({start:o(e),end:r(e)}):void 0},Identifier:function(e){var t=a[a.length-2];return new("LabeledStatement"==t.type?AST_Label:"VariableDeclarator"==t.type&&t.id===e?"const"==t.kind?AST_SymbolConst:"let"==t.kind?AST_SymbolLet:AST_SymbolVar:/Import.*Specifier/.test(t.type)?t.local===e?AST_SymbolImport:AST_SymbolImportForeign:"ExportSpecifier"==t.type?t.local===e?AST_SymbolExport:AST_SymbolExportForeign:"FunctionExpression"==t.type?t.id===e?AST_SymbolLambda:AST_SymbolFunarg:"FunctionDeclaration"==t.type?t.id===e?AST_SymbolDefun:AST_SymbolFunarg:"ArrowFunctionExpression"==t.type?t.params.includes(e)?AST_SymbolFunarg:AST_SymbolRef:"ClassExpression"==t.type?t.id===e?AST_SymbolClass:AST_SymbolRef:"Property"==t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolMethod:"PropertyDefinition"==t.type||"FieldDefinition"===t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolClassProperty:"ClassDeclaration"==t.type?t.id===e?AST_SymbolDefClass:AST_SymbolRef:"MethodDefinition"==t.type?t.computed?AST_SymbolRef:AST_SymbolMethod:"CatchClause"==t.type?AST_SymbolCatch:"BreakStatement"==t.type||"ContinueStatement"==t.type?AST_LabelRef:AST_SymbolRef)({start:o(e),end:r(e),name:e.name})},BigIntLiteral:e=>new AST_BigInt({start:o(e),end:r(e),value:e.value}),EmptyStatement:function(e){return new AST_EmptyStatement({start:o(e),end:r(e)})},BlockStatement:function(e){return new AST_BlockStatement({start:o(e),end:r(e),body:e.body.map(s)})},IfStatement:function(e){return new AST_If({start:o(e),end:r(e),condition:s(e.test),body:s(e.consequent),alternative:s(e.alternate)})},LabeledStatement:function(e){return new AST_LabeledStatement({start:o(e),end:r(e),label:s(e.label),body:s(e.body)})},BreakStatement:function(e){return new AST_Break({start:o(e),end:r(e),label:s(e.label)})},ContinueStatement:function(e){return new AST_Continue({start:o(e),end:r(e),label:s(e.label)})},WithStatement:function(e){return new AST_With({start:o(e),end:r(e),expression:s(e.object),body:s(e.body)})},SwitchStatement:function(e){return new AST_Switch({start:o(e),end:r(e),expression:s(e.discriminant),body:e.cases.map(s)})},ReturnStatement:function(e){return new AST_Return({start:o(e),end:r(e),value:s(e.argument)})},ThrowStatement:function(e){return new AST_Throw({start:o(e),end:r(e),value:s(e.argument)})},WhileStatement:function(e){return new AST_While({start:o(e),end:r(e),condition:s(e.test),body:s(e.body)})},DoWhileStatement:function(e){return new AST_Do({start:o(e),end:r(e),condition:s(e.test),body:s(e.body)})},ForStatement:function(e){return new AST_For({start:o(e),end:r(e),init:s(e.init),condition:s(e.test),step:s(e.update),body:s(e.body)})},ForInStatement:function(e){return new AST_ForIn({start:o(e),end:r(e),init:s(e.left),object:s(e.right),body:s(e.body)})},ForOfStatement:function(e){return new AST_ForOf({start:o(e),end:r(e),init:s(e.left),object:s(e.right),body:s(e.body),await:e.await})},AwaitExpression:function(e){return new AST_Await({start:o(e),end:r(e),expression:s(e.argument)})},YieldExpression:function(e){return new AST_Yield({start:o(e),end:r(e),expression:s(e.argument),is_star:e.delegate})},DebuggerStatement:function(e){return new AST_Debugger({start:o(e),end:r(e)})},VariableDeclarator:function(e){return new AST_VarDef({start:o(e),end:r(e),name:s(e.id),value:s(e.init)})},CatchClause:function(e){return new AST_Catch({start:o(e),end:r(e),argname:s(e.param),body:s(e.body).body})},ThisExpression:function(e){return new AST_This({start:o(e),end:r(e)})},Super:function(e){return new AST_Super({start:o(e),end:r(e)})},BinaryExpression:function(e){return "PrivateIdentifier"===e.left.type?new AST_PrivateIn({start:o(e),end:r(e),key:new AST_SymbolPrivateProperty({start:o(e.left),end:r(e.left),name:e.left.name}),value:s(e.right)}):new AST_Binary({start:o(e),end:r(e),operator:e.operator,left:s(e.left),right:s(e.right)})},LogicalExpression:function(e){return new AST_Binary({start:o(e),end:r(e),operator:e.operator,left:s(e.left),right:s(e.right)})},AssignmentExpression:function(e){return new AST_Assign({start:o(e),end:r(e),operator:e.operator,left:s(e.left),right:s(e.right)})},ConditionalExpression:function(e){return new AST_Conditional({start:o(e),end:r(e),condition:s(e.test),consequent:s(e.consequent),alternative:s(e.alternate)})},NewExpression:function(e){return new AST_New({start:o(e),end:r(e),expression:s(e.callee),args:e.arguments.map(s)})},CallExpression:function(e){return new AST_Call({start:o(e),end:r(e),expression:s(e.callee),optional:e.optional,args:e.arguments.map(s)})}};n.UpdateExpression=n.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?AST_UnaryPrefix:AST_UnaryPostfix)({start:o(e),end:r(e),operator:e.operator,expression:s(e.argument)})},n.ClassDeclaration=n.ClassExpression=function(e){return new("ClassDeclaration"===e.type?AST_DefClass:AST_ClassExpression)({start:o(e),end:r(e),name:s(e.id),extends:s(e.superClass),properties:e.body.body.map(s)})},u(AST_EmptyStatement,(function(){return {type:"EmptyStatement"}})),u(AST_BlockStatement,(function(e){return {type:"BlockStatement",body:e.body.map(c)}})),u(AST_If,(function(e){return {type:"IfStatement",test:c(e.condition),consequent:c(e.body),alternate:c(e.alternative)}})),u(AST_LabeledStatement,(function(e){return {type:"LabeledStatement",label:c(e.label),body:c(e.body)}})),u(AST_Break,(function(e){return {type:"BreakStatement",label:c(e.label)}})),u(AST_Continue,(function(e){return {type:"ContinueStatement",label:c(e.label)}})),u(AST_With,(function(e){return {type:"WithStatement",object:c(e.expression),body:c(e.body)}})),u(AST_Switch,(function(e){return {type:"SwitchStatement",discriminant:c(e.expression),cases:e.body.map(c)}})),u(AST_Return,(function(e){return {type:"ReturnStatement",argument:c(e.value)}})),u(AST_Throw,(function(e){return {type:"ThrowStatement",argument:c(e.value)}})),u(AST_While,(function(e){return {type:"WhileStatement",test:c(e.condition),body:c(e.body)}})),u(AST_Do,(function(e){return {type:"DoWhileStatement",test:c(e.condition),body:c(e.body)}})),u(AST_For,(function(e){return {type:"ForStatement",init:c(e.init),test:c(e.condition),update:c(e.step),body:c(e.body)}})),u(AST_ForIn,(function(e){return {type:"ForInStatement",left:c(e.init),right:c(e.object),body:c(e.body)}})),u(AST_ForOf,(function(e){return {type:"ForOfStatement",left:c(e.init),right:c(e.object),body:c(e.body),await:e.await}})),u(AST_Await,(function(e){return {type:"AwaitExpression",argument:c(e.expression)}})),u(AST_Yield,(function(e){return {type:"YieldExpression",argument:c(e.expression),delegate:e.is_star}})),u(AST_Debugger,(function(){return {type:"DebuggerStatement"}})),u(AST_VarDef,(function(e){return {type:"VariableDeclarator",id:c(e.name),init:c(e.value)}})),u(AST_Catch,(function(e){return {type:"CatchClause",param:c(e.argname),body:f(e)}})),u(AST_This,(function(){return {type:"ThisExpression"}})),u(AST_Super,(function(){return {type:"Super"}})),u(AST_Binary,(function(e){return {type:"BinaryExpression",operator:e.operator,left:c(e.left),right:c(e.right)}})),u(AST_Binary,(function(e){return {type:"LogicalExpression",operator:e.operator,left:c(e.left),right:c(e.right)}})),u(AST_Assign,(function(e){return {type:"AssignmentExpression",operator:e.operator,left:c(e.left),right:c(e.right)}})),u(AST_Conditional,(function(e){return {type:"ConditionalExpression",test:c(e.condition),consequent:c(e.consequent),alternate:c(e.alternative)}})),u(AST_New,(function(e){return {type:"NewExpression",callee:c(e.expression),arguments:e.args.map(c)}})),u(AST_Call,(function(e){return {type:"CallExpression",callee:c(e.expression),optional:e.optional,arguments:e.args.map(c)}})),u(AST_Toplevel,(function(e){return p("Program",e)})),u(AST_Expansion,(function(e){return {type:_()?"RestElement":"SpreadElement",argument:c(e.expression)}})),u(AST_PrefixedTemplateString,(function(e){return {type:"TaggedTemplateExpression",tag:c(e.prefix),quasi:c(e.template_string)}})),u(AST_TemplateString,(function(e){for(var t=[],n=[],i=0;i<e.segments.length;i++)i%2!=0?n.push(c(e.segments[i])):t.push({type:"TemplateElement",value:{raw:e.segments[i].raw,cooked:e.segments[i].value},tail:i===e.segments.length-1});return {type:"TemplateLiteral",quasis:t,expressions:n}})),u(AST_Defun,(function(e){return {type:"FunctionDeclaration",id:c(e.name),params:e.argnames.map(c),generator:e.is_generator,async:e.async,body:p("BlockStatement",e)}})),u(AST_Function,(function(e,t){var n=void 0!==t.is_generator?t.is_generator:e.is_generator;return {type:"FunctionExpression",id:c(e.name),params:e.argnames.map(c),generator:n,async:e.async,body:p("BlockStatement",e)}})),u(AST_Arrow,(function(e){var t={type:"BlockStatement",body:e.body.map(c)};return {type:"ArrowFunctionExpression",params:e.argnames.map(c),async:e.async,body:t}})),u(AST_Destructuring,(function(e){return e.is_array?{type:"ArrayPattern",elements:e.names.map(c)}:{type:"ObjectPattern",properties:e.names.map(c)}})),u(AST_Directive,(function(e){return {type:"ExpressionStatement",expression:{type:"Literal",value:e.value,raw:e.print_to_string()},directive:e.value}})),u(AST_SimpleStatement,(function(e){return {type:"ExpressionStatement",expression:c(e.body)}})),u(AST_SwitchBranch,(function(e){return {type:"SwitchCase",test:c(e.expression),consequent:e.body.map(c)}})),u(AST_Try,(function(e){return {type:"TryStatement",block:f(e),handler:c(e.bcatch),guardedHandlers:[],finalizer:c(e.bfinally)}})),u(AST_Catch,(function(e){return {type:"CatchClause",param:c(e.argname),guard:null,body:f(e)}})),u(AST_Definitions,(function(e){return {type:"VariableDeclaration",kind:e instanceof AST_Const?"const":e instanceof AST_Let?"let":"var",declarations:e.definitions.map(c)}}));const i=e=>{const t=[];if(e)for(const{key:n,value:i}of e.properties){const e=is_basic_identifier_string(n)?{type:"Identifier",name:n}:{type:"Literal",value:n,raw:JSON.stringify(n)};t.push({type:"ImportAttribute",key:e,value:c(i)});}return t};function o(e){var t=e.loc,n=t&&t.start,i=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,i?i[0]:e.start,!1,[],[],t&&t.source)}function r(e){var t=e.loc,n=t&&t.end,i=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,i?i[0]:e.end,!1,[],[],t&&t.source)}u(AST_Export,(function(e){return e.exported_names?"*"===e.exported_names[0].name.name?{type:"ExportAllDeclaration",source:c(e.module_name),assertions:i(e.assert_clause)}:{type:"ExportNamedDeclaration",specifiers:e.exported_names.map((function(e){return {type:"ExportSpecifier",exported:c(e.foreign_name),local:c(e.name)}})),declaration:c(e.exported_definition),source:c(e.module_name),assertions:i(e.assert_clause)}:{type:e.is_default?"ExportDefaultDeclaration":"ExportNamedDeclaration",declaration:c(e.exported_value||e.exported_definition)}})),u(AST_Import,(function(e){var t=[];return e.imported_name&&t.push({type:"ImportDefaultSpecifier",local:c(e.imported_name)}),e.imported_names&&"*"===e.imported_names[0].foreign_name.name?t.push({type:"ImportNamespaceSpecifier",local:c(e.imported_names[0].name)}):e.imported_names&&e.imported_names.forEach((function(e){t.push({type:"ImportSpecifier",local:c(e.name),imported:c(e.foreign_name)});})),{type:"ImportDeclaration",specifiers:t,source:c(e.module_name),assertions:i(e.assert_clause)}})),u(AST_ImportMeta,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"import"},property:{type:"Identifier",name:"meta"}}})),u(AST_Sequence,(function(e){return {type:"SequenceExpression",expressions:e.expressions.map(c)}})),u(AST_DotHash,(function(e){return {type:"MemberExpression",object:c(e.expression),computed:!1,property:{type:"PrivateIdentifier",name:e.property},optional:e.optional}})),u(AST_PropAccess,(function(e){var t=e instanceof AST_Sub;return {type:"MemberExpression",object:c(e.expression),computed:t,property:t?c(e.property):{type:"Identifier",name:e.property},optional:e.optional}})),u(AST_Chain,(function(e){return {type:"ChainExpression",expression:c(e.expression)}})),u(AST_Unary,(function(e){return {type:"++"==e.operator||"--"==e.operator?"UpdateExpression":"UnaryExpression",operator:e.operator,prefix:e instanceof AST_UnaryPrefix,argument:c(e.expression)}})),u(AST_Binary,(function(e){return "="==e.operator&&_()?{type:"AssignmentPattern",left:c(e.left),right:c(e.right)}:{type:"&&"==e.operator||"||"==e.operator||"??"===e.operator?"LogicalExpression":"BinaryExpression",left:c(e.left),operator:e.operator,right:c(e.right)}})),u(AST_PrivateIn,(function(e){return {type:"BinaryExpression",left:{type:"PrivateIdentifier",name:e.key.name},operator:"in",right:c(e.value)}})),u(AST_Array,(function(e){return {type:"ArrayExpression",elements:e.elements.map(c)}})),u(AST_Object,(function(e){return {type:"ObjectExpression",properties:e.properties.map(c)}})),u(AST_ObjectProperty,(function(e,t){var n,i=e.key instanceof AST_Node?c(e.key):{type:"Identifier",value:e.key};"number"==typeof e.key&&(i={type:"Literal",value:Number(e.key)}),"string"==typeof e.key&&(i={type:"Identifier",name:e.key});var o="string"==typeof e.key||"number"==typeof e.key,r=!o&&(!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef);return e instanceof AST_ObjectKeyVal?(n="init",r=!o):e instanceof AST_ObjectGetter?n="get":e instanceof AST_ObjectSetter&&(n="set"),e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter?{type:"MethodDefinition",computed:!1,kind:e instanceof AST_PrivateGetter?"get":"set",static:e.static,key:{type:"PrivateIdentifier",name:e.key.name},value:c(e.value)}:e instanceof AST_ClassPrivateProperty?{type:"PropertyDefinition",key:{type:"PrivateIdentifier",name:e.key.name},value:c(e.value),computed:!1,static:e.static}:e instanceof AST_ClassProperty?{type:"PropertyDefinition",key:i,value:c(e.value),computed:r,static:e.static}:t instanceof AST_Class?{type:"MethodDefinition",computed:r,kind:n,static:e.static,key:c(e.key),value:c(e.value)}:{type:"Property",computed:r,kind:n,key:i,value:c(e.value)}})),u(AST_ConciseMethod,(function(e,t){if(t instanceof AST_Object)return {type:"Property",computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,kind:"init",method:!0,shorthand:!1,key:c(e.key),value:c(e.value)};const n=e instanceof AST_PrivateMethod?{type:"PrivateIdentifier",name:e.key.name}:c(e.key);return {type:"MethodDefinition",kind:"constructor"===e.key?"constructor":"method",key:n,value:c(e.value),computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,static:e.static}})),u(AST_Class,(function(e){return {type:e instanceof AST_ClassExpression?"ClassExpression":"ClassDeclaration",superClass:c(e.extends),id:e.name?c(e.name):null,body:{type:"ClassBody",body:e.properties.map(c)}}})),u(AST_ClassStaticBlock,(function(e){return {type:"StaticBlock",body:e.body.map(c)}})),u(AST_NewTarget,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"new"},property:{type:"Identifier",name:"target"}}})),u(AST_Symbol,(function(e,t){if(e instanceof AST_SymbolMethod&&t.quote)return {type:"Literal",value:e.name};var n=e.definition();return {type:"Identifier",name:n?n.mangled_name||n.name:e.name}})),u(AST_RegExp,(function(e){const t=e.value.source,n=e.value.flags;return {type:"Literal",value:null,raw:e.print_to_string(),regex:{pattern:t,flags:n}}})),u(AST_Constant,(function(e){return {type:"Literal",value:e.value,raw:e.raw||e.print_to_string()}})),u(AST_Atom,(function(e){return {type:"Identifier",name:String(e.value)}})),u(AST_BigInt,(e=>({type:"BigIntLiteral",value:e.value}))),AST_Boolean.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Null.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Hole.DEFMETHOD("to_mozilla_ast",(function(){return null})),AST_Block.DEFMETHOD("to_mozilla_ast",AST_BlockStatement.prototype.to_mozilla_ast),AST_Lambda.DEFMETHOD("to_mozilla_ast",AST_Function.prototype.to_mozilla_ast);var a=null;function s(e){a.push(e);var t=null!=e?n[e.type](e):null;return a.pop(),t}function u(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return n=t(this,e),i=this.start,o=this.end,i&&o?(null!=i.pos&&null!=o.endpos&&(n.range=[i.pos,o.endpos]),i.line&&(n.loc={start:{line:i.line,column:i.col},end:o.endline?{line:o.endline,column:o.endcol}:null},i.file&&(n.loc.source=i.file)),n):n;var n,i,o;}));}AST_Node.from_mozilla_ast=function(e){var t=a;a=[];var n=s(e);return a=t,n};var l=null;function c(e){null===l&&(l=[]),l.push(e);var t=null!=e?e.to_mozilla_ast(l[l.length-2]):null;return l.pop(),0===l.length&&(l=null),t}function _(){for(var e=l.length;e--;)if(l[e]instanceof AST_Destructuring)return !0;return !1}function f(e){return {type:"BlockStatement",body:e.body.map(c)}}function p(e,t){var n=t.body.map(c);return t.body[0]instanceof AST_SimpleStatement&&t.body[0].body instanceof AST_String&&n.unshift(c(new AST_EmptyStatement(t.body[0]))),{type:e,body:n}}}();const EXPECT_DIRECTIVE=/^$|[;{][\s\n]*$/,r_annotation=/[@#]__(PURE|INLINE|NOINLINE)__/g;function is_some_comments(e){return ("comment2"===e.type||"comment1"===e.type)&&/@preserve|@copyright|@lic|@cc_on|^\**!/i.test(e.value)}class Rope{constructor(){this.committed="",this.current="";}append(e){this.current+=e;}insertAt(e,t){const{committed:n,current:i}=this;t<n.length?this.committed=n.slice(0,t)+e+n.slice(t):t===n.length?this.committed+=e:(t-=n.length,this.committed+=i.slice(0,t)+e,this.current=i.slice(t));}charAt(e){const{committed:t}=this;return e<t.length?t[e]:this.current[e-t.length]}curLength(){return this.current.length}length(){return this.committed.length+this.current.length}toString(){return this.committed+this.current}}function OutputStream(e){var t=!e;void 0===(e=defaults$1(e,{ascii_only:!1,beautify:!1,braces:!1,comments:"some",ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_numbers:!1,keep_quoted_props:!1,max_line_len:!1,preamble:null,preserve_annotations:!1,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1,wrap_func_args:!0,_destroy_ast:!1},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=return_false;if(e.comments){let t=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var i=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,i-1),e.comments.substr(i+1));}n=t instanceof RegExp?function(e){return "comment5"!=e.type&&t.test(e.value)}:"function"==typeof t?function(e){return "comment5"!=e.type&&t(this,e)}:"some"===t?is_some_comments:return_true;}var o=0,r=0,a=1,s=0,u=new Rope;let l=new Set;var c=e.ascii_only?function(t,n=!1,i=!1){return e.ecma>=2015&&!e.safari10&&!i&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){return "\\u{"+get_full_char_code(e,0).toString(16)+"}"}))),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return "\\x"+t}for(;t.length<4;)t="0"+t;return "\\u"+t}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){return t?"\\u"+t.charCodeAt(0).toString(16):e}))};function _(t,n){var i=function(t,n){var i=0,o=0;function r(){return "'"+t.replace(/\x27/g,"\\'")+"'"}function a(){return '"'+t.replace(/\x22/g,'\\"')+'"'}if(t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,r){switch(n){case'"':return ++i,'"';case"'":return ++o,"'";case"\\":return "\\\\";case"\n":return "\\n";case"\r":return "\\r";case"\t":return "\\t";case"\b":return "\\b";case"\f":return "\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return "\\u2028";case"\u2029":return "\\u2029";case"\ufeff":return "\\ufeff";case"\0":return /[0-9]/.test(get_full_char(t,r+1))?"\\x00":"\\0"}return n})),t=c(t),"`"===n)return "`"+t.replace(/`/g,"\\`")+"`";switch(e.quote_style){case 1:return r();case 2:return a();case 3:return "'"==n?r():a();default:return i>o?r():a()}}(t,n);return e.inline_script&&(i=(i=(i=i.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),i}var f,p,d=!1,m=!1,S=!1,h=0,A=!1,T=!1,E=-1,g="",b=e.source_map&&[],D=b?function(){b.forEach((function(t){try{let{name:n,token:i}=t;"name"==i.type||"privatename"===i.type?n=i.value:n instanceof AST_Symbol&&(n="string"===i.type?i.value:n.name),e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,is_basic_identifier_string(n)?n:void 0);}catch(e){}})),b=[];}:noop,y=e.max_line_len?function(){if(r>e.max_line_len&&h){u.insertAt("\n",h);const e=u.curLength();if(b){var t=e-r;b.forEach((function(e){e.line++,e.col+=t;}));}a++,s++,r=e;}h&&(h=0,D());}:noop,v=makePredicate("( [ + * / - , . `");function C(t){var n=get_full_char(t=String(t),0);A&&n&&(A=!1,"\n"!==n&&(C("\n"),R())),T&&n&&(T=!1,/[\s;})]/.test(n)||k()),E=-1;var i=g.charAt(g.length-1);S&&(S=!1,(":"!==i||"}"!==n)&&(n&&";}".includes(n)||";"===i)||(e.semicolons||v.has(n)?(u.append(";"),r++,s++):(y(),r>0&&(u.append("\n"),s++,a++,r=0),/^\s+$/.test(t)&&(S=!0)),e.beautify||(m=!1))),m&&((is_identifier_char(i)&&(is_identifier_char(n)||"\\"==n)||"/"==n&&n==i||("+"==n||"-"==n)&&n==g)&&(u.append(" "),r++,s++),m=!1),f&&(b.push({token:f,name:p,line:a,col:r}),f=!1,h||D()),u.append(t),d="("==t[t.length-1],s+=t.length;var o=t.split(/\r?\n/),l=o.length-1;a+=l,r+=o[0].length,l>0&&(y(),r=o[l].length),g=t;}var k=e.beautify?function(){C(" ");}:function(){m=!0;},R=e.beautify?function(t){var n;e.beautify&&C((n=t?.5:0," ".repeat(e.indent_start+o-n*e.indent_level)));}:noop,O=e.beautify?function(e,t){!0===e&&(e=x());var n=o;o=e;var i=t();return o=n,i}:function(e,t){return t()},F=e.beautify?function(){if(E<0)return C("\n");"\n"!=u.charAt(E)&&(u.insertAt("\n",E),s++,a++),E++;}:e.max_line_len?function(){y(),h=u.length();}:noop,N=e.beautify?function(){C(";");}:function(){S=!0;};function M(){S=!1,C(";");}function x(){return o+e.indent_level}var w=b?function(e,t){f=e,p=t;}:noop;function I(){return h&&y(),u.toString()}function P(){const e=u.toString();let t=e.length-1;for(;t>=0;){const n=e.charCodeAt(t);if(10===n)return !0;if(32!==n)return !1;t--;}return !0}function B(t){return e.preserve_annotations||(t=t.replace(r_annotation," ")),/^\s*$/.test(t)?"":t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}const L=e._destroy_ast?function(e){e.body.length=0,e.argnames.length=0;}:noop;var V=[];return {get:I,toString:I,indent:R,in_directive:!1,use_asm:null,active_scope:null,indentation:function(){return o},current_width:function(){return r-o},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return d},newline:F,print:C,star:function(){C("*");},space:k,comma:function(){C(","),k();},colon:function(){C(":"),k();},last:function(){return g},semicolon:N,force_semicolon:M,to_utf8:c,print_name:function(e){C(function(e){return e=e.toString(),c(e,!0)}(e));},print_string:function(e,t,n){var i=_(e,t);!0!==n||i.includes("\\")||(EXPECT_DIRECTIVE.test(u.toString())||M(),M()),C(i);},print_template_string_chars:function(e){var t=_(e,"`").replace(/\${/g,"\\${");return C(t.substr(1,t.length-2))},encode_string:_,next_indent:x,with_indent:O,with_block:function(e){var t;return C("{"),F(),O(x(),(function(){t=e();})),R(),C("}"),t},with_parens:function(e){C("(");var t=e();return C(")"),t},with_square:function(e){C("[");var t=e();return C("]"),t},add_mapping:w,option:function(t){return e[t]},gc_scope:L,printed_comments:l,prepend_comments:t?noop:function(t){var i=t.start;if(!i)return;var o=this.printed_comments;const r=t instanceof AST_Exit&&t.value;if(i.comments_before&&o.has(i.comments_before)){if(!r)return;i.comments_before=[];}var a=i.comments_before;if(a||(a=i.comments_before=[]),o.add(a),r){var u=new TreeWalker((function(e){var t=u.parent();if(!(t instanceof AST_Exit||t instanceof AST_Binary&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof AST_Conditional&&t.condition===e||t instanceof AST_Dot&&t.expression===e||t instanceof AST_Sequence&&t.expressions[0]===e||t instanceof AST_Sub&&t.expression===e||t instanceof AST_UnaryPostfix))return !0;if(e.start){var n=e.start.comments_before;n&&!o.has(n)&&(o.add(n),a=a.concat(n));}}));u.push(t),t.value.walk(u);}if(0==s){a.length>0&&e.shebang&&"comment5"===a[0].type&&!o.has(a[0])&&(C("#!"+a.shift().value+"\n"),R());var l=e.preamble;l&&C(l.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"));}if(0!=(a=a.filter(n,t).filter((e=>!o.has(e)))).length){var c=P();a.forEach((function(e,t){if(o.add(e),c||(e.nlb?(C("\n"),R(),c=!0):t>0&&k()),/comment[134]/.test(e.type))(n=B(e.value))&&(C("//"+n+"\n"),R()),c=!0;else if("comment2"==e.type){var n;(n=B(e.value))&&C("/*"+n+"*/"),c=!1;}})),c||(i.nlb?(C("\n"),R()):k());}},append_comments:t||n===return_false?noop:function(e,t){var i=e.end;if(i){var o=this.printed_comments,r=i[t?"comments_before":"comments_after"];if(r&&!o.has(r)&&(e instanceof AST_Statement||r.every((e=>!/comment[134]/.test(e.type))))){o.add(r);var a=u.length();r.filter(n,e).forEach((function(e,n){if(!o.has(e))if(o.add(e),T=!1,A?(C("\n"),R(),A=!1):e.nlb&&(n>0||!P())?(C("\n"),R()):(n>0||!t)&&k(),/comment[134]/.test(e.type)){const t=B(e.value);t&&C("//"+t),A=!0;}else if("comment2"==e.type){const t=B(e.value);t&&C("/*"+t+"*/"),T=!0;}})),u.length()>a&&(E=a);}}},line:function(){return a},col:function(){return r},pos:function(){return s},push_node:function(e){V.push(e);},pop_node:function(){return V.pop()},parent:function(e){return V[V.length-2-(e||0)]}}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t);}function t(e,n){Array.isArray(e)?e.forEach((function(e){t(e,n);})):e.DEFMETHOD("needs_parens",n);}function n(e,t,n,i){var o=e.length-1;n.in_directive=i,e.forEach((function(e,i){!0!==n.in_directive||e instanceof AST_Directive||e instanceof AST_EmptyStatement||e instanceof AST_SimpleStatement&&e.body instanceof AST_String||(n.in_directive=!1),e instanceof AST_EmptyStatement||(n.indent(),e.print(n),i==o&&t||(n.newline(),t&&n.newline())),!0===n.in_directive&&e instanceof AST_SimpleStatement&&e.body instanceof AST_String&&(n.in_directive=!1);})),n.in_directive=!1;}function i(e,t){t.print("{"),t.with_indent(t.next_indent(),(function(){t.append_comments(e,!0);})),t.add_mapping(e.end),t.print("}");}function o(e,t,o){e.body.length>0?t.with_block((function(){n(e.body,!1,t,o),t.add_mapping(e.end);})):i(e,t);}function r(e,t,n){var i=!1;n&&(i=walk$2(e,(e=>e instanceof AST_Scope&&!(e instanceof AST_Arrow)||(e instanceof AST_Binary&&"in"==e.operator||e instanceof AST_PrivateIn?walk_abort:void 0)))),e.print(t,i);}function a(e,t,n){return n.option("quote_keys")?n.print_string(e):""+ +e==e&&e>=0?n.option("keep_numbers")?n.print(e):n.print(c(e)):(ALL_RESERVED_WORDS.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!is_basic_identifier_string(e):!is_identifier_string(e,!0))||t&&n.option("keep_quoted_props")?n.print_string(e,t):n.print_name(e)}AST_Node.DEFMETHOD("print",(function(e,t){var n=this,i=n._codegen;function o(){e.prepend_comments(n),n.add_source_map(e),i(n,e),e.append_comments(n);}n instanceof AST_Scope?e.active_scope=n:!e.use_asm&&n instanceof AST_Directive&&"use asm"==n.value&&(e.use_asm=e.active_scope),e.push_node(n),t||n.needs_parens(e)?e.with_parens(o):o(),e.pop_node(),n===e.use_asm&&(e.use_asm=null);})),AST_Node.DEFMETHOD("_print",AST_Node.prototype.print),AST_Node.DEFMETHOD("print_to_string",(function(e){var t=OutputStream(e);return this.print(t),t.get()})),t(AST_Node,return_false),t(AST_Function,(function(e){return !(e.has_parens()||!first_in_statement(e))||(!!(e.option("webkit")&&(t=e.parent())instanceof AST_PropAccess&&t.expression===this)||(!!(e.option("wrap_iife")&&(t=e.parent())instanceof AST_Call&&t.expression===this)||!!(e.option("wrap_func_args")&&(t=e.parent())instanceof AST_Call&&t.args.includes(this))));var t;})),t(AST_Arrow,(function(e){var t=e.parent();return !!(e.option("wrap_func_args")&&t instanceof AST_Call&&t.args.includes(this))||t instanceof AST_PropAccess&&t.expression===this})),t(AST_Object,(function(e){return !e.has_parens()&&first_in_statement(e)})),t(AST_ClassExpression,first_in_statement),t(AST_Unary,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&this instanceof AST_UnaryPrefix&&t.left===this&&"++"!==this.operator&&"--"!==this.operator})),t(AST_Await,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&t.left===this||e.option("safari10")&&t instanceof AST_UnaryPrefix})),t(AST_Sequence,(function(e){var t=e.parent();return t instanceof AST_Call||t instanceof AST_Unary||t instanceof AST_Binary||t instanceof AST_VarDef||t instanceof AST_PropAccess||t instanceof AST_Array||t instanceof AST_ObjectProperty||t instanceof AST_Conditional||t instanceof AST_Arrow||t instanceof AST_DefaultAssign||t instanceof AST_Expansion||t instanceof AST_ForOf&&this===t.object||t instanceof AST_Yield||t instanceof AST_Export})),t(AST_Binary,(function(e){var t=e.parent();if(t instanceof AST_Call&&t.expression===this)return !0;if(t instanceof AST_Unary)return !0;if(t instanceof AST_PropAccess&&t.expression===this)return !0;if(t instanceof AST_Binary){const e=t.operator,n=this.operator;if("??"===n&&("||"===e||"&&"===e))return !0;if("??"===e&&("||"===n||"&&"===n))return !0;const i=PRECEDENCE[e],o=PRECEDENCE[n];if(i>o||i==o&&(this===t.right||"**"==e))return !0}})),t(AST_Yield,(function(e){var t=e.parent();return t instanceof AST_Binary&&"="!==t.operator||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_Unary||t instanceof AST_PropAccess&&t.expression===this||void 0})),t(AST_PropAccess,(function(e){var t=e.parent();if(t instanceof AST_New&&t.expression===this)return walk$2(this,(e=>e instanceof AST_Scope||(e instanceof AST_Call?walk_abort:void 0)))})),t(AST_Call,(function(e){var t,n=e.parent();return !!(n instanceof AST_New&&n.expression===this||n instanceof AST_Export&&n.is_default&&this.expression instanceof AST_Function)||this.expression instanceof AST_Function&&n instanceof AST_PropAccess&&n.expression===this&&(t=e.parent(1))instanceof AST_Assign&&t.left===n})),t(AST_New,(function(e){var t=e.parent();if(0===this.args.length&&(t instanceof AST_PropAccess||t instanceof AST_Call&&t.expression===this||t instanceof AST_PrefixedTemplateString&&t.prefix===this))return !0})),t(AST_Number,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(c(n)))return !0}})),t(AST_BigInt,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this&&this.getValue().startsWith("-"))return !0})),t([AST_Assign,AST_Conditional],(function(e){var t=e.parent();return t instanceof AST_Unary||t instanceof AST_Binary&&!(t instanceof AST_Assign)||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_PropAccess&&t.expression===this||this instanceof AST_Assign&&this.left instanceof AST_Destructuring&&!1===this.left.is_array||void 0})),e(AST_Directive,(function(e,t){t.print_string(e.value,e.quote),t.semicolon();})),e(AST_Expansion,(function(e,t){t.print("..."),e.expression.print(t);})),e(AST_Destructuring,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,i){i>0&&t.comma(),e.print(t),i==n-1&&e instanceof AST_Hole&&t.comma();})),t.print(e.is_array?"]":"}");})),e(AST_Debugger,(function(e,t){t.print("debugger"),t.semicolon();})),AST_StatementWithBody.DEFMETHOD("_do_print_body",(function(e){l(this.body,e);})),e(AST_Statement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_Toplevel,(function(e,t){n(e.body,!0,t,!0),t.print("");})),e(AST_LabeledStatement,(function(e,t){e.label.print(t),t.colon(),e.body.print(t);})),e(AST_SimpleStatement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_BlockStatement,(function(e,t){o(e,t);})),e(AST_EmptyStatement,(function(e,t){t.semicolon();})),e(AST_Do,(function(e,t){t.print("do"),t.space(),_(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.semicolon();})),e(AST_While,(function(e,t){t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e._do_print_body(t);})),e(AST_For,(function(e,t){t.print("for"),t.space(),t.with_parens((function(){e.init?(e.init instanceof AST_Definitions?e.init.print(t):r(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t);})),t.space(),e._do_print_body(t);})),e(AST_ForIn,(function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens((function(){e.init.print(t),t.space(),t.print(e instanceof AST_ForOf?"of":"in"),t.space(),e.object.print(t);})),t.space(),e._do_print_body(t);})),e(AST_With,(function(e,t){t.print("with"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space(),e._do_print_body(t);})),AST_Lambda.DEFMETHOD("_do_print",(function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof AST_Symbol?n.name.print(e):t&&n.name instanceof AST_Node&&e.with_square((function(){n.name.print(e);})),e.with_parens((function(){n.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),o(n,e,!0);})),e(AST_Lambda,(function(e,t){e._do_print(t),t.gc_scope(e);})),e(AST_PrefixedTemplateString,(function(e,t){var n=e.prefix,i=n instanceof AST_Lambda||n instanceof AST_Binary||n instanceof AST_Conditional||n instanceof AST_Sequence||n instanceof AST_Unary||n instanceof AST_Dot&&n.expression instanceof AST_Object;i&&t.print("("),e.prefix.print(t),i&&t.print(")"),e.template_string.print(t);})),e(AST_TemplateString,(function(e,t){var n=t.parent()instanceof AST_PrefixedTemplateString;t.print("`");for(var i=0;i<e.segments.length;i++)e.segments[i]instanceof AST_TemplateSegment?n?t.print(e.segments[i].raw):t.print_template_string_chars(e.segments[i].value):(t.print("${"),e.segments[i].print(t),t.print("}"));t.print("`");})),e(AST_TemplateSegment,(function(e,t){t.print_template_string_chars(e.value);})),AST_Arrow.DEFMETHOD("_do_print",(function(e){var t=this,n=e.parent(),i=n instanceof AST_Binary&&!(n instanceof AST_Assign)||n instanceof AST_Unary||n instanceof AST_Call&&t===n.expression;i&&e.print("("),t.async&&(e.print("async"),e.space()),1===t.argnames.length&&t.argnames[0]instanceof AST_Symbol?t.argnames[0].print(e):e.with_parens((function(){t.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),e.print("=>"),e.space();const r=t.body[0];if(1===t.body.length&&r instanceof AST_Return){const t=r.value;t?left_is_object(t)?(e.print("("),t.print(e),e.print(")")):t.print(e):e.print("{}");}else o(t,e);i&&e.print(")"),e.gc_scope(t);})),AST_Exit.DEFMETHOD("_do_print",(function(e,t){if(e.print(t),this.value){e.space();const t=this.value.start.comments_before;t&&t.length&&!e.printed_comments.has(t)?(e.print("("),this.value.print(e),e.print(")")):this.value.print(e);}e.semicolon();})),e(AST_Return,(function(e,t){e._do_print(t,"return");})),e(AST_Throw,(function(e,t){e._do_print(t,"throw");})),e(AST_Yield,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t));})),e(AST_Await,(function(e,t){t.print("await"),t.space();var n=e.expression,i=!(n instanceof AST_Call||n instanceof AST_SymbolRef||n instanceof AST_PropAccess||n instanceof AST_Unary||n instanceof AST_Constant||n instanceof AST_Await||n instanceof AST_Object);i&&t.print("("),e.expression.print(t),i&&t.print(")");})),AST_LoopControl.DEFMETHOD("_do_print",(function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon();})),e(AST_Break,(function(e,t){e._do_print(t,"break");})),e(AST_Continue,(function(e,t){e._do_print(t,"continue");})),e(AST_If,(function(e,t){t.print("if"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e.alternative?(function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof AST_Do)return _(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof AST_If){if(!n.alternative)return void _(e.body,t);n=n.alternative;}else {if(!(n instanceof AST_StatementWithBody))break;n=n.body;}l(e.body,t);}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof AST_If?e.alternative.print(t):l(e.alternative,t)):e._do_print_body(t);})),e(AST_Switch,(function(e,t){t.print("switch"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space();var n=e.body.length-1;n<0?i(e,t):t.with_block((function(){e.body.forEach((function(e,i){t.indent(!0),e.print(t),i<n&&e.body.length>0&&t.newline();}));}));})),AST_SwitchBranch.DEFMETHOD("_do_print_body",(function(e){e.newline(),this.body.forEach((function(t){e.indent(),t.print(e),e.newline();}));})),e(AST_Default,(function(e,t){t.print("default:"),e._do_print_body(t);})),e(AST_Case,(function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t);})),e(AST_Try,(function(e,t){t.print("try"),t.space(),o(e,t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t));})),e(AST_Catch,(function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens((function(){e.argname.print(t);}))),t.space(),o(e,t);})),e(AST_Finally,(function(e,t){t.print("finally"),t.space(),o(e,t);})),AST_Definitions.DEFMETHOD("_do_print",(function(e,t){e.print(t),e.space(),this.definitions.forEach((function(t,n){n&&e.comma(),t.print(e);}));var n=e.parent();(!(n instanceof AST_For||n instanceof AST_ForIn)||n&&n.init!==this)&&e.semicolon();})),e(AST_Let,(function(e,t){e._do_print(t,"let");})),e(AST_Var,(function(e,t){e._do_print(t,"var");})),e(AST_Const,(function(e,t){e._do_print(t,"const");})),e(AST_Import,(function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1===e.imported_names.length&&"*"===e.imported_names[0].foreign_name.name?e.imported_names[0].print(t):(t.print("{"),e.imported_names.forEach((function(n,i){t.space(),n.print(t),i<e.imported_names.length-1&&t.print(",");})),t.space(),t.print("}"))),(e.imported_name||e.imported_names)&&(t.space(),t.print("from"),t.space()),e.module_name.print(t),e.assert_clause&&(t.print("assert"),e.assert_clause.print(t)),t.semicolon();})),e(AST_ImportMeta,(function(e,t){t.print("import.meta");})),e(AST_NameMapping,(function(e,t){var n=t.parent()instanceof AST_Import,i=e.name.definition();(i&&i.mangled_name||e.name.name)!==e.foreign_name.name?(n?t.print(e.foreign_name.name):e.name.print(t),t.space(),t.print("as"),t.space(),n?e.name.print(t):t.print(e.foreign_name.name)):e.name.print(t);})),e(AST_Export,(function(e,t){if(t.print("export"),t.space(),e.is_default&&(t.print("default"),t.space()),e.exported_names)1===e.exported_names.length&&"*"===e.exported_names[0].name.name?e.exported_names[0].print(t):(t.print("{"),e.exported_names.forEach((function(n,i){t.space(),n.print(t),i<e.exported_names.length-1&&t.print(",");})),t.space(),t.print("}"));else if(e.exported_value)e.exported_value.print(t);else if(e.exported_definition&&(e.exported_definition.print(t),e.exported_definition instanceof AST_Definitions))return;e.module_name&&(t.space(),t.print("from"),t.space(),e.module_name.print(t)),e.assert_clause&&(t.print("assert"),e.assert_clause.print(t)),(e.exported_value&&!(e.exported_value instanceof AST_Defun||e.exported_value instanceof AST_Function||e.exported_value instanceof AST_Class)||e.module_name||e.exported_names)&&t.semicolon();})),e(AST_VarDef,(function(e,t){if(e.name.print(t),e.value){t.space(),t.print("="),t.space();var n=t.parent(1),i=n instanceof AST_For||n instanceof AST_ForIn;r(e.value,t,i);}})),e(AST_Call,(function(e,t){e.expression.print(t),e instanceof AST_New&&0===e.args.length||((e.expression instanceof AST_Call||e.expression instanceof AST_Lambda)&&t.add_mapping(e.start),e.optional&&t.print("?."),t.with_parens((function(){e.args.forEach((function(e,n){n&&t.comma(),e.print(t);}));})));})),e(AST_New,(function(e,t){t.print("new"),t.space(),AST_Call.prototype._codegen(e,t);})),AST_Sequence.DEFMETHOD("_do_print",(function(e){this.expressions.forEach((function(t,n){n>0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e);}));})),e(AST_Sequence,(function(e,t){e._do_print(t);})),e(AST_Dot,(function(e,t){var n=e.expression;n.print(t);var i=e.property,o=ALL_RESERVED_WORDS.has(i)?t.option("ie8"):!is_identifier_string(i,t.option("ecma")>=2015||t.option("safari10"));e.optional&&t.print("?."),o?(t.print("["),t.add_mapping(e.end),t.print_string(i),t.print("]")):(n instanceof AST_Number&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),e.optional||t.print("."),t.add_mapping(e.end),t.print_name(i));})),e(AST_DotHash,(function(e,t){e.expression.print(t);var n=e.property;e.optional&&t.print("?"),t.print(".#"),t.add_mapping(e.end),t.print_name(n);})),e(AST_Sub,(function(e,t){e.expression.print(t),e.optional&&t.print("?."),t.print("["),e.property.print(t),t.print("]");})),e(AST_Chain,(function(e,t){e.expression.print(t);})),e(AST_UnaryPrefix,(function(e,t){var n=e.operator;t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof AST_UnaryPrefix&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t);})),e(AST_UnaryPostfix,(function(e,t){e.expression.print(t),t.print(e.operator);})),e(AST_Binary,(function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&e.left instanceof AST_UnaryPostfix&&"--"==e.left.operator?t.print(" "):t.space(),t.print(n),("<"==n||"<<"==n)&&e.right instanceof AST_UnaryPrefix&&"!"==e.right.operator&&e.right.expression instanceof AST_UnaryPrefix&&"--"==e.right.expression.operator?t.print(" "):t.space(),e.right.print(t);})),e(AST_Conditional,(function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t);})),e(AST_Array,(function(e,t){t.with_square((function(){var n=e.elements,i=n.length;i>0&&t.space(),n.forEach((function(e,n){n&&t.comma(),e.print(t),n===i-1&&e instanceof AST_Hole&&t.comma();})),i>0&&t.space();}));})),e(AST_Object,(function(e,t){e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t);})),t.newline();})):i(e,t);})),e(AST_Class,(function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof AST_SymbolRef||e.extends instanceof AST_PropAccess||e.extends instanceof AST_ClassExpression||e.extends instanceof AST_Function);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space();}e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&t.newline(),t.indent(),e.print(t);})),t.newline();})):t.print("{}");})),e(AST_NewTarget,(function(e,t){t.print("new.target");})),e(AST_ObjectKeyVal,(function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var i=t.option("shorthand");i&&e.value instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value)===e.key&&!ALL_RESERVED_WORDS.has(e.key)?a(e.key,e.quote,t):i&&e.value instanceof AST_DefaultAssign&&e.value.left instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value.left)===e.key?(a(e.key,e.quote,t),t.space(),t.print("="),t.space(),e.value.right.print(t)):(e.key instanceof AST_Node?t.with_square((function(){e.key.print(t);})):a(e.key,e.quote,t),t.colon(),e.value.print(t));})),e(AST_ClassPrivateProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),t.print("#"),a(e.key.name,e.quote,t),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),e(AST_ClassProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),e.key instanceof AST_SymbolClassProperty?a(e.key.name,e.quote,t):(t.print("["),e.key.print(t),t.print("]")),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),AST_ObjectProperty.DEFMETHOD("_print_getter_setter",(function(e,t,n){var i=this;i.static&&(n.print("static"),n.space()),e&&(n.print(e),n.space()),i.key instanceof AST_SymbolMethod?(t&&n.print("#"),a(i.key.name,i.quote,n)):n.with_square((function(){i.key.print(n);})),i.value._do_print(n,!0);})),e(AST_ObjectSetter,(function(e,t){e._print_getter_setter("set",!1,t);})),e(AST_ObjectGetter,(function(e,t){e._print_getter_setter("get",!1,t);})),e(AST_PrivateSetter,(function(e,t){e._print_getter_setter("set",!0,t);})),e(AST_PrivateGetter,(function(e,t){e._print_getter_setter("get",!0,t);})),e(AST_PrivateMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!0,t);})),e(AST_PrivateIn,(function(e,t){e.key.print(t),t.space(),t.print("in"),t.space(),e.value.print(t);})),e(AST_SymbolPrivateProperty,(function(e,t){t.print("#"+e.name);})),e(AST_ConciseMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!1,t);})),e(AST_ClassStaticBlock,(function(e,t){t.print("static"),t.space(),o(e,t);})),AST_Symbol.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name);})),e(AST_Symbol,(function(e,t){e._do_print(t);})),e(AST_Hole,noop),e(AST_This,(function(e,t){t.print("this");})),e(AST_Super,(function(e,t){t.print("super");})),e(AST_Constant,(function(e,t){t.print(e.getValue());})),e(AST_String,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive);})),e(AST_Number,(function(e,t){(t.option("keep_numbers")||t.use_asm)&&e.raw?t.print(e.raw):t.print(c(e.getValue()));})),e(AST_BigInt,(function(e,t){t.print(e.getValue()+"n");}));const s=/(<\s*\/\s*script)/i,u=(e,t)=>t.replace("/","\\/");function l(e,t){t.option("braces")?_(e,t):!e||e instanceof AST_EmptyStatement?t.force_semicolon():e.print(t);}function c(e){var t,n,i,o=e.toString(10).replace(/^0\./,".").replace("e+","e"),r=[o];return Math.floor(e)===e&&(e<0?r.push("-0x"+(-e).toString(16).toLowerCase()):r.push("0x"+e.toString(16).toLowerCase())),(t=/^\.0+/.exec(o))?(n=t[0].length,i=o.slice(n),r.push(i+"e-"+(i.length+n-1))):(t=/0+$/.exec(o))?(n=t[0].length,r.push(o.slice(0,-n)+"e"+n)):(t=/^(\d)\.(\d+)e(-?\d+)$/.exec(o))&&r.push(t[1]+t[2]+"e"+(t[3]-t[2].length)),function(e){for(var t=e[0],n=t.length,i=1;i<e.length;++i)e[i].length<n&&(n=(t=e[i]).length);return t}(r)}function _(e,t){!e||e instanceof AST_EmptyStatement?t.print("{}"):e instanceof AST_BlockStatement?e.print(t):t.with_block((function(){t.indent(),e.print(t),t.newline();}));}function f(e,t){e.forEach((function(e){e.DEFMETHOD("add_source_map",t);}));}e(AST_RegExp,(function(e,t){let{source:n,flags:i}=e.getValue();n=regexp_source_fix(n),i=i?sort_regexp_flags(i):"",n=n.replace(s,u),t.print(t.to_utf8(`/${n}/${i}`,!1,!0));const o=t.parent();o instanceof AST_Binary&&/^\w/.test(o.operator)&&o.left===e&&t.print(" ");})),f([AST_Node,AST_LabeledStatement,AST_Toplevel],noop),f([AST_Array,AST_BlockStatement,AST_Catch,AST_Class,AST_Constant,AST_Debugger,AST_Definitions,AST_Directive,AST_Finally,AST_Jump,AST_Lambda,AST_New,AST_Object,AST_StatementWithBody,AST_Symbol,AST_Switch,AST_SwitchBranch,AST_TemplateString,AST_TemplateSegment,AST_Try],(function(e){e.add_mapping(this.start);})),f([AST_ObjectGetter,AST_ObjectSetter,AST_PrivateGetter,AST_PrivateSetter],(function(e){e.add_mapping(this.key.end,this.key.name);})),f([AST_ObjectProperty],(function(e){e.add_mapping(this.start,this.key);}));}();const shallow_cmp=(e,t)=>null===e&&null===t||e.TYPE===t.TYPE&&e.shallow_cmp(t),equivalent_to=(e,t)=>{if(!shallow_cmp(e,t))return !1;const n=[e],i=[t],o=n.push.bind(n),r=i.push.bind(i);for(;n.length&&i.length;){const e=n.pop(),t=i.pop();if(!shallow_cmp(e,t))return !1;if(e._children_backwards(o),t._children_backwards(r),n.length!==i.length)return !1}return 0==n.length&&0==i.length},pass_through=()=>!0;AST_Node.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)},AST_Debugger.prototype.shallow_cmp=pass_through,AST_Directive.prototype.shallow_cmp=function(e){return this.value===e.value},AST_SimpleStatement.prototype.shallow_cmp=pass_through,AST_Block.prototype.shallow_cmp=pass_through,AST_EmptyStatement.prototype.shallow_cmp=pass_through,AST_LabeledStatement.prototype.shallow_cmp=function(e){return this.label.name===e.label.name},AST_Do.prototype.shallow_cmp=pass_through,AST_While.prototype.shallow_cmp=pass_through,AST_For.prototype.shallow_cmp=function(e){return (null==this.init?null==e.init:this.init===e.init)&&(null==this.condition?null==e.condition:this.condition===e.condition)&&(null==this.step?null==e.step:this.step===e.step)},AST_ForIn.prototype.shallow_cmp=pass_through,AST_ForOf.prototype.shallow_cmp=pass_through,AST_With.prototype.shallow_cmp=pass_through,AST_Toplevel.prototype.shallow_cmp=pass_through,AST_Expansion.prototype.shallow_cmp=pass_through,AST_Lambda.prototype.shallow_cmp=function(e){return this.is_generator===e.is_generator&&this.async===e.async},AST_Destructuring.prototype.shallow_cmp=function(e){return this.is_array===e.is_array},AST_PrefixedTemplateString.prototype.shallow_cmp=pass_through,AST_TemplateString.prototype.shallow_cmp=pass_through,AST_TemplateSegment.prototype.shallow_cmp=function(e){return this.value===e.value},AST_Jump.prototype.shallow_cmp=pass_through,AST_LoopControl.prototype.shallow_cmp=pass_through,AST_Await.prototype.shallow_cmp=pass_through,AST_Yield.prototype.shallow_cmp=function(e){return this.is_star===e.is_star},AST_If.prototype.shallow_cmp=function(e){return null==this.alternative?null==e.alternative:this.alternative===e.alternative},AST_Switch.prototype.shallow_cmp=pass_through,AST_SwitchBranch.prototype.shallow_cmp=pass_through,AST_Try.prototype.shallow_cmp=function(e){return (null==this.bcatch?null==e.bcatch:this.bcatch===e.bcatch)&&(null==this.bfinally?null==e.bfinally:this.bfinally===e.bfinally)},AST_Catch.prototype.shallow_cmp=function(e){return null==this.argname?null==e.argname:this.argname===e.argname},AST_Finally.prototype.shallow_cmp=pass_through,AST_Definitions.prototype.shallow_cmp=pass_through,AST_VarDef.prototype.shallow_cmp=function(e){return null==this.value?null==e.value:this.value===e.value},AST_NameMapping.prototype.shallow_cmp=pass_through,AST_Import.prototype.shallow_cmp=function(e){return (null==this.imported_name?null==e.imported_name:this.imported_name===e.imported_name)&&(null==this.imported_names?null==e.imported_names:this.imported_names===e.imported_names)},AST_ImportMeta.prototype.shallow_cmp=pass_through,AST_Export.prototype.shallow_cmp=function(e){return (null==this.exported_definition?null==e.exported_definition:this.exported_definition===e.exported_definition)&&(null==this.exported_value?null==e.exported_value:this.exported_value===e.exported_value)&&(null==this.exported_names?null==e.exported_names:this.exported_names===e.exported_names)&&this.module_name===e.module_name&&this.is_default===e.is_default},AST_Call.prototype.shallow_cmp=pass_through,AST_Sequence.prototype.shallow_cmp=pass_through,AST_PropAccess.prototype.shallow_cmp=pass_through,AST_Chain.prototype.shallow_cmp=pass_through,AST_Dot.prototype.shallow_cmp=function(e){return this.property===e.property},AST_DotHash.prototype.shallow_cmp=function(e){return this.property===e.property},AST_Unary.prototype.shallow_cmp=function(e){return this.operator===e.operator},AST_Binary.prototype.shallow_cmp=function(e){return this.operator===e.operator},AST_Conditional.prototype.shallow_cmp=pass_through,AST_Array.prototype.shallow_cmp=pass_through,AST_Object.prototype.shallow_cmp=pass_through,AST_ObjectProperty.prototype.shallow_cmp=pass_through,AST_ObjectKeyVal.prototype.shallow_cmp=function(e){return this.key===e.key},AST_ObjectSetter.prototype.shallow_cmp=function(e){return this.static===e.static},AST_ObjectGetter.prototype.shallow_cmp=function(e){return this.static===e.static},AST_ConciseMethod.prototype.shallow_cmp=function(e){return this.static===e.static&&this.is_generator===e.is_generator&&this.async===e.async},AST_Class.prototype.shallow_cmp=function(e){return (null==this.name?null==e.name:this.name===e.name)&&(null==this.extends?null==e.extends:this.extends===e.extends)},AST_ClassProperty.prototype.shallow_cmp=function(e){return this.static===e.static},AST_Symbol.prototype.shallow_cmp=function(e){return this.name===e.name},AST_NewTarget.prototype.shallow_cmp=pass_through,AST_This.prototype.shallow_cmp=pass_through,AST_Super.prototype.shallow_cmp=pass_through,AST_String.prototype.shallow_cmp=function(e){return this.value===e.value},AST_Number.prototype.shallow_cmp=function(e){return this.value===e.value},AST_BigInt.prototype.shallow_cmp=function(e){return this.value===e.value},AST_RegExp.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source},AST_Atom.prototype.shallow_cmp=pass_through;let function_defs=null,unmangleable_names=null,scopes_with_block_defuns=null;class SymbolDef{constructor(e,t,n){this.name=t.name,this.orig=[t],this.init=n,this.eliminated=0,this.assignments=0,this.scope=e,this.replaced=0,this.global=!1,this.export=0,this.mangled_name=null,this.undeclared=!1,this.id=SymbolDef.next_id++,this.chained=!1,this.direct_access=!1,this.escaped=0,this.recursive_refs=0,this.references=[],this.should_replace=void 0,this.single_use=!1,this.fixed=!1,Object.seal(this);}fixed_value(){return !this.fixed||this.fixed instanceof AST_Node?this.fixed:this.fixed()}unmangleable(e){return e||(e={}),!!(function_defs&&function_defs.has(this.id)&&keep_name(e.keep_fnames,this.orig[0].name))||this.global&&!e.toplevel||1&this.export||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof AST_SymbolLambda||this.orig[0]instanceof AST_SymbolDefun)&&keep_name(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof AST_SymbolMethod||(this.orig[0]instanceof AST_SymbolClass||this.orig[0]instanceof AST_SymbolDefClass)&&keep_name(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope,i=this.orig[0];e.ie8&&i instanceof AST_SymbolLambda&&(n=n.parent_scope);const o=redefined_catch_def(this);this.mangled_name=o?o.mangled_name||o.name:n.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name);}}}function redefined_catch_def(e){if(e.orig[0]instanceof AST_SymbolCatch&&e.scope.is_block_scope())return e.scope.get_defun_scope().variables.get(e.name)}function find_scopes_visible_from(e){const t=new Set;for(const n of new Set(e))!function e(n){null==n||t.has(n)||(t.add(n),e(n.parent_scope));}(n);return [...t]}function next_mangled(e,t){let n;scopes_with_block_defuns&&(n=e.get_defun_scope())&&scopes_with_block_defuns.has(n)&&(e=n);var i=e.enclosed,o=t.nth_identifier;e:for(;;){var r=o.get(++e.cname);if(!ALL_RESERVED_WORDS.has(r)&&!(t.reserved.has(r)||unmangleable_names&&unmangleable_names.has(r))){for(let e=i.length;--e>=0;){const n=i[e];if(r==(n.mangled_name||n.unmangleable(t)&&n.name))continue e}return r}}}function format_mangler_options(e){return (e=defaults$1(e,{eval:!1,nth_identifier:base54,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,reserved:[],toplevel:!1})).module&&(e.toplevel=!0),Array.isArray(e.reserved)||e.reserved instanceof Set||(e.reserved=[]),e.reserved=new Set(e.reserved),e.reserved.add("arguments"),e}SymbolDef.next_id=1,AST_Scope.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){if(e=defaults$1(e,{cache:null,ie8:!1,safari10:!1}),!(n instanceof AST_Toplevel))throw new Error("Invalid toplevel scope");var i=this.parent_scope=t,o=new Map,r=null,a=null,s=[],u=new TreeWalker(((t,n)=>{if(t.is_block_scope()){const o=i;t.block_scope=i=new AST_Scope(t),i._block_scope=!0;const r=t instanceof AST_Catch?o.parent_scope:o;if(i.init_scope_vars(r),i.uses_with=o.uses_with,i.uses_eval=o.uses_eval,e.safari10&&(t instanceof AST_For||t instanceof AST_ForIn)&&s.push(i),t instanceof AST_Switch){const e=i;i=o,t.expression.walk(u),i=e;for(let e=0;e<t.body.length;e++)t.body[e].walk(u);}else n();return i=o,!0}if(t instanceof AST_Destructuring){const e=a;return a=t,n(),a=e,!0}if(t instanceof AST_Scope){t.init_scope_vars(i);var c=i,_=r,f=o;return r=i=t,o=new Map,n(),i=c,r=_,o=f,!0}if(t instanceof AST_LabeledStatement){var p=t.label;if(o.has(p.name))throw new Error(string_template("Label {name} defined twice",p));return o.set(p.name,p),n(),o.delete(p.name),!0}if(t instanceof AST_With)for(var d=i;d;d=d.parent_scope)d.uses_with=!0;else {if(t instanceof AST_Symbol&&(t.scope=i),t instanceof AST_Label&&(t.thedef=t,t.references=[]),t instanceof AST_SymbolLambda)r.def_function(t,"arguments"==t.name?void 0:r);else if(t instanceof AST_SymbolDefun){const e=r.parent_scope;t.scope=u.directives["use strict"]?e:e.get_defun_scope(),l(t.scope.def_function(t,r),1);}else if(t instanceof AST_SymbolClass)l(r.def_variable(t,r),1);else if(t instanceof AST_SymbolImport)i.def_variable(t);else if(t instanceof AST_SymbolDefClass)l((t.scope=r.parent_scope).def_function(t,r),1);else if(t instanceof AST_SymbolVar||t instanceof AST_SymbolLet||t instanceof AST_SymbolConst||t instanceof AST_SymbolCatch){if((m=t instanceof AST_SymbolBlockDeclaration?i.def_variable(t,null):r.def_variable(t,"SymbolVar"==t.TYPE?null:void 0)).orig.every((e=>e===t||(t instanceof AST_SymbolBlockDeclaration?e instanceof AST_SymbolLambda:!(e instanceof AST_SymbolLet||e instanceof AST_SymbolConst))))||js_error(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof AST_SymbolFunarg||l(m,2),r!==i){t.mark_enclosed();var m=i.find_variable(t);t.thedef!==m&&(t.thedef=m,t.reference());}}else if(t instanceof AST_LabelRef){var S=o.get(t.name);if(!S)throw new Error(string_template("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=S;}i instanceof AST_Toplevel||!(t instanceof AST_Export||t instanceof AST_Import)||js_error(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos);}}));function l(e,t){if(a){var n=0;do{t++;}while(u.parent(n++)!==a)}var i=u.parent(t);if(e.export=i instanceof AST_Export?1:0){var o=i.exported_definition;(o instanceof AST_Defun||o instanceof AST_DefClass)&&i.is_default&&(e.export=2);}}if(this.walk(u),this instanceof AST_Toplevel&&(this.globals=new Map),u=new TreeWalker((e=>{if(e instanceof AST_LoopControl&&e.label)return e.label.thedef.references.push(e),!0;if(e instanceof AST_SymbolRef){var t,i=e.name;if("eval"==i&&u.parent()instanceof AST_Call)for(var o=e.scope;o&&!o.uses_eval;o=o.parent_scope)o.uses_eval=!0;return u.parent()instanceof AST_NameMapping&&u.parent(1).module_name||!(t=e.scope.find_variable(i))?(t=n.def_global(e),e instanceof AST_SymbolExport&&(t.export=1)):t.scope instanceof AST_Lambda&&"arguments"==i&&(t.scope.get_defun_scope().uses_arguments=!0),e.thedef=t,e.reference(),!e.scope.is_block_scope()||t.orig[0]instanceof AST_SymbolBlockDeclaration||(e.scope=e.scope.get_defun_scope()),!0}var r;if(e instanceof AST_SymbolCatch&&(r=redefined_catch_def(e.definition())))for(o=e.scope;o&&(push_uniq(o.enclosed,r),o!==r.scope);)o=o.parent_scope;})),this.walk(u),(e.ie8||e.safari10)&&walk$2(this,(e=>{if(e instanceof AST_SymbolCatch){var t=e.name,i=e.thedef.references,o=e.scope.get_defun_scope(),r=o.find_variable(t)||n.globals.get(t)||o.def_variable(e);return i.forEach((function(e){e.thedef=r,e.reference();})),e.thedef=r,e.reference(),!0}})),e.safari10)for(const e of s)e.parent_scope.variables.forEach((function(t){push_uniq(e.enclosed,t);}));})),AST_Toplevel.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n))return t.get(n);var i=new SymbolDef(this,e);return i.undeclared=!0,i.global=!0,t.set(n,i),i})),AST_Scope.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map,this.uses_with=!1,this.uses_eval=!1,this.parent_scope=e,this.enclosed=[],this.cname=-1;})),AST_Scope.DEFMETHOD("conflicting_def",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)})),AST_Scope.DEFMETHOD("conflicting_def_shallow",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)})),AST_Scope.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this,e instanceof AST_Arrow&&!this.uses_arguments&&(this.uses_arguments=walk$2(e,(e=>e instanceof AST_SymbolRef&&e.scope instanceof AST_Lambda&&"arguments"===e.name?walk_abort:e instanceof AST_Lambda&&!(e instanceof AST_Arrow)||void 0))),this.uses_with=this.uses_with||e.uses_with,this.uses_eval=this.uses_eval||e.uses_eval;const t=(()=>{const e=[];let t=this;do{e.push(t);}while(t=t.parent_scope);return e.reverse(),e})(),n=new Set(e.enclosed),i=[];for(const e of t){i.forEach((t=>push_uniq(e.enclosed,t)));for(const t of e.variables.values())n.has(t)&&(push_uniq(i,t),push_uniq(e.enclosed,t));}})),AST_Scope.DEFMETHOD("create_symbol",(function(e,{source:t,tentative_name:n,scope:i,conflict_scopes:o=[i],init:r=null}={}){let a;if(o=find_scopes_visible_from(o),n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;for(;o.find((e=>e.conflicting_def_shallow(a)));)a=n+"$"+e++;}if(!a)throw new Error("No symbol name could be generated in create_symbol()");const s=make_node(e,t,{name:a,scope:i});return this.def_variable(s,r||null),s.mark_enclosed(),s})),AST_Node.DEFMETHOD("is_block_scope",return_false),AST_Class.DEFMETHOD("is_block_scope",return_false),AST_Lambda.DEFMETHOD("is_block_scope",return_false),AST_Toplevel.DEFMETHOD("is_block_scope",return_false),AST_SwitchBranch.DEFMETHOD("is_block_scope",return_false),AST_Block.DEFMETHOD("is_block_scope",return_true),AST_Scope.DEFMETHOD("is_block_scope",(function(){return this._block_scope||!1})),AST_IterationStatement.DEFMETHOD("is_block_scope",return_true),AST_Lambda.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1,this.def_variable(new AST_SymbolFunarg({name:"arguments",start:this.start,end:this.end}));})),AST_Arrow.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1;})),AST_Symbol.DEFMETHOD("mark_enclosed",(function(){for(var e=this.definition(),t=this.scope;t&&(push_uniq(t.enclosed,e),t!==e.scope);)t=t.parent_scope;})),AST_Symbol.DEFMETHOD("reference",(function(){this.definition().references.push(this),this.mark_enclosed();})),AST_Scope.DEFMETHOD("find_variable",(function(e){return e instanceof AST_Symbol&&(e=e.name),this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)})),AST_Scope.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);return (!n.init||n.init instanceof AST_Defun)&&(n.init=t),n})),AST_Scope.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);return n?(n.orig.push(e),n.init&&(n.scope!==e.scope||n.init instanceof AST_Function)&&(n.init=t)):(n=new SymbolDef(this,e,t),this.variables.set(e.name,n),n.global=!this.parent_scope),e.thedef=n})),AST_Scope.DEFMETHOD("next_mangled",(function(e){return next_mangled(this,e)})),AST_Toplevel.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=next_mangled(this,e);}while(n.has(t));return t})),AST_Function.DEFMETHOD("next_mangled",(function(e,t){for(var n=t.orig[0]instanceof AST_SymbolFunarg&&this.name&&this.name.definition(),i=n?n.mangled_name||n.name:null;;){var o=next_mangled(this,e);if(!i||i!=o)return o}})),AST_Symbol.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return !t||t.unmangleable(e)})),AST_Label.DEFMETHOD("unmangleable",return_false),AST_Symbol.DEFMETHOD("unreferenced",(function(){return !this.definition().references.length&&!this.scope.pinned()})),AST_Symbol.DEFMETHOD("definition",(function(){return this.thedef})),AST_Symbol.DEFMETHOD("global",(function(){return this.thedef.global})),AST_Toplevel.DEFMETHOD("mangle_names",(function(e){var t=(e=format_mangler_options(e)).nth_identifier,n=-1,i=[];e.keep_fnames&&(function_defs=new Set);const o=this.mangled_names=new Set;unmangleable_names=new Set,e.cache&&(this.globals.forEach(a),e.cache.props&&e.cache.props.forEach((function(e){o.add(e);})));var r=new TreeWalker((function(o,s){if(o instanceof AST_LabeledStatement){var u=n;return s(),n=u,!0}if(o instanceof AST_Defun&&!(r.parent()instanceof AST_Scope)&&(scopes_with_block_defuns=scopes_with_block_defuns||new Set,scopes_with_block_defuns.add(o.parent_scope.get_defun_scope())),o instanceof AST_Scope)o.variables.forEach(a);else if(o.is_block_scope())o.block_scope.variables.forEach(a);else if(function_defs&&o instanceof AST_VarDef&&o.value instanceof AST_Lambda&&!o.value.name&&keep_name(e.keep_fnames,o.name.name))function_defs.add(o.name.definition().id);else {if(o instanceof AST_Label){let e;do{e=t.get(++n);}while(ALL_RESERVED_WORDS.has(e));return o.mangled_name=e,!0}!e.ie8&&!e.safari10&&o instanceof AST_SymbolCatch&&i.push(o.definition());}}));function a(t){1&t.export?unmangleable_names.add(t.name):e.reserved.has(t.name)||i.push(t);}this.walk(r),(e.keep_fnames||e.keep_classnames)&&i.forEach((t=>{t.name.length<6&&t.unmangleable(e)&&unmangleable_names.add(t.name);})),i.forEach((t=>{t.mangle(e);})),function_defs=null,unmangleable_names=null,scopes_with_block_defuns=null;})),AST_Toplevel.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props,n=new Set;return e.reserved.forEach(i),this.globals.forEach(o),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(o),e instanceof AST_SymbolCatch&&o(e.definition());}))),n;function i(e){n.add(e);}function o(n){var o=n.name;if(n.global&&t&&t.has(o))o=t.get(o);else if(!n.unmangleable(e))return;i(o);}})),AST_Toplevel.DEFMETHOD("expand_names",(function(e){var t=(e=format_mangler_options(e)).nth_identifier;t.reset&&t.sort&&(t.reset(),t.sort());var n=this.find_colliding_names(e),i=0;function o(o){if(o.global&&e.cache)return;if(o.unmangleable(e))return;if(e.reserved.has(o.name))return;const r=redefined_catch_def(o),a=o.name=r?r.name:function(){var e;do{e=t.get(i++);}while(n.has(e)||ALL_RESERVED_WORDS.has(e));return e}();o.orig.forEach((function(e){e.name=a;})),o.references.forEach((function(e){e.name=a;}));}this.globals.forEach(o),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(o),e instanceof AST_SymbolCatch&&o(e.definition());})));})),AST_Node.DEFMETHOD("tail_node",return_this),AST_Sequence.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]})),AST_Toplevel.DEFMETHOD("compute_char_frequency",(function(e){var t=(e=format_mangler_options(e)).nth_identifier;if(t.reset&&t.consider&&t.sort){t.reset();try{AST_Node.prototype.print=function(i,o){this._print(i,o),this instanceof AST_Symbol&&!this.unmangleable(e)?t.consider(this.name,-1):e.properties&&(this instanceof AST_DotHash?t.consider("#"+this.property,-1):this instanceof AST_Dot?t.consider(this.property,-1):this instanceof AST_Sub&&n(this.property));},t.consider(this.print_to_string(),1);}finally{AST_Node.prototype.print=AST_Node.prototype._print;}t.sort();}function n(e){e instanceof AST_String?t.consider(e.value,-1):e instanceof AST_Conditional?(n(e.consequent),n(e.alternative)):e instanceof AST_Sequence&&n(e.tail_node());}}));const base54=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""),t="0123456789".split("");let n,i;function o(){i=new Map,e.forEach((function(e){i.set(e,0);})),t.forEach((function(e){i.set(e,0);}));}function r(e,t){return i.get(t)-i.get(e)}function a(){n=mergeSort(e,r).concat(mergeSort(t,r));}return o(),a(),{get:function(e){var t="",i=54;e++;do{e--,t+=n[e%i],e=Math.floor(e/i),i=64;}while(e>0);return t},consider:function(e,t){for(var n=e.length;--n>=0;)i.set(e[n],i.get(e[n])+t);},reset:o,sort:a}})();let mangle_options;AST_Node.prototype.size=function(e,t){mangle_options=e&&e.mangle_options;let n=0;return walk_parent(this,((e,t)=>{if(n+=e._size(t),e instanceof AST_Arrow&&e.is_braceless())return n+=e.body[0].value._size(t),!0}),t||e&&e.stack),mangle_options=void 0,n},AST_Node.prototype._size=()=>0,AST_Debugger.prototype._size=()=>8,AST_Directive.prototype._size=function(){return 2+this.value.length};const list_overhead=e=>e.length&&e.length-1;AST_Block.prototype._size=function(){return 2+list_overhead(this.body)},AST_Toplevel.prototype._size=function(){return list_overhead(this.body)},AST_EmptyStatement.prototype._size=()=>1,AST_LabeledStatement.prototype._size=()=>2,AST_Do.prototype._size=()=>9,AST_While.prototype._size=()=>7,AST_For.prototype._size=()=>8,AST_ForIn.prototype._size=()=>8,AST_With.prototype._size=()=>6,AST_Expansion.prototype._size=()=>3;const lambda_modifiers=e=>(e.is_generator?1:0)+(e.async?6:0);AST_Accessor.prototype._size=function(){return lambda_modifiers(this)+4+list_overhead(this.argnames)+list_overhead(this.body)},AST_Function.prototype._size=function(e){return 2*!!first_in_statement(e)+lambda_modifiers(this)+12+list_overhead(this.argnames)+list_overhead(this.body)},AST_Defun.prototype._size=function(){return lambda_modifiers(this)+13+list_overhead(this.argnames)+list_overhead(this.body)},AST_Arrow.prototype._size=function(){let e=2+list_overhead(this.argnames);1===this.argnames.length&&this.argnames[0]instanceof AST_Symbol||(e+=2);const t=this.is_braceless()?0:list_overhead(this.body)+2;return lambda_modifiers(this)+e+t},AST_Destructuring.prototype._size=()=>2,AST_TemplateString.prototype._size=function(){return 2+3*Math.floor(this.segments.length/2)},AST_TemplateSegment.prototype._size=function(){return this.value.length},AST_Return.prototype._size=function(){return this.value?7:6},AST_Throw.prototype._size=()=>6,AST_Break.prototype._size=function(){return this.label?6:5},AST_Continue.prototype._size=function(){return this.label?9:8},AST_If.prototype._size=()=>4,AST_Switch.prototype._size=function(){return 8+list_overhead(this.body)},AST_Case.prototype._size=function(){return 5+list_overhead(this.body)},AST_Default.prototype._size=function(){return 8+list_overhead(this.body)},AST_Try.prototype._size=function(){return 3+list_overhead(this.body)},AST_Catch.prototype._size=function(){let e=7+list_overhead(this.body);return this.argname&&(e+=2),e},AST_Finally.prototype._size=function(){return 7+list_overhead(this.body)},AST_Var.prototype._size=function(){return 4+list_overhead(this.definitions)},AST_Let.prototype._size=function(){return 4+list_overhead(this.definitions)},AST_Const.prototype._size=function(){return 6+list_overhead(this.definitions)},AST_VarDef.prototype._size=function(){return this.value?1:0},AST_NameMapping.prototype._size=function(){return this.name?4:0},AST_Import.prototype._size=function(){let e=6;return this.imported_name&&(e+=1),(this.imported_name||this.imported_names)&&(e+=5),this.imported_names&&(e+=2+list_overhead(this.imported_names)),e},AST_ImportMeta.prototype._size=()=>11,AST_Export.prototype._size=function(){let e=7+(this.is_default?8:0);return this.exported_value&&(e+=this.exported_value._size()),this.exported_names&&(e+=2+list_overhead(this.exported_names)),this.module_name&&(e+=5),e},AST_Call.prototype._size=function(){return this.optional?4+list_overhead(this.args):2+list_overhead(this.args)},AST_New.prototype._size=function(){return 6+list_overhead(this.args)},AST_Sequence.prototype._size=function(){return list_overhead(this.expressions)},AST_Dot.prototype._size=function(){return this.optional?this.property.length+2:this.property.length+1},AST_DotHash.prototype._size=function(){return this.optional?this.property.length+3:this.property.length+2},AST_Sub.prototype._size=function(){return this.optional?4:2},AST_Unary.prototype._size=function(){return "typeof"===this.operator?7:"void"===this.operator?5:this.operator.length},AST_Binary.prototype._size=function(e){if("in"===this.operator)return 4;let t=this.operator.length;return ("+"===this.operator||"-"===this.operator)&&this.right instanceof AST_Unary&&this.right.operator===this.operator&&(t+=1),this.needs_parens(e)&&(t+=2),t},AST_Conditional.prototype._size=()=>3,AST_Array.prototype._size=function(){return 2+list_overhead(this.elements)},AST_Object.prototype._size=function(e){let t=2;return first_in_statement(e)&&(t+=2),t+list_overhead(this.properties)};const key_size=e=>"string"==typeof e?e.length:0;AST_ObjectKeyVal.prototype._size=function(){return key_size(this.key)+1};const static_size=e=>e?7:0;AST_ObjectGetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ObjectSetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ConciseMethod.prototype._size=function(){return static_size(this.static)+key_size(this.key)+lambda_modifiers(this)},AST_PrivateMethod.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+1},AST_PrivateGetter.prototype._size=AST_PrivateSetter.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+4},AST_PrivateIn.prototype._size=function(){return 5},AST_Class.prototype._size=function(){return (this.name?8:7)+(this.extends?8:0)},AST_ClassStaticBlock.prototype._size=function(){return 7+list_overhead(this.body)},AST_ClassProperty.prototype._size=function(){return static_size(this.static)+("string"==typeof this.key?this.key.length+2:0)+(this.value?1:0)},AST_ClassPrivateProperty.prototype._size=function(){return AST_ClassProperty.prototype._size.call(this)+1},AST_Symbol.prototype._size=function(){return mangle_options&&this.thedef&&!this.thedef.unmangleable(mangle_options)?1:this.name.length},AST_SymbolClassProperty.prototype._size=function(){return this.name.length},AST_SymbolRef.prototype._size=AST_SymbolDeclaration.prototype._size=function(){return "arguments"===this.name?9:AST_Symbol.prototype._size.call(this)},AST_NewTarget.prototype._size=()=>10,AST_SymbolImportForeign.prototype._size=function(){return this.name.length},AST_SymbolExportForeign.prototype._size=function(){return this.name.length},AST_This.prototype._size=()=>4,AST_Super.prototype._size=()=>5,AST_String.prototype._size=function(){return this.value.length+2},AST_Number.prototype._size=function(){const{value:e}=this;return 0===e?1:e>0&&Math.floor(e)===e?Math.floor(Math.log10(e)+1):e.toString().length},AST_BigInt.prototype._size=function(){return this.value.length},AST_RegExp.prototype._size=function(){return this.value.toString().length},AST_Null.prototype._size=()=>4,AST_NaN.prototype._size=()=>3,AST_Undefined.prototype._size=()=>6,AST_Hole.prototype._size=()=>0,AST_Infinity.prototype._size=()=>8,AST_True.prototype._size=()=>4,AST_False.prototype._size=()=>5,AST_Await.prototype._size=()=>6,AST_Yield.prototype._size=()=>6;const TOP=1024,has_flag=(e,t)=>e.flags&t,set_flag=(e,t)=>{e.flags|=t;},clear_flag=(e,t)=>{e.flags&=~t;};function merge_sequence(e,t){return t instanceof AST_Sequence?e.push(...t.expressions):e.push(t),e}function make_sequence(e,t){if(1==t.length)return t[0];if(0==t.length)throw new Error("trying to create a sequence with length zero!");return make_node(AST_Sequence,e,{expressions:t.reduce(merge_sequence,[])})}function make_node_from_constant(e,t){switch(typeof e){case"string":return make_node(AST_String,t,{value:e});case"number":return isNaN(e)?make_node(AST_NaN,t):isFinite(e)?1/e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Number,t,{value:-e})}):make_node(AST_Number,t,{value:e}):e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Infinity,t)}):make_node(AST_Infinity,t);case"boolean":return make_node(e?AST_True:AST_False,t);case"undefined":return make_node(AST_Undefined,t);default:if(null===e)return make_node(AST_Null,t,{value:null});if(e instanceof RegExp)return make_node(AST_RegExp,t,{value:{source:regexp_source_fix(e.source),flags:e.flags}});throw new Error(string_template("Can't handle constant of type: {type}",{type:typeof e}))}}function best_of_expression(e,t){return e.size()>t.size()?t:e}function best_of_statement(e,t){return best_of_expression(make_node(AST_SimpleStatement,e,{body:e}),make_node(AST_SimpleStatement,t,{body:t})).body}function best_of(e,t,n){return first_in_statement(e)?best_of_statement(t,n):best_of_expression(t,n)}function get_simple_key(e){return e instanceof AST_Constant?e.getValue():e instanceof AST_UnaryPrefix&&"void"==e.operator&&e.expression instanceof AST_Constant?void 0:e}function read_property(e,t){if(!((t=get_simple_key(t))instanceof AST_Node)){var n;if(e instanceof AST_Array){var i=e.elements;if("length"==t)return make_node_from_constant(i.length,e);"number"==typeof t&&t in i&&(n=i[t]);}else if(e instanceof AST_Object){t=""+t;for(var o=e.properties,r=o.length;--r>=0;){if(!(o[r]instanceof AST_ObjectKeyVal))return;n||o[r].key!==t||(n=o[r].value);}}return n instanceof AST_SymbolRef&&n.fixed_value()||n}}function has_break_or_continue(e,t){var n=!1,i=new TreeWalker((function(t){return !!(n||t instanceof AST_Scope)||(t instanceof AST_LoopControl&&i.loopcontrol_target(t)===e?n=!0:void 0)}));return t instanceof AST_LabeledStatement&&i.push(t),i.push(e),e.body.walk(i),n}function maintain_this_binding(e,t,n){return e instanceof AST_UnaryPrefix&&"delete"==e.operator||e instanceof AST_Call&&e.expression===t&&(n instanceof AST_PropAccess||n instanceof AST_SymbolRef&&"eval"==n.name)?make_sequence(t,[make_node(AST_Number,t,{value:0}),n]):n}function is_func_expr(e){return e instanceof AST_Arrow||e instanceof AST_Function}function is_iife_call(e){return "Call"==e.TYPE&&(e.expression instanceof AST_Function||is_iife_call(e.expression))}function is_empty(e){return null===e||e instanceof AST_EmptyStatement||e instanceof AST_BlockStatement&&0==e.body.length}const identifier_atom=makePredicate("Infinity NaN undefined");function is_identifier_atom(e){return e instanceof AST_Infinity||e instanceof AST_NaN||e instanceof AST_Undefined}function is_ref_of(e,t){if(!(e instanceof AST_SymbolRef))return !1;for(var n=e.definition().orig,i=n.length;--i>=0;)if(n[i]instanceof t)return !0}function can_be_evicted_from_block(e){return !(e instanceof AST_DefClass||e instanceof AST_Defun||e instanceof AST_Let||e instanceof AST_Const||e instanceof AST_Export||e instanceof AST_Import)}function as_statement_array(e){if(null===e)return [];if(e instanceof AST_BlockStatement)return e.body;if(e instanceof AST_EmptyStatement)return [];if(e instanceof AST_Statement)return [e];throw new Error("Can't convert thing to statement array")}function is_reachable(e,t){const n=e=>{if(e instanceof AST_SymbolRef&&t.includes(e.definition()))return walk_abort};return walk_parent(e,((t,i)=>{if(t instanceof AST_Scope&&t!==e){var o=i.parent();if(o instanceof AST_Call&&o.expression===t&&!t.async&&!t.is_generator)return;return !walk$2(t,n)||walk_abort}}))}function is_recursive_ref(e,t){for(var n,i=0;n=e.parent(i);i++)if(n instanceof AST_Lambda||n instanceof AST_Class){var o=n.name;if(o&&o.definition()===t)return !0}return !1}function retain_top_func(e,t){return t.top_retain&&e instanceof AST_Defun&&has_flag(e,TOP)&&e.name&&t.top_retain(e.name)}function make_nested_lookup(e){const t=new Map;for(var n of Object.keys(e))t.set(n,makePredicate(e[n]));return (e,n)=>{const i=t.get(e);return null!=i&&i.has(n)}}const pure_prop_access_globals=new Set(["Number","String","Array","Object","Function","Promise"]),object_methods=["constructor","toString","valueOf"],is_pure_native_method=make_nested_lookup({Array:["indexOf","join","lastIndexOf","slice",...object_methods],Boolean:object_methods,Function:object_methods,Number:["toExponential","toFixed","toPrecision",...object_methods],Object:object_methods,RegExp:["test",...object_methods],String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim",...object_methods]}),is_pure_native_fn=make_nested_lookup({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","hasOwn","keys"],String:["fromCharCode"]}),is_pure_native_value=make_nested_lookup({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]}),is_undeclared_ref=e=>e instanceof AST_SymbolRef&&e.definition().undeclared,lazy_op=makePredicate("&& || ??"),unary_side_effects=makePredicate("delete ++ --");function is_undefined(e,t){return has_flag(e,8)||e instanceof AST_Undefined||e instanceof AST_UnaryPrefix&&"void"==e.operator&&!e.expression.has_side_effects(t)}function is_null_or_undefined(e,t){let n;return e instanceof AST_Null||is_undefined(e,t)||e instanceof AST_SymbolRef&&(n=e.definition().fixed)instanceof AST_Node&&is_nullish(n,t)}function is_nullish_shortcircuited(e,t){return e instanceof AST_PropAccess||e instanceof AST_Call?e.optional&&is_null_or_undefined(e.expression,t)||is_nullish_shortcircuited(e.expression,t):e instanceof AST_Chain&&is_nullish_shortcircuited(e.expression,t)}function is_nullish(e,t){return !!is_null_or_undefined(e,t)||is_nullish_shortcircuited(e,t)}function is_lhs(e,t){return t instanceof AST_Unary&&unary_side_effects.has(t.operator)?t.expression:t instanceof AST_Assign&&t.left===e?e:void 0}!function(e){const t=makePredicate("! delete"),n=makePredicate("in instanceof == != === !== < <= >= >");e(AST_Node,return_false),e(AST_UnaryPrefix,(function(){return t.has(this.operator)})),e(AST_Binary,(function(){return n.has(this.operator)||lazy_op.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()})),e(AST_Conditional,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()})),e(AST_Assign,(function(){return "="==this.operator&&this.right.is_boolean()})),e(AST_Sequence,(function(){return this.tail_node().is_boolean()})),e(AST_True,return_true),e(AST_False,return_true);}((function(e,t){e.DEFMETHOD("is_boolean",t);})),function(e){e(AST_Node,return_false),e(AST_Number,return_true);const t=makePredicate("+ - ~ ++ --");e(AST_Unary,(function(){return t.has(this.operator)}));const n=makePredicate("- * / % & | ^ << >> >>>");e(AST_Binary,(function(e){return n.has(this.operator)||"+"==this.operator&&this.left.is_number(e)&&this.right.is_number(e)})),e(AST_Assign,(function(e){return n.has(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_number(e)})),e(AST_Conditional,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}));}((function(e,t){e.DEFMETHOD("is_number",t);})),function(e){e(AST_Node,return_false),e(AST_String,return_true),e(AST_TemplateString,return_true),e(AST_UnaryPrefix,(function(){return "typeof"==this.operator})),e(AST_Binary,(function(e){return "+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))})),e(AST_Assign,(function(e){return ("="==this.operator||"+="==this.operator)&&this.right.is_string(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_string(e)})),e(AST_Conditional,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}));}((function(e,t){e.DEFMETHOD("is_string",t);})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return !0;return !1}e(AST_Node,return_true),e(AST_EmptyStatement,return_false),e(AST_Constant,return_false),e(AST_This,return_false),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return !(this.is_callee_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)})),e(AST_Switch,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Case,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Try,(function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)})),e(AST_If,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)})),e(AST_LabeledStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_SimpleStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_Lambda,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)})),e(AST_ClassStaticBlock,(function(e){return t(this.body,e)})),e(AST_Binary,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)})),e(AST_Assign,return_true),e(AST_Conditional,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)})),e(AST_Unary,(function(e){return unary_side_effects.has(this.operator)||this.expression.has_side_effects(e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_SymbolDeclaration,return_false),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Dot,(function(e){return !is_nullish(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e))})),e(AST_Sub,(function(e){return !is_nullish(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e))})),e(AST_Chain,(function(e){return this.expression.has_side_effects(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_VarDef,(function(){return this.value})),e(AST_TemplateSegment,return_false),e(AST_TemplateString,(function(e){return t(this.segments,e)}));}((function(e,t){e.DEFMETHOD("has_side_effects",t);})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return !0;return !1}e(AST_Node,return_true),e(AST_Constant,return_false),e(AST_EmptyStatement,return_false),e(AST_Lambda,return_false),e(AST_SymbolDeclaration,return_false),e(AST_This,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)})),e(AST_ClassStaticBlock,(function(e){return t(this.body,e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Assign,(function(e){return !!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof AST_SymbolRef)&&this.left.may_throw(e)})),e(AST_Binary,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)})),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return !is_nullish(this,e)&&(!!t(this.args,e)||!this.is_callee_pure(e)&&(!!this.expression.may_throw(e)||!(this.expression instanceof AST_Lambda)||t(this.expression.body,e)))})),e(AST_Case,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_Conditional,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_If,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)})),e(AST_LabeledStatement,(function(e){return this.body.may_throw(e)})),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return !!this.value&&this.value.may_throw(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_Return,(function(e){return this.value&&this.value.may_throw(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_SimpleStatement,(function(e){return this.body.may_throw(e)})),e(AST_Dot,(function(e){return !is_nullish(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e))})),e(AST_Sub,(function(e){return !is_nullish(this,e)&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e))})),e(AST_Chain,(function(e){return this.expression.may_throw(e)})),e(AST_Switch,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_Try,(function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)})),e(AST_Unary,(function(e){return !("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)&&this.expression.may_throw(e)})),e(AST_VarDef,(function(e){return !!this.value&&this.value.may_throw(e)}));}((function(e,t){e.DEFMETHOD("may_throw",t);})),function(e){function t(e){let t=!0;return walk$2(this,(n=>{if(n instanceof AST_SymbolRef){if(has_flag(this,16))return t=!1,walk_abort;var i=n.definition();if(member(i,this.enclosed)&&!this.variables.has(i.name)){if(e){var o=e.find_variable(n);if(i.undeclared?!o:o===i)return t="f",!0}return t=!1,walk_abort}return !0}if(n instanceof AST_This&&this instanceof AST_Arrow)return t=!1,walk_abort})),t}e(AST_Node,return_false),e(AST_Constant,return_true),e(AST_Class,(function(e){if(this.extends&&!this.extends.is_constant_expression(e))return !1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return !1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return !1;if(t instanceof AST_ClassStaticBlock)return !1}return t.call(this,e)})),e(AST_Lambda,t),e(AST_Unary,(function(){return this.expression.is_constant_expression()})),e(AST_Binary,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()})),e(AST_Array,(function(){return this.elements.every((e=>e.is_constant_expression()))})),e(AST_Object,(function(){return this.properties.every((e=>e.is_constant_expression()))})),e(AST_ObjectProperty,(function(){return !(this.key instanceof AST_Node||!this.value||!this.value.is_constant_expression())}));}((function(e,t){e.DEFMETHOD("is_constant_expression",t);})),function(e){function t(e){return /strict/.test(e.option("pure_getters"))}AST_Node.DEFMETHOD("may_throw_on_access",(function(e){return !e.option("pure_getters")||this._dot_throw(e)})),e(AST_Node,t),e(AST_Null,return_true),e(AST_Undefined,return_true),e(AST_Constant,return_false),e(AST_Array,return_false),e(AST_Object,(function(e){if(!t(e))return !1;for(var n=this.properties.length;--n>=0;)if(this.properties[n]._dot_throw(e))return !0;return !1})),e(AST_Class,return_false),e(AST_ObjectProperty,return_false),e(AST_ObjectGetter,return_true),e(AST_Expansion,(function(e){return this.expression._dot_throw(e)})),e(AST_Function,return_false),e(AST_Arrow,return_false),e(AST_UnaryPostfix,return_false),e(AST_UnaryPrefix,(function(){return "void"==this.operator})),e(AST_Binary,(function(e){return ("&&"==this.operator||"||"==this.operator||"??"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))})),e(AST_Assign,(function(e){return !!this.logical||"="==this.operator&&this.right._dot_throw(e)})),e(AST_Conditional,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)})),e(AST_Dot,(function(e){return !(!t(e)||"prototype"==this.property&&(this.expression instanceof AST_Function||this.expression instanceof AST_Class))})),e(AST_Chain,(function(e){return this.expression._dot_throw(e)})),e(AST_Sequence,(function(e){return this.tail_node()._dot_throw(e)})),e(AST_SymbolRef,(function(e){if("arguments"===this.name&&this.scope instanceof AST_Lambda)return !1;if(has_flag(this,8))return !0;if(!t(e))return !1;if(is_undeclared_ref(this)&&this.is_declared(e))return !1;if(this.is_immutable())return !1;var n=this.fixed_value();return !n||n._dot_throw(e)}));}((function(e,t){e.DEFMETHOD("_dot_throw",t);})),function(e){function t(e,n){if(e instanceof AST_Node)return e instanceof AST_Constant||(e=e.clone(!0)),make_node(e.CTOR,n,e);if(Array.isArray(e))return make_node(AST_Array,n,{elements:e.map((function(e){return t(e,n)}))});if(e&&"object"==typeof e){var i=[];for(var o in e)HOP(e,o)&&i.push(make_node(AST_ObjectKeyVal,n,{key:o,value:t(e[o],n)}));return make_node(AST_Object,n,{properties:i})}return make_node_from_constant(e,n)}AST_Toplevel.DEFMETHOD("resolve_defines",(function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new TreeTransformer((function(t){var n=t._find_defs(e,"");if(n){for(var i,o=0,r=t;(i=this.parent(o++))&&i instanceof AST_PropAccess&&i.expression===r;)r=i;if(!is_lhs(r,i))return n}})))):this})),e(AST_Node,noop),e(AST_Chain,(function(e,t){return this.expression._find_defs(e,t)})),e(AST_Dot,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)})),e(AST_SymbolDeclaration,(function(){this.global();})),e(AST_SymbolRef,(function(e,n){if(this.global()){var i=e.option("global_defs"),o=this.name+n;return HOP(i,o)?t(i[o],this):void 0}}));}((function(e,t){e.DEFMETHOD("_find_defs",t);})),function(e){function t(e){return make_node(AST_UnaryPrefix,e,{operator:"!",expression:e})}function n(e,n,i){var o=t(e);if(i){var r=make_node(AST_SimpleStatement,n,{body:n});return best_of_expression(o,r)===r?n:o}return best_of_expression(o,n)}e(AST_Node,(function(){return t(this)})),e(AST_Statement,(function(){throw new Error("Cannot negate a statement")})),e(AST_Function,(function(){return t(this)})),e(AST_Arrow,(function(){return t(this)})),e(AST_UnaryPrefix,(function(){return "!"==this.operator?this.expression:t(this)})),e(AST_Sequence,(function(e){var t=this.expressions.slice();return t.push(t.pop().negate(e)),make_sequence(this,t)})),e(AST_Conditional,(function(e,t){var i=this.clone();return i.consequent=i.consequent.negate(e),i.alternative=i.alternative.negate(e),n(this,i,t)})),e(AST_Binary,(function(e,i){var o=this.clone(),r=this.operator;if(e.option("unsafe_comps"))switch(r){case"<=":return o.operator=">",o;case"<":return o.operator=">=",o;case">=":return o.operator="<",o;case">":return o.operator="<=",o}switch(r){case"==":return o.operator="!=",o;case"!=":return o.operator="==",o;case"===":return o.operator="!==",o;case"!==":return o.operator="===",o;case"&&":return o.operator="||",o.left=o.left.negate(e,i),o.right=o.right.negate(e),n(this,o,i);case"||":return o.operator="&&",o.left=o.left.negate(e,i),o.right=o.right.negate(e),n(this,o,i)}return t(this)}));}((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}));}));var global_pure_fns=makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");AST_Call.DEFMETHOD("is_callee_pure",(function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return !1;if(is_undeclared_ref(t)&&global_pure_fns.has(t.name))return !0;if(t instanceof AST_Dot&&is_undeclared_ref(t.expression)&&is_pure_native_fn(t.expression.name,t.property))return !0}return !!has_annotation(this,_PURE)||!e.pure_funcs(this)})),AST_Node.DEFMETHOD("is_call_pure",return_false),AST_Dot.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof AST_Array?n="Array":t.is_boolean()?n="Boolean":t.is_number(e)?n="Number":t instanceof AST_RegExp?n="RegExp":t.is_string(e)?n="String":this.may_throw_on_access(e)||(n="Object"),null!=n&&is_pure_native_method(n,this.property)}));const aborts=e=>e&&e.aborts();function is_modified(e,t,n,i,o,r){var a=t.parent(o),s=is_lhs(n,a);if(s)return s;if(!r&&a instanceof AST_Call&&a.expression===n&&!(i instanceof AST_Arrow)&&!(i instanceof AST_Class)&&!a.is_callee_pure(e)&&(!(i instanceof AST_Function)||!(a instanceof AST_New)&&i.contains_this()))return !0;if(a instanceof AST_Array)return is_modified(e,t,a,a,o+1);if(a instanceof AST_ObjectKeyVal&&n===a.value){var u=t.parent(o+1);return is_modified(e,t,u,u,o+2)}if(a instanceof AST_PropAccess&&a.expression===n){var l=read_property(i,a.property);return !r&&is_modified(e,t,a,l,o+1)}}function def_eval(e,t){e.DEFMETHOD("_eval",t);}!function(e){function t(){for(var e=0;e<this.body.length;e++)if(aborts(this.body[e]))return this.body[e];return null}e(AST_Statement,return_null),e(AST_Jump,return_this),e(AST_Import,return_null),e(AST_BlockStatement,t),e(AST_SwitchBranch,t),e(AST_DefClass,(function(){for(const e of this.properties)if(e instanceof AST_ClassStaticBlock&&e.aborts())return e;return null})),e(AST_ClassStaticBlock,t),e(AST_If,(function(){return this.alternative&&aborts(this.body)&&aborts(this.alternative)&&this}));}((function(e,t){e.DEFMETHOD("aborts",t);}));const nullish=Symbol("This AST_Chain is nullish");AST_Node.DEFMETHOD("evaluate",(function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);if(!t||t instanceof RegExp)return t;if("function"==typeof t||"object"==typeof t||t==nullish)return this;if("string"==typeof t){const n=this.size(e);if(t.length+2>n)return this}return t}));var unaryPrefix=makePredicate("! ~ - + void");AST_Node.DEFMETHOD("is_constant",(function(){return this instanceof AST_Constant?!(this instanceof AST_RegExp):this instanceof AST_UnaryPrefix&&this.expression instanceof AST_Constant&&unaryPrefix.has(this.operator)})),def_eval(AST_Statement,(function(){throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]",this.start))})),def_eval(AST_Lambda,return_this),def_eval(AST_Class,return_this),def_eval(AST_Node,return_this),def_eval(AST_Constant,(function(){return this.getValue()})),def_eval(AST_BigInt,return_this),def_eval(AST_RegExp,(function(e){let t=e.evaluated_regexps.get(this.value);if(void 0===t&&regexp_is_safe(this.value.source)){try{const{source:e,flags:n}=this.value;t=new RegExp(e,n);}catch(e){t=null;}e.evaluated_regexps.set(this.value,t);}return t||this})),def_eval(AST_TemplateString,(function(){return 1!==this.segments.length?this:this.segments[0].value})),def_eval(AST_Function,(function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=()=>this.print_to_string(),t}return this})),def_eval(AST_Array,(function(e,t){if(e.option("unsafe")){for(var n=[],i=0,o=this.elements.length;i<o;i++){var r=this.elements[i],a=r._eval(e,t);if(r===a)return this;n.push(a);}return n}return this})),def_eval(AST_Object,(function(e,t){if(e.option("unsafe")){for(var n={},i=0,o=this.properties.length;i<o;i++){var r=this.properties[i];if(r instanceof AST_Expansion)return this;var a=r.key;if(a instanceof AST_Symbol)a=a.name;else if(a instanceof AST_Node&&(a=a._eval(e,t))===r.key)return this;if("function"==typeof Object.prototype[a])return this;if(!(r.value instanceof AST_Function)&&(n[a]=r.value._eval(e,t),n[a]===r.value))return this}return n}return this}));var non_converting_unary=makePredicate("! typeof void");def_eval(AST_UnaryPrefix,(function(e,t){var n=this.expression;if(e.option("typeofs")&&"typeof"==this.operator&&(n instanceof AST_Lambda||n instanceof AST_SymbolRef&&n.fixed_value()instanceof AST_Lambda))return "function";if(non_converting_unary.has(this.operator)||t++,(n=n._eval(e,t))===this.expression)return this;switch(this.operator){case"!":return !n;case"typeof":return n instanceof RegExp?this:typeof n;case"void":return;case"~":return ~n;case"-":return -n;case"+":return +n}return this}));var non_converting_binary=makePredicate("&& || ?? === !==");const identity_comparison=makePredicate("== != === !=="),has_identity=e=>"object"==typeof e||"function"==typeof e||"symbol"==typeof e;def_eval(AST_Binary,(function(e,t){non_converting_binary.has(this.operator)||t++;var n=this.left._eval(e,t);if(n===this.left)return this;var i,o=this.right._eval(e,t);if(o===this.right)return this;if(null!=n&&null!=o&&identity_comparison.has(this.operator)&&has_identity(n)&&has_identity(o)&&typeof n==typeof o)return this;switch(this.operator){case"&&":i=n&&o;break;case"||":i=n||o;break;case"??":i=null!=n?n:o;break;case"|":i=n|o;break;case"&":i=n&o;break;case"^":i=n^o;break;case"+":i=n+o;break;case"*":i=n*o;break;case"**":i=Math.pow(n,o);break;case"/":i=n/o;break;case"%":i=n%o;break;case"-":i=n-o;break;case"<<":i=n<<o;break;case">>":i=n>>o;break;case">>>":i=n>>>o;break;case"==":i=n==o;break;case"===":i=n===o;break;case"!=":i=n!=o;break;case"!==":i=n!==o;break;case"<":i=n<o;break;case"<=":i=n<=o;break;case">":i=n>o;break;case">=":i=n>=o;break;default:return this}return isNaN(i)&&e.find_parent(AST_With)?this:i})),def_eval(AST_Conditional,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var i=n?this.consequent:this.alternative,o=i._eval(e,t);return o===i?this:o}));const reentrant_ref_eval=new Set;def_eval(AST_SymbolRef,(function(e,t){if(reentrant_ref_eval.has(this))return this;var n=this.fixed_value();if(!n)return this;reentrant_ref_eval.add(this);const i=n._eval(e,t);if(reentrant_ref_eval.delete(this),i===n)return this;if(i&&"object"==typeof i){var o=this.definition().escaped;if(o&&t>o)return this}return i}));const global_objs={Array,Math,Number,Object,String},regexp_flags=new Set(["dotAll","global","ignoreCase","multiline","sticky","unicode"]);function def_drop_side_effect_free(e,t){e.DEFMETHOD("drop_side_effect_free",t);}function trim(e,t,n){var i=e.length;if(!i)return null;for(var o=[],r=!1,a=0;a<i;a++){var s=e[a].drop_side_effect_free(t,n);r|=s!==e[a],s&&(o.push(s),n=!1);}return r?o.length?o:null:e}def_eval(AST_PropAccess,(function(e,t){let n=this.expression._eval(e,t+1);if(n===nullish||this.optional&&null==n)return nullish;if(e.option("unsafe")){var i=this.property;if(i instanceof AST_Node&&(i=i._eval(e,t))===this.property)return this;var o=this.expression;if(is_undeclared_ref(o)){var r,a="hasOwnProperty"===o.name&&"call"===i&&(r=e.parent()&&e.parent().args)&&r&&r[0]&&r[0].evaluate(e);if(null==(a=a instanceof AST_Dot?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();if(!is_pure_native_value(o.name,i))return this;n=global_objs[o.name];}else {if(n instanceof RegExp){if("source"==i)return regexp_source_fix(n.source);if("flags"==i||regexp_flags.has(i))return n[i]}if(!n||n===o||!HOP(n,i))return this;if("function"==typeof n)switch(i){case"name":return n.node.name?n.node.name.name:"";case"length":return n.node.length_property();default:return this}}return n[i]}return this})),def_eval(AST_Chain,(function(e,t){const n=this.expression._eval(e,t);return n===nullish?void 0:n===this.expression?this:n})),def_eval(AST_Call,(function(e,t){var n=this.expression;const i=n._eval(e,t);if(i===nullish||this.optional&&null==i)return nullish;if(e.option("unsafe")&&n instanceof AST_PropAccess){var o,r=n.property;if(r instanceof AST_Node&&(r=r._eval(e,t))===n.property)return this;var a=n.expression;if(is_undeclared_ref(a)){var s="hasOwnProperty"===a.name&&"call"===r&&this.args[0]&&this.args[0].evaluate(e);if(null==(s=s instanceof AST_Dot?s.expression:s)||s.thedef&&s.thedef.undeclared)return this.clone();if(!is_pure_native_fn(a.name,r))return this;o=global_objs[a.name];}else {if((o=a._eval(e,t+1))===a||!o)return this;if(!is_pure_native_method(o.constructor.name,r))return this}for(var u=[],l=0,c=this.args.length;l<c;l++){var _=this.args[l],f=_._eval(e,t);if(_===f)return this;if(_ instanceof AST_Lambda)return this;u.push(f);}try{return o[r].apply(o,u)}catch(e){}}return this})),def_eval(AST_New,return_this),def_drop_side_effect_free(AST_Node,return_this),def_drop_side_effect_free(AST_Constant,return_null),def_drop_side_effect_free(AST_This,return_null),def_drop_side_effect_free(AST_Call,(function(e,t){if(is_nullish_shortcircuited(this,e))return this.expression.drop_side_effect_free(e,t);if(!this.is_callee_pure(e)){if(this.expression.is_call_pure(e)){var n=this.args.slice();return n.unshift(this.expression.expression),(n=trim(n,e,t))&&make_sequence(this,n)}if(is_func_expr(this.expression)&&(!this.expression.name||!this.expression.name.definition().references.length)){var i=this.clone();return i.expression.process_expression(!1,e),i}return this}var o=trim(this.args,e,t);return o&&make_sequence(this,o)})),def_drop_side_effect_free(AST_Accessor,return_null),def_drop_side_effect_free(AST_Function,return_null),def_drop_side_effect_free(AST_Arrow,return_null),def_drop_side_effect_free(AST_Class,(function(e){const t=[],n=this.extends&&this.extends.drop_side_effect_free(e);n&&t.push(n);for(const n of this.properties){if(n instanceof AST_ClassStaticBlock){if(n.body.some((t=>t.has_side_effects(e))))return this;continue}const i=n.drop_side_effect_free(e);i&&t.push(i);}return t.length?make_sequence(this,t):null})),def_drop_side_effect_free(AST_Binary,(function(e,t){var n=this.right.drop_side_effect_free(e);if(!n)return this.left.drop_side_effect_free(e,t);if(lazy_op.has(this.operator)){if(n===this.right)return this;var i=this.clone();return i.right=n,i}var o=this.left.drop_side_effect_free(e,t);return o?make_sequence(this,[o,n]):this.right.drop_side_effect_free(e,t)})),def_drop_side_effect_free(AST_Assign,(function(e){if(this.logical)return this;var t=this.left;if(t.has_side_effects(e)||e.has_directive("use strict")&&t instanceof AST_PropAccess&&t.expression.is_constant())return this;for(set_flag(this,32);t instanceof AST_PropAccess;)t=t.expression;return t.is_constant_expression(e.find_parent(AST_Scope))?this.right.drop_side_effect_free(e):this})),def_drop_side_effect_free(AST_Conditional,(function(e){var t=this.consequent.drop_side_effect_free(e),n=this.alternative.drop_side_effect_free(e);if(t===this.consequent&&n===this.alternative)return this;if(!t)return n?make_node(AST_Binary,this,{operator:"||",left:this.condition,right:n}):this.condition.drop_side_effect_free(e);if(!n)return make_node(AST_Binary,this,{operator:"&&",left:this.condition,right:t});var i=this.clone();return i.consequent=t,i.alternative=n,i})),def_drop_side_effect_free(AST_Unary,(function(e,t){if(unary_side_effects.has(this.operator))return this.expression.has_side_effects(e)?clear_flag(this,32):set_flag(this,32),this;if("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)return null;var n=this.expression.drop_side_effect_free(e,t);return t&&n&&is_iife_call(n)?n===this.expression&&"!"==this.operator?this:n.negate(e,t):n})),def_drop_side_effect_free(AST_SymbolRef,(function(e){return this.is_declared(e)||pure_prop_access_globals.has(this.name)?null:this})),def_drop_side_effect_free(AST_Object,(function(e,t){var n=trim(this.properties,e,t);return n&&make_sequence(this,n)})),def_drop_side_effect_free(AST_ObjectProperty,(function(e,t){const n=this instanceof AST_ObjectKeyVal&&this.key instanceof AST_Node&&this.key.drop_side_effect_free(e,t),i=this.value&&this.value.drop_side_effect_free(e,t);return n&&i?make_sequence(this,[n,i]):n||i})),def_drop_side_effect_free(AST_ClassProperty,(function(e){const t=this.computed_key()&&this.key.drop_side_effect_free(e),n=this.static&&this.value&&this.value.drop_side_effect_free(e);return t&&n?make_sequence(this,[t,n]):t||n||null})),def_drop_side_effect_free(AST_ConciseMethod,(function(){return this.computed_key()?this.key:null})),def_drop_side_effect_free(AST_ObjectGetter,(function(){return this.computed_key()?this.key:null})),def_drop_side_effect_free(AST_ObjectSetter,(function(){return this.computed_key()?this.key:null})),def_drop_side_effect_free(AST_Array,(function(e,t){var n=trim(this.elements,e,t);return n&&make_sequence(this,n)})),def_drop_side_effect_free(AST_Dot,(function(e,t){return is_nullish_shortcircuited(this,e)?this.expression.drop_side_effect_free(e,t):this.expression.may_throw_on_access(e)?this:this.expression.drop_side_effect_free(e,t)})),def_drop_side_effect_free(AST_Sub,(function(e,t){if(is_nullish_shortcircuited(this,e))return this.expression.drop_side_effect_free(e,t);if(this.expression.may_throw_on_access(e))return this;var n=this.expression.drop_side_effect_free(e,t);if(!n)return this.property.drop_side_effect_free(e,t);var i=this.property.drop_side_effect_free(e);return i?make_sequence(this,[n,i]):n})),def_drop_side_effect_free(AST_Chain,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),def_drop_side_effect_free(AST_Sequence,(function(e){var t=this.tail_node(),n=t.drop_side_effect_free(e);if(n===t)return this;var i=this.expressions.slice(0,-1);return n&&i.push(n),i.length?make_sequence(this,i):make_node(AST_Number,this,{value:0})})),def_drop_side_effect_free(AST_Expansion,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),def_drop_side_effect_free(AST_TemplateSegment,return_null),def_drop_side_effect_free(AST_TemplateString,(function(e){var t=trim(this.segments,e,first_in_statement);return t&&make_sequence(this,t)}));const r_keep_assign=/keep_assign/;function def_reduce_vars(e,t){e.DEFMETHOD("reduce_vars",t);}function reset_def(e,t){t.assignments=0,t.chained=!1,t.direct_access=!1,t.escaped=0,t.recursive_refs=0,t.references=[],t.single_use=void 0,t.scope.pinned()?t.fixed=!1:t.orig[0]instanceof AST_SymbolConst||!e.exposed(t)?t.fixed=t.init:t.fixed=!1;}function reset_variables(e,t,n){n.variables.forEach((function(n){reset_def(t,n),null===n.fixed?(e.defs_to_safe_ids.set(n.id,e.safe_ids),mark$1(e,n,!0)):n.fixed&&(e.loop_ids.set(n.id,e.in_loop),mark$1(e,n,!0));}));}function reset_block_variables(e,t){t.block_scope&&t.block_scope.variables.forEach((t=>{reset_def(e,t);}));}function push(e){e.safe_ids=Object.create(e.safe_ids);}function pop(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids);}function mark$1(e,t,n){e.safe_ids[t.id]=n;}function safe_to_read(e,t){if("m"==t.single_use)return !1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof AST_SymbolFunarg||"arguments"==n.name)return !1;t.fixed=make_node(AST_Undefined,n);}return !0}return t.fixed instanceof AST_Defun}function safe_to_assign(e,t,n,i){if(void 0===t.fixed)return !0;let o;return null===t.fixed&&(o=e.defs_to_safe_ids.get(t.id))?(o[t.id]=!1,e.defs_to_safe_ids.delete(t.id),!0):!!HOP(e.safe_ids,t.id)&&!!safe_to_read(e,t)&&!1!==t.fixed&&!(null!=t.fixed&&(!i||t.references.length>t.assignments))&&(t.fixed instanceof AST_Defun?i instanceof AST_Node&&t.fixed.parent_scope===n:t.orig.every((e=>!(e instanceof AST_SymbolConst||e instanceof AST_SymbolDefun||e instanceof AST_SymbolLambda))))}function ref_once(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}function is_immutable(e){return !!e&&(e.is_constant()||e instanceof AST_Lambda||e instanceof AST_This)}function mark_escaped(e,t,n,i,o,r=0,a=1){var s=e.parent(r);if(o){if(o.is_constant())return;if(o instanceof AST_ClassExpression)return}if(s instanceof AST_Assign&&("="===s.operator||s.logical)&&i===s.right||s instanceof AST_Call&&(i!==s.expression||s instanceof AST_New)||s instanceof AST_Exit&&i===s.value&&i.scope!==t.scope||s instanceof AST_VarDef&&i===s.value||s instanceof AST_Yield&&i===s.value&&i.scope!==t.scope)return !(a>1)||o&&o.is_constant_expression(n)||(a=1),void((!t.escaped||t.escaped>a)&&(t.escaped=a));if(s instanceof AST_Array||s instanceof AST_Await||s instanceof AST_Binary&&lazy_op.has(s.operator)||s instanceof AST_Conditional&&i!==s.condition||s instanceof AST_Expansion||s instanceof AST_Sequence&&i===s.tail_node())mark_escaped(e,t,n,s,s,r+1,a);else if(s instanceof AST_ObjectKeyVal&&i===s.value){var u=e.parent(r+1);mark_escaped(e,t,n,u,u,r+2,a);}else if(s instanceof AST_PropAccess&&i===s.expression&&(mark_escaped(e,t,n,s,o=read_property(o,s.property),r+1,a+1),o))return;r>0||s instanceof AST_Sequence&&i!==s.tail_node()||s instanceof AST_SimpleStatement||(t.direct_access=!0);}AST_Scope.DEFMETHOD("drop_unused",(function(e){if(!e.option("unused"))return;if(e.has_directive("use asm"))return;var t=this;if(t.pinned())return;var n=!(t instanceof AST_Toplevel)||e.toplevel.funcs,i=!(t instanceof AST_Toplevel)||e.toplevel.vars;const o=r_keep_assign.test(e.option("unused"))?return_false:function(e){return e instanceof AST_Assign&&!e.logical&&(has_flag(e,32)||"="==e.operator)?e.left:e instanceof AST_Unary&&has_flag(e,32)?e.expression:void 0};var r=new Map,a=new Map;t instanceof AST_Toplevel&&e.top_retain&&t.variables.forEach((function(t){e.top_retain(t)&&!r.has(t.id)&&r.set(t.id,t);}));var s=new Map,u=new Map,l=this,c=new TreeWalker((function(o,_){if(o instanceof AST_Lambda&&o.uses_arguments&&!c.has_directive("use strict")&&o.argnames.forEach((function(e){if(e instanceof AST_SymbolDeclaration){var t=e.definition();r.has(t.id)||r.set(t.id,t);}})),o!==t){if(o instanceof AST_Defun||o instanceof AST_DefClass){var p=o.name.definition();if((c.parent()instanceof AST_Export||!n&&l===t)&&p.global&&!r.has(p.id)&&r.set(p.id,p),o instanceof AST_DefClass){o.extends&&(o.extends.has_side_effects(e)||o.extends.may_throw(e))&&o.extends.walk(c);for(const t of o.properties)(t.has_side_effects(e)||t.may_throw(e))&&t.walk(c);}return map_add(u,p.id,o),!0}if(o instanceof AST_SymbolFunarg&&l===t&&map_add(s,o.definition().id,o),o instanceof AST_Definitions&&l===t){const t=c.parent()instanceof AST_Export;return o.definitions.forEach((function(n){if(n.name instanceof AST_SymbolVar&&map_add(s,n.name.definition().id,n),!t&&i||walk$2(n.name,(e=>{if(e instanceof AST_SymbolDeclaration){const t=e.definition();t.global&&!r.has(t.id)&&r.set(t.id,t);}})),n.name instanceof AST_Destructuring&&n.walk(c),n.name instanceof AST_SymbolDeclaration&&n.value){var o=n.name.definition();map_add(u,o.id,n.value),o.chained||n.name.fixed_value()!==n.value||a.set(o.id,n),n.value.has_side_effects(e)&&n.value.walk(c);}})),!0}return f(o,_)}}));t.walk(c),c=new TreeWalker(f),r.forEach((function(e){var t=u.get(e.id);t&&t.forEach((function(e){e.walk(c);}));}));var _=new TreeTransformer((function(u,c,f){var p=_.parent();if(i){const e=o(u);if(e instanceof AST_SymbolRef){var d=e.definition(),m=r.has(d.id);if(u instanceof AST_Assign){if(!m||a.has(d.id)&&a.get(d.id)!==u)return maintain_this_binding(p,u,u.right.transform(_))}else if(!m)return f?MAP.skip:make_node(AST_Number,u,{value:0})}}if(l===t){if(u.name&&(u instanceof AST_ClassExpression&&!keep_name(e.option("keep_classnames"),(d=u.name.definition()).name)||u instanceof AST_Function&&!keep_name(e.option("keep_fnames"),(d=u.name.definition()).name))&&(!r.has(d.id)||d.orig.length>1)&&(u.name=null),u instanceof AST_Lambda&&!(u instanceof AST_Accessor))for(var S=!e.option("keep_fargs"),h=u.argnames,A=h.length;--A>=0;){var T=h[A];T instanceof AST_Expansion&&(T=T.expression),T instanceof AST_DefaultAssign&&(T=T.left),T instanceof AST_Destructuring||r.has(T.definition().id)?S=!1:(set_flag(T,1),S&&h.pop());}if((u instanceof AST_Defun||u instanceof AST_DefClass)&&u!==t){const t=u.name.definition(),i=t.global&&!n||r.has(t.id),o=!i&&u instanceof AST_Class&&u.has_side_effects(e);if(!i&&!o)return t.eliminated++,f?MAP.skip:make_node(AST_EmptyStatement,u)}if(u instanceof AST_Definitions&&!(p instanceof AST_ForIn&&p.init===u)){var E=!(p instanceof AST_Toplevel||u instanceof AST_Var),g=[],b=[],D=[],y=[];switch(u.definitions.forEach((function(t){t.value&&(t.value=t.value.transform(_));var n=t.name instanceof AST_Destructuring,o=n?new SymbolDef(null,{name:"<destructure>"}):t.name.definition();if(E&&o.global)return D.push(t);if(!i&&!E||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||r.has(o.id)){if(t.value&&a.has(o.id)&&a.get(o.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof AST_SymbolVar){var l=s.get(o.id);if(l.length>1&&(!t.value||o.orig.indexOf(t.name)>o.eliminated)){if(t.value){var c=make_node(AST_SymbolRef,t.name,t.name);o.references.push(c);var f=make_node(AST_Assign,t,{operator:"=",logical:!1,left:c,right:t.value});a.get(o.id)===t&&a.set(o.id,f),y.push(f.transform(_));}return remove$1(l,t),void o.eliminated++}}t.value?(y.length>0&&(D.length>0?(y.push(t.value),t.value=make_sequence(t.value,y)):g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),y=[]),D.push(t)):b.push(t);}else if(o.orig[0]instanceof AST_SymbolCatch)(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),t.value=null,b.push(t);else {var p;(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),o.eliminated++;}})),(b.length>0||D.length>0)&&(u.definitions=b.concat(D),g.push(u)),y.length>0&&g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),g.length){case 0:return f?MAP.skip:make_node(AST_EmptyStatement,u);case 1:return g[0];default:return f?MAP.splice(g):make_node(AST_BlockStatement,u,{body:g})}}if(u instanceof AST_For)return c(u,this),u.init instanceof AST_BlockStatement&&(v=u.init,u.init=v.body.pop(),v.body.push(u)),u.init instanceof AST_SimpleStatement?u.init=u.init.body:is_empty(u.init)&&(u.init=null),v?f?MAP.splice(v.body):v:u;if(u instanceof AST_LabeledStatement&&u.body instanceof AST_For){if(c(u,this),u.body instanceof AST_BlockStatement){var v=u.body;return u.body=v.body.pop(),v.body.push(u),f?MAP.splice(v.body):v}return u}if(u instanceof AST_BlockStatement)return c(u,this),f&&u.body.every(can_be_evicted_from_block)?MAP.splice(u.body):u;if(u instanceof AST_Scope){const e=l;return l=u,c(u,this),l=e,u}}}));function f(e,n){var i;const s=o(e);if(s instanceof AST_SymbolRef&&!is_ref_of(e.left,AST_SymbolBlockDeclaration)&&t.variables.get(s.name)===(i=s.definition()))return e instanceof AST_Assign&&(e.right.walk(c),i.chained||e.left.fixed_value()!==e.right||a.set(i.id,e)),!0;if(e instanceof AST_SymbolRef){if(i=e.definition(),!r.has(i.id)&&(r.set(i.id,i),i.orig[0]instanceof AST_SymbolCatch)){const e=i.scope.is_block_scope()&&i.scope.get_defun_scope().variables.get(i.name);e&&r.set(e.id,e);}return !0}if(e instanceof AST_Scope){var u=l;return l=e,n(),l=u,!0}}t.transform(_);})),def_reduce_vars(AST_Node,noop);const suppress=e=>walk$2(e,(e=>{if(e instanceof AST_Symbol){var t=e.definition();t&&(e instanceof AST_SymbolRef&&t.references.push(e),t.fixed=!1);}}));function mark_lambda(e,t,n){return clear_flag(this,16),push(e),reset_variables(e,n,this),this.uses_arguments?(t(),void pop(e)):(!this.name&&(i=e.parent())instanceof AST_Call&&i.expression===this&&!i.args.some((e=>e instanceof AST_Expansion))&&this.argnames.every((e=>e instanceof AST_Symbol))&&this.argnames.forEach(((t,n)=>{if(t.definition){var o=t.definition();o.orig.length>1||(void 0!==o.fixed||this.uses_arguments&&!e.has_directive("use strict")?o.fixed=!1:(o.fixed=function(){return i.args[n]||make_node(AST_Undefined,i)},e.loop_ids.set(o.id,e.in_loop),mark$1(e,o,!0)));}})),t(),pop(e),!0);var i;}function loop_body(e){return e instanceof AST_IterationStatement&&e.body instanceof AST_BlockStatement?e.body:e}function is_lhs_read_only(e){if(e instanceof AST_This)return !0;if(e instanceof AST_SymbolRef)return e.definition().orig[0]instanceof AST_SymbolLambda;if(e instanceof AST_PropAccess){if((e=e.expression)instanceof AST_SymbolRef){if(e.is_immutable())return !1;e=e.fixed_value();}return !e||!(e instanceof AST_RegExp)&&(e instanceof AST_Constant||is_lhs_read_only(e))}return !1}function trim_unreachable_code(e,t,n){walk$2(t,(i=>i instanceof AST_Var?(i.remove_initializers(),n.push(i),!0):i instanceof AST_Defun&&(i===t||!e.has_directive("use strict"))?(n.push(i===t?i:make_node(AST_Var,i,{definitions:[make_node(AST_VarDef,i,{name:make_node(AST_SymbolVar,i.name,i.name),value:null})]})),!0):i instanceof AST_Export||i instanceof AST_Import?(n.push(i),!0):i instanceof AST_Scope||void 0));}function tighten_body(e,t){const n=t.find_scope(),i=n.get_defun_scope(),{in_loop:o,in_try:r}=function(){var e=t.self(),n=0,i=!1,o=!1;do{if(e instanceof AST_Catch||e instanceof AST_Finally)n++;else if(e instanceof AST_IterationStatement)i=!0;else {if(e instanceof AST_Scope)break;e instanceof AST_Try&&(o=!0);}}while(e=t.parent(n++));return {in_loop:i,in_try:o}}();var a,s=10;do{a=!1,l(e),t.option("dead_code")&&_(e,t),t.option("if_return")&&c(e,t),t.sequences_limit>0&&(p(e,t),m(e,t)),t.option("join_vars")&&h(e),t.option("collapse_vars")&&u(e,t);}while(a&&s-- >0);function u(e,t){if(n.pinned()||i.pinned())return e;for(var s,u=[],l=e.length,c=new TreeTransformer((function(e){if(C)return e;if(!v)return e!==f[p]?e:++p<f.length?x(e):(v=!0,(S=B(e,0))===e&&(C=!0),e);var i,o=c.parent();if(e instanceof AST_Assign&&(e.logical||"="!=e.operator&&A.equivalent_to(e.left))||e instanceof AST_Await||e instanceof AST_Call&&A instanceof AST_PropAccess&&A.equivalent_to(e.expression)||e instanceof AST_Debugger||e instanceof AST_Destructuring||e instanceof AST_Expansion&&e.expression instanceof AST_Symbol&&(e.expression instanceof AST_This||e.expression.definition().references.length>1)||e instanceof AST_IterationStatement&&!(e instanceof AST_For)||e instanceof AST_LoopControl||e instanceof AST_Try||e instanceof AST_With||e instanceof AST_Yield||e instanceof AST_Export||e instanceof AST_Class||o instanceof AST_For&&e!==o.init||!b&&e instanceof AST_SymbolRef&&!e.is_declared(t)&&!pure_prop_access_globals.has(e)||e instanceof AST_SymbolRef&&o instanceof AST_Call&&has_annotation(o,_NOINLINE))return C=!0,e;if(h||E&&b||!(o instanceof AST_Binary&&lazy_op.has(o.operator)&&o.left!==e||o instanceof AST_Conditional&&o.condition!==e||o instanceof AST_If&&o.condition!==e)||(h=o),R&&!(e instanceof AST_SymbolDeclaration)&&A.equivalent_to(e)&&!function(e,t){for(const{def:n}of t.values()){const t=e.find_variable(n.name);if(t){if(t===n)continue;return !0}}return !1}(c.find_scope()||n,T)){if(h)return C=!0,e;if(is_lhs(e,o))return m&&k++,e;if(k++,m&&d instanceof AST_VarDef)return e;if(a=C=!0,d instanceof AST_UnaryPostfix)return make_node(AST_UnaryPrefix,d,d);if(d instanceof AST_VarDef){var s=d.name.definition(),u=d.value;return s.references.length-s.replaced!=1||t.exposed(s)?make_node(AST_Assign,d,{operator:"=",logical:!1,left:make_node(AST_SymbolRef,d.name,d.name),right:u}):(s.replaced++,y&&is_identifier_atom(u)?u.transform(t):maintain_this_binding(o,e,u))}return clear_flag(d,32),d}return (e instanceof AST_Call||e instanceof AST_Exit&&(g||A instanceof AST_PropAccess||X(A))||e instanceof AST_PropAccess&&(g||e.expression.may_throw_on_access(t))||e instanceof AST_SymbolRef&&(T.has(e.name)&&T.get(e.name).modified||g&&X(e))||e instanceof AST_VarDef&&e.value&&(T.has(e.name.name)||g&&X(e.name))||(i=is_lhs(e.left,e))&&(i instanceof AST_PropAccess||T.has(i.name))||D&&(r?e.has_side_effects(t):z(e)))&&(S=e,e instanceof AST_Scope&&(C=!0)),x(e)}),(function(e){C||(S===e&&(C=!0),h===e&&(h=null));})),_=new TreeTransformer((function(e){if(C)return e;if(!v){if(e!==f[p])return e;if(++p<f.length)return;return v=!0,e}return e instanceof AST_SymbolRef&&e.name==N.name?(--k||(C=!0),is_lhs(e,_.parent())?e:(N.replaced++,m.replaced--,d.value)):e instanceof AST_Default||e instanceof AST_Scope?e:void 0}));--l>=0;){0==l&&t.option("unused")&&I();var f=[];for(P(e[l]);u.length>0;){f=u.pop();var p=0,d=f[f.length-1],m=null,S=null,h=null,A=L(d);if(A&&!is_lhs_read_only(A)&&!A.has_side_effects(t)){var T=U(d),E=G(A);A instanceof AST_SymbolRef&&T.set(A.name,{def:A.definition(),modified:!1});var g=(M=d)instanceof AST_Unary?unary_side_effects.has(M.operator):V(M).has_side_effects(t),b=H(),D=d.may_throw(t),y=d.name instanceof AST_SymbolFunarg,v=y,C=!1,k=0,R=!s||!v;if(!R){for(var O=t.self().argnames.lastIndexOf(d.name)+1;!C&&O<s.length;O++)s[O].transform(c);R=!0;}for(var F=l;!C&&F<e.length;F++)e[F].transform(c);if(m){var N=d.name.definition();if(C&&N.references.length-N.replaced>k)k=!1;else {for(C=!1,p=0,v=y,F=l;!C&&F<e.length;F++)e[F].transform(_);m.single_use=!1;}}k&&!K(d)&&e.splice(l,1);}}}var M;function x(e){if(e instanceof AST_Scope)return e;if(e instanceof AST_Switch){e.expression=e.expression.transform(c);for(var t=0,n=e.body.length;!C&&t<n;t++){var i=e.body[t];if(i instanceof AST_Case){if(!v){if(i!==f[p])continue;p++;}if(i.expression=i.expression.transform(c),!b)break}}return C=!0,e}}function w(e,t,n){var o=!1,r=!(e instanceof AST_Arrow);return t.walk(new TreeWalker((function(t,a){if(o)return !0;if(t instanceof AST_SymbolRef&&(e.variables.has(t.name)||function(e,t){if(e.global)return !1;let n=e.scope;for(;n&&n!==t;){if(n.variables.has(e.name))return !0;n=n.parent_scope;}return !1}(t.definition(),e))){var s=t.definition().scope;if(s!==i)for(;s=s.parent_scope;)if(s===i)return !0;return o=!0}if((n||r)&&t instanceof AST_This)return o=!0;if(t instanceof AST_Scope&&!(t instanceof AST_Arrow)){var u=r;return r=!1,a(),r=u,!0}}))),o}function I(){var e,n=t.self();if(is_func_expr(n)&&!n.name&&!n.uses_arguments&&!n.pinned()&&(e=t.parent())instanceof AST_Call&&e.expression===n&&e.args.every((e=>!(e instanceof AST_Expansion)))){var i=t.has_directive("use strict");i&&!member(i,n.body)&&(i=!1);var o=n.argnames.length;s=e.args.slice(o);for(var r=new Set,a=o;--a>=0;){var l=n.argnames[a],c=e.args[a];const o=l.definition&&l.definition();if(!(o&&o.orig.length>1||(s.unshift(make_node(AST_VarDef,l,{name:l,value:c})),r.has(l.name))))if(r.add(l.name),l instanceof AST_Expansion){var _=e.args.slice(a);_.every((e=>!w(n,e,i)))&&u.unshift([make_node(AST_VarDef,l,{name:l.expression,value:make_node(AST_Array,e,{elements:_})})]);}else c?(c instanceof AST_Lambda&&c.pinned()||w(n,c,i))&&(c=null):c=make_node(AST_Undefined,l).transform(t),c&&u.unshift([make_node(AST_VarDef,l,{name:l,value:c})]);}}}function P(e){if(f.push(e),e instanceof AST_Assign)e.left.has_side_effects(t)||e.right instanceof AST_Chain||u.push(f.slice()),P(e.right);else if(e instanceof AST_Binary)P(e.left),P(e.right);else if(e instanceof AST_Call&&!has_annotation(e,_NOINLINE))P(e.expression),e.args.forEach(P);else if(e instanceof AST_Case)P(e.expression);else if(e instanceof AST_Conditional)P(e.condition),P(e.consequent),P(e.alternative);else if(e instanceof AST_Definitions){var n=e.definitions.length,i=n-200;for(i<0&&(i=0);i<n;i++)P(e.definitions[i]);}else e instanceof AST_DWLoop?(P(e.condition),e.body instanceof AST_Block||P(e.body)):e instanceof AST_Exit?e.value&&P(e.value):e instanceof AST_For?(e.init&&P(e.init),e.condition&&P(e.condition),e.step&&P(e.step),e.body instanceof AST_Block||P(e.body)):e instanceof AST_ForIn?(P(e.object),e.body instanceof AST_Block||P(e.body)):e instanceof AST_If?(P(e.condition),e.body instanceof AST_Block||P(e.body),!e.alternative||e.alternative instanceof AST_Block||P(e.alternative)):e instanceof AST_Sequence?e.expressions.forEach(P):e instanceof AST_SimpleStatement?P(e.body):e instanceof AST_Switch?(P(e.expression),e.body.forEach(P)):e instanceof AST_Unary?"++"!=e.operator&&"--"!=e.operator||u.push(f.slice()):e instanceof AST_VarDef&&(!e.value||e.value instanceof AST_Chain||(u.push(f.slice()),P(e.value)));f.pop();}function B(e,t,n){var i=c.parent(t);return i instanceof AST_Assign?!n||i.logical||i.left instanceof AST_PropAccess||T.has(i.left.name)?e:B(i,t+1,n):i instanceof AST_Binary?!n||lazy_op.has(i.operator)&&i.left!==e?e:B(i,t+1,n):i instanceof AST_Call||i instanceof AST_Case?e:i instanceof AST_Conditional?n&&i.condition===e?B(i,t+1,n):e:i instanceof AST_Definitions?B(i,t+1,!0):i instanceof AST_Exit?n?B(i,t+1,n):e:i instanceof AST_If?n&&i.condition===e?B(i,t+1,n):e:i instanceof AST_IterationStatement?e:i instanceof AST_Sequence?B(i,t+1,i.tail_node()!==e):i instanceof AST_SimpleStatement?B(i,t+1,!0):i instanceof AST_Switch||i instanceof AST_VarDef?e:null}function L(e){if(e instanceof AST_Assign&&e.logical)return !1;if(!(e instanceof AST_VarDef&&e.name instanceof AST_SymbolDeclaration)){const t=e instanceof AST_Assign?e.left:e.expression;return !is_ref_of(t,AST_SymbolConst)&&!is_ref_of(t,AST_SymbolLet)&&t}var n=e.name.definition();if(member(e.name,n.orig)){var i=n.references.length-n.replaced;if(i)return n.orig.length-n.eliminated>1&&!(e.name instanceof AST_SymbolFunarg)||(i>1?function(e){var t=e.value;if(t instanceof AST_SymbolRef&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return m=n}}(e):!t.exposed(n))?make_node(AST_SymbolRef,e.name,e.name):void 0}}function V(e){return e instanceof AST_Assign?e.right:e.value}function U(e){var n=new Map;if(e instanceof AST_Unary)return n;var i=new TreeWalker((function(e){for(var o=e;o instanceof AST_PropAccess;)o=o.expression;if(o instanceof AST_SymbolRef){const r=n.get(o.name);r&&r.modified||n.set(o.name,{def:o.definition(),modified:is_modified(t,i,e,e,0)});}}));return V(e).walk(i),n}function K(n){if(n.name instanceof AST_SymbolFunarg){var i=t.parent(),o=t.self().argnames,r=o.indexOf(n.name);if(r<0)i.args.length=Math.min(i.args.length,o.length-1);else {var a=i.args;a[r]&&(a[r]=make_node(AST_Number,a[r],{value:0}));}return !0}var s=!1;return e[l].transform(new TreeTransformer((function(e,t,i){return s?e:e===n||e.body===n?(s=!0,e instanceof AST_VarDef?(e.value=e.name instanceof AST_SymbolConst?make_node(AST_Undefined,e.value):null,e):i?MAP.skip:null):void 0}),(function(e){if(e instanceof AST_Sequence)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function G(e){for(;e instanceof AST_PropAccess;)e=e.expression;return e instanceof AST_SymbolRef&&e.definition().scope.get_defun_scope()===i&&!(o&&(T.has(e.name)||d instanceof AST_Unary||d instanceof AST_Assign&&!d.logical&&"="!=d.operator))}function H(){if(g)return !1;if(m)return !0;if(A instanceof AST_SymbolRef){var e=A.definition();if(e.references.length-e.replaced==(d instanceof AST_VarDef?1:2))return !0}return !1}function X(e){if(!e.definition)return !0;var t=e.definition();return !(1==t.orig.length&&t.orig[0]instanceof AST_SymbolDefun)&&(t.scope.get_defun_scope()!==i||t.references.some((e=>e.scope.get_defun_scope()!==i)))}function z(e,t){if(e instanceof AST_Assign)return z(e.left,!0);if(e instanceof AST_Unary)return z(e.expression,!0);if(e instanceof AST_VarDef)return e.value&&z(e.value);if(t){if(e instanceof AST_Dot)return z(e.expression,!0);if(e instanceof AST_Sub)return z(e.expression,!0);if(e instanceof AST_SymbolRef)return e.definition().scope.get_defun_scope()!==i}return !1}}function l(e){for(var t=[],n=0;n<e.length;){var i=e[n];i instanceof AST_BlockStatement&&i.body.every(can_be_evicted_from_block)?(a=!0,l(i.body),e.splice(n,1,...i.body),n+=i.body.length):i instanceof AST_EmptyStatement?(a=!0,e.splice(n,1)):i instanceof AST_Directive?t.indexOf(i.value)<0?(n++,t.push(i.value)):(a=!0,e.splice(n,1)):n++;}}function c(e,t){for(var n=t.self(),i=function(e){for(var t=0,n=e.length;--n>=0;){var i=e[n];if(i instanceof AST_If&&i.body instanceof AST_Return&&++t>1)return !0}return !1}(e),o=n instanceof AST_Lambda,r=e.length;--r>=0;){var s=e[r],u=A(r),l=e[u];if(o&&!l&&s instanceof AST_Return){if(!s.value){a=!0,e.splice(r,1);continue}if(s.value instanceof AST_UnaryPrefix&&"void"==s.value.operator){a=!0,e[r]=make_node(AST_SimpleStatement,s,{body:s.value.expression});continue}}if(s instanceof AST_If){var c;if(m(c=aborts(s.body))){c.label&&remove$1(c.label.thedef.references,c),a=!0,(s=s.clone()).condition=s.condition.negate(t);var _=h(s.body,c);s.body=make_node(AST_BlockStatement,s,{body:as_statement_array(s.alternative).concat(S())}),s.alternative=make_node(AST_BlockStatement,s,{body:_}),e[r]=s.transform(t);continue}if(m(c=aborts(s.alternative))){c.label&&remove$1(c.label.thedef.references,c),a=!0,(s=s.clone()).body=make_node(AST_BlockStatement,s.body,{body:as_statement_array(s.body).concat(S())}),_=h(s.alternative,c),s.alternative=make_node(AST_BlockStatement,s.alternative,{body:_}),e[r]=s.transform(t);continue}}if(s instanceof AST_If&&s.body instanceof AST_Return){var p=s.body.value;if(!p&&!s.alternative&&(o&&!l||l instanceof AST_Return&&!l.value)){a=!0,e[r]=make_node(AST_SimpleStatement,s.condition,{body:s.condition});continue}if(p&&!s.alternative&&l instanceof AST_Return&&l.value){a=!0,(s=s.clone()).alternative=l,e[r]=s.transform(t),e.splice(u,1);continue}if(p&&!s.alternative&&(!l&&o&&i||l instanceof AST_Return)){a=!0,(s=s.clone()).alternative=l||make_node(AST_Return,s,{value:null}),e[r]=s.transform(t),l&&e.splice(u,1);continue}var d=e[T(r)];if(t.option("sequences")&&o&&!s.alternative&&d instanceof AST_If&&d.body instanceof AST_Return&&A(u)==e.length&&l instanceof AST_SimpleStatement){a=!0,(s=s.clone()).alternative=make_node(AST_BlockStatement,l,{body:[l,make_node(AST_Return,l,{value:null})]}),e[r]=s.transform(t),e.splice(u,1);continue}}}function m(i){if(!i)return !1;for(var a=r+1,s=e.length;a<s;a++){var u=e[a];if(u instanceof AST_Const||u instanceof AST_Let)return !1}var l=i instanceof AST_LoopControl?t.loopcontrol_target(i):null;return i instanceof AST_Return&&o&&function(e){return !e||e instanceof AST_UnaryPrefix&&"void"==e.operator}(i.value)||i instanceof AST_Continue&&n===loop_body(l)||i instanceof AST_Break&&l instanceof AST_BlockStatement&&n===l}function S(){var t=e.slice(r+1);return e.length=r+1,t.filter((function(t){return !(t instanceof AST_Defun&&(e.push(t),1))}))}function h(e,t){var n=as_statement_array(e).slice(0,-1);return t.value&&n.push(make_node(AST_SimpleStatement,t.value,{body:t.value.expression})),n}function A(t){for(var n=t+1,i=e.length;n<i;n++){var o=e[n];if(!(o instanceof AST_Var&&f(o)))break}return n}function T(t){for(var n=t;--n>=0;){var i=e[n];if(!(i instanceof AST_Var&&f(i)))break}return n}}function _(e,t){for(var n,i=t.self(),o=0,r=0,s=e.length;o<s;o++){var u=e[o];if(u instanceof AST_LoopControl){var l=t.loopcontrol_target(u);u instanceof AST_Break&&!(l instanceof AST_IterationStatement)&&loop_body(l)===i||u instanceof AST_Continue&&loop_body(l)===i?u.label&&remove$1(u.label.thedef.references,u):e[r++]=u;}else e[r++]=u;if(aborts(u)){n=e.slice(o+1);break}}e.length=r,a=r!=s,n&&n.forEach((function(n){trim_unreachable_code(t,n,e);}));}function f(e){return e.definitions.every((e=>!e.value))}function p(e,t){if(!(e.length<2)){for(var n=[],i=0,o=0,r=e.length;o<r;o++){var s=e[o];if(s instanceof AST_SimpleStatement){n.length>=t.sequences_limit&&l();var u=s.body;n.length>0&&(u=u.drop_side_effect_free(t)),u&&merge_sequence(n,u);}else s instanceof AST_Definitions&&f(s)||s instanceof AST_Defun||l(),e[i++]=s;}l(),e.length=i,i!=r&&(a=!0);}function l(){if(n.length){var t=make_sequence(n[0],n);e[i++]=make_node(AST_SimpleStatement,t,{body:t}),n=[];}}}function d(e,t){if(!(e instanceof AST_BlockStatement))return e;for(var n=null,i=0,o=e.body.length;i<o;i++){var r=e.body[i];if(r instanceof AST_Var&&f(r))t.push(r);else {if(n||r instanceof AST_Const||r instanceof AST_Let)return !1;n=r;}}return n}function m(e,t){function n(e){o--,a=!0;var n=i.body;return make_sequence(n,[n,e]).transform(t)}for(var i,o=0,r=0;r<e.length;r++){var s=e[r];if(i&&(s instanceof AST_Exit?s.value=n(s.value||make_node(AST_Undefined,s).transform(t)):s instanceof AST_For?s.init instanceof AST_Definitions||walk$2(i.body,(e=>e instanceof AST_Scope||(e instanceof AST_Binary&&"in"===e.operator?walk_abort:void 0)))||(s.init?s.init=n(s.init):(s.init=i.body,o--,a=!0)):s instanceof AST_ForIn?s.init instanceof AST_Const||s.init instanceof AST_Let||(s.object=n(s.object)):s instanceof AST_If?s.condition=n(s.condition):(s instanceof AST_Switch||s instanceof AST_With)&&(s.expression=n(s.expression))),t.option("conditionals")&&s instanceof AST_If){var u=[],l=d(s.body,u),c=d(s.alternative,u);if(!1!==l&&!1!==c&&u.length>0){var _=u.length;u.push(make_node(AST_If,s,{condition:s.condition,body:l||make_node(AST_EmptyStatement,s.body),alternative:c})),u.unshift(o,1),[].splice.apply(e,u),r+=_,o+=_+1,i=null,a=!0;continue}}e[o++]=s,i=s instanceof AST_SimpleStatement?s:null;}e.length=o;}function S(e,i){if(e instanceof AST_Definitions){var o,r=e.definitions[e.definitions.length-1];if(r.value instanceof AST_Object&&(i instanceof AST_Assign&&!i.logical?o=[i]:i instanceof AST_Sequence&&(o=i.expressions.slice()),o)){var a=!1;do{var s=o[0];if(!(s instanceof AST_Assign))break;if("="!=s.operator)break;if(!(s.left instanceof AST_PropAccess))break;var u=s.left.expression;if(!(u instanceof AST_SymbolRef))break;if(r.name.name!=u.name)break;if(!s.right.is_constant_expression(n))break;var l=s.left.property;if(l instanceof AST_Node&&(l=l.evaluate(t)),l instanceof AST_Node)break;l=""+l;var c=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&e.key&&e.key.name!=l}:function(e){return e.key&&e.key.name!=l};if(!r.value.properties.every(c))break;var _=r.value.properties.filter((function(e){return e.key===l}))[0];_?_.value=new AST_Sequence({start:_.start,expressions:[_.value.clone(),s.right.clone()],end:_.end}):r.value.properties.push(make_node(AST_ObjectKeyVal,s,{key:l,value:s.right})),o.shift(),a=!0;}while(o.length);return a&&o}}}function h(e){for(var t,n=0,i=-1,o=e.length;n<o;n++){var r=e[n],s=e[i];if(r instanceof AST_Definitions)s&&s.TYPE==r.TYPE?(s.definitions=s.definitions.concat(r.definitions),a=!0):t&&t.TYPE==r.TYPE&&f(r)?(t.definitions=t.definitions.concat(r.definitions),a=!0):(e[++i]=r,t=r);else if(r instanceof AST_Exit)r.value=l(r.value);else if(r instanceof AST_For)(u=S(s,r.init))?(a=!0,r.init=u.length?make_sequence(r.init,u):null,e[++i]=r):s instanceof AST_Var&&(!r.init||r.init.TYPE==s.TYPE)?(r.init&&(s.definitions=s.definitions.concat(r.init.definitions)),r.init=s,e[i]=r,a=!0):t&&r.init&&t.TYPE==r.init.TYPE&&f(r.init)?(t.definitions=t.definitions.concat(r.init.definitions),r.init=null,e[++i]=r,a=!0):e[++i]=r;else if(r instanceof AST_ForIn)r.object=l(r.object);else if(r instanceof AST_If)r.condition=l(r.condition);else if(r instanceof AST_SimpleStatement){var u;if(u=S(s,r.body)){if(a=!0,!u.length)continue;r.body=make_sequence(r.body,u);}e[++i]=r;}else r instanceof AST_Switch||r instanceof AST_With?r.expression=l(r.expression):e[++i]=r;}function l(t){e[++i]=r;var n=S(s,t);return n?(a=!0,n.length?make_sequence(t,n):t instanceof AST_Sequence?t.tail_node().left:t.left):t}e.length=i+1;}}function within_array_or_object_literal(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof AST_Statement)return !1;if(t instanceof AST_Array||t instanceof AST_ObjectKeyVal||t instanceof AST_Object)return !0}return !1}function scope_encloses_variables_in_this_scope(e,t){for(const n of t.enclosed){if(t.variables.has(n.name))continue;const i=e.find_variable(n.name);if(i){if(i===n)continue;return !0}}return !1}function inline_into_symbolref(e,t){const n=t.parent();if(t.option("reduce_vars")&&is_lhs(e,n)!==e){const r=e.definition(),a=t.find_scope();if(t.top_retain&&r.global&&t.top_retain(r))return r.fixed=!1,r.single_use=!1,e;let s=e.fixed_value(),u=r.single_use&&!(n instanceof AST_Call&&n.is_callee_pure(t)||has_annotation(n,_NOINLINE))&&!(n instanceof AST_Export&&s instanceof AST_Lambda&&s.name);if(u&&s instanceof AST_Node&&(u=!s.has_side_effects(t)&&!s.may_throw(t)),u&&(s instanceof AST_Lambda||s instanceof AST_Class))if(retain_top_func(s,t))u=!1;else if(r.scope===e.scope||1!=r.escaped&&!has_flag(s,16)&&!within_array_or_object_literal(t)&&t.option("reduce_funcs")){if(is_recursive_ref(t,r))u=!1;else if((r.scope!==e.scope||r.orig[0]instanceof AST_SymbolFunarg)&&(u=s.is_constant_expression(e.scope),"f"==u)){var i=e.scope;do{(i instanceof AST_Defun||is_func_expr(i))&&set_flag(i,16);}while(i=i.parent_scope)}}else u=!1;if(u&&(s instanceof AST_Lambda||s instanceof AST_Class)&&(u=r.scope===e.scope&&!scope_encloses_variables_in_this_scope(a,s)||n instanceof AST_Call&&n.expression===e&&!scope_encloses_variables_in_this_scope(a,s)&&!(s.name&&s.name.definition().recursive_refs>0)),u&&s){if(s instanceof AST_DefClass&&(set_flag(s,256),s=make_node(AST_ClassExpression,s,s)),s instanceof AST_Defun&&(set_flag(s,256),s=make_node(AST_Function,s,s)),r.recursive_refs>0&&s.name instanceof AST_SymbolDefun){const e=s.name.definition();let t=s.variables.get(s.name.name),n=t&&t.orig[0];n instanceof AST_SymbolLambda||(n=make_node(AST_SymbolLambda,s.name,s.name),n.scope=s,s.name=n,t=s.def_function(n)),walk$2(s,(n=>{n instanceof AST_SymbolRef&&n.definition()===e&&(n.thedef=t,t.references.push(n));}));}return (s instanceof AST_Lambda||s instanceof AST_Class)&&s.parent_scope!==a&&(s=s.clone(!0,t.get_toplevel()),a.add_child_scope(s)),s.optimize(t)}if(s){let n;if(s instanceof AST_This)r.orig[0]instanceof AST_SymbolFunarg||!r.references.every((e=>r.scope===e.scope))||(n=s);else {var o=s.evaluate(t);o===s||!t.option("unsafe_regexp")&&o instanceof RegExp||(n=make_node_from_constant(o,s));}if(n){const i=e.size(t),o=n.size(t);let a=0;if(t.option("unused")&&!t.exposed(r)&&(a=(i+2+o)/(r.references.length-r.assignments)),o<=i+a)return n}}}return e}function inline_into_call(e,t,n){var i=e.expression,o=e.args.every((e=>!(e instanceof AST_Expansion)));if(n.option("reduce_vars")&&t instanceof AST_SymbolRef&&!has_annotation(e,_NOINLINE)){const e=t.fixed_value();retain_top_func(e,n)||(t=e);}var r=t instanceof AST_Lambda,a=r&&t.body[0],s=r&&!t.is_generator&&!t.async,u=s&&n.option("inline")&&!e.is_callee_pure(n);if(u&&a instanceof AST_Return){let i=a.value;if(!i||i.is_constant_expression()){i=i?i.clone(!0):make_node(AST_Undefined,e);const t=e.args.concat(i);return make_sequence(e,t).optimize(n)}if(1===t.argnames.length&&t.argnames[0]instanceof AST_SymbolFunarg&&e.args.length<2&&!(e.args[0]instanceof AST_Expansion)&&i instanceof AST_SymbolRef&&i.name===t.argnames[0].name){const t=(e.args[0]||make_node(AST_Undefined)).optimize(n);let i;return t instanceof AST_PropAccess&&(i=n.parent())instanceof AST_Call&&i.expression===e?make_sequence(e,[make_node(AST_Number,e,{value:0}),t]):t}}if(u){var l,c,_=-1;let r,s,u;if(o&&!t.uses_arguments&&!(n.parent()instanceof AST_Class)&&!(t.name&&t instanceof AST_Function)&&(s=function(e){var i=t.body,o=i.length;if(n.option("inline")<3)return 1==o&&d(e);e=null;for(var r=0;r<o;r++){var a=i[r];if(a instanceof AST_Var){if(e&&!a.definitions.every((e=>!e.value)))return !1}else {if(e)return !1;a instanceof AST_EmptyStatement||(e=a);}}return d(e)}(a))&&(i===t||has_annotation(e,_INLINE)||n.option("unused")&&1==(r=i.definition()).references.length&&!is_recursive_ref(n,r)&&t.is_constant_expression(i.scope))&&!has_annotation(e,_PURE|_NOINLINE)&&!t.contains_this()&&function(){var e=new Set;do{if((l=n.parent(++_)).is_block_scope()&&l.block_scope&&l.block_scope.variables.forEach((function(t){e.add(t.name);})),l instanceof AST_Catch)l.argname&&e.add(l.argname.name);else if(l instanceof AST_IterationStatement)c=[];else if(l instanceof AST_SymbolRef&&l.fixed_value()instanceof AST_Scope)return !1}while(!(l instanceof AST_Scope));var i=!(l instanceof AST_Toplevel)||n.toplevel.vars,o=n.option("inline");return !(!function(e,n){for(var i=t.body.length,o=0;o<i;o++){var r=t.body[o];if(r instanceof AST_Var){if(!n)return !1;for(var a=r.definitions.length;--a>=0;){var s=r.definitions[a].name;if(s instanceof AST_Destructuring||e.has(s.name)||identifier_atom.has(s.name)||l.conflicting_def(s.name))return !1;c&&c.push(s.definition());}}}return !0}(e,o>=3&&i)||!function(e,n){for(var i=0,o=t.argnames.length;i<o;i++){var r=t.argnames[i];if(r instanceof AST_DefaultAssign){if(has_flag(r.left,1))continue;return !1}if(r instanceof AST_Destructuring)return !1;if(r instanceof AST_Expansion){if(has_flag(r.expression,1))continue;return !1}if(!has_flag(r,1)){if(!n||e.has(r.name)||identifier_atom.has(r.name)||l.conflicting_def(r.name))return !1;c&&c.push(r.definition());}}return !0}(e,o>=2&&i)||c&&0!=c.length&&is_reachable(t,c))}()&&(u=n.find_scope())&&!scope_encloses_variables_in_this_scope(u,t)&&!function(){let e,t=0;for(;e=n.parent(t++);){if(e instanceof AST_DefaultAssign)return !0;if(e instanceof AST_Block)break}return !1}()&&!(l instanceof AST_Class))return set_flag(t,256),u.add_child_scope(t),make_sequence(e,function(i){var o=[],r=[];if(function(n,i){for(var o=t.argnames.length,r=e.args.length;--r>=o;)i.push(e.args[r]);for(r=o;--r>=0;){var a=t.argnames[r],s=e.args[r];if(has_flag(a,1)||!a.name||l.conflicting_def(a.name))s&&i.push(s);else {var u=make_node(AST_SymbolVar,a,a);a.definition().orig.push(u),!s&&c&&(s=make_node(AST_Undefined,e)),m(n,i,u,s);}}n.reverse(),i.reverse();}(o,r),function(e,n){for(var i=n.length,o=0,r=t.body.length;o<r;o++){var a=t.body[o];if(a instanceof AST_Var)for(var s=0,u=a.definitions.length;s<u;s++){var l=a.definitions[s],_=l.name;if(m(e,n,_,l.value),c&&t.argnames.every((e=>e.name!=_.name))){var f=t.variables.get(_.name),p=make_node(AST_SymbolRef,_,_);f.references.push(p),n.splice(i++,0,make_node(AST_Assign,l,{operator:"=",logical:!1,left:p,right:make_node(AST_Undefined,_)}));}}}}(o,r),r.push(i),o.length){const e=l.body.indexOf(n.parent(_-1))+1;l.body.splice(e,0,make_node(AST_Var,t,{definitions:o}));}return r.map((e=>e.clone(!0)))}(s)).optimize(n)}if(u&&has_annotation(e,_INLINE))return set_flag(t,256),(t=(t=make_node(t.CTOR===AST_Defun?AST_Function:t.CTOR,t,t)).clone(!0)).figure_out_scope({},{parent_scope:n.find_scope(),toplevel:n.get_toplevel()}),make_node(AST_Call,e,{expression:t,args:e.args}).optimize(n);if(s&&n.option("side_effects")&&t.body.every(is_empty)){var f=e.args.concat(make_node(AST_Undefined,e));return make_sequence(e,f).optimize(n)}if(n.option("negate_iife")&&n.parent()instanceof AST_SimpleStatement&&is_iife_call(e))return e.negate(n,!0);var p=e.evaluate(n);return p!==e?(p=make_node_from_constant(p,e).optimize(n),best_of(n,p,e)):e;function d(t){return t?t instanceof AST_Return?t.value?t.value.clone(!0):make_node(AST_Undefined,e):t instanceof AST_SimpleStatement?make_node(AST_UnaryPrefix,t,{operator:"void",expression:t.body.clone(!0)}):void 0:make_node(AST_Undefined,e)}function m(t,n,i,o){var r=i.definition();l.variables.has(i.name)||(l.variables.set(i.name,r),l.enclosed.push(r),t.push(make_node(AST_VarDef,i,{name:i,value:null})));var a=make_node(AST_SymbolRef,i,i);r.references.push(a),o&&n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:a,right:o.clone()}));}}def_reduce_vars(AST_Accessor,(function(e,t,n){return push(e),reset_variables(e,n,this),t(),pop(e),!0})),def_reduce_vars(AST_Assign,(function(e,t,n){var i=this;if(i.left instanceof AST_Destructuring)return void suppress(i.left);const o=()=>{if(i.logical)return i.left.walk(e),push(e),i.right.walk(e),pop(e),!0};var r=i.left;if(!(r instanceof AST_SymbolRef))return o();var a=r.definition(),s=safe_to_assign(e,a,r.scope,i.right);if(a.assignments++,!s)return o();var u=a.fixed;if(!u&&"="!=i.operator&&!i.logical)return o();var l="="==i.operator,c=l?i.right:i;return is_modified(n,e,i,c,0)?o():(a.references.push(r),i.logical||(l||(a.chained=!0),a.fixed=l?function(){return i.right}:function(){return make_node(AST_Binary,i,{operator:i.operator.slice(0,-1),left:u instanceof AST_Node?u:u(),right:i.right})}),i.logical?(mark$1(e,a,!1),push(e),i.right.walk(e),pop(e),!0):(mark$1(e,a,!1),i.right.walk(e),mark$1(e,a,!0),mark_escaped(e,a,r.scope,i,c,0,1),!0))})),def_reduce_vars(AST_Binary,(function(e){if(lazy_op.has(this.operator))return this.left.walk(e),push(e),this.right.walk(e),pop(e),!0})),def_reduce_vars(AST_Block,(function(e,t,n){reset_block_variables(n,this);})),def_reduce_vars(AST_Case,(function(e){return push(e),this.expression.walk(e),pop(e),push(e),walk_body(this,e),pop(e),!0})),def_reduce_vars(AST_Class,(function(e,t){return clear_flag(this,16),push(e),t(),pop(e),!0})),def_reduce_vars(AST_ClassStaticBlock,(function(e,t,n){reset_block_variables(n,this);})),def_reduce_vars(AST_Conditional,(function(e){return this.condition.walk(e),push(e),this.consequent.walk(e),pop(e),push(e),this.alternative.walk(e),pop(e),!0})),def_reduce_vars(AST_Chain,(function(e,t){const n=e.safe_ids;return t(),e.safe_ids=n,!0})),def_reduce_vars(AST_Call,(function(e){this.expression.walk(e),this.optional&&push(e);for(const t of this.args)t.walk(e);return !0})),def_reduce_vars(AST_PropAccess,(function(e){if(this.optional)return this.expression.walk(e),push(e),this.property instanceof AST_Node&&this.property.walk(e),!0})),def_reduce_vars(AST_Default,(function(e,t){return push(e),t(),pop(e),!0})),def_reduce_vars(AST_Lambda,mark_lambda),def_reduce_vars(AST_Do,(function(e,t,n){reset_block_variables(n,this);const i=e.in_loop;return e.in_loop=this,push(e),this.body.walk(e),has_break_or_continue(this)&&(pop(e),push(e)),this.condition.walk(e),pop(e),e.in_loop=i,!0})),def_reduce_vars(AST_For,(function(e,t,n){reset_block_variables(n,this),this.init&&this.init.walk(e);const i=e.in_loop;return e.in_loop=this,push(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&(has_break_or_continue(this)&&(pop(e),push(e)),this.step.walk(e)),pop(e),e.in_loop=i,!0})),def_reduce_vars(AST_ForIn,(function(e,t,n){reset_block_variables(n,this),suppress(this.init),this.object.walk(e);const i=e.in_loop;return e.in_loop=this,push(e),this.body.walk(e),pop(e),e.in_loop=i,!0})),def_reduce_vars(AST_If,(function(e){return this.condition.walk(e),push(e),this.body.walk(e),pop(e),this.alternative&&(push(e),this.alternative.walk(e),pop(e)),!0})),def_reduce_vars(AST_LabeledStatement,(function(e){return push(e),this.body.walk(e),pop(e),!0})),def_reduce_vars(AST_SymbolCatch,(function(){this.definition().fixed=!1;})),def_reduce_vars(AST_SymbolRef,(function(e,t,n){var i,o=this.definition();o.references.push(this),1==o.references.length&&!o.fixed&&o.orig[0]instanceof AST_SymbolDefun&&e.loop_ids.set(o.id,e.in_loop),void 0!==o.fixed&&safe_to_read(e,o)?o.fixed&&((i=this.fixed_value())instanceof AST_Lambda&&is_recursive_ref(e,o)?o.recursive_refs++:i&&!n.exposed(o)&&ref_once(e,n,o)?o.single_use=i instanceof AST_Lambda&&!i.pinned()||i instanceof AST_Class||o.scope===this.scope&&i.is_constant_expression():o.single_use=!1,is_modified(n,e,this,i,0,is_immutable(i))&&(o.single_use?o.single_use="m":o.fixed=!1)):o.fixed=!1,mark_escaped(e,o,this.scope,this,i,0,1);})),def_reduce_vars(AST_Toplevel,(function(e,t,n){this.globals.forEach((function(e){reset_def(n,e);})),reset_variables(e,n,this);})),def_reduce_vars(AST_Try,(function(e,t,n){return reset_block_variables(n,this),push(e),walk_body(this,e),pop(e),this.bcatch&&(push(e),this.bcatch.walk(e),pop(e)),this.bfinally&&this.bfinally.walk(e),!0})),def_reduce_vars(AST_Unary,(function(e){var t=this;if("++"===t.operator||"--"===t.operator){var n=t.expression;if(n instanceof AST_SymbolRef){var i=n.definition(),o=safe_to_assign(e,i,n.scope,!0);if(i.assignments++,o){var r=i.fixed;if(r)return i.references.push(n),i.chained=!0,i.fixed=function(){return make_node(AST_Binary,t,{operator:t.operator.slice(0,-1),left:make_node(AST_UnaryPrefix,t,{operator:"+",expression:r instanceof AST_Node?r:r()}),right:make_node(AST_Number,t,{value:1})})},mark$1(e,i,!0),!0}}}})),def_reduce_vars(AST_VarDef,(function(e,t){var n=this;if(n.name instanceof AST_Destructuring)suppress(n.name);else {var i=n.name.definition();if(n.value){if(safe_to_assign(e,i,n.name.scope,n.value))return i.fixed=function(){return n.value},e.loop_ids.set(i.id,e.in_loop),mark$1(e,i,!1),t(),mark$1(e,i,!0),!0;i.fixed=!1;}}})),def_reduce_vars(AST_While,(function(e,t,n){reset_block_variables(n,this);const i=e.in_loop;return e.in_loop=this,push(e),t(),pop(e),e.in_loop=i,!0}));class Compressor extends TreeWalker{constructor(e,{false_by_default:t=!1,mangle_options:n=!1}){super(),void 0===e.defaults||e.defaults||(t=!0),this.options=defaults$1(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:!t,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_symbols:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var i=this.options.global_defs;if("object"==typeof i)for(var o in i)"@"===o[0]&&HOP(i,o)&&(i[o.slice(1)]=parse$4(i[o],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var r=this.options.pure_funcs;this.pure_funcs="function"==typeof r?r:r?function(e){return !r.includes(e.expression.print_to_string())}:return_true;var a=this.options.top_retain;a instanceof RegExp?this.top_retain=function(e){return a.test(e.name)}:"function"==typeof a?this.top_retain=a:a&&("string"==typeof a&&(a=a.split(/,/)),this.top_retain=function(e){return a.includes(e.name)}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var s=this.options.toplevel;this.toplevel="string"==typeof s?{funcs:/funcs/.test(s),vars:/vars/.test(s)}:{funcs:s,vars:s};var u=this.options.sequences;this.sequences_limit=1==u?800:0|u,this.evaluated_regexps=new Map,this._toplevel=void 0,this.mangle_options=n?format_mangler_options(n):n;}option(e){return this.options[e]}exposed(e){if(e.export)return !0;if(e.global)for(var t=0,n=e.orig.length;t<n;t++)if(!this.toplevel[e.orig[t]instanceof AST_SymbolDefun?"funcs":"vars"])return !0;return !1}in_boolean_context(){if(!this.option("booleans"))return !1;for(var e,t=this.self(),n=0;e=this.parent(n);n++){if(e instanceof AST_SimpleStatement||e instanceof AST_Conditional&&e.condition===t||e instanceof AST_DWLoop&&e.condition===t||e instanceof AST_For&&e.condition===t||e instanceof AST_If&&e.condition===t||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression===t)return !0;if(!(e instanceof AST_Binary&&("&&"==e.operator||"||"==e.operator||"??"==e.operator)||e instanceof AST_Conditional||e.tail_node()===t))return !1;t=e;}}get_toplevel(){return this._toplevel}compress(e){e=e.resolve_defines(this),this._toplevel=e,this.option("expression")&&this._toplevel.process_expression(!0);for(var t=+this.options.passes||1,n=1/0,i=!1,o=this.mangle_options&&this.mangle_options.nth_identifier||base54,r={ie8:this.option("ie8"),nth_identifier:o},a=0;a<t;a++)if(this._toplevel.figure_out_scope(r),0===a&&this.option("drop_console")&&(this._toplevel=this._toplevel.drop_console()),(a>0||this.option("reduce_vars"))&&this._toplevel.reset_opt_flags(this),this._toplevel=this._toplevel.transform(this),t>1){let e=0;if(walk$2(this._toplevel,(()=>{e++;})),e<n)n=e,i=!1;else {if(i)break;i=!0;}}return this.option("expression")&&this._toplevel.process_expression(!1),e=this._toplevel,this._toplevel=void 0,e}before(e,t){if(has_flag(e,256))return e;var n=!1;e instanceof AST_Scope&&(e=(e=e.hoist_properties(this)).hoist_declarations(this),n=!0),t(e,this),t(e,this);var i=e.optimize(this);return n&&i instanceof AST_Scope&&(i.drop_unused(this),t(i,this)),i===e&&set_flag(i,256),i}}function def_optimize(e,t){e.DEFMETHOD("optimize",(function(e){var n=this;if(has_flag(n,512))return n;if(e.has_directive("use asm"))return n;var i=t(n,e);return set_flag(i,512),i}));}function find_variable(e,t){for(var n,i=0;(n=e.parent(i++))&&!(n instanceof AST_Scope);)if(n instanceof AST_Catch&&n.argname){n=n.argname.definition().scope;break}return n.find_variable(t)}def_optimize(AST_Node,(function(e){return e})),AST_Toplevel.DEFMETHOD("drop_console",(function(){return this.transform(new TreeTransformer((function(e){if("Call"==e.TYPE){var t=e.expression;if(t instanceof AST_PropAccess){for(var n=t.expression;n.expression;)n=n.expression;if(is_undeclared_ref(n)&&"console"==n.name)return make_node(AST_Undefined,e)}}})))})),AST_Node.DEFMETHOD("equivalent_to",(function(e){return equivalent_to(this,e)})),AST_Scope.DEFMETHOD("process_expression",(function(e,t){var n=this,i=new TreeTransformer((function(o){if(e&&o instanceof AST_SimpleStatement)return make_node(AST_Return,o,{value:o.body});if(!e&&o instanceof AST_Return){if(t){var r=o.value&&o.value.drop_side_effect_free(t,!0);return r?make_node(AST_SimpleStatement,o,{body:r}):make_node(AST_EmptyStatement,o)}return make_node(AST_SimpleStatement,o,{body:o.value||make_node(AST_UnaryPrefix,o,{operator:"void",expression:make_node(AST_Number,o,{value:0})})})}if(o instanceof AST_Class||o instanceof AST_Lambda&&o!==n)return o;if(o instanceof AST_Block){var a=o.body.length-1;a>=0&&(o.body[a]=o.body[a].transform(i));}else o instanceof AST_If?(o.body=o.body.transform(i),o.alternative&&(o.alternative=o.alternative.transform(i))):o instanceof AST_With&&(o.body=o.body.transform(i));return o}));n.transform(i);})),AST_Toplevel.DEFMETHOD("reset_opt_flags",(function(e){const t=this,n=e.option("reduce_vars"),i=new TreeWalker((function(o,r){if(clear_flag(o,1792),n)return e.top_retain&&o instanceof AST_Defun&&i.parent()===t&&set_flag(o,TOP),o.reduce_vars(i,r,e)}));i.safe_ids=Object.create(null),i.in_loop=null,i.loop_ids=new Map,i.defs_to_safe_ids=new Map,t.walk(i);})),AST_Symbol.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;return !e||e instanceof AST_Node?e:e()})),AST_SymbolRef.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof AST_SymbolLambda}));var global_names=makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");AST_SymbolRef.DEFMETHOD("is_declared",(function(e){return !this.definition().undeclared||e.option("unsafe")&&global_names.has(this.name)}));var directives=new Set(["use asm","use strict"]);function can_be_extracted_from_if_block(e){return !(e instanceof AST_Const||e instanceof AST_Let||e instanceof AST_Class)}function opt_AST_Lambda(e,t){return tighten_body(e.body,t),t.option("side_effects")&&1==e.body.length&&e.body[0]===t.has_directive("use strict")&&(e.body.length=0),e}function if_break_in_loop(e,t){var n=e.body instanceof AST_BlockStatement?e.body.body[0]:e.body;if(t.option("dead_code")&&o(n)){var i=[];return e.init instanceof AST_Statement?i.push(e.init):e.init&&i.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),e.condition&&i.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),trim_unreachable_code(t,e.body,i),make_node(AST_BlockStatement,e,{body:i})}return n instanceof AST_If&&(o(n.body)?(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition.negate(t)}):e.condition=n.condition.negate(t),r(n.alternative)):o(n.alternative)&&(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition}):e.condition=n.condition,r(n.body))),e;function o(e){return e instanceof AST_Break&&t.loopcontrol_target(e)===t.self()}function r(n){n=as_statement_array(n),e.body instanceof AST_BlockStatement?(e.body=e.body.clone(),e.body.body=n.concat(e.body.body.slice(1)),e.body=e.body.transform(t)):e.body=make_node(AST_BlockStatement,e.body,{body:n}).transform(t),e=if_break_in_loop(e,t);}}def_optimize(AST_Directive,(function(e,t){return !t.option("directives")||directives.has(e.value)&&t.has_directive(e.value)===e?e:make_node(AST_EmptyStatement,e)})),def_optimize(AST_Debugger,(function(e,t){return t.option("drop_debugger")?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_LabeledStatement,(function(e,t){return e.body instanceof AST_Break&&t.loopcontrol_target(e.body)===e.body?make_node(AST_EmptyStatement,e):0==e.label.references.length?e.body:e})),def_optimize(AST_Block,(function(e,t){return tighten_body(e.body,t),e})),def_optimize(AST_BlockStatement,(function(e,t){switch(tighten_body(e.body,t),e.body.length){case 1:if(!t.has_directive("use strict")&&t.parent()instanceof AST_If&&can_be_extracted_from_if_block(e.body[0])||can_be_evicted_from_block(e.body[0]))return e.body[0];break;case 0:return make_node(AST_EmptyStatement,e)}return e})),def_optimize(AST_Lambda,opt_AST_Lambda),AST_Scope.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),i=e.option("hoist_vars");if(n||i){var o=[],r=[],a=new Map,s=0,u=0;walk$2(t,(e=>e instanceof AST_Scope&&e!==t||(e instanceof AST_Var?(++u,!0):void 0))),i=i&&u>1;var l=new TreeTransformer((function(u){if(u!==t){if(u instanceof AST_Directive)return o.push(u),make_node(AST_EmptyStatement,u);if(n&&u instanceof AST_Defun&&!(l.parent()instanceof AST_Export)&&l.parent()===t)return r.push(u),make_node(AST_EmptyStatement,u);if(i&&u instanceof AST_Var&&!u.definitions.some((e=>e.name instanceof AST_Destructuring))){u.definitions.forEach((function(e){a.set(e.name.name,e),++s;}));var c=u.to_assignments(e),_=l.parent();if(_ instanceof AST_ForIn&&_.init===u){if(null==c){var f=u.definitions[0].name;return make_node(AST_SymbolRef,f,f)}return c}return _ instanceof AST_For&&_.init===u?c:c?make_node(AST_SimpleStatement,u,{body:c}):make_node(AST_EmptyStatement,u)}if(u instanceof AST_Scope)return u}}));if(t=t.transform(l),s>0){var c=[];const e=t instanceof AST_Lambda,n=e?t.args_as_names():null;if(a.forEach(((t,i)=>{e&&n.some((e=>e.name===t.name.name))?a.delete(i):((t=t.clone()).value=null,c.push(t),a.set(i,t));})),c.length>0){for(;0<t.body.length;){if(t.body[0]instanceof AST_SimpleStatement){var _,f,p=t.body[0].body;if(p instanceof AST_Assign&&"="==p.operator&&(_=p.left)instanceof AST_Symbol&&a.has(_.name)){if((d=a.get(_.name)).value)break;d.value=p.right,remove$1(c,d),c.push(d),t.body.splice(0,1);continue}if(p instanceof AST_Sequence&&(f=p.expressions[0])instanceof AST_Assign&&"="==f.operator&&(_=f.left)instanceof AST_Symbol&&a.has(_.name)){var d;if((d=a.get(_.name)).value)break;d.value=f.right,remove$1(c,d),c.push(d),t.body[0].body=make_sequence(p,p.expressions.slice(1));continue}}if(t.body[0]instanceof AST_EmptyStatement)t.body.splice(0,1);else {if(!(t.body[0]instanceof AST_BlockStatement))break;t.body.splice(0,1,...t.body[0].body);}}c=make_node(AST_Var,t,{definitions:c}),r.push(c);}}t.body=o.concat(r,t.body);}return t})),AST_Scope.DEFMETHOD("hoist_properties",(function(e){var t=this;if(!e.option("hoist_props")||e.has_directive("use asm"))return t;var n=t instanceof AST_Toplevel&&e.top_retain||return_false,i=new Map,o=new TreeTransformer((function(r,a){if(r instanceof AST_VarDef){const s=r.name;let u,l;if(s.scope===t&&1!=(u=s.definition()).escaped&&!u.assignments&&!u.direct_access&&!u.single_use&&!e.exposed(u)&&!n(u)&&(l=s.fixed_value())===r.value&&l instanceof AST_Object&&!l.properties.some((e=>e instanceof AST_Expansion||e.computed_key()))){a(r,this);const e=new Map,n=[];return l.properties.forEach((({key:i,value:a})=>{const u=o.find_scope(),l=t.create_symbol(s.CTOR,{source:s,scope:u,conflict_scopes:new Set([u,...s.definition().references.map((e=>e.scope))]),tentative_name:s.name+"_"+i});e.set(String(i),l.definition()),n.push(make_node(AST_VarDef,r,{name:l,value:a}));})),i.set(u.id,e),MAP.splice(n)}}else if(r instanceof AST_PropAccess&&r.expression instanceof AST_SymbolRef){const e=i.get(r.expression.definition().id);if(e){const t=e.get(String(get_simple_key(r.property))),n=make_node(AST_SymbolRef,r,{name:t.name,scope:r.expression.scope,thedef:t});return n.reference({}),n}}}));return t.transform(o)})),def_optimize(AST_SimpleStatement,(function(e,t){if(t.option("side_effects")){var n=e.body,i=n.drop_side_effect_free(t,!0);if(!i)return make_node(AST_EmptyStatement,e);if(i!==n)return make_node(AST_SimpleStatement,e,{body:i})}return e})),def_optimize(AST_While,(function(e,t){return t.option("loops")?make_node(AST_For,e,e).optimize(t):e})),def_optimize(AST_Do,(function(e,t){if(!t.option("loops"))return e;var n=e.condition.tail_node().evaluate(t);if(!(n instanceof AST_Node)){if(n)return make_node(AST_For,e,{body:make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]})}).optimize(t);if(!has_break_or_continue(e,t.parent()))return make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]}).optimize(t)}return e})),def_optimize(AST_For,(function(e,t){if(!t.option("loops"))return e;if(t.option("side_effects")&&e.init&&(e.init=e.init.drop_side_effect_free(t)),e.condition){var n=e.condition.evaluate(t);if(!(n instanceof AST_Node))if(n)e.condition=null;else if(!t.option("dead_code")){var i=e.condition;e.condition=make_node_from_constant(n,e.condition),e.condition=best_of_expression(e.condition.transform(t),i);}if(t.option("dead_code")&&(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n)){var o=[];return trim_unreachable_code(t,e.body,o),e.init instanceof AST_Statement?o.push(e.init):e.init&&o.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),o.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),make_node(AST_BlockStatement,e,{body:o}).optimize(t)}}return if_break_in_loop(e,t)})),def_optimize(AST_If,(function(e,t){if(is_empty(e.alternative)&&(e.alternative=null),!t.option("conditionals"))return e;var n=e.condition.evaluate(t);if(!(t.option("dead_code")||n instanceof AST_Node)){var i=e.condition;e.condition=make_node_from_constant(n,i),e.condition=best_of_expression(e.condition.transform(t),i);}if(t.option("dead_code")){if(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n){var o=[];return trim_unreachable_code(t,e.body,o),o.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),e.alternative&&o.push(e.alternative),make_node(AST_BlockStatement,e,{body:o}).optimize(t)}if(!(n instanceof AST_Node))return (o=[]).push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),o.push(e.body),e.alternative&&trim_unreachable_code(t,e.alternative,o),make_node(AST_BlockStatement,e,{body:o}).optimize(t)}var r=e.condition.negate(t),a=e.condition.size(),s=r.size(),u=s<a;if(e.alternative&&u){u=!1,e.condition=r;var l=e.body;e.body=e.alternative||make_node(AST_EmptyStatement,e),e.alternative=l;}if(is_empty(e.body)&&is_empty(e.alternative))return make_node(AST_SimpleStatement,e.condition,{body:e.condition.clone()}).optimize(t);if(e.body instanceof AST_SimpleStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.body,alternative:e.alternative.body})}).optimize(t);if(is_empty(e.alternative)&&e.body instanceof AST_SimpleStatement)return a===s&&!u&&e.condition instanceof AST_Binary&&"||"==e.condition.operator&&(u=!0),u?make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:r,right:e.body.body})}).optimize(t):make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:e.body.body})}).optimize(t);if(e.body instanceof AST_EmptyStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:e.condition,right:e.alternative.body})}).optimize(t);if(e.body instanceof AST_Exit&&e.alternative instanceof AST_Exit&&e.body.TYPE==e.alternative.TYPE)return make_node(e.body.CTOR,e,{value:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.value||make_node(AST_Undefined,e.body),alternative:e.alternative.value||make_node(AST_Undefined,e.alternative)}).transform(t)}).optimize(t);if(e.body instanceof AST_If&&!e.body.alternative&&!e.alternative&&(e=make_node(AST_If,e,{condition:make_node(AST_Binary,e.condition,{operator:"&&",left:e.condition,right:e.body.condition}),body:e.body.body,alternative:null})),aborts(e.body)&&e.alternative){var c=e.alternative;return e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,c]}).optimize(t)}return aborts(e.alternative)?(o=e.body,e.body=e.alternative,e.condition=u?r:e.condition.negate(t),e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,o]}).optimize(t)):e})),def_optimize(AST_Switch,(function(e,t){if(!t.option("switches"))return e;var n,i=e.expression.evaluate(t);if(!(i instanceof AST_Node)){var o=e.expression;e.expression=make_node_from_constant(i,o),e.expression=best_of_expression(e.expression.transform(t),o);}if(!t.option("dead_code"))return e;i instanceof AST_Node&&(i=e.expression.tail_node().evaluate(t));for(var r,a,s=[],u=[],l=0,c=e.body.length;l<c&&!a;l++){if((n=e.body[l])instanceof AST_Default)r?d(n,u[u.length-1]):r=n;else if(!(i instanceof AST_Node)){var _=n.expression.evaluate(t);if(!(_ instanceof AST_Node)&&_!==i){d(n,u[u.length-1]);continue}if(_ instanceof AST_Node&&(_=n.expression.tail_node().evaluate(t)),_===i&&(a=n,r)){var f=u.indexOf(r);u.splice(f,1),d(r,u[f-1]),r=null;}}u.push(n);}for(;l<c;)d(e.body[l++],u[u.length-1]);e.body=u;let p=r||a;if(r=null,a=null,u.every(((e,t)=>(e===p||e.expression instanceof AST_Constant)&&(0===e.body.length||aborts(e)||u.length-1===t))))for(let e=0;e<u.length;e++){const t=u[e];for(let n=e+1;n<u.length;n++){const i=u[n];if(0===i.body.length)continue;const o=n===u.length-1,r=m(i,t,!1);if(r||o&&m(i,t,!0)){!r&&o&&i.body.push(make_node(AST_Break));let t=n-1,a=0;for(;t>e&&T(u[t--]);)a++;const s=u.splice(n-a,1+a);u.splice(e+1,0,...s),e+=s.length;}}}for(let e=0;e<u.length;e++){let t=u[e];if(0!==t.body.length&&aborts(t))for(let n=e+1;n<u.length;e++,n++){let e=u[n];if(0!==e.body.length){if(!(m(e,t,!1)||n===u.length-1&&m(e,t,!0)))break;t.body=[],t=e;}}}{let e=u.length-1;for(;e>=0;e--){let n=u[e].body;if(A(n[n.length-1],t)&&n.pop(),!T(u[e]))break}if(e++,!p||u.indexOf(p)>=e)for(let n=u.length-1;n>=e;n--){let e=u[n];if(e===p)p=null,u.pop();else {if(e.expression.has_side_effects(t))break;u.pop();}}}e:if(p){let e=u.indexOf(p),n=e;for(;n<u.length-1&&T(u[n]);n++);if(n<u.length-1)break e;let i=u.length-1;for(;i>=0;i--){let e=u[i];if(e!==p&&e.expression.has_side_effects(t))break}if(n>i){let t=e-1;for(;t>=0&&T(u[t]);t--);let o=Math.max(i,t)+1,r=e;i>e?(r=i,u[i].body=u[n].body):p.body=u[n].body,u.splice(r+1,n-r),u.splice(o,e-o);}}e:if(p){let n,i=u.findIndex((e=>!T(e)));if(i===u.length-1){let t=u[i];if(h(e))break e;n=make_node(AST_BlockStatement,t,{body:t.body}),t.body=[];}else if(-1!==i)break e;let o=u.find((e=>e!==p&&e.expression.has_side_effects(t)));if(!o)return make_node(AST_BlockStatement,e,{body:s.concat(S(e.expression),p.expression?S(p.expression):[],n||[])}).optimize(t);const r=u.indexOf(p);if(u.splice(r,1),p=null,n)return make_node(AST_BlockStatement,e,{body:s.concat(e,n)}).optimize(t)}if(u.length>0&&(u[0].body=s.concat(u[0].body)),0==u.length)return make_node(AST_BlockStatement,e,{body:s.concat(S(e.expression))}).optimize(t);if(1==u.length&&!h(e)){let n=u[0];return make_node(AST_If,e,{condition:make_node(AST_Binary,e,{operator:"===",left:e.expression,right:n.expression}),body:make_node(AST_BlockStatement,n,{body:n.body}),alternative:null}).optimize(t)}if(2===u.length&&p&&!h(e)){let n=u[0]===p?u[1]:u[0],i=p.expression&&S(p.expression);if(aborts(u[0])){let o=u[0];return A(o.body[o.body.length-1],t)&&o.body.pop(),make_node(AST_If,e,{condition:make_node(AST_Binary,e,{operator:"===",left:e.expression,right:n.expression}),body:make_node(AST_BlockStatement,n,{body:n.body}),alternative:make_node(AST_BlockStatement,p,{body:[].concat(i||[],p.body)})}).optimize(t)}let o="===",r=make_node(AST_BlockStatement,n,{body:n.body}),a=make_node(AST_BlockStatement,p,{body:[].concat(i||[],p.body)});if(u[0]===p){o="!==";let e=a;a=r,r=e;}return make_node(AST_BlockStatement,e,{body:[make_node(AST_If,e,{condition:make_node(AST_Binary,e,{operator:o,left:e.expression,right:n.expression}),body:r,alternative:null})].concat(a)}).optimize(t)}return e;function d(e,n){n&&!aborts(n)?n.body=n.body.concat(e.body):trim_unreachable_code(t,e,s);}function m(e,t,n){let i=e.body,o=t.body;if(n&&(i=i.concat(make_node(AST_Break))),i.length!==o.length)return !1;let r=make_node(AST_BlockStatement,e,{body:i}),a=make_node(AST_BlockStatement,t,{body:o});return r.equivalent_to(a)}function S(e){return make_node(AST_SimpleStatement,e,{body:e})}function h(e){let t=!1,n=new TreeWalker((e=>{if(t)return !0;if(e instanceof AST_Lambda)return !0;if(e instanceof AST_SimpleStatement)return !0;if(!A(e,n))return;let i=n.parent();i instanceof AST_SwitchBranch&&i.body[i.body.length-1]===e||(t=!0);}));return e.walk(n),t}function A(t,n){return t instanceof AST_Break&&n.loopcontrol_target(t)===e}function T(e){return !aborts(e)&&!make_node(AST_BlockStatement,e,{body:e.body}).has_side_effects(t)}})),def_optimize(AST_Try,(function(e,t){if(tighten_body(e.body,t),e.bcatch&&e.bfinally&&e.bfinally.body.every(is_empty)&&(e.bfinally=null),t.option("dead_code")&&e.body.every(is_empty)){var n=[];return e.bcatch&&trim_unreachable_code(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),make_node(AST_BlockStatement,e,{body:n}).optimize(t)}return e})),AST_Definitions.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){t.name instanceof AST_SymbolDeclaration?(t.value=null,e.push(t)):walk$2(t.name,(n=>{n instanceof AST_SymbolDeclaration&&e.push(make_node(AST_VarDef,t,{name:n,value:null}));}));})),this.definitions=e;})),AST_Definitions.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars"),n=[];for(const e of this.definitions){if(e.value){var i=make_node(AST_SymbolRef,e.name,e.name);n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:i,right:e.value})),t&&(i.definition().fixed=!1);}const o=e.name.definition();o.eliminated++,o.replaced--;}return 0==n.length?null:make_sequence(this,n)})),def_optimize(AST_Definitions,(function(e){return 0==e.definitions.length?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_VarDef,(function(e,t){return e.name instanceof AST_SymbolLet&&null!=e.value&&is_undefined(e.value,t)&&(e.value=null),e})),def_optimize(AST_Import,(function(e){return e})),def_optimize(AST_Call,(function(e,t){var n=e.expression,i=n;inline_array_like_spread(e.args);var o=e.args.every((e=>!(e instanceof AST_Expansion)));if(t.option("reduce_vars")&&i instanceof AST_SymbolRef&&!has_annotation(e,_NOINLINE)){const e=i.fixed_value();retain_top_func(e,t)||(i=e);}var r=i instanceof AST_Lambda;if(r&&i.pinned())return e;if(t.option("unused")&&o&&r&&!i.uses_arguments){for(var a=0,s=0,u=0,l=e.args.length;u<l;u++){if(i.argnames[u]instanceof AST_Expansion){if(has_flag(i.argnames[u].expression,1))for(;u<l;)(d=e.args[u++].drop_side_effect_free(t))&&(e.args[a++]=d);else for(;u<l;)e.args[a++]=e.args[u++];s=a;break}var c=u>=i.argnames.length;if(c||has_flag(i.argnames[u],1)){if(d=e.args[u].drop_side_effect_free(t))e.args[a++]=d;else if(!c){e.args[a++]=make_node(AST_Number,e.args[u],{value:0});continue}}else e.args[a++]=e.args[u];s=a;}e.args.length=s;}if(t.option("unsafe")){if(n instanceof AST_Dot&&"Array"===n.start.value&&"from"===n.property&&1===e.args.length){const[n]=e.args;if(n instanceof AST_Array)return make_node(AST_Array,n,{elements:n.elements}).optimize(t)}if(is_undeclared_ref(n))switch(n.name){case"Array":if(1!=e.args.length)return make_node(AST_Array,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof AST_Number&&e.args[0].value<=11){const t=[];for(let n=0;n<e.args[0].value;n++)t.push(new AST_Hole);return new AST_Array({elements:t})}break;case"Object":if(0==e.args.length)return make_node(AST_Object,e,{properties:[]});break;case"String":if(0==e.args.length)return make_node(AST_String,e,{value:""});if(e.args.length<=1)return make_node(AST_Binary,e,{left:e.args[0],operator:"+",right:make_node(AST_String,e,{value:""})}).optimize(t);break;case"Number":if(0==e.args.length)return make_node(AST_Number,e,{value:0});if(1==e.args.length&&t.option("unsafe_math"))return make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"+"}).optimize(t);break;case"Symbol":1==e.args.length&&e.args[0]instanceof AST_String&&t.option("unsafe_symbols")&&(e.args.length=0);break;case"Boolean":if(0==e.args.length)return make_node(AST_False,e);if(1==e.args.length)return make_node(AST_UnaryPrefix,e,{expression:make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"!"}),operator:"!"}).optimize(t);break;case"RegExp":var _=[];if(e.args.length>=1&&e.args.length<=2&&e.args.every((e=>{var n=e.evaluate(t);return _.push(n),e!==n}))&&regexp_is_safe(_[0])){let[n,i]=_;n=regexp_source_fix(new RegExp(n).source);const o=make_node(AST_RegExp,e,{value:{source:n,flags:i}});if(o._eval(t)!==o)return o}}else if(n instanceof AST_Dot)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return make_node(AST_Binary,e,{left:make_node(AST_String,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof AST_Array)e:{var f;if(!(e.args.length>0&&(f=e.args[0].evaluate(t))===e.args[0])){var p,d,m=[],S=[];for(u=0,l=n.expression.elements.length;u<l;u++){var h=n.expression.elements[u];if(h instanceof AST_Expansion)break e;var A=h.evaluate(t);A!==h?S.push(A):(S.length>0&&(m.push(make_node(AST_String,e,{value:S.join(f)})),S.length=0),m.push(h));}return S.length>0&&m.push(make_node(AST_String,e,{value:S.join(f)})),0==m.length?make_node(AST_String,e,{value:""}):1==m.length?m[0].is_string(t)?m[0]:make_node(AST_Binary,m[0],{operator:"+",left:make_node(AST_String,e,{value:""}),right:m[0]}):""==f?(p=m[0].is_string(t)||m[1].is_string(t)?m.shift():make_node(AST_String,e,{value:""}),m.reduce((function(e,t){return make_node(AST_Binary,t,{operator:"+",left:e,right:t})}),p).optimize(t)):((d=e.clone()).expression=d.expression.clone(),d.expression.expression=d.expression.expression.clone(),d.expression.expression.elements=m,best_of(t,e,d))}}break;case"charAt":if(n.expression.is_string(t)){var T=e.args[0],E=T?T.evaluate(t):0;if(E!==T)return make_node(AST_Sub,n,{expression:n.expression,property:make_node_from_constant(0|E,T||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof AST_Array){var g=e.args[1].elements.slice();return g.unshift(e.args[0]),make_node(AST_Call,e,{expression:make_node(AST_Dot,n,{expression:n.expression,optional:!1,property:"call"}),args:g}).optimize(t)}break;case"call":var b=n.expression;if(b instanceof AST_SymbolRef&&(b=b.fixed_value()),b instanceof AST_Lambda&&!b.contains_this())return (e.args.length?make_sequence(this,[e.args[0],make_node(AST_Call,e,{expression:n.expression,args:e.args.slice(1)})]):make_node(AST_Call,e,{expression:n.expression,args:[]})).optimize(t)}}if(t.option("unsafe_Function")&&is_undeclared_ref(n)&&"Function"==n.name){if(0==e.args.length)return make_node(AST_Function,e,{argnames:[],body:[]}).optimize(t);var D=t.mangle_options&&t.mangle_options.nth_identifier||base54;if(e.args.every((e=>e instanceof AST_String)))try{var y="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})",v=parse$4(y),C={ie8:t.option("ie8"),nth_identifier:D};v.figure_out_scope(C);var k,R=new Compressor(t.options,{mangle_options:t.mangle_options});return (v=v.transform(R)).figure_out_scope(C),v.compute_char_frequency(C),v.mangle_names(C),walk$2(v,(e=>{if(is_func_expr(e))return k=e,walk_abort})),y=OutputStream(),AST_BlockStatement.prototype._codegen.call(k,k,y),e.args=[make_node(AST_String,e,{value:k.argnames.map((function(e){return e.print_to_string()})).join(",")}),make_node(AST_String,e.args[e.args.length-1],{value:y.get().replace(/^{|}$/g,"")})],e}catch(e){if(!(e instanceof JS_Parse_Error))throw e}}return inline_into_call(e,i,t)})),def_optimize(AST_New,(function(e,t){return t.option("unsafe")&&is_undeclared_ref(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?make_node(AST_Call,e,e).transform(t):e})),def_optimize(AST_Sequence,(function(e,t){if(!t.option("side_effects"))return e;var n,i,o=[];n=first_in_statement(t),i=e.expressions.length-1,e.expressions.forEach((function(e,r){r<i&&(e=e.drop_side_effect_free(t,n)),e&&(merge_sequence(o,e),n=!1);}));var r=o.length-1;return function(){for(;r>0&&is_undefined(o[r],t);)r--;r<o.length-1&&(o[r]=make_node(AST_UnaryPrefix,e,{operator:"void",expression:o[r]}),o.length=r+1);}(),0==r?((e=maintain_this_binding(t.parent(),t.self(),o[0]))instanceof AST_Sequence||(e=e.optimize(t)),e):(e.expressions=o,e)})),AST_Unary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")&&this.expression instanceof AST_Sequence){var t=this.expression.expressions.slice(),n=this.clone();return n.expression=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}return this})),def_optimize(AST_UnaryPostfix,(function(e,t){return e.lift_sequences(t)})),def_optimize(AST_UnaryPrefix,(function(e,t){var n=e.expression;if("delete"==e.operator&&!(n instanceof AST_SymbolRef||n instanceof AST_PropAccess||n instanceof AST_Chain||is_identifier_atom(n)))return make_sequence(e,[n,make_node(AST_True,e)]).optimize(t);var i=e.lift_sequences(t);if(i!==e)return i;if(t.option("side_effects")&&"void"==e.operator)return (n=n.drop_side_effect_free(t))?(e.expression=n,e):make_node(AST_Undefined,e).optimize(t);if(t.in_boolean_context())switch(e.operator){case"!":if(n instanceof AST_UnaryPrefix&&"!"==n.operator)return n.expression;n instanceof AST_Binary&&(e=best_of(t,e,n.negate(t,first_in_statement(t))));break;case"typeof":return (n instanceof AST_SymbolRef?make_node(AST_True,e):make_sequence(e,[n,make_node(AST_True,e)])).optimize(t)}if("-"==e.operator&&n instanceof AST_Infinity&&(n=n.transform(t)),n instanceof AST_Binary&&("+"==e.operator||"-"==e.operator)&&("*"==n.operator||"/"==n.operator||"%"==n.operator))return make_node(AST_Binary,e,{operator:n.operator,left:make_node(AST_UnaryPrefix,n.left,{operator:e.operator,expression:n.left}),right:n.right});if("-"!=e.operator||!(n instanceof AST_Number||n instanceof AST_Infinity||n instanceof AST_BigInt)){var o=e.evaluate(t);if(o!==e)return best_of(t,o=make_node_from_constant(o,e).optimize(t),e)}return e})),AST_Binary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")){if(this.left instanceof AST_Sequence){var t=this.left.expressions.slice();return (n=this.clone()).left=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}if(this.right instanceof AST_Sequence&&!this.left.has_side_effects(e)){for(var n,i="="==this.operator&&this.left instanceof AST_SymbolRef,o=(t=this.right.expressions).length-1,r=0;r<o&&(i||!t[r].has_side_effects(e));r++);if(r==o)return t=t.slice(),(n=this.clone()).right=t.pop(),t.push(n),make_sequence(this,t).optimize(e);if(r>0)return (n=this.clone()).right=make_sequence(this.right,t.slice(r)),(t=t.slice(0,r)).push(n),make_sequence(this,t).optimize(e)}}return this}));var commutativeOperators=makePredicate("== === != !== * & | ^");function is_object(e){return e instanceof AST_Array||e instanceof AST_Lambda||e instanceof AST_Object||e instanceof AST_Class}function is_atomic(e,t){return e instanceof AST_SymbolRef||e.TYPE===t.TYPE}def_optimize(AST_Binary,(function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function i(t){if(n()){t&&(e.operator=t);var i=e.left;e.left=e.right,e.right=i;}}if(commutativeOperators.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof AST_Binary&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator]||i()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var o=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!o&&is_undefined(e.left,t))e.left=make_node(AST_Null,e.left);else if(t.option("typeofs")&&e.left instanceof AST_String&&"undefined"==e.left.value&&e.right instanceof AST_UnaryPrefix&&"typeof"==e.right.operator){var r=e.right.expression;(r instanceof AST_SymbolRef?!r.is_declared(t):r instanceof AST_PropAccess&&t.option("ie8"))||(e.right=r,e.left=make_node(AST_Undefined,e.left).optimize(t),2==e.operator.length&&(e.operator+="="));}else if(e.left instanceof AST_SymbolRef&&e.right instanceof AST_SymbolRef&&e.left.definition()===e.right.definition()&&is_object(e.left.fixed_value()))return make_node("="==e.operator[0]?AST_True:AST_False,e);break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof AST_Binary&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof AST_Binary&&a.operator==e.right.operator&&(is_undefined(a.left,t)&&e.right.left instanceof AST_Null||a.left instanceof AST_Null&&is_undefined(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=make_node(AST_Binary,e,{operator:a.operator.slice(0,-1),left:make_node(AST_Null,e),right:a.right});return a!==e.left&&(s=make_node(AST_Binary,e,{operator:e.operator,left:e.left.left,right:s})),s}}if("+"==e.operator&&t.in_boolean_context()){var u=e.left.evaluate(t),l=e.right.evaluate(t);if(u&&"string"==typeof u)return make_sequence(e,[e.right,make_node(AST_True,e)]).optimize(t);if(l&&"string"==typeof l)return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof AST_Binary)||t.parent()instanceof AST_Assign){var c=make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t,first_in_statement(t))});e=best_of(t,e,c);}if(t.option("unsafe_comps"))switch(e.operator){case"<":i(">");break;case"<=":i(">=");}}if("+"==e.operator){if(e.right instanceof AST_String&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof AST_String&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.left instanceof AST_String&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(!(u instanceof AST_Node))return make_sequence(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)&&("&&"==(_=t.parent()).operator&&_.left===t.self()||t.in_boolean_context()))return e.left.optimize(t)}else {if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_False,e)]).optimize(t);set_flag(e,4);}if("||"==e.left.operator&&!(f=e.left.right.evaluate(t)))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var _,f;if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return make_sequence(e,[e.left,e.right]).optimize(t);if(!(u instanceof AST_Node))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)){if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t);set_flag(e,2);}}else if("||"==(_=t.parent()).operator&&_.left===t.self()||t.in_boolean_context())return e.left.optimize(t);if("&&"==e.left.operator&&(f=e.left.right.evaluate(t))&&!(f instanceof AST_Node))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(is_nullish(e.left,t))return e.right;if(!((u=e.left.evaluate(t))instanceof AST_Node))return null==u?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof AST_Node||n))return e.left}}var p=!0;switch(e.operator){case"+":if(e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)){var d=(m=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);m!==d&&(e=make_node(AST_Binary,e,{operator:"+",left:e.left.left,right:d}));}if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof AST_Binary&&"+"==e.right.operator&&e.right.is_string(t)){var m,S=(m=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);m!==S&&(e=make_node(AST_Binary,e,{operator:"+",left:make_node(AST_Binary,e.left,{operator:"+",left:e.left.left,right:S}),right:e.right.right}));}if(e.right instanceof AST_UnaryPrefix&&"-"==e.right.operator&&e.left.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof AST_UnaryPrefix&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof AST_TemplateString){var h=e.left;if((d=e.right.evaluate(t))!=e.right)return h.segments[h.segments.length-1].value+=String(d),h}if(e.right instanceof AST_TemplateString&&(d=e.right,(h=e.left.evaluate(t))!=e.left))return d.segments[0].value=String(h)+d.segments[0].value,d;if(e.left instanceof AST_TemplateString&&e.right instanceof AST_TemplateString){var A=(h=e.left).segments;d=e.right,A[A.length-1].value+=d.segments[0].value;for(var T=1;T<d.segments.length;T++)A.push(d.segments[T]);return h}case"*":p=t.option("unsafe_math");case"&":case"|":case"^":if(e.left.is_number(t)&&e.right.is_number(t)&&n()&&!(e.left instanceof AST_Binary&&e.left.operator!=e.operator&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator])){var E=make_node(AST_Binary,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof AST_Constant&&!(e.left instanceof AST_Constant)?best_of(t,E,e):best_of(t,e,E);}p&&e.is_number(t)&&(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&e.left.operator==e.operator&&(e.left.left instanceof AST_Constant?e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof AST_Binary&&e.left.operator==e.operator&&e.left.right instanceof AST_Constant&&e.right instanceof AST_Binary&&e.right.operator==e.operator&&e.right.left instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:make_node(AST_Binary,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})));}}if(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(lazy_op.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)}),e.right=e.right.right.transform(t),e.transform(t);var g=e.evaluate(t);return g!==e?(g=make_node_from_constant(g,e).optimize(t),best_of(t,g,e)):e})),def_optimize(AST_SymbolExport,(function(e){return e})),def_optimize(AST_SymbolRef,(function(e,t){if(!t.option("ie8")&&is_undeclared_ref(e)&&!t.find_parent(AST_With))switch(e.name){case"undefined":return make_node(AST_Undefined,e).optimize(t);case"NaN":return make_node(AST_NaN,e).optimize(t);case"Infinity":return make_node(AST_Infinity,e).optimize(t)}const n=t.parent();return t.option("reduce_vars")&&is_lhs(e,n)!==e?inline_into_symbolref(e,t):e})),def_optimize(AST_Undefined,(function(e,t){if(t.option("unsafe_undefined")){var n=find_variable(t,"undefined");if(n){var i=make_node(AST_SymbolRef,e,{name:"undefined",scope:n.scope,thedef:n});return set_flag(i,8),i}}var o=is_lhs(t.self(),t.parent());return o&&is_atomic(o,e)?e:make_node(AST_UnaryPrefix,e,{operator:"void",expression:make_node(AST_Number,e,{value:0})})})),def_optimize(AST_Infinity,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&is_atomic(n,e)?e:!t.option("keep_infinity")||n&&!is_atomic(n,e)||find_variable(t,"Infinity")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:1}),right:make_node(AST_Number,e,{value:0})}):e})),def_optimize(AST_NaN,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&!is_atomic(n,e)||find_variable(t,"NaN")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:0}),right:make_node(AST_Number,e,{value:0})}):e}));const ASSIGN_OPS=makePredicate("+ - / * % >> << >>> | ^ &"),ASSIGN_OPS_COMMUTATIVE=makePredicate("* | ^ &");function is_nullish_check(e,t,n){if(t.may_throw(n))return !1;let i;if(e instanceof AST_Binary&&"=="===e.operator&&((i=is_nullish(e.left,n)&&e.left)||(i=is_nullish(e.right,n)&&e.right))&&(i===e.left?e.right:e.left).equivalent_to(t))return !0;if(e instanceof AST_Binary&&"||"===e.operator){let i,o;const r=e=>{if(!(e instanceof AST_Binary)||"==="!==e.operator&&"=="!==e.operator)return !1;let r,a=0;return e.left instanceof AST_Null&&(a++,i=e,r=e.right),e.right instanceof AST_Null&&(a++,i=e,r=e.left),is_undefined(e.left,n)&&(a++,o=e,r=e.right),is_undefined(e.right,n)&&(a++,o=e,r=e.left),1===a&&!!r.equivalent_to(t)};if(!r(e.left))return !1;if(!r(e.right))return !1;if(i&&o&&i!==o)return !0}return !1}function safe_to_flatten(e,t){return e instanceof AST_SymbolRef&&(e=e.fixed_value()),!!e&&(!(e instanceof AST_Lambda||e instanceof AST_Class)||!(e instanceof AST_Lambda&&e.contains_this())||t.parent()instanceof AST_New)}function literals_in_boolean_context(e,t){return t.in_boolean_context()?best_of(t,e,make_sequence(e,[e,make_node(AST_True,e)]).optimize(t)):e}function inline_array_like_spread(e){for(var t=0;t<e.length;t++){var n=e[t];if(n instanceof AST_Expansion){var i=n.expression;i instanceof AST_Array&&!i.elements.some((e=>e instanceof AST_Hole))&&(e.splice(t,1,...i.elements),t--);}}}function inline_object_prop_spread(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i instanceof AST_Expansion){const o=i.expression;o instanceof AST_Object&&o.properties.every((e=>e instanceof AST_ObjectKeyVal))?(e.splice(n,1,...o.properties),n--):(o instanceof AST_Constant&&!(o instanceof AST_String)||is_nullish(o,t))&&(e.splice(n,1),n--);}}}function lift_key(e,t){if(!t.option("computed_props"))return e;if(!(e.key instanceof AST_Constant))return e;if(e.key instanceof AST_String||e.key instanceof AST_Number){if("__proto__"===e.key.value)return e;if("constructor"==e.key.value&&t.parent()instanceof AST_Class)return e;e instanceof AST_ObjectKeyVal?(e.quote=e.key.quote,e.key=e.key.value):e instanceof AST_ClassProperty?(e.quote=e.key.quote,e.key=make_node(AST_SymbolClassProperty,e.key,{name:e.key.value})):(e.quote=e.key.quote,e.key=make_node(AST_SymbolMethod,e.key,{name:e.key.value}));}return e}async function SourceMap$4(e){var t;e=defaults$1(e,{file:null,root:null,orig:null,files:{}});var n=new SourceMapGenerator({file:e.file,sourceRoot:e.root});let i={__proto__:null},o=e.files;for(var r in o)HOP(o,r)&&(i[r]=o[r]);function a(e){return e.sourcesContent&&e.sourcesContent.every((e=>null==e))&&delete e.sourcesContent,void 0===e.file&&delete e.file,void 0===e.sourceRoot&&delete e.sourceRoot,e}return e.orig&&(t=await new SourceMapConsumer(e.orig)).sourcesContent&&t.sources.forEach((function(e,n){var o=t.sourcesContent[n];o&&(i[e]=o);})),{add:function(e,o,r,a,s,u){let l={line:o,column:r};if(t){var c=t.originalPositionFor({line:a,column:s});if(null===c.source)return void n.addMapping({generated:l,original:null,source:null,name:null});e=c.source,a=c.line,s=c.column,u=c.name||u;}n.addMapping({generated:l,original:{line:a,column:s},source:e,name:u}),n.setSourceContent(e,i[e]);},getDecoded:function(){return n.toDecodedMap?a(n.toDecodedMap()):null},getEncoded:function(){return a(n.toJSON())},destroy:function(){t&&t.destroy&&t.destroy();}}}def_optimize(AST_Assign,(function(e,t){if(e.logical)return e.lift_sequences(t);var n;if("="===e.operator&&e.left instanceof AST_SymbolRef&&"arguments"!==e.left.name&&!(n=e.left.definition()).undeclared&&e.right.equivalent_to(e.left))return e.right;if(t.option("dead_code")&&e.left instanceof AST_SymbolRef&&(n=e.left.definition()).scope===t.find_parent(AST_Lambda)){var i,o=0,r=e;do{if(i=r,(r=t.parent(o++))instanceof AST_Exit){if(a(o,r))break;if(is_reachable(n.scope,[n]))break;return "="==e.operator?e.right:(n.fixed=!1,make_node(AST_Binary,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t))}}while(r instanceof AST_Binary&&r.right===i||r instanceof AST_Sequence&&r.tail_node()===i)}return "="==(e=e.lift_sequences(t)).operator&&e.left instanceof AST_SymbolRef&&e.right instanceof AST_Binary&&(e.right.left instanceof AST_SymbolRef&&e.right.left.name==e.left.name&&ASSIGN_OPS.has(e.right.operator)?(e.operator=e.right.operator+"=",e.right=e.right.right):e.right.right instanceof AST_SymbolRef&&e.right.right.name==e.left.name&&ASSIGN_OPS_COMMUTATIVE.has(e.right.operator)&&!e.right.left.has_side_effects(t)&&(e.operator=e.right.operator+"=",e.right=e.right.left)),e;function a(n,i){var o=e.right;e.right=make_node(AST_Null,o);var r=i.may_throw(t);e.right=o;for(var a,s=e.left.definition().scope;(a=t.parent(n++))!==s;)if(a instanceof AST_Try){if(a.bfinally)return !0;if(r&&a.bcatch)return !0}}})),def_optimize(AST_DefaultAssign,(function(e,t){if(!t.option("evaluate"))return e;var n=e.right.evaluate(t);return void 0===n?e=e.left:n!==e.right&&(n=make_node_from_constant(n,e.right),e.right=best_of_expression(n,e.right)),e})),def_optimize(AST_Conditional,(function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof AST_Sequence){var n=e.condition.expressions.slice();return e.condition=n.pop(),n.push(e),make_sequence(e,n)}var i=e.condition.evaluate(t);if(i!==e.condition)return maintain_this_binding(t.parent(),t.self(),i?e.consequent:e.alternative);var o=i.negate(t,first_in_statement(t));best_of(t,i,o)===o&&(e=make_node(AST_Conditional,e,{condition:o,consequent:e.alternative,alternative:e.consequent}));var r,a=e.condition,s=e.consequent,u=e.alternative;if(a instanceof AST_SymbolRef&&s instanceof AST_SymbolRef&&a.definition()===s.definition())return make_node(AST_Binary,e,{operator:"||",left:a,right:u});if(s instanceof AST_Assign&&u instanceof AST_Assign&&s.operator===u.operator&&s.logical===u.logical&&s.left.equivalent_to(u.left)&&(!e.condition.has_side_effects(t)||"="==s.operator&&!s.left.has_side_effects(t)))return make_node(AST_Assign,e,{operator:s.operator,left:s.left,logical:s.logical,right:make_node(AST_Conditional,e,{condition:e.condition,consequent:s.right,alternative:u.right})});if(s instanceof AST_Call&&u.TYPE===s.TYPE&&s.args.length>0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(r=function(){for(var e=s.args,t=u.args,n=0,i=e.length;n<i;n++){if(e[n]instanceof AST_Expansion)return;if(!e[n].equivalent_to(t[n])){if(t[n]instanceof AST_Expansion)return;for(var o=n+1;o<i;o++){if(e[o]instanceof AST_Expansion)return;if(!e[o].equivalent_to(t[o]))return}return n}}}())){var l=s.clone();return l.args[r]=make_node(AST_Conditional,e,{condition:e.condition,consequent:s.args[r],alternative:u.args[r]}),l}if(u instanceof AST_Conditional&&s.equivalent_to(u.consequent))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{operator:"||",left:a,right:u.condition}),consequent:s,alternative:u.alternative}).optimize(t);if(t.option("ecma")>=2020&&is_nullish_check(a,u,t))return make_node(AST_Binary,e,{operator:"??",left:u,right:s}).optimize(t);if(u instanceof AST_Sequence&&s.equivalent_to(u.expressions[u.expressions.length-1]))return make_sequence(e,[make_node(AST_Binary,e,{operator:"||",left:a,right:make_sequence(e,u.expressions.slice(0,-1))}),s]).optimize(t);if(u instanceof AST_Binary&&"&&"==u.operator&&s.equivalent_to(u.right))return make_node(AST_Binary,e,{operator:"&&",left:make_node(AST_Binary,e,{operator:"||",left:a,right:u.left}),right:s}).optimize(t);if(s instanceof AST_Conditional&&s.alternative.equivalent_to(u))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{left:e.condition,operator:"&&",right:s.condition}),consequent:s.consequent,alternative:u});if(s.equivalent_to(u))return make_sequence(e,[e.condition,s]).optimize(t);if(s instanceof AST_Binary&&"||"==s.operator&&s.right.equivalent_to(u))return make_node(AST_Binary,e,{operator:"||",left:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:s.left}),right:u}).optimize(t);const c=t.in_boolean_context();return f(e.consequent)?p(e.alternative)?_(e.condition):make_node(AST_Binary,e,{operator:"||",left:_(e.condition),right:e.alternative}):p(e.consequent)?f(e.alternative)?_(e.condition.negate(t)):make_node(AST_Binary,e,{operator:"&&",left:_(e.condition.negate(t)),right:e.alternative}):f(e.alternative)?make_node(AST_Binary,e,{operator:"||",left:_(e.condition.negate(t)),right:e.consequent}):p(e.alternative)?make_node(AST_Binary,e,{operator:"&&",left:_(e.condition),right:e.consequent}):e;function _(e){return e.is_boolean()?e:make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t)})}function f(e){return e instanceof AST_True||c&&e instanceof AST_Constant&&e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&!e.expression.getValue()}function p(e){return e instanceof AST_False||c&&e instanceof AST_Constant&&!e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&e.expression.getValue()}})),def_optimize(AST_Boolean,(function(e,t){if(t.in_boolean_context())return make_node(AST_Number,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof AST_Binary&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),make_node(AST_Number,e,{value:+e.value})):t.option("booleans")?n instanceof AST_Binary&&("=="==n.operator||"!="==n.operator)?make_node(AST_Number,e,{value:+e.value}):make_node(AST_UnaryPrefix,e,{operator:"!",expression:make_node(AST_Number,e,{value:1-e.value})}):e})),AST_PropAccess.DEFMETHOD("flatten_object",(function(e,t){if(t.option("properties")&&"__proto__"!==e){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,i=this.expression;if(i instanceof AST_Object)for(var o=i.properties,r=o.length;--r>=0;){var a=o[r];if(""+(a instanceof AST_ConciseMethod?a.key.name:a.key)==e){if(!o.every((e=>(e instanceof AST_ObjectKeyVal||n&&e instanceof AST_ConciseMethod&&!e.is_generator)&&!e.computed_key())))return;if(!safe_to_flatten(a.value,t))return;return make_node(AST_Sub,this,{expression:make_node(AST_Array,i,{elements:o.map((function(e){var t=e.value;t instanceof AST_Accessor&&(t=make_node(AST_Function,t,t));var n=e.key;return n instanceof AST_Node&&!(n instanceof AST_SymbolMethod)?make_sequence(e,[n,t]):t}))}),property:make_node(AST_Number,this,{value:r})})}}}})),def_optimize(AST_Sub,(function(e,t){var n,i=e.expression,o=e.property;if(t.option("properties")){var r=o.evaluate(t);if(r!==o){"string"==typeof r&&("undefined"==r?r=void 0:(g=parseFloat(r)).toString()==r&&(r=g)),o=e.property=best_of_expression(o,make_node_from_constant(r,o).transform(t));var a=""+r;if(is_basic_identifier_string(a)&&a.length<=o.size()+1)return make_node(AST_Dot,e,{expression:i,optional:e.optional,property:a,quote:o.quote}).optimize(t)}}e:if(t.option("arguments")&&i instanceof AST_SymbolRef&&"arguments"==i.name&&1==i.definition().orig.length&&(n=i.scope)instanceof AST_Lambda&&n.uses_arguments&&!(n instanceof AST_Arrow)&&o instanceof AST_Number){for(var s=o.getValue(),u=new Set,l=n.argnames,c=0;c<l.length;c++){if(!(l[c]instanceof AST_SymbolFunarg))break e;var _=l[c].name;if(u.has(_))break e;u.add(_);}var f=n.argnames[s];if(f&&t.has_directive("use strict")){var p=f.definition();(!t.option("reduce_vars")||p.assignments||p.orig.length>1)&&(f=null);}else if(!f&&!t.option("keep_fargs")&&s<n.argnames.length+5)for(;s>=n.argnames.length;)f=n.create_symbol(AST_SymbolFunarg,{source:n,scope:n,tentative_name:"argument_"+n.argnames.length}),n.argnames.push(f);if(f){var d=make_node(AST_SymbolRef,e,f);return d.reference({}),clear_flag(f,1),d}}if(is_lhs(e,t.parent()))return e;if(r!==o){var m=e.flatten_object(a,t);m&&(i=e.expression=m.expression,o=e.property=m.property);}if(t.option("properties")&&t.option("side_effects")&&o instanceof AST_Number&&i instanceof AST_Array){s=o.getValue();var S=i.elements,h=S[s];e:if(safe_to_flatten(h,t)){for(var A=!0,T=[],E=S.length;--E>s;)(g=S[E].drop_side_effect_free(t))&&(T.unshift(g),A&&g.has_side_effects(t)&&(A=!1));if(h instanceof AST_Expansion)break e;for(h=h instanceof AST_Hole?make_node(AST_Undefined,h):h,A||T.unshift(h);--E>=0;){var g;if((g=S[E])instanceof AST_Expansion)break e;(g=g.drop_side_effect_free(t))?T.unshift(g):s--;}return A?(T.push(h),make_sequence(e,T).optimize(t)):make_node(AST_Sub,e,{expression:make_node(AST_Array,i,{elements:T}),property:make_node(AST_Number,o,{value:s})})}}var b=e.evaluate(t);return b!==e?best_of(t,b=make_node_from_constant(b,e).optimize(t),e):e})),def_optimize(AST_Chain,(function(e,t){if(is_nullish(e.expression,t)){let n=t.parent();return n instanceof AST_UnaryPrefix&&"delete"===n.operator?make_node_from_constant(0,e):make_node(AST_Undefined,e)}return e})),AST_Lambda.DEFMETHOD("contains_this",(function(){return walk$2(this,(e=>e instanceof AST_This?walk_abort:e!==this&&e instanceof AST_Scope&&!(e instanceof AST_Arrow)||void 0))})),def_optimize(AST_Dot,(function(e,t){const n=t.parent();if(is_lhs(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof AST_Dot&&"prototype"==e.expression.property){var i=e.expression.expression;if(is_undeclared_ref(i))switch(i.name){case"Array":e.expression=make_node(AST_Array,e.expression,{elements:[]});break;case"Function":e.expression=make_node(AST_Function,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=make_node(AST_Number,e.expression,{value:0});break;case"Object":e.expression=make_node(AST_Object,e.expression,{properties:[]});break;case"RegExp":e.expression=make_node(AST_RegExp,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=make_node(AST_String,e.expression,{value:""});}}if(!(n instanceof AST_Call&&has_annotation(n,_NOINLINE))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}if(e.expression instanceof AST_PropAccess&&n instanceof AST_PropAccess)return e;let o=e.evaluate(t);return o!==e?(o=make_node_from_constant(o,e).optimize(t),best_of(t,o,e)):e})),def_optimize(AST_Array,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_array_like_spread(e.elements),e)})),def_optimize(AST_Object,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_object_prop_spread(e.properties,t),e)})),def_optimize(AST_RegExp,literals_in_boolean_context),def_optimize(AST_Return,(function(e,t){return e.value&&is_undefined(e.value,t)&&(e.value=null),e})),def_optimize(AST_Arrow,opt_AST_Lambda),def_optimize(AST_Function,(function(e,t){return e=opt_AST_Lambda(e,t),!(t.option("unsafe_arrows")&&t.option("ecma")>=2015)||e.name||e.is_generator||e.uses_arguments||e.pinned()||walk$2(e,(e=>{if(e instanceof AST_This)return walk_abort}))?e:make_node(AST_Arrow,e,e).optimize(t)})),def_optimize(AST_Class,(function(e){return e})),def_optimize(AST_ClassStaticBlock,(function(e,t){return tighten_body(e.body,t),e})),def_optimize(AST_Yield,(function(e,t){return e.expression&&!e.is_star&&is_undefined(e.expression,t)&&(e.expression=null),e})),def_optimize(AST_TemplateString,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof AST_PrefixedTemplateString)return e;for(var n=[],i=0;i<e.segments.length;i++){var o=e.segments[i];if(o instanceof AST_Node){var r=o.evaluate(t);if(r!==o&&(r+"").length<=o.size()+"${}".length){n[n.length-1].value=n[n.length-1].value+r+e.segments[++i].value;continue}if(o instanceof AST_TemplateString){var a=o.segments;n[n.length-1].value+=a[0].value;for(var s=1;s<a.length;s++)o=a[s],n.push(o);continue}}n.push(o);}if(e.segments=n,1==n.length)return make_node(AST_String,e,n[0]);if(3===n.length&&n[1]instanceof AST_Node&&(n[1].is_string(t)||n[1].is_number(t)||is_nullish(n[1],t)||t.option("unsafe"))){if(""===n[2].value)return make_node(AST_Binary,e,{operator:"+",left:make_node(AST_String,e,{value:n[0].value}),right:n[1]});if(""===n[0].value)return make_node(AST_Binary,e,{operator:"+",left:n[1],right:make_node(AST_String,e,{value:n[2].value})})}return e})),def_optimize(AST_PrefixedTemplateString,(function(e){return e})),def_optimize(AST_ObjectProperty,lift_key),def_optimize(AST_ConciseMethod,(function(e,t){if(lift_key(e,t),t.option("arrows")&&t.parent()instanceof AST_Object&&!e.is_generator&&!e.value.uses_arguments&&!e.value.pinned()&&1==e.value.body.length&&e.value.body[0]instanceof AST_Return&&e.value.body[0].value&&!e.value.contains_this()){var n=make_node(AST_Arrow,e.value,e.value);return n.async=e.async,n.is_generator=e.is_generator,make_node(AST_ObjectKeyVal,e,{key:e.key instanceof AST_SymbolMethod?e.key.name:e.key,value:n,quote:e.quote})}return e})),def_optimize(AST_ObjectKeyVal,(function(e,t){lift_key(e,t);var n=t.option("unsafe_methods");if(n&&t.option("ecma")>=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var i=e.key,o=e.value;if((o instanceof AST_Arrow&&Array.isArray(o.body)&&!o.contains_this()||o instanceof AST_Function)&&!o.name)return make_node(AST_ConciseMethod,e,{async:o.async,is_generator:o.is_generator,key:i instanceof AST_Node?i:make_node(AST_SymbolMethod,e,{name:i}),value:make_node(AST_Accessor,o,o),quote:e.quote})}return e})),def_optimize(AST_Destructuring,(function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,i=0,o=t.length;n<o;i++){var r=e.parent(i);if(!r)return !1;if(0!==n||"Destructuring"!=r.TYPE){if(!t[n].test(r.TYPE))return !1;n++;}}return !0}(t)&&!(e.names[e.names.length-1]instanceof AST_Expansion)){for(var n=[],i=0;i<e.names.length;i++){var o=e.names[i];o instanceof AST_ObjectKeyVal&&"string"==typeof o.key&&o.value instanceof AST_SymbolDeclaration&&!r(t,o.value.definition())||n.push(o);}n.length!=e.names.length&&(e.names=n);}return e;function r(e,t){return !!t.references.length||!!t.global&&(!e.toplevel.vars||!!e.top_retain&&e.top_retain(t))}}));var domprops=["$&","$'","$*","$+","$1","$2","$3","$4","$5","$6","$7","$8","$9","$_","$`","$input","-moz-animation","-moz-animation-delay","-moz-animation-direction","-moz-animation-duration","-moz-animation-fill-mode","-moz-animation-iteration-count","-moz-animation-name","-moz-animation-play-state","-moz-animation-timing-function","-moz-appearance","-moz-backface-visibility","-moz-border-end","-moz-border-end-color","-moz-border-end-style","-moz-border-end-width","-moz-border-image","-moz-border-start","-moz-border-start-color","-moz-border-start-style","-moz-border-start-width","-moz-box-align","-moz-box-direction","-moz-box-flex","-moz-box-ordinal-group","-moz-box-orient","-moz-box-pack","-moz-box-sizing","-moz-float-edge","-moz-font-feature-settings","-moz-font-language-override","-moz-force-broken-image-icon","-moz-hyphens","-moz-image-region","-moz-margin-end","-moz-margin-start","-moz-orient","-moz-osx-font-smoothing","-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-moz-padding-end","-moz-padding-start","-moz-perspective","-moz-perspective-origin","-moz-tab-size","-moz-text-size-adjust","-moz-transform","-moz-transform-origin","-moz-transform-style","-moz-transition","-moz-transition-delay","-moz-transition-duration","-moz-transition-property","-moz-transition-timing-function","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select","-moz-window-dragging","-webkit-align-content","-webkit-align-items","-webkit-align-self","-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-fill-mode","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-shadow","-webkit-box-sizing","-webkit-filter","-webkit-flex","-webkit-flex-basis","-webkit-flex-direction","-webkit-flex-flow","-webkit-flex-grow","-webkit-flex-shrink","-webkit-flex-wrap","-webkit-justify-content","-webkit-line-clamp","-webkit-mask","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-order","-webkit-perspective","-webkit-perspective-origin","-webkit-text-fill-color","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-transform","-webkit-transform-origin","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-select","0","1","10","11","12","13","14","15","16","17","18","19","2","20","3","4","5","6","7","8","9","@@iterator","ABORT_ERR","ACTIVE","ACTIVE_ATTRIBUTES","ACTIVE_TEXTURE","ACTIVE_UNIFORMS","ACTIVE_UNIFORM_BLOCKS","ADDITION","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","ALLOW_KEYBOARD_INPUT","ALLPASS","ALPHA","ALPHA_BITS","ALREADY_SIGNALED","ALT_MASK","ALWAYS","ANY_SAMPLES_PASSED","ANY_SAMPLES_PASSED_CONSERVATIVE","ANY_TYPE","ANY_UNORDERED_NODE_TYPE","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","ATTACHED_SHADERS","ATTRIBUTE_NODE","AT_TARGET","AbortController","AbortSignal","AbsoluteOrientationSensor","AbstractRange","Accelerometer","AddSearchProvider","AggregateError","AnalyserNode","Animation","AnimationEffect","AnimationEvent","AnimationPlaybackEvent","AnimationTimeline","AnonXMLHttpRequest","Any","ApplicationCache","ApplicationCacheErrorEvent","Array","ArrayBuffer","ArrayType","Atomics","Attr","Audio","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioListener","AudioNode","AudioParam","AudioParamMap","AudioProcessingEvent","AudioScheduledSourceNode","AudioStreamTrack","AudioWorklet","AudioWorkletNode","AuthenticatorAssertionResponse","AuthenticatorAttestationResponse","AuthenticatorResponse","AutocompleteErrorEvent","BACK","BAD_BOUNDARYPOINTS_ERR","BAD_REQUEST","BANDPASS","BLEND","BLEND_COLOR","BLEND_DST_ALPHA","BLEND_DST_RGB","BLEND_EQUATION","BLEND_EQUATION_ALPHA","BLEND_EQUATION_RGB","BLEND_SRC_ALPHA","BLEND_SRC_RGB","BLUE_BITS","BLUR","BOOL","BOOLEAN_TYPE","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","BOTH","BROWSER_DEFAULT_WEBGL","BUBBLING_PHASE","BUFFER_SIZE","BUFFER_USAGE","BYTE","BYTES_PER_ELEMENT","BackgroundFetchManager","BackgroundFetchRecord","BackgroundFetchRegistration","BarProp","BarcodeDetector","BaseAudioContext","BaseHref","BatteryManager","BeforeInstallPromptEvent","BeforeLoadEvent","BeforeUnloadEvent","BigInt","BigInt64Array","BigUint64Array","BiquadFilterNode","Blob","BlobEvent","Bluetooth","BluetoothCharacteristicProperties","BluetoothDevice","BluetoothRemoteGATTCharacteristic","BluetoothRemoteGATTDescriptor","BluetoothRemoteGATTServer","BluetoothRemoteGATTService","BluetoothUUID","Boolean","BroadcastChannel","ByteLengthQueuingStrategy","CAPTURING_PHASE","CCW","CDATASection","CDATA_SECTION_NODE","CHANGE","CHARSET_RULE","CHECKING","CLAMP_TO_EDGE","CLICK","CLOSED","CLOSING","COLOR","COLOR_ATTACHMENT0","COLOR_ATTACHMENT1","COLOR_ATTACHMENT10","COLOR_ATTACHMENT11","COLOR_ATTACHMENT12","COLOR_ATTACHMENT13","COLOR_ATTACHMENT14","COLOR_ATTACHMENT15","COLOR_ATTACHMENT2","COLOR_ATTACHMENT3","COLOR_ATTACHMENT4","COLOR_ATTACHMENT5","COLOR_ATTACHMENT6","COLOR_ATTACHMENT7","COLOR_ATTACHMENT8","COLOR_ATTACHMENT9","COLOR_BUFFER_BIT","COLOR_CLEAR_VALUE","COLOR_WRITEMASK","COMMENT_NODE","COMPARE_REF_TO_TEXTURE","COMPILE_STATUS","COMPLETION_STATUS_KHR","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_TEXTURE_FORMATS","CONDITION_SATISFIED","CONFIGURATION_UNSUPPORTED","CONNECTING","CONSTANT_ALPHA","CONSTANT_COLOR","CONSTRAINT_ERR","CONTEXT_LOST_WEBGL","CONTROL_MASK","COPY_READ_BUFFER","COPY_READ_BUFFER_BINDING","COPY_WRITE_BUFFER","COPY_WRITE_BUFFER_BINDING","COUNTER_STYLE_RULE","CSS","CSS2Properties","CSSAnimation","CSSCharsetRule","CSSConditionRule","CSSCounterStyleRule","CSSFontFaceRule","CSSFontFeatureValuesRule","CSSGroupingRule","CSSImageValue","CSSImportRule","CSSKeyframeRule","CSSKeyframesRule","CSSKeywordValue","CSSMathInvert","CSSMathMax","CSSMathMin","CSSMathNegate","CSSMathProduct","CSSMathSum","CSSMathValue","CSSMatrixComponent","CSSMediaRule","CSSMozDocumentRule","CSSNameSpaceRule","CSSNamespaceRule","CSSNumericArray","CSSNumericValue","CSSPageRule","CSSPerspective","CSSPositionValue","CSSPrimitiveValue","CSSRotate","CSSRule","CSSRuleList","CSSScale","CSSSkew","CSSSkewX","CSSSkewY","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSStyleValue","CSSSupportsRule","CSSTransformComponent","CSSTransformValue","CSSTransition","CSSTranslate","CSSUnitValue","CSSUnknownRule","CSSUnparsedValue","CSSValue","CSSValueList","CSSVariableReferenceValue","CSSVariablesDeclaration","CSSVariablesRule","CSSViewportRule","CSS_ATTR","CSS_CM","CSS_COUNTER","CSS_CUSTOM","CSS_DEG","CSS_DIMENSION","CSS_EMS","CSS_EXS","CSS_FILTER_BLUR","CSS_FILTER_BRIGHTNESS","CSS_FILTER_CONTRAST","CSS_FILTER_CUSTOM","CSS_FILTER_DROP_SHADOW","CSS_FILTER_GRAYSCALE","CSS_FILTER_HUE_ROTATE","CSS_FILTER_INVERT","CSS_FILTER_OPACITY","CSS_FILTER_REFERENCE","CSS_FILTER_SATURATE","CSS_FILTER_SEPIA","CSS_GRAD","CSS_HZ","CSS_IDENT","CSS_IN","CSS_INHERIT","CSS_KHZ","CSS_MATRIX","CSS_MATRIX3D","CSS_MM","CSS_MS","CSS_NUMBER","CSS_PC","CSS_PERCENTAGE","CSS_PERSPECTIVE","CSS_PRIMITIVE_VALUE","CSS_PT","CSS_PX","CSS_RAD","CSS_RECT","CSS_RGBCOLOR","CSS_ROTATE","CSS_ROTATE3D","CSS_ROTATEX","CSS_ROTATEY","CSS_ROTATEZ","CSS_S","CSS_SCALE","CSS_SCALE3D","CSS_SCALEX","CSS_SCALEY","CSS_SCALEZ","CSS_SKEW","CSS_SKEWX","CSS_SKEWY","CSS_STRING","CSS_TRANSLATE","CSS_TRANSLATE3D","CSS_TRANSLATEX","CSS_TRANSLATEY","CSS_TRANSLATEZ","CSS_UNKNOWN","CSS_URI","CSS_VALUE_LIST","CSS_VH","CSS_VMAX","CSS_VMIN","CSS_VW","CULL_FACE","CULL_FACE_MODE","CURRENT_PROGRAM","CURRENT_QUERY","CURRENT_VERTEX_ATTRIB","CUSTOM","CW","Cache","CacheStorage","CanvasCaptureMediaStream","CanvasCaptureMediaStreamTrack","CanvasGradient","CanvasPattern","CanvasRenderingContext2D","CaretPosition","ChannelMergerNode","ChannelSplitterNode","CharacterData","ClientRect","ClientRectList","Clipboard","ClipboardEvent","ClipboardItem","CloseEvent","Collator","CommandEvent","Comment","CompileError","CompositionEvent","CompressionStream","Console","ConstantSourceNode","Controllers","ConvolverNode","CountQueuingStrategy","Counter","Credential","CredentialsContainer","Crypto","CryptoKey","CustomElementRegistry","CustomEvent","DATABASE_ERR","DATA_CLONE_ERR","DATA_ERR","DBLCLICK","DECR","DECR_WRAP","DELETE_STATUS","DEPTH","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","DEPTH_ATTACHMENT","DEPTH_BITS","DEPTH_BUFFER_BIT","DEPTH_CLEAR_VALUE","DEPTH_COMPONENT","DEPTH_COMPONENT16","DEPTH_COMPONENT24","DEPTH_COMPONENT32F","DEPTH_FUNC","DEPTH_RANGE","DEPTH_STENCIL","DEPTH_STENCIL_ATTACHMENT","DEPTH_TEST","DEPTH_WRITEMASK","DEVICE_INELIGIBLE","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DISABLED","DISPATCH_REQUEST_ERR","DITHER","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","DOCUMENT_POSITION_PRECEDING","DOCUMENT_TYPE_NODE","DOMCursor","DOMError","DOMException","DOMImplementation","DOMImplementationLS","DOMMatrix","DOMMatrixReadOnly","DOMParser","DOMPoint","DOMPointReadOnly","DOMQuad","DOMRect","DOMRectList","DOMRectReadOnly","DOMRequest","DOMSTRING_SIZE_ERR","DOMSettableTokenList","DOMStringList","DOMStringMap","DOMTokenList","DOMTransactionEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","DOM_INPUT_METHOD_DROP","DOM_INPUT_METHOD_HANDWRITING","DOM_INPUT_METHOD_IME","DOM_INPUT_METHOD_KEYBOARD","DOM_INPUT_METHOD_MULTIMODAL","DOM_INPUT_METHOD_OPTION","DOM_INPUT_METHOD_PASTE","DOM_INPUT_METHOD_SCRIPT","DOM_INPUT_METHOD_UNKNOWN","DOM_INPUT_METHOD_VOICE","DOM_KEY_LOCATION_JOYSTICK","DOM_KEY_LOCATION_LEFT","DOM_KEY_LOCATION_MOBILE","DOM_KEY_LOCATION_NUMPAD","DOM_KEY_LOCATION_RIGHT","DOM_KEY_LOCATION_STANDARD","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5","DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_A","DOM_VK_ACCEPT","DOM_VK_ADD","DOM_VK_ALT","DOM_VK_ALTGR","DOM_VK_AMPERSAND","DOM_VK_ASTERISK","DOM_VK_AT","DOM_VK_ATTN","DOM_VK_B","DOM_VK_BACKSPACE","DOM_VK_BACK_QUOTE","DOM_VK_BACK_SLASH","DOM_VK_BACK_SPACE","DOM_VK_C","DOM_VK_CANCEL","DOM_VK_CAPS_LOCK","DOM_VK_CIRCUMFLEX","DOM_VK_CLEAR","DOM_VK_CLOSE_BRACKET","DOM_VK_CLOSE_CURLY_BRACKET","DOM_VK_CLOSE_PAREN","DOM_VK_COLON","DOM_VK_COMMA","DOM_VK_CONTEXT_MENU","DOM_VK_CONTROL","DOM_VK_CONVERT","DOM_VK_CRSEL","DOM_VK_CTRL","DOM_VK_D","DOM_VK_DECIMAL","DOM_VK_DELETE","DOM_VK_DIVIDE","DOM_VK_DOLLAR","DOM_VK_DOUBLE_QUOTE","DOM_VK_DOWN","DOM_VK_E","DOM_VK_EISU","DOM_VK_END","DOM_VK_ENTER","DOM_VK_EQUALS","DOM_VK_EREOF","DOM_VK_ESCAPE","DOM_VK_EXCLAMATION","DOM_VK_EXECUTE","DOM_VK_EXSEL","DOM_VK_F","DOM_VK_F1","DOM_VK_F10","DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19","DOM_VK_F2","DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_F25","DOM_VK_F26","DOM_VK_F27","DOM_VK_F28","DOM_VK_F29","DOM_VK_F3","DOM_VK_F30","DOM_VK_F31","DOM_VK_F32","DOM_VK_F33","DOM_VK_F34","DOM_VK_F35","DOM_VK_F36","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_FINAL","DOM_VK_FRONT","DOM_VK_G","DOM_VK_GREATER_THAN","DOM_VK_H","DOM_VK_HANGUL","DOM_VK_HANJA","DOM_VK_HASH","DOM_VK_HELP","DOM_VK_HK_TOGGLE","DOM_VK_HOME","DOM_VK_HYPHEN_MINUS","DOM_VK_I","DOM_VK_INSERT","DOM_VK_J","DOM_VK_JUNJA","DOM_VK_K","DOM_VK_KANA","DOM_VK_KANJI","DOM_VK_L","DOM_VK_LEFT","DOM_VK_LEFT_TAB","DOM_VK_LESS_THAN","DOM_VK_M","DOM_VK_META","DOM_VK_MODECHANGE","DOM_VK_MULTIPLY","DOM_VK_N","DOM_VK_NONCONVERT","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2","DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9","DOM_VK_NUM_LOCK","DOM_VK_O","DOM_VK_OEM_1","DOM_VK_OEM_102","DOM_VK_OEM_2","DOM_VK_OEM_3","DOM_VK_OEM_4","DOM_VK_OEM_5","DOM_VK_OEM_6","DOM_VK_OEM_7","DOM_VK_OEM_8","DOM_VK_OEM_COMMA","DOM_VK_OEM_MINUS","DOM_VK_OEM_PERIOD","DOM_VK_OEM_PLUS","DOM_VK_OPEN_BRACKET","DOM_VK_OPEN_CURLY_BRACKET","DOM_VK_OPEN_PAREN","DOM_VK_P","DOM_VK_PA1","DOM_VK_PAGEDOWN","DOM_VK_PAGEUP","DOM_VK_PAGE_DOWN","DOM_VK_PAGE_UP","DOM_VK_PAUSE","DOM_VK_PERCENT","DOM_VK_PERIOD","DOM_VK_PIPE","DOM_VK_PLAY","DOM_VK_PLUS","DOM_VK_PRINT","DOM_VK_PRINTSCREEN","DOM_VK_PROCESSKEY","DOM_VK_PROPERITES","DOM_VK_Q","DOM_VK_QUESTION_MARK","DOM_VK_QUOTE","DOM_VK_R","DOM_VK_REDO","DOM_VK_RETURN","DOM_VK_RIGHT","DOM_VK_S","DOM_VK_SCROLL_LOCK","DOM_VK_SELECT","DOM_VK_SEMICOLON","DOM_VK_SEPARATOR","DOM_VK_SHIFT","DOM_VK_SLASH","DOM_VK_SLEEP","DOM_VK_SPACE","DOM_VK_SUBTRACT","DOM_VK_T","DOM_VK_TAB","DOM_VK_TILDE","DOM_VK_U","DOM_VK_UNDERSCORE","DOM_VK_UNDO","DOM_VK_UNICODE","DOM_VK_UP","DOM_VK_V","DOM_VK_VOLUME_DOWN","DOM_VK_VOLUME_MUTE","DOM_VK_VOLUME_UP","DOM_VK_W","DOM_VK_WIN","DOM_VK_WINDOW","DOM_VK_WIN_ICO_00","DOM_VK_WIN_ICO_CLEAR","DOM_VK_WIN_ICO_HELP","DOM_VK_WIN_OEM_ATTN","DOM_VK_WIN_OEM_AUTO","DOM_VK_WIN_OEM_BACKTAB","DOM_VK_WIN_OEM_CLEAR","DOM_VK_WIN_OEM_COPY","DOM_VK_WIN_OEM_CUSEL","DOM_VK_WIN_OEM_ENLW","DOM_VK_WIN_OEM_FINISH","DOM_VK_WIN_OEM_FJ_JISHO","DOM_VK_WIN_OEM_FJ_LOYA","DOM_VK_WIN_OEM_FJ_MASSHOU","DOM_VK_WIN_OEM_FJ_ROYA","DOM_VK_WIN_OEM_FJ_TOUROKU","DOM_VK_WIN_OEM_JUMP","DOM_VK_WIN_OEM_PA1","DOM_VK_WIN_OEM_PA2","DOM_VK_WIN_OEM_PA3","DOM_VK_WIN_OEM_RESET","DOM_VK_WIN_OEM_WSCTRL","DOM_VK_X","DOM_VK_XF86XK_ADD_FAVORITE","DOM_VK_XF86XK_APPLICATION_LEFT","DOM_VK_XF86XK_APPLICATION_RIGHT","DOM_VK_XF86XK_AUDIO_CYCLE_TRACK","DOM_VK_XF86XK_AUDIO_FORWARD","DOM_VK_XF86XK_AUDIO_LOWER_VOLUME","DOM_VK_XF86XK_AUDIO_MEDIA","DOM_VK_XF86XK_AUDIO_MUTE","DOM_VK_XF86XK_AUDIO_NEXT","DOM_VK_XF86XK_AUDIO_PAUSE","DOM_VK_XF86XK_AUDIO_PLAY","DOM_VK_XF86XK_AUDIO_PREV","DOM_VK_XF86XK_AUDIO_RAISE_VOLUME","DOM_VK_XF86XK_AUDIO_RANDOM_PLAY","DOM_VK_XF86XK_AUDIO_RECORD","DOM_VK_XF86XK_AUDIO_REPEAT","DOM_VK_XF86XK_AUDIO_REWIND","DOM_VK_XF86XK_AUDIO_STOP","DOM_VK_XF86XK_AWAY","DOM_VK_XF86XK_BACK","DOM_VK_XF86XK_BACK_FORWARD","DOM_VK_XF86XK_BATTERY","DOM_VK_XF86XK_BLUE","DOM_VK_XF86XK_BLUETOOTH","DOM_VK_XF86XK_BOOK","DOM_VK_XF86XK_BRIGHTNESS_ADJUST","DOM_VK_XF86XK_CALCULATOR","DOM_VK_XF86XK_CALENDAR","DOM_VK_XF86XK_CD","DOM_VK_XF86XK_CLOSE","DOM_VK_XF86XK_COMMUNITY","DOM_VK_XF86XK_CONTRAST_ADJUST","DOM_VK_XF86XK_COPY","DOM_VK_XF86XK_CUT","DOM_VK_XF86XK_CYCLE_ANGLE","DOM_VK_XF86XK_DISPLAY","DOM_VK_XF86XK_DOCUMENTS","DOM_VK_XF86XK_DOS","DOM_VK_XF86XK_EJECT","DOM_VK_XF86XK_EXCEL","DOM_VK_XF86XK_EXPLORER","DOM_VK_XF86XK_FAVORITES","DOM_VK_XF86XK_FINANCE","DOM_VK_XF86XK_FORWARD","DOM_VK_XF86XK_FRAME_BACK","DOM_VK_XF86XK_FRAME_FORWARD","DOM_VK_XF86XK_GAME","DOM_VK_XF86XK_GO","DOM_VK_XF86XK_GREEN","DOM_VK_XF86XK_HIBERNATE","DOM_VK_XF86XK_HISTORY","DOM_VK_XF86XK_HOME_PAGE","DOM_VK_XF86XK_HOT_LINKS","DOM_VK_XF86XK_I_TOUCH","DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN","DOM_VK_XF86XK_KBD_BRIGHTNESS_UP","DOM_VK_XF86XK_KBD_LIGHT_ON_OFF","DOM_VK_XF86XK_LAUNCH0","DOM_VK_XF86XK_LAUNCH1","DOM_VK_XF86XK_LAUNCH2","DOM_VK_XF86XK_LAUNCH3","DOM_VK_XF86XK_LAUNCH4","DOM_VK_XF86XK_LAUNCH5","DOM_VK_XF86XK_LAUNCH6","DOM_VK_XF86XK_LAUNCH7","DOM_VK_XF86XK_LAUNCH8","DOM_VK_XF86XK_LAUNCH9","DOM_VK_XF86XK_LAUNCH_A","DOM_VK_XF86XK_LAUNCH_B","DOM_VK_XF86XK_LAUNCH_C","DOM_VK_XF86XK_LAUNCH_D","DOM_VK_XF86XK_LAUNCH_E","DOM_VK_XF86XK_LAUNCH_F","DOM_VK_XF86XK_LIGHT_BULB","DOM_VK_XF86XK_LOG_OFF","DOM_VK_XF86XK_MAIL","DOM_VK_XF86XK_MAIL_FORWARD","DOM_VK_XF86XK_MARKET","DOM_VK_XF86XK_MEETING","DOM_VK_XF86XK_MEMO","DOM_VK_XF86XK_MENU_KB","DOM_VK_XF86XK_MENU_PB","DOM_VK_XF86XK_MESSENGER","DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN","DOM_VK_XF86XK_MON_BRIGHTNESS_UP","DOM_VK_XF86XK_MUSIC","DOM_VK_XF86XK_MY_COMPUTER","DOM_VK_XF86XK_MY_SITES","DOM_VK_XF86XK_NEW","DOM_VK_XF86XK_NEWS","DOM_VK_XF86XK_OFFICE_HOME","DOM_VK_XF86XK_OPEN","DOM_VK_XF86XK_OPEN_URL","DOM_VK_XF86XK_OPTION","DOM_VK_XF86XK_PASTE","DOM_VK_XF86XK_PHONE","DOM_VK_XF86XK_PICTURES","DOM_VK_XF86XK_POWER_DOWN","DOM_VK_XF86XK_POWER_OFF","DOM_VK_XF86XK_RED","DOM_VK_XF86XK_REFRESH","DOM_VK_XF86XK_RELOAD","DOM_VK_XF86XK_REPLY","DOM_VK_XF86XK_ROCKER_DOWN","DOM_VK_XF86XK_ROCKER_ENTER","DOM_VK_XF86XK_ROCKER_UP","DOM_VK_XF86XK_ROTATE_WINDOWS","DOM_VK_XF86XK_ROTATION_KB","DOM_VK_XF86XK_ROTATION_PB","DOM_VK_XF86XK_SAVE","DOM_VK_XF86XK_SCREEN_SAVER","DOM_VK_XF86XK_SCROLL_CLICK","DOM_VK_XF86XK_SCROLL_DOWN","DOM_VK_XF86XK_SCROLL_UP","DOM_VK_XF86XK_SEARCH","DOM_VK_XF86XK_SEND","DOM_VK_XF86XK_SHOP","DOM_VK_XF86XK_SPELL","DOM_VK_XF86XK_SPLIT_SCREEN","DOM_VK_XF86XK_STANDBY","DOM_VK_XF86XK_START","DOM_VK_XF86XK_STOP","DOM_VK_XF86XK_SUBTITLE","DOM_VK_XF86XK_SUPPORT","DOM_VK_XF86XK_SUSPEND","DOM_VK_XF86XK_TASK_PANE","DOM_VK_XF86XK_TERMINAL","DOM_VK_XF86XK_TIME","DOM_VK_XF86XK_TOOLS","DOM_VK_XF86XK_TOP_MENU","DOM_VK_XF86XK_TO_DO_LIST","DOM_VK_XF86XK_TRAVEL","DOM_VK_XF86XK_USER1KB","DOM_VK_XF86XK_USER2KB","DOM_VK_XF86XK_USER_PB","DOM_VK_XF86XK_UWB","DOM_VK_XF86XK_VENDOR_HOME","DOM_VK_XF86XK_VIDEO","DOM_VK_XF86XK_VIEW","DOM_VK_XF86XK_WAKE_UP","DOM_VK_XF86XK_WEB_CAM","DOM_VK_XF86XK_WHEEL_BUTTON","DOM_VK_XF86XK_WLAN","DOM_VK_XF86XK_WORD","DOM_VK_XF86XK_WWW","DOM_VK_XF86XK_XFER","DOM_VK_XF86XK_YELLOW","DOM_VK_XF86XK_ZOOM_IN","DOM_VK_XF86XK_ZOOM_OUT","DOM_VK_Y","DOM_VK_Z","DOM_VK_ZOOM","DONE","DONT_CARE","DOWNLOADING","DRAGDROP","DRAW_BUFFER0","DRAW_BUFFER1","DRAW_BUFFER10","DRAW_BUFFER11","DRAW_BUFFER12","DRAW_BUFFER13","DRAW_BUFFER14","DRAW_BUFFER15","DRAW_BUFFER2","DRAW_BUFFER3","DRAW_BUFFER4","DRAW_BUFFER5","DRAW_BUFFER6","DRAW_BUFFER7","DRAW_BUFFER8","DRAW_BUFFER9","DRAW_FRAMEBUFFER","DRAW_FRAMEBUFFER_BINDING","DST_ALPHA","DST_COLOR","DYNAMIC_COPY","DYNAMIC_DRAW","DYNAMIC_READ","DataChannel","DataTransfer","DataTransferItem","DataTransferItemList","DataView","Date","DateTimeFormat","DecompressionStream","DelayNode","DeprecationReportBody","DesktopNotification","DesktopNotificationCenter","DeviceLightEvent","DeviceMotionEvent","DeviceMotionEventAcceleration","DeviceMotionEventRotationRate","DeviceOrientationEvent","DeviceProximityEvent","DeviceStorage","DeviceStorageChangeEvent","Directory","DisplayNames","Document","DocumentFragment","DocumentTimeline","DocumentType","DragEvent","DynamicsCompressorNode","E","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_NODE","EMPTY","ENCODING_ERR","ENDED","END_TO_END","END_TO_START","ENTITY_NODE","ENTITY_REFERENCE_NODE","EPSILON","EQUAL","EQUALPOWER","ERROR","EXPONENTIAL_DISTANCE","Element","ElementInternals","ElementQuery","EnterPictureInPictureEvent","Entity","EntityReference","Error","ErrorEvent","EvalError","Event","EventException","EventSource","EventTarget","External","FASTEST","FIDOSDK","FILTER_ACCEPT","FILTER_INTERRUPT","FILTER_REJECT","FILTER_SKIP","FINISHED_STATE","FIRST_ORDERED_NODE_TYPE","FLOAT","FLOAT_32_UNSIGNED_INT_24_8_REV","FLOAT_MAT2","FLOAT_MAT2x3","FLOAT_MAT2x4","FLOAT_MAT3","FLOAT_MAT3x2","FLOAT_MAT3x4","FLOAT_MAT4","FLOAT_MAT4x2","FLOAT_MAT4x3","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","FOCUS","FONT_FACE_RULE","FONT_FEATURE_VALUES_RULE","FRAGMENT_SHADER","FRAGMENT_SHADER_DERIVATIVE_HINT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","FRAMEBUFFER","FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE","FRAMEBUFFER_ATTACHMENT_BLUE_SIZE","FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING","FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE","FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE","FRAMEBUFFER_ATTACHMENT_GREEN_SIZE","FRAMEBUFFER_ATTACHMENT_OBJECT_NAME","FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE","FRAMEBUFFER_ATTACHMENT_RED_SIZE","FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE","FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE","FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER","FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL","FRAMEBUFFER_BINDING","FRAMEBUFFER_COMPLETE","FRAMEBUFFER_DEFAULT","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MULTISAMPLE","FRAMEBUFFER_UNSUPPORTED","FRONT","FRONT_AND_BACK","FRONT_FACE","FUNC_ADD","FUNC_REVERSE_SUBTRACT","FUNC_SUBTRACT","FeaturePolicy","FeaturePolicyViolationReportBody","FederatedCredential","Feed","FeedEntry","File","FileError","FileList","FileReader","FileSystem","FileSystemDirectoryEntry","FileSystemDirectoryReader","FileSystemEntry","FileSystemFileEntry","FinalizationRegistry","FindInPage","Float32Array","Float64Array","FocusEvent","FontFace","FontFaceSet","FontFaceSetLoadEvent","FormData","FormDataEvent","FragmentDirective","Function","GENERATE_MIPMAP_HINT","GEQUAL","GREATER","GREEN_BITS","GainNode","Gamepad","GamepadAxisMoveEvent","GamepadButton","GamepadButtonEvent","GamepadEvent","GamepadHapticActuator","GamepadPose","Geolocation","GeolocationCoordinates","GeolocationPosition","GeolocationPositionError","GestureEvent","Global","Gyroscope","HALF_FLOAT","HAVE_CURRENT_DATA","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","HAVE_METADATA","HAVE_NOTHING","HEADERS_RECEIVED","HIDDEN","HIERARCHY_REQUEST_ERR","HIGHPASS","HIGHSHELF","HIGH_FLOAT","HIGH_INT","HORIZONTAL","HORIZONTAL_AXIS","HRTF","HTMLAllCollection","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement","HTMLAudioElement","HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBlockquoteElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement","HTMLCollection","HTMLCommandElement","HTMLContentElement","HTMLDListElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormControlsCollection","HTMLFormElement","HTMLFrameElement","HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement","HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLKeygenElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement","HTMLLinkElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMenuElement","HTMLMenuItemElement","HTMLMetaElement","HTMLMeterElement","HTMLModElement","HTMLOListElement","HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLOutputElement","HTMLParagraphElement","HTMLParamElement","HTMLPictureElement","HTMLPreElement","HTMLProgressElement","HTMLPropertiesCollection","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLShadowElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLStyleElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLTimeElement","HTMLTitleElement","HTMLTrackElement","HTMLUListElement","HTMLUnknownElement","HTMLVideoElement","HashChangeEvent","Headers","History","Hz","ICE_CHECKING","ICE_CLOSED","ICE_COMPLETED","ICE_CONNECTED","ICE_FAILED","ICE_GATHERING","ICE_WAITING","IDBCursor","IDBCursorWithValue","IDBDatabase","IDBDatabaseException","IDBFactory","IDBFileHandle","IDBFileRequest","IDBIndex","IDBKeyRange","IDBMutableFile","IDBObjectStore","IDBOpenDBRequest","IDBRequest","IDBTransaction","IDBVersionChangeEvent","IDLE","IIRFilterNode","IMPLEMENTATION_COLOR_READ_FORMAT","IMPLEMENTATION_COLOR_READ_TYPE","IMPORT_RULE","INCR","INCR_WRAP","INDEX_SIZE_ERR","INT","INTERLEAVED_ATTRIBS","INT_2_10_10_10_REV","INT_SAMPLER_2D","INT_SAMPLER_2D_ARRAY","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_VEC2","INT_VEC3","INT_VEC4","INUSE_ATTRIBUTE_ERR","INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_ENUM","INVALID_EXPRESSION_ERR","INVALID_FRAMEBUFFER_OPERATION","INVALID_INDEX","INVALID_MODIFICATION_ERR","INVALID_NODE_TYPE_ERR","INVALID_OPERATION","INVALID_STATE_ERR","INVALID_VALUE","INVERSE_DISTANCE","INVERT","IceCandidate","IdleDeadline","Image","ImageBitmap","ImageBitmapRenderingContext","ImageCapture","ImageData","Infinity","InputDeviceCapabilities","InputDeviceInfo","InputEvent","InputMethodContext","InstallTrigger","InstallTriggerImpl","Instance","Int16Array","Int32Array","Int8Array","Intent","InternalError","IntersectionObserver","IntersectionObserverEntry","Intl","IsSearchProviderInstalled","Iterator","JSON","KEEP","KEYDOWN","KEYFRAMES_RULE","KEYFRAME_RULE","KEYPRESS","KEYUP","KeyEvent","Keyboard","KeyboardEvent","KeyboardLayoutMap","KeyframeEffect","LENGTHADJUST_SPACING","LENGTHADJUST_SPACINGANDGLYPHS","LENGTHADJUST_UNKNOWN","LEQUAL","LESS","LINEAR","LINEAR_DISTANCE","LINEAR_MIPMAP_LINEAR","LINEAR_MIPMAP_NEAREST","LINES","LINE_LOOP","LINE_STRIP","LINE_WIDTH","LINK_STATUS","LIVE","LN10","LN2","LOADED","LOADING","LOG10E","LOG2E","LOWPASS","LOWSHELF","LOW_FLOAT","LOW_INT","LSException","LSParserFilter","LUMINANCE","LUMINANCE_ALPHA","LargestContentfulPaint","LayoutShift","LayoutShiftAttribution","LinearAccelerationSensor","LinkError","ListFormat","LocalMediaStream","Locale","Location","Lock","LockManager","MAX","MAX_3D_TEXTURE_SIZE","MAX_ARRAY_TEXTURE_LAYERS","MAX_CLIENT_WAIT_TIMEOUT_WEBGL","MAX_COLOR_ATTACHMENTS","MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_COMBINED_UNIFORM_BLOCKS","MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_DRAW_BUFFERS","MAX_ELEMENTS_INDICES","MAX_ELEMENTS_VERTICES","MAX_ELEMENT_INDEX","MAX_FRAGMENT_INPUT_COMPONENTS","MAX_FRAGMENT_UNIFORM_BLOCKS","MAX_FRAGMENT_UNIFORM_COMPONENTS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_PROGRAM_TEXEL_OFFSET","MAX_RENDERBUFFER_SIZE","MAX_SAFE_INTEGER","MAX_SAMPLES","MAX_SERVER_WAIT_TIMEOUT","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_LOD_BIAS","MAX_TEXTURE_MAX_ANISOTROPY_EXT","MAX_TEXTURE_SIZE","MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS","MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS","MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS","MAX_UNIFORM_BLOCK_SIZE","MAX_UNIFORM_BUFFER_BINDINGS","MAX_VALUE","MAX_VARYING_COMPONENTS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_OUTPUT_COMPONENTS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_BLOCKS","MAX_VERTEX_UNIFORM_COMPONENTS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_ENCRYPTED","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_KEYERR_CLIENT","MEDIA_KEYERR_DOMAIN","MEDIA_KEYERR_HARDWARECHANGE","MEDIA_KEYERR_OUTPUT","MEDIA_KEYERR_SERVICE","MEDIA_KEYERR_UNKNOWN","MEDIA_RULE","MEDIUM_FLOAT","MEDIUM_INT","META_MASK","MIDIAccess","MIDIConnectionEvent","MIDIInput","MIDIInputMap","MIDIMessageEvent","MIDIOutput","MIDIOutputMap","MIDIPort","MIN","MIN_PROGRAM_TEXEL_OFFSET","MIN_SAFE_INTEGER","MIN_VALUE","MIRRORED_REPEAT","MODE_ASYNCHRONOUS","MODE_SYNCHRONOUS","MODIFICATION","MOUSEDOWN","MOUSEDRAG","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOZ_KEYFRAMES_RULE","MOZ_KEYFRAME_RULE","MOZ_SOURCE_CURSOR","MOZ_SOURCE_ERASER","MOZ_SOURCE_KEYBOARD","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_TOUCH","MOZ_SOURCE_UNKNOWN","MSGESTURE_FLAG_BEGIN","MSGESTURE_FLAG_CANCEL","MSGESTURE_FLAG_END","MSGESTURE_FLAG_INERTIA","MSGESTURE_FLAG_NONE","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_PEN","MSPOINTER_TYPE_TOUCH","MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE","MS_ASYNC_CALLBACK_STATUS_CANCEL","MS_ASYNC_CALLBACK_STATUS_CHOOSEANY","MS_ASYNC_CALLBACK_STATUS_ERROR","MS_ASYNC_CALLBACK_STATUS_JOIN","MS_ASYNC_OP_STATUS_CANCELED","MS_ASYNC_OP_STATUS_ERROR","MS_ASYNC_OP_STATUS_SUCCESS","MS_MANIPULATION_STATE_ACTIVE","MS_MANIPULATION_STATE_CANCELLED","MS_MANIPULATION_STATE_COMMITTED","MS_MANIPULATION_STATE_DRAGGING","MS_MANIPULATION_STATE_INERTIA","MS_MANIPULATION_STATE_PRESELECT","MS_MANIPULATION_STATE_SELECTING","MS_MANIPULATION_STATE_STOPPED","MS_MEDIA_ERR_ENCRYPTED","MS_MEDIA_KEYERR_CLIENT","MS_MEDIA_KEYERR_DOMAIN","MS_MEDIA_KEYERR_HARDWARECHANGE","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_SERVICE","MS_MEDIA_KEYERR_UNKNOWN","Map","Math","MathMLElement","MediaCapabilities","MediaCapabilitiesInfo","MediaController","MediaDeviceInfo","MediaDevices","MediaElementAudioSourceNode","MediaEncryptedEvent","MediaError","MediaKeyError","MediaKeyEvent","MediaKeyMessageEvent","MediaKeyNeededEvent","MediaKeySession","MediaKeyStatusMap","MediaKeySystemAccess","MediaKeys","MediaList","MediaMetadata","MediaQueryList","MediaQueryListEvent","MediaRecorder","MediaRecorderErrorEvent","MediaSession","MediaSettingsRange","MediaSource","MediaStream","MediaStreamAudioDestinationNode","MediaStreamAudioSourceNode","MediaStreamEvent","MediaStreamTrack","MediaStreamTrackAudioSourceNode","MediaStreamTrackEvent","Memory","MessageChannel","MessageEvent","MessagePort","Methods","MimeType","MimeTypeArray","Module","MouseEvent","MouseScrollEvent","MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBackfaceVisibility","MozBinding","MozBorderBottomColors","MozBorderEnd","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStart","MozBorderStartColor","MozBorderStartStyle","MozBorderStartWidth","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex","MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozCSSKeyframeRule","MozCSSKeyframesRule","MozColumnCount","MozColumnFill","MozColumnGap","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContactChangeEvent","MozFloatEdge","MozFontFeatureSettings","MozFontLanguageOverride","MozForceBrokenImageIcon","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozMmsEvent","MozMmsMessage","MozMobileMessageThread","MozOSXFontSmoothing","MozOrient","MozOsxFontSmoothing","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozPerspective","MozPerspectiveOrigin","MozPowerManager","MozSettingsEvent","MozSmsEvent","MozSmsMessage","MozStackSizing","MozTabSize","MozTextAlignLast","MozTextDecorationColor","MozTextDecorationLine","MozTextDecorationStyle","MozTextSizeAdjust","MozTransform","MozTransformOrigin","MozTransformStyle","MozTransition","MozTransitionDelay","MozTransitionDuration","MozTransitionProperty","MozTransitionTimingFunction","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","MutationEvent","MutationObserver","MutationRecord","NAMESPACE_ERR","NAMESPACE_RULE","NEAREST","NEAREST_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","NEGATIVE_INFINITY","NETWORK_EMPTY","NETWORK_ERR","NETWORK_IDLE","NETWORK_LOADED","NETWORK_LOADING","NETWORK_NO_SOURCE","NEVER","NEW","NEXT","NEXT_NO_DUPLICATE","NICEST","NODE_AFTER","NODE_BEFORE","NODE_BEFORE_AND_AFTER","NODE_INSIDE","NONE","NON_TRANSIENT_ERR","NOTATION_NODE","NOTCH","NOTEQUAL","NOT_ALLOWED_ERR","NOT_FOUND_ERR","NOT_READABLE_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_ERR","NO_ERROR","NO_MODIFICATION_ALLOWED_ERR","NUMBER_TYPE","NUM_COMPRESSED_TEXTURE_FORMATS","NaN","NamedNodeMap","NavigationPreloadManager","Navigator","NearbyLinks","NetworkInformation","Node","NodeFilter","NodeIterator","NodeList","Notation","Notification","NotifyPaintEvent","Number","NumberFormat","OBJECT_TYPE","OBSOLETE","OK","ONE","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","OPEN","OPENED","OPENING","ORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","OTHER_ERROR","OUT_OF_MEMORY","Object","OfflineAudioCompletionEvent","OfflineAudioContext","OfflineResourceList","OffscreenCanvas","OffscreenCanvasRenderingContext2D","Option","OrientationSensor","OscillatorNode","OverconstrainedError","OverflowEvent","PACK_ALIGNMENT","PACK_ROW_LENGTH","PACK_SKIP_PIXELS","PACK_SKIP_ROWS","PAGE_RULE","PARSE_ERR","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_CLOSEPATH","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_UNKNOWN","PATH_EXISTS_ERR","PEAKING","PERMISSION_DENIED","PERSISTENT","PI","PIXEL_PACK_BUFFER","PIXEL_PACK_BUFFER_BINDING","PIXEL_UNPACK_BUFFER","PIXEL_UNPACK_BUFFER_BINDING","PLAYING_STATE","POINTS","POLYGON_OFFSET_FACTOR","POLYGON_OFFSET_FILL","POLYGON_OFFSET_UNITS","POSITION_UNAVAILABLE","POSITIVE_INFINITY","PREV","PREV_NO_DUPLICATE","PROCESSING_INSTRUCTION_NODE","PageChangeEvent","PageTransitionEvent","PaintRequest","PaintRequestList","PannerNode","PasswordCredential","Path2D","PaymentAddress","PaymentInstruments","PaymentManager","PaymentMethodChangeEvent","PaymentRequest","PaymentRequestUpdateEvent","PaymentResponse","Performance","PerformanceElementTiming","PerformanceEntry","PerformanceEventTiming","PerformanceLongTaskTiming","PerformanceMark","PerformanceMeasure","PerformanceNavigation","PerformanceNavigationTiming","PerformanceObserver","PerformanceObserverEntryList","PerformancePaintTiming","PerformanceResourceTiming","PerformanceServerTiming","PerformanceTiming","PeriodicSyncManager","PeriodicWave","PermissionStatus","Permissions","PhotoCapabilities","PictureInPictureWindow","Plugin","PluginArray","PluralRules","PointerEvent","PopStateEvent","PopupBlockedEvent","Presentation","PresentationAvailability","PresentationConnection","PresentationConnectionAvailableEvent","PresentationConnectionCloseEvent","PresentationConnectionList","PresentationReceiver","PresentationRequest","ProcessingInstruction","ProgressEvent","Promise","PromiseRejectionEvent","PropertyNodeList","Proxy","PublicKeyCredential","PushManager","PushSubscription","PushSubscriptionOptions","Q","QUERY_RESULT","QUERY_RESULT_AVAILABLE","QUOTA_ERR","QUOTA_EXCEEDED_ERR","QueryInterface","R11F_G11F_B10F","R16F","R16I","R16UI","R32F","R32I","R32UI","R8","R8I","R8UI","R8_SNORM","RASTERIZER_DISCARD","READ_BUFFER","READ_FRAMEBUFFER","READ_FRAMEBUFFER_BINDING","READ_ONLY","READ_ONLY_ERR","READ_WRITE","RED","RED_BITS","RED_INTEGER","REMOVAL","RENDERBUFFER","RENDERBUFFER_ALPHA_SIZE","RENDERBUFFER_BINDING","RENDERBUFFER_BLUE_SIZE","RENDERBUFFER_DEPTH_SIZE","RENDERBUFFER_GREEN_SIZE","RENDERBUFFER_HEIGHT","RENDERBUFFER_INTERNAL_FORMAT","RENDERBUFFER_RED_SIZE","RENDERBUFFER_SAMPLES","RENDERBUFFER_STENCIL_SIZE","RENDERBUFFER_WIDTH","RENDERER","RENDERING_INTENT_ABSOLUTE_COLORIMETRIC","RENDERING_INTENT_AUTO","RENDERING_INTENT_PERCEPTUAL","RENDERING_INTENT_RELATIVE_COLORIMETRIC","RENDERING_INTENT_SATURATION","RENDERING_INTENT_UNKNOWN","REPEAT","REPLACE","RG","RG16F","RG16I","RG16UI","RG32F","RG32I","RG32UI","RG8","RG8I","RG8UI","RG8_SNORM","RGB","RGB10_A2","RGB10_A2UI","RGB16F","RGB16I","RGB16UI","RGB32F","RGB32I","RGB32UI","RGB565","RGB5_A1","RGB8","RGB8I","RGB8UI","RGB8_SNORM","RGB9_E5","RGBA","RGBA16F","RGBA16I","RGBA16UI","RGBA32F","RGBA32I","RGBA32UI","RGBA4","RGBA8","RGBA8I","RGBA8UI","RGBA8_SNORM","RGBA_INTEGER","RGBColor","RGB_INTEGER","RG_INTEGER","ROTATION_CLOCKWISE","ROTATION_COUNTERCLOCKWISE","RTCCertificate","RTCDTMFSender","RTCDTMFToneChangeEvent","RTCDataChannel","RTCDataChannelEvent","RTCDtlsTransport","RTCError","RTCErrorEvent","RTCIceCandidate","RTCIceTransport","RTCPeerConnection","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSctpTransport","RTCSessionDescription","RTCStatsReport","RTCTrackEvent","RadioNodeList","Range","RangeError","RangeException","ReadableStream","ReadableStreamDefaultReader","RecordErrorEvent","Rect","ReferenceError","Reflect","RegExp","RelativeOrientationSensor","RelativeTimeFormat","RemotePlayback","Report","ReportBody","ReportingObserver","Request","ResizeObserver","ResizeObserverEntry","ResizeObserverSize","Response","RuntimeError","SAMPLER_2D","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_2D_SHADOW","SAMPLER_3D","SAMPLER_BINDING","SAMPLER_CUBE","SAMPLER_CUBE_SHADOW","SAMPLES","SAMPLE_ALPHA_TO_COVERAGE","SAMPLE_BUFFERS","SAMPLE_COVERAGE","SAMPLE_COVERAGE_INVERT","SAMPLE_COVERAGE_VALUE","SAWTOOTH","SCHEDULED_STATE","SCISSOR_BOX","SCISSOR_TEST","SCROLL_PAGE_DOWN","SCROLL_PAGE_UP","SDP_ANSWER","SDP_OFFER","SDP_PRANSWER","SECURITY_ERR","SELECT","SEPARATE_ATTRIBS","SERIALIZE_ERR","SEVERITY_ERROR","SEVERITY_FATAL_ERROR","SEVERITY_WARNING","SHADER_COMPILER","SHADER_TYPE","SHADING_LANGUAGE_VERSION","SHIFT_MASK","SHORT","SHOWING","SHOW_ALL","SHOW_ATTRIBUTE","SHOW_CDATA_SECTION","SHOW_COMMENT","SHOW_DOCUMENT","SHOW_DOCUMENT_FRAGMENT","SHOW_DOCUMENT_TYPE","SHOW_ELEMENT","SHOW_ENTITY","SHOW_ENTITY_REFERENCE","SHOW_NOTATION","SHOW_PROCESSING_INSTRUCTION","SHOW_TEXT","SIGNALED","SIGNED_NORMALIZED","SINE","SOUNDFIELD","SQLException","SQRT1_2","SQRT2","SQUARE","SRC_ALPHA","SRC_ALPHA_SATURATE","SRC_COLOR","SRGB","SRGB8","SRGB8_ALPHA8","START_TO_END","START_TO_START","STATIC_COPY","STATIC_DRAW","STATIC_READ","STENCIL","STENCIL_ATTACHMENT","STENCIL_BACK_FAIL","STENCIL_BACK_FUNC","STENCIL_BACK_PASS_DEPTH_FAIL","STENCIL_BACK_PASS_DEPTH_PASS","STENCIL_BACK_REF","STENCIL_BACK_VALUE_MASK","STENCIL_BACK_WRITEMASK","STENCIL_BITS","STENCIL_BUFFER_BIT","STENCIL_CLEAR_VALUE","STENCIL_FAIL","STENCIL_FUNC","STENCIL_INDEX","STENCIL_INDEX8","STENCIL_PASS_DEPTH_FAIL","STENCIL_PASS_DEPTH_PASS","STENCIL_REF","STENCIL_TEST","STENCIL_VALUE_MASK","STENCIL_WRITEMASK","STREAM_COPY","STREAM_DRAW","STREAM_READ","STRING_TYPE","STYLE_RULE","SUBPIXEL_BITS","SUPPORTS_RULE","SVGAElement","SVGAltGlyphDefElement","SVGAltGlyphElement","SVGAltGlyphItemElement","SVGAngle","SVGAnimateColorElement","SVGAnimateElement","SVGAnimateMotionElement","SVGAnimateTransformElement","SVGAnimatedAngle","SVGAnimatedBoolean","SVGAnimatedEnumeration","SVGAnimatedInteger","SVGAnimatedLength","SVGAnimatedLengthList","SVGAnimatedNumber","SVGAnimatedNumberList","SVGAnimatedPreserveAspectRatio","SVGAnimatedRect","SVGAnimatedString","SVGAnimatedTransformList","SVGAnimationElement","SVGCircleElement","SVGClipPathElement","SVGColor","SVGComponentTransferFunctionElement","SVGCursorElement","SVGDefsElement","SVGDescElement","SVGDiscardElement","SVGDocument","SVGElement","SVGElementInstance","SVGElementInstanceList","SVGEllipseElement","SVGException","SVGFEBlendElement","SVGFEColorMatrixElement","SVGFEComponentTransferElement","SVGFECompositeElement","SVGFEConvolveMatrixElement","SVGFEDiffuseLightingElement","SVGFEDisplacementMapElement","SVGFEDistantLightElement","SVGFEDropShadowElement","SVGFEFloodElement","SVGFEFuncAElement","SVGFEFuncBElement","SVGFEFuncGElement","SVGFEFuncRElement","SVGFEGaussianBlurElement","SVGFEImageElement","SVGFEMergeElement","SVGFEMergeNodeElement","SVGFEMorphologyElement","SVGFEOffsetElement","SVGFEPointLightElement","SVGFESpecularLightingElement","SVGFESpotLightElement","SVGFETileElement","SVGFETurbulenceElement","SVGFilterElement","SVGFontElement","SVGFontFaceElement","SVGFontFaceFormatElement","SVGFontFaceNameElement","SVGFontFaceSrcElement","SVGFontFaceUriElement","SVGForeignObjectElement","SVGGElement","SVGGeometryElement","SVGGlyphElement","SVGGlyphRefElement","SVGGradientElement","SVGGraphicsElement","SVGHKernElement","SVGImageElement","SVGLength","SVGLengthList","SVGLineElement","SVGLinearGradientElement","SVGMPathElement","SVGMarkerElement","SVGMaskElement","SVGMatrix","SVGMetadataElement","SVGMissingGlyphElement","SVGNumber","SVGNumberList","SVGPaint","SVGPathElement","SVGPathSeg","SVGPathSegArcAbs","SVGPathSegArcRel","SVGPathSegClosePath","SVGPathSegCurvetoCubicAbs","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathSegLinetoAbs","SVGPathSegLinetoHorizontalAbs","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegList","SVGPathSegMovetoAbs","SVGPathSegMovetoRel","SVGPatternElement","SVGPoint","SVGPointList","SVGPolygonElement","SVGPolylineElement","SVGPreserveAspectRatio","SVGRadialGradientElement","SVGRect","SVGRectElement","SVGRenderingIntent","SVGSVGElement","SVGScriptElement","SVGSetElement","SVGStopElement","SVGStringList","SVGStyleElement","SVGSwitchElement","SVGSymbolElement","SVGTRefElement","SVGTSpanElement","SVGTextContentElement","SVGTextElement","SVGTextPathElement","SVGTextPositioningElement","SVGTitleElement","SVGTransform","SVGTransformList","SVGUnitTypes","SVGUseElement","SVGVKernElement","SVGViewElement","SVGViewSpec","SVGZoomAndPan","SVGZoomEvent","SVG_ANGLETYPE_DEG","SVG_ANGLETYPE_GRAD","SVG_ANGLETYPE_RAD","SVG_ANGLETYPE_UNKNOWN","SVG_ANGLETYPE_UNSPECIFIED","SVG_CHANNEL_A","SVG_CHANNEL_B","SVG_CHANNEL_G","SVG_CHANNEL_R","SVG_CHANNEL_UNKNOWN","SVG_COLORTYPE_CURRENTCOLOR","SVG_COLORTYPE_RGBCOLOR","SVG_COLORTYPE_RGBCOLOR_ICCCOLOR","SVG_COLORTYPE_UNKNOWN","SVG_EDGEMODE_DUPLICATE","SVG_EDGEMODE_NONE","SVG_EDGEMODE_UNKNOWN","SVG_EDGEMODE_WRAP","SVG_FEBLEND_MODE_COLOR","SVG_FEBLEND_MODE_COLOR_BURN","SVG_FEBLEND_MODE_COLOR_DODGE","SVG_FEBLEND_MODE_DARKEN","SVG_FEBLEND_MODE_DIFFERENCE","SVG_FEBLEND_MODE_EXCLUSION","SVG_FEBLEND_MODE_HARD_LIGHT","SVG_FEBLEND_MODE_HUE","SVG_FEBLEND_MODE_LIGHTEN","SVG_FEBLEND_MODE_LUMINOSITY","SVG_FEBLEND_MODE_MULTIPLY","SVG_FEBLEND_MODE_NORMAL","SVG_FEBLEND_MODE_OVERLAY","SVG_FEBLEND_MODE_SATURATION","SVG_FEBLEND_MODE_SCREEN","SVG_FEBLEND_MODE_SOFT_LIGHT","SVG_FEBLEND_MODE_UNKNOWN","SVG_FECOLORMATRIX_TYPE_HUEROTATE","SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA","SVG_FECOLORMATRIX_TYPE_MATRIX","SVG_FECOLORMATRIX_TYPE_SATURATE","SVG_FECOLORMATRIX_TYPE_UNKNOWN","SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE","SVG_FECOMPONENTTRANSFER_TYPE_GAMMA","SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY","SVG_FECOMPONENTTRANSFER_TYPE_LINEAR","SVG_FECOMPONENTTRANSFER_TYPE_TABLE","SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_ARITHMETIC","SVG_FECOMPOSITE_OPERATOR_ATOP","SVG_FECOMPOSITE_OPERATOR_IN","SVG_FECOMPOSITE_OPERATOR_OUT","SVG_FECOMPOSITE_OPERATOR_OVER","SVG_FECOMPOSITE_OPERATOR_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_XOR","SVG_INVALID_VALUE_ERR","SVG_LENGTHTYPE_CM","SVG_LENGTHTYPE_EMS","SVG_LENGTHTYPE_EXS","SVG_LENGTHTYPE_IN","SVG_LENGTHTYPE_MM","SVG_LENGTHTYPE_NUMBER","SVG_LENGTHTYPE_PC","SVG_LENGTHTYPE_PERCENTAGE","SVG_LENGTHTYPE_PT","SVG_LENGTHTYPE_PX","SVG_LENGTHTYPE_UNKNOWN","SVG_MARKERUNITS_STROKEWIDTH","SVG_MARKERUNITS_UNKNOWN","SVG_MARKERUNITS_USERSPACEONUSE","SVG_MARKER_ORIENT_ANGLE","SVG_MARKER_ORIENT_AUTO","SVG_MARKER_ORIENT_UNKNOWN","SVG_MASKTYPE_ALPHA","SVG_MASKTYPE_LUMINANCE","SVG_MATRIX_NOT_INVERTABLE","SVG_MEETORSLICE_MEET","SVG_MEETORSLICE_SLICE","SVG_MEETORSLICE_UNKNOWN","SVG_MORPHOLOGY_OPERATOR_DILATE","SVG_MORPHOLOGY_OPERATOR_ERODE","SVG_MORPHOLOGY_OPERATOR_UNKNOWN","SVG_PAINTTYPE_CURRENTCOLOR","SVG_PAINTTYPE_NONE","SVG_PAINTTYPE_RGBCOLOR","SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR","SVG_PAINTTYPE_UNKNOWN","SVG_PAINTTYPE_URI","SVG_PAINTTYPE_URI_CURRENTCOLOR","SVG_PAINTTYPE_URI_NONE","SVG_PAINTTYPE_URI_RGBCOLOR","SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR","SVG_PRESERVEASPECTRATIO_NONE","SVG_PRESERVEASPECTRATIO_UNKNOWN","SVG_PRESERVEASPECTRATIO_XMAXYMAX","SVG_PRESERVEASPECTRATIO_XMAXYMID","SVG_PRESERVEASPECTRATIO_XMAXYMIN","SVG_PRESERVEASPECTRATIO_XMIDYMAX","SVG_PRESERVEASPECTRATIO_XMIDYMID","SVG_PRESERVEASPECTRATIO_XMIDYMIN","SVG_PRESERVEASPECTRATIO_XMINYMAX","SVG_PRESERVEASPECTRATIO_XMINYMID","SVG_PRESERVEASPECTRATIO_XMINYMIN","SVG_SPREADMETHOD_PAD","SVG_SPREADMETHOD_REFLECT","SVG_SPREADMETHOD_REPEAT","SVG_SPREADMETHOD_UNKNOWN","SVG_STITCHTYPE_NOSTITCH","SVG_STITCHTYPE_STITCH","SVG_STITCHTYPE_UNKNOWN","SVG_TRANSFORM_MATRIX","SVG_TRANSFORM_ROTATE","SVG_TRANSFORM_SCALE","SVG_TRANSFORM_SKEWX","SVG_TRANSFORM_SKEWY","SVG_TRANSFORM_TRANSLATE","SVG_TRANSFORM_UNKNOWN","SVG_TURBULENCE_TYPE_FRACTALNOISE","SVG_TURBULENCE_TYPE_TURBULENCE","SVG_TURBULENCE_TYPE_UNKNOWN","SVG_UNIT_TYPE_OBJECTBOUNDINGBOX","SVG_UNIT_TYPE_UNKNOWN","SVG_UNIT_TYPE_USERSPACEONUSE","SVG_WRONG_TYPE_ERR","SVG_ZOOMANDPAN_DISABLE","SVG_ZOOMANDPAN_MAGNIFY","SVG_ZOOMANDPAN_UNKNOWN","SYNC_CONDITION","SYNC_FENCE","SYNC_FLAGS","SYNC_FLUSH_COMMANDS_BIT","SYNC_GPU_COMMANDS_COMPLETE","SYNC_STATUS","SYNTAX_ERR","SavedPages","Screen","ScreenOrientation","Script","ScriptProcessorNode","ScrollAreaEvent","SecurityPolicyViolationEvent","Selection","Sensor","SensorErrorEvent","ServiceWorker","ServiceWorkerContainer","ServiceWorkerRegistration","SessionDescription","Set","ShadowRoot","SharedArrayBuffer","SharedWorker","SimpleGestureEvent","SourceBuffer","SourceBufferList","SpeechSynthesis","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","SpeechSynthesisUtterance","SpeechSynthesisVoice","StaticRange","StereoPannerNode","StopIteration","Storage","StorageEvent","StorageManager","String","StructType","StylePropertyMap","StylePropertyMapReadOnly","StyleSheet","StyleSheetList","SubmitEvent","SubtleCrypto","Symbol","SyncManager","SyntaxError","TEMPORARY","TEXTPATH_METHODTYPE_ALIGN","TEXTPATH_METHODTYPE_STRETCH","TEXTPATH_METHODTYPE_UNKNOWN","TEXTPATH_SPACINGTYPE_AUTO","TEXTPATH_SPACINGTYPE_EXACT","TEXTPATH_SPACINGTYPE_UNKNOWN","TEXTURE","TEXTURE0","TEXTURE1","TEXTURE10","TEXTURE11","TEXTURE12","TEXTURE13","TEXTURE14","TEXTURE15","TEXTURE16","TEXTURE17","TEXTURE18","TEXTURE19","TEXTURE2","TEXTURE20","TEXTURE21","TEXTURE22","TEXTURE23","TEXTURE24","TEXTURE25","TEXTURE26","TEXTURE27","TEXTURE28","TEXTURE29","TEXTURE3","TEXTURE30","TEXTURE31","TEXTURE4","TEXTURE5","TEXTURE6","TEXTURE7","TEXTURE8","TEXTURE9","TEXTURE_2D","TEXTURE_2D_ARRAY","TEXTURE_3D","TEXTURE_BASE_LEVEL","TEXTURE_BINDING_2D","TEXTURE_BINDING_2D_ARRAY","TEXTURE_BINDING_3D","TEXTURE_BINDING_CUBE_MAP","TEXTURE_COMPARE_FUNC","TEXTURE_COMPARE_MODE","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_NEGATIVE_X","TEXTURE_CUBE_MAP_NEGATIVE_Y","TEXTURE_CUBE_MAP_NEGATIVE_Z","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP_POSITIVE_Y","TEXTURE_CUBE_MAP_POSITIVE_Z","TEXTURE_IMMUTABLE_FORMAT","TEXTURE_IMMUTABLE_LEVELS","TEXTURE_MAG_FILTER","TEXTURE_MAX_ANISOTROPY_EXT","TEXTURE_MAX_LEVEL","TEXTURE_MAX_LOD","TEXTURE_MIN_FILTER","TEXTURE_MIN_LOD","TEXTURE_WRAP_R","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXT_NODE","TIMEOUT","TIMEOUT_ERR","TIMEOUT_EXPIRED","TIMEOUT_IGNORED","TOO_LARGE_ERR","TRANSACTION_INACTIVE_ERR","TRANSFORM_FEEDBACK","TRANSFORM_FEEDBACK_ACTIVE","TRANSFORM_FEEDBACK_BINDING","TRANSFORM_FEEDBACK_BUFFER","TRANSFORM_FEEDBACK_BUFFER_BINDING","TRANSFORM_FEEDBACK_BUFFER_MODE","TRANSFORM_FEEDBACK_BUFFER_SIZE","TRANSFORM_FEEDBACK_BUFFER_START","TRANSFORM_FEEDBACK_PAUSED","TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN","TRANSFORM_FEEDBACK_VARYINGS","TRIANGLE","TRIANGLES","TRIANGLE_FAN","TRIANGLE_STRIP","TYPE_BACK_FORWARD","TYPE_ERR","TYPE_MISMATCH_ERR","TYPE_NAVIGATE","TYPE_RELOAD","TYPE_RESERVED","Table","TaskAttributionTiming","Text","TextDecoder","TextDecoderStream","TextEncoder","TextEncoderStream","TextEvent","TextMetrics","TextTrack","TextTrackCue","TextTrackCueList","TextTrackList","TimeEvent","TimeRanges","Touch","TouchEvent","TouchList","TrackEvent","TransformStream","TransitionEvent","TreeWalker","TrustedHTML","TrustedScript","TrustedScriptURL","TrustedTypePolicy","TrustedTypePolicyFactory","TypeError","TypedObject","U2F","UIEvent","UNCACHED","UNIFORM_ARRAY_STRIDE","UNIFORM_BLOCK_ACTIVE_UNIFORMS","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_INDEX","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BUFFER","UNIFORM_BUFFER_BINDING","UNIFORM_BUFFER_OFFSET_ALIGNMENT","UNIFORM_BUFFER_SIZE","UNIFORM_BUFFER_START","UNIFORM_IS_ROW_MAJOR","UNIFORM_MATRIX_STRIDE","UNIFORM_OFFSET","UNIFORM_SIZE","UNIFORM_TYPE","UNKNOWN_ERR","UNKNOWN_RULE","UNMASKED_RENDERER_WEBGL","UNMASKED_VENDOR_WEBGL","UNORDERED_NODE_ITERATOR_TYPE","UNORDERED_NODE_SNAPSHOT_TYPE","UNPACK_ALIGNMENT","UNPACK_COLORSPACE_CONVERSION_WEBGL","UNPACK_FLIP_Y_WEBGL","UNPACK_IMAGE_HEIGHT","UNPACK_PREMULTIPLY_ALPHA_WEBGL","UNPACK_ROW_LENGTH","UNPACK_SKIP_IMAGES","UNPACK_SKIP_PIXELS","UNPACK_SKIP_ROWS","UNSCHEDULED_STATE","UNSENT","UNSIGNALED","UNSIGNED_BYTE","UNSIGNED_INT","UNSIGNED_INT_10F_11F_11F_REV","UNSIGNED_INT_24_8","UNSIGNED_INT_2_10_10_10_REV","UNSIGNED_INT_5_9_9_9_REV","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","UNSIGNED_NORMALIZED","UNSIGNED_SHORT","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","UNSIGNED_SHORT_5_6_5","UNSPECIFIED_EVENT_TYPE_ERR","UPDATEREADY","URIError","URL","URLSearchParams","URLUnencoded","URL_MISMATCH_ERR","USB","USBAlternateInterface","USBConfiguration","USBConnectionEvent","USBDevice","USBEndpoint","USBInTransferResult","USBInterface","USBIsochronousInTransferPacket","USBIsochronousInTransferResult","USBIsochronousOutTransferPacket","USBIsochronousOutTransferResult","USBOutTransferResult","UTC","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","UserActivation","UserMessageHandler","UserMessageHandlersNamespace","UserProximityEvent","VALIDATE_STATUS","VALIDATION_ERR","VARIABLES_RULE","VENDOR","VERSION","VERSION_CHANGE","VERSION_ERR","VERTEX_ARRAY_BINDING","VERTEX_ATTRIB_ARRAY_BUFFER_BINDING","VERTEX_ATTRIB_ARRAY_DIVISOR","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","VERTEX_ATTRIB_ARRAY_ENABLED","VERTEX_ATTRIB_ARRAY_INTEGER","VERTEX_ATTRIB_ARRAY_NORMALIZED","VERTEX_ATTRIB_ARRAY_POINTER","VERTEX_ATTRIB_ARRAY_SIZE","VERTEX_ATTRIB_ARRAY_STRIDE","VERTEX_ATTRIB_ARRAY_TYPE","VERTEX_SHADER","VERTICAL","VERTICAL_AXIS","VER_ERR","VIEWPORT","VIEWPORT_RULE","VRDisplay","VRDisplayCapabilities","VRDisplayEvent","VREyeParameters","VRFieldOfView","VRFrameData","VRPose","VRStageParameters","VTTCue","VTTRegion","ValidityState","VideoPlaybackQuality","VideoStreamTrack","VisualViewport","WAIT_FAILED","WEBKIT_FILTER_RULE","WEBKIT_KEYFRAMES_RULE","WEBKIT_KEYFRAME_RULE","WEBKIT_REGION_RULE","WRONG_DOCUMENT_ERR","WakeLock","WakeLockSentinel","WasmAnyRef","WaveShaperNode","WeakMap","WeakRef","WeakSet","WebAssembly","WebGL2RenderingContext","WebGLActiveInfo","WebGLBuffer","WebGLContextEvent","WebGLFramebuffer","WebGLProgram","WebGLQuery","WebGLRenderbuffer","WebGLRenderingContext","WebGLSampler","WebGLShader","WebGLShaderPrecisionFormat","WebGLSync","WebGLTexture","WebGLTransformFeedback","WebGLUniformLocation","WebGLVertexArray","WebGLVertexArrayObject","WebKitAnimationEvent","WebKitBlobBuilder","WebKitCSSFilterRule","WebKitCSSFilterValue","WebKitCSSKeyframeRule","WebKitCSSKeyframesRule","WebKitCSSMatrix","WebKitCSSRegionRule","WebKitCSSTransformValue","WebKitDataCue","WebKitGamepad","WebKitMediaKeyError","WebKitMediaKeyMessageEvent","WebKitMediaKeySession","WebKitMediaKeys","WebKitMediaSource","WebKitMutationObserver","WebKitNamespace","WebKitPlaybackTargetAvailabilityEvent","WebKitPoint","WebKitShadowRoot","WebKitSourceBuffer","WebKitSourceBufferList","WebKitTransitionEvent","WebSocket","WebkitAlignContent","WebkitAlignItems","WebkitAlignSelf","WebkitAnimation","WebkitAnimationDelay","WebkitAnimationDirection","WebkitAnimationDuration","WebkitAnimationFillMode","WebkitAnimationIterationCount","WebkitAnimationName","WebkitAnimationPlayState","WebkitAnimationTimingFunction","WebkitAppearance","WebkitBackfaceVisibility","WebkitBackgroundClip","WebkitBackgroundOrigin","WebkitBackgroundSize","WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius","WebkitBorderImage","WebkitBorderRadius","WebkitBorderTopLeftRadius","WebkitBorderTopRightRadius","WebkitBoxAlign","WebkitBoxDirection","WebkitBoxFlex","WebkitBoxOrdinalGroup","WebkitBoxOrient","WebkitBoxPack","WebkitBoxShadow","WebkitBoxSizing","WebkitFilter","WebkitFlex","WebkitFlexBasis","WebkitFlexDirection","WebkitFlexFlow","WebkitFlexGrow","WebkitFlexShrink","WebkitFlexWrap","WebkitJustifyContent","WebkitLineClamp","WebkitMask","WebkitMaskClip","WebkitMaskComposite","WebkitMaskImage","WebkitMaskOrigin","WebkitMaskPosition","WebkitMaskPositionX","WebkitMaskPositionY","WebkitMaskRepeat","WebkitMaskSize","WebkitOrder","WebkitPerspective","WebkitPerspectiveOrigin","WebkitTextFillColor","WebkitTextSizeAdjust","WebkitTextStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","WebkitTransform","WebkitTransformOrigin","WebkitTransformStyle","WebkitTransition","WebkitTransitionDelay","WebkitTransitionDuration","WebkitTransitionProperty","WebkitTransitionTimingFunction","WebkitUserSelect","WheelEvent","Window","Worker","Worklet","WritableStream","WritableStreamDefaultWriter","XMLDocument","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestException","XMLHttpRequestProgressEvent","XMLHttpRequestUpload","XMLSerializer","XMLStylesheetProcessingInstruction","XPathEvaluator","XPathException","XPathExpression","XPathNSResolver","XPathResult","XRBoundedReferenceSpace","XRDOMOverlayState","XRFrame","XRHitTestResult","XRHitTestSource","XRInputSource","XRInputSourceArray","XRInputSourceEvent","XRInputSourcesChangeEvent","XRLayer","XRPose","XRRay","XRReferenceSpace","XRReferenceSpaceEvent","XRRenderState","XRRigidTransform","XRSession","XRSessionEvent","XRSpace","XRSystem","XRTransientInputHitTestResult","XRTransientInputHitTestSource","XRView","XRViewerPose","XRViewport","XRWebGLLayer","XSLTProcessor","ZERO","_XD0M_","_YD0M_","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__opera","__proto__","_browserjsran","a","aLink","abbr","abort","aborted","abs","absolute","acceleration","accelerationIncludingGravity","accelerator","accept","acceptCharset","acceptNode","accessKey","accessKeyLabel","accuracy","acos","acosh","action","actionURL","actions","activated","active","activeCues","activeElement","activeSourceBuffers","activeSourceCount","activeTexture","activeVRDisplays","actualBoundingBoxAscent","actualBoundingBoxDescent","actualBoundingBoxLeft","actualBoundingBoxRight","add","addAll","addBehavior","addCandidate","addColorStop","addCue","addElement","addEventListener","addFilter","addFromString","addFromUri","addIceCandidate","addImport","addListener","addModule","addNamed","addPageRule","addPath","addPointer","addRange","addRegion","addRule","addSearchEngine","addSourceBuffer","addStream","addTextTrack","addTrack","addTransceiver","addWakeLockListener","added","addedNodes","additionalName","additiveSymbols","addons","address","addressLine","adoptNode","adoptedStyleSheets","adr","advance","after","album","alert","algorithm","align","align-content","align-items","align-self","alignContent","alignItems","alignSelf","alignmentBaseline","alinkColor","all","allSettled","allow","allowFullscreen","allowPaymentRequest","allowedDirections","allowedFeatures","allowedToPlay","allowsFeature","alpha","alt","altGraphKey","altHtml","altKey","altLeft","alternate","alternateSetting","alternates","altitude","altitudeAccuracy","amplitude","ancestorOrigins","anchor","anchorNode","anchorOffset","anchors","and","angle","angularAcceleration","angularVelocity","animVal","animate","animatedInstanceRoot","animatedNormalizedPathSegList","animatedPathSegList","animatedPoints","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationStartTime","animationTimingFunction","animationsPaused","anniversary","antialias","anticipatedRemoval","any","app","appCodeName","appMinorVersion","appName","appNotifications","appVersion","appearance","append","appendBuffer","appendChild","appendData","appendItem","appendMedium","appendNamed","appendRule","appendStream","appendWindowEnd","appendWindowStart","applets","applicationCache","applicationServerKey","apply","applyConstraints","applyElement","arc","arcTo","architecture","archive","areas","arguments","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","arrayBuffer","artist","artwork","as","asIntN","asUintN","asin","asinh","assert","assign","assignedElements","assignedNodes","assignedSlot","async","asyncIterator","atEnd","atan","atan2","atanh","atob","attachEvent","attachInternals","attachShader","attachShadow","attachments","attack","attestationObject","attrChange","attrName","attributeFilter","attributeName","attributeNamespace","attributeOldValue","attributeStyleMap","attributes","attribution","audioBitsPerSecond","audioTracks","audioWorklet","authenticatedSignedWrites","authenticatorData","autoIncrement","autobuffer","autocapitalize","autocomplete","autocorrect","autofocus","automationRate","autoplay","availHeight","availLeft","availTop","availWidth","availability","available","aversion","ax","axes","axis","ay","azimuth","b","back","backface-visibility","backfaceVisibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundFetch","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","badInput","badge","balance","baseFrequencyX","baseFrequencyY","baseLatency","baseLayer","baseNode","baseOffset","baseURI","baseVal","baselineShift","battery","bday","before","beginElement","beginElementAt","beginPath","beginQuery","beginTransformFeedback","behavior","behaviorCookie","behaviorPart","behaviorUrns","beta","bezierCurveTo","bgColor","bgProperties","bias","big","bigint64","biguint64","binaryType","bind","bindAttribLocation","bindBuffer","bindBufferBase","bindBufferRange","bindFramebuffer","bindRenderbuffer","bindSampler","bindTexture","bindTransformFeedback","bindVertexArray","bitness","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","blink","blitFramebuffer","blob","block-size","blockDirection","blockSize","blockedURI","blue","bluetooth","blur","body","bodyUsed","bold","bookmarks","booleanValue","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderBoxSize","borderCollapse","borderColor","borderColorDark","borderColorLight","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","bottomMargin","bound","boundElements","boundingClientRect","boundingHeight","boundingLeft","boundingTop","boundingWidth","bounds","boundsGeometry","box-decoration-break","box-shadow","box-sizing","boxDecorationBreak","boxShadow","boxSizing","brand","brands","break-after","break-before","break-inside","breakAfter","breakBefore","breakInside","broadcast","browserLanguage","btoa","bubbles","buffer","bufferData","bufferDepth","bufferSize","bufferSubData","buffered","bufferedAmount","bufferedAmountLowThreshold","buildID","buildNumber","button","buttonID","buttons","byteLength","byteOffset","bytesWritten","c","cache","caches","call","caller","canBeFormatted","canBeMounted","canBeShared","canHaveChildren","canHaveHTML","canInsertDTMF","canMakePayment","canPlayType","canPresent","canTrickleIceCandidates","cancel","cancelAndHoldAtTime","cancelAnimationFrame","cancelBubble","cancelIdleCallback","cancelScheduledValues","cancelVideoFrameCallback","cancelWatchAvailability","cancelable","candidate","canonicalUUID","canvas","capabilities","caption","caption-side","captionSide","capture","captureEvents","captureStackTrace","captureStream","caret-color","caretBidiLevel","caretColor","caretPositionFromPoint","caretRangeFromPoint","cast","catch","category","cbrt","cd","ceil","cellIndex","cellPadding","cellSpacing","cells","ch","chOff","chain","challenge","changeType","changedTouches","channel","channelCount","channelCountMode","channelInterpretation","char","charAt","charCode","charCodeAt","charIndex","charLength","characterData","characterDataOldValue","characterSet","characteristic","charging","chargingTime","charset","check","checkEnclosure","checkFramebufferStatus","checkIntersection","checkValidity","checked","childElementCount","childList","childNodes","children","chrome","ciphertext","cite","city","claimInterface","claimed","classList","className","classid","clear","clearAppBadge","clearAttributes","clearBufferfi","clearBufferfv","clearBufferiv","clearBufferuiv","clearColor","clearData","clearDepth","clearHalt","clearImmediate","clearInterval","clearLiveSeekableRange","clearMarks","clearMaxGCPauseAccumulator","clearMeasures","clearParameters","clearRect","clearResourceTimings","clearShadow","clearStencil","clearTimeout","clearWatch","click","clickCount","clientDataJSON","clientHeight","clientInformation","clientLeft","clientRect","clientRects","clientTop","clientWaitSync","clientWidth","clientX","clientY","clip","clip-path","clip-rule","clipBottom","clipLeft","clipPath","clipPathUnits","clipRight","clipRule","clipTop","clipboard","clipboardData","clone","cloneContents","cloneNode","cloneRange","close","closePath","closed","closest","clz","clz32","cm","cmp","code","codeBase","codePointAt","codeType","colSpan","collapse","collapseToEnd","collapseToStart","collapsed","collect","colno","color","color-adjust","color-interpolation","color-interpolation-filters","colorAdjust","colorDepth","colorInterpolation","colorInterpolationFilters","colorMask","colorType","cols","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columnCount","columnFill","columnGap","columnNumber","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","command","commit","commitPreferences","commitStyles","commonAncestorContainer","compact","compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareExchange","compareNode","comparePoint","compatMode","compatible","compile","compileShader","compileStreaming","complete","component","componentFromPoint","composed","composedPath","composite","compositionEndOffset","compositionStartOffset","compressedTexImage2D","compressedTexImage3D","compressedTexSubImage2D","compressedTexSubImage3D","computedStyleMap","concat","conditionText","coneInnerAngle","coneOuterAngle","coneOuterGain","configuration","configurationName","configurationValue","configurations","confirm","confirmComposition","confirmSiteSpecificTrackingException","confirmWebWideTrackingException","connect","connectEnd","connectShark","connectStart","connected","connection","connectionList","connectionSpeed","connectionState","connections","console","consolidate","constraint","constrictionActive","construct","constructor","contactID","contain","containerId","containerName","containerSrc","containerType","contains","containsNode","content","contentBoxSize","contentDocument","contentEditable","contentHint","contentOverflow","contentRect","contentScriptType","contentStyleType","contentType","contentWindow","context","contextMenu","contextmenu","continue","continuePrimaryKey","continuous","control","controlTransferIn","controlTransferOut","controller","controls","controlsList","convertPointFromNode","convertQuadFromNode","convertRectFromNode","convertToBlob","convertToSpecifiedUnits","cookie","cookieEnabled","coords","copyBufferSubData","copyFromChannel","copyTexImage2D","copyTexSubImage2D","copyTexSubImage3D","copyToChannel","copyWithin","correspondingElement","correspondingUseElement","corruptedVideoFrames","cos","cosh","count","countReset","counter-increment","counter-reset","counter-set","counterIncrement","counterReset","counterSet","country","cpuClass","cpuSleepAllowed","create","createAnalyser","createAnswer","createAttribute","createAttributeNS","createBiquadFilter","createBuffer","createBufferSource","createCDATASection","createCSSStyleSheet","createCaption","createChannelMerger","createChannelSplitter","createComment","createConstantSource","createContextualFragment","createControlRange","createConvolver","createDTMFSender","createDataChannel","createDelay","createDelayNode","createDocument","createDocumentFragment","createDocumentType","createDynamicsCompressor","createElement","createElementNS","createEntityReference","createEvent","createEventObject","createExpression","createFramebuffer","createFunction","createGain","createGainNode","createHTML","createHTMLDocument","createIIRFilter","createImageBitmap","createImageData","createIndex","createJavaScriptNode","createLinearGradient","createMediaElementSource","createMediaKeys","createMediaStreamDestination","createMediaStreamSource","createMediaStreamTrackSource","createMutableFile","createNSResolver","createNodeIterator","createNotification","createObjectStore","createObjectURL","createOffer","createOscillator","createPanner","createPattern","createPeriodicWave","createPolicy","createPopup","createProcessingInstruction","createProgram","createQuery","createRadialGradient","createRange","createRangeCollection","createReader","createRenderbuffer","createSVGAngle","createSVGLength","createSVGMatrix","createSVGNumber","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegClosePath","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPoint","createSVGRect","createSVGTransform","createSVGTransformFromMatrix","createSampler","createScript","createScriptProcessor","createScriptURL","createSession","createShader","createShadowRoot","createStereoPanner","createStyleSheet","createTBody","createTFoot","createTHead","createTextNode","createTextRange","createTexture","createTouch","createTouchList","createTransformFeedback","createTreeWalker","createVertexArray","createWaveShaper","creationTime","credentials","crossOrigin","crossOriginIsolated","crypto","csi","csp","cssFloat","cssRules","cssText","cssValueType","ctrlKey","ctrlLeft","cues","cullFace","currentDirection","currentLocalDescription","currentNode","currentPage","currentRect","currentRemoteDescription","currentScale","currentScript","currentSrc","currentState","currentStyle","currentTarget","currentTime","currentTranslate","currentView","cursor","curve","customElements","customError","cx","cy","d","data","dataFld","dataFormatAs","dataLoss","dataLossMessage","dataPageSize","dataSrc","dataTransfer","database","databases","dataset","dateTime","db","debug","debuggerEnabled","declare","decode","decodeAudioData","decodeURI","decodeURIComponent","decodedBodySize","decoding","decodingInfo","decrypt","default","defaultCharset","defaultChecked","defaultMuted","defaultPlaybackRate","defaultPolicy","defaultPrevented","defaultRequest","defaultSelected","defaultStatus","defaultURL","defaultValue","defaultView","defaultstatus","defer","define","defineMagicFunction","defineMagicVariable","defineProperties","defineProperty","deg","delay","delayTime","delegatesFocus","delete","deleteBuffer","deleteCaption","deleteCell","deleteContents","deleteData","deleteDatabase","deleteFramebuffer","deleteFromDocument","deleteIndex","deleteMedium","deleteObjectStore","deleteProgram","deleteProperty","deleteQuery","deleteRenderbuffer","deleteRow","deleteRule","deleteSampler","deleteShader","deleteSync","deleteTFoot","deleteTHead","deleteTexture","deleteTransformFeedback","deleteVertexArray","deliverChangeRecords","delivery","deliveryInfo","deliveryStatus","deliveryTimestamp","delta","deltaMode","deltaX","deltaY","deltaZ","dependentLocality","depthFar","depthFunc","depthMask","depthNear","depthRange","deref","deriveBits","deriveKey","description","deselectAll","designMode","desiredSize","destination","destinationURL","detach","detachEvent","detachShader","detail","details","detect","detune","device","deviceClass","deviceId","deviceMemory","devicePixelContentBoxSize","devicePixelRatio","deviceProtocol","deviceSubclass","deviceVersionMajor","deviceVersionMinor","deviceVersionSubminor","deviceXDPI","deviceYDPI","didTimeout","diffuseConstant","digest","dimensions","dir","dirName","direction","dirxml","disable","disablePictureInPicture","disableRemotePlayback","disableVertexAttribArray","disabled","dischargingTime","disconnect","disconnectShark","dispatchEvent","display","displayId","displayName","disposition","distanceModel","div","divisor","djsapi","djsproxy","doImport","doNotTrack","doScroll","doctype","document","documentElement","documentMode","documentURI","dolphin","dolphinGameCenter","dolphininfo","dolphinmeta","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domOverlayState","domain","domainLookupEnd","domainLookupStart","dominant-baseline","dominantBaseline","done","dopplerFactor","dotAll","downDegrees","downlink","download","downloadTotal","downloaded","dpcm","dpi","dppx","dragDrop","draggable","drawArrays","drawArraysInstanced","drawArraysInstancedANGLE","drawBuffers","drawCustomFocusRing","drawElements","drawElementsInstanced","drawElementsInstancedANGLE","drawFocusIfNeeded","drawImage","drawImageFromRect","drawRangeElements","drawSystemFocusRing","drawingBufferHeight","drawingBufferWidth","dropEffect","droppedVideoFrames","dropzone","dtmf","dump","dumpProfile","duplicate","durability","duration","dvname","dvnum","dx","dy","dynsrc","e","edgeMode","effect","effectAllowed","effectiveDirective","effectiveType","elapsedTime","element","elementFromPoint","elementTiming","elements","elementsFromPoint","elevation","ellipse","em","email","embeds","emma","empty","empty-cells","emptyCells","emptyHTML","emptyScript","emulatedPosition","enable","enableBackground","enableDelegations","enableStyleSheetsForSet","enableVertexAttribArray","enabled","enabledPlugin","encode","encodeInto","encodeURI","encodeURIComponent","encodedBodySize","encoding","encodingInfo","encrypt","enctype","end","endContainer","endElement","endElementAt","endOfStream","endOffset","endQuery","endTime","endTransformFeedback","ended","endpoint","endpointNumber","endpoints","endsWith","enterKeyHint","entities","entries","entryType","enumerate","enumerateDevices","enumerateEditable","environmentBlendMode","equals","error","errorCode","errorDetail","errorText","escape","estimate","eval","evaluate","event","eventPhase","every","ex","exception","exchange","exec","execCommand","execCommandShowHelp","execScript","exitFullscreen","exitPictureInPicture","exitPointerLock","exitPresent","exp","expand","expandEntityReferences","expando","expansion","expiration","expirationTime","expires","expiryDate","explicitOriginalTarget","expm1","exponent","exponentialRampToValueAtTime","exportKey","exports","extend","extensions","extentNode","extentOffset","external","externalResourcesRequired","extractContents","extractable","eye","f","face","factoryReset","failureReason","fallback","family","familyName","farthestViewportElement","fastSeek","fatal","featureId","featurePolicy","featureSettings","features","fenceSync","fetch","fetchStart","fftSize","fgColor","fieldOfView","file","fileCreatedDate","fileHandle","fileModifiedDate","fileName","fileSize","fileUpdatedDate","filename","files","filesystem","fill","fill-opacity","fill-rule","fillLightMode","fillOpacity","fillRect","fillRule","fillStyle","fillText","filter","filterResX","filterResY","filterUnits","filters","finally","find","findIndex","findRule","findText","finish","finished","fireEvent","firesTouchEvents","firstChild","firstElementChild","firstPage","fixed","flags","flat","flatMap","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","flipX","flipY","float","float32","float64","flood-color","flood-opacity","floodColor","floodOpacity","floor","flush","focus","focusNode","focusOffset","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontOpticalSizing","fontSize","fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","fontcolor","fontfaces","fonts","fontsize","for","forEach","force","forceRedraw","form","formAction","formData","formEnctype","formMethod","formNoValidate","formTarget","format","formatToParts","forms","forward","forwardX","forwardY","forwardZ","foundation","fr","fragmentDirective","frame","frameBorder","frameElement","frameSpacing","framebuffer","framebufferHeight","framebufferRenderbuffer","framebufferTexture2D","framebufferTextureLayer","framebufferWidth","frames","freeSpace","freeze","frequency","frequencyBinCount","from","fromCharCode","fromCodePoint","fromElement","fromEntries","fromFloat32Array","fromFloat64Array","fromMatrix","fromPoint","fromQuad","fromRect","frontFace","fround","fullPath","fullScreen","fullVersionList","fullscreen","fullscreenElement","fullscreenEnabled","fx","fy","gain","gamepad","gamma","gap","gatheringState","gatt","genderIdentity","generateCertificate","generateKey","generateMipmap","generateRequest","geolocation","gestureObject","get","getActiveAttrib","getActiveUniform","getActiveUniformBlockName","getActiveUniformBlockParameter","getActiveUniforms","getAdjacentText","getAll","getAllKeys","getAllResponseHeaders","getAllowlistForFeature","getAnimations","getAsFile","getAsString","getAttachedShaders","getAttribLocation","getAttribute","getAttributeNS","getAttributeNames","getAttributeNode","getAttributeNodeNS","getAttributeType","getAudioTracks","getAvailability","getBBox","getBattery","getBigInt64","getBigUint64","getBlob","getBookmark","getBoundingClientRect","getBounds","getBoxQuads","getBufferParameter","getBufferSubData","getByteFrequencyData","getByteTimeDomainData","getCSSCanvasContext","getCTM","getCandidateWindowClientRect","getCanonicalLocales","getCapabilities","getChannelData","getCharNumAtPosition","getCharacteristic","getCharacteristics","getClientExtensionResults","getClientRect","getClientRects","getCoalescedEvents","getCompositionAlternatives","getComputedStyle","getComputedTextLength","getComputedTiming","getConfiguration","getConstraints","getContext","getContextAttributes","getContributingSources","getCounterValue","getCueAsHTML","getCueById","getCurrentPosition","getCurrentTime","getData","getDatabaseNames","getDate","getDay","getDefaultComputedStyle","getDescriptor","getDescriptors","getDestinationInsertionPoints","getDevices","getDirectory","getDisplayMedia","getDistributedNodes","getEditable","getElementById","getElementsByClassName","getElementsByName","getElementsByTagName","getElementsByTagNameNS","getEnclosureList","getEndPositionOfChar","getEntries","getEntriesByName","getEntriesByType","getError","getExtension","getExtentOfChar","getEyeParameters","getFeature","getFile","getFiles","getFilesAndDirectories","getFingerprints","getFloat32","getFloat64","getFloatFrequencyData","getFloatTimeDomainData","getFloatValue","getFragDataLocation","getFrameData","getFramebufferAttachmentParameter","getFrequencyResponse","getFullYear","getGamepads","getHighEntropyValues","getHitTestResults","getHitTestResultsForTransientInput","getHours","getIdentityAssertion","getIds","getImageData","getIndexedParameter","getInstalledRelatedApps","getInt16","getInt32","getInt8","getInternalformatParameter","getIntersectionList","getItem","getItems","getKey","getKeyframes","getLayers","getLayoutMap","getLineDash","getLocalCandidates","getLocalParameters","getLocalStreams","getMarks","getMatchedCSSRules","getMaxGCPauseSinceClear","getMeasures","getMetadata","getMilliseconds","getMinutes","getModifierState","getMonth","getNamedItem","getNamedItemNS","getNativeFramebufferScaleFactor","getNotifications","getNotifier","getNumberOfChars","getOffsetReferenceSpace","getOutputTimestamp","getOverrideHistoryNavigationMode","getOverrideStyle","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getParameter","getParameters","getParent","getPathSegAtLength","getPhotoCapabilities","getPhotoSettings","getPointAtLength","getPose","getPredictedEvents","getPreference","getPreferenceDefault","getPresentationAttribute","getPreventDefault","getPrimaryService","getPrimaryServices","getProgramInfoLog","getProgramParameter","getPropertyCSSValue","getPropertyPriority","getPropertyShorthand","getPropertyType","getPropertyValue","getPrototypeOf","getQuery","getQueryParameter","getRGBColorValue","getRandomValues","getRangeAt","getReader","getReceivers","getRectValue","getRegistration","getRegistrations","getRemoteCandidates","getRemoteCertificates","getRemoteParameters","getRemoteStreams","getRenderbufferParameter","getResponseHeader","getRoot","getRootNode","getRotationOfChar","getSVGDocument","getSamplerParameter","getScreenCTM","getSeconds","getSelectedCandidatePair","getSelection","getSenders","getService","getSettings","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSimpleDuration","getSiteIcons","getSources","getSpeculativeParserUrls","getStartPositionOfChar","getStartTime","getState","getStats","getStatusForPolicy","getStorageUpdates","getStreamById","getStringValue","getSubStringLength","getSubscription","getSupportedConstraints","getSupportedExtensions","getSupportedFormats","getSyncParameter","getSynchronizationSources","getTags","getTargetRanges","getTexParameter","getTime","getTimezoneOffset","getTiming","getTotalLength","getTrackById","getTracks","getTransceivers","getTransform","getTransformFeedbackVarying","getTransformToElement","getTransports","getType","getTypeMapping","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getUint16","getUint32","getUint8","getUniform","getUniformBlockIndex","getUniformIndices","getUniformLocation","getUserMedia","getVRDisplays","getValues","getVarDate","getVariableValue","getVertexAttrib","getVertexAttribOffset","getVideoPlaybackQuality","getVideoTracks","getViewerPose","getViewport","getVoices","getWakeLockState","getWriter","getYear","givenName","global","globalAlpha","globalCompositeOperation","globalThis","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","go","grabFrame","grad","gradientTransform","gradientUnits","grammars","green","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gripSpace","group","groupCollapsed","groupEnd","groupId","hadRecentInput","hand","handedness","hapticActuators","hardwareConcurrency","has","hasAttribute","hasAttributeNS","hasAttributes","hasBeenActive","hasChildNodes","hasComposition","hasEnrolledInstrument","hasExtension","hasExternalDisplay","hasFeature","hasFocus","hasInstance","hasLayout","hasOrientation","hasOwnProperty","hasPointerCapture","hasPosition","hasReading","hasStorageAccess","hash","head","headers","heading","height","hidden","hide","hideFocus","high","highWaterMark","hint","history","honorificPrefix","honorificSuffix","horizontalOverflow","host","hostCandidate","hostname","href","hrefTranslate","hreflang","hspace","html5TagCheckInerface","htmlFor","htmlText","httpEquiv","httpRequestStatusCode","hwTimestamp","hyphens","hypot","iccId","iceConnectionState","iceGatheringState","iceTransport","icon","iconURL","id","identifier","identity","idpLoginUrl","ignoreBOM","ignoreCase","ignoreDepthValues","image-orientation","image-rendering","imageHeight","imageOrientation","imageRendering","imageSizes","imageSmoothingEnabled","imageSmoothingQuality","imageSrcset","imageWidth","images","ime-mode","imeMode","implementation","importKey","importNode","importStylesheet","imports","impp","imul","in","in1","in2","inBandMetadataTrackDispatchType","inRange","includes","incremental","indeterminate","index","indexNames","indexOf","indexedDB","indicate","inertiaDestinationX","inertiaDestinationY","info","init","initAnimationEvent","initBeforeLoadEvent","initClipboardEvent","initCloseEvent","initCommandEvent","initCompositionEvent","initCustomEvent","initData","initDataType","initDeviceMotionEvent","initDeviceOrientationEvent","initDragEvent","initErrorEvent","initEvent","initFocusEvent","initGestureEvent","initHashChangeEvent","initKeyEvent","initKeyboardEvent","initMSManipulationEvent","initMessageEvent","initMouseEvent","initMouseScrollEvent","initMouseWheelEvent","initMutationEvent","initNSMouseEvent","initOverflowEvent","initPageEvent","initPageTransitionEvent","initPointerEvent","initPopStateEvent","initProgressEvent","initScrollAreaEvent","initSimpleGestureEvent","initStorageEvent","initTextEvent","initTimeEvent","initTouchEvent","initTransitionEvent","initUIEvent","initWebKitAnimationEvent","initWebKitTransitionEvent","initWebKitWheelEvent","initWheelEvent","initialTime","initialize","initiatorType","inline-size","inlineSize","inlineVerticalFieldOfView","inner","innerHTML","innerHeight","innerText","innerWidth","input","inputBuffer","inputEncoding","inputMethod","inputMode","inputSource","inputSources","inputType","inputs","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertDTMF","insertData","insertItemBefore","insertNode","insertRow","insertRule","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","installing","instanceRoot","instantiate","instantiateStreaming","instruments","int16","int32","int8","integrity","interactionMode","intercept","interfaceClass","interfaceName","interfaceNumber","interfaceProtocol","interfaceSubclass","interfaces","interimResults","internalSubset","interpretation","intersectionRatio","intersectionRect","intersectsNode","interval","invalidIteratorState","invalidateFramebuffer","invalidateSubFramebuffer","inverse","invertSelf","is","is2D","isActive","isAlternate","isArray","isBingCurrentSearchDefault","isBuffer","isCandidateWindowVisible","isChar","isCollapsed","isComposing","isConcatSpreadable","isConnected","isContentEditable","isContentHandlerRegistered","isContextLost","isDefaultNamespace","isDirectory","isDisabled","isEnabled","isEqual","isEqualNode","isExtensible","isExternalCTAP2SecurityKeySupported","isFile","isFinite","isFramebuffer","isFrozen","isGenerator","isHTML","isHistoryNavigation","isId","isIdentity","isInjected","isInteger","isIntersecting","isLockFree","isMap","isMultiLine","isNaN","isOpen","isPointInFill","isPointInPath","isPointInRange","isPointInStroke","isPrefAlternate","isPresenting","isPrimary","isProgram","isPropertyImplicit","isProtocolHandlerRegistered","isPrototypeOf","isQuery","isRenderbuffer","isSafeInteger","isSameNode","isSampler","isScript","isScriptURL","isSealed","isSecureContext","isSessionSupported","isShader","isSupported","isSync","isTextEdit","isTexture","isTransformFeedback","isTrusted","isTypeSupported","isUserVerifyingPlatformAuthenticatorAvailable","isVertexArray","isView","isVisible","isochronousTransferIn","isochronousTransferOut","isolation","italics","item","itemId","itemProp","itemRef","itemScope","itemType","itemValue","items","iterateNext","iterationComposite","iterator","javaEnabled","jobTitle","join","json","justify-content","justify-items","justify-self","justifyContent","justifyItems","justifySelf","k1","k2","k3","k4","kHz","keepalive","kernelMatrix","kernelUnitLengthX","kernelUnitLengthY","kerning","key","keyCode","keyFor","keyIdentifier","keyLightEnabled","keyLocation","keyPath","keyStatuses","keySystem","keyText","keyUsage","keyboard","keys","keytype","kind","knee","label","labels","lang","language","languages","largeArcFlag","lastChild","lastElementChild","lastEventId","lastIndex","lastIndexOf","lastInputTime","lastMatch","lastMessageSubject","lastMessageType","lastModified","lastModifiedDate","lastPage","lastParen","lastState","lastStyleSheetSet","latitude","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar","layoutGridLine","layoutGridMode","layoutGridType","lbound","left","leftContext","leftDegrees","leftMargin","leftProjectionMatrix","leftViewMatrix","length","lengthAdjust","lengthComputable","letter-spacing","letterSpacing","level","lighting-color","lightingColor","limitingConeAngle","line","line-break","line-height","lineAlign","lineBreak","lineCap","lineDashOffset","lineHeight","lineJoin","lineNumber","lineTo","lineWidth","linearAcceleration","linearRampToValueAtTime","linearVelocity","lineno","lines","link","linkColor","linkProgram","links","list","list-style","list-style-image","list-style-position","list-style-type","listStyle","listStyleImage","listStylePosition","listStyleType","listener","load","loadEventEnd","loadEventStart","loadTime","loadTimes","loaded","loading","localDescription","localName","localService","localStorage","locale","localeCompare","location","locationbar","lock","locked","lockedFile","locks","log","log10","log1p","log2","logicalXDPI","logicalYDPI","longDesc","longitude","lookupNamespaceURI","lookupPrefix","loop","loopEnd","loopStart","looping","low","lower","lowerBound","lowerOpen","lowsrc","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","makeXRCompatible","manifest","manufacturer","manufacturerName","map","mapping","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginHeight","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marginWidth","mark","marker","marker-end","marker-mid","marker-offset","marker-start","markerEnd","markerHeight","markerMid","markerOffset","markerStart","markerUnits","markerWidth","marks","mask","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-position-x","mask-position-y","mask-repeat","mask-size","mask-type","maskClip","maskComposite","maskContentUnits","maskImage","maskMode","maskOrigin","maskPosition","maskPositionX","maskPositionY","maskRepeat","maskSize","maskType","maskUnits","match","matchAll","matchMedia","matchMedium","matches","matrix","matrixTransform","max","max-block-size","max-height","max-inline-size","max-width","maxActions","maxAlternatives","maxBlockSize","maxChannelCount","maxChannels","maxConnectionsPerServer","maxDecibels","maxDistance","maxHeight","maxInlineSize","maxLayers","maxLength","maxMessageSize","maxPacketLifeTime","maxRetransmits","maxTouchPoints","maxValue","maxWidth","measure","measureText","media","mediaCapabilities","mediaDevices","mediaElement","mediaGroup","mediaKeys","mediaSession","mediaStream","mediaText","meetOrSlice","memory","menubar","mergeAttributes","message","messageClass","messageHandlers","messageType","metaKey","metadata","method","methodDetails","methodName","mid","mimeType","mimeTypes","min","min-block-size","min-height","min-inline-size","min-width","minBlockSize","minDecibels","minHeight","minInlineSize","minLength","minValue","minWidth","miterLimit","mix-blend-mode","mixBlendMode","mm","mobile","mode","model","modify","mount","move","moveBy","moveEnd","moveFirst","moveFocusDown","moveFocusLeft","moveFocusRight","moveFocusUp","moveNext","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint","movementX","movementY","mozAdd","mozAnimationStartTime","mozAnon","mozApps","mozAudioCaptured","mozAudioChannelType","mozAutoplayEnabled","mozCancelAnimationFrame","mozCancelFullScreen","mozCancelRequestAnimationFrame","mozCaptureStream","mozCaptureStreamUntilEnded","mozClearDataAt","mozContact","mozContacts","mozCreateFileHandle","mozCurrentTransform","mozCurrentTransformInverse","mozCursor","mozDash","mozDashOffset","mozDecodedFrames","mozExitPointerLock","mozFillRule","mozFragmentEnd","mozFrameDelay","mozFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozGetAll","mozGetAllKeys","mozGetAsFile","mozGetDataAt","mozGetMetadata","mozGetUserMedia","mozHasAudio","mozHasItem","mozHidden","mozImageSmoothingEnabled","mozIndexedDB","mozInnerScreenX","mozInnerScreenY","mozInputSource","mozIsTextField","mozItem","mozItemCount","mozItems","mozLength","mozLockOrientation","mozMatchesSelector","mozMovementX","mozMovementY","mozOpaque","mozOrientation","mozPaintCount","mozPaintedFrames","mozParsedFrames","mozPay","mozPointerLockElement","mozPresentedFrames","mozPreservesPitch","mozPressure","mozPrintCallback","mozRTCIceCandidate","mozRTCPeerConnection","mozRTCSessionDescription","mozRemove","mozRequestAnimationFrame","mozRequestFullScreen","mozRequestPointerLock","mozSetDataAt","mozSetImageElement","mozSourceNode","mozSrcObject","mozSystem","mozTCPSocket","mozTextStyle","mozTypesAt","mozUnlockOrientation","mozUserCancelled","mozVisibilityState","ms","msAnimation","msAnimationDelay","msAnimationDirection","msAnimationDuration","msAnimationFillMode","msAnimationIterationCount","msAnimationName","msAnimationPlayState","msAnimationStartTime","msAnimationTimingFunction","msBackfaceVisibility","msBlockProgression","msCSSOMElementFloatMetrics","msCaching","msCachingEnabled","msCancelRequestAnimationFrame","msCapsLockWarningOff","msClearImmediate","msClose","msContentZoomChaining","msContentZoomFactor","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msConvertURL","msCrypto","msDoNotTrack","msElementsFromPoint","msElementsFromRect","msExitFullscreen","msExtendedCode","msFillRule","msFirstPaint","msFlex","msFlexAlign","msFlexDirection","msFlexFlow","msFlexItemAlign","msFlexLinePack","msFlexNegative","msFlexOrder","msFlexPack","msFlexPositive","msFlexPreferredSize","msFlexWrap","msFlowFrom","msFlowInto","msFontFeatureSettings","msFullscreenElement","msFullscreenEnabled","msGetInputContext","msGetRegionContent","msGetUntransformedBounds","msGraphicsTrustStatus","msGridColumn","msGridColumnAlign","msGridColumnSpan","msGridColumns","msGridRow","msGridRowAlign","msGridRowSpan","msGridRows","msHidden","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImageSmoothingEnabled","msImeAlign","msIndexedDB","msInterpolationMode","msIsStaticHTML","msKeySystem","msKeys","msLaunchUri","msLockOrientation","msManipulationViewsEnabled","msMatchMedia","msMatchesSelector","msMaxTouchPoints","msOrientation","msOverflowStyle","msPerspective","msPerspectiveOrigin","msPlayToDisabled","msPlayToPreferredSourceUri","msPlayToPrimary","msPointerEnabled","msRegionOverflow","msReleasePointerCapture","msRequestAnimationFrame","msRequestFullscreen","msSaveBlob","msSaveOrOpenBlob","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msSetImmediate","msSetMediaKeys","msSetPointerCapture","msTextCombineHorizontal","msTextSizeAdjust","msToBlob","msTouchAction","msTouchSelect","msTraceAsyncCallbackCompleted","msTraceAsyncCallbackStarting","msTraceAsyncOperationCompleted","msTraceAsyncOperationStarting","msTransform","msTransformOrigin","msTransformStyle","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUnlockOrientation","msUpdateAsyncCallbackRelation","msUserSelect","msVisibilityState","msWrapFlow","msWrapMargin","msWrapThrough","msWriteProfilerMark","msZoom","msZoomTo","mt","mul","multiEntry","multiSelectionObj","multiline","multiple","multiply","multiplySelf","mutableFile","muted","n","name","nameProp","namedItem","namedRecordset","names","namespaceURI","namespaces","naturalHeight","naturalWidth","navigate","navigation","navigationMode","navigationPreload","navigationStart","navigator","near","nearestViewportElement","negative","negotiated","netscape","networkState","newScale","newTranslate","newURL","newValue","newValueSpecifiedUnits","newVersion","newhome","next","nextElementSibling","nextHopProtocol","nextNode","nextPage","nextSibling","nickname","noHref","noModule","noResize","noShade","noValidate","noWrap","node","nodeName","nodeType","nodeValue","nonce","normalize","normalizedPathSegList","notationName","notations","note","noteGrainOn","noteOff","noteOn","notify","now","numOctaves","number","numberOfChannels","numberOfInputs","numberOfItems","numberOfOutputs","numberValue","oMatchesSelector","object","object-fit","object-position","objectFit","objectPosition","objectStore","objectStoreNames","objectType","observe","of","offscreenBuffering","offset","offset-anchor","offset-distance","offset-path","offset-rotate","offsetAnchor","offsetDistance","offsetHeight","offsetLeft","offsetNode","offsetParent","offsetPath","offsetRotate","offsetTop","offsetWidth","offsetX","offsetY","ok","oldURL","oldValue","oldVersion","olderShadowRoot","onLine","onabort","onabsolutedeviceorientation","onactivate","onactive","onaddsourcebuffer","onaddstream","onaddtrack","onafterprint","onafterscriptexecute","onafterupdate","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onappinstalled","onaudioend","onaudioprocess","onaudiostart","onautocomplete","onautocompleteerror","onauxclick","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus","onbeforeinstallprompt","onbeforepaste","onbeforeprint","onbeforescriptexecute","onbeforeunload","onbeforeupdate","onbeforexrselect","onbegin","onblocked","onblur","onbounce","onboundary","onbufferedamountlow","oncached","oncancel","oncandidatewindowhide","oncandidatewindowshow","oncandidatewindowupdate","oncanplay","oncanplaythrough","once","oncellchange","onchange","oncharacteristicvaluechanged","onchargingchange","onchargingtimechange","onchecking","onclick","onclose","onclosing","oncompassneedscalibration","oncomplete","onconnect","onconnecting","onconnectionavailable","onconnectionstatechange","oncontextmenu","oncontrollerchange","oncontrolselect","oncopy","oncuechange","oncut","ondataavailable","ondatachannel","ondatasetchanged","ondatasetcomplete","ondblclick","ondeactivate","ondevicechange","ondevicelight","ondevicemotion","ondeviceorientation","ondeviceorientationabsolute","ondeviceproximity","ondischargingtimechange","ondisconnect","ondisplay","ondownloading","ondrag","ondragend","ondragenter","ondragexit","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onenter","onenterpictureinpicture","onerror","onerrorupdate","onexit","onfilterchange","onfinish","onfocus","onfocusin","onfocusout","onformdata","onfreeze","onfullscreenchange","onfullscreenerror","ongatheringstatechange","ongattserverdisconnected","ongesturechange","ongestureend","ongesturestart","ongotpointercapture","onhashchange","onhelp","onicecandidate","onicecandidateerror","oniceconnectionstatechange","onicegatheringstatechange","oninactive","oninput","oninputsourceschange","oninvalid","onkeydown","onkeypress","onkeystatuseschange","onkeyup","onlanguagechange","onlayoutcomplete","onleavepictureinpicture","onlevelchange","onload","onloadeddata","onloadedmetadata","onloadend","onloading","onloadingdone","onloadingerror","onloadstart","onlosecapture","onlostpointercapture","only","onmark","onmessage","onmessageerror","onmidimessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend","onmovestart","onmozfullscreenchange","onmozfullscreenerror","onmozorientationchange","onmozpointerlockchange","onmozpointerlockerror","onmscontentzoom","onmsfullscreenchange","onmsfullscreenerror","onmsgesturechange","onmsgesturedoubletap","onmsgestureend","onmsgesturehold","onmsgesturestart","onmsgesturetap","onmsgotpointercapture","onmsinertiastart","onmslostpointercapture","onmsmanipulationstatechanged","onmsneedkey","onmsorientationchange","onmspointercancel","onmspointerdown","onmspointerenter","onmspointerhover","onmspointerleave","onmspointermove","onmspointerout","onmspointerover","onmspointerup","onmssitemodejumplistitemremoved","onmsthumbnailclick","onmute","onnegotiationneeded","onnomatch","onnoupdate","onobsolete","onoffline","ononline","onopen","onorientationchange","onpagechange","onpagehide","onpageshow","onpaste","onpause","onpayerdetailchange","onpaymentmethodchange","onplay","onplaying","onpluginstreamstart","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerrawupdate","onpointerup","onpopstate","onprocessorerror","onprogress","onpropertychange","onratechange","onreading","onreadystatechange","onrejectionhandled","onrelease","onremove","onremovesourcebuffer","onremovestream","onremovetrack","onrepeat","onreset","onresize","onresizeend","onresizestart","onresourcetimingbufferfull","onresult","onresume","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onsearch","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectedcandidatepairchange","onselectend","onselectionchange","onselectstart","onshippingaddresschange","onshippingoptionchange","onshow","onsignalingstatechange","onsoundend","onsoundstart","onsourceclose","onsourceclosed","onsourceended","onsourceopen","onspeechend","onspeechstart","onsqueeze","onsqueezeend","onsqueezestart","onstalled","onstart","onstatechange","onstop","onstorage","onstoragecommit","onsubmit","onsuccess","onsuspend","onterminate","ontextinput","ontimeout","ontimeupdate","ontoggle","ontonechange","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontrack","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onunhandledrejection","onunload","onunmute","onupdate","onupdateend","onupdatefound","onupdateready","onupdatestart","onupgradeneeded","onuserproximity","onversionchange","onvisibilitychange","onvoiceschanged","onvolumechange","onvrdisplayactivate","onvrdisplayconnect","onvrdisplaydeactivate","onvrdisplaydisconnect","onvrdisplaypresentchange","onwaiting","onwaitingforkey","onwarning","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkitcurrentplaybacktargetiswirelesschanged","onwebkitfullscreenchange","onwebkitfullscreenerror","onwebkitkeyadded","onwebkitkeyerror","onwebkitkeymessage","onwebkitneedkey","onwebkitorientationchange","onwebkitplaybacktargetavailabilitychanged","onwebkitpointerlockchange","onwebkitpointerlockerror","onwebkitresourcetimingbufferfull","onwebkittransitionend","onwheel","onzoom","opacity","open","openCursor","openDatabase","openKeyCursor","opened","opener","opera","operationType","operator","opr","optimum","options","or","order","orderX","orderY","ordered","org","organization","orient","orientAngle","orientType","orientation","orientationX","orientationY","orientationZ","origin","originalPolicy","originalTarget","orphans","oscpu","outerHTML","outerHeight","outerText","outerWidth","outline","outline-color","outline-offset","outline-style","outline-width","outlineColor","outlineOffset","outlineStyle","outlineWidth","outputBuffer","outputChannelCount","outputLatency","outputs","overflow","overflow-anchor","overflow-block","overflow-inline","overflow-wrap","overflow-x","overflow-y","overflowAnchor","overflowBlock","overflowInline","overflowWrap","overflowX","overflowY","overrideMimeType","oversample","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","ownKeys","ownerDocument","ownerElement","ownerNode","ownerRule","ownerSVGElement","owningElement","p1","p2","p3","p4","packetSize","packets","pad","padEnd","padStart","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","page-break-after","page-break-before","page-break-inside","pageBreakAfter","pageBreakBefore","pageBreakInside","pageCount","pageLeft","pageTop","pageX","pageXOffset","pageY","pageYOffset","pages","paint-order","paintOrder","paintRequests","paintType","paintWorklet","palette","pan","panningModel","parameterData","parameters","parent","parentElement","parentNode","parentRule","parentStyleSheet","parentTextEdit","parentWindow","parse","parseAll","parseFloat","parseFromString","parseInt","part","participants","passive","password","pasteHTML","path","pathLength","pathSegList","pathSegType","pathSegTypeAsLetter","pathname","pattern","patternContentUnits","patternMismatch","patternTransform","patternUnits","pause","pauseAnimations","pauseOnExit","pauseProfilers","pauseTransformFeedback","paused","payerEmail","payerName","payerPhone","paymentManager","pc","peerIdentity","pending","pendingLocalDescription","pendingRemoteDescription","percent","performance","periodicSync","permission","permissionState","permissions","persist","persisted","personalbar","perspective","perspective-origin","perspectiveOrigin","phone","phoneticFamilyName","phoneticGivenName","photo","pictureInPictureElement","pictureInPictureEnabled","pictureInPictureWindow","ping","pipeThrough","pipeTo","pitch","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelStorei","pixelTop","pixelUnitToMillimeterX","pixelUnitToMillimeterY","pixelWidth","place-content","place-items","place-self","placeContent","placeItems","placeSelf","placeholder","platformVersion","platform","platforms","play","playEffect","playState","playbackRate","playbackState","playbackTime","played","playoutDelayHint","playsInline","plugins","pluginspage","pname","pointer-events","pointerBeforeReferenceNode","pointerEnabled","pointerEvents","pointerId","pointerLockElement","pointerType","points","pointsAtX","pointsAtY","pointsAtZ","polygonOffset","pop","populateMatrix","popupWindowFeatures","popupWindowName","popupWindowURI","port","port1","port2","ports","posBottom","posHeight","posLeft","posRight","posTop","posWidth","pose","position","positionAlign","positionX","positionY","positionZ","postError","postMessage","postalCode","poster","pow","powerEfficient","powerOff","preMultiplySelf","precision","preferredStyleSheetSet","preferredStylesheetSet","prefix","preload","prepend","presentation","preserveAlpha","preserveAspectRatio","preserveAspectRatioString","pressed","pressure","prevValue","preventDefault","preventExtensions","preventSilentAccess","previousElementSibling","previousNode","previousPage","previousRect","previousScale","previousSibling","previousTranslate","primaryKey","primitiveType","primitiveUnits","principals","print","priority","privateKey","probablySupportsContext","process","processIceMessage","processingEnd","processingStart","processorOptions","product","productId","productName","productSub","profile","profileEnd","profiles","projectionMatrix","promise","prompt","properties","propertyIsEnumerable","propertyName","protocol","protocolLong","prototype","provider","pseudoClass","pseudoElement","pt","publicId","publicKey","published","pulse","push","pushManager","pushNotification","pushState","put","putImageData","px","quadraticCurveTo","qualifier","quaternion","query","queryCommandEnabled","queryCommandIndeterm","queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","querySelector","querySelectorAll","queueMicrotask","quote","quotes","r","r1","r2","race","rad","radiogroup","radiusX","radiusY","random","range","rangeCount","rangeMax","rangeMin","rangeOffset","rangeOverflow","rangeParent","rangeUnderflow","rate","ratio","raw","rawId","read","readAsArrayBuffer","readAsBinaryString","readAsBlob","readAsDataURL","readAsText","readBuffer","readEntries","readOnly","readPixels","readReportRequested","readText","readValue","readable","ready","readyState","reason","reboot","receivedAlert","receiver","receivers","recipient","reconnect","recordNumber","recordsAvailable","recordset","rect","red","redEyeReduction","redirect","redirectCount","redirectEnd","redirectStart","redirected","reduce","reduceRight","reduction","refDistance","refX","refY","referenceNode","referenceSpace","referrer","referrerPolicy","refresh","region","regionAnchorX","regionAnchorY","regionId","regions","register","registerContentHandler","registerElement","registerProperty","registerProtocolHandler","reject","rel","relList","relatedAddress","relatedNode","relatedPort","relatedTarget","release","releaseCapture","releaseEvents","releaseInterface","releaseLock","releasePointerCapture","releaseShaderCompiler","reliable","reliableWrite","reload","rem","remainingSpace","remote","remoteDescription","remove","removeAllRanges","removeAttribute","removeAttributeNS","removeAttributeNode","removeBehavior","removeChild","removeCue","removeEventListener","removeFilter","removeImport","removeItem","removeListener","removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRegion","removeRule","removeSiteSpecificTrackingException","removeSourceBuffer","removeStream","removeTrack","removeVariable","removeWakeLockListener","removeWebWideTrackingException","removed","removedNodes","renderHeight","renderState","renderTime","renderWidth","renderbufferStorage","renderbufferStorageMultisample","renderedBuffer","renderingMode","renotify","repeat","replace","replaceAdjacentText","replaceAll","replaceChild","replaceChildren","replaceData","replaceId","replaceItem","replaceNode","replaceState","replaceSync","replaceTrack","replaceWholeText","replaceWith","reportValidity","request","requestAnimationFrame","requestAutocomplete","requestData","requestDevice","requestFrame","requestFullscreen","requestHitTestSource","requestHitTestSourceForTransientInput","requestId","requestIdleCallback","requestMIDIAccess","requestMediaKeySystemAccess","requestPermission","requestPictureInPicture","requestPointerLock","requestPresent","requestReferenceSpace","requestSession","requestStart","requestStorageAccess","requestSubmit","requestVideoFrameCallback","requestingWindow","requireInteraction","required","requiredExtensions","requiredFeatures","reset","resetPose","resetTransform","resize","resizeBy","resizeTo","resolve","response","responseBody","responseEnd","responseReady","responseStart","responseText","responseType","responseURL","responseXML","restartIce","restore","result","resultIndex","resultType","results","resume","resumeProfilers","resumeTransformFeedback","retry","returnValue","rev","reverse","reversed","revocable","revokeObjectURL","rgbColor","right","rightContext","rightDegrees","rightMargin","rightProjectionMatrix","rightViewMatrix","role","rolloffFactor","root","rootBounds","rootElement","rootMargin","rotate","rotateAxisAngle","rotateAxisAngleSelf","rotateFromVector","rotateFromVectorSelf","rotateSelf","rotation","rotationAngle","rotationRate","round","row-gap","rowGap","rowIndex","rowSpan","rows","rtcpTransport","rtt","ruby-align","ruby-position","rubyAlign","rubyOverhang","rubyPosition","rules","runtime","runtimeStyle","rx","ry","s","safari","sample","sampleCoverage","sampleRate","samplerParameterf","samplerParameteri","sandbox","save","saveData","scale","scale3d","scale3dSelf","scaleNonUniform","scaleNonUniformSelf","scaleSelf","scheme","scissor","scope","scopeName","scoped","screen","screenBrightness","screenEnabled","screenLeft","screenPixelToMillimeterX","screenPixelToMillimeterY","screenTop","screenX","screenY","scriptURL","scripts","scroll","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","scrollAmount","scrollBehavior","scrollBy","scrollByLines","scrollByPages","scrollDelay","scrollHeight","scrollIntoView","scrollIntoViewIfNeeded","scrollLeft","scrollLeftMax","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollMaxX","scrollMaxY","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollRestoration","scrollSnapAlign","scrollSnapType","scrollTo","scrollTop","scrollTopMax","scrollWidth","scrollX","scrollY","scrollbar-color","scrollbar-width","scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarColor","scrollbarDarkShadowColor","scrollbarFaceColor","scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","scrollbarWidth","scrollbars","scrolling","scrollingElement","sctp","sctpCauseCode","sdp","sdpLineNumber","sdpMLineIndex","sdpMid","seal","search","searchBox","searchBoxJavaBridge_","searchParams","sectionRowIndex","secureConnectionStart","security","seed","seekToNextFrame","seekable","seeking","select","selectAllChildren","selectAlternateInterface","selectConfiguration","selectNode","selectNodeContents","selectNodes","selectSingleNode","selectSubString","selected","selectedIndex","selectedOptions","selectedStyleSheetSet","selectedStylesheetSet","selection","selectionDirection","selectionEnd","selectionStart","selector","selectorText","self","send","sendAsBinary","sendBeacon","sender","sentAlert","sentTimestamp","separator","serialNumber","serializeToString","serverTiming","service","serviceWorker","session","sessionId","sessionStorage","set","setActionHandler","setActive","setAlpha","setAppBadge","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setBaseAndExtent","setBigInt64","setBigUint64","setBingCurrentSearchDefault","setCapture","setCodecPreferences","setColor","setCompositeOperation","setConfiguration","setCurrentTime","setCustomValidity","setData","setDate","setDragImage","setEnd","setEndAfter","setEndBefore","setEndPoint","setFillColor","setFilterRes","setFloat32","setFloat64","setFloatValue","setFormValue","setFullYear","setHeaderValue","setHours","setIdentityProvider","setImmediate","setInt16","setInt32","setInt8","setInterval","setItem","setKeyframes","setLineCap","setLineDash","setLineJoin","setLineWidth","setLiveSeekableRange","setLocalDescription","setMatrix","setMatrixValue","setMediaKeys","setMilliseconds","setMinutes","setMiterLimit","setMonth","setNamedItem","setNamedItemNS","setNonUserCodeExceptions","setOrientToAngle","setOrientToAuto","setOrientation","setOverrideHistoryNavigationMode","setPaint","setParameter","setParameters","setPeriodicWave","setPointerCapture","setPosition","setPositionState","setPreference","setProperty","setPrototypeOf","setRGBColor","setRGBColorICCColor","setRadius","setRangeText","setRemoteDescription","setRequestHeader","setResizable","setResourceTimingBufferSize","setRotate","setScale","setSeconds","setSelectionRange","setServerCertificate","setShadow","setSinkId","setSkewX","setSkewY","setStart","setStartAfter","setStartBefore","setStdDeviation","setStreams","setStringValue","setStrokeColor","setSuggestResult","setTargetAtTime","setTargetValueAtTime","setTime","setTimeout","setTransform","setTranslate","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setUint16","setUint32","setUint8","setUri","setValidity","setValueAtTime","setValueCurveAtTime","setVariable","setVelocity","setVersion","setYear","settingName","settingValue","sex","shaderSource","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","shadowRoot","shape","shape-image-threshold","shape-margin","shape-outside","shape-rendering","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","sheet","shift","shiftKey","shiftLeft","shippingAddress","shippingOption","shippingType","show","showHelp","showModal","showModalDialog","showModelessDialog","showNotification","sidebar","sign","signal","signalingState","signature","silent","sin","singleNodeValue","sinh","sinkId","sittingToStandingTransform","size","sizeToContent","sizeX","sizeZ","sizes","skewX","skewXSelf","skewY","skewYSelf","slice","slope","slot","small","smil","smooth","smoothingTimeConstant","snapToLines","snapshotItem","snapshotLength","some","sort","sortingCode","source","sourceBuffer","sourceBuffers","sourceCapabilities","sourceFile","sourceIndex","sources","spacing","span","speak","speakAs","speaking","species","specified","specularConstant","specularExponent","speechSynthesis","speed","speedOfSound","spellcheck","splice","split","splitText","spreadMethod","sqrt","src","srcElement","srcFilter","srcObject","srcUrn","srcdoc","srclang","srcset","stack","stackTraceLimit","stacktrace","stageParameters","standalone","standby","start","startContainer","startIce","startMessages","startNotifications","startOffset","startProfiling","startRendering","startShark","startTime","startsWith","state","status","statusCode","statusMessage","statusText","statusbar","stdDeviationX","stdDeviationY","stencilFunc","stencilFuncSeparate","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","step","stepDown","stepMismatch","stepUp","sticky","stitchTiles","stop","stop-color","stop-opacity","stopColor","stopImmediatePropagation","stopNotifications","stopOpacity","stopProfiling","stopPropagation","stopShark","stopped","storage","storageArea","storageName","storageStatus","store","storeSiteSpecificTrackingException","storeWebWideTrackingException","stpVersion","stream","streams","stretch","strike","string","stringValue","stringify","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeRect","strokeStyle","strokeText","strokeWidth","style","styleFloat","styleMap","styleMedia","styleSheet","styleSheetSets","styleSheets","sub","subarray","subject","submit","submitFrame","submitter","subscribe","substr","substring","substringData","subtle","subtree","suffix","suffixes","summary","sup","supported","supportedContentEncodings","supportedEntryTypes","supports","supportsSession","surfaceScale","surroundContents","suspend","suspendRedraw","swapCache","swapNode","sweepFlag","symbols","sync","sysexEnabled","system","systemCode","systemId","systemLanguage","systemXDPI","systemYDPI","tBodies","tFoot","tHead","tabIndex","table","table-layout","tableLayout","tableValues","tag","tagName","tagUrn","tags","taintEnabled","takePhoto","takeRecords","tan","tangentialPressure","tanh","target","targetElement","targetRayMode","targetRaySpace","targetTouches","targetX","targetY","tcpType","tee","tel","terminate","test","texImage2D","texImage3D","texParameterf","texParameteri","texStorage2D","texStorage3D","texSubImage2D","texSubImage3D","text","text-align","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","textAlign","textAlignLast","textAnchor","textAutospace","textBaseline","textCombineUpright","textContent","textDecoration","textDecorationBlink","textDecorationColor","textDecorationLine","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textDecorationUnderline","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textJustify","textJustifyTrim","textKashida","textKashidaSpace","textLength","textOrientation","textOverflow","textRendering","textShadow","textTracks","textTransform","textUnderlineOffset","textUnderlinePosition","then","threadId","threshold","thresholds","tiltX","tiltY","time","timeEnd","timeLog","timeOrigin","timeRemaining","timeStamp","timecode","timeline","timelineTime","timeout","timestamp","timestampOffset","timing","title","to","toArray","toBlob","toDataURL","toDateString","toElement","toExponential","toFixed","toFloat32Array","toFloat64Array","toGMTString","toISOString","toJSON","toLocaleDateString","toLocaleFormat","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase","toMatrix","toMethod","toPrecision","toPrimitive","toSdp","toSource","toStaticHTML","toString","toStringTag","toSum","toTimeString","toUTCString","toUpperCase","toggle","toggleAttribute","toggleLongPressEnabled","tone","toneBuffer","tooLong","tooShort","toolbar","top","topMargin","total","totalFrameDelay","totalVideoFrames","touch-action","touchAction","touched","touches","trace","track","trackVisibility","transaction","transactions","transceiver","transferControlToOffscreen","transferFromImageBitmap","transferImageBitmap","transferIn","transferOut","transferSize","transferToImageBitmap","transform","transform-box","transform-origin","transform-style","transformBox","transformFeedbackVaryings","transformOrigin","transformPoint","transformString","transformStyle","transformToDocument","transformToFragment","transition","transition-delay","transition-duration","transition-property","transition-timing-function","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateSelf","translationX","translationY","transport","trim","trimEnd","trimLeft","trimRight","trimStart","trueSpeed","trunc","truncate","trustedTypes","turn","twist","type","typeDetail","typeMismatch","typeMustMatch","types","u2f","ubound","uint16","uint32","uint8","uint8Clamped","undefined","unescape","uneval","unicode","unicode-bidi","unicodeBidi","unicodeRange","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform1ui","uniform1uiv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform2ui","uniform2uiv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform3ui","uniform3uiv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniform4ui","uniform4uiv","uniformBlockBinding","uniformMatrix2fv","uniformMatrix2x3fv","uniformMatrix2x4fv","uniformMatrix3fv","uniformMatrix3x2fv","uniformMatrix3x4fv","uniformMatrix4fv","uniformMatrix4x2fv","uniformMatrix4x3fv","unique","uniqueID","uniqueNumber","unit","unitType","units","unloadEventEnd","unloadEventStart","unlock","unmount","unobserve","unpause","unpauseAnimations","unreadCount","unregister","unregisterContentHandler","unregisterProtocolHandler","unscopables","unselectable","unshift","unsubscribe","unsuspendRedraw","unsuspendRedrawAll","unwatch","unwrapKey","upDegrees","upX","upY","upZ","update","updateCommands","updateIce","updateInterval","updatePlaybackRate","updateRenderState","updateSettings","updateTiming","updateViaCache","updateWith","updated","updating","upgrade","upload","uploadTotal","uploaded","upper","upperBound","upperOpen","uri","url","urn","urns","usages","usb","usbVersionMajor","usbVersionMinor","usbVersionSubminor","useCurrentView","useMap","useProgram","usedSpace","user-select","userActivation","userAgent","userAgentData","userChoice","userHandle","userHint","userLanguage","userSelect","userVisibleOnly","username","usernameFragment","utterance","uuid","v8BreakIterator","vAlign","vLink","valid","validate","validateProgram","validationMessage","validity","value","valueAsDate","valueAsNumber","valueAsString","valueInSpecifiedUnits","valueMissing","valueOf","valueText","valueType","values","variable","variant","variationSettings","vector-effect","vectorEffect","velocityAngular","velocityExpansion","velocityX","velocityY","vendor","vendorId","vendorSub","verify","version","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribDivisor","vertexAttribDivisorANGLE","vertexAttribI4i","vertexAttribI4iv","vertexAttribI4ui","vertexAttribI4uiv","vertexAttribIPointer","vertexAttribPointer","vertical","vertical-align","verticalAlign","verticalOverflow","vh","vibrate","vibrationActuator","videoBitsPerSecond","videoHeight","videoTracks","videoWidth","view","viewBox","viewBoxString","viewTarget","viewTargetString","viewport","viewportAnchorX","viewportAnchorY","viewportElement","views","violatedDirective","visibility","visibilityState","visible","visualViewport","vlinkColor","vmax","vmin","voice","voiceURI","volume","vrml","vspace","vw","w","wait","waitSync","waiting","wake","wakeLock","wand","warn","wasClean","wasDiscarded","watch","watchAvailability","watchPosition","webdriver","webkitAddKey","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppearance","webkitAudioContext","webkitAudioDecodedByteCount","webkitAudioPannerNode","webkitBackfaceVisibility","webkitBackground","webkitBackgroundAttachment","webkitBackgroundClip","webkitBackgroundColor","webkitBackgroundImage","webkitBackgroundOrigin","webkitBackgroundPosition","webkitBackgroundPositionX","webkitBackgroundPositionY","webkitBackgroundRepeat","webkitBackgroundSize","webkitBackingStorePixelRatio","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderImage","webkitBorderImageOutset","webkitBorderImageRepeat","webkitBorderImageSlice","webkitBorderImageSource","webkitBorderImageWidth","webkitBorderRadius","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBoxAlign","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxShadow","webkitBoxSizing","webkitCancelAnimationFrame","webkitCancelFullScreen","webkitCancelKeyRequest","webkitCancelRequestAnimationFrame","webkitClearResourceTimings","webkitClosedCaptionsVisible","webkitConvertPointFromNodeToPage","webkitConvertPointFromPageToNode","webkitCreateShadowRoot","webkitCurrentFullScreenElement","webkitCurrentPlaybackTargetIsWireless","webkitDecodedFrameCount","webkitDirectionInvertedFromDevice","webkitDisplayingFullscreen","webkitDroppedFrameCount","webkitEnterFullScreen","webkitEnterFullscreen","webkitEntries","webkitExitFullScreen","webkitExitFullscreen","webkitExitPointerLock","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFullScreenKeyboardInputAllowed","webkitFullscreenElement","webkitFullscreenEnabled","webkitGenerateKeyRequest","webkitGetAsEntry","webkitGetDatabaseNames","webkitGetEntries","webkitGetEntriesByName","webkitGetEntriesByType","webkitGetFlowByName","webkitGetGamepads","webkitGetImageDataHD","webkitGetNamedFlows","webkitGetRegionFlowRanges","webkitGetUserMedia","webkitHasClosedCaptions","webkitHidden","webkitIDBCursor","webkitIDBDatabase","webkitIDBDatabaseError","webkitIDBDatabaseException","webkitIDBFactory","webkitIDBIndex","webkitIDBKeyRange","webkitIDBObjectStore","webkitIDBRequest","webkitIDBTransaction","webkitImageSmoothingEnabled","webkitIndexedDB","webkitInitMessageEvent","webkitIsFullScreen","webkitJustifyContent","webkitKeys","webkitLineClamp","webkitLineDashOffset","webkitLockOrientation","webkitMask","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMatchesSelector","webkitMediaStream","webkitNotifications","webkitOfflineAudioContext","webkitOrder","webkitOrientation","webkitPeerConnection00","webkitPersistentStorage","webkitPerspective","webkitPerspectiveOrigin","webkitPointerLockElement","webkitPostMessage","webkitPreservesPitch","webkitPutImageDataHD","webkitRTCPeerConnection","webkitRegionOverset","webkitRelativePath","webkitRequestAnimationFrame","webkitRequestFileSystem","webkitRequestFullScreen","webkitRequestFullscreen","webkitRequestPointerLock","webkitResolveLocalFileSystemURL","webkitSetMediaKeys","webkitSetResourceTimingBufferSize","webkitShadowRoot","webkitShowPlaybackTargetPicker","webkitSlice","webkitSpeechGrammar","webkitSpeechGrammarList","webkitSpeechRecognition","webkitSpeechRecognitionError","webkitSpeechRecognitionEvent","webkitStorageInfo","webkitSupportsFullscreen","webkitTemporaryStorage","webkitTextFillColor","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitURL","webkitUnlockOrientation","webkitUserSelect","webkitVideoDecodedByteCount","webkitVisibilityState","webkitWirelessVideoPlaybackDisabled","webkitdirectory","webkitdropzone","webstore","weight","whatToShow","wheelDelta","wheelDeltaX","wheelDeltaY","whenDefined","which","white-space","whiteSpace","wholeText","widows","width","will-change","willChange","willValidate","window","withCredentials","word-break","word-spacing","word-wrap","wordBreak","wordSpacing","wordWrap","workerStart","wow64","wrap","wrapKey","writable","writableAuxiliaries","write","writeText","writeValue","writeWithoutResponse","writeln","writing-mode","writingMode","x","x1","x2","xChannelSelector","xmlEncoding","xmlStandalone","xmlVersion","xmlbase","xmllang","xmlspace","xor","xr","y","y1","y2","yChannelSelector","yandex","z","z-index","zIndex","zoom","zoomAndPan","zoomRectScreen"];function find_builtins(e){domprops.forEach(i);var t={},n="object"==typeof global?global:self;function i(t){e.add(t);}["Symbol","Map","Promise","Proxy","Reflect","Set","WeakMap","WeakSet"].forEach((function(e){t[e]=n[e]||function(){};})),["null","true","false","NaN","Infinity","-Infinity","undefined"].forEach(i),[Object,Array,Function,Number,String,Boolean,Error,Math,Date,RegExp,t.Symbol,ArrayBuffer,DataView,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,EvalError,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,isFinite,isNaN,JSON,t.Map,parseFloat,parseInt,t.Promise,t.Proxy,RangeError,ReferenceError,t.Reflect,t.Set,SyntaxError,TypeError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,URIError,t.WeakMap,t.WeakSet].forEach((function(e){Object.getOwnPropertyNames(e).map(i),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(i);}));}function reserve_quoted_keys(e,t){function n(e){push_uniq(t,e);}e.walk(new TreeWalker((function(e){e instanceof AST_ObjectKeyVal&&e.quote?n(e.key):e instanceof AST_ObjectProperty&&e.quote?n(e.key.name):e instanceof AST_Sub&&addStrings(e.property,n);})));}function addStrings(e,t){e.walk(new TreeWalker((function(e){return e instanceof AST_Sequence?addStrings(e.tail_node(),t):e instanceof AST_String?t(e.value):e instanceof AST_Conditional&&(addStrings(e.consequent,t),addStrings(e.alternative,t)),!0})));}function mangle_private_properties(e,t){var n=-1,i=new Map,o=t.nth_identifier||base54;return e.transform(new TreeTransformer((function(e){e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod||e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter||e instanceof AST_PrivateIn?e.key.name=r(e.key.name):e instanceof AST_DotHash&&(e.property=r(e.property));})));function r(e){let t=i.get(e);return t||(t=o.get(++n),i.set(e,t)),t}}function mangle_properties(e,t){var n=(t=defaults$1(t,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,nth_identifier:base54,only_cache:!1,regex:null,reserved:null,undeclared:!1},!0)).nth_identifier,i=t.reserved;Array.isArray(i)||(i=[i]);var o=new Set(i);t.builtins||find_builtins(o);var r,a=-1;r=t.cache?t.cache.props:new Map;var s,u=t.regex&&new RegExp(t.regex),l=!1!==t.debug;l&&(s=!0===t.debug?"":t.debug);var c=new Set,_=new Set;r.forEach((e=>_.add(e)));var f=!!t.keep_quoted;return e.walk(new TreeWalker((function(e){if(e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod||e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter||e instanceof AST_DotHash);else if(e instanceof AST_ObjectKeyVal)"string"!=typeof e.key||f&&e.quote||m(e.key);else if(e instanceof AST_ObjectProperty)f&&e.quote||m(e.key.name);else if(e instanceof AST_Dot){var n=!!t.undeclared;if(!n){for(var i=e;i.expression;)i=i.expression;n=!(i.thedef&&i.thedef.undeclared);}!n||f&&e.quote||m(e.property);}else e instanceof AST_Sub?f||addStrings(e.property,m):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?addStrings(e.args[1],m):e instanceof AST_Binary&&"in"===e.operator&&addStrings(e.left,m);}))),e.transform(new TreeTransformer((function(e){e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod||e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter||e instanceof AST_DotHash||(e instanceof AST_ObjectKeyVal?"string"!=typeof e.key||f&&e.quote||(e.key=S(e.key)):e instanceof AST_ObjectProperty?f&&e.quote||(e.key.name=S(e.key.name)):e instanceof AST_Dot?f&&e.quote||(e.property=S(e.property)):!f&&e instanceof AST_Sub?e.property=h(e.property):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?e.args[1]=h(e.args[1]):e instanceof AST_Binary&&"in"===e.operator&&(e.left=h(e.left)));})));function p(e){return !_.has(e)&&!o.has(e)&&(t.only_cache?r.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e))}function d(e){return !(u&&!u.test(e))&&!o.has(e)&&(r.has(e)||c.has(e))}function m(e){p(e)&&c.add(e),d(e)||_.add(e);}function S(e){if(!d(e))return e;var t=r.get(e);if(!t){if(l){var i="_$"+e+"$"+s+"_";p(i)&&(t=i);}if(!t)do{t=n.get(++a);}while(!p(t));r.set(e,t);}return t}function h(e){return e.transform(new TreeTransformer((function(e){if(e instanceof AST_Sequence){var t=e.expressions.length-1;e.expressions[t]=h(e.expressions[t]);}else e instanceof AST_String?e.value=S(e.value):e instanceof AST_Conditional&&(e.consequent=h(e.consequent),e.alternative=h(e.alternative));return e})))}}var to_ascii="undefined"==typeof atob?function(e){return Buffer.from(e,"base64").toString()}:atob,to_base64="undefined"==typeof btoa?function(e){return Buffer.from(e).toString("base64")}:btoa;function read_source_map(e){var t=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(e);return t?to_ascii(t[2]):(console.warn("inline source map not found"),null)}function set_shorthand(e,t,n){t[e]&&n.forEach((function(n){t[n]&&("object"!=typeof t[n]&&(t[n]={}),e in t[n]||(t[n][e]=t[e]));}));}function init_cache(e){e&&("props"in e?e.props instanceof Map||(e.props=map_from_object(e.props)):e.props=new Map);}function cache_to_json(e){return {props:map_to_object(e.props)}}function log_input(e,t,n,i){if(!(n&&n.writeFileSync&&n.mkdirSync))return;try{n.mkdirSync(i);}catch(e){if("EEXIST"!==e.code)throw e}const o=`${i}/terser-debug-${9999999*Math.random()|0}.log`;t=t||{};const r=JSON.stringify(t,((e,t)=>"function"==typeof t?"[Function "+t.toString()+"]":t instanceof RegExp?"[RegExp "+t.toString()+"]":t),4),a=e=>"object"==typeof e&&t.parse&&t.parse.spidermonkey?JSON.stringify(e,null,2):"object"==typeof e?Object.keys(e).map((t=>t+": "+a(e[t]))).join("\n\n"):"string"==typeof e?"```\n"+e+"\n```":e;n.writeFileSync(o,"Options: \n"+r+"\n\nInput files:\n\n"+a(e)+"\n");}async function minify(e,t,n){n&&"object"==typeof process&&process.env&&"string"==typeof process.env.TERSER_DEBUG_DIR&&log_input(e,t,n,process.env.TERSER_DEBUG_DIR);var i,o,r=(t=defaults$1(t,{compress:{},ecma:void 0,enclose:!1,ie8:!1,keep_classnames:void 0,keep_fnames:!1,mangle:{},module:!1,nameCache:null,output:null,format:null,parse:{},rename:void 0,safari10:!1,sourceMap:!1,spidermonkey:!1,timings:!1,toplevel:!1,warnings:!1,wrap:!1},!0)).timings&&{start:Date.now()};if(void 0===t.keep_classnames&&(t.keep_classnames=t.keep_fnames),void 0===t.rename&&(t.rename=t.compress&&t.mangle),t.output&&t.format)throw new Error("Please only specify either output or format option, preferrably format.");if(t.format=t.format||t.output||{},set_shorthand("ecma",t,["parse","compress","format"]),set_shorthand("ie8",t,["compress","mangle","format"]),set_shorthand("keep_classnames",t,["compress","mangle"]),set_shorthand("keep_fnames",t,["compress","mangle"]),set_shorthand("module",t,["parse","compress","mangle"]),set_shorthand("safari10",t,["mangle","format"]),set_shorthand("toplevel",t,["compress","mangle"]),set_shorthand("warnings",t,["compress"]),t.mangle&&(t.mangle=defaults$1(t.mangle,{cache:t.nameCache&&(t.nameCache.vars||{}),eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,nth_identifier:base54,properties:!1,reserved:[],safari10:!1,toplevel:!1},!0),t.mangle.properties&&("object"!=typeof t.mangle.properties&&(t.mangle.properties={}),t.mangle.properties.keep_quoted&&(i=t.mangle.properties.reserved,Array.isArray(i)||(i=[]),t.mangle.properties.reserved=i),t.nameCache&&!("cache"in t.mangle.properties)&&(t.mangle.properties.cache=t.nameCache.props||{})),init_cache(t.mangle.cache),init_cache(t.mangle.properties.cache)),t.sourceMap&&(t.sourceMap=defaults$1(t.sourceMap,{asObject:!1,content:null,filename:null,includeSources:!1,root:null,url:null},!0)),r&&(r.parse=Date.now()),e instanceof AST_Toplevel)o=e;else {if(("string"==typeof e||t.parse.spidermonkey&&!Array.isArray(e))&&(e=[e]),t.parse=t.parse||{},t.parse.toplevel=null,t.parse.spidermonkey)t.parse.toplevel=AST_Node.from_mozilla_ast(Object.keys(e).reduce((function(t,n){return t?(t.body=t.body.concat(e[n].body),t):e[n]}),null));else for(var a in delete t.parse.spidermonkey,e)if(HOP(e,a)&&(t.parse.filename=a,t.parse.toplevel=parse$4(e[a],t.parse),t.sourceMap&&"inline"==t.sourceMap.content)){if(Object.keys(e).length>1)throw new Error("inline source map only works with singular input");t.sourceMap.content=read_source_map(e[a]);}o=t.parse.toplevel;}i&&"strict"!==t.mangle.properties.keep_quoted&&reserve_quoted_keys(o,i),t.wrap&&(o=o.wrap_commonjs(t.wrap)),t.enclose&&(o=o.wrap_enclose(t.enclose)),r&&(r.rename=Date.now()),r&&(r.compress=Date.now()),t.compress&&(o=new Compressor(t.compress,{mangle_options:t.mangle}).compress(o)),r&&(r.scope=Date.now()),t.mangle&&o.figure_out_scope(t.mangle),r&&(r.mangle=Date.now()),t.mangle&&(o.compute_char_frequency(t.mangle),o.mangle_names(t.mangle),o=mangle_private_properties(o,t.mangle)),r&&(r.properties=Date.now()),t.mangle&&t.mangle.properties&&(o=mangle_properties(o,t.mangle.properties)),r&&(r.format=Date.now());var s={};if(t.format.ast&&(s.ast=o),t.format.spidermonkey&&(s.ast=o.to_mozilla_ast()),!HOP(t.format,"code")||t.format.code){if(t.format.ast||(t.format._destroy_ast=!0,walk$2(o,(e=>{e instanceof AST_Scope&&(e.variables=void 0,e.enclosed=void 0,e.parent_scope=void 0),e.block_scope&&(e.block_scope.variables=void 0,e.block_scope.enclosed=void 0,e.parent_scope=void 0);}))),t.sourceMap){if(t.sourceMap.includeSources&&e instanceof AST_Toplevel)throw new Error("original source content unavailable");t.format.source_map=await SourceMap$4({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root,files:t.sourceMap.includeSources?e:null});}delete t.format.ast,delete t.format.code,delete t.format.spidermonkey;var u=OutputStream(t.format);if(o.print(u),s.code=u.get(),t.sourceMap)if(Object.defineProperty(s,"map",{configurable:!0,enumerable:!0,get(){const e=t.format.source_map.getEncoded();return s.map=t.sourceMap.asObject?e:JSON.stringify(e)},set(e){Object.defineProperty(s,"map",{value:e,writable:!0});}}),s.decoded_map=t.format.source_map.getDecoded(),"inline"==t.sourceMap.url){var l="object"==typeof s.map?JSON.stringify(s.map):s.map;s.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+to_base64(l);}else t.sourceMap.url&&(s.code+="\n//# sourceMappingURL="+t.sourceMap.url);}return t.nameCache&&t.mangle&&(t.mangle.cache&&(t.nameCache.vars=cache_to_json(t.mangle.cache)),t.mangle.properties&&t.mangle.properties.cache&&(t.nameCache.props=cache_to_json(t.mangle.properties.cache))),t.format&&t.format.source_map&&t.format.source_map.destroy(),r&&(r.end=Date.now(),s.timings={parse:.001*(r.rename-r.parse),rename:.001*(r.compress-r.rename),compress:.001*(r.scope-r.compress),scope:.001*(r.mangle-r.scope),mangle:.001*(r.properties-r.mangle),properties:.001*(r.format-r.properties),format:.001*(r.end-r.format),total:.001*(r.end-r.start)}),s}

/**
 * Performs the minification of JavaScript source
 * @param input the JavaScript source to minify
 * @param opts the options used by the minifier
 * @returns the resulting minified JavaScript
 */
const minifyJs = async (input, opts) => {
  const results = {
    output: input,
    sourceMap: null,
    diagnostics: [],
  };
  if (opts) {
    const mangle = opts.mangle;
    if (mangle) {
      const mangleProperties = mangle.properties;
      if (mangleProperties && mangleProperties.regex) {
        mangleProperties.regex = new RegExp(mangleProperties.regex);
      }
    }
    if (opts.sourceMap) {
      /**
       * sourceMap, when used in conjunction with compress, can lead to sourcemaps that don't in every browser. despite
       * there being a sourcemap spec, each browser has it's own tricks for trying to get sourcemaps to properly map
       * minified JS back to its original form. for the most consistent results across all browsers, explicitly disable
       * compress.
       */
      opts.compress = undefined;
    }
  }
  try {
    const minifyResults = await minify(input, opts);
    results.output = minifyResults.code;
    results.sourceMap = typeof minifyResults.map === 'string' ? JSON.parse(minifyResults.map) : minifyResults.map;
    const compress = opts.compress;
    if (compress && compress.module && results.output.endsWith('};')) {
      // stripping the semicolon here _shouldn't_ be of significant consequence for the already generated sourcemap
      results.output = results.output.substring(0, results.output.length - 1);
    }
  }
  catch (e) {
    if (e instanceof Error) {
      console.log(e.stack);
    }
    loadMinifyJsDiagnostics(input, results.diagnostics, e);
  }
  return results;
};
const loadMinifyJsDiagnostics = (sourceText, diagnostics, error) => {
  const d = {
    level: 'error',
    type: 'build',
    language: 'javascript',
    header: 'Minify JS',
    code: '',
    messageText: error.message,
    absFilePath: null,
    relFilePath: null,
    lines: [],
  };
  const err = error;
  if (typeof err.line === 'number' && err.line > -1) {
    const srcLines = splitLineBreaks(sourceText);
    const errorLine = {
      lineIndex: err.line - 1,
      lineNumber: err.line,
      text: srcLines[err.line - 1],
      errorCharStart: err.col,
      errorLength: 0,
    };
    d.lineNumber = errorLine.lineNumber;
    d.columnNumber = errorLine.errorCharStart;
    const highlightLine = errorLine.text.slice(d.columnNumber);
    for (let i = 0; i < highlightLine.length; i++) {
      if (MINIFY_CHAR_BREAK.has(highlightLine.charAt(i))) {
        break;
      }
      errorLine.errorLength++;
    }
    d.lines.push(errorLine);
    if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
      errorLine.errorLength = 1;
      errorLine.errorCharStart--;
    }
    if (errorLine.lineIndex > 0) {
      const previousLine = {
        lineIndex: errorLine.lineIndex - 1,
        lineNumber: errorLine.lineNumber - 1,
        text: srcLines[errorLine.lineIndex - 1],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.unshift(previousLine);
    }
    if (errorLine.lineIndex + 1 < srcLines.length) {
      const nextLine = {
        lineIndex: errorLine.lineIndex + 1,
        lineNumber: errorLine.lineNumber + 1,
        text: srcLines[errorLine.lineIndex + 1],
        errorCharStart: -1,
        errorLength: -1,
      };
      d.lines.push(nextLine);
    }
  }
  diagnostics.push(d);
};
const MINIFY_CHAR_BREAK = new Set([
  ' ',
  '=',
  '.',
  ',',
  '?',
  ':',
  ';',
  '(',
  ')',
  '{',
  '}',
  '[',
  ']',
  '|',
  `'`,
  `"`,
  '`',
]);

/**
 * Begins the process of minifying a user's JavaScript
 * @param config the Stencil configuration file that was provided as a part of the build step
 * @param compilerCtx the current compiler context
 * @param opts minification options that specify how the JavaScript ought to be minified
 * @returns the minified JavaScript result
 */
const optimizeModule = async (config, compilerCtx, opts) => {
  if ((!opts.minify && opts.sourceTarget !== 'es5') || opts.input === '') {
    return {
      output: opts.input,
      diagnostics: [],
      sourceMap: opts.sourceMap,
    };
  }
  const isDebug = config.logLevel === 'debug';
  const cacheKey = await compilerCtx.cache.createKey('optimizeModule', minfyJsId, opts, isDebug);
  const cachedContent = await compilerCtx.cache.get(cacheKey);
  if (cachedContent != null) {
    const cachedMap = await compilerCtx.cache.get(cacheKey + 'Map');
    return {
      output: cachedContent,
      diagnostics: [],
      sourceMap: cachedMap ? JSON.parse(cachedMap) : null,
    };
  }
  let minifyOpts;
  let code = opts.input;
  if (opts.isCore) {
    // IS_ESM_BUILD is replaced at build time so systemjs and esm builds have diff values
    // not using the BUILD conditional since rollup would input the same value
    code = code.replace(/\/\* IS_ESM_BUILD \*\//g, '&& false /* IS_SYSTEM_JS_BUILD */');
  }
  if (opts.sourceTarget === 'es5' || opts.minify) {
    minifyOpts = getTerserOptions(config, opts.sourceTarget, isDebug);
    if (config.sourceMap) {
      minifyOpts.sourceMap = {
        content:
        // We need to loosely check for a source map definition
        // so we don't spread a `null`/`undefined` value into the object
        // which results in invalid source maps during minification
        opts.sourceMap != null
          ? {
            ...opts.sourceMap,
            version: 3,
          }
          : undefined,
      };
    }
    const compressOpts = minifyOpts.compress;
    const mangleOptions = minifyOpts.mangle;
    if (opts.sourceTarget !== 'es5' && opts.isCore) {
      if (!isDebug) {
        compressOpts.passes = 2;
        compressOpts.global_defs = {
          supportsListenerOptions: true,
          'plt.$cssShim$': false,
        };
        compressOpts.pure_funcs = compressOpts.pure_funcs || [];
        compressOpts.pure_funcs = ['getHostRef', ...compressOpts.pure_funcs];
      }
      mangleOptions.properties = {
        regex: '^\\$.+\\$$',
        debug: isDebug,
      };
      compressOpts.inline = 1;
      compressOpts.unsafe = true;
      compressOpts.unsafe_undefined = true;
    }
  }
  const shouldTranspile = opts.sourceTarget === 'es5';
  const results = await compilerCtx.worker.prepareModule(code, minifyOpts, shouldTranspile, opts.inlineHelpers);
  if (results != null &&
    typeof results.output === 'string' &&
    results.diagnostics.length === 0 &&
    compilerCtx != null) {
    if (opts.isCore) {
      results.output = results.output.replace(/disconnectedCallback\(\)\{\},/g, '');
    }
    await compilerCtx.cache.put(cacheKey, results.output);
    if (results.sourceMap) {
      await compilerCtx.cache.put(cacheKey + 'Map', JSON.stringify(results.sourceMap));
    }
  }
  return results;
};
/**
 * Builds a configuration object to be used by Terser for the purposes of minifying a user's JavaScript
 * @param config the Stencil configuration file that was provided as a part of the build step
 * @param sourceTarget the version of JavaScript being targeted (e.g. ES2017)
 * @param prettyOutput if true, set the necessary flags to beautify the output of terser
 * @returns the minification options
 */
const getTerserOptions = (config, sourceTarget, prettyOutput) => {
  const opts = {
    ie8: false,
    safari10: !!config.extras.safari10,
    format: {},
    sourceMap: config.sourceMap,
  };
  if (sourceTarget === 'es5') {
    opts.ecma = opts.format.ecma = 5;
    opts.compress = false;
    opts.mangle = true;
  }
  else {
    opts.mangle = {
      properties: {
        regex: '^\\$.+\\$$',
      },
    };
    opts.compress = {
      pure_getters: true,
      keep_fargs: false,
      passes: 2,
    };
    opts.ecma = opts.format.ecma = opts.compress.ecma = 2018;
    opts.toplevel = true;
    opts.module = true;
    opts.mangle.toplevel = true;
    opts.compress.arrows = true;
    opts.compress.module = true;
    opts.compress.toplevel = true;
  }
  if (prettyOutput) {
    opts.mangle = { keep_fnames: true };
    opts.compress = {};
    opts.compress.drop_console = false;
    opts.compress.drop_debugger = false;
    opts.compress.pure_funcs = [];
    opts.format.beautify = true;
    opts.format.indent_level = 2;
    opts.format.comments = 'all';
  }
  return opts;
};
/**
 * This method is likely to be called by a worker on the compiler context, rather than directly.
 * @param input the source code to minify
 * @param minifyOpts options to be used by the minifier
 * @param transpileToEs5 if true, use the TypeScript compiler to transpile the input to ES5 prior to minification
 * @param inlineHelpers when true, emits less terse JavaScript by allowing global helpers created by the TypeScript
 * compiler to be added directly to the transpiled source. Used only if `transpileToEs5` is true.
 * @returns minified input, as JavaScript
 */
const prepareModule = async (input, minifyOpts, transpileToEs5, inlineHelpers) => {
  var _a, _b;
  const results = {
    output: input,
    diagnostics: [],
    sourceMap: null,
  };
  if (transpileToEs5) {
    const tsResults = t.transpileModule(input, {
      fileName: 'module.ts',
      compilerOptions: {
        sourceMap: !!minifyOpts.sourceMap,
        allowJs: true,
        target: t.ScriptTarget.ES5,
        module: t.ModuleKind.ESNext,
        removeComments: false,
        isolatedModules: true,
        skipLibCheck: true,
        noEmitHelpers: !inlineHelpers,
        importHelpers: !inlineHelpers,
      },
      reportDiagnostics: false,
    });
    results.output = tsResults.outputText;
    if (tsResults.sourceMapText) {
      // need to merge sourcemaps at this point
      const mergeMap = mergeSourceMap((_a = minifyOpts.sourceMap) === null || _a === void 0 ? void 0 : _a.content, JSON.parse(tsResults.sourceMapText));
      if (mergeMap != null) {
        minifyOpts.sourceMap = {
          content: {
            ...mergeMap,
            sources: (_b = mergeMap.sources) !== null && _b !== void 0 ? _b : [],
            version: 3,
          },
        };
      }
    }
  }
  if (minifyOpts) {
    return minifyJs(results.output, minifyOpts);
  }
  return results;
};

const crawlAnchorsForNextUrls = (prerenderConfig, diagnostics, baseUrl, currentUrl, parsedAnchors) => {
  if (!Array.isArray(parsedAnchors) || parsedAnchors.length === 0) {
    return [];
  }
  const basePathParts = baseUrl.pathname.split('/');
  // filterAnchor(): filter which anchors to actually crawl
  // normalizeUrl(): normalize href strings into URL objects
  // filterUrl(): filter which urls to actually crawl
  // normalizeHref(): normalize URL objects into href strings
  return parsedAnchors
    .filter((anchor) => {
    // filter which anchors to actually crawl
    if (typeof prerenderConfig.filterAnchor === 'function') {
      // user filterAnchor()
      try {
        const userFilterAnchor = prerenderConfig.filterAnchor(anchor, currentUrl);
        if (userFilterAnchor === false) {
          return false;
        }
      }
      catch (e) {
        // user filterAnchor() error
        catchError(diagnostics, e);
        return false;
      }
    }
    // standard filterAnchor()
    return standardFilterAnchor(diagnostics, anchor);
  })
    .map((anchor) => {
    // normalize href strings into URL objects
    if (typeof prerenderConfig.normalizeUrl === 'function') {
      try {
        // user normalizeUrl()
        const userNormalizedUrl = prerenderConfig.normalizeUrl(anchor.href, currentUrl);
        // standard normalizeUrl(), after user normalized
        return standardNormalizeUrl(diagnostics, userNormalizedUrl.href, currentUrl);
      }
      catch (e) {
        // user normalizeUrl() error
        catchError(diagnostics, e);
      }
    }
    // standard normalizeUrl(), no user normalized
    return standardNormalizeUrl(diagnostics, anchor.href, currentUrl);
  })
    .filter((url) => {
    // filter which urls to actually crawl
    if (typeof prerenderConfig.filterUrl === 'function') {
      // user filterUrl()
      try {
        const userFilterUrl = prerenderConfig.filterUrl(url, currentUrl);
        if (userFilterUrl === false) {
          return false;
        }
      }
      catch (e) {
        // user filterUrl() error
        catchError(diagnostics, e);
        return false;
      }
    }
    // standard filterUrl()
    return standardFilterUrl(diagnostics, url, currentUrl, basePathParts);
  })
    .map((url) => {
    // standard normalize href
    // normalize URL objects into href strings
    return standardNormalizeHref(prerenderConfig, diagnostics, url);
  })
    .reduce((hrefs, href) => {
    // remove any duplicate hrefs from the array
    if (!hrefs.includes(href)) {
      hrefs.push(href);
    }
    return hrefs;
  }, [])
    .sort((a, b) => {
    // sort the hrefs so the urls with the least amount
    // of directories are first, then by alphabetical
    const partsA = a.split('/').length;
    const partsB = b.split('/').length;
    if (partsA < partsB)
      return -1;
    if (partsA > partsB)
      return 1;
    if (a < b)
      return -1;
    if (a > b)
      return 1;
    return 0;
  });
};
const standardFilterAnchor = (diagnostics, attrs, _base) => {
  try {
    let href = attrs.href;
    if (typeof attrs.download === 'string') {
      return false;
    }
    if (typeof href === 'string') {
      href = href.trim();
      if (href !== '' && !href.startsWith('#') && !href.startsWith('?')) {
        const target = attrs.target;
        if (typeof target === 'string' && attrs.target.trim().toLowerCase() !== '_self') {
          return false;
        }
        return true;
      }
    }
  }
  catch (e) {
    catchError(diagnostics, e);
  }
  return false;
};
const standardNormalizeUrl = (diagnostics, href, currentUrl) => {
  if (typeof href === 'string') {
    try {
      const outputUrl = new URL(href, currentUrl.href);
      outputUrl.protocol = currentUrl.href;
      outputUrl.hash = '';
      outputUrl.search = '';
      const parts = outputUrl.pathname.split('/');
      const lastPart = parts[parts.length - 1];
      if (lastPart === 'index.html' || lastPart === 'index.htm') {
        parts.pop();
        outputUrl.pathname = parts.join('/');
      }
      return outputUrl;
    }
    catch (e) {
      catchError(diagnostics, e);
    }
  }
  return null;
};
const standardFilterUrl = (diagnostics, url, currentUrl, basePathParts) => {
  try {
    if (url.hostname != null && currentUrl.hostname != null && url.hostname !== currentUrl.hostname) {
      return false;
    }
    if (shouldSkipExtension(url.pathname)) {
      return false;
    }
    const inputPathParts = url.pathname.split('/');
    if (inputPathParts.length < basePathParts.length) {
      return false;
    }
    for (let i = 0; i < basePathParts.length; i++) {
      const basePathPart = basePathParts[i];
      const inputPathPart = inputPathParts[i];
      if (basePathParts.length - 1 === i && basePathPart === '') {
        break;
      }
      if (basePathPart !== inputPathPart) {
        return false;
      }
    }
    return true;
  }
  catch (e) {
    catchError(diagnostics, e);
  }
  return false;
};
const standardNormalizeHref = (prerenderConfig, diagnostics, url) => {
  try {
    if (url != null && typeof url.href === 'string') {
      let href = url.href.trim();
      if (prerenderConfig.trailingSlash) {
        // url should have a trailing slash
        if (!href.endsWith('/')) {
          const parts = url.pathname.split('/');
          const lastPart = parts[parts.length - 1];
          if (!lastPart.includes('.')) {
            // does not end with a slash and last part does not have a dot
            href += '/';
          }
        }
      }
      else {
        // url should NOT have a trailing slash
        if (href.endsWith('/') && url.pathname !== '/') {
          // this has a trailing slash and it's not the root path
          href = href.slice(0, -1);
        }
      }
      return href;
    }
  }
  catch (e) {
    catchError(diagnostics, e);
  }
  return null;
};
const shouldSkipExtension = (filename) => SKIP_EXT.has(extname(filename).toLowerCase());
const extname = (str) => {
  const parts = str.split('.');
  return parts[parts.length - 1].toLowerCase();
};
const SKIP_EXT = new Set(['zip', 'rar', 'tar', 'gz', 'bz2', 'png', 'jpeg', 'jpg', 'gif', 'pdf', 'tiff', 'psd']);

const nodeRequire = (id) => {
  const results = {
    module: undefined,
    id,
    diagnostics: [],
  };
  if (IS_NODE_ENV) {
    try {
      const fs = require('fs');
      const path = require('path');
      results.id = path.resolve(id);
      // ensure we cleared out node's internal require() cache for this file
      delete require.cache[results.id];
      // let's override node's require for a second
      // don't worry, we'll revert this when we're done
      require.extensions['.ts'] = (module, fileName) => {
        let sourceText = fs.readFileSync(fileName, 'utf8');
        if (fileName.endsWith('.ts')) {
          // looks like we've got a typed config file
          // let's transpile it to .js quick
          const tsResults = t.transpileModule(sourceText, {
            fileName,
            compilerOptions: {
              module: t.ModuleKind.CommonJS,
              moduleResolution: t.ModuleResolutionKind.NodeJs,
              esModuleInterop: true,
              target: t.ScriptTarget.ES2017,
              allowJs: true,
            },
          });
          sourceText = tsResults.outputText;
          results.diagnostics.push(...tsResults.diagnostics.map(loadTypeScriptDiagnostic));
        }
        else {
          // quick hack to turn a modern es module
          // into and old school commonjs module
          sourceText = sourceText.replace(/export\s+\w+\s+(\w+)/gm, 'exports.$1');
        }
        try {
          // we need to coerce because of the requirements for the arguments to
          // this function. It's safe enough since it's already wrapped in a
          // `try { } catch`.
          module._compile(sourceText, fileName);
        }
        catch (e) {
          catchError(results.diagnostics, e);
        }
      };
      // let's do this!
      results.module = require(results.id);
      // all set, let's go ahead and reset the require back to the default
      require.extensions['.ts'] = undefined;
    }
    catch (e) {
      catchError(results.diagnostics, e);
    }
  }
  return results;
};

const getPrerenderConfig = (diagnostics, prerenderConfigPath) => {
  const prerenderConfig = {};
  if (isString$1(prerenderConfigPath)) {
    const results = nodeRequire(prerenderConfigPath);
    diagnostics.push(...results.diagnostics);
    if (results.module != null && typeof results.module === 'object') {
      if (results.module.config != null && typeof results.module.config === 'object') {
        Object.assign(prerenderConfig, results.module.config);
      }
      else {
        Object.assign(prerenderConfig, results.module);
      }
    }
  }
  return prerenderConfig;
};

const getHydrateOptions = (prerenderConfig, url, diagnostics) => {
  const prerenderUrl = url.href;
  const opts = {
    url: prerenderUrl,
    addModulePreloads: true,
    approximateLineWidth: 100,
    hashAssets: 'querystring',
    inlineExternalStyleSheets: false,
    minifyScriptElements: true,
    minifyStyleElements: true,
    removeAttributeQuotes: true,
    removeBooleanAttributeQuotes: true,
    removeEmptyAttributes: true,
    removeHtmlComments: true,
  };
  if (prerenderConfig.canonicalUrl === null || prerenderConfig.canonicalUrl === false) {
    opts.canonicalUrl = null;
  }
  else if (typeof prerenderConfig.canonicalUrl === 'function') {
    try {
      opts.canonicalUrl = prerenderConfig.canonicalUrl(url);
    }
    catch (e) {
      catchError(diagnostics, e);
    }
  }
  else {
    opts.canonicalUrl = prerenderUrl;
  }
  if (typeof prerenderConfig.hydrateOptions === 'function') {
    try {
      const userOpts = prerenderConfig.hydrateOptions(url);
      if (userOpts != null) {
        if (userOpts.prettyHtml && typeof userOpts.removeAttributeQuotes !== 'boolean') {
          opts.removeAttributeQuotes = false;
        }
        Object.assign(opts, userOpts);
      }
    }
    catch (e) {
      catchError(diagnostics, e);
    }
  }
  return opts;
};

const getAbsoluteBuildDir = (outputTarget) => {
  const relativeBuildDir = relative$1(outputTarget.dir, outputTarget.buildDir);
  return join('/', relativeBuildDir) + '/';
};

const optimizeCriticalPath = (doc, criticalBundlers, outputTarget) => {
  const buildDir = getAbsoluteBuildDir(outputTarget);
  const paths = criticalBundlers.map((path) => join(buildDir, path));
  injectModulePreloads(doc, paths);
};
const injectModulePreloads = (doc, paths) => {
  const existingLinks = Array.from(doc.querySelectorAll('link[rel=modulepreload]')).map((link) => link.getAttribute('href'));
  const addLinks = paths.filter((path) => !existingLinks.includes(path)).map((path) => createModulePreload(doc, path));
  const head = doc.head;
  const firstScript = head.querySelector('script');
  if (firstScript) {
    for (const link of addLinks) {
      head.insertBefore(link, firstScript);
    }
  }
  else {
    for (const link of addLinks) {
      head.appendChild(link);
    }
  }
};
const createModulePreload = (doc, href) => {
  const link = doc.createElement('link');
  link.setAttribute('rel', 'modulepreload');
  link.setAttribute('href', href);
  return link;
};

const optimizeJs = async (inputOpts) => {
  const result = {
    output: inputOpts.input,
    diagnostics: [],
    sourceMap: null,
  };
  try {
    const prettyOutput = !!inputOpts.pretty;
    const config = {
      extras: {
        safari10: true,
      },
    };
    const sourceTarget = inputOpts.target === 'es5' ? 'es5' : 'latest';
    const minifyOpts = getTerserOptions(config, sourceTarget, prettyOutput);
    const minifyResults = await minifyJs(inputOpts.input, minifyOpts);
    if (minifyResults.diagnostics.length > 0) {
      result.diagnostics.push(...minifyResults.diagnostics);
    }
    else {
      result.output = minifyResults.output;
      result.sourceMap = minifyResults.sourceMap;
    }
  }
  catch (e) {
    catchError(result.diagnostics, e);
  }
  return result;
};

const getScopeId = (tagName, mode) => {
  return 'sc-' + tagName + (mode && mode !== DEFAULT_STYLE_MODE ? '-' + mode : '');
};

const inlineExternalStyleSheets = async (sys, appDir, doc) => {
  const documentLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
  if (documentLinks.length === 0) {
    return;
  }
  await Promise.all(documentLinks.map(async (link) => {
    const href = link.getAttribute('href');
    if (!href.startsWith('/') || link.getAttribute('media') !== null) {
      return;
    }
    const fsPath = join(appDir, href);
    try {
      let styles = await sys.readFile(fsPath);
      const optimizeResults = await optimizeCss$1({
        input: styles,
      });
      styles = optimizeResults.output;
      // insert inline <style>
      const inlinedStyles = doc.createElement('style');
      inlinedStyles.innerHTML = styles;
      link.parentNode.insertBefore(inlinedStyles, link);
      link.remove();
      // mark inlinedStyle as treeshakable
      inlinedStyles.setAttribute('data-styles', '');
      // since it's no longer a critical resource
      link.setAttribute('media', '(max-width: 0px)');
      link.setAttribute('importance', 'low');
      link.setAttribute('onload', `this.media=''`);
      // move <link rel="stylesheet"> to the end of <body>
      doc.body.appendChild(link);
    }
    catch (e) { }
  }));
};
const minifyScriptElements = async (doc, addMinifiedAttr) => {
  const scriptElms = Array.from(doc.querySelectorAll('script')).filter((scriptElm) => {
    if (scriptElm.hasAttribute('src') || scriptElm.hasAttribute(dataMinifiedAttr)) {
      return false;
    }
    const scriptType = scriptElm.getAttribute('type');
    if (typeof scriptType === 'string' && scriptType !== 'module' && scriptType !== 'text/javascript') {
      return false;
    }
    return true;
  });
  if (scriptElms.length === 0) {
    return;
  }
  await Promise.all(scriptElms.map(async (scriptElm) => {
    const content = scriptElm.innerHTML.trim();
    if (content.length > 0) {
      const opts = {
        input: content,
        sourceMap: false,
        target: 'latest',
      };
      if (scriptElm.getAttribute('type') !== 'module') {
        opts.target = 'es5';
      }
      const optimizeResults = await optimizeJs(opts);
      if (optimizeResults.diagnostics.length === 0) {
        scriptElm.innerHTML = optimizeResults.output;
      }
      if (addMinifiedAttr) {
        scriptElm.setAttribute(dataMinifiedAttr, '');
      }
    }
  }));
};
const minifyStyleElements = async (sys, appDir, doc, currentUrl, addMinifiedAttr) => {
  const styleElms = Array.from(doc.querySelectorAll('style')).filter((styleElm) => {
    if (styleElm.hasAttribute(dataMinifiedAttr)) {
      return false;
    }
    return true;
  });
  await Promise.all(styleElms.map(async (styleElm) => {
    const content = styleElm.innerHTML.trim();
    if (content.length > 0) {
      const optimizeResults = await optimizeCss$1({
        input: content,
        minify: true,
        async resolveUrl(urlProp) {
          const assetUrl = new URL(urlProp, currentUrl);
          const hash = await getAssetFileHash(sys, appDir, assetUrl);
          assetUrl.searchParams.append('v', hash);
          return assetUrl.pathname + assetUrl.search;
        },
      });
      if (optimizeResults.diagnostics.length === 0) {
        styleElm.innerHTML = optimizeResults.output;
      }
      if (addMinifiedAttr) {
        styleElm.setAttribute(dataMinifiedAttr, '');
      }
    }
  }));
};
const excludeStaticComponents = (doc, hydrateOpts, hydrateResults) => {
  const staticComponents = hydrateOpts.staticComponents.filter((tag) => {
    return hydrateResults.components.some((cmp) => cmp.tag === tag);
  });
  if (staticComponents.length > 0) {
    const stencilScriptElm = doc.querySelector('script[data-stencil-namespace]');
    if (stencilScriptElm) {
      const namespace = stencilScriptElm.getAttribute('data-stencil-namespace');
      let scriptContent = excludeComponentScript.replace('__NAMESPACE__', namespace);
      scriptContent = scriptContent.replace('__EXCLUDE__', JSON.stringify(staticComponents));
      const dataOptsScript = doc.createElement('script');
      dataOptsScript.innerHTML = scriptContent;
      dataOptsScript.setAttribute(dataMinifiedAttr, '');
      stencilScriptElm.parentNode.insertBefore(dataOptsScript, stencilScriptElm.nextSibling);
    }
  }
};
const excludeComponentScript = `
(function(){
var s=document.querySelector('[data-stencil-namespace="__NAMESPACE__"]');
s&&((s['data-opts']=s['data-opts']||{}).exclude=__EXCLUDE__);
})();
`
  .replace(/\n/g, '')
  .trim();
const addModulePreloads = (doc, hydrateOpts, hydrateResults, componentGraph) => {
  if (!componentGraph) {
    return false;
  }
  const staticComponents = hydrateOpts.staticComponents || [];
  const cmpTags = hydrateResults.components.filter((cmp) => !staticComponents.includes(cmp.tag));
  const modulePreloads = unique(flatOne(cmpTags.map((cmp) => getScopeId(cmp.tag, cmp.mode)).map((scopeId) => componentGraph.get(scopeId) || [])));
  injectModulePreloads(doc, modulePreloads);
  return true;
};
const removeModulePreloads = (doc) => {
  const links = doc.querySelectorAll('link[rel="modulepreload"]');
  for (let i = links.length - 1; i >= 0; i--) {
    const href = links[i].getAttribute('href');
    if (href && href.includes('/p-')) {
      links[i].remove();
    }
  }
};
const removeStencilScripts = (doc) => {
  const stencilScripts = doc.querySelectorAll('script[data-stencil]');
  for (let i = stencilScripts.length - 1; i >= 0; i--) {
    stencilScripts[i].remove();
  }
};
const hasStencilScript = (doc) => {
  return !!doc.querySelector('script[data-stencil]');
};
const hashAssets = async (sys, prerenderCtx, diagnostics, hydrateOpts, appDir, doc, currentUrl) => {
  // do one at a time to prevent too many opened files and memory usage issues
  // hash id is cached in each worker, so shouldn't have to do this for every page
  // update the stylesheet content first so the hash url()s are apart of the file's hash too
  const links = Array.from(doc.querySelectorAll('link[rel=stylesheet][href]'));
  for (const link of links) {
    const href = link.getAttribute('href');
    if (isString$1(href) && href.length > 0) {
      const stylesheetUrl = new URL(href, currentUrl);
      if (currentUrl.host === stylesheetUrl.host) {
        try {
          const filePath = join(appDir, stylesheetUrl.pathname);
          if (prerenderCtx.hashedFile.has(filePath)) {
            continue;
          }
          prerenderCtx.hashedFile.add(filePath);
          let css = await sys.readFile(filePath);
          if (isString$1(css) && css.length > 0) {
            css = await minifyCss({
              css,
              async resolveUrl(urlProp) {
                const assetUrl = new URL(urlProp, stylesheetUrl);
                const hash = await getAssetFileHash(sys, appDir, assetUrl);
                assetUrl.searchParams.append('v', hash);
                return assetUrl.pathname + assetUrl.search;
              },
            });
            sys.writeFileSync(filePath, css);
          }
        }
        catch (e) {
          catchError(diagnostics, e);
        }
      }
    }
  }
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="stylesheet"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="prefetch"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="preload"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="modulepreload"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="icon"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="apple-touch-icon"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="manifest"]', ['href']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'script', ['src']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'img', ['src', 'srcset']);
  await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'picture > source', ['srcset']);
  const pageStates = Array.from(doc.querySelectorAll('script[data-stencil-static="page.state"][type="application/json"]'));
  if (pageStates.length > 0) {
    await Promise.all(pageStates.map(async (pageStateScript) => {
      const pageState = JSON.parse(pageStateScript.textContent);
      if (pageState && Array.isArray(pageState.ast)) {
        for (const node of pageState.ast) {
          if (Array.isArray(node)) {
            await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node);
          }
        }
        pageStateScript.textContent = JSON.stringify(pageState);
      }
    }));
  }
};
const hashAsset = async (sys, hydrateOpts, appDir, doc, currentUrl, selector, srcAttrs) => {
  const elms = Array.from(doc.querySelectorAll(selector));
  // do one at a time to prevent too many opened files and memory usage issues
  for (const elm of elms) {
    for (const attrName of srcAttrs) {
      const srcValues = getAttrUrls(attrName, elm.getAttribute(attrName));
      for (const srcValue of srcValues) {
        const assetUrl = new URL(srcValue.src, currentUrl);
        if (assetUrl.hostname === currentUrl.hostname) {
          if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
            try {
              const hash = await getAssetFileHash(sys, appDir, assetUrl);
              if (isString$1(hash)) {
                assetUrl.searchParams.append('v', hash);
                const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
                elm.setAttribute(attrName, attrValue);
              }
            }
            catch (e) { }
          }
        }
      }
    }
  }
};
const hashPageStateAstAssets = async (sys, hydrateOpts, appDir, currentUrl, pageStateScript, node) => {
  const tagName = node[0];
  const attrs = node[1];
  if (isString$1(tagName)) {
    if (attrs) {
      if (tagName === 'img' || tagName === 'source') {
        for (const attrName of ['src', 'srcset']) {
          const srcValues = getAttrUrls(attrName, attrs[attrName]);
          for (const srcValue of srcValues) {
            const assetUrl = new URL(srcValue.src, currentUrl);
            if (assetUrl.hostname === currentUrl.hostname) {
              if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
                try {
                  const hash = await getAssetFileHash(sys, appDir, assetUrl);
                  if (isString$1(hash)) {
                    assetUrl.searchParams.append('v', hash);
                    const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
                    attrs[attrName] = attrValue;
                  }
                }
                catch (e) { }
              }
            }
          }
        }
      }
    }
    for (let i = 2, l = node.length; i < l; i++) {
      if (Array.isArray(node[i])) {
        await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node[i]);
      }
    }
  }
};
const getAttrUrls = (attrName, attrValue) => {
  const srcValues = [];
  if (isString$1(attrValue)) {
    if (attrName.toLowerCase() === 'srcset') {
      attrValue
        .split(',')
        .map((a) => a.trim())
        .filter((a) => a.length > 0)
        .forEach((src) => {
        const spaceSplt = src.split(' ');
        if (spaceSplt[0].length > 0) {
          srcValues.push({ src: spaceSplt[0], descriptor: spaceSplt[1] });
        }
      });
    }
    else {
      srcValues.push({ src: attrValue });
    }
  }
  return srcValues;
};
const setAttrUrls = (url, descriptor) => {
  let src = url.pathname + url.search;
  if (isString$1(descriptor)) {
    src += ' ' + descriptor;
  }
  return src;
};
const hashedAssets = new Map();
const getAssetFileHash = async (sys, appDir, assetUrl) => {
  let p = hashedAssets.get(assetUrl.pathname);
  if (!p) {
    const assetFilePath = join(appDir, assetUrl.pathname);
    p = sys.generateFileHash(assetFilePath, 10);
    hashedAssets.set(assetUrl.pathname, p);
  }
  return p;
};
const dataMinifiedAttr = 'data-m';

const prerenderCtx = {
  buildId: null,
  componentGraph: null,
  prerenderConfig: null,
  ensuredDirs: null,
  templateHtml: null,
  hashedFile: null,
};
const getPrerenderCtx = (prerenderRequest) => {
  if (prerenderRequest.buildId !== prerenderCtx.buildId) {
    prerenderCtx.buildId = prerenderRequest.buildId;
    prerenderCtx.componentGraph = null;
    prerenderCtx.prerenderConfig = null;
    prerenderCtx.ensuredDirs = new Set();
    prerenderCtx.templateHtml = null;
    prerenderCtx.hashedFile = new Set();
  }
  return prerenderCtx;
};

const prerenderWorker = async (sys, prerenderRequest) => {
  // worker thread!
  const results = {
    diagnostics: [],
    anchorUrls: [],
    filePath: prerenderRequest.writeToFilePath,
  };
  try {
    const prerenderCtx = getPrerenderCtx(prerenderRequest);
    const url = new URL(prerenderRequest.url, prerenderRequest.devServerHostUrl);
    const baseUrl = new URL(prerenderRequest.baseUrl);
    const componentGraph = getComponentGraph(sys, prerenderCtx, prerenderRequest.componentGraphPath);
    // webpack work-around/hack
    const hydrateApp = requireFunc(prerenderRequest.hydrateAppFilePath);
    if (prerenderCtx.templateHtml == null) {
      // cache template html in this process
      prerenderCtx.templateHtml = sys.readFileSync(prerenderRequest.templateId);
    }
    // create a new window by cloning the cached parsed window
    const win = hydrateApp.createWindowFromHtml(prerenderCtx.templateHtml, prerenderRequest.templateId);
    const doc = win.document;
    win.location.href = url.href;
    // patch this new window
    if (isFunction(sys.applyPrerenderGlobalPatch)) {
      sys.applyPrerenderGlobalPatch({
        devServerHostUrl: prerenderRequest.devServerHostUrl,
        window: win,
      });
    }
    if (prerenderCtx.prerenderConfig == null) {
      prerenderCtx.prerenderConfig = getPrerenderConfig(results.diagnostics, prerenderRequest.prerenderConfigPath);
    }
    const prerenderConfig = prerenderCtx.prerenderConfig;
    const hydrateOpts = getHydrateOptions(prerenderConfig, url, results.diagnostics);
    if (prerenderRequest.staticSite || hydrateOpts.staticDocument) {
      hydrateOpts.addModulePreloads = false;
      hydrateOpts.clientHydrateAnnotations = false;
    }
    if (typeof hydrateOpts.buildId !== 'string') {
      hydrateOpts.buildId = prerenderRequest.buildId;
    }
    if (typeof prerenderConfig.beforeHydrate === 'function') {
      try {
        const rtn = prerenderConfig.beforeHydrate(doc, url);
        if (isPromise(rtn)) {
          await rtn;
        }
      }
      catch (e) {
        catchError(results.diagnostics, e);
      }
    }
    // parse the html to dom nodes, hydrate the components, then
    // serialize the hydrated dom nodes back to into html
    const hydrateResults = (await hydrateApp.hydrateDocument(doc, hydrateOpts));
    results.diagnostics.push(...hydrateResults.diagnostics);
    if (typeof prerenderConfig.filePath === 'function') {
      try {
        const userWriteToFilePath = prerenderConfig.filePath(url, results.filePath);
        if (typeof userWriteToFilePath === 'string') {
          results.filePath = userWriteToFilePath;
        }
      }
      catch (e) {
        catchError(results.diagnostics, e);
      }
    }
    if (hydrateOpts.staticDocument) {
      removeStencilScripts(doc);
      removeModulePreloads(doc);
    }
    else {
      if (Array.isArray(hydrateOpts.staticComponents)) {
        excludeStaticComponents(doc, hydrateOpts, hydrateResults);
      }
      if (hydrateOpts.addModulePreloads) {
        if (!prerenderRequest.isDebug) {
          addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
        }
      }
      else {
        // remove module preloads
        removeModulePreloads(doc);
      }
    }
    const docPromises = [];
    if (hydrateOpts.minifyStyleElements && !prerenderRequest.isDebug) {
      docPromises.push(minifyStyleElements(sys, prerenderRequest.appDir, doc, url, false));
    }
    if (hydrateOpts.minifyScriptElements && !prerenderRequest.isDebug) {
      docPromises.push(minifyScriptElements(doc, false));
    }
    if (hydrateOpts.hashAssets && !prerenderRequest.isDebug) {
      try {
        docPromises.push(hashAssets(sys, prerenderCtx, results.diagnostics, hydrateOpts, prerenderRequest.appDir, doc, url));
      }
      catch (e) {
        catchError(results.diagnostics, e);
      }
    }
    if (docPromises.length > 0) {
      await Promise.all(docPromises);
    }
    if (prerenderConfig.crawlUrls !== false) {
      results.anchorUrls = crawlAnchorsForNextUrls(prerenderConfig, results.diagnostics, baseUrl, url, hydrateResults.anchors);
    }
    if (typeof prerenderConfig.afterHydrate === 'function') {
      try {
        const rtn = prerenderConfig.afterHydrate(doc, url, results);
        if (isPromise(rtn)) {
          await rtn;
        }
      }
      catch (e) {
        catchError(results.diagnostics, e);
      }
    }
    if (typeof hydrateResults.httpStatus === 'number' && hydrateResults.httpStatus >= 400) {
      try {
        win.close();
      }
      catch (e) { }
      return results;
    }
    const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
    prerenderEnsureDir(sys, prerenderCtx, results.filePath);
    const writePromise = sys.writeFile(results.filePath, html);
    if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
      const pageDir = dirname(results.filePath);
      await Promise.all(hydrateResults.staticData.map(async (s) => {
        if (s.type === 'application/json') {
          const data = {
            [s.id]: JSON.parse(s.content),
            components: hydrateResults.components.map((c) => c.tag),
          };
          const dataFileName = `${s.id}.json`;
          const dataFilePath = join(pageDir, dataFileName);
          await sys.writeFile(dataFilePath, JSON.stringify(data));
        }
        else {
          const contentFileName = `${s.id}.txt`;
          const contentFilePath = join(pageDir, contentFileName);
          await sys.writeFile(contentFilePath, s.content);
        }
      }));
    }
    await writePromise;
    try {
      win.close();
    }
    catch (e) { }
  }
  catch (e) {
    // ahh man! what happened!
    catchError(results.diagnostics, e);
  }
  return results;
};
const getComponentGraph = (sys, prerenderCtx, componentGraphPath) => {
  if (componentGraphPath == null) {
    return undefined;
  }
  if (prerenderCtx.componentGraph == null) {
    const componentGraphJson = JSON.parse(sys.readFileSync(componentGraphPath));
    prerenderCtx.componentGraph = new Map(Object.entries(componentGraphJson));
  }
  return prerenderCtx.componentGraph;
};
const prerenderEnsureDir = (sys, prerenderCtx, p) => {
  const allDirs = [];
  while (true) {
    p = normalizePath$2(sys.platformPath.dirname(p));
    if (typeof p === 'string' && p.length > 0 && !isRootPath(p)) {
      allDirs.push(p);
    }
    else {
      break;
    }
  }
  allDirs.reverse();
  for (let i = 0; i < allDirs.length; i++) {
    const dir = allDirs[i];
    if (!prerenderCtx.ensuredDirs.has(dir)) {
      prerenderCtx.ensuredDirs.add(dir);
      sys.createDirSync(dir);
    }
  }
};

const comma = ','.charCodeAt(0);
const semicolon = ';'.charCodeAt(0);
const chars$3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const intToChar = new Uint8Array(64); // 64 possible chars.
const charToInt = new Uint8Array(128); // z is 122 in ASCII
for (let i = 0; i < chars$3.length; i++) {
  const c = chars$3.charCodeAt(i);
  intToChar[i] = c;
  charToInt[c] = i;
}
// Provide a fallback for older environments.
const td = typeof TextDecoder !== 'undefined'
  ? /* #__PURE__ */ new TextDecoder()
  : typeof Buffer !== 'undefined'
    ? {
      decode(buf) {
        const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
        return out.toString();
      },
    }
    : {
      decode(buf) {
        let out = '';
        for (let i = 0; i < buf.length; i++) {
          out += String.fromCharCode(buf[i]);
        }
        return out;
      },
    };
function encode$2(decoded) {
  const state = new Int32Array(5);
  const bufLength = 1024 * 16;
  const subLength = bufLength - 36;
  const buf = new Uint8Array(bufLength);
  const sub = buf.subarray(0, subLength);
  let pos = 0;
  let out = '';
  for (let i = 0; i < decoded.length; i++) {
    const line = decoded[i];
    if (i > 0) {
      if (pos === bufLength) {
        out += td.decode(buf);
        pos = 0;
      }
      buf[pos++] = semicolon;
    }
    if (line.length === 0)
      continue;
    state[0] = 0;
    for (let j = 0; j < line.length; j++) {
      const segment = line[j];
      // We can push up to 5 ints, each int can take at most 7 chars, and we
      // may push a comma.
      if (pos > subLength) {
        out += td.decode(sub);
        buf.copyWithin(0, subLength, pos);
        pos -= subLength;
      }
      if (j > 0)
        buf[pos++] = comma;
      pos = encodeInteger$2(buf, pos, state, segment, 0); // genColumn
      if (segment.length === 1)
        continue;
      pos = encodeInteger$2(buf, pos, state, segment, 1); // sourcesIndex
      pos = encodeInteger$2(buf, pos, state, segment, 2); // sourceLine
      pos = encodeInteger$2(buf, pos, state, segment, 3); // sourceColumn
      if (segment.length === 4)
        continue;
      pos = encodeInteger$2(buf, pos, state, segment, 4); // namesIndex
    }
  }
  return out + td.decode(buf.subarray(0, pos));
}
function encodeInteger$2(buf, pos, state, segment, j) {
  const next = segment[j];
  let num = next - state[j];
  state[j] = next;
  num = num < 0 ? (-num << 1) | 1 : num << 1;
  do {
    let clamped = num & 0b011111;
    num >>>= 5;
    if (num > 0)
      clamped |= 0b100000;
    buf[pos++] = intToChar[clamped];
  } while (num > 0);
  return pos;
}

class BitSet$3 {
	constructor(arg) {
		this.bits = arg instanceof BitSet$3 ? arg.bits.slice() : [];
	}

	add(n) {
		this.bits[n >> 5] |= 1 << (n & 31);
	}

	has(n) {
		return !!(this.bits[n >> 5] & (1 << (n & 31)));
	}
}

class Chunk$3 {
	constructor(start, end, content) {
		this.start = start;
		this.end = end;
		this.original = content;

		this.intro = '';
		this.outro = '';

		this.content = content;
		this.storeName = false;
		this.edited = false;

		{
			this.previous = null;
			this.next = null;
		}
	}

	appendLeft(content) {
		this.outro += content;
	}

	appendRight(content) {
		this.intro = this.intro + content;
	}

	clone() {
		const chunk = new Chunk$3(this.start, this.end, this.original);

		chunk.intro = this.intro;
		chunk.outro = this.outro;
		chunk.content = this.content;
		chunk.storeName = this.storeName;
		chunk.edited = this.edited;

		return chunk;
	}

	contains(index) {
		return this.start < index && index < this.end;
	}

	eachNext(fn) {
		let chunk = this;
		while (chunk) {
			fn(chunk);
			chunk = chunk.next;
		}
	}

	eachPrevious(fn) {
		let chunk = this;
		while (chunk) {
			fn(chunk);
			chunk = chunk.previous;
		}
	}

	edit(content, storeName, contentOnly) {
		this.content = content;
		if (!contentOnly) {
			this.intro = '';
			this.outro = '';
		}
		this.storeName = storeName;

		this.edited = true;

		return this;
	}

	prependLeft(content) {
		this.outro = content + this.outro;
	}

	prependRight(content) {
		this.intro = content + this.intro;
	}

	split(index) {
		const sliceIndex = index - this.start;

		const originalBefore = this.original.slice(0, sliceIndex);
		const originalAfter = this.original.slice(sliceIndex);

		this.original = originalBefore;

		const newChunk = new Chunk$3(index, this.end, originalAfter);
		newChunk.outro = this.outro;
		this.outro = '';

		this.end = index;

		if (this.edited) {
			// TODO is this block necessary?...
			newChunk.edit('', false);
			this.content = '';
		} else {
			this.content = originalBefore;
		}

		newChunk.next = this.next;
		if (newChunk.next) newChunk.next.previous = newChunk;
		newChunk.previous = this;
		this.next = newChunk;

		return newChunk;
	}

	toString() {
		return this.intro + this.content + this.outro;
	}

	trimEnd(rx) {
		this.outro = this.outro.replace(rx, '');
		if (this.outro.length) return true;

		const trimmed = this.content.replace(rx, '');

		if (trimmed.length) {
			if (trimmed !== this.content) {
				this.split(this.start + trimmed.length).edit('', undefined, true);
			}
			return true;
		} else {
			this.edit('', undefined, true);

			this.intro = this.intro.replace(rx, '');
			if (this.intro.length) return true;
		}
	}

	trimStart(rx) {
		this.intro = this.intro.replace(rx, '');
		if (this.intro.length) return true;

		const trimmed = this.content.replace(rx, '');

		if (trimmed.length) {
			if (trimmed !== this.content) {
				this.split(this.end - trimmed.length);
				this.edit('', undefined, true);
			}
			return true;
		} else {
			this.edit('', undefined, true);

			this.outro = this.outro.replace(rx, '');
			if (this.outro.length) return true;
		}
	}
}

function getBtoa () {
	if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
		return (str) => window.btoa(unescape(encodeURIComponent(str)));
	} else if (typeof Buffer === 'function') {
		return (str) => Buffer.from(str, 'utf-8').toString('base64');
	} else {
		return () => {
			throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
		};
	}
}

const btoa$3 = /*#__PURE__*/ getBtoa();

class SourceMap$3 {
	constructor(properties) {
		this.version = 3;
		this.file = properties.file;
		this.sources = properties.sources;
		this.sourcesContent = properties.sourcesContent;
		this.names = properties.names;
		this.mappings = encode$2(properties.mappings);
	}

	toString() {
		return JSON.stringify(this);
	}

	toUrl() {
		return 'data:application/json;charset=utf-8;base64,' + btoa$3(this.toString());
	}
}

function guessIndent$3(code) {
	const lines = code.split('\n');

	const tabbed = lines.filter((line) => /^\t+/.test(line));
	const spaced = lines.filter((line) => /^ {2,}/.test(line));

	if (tabbed.length === 0 && spaced.length === 0) {
		return null;
	}

	// More lines tabbed than spaced? Assume tabs, and
	// default to tabs in the case of a tie (or nothing
	// to go on)
	if (tabbed.length >= spaced.length) {
		return '\t';
	}

	// Otherwise, we need to guess the multiple
	const min = spaced.reduce((previous, current) => {
		const numSpaces = /^ +/.exec(current)[0].length;
		return Math.min(numSpaces, previous);
	}, Infinity);

	return new Array(min + 1).join(' ');
}

function getRelativePath$3(from, to) {
	const fromParts = from.split(/[/\\]/);
	const toParts = to.split(/[/\\]/);

	fromParts.pop(); // get dirname

	while (fromParts[0] === toParts[0]) {
		fromParts.shift();
		toParts.shift();
	}

	if (fromParts.length) {
		let i = fromParts.length;
		while (i--) fromParts[i] = '..';
	}

	return fromParts.concat(toParts).join('/');
}

const toString$3 = Object.prototype.toString;

function isObject$4(thing) {
	return toString$3.call(thing) === '[object Object]';
}

function getLocator$3(source) {
	const originalLines = source.split('\n');
	const lineOffsets = [];

	for (let i = 0, pos = 0; i < originalLines.length; i++) {
		lineOffsets.push(pos);
		pos += originalLines[i].length + 1;
	}

	return function locate(index) {
		let i = 0;
		let j = lineOffsets.length;
		while (i < j) {
			const m = (i + j) >> 1;
			if (index < lineOffsets[m]) {
				j = m;
			} else {
				i = m + 1;
			}
		}
		const line = i - 1;
		const column = index - lineOffsets[line];
		return { line, column };
	};
}

class Mappings$3 {
	constructor(hires) {
		this.hires = hires;
		this.generatedCodeLine = 0;
		this.generatedCodeColumn = 0;
		this.raw = [];
		this.rawSegments = this.raw[this.generatedCodeLine] = [];
		this.pending = null;
	}

	addEdit(sourceIndex, content, loc, nameIndex) {
		if (content.length) {
			const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
			if (nameIndex >= 0) {
				segment.push(nameIndex);
			}
			this.rawSegments.push(segment);
		} else if (this.pending) {
			this.rawSegments.push(this.pending);
		}

		this.advance(content);
		this.pending = null;
	}

	addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
		let originalCharIndex = chunk.start;
		let first = true;

		while (originalCharIndex < chunk.end) {
			if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
				this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
			}

			if (original[originalCharIndex] === '\n') {
				loc.line += 1;
				loc.column = 0;
				this.generatedCodeLine += 1;
				this.raw[this.generatedCodeLine] = this.rawSegments = [];
				this.generatedCodeColumn = 0;
				first = true;
			} else {
				loc.column += 1;
				this.generatedCodeColumn += 1;
				first = false;
			}

			originalCharIndex += 1;
		}

		this.pending = null;
	}

	advance(str) {
		if (!str) return;

		const lines = str.split('\n');

		if (lines.length > 1) {
			for (let i = 0; i < lines.length - 1; i++) {
				this.generatedCodeLine++;
				this.raw[this.generatedCodeLine] = this.rawSegments = [];
			}
			this.generatedCodeColumn = 0;
		}

		this.generatedCodeColumn += lines[lines.length - 1].length;
	}
}

const n$3 = '\n';

const warned$3 = {
	insertLeft: false,
	insertRight: false,
	storeName: false,
};

class MagicString$3 {
	constructor(string, options = {}) {
		const chunk = new Chunk$3(0, string.length, string);

		Object.defineProperties(this, {
			original: { writable: true, value: string },
			outro: { writable: true, value: '' },
			intro: { writable: true, value: '' },
			firstChunk: { writable: true, value: chunk },
			lastChunk: { writable: true, value: chunk },
			lastSearchedChunk: { writable: true, value: chunk },
			byStart: { writable: true, value: {} },
			byEnd: { writable: true, value: {} },
			filename: { writable: true, value: options.filename },
			indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
			sourcemapLocations: { writable: true, value: new BitSet$3() },
			storedNames: { writable: true, value: {} },
			indentStr: { writable: true, value: undefined },
		});

		this.byStart[0] = chunk;
		this.byEnd[string.length] = chunk;
	}

	addSourcemapLocation(char) {
		this.sourcemapLocations.add(char);
	}

	append(content) {
		if (typeof content !== 'string') throw new TypeError('outro content must be a string');

		this.outro += content;
		return this;
	}

	appendLeft(index, content) {
		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');

		this._split(index);

		const chunk = this.byEnd[index];

		if (chunk) {
			chunk.appendLeft(content);
		} else {
			this.intro += content;
		}
		return this;
	}

	appendRight(index, content) {
		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');

		this._split(index);

		const chunk = this.byStart[index];

		if (chunk) {
			chunk.appendRight(content);
		} else {
			this.outro += content;
		}
		return this;
	}

	clone() {
		const cloned = new MagicString$3(this.original, { filename: this.filename });

		let originalChunk = this.firstChunk;
		let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());

		while (originalChunk) {
			cloned.byStart[clonedChunk.start] = clonedChunk;
			cloned.byEnd[clonedChunk.end] = clonedChunk;

			const nextOriginalChunk = originalChunk.next;
			const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();

			if (nextClonedChunk) {
				clonedChunk.next = nextClonedChunk;
				nextClonedChunk.previous = clonedChunk;

				clonedChunk = nextClonedChunk;
			}

			originalChunk = nextOriginalChunk;
		}

		cloned.lastChunk = clonedChunk;

		if (this.indentExclusionRanges) {
			cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
		}

		cloned.sourcemapLocations = new BitSet$3(this.sourcemapLocations);

		cloned.intro = this.intro;
		cloned.outro = this.outro;

		return cloned;
	}

	generateDecodedMap(options) {
		options = options || {};

		const sourceIndex = 0;
		const names = Object.keys(this.storedNames);
		const mappings = new Mappings$3(options.hires);

		const locate = getLocator$3(this.original);

		if (this.intro) {
			mappings.advance(this.intro);
		}

		this.firstChunk.eachNext((chunk) => {
			const loc = locate(chunk.start);

			if (chunk.intro.length) mappings.advance(chunk.intro);

			if (chunk.edited) {
				mappings.addEdit(
					sourceIndex,
					chunk.content,
					loc,
					chunk.storeName ? names.indexOf(chunk.original) : -1
				);
			} else {
				mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
			}

			if (chunk.outro.length) mappings.advance(chunk.outro);
		});

		return {
			file: options.file ? options.file.split(/[/\\]/).pop() : null,
			sources: [options.source ? getRelativePath$3(options.file || '', options.source) : null],
			sourcesContent: options.includeContent ? [this.original] : [null],
			names,
			mappings: mappings.raw,
		};
	}

	generateMap(options) {
		return new SourceMap$3(this.generateDecodedMap(options));
	}

	_ensureindentStr() {
		if (this.indentStr === undefined) {
			this.indentStr = guessIndent$3(this.original);
		}
	}

	_getRawIndentString() {
		this._ensureindentStr();
		return this.indentStr;
	}

	getIndentString() {
		this._ensureindentStr();
		return this.indentStr === null ? '\t' : this.indentStr;
	}

	indent(indentStr, options) {
		const pattern = /^[^\r\n]/gm;

		if (isObject$4(indentStr)) {
			options = indentStr;
			indentStr = undefined;
		}

		if (indentStr === undefined) {
			this._ensureindentStr();
			indentStr = this.indentStr || '\t';
		}

		if (indentStr === '') return this; // noop

		options = options || {};

		// Process exclusion ranges
		const isExcluded = {};

		if (options.exclude) {
			const exclusions =
				typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
			exclusions.forEach((exclusion) => {
				for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
					isExcluded[i] = true;
				}
			});
		}

		let shouldIndentNextCharacter = options.indentStart !== false;
		const replacer = (match) => {
			if (shouldIndentNextCharacter) return `${indentStr}${match}`;
			shouldIndentNextCharacter = true;
			return match;
		};

		this.intro = this.intro.replace(pattern, replacer);

		let charIndex = 0;
		let chunk = this.firstChunk;

		while (chunk) {
			const end = chunk.end;

			if (chunk.edited) {
				if (!isExcluded[charIndex]) {
					chunk.content = chunk.content.replace(pattern, replacer);

					if (chunk.content.length) {
						shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
					}
				}
			} else {
				charIndex = chunk.start;

				while (charIndex < end) {
					if (!isExcluded[charIndex]) {
						const char = this.original[charIndex];

						if (char === '\n') {
							shouldIndentNextCharacter = true;
						} else if (char !== '\r' && shouldIndentNextCharacter) {
							shouldIndentNextCharacter = false;

							if (charIndex === chunk.start) {
								chunk.prependRight(indentStr);
							} else {
								this._splitChunk(chunk, charIndex);
								chunk = chunk.next;
								chunk.prependRight(indentStr);
							}
						}
					}

					charIndex += 1;
				}
			}

			charIndex = chunk.end;
			chunk = chunk.next;
		}

		this.outro = this.outro.replace(pattern, replacer);

		return this;
	}

	insert() {
		throw new Error(
			'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
		);
	}

	insertLeft(index, content) {
		if (!warned$3.insertLeft) {
			console.warn(
				'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
			); // eslint-disable-line no-console
			warned$3.insertLeft = true;
		}

		return this.appendLeft(index, content);
	}

	insertRight(index, content) {
		if (!warned$3.insertRight) {
			console.warn(
				'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
			); // eslint-disable-line no-console
			warned$3.insertRight = true;
		}

		return this.prependRight(index, content);
	}

	move(start, end, index) {
		if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');

		this._split(start);
		this._split(end);
		this._split(index);

		const first = this.byStart[start];
		const last = this.byEnd[end];

		const oldLeft = first.previous;
		const oldRight = last.next;

		const newRight = this.byStart[index];
		if (!newRight && last === this.lastChunk) return this;
		const newLeft = newRight ? newRight.previous : this.lastChunk;

		if (oldLeft) oldLeft.next = oldRight;
		if (oldRight) oldRight.previous = oldLeft;

		if (newLeft) newLeft.next = first;
		if (newRight) newRight.previous = last;

		if (!first.previous) this.firstChunk = last.next;
		if (!last.next) {
			this.lastChunk = first.previous;
			this.lastChunk.next = null;
		}

		first.previous = newLeft;
		last.next = newRight || null;

		if (!newLeft) this.firstChunk = first;
		if (!newRight) this.lastChunk = last;
		return this;
	}

	overwrite(start, end, content, options) {
		options = options || {};
		return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
	}

	update(start, end, content, options) {
		if (typeof content !== 'string') throw new TypeError('replacement content must be a string');

		while (start < 0) start += this.original.length;
		while (end < 0) end += this.original.length;

		if (end > this.original.length) throw new Error('end is out of bounds');
		if (start === end)
			throw new Error(
				'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
			);

		this._split(start);
		this._split(end);

		if (options === true) {
			if (!warned$3.storeName) {
				console.warn(
					'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
				); // eslint-disable-line no-console
				warned$3.storeName = true;
			}

			options = { storeName: true };
		}
		const storeName = options !== undefined ? options.storeName : false;
		const overwrite = options !== undefined ? options.overwrite : false;

		if (storeName) {
			const original = this.original.slice(start, end);
			Object.defineProperty(this.storedNames, original, {
				writable: true,
				value: true,
				enumerable: true,
			});
		}

		const first = this.byStart[start];
		const last = this.byEnd[end];

		if (first) {
			let chunk = first;
			while (chunk !== last) {
				if (chunk.next !== this.byStart[chunk.end]) {
					throw new Error('Cannot overwrite across a split point');
				}
				chunk = chunk.next;
				chunk.edit('', false);
			}

			first.edit(content, storeName, !overwrite);
		} else {
			// must be inserting at the end
			const newChunk = new Chunk$3(start, end, '').edit(content, storeName);

			// TODO last chunk in the array may not be the last chunk, if it's moved...
			last.next = newChunk;
			newChunk.previous = last;
		}
		return this;
	}

	prepend(content) {
		if (typeof content !== 'string') throw new TypeError('outro content must be a string');

		this.intro = content + this.intro;
		return this;
	}

	prependLeft(index, content) {
		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');

		this._split(index);

		const chunk = this.byEnd[index];

		if (chunk) {
			chunk.prependLeft(content);
		} else {
			this.intro = content + this.intro;
		}
		return this;
	}

	prependRight(index, content) {
		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');

		this._split(index);

		const chunk = this.byStart[index];

		if (chunk) {
			chunk.prependRight(content);
		} else {
			this.outro = content + this.outro;
		}
		return this;
	}

	remove(start, end) {
		while (start < 0) start += this.original.length;
		while (end < 0) end += this.original.length;

		if (start === end) return this;

		if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
		if (start > end) throw new Error('end must be greater than start');

		this._split(start);
		this._split(end);

		let chunk = this.byStart[start];

		while (chunk) {
			chunk.intro = '';
			chunk.outro = '';
			chunk.edit('');

			chunk = end > chunk.end ? this.byStart[chunk.end] : null;
		}
		return this;
	}

	lastChar() {
		if (this.outro.length) return this.outro[this.outro.length - 1];
		let chunk = this.lastChunk;
		do {
			if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
			if (chunk.content.length) return chunk.content[chunk.content.length - 1];
			if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
		} while ((chunk = chunk.previous));
		if (this.intro.length) return this.intro[this.intro.length - 1];
		return '';
	}

	lastLine() {
		let lineIndex = this.outro.lastIndexOf(n$3);
		if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
		let lineStr = this.outro;
		let chunk = this.lastChunk;
		do {
			if (chunk.outro.length > 0) {
				lineIndex = chunk.outro.lastIndexOf(n$3);
				if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
				lineStr = chunk.outro + lineStr;
			}

			if (chunk.content.length > 0) {
				lineIndex = chunk.content.lastIndexOf(n$3);
				if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
				lineStr = chunk.content + lineStr;
			}

			if (chunk.intro.length > 0) {
				lineIndex = chunk.intro.lastIndexOf(n$3);
				if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
				lineStr = chunk.intro + lineStr;
			}
		} while ((chunk = chunk.previous));
		lineIndex = this.intro.lastIndexOf(n$3);
		if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
		return this.intro + lineStr;
	}

	slice(start = 0, end = this.original.length) {
		while (start < 0) start += this.original.length;
		while (end < 0) end += this.original.length;

		let result = '';

		// find start chunk
		let chunk = this.firstChunk;
		while (chunk && (chunk.start > start || chunk.end <= start)) {
			// found end chunk before start
			if (chunk.start < end && chunk.end >= end) {
				return result;
			}

			chunk = chunk.next;
		}

		if (chunk && chunk.edited && chunk.start !== start)
			throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);

		const startChunk = chunk;
		while (chunk) {
			if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
				result += chunk.intro;
			}

			const containsEnd = chunk.start < end && chunk.end >= end;
			if (containsEnd && chunk.edited && chunk.end !== end)
				throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);

			const sliceStart = startChunk === chunk ? start - chunk.start : 0;
			const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;

			result += chunk.content.slice(sliceStart, sliceEnd);

			if (chunk.outro && (!containsEnd || chunk.end === end)) {
				result += chunk.outro;
			}

			if (containsEnd) {
				break;
			}

			chunk = chunk.next;
		}

		return result;
	}

	// TODO deprecate this? not really very useful
	snip(start, end) {
		const clone = this.clone();
		clone.remove(0, start);
		clone.remove(end, clone.original.length);

		return clone;
	}

	_split(index) {
		if (this.byStart[index] || this.byEnd[index]) return;

		let chunk = this.lastSearchedChunk;
		const searchForward = index > chunk.end;

		while (chunk) {
			if (chunk.contains(index)) return this._splitChunk(chunk, index);

			chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
		}
	}

	_splitChunk(chunk, index) {
		if (chunk.edited && chunk.content.length) {
			// zero-length edited chunks are a special case (overlapping replacements)
			const loc = getLocator$3(this.original)(index);
			throw new Error(
				`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
			);
		}

		const newChunk = chunk.split(index);

		this.byEnd[index] = chunk;
		this.byStart[index] = newChunk;
		this.byEnd[newChunk.end] = newChunk;

		if (chunk === this.lastChunk) this.lastChunk = newChunk;

		this.lastSearchedChunk = chunk;
		return true;
	}

	toString() {
		let str = this.intro;

		let chunk = this.firstChunk;
		while (chunk) {
			str += chunk.toString();
			chunk = chunk.next;
		}

		return str + this.outro;
	}

	isEmpty() {
		let chunk = this.firstChunk;
		do {
			if (
				(chunk.intro.length && chunk.intro.trim()) ||
				(chunk.content.length && chunk.content.trim()) ||
				(chunk.outro.length && chunk.outro.trim())
			)
				return false;
		} while ((chunk = chunk.next));
		return true;
	}

	length() {
		let chunk = this.firstChunk;
		let length = 0;
		do {
			length += chunk.intro.length + chunk.content.length + chunk.outro.length;
		} while ((chunk = chunk.next));
		return length;
	}

	trimLines() {
		return this.trim('[\\r\\n]');
	}

	trim(charType) {
		return this.trimStart(charType).trimEnd(charType);
	}

	trimEndAborted(charType) {
		const rx = new RegExp((charType || '\\s') + '+$');

		this.outro = this.outro.replace(rx, '');
		if (this.outro.length) return true;

		let chunk = this.lastChunk;

		do {
			const end = chunk.end;
			const aborted = chunk.trimEnd(rx);

			// if chunk was trimmed, we have a new lastChunk
			if (chunk.end !== end) {
				if (this.lastChunk === chunk) {
					this.lastChunk = chunk.next;
				}

				this.byEnd[chunk.end] = chunk;
				this.byStart[chunk.next.start] = chunk.next;
				this.byEnd[chunk.next.end] = chunk.next;
			}

			if (aborted) return true;
			chunk = chunk.previous;
		} while (chunk);

		return false;
	}

	trimEnd(charType) {
		this.trimEndAborted(charType);
		return this;
	}
	trimStartAborted(charType) {
		const rx = new RegExp('^' + (charType || '\\s') + '+');

		this.intro = this.intro.replace(rx, '');
		if (this.intro.length) return true;

		let chunk = this.firstChunk;

		do {
			const end = chunk.end;
			const aborted = chunk.trimStart(rx);

			if (chunk.end !== end) {
				// special case...
				if (chunk === this.lastChunk) this.lastChunk = chunk.next;

				this.byEnd[chunk.end] = chunk;
				this.byStart[chunk.next.start] = chunk.next;
				this.byEnd[chunk.next.end] = chunk.next;
			}

			if (aborted) return true;
			chunk = chunk.next;
		} while (chunk);

		return false;
	}

	trimStart(charType) {
		this.trimStartAborted(charType);
		return this;
	}

	hasChanged() {
		return this.original !== this.toString();
	}

	_replaceRegexp(searchValue, replacement) {
		function getReplacement(match, str) {
			if (typeof replacement === 'string') {
				return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
					// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter
					if (i === '$') return '$';
					if (i === '&') return match[0];
					const num = +i;
					if (num < match.length) return match[+i];
					return `$${i}`;
				});
			} else {
				return replacement(...match, match.index, str, match.groups);
			}
		}
		function matchAll(re, str) {
			let match;
			const matches = [];
			while ((match = re.exec(str))) {
				matches.push(match);
			}
			return matches;
		}
		if (searchValue.global) {
			const matches = matchAll(searchValue, this.original);
			matches.forEach((match) => {
				if (match.index != null)
					this.overwrite(
						match.index,
						match.index + match[0].length,
						getReplacement(match, this.original)
					);
			});
		} else {
			const match = this.original.match(searchValue);
			if (match && match.index != null)
				this.overwrite(
					match.index,
					match.index + match[0].length,
					getReplacement(match, this.original)
				);
		}
		return this;
	}

	_replaceString(string, replacement) {
		const { original } = this;
		const index = original.indexOf(string);

		if (index !== -1) {
			this.overwrite(index, index + string.length, replacement);
		}

		return this;
	}

	replace(searchValue, replacement) {
		if (typeof searchValue === 'string') {
			return this._replaceString(searchValue, replacement);
		}

		return this._replaceRegexp(searchValue, replacement);
	}

	_replaceAllString(string, replacement) {
		const { original } = this;
		const stringLength = string.length;
		for (
			let index = original.indexOf(string);
			index !== -1;
			index = original.indexOf(string, index + stringLength)
		) {
			this.overwrite(index, index + stringLength, replacement);
		}

		return this;
	}

	replaceAll(searchValue, replacement) {
		if (typeof searchValue === 'string') {
			return this._replaceAllString(searchValue, replacement);
		}

		if (!searchValue.global) {
			throw new TypeError(
				'MagicString.prototype.replaceAll called with a non-global RegExp argument'
			);
		}

		return this._replaceRegexp(searchValue, replacement);
	}
}

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 *
 * This file is a port of shadowCSS from webcomponents.js to TypeScript.
 * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
 * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
 */
const safeSelector = (selector) => {
  const placeholders = [];
  let index = 0;
  // Replaces attribute selectors with placeholders.
  // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
  selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
    const replaceBy = `__ph-${index}__`;
    placeholders.push(keep);
    index++;
    return replaceBy;
  });
  // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
  // WS and "+" would otherwise be interpreted as selector separators.
  const content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
    const replaceBy = `__ph-${index}__`;
    placeholders.push(exp);
    index++;
    return pseudo + replaceBy;
  });
  const ss = {
    content,
    placeholders,
  };
  return ss;
};
const restoreSafeSelector = (placeholders, content) => {
  return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
};
const _polyfillHost = '-shadowcsshost';
const _polyfillSlotted = '-shadowcssslotted';
// note: :host-context pre-processed to -shadowcsshostcontext.
const _polyfillHostContext = '-shadowcsscontext';
const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
const _polyfillHostRe = /-shadowcsshost/gim;
const _colonHostRe = /:host/gim;
const _colonSlottedRe = /::slotted/gim;
const _colonHostContextRe = /:host-context/gim;
const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
const stripComments = (input) => {
  return input.replace(_commentRe, '');
};
const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
const extractCommentsWithHash = (input) => {
  return input.match(_commentWithHashRe) || [];
};
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
const _curlyRe = /([{}])/g;
const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
const OPEN_CURLY = '{';
const CLOSE_CURLY = '}';
const BLOCK_PLACEHOLDER = '%BLOCK%';
const processRules = (input, ruleCallback) => {
  const inputWithEscapedBlocks = escapeBlocks(input);
  let nextBlockIndex = 0;
  return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
    const selector = m[2];
    let content = '';
    let suffix = m[4];
    let contentPrefix = '';
    if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
      content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
      suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
      contentPrefix = '{';
    }
    const cssRule = {
      selector,
      content,
    };
    const rule = ruleCallback(cssRule);
    return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
  });
};
const escapeBlocks = (input) => {
  const inputParts = input.split(_curlyRe);
  const resultParts = [];
  const escapedBlocks = [];
  let bracketCount = 0;
  let currentBlockParts = [];
  for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
    const part = inputParts[partIndex];
    if (part === CLOSE_CURLY) {
      bracketCount--;
    }
    if (bracketCount > 0) {
      currentBlockParts.push(part);
    }
    else {
      if (currentBlockParts.length > 0) {
        escapedBlocks.push(currentBlockParts.join(''));
        resultParts.push(BLOCK_PLACEHOLDER);
        currentBlockParts = [];
      }
      resultParts.push(part);
    }
    if (part === OPEN_CURLY) {
      bracketCount++;
    }
  }
  if (currentBlockParts.length > 0) {
    escapedBlocks.push(currentBlockParts.join(''));
    resultParts.push(BLOCK_PLACEHOLDER);
  }
  const strEscapedBlocks = {
    escapedString: resultParts.join(''),
    blocks: escapedBlocks,
  };
  return strEscapedBlocks;
};
const insertPolyfillHostInCssText = (selector) => {
  selector = selector
    .replace(_colonHostContextRe, _polyfillHostContext)
    .replace(_colonHostRe, _polyfillHost)
    .replace(_colonSlottedRe, _polyfillSlotted);
  return selector;
};
const convertColonRule = (cssText, regExp, partReplacer) => {
  // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
  return cssText.replace(regExp, (...m) => {
    if (m[2]) {
      const parts = m[2].split(',');
      const r = [];
      for (let i = 0; i < parts.length; i++) {
        const p = parts[i].trim();
        if (!p)
          break;
        r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
      }
      return r.join(',');
    }
    else {
      return _polyfillHostNoCombinator + m[3];
    }
  });
};
const colonHostPartReplacer = (host, part, suffix) => {
  return host + part.replace(_polyfillHost, '') + suffix;
};
const convertColonHost = (cssText) => {
  return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
};
const colonHostContextPartReplacer = (host, part, suffix) => {
  if (part.indexOf(_polyfillHost) > -1) {
    return colonHostPartReplacer(host, part, suffix);
  }
  else {
    return host + part + suffix + ', ' + part + ' ' + host + suffix;
  }
};
const convertColonSlotted = (cssText, slotScopeId) => {
  const slotClass = '.' + slotScopeId + ' > ';
  const selectors = [];
  cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
    if (m[2]) {
      const compound = m[2].trim();
      const suffix = m[3];
      const slottedSelector = slotClass + compound + suffix;
      let prefixSelector = '';
      for (let i = m[4] - 1; i >= 0; i--) {
        const char = m[5][i];
        if (char === '}' || char === ',') {
          break;
        }
        prefixSelector = char + prefixSelector;
      }
      const orgSelector = prefixSelector + slottedSelector;
      const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
      if (orgSelector.trim() !== addedSelector.trim()) {
        const updatedSelector = `${addedSelector}, ${orgSelector}`;
        selectors.push({
          orgSelector,
          updatedSelector,
        });
      }
      return slottedSelector;
    }
    else {
      return _polyfillHostNoCombinator + m[3];
    }
  });
  return {
    selectors,
    cssText,
  };
};
const convertColonHostContext = (cssText) => {
  return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
};
const convertShadowDOMSelectors = (cssText) => {
  return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
};
const makeScopeMatcher = (scopeSelector) => {
  const lre = /\[/g;
  const rre = /\]/g;
  scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
  return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
};
const selectorNeedsScoping = (selector, scopeSelector) => {
  const re = makeScopeMatcher(scopeSelector);
  return !re.test(selector);
};
const injectScopingSelector = (selector, scopingSelector) => {
  return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
    return before + scopingSelector + colon + after;
  });
};
const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
  // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
  _polyfillHostRe.lastIndex = 0;
  if (_polyfillHostRe.test(selector)) {
    const replaceBy = `.${hostSelector}`;
    return selector
      .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
      .replace(_polyfillHostRe, replaceBy + ' ');
  }
  return scopeSelector + ' ' + selector;
};
const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
  const isRe = /\[is=([^\]]*)\]/g;
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
  const className = '.' + scopeSelector;
  const _scopeSelectorPart = (p) => {
    let scopedP = p.trim();
    if (!scopedP) {
      return '';
    }
    if (p.indexOf(_polyfillHostNoCombinator) > -1) {
      scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
    }
    else {
      // remove :host since it should be unnecessary
      const t = p.replace(_polyfillHostRe, '');
      if (t.length > 0) {
        scopedP = injectScopingSelector(t, className);
      }
    }
    return scopedP;
  };
  const safeContent = safeSelector(selector);
  selector = safeContent.content;
  let scopedSelector = '';
  let startIndex = 0;
  let res;
  const sep = /( |>|\+|~(?!=))\s*/g;
  // If a selector appears before :host it should not be shimmed as it
  // matches on ancestor elements and not on elements in the host's shadow
  // `:host-context(div)` is transformed to
  // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
  // the `div` is not part of the component in the 2nd selectors and should not be scoped.
  // Historically `component-tag:host` was matching the component so we also want to preserve
  // this behavior to avoid breaking legacy apps (it should not match).
  // The behavior should be:
  // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
  // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
  //   `:host-context(tag)`)
  const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
  // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
  let shouldScope = !hasHost;
  while ((res = sep.exec(selector)) !== null) {
    const separator = res[1];
    const part = selector.slice(startIndex, res.index).trim();
    shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
    const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
    scopedSelector += `${scopedPart} ${separator} `;
    startIndex = sep.lastIndex;
  }
  const part = selector.substring(startIndex);
  shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
  scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
  // replace the placeholders with their original values
  return restoreSafeSelector(safeContent.placeholders, scopedSelector);
};
const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
  return selector
    .split(',')
    .map((shallowPart) => {
    if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
      return shallowPart.trim();
    }
    if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
      return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
    }
    else {
      return shallowPart.trim();
    }
  })
    .join(', ');
};
const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
  return processRules(cssText, (rule) => {
    let selector = rule.selector;
    let content = rule.content;
    if (rule.selector[0] !== '@') {
      selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
    }
    else if (rule.selector.startsWith('@media') ||
      rule.selector.startsWith('@supports') ||
      rule.selector.startsWith('@page') ||
      rule.selector.startsWith('@document')) {
      content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
    }
    const cssRule = {
      selector: selector.replace(/\s{2,}/g, ' ').trim(),
      content,
    };
    return cssRule;
  });
};
const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
  cssText = insertPolyfillHostInCssText(cssText);
  cssText = convertColonHost(cssText);
  cssText = convertColonHostContext(cssText);
  const slotted = convertColonSlotted(cssText, slotScopeId);
  cssText = slotted.cssText;
  cssText = convertShadowDOMSelectors(cssText);
  if (scopeId) {
    cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
  }
  cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
  cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
  return {
    cssText: cssText.trim(),
    slottedSelectors: slotted.selectors,
  };
};
const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
  const hostScopeId = scopeId + '-h';
  const slotScopeId = scopeId + '-s';
  const commentsWithHash = extractCommentsWithHash(cssText);
  cssText = stripComments(cssText);
  const orgSelectors = [];
  if (commentOriginalSelector) {
    const processCommentedSelector = (rule) => {
      const placeholder = `/*!@___${orgSelectors.length}___*/`;
      const comment = `/*!@${rule.selector}*/`;
      orgSelectors.push({ placeholder, comment });
      rule.selector = placeholder + rule.selector;
      return rule;
    };
    cssText = processRules(cssText, (rule) => {
      if (rule.selector[0] !== '@') {
        return processCommentedSelector(rule);
      }
      else if (rule.selector.startsWith('@media') ||
        rule.selector.startsWith('@supports') ||
        rule.selector.startsWith('@page') ||
        rule.selector.startsWith('@document')) {
        rule.content = processRules(rule.content, processCommentedSelector);
        return rule;
      }
      return rule;
    });
  }
  const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
  cssText = [scoped.cssText, ...commentsWithHash].join('\n');
  if (commentOriginalSelector) {
    orgSelectors.forEach(({ placeholder, comment }) => {
      cssText = cssText.replace(placeholder, comment);
    });
  }
  scoped.slottedSelectors.forEach((slottedSelector) => {
    cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
  });
  return cssText;
};

/**
 * Parse CSS docstrings that Stencil supports, as documented here:
 * https://stenciljs.com/docs/docs-json#css-variables
 *
 * Docstrings found in the supplied style text will be added to the
 * `styleDocs` param
 *
 * @param styleDocs the array to hold formatted CSS docstrings
 * @param styleText the CSS text we're working with
 */
function parseStyleDocs(styleDocs, styleText) {
  if (typeof styleText !== 'string') {
    return;
  }
  let startIndex;
  while ((startIndex = styleText.indexOf(CSS_DOC_START)) > -1) {
    styleText = styleText.substring(startIndex + CSS_DOC_START.length);
    const endIndex = styleText.indexOf(CSS_DOC_END);
    if (endIndex === -1) {
      break;
    }
    const comment = styleText.substring(0, endIndex);
    parseCssComment(styleDocs, comment);
    styleText = styleText.substring(endIndex + CSS_DOC_END.length);
  }
}
/**
 * Parse a CSS comment string and insert it into the provided array of
 * style docstrings.
 *
 * @param styleDocs an array which will be modified with the docstring
 * @param comment the comment string
 */
function parseCssComment(styleDocs, comment) {
  /**
   * @prop --max-width: Max width of the alert
   */
  // (the above is an example of what these comments might look like)
  const lines = comment.split(/\r?\n/).map((line) => {
    line = line.trim();
    while (line.startsWith('*')) {
      line = line.substring(1).trim();
    }
    return line;
  });
  comment = lines.join(' ').replace(/\t/g, ' ').trim();
  while (comment.includes('  ')) {
    comment = comment.replace('  ', ' ');
  }
  const docs = comment.split(CSS_PROP_ANNOTATION);
  docs.forEach((d) => {
    const doc = d.trim();
    if (!doc.startsWith(`--`)) {
      return;
    }
    const splt = doc.split(`:`);
    const cssDoc = {
      name: splt[0].trim(),
      docs: (splt.shift() && splt.join(`:`)).trim(),
      annotation: 'prop',
    };
    if (!styleDocs.some((c) => c.name === cssDoc.name && c.annotation === 'prop')) {
      styleDocs.push(cssDoc);
    }
  });
}
/**
 * Opening syntax for a CSS docstring
 */
const CSS_DOC_START = '/**';
/**
 * Closing syntax for a CSS docstring
 */
const CSS_DOC_END = '*/';
/**
 * The `@prop` annotation we support within CSS docstrings
 */
const CSS_PROP_ANNOTATION = '@prop';

/**
 * Serialize data about a style import to an annotated path, where
 * the filename has a URL queryparams style string appended to it.
 * This could look like:
 *
 * ```
 * './some-file.CSS?tag=my-tag&mode=ios&encapsulation=scoped');
 * ```
 *
 * @param data import data to be serialized
 * @param styleImportData an argument which controls whether the import data
 * will be added to the path (formatted as queryparams)
 * @returns a formatted string
 */
const serializeImportPath = (data, styleImportData) => {
  let p = data.importeePath;
  if (isString$1(p)) {
    if (isString$1(data.importerPath) && isAbsolute$1(data.importeePath)) {
      p = relative$1(dirname(data.importerPath), data.importeePath);
    }
    p = normalizePath$2(p);
    if (!p.startsWith('.')) {
      p = './' + p;
    }
    if (styleImportData === 'queryparams' || styleImportData === undefined) {
      const paramData = {};
      if (isString$1(data.tag)) {
        paramData.tag = data.tag;
      }
      if (isString$1(data.mode) && data.mode !== DEFAULT_STYLE_MODE) {
        paramData.mode = data.mode;
      }
      if (isString$1(data.encapsulation) && data.encapsulation !== 'none') {
        paramData.encapsulation = data.encapsulation;
      }
      const paramEntries = Object.entries(paramData);
      if (paramEntries.length > 0) {
        const params = new URLSearchParams(paramEntries);
        p += '?' + params.toString();
      }
    }
  }
  return p;
};
/**
 * Parse import paths (filepaths possibly annotated w/ component metadata,
 * formatted as URL queryparams) into a structured format.
 *
 * @param importPath an annotated import path to examine
 * @returns formatted information about the import
 */
const parseImportPath = (importPath) => {
  const parsedPath = {
    importPath,
    basename: null,
    ext: null,
    data: null,
  };
  if (isString$1(importPath)) {
    const pathParts = importPath.split('?');
    parsedPath.basename = basename(pathParts[0].trim());
    const extParts = parsedPath.basename.toLowerCase().split('.');
    if (extParts.length > 1) {
      parsedPath.ext = extParts[extParts.length - 1];
      if (parsedPath.ext === 'ts' && extParts[extParts.length - 2] === 'd') {
        parsedPath.ext = 'd.ts';
      }
    }
    if (pathParts.length > 1) {
      const params = pathParts[1];
      const urlParams = new URLSearchParams(params);
      const tag = urlParams.get('tag');
      if (tag != null) {
        parsedPath.data = {
          tag,
          encapsulation: urlParams.get('encapsulation') || 'none',
          mode: urlParams.get('mode') || DEFAULT_STYLE_MODE,
        };
      }
    }
    else if (parsedPath.basename.endsWith('.css')) {
      parsedPath.data = {
        encapsulation: 'none',
      };
    }
  }
  return parsedPath;
};

/**
 * Strip out comments from some CSS
 *
 * @param input the string we'd like to de-comment
 * @returns de-commented CSS!
 */
const stripCssComments = (input) => {
  let isInsideString = null;
  let currentCharacter = '';
  let returnValue = '';
  for (let i = 0; i < input.length; i++) {
    currentCharacter = input[i];
    if (input[i - 1] !== '\\') {
      if (currentCharacter === '"' || currentCharacter === "'") {
        if (isInsideString === currentCharacter) {
          isInsideString = null;
        }
        else if (!isInsideString) {
          isInsideString = currentCharacter;
        }
      }
    }
    // Find beginning of /* type comment
    if (!isInsideString && currentCharacter === '/' && input[i + 1] === '*') {
      // Ignore important comment when configured to preserve comments using important syntax: /*!
      let j = i + 2;
      // Iterate over comment
      for (; j < input.length; j++) {
        // Find end of comment
        if (input[j] === '*' && input[j + 1] === '/') {
          break;
        }
      }
      // Resume iteration over CSS string from the end of the comment
      i = j + 1;
      continue;
    }
    returnValue += currentCharacter;
  }
  return returnValue;
};

/**
 * A regular expression for matching CSS import statements
 *
 * According to https://developer.mozilla.org/en-US/docs/Web/CSS/@import
 * the formal grammar for CSS import statements is:
 *
 * ```
 * @import [ <url> | <string> ]
 *     [ supports( [ <supports-condition> | <declaration> ] ) ]?
 *     <media-query-list>? ;
 * ```
 *
 * Thus the string literal `"@import"` will be followed by a `<url>` or a
 * `<string>`, where a `<url>` may be a relative or absolute URL _or_ a `url()`
 * function.
 *
 * Thus the regular expression needs to match:
 *
 * - the string `"@import
 * - any amount of whitespace
 * - a URL, comprised of:
 *   - an optional `url(` function opener
 *   - a non-greedy match on any characters (to match the argument to the URL
 *   function)
 *   - an optional `)` closing paren on the `url()` function
 * - trailing characters after the URL, given by anything which doesn't match
 *   the line-terminator `;`
 *   - this can match media queries, support conditions, and so on
 * - a line-terminating semicolon
 *
 * The regex has 4 capture groups:
 *
 * 1. `@import`
 * 2. `url(`
 * 3. characters after `url(`
 * 4. all characters other than `;`, greedily matching
 *
 * We typically only care about group 4 here.
 */
const CSS_IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
/**
 * Our main entry point to this module. This performs an async transformation
 * of CSS input to ESM.
 *
 * @param input CSS input to be transformed to ESM
 * @returns a promise wrapping transformed ESM output
 */
const transformCssToEsm = async (input) => {
  const results = transformCssToEsmModule(input);
  const optimizeResults = await optimizeCss$1({
    autoprefixer: input.autoprefixer,
    input: results.styleText,
    filePath: input.file,
    minify: true,
    sourceMap: input.sourceMap,
  });
  results.diagnostics.push(...optimizeResults.diagnostics);
  if (hasError(optimizeResults.diagnostics)) {
    return results;
  }
  results.styleText = optimizeResults.output;
  return generateTransformCssToEsm(input, results);
};
/**
 * A sync function for transforming input CSS to ESM
 *
 * @param input the input CSS we're going to transform
 * @returns transformed ESM output
 */
const transformCssToEsmSync = (input) => {
  const results = transformCssToEsmModule(input);
  return generateTransformCssToEsm(input, results);
};
/**
 * Performs the actual transformation from CSS to ESM
 *
 * @param input input CSS to be transformed
 * @returns ESM output
 */
const transformCssToEsmModule = (input) => {
  const results = {
    styleText: input.input,
    output: '',
    map: null,
    diagnostics: [],
    imports: [],
    defaultVarName: createCssVarName(input.file, input.mode),
    styleDocs: [],
  };
  if (input.docs) {
    parseStyleDocs(results.styleDocs, input.input);
  }
  try {
    const varNames = new Set([results.defaultVarName]);
    if (isString$1(input.tag)) {
      if (input.encapsulation === 'scoped' || (input.encapsulation === 'shadow' && input.commentOriginalSelector)) {
        const scopeId = getScopeId(input.tag, input.mode);
        results.styleText = scopeCss(results.styleText, scopeId, input.commentOriginalSelector);
      }
    }
    const cssImports = getCssToEsmImports(varNames, results.styleText, input.file, input.mode);
    cssImports.forEach((cssImport) => {
      // remove the original css @imports
      results.styleText = results.styleText.replace(cssImport.srcImportText, '');
      const importPath = serializeImportPath({
        importeePath: cssImport.filePath,
        importerPath: input.file,
        tag: input.tag,
        encapsulation: input.encapsulation,
        mode: input.mode,
      }, input.styleImportData);
      // str.append(`import ${cssImport.varName} from '${importPath}';\n`);
      results.imports.push({
        varName: cssImport.varName,
        importPath,
      });
    });
  }
  catch (e) {
    catchError(results.diagnostics, e);
  }
  return results;
};
/**
 * Updated the `output` property on `results` with appropriate import statements for
 * the CSS import tree and the module type.
 *
 * @param input the CSS to ESM transform input
 * @param results the corresponding output
 * @returns the modified ESM output
 */
const generateTransformCssToEsm = (input, results) => {
  const s = new MagicString$3('');
  if (input.module === 'cjs') {
    // CommonJS
    results.imports.forEach((cssImport) => {
      s.append(`const ${cssImport.varName} = require('${cssImport.importPath}');\n`);
    });
    s.append(`const ${results.defaultVarName} = `);
    results.imports.forEach((cssImport) => {
      s.append(`${cssImport.varName} + `);
    });
    s.append(`${JSON.stringify(results.styleText)};\n`);
    s.append(`module.exports = ${results.defaultVarName};`);
  }
  else {
    // ESM
    results.imports.forEach((cssImport) => {
      s.append(`import ${cssImport.varName} from '${cssImport.importPath}';\n`);
    });
    s.append(`const ${results.defaultVarName} = `);
    results.imports.forEach((cssImport) => {
      s.append(`${cssImport.varName} + `);
    });
    s.append(`${JSON.stringify(results.styleText)};\n`);
    s.append(`export default ${results.defaultVarName};`);
  }
  results.output = s.toString();
  return results;
};
/**
 * Get all of the CSS imports in a file
 *
 * @param varNames a set into which new names will be added
 * @param cssText the CSS text in question
 * @param filePath the file path to the file in question
 * @param modeName the current mode name
 * @returns an array of import objects
 */
const getCssToEsmImports = (varNames, cssText, filePath, modeName) => {
  const cssImports = [];
  if (!cssText.includes('@import')) {
    // no @import at all, so don't bother
    return cssImports;
  }
  cssText = stripCssComments(cssText);
  const dir = path$5.dirname(filePath);
  let r;
  while ((r = CSS_IMPORT_RE.exec(cssText))) {
    const cssImportData = {
      srcImportText: r[0],
      url: r[4].replace(/[\"\'\)]/g, ''),
      filePath: null,
      varName: null,
    };
    if (!isLocalCssImport$1(cssImportData.srcImportText)) {
      // do nothing for @import url(http://external.css)
      continue;
    }
    else if (isCssNodeModule$1(cssImportData.url)) {
      // do not resolve this path cuz it starts with node resolve id ~
      continue;
    }
    else if (path$5.isAbsolute(cssImportData.url)) {
      // absolute path already
      cssImportData.filePath = normalizePath$2(cssImportData.url);
    }
    else {
      // relative path
      cssImportData.filePath = normalizePath$2(path$5.resolve(dir, cssImportData.url));
    }
    cssImportData.varName = createCssVarName(cssImportData.filePath, modeName);
    if (varNames.has(cssImportData.varName)) {
      cssImportData.varName += varNames.size;
    }
    varNames.add(cssImportData.varName);
    cssImports.push(cssImportData);
  }
  return cssImports;
};
/**
 * Check if a module URL is a css node module
 *
 * @param url to check
 * @returns whether or not it's a Css node module
 */
const isCssNodeModule$1 = (url) => {
  return url.startsWith('~');
};
/**
 * Check if a given import is a local import or not (i.e. check that it
 * is not importing from some other domain)
 *
 * @param srcImport the import to check
 * @returns whether it's local or not
 */
const isLocalCssImport$1 = (srcImport) => {
  srcImport = srcImport.toLowerCase();
  if (srcImport.includes('url(')) {
    srcImport = srcImport.replace(/\"/g, '');
    srcImport = srcImport.replace(/\'/g, '');
    srcImport = srcImport.replace(/\s/g, '');
    if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
      return false;
    }
  }
  return true;
};
/**
 * Given a file path and a mode name, create an appropriate variable name
 *
 * @param filePath the path we want to use
 * @param modeName the name for the current style mode (i.e. `md` or `ios` on Ionic)
 * @returns an appropriate Css var name
 */
const createCssVarName = (filePath, modeName) => {
  let varName = path$5.basename(filePath);
  if (modeName && modeName !== DEFAULT_STYLE_MODE && !varName.includes(modeName)) {
    varName = modeName + '-' + varName;
  }
  return createJsVarName(varName);
};

const createWorkerContext = (sys) => ({
  transformCssToEsm,
  prepareModule,
  optimizeCss: optimizeCss$1,
  prerenderWorker: (prerenderRequest) => prerenderWorker(sys, prerenderRequest),
});
const createWorkerMessageHandler = (sys) => {
  const workerCtx = createWorkerContext(sys);
  return (msgToWorker) => {
    const fnName = msgToWorker.args[0];
    const fnArgs = msgToWorker.args.slice(1);
    const fn = workerCtx[fnName];
    if (typeof fn === 'function') {
      return fn(...fnArgs);
    }
  };
};

/**
 * The CompilerCtx is a persistent object that's reused throughout
 * all builds and rebuilds. The data within this object is used
 * for in-memory caching, and can be reset, but the object itself
 * is always the same.
 */
class CompilerContext {
  constructor() {
    this.version = 2;
    this.activeBuildId = -1;
    this.activeFilesAdded = [];
    this.activeFilesDeleted = [];
    this.activeFilesUpdated = [];
    this.activeDirsAdded = [];
    this.activeDirsDeleted = [];
    this.addWatchDir = noop$1;
    this.addWatchFile = noop$1;
    this.cssModuleImports = new Map();
    this.changedFiles = new Set();
    this.changedModules = new Set();
    this.collections = [];
    this.compilerOptions = null;
    this.events = buildEvents();
    this.hasSuccessfulBuild = false;
    this.isActivelyBuilding = false;
    this.lastBuildResults = null;
    this.moduleMap = new Map();
    this.nodeMap = new WeakMap();
    this.resolvedCollections = new Set();
    this.rollupCache = new Map();
    this.rollupCacheHydrate = null;
    this.rollupCacheLazy = null;
    this.rollupCacheNative = null;
    this.styleModeNames = new Set();
    this.worker = null;
  }
  reset() {
    this.cache.clear();
    this.cssModuleImports.clear();
    this.cachedGlobalStyle = null;
    this.collections.length = 0;
    this.compilerOptions = null;
    this.hasSuccessfulBuild = false;
    this.rollupCacheHydrate = null;
    this.rollupCacheLazy = null;
    this.rollupCacheNative = null;
    this.moduleMap.clear();
    this.resolvedCollections.clear();
    if (this.fs != null) {
      this.fs.clearCache();
    }
  }
}
const getModuleLegacy = (_config, compilerCtx, sourceFilePath) => {
  sourceFilePath = normalizePath$2(sourceFilePath);
  const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
  if (moduleFile != null) {
    return moduleFile;
  }
  else {
    const sourceFileDir = dirname(sourceFilePath);
    const sourceFileExt = extname$1(sourceFilePath);
    const sourceFileName = basename(sourceFilePath, sourceFileExt);
    const jsFilePath = join(sourceFileDir, sourceFileName + '.js');
    const moduleFile = {
      sourceFilePath: sourceFilePath,
      jsFilePath: jsFilePath,
      cmps: [],
      coreRuntimeApis: [],
      collectionName: null,
      dtsFilePath: null,
      excludeFromCollection: false,
      externalImports: [],
      hasVdomAttribute: false,
      hasVdomXlink: false,
      hasVdomClass: false,
      hasVdomFunctional: false,
      hasVdomKey: false,
      hasVdomListener: false,
      hasVdomPropOrAttr: false,
      hasVdomRef: false,
      hasVdomRender: false,
      hasVdomStyle: false,
      hasVdomText: false,
      htmlAttrNames: [],
      htmlTagNames: [],
      htmlParts: [],
      isCollectionDependency: false,
      isLegacy: false,
      localImports: [],
      originalCollectionComponentPath: null,
      originalImports: [],
      potentialCmpRefs: [],
      staticSourceFile: null,
      staticSourceFileText: '',
      sourceMapPath: null,
      sourceMapFileText: null,
    };
    compilerCtx.moduleMap.set(sourceFilePath, moduleFile);
    return moduleFile;
  }
};
const resetModuleLegacy = (moduleFile) => {
  moduleFile.cmps.length = 0;
  moduleFile.coreRuntimeApis.length = 0;
  moduleFile.collectionName = null;
  moduleFile.dtsFilePath = null;
  moduleFile.excludeFromCollection = false;
  moduleFile.externalImports.length = 0;
  moduleFile.isCollectionDependency = false;
  moduleFile.localImports.length = 0;
  moduleFile.originalCollectionComponentPath = null;
  moduleFile.originalImports.length = 0;
  moduleFile.hasVdomXlink = false;
  moduleFile.hasVdomAttribute = false;
  moduleFile.hasVdomClass = false;
  moduleFile.hasVdomFunctional = false;
  moduleFile.hasVdomKey = false;
  moduleFile.hasVdomListener = false;
  moduleFile.hasVdomRef = false;
  moduleFile.hasVdomRender = false;
  moduleFile.hasVdomStyle = false;
  moduleFile.hasVdomText = false;
  moduleFile.htmlAttrNames.length = 0;
  moduleFile.htmlTagNames.length = 0;
  moduleFile.potentialCmpRefs.length = 0;
};

const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
  let relativePath = relative$1(dirname(pathFrom), dirname(pathTo));
  if (addPrefix) {
    if (relativePath === '') {
      relativePath = '.';
    }
    else if (relativePath[0] !== '.') {
      relativePath = './' + relativePath;
    }
  }
  return normalizePath$2(`${relativePath}/${basename(pathTo, ext)}`);
};
const getComponentsDtsSrcFilePath = (config) => join(config.srcDir, GENERATED_DTS$1);
const getComponentsDtsTypesFilePath = (outputTarget) => join(outputTarget.typesDir, GENERATED_DTS$1);
const isOutputTargetDist = (o) => o.type === DIST;
const isOutputTargetDistCollection = (o) => o.type === DIST_COLLECTION;
const isOutputTargetDistCustomElements = (o) => o.type === DIST_CUSTOM_ELEMENTS;
const isOutputTargetDistCustomElementsBundle = (o) => o.type === DIST_CUSTOM_ELEMENTS_BUNDLE;
const isOutputTargetCopy = (o) => o.type === COPY;
const isOutputTargetDistLazy = (o) => o.type === DIST_LAZY;
const isOutputTargetAngular = (o) => o.type === ANGULAR;
const isOutputTargetDistLazyLoader = (o) => o.type === DIST_LAZY_LOADER;
const isOutputTargetDistGlobalStyles = (o) => o.type === DIST_GLOBAL_STYLES;
const isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
const isOutputTargetCustom = (o) => o.type === CUSTOM;
const isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;
const isOutputTargetDocsReadme = (o) => o.type === DOCS_README;
const isOutputTargetDocsJson = (o) => o.type === DOCS_JSON;
const isOutputTargetDocsCustom = (o) => o.type === DOCS_CUSTOM;
const isOutputTargetDocsVscode = (o) => o.type === DOCS_VSCODE;
const isOutputTargetWww = (o) => o.type === WWW;
const isOutputTargetStats = (o) => o.type === STATS;
const isOutputTargetDistTypes = (o) => o.type === DIST_TYPES;
const getComponentsFromModules = (moduleFiles) => sortBy(flatOne(moduleFiles.map((m) => m.cmps)), (c) => c.tagName);
const ANGULAR = 'angular';
const COPY = 'copy';
const CUSTOM = 'custom';
const DIST = 'dist';
const DIST_COLLECTION = 'dist-collection';
const DIST_CUSTOM_ELEMENTS = 'dist-custom-elements';
const DIST_CUSTOM_ELEMENTS_BUNDLE = 'dist-custom-elements-bundle';
const DIST_TYPES = 'dist-types';
const DIST_HYDRATE_SCRIPT = 'dist-hydrate-script';
const DIST_LAZY = 'dist-lazy';
const DIST_LAZY_LOADER = 'dist-lazy-loader';
const DIST_GLOBAL_STYLES = 'dist-global-styles';
const DOCS_CUSTOM = 'docs-custom';
const DOCS_JSON = 'docs-json';
const DOCS_README = 'docs-readme';
const DOCS_VSCODE = 'docs-vscode';
const STATS = 'stats';
const WWW = 'www';
/**
 * Valid output targets to specify in a Stencil config.
 *
 * Note that there are some output targets (e.g. `DIST_TYPES`) which are
 * programmatically set as output targets by the compiler when other output
 * targets (in that case `DIST`) are set, but which are _not_ supported in a
 * Stencil config. This is enforced in the output target validation code.
 */
const VALID_CONFIG_OUTPUT_TARGETS = [
  // DIST
  WWW,
  DIST,
  DIST_COLLECTION,
  DIST_CUSTOM_ELEMENTS,
  DIST_CUSTOM_ELEMENTS_BUNDLE,
  DIST_LAZY,
  DIST_HYDRATE_SCRIPT,
  // DOCS
  DOCS_JSON,
  DOCS_README,
  DOCS_VSCODE,
  DOCS_CUSTOM,
  // MISC
  ANGULAR,
  COPY,
  CUSTOM,
  STATS,
];
/**
 * Check whether a given output target is a valid one to be set in a Stencil config
 *
 * @param targetType the type which we want to check
 * @returns whether or not the targetType is a valid, configurable output target.
 */
function isValidConfigOutputTarget(targetType) {
  // unfortunately `includes` is typed on `ReadonlyArray<T>` as `(el: T):
  // boolean` so a `string` cannot be passed to `includes` on a
  // `ReadonlyArray` 😢 thus we `as any`
  //
  // see microsoft/TypeScript#31018 for some discussion of this
  return VALID_CONFIG_OUTPUT_TARGETS.includes(targetType);
}
const GENERATED_DTS$1 = 'components.d.ts';

const getTsOptionsToExtend = (config) => {
  const tsOptions = {
    experimentalDecorators: true,
    declaration: config.outputTargets.some(isOutputTargetDistTypes),
    module: t.ModuleKind.ESNext,
    moduleResolution: t.ModuleResolutionKind.NodeJs,
    noEmitOnError: false,
    outDir: config.cacheDir || config.sys.tmpDirSync(),
    sourceMap: config.sourceMap,
    inlineSources: config.sourceMap,
  };
  return tsOptions;
};

/**
 * Create a TypeScript Program ({@link ts.Program}) to perform builds of a Stencil project using the provided
 * `buildCallback` entity
 * @param config a Stencil configuration to apply to a full build of a Stencil project
 * @param buildCallback a callback that invokes the actual transpilation of a Stencil project
 * @returns a Program that marries the TypeScript and Stencil compilers together.
 */
const createTsBuildProgram = async (config, buildCallback) => {
  let isBuildRunning = false;
  let currentBuildTimeoutId;
  const optionsToExtend = getTsOptionsToExtend(config);
  /**
   * Create a {@link ts.System}. The System is responsible for handling all interactions between the TypeScript compiler
   * and the host operating system.
   */
  const tsWatchSys = {
    ...t.sys,
    /**
     * Watch changes in source files, missing files needed to update the program or config file
     * @returns a no-op file watcher
     */
    watchFile() {
      return {
        close() { },
      };
    },
    /**
     * Watch a resolved module's failed lookup locations, config file specs, type roots where auto type reference
     * directives are added
     * @returns a no-op file watcher
     */
    watchDirectory() {
      return {
        close() { },
      };
    },
    /**
     * Set delayed compilation, so that multiple changes in short span are compiled together
     * @param callback a callback to invoke upon the completion of compilation. this function is provided to Stencil by
     * the TypeScript compiler.
     * @param timeoutMs the minimum time to wait (in milliseconds) before checking if compilation is complete or not
     * @returns the identifier for the interval that's created
     */
    setTimeout(callback, timeoutMs) {
      currentBuildTimeoutId = setInterval(() => {
        if (!isBuildRunning) {
          callback();
          clearInterval(currentBuildTimeoutId);
        }
      }, config.sys.watchTimeout || timeoutMs);
      return currentBuildTimeoutId;
    },
    /**
     * Reset existing delayed compilation
     * @param timeoutId the current build timeout identifier to clear
     */
    clearTimeout(timeoutId) {
      clearInterval(timeoutId);
    },
  };
  config.sys.addDestory(() => tsWatchSys.clearTimeout(currentBuildTimeoutId));
  /**
   * Create a {@link ts.WatchCompilerHost}. A CompilerHost allows a {@link ts.Program} to interact with the
   * {@link ts.System}, by acting as an intermediary:
   * ```
   * ┌────────────┐   ┌──────────────────────┐   ┌───────────┐   ┌──────────────────┐
   * │ ts.Program │<->│ ts.WatchCompilerHost │<->│ ts.System │<->│ Operating System │
   * └────────────┘   └──────────────────────┘   └───────────┘   └──────────────────┘
   * ```
   *
   * Strictly speaking, the created entity is a subclass of a WatchCompilerHost. The
   * {@link ts.WatchCompilerHostOfConfigFile} class has the following features that makes it useful to Stencil (even
   * when Stencil is performing a single, full build):
   * - it provides the opportunity to extend/alter an existing tsconfig file, allowing users to override specific
   * configuration options via {@link ts.WatchCompilerHostOfConfigFile#optionsToExtend}, which is a provided as an
   * argument in the constructor
   * - it includes the {@link ts.WatchCompilerHost#afterProgramCreate} function in its interface, which Stencil
   * overrides to invoke a build callback (not as a part of this object's creation)
   */
  const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
    config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
  }, (reportWatchStatus) => {
    config.logger.debug(reportWatchStatus.messageText);
  });
  /**
   * Override {@link ts.WatchCompilerHost#afterProgramCreate} to invoke the build callback that was provided as an
   * argument to this function.
   * @param tsBuilder a {@link ts.BuilderProgram} to manage the {@link ts.Program} in the provided build context
   */
  tsWatchHost.afterProgramCreate = async (tsBuilder) => {
    isBuildRunning = true;
    await buildCallback(tsBuilder);
    isBuildRunning = false;
  };
  /**
   * Create the initial {@link ts.Program} using Stencil's custom {@link ts.WatchCompilerHostOfConfigFile}. The Program
   * represents the _TypeScript_ compiler context, that will work in tandem with Stencil's compiler context and build
   * context
   */
  return t.createWatchProgram(tsWatchHost);
};

const CONTENT_REF_ID = 'r';
const ORG_LOCATION_ID = 'o';
const SLOT_NODE_ID = 's';
const TEXT_NODE_ID = 't';
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
const XLINK_NS = 'http://www.w3.org/1999/xlink';

const attrHandler = {
  get(obj, prop) {
    if (prop in obj) {
      return obj[prop];
    }
    if (typeof prop !== 'symbol' && !isNaN(prop)) {
      return obj.__items[prop];
    }
    return undefined;
  },
};
const createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
class MockAttributeMap {
  constructor(caseInsensitive = false) {
    this.caseInsensitive = caseInsensitive;
    this.__items = [];
  }
  get length() {
    return this.__items.length;
  }
  item(index) {
    return this.__items[index] || null;
  }
  setNamedItem(attr) {
    attr.namespaceURI = null;
    this.setNamedItemNS(attr);
  }
  setNamedItemNS(attr) {
    if (attr != null && attr.value != null) {
      attr.value = String(attr.value);
    }
    const existingAttr = this.__items.find((a) => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
    if (existingAttr != null) {
      existingAttr.value = attr.value;
    }
    else {
      this.__items.push(attr);
    }
  }
  getNamedItem(attrName) {
    if (this.caseInsensitive) {
      attrName = attrName.toLowerCase();
    }
    return this.getNamedItemNS(null, attrName);
  }
  getNamedItemNS(namespaceURI, attrName) {
    namespaceURI = getNamespaceURI(namespaceURI);
    return (this.__items.find((attr) => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null);
  }
  removeNamedItem(attr) {
    this.removeNamedItemNS(attr);
  }
  removeNamedItemNS(attr) {
    for (let i = 0, ii = this.__items.length; i < ii; i++) {
      if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
        this.__items.splice(i, 1);
        break;
      }
    }
  }
  [Symbol.iterator]() {
    let i = 0;
    return {
      next: () => ({
        done: i === this.length,
        value: this.item(i++),
      }),
    };
  }
  get [Symbol.toStringTag]() {
    return 'MockAttributeMap';
  }
}
function getNamespaceURI(namespaceURI) {
  return namespaceURI === XLINK_NS ? null : namespaceURI;
}
function cloneAttributes(srcAttrs, sortByName = false) {
  const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
  if (srcAttrs != null) {
    const attrLen = srcAttrs.length;
    if (sortByName && attrLen > 1) {
      const sortedAttrs = [];
      for (let i = 0; i < attrLen; i++) {
        const srcAttr = srcAttrs.item(i);
        const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
        sortedAttrs.push(dstAttr);
      }
      sortedAttrs.sort(sortAttributes).forEach((attr) => {
        dstAttrs.setNamedItemNS(attr);
      });
    }
    else {
      for (let i = 0; i < attrLen; i++) {
        const srcAttr = srcAttrs.item(i);
        const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
        dstAttrs.setNamedItemNS(dstAttr);
      }
    }
  }
  return dstAttrs;
}
function sortAttributes(a, b) {
  if (a.name < b.name)
    return -1;
  if (a.name > b.name)
    return 1;
  return 0;
}
class MockAttr {
  constructor(attrName, attrValue, namespaceURI = null) {
    this._name = attrName;
    this._value = String(attrValue);
    this._namespaceURI = namespaceURI;
  }
  get name() {
    return this._name;
  }
  set name(value) {
    this._name = value;
  }
  get value() {
    return this._value;
  }
  set value(value) {
    this._value = String(value);
  }
  get nodeName() {
    return this._name;
  }
  set nodeName(value) {
    this._name = value;
  }
  get nodeValue() {
    return this._value;
  }
  set nodeValue(value) {
    this._value = String(value);
  }
  get namespaceURI() {
    return this._namespaceURI;
  }
  set namespaceURI(namespaceURI) {
    this._namespaceURI = namespaceURI;
  }
}

class MockClassList {
  constructor(elm) {
    this.elm = elm;
  }
  add(...classNames) {
    const clsNames = getItems(this.elm);
    let updated = false;
    classNames.forEach((className) => {
      className = String(className);
      validateClass(className);
      if (clsNames.includes(className) === false) {
        clsNames.push(className);
        updated = true;
      }
    });
    if (updated) {
      this.elm.setAttributeNS(null, 'class', clsNames.join(' '));
    }
  }
  remove(...classNames) {
    const clsNames = getItems(this.elm);
    let updated = false;
    classNames.forEach((className) => {
      className = String(className);
      validateClass(className);
      const index = clsNames.indexOf(className);
      if (index > -1) {
        clsNames.splice(index, 1);
        updated = true;
      }
    });
    if (updated) {
      this.elm.setAttributeNS(null, 'class', clsNames.filter((c) => c.length > 0).join(' '));
    }
  }
  contains(className) {
    className = String(className);
    return getItems(this.elm).includes(className);
  }
  toggle(className) {
    className = String(className);
    if (this.contains(className) === true) {
      this.remove(className);
    }
    else {
      this.add(className);
    }
  }
  get length() {
    return getItems(this.elm).length;
  }
  item(index) {
    return getItems(this.elm)[index];
  }
  toString() {
    return getItems(this.elm).join(' ');
  }
}
function validateClass(className) {
  if (className === '') {
    throw new Error('The token provided must not be empty.');
  }
  if (/\s/.test(className)) {
    throw new Error(`The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`);
  }
}
function getItems(elm) {
  const className = elm.getAttribute('class');
  if (typeof className === 'string' && className.length > 0) {
    return className
      .trim()
      .split(' ')
      .filter((c) => c.length > 0);
  }
  return [];
}

class MockCSSStyleDeclaration {
  constructor() {
    this._styles = new Map();
  }
  setProperty(prop, value) {
    prop = jsCaseToCssCase(prop);
    if (value == null || value === '') {
      this._styles.delete(prop);
    }
    else {
      this._styles.set(prop, String(value));
    }
  }
  getPropertyValue(prop) {
    prop = jsCaseToCssCase(prop);
    return String(this._styles.get(prop) || '');
  }
  removeProperty(prop) {
    prop = jsCaseToCssCase(prop);
    this._styles.delete(prop);
  }
  get length() {
    return this._styles.size;
  }
  get cssText() {
    const cssText = [];
    this._styles.forEach((value, prop) => {
      cssText.push(`${prop}: ${value};`);
    });
    return cssText.join(' ').trim();
  }
  set cssText(cssText) {
    if (cssText == null || cssText === '') {
      this._styles.clear();
      return;
    }
    cssText.split(';').forEach((rule) => {
      rule = rule.trim();
      if (rule.length > 0) {
        const splt = rule.split(':');
        if (splt.length > 1) {
          const prop = splt[0].trim();
          const value = splt.slice(1).join(':').trim();
          if (prop !== '' && value !== '') {
            this._styles.set(jsCaseToCssCase(prop), value);
          }
        }
      }
    });
  }
}
function createCSSStyleDeclaration() {
  return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
}
const cssProxyHandler = {
  get(cssStyle, prop) {
    if (prop in cssStyle) {
      return cssStyle[prop];
    }
    prop = cssCaseToJsCase(prop);
    return cssStyle.getPropertyValue(prop);
  },
  set(cssStyle, prop, value) {
    if (prop in cssStyle) {
      cssStyle[prop] = value;
    }
    else {
      cssStyle.setProperty(prop, value);
    }
    return true;
  },
};
function cssCaseToJsCase(str) {
  // font-size to fontSize
  if (str.length > 1 && str.includes('-') === true) {
    str = str
      .toLowerCase()
      .split('-')
      .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
      .join('');
    str = str.slice(0, 1).toLowerCase() + str.slice(1);
  }
  return str;
}
function jsCaseToCssCase(str) {
  // fontSize to font-size
  if (str.length > 1 && str.includes('-') === false && /[A-Z]/.test(str) === true) {
    str = str
      .replace(/([A-Z])/g, (g) => ' ' + g[0])
      .trim()
      .replace(/ /g, '-')
      .toLowerCase();
  }
  return str;
}

class MockCustomElementRegistry {
  constructor(win) {
    this.win = win;
  }
  define(tagName, cstr, options) {
    if (tagName.toLowerCase() !== tagName) {
      throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`);
    }
    if (this.__registry == null) {
      this.__registry = new Map();
    }
    this.__registry.set(tagName, { cstr, options });
    if (this.__whenDefined != null) {
      const whenDefinedResolveFns = this.__whenDefined.get(tagName);
      if (whenDefinedResolveFns != null) {
        whenDefinedResolveFns.forEach((whenDefinedResolveFn) => {
          whenDefinedResolveFn();
        });
        whenDefinedResolveFns.length = 0;
        this.__whenDefined.delete(tagName);
      }
    }
    const doc = this.win.document;
    if (doc != null) {
      const hosts = doc.querySelectorAll(tagName);
      hosts.forEach((host) => {
        if (upgradedElements.has(host) === false) {
          tempDisableCallbacks.add(doc);
          const upgradedCmp = createCustomElement(this, doc, tagName);
          for (let i = 0; i < host.childNodes.length; i++) {
            const childNode = host.childNodes[i];
            childNode.remove();
            upgradedCmp.appendChild(childNode);
          }
          tempDisableCallbacks.delete(doc);
          if (proxyElements.has(host)) {
            proxyElements.set(host, upgradedCmp);
          }
        }
        fireConnectedCallback(host);
      });
    }
  }
  get(tagName) {
    if (this.__registry != null) {
      const def = this.__registry.get(tagName.toLowerCase());
      if (def != null) {
        return def.cstr;
      }
    }
    return undefined;
  }
  upgrade(_rootNode) {
    //
  }
  clear() {
    if (this.__registry != null) {
      this.__registry.clear();
    }
    if (this.__whenDefined != null) {
      this.__whenDefined.clear();
    }
  }
  whenDefined(tagName) {
    tagName = tagName.toLowerCase();
    if (this.__registry != null && this.__registry.has(tagName) === true) {
      return Promise.resolve(this.__registry.get(tagName).cstr);
    }
    return new Promise((resolve) => {
      if (this.__whenDefined == null) {
        this.__whenDefined = new Map();
      }
      let whenDefinedResolveFns = this.__whenDefined.get(tagName);
      if (whenDefinedResolveFns == null) {
        whenDefinedResolveFns = [];
        this.__whenDefined.set(tagName, whenDefinedResolveFns);
      }
      whenDefinedResolveFns.push(resolve);
    });
  }
}
function createCustomElement(customElements, ownerDocument, tagName) {
  const Cstr = customElements.get(tagName);
  if (Cstr != null) {
    const cmp = new Cstr(ownerDocument);
    cmp.nodeName = tagName.toUpperCase();
    upgradedElements.add(cmp);
    return cmp;
  }
  const host = new Proxy({}, {
    get(obj, prop) {
      const elm = proxyElements.get(host);
      if (elm != null) {
        return elm[prop];
      }
      return obj[prop];
    },
    set(obj, prop, val) {
      const elm = proxyElements.get(host);
      if (elm != null) {
        elm[prop] = val;
      }
      else {
        obj[prop] = val;
      }
      return true;
    },
    has(obj, prop) {
      const elm = proxyElements.get(host);
      if (prop in elm) {
        return true;
      }
      if (prop in obj) {
        return true;
      }
      return false;
    },
  });
  const elm = new MockHTMLElement(ownerDocument, tagName);
  proxyElements.set(host, elm);
  return host;
}
const proxyElements = new WeakMap();
const upgradedElements = new WeakSet();
function connectNode(ownerDocument, node) {
  node.ownerDocument = ownerDocument;
  if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
    if (ownerDocument != null && node.nodeName.includes('-')) {
      const win = ownerDocument.defaultView;
      if (win != null && typeof node.connectedCallback === 'function' && node.isConnected) {
        fireConnectedCallback(node);
      }
      const shadowRoot = node.shadowRoot;
      if (shadowRoot != null) {
        shadowRoot.childNodes.forEach((childNode) => {
          connectNode(ownerDocument, childNode);
        });
      }
    }
    node.childNodes.forEach((childNode) => {
      connectNode(ownerDocument, childNode);
    });
  }
  else {
    node.childNodes.forEach((childNode) => {
      childNode.ownerDocument = ownerDocument;
    });
  }
}
function fireConnectedCallback(node) {
  if (typeof node.connectedCallback === 'function') {
    if (tempDisableCallbacks.has(node.ownerDocument) === false) {
      try {
        node.connectedCallback();
      }
      catch (e) {
        console.error(e);
      }
    }
  }
}
function disconnectNode(node) {
  if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
    if (node.nodeName.includes('-') === true && typeof node.disconnectedCallback === 'function') {
      if (tempDisableCallbacks.has(node.ownerDocument) === false) {
        try {
          node.disconnectedCallback();
        }
        catch (e) {
          console.error(e);
        }
      }
    }
    node.childNodes.forEach(disconnectNode);
  }
}
function attributeChanged(node, attrName, oldValue, newValue) {
  attrName = attrName.toLowerCase();
  const observedAttributes = node.constructor.observedAttributes;
  if (Array.isArray(observedAttributes) === true &&
    observedAttributes.some((obs) => obs.toLowerCase() === attrName) === true) {
    try {
      node.attributeChangedCallback(attrName, oldValue, newValue);
    }
    catch (e) {
      console.error(e);
    }
  }
}
function checkAttributeChanged(node) {
  return node.nodeName.includes('-') === true && typeof node.attributeChangedCallback === 'function';
}
const tempDisableCallbacks = new Set();

function dataset(elm) {
  const ds = {};
  const attributes = elm.attributes;
  const attrLen = attributes.length;
  for (let i = 0; i < attrLen; i++) {
    const attr = attributes.item(i);
    const nodeName = attr.nodeName;
    if (nodeName.startsWith('data-')) {
      ds[dashToPascalCase(nodeName)] = attr.nodeValue;
    }
  }
  return new Proxy(ds, {
    get(_obj, camelCaseProp) {
      return ds[camelCaseProp];
    },
    set(_obj, camelCaseProp, value) {
      const dataAttr = toDataAttribute(camelCaseProp);
      elm.setAttribute(dataAttr, value);
      return true;
    },
  });
}
function toDataAttribute(str) {
  return ('data-' +
    String(str)
      .replace(/([A-Z0-9])/g, (g) => ' ' + g[0])
      .trim()
      .replace(/ /g, '-')
      .toLowerCase());
}
function dashToPascalCase(str) {
  str = String(str).slice(5);
  return str
    .split('-')
    .map((segment, index) => {
    if (index === 0) {
      return segment.charAt(0).toLowerCase() + segment.slice(1);
    }
    return segment.charAt(0).toUpperCase() + segment.slice(1);
  })
    .join('');
}

class MockEvent {
  constructor(type, eventInitDict) {
    this.bubbles = false;
    this.cancelBubble = false;
    this.cancelable = false;
    this.composed = false;
    this.currentTarget = null;
    this.defaultPrevented = false;
    this.srcElement = null;
    this.target = null;
    if (typeof type !== 'string') {
      throw new Error(`Event type required`);
    }
    this.type = type;
    this.timeStamp = Date.now();
    if (eventInitDict != null) {
      Object.assign(this, eventInitDict);
    }
  }
  preventDefault() {
    this.defaultPrevented = true;
  }
  stopPropagation() {
    this.cancelBubble = true;
  }
  stopImmediatePropagation() {
    this.cancelBubble = true;
  }
  composedPath() {
    const composedPath = [];
    let currentElement = this.target;
    while (currentElement) {
      composedPath.push(currentElement);
      if (!currentElement.parentElement && currentElement.nodeName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
        // the current element doesn't have a parent, but we've detected it's our root document node. push the window
        // object associated with the document onto the path
        composedPath.push(currentElement.defaultView);
        break;
      }
      currentElement = currentElement.parentElement;
    }
    return composedPath;
  }
}
class MockCustomEvent extends MockEvent {
  constructor(type, customEventInitDic) {
    super(type);
    this.detail = null;
    if (customEventInitDic != null) {
      Object.assign(this, customEventInitDic);
    }
  }
}
class MockKeyboardEvent extends MockEvent {
  constructor(type, keyboardEventInitDic) {
    super(type);
    this.code = '';
    this.key = '';
    this.altKey = false;
    this.ctrlKey = false;
    this.metaKey = false;
    this.shiftKey = false;
    this.location = 0;
    this.repeat = false;
    if (keyboardEventInitDic != null) {
      Object.assign(this, keyboardEventInitDic);
    }
  }
}
class MockMouseEvent extends MockEvent {
  constructor(type, mouseEventInitDic) {
    super(type);
    this.screenX = 0;
    this.screenY = 0;
    this.clientX = 0;
    this.clientY = 0;
    this.ctrlKey = false;
    this.shiftKey = false;
    this.altKey = false;
    this.metaKey = false;
    this.button = 0;
    this.buttons = 0;
    this.relatedTarget = null;
    if (mouseEventInitDic != null) {
      Object.assign(this, mouseEventInitDic);
    }
  }
}
class MockUIEvent extends MockEvent {
  constructor(type, uiEventInitDic) {
    super(type);
    this.detail = null;
    this.view = null;
    if (uiEventInitDic != null) {
      Object.assign(this, uiEventInitDic);
    }
  }
}
class MockFocusEvent extends MockUIEvent {
  constructor(type, focusEventInitDic) {
    super(type);
    this.relatedTarget = null;
    if (focusEventInitDic != null) {
      Object.assign(this, focusEventInitDic);
    }
  }
}
class MockEventListener {
  constructor(type, handler) {
    this.type = type;
    this.handler = handler;
  }
}
function addEventListener(elm, type, handler) {
  const target = elm;
  if (target.__listeners == null) {
    target.__listeners = [];
  }
  target.__listeners.push(new MockEventListener(type, handler));
}
function removeEventListener(elm, type, handler) {
  const target = elm;
  if (target != null && Array.isArray(target.__listeners) === true) {
    const elmListener = target.__listeners.find((e) => e.type === type && e.handler === handler);
    if (elmListener != null) {
      const index = target.__listeners.indexOf(elmListener);
      target.__listeners.splice(index, 1);
    }
  }
}
function resetEventListeners(target) {
  if (target != null && target.__listeners != null) {
    target.__listeners = null;
  }
}
function triggerEventListener(elm, ev) {
  if (elm == null || ev.cancelBubble === true) {
    return;
  }
  const target = elm;
  ev.currentTarget = elm;
  if (Array.isArray(target.__listeners) === true) {
    const listeners = target.__listeners.filter((e) => e.type === ev.type);
    listeners.forEach((listener) => {
      try {
        listener.handler.call(target, ev);
      }
      catch (err) {
        console.error(err);
      }
    });
  }
  if (ev.bubbles === false) {
    return;
  }
  if (elm.nodeName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
    triggerEventListener(elm.defaultView, ev);
  }
  else {
    triggerEventListener(elm.parentElement, ev);
  }
}
function dispatchEvent(currentTarget, ev) {
  ev.target = currentTarget;
  triggerEventListener(currentTarget, ev);
  return true;
}

// Parse5 7.1.2
const e=function(e){const t=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),s="�";var a;!function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",e[e.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_F=102]="LATIN_SMALL_F",e[e.LATIN_SMALL_X=120]="LATIN_SMALL_X",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",e[e.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER";}(a=a||(a={}));const r="[CDATA[",n="doctype",i="script";function o(e){return e>=55296&&e<=57343}function c(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159}function E(e){return e>=64976&&e<=65007||t.has(e)}var T,h;!function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text";}(T=T||(T={}));class _{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1;}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e){const{line:t,col:s,offset:a}=this;return {code:e,startLine:t,endLine:t,startCol:s,endCol:s,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e)));}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos;}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,a.EOF;return this._err(T.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0);}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t;}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1;}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((32|this.html.charCodeAt(this.pos+t))!==e.charCodeAt(t))return !1;return !0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,a.EOF;const s=this.html.charCodeAt(t);return s===a.CARRIAGE_RETURN?a.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,a.EOF;let e=this.html.charCodeAt(this.pos);return e===a.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,a.LINE_FEED):e===a.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,o(e)&&(e=this._processSurrogate(e)),null===this.handler.onParseError||e>31&&e<127||e===a.LINE_FEED||e===a.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){c(e)?this._err(T.controlCharacterInInputStream):E(e)&&this._err(T.noncharacterInInputStream);}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1;}}function A(e,t){for(let s=e.attrs.length-1;s>=0;s--)if(e.attrs[s].name===t)return e.attrs[s].value;return null}!function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION";}(h=h||(h={}));var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(e,t,s){return e(s={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},s.exports),s.exports}var p,d,I,N,u,C=m((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((function(e){return e.charCodeAt(0)})));})),D=m((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((function(e){return e.charCodeAt(0)})));})),S=m((function(e,t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var a=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function r(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=a.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(s=String.fromCodePoint)&&void 0!==s?s:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+String.fromCharCode(e)},t.replaceCodePoint=r,t.default=function(e){return (0, t.fromCodePoint)(r(e))};})),R=m((function(e,t){var s=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTML=t.determineBranch=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var a=s(C);t.htmlDecodeTree=a.default;var r=s(D);t.xmlDecodeTree=r.default;var n=s(S);t.decodeCodePoint=n.default;var i,o,c=S;function E(e){return function(t,s){for(var a="",r=0,c=0;(c=t.indexOf("&",c))>=0;)if(a+=t.slice(r,c),r=c,c+=1,t.charCodeAt(c)!==i.NUM){for(var E=0,h=1,_=0,A=e[_];c<t.length&&!((_=T(e,A,_+1,t.charCodeAt(c)))<0);c++,h++){var l=(A=e[_])&o.VALUE_LENGTH;if(l){var m;if(s&&t.charCodeAt(c)!==i.SEMI||(E=_,h=0),0==(m=(l>>14)-1))break;_+=m;}}0!==E&&(a+=1==(m=(e[E]&o.VALUE_LENGTH)>>14)?String.fromCharCode(e[E]&~o.VALUE_LENGTH):2===m?String.fromCharCode(e[E+1]):String.fromCharCode(e[E+1],e[E+2]),r=c-h+1);}else {var p=c+1,d=10,I=t.charCodeAt(p);(I|i.To_LOWER_BIT)===i.LOWER_X&&(d=16,c+=1,p+=1);do{I=t.charCodeAt(++c);}while(I>=i.ZERO&&I<=i.NINE||16===d&&(I|i.To_LOWER_BIT)>=i.LOWER_A&&(I|i.To_LOWER_BIT)<=i.LOWER_F);if(p!==c){var N=t.substring(p,c),u=parseInt(N,d);if(t.charCodeAt(c)===i.SEMI)c+=1;else if(s)continue;a+=(0, n.default)(u),r=c;}}return a+t.slice(r)}}function T(e,t,s,a){var r=(t&o.BRANCH_LENGTH)>>7,n=t&o.JUMP_TABLE;if(0===r)return 0!==n&&a===n?s:-1;if(n){var i=a-n;return i<0||i>=r?-1:e[s+i]-1}for(var c=s,E=c+r-1;c<=E;){var T=c+E>>>1,h=e[T];if(h<a)c=T+1;else {if(!(h>a))return e[T+r];E=T-1;}}return -1}Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return c.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return c.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.To_LOWER_BIT=32]="To_LOWER_BIT";}(i||(i={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE";}(o=t.BinTrieFlags||(t.BinTrieFlags={})),t.determineBranch=T;var h=E(a.default),_=E(r.default);t.decodeHTML=function(e){return h(e,!1)},t.decodeHTMLStrict=function(e){return h(e,!0)},t.decodeXML=function(e){return _(e,!0)};}));!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/";}(p=p||(p={})),function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size";}(d=d||(d={})),function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks";}(I=I||(I={})),function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp";}(N=N||(N={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SECTION=94]="SECTION",e[e.SELECT=95]="SELECT",e[e.SOURCE=96]="SOURCE",e[e.SMALL=97]="SMALL",e[e.SPAN=98]="SPAN",e[e.STRIKE=99]="STRIKE",e[e.STRONG=100]="STRONG",e[e.STYLE=101]="STYLE",e[e.SUB=102]="SUB",e[e.SUMMARY=103]="SUMMARY",e[e.SUP=104]="SUP",e[e.TABLE=105]="TABLE",e[e.TBODY=106]="TBODY",e[e.TEMPLATE=107]="TEMPLATE",e[e.TEXTAREA=108]="TEXTAREA",e[e.TFOOT=109]="TFOOT",e[e.TD=110]="TD",e[e.TH=111]="TH",e[e.THEAD=112]="THEAD",e[e.TITLE=113]="TITLE",e[e.TR=114]="TR",e[e.TRACK=115]="TRACK",e[e.TT=116]="TT",e[e.U=117]="U",e[e.UL=118]="UL",e[e.SVG=119]="SVG",e[e.VAR=120]="VAR",e[e.WBR=121]="WBR",e[e.XMP=122]="XMP";}(u=u||(u={}));const O=new Map([[N.A,u.A],[N.ADDRESS,u.ADDRESS],[N.ANNOTATION_XML,u.ANNOTATION_XML],[N.APPLET,u.APPLET],[N.AREA,u.AREA],[N.ARTICLE,u.ARTICLE],[N.ASIDE,u.ASIDE],[N.B,u.B],[N.BASE,u.BASE],[N.BASEFONT,u.BASEFONT],[N.BGSOUND,u.BGSOUND],[N.BIG,u.BIG],[N.BLOCKQUOTE,u.BLOCKQUOTE],[N.BODY,u.BODY],[N.BR,u.BR],[N.BUTTON,u.BUTTON],[N.CAPTION,u.CAPTION],[N.CENTER,u.CENTER],[N.CODE,u.CODE],[N.COL,u.COL],[N.COLGROUP,u.COLGROUP],[N.DD,u.DD],[N.DESC,u.DESC],[N.DETAILS,u.DETAILS],[N.DIALOG,u.DIALOG],[N.DIR,u.DIR],[N.DIV,u.DIV],[N.DL,u.DL],[N.DT,u.DT],[N.EM,u.EM],[N.EMBED,u.EMBED],[N.FIELDSET,u.FIELDSET],[N.FIGCAPTION,u.FIGCAPTION],[N.FIGURE,u.FIGURE],[N.FONT,u.FONT],[N.FOOTER,u.FOOTER],[N.FOREIGN_OBJECT,u.FOREIGN_OBJECT],[N.FORM,u.FORM],[N.FRAME,u.FRAME],[N.FRAMESET,u.FRAMESET],[N.H1,u.H1],[N.H2,u.H2],[N.H3,u.H3],[N.H4,u.H4],[N.H5,u.H5],[N.H6,u.H6],[N.HEAD,u.HEAD],[N.HEADER,u.HEADER],[N.HGROUP,u.HGROUP],[N.HR,u.HR],[N.HTML,u.HTML],[N.I,u.I],[N.IMG,u.IMG],[N.IMAGE,u.IMAGE],[N.INPUT,u.INPUT],[N.IFRAME,u.IFRAME],[N.KEYGEN,u.KEYGEN],[N.LABEL,u.LABEL],[N.LI,u.LI],[N.LINK,u.LINK],[N.LISTING,u.LISTING],[N.MAIN,u.MAIN],[N.MALIGNMARK,u.MALIGNMARK],[N.MARQUEE,u.MARQUEE],[N.MATH,u.MATH],[N.MENU,u.MENU],[N.META,u.META],[N.MGLYPH,u.MGLYPH],[N.MI,u.MI],[N.MO,u.MO],[N.MN,u.MN],[N.MS,u.MS],[N.MTEXT,u.MTEXT],[N.NAV,u.NAV],[N.NOBR,u.NOBR],[N.NOFRAMES,u.NOFRAMES],[N.NOEMBED,u.NOEMBED],[N.NOSCRIPT,u.NOSCRIPT],[N.OBJECT,u.OBJECT],[N.OL,u.OL],[N.OPTGROUP,u.OPTGROUP],[N.OPTION,u.OPTION],[N.P,u.P],[N.PARAM,u.PARAM],[N.PLAINTEXT,u.PLAINTEXT],[N.PRE,u.PRE],[N.RB,u.RB],[N.RP,u.RP],[N.RT,u.RT],[N.RTC,u.RTC],[N.RUBY,u.RUBY],[N.S,u.S],[N.SCRIPT,u.SCRIPT],[N.SECTION,u.SECTION],[N.SELECT,u.SELECT],[N.SOURCE,u.SOURCE],[N.SMALL,u.SMALL],[N.SPAN,u.SPAN],[N.STRIKE,u.STRIKE],[N.STRONG,u.STRONG],[N.STYLE,u.STYLE],[N.SUB,u.SUB],[N.SUMMARY,u.SUMMARY],[N.SUP,u.SUP],[N.TABLE,u.TABLE],[N.TBODY,u.TBODY],[N.TEMPLATE,u.TEMPLATE],[N.TEXTAREA,u.TEXTAREA],[N.TFOOT,u.TFOOT],[N.TD,u.TD],[N.TH,u.TH],[N.THEAD,u.THEAD],[N.TITLE,u.TITLE],[N.TR,u.TR],[N.TRACK,u.TRACK],[N.TT,u.TT],[N.U,u.U],[N.UL,u.UL],[N.SVG,u.SVG],[N.VAR,u.VAR],[N.WBR,u.WBR],[N.XMP,u.XMP]]);function f(e){var t;return null!==(t=O.get(e))&&void 0!==t?t:u.UNKNOWN}const L=u,g={[p.HTML]:new Set([L.ADDRESS,L.APPLET,L.AREA,L.ARTICLE,L.ASIDE,L.BASE,L.BASEFONT,L.BGSOUND,L.BLOCKQUOTE,L.BODY,L.BR,L.BUTTON,L.CAPTION,L.CENTER,L.COL,L.COLGROUP,L.DD,L.DETAILS,L.DIR,L.DIV,L.DL,L.DT,L.EMBED,L.FIELDSET,L.FIGCAPTION,L.FIGURE,L.FOOTER,L.FORM,L.FRAME,L.FRAMESET,L.H1,L.H2,L.H3,L.H4,L.H5,L.H6,L.HEAD,L.HEADER,L.HGROUP,L.HR,L.HTML,L.IFRAME,L.IMG,L.INPUT,L.LI,L.LINK,L.LISTING,L.MAIN,L.MARQUEE,L.MENU,L.META,L.NAV,L.NOEMBED,L.NOFRAMES,L.NOSCRIPT,L.OBJECT,L.OL,L.P,L.PARAM,L.PLAINTEXT,L.PRE,L.SCRIPT,L.SECTION,L.SELECT,L.SOURCE,L.STYLE,L.SUMMARY,L.TABLE,L.TBODY,L.TD,L.TEMPLATE,L.TEXTAREA,L.TFOOT,L.TH,L.THEAD,L.TITLE,L.TR,L.TRACK,L.UL,L.WBR,L.XMP]),[p.MATHML]:new Set([L.MI,L.MO,L.MN,L.MS,L.MTEXT,L.ANNOTATION_XML]),[p.SVG]:new Set([L.TITLE,L.FOREIGN_OBJECT,L.DESC]),[p.XLINK]:new Set,[p.XML]:new Set,[p.XMLNS]:new Set};function M(e){return e===L.H1||e===L.H2||e===L.H3||e===L.H4||e===L.H5||e===L.H6}const k=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var P;!function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",e[e.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",e[e.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",e[e.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",e[e.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",e[e.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END";}(P||(P={}));const b={DATA:P.DATA,RCDATA:P.RCDATA,RAWTEXT:P.RAWTEXT,SCRIPT_DATA:P.SCRIPT_DATA,PLAINTEXT:P.PLAINTEXT,CDATA_SECTION:P.CDATA_SECTION};function B(e){return e>=a.DIGIT_0&&e<=a.DIGIT_9}function H(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_Z}function F(e){return function(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_Z}(e)||H(e)}function U(e){return F(e)||B(e)}function G(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_F}function y(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_F}function w(e){return e+32}function Y(e){return e===a.SPACE||e===a.LINE_FEED||e===a.TABULATION||e===a.FORM_FEED}function x(e){return Y(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN}class v{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=P.DATA,this.returnState=P.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new _(t),this.currentLocation=this.getCurrentLocation(-1);}_err(e){var t,s;null===(s=(t=this.handler).onParseError)||void 0===s||s.call(t,this.preprocessor.getError(e));}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e);}this.inLoop=!1;}}pause(){this.paused=!0;}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e());}write(e,t,s){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==s||s();}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop();}_ensureHibernation(){return !!this.preprocessor.endOfChunkHit&&(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(e){this.consumedAfterSnapshot-=e,this.preprocessor.retreat(e);}_reconsumeInState(e,t){this.state=e,this._callState(t);}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance();}_consumeSequenceIfMatch(e,t){return !!this.preprocessor.startsWith(e,t)&&(this._advanceBy(e.length-1),!0)}_createStartTagToken(){this.currentToken={type:h.START_TAG,tagName:"",tagID:u.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)};}_createEndTagToken(){this.currentToken={type:h.END_TAG,tagName:"",tagID:u.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)};}_createCommentToken(e){this.currentToken={type:h.COMMENT,data:"",location:this.getCurrentLocation(e)};}_createDoctypeToken(e){this.currentToken={type:h.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation};}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation};}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0);}_leaveAttrName(){var e,t;const s=this.currentToken;null===A(s,this.currentAttr.name)?(s.attrs.push(this.currentAttr),s.location&&this.currentLocation&&((null!==(e=(t=s.location).attrs)&&void 0!==e?e:t.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue())):this._err(T.duplicateAttribute);}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset);}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1);}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=f(e.tagName),e.type===h.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(T.endTagWithAttributes),e.selfClosing&&this._err(T.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk();}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk();}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk();}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case h.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case h.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case h.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);}this.currentCharacterToken=null;}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:h.EOF,location:e}),this.active=!1;}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();}this._createCharacterToken(e,t);}_emitCodePoint(e){const t=Y(e)?h.WHITESPACE_CHARACTER:e===a.NULL?h.NULL_CHARACTER:h.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e));}_emitChars(e){this._appendCharToCurrentCharacterToken(h.CHARACTER,e);}_matchNamedCharacterReference(e){let t=null,s=0,r=!1;for(let i=0,o=R.htmlDecodeTree[0];i>=0&&(i=R.determineBranch(R.htmlDecodeTree,o,i+1,e),!(i<0));e=this._consume()){s+=1,o=R.htmlDecodeTree[i];const c=o&R.BinTrieFlags.VALUE_LENGTH;if(c){const o=(c>>14)-1;if(e!==a.SEMICOLON&&this._isCharacterReferenceInAttribute()&&((n=this.preprocessor.peek(1))===a.EQUALS_SIGN||U(n))?(t=[a.AMPERSAND],i+=o):(t=0===o?[R.htmlDecodeTree[i]&~R.BinTrieFlags.VALUE_LENGTH]:1===o?[R.htmlDecodeTree[++i]]:[R.htmlDecodeTree[++i],R.htmlDecodeTree[++i]],s=0,r=e!==a.SEMICOLON),0===o){this._consume();break}}}var n;return this._unconsume(s),r&&!this.preprocessor.endOfChunkHit&&this._err(T.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===P.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e);}_callState(e){switch(this.state){case P.DATA:this._stateData(e);break;case P.RCDATA:this._stateRcdata(e);break;case P.RAWTEXT:this._stateRawtext(e);break;case P.SCRIPT_DATA:this._stateScriptData(e);break;case P.PLAINTEXT:this._statePlaintext(e);break;case P.TAG_OPEN:this._stateTagOpen(e);break;case P.END_TAG_OPEN:this._stateEndTagOpen(e);break;case P.TAG_NAME:this._stateTagName(e);break;case P.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case P.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case P.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case P.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case P.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case P.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case P.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case P.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case P.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case P.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case P.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case P.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case P.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case P.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case P.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case P.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case P.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case P.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case P.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case P.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case P.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case P.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case P.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case P.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case P.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case P.BOGUS_COMMENT:this._stateBogusComment(e);break;case P.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case P.COMMENT_START:this._stateCommentStart(e);break;case P.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case P.COMMENT:this._stateComment(e);break;case P.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case P.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case P.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case P.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case P.COMMENT_END:this._stateCommentEnd(e);break;case P.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case P.DOCTYPE:this._stateDoctype(e);break;case P.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case P.DOCTYPE_NAME:this._stateDoctypeName(e);break;case P.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case P.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case P.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case P.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case P.CDATA_SECTION:this._stateCdataSection(e);break;case P.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case P.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case P.CHARACTER_REFERENCE:this._stateCharacterReference(e);break;case P.NAMED_CHARACTER_REFERENCE:this._stateNamedCharacterReference(e);break;case P.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;case P.NUMERIC_CHARACTER_REFERENCE:this._stateNumericCharacterReference(e);break;case P.HEXADEMICAL_CHARACTER_REFERENCE_START:this._stateHexademicalCharacterReferenceStart(e);break;case P.HEXADEMICAL_CHARACTER_REFERENCE:this._stateHexademicalCharacterReference(e);break;case P.DECIMAL_CHARACTER_REFERENCE:this._stateDecimalCharacterReference(e);break;case P.NUMERIC_CHARACTER_REFERENCE_END:this._stateNumericCharacterReferenceEnd(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case a.LESS_THAN_SIGN:this.state=P.TAG_OPEN;break;case a.AMPERSAND:this.returnState=P.DATA,this.state=P.CHARACTER_REFERENCE;break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitCodePoint(e);break;case a.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateRcdata(e){switch(e){case a.AMPERSAND:this.returnState=P.RCDATA,this.state=P.CHARACTER_REFERENCE;break;case a.LESS_THAN_SIGN:this.state=P.RCDATA_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateRawtext(e){switch(e){case a.LESS_THAN_SIGN:this.state=P.RAWTEXT_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateScriptData(e){switch(e){case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e);}}_statePlaintext(e){switch(e){case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateTagOpen(e){if(F(e))this._createStartTagToken(),this.state=P.TAG_NAME,this._stateTagName(e);else switch(e){case a.EXCLAMATION_MARK:this.state=P.MARKUP_DECLARATION_OPEN;break;case a.SOLIDUS:this.state=P.END_TAG_OPEN;break;case a.QUESTION_MARK:this._err(T.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=P.BOGUS_COMMENT,this._stateBogusComment(e);break;case a.EOF:this._err(T.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(T.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=P.DATA,this._stateData(e);}}_stateEndTagOpen(e){if(F(e))this._createEndTagToken(),this.state=P.TAG_NAME,this._stateTagName(e);else switch(e){case a.GREATER_THAN_SIGN:this._err(T.missingEndTagName),this.state=P.DATA;break;case a.EOF:this._err(T.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(T.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(e);}}_stateTagName(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.BEFORE_ATTRIBUTE_NAME;break;case a.SOLIDUS:this.state=P.SELF_CLOSING_START_TAG;break;case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentTagToken();break;case a.NULL:this._err(T.unexpectedNullCharacter),t.tagName+=s;break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(H(e)?w(e):e);}}_stateRcdataLessThanSign(e){e===a.SOLIDUS?this.state=P.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RCDATA,this._stateRcdata(e));}_stateRcdataEndTagOpen(e){F(e)?(this.state=P.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=P.RCDATA,this._stateRcdata(e));}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return !this._ensureHibernation();switch(this._createEndTagToken(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=P.BEFORE_ATTRIBUTE_NAME,!1;case a.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=P.SELF_CLOSING_START_TAG,!1;case a.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=P.DATA,!1;default:return !this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=P.RCDATA,this._stateRcdata(e));}_stateRawtextLessThanSign(e){e===a.SOLIDUS?this.state=P.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RAWTEXT,this._stateRawtext(e));}_stateRawtextEndTagOpen(e){F(e)?(this.state=P.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(e));}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(e));}_stateScriptDataLessThanSign(e){switch(e){case a.SOLIDUS:this.state=P.SCRIPT_DATA_END_TAG_OPEN;break;case a.EXCLAMATION_MARK:this.state=P.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=P.SCRIPT_DATA,this._stateScriptData(e);}}_stateScriptDataEndTagOpen(e){F(e)?(this.state=P.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(e));}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(e));}_stateScriptDataEscapeStart(e){e===a.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(e));}_stateScriptDataEscapeStartDash(e){e===a.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(e));}_stateScriptDataEscaped(e){switch(e){case a.HYPHEN_MINUS:this.state=P.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateScriptDataEscapedDash(e){switch(e){case a.HYPHEN_MINUS:this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e);}}_stateScriptDataEscapedDashDash(e){switch(e){case a.HYPHEN_MINUS:this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case a.GREATER_THAN_SIGN:this.state=P.SCRIPT_DATA,this._emitChars(">");break;case a.NULL:this._err(T.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e);}}_stateScriptDataEscapedLessThanSign(e){e===a.SOLIDUS?this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:F(e)?(this._emitChars("<"),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e));}_stateScriptDataEscapedEndTagOpen(e){F(e)?(this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e));}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e));}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(i,!1)&&x(this.preprocessor.peek(i.length))){this._emitCodePoint(e);for(let e=0;e<i.length;e++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED;}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e));}_stateScriptDataDoubleEscaped(e){switch(e){case a.HYPHEN_MINUS:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case a.NULL:this._err(T.unexpectedNullCharacter),this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateScriptDataDoubleEscapedDash(e){switch(e){case a.HYPHEN_MINUS:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case a.NULL:this._err(T.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e);}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case a.HYPHEN_MINUS:this._emitChars("-");break;case a.LESS_THAN_SIGN:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case a.GREATER_THAN_SIGN:this.state=P.SCRIPT_DATA,this._emitChars(">");break;case a.NULL:this._err(T.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(s);break;case a.EOF:this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e);}}_stateScriptDataDoubleEscapedLessThanSign(e){e===a.SOLIDUS?(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e));}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(i,!1)&&x(this.preprocessor.peek(i.length))){this._emitCodePoint(e);for(let e=0;e<i.length;e++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_ESCAPED;}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e));}_stateBeforeAttributeName(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.SOLIDUS:case a.GREATER_THAN_SIGN:case a.EOF:this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case a.EQUALS_SIGN:this._err(T.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=P.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(e);}}_stateAttributeName(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:case a.SOLIDUS:case a.GREATER_THAN_SIGN:case a.EOF:this._leaveAttrName(),this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case a.EQUALS_SIGN:this._leaveAttrName(),this.state=P.BEFORE_ATTRIBUTE_VALUE;break;case a.QUOTATION_MARK:case a.APOSTROPHE:case a.LESS_THAN_SIGN:this._err(T.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case a.NULL:this._err(T.unexpectedNullCharacter),this.currentAttr.name+=s;break;default:this.currentAttr.name+=String.fromCodePoint(H(e)?w(e):e);}}_stateAfterAttributeName(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.SOLIDUS:this.state=P.SELF_CLOSING_START_TAG;break;case a.EQUALS_SIGN:this.state=P.BEFORE_ATTRIBUTE_VALUE;break;case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentTagToken();break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(e);}}_stateBeforeAttributeValue(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.QUOTATION_MARK:this.state=P.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case a.APOSTROPHE:this.state=P.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case a.GREATER_THAN_SIGN:this._err(T.missingAttributeValue),this.state=P.DATA,this.emitCurrentTagToken();break;default:this.state=P.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e);}}_stateAttributeValueDoubleQuoted(e){switch(e){case a.QUOTATION_MARK:this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case a.AMPERSAND:this.returnState=P.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=P.CHARACTER_REFERENCE;break;case a.NULL:this._err(T.unexpectedNullCharacter),this.currentAttr.value+=s;break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e);}}_stateAttributeValueSingleQuoted(e){switch(e){case a.APOSTROPHE:this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case a.AMPERSAND:this.returnState=P.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=P.CHARACTER_REFERENCE;break;case a.NULL:this._err(T.unexpectedNullCharacter),this.currentAttr.value+=s;break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e);}}_stateAttributeValueUnquoted(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break;case a.AMPERSAND:this.returnState=P.ATTRIBUTE_VALUE_UNQUOTED,this.state=P.CHARACTER_REFERENCE;break;case a.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break;case a.NULL:this._err(T.unexpectedNullCharacter),this.currentAttr.value+=s;break;case a.QUOTATION_MARK:case a.APOSTROPHE:case a.LESS_THAN_SIGN:case a.EQUALS_SIGN:case a.GRAVE_ACCENT:this._err(T.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e);}}_stateAfterAttributeValueQuoted(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break;case a.SOLIDUS:this._leaveAttrValue(),this.state=P.SELF_CLOSING_START_TAG;break;case a.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this._err(T.missingWhitespaceBetweenAttributes),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e);}}_stateSelfClosingStartTag(e){switch(e){case a.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=P.DATA,this.emitCurrentTagToken();break;case a.EOF:this._err(T.eofInTag),this._emitEOFToken();break;default:this._err(T.unexpectedSolidusInTag),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e);}}_stateBogusComment(e){const t=this.currentToken;switch(e){case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentComment(t);break;case a.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case a.NULL:this._err(T.unexpectedNullCharacter),t.data+=s;break;default:t.data+=String.fromCodePoint(e);}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch("--",!0)?(this._createCommentToken("--".length+1),this.state=P.COMMENT_START):this._consumeSequenceIfMatch(n,!1)?(this.currentLocation=this.getCurrentLocation(n.length+1),this.state=P.DOCTYPE):this._consumeSequenceIfMatch(r,!0)?this.inForeignNode?this.state=P.CDATA_SECTION:(this._err(T.cdataInHtmlContent),this._createCommentToken(r.length+1),this.currentToken.data="[CDATA[",this.state=P.BOGUS_COMMENT):this._ensureHibernation()||(this._err(T.incorrectlyOpenedComment),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(e));}_stateCommentStart(e){switch(e){case a.HYPHEN_MINUS:this.state=P.COMMENT_START_DASH;break;case a.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=P.DATA;const e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=P.COMMENT,this._stateComment(e);}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case a.HYPHEN_MINUS:this.state=P.COMMENT_END;break;case a.GREATER_THAN_SIGN:this._err(T.abruptClosingOfEmptyComment),this.state=P.DATA,this.emitCurrentComment(t);break;case a.EOF:this._err(T.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=P.COMMENT,this._stateComment(e);}}_stateComment(e){const t=this.currentToken;switch(e){case a.HYPHEN_MINUS:this.state=P.COMMENT_END_DASH;break;case a.LESS_THAN_SIGN:t.data+="<",this.state=P.COMMENT_LESS_THAN_SIGN;break;case a.NULL:this._err(T.unexpectedNullCharacter),t.data+=s;break;case a.EOF:this._err(T.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e);}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case a.EXCLAMATION_MARK:t.data+="!",this.state=P.COMMENT_LESS_THAN_SIGN_BANG;break;case a.LESS_THAN_SIGN:t.data+="<";break;default:this.state=P.COMMENT,this._stateComment(e);}}_stateCommentLessThanSignBang(e){e===a.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=P.COMMENT,this._stateComment(e));}_stateCommentLessThanSignBangDash(e){e===a.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=P.COMMENT_END_DASH,this._stateCommentEndDash(e));}_stateCommentLessThanSignBangDashDash(e){e!==a.GREATER_THAN_SIGN&&e!==a.EOF&&this._err(T.nestedComment),this.state=P.COMMENT_END,this._stateCommentEnd(e);}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case a.HYPHEN_MINUS:this.state=P.COMMENT_END;break;case a.EOF:this._err(T.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=P.COMMENT,this._stateComment(e);}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentComment(t);break;case a.EXCLAMATION_MARK:this.state=P.COMMENT_END_BANG;break;case a.HYPHEN_MINUS:t.data+="-";break;case a.EOF:this._err(T.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--",this.state=P.COMMENT,this._stateComment(e);}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case a.HYPHEN_MINUS:t.data+="--!",this.state=P.COMMENT_END_DASH;break;case a.GREATER_THAN_SIGN:this._err(T.incorrectlyClosedComment),this.state=P.DATA,this.emitCurrentComment(t);break;case a.EOF:this._err(T.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--!",this.state=P.COMMENT,this._stateComment(e);}}_stateDoctype(e){switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.BEFORE_DOCTYPE_NAME;break;case a.GREATER_THAN_SIGN:this.state=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case a.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBeforeDoctypeName),this.state=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);}}_stateBeforeDoctypeName(e){if(H(e))this._createDoctypeToken(String.fromCharCode(w(e))),this.state=P.DOCTYPE_NAME;else switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.NULL:this._err(T.unexpectedNullCharacter),this._createDoctypeToken(s),this.state=P.DOCTYPE_NAME;break;case a.GREATER_THAN_SIGN:{this._err(T.missingDoctypeName),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=P.DATA;break}case a.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=P.DOCTYPE_NAME;}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.AFTER_DOCTYPE_NAME;break;case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.NULL:this._err(T.unexpectedNullCharacter),t.name+=s;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(H(e)?w(e):e);}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch("public",!1)?this.state=P.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch("system",!1)?this.state=P.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(T.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e));}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case a.QUOTATION_MARK:this._err(T.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:this._err(T.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case a.GREATER_THAN_SIGN:this._err(T.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.QUOTATION_MARK:t.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:t.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case a.GREATER_THAN_SIGN:this._err(T.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case a.QUOTATION_MARK:this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case a.NULL:this._err(T.unexpectedNullCharacter),t.publicId+=s;break;case a.GREATER_THAN_SIGN:this._err(T.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e);}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case a.APOSTROPHE:this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case a.NULL:this._err(T.unexpectedNullCharacter),t.publicId+=s;break;case a.GREATER_THAN_SIGN:this._err(T.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e);}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case a.GREATER_THAN_SIGN:this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.QUOTATION_MARK:this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.QUOTATION_MARK:t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:this.state=P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case a.QUOTATION_MARK:this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case a.GREATER_THAN_SIGN:this._err(T.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.QUOTATION_MARK:t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case a.APOSTROPHE:t.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case a.GREATER_THAN_SIGN:this._err(T.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(t);break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case a.QUOTATION_MARK:this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case a.NULL:this._err(T.unexpectedNullCharacter),t.systemId+=s;break;case a.GREATER_THAN_SIGN:this._err(T.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e);}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case a.APOSTROPHE:this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case a.NULL:this._err(T.unexpectedNullCharacter),t.systemId+=s;break;case a.GREATER_THAN_SIGN:this._err(T.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e);}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case a.SPACE:case a.LINE_FEED:case a.TABULATION:case a.FORM_FEED:break;case a.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.EOF:this._err(T.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(e);}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case a.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=P.DATA;break;case a.NULL:this._err(T.unexpectedNullCharacter);break;case a.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();}}_stateCdataSection(e){switch(e){case a.RIGHT_SQUARE_BRACKET:this.state=P.CDATA_SECTION_BRACKET;break;case a.EOF:this._err(T.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e);}}_stateCdataSectionBracket(e){e===a.RIGHT_SQUARE_BRACKET?this.state=P.CDATA_SECTION_END:(this._emitChars("]"),this.state=P.CDATA_SECTION,this._stateCdataSection(e));}_stateCdataSectionEnd(e){switch(e){case a.GREATER_THAN_SIGN:this.state=P.DATA;break;case a.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=P.CDATA_SECTION,this._stateCdataSection(e);}}_stateCharacterReference(e){e===a.NUMBER_SIGN?this.state=P.NUMERIC_CHARACTER_REFERENCE:U(e)?(this.state=P.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(e)):(this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND),this._reconsumeInState(this.returnState,e));}_stateNamedCharacterReference(e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation());else if(t){for(let e=0;e<t.length;e++)this._flushCodePointConsumedAsCharacterReference(t[e]);this.state=this.returnState;}else this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND),this.state=P.AMBIGUOUS_AMPERSAND;}_stateAmbiguousAmpersand(e){U(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===a.SEMICOLON&&this._err(T.unknownNamedCharacterReference),this._reconsumeInState(this.returnState,e));}_stateNumericCharacterReference(e){this.charRefCode=0,e===a.LATIN_SMALL_X||e===a.LATIN_CAPITAL_X?this.state=P.HEXADEMICAL_CHARACTER_REFERENCE_START:B(e)?(this.state=P.DECIMAL_CHARACTER_REFERENCE,this._stateDecimalCharacterReference(e)):(this._err(T.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN),this._reconsumeInState(this.returnState,e));}_stateHexademicalCharacterReferenceStart(e){!function(e){return B(e)||G(e)||y(e)}(e)?(this._err(T.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN),this._unconsume(2),this.state=this.returnState):(this.state=P.HEXADEMICAL_CHARACTER_REFERENCE,this._stateHexademicalCharacterReference(e));}_stateHexademicalCharacterReference(e){G(e)?this.charRefCode=16*this.charRefCode+e-55:y(e)?this.charRefCode=16*this.charRefCode+e-87:B(e)?this.charRefCode=16*this.charRefCode+e-48:e===a.SEMICOLON?this.state=P.NUMERIC_CHARACTER_REFERENCE_END:(this._err(T.missingSemicolonAfterCharacterReference),this.state=P.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e));}_stateDecimalCharacterReference(e){B(e)?this.charRefCode=10*this.charRefCode+e-48:e===a.SEMICOLON?this.state=P.NUMERIC_CHARACTER_REFERENCE_END:(this._err(T.missingSemicolonAfterCharacterReference),this.state=P.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e));}_stateNumericCharacterReferenceEnd(e){if(this.charRefCode===a.NULL)this._err(T.nullCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(T.characterReferenceOutsideUnicodeRange),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(o(this.charRefCode))this._err(T.surrogateCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(E(this.charRefCode))this._err(T.noncharacterCharacterReference);else if(c(this.charRefCode)||this.charRefCode===a.CARRIAGE_RETURN){this._err(T.controlCharacterReference);const e=k.get(this.charRefCode);void 0!==e&&(this.charRefCode=e);}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e);}}const Q=new Set([u.DD,u.DT,u.LI,u.OPTGROUP,u.OPTION,u.P,u.RB,u.RP,u.RT,u.RTC]),q=new Set([...Q,u.CAPTION,u.COLGROUP,u.TBODY,u.TD,u.TFOOT,u.TH,u.THEAD,u.TR]),W=new Map([[u.APPLET,p.HTML],[u.CAPTION,p.HTML],[u.HTML,p.HTML],[u.MARQUEE,p.HTML],[u.OBJECT,p.HTML],[u.TABLE,p.HTML],[u.TD,p.HTML],[u.TEMPLATE,p.HTML],[u.TH,p.HTML],[u.ANNOTATION_XML,p.MATHML],[u.MI,p.MATHML],[u.MN,p.MATHML],[u.MO,p.MATHML],[u.MS,p.MATHML],[u.MTEXT,p.MATHML],[u.DESC,p.SVG],[u.FOREIGN_OBJECT,p.SVG],[u.TITLE,p.SVG]]),X=[u.H1,u.H2,u.H3,u.H4,u.H5,u.H6],K=[u.TR,u.TEMPLATE,u.HTML],V=[u.TBODY,u.TFOOT,u.THEAD,u.TEMPLATE,u.HTML],z=[u.TABLE,u.TEMPLATE,u.HTML],j=[u.TD,u.TH];class J{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,s){this.treeAdapter=t,this.handler=s,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=u.UNKNOWN,this.current=e;}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===u.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===p.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop];}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0);}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0);}replace(e,t){const s=this._indexOf(e);this.items[s]=t,s===this.stackTop&&(this.current=t);}insertAfter(e,t,s){const a=this._indexOf(e)+1;this.items.splice(a,0,t),this.tagIDs.splice(a,0,s),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,a===this.stackTop);}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1);}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==p.HTML);this.shortenToLength(t<0?0:t);}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e);}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(t<0?0:t);}popUntilPopped(e,t){const s=this._indexOfTagNames(e,t);this.shortenToLength(s<0?0:s);}popUntilNumberedHeaderPopped(){this.popUntilPopped(X,p.HTML);}popUntilTableCellPopped(){this.popUntilPopped(j,p.HTML);}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1);}_indexOfTagNames(e,t){for(let s=this.stackTop;s>=0;s--)if(e.includes(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===t)return s;return -1}clearBackTo(e,t){const s=this._indexOfTagNames(e,t);this.shortenToLength(s+1);}clearBackToTableContext(){this.clearBackTo(z,p.HTML);}clearBackToTableBodyContext(){this.clearBackTo(V,p.HTML);}clearBackToTableRowContext(){this.clearBackTo(K,p.HTML);}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)));}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===u.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===u.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const s=this.tagIDs[t],a=this.treeAdapter.getNamespaceURI(this.items[t]);if(s===e&&a===p.HTML)return !0;if(W.get(s)===a)return !1}return !0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e],s=this.treeAdapter.getNamespaceURI(this.items[e]);if(M(t)&&s===p.HTML)return !0;if(W.get(t)===s)return !1}return !0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const s=this.tagIDs[t],a=this.treeAdapter.getNamespaceURI(this.items[t]);if(s===e&&a===p.HTML)return !0;if((s===u.UL||s===u.OL)&&a===p.HTML||W.get(s)===a)return !1}return !0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const s=this.tagIDs[t],a=this.treeAdapter.getNamespaceURI(this.items[t]);if(s===e&&a===p.HTML)return !0;if(s===u.BUTTON&&a===p.HTML||W.get(s)===a)return !1}return !0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const s=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===p.HTML){if(s===e)return !0;if(s===u.TABLE||s===u.TEMPLATE||s===u.HTML)return !1}}return !0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];if(this.treeAdapter.getNamespaceURI(this.items[e])===p.HTML){if(t===u.TBODY||t===u.THEAD||t===u.TFOOT)return !0;if(t===u.TABLE||t===u.HTML)return !1}}return !0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const s=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===p.HTML){if(s===e)return !0;if(s!==u.OPTION&&s!==u.OPTGROUP)return !1}}return !0}generateImpliedEndTags(){for(;Q.has(this.currentTagId);)this.pop();}generateImpliedEndTagsThoroughly(){for(;q.has(this.currentTagId);)this.pop();}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&q.has(this.currentTagId);)this.pop();}}var Z;!function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element";}(Z=Z||(Z={}));const $={type:Z.Marker};class ee{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null;}_getNoahArkConditionCandidates(e,t){const s=[],a=t.length,r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){const t=this.entries[e];if(t.type===Z.Marker)break;const{element:i}=t;if(this.treeAdapter.getTagName(i)===r&&this.treeAdapter.getNamespaceURI(i)===n){const t=this.treeAdapter.getAttrList(i);t.length===a&&s.push({idx:e,attrs:t});}}return s}_ensureNoahArkCondition(e){if(this.entries.length<3)return;const t=this.treeAdapter.getAttrList(e),s=this._getNoahArkConditionCandidates(e,t);if(s.length<3)return;const a=new Map(t.map((e=>[e.name,e.value])));let r=0;for(let e=0;e<s.length;e++){const t=s[e];t.attrs.every((e=>a.get(e.name)===e.value))&&(r+=1,r>=3&&this.entries.splice(t.idx,1));}}insertMarker(){this.entries.unshift($);}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Z.Element,element:e,token:t});}insertElementAfterBookmark(e,t){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:Z.Element,element:e,token:t});}removeEntry(e){const t=this.entries.indexOf(e);t>=0&&this.entries.splice(t,1);}clearToLastMarker(){const e=this.entries.indexOf($);e>=0?this.entries.splice(0,e+1):this.entries.length=0;}getElementEntryInScopeWithTagName(e){const t=this.entries.find((t=>t.type===Z.Marker||this.treeAdapter.getTagName(t.element)===e));return t&&t.type===Z.Element?t:null}getElementEntry(e){return this.entries.find((t=>t.type===Z.Element&&t.element===e))}}function te(e){return {nodeName:"#text",value:e,parentNode:null}}const se={createDocument:()=>({nodeName:"#document",mode:I.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,s)=>({nodeName:e,tagName:e,attrs:s,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e;},insertBefore(e,t,s){const a=e.childNodes.indexOf(s);e.childNodes.splice(a,0,t),t.parentNode=e;},setTemplateContent(e,t){e.content=t;},getTemplateContent:e=>e.content,setDocumentType(e,t,s,a){const r=e.childNodes.find((e=>"#documentType"===e.nodeName));if(r)r.name=t,r.publicId=s,r.systemId=a;else {const r={nodeName:"#documentType",name:t,publicId:s,systemId:a,parentNode:null};se.appendChild(e,r);}},setDocumentMode(e,t){e.mode=t;},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null;}},insertText(e,t){if(e.childNodes.length>0){const s=e.childNodes[e.childNodes.length-1];if(se.isTextNode(s))return void(s.value+=t)}se.appendChild(e,te(t));},insertTextBefore(e,t,s){const a=e.childNodes[e.childNodes.indexOf(s)-1];a&&se.isTextNode(a)?a.value+=t:se.insertBefore(e,te(t),s);},adoptAttributes(e,t){const s=new Set(e.attrs.map((e=>e.name)));for(let a=0;a<t.length;a++)s.has(t[a].name)||e.attrs.push(t[a]);},getFirstChild:e=>e.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t;},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t};}},ae="html",re=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],ne=[...re,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],ie=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),oe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],ce=[...oe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ee(e,t){return t.some((t=>e.startsWith(t)))}const Te=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),he=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:p.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:p.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:p.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:p.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:p.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:p.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:p.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:p.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:p.XML}],["xml:space",{prefix:"xml",name:"space",namespace:p.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:p.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:p.XMLNS}]]),_e=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),Ae=new Set([u.B,u.BIG,u.BLOCKQUOTE,u.BODY,u.BR,u.CENTER,u.CODE,u.DD,u.DIV,u.DL,u.DT,u.EM,u.EMBED,u.H1,u.H2,u.H3,u.H4,u.H5,u.H6,u.HEAD,u.HR,u.I,u.IMG,u.LI,u.LISTING,u.MENU,u.META,u.NOBR,u.OL,u.P,u.PRE,u.RUBY,u.S,u.SMALL,u.SPAN,u.STRONG,u.STRIKE,u.SUB,u.SUP,u.TABLE,u.TT,u.U,u.UL,u.VAR]);function le(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}}function me(e){for(let t=0;t<e.attrs.length;t++){const s=Te.get(e.attrs[t].name);null!=s&&(e.attrs[t].name=s);}}function pe(e){for(let t=0;t<e.attrs.length;t++){const s=he.get(e.attrs[t].name);s&&(e.attrs[t].prefix=s.prefix,e.attrs[t].name=s.name,e.attrs[t].namespace=s.namespace);}}var de;!function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET";}(de||(de={}));const Ie={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ne=new Set([u.TABLE,u.TBODY,u.TFOOT,u.THEAD,u.TR]),ue={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:se,onParseError:null};class Ce{constructor(e,t,s=null,a=null){this.fragmentContext=s,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=de.INITIAL,this.originalInsertionMode=de.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ue,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=t?t:this.treeAdapter.createDocument(),this.tokenizer=new v(this.options,this),this.activeFormattingElements=new ee(this.treeAdapter),this.fragmentContextID=s?f(this.treeAdapter.getTagName(s)):u.UNKNOWN,this._setContextModes(null!=s?s:this.document,this.fragmentContextID),this.openElements=new J(this.document,this.treeAdapter,this);}static parse(e,t){const s=new this(t);return s.tokenizer.write(e,!0),s.document}static getFragmentParser(e,t){const s={...ue,...t};null!=e||(e=s.treeAdapter.createElement(N.TEMPLATE,p.HTML,[]));const a=s.treeAdapter.createElement("documentmock",p.HTML,[]),r=new this(s,a,e);return r.fragmentContextID===u.TEMPLATE&&r.tmplInsertionModeStack.unshift(de.IN_TEMPLATE),r._initTokenizerForFragmentParsing(),r._insertFakeRootElement(),r._resetInsertionMode(),r._findFormInFragmentContext(),r}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,s){var a;if(!this.onParseError)return;const r=null!==(a=e.location)&&void 0!==a?a:Ie,n={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:s?r.startLine:r.endLine,endCol:s?r.startCol:r.endCol,endOffset:s?r.startOffset:r.endOffset};this.onParseError(n);}onItemPush(e,t,s){var a,r;null===(r=(a=this.treeAdapter).onItemPush)||void 0===r||r.call(a,e),s&&this.openElements.stackTop>0&&this._setContextModes(e,t);}onItemPop(e,t){var s,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(a=(s=this.treeAdapter).onItemPop)||void 0===a||a.call(s,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t);}}_setContextModes(e,t){const s=e===this.document||this.treeAdapter.getNamespaceURI(e)===p.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&!this._isIntegrationPoint(t,e);}_switchToTextParsing(e,t){this._insertElement(e,p.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=de.TEXT;}switchToPlaintextParsing(){this.insertionMode=de.TEXT,this.originalInsertionMode=de.IN_BODY,this.tokenizer.state=b.PLAINTEXT;}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===N.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e);}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===p.HTML)switch(this.fragmentContextID){case u.TITLE:case u.TEXTAREA:this.tokenizer.state=b.RCDATA;break;case u.STYLE:case u.XMP:case u.IFRAME:case u.NOEMBED:case u.NOFRAMES:case u.NOSCRIPT:this.tokenizer.state=b.RAWTEXT;break;case u.SCRIPT:this.tokenizer.state=b.SCRIPT_DATA;break;case u.PLAINTEXT:this.tokenizer.state=b.PLAINTEXT;}}_setDocumentType(e){const t=e.name||"",s=e.publicId||"",a=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,s,a),e.location){const t=this.treeAdapter.getChildNodes(this.document).find((e=>this.treeAdapter.isDocumentTypeNode(e)));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location);}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const s=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,s);}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else {const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t,e);}}_appendElement(e,t){const s=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(s,e.location);}_insertElement(e,t){const s=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(s,e.location),this.openElements.push(s,e.tagID);}_insertFakeElement(e,t){const s=this.treeAdapter.createElement(e,p.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,t);}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,p.HTML,e.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,s),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null);}_insertFakeRootElement(){const e=this.treeAdapter.createElement(N.HTML,p.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,u.HTML);}_appendCommentNode(e,t){const s=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location);}_insertCharacters(e){let t,s;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:s}=this._findFosterParentingLocation()),s?this.treeAdapter.insertTextBefore(t,e.chars,s):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const a=this.treeAdapter.getChildNodes(t),r=s?a.lastIndexOf(s):a.length,n=a[r-1];if(this.treeAdapter.getNodeSourceCodeLocation(n)){const{endLine:t,endCol:s,endOffset:a}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(n,{endLine:t,endCol:s,endOffset:a});}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location);}_adoptNodes(e,t){for(let s=this.treeAdapter.getFirstChild(e);s;s=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(t,s);}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const s=t.location,a=this.treeAdapter.getTagName(e),r=t.type===h.END_TAG&&a===t.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,r);}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return !1;let t,s;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,s=this.fragmentContextID):({current:t,currentTagId:s}=this.openElements),(e.tagID!==u.SVG||this.treeAdapter.getTagName(t)!==N.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==p.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===u.MGLYPH||e.tagID===u.MALIGNMARK)&&!this._isIntegrationPoint(s,t,p.HTML))}_processToken(e){switch(e.type){case h.CHARACTER:this.onCharacter(e);break;case h.NULL_CHARACTER:this.onNullCharacter(e);break;case h.COMMENT:this.onComment(e);break;case h.DOCTYPE:this.onDoctype(e);break;case h.START_TAG:this._processStartTag(e);break;case h.END_TAG:this.onEndTag(e);break;case h.EOF:this.onEof(e);break;case h.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);}}_isIntegrationPoint(e,t,s){return function(e,t,s,a){return (!a||a===p.HTML)&&function(e,t,s){if(t===p.MATHML&&e===u.ANNOTATION_XML)for(let e=0;e<s.length;e++)if(s[e].name===d.ENCODING){const t=s[e].value.toLowerCase();return "text/html"===t||"application/xhtml+xml"===t}return t===p.SVG&&(e===u.FOREIGN_OBJECT||e===u.DESC||e===u.TITLE)}(e,t,s)||(!a||a===p.MATHML)&&function(e,t){return t===p.MATHML&&(e===u.MI||e===u.MO||e===u.MN||e===u.MS||e===u.MTEXT)}(e,t)}(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),s)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex((e=>e.type===Z.Marker||this.openElements.contains(e.element)));for(let s=t<0?e-1:t-1;s>=0;s--){const e=this.activeFormattingElements.entries[s];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current;}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=de.IN_ROW;}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(u.P),this.openElements.popUntilTagNamePopped(u.P);}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case u.TR:return void(this.insertionMode=de.IN_ROW);case u.TBODY:case u.THEAD:case u.TFOOT:return void(this.insertionMode=de.IN_TABLE_BODY);case u.CAPTION:return void(this.insertionMode=de.IN_CAPTION);case u.COLGROUP:return void(this.insertionMode=de.IN_COLUMN_GROUP);case u.TABLE:return void(this.insertionMode=de.IN_TABLE);case u.BODY:return void(this.insertionMode=de.IN_BODY);case u.FRAMESET:return void(this.insertionMode=de.IN_FRAMESET);case u.SELECT:return void this._resetInsertionModeForSelect(e);case u.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case u.HTML:return void(this.insertionMode=this.headElement?de.AFTER_HEAD:de.BEFORE_HEAD);case u.TD:case u.TH:if(e>0)return void(this.insertionMode=de.IN_CELL);break;case u.HEAD:if(e>0)return void(this.insertionMode=de.IN_HEAD)}this.insertionMode=de.IN_BODY;}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===u.TEMPLATE)break;if(e===u.TABLE)return void(this.insertionMode=de.IN_SELECT_IN_TABLE)}this.insertionMode=de.IN_SELECT;}_isElementCausesFosterParenting(e){return Ne.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case u.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===p.HTML)return {parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case u.TABLE:{const s=this.treeAdapter.getParentNode(t);return s?{parent:s,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return {parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e);}_isSpecialElement(e,t){const s=this.treeAdapter.getNamespaceURI(e);return g[s].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1;}(this,e);else switch(this.insertionMode){case de.INITIAL:Pe(this,e);break;case de.BEFORE_HTML:be(this,e);break;case de.BEFORE_HEAD:Be(this,e);break;case de.IN_HEAD:Ue(this,e);break;case de.IN_HEAD_NO_SCRIPT:Ge(this,e);break;case de.AFTER_HEAD:ye(this,e);break;case de.IN_BODY:case de.IN_CAPTION:case de.IN_CELL:case de.IN_TEMPLATE:xe(this,e);break;case de.TEXT:case de.IN_SELECT:case de.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case de.IN_TABLE:case de.IN_TABLE_BODY:case de.IN_ROW:je(this,e);break;case de.IN_TABLE_TEXT:tt(this,e);break;case de.IN_COLUMN_GROUP:nt(this,e);break;case de.AFTER_BODY:lt(this,e);break;case de.AFTER_AFTER_BODY:mt(this,e);}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars=s,e._insertCharacters(t);}(this,e);else switch(this.insertionMode){case de.INITIAL:Pe(this,e);break;case de.BEFORE_HTML:be(this,e);break;case de.BEFORE_HEAD:Be(this,e);break;case de.IN_HEAD:Ue(this,e);break;case de.IN_HEAD_NO_SCRIPT:Ge(this,e);break;case de.AFTER_HEAD:ye(this,e);break;case de.TEXT:this._insertCharacters(e);break;case de.IN_TABLE:case de.IN_TABLE_BODY:case de.IN_ROW:je(this,e);break;case de.IN_COLUMN_GROUP:nt(this,e);break;case de.AFTER_BODY:lt(this,e);break;case de.AFTER_AFTER_BODY:mt(this,e);}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)Me(this,e);else switch(this.insertionMode){case de.INITIAL:case de.BEFORE_HTML:case de.BEFORE_HEAD:case de.IN_HEAD:case de.IN_HEAD_NO_SCRIPT:case de.AFTER_HEAD:case de.IN_BODY:case de.IN_TABLE:case de.IN_CAPTION:case de.IN_COLUMN_GROUP:case de.IN_TABLE_BODY:case de.IN_ROW:case de.IN_CELL:case de.IN_SELECT:case de.IN_SELECT_IN_TABLE:case de.IN_TEMPLATE:case de.IN_FRAMESET:case de.AFTER_FRAMESET:Me(this,e);break;case de.IN_TABLE_TEXT:st(this,e);break;case de.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0]);}(this,e);break;case de.AFTER_AFTER_BODY:case de.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document);}(this,e);}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case de.INITIAL:!function(e,t){e._setDocumentType(t);const s=t.forceQuirks?I.QUIRKS:function(e){if(e.name!==ae)return I.QUIRKS;const{systemId:t}=e;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return I.QUIRKS;let{publicId:s}=e;if(null!==s){if(s=s.toLowerCase(),ie.has(s))return I.QUIRKS;let e=null===t?ne:re;if(Ee(s,e))return I.QUIRKS;if(e=null===t?oe:ce,Ee(s,e))return I.LIMITED_QUIRKS}return I.NO_QUIRKS}(t);(function(e){return e.name===ae&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err(t,T.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,s),e.insertionMode=de.BEFORE_HTML;}(this,e);break;case de.BEFORE_HEAD:case de.IN_HEAD:case de.IN_HEAD_NO_SCRIPT:case de.AFTER_HEAD:this._err(e,T.misplacedDoctype);break;case de.IN_TABLE_TEXT:st(this,e);}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,T.nonVoidHtmlElementStartTagWithTrailingSolidus);}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(function(e){const t=e.tagID;return t===u.FONT&&e.attrs.some((({name:e})=>e===d.COLOR||e===d.SIZE||e===d.FACE))||Ae.has(t)}(t))pt(e),e._startTagOutsideForeignContent(t);else {const s=e._getAdjustedCurrentElement(),a=e.treeAdapter.getNamespaceURI(s);a===p.MATHML?le(t):a===p.SVG&&(function(e){const t=_e.get(e.tagName);null!=t&&(e.tagName=t,e.tagID=f(e.tagName));}(t),me(t)),pe(t),t.selfClosing?e._appendElement(t,a):e._insertElement(t,a),t.ackSelfClosing=!0;}}(this,e):this._startTagOutsideForeignContent(e);}_startTagOutsideForeignContent(e){switch(this.insertionMode){case de.INITIAL:Pe(this,e);break;case de.BEFORE_HTML:!function(e,t){t.tagID===u.HTML?(e._insertElement(t,p.HTML),e.insertionMode=de.BEFORE_HEAD):be(e,t);}(this,e);break;case de.BEFORE_HEAD:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.HEAD:e._insertElement(t,p.HTML),e.headElement=e.openElements.current,e.insertionMode=de.IN_HEAD;break;default:Be(e,t);}}(this,e);break;case de.IN_HEAD:He(this,e);break;case de.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.BASEFONT:case u.BGSOUND:case u.HEAD:case u.LINK:case u.META:case u.NOFRAMES:case u.STYLE:He(e,t);break;case u.NOSCRIPT:e._err(t,T.nestedNoscriptInHead);break;default:Ge(e,t);}}(this,e);break;case de.AFTER_HEAD:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.BODY:e._insertElement(t,p.HTML),e.framesetOk=!1,e.insertionMode=de.IN_BODY;break;case u.FRAMESET:e._insertElement(t,p.HTML),e.insertionMode=de.IN_FRAMESET;break;case u.BASE:case u.BASEFONT:case u.BGSOUND:case u.LINK:case u.META:case u.NOFRAMES:case u.SCRIPT:case u.STYLE:case u.TEMPLATE:case u.TITLE:e._err(t,T.abandonedHeadElementChild),e.openElements.push(e.headElement,u.HEAD),He(e,t),e.openElements.remove(e.headElement);break;case u.HEAD:e._err(t,T.misplacedStartTagForHeadElement);break;default:ye(e,t);}}(this,e);break;case de.IN_BODY:Xe(this,e);break;case de.IN_TABLE:Je(this,e);break;case de.IN_TABLE_TEXT:st(this,e);break;case de.IN_CAPTION:!function(e,t){const s=t.tagID;at.has(s)?e.openElements.hasInTableScope(u.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=de.IN_TABLE,Je(e,t)):Xe(e,t);}(this,e);break;case de.IN_COLUMN_GROUP:rt(this,e);break;case de.IN_TABLE_BODY:it(this,e);break;case de.IN_ROW:ct(this,e);break;case de.IN_CELL:!function(e,t){const s=t.tagID;at.has(s)?(e.openElements.hasInTableScope(u.TD)||e.openElements.hasInTableScope(u.TH))&&(e._closeTableCell(),ct(e,t)):Xe(e,t);}(this,e);break;case de.IN_SELECT:Tt(this,e);break;case de.IN_SELECT_IN_TABLE:!function(e,t){const s=t.tagID;s===u.CAPTION||s===u.TABLE||s===u.TBODY||s===u.TFOOT||s===u.THEAD||s===u.TR||s===u.TD||s===u.TH?(e.openElements.popUntilTagNamePopped(u.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Tt(e,t);}(this,e);break;case de.IN_TEMPLATE:!function(e,t){switch(t.tagID){case u.BASE:case u.BASEFONT:case u.BGSOUND:case u.LINK:case u.META:case u.NOFRAMES:case u.SCRIPT:case u.STYLE:case u.TEMPLATE:case u.TITLE:He(e,t);break;case u.CAPTION:case u.COLGROUP:case u.TBODY:case u.TFOOT:case u.THEAD:e.tmplInsertionModeStack[0]=de.IN_TABLE,e.insertionMode=de.IN_TABLE,Je(e,t);break;case u.COL:e.tmplInsertionModeStack[0]=de.IN_COLUMN_GROUP,e.insertionMode=de.IN_COLUMN_GROUP,rt(e,t);break;case u.TR:e.tmplInsertionModeStack[0]=de.IN_TABLE_BODY,e.insertionMode=de.IN_TABLE_BODY,it(e,t);break;case u.TD:case u.TH:e.tmplInsertionModeStack[0]=de.IN_ROW,e.insertionMode=de.IN_ROW,ct(e,t);break;default:e.tmplInsertionModeStack[0]=de.IN_BODY,e.insertionMode=de.IN_BODY,Xe(e,t);}}(this,e);break;case de.AFTER_BODY:!function(e,t){t.tagID===u.HTML?Xe(e,t):lt(e,t);}(this,e);break;case de.IN_FRAMESET:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.FRAMESET:e._insertElement(t,p.HTML);break;case u.FRAME:e._appendElement(t,p.HTML),t.ackSelfClosing=!0;break;case u.NOFRAMES:He(e,t);}}(this,e);break;case de.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.NOFRAMES:He(e,t);}}(this,e);break;case de.AFTER_AFTER_BODY:!function(e,t){t.tagID===u.HTML?Xe(e,t):mt(e,t);}(this,e);break;case de.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.NOFRAMES:He(e,t);}}(this,e);}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===u.P||t.tagID===u.BR)return pt(e),void e._endTagOutsideForeignContent(t);for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s];if(e.treeAdapter.getNamespaceURI(a)===p.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(a);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(s);break}}}(this,e):this._endTagOutsideForeignContent(e);}_endTagOutsideForeignContent(e){switch(this.insertionMode){case de.INITIAL:Pe(this,e);break;case de.BEFORE_HTML:!function(e,t){const s=t.tagID;s!==u.HTML&&s!==u.HEAD&&s!==u.BODY&&s!==u.BR||be(e,t);}(this,e);break;case de.BEFORE_HEAD:!function(e,t){const s=t.tagID;s===u.HEAD||s===u.BODY||s===u.HTML||s===u.BR?Be(e,t):e._err(t,T.endTagWithoutMatchingOpenElement);}(this,e);break;case de.IN_HEAD:!function(e,t){switch(t.tagID){case u.HEAD:e.openElements.pop(),e.insertionMode=de.AFTER_HEAD;break;case u.BODY:case u.BR:case u.HTML:Ue(e,t);break;case u.TEMPLATE:Fe(e,t);break;default:e._err(t,T.endTagWithoutMatchingOpenElement);}}(this,e);break;case de.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case u.NOSCRIPT:e.openElements.pop(),e.insertionMode=de.IN_HEAD;break;case u.BR:Ge(e,t);break;default:e._err(t,T.endTagWithoutMatchingOpenElement);}}(this,e);break;case de.AFTER_HEAD:!function(e,t){switch(t.tagID){case u.BODY:case u.HTML:case u.BR:ye(e,t);break;case u.TEMPLATE:Fe(e,t);break;default:e._err(t,T.endTagWithoutMatchingOpenElement);}}(this,e);break;case de.IN_BODY:Ve(this,e);break;case de.TEXT:!function(e,t){var s;t.tagID===u.SCRIPT&&(null===(s=e.scriptHandler)||void 0===s||s.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode;}(this,e);break;case de.IN_TABLE:Ze(this,e);break;case de.IN_TABLE_TEXT:st(this,e);break;case de.IN_CAPTION:!function(e,t){const s=t.tagID;switch(s){case u.CAPTION:case u.TABLE:e.openElements.hasInTableScope(u.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=de.IN_TABLE,s===u.TABLE&&Ze(e,t));break;case u.BODY:case u.COL:case u.COLGROUP:case u.HTML:case u.TBODY:case u.TD:case u.TFOOT:case u.TH:case u.THEAD:case u.TR:break;default:Ve(e,t);}}(this,e);break;case de.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case u.COLGROUP:e.openElements.currentTagId===u.COLGROUP&&(e.openElements.pop(),e.insertionMode=de.IN_TABLE);break;case u.TEMPLATE:Fe(e,t);break;case u.COL:break;default:nt(e,t);}}(this,e);break;case de.IN_TABLE_BODY:ot(this,e);break;case de.IN_ROW:Et(this,e);break;case de.IN_CELL:!function(e,t){const s=t.tagID;switch(s){case u.TD:case u.TH:e.openElements.hasInTableScope(s)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(s),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=de.IN_ROW);break;case u.TABLE:case u.TBODY:case u.TFOOT:case u.THEAD:case u.TR:e.openElements.hasInTableScope(s)&&(e._closeTableCell(),Et(e,t));break;case u.BODY:case u.CAPTION:case u.COL:case u.COLGROUP:case u.HTML:break;default:Ve(e,t);}}(this,e);break;case de.IN_SELECT:ht(this,e);break;case de.IN_SELECT_IN_TABLE:!function(e,t){const s=t.tagID;s===u.CAPTION||s===u.TABLE||s===u.TBODY||s===u.TFOOT||s===u.THEAD||s===u.TR||s===u.TD||s===u.TH?e.openElements.hasInTableScope(s)&&(e.openElements.popUntilTagNamePopped(u.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ht(e,t);}(this,e);break;case de.IN_TEMPLATE:!function(e,t){t.tagID===u.TEMPLATE&&Fe(e,t);}(this,e);break;case de.AFTER_BODY:At(this,e);break;case de.IN_FRAMESET:!function(e,t){t.tagID!==u.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===u.FRAMESET||(e.insertionMode=de.AFTER_FRAMESET));}(this,e);break;case de.AFTER_FRAMESET:!function(e,t){t.tagID===u.HTML&&(e.insertionMode=de.AFTER_AFTER_FRAMESET);}(this,e);break;case de.AFTER_AFTER_BODY:mt(this,e);}}onEof(e){switch(this.insertionMode){case de.INITIAL:Pe(this,e);break;case de.BEFORE_HTML:be(this,e);break;case de.BEFORE_HEAD:Be(this,e);break;case de.IN_HEAD:Ue(this,e);break;case de.IN_HEAD_NO_SCRIPT:Ge(this,e);break;case de.AFTER_HEAD:ye(this,e);break;case de.IN_BODY:case de.IN_TABLE:case de.IN_CAPTION:case de.IN_COLUMN_GROUP:case de.IN_TABLE_BODY:case de.IN_ROW:case de.IN_CELL:case de.IN_SELECT:case de.IN_SELECT_IN_TABLE:ze(this,e);break;case de.TEXT:!function(e,t){e._err(t,T.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t);}(this,e);break;case de.IN_TABLE_TEXT:st(this,e);break;case de.IN_TEMPLATE:_t(this,e);break;case de.AFTER_BODY:case de.IN_FRAMESET:case de.AFTER_FRAMESET:case de.AFTER_AFTER_BODY:case de.AFTER_AFTER_FRAMESET:ke(this,e);}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===a.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1);}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case de.IN_HEAD:case de.IN_HEAD_NO_SCRIPT:case de.AFTER_HEAD:case de.TEXT:case de.IN_COLUMN_GROUP:case de.IN_SELECT:case de.IN_SELECT_IN_TABLE:case de.IN_FRAMESET:case de.AFTER_FRAMESET:this._insertCharacters(e);break;case de.IN_BODY:case de.IN_CAPTION:case de.IN_CELL:case de.IN_TEMPLATE:case de.AFTER_BODY:case de.AFTER_AFTER_BODY:case de.AFTER_AFTER_FRAMESET:Ye(this,e);break;case de.IN_TABLE:case de.IN_TABLE_BODY:case de.IN_ROW:je(this,e);break;case de.IN_TABLE_TEXT:et(this,e);}}}function De(e,t){let s=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return s?e.openElements.contains(s.element)?e.openElements.hasInScope(t.tagID)||(s=null):(e.activeFormattingElements.removeEntry(s),s=null):Ke(e,t),s}function Se(e,t){let s=null,a=e.openElements.stackTop;for(;a>=0;a--){const r=e.openElements.items[a];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[a])&&(s=r);}return s||(e.openElements.shortenToLength(a<0?0:a),e.activeFormattingElements.removeEntry(t)),s}function Re(e,t,s){let a=t,r=e.openElements.getCommonAncestor(t);for(let n=0,i=r;i!==s;n++,i=r){r=e.openElements.getCommonAncestor(i);const s=e.activeFormattingElements.getElementEntry(i),o=s&&n>=3;!s||o?(o&&e.activeFormattingElements.removeEntry(s),e.openElements.remove(i)):(i=Oe(e,s),a===t&&(e.activeFormattingElements.bookmark=s),e.treeAdapter.detachNode(a),e.treeAdapter.appendChild(i,a),a=i);}return a}function Oe(e,t){const s=e.treeAdapter.getNamespaceURI(t.element),a=e.treeAdapter.createElement(t.token.tagName,s,t.token.attrs);return e.openElements.replace(t.element,a),t.element=a,a}function fe(e,t,s){const a=f(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(a))e._fosterParentElement(s);else {const r=e.treeAdapter.getNamespaceURI(t);a===u.TEMPLATE&&r===p.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,s);}}function Le(e,t,s){const a=e.treeAdapter.getNamespaceURI(s.element),{token:r}=s,n=e.treeAdapter.createElement(r.tagName,a,r.attrs);e._adoptNodes(t,n),e.treeAdapter.appendChild(t,n),e.activeFormattingElements.insertElementAfterBookmark(n,r),e.activeFormattingElements.removeEntry(s),e.openElements.remove(s.element),e.openElements.insertAfter(t,n,r.tagID);}function ge(e,t){for(let s=0;s<8;s++){const s=De(e,t);if(!s)break;const a=Se(e,s);if(!a)break;e.activeFormattingElements.bookmark=s;const r=Re(e,a,s.element),n=e.openElements.getCommonAncestor(s.element);e.treeAdapter.detachNode(r),n&&fe(e,n,r),Le(e,a,s);}}function Me(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode);}function ke(e,t){if(e.stopped=!0,t.location){const s=e.fragmentContext?0:2;for(let a=e.openElements.stackTop;a>=s;a--)e._setEndLocation(e.openElements.items[a],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],a=e.treeAdapter.getNodeSourceCodeLocation(s);if(a&&!a.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t);}}}}function Pe(e,t){e._err(t,T.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,I.QUIRKS),e.insertionMode=de.BEFORE_HTML,e._processToken(t);}function be(e,t){e._insertFakeRootElement(),e.insertionMode=de.BEFORE_HEAD,e._processToken(t);}function Be(e,t){e._insertFakeElement(N.HEAD,u.HEAD),e.headElement=e.openElements.current,e.insertionMode=de.IN_HEAD,e._processToken(t);}function He(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.BASE:case u.BASEFONT:case u.BGSOUND:case u.LINK:case u.META:e._appendElement(t,p.HTML),t.ackSelfClosing=!0;break;case u.TITLE:e._switchToTextParsing(t,b.RCDATA);break;case u.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,b.RAWTEXT):(e._insertElement(t,p.HTML),e.insertionMode=de.IN_HEAD_NO_SCRIPT);break;case u.NOFRAMES:case u.STYLE:e._switchToTextParsing(t,b.RAWTEXT);break;case u.SCRIPT:e._switchToTextParsing(t,b.SCRIPT_DATA);break;case u.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=de.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(de.IN_TEMPLATE);break;case u.HEAD:e._err(t,T.misplacedStartTagForHeadElement);break;default:Ue(e,t);}}function Fe(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==u.TEMPLATE&&e._err(t,T.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(u.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,T.endTagWithoutMatchingOpenElement);}function Ue(e,t){e.openElements.pop(),e.insertionMode=de.AFTER_HEAD,e._processToken(t);}function Ge(e,t){const s=t.type===h.EOF?T.openElementsLeftAfterEof:T.disallowedContentInNoscriptInHead;e._err(t,s),e.openElements.pop(),e.insertionMode=de.IN_HEAD,e._processToken(t);}function ye(e,t){e._insertFakeElement(N.BODY,u.BODY),e.insertionMode=de.IN_BODY,we(e,t);}function we(e,t){switch(t.type){case h.CHARACTER:xe(e,t);break;case h.WHITESPACE_CHARACTER:Ye(e,t);break;case h.COMMENT:Me(e,t);break;case h.START_TAG:Xe(e,t);break;case h.END_TAG:Ve(e,t);break;case h.EOF:ze(e,t);}}function Ye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t);}function xe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1;}function ve(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,p.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}function Qe(e){const t=A(e,d.TYPE);return null!=t&&"hidden"===t.toLowerCase()}function qe(e,t){e._switchToTextParsing(t,b.RAWTEXT);}function We(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML);}function Xe(e,t){switch(t.tagID){case u.I:case u.S:case u.B:case u.U:case u.EM:case u.TT:case u.BIG:case u.CODE:case u.FONT:case u.SMALL:case u.STRIKE:case u.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t);break;case u.A:!function(e,t){const s=e.activeFormattingElements.getElementEntryInScopeWithTagName(N.A);s&&(ge(e,t),e.openElements.remove(s.element),e.activeFormattingElements.removeEntry(s)),e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t);break;case u.H1:case u.H2:case u.H3:case u.H4:case u.H5:case u.H6:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),M(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,p.HTML);}(e,t);break;case u.P:case u.DL:case u.OL:case u.UL:case u.DIV:case u.DIR:case u.NAV:case u.MAIN:case u.MENU:case u.ASIDE:case u.CENTER:case u.FIGURE:case u.FOOTER:case u.HEADER:case u.HGROUP:case u.DIALOG:case u.DETAILS:case u.ADDRESS:case u.ARTICLE:case u.SECTION:case u.SUMMARY:case u.FIELDSET:case u.BLOCKQUOTE:case u.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML);}(e,t);break;case u.LI:case u.DD:case u.DT:!function(e,t){e.framesetOk=!1;const s=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const a=e.openElements.tagIDs[t];if(s===u.LI&&a===u.LI||(s===u.DD||s===u.DT)&&(a===u.DD||a===u.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==u.ADDRESS&&a!==u.DIV&&a!==u.P&&e._isSpecialElement(e.openElements.items[t],a))break}e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML);}(e,t);break;case u.BR:case u.IMG:case u.WBR:case u.AREA:case u.EMBED:case u.KEYGEN:ve(e,t);break;case u.HR:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._appendElement(t,p.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}(e,t);break;case u.RB:case u.RTC:!function(e,t){e.openElements.hasInScope(u.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,p.HTML);}(e,t);break;case u.RT:case u.RP:!function(e,t){e.openElements.hasInScope(u.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(u.RTC),e._insertElement(t,p.HTML);}(e,t);break;case u.PRE:case u.LISTING:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML),e.skipNextNewLine=!0,e.framesetOk=!1;}(e,t);break;case u.XMP:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,b.RAWTEXT);}(e,t);break;case u.SVG:!function(e,t){e._reconstructActiveFormattingElements(),me(t),pe(t),t.selfClosing?e._appendElement(t,p.SVG):e._insertElement(t,p.SVG),t.ackSelfClosing=!0;}(e,t);break;case u.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs);}(e,t);break;case u.BASE:case u.LINK:case u.META:case u.STYLE:case u.TITLE:case u.SCRIPT:case u.BGSOUND:case u.BASEFONT:case u.TEMPLATE:He(e,t);break;case u.BODY:!function(e,t){const s=e.openElements.tryPeekProperlyNestedBodyElement();s&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(s,t.attrs));}(e,t);break;case u.FORM:!function(e,t){const s=e.openElements.tmplCount>0;e.formElement&&!s||(e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML),s||(e.formElement=e.openElements.current));}(e,t);break;case u.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(u.NOBR)&&(ge(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,p.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t);break;case u.MATH:!function(e,t){e._reconstructActiveFormattingElements(),le(t),pe(t),t.selfClosing?e._appendElement(t,p.MATHML):e._insertElement(t,p.MATHML),t.ackSelfClosing=!0;}(e,t);break;case u.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==I.QUIRKS&&e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML),e.framesetOk=!1,e.insertionMode=de.IN_TABLE;}(e,t);break;case u.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,p.HTML),Qe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0;}(e,t);break;case u.PARAM:case u.TRACK:case u.SOURCE:!function(e,t){e._appendElement(t,p.HTML),t.ackSelfClosing=!0;}(e,t);break;case u.IMAGE:!function(e,t){t.tagName=N.IMG,t.tagID=u.IMG,ve(e,t);}(e,t);break;case u.BUTTON:!function(e,t){e.openElements.hasInScope(u.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML),e.framesetOk=!1;}(e,t);break;case u.APPLET:case u.OBJECT:case u.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1;}(e,t);break;case u.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,b.RAWTEXT);}(e,t);break;case u.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===de.IN_TABLE||e.insertionMode===de.IN_CAPTION||e.insertionMode===de.IN_TABLE_BODY||e.insertionMode===de.IN_ROW||e.insertionMode===de.IN_CELL?de.IN_SELECT_IN_TABLE:de.IN_SELECT;}(e,t);break;case u.OPTION:case u.OPTGROUP:!function(e,t){e.openElements.currentTagId===u.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,p.HTML);}(e,t);break;case u.NOEMBED:qe(e,t);break;case u.FRAMESET:!function(e,t){const s=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&s&&(e.treeAdapter.detachNode(s),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_FRAMESET);}(e,t);break;case u.TEXTAREA:!function(e,t){e._insertElement(t,p.HTML),e.skipNextNewLine=!0,e.tokenizer.state=b.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=de.TEXT;}(e,t);break;case u.NOSCRIPT:e.options.scriptingEnabled?qe(e,t):We(e,t);break;case u.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(u.P)&&e._closePElement(),e._insertElement(t,p.HTML),e.tokenizer.state=b.PLAINTEXT;}(e,t);break;case u.COL:case u.TH:case u.TD:case u.TR:case u.HEAD:case u.FRAME:case u.TBODY:case u.TFOOT:case u.THEAD:case u.CAPTION:case u.COLGROUP:break;default:We(e,t);}}function Ke(e,t){const s=t.tagName,a=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const r=e.openElements.items[t],n=e.openElements.tagIDs[t];if(a===n&&(a!==u.UNKNOWN||e.treeAdapter.getTagName(r)===s)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(r,n))break}}function Ve(e,t){switch(t.tagID){case u.A:case u.B:case u.I:case u.S:case u.U:case u.EM:case u.TT:case u.BIG:case u.CODE:case u.FONT:case u.NOBR:case u.SMALL:case u.STRIKE:case u.STRONG:ge(e,t);break;case u.P:!function(e){e.openElements.hasInButtonScope(u.P)||e._insertFakeElement(N.P,u.P),e._closePElement();}(e);break;case u.DL:case u.UL:case u.OL:case u.DIR:case u.DIV:case u.NAV:case u.PRE:case u.MAIN:case u.MENU:case u.ASIDE:case u.BUTTON:case u.CENTER:case u.FIGURE:case u.FOOTER:case u.HEADER:case u.HGROUP:case u.DIALOG:case u.ADDRESS:case u.ARTICLE:case u.DETAILS:case u.SECTION:case u.SUMMARY:case u.LISTING:case u.FIELDSET:case u.BLOCKQUOTE:case u.FIGCAPTION:!function(e,t){const s=t.tagID;e.openElements.hasInScope(s)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(s));}(e,t);break;case u.LI:!function(e){e.openElements.hasInListItemScope(u.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(u.LI),e.openElements.popUntilTagNamePopped(u.LI));}(e);break;case u.DD:case u.DT:!function(e,t){const s=t.tagID;e.openElements.hasInScope(s)&&(e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s));}(e,t);break;case u.H1:case u.H2:case u.H3:case u.H4:case u.H5:case u.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped());}(e);break;case u.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(N.BR,u.BR),e.openElements.pop(),e.framesetOk=!1;}(e);break;case u.BODY:!function(e,t){if(e.openElements.hasInScope(u.BODY)&&(e.insertionMode=de.AFTER_BODY,e.options.sourceCodeLocationInfo)){const s=e.openElements.tryPeekProperlyNestedBodyElement();s&&e._setEndLocation(s,t);}}(e,t);break;case u.HTML:!function(e,t){e.openElements.hasInScope(u.BODY)&&(e.insertionMode=de.AFTER_BODY,At(e,t));}(e,t);break;case u.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:s}=e;t||(e.formElement=null),(s||t)&&e.openElements.hasInScope(u.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(u.FORM):s&&e.openElements.remove(s));}(e);break;case u.APPLET:case u.OBJECT:case u.MARQUEE:!function(e,t){const s=t.tagID;e.openElements.hasInScope(s)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(s),e.activeFormattingElements.clearToLastMarker());}(e,t);break;case u.TEMPLATE:Fe(e,t);break;default:Ke(e,t);}}function ze(e,t){e.tmplInsertionModeStack.length>0?_t(e,t):ke(e,t);}function je(e,t){if(Ne.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=de.IN_TABLE_TEXT,t.type){case h.CHARACTER:tt(e,t);break;case h.WHITESPACE_CHARACTER:et(e,t);}else $e(e,t);}function Je(e,t){switch(t.tagID){case u.TD:case u.TH:case u.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(N.TBODY,u.TBODY),e.insertionMode=de.IN_TABLE_BODY,it(e,t);}(e,t);break;case u.STYLE:case u.SCRIPT:case u.TEMPLATE:He(e,t);break;case u.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(N.COLGROUP,u.COLGROUP),e.insertionMode=de.IN_COLUMN_GROUP,rt(e,t);}(e,t);break;case u.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,p.HTML),e.formElement=e.openElements.current,e.openElements.pop());}(e,t);break;case u.TABLE:!function(e,t){e.openElements.hasInTableScope(u.TABLE)&&(e.openElements.popUntilTagNamePopped(u.TABLE),e._resetInsertionMode(),e._processStartTag(t));}(e,t);break;case u.TBODY:case u.TFOOT:case u.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_TABLE_BODY;}(e,t);break;case u.INPUT:!function(e,t){Qe(t)?e._appendElement(t,p.HTML):$e(e,t),t.ackSelfClosing=!0;}(e,t);break;case u.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_CAPTION;}(e,t);break;case u.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_COLUMN_GROUP;}(e,t);break;default:$e(e,t);}}function Ze(e,t){switch(t.tagID){case u.TABLE:e.openElements.hasInTableScope(u.TABLE)&&(e.openElements.popUntilTagNamePopped(u.TABLE),e._resetInsertionMode());break;case u.TEMPLATE:Fe(e,t);break;case u.BODY:case u.CAPTION:case u.COL:case u.COLGROUP:case u.HTML:case u.TBODY:case u.TD:case u.TFOOT:case u.TH:case u.THEAD:case u.TR:break;default:$e(e,t);}}function $e(e,t){const s=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,we(e,t),e.fosterParentingEnabled=s;}function et(e,t){e.pendingCharacterTokens.push(t);}function tt(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0;}function st(e,t){let s=0;if(e.hasNonWhitespacePendingCharacterToken)for(;s<e.pendingCharacterTokens.length;s++)$e(e,e.pendingCharacterTokens[s]);else for(;s<e.pendingCharacterTokens.length;s++)e._insertCharacters(e.pendingCharacterTokens[s]);e.insertionMode=e.originalInsertionMode,e._processToken(t);}const at=new Set([u.CAPTION,u.COL,u.COLGROUP,u.TBODY,u.TD,u.TFOOT,u.TH,u.THEAD,u.TR]);function rt(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.COL:e._appendElement(t,p.HTML),t.ackSelfClosing=!0;break;case u.TEMPLATE:He(e,t);break;default:nt(e,t);}}function nt(e,t){e.openElements.currentTagId===u.COLGROUP&&(e.openElements.pop(),e.insertionMode=de.IN_TABLE,e._processToken(t));}function it(e,t){switch(t.tagID){case u.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_ROW;break;case u.TH:case u.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(N.TR,u.TR),e.insertionMode=de.IN_ROW,ct(e,t);break;case u.CAPTION:case u.COL:case u.COLGROUP:case u.TBODY:case u.TFOOT:case u.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE,Je(e,t));break;default:Je(e,t);}}function ot(e,t){const s=t.tagID;switch(t.tagID){case u.TBODY:case u.TFOOT:case u.THEAD:e.openElements.hasInTableScope(s)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE);break;case u.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE,Ze(e,t));break;case u.BODY:case u.CAPTION:case u.COL:case u.COLGROUP:case u.HTML:case u.TD:case u.TH:case u.TR:break;default:Ze(e,t);}}function ct(e,t){switch(t.tagID){case u.TH:case u.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,p.HTML),e.insertionMode=de.IN_CELL,e.activeFormattingElements.insertMarker();break;case u.CAPTION:case u.COL:case u.COLGROUP:case u.TBODY:case u.TFOOT:case u.THEAD:case u.TR:e.openElements.hasInTableScope(u.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE_BODY,it(e,t));break;default:Je(e,t);}}function Et(e,t){switch(t.tagID){case u.TR:e.openElements.hasInTableScope(u.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE_BODY);break;case u.TABLE:e.openElements.hasInTableScope(u.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE_BODY,ot(e,t));break;case u.TBODY:case u.TFOOT:case u.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(u.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=de.IN_TABLE_BODY,ot(e,t));break;case u.BODY:case u.CAPTION:case u.COL:case u.COLGROUP:case u.HTML:case u.TD:case u.TH:break;default:Ze(e,t);}}function Tt(e,t){switch(t.tagID){case u.HTML:Xe(e,t);break;case u.OPTION:e.openElements.currentTagId===u.OPTION&&e.openElements.pop(),e._insertElement(t,p.HTML);break;case u.OPTGROUP:e.openElements.currentTagId===u.OPTION&&e.openElements.pop(),e.openElements.currentTagId===u.OPTGROUP&&e.openElements.pop(),e._insertElement(t,p.HTML);break;case u.INPUT:case u.KEYGEN:case u.TEXTAREA:case u.SELECT:e.openElements.hasInSelectScope(u.SELECT)&&(e.openElements.popUntilTagNamePopped(u.SELECT),e._resetInsertionMode(),t.tagID!==u.SELECT&&e._processStartTag(t));break;case u.SCRIPT:case u.TEMPLATE:He(e,t);}}function ht(e,t){switch(t.tagID){case u.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===u.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===u.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===u.OPTGROUP&&e.openElements.pop();break;case u.OPTION:e.openElements.currentTagId===u.OPTION&&e.openElements.pop();break;case u.SELECT:e.openElements.hasInSelectScope(u.SELECT)&&(e.openElements.popUntilTagNamePopped(u.SELECT),e._resetInsertionMode());break;case u.TEMPLATE:Fe(e,t);}}function _t(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(u.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ke(e,t);}function At(e,t){var s;if(t.tagID===u.HTML){if(e.fragmentContext||(e.insertionMode=de.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===u.HTML){e._setEndLocation(e.openElements.items[0],t);const a=e.openElements.items[1];a&&!(null===(s=e.treeAdapter.getNodeSourceCodeLocation(a))||void 0===s?void 0:s.endTag)&&e._setEndLocation(a,t);}}else lt(e,t);}function lt(e,t){e.insertionMode=de.IN_BODY,we(e,t);}function mt(e,t){e.insertionMode=de.IN_BODY,we(e,t);}function pt(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==p.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop();}return e.parse=function(e,t){return Ce.parse(e,t)},e.parseFragment=function(e,t,s){"string"==typeof e&&(s=t,t=e,e=null);const a=Ce.getFragmentParser(e,s);return a.tokenizer.write(t,!0),a.getFragment()},Object.defineProperty(e,"__esModule",{value:!0}),e}({});const parse$3=e.parse;const parseFragment=e.parseFragment;

const docParser = new WeakMap();
function parseDocumentUtil(ownerDocument, html) {
  const doc = parse$3(html.trim(), getParser(ownerDocument));
  doc.documentElement = doc.firstElementChild;
  doc.head = doc.documentElement.firstElementChild;
  doc.body = doc.head.nextElementSibling;
  return doc;
}
function parseFragmentUtil(ownerDocument, html) {
  if (typeof html === 'string') {
    html = html.trim();
  }
  else {
    html = '';
  }
  const frag = parseFragment(html, getParser(ownerDocument));
  return frag;
}
function getParser(ownerDocument) {
  let parseOptions = docParser.get(ownerDocument);
  if (parseOptions != null) {
    return parseOptions;
  }
  const treeAdapter = {
    createDocument() {
      const doc = ownerDocument.createElement("#document" /* NODE_NAMES.DOCUMENT_NODE */);
      doc['x-mode'] = 'no-quirks';
      return doc;
    },
    setNodeSourceCodeLocation(node, location) {
      node.sourceCodeLocation = location;
    },
    getNodeSourceCodeLocation(node) {
      return node.sourceCodeLocation;
    },
    createDocumentFragment() {
      return ownerDocument.createDocumentFragment();
    },
    createElement(tagName, namespaceURI, attrs) {
      const elm = ownerDocument.createElementNS(namespaceURI, tagName);
      for (let i = 0; i < attrs.length; i++) {
        const attr = attrs[i];
        if (attr.namespace == null || attr.namespace === 'http://www.w3.org/1999/xhtml') {
          elm.setAttribute(attr.name, attr.value);
        }
        else {
          elm.setAttributeNS(attr.namespace, attr.name, attr.value);
        }
      }
      return elm;
    },
    createCommentNode(data) {
      return ownerDocument.createComment(data);
    },
    appendChild(parentNode, newNode) {
      parentNode.appendChild(newNode);
    },
    insertBefore(parentNode, newNode, referenceNode) {
      parentNode.insertBefore(newNode, referenceNode);
    },
    setTemplateContent(templateElement, contentElement) {
      templateElement.content = contentElement;
    },
    getTemplateContent(templateElement) {
      return templateElement.content;
    },
    setDocumentType(doc, name, publicId, systemId) {
      let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */);
      if (doctypeNode == null) {
        doctypeNode = ownerDocument.createDocumentTypeNode();
        doc.insertBefore(doctypeNode, doc.firstChild);
      }
      doctypeNode.nodeValue = '!DOCTYPE';
      doctypeNode['x-name'] = name;
      doctypeNode['x-publicId'] = publicId;
      doctypeNode['x-systemId'] = systemId;
    },
    setDocumentMode(doc, mode) {
      doc['x-mode'] = mode;
    },
    getDocumentMode(doc) {
      return doc['x-mode'];
    },
    detachNode(node) {
      node.remove();
    },
    insertText(parentNode, text) {
      const lastChild = parentNode.lastChild;
      if (lastChild != null && lastChild.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
        lastChild.nodeValue += text;
      }
      else {
        parentNode.appendChild(ownerDocument.createTextNode(text));
      }
    },
    insertTextBefore(parentNode, text, referenceNode) {
      const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
      if (prevNode != null && prevNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
        prevNode.nodeValue += text;
      }
      else {
        parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
      }
    },
    adoptAttributes(recipient, attrs) {
      for (let i = 0; i < attrs.length; i++) {
        const attr = attrs[i];
        if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
          recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
        }
      }
    },
    getFirstChild(node) {
      return node.childNodes[0];
    },
    getChildNodes(node) {
      return node.childNodes;
    },
    getParentNode(node) {
      return node.parentNode;
    },
    getAttrList(element) {
      const attrs = element.attributes.__items.map((attr) => {
        return {
          name: attr.name,
          value: attr.value,
          namespace: attr.namespaceURI,
          prefix: null,
        };
      });
      return attrs;
    },
    getTagName(element) {
      if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
        return element.nodeName.toLowerCase();
      }
      else {
        return element.nodeName;
      }
    },
    getNamespaceURI(element) {
      // mock-doc widens the type of an element's namespace uri to 'string | null'
      // we use a type assertion here to adhere to parse5's type definitions
      return element.namespaceURI;
    },
    getTextNodeContent(textNode) {
      return textNode.nodeValue;
    },
    getCommentNodeContent(commentNode) {
      return commentNode.nodeValue;
    },
    getDocumentTypeNodeName(doctypeNode) {
      return doctypeNode['x-name'];
    },
    getDocumentTypeNodePublicId(doctypeNode) {
      return doctypeNode['x-publicId'];
    },
    getDocumentTypeNodeSystemId(doctypeNode) {
      return doctypeNode['x-systemId'];
    },
    // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['text']`. As a result, we cannot
    // complete this function signature
    isTextNode(node) {
      return node.nodeType === 3 /* NODE_TYPES.TEXT_NODE */;
    },
    // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['comment']`. As a result, we cannot
    // complete this function signature (which requires its return type to be a type predicate)
    isCommentNode(node) {
      return node.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */;
    },
    // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['document']`. As a result, we cannot
    // complete this function signature (which requires its return type to be a type predicate)
    isDocumentTypeNode(node) {
      return node.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */;
    },
    // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['element']`. As a result, we cannot
    // complete this function signature (which requires its return type to be a type predicate)
    isElementNode(node) {
      return node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */;
    },
  };
  parseOptions = {
    treeAdapter: treeAdapter,
  };
  docParser.set(ownerDocument, parseOptions);
  return parseOptions;
}

// Sizzle 2.3.9
const Sizzle = (function() {
const window = {
  document: {
  createElement() {
    return {};
  },
  nodeType: 9,
  documentElement: {
    nodeType: 1,
    nodeName: 'HTML'
  }
  }
};
const module = { exports: {} };

/*! Sizzle v2.3.9 | (c) JS Foundation and other contributors | js.foundation */
!function(e){var t,n,r,i,o,u,l,a,s,c,f,d,p,h,g,m,y,v,w,b="sizzle"+1*new Date,N=e.document,C=0,x=0,S=ae(),E=ae(),A=ae(),D=ae(),T=function(e,t){return e===t&&(f=!0),0},L={}.hasOwnProperty,q=[],I=q.pop,B=q.push,R=q.push,k=q.slice,$=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",O=new RegExp(M+"+","g"),j=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),G=new RegExp("^"+M+"*,"+M+"*"),U=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),V=new RegExp(M+"|>"),X=new RegExp(F),J=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,W=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d();},ue=ve(function(e){return !0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(q=k.call(N.childNodes),N.childNodes),q[N.childNodes.length].nodeType;}catch(e){R={apply:q.length?function(e,t){B.apply(e,k.call(t));}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1;}};}function le(e,t,r,i){var o,l,s,c,f,h,y,v=t&&t.ownerDocument,N=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==N&&9!==N&&11!==N)return r;if(!i&&(d(t),t=t||p,g)){if(11!==N&&(f=_.exec(e)))if(o=f[1]){if(9===N){if(!(s=t.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(v&&(s=v.getElementById(o))&&w(t,s)&&s.id===o)return r.push(s),r}else {if(f[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!m||!m.test(e))&&(1!==N||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===N&&(V.test(e)||U.test(e))){(v=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=b)),l=(h=u(e)).length;while(l--)h[l]=(c?"#"+c:":scope")+" "+ye(h[l]);y=h.join(",");}try{if(n.cssSupportsSelector&&!CSS.supports("selector(:is("+y+"))"))throw new Error;return R.apply(r,v.querySelectorAll(y)),r}catch(t){D(e,!0);}finally{c===b&&t.removeAttribute("id");}}}return a(e.replace(j,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return !!e(t)}catch(e){return !1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null;}}function fe(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t;}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return -1;return e?1:-1}function pe(e){return function(t){return "form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),u=o.length;while(u--)n[i=o[u]]&&(n[i]=!(r[i]=n[i]));})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return !Q.test(t||n&&n.nodeName||"HTML")},d=le.setDocument=function(e){var t,i,u=e?e.ownerDocument||e:N;return u!=p&&9===u.nodeType&&u.documentElement?(p=u,h=p.documentElement,g=!o(p),N!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.cssSupportsSelector=ce(function(){return CSS.supports("selector(*)")&&p.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=ce(function(e){return h.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return [o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return [o]}return []}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(ce(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+M+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]");}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:");})),(n.matchesSelector=Z.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F);}),n.cssSupportsSelector||m.push(":has"),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(h.compareDocumentPosition),w=t||Z.test(h.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return !0;return !1},T=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==N&&w(N,e)?-1:t==p||t.ownerDocument==N&&w(N,t)?1:c?$(c,e)-$(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,u=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:c?$(c,e)-$(c,t):0;if(i===o)return de(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)l.unshift(n);while(u[r]===l[r])r++;return r?de(u[r],l[r]):u[r]==N?-1:l[r]==N?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&g&&!D[t+" "]&&(!y||!y.test(t))&&(!m||!m.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0);}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return (e.ownerDocument||e)!=p&&d(e),w(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return (e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(T),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1);}return c=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e);}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:se,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&S(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(O," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return !!e.parentNode}:function(t,n,a){var s,c,f,d,p,h,g=o!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l,w=!1;if(m){if(o){while(g){d=t;while(d=d[g])if(l?d.nodeName.toLowerCase()===y:1===d.nodeType)return !1;h=g="only"===e&&!h&&"nextSibling";}return !0}if(h=[u?m.firstChild:m.lastChild],u&&v){w=(p=(s=(c=(f=(d=m)[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===C&&s[1])&&s[2],d=p&&m.childNodes[p];while(d=++p&&d&&d[g]||(w=p=0)||h.pop())if(1===d.nodeType&&++w&&d===t){c[e]=[C,p,w];break}}else if(v&&(w=p=(s=(c=(f=(d=t)[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===C&&s[1]),!1===w)while(d=++p&&d&&d[g]||(w=p=0)||h.pop())if((l?d.nodeName.toLowerCase()===y:1===d.nodeType)&&++w&&(v&&((c=(f=d[b]||(d[b]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[C,w]),d===t))break;return (w-=i)===r||w%r==0&&w/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),u=o.length;while(u--)e[r=$(e,o[u])]=!(n[r]=o[u]);}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=l(e.replace(j,"$1"));return r[b]?se(function(e,t,n,i){var o,u=r(e,null,i,[]),l=e.length;while(l--)(o=u[l])&&(e[l]=!(t[l]=o));}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return le(e,t).length>0}}),contains:se(function(e){return e=e.replace(te,ne),function(t){return (t.textContent||i(t)).indexOf(e)>-1}}),lang:se(function(e){return J.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return !0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return [0]}),last:he(function(e,t){return [t-1]}),eq:he(function(e,t,n){return [n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(t);for(t in {submit:!0,reset:!0})r.pseudos[t]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(t);function me(){}me.prototype=r.filters=r.pseudos,r.setFilters=new me,u=le.tokenize=function(e,t){var n,i,o,u,l,a,s,c=E[e+" "];if(c)return t?0:c.slice(0);l=e,a=[],s=r.preFilter;while(l){n&&!(i=G.exec(l))||(i&&(l=l.slice(i[0].length)||l),a.push(o=[])),n=!1,(i=U.exec(l))&&(n=i.shift(),o.push({value:n,type:i[0].replace(j," ")}),l=l.slice(n.length));for(u in r.filter)!(i=K[u].exec(l))||s[u]&&!(i=s[u](i))||(n=i.shift(),o.push({value:n,type:u,matches:i}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):E(e,a).slice(0)};function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=t.next,o=i||r,u=n&&"parentNode"===o,l=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||u)return e(t,n,i);return !1}:function(t,n,a){var s,c,f,d=[C,l];if(a){while(t=t[r])if((1===t.nodeType||u)&&e(t,n,a))return !0}else while(t=t[r])if(1===t.nodeType||u)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else {if((s=c[o])&&s[0]===C&&s[1]===l)return d[2]=s[2];if(c[o]=d,d[2]=e(t,n,a))return !0}return !1}}function we(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return !1;return !0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)le(e,t[r],n);return n}function Ne(e,t,n,r,i){for(var o,u=[],l=0,a=e.length,s=null!=t;l<a;l++)(o=e[l])&&(n&&!n(o,r,i)||(u.push(o),s&&t.push(l)));return u}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),se(function(o,u,l,a){var s,c,f,d=[],p=[],h=u.length,g=o||be(t||"*",l.nodeType?[l]:l,[]),m=!e||!o&&t?g:Ne(g,d,e,l,a),y=n?i||(o?e:h||r)?[]:u:m;if(n&&n(m,y,l,a),r){s=Ne(y,p),r(s,[],l,a),c=s.length;while(c--)(f=s[c])&&(y[p[c]]=!(m[p[c]]=f));}if(o){if(i||e){if(i){s=[],c=y.length;while(c--)(f=y[c])&&s.push(m[c]=f);i(null,y=[],s,a);}c=y.length;while(c--)(f=y[c])&&(s=i?$(o,f):d[c])>-1&&(o[s]=!(u[s]=f));}}else y=Ne(y===u?y.splice(h,y.length):y),i?i(null,u,y,a):R.apply(u,y);})}function xe(e){for(var t,n,i,o=e.length,u=r.relative[e[0].type],l=u||r.relative[" "],a=u?1:0,c=ve(function(e){return e===t},l,!0),f=ve(function(e){return $(t,e)>-1},l,!0),d=[function(e,n,r){var i=!u&&(r||n!==s)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];a<o;a++)if(n=r.relative[e[a].type])d=[ve(we(d),n)];else {if((n=r.filter[e[a].type].apply(null,e[a].matches))[b]){for(i=++a;i<o;i++)if(r.relative[e[i].type])break;return Ce(a>1&&we(d),a>1&&ye(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(j,"$1"),n,a<i&&xe(e.slice(a,i)),i<o&&xe(e=e.slice(i)),i<o&&ye(e))}d.push(n);}return we(d)}function Se(e,t){var n=t.length>0,i=e.length>0,o=function(o,u,l,a,c){var f,h,m,y=0,v="0",w=o&&[],b=[],N=s,x=o||i&&r.find.TAG("*",c),S=C+=null==N?1:Math.random()||.1,E=x.length;for(c&&(s=u==p||u||c);v!==E&&null!=(f=x[v]);v++){if(i&&f){h=0,u||f.ownerDocument==p||(d(f),l=!g);while(m=e[h++])if(m(f,u||p,l)){a.push(f);break}c&&(C=S);}n&&((f=!m&&f)&&y--,o&&w.push(f));}if(y+=v,n&&v!==y){h=0;while(m=t[h++])m(w,b,u,l);if(o){if(y>0)while(v--)w[v]||b[v]||(b[v]=I.call(a));b=Ne(b);}R.apply(a,b),c&&!o&&b.length>0&&y+t.length>1&&le.uniqueSort(a);}return c&&(C=S,s=N),w};return n?se(o):o}l=le.compile=function(e,t){var n,r=[],i=[],o=A[e+" "];if(!o){t||(t=u(e)),n=t.length;while(n--)(o=xe(t[n]))[b]?r.push(o):i.push(o);(o=A(e,Se(i,r))).selector=e;}return o},a=le.select=function(e,t,n,i){var o,a,s,c,f,d="function"==typeof e&&e,p=!i&&u(e=d.selector||e);if(n=n||[],1===p.length){if((a=p[0]=p[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===t.nodeType&&g&&r.relative[a[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(a.shift().value.length);}o=K.needsContext.test(e)?0:a.length;while(o--){if(s=a[o],r.relative[c=s.type])break;if((f=r.find[c])&&(i=f(s.matches[0].replace(te,ne),ee.test(a[0].type)&&ge(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&ye(a)))return R.apply(n,i),n;break}}}return (d||l(e,p))(i,t,!g,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(T).join("")===b,n.detectDuplicates=!!f,d(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(H,function(e,t,n){var r;if(!n)return !0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ee=e.Sizzle;le.noConflict=function(){return e.Sizzle===le&&(e.Sizzle=Ee),le},"function"==typeof define&&define.amd?define(function(){return le}):"undefined"!=typeof module&&module.exports?module.exports=le:e.Sizzle=le;}(window);
//# sourceMappingURL=sizzle.min.map

return module.exports;
})();

function matches(selector, elm) {
  const r = Sizzle.matches(selector, [elm]);
  return r.length > 0;
}
function selectOne(selector, elm) {
  const r = Sizzle(selector, elm);
  return r[0] || null;
}
function selectAll(selector, elm) {
  return Sizzle(selector, elm);
}

function serializeNodeToHtml(elm, opts = {}) {
  const output = {
    currentLineWidth: 0,
    indent: 0,
    isWithinBody: false,
    text: [],
  };
  if (opts.prettyHtml) {
    if (typeof opts.indentSpaces !== 'number') {
      opts.indentSpaces = 2;
    }
    if (typeof opts.newLines !== 'boolean') {
      opts.newLines = true;
    }
    opts.approximateLineWidth = -1;
  }
  else {
    opts.prettyHtml = false;
    if (typeof opts.newLines !== 'boolean') {
      opts.newLines = false;
    }
    if (typeof opts.indentSpaces !== 'number') {
      opts.indentSpaces = 0;
    }
  }
  if (typeof opts.approximateLineWidth !== 'number') {
    opts.approximateLineWidth = -1;
  }
  if (typeof opts.removeEmptyAttributes !== 'boolean') {
    opts.removeEmptyAttributes = true;
  }
  if (typeof opts.removeAttributeQuotes !== 'boolean') {
    opts.removeAttributeQuotes = false;
  }
  if (typeof opts.removeBooleanAttributeQuotes !== 'boolean') {
    opts.removeBooleanAttributeQuotes = false;
  }
  if (typeof opts.removeHtmlComments !== 'boolean') {
    opts.removeHtmlComments = false;
  }
  if (typeof opts.serializeShadowRoot !== 'boolean') {
    opts.serializeShadowRoot = false;
  }
  if (opts.outerHtml) {
    serializeToHtml(elm, opts, output, false);
  }
  else {
    for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
      serializeToHtml(elm.childNodes[i], opts, output, false);
    }
  }
  if (output.text[0] === '\n') {
    output.text.shift();
  }
  if (output.text[output.text.length - 1] === '\n') {
    output.text.pop();
  }
  return output.text.join('');
}
function serializeToHtml(node, opts, output, isShadowRoot) {
  if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ || isShadowRoot) {
    const tagName = isShadowRoot ? 'mock:shadow-root' : getTagName(node);
    if (tagName === 'body') {
      output.isWithinBody = true;
    }
    const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
    if (ignoreTag === false) {
      const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
      if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
        output.text.push('\n');
        output.currentLineWidth = 0;
      }
      if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
        for (let i = 0; i < output.indent; i++) {
          output.text.push(' ');
        }
        output.currentLineWidth += output.indent;
      }
      output.text.push('<' + tagName);
      output.currentLineWidth += tagName.length + 1;
      const attrsLength = node.attributes.length;
      const attributes = opts.prettyHtml && attrsLength > 1
        ? cloneAttributes(node.attributes, true)
        : node.attributes;
      for (let i = 0; i < attrsLength; i++) {
        const attr = attributes.item(i);
        const attrName = attr.name;
        if (attrName === 'style') {
          continue;
        }
        let attrValue = attr.value;
        if (opts.removeEmptyAttributes && attrValue === '' && REMOVE_EMPTY_ATTR.has(attrName)) {
          continue;
        }
        const attrNamespaceURI = attr.namespaceURI;
        if (attrNamespaceURI == null) {
          output.currentLineWidth += attrName.length + 1;
          if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
            output.text.push('\n' + attrName);
            output.currentLineWidth = 0;
          }
          else {
            output.text.push(' ' + attrName);
          }
        }
        else if (attrNamespaceURI === 'http://www.w3.org/XML/1998/namespace') {
          output.text.push(' xml:' + attrName);
          output.currentLineWidth += attrName.length + 5;
        }
        else if (attrNamespaceURI === 'http://www.w3.org/2000/xmlns/') {
          if (attrName !== 'xmlns') {
            output.text.push(' xmlns:' + attrName);
            output.currentLineWidth += attrName.length + 7;
          }
          else {
            output.text.push(' ' + attrName);
            output.currentLineWidth += attrName.length + 1;
          }
        }
        else if (attrNamespaceURI === XLINK_NS) {
          output.text.push(' xlink:' + attrName);
          output.currentLineWidth += attrName.length + 7;
        }
        else {
          output.text.push(' ' + attrNamespaceURI + ':' + attrName);
          output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
        }
        if (opts.prettyHtml && attrName === 'class') {
          attrValue = attr.value = attrValue
            .split(' ')
            .filter((t) => t !== '')
            .sort()
            .join(' ')
            .trim();
        }
        if (attrValue === '') {
          if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
            continue;
          }
          if (opts.removeEmptyAttributes && attrName.startsWith('data-')) {
            continue;
          }
        }
        if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
          output.text.push('=' + escapeString(attrValue, true));
          output.currentLineWidth += attrValue.length + 1;
        }
        else {
          output.text.push('="' + escapeString(attrValue, true) + '"');
          output.currentLineWidth += attrValue.length + 3;
        }
      }
      if (node.hasAttribute('style')) {
        const cssText = node.style.cssText;
        if (opts.approximateLineWidth > 0 &&
          output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
          output.text.push(`\nstyle="${cssText}">`);
          output.currentLineWidth = 0;
        }
        else {
          output.text.push(` style="${cssText}">`);
          output.currentLineWidth += cssText.length + 10;
        }
      }
      else {
        output.text.push('>');
        output.currentLineWidth += 1;
      }
    }
    if (EMPTY_ELEMENTS.has(tagName) === false) {
      if (opts.serializeShadowRoot && node.shadowRoot != null) {
        output.indent = output.indent + opts.indentSpaces;
        serializeToHtml(node.shadowRoot, opts, output, true);
        output.indent = output.indent - opts.indentSpaces;
        if (opts.newLines &&
          (node.childNodes.length === 0 ||
            (node.childNodes.length === 1 &&
              node.childNodes[0].nodeType === 3 /* NODE_TYPES.TEXT_NODE */ &&
              node.childNodes[0].nodeValue.trim() === ''))) {
          output.text.push('\n');
          output.currentLineWidth = 0;
          for (let i = 0; i < output.indent; i++) {
            output.text.push(' ');
          }
          output.currentLineWidth += output.indent;
        }
      }
      if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
        const childNodes = tagName === 'template' ? node.content.childNodes : node.childNodes;
        const childNodeLength = childNodes.length;
        if (childNodeLength > 0) {
          if (childNodeLength === 1 &&
            childNodes[0].nodeType === 3 /* NODE_TYPES.TEXT_NODE */ &&
            (typeof childNodes[0].nodeValue !== 'string' || childNodes[0].nodeValue.trim() === '')) ;
          else {
            const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
            if (!isWithinWhitespaceSensitiveNode && opts.indentSpaces > 0 && ignoreTag === false) {
              output.indent = output.indent + opts.indentSpaces;
            }
            for (let i = 0; i < childNodeLength; i++) {
              serializeToHtml(childNodes[i], opts, output, false);
            }
            if (ignoreTag === false) {
              if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
                output.text.push('\n');
                output.currentLineWidth = 0;
              }
              if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
                output.indent = output.indent - opts.indentSpaces;
                for (let i = 0; i < output.indent; i++) {
                  output.text.push(' ');
                }
                output.currentLineWidth += output.indent;
              }
            }
          }
        }
        if (ignoreTag === false) {
          output.text.push('</' + tagName + '>');
          output.currentLineWidth += tagName.length + 3;
        }
      }
    }
    if (opts.approximateLineWidth > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
      output.text.push('\n');
      output.currentLineWidth = 0;
    }
    if (tagName === 'body') {
      output.isWithinBody = false;
    }
  }
  else if (node.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
    let textContent = node.nodeValue;
    if (typeof textContent === 'string') {
      const trimmedTextContent = textContent.trim();
      if (trimmedTextContent === '') {
        // this text node is whitespace only
        if (isWithinWhitespaceSensitive(node)) {
          // whitespace matters within this element
          // just add the exact text we were given
          output.text.push(textContent);
          output.currentLineWidth += textContent.length;
        }
        else if (opts.approximateLineWidth > 0 && !output.isWithinBody) ;
        else if (!opts.prettyHtml) {
          // this text node is only whitespace, and it's not
          // within a whitespace sensitive element like <pre> or <code>
          // so replace the entire white space with a single new line
          output.currentLineWidth += 1;
          if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
            // good enough for a new line
            // for perf these are all just estimates
            // we don't care to ensure exact line lengths
            output.text.push('\n');
            output.currentLineWidth = 0;
          }
          else {
            // let's keep it all on the same line yet
            output.text.push(' ');
          }
        }
      }
      else {
        // this text node has text content
        const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
        if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
          output.text.push('\n');
          output.currentLineWidth = 0;
        }
        if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
          for (let i = 0; i < output.indent; i++) {
            output.text.push(' ');
          }
          output.currentLineWidth += output.indent;
        }
        let textContentLength = textContent.length;
        if (textContentLength > 0) {
          // this text node has text content
          const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */
            ? node.parentNode.nodeName
            : null;
          if (NON_ESCAPABLE_CONTENT.has(parentTagName)) {
            // this text node cannot have its content escaped since it's going
            // into an element like <style> or <script>
            if (isWithinWhitespaceSensitive(node)) {
              output.text.push(textContent);
            }
            else {
              output.text.push(trimmedTextContent);
              textContentLength = trimmedTextContent.length;
            }
            output.currentLineWidth += textContentLength;
          }
          else {
            // this text node is going into a normal element and html can be escaped
            if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
              // pretty print the text node
              output.text.push(escapeString(textContent.replace(/\s\s+/g, ' ').trim(), false));
              output.currentLineWidth += textContentLength;
            }
            else {
              // not pretty printing the text node
              if (isWithinWhitespaceSensitive(node)) {
                output.currentLineWidth += textContentLength;
              }
              else {
                // this element is not a whitespace sensitive one, like <pre> or <code> so
                // any whitespace at the start and end can be cleaned up to just be one space
                if (/\s/.test(textContent.charAt(0))) {
                  textContent = ' ' + textContent.trimLeft();
                }
                textContentLength = textContent.length;
                if (textContentLength > 1) {
                  if (/\s/.test(textContent.charAt(textContentLength - 1))) {
                    if (opts.approximateLineWidth > 0 &&
                      output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
                      textContent = textContent.trimRight() + '\n';
                      output.currentLineWidth = 0;
                    }
                    else {
                      textContent = textContent.trimRight() + ' ';
                    }
                  }
                }
                output.currentLineWidth += textContentLength;
              }
              output.text.push(escapeString(textContent, false));
            }
          }
        }
      }
    }
  }
  else if (node.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */) {
    const nodeValue = node.nodeValue;
    if (opts.removeHtmlComments) {
      const isHydrateAnnotation = nodeValue.startsWith(CONTENT_REF_ID + '.') ||
        nodeValue.startsWith(ORG_LOCATION_ID + '.') ||
        nodeValue.startsWith(SLOT_NODE_ID + '.') ||
        nodeValue.startsWith(TEXT_NODE_ID + '.');
      if (!isHydrateAnnotation) {
        return;
      }
    }
    const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
    if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
      output.text.push('\n');
      output.currentLineWidth = 0;
    }
    if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
      for (let i = 0; i < output.indent; i++) {
        output.text.push(' ');
      }
      output.currentLineWidth += output.indent;
    }
    output.text.push('<!--' + nodeValue + '-->');
    output.currentLineWidth += nodeValue.length + 7;
  }
  else if (node.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */) {
    output.text.push('<!doctype html>');
  }
}
const AMP_REGEX = /&/g;
const NBSP_REGEX = /\u00a0/g;
const DOUBLE_QUOTE_REGEX = /"/g;
const LT_REGEX = /</g;
const GT_REGEX = />/g;
const CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
function getTagName(element) {
  if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
    return element.nodeName.toLowerCase();
  }
  else {
    return element.nodeName;
  }
}
function escapeString(str, attrMode) {
  str = str.replace(AMP_REGEX, '&amp;').replace(NBSP_REGEX, '&nbsp;');
  if (attrMode) {
    return str.replace(DOUBLE_QUOTE_REGEX, '&quot;');
  }
  return str.replace(LT_REGEX, '&lt;').replace(GT_REGEX, '&gt;');
}
function isWithinWhitespaceSensitive(node) {
  while (node != null) {
    if (WHITESPACE_SENSITIVE.has(node.nodeName)) {
      return true;
    }
    node = node.parentNode;
  }
  return false;
}
/*@__PURE__*/ const NON_ESCAPABLE_CONTENT = new Set([
  'STYLE',
  'SCRIPT',
  'IFRAME',
  'NOSCRIPT',
  'XMP',
  'NOEMBED',
  'NOFRAMES',
  'PLAINTEXT',
]);
/*@__PURE__*/ const WHITESPACE_SENSITIVE = new Set([
  'CODE',
  'OUTPUT',
  'PLAINTEXT',
  'PRE',
  'SCRIPT',
  'TEMPLATE',
  'TEXTAREA',
]);
/*@__PURE__*/ const EMPTY_ELEMENTS = new Set([
  'area',
  'base',
  'basefont',
  'bgsound',
  'br',
  'col',
  'embed',
  'frame',
  'hr',
  'img',
  'input',
  'keygen',
  'link',
  'meta',
  'param',
  'source',
  'trace',
  'wbr',
]);
/*@__PURE__*/ const REMOVE_EMPTY_ATTR = new Set(['class', 'dir', 'id', 'lang', 'name', 'title']);
/*@__PURE__*/ const BOOLEAN_ATTR = new Set([
  'allowfullscreen',
  'async',
  'autofocus',
  'autoplay',
  'checked',
  'compact',
  'controls',
  'declare',
  'default',
  'defaultchecked',
  'defaultmuted',
  'defaultselected',
  'defer',
  'disabled',
  'enabled',
  'formnovalidate',
  'hidden',
  'indeterminate',
  'inert',
  'ismap',
  'itemscope',
  'loop',
  'multiple',
  'muted',
  'nohref',
  'nomodule',
  'noresize',
  'noshade',
  'novalidate',
  'nowrap',
  'open',
  'pauseonexit',
  'readonly',
  'required',
  'reversed',
  'scoped',
  'seamless',
  'selected',
  'sortable',
  'truespeed',
  'typemustmatch',
  'visible',
]);
/*@__PURE__*/ const STRUCTURE_ELEMENTS = new Set([
  'html',
  'body',
  'head',
  'iframe',
  'meta',
  'link',
  'base',
  'title',
  'script',
  'style',
]);

class MockNode {
  constructor(ownerDocument, nodeType, nodeName, nodeValue) {
    this.ownerDocument = ownerDocument;
    this.nodeType = nodeType;
    this.nodeName = nodeName;
    this._nodeValue = nodeValue;
    this.parentNode = null;
    this.childNodes = [];
  }
  appendChild(newNode) {
    if (newNode.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
      const nodes = newNode.childNodes.slice();
      for (const child of nodes) {
        this.appendChild(child);
      }
    }
    else {
      newNode.remove();
      newNode.parentNode = this;
      this.childNodes.push(newNode);
      connectNode(this.ownerDocument, newNode);
    }
    return newNode;
  }
  append(...items) {
    items.forEach((item) => {
      const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
      this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
    });
  }
  prepend(...items) {
    const firstChild = this.firstChild;
    items.forEach((item) => {
      const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
      if (firstChild) {
        this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
      }
    });
  }
  cloneNode(deep) {
    throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
  }
  compareDocumentPosition(_other) {
    // unimplemented
    // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
    return -1;
  }
  get firstChild() {
    return this.childNodes[0] || null;
  }
  insertBefore(newNode, referenceNode) {
    if (newNode.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
      for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
        insertBefore(this, newNode.childNodes[i], referenceNode);
      }
    }
    else {
      insertBefore(this, newNode, referenceNode);
    }
    return newNode;
  }
  get isConnected() {
    let node = this;
    while (node != null) {
      if (node.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */) {
        return true;
      }
      node = node.parentNode;
      if (node != null && node.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
        node = node.host;
      }
    }
    return false;
  }
  isSameNode(node) {
    return this === node;
  }
  get lastChild() {
    return this.childNodes[this.childNodes.length - 1] || null;
  }
  get nextSibling() {
    if (this.parentNode != null) {
      const index = this.parentNode.childNodes.indexOf(this) + 1;
      return this.parentNode.childNodes[index] || null;
    }
    return null;
  }
  get nodeValue() {
    var _a;
    return (_a = this._nodeValue) !== null && _a !== void 0 ? _a : '';
  }
  set nodeValue(value) {
    this._nodeValue = value;
  }
  get parentElement() {
    return this.parentNode || null;
  }
  set parentElement(value) {
    this.parentNode = value;
  }
  get previousSibling() {
    if (this.parentNode != null) {
      const index = this.parentNode.childNodes.indexOf(this) - 1;
      return this.parentNode.childNodes[index] || null;
    }
    return null;
  }
  contains(otherNode) {
    if (otherNode === this) {
      return true;
    }
    const childNodes = Array.from(this.childNodes);
    if (childNodes.includes(otherNode)) {
      return true;
    }
    return childNodes.some((node) => this.contains.bind(node)(otherNode));
  }
  removeChild(childNode) {
    const index = this.childNodes.indexOf(childNode);
    if (index > -1) {
      this.childNodes.splice(index, 1);
      if (this.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
        const wasConnected = this.isConnected;
        childNode.parentNode = null;
        if (wasConnected === true) {
          disconnectNode(childNode);
        }
      }
      else {
        childNode.parentNode = null;
      }
    }
    else {
      throw new Error(`node not found within childNodes during removeChild`);
    }
    return childNode;
  }
  remove() {
    if (this.parentNode != null) {
      this.parentNode.removeChild(this);
    }
  }
  replaceChild(newChild, oldChild) {
    if (oldChild.parentNode === this) {
      this.insertBefore(newChild, oldChild);
      oldChild.remove();
      return newChild;
    }
    return null;
  }
  get textContent() {
    var _a;
    return (_a = this._nodeValue) !== null && _a !== void 0 ? _a : '';
  }
  set textContent(value) {
    this._nodeValue = String(value);
  }
}
MockNode.ELEMENT_NODE = 1;
MockNode.TEXT_NODE = 3;
MockNode.PROCESSING_INSTRUCTION_NODE = 7;
MockNode.COMMENT_NODE = 8;
MockNode.DOCUMENT_NODE = 9;
MockNode.DOCUMENT_TYPE_NODE = 10;
MockNode.DOCUMENT_FRAGMENT_NODE = 11;
class MockNodeList {
  constructor(ownerDocument, childNodes, length) {
    this.ownerDocument = ownerDocument;
    this.childNodes = childNodes;
    this.length = length;
  }
}
class MockElement extends MockNode {
  constructor(ownerDocument, nodeName) {
    super(ownerDocument, 1 /* NODE_TYPES.ELEMENT_NODE */, typeof nodeName === 'string' ? nodeName : null, null);
    this.namespaceURI = null;
    this.__shadowRoot = null;
    this.__attributeMap = null;
  }
  addEventListener(type, handler) {
    addEventListener(this, type, handler);
  }
  attachShadow(_opts) {
    const shadowRoot = this.ownerDocument.createDocumentFragment();
    this.shadowRoot = shadowRoot;
    return shadowRoot;
  }
  blur() {
    dispatchEvent(this, new MockFocusEvent('blur', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
  }
  get shadowRoot() {
    return this.__shadowRoot || null;
  }
  set shadowRoot(shadowRoot) {
    if (shadowRoot != null) {
      shadowRoot.host = this;
      this.__shadowRoot = shadowRoot;
    }
    else {
      delete this.__shadowRoot;
    }
  }
  get attributes() {
    if (this.__attributeMap == null) {
      const attrMap = createAttributeProxy(false);
      this.__attributeMap = attrMap;
      return attrMap;
    }
    return this.__attributeMap;
  }
  set attributes(attrs) {
    this.__attributeMap = attrs;
  }
  get children() {
    return this.childNodes.filter((n) => n.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */);
  }
  get childElementCount() {
    return this.childNodes.filter((n) => n.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */).length;
  }
  get className() {
    return this.getAttributeNS(null, 'class') || '';
  }
  set className(value) {
    this.setAttributeNS(null, 'class', value);
  }
  get classList() {
    return new MockClassList(this);
  }
  click() {
    dispatchEvent(this, new MockEvent('click', { bubbles: true, cancelable: true, composed: true }));
  }
  cloneNode(_deep) {
    // implemented on MockElement.prototype from within element.ts
    // @ts-ignore - implemented on MockElement.prototype from within element.ts
    return null;
  }
  closest(selector) {
    let elm = this;
    while (elm != null) {
      if (elm.matches(selector)) {
        return elm;
      }
      elm = elm.parentNode;
    }
    return null;
  }
  get dataset() {
    return dataset(this);
  }
  get dir() {
    return this.getAttributeNS(null, 'dir') || '';
  }
  set dir(value) {
    this.setAttributeNS(null, 'dir', value);
  }
  dispatchEvent(ev) {
    return dispatchEvent(this, ev);
  }
  get firstElementChild() {
    return this.children[0] || null;
  }
  focus(_options) {
    dispatchEvent(this, new MockFocusEvent('focus', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
  }
  getAttribute(attrName) {
    if (attrName === 'style') {
      if (this.__style != null && this.__style.length > 0) {
        return this.style.cssText;
      }
      return null;
    }
    const attr = this.attributes.getNamedItem(attrName);
    if (attr != null) {
      return attr.value;
    }
    return null;
  }
  getAttributeNS(namespaceURI, attrName) {
    const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
    if (attr != null) {
      return attr.value;
    }
    return null;
  }
  getBoundingClientRect() {
    return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
  }
  getRootNode(opts) {
    const isComposed = opts != null && opts.composed === true;
    let node = this;
    while (node.parentNode != null) {
      node = node.parentNode;
      if (isComposed === true && node.parentNode == null && node.host != null) {
        node = node.host;
      }
    }
    return node;
  }
  get draggable() {
    return this.getAttributeNS(null, 'draggable') === 'true';
  }
  set draggable(value) {
    this.setAttributeNS(null, 'draggable', value);
  }
  hasChildNodes() {
    return this.childNodes.length > 0;
  }
  get id() {
    return this.getAttributeNS(null, 'id') || '';
  }
  set id(value) {
    this.setAttributeNS(null, 'id', value);
  }
  get innerHTML() {
    if (this.childNodes.length === 0) {
      return '';
    }
    return serializeNodeToHtml(this, {
      newLines: false,
      indentSpaces: 0,
    });
  }
  set innerHTML(html) {
    var _a;
    if (NON_ESCAPABLE_CONTENT.has((_a = this.nodeName) !== null && _a !== void 0 ? _a : '') === true) {
      setTextContent(this, html);
    }
    else {
      for (let i = this.childNodes.length - 1; i >= 0; i--) {
        this.removeChild(this.childNodes[i]);
      }
      if (typeof html === 'string') {
        const frag = parseFragmentUtil(this.ownerDocument, html);
        while (frag.childNodes.length > 0) {
          this.appendChild(frag.childNodes[0]);
        }
      }
    }
  }
  get innerText() {
    const text = [];
    getTextContent(this.childNodes, text);
    return text.join('');
  }
  set innerText(value) {
    setTextContent(this, value);
  }
  insertAdjacentElement(position, elm) {
    if (position === 'beforebegin') {
      insertBefore(this.parentNode, elm, this);
    }
    else if (position === 'afterbegin') {
      this.prepend(elm);
    }
    else if (position === 'beforeend') {
      this.appendChild(elm);
    }
    else if (position === 'afterend') {
      insertBefore(this.parentNode, elm, this.nextSibling);
    }
    return elm;
  }
  insertAdjacentHTML(position, html) {
    const frag = parseFragmentUtil(this.ownerDocument, html);
    if (position === 'beforebegin') {
      while (frag.childNodes.length > 0) {
        insertBefore(this.parentNode, frag.childNodes[0], this);
      }
    }
    else if (position === 'afterbegin') {
      while (frag.childNodes.length > 0) {
        this.prepend(frag.childNodes[frag.childNodes.length - 1]);
      }
    }
    else if (position === 'beforeend') {
      while (frag.childNodes.length > 0) {
        this.appendChild(frag.childNodes[0]);
      }
    }
    else if (position === 'afterend') {
      while (frag.childNodes.length > 0) {
        insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
      }
    }
  }
  insertAdjacentText(position, text) {
    const elm = this.ownerDocument.createTextNode(text);
    if (position === 'beforebegin') {
      insertBefore(this.parentNode, elm, this);
    }
    else if (position === 'afterbegin') {
      this.prepend(elm);
    }
    else if (position === 'beforeend') {
      this.appendChild(elm);
    }
    else if (position === 'afterend') {
      insertBefore(this.parentNode, elm, this.nextSibling);
    }
  }
  hasAttribute(attrName) {
    if (attrName === 'style') {
      return this.__style != null && this.__style.length > 0;
    }
    return this.getAttribute(attrName) !== null;
  }
  hasAttributeNS(namespaceURI, name) {
    return this.getAttributeNS(namespaceURI, name) !== null;
  }
  get hidden() {
    return this.hasAttributeNS(null, 'hidden');
  }
  set hidden(isHidden) {
    if (isHidden === true) {
      this.setAttributeNS(null, 'hidden', '');
    }
    else {
      this.removeAttributeNS(null, 'hidden');
    }
  }
  get lang() {
    return this.getAttributeNS(null, 'lang') || '';
  }
  set lang(value) {
    this.setAttributeNS(null, 'lang', value);
  }
  get lastElementChild() {
    const children = this.children;
    return children[children.length - 1] || null;
  }
  matches(selector) {
    return matches(selector, this);
  }
  get nextElementSibling() {
    const parentElement = this.parentElement;
    if (parentElement != null &&
      (parentElement.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
        parentElement.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */ ||
        parentElement.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */)) {
      const children = parentElement.children;
      const index = children.indexOf(this) + 1;
      return parentElement.children[index] || null;
    }
    return null;
  }
  get outerHTML() {
    return serializeNodeToHtml(this, {
      newLines: false,
      outerHtml: true,
      indentSpaces: 0,
    });
  }
  get previousElementSibling() {
    const parentElement = this.parentElement;
    if (parentElement != null &&
      (parentElement.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
        parentElement.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */ ||
        parentElement.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */)) {
      const children = parentElement.children;
      const index = children.indexOf(this) - 1;
      return parentElement.children[index] || null;
    }
    return null;
  }
  getElementsByClassName(classNames) {
    const classes = classNames
      .trim()
      .split(' ')
      .filter((c) => c.length > 0);
    const results = [];
    getElementsByClassName(this, classes, results);
    return results;
  }
  getElementsByTagName(tagName) {
    const results = [];
    getElementsByTagName(this, tagName.toLowerCase(), results);
    return results;
  }
  querySelector(selector) {
    return selectOne(selector, this);
  }
  querySelectorAll(selector) {
    return selectAll(selector, this);
  }
  removeAttribute(attrName) {
    if (attrName === 'style') {
      delete this.__style;
    }
    else {
      const attr = this.attributes.getNamedItem(attrName);
      if (attr != null) {
        this.attributes.removeNamedItemNS(attr);
        if (checkAttributeChanged(this) === true) {
          attributeChanged(this, attrName, attr.value, null);
        }
      }
    }
  }
  removeAttributeNS(namespaceURI, attrName) {
    const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
    if (attr != null) {
      this.attributes.removeNamedItemNS(attr);
      if (checkAttributeChanged(this) === true) {
        attributeChanged(this, attrName, attr.value, null);
      }
    }
  }
  removeEventListener(type, handler) {
    removeEventListener(this, type, handler);
  }
  setAttribute(attrName, value) {
    if (attrName === 'style') {
      this.style = value;
    }
    else {
      const attributes = this.attributes;
      let attr = attributes.getNamedItem(attrName);
      const checkAttrChanged = checkAttributeChanged(this);
      if (attr != null) {
        if (checkAttrChanged === true) {
          const oldValue = attr.value;
          attr.value = value;
          if (oldValue !== attr.value) {
            attributeChanged(this, attr.name, oldValue, attr.value);
          }
        }
        else {
          attr.value = value;
        }
      }
      else {
        if (attributes.caseInsensitive) {
          attrName = attrName.toLowerCase();
        }
        attr = new MockAttr(attrName, value);
        attributes.__items.push(attr);
        if (checkAttrChanged === true) {
          attributeChanged(this, attrName, null, attr.value);
        }
      }
    }
  }
  setAttributeNS(namespaceURI, attrName, value) {
    const attributes = this.attributes;
    let attr = attributes.getNamedItemNS(namespaceURI, attrName);
    const checkAttrChanged = checkAttributeChanged(this);
    if (attr != null) {
      if (checkAttrChanged === true) {
        const oldValue = attr.value;
        attr.value = value;
        if (oldValue !== attr.value) {
          attributeChanged(this, attr.name, oldValue, attr.value);
        }
      }
      else {
        attr.value = value;
      }
    }
    else {
      attr = new MockAttr(attrName, value, namespaceURI);
      attributes.__items.push(attr);
      if (checkAttrChanged === true) {
        attributeChanged(this, attrName, null, attr.value);
      }
    }
  }
  get style() {
    if (this.__style == null) {
      this.__style = createCSSStyleDeclaration();
    }
    return this.__style;
  }
  set style(val) {
    if (typeof val === 'string') {
      if (this.__style == null) {
        this.__style = createCSSStyleDeclaration();
      }
      this.__style.cssText = val;
    }
    else {
      this.__style = val;
    }
  }
  get tabIndex() {
    return parseInt(this.getAttributeNS(null, 'tabindex') || '-1', 10);
  }
  set tabIndex(value) {
    this.setAttributeNS(null, 'tabindex', value);
  }
  get tagName() {
    var _a;
    return (_a = this.nodeName) !== null && _a !== void 0 ? _a : '';
  }
  set tagName(value) {
    this.nodeName = value;
  }
  get textContent() {
    const text = [];
    getTextContent(this.childNodes, text);
    return text.join('');
  }
  set textContent(value) {
    setTextContent(this, value);
  }
  get title() {
    return this.getAttributeNS(null, 'title') || '';
  }
  set title(value) {
    this.setAttributeNS(null, 'title', value);
  }
  animate() {
    /**/
  }
  onanimationstart() {
    /**/
  }
  onanimationend() {
    /**/
  }
  onanimationiteration() {
    /**/
  }
  onabort() {
    /**/
  }
  onauxclick() {
    /**/
  }
  onbeforecopy() {
    /**/
  }
  onbeforecut() {
    /**/
  }
  onbeforepaste() {
    /**/
  }
  onblur() {
    /**/
  }
  oncancel() {
    /**/
  }
  oncanplay() {
    /**/
  }
  oncanplaythrough() {
    /**/
  }
  onchange() {
    /**/
  }
  onclick() {
    /**/
  }
  onclose() {
    /**/
  }
  oncontextmenu() {
    /**/
  }
  oncopy() {
    /**/
  }
  oncuechange() {
    /**/
  }
  oncut() {
    /**/
  }
  ondblclick() {
    /**/
  }
  ondrag() {
    /**/
  }
  ondragend() {
    /**/
  }
  ondragenter() {
    /**/
  }
  ondragleave() {
    /**/
  }
  ondragover() {
    /**/
  }
  ondragstart() {
    /**/
  }
  ondrop() {
    /**/
  }
  ondurationchange() {
    /**/
  }
  onemptied() {
    /**/
  }
  onended() {
    /**/
  }
  onerror() {
    /**/
  }
  onfocus() {
    /**/
  }
  onfocusin() {
    /**/
  }
  onfocusout() {
    /**/
  }
  onformdata() {
    /**/
  }
  onfullscreenchange() {
    /**/
  }
  onfullscreenerror() {
    /**/
  }
  ongotpointercapture() {
    /**/
  }
  oninput() {
    /**/
  }
  oninvalid() {
    /**/
  }
  onkeydown() {
    /**/
  }
  onkeypress() {
    /**/
  }
  onkeyup() {
    /**/
  }
  onload() {
    /**/
  }
  onloadeddata() {
    /**/
  }
  onloadedmetadata() {
    /**/
  }
  onloadstart() {
    /**/
  }
  onlostpointercapture() {
    /**/
  }
  onmousedown() {
    /**/
  }
  onmouseenter() {
    /**/
  }
  onmouseleave() {
    /**/
  }
  onmousemove() {
    /**/
  }
  onmouseout() {
    /**/
  }
  onmouseover() {
    /**/
  }
  onmouseup() {
    /**/
  }
  onmousewheel() {
    /**/
  }
  onpaste() {
    /**/
  }
  onpause() {
    /**/
  }
  onplay() {
    /**/
  }
  onplaying() {
    /**/
  }
  onpointercancel() {
    /**/
  }
  onpointerdown() {
    /**/
  }
  onpointerenter() {
    /**/
  }
  onpointerleave() {
    /**/
  }
  onpointermove() {
    /**/
  }
  onpointerout() {
    /**/
  }
  onpointerover() {
    /**/
  }
  onpointerup() {
    /**/
  }
  onprogress() {
    /**/
  }
  onratechange() {
    /**/
  }
  onreset() {
    /**/
  }
  onresize() {
    /**/
  }
  onscroll() {
    /**/
  }
  onsearch() {
    /**/
  }
  onseeked() {
    /**/
  }
  onseeking() {
    /**/
  }
  onselect() {
    /**/
  }
  onselectstart() {
    /**/
  }
  onstalled() {
    /**/
  }
  onsubmit() {
    /**/
  }
  onsuspend() {
    /**/
  }
  ontimeupdate() {
    /**/
  }
  ontoggle() {
    /**/
  }
  onvolumechange() {
    /**/
  }
  onwaiting() {
    /**/
  }
  onwebkitfullscreenchange() {
    /**/
  }
  onwebkitfullscreenerror() {
    /**/
  }
  onwheel() {
    /**/
  }
  requestFullscreen() {
    /**/
  }
  scrollBy() {
    /**/
  }
  scrollTo() {
    /**/
  }
  scrollIntoView() {
    /**/
  }
  toString(opts) {
    return serializeNodeToHtml(this, opts);
  }
}
function getElementsByClassName(elm, classNames, foundElms) {
  const children = elm.children;
  for (let i = 0, ii = children.length; i < ii; i++) {
    const childElm = children[i];
    for (let j = 0, jj = classNames.length; j < jj; j++) {
      if (childElm.classList.contains(classNames[j])) {
        foundElms.push(childElm);
      }
    }
    getElementsByClassName(childElm, classNames, foundElms);
  }
}
function getElementsByTagName(elm, tagName, foundElms) {
  var _a;
  const children = elm.children;
  for (let i = 0, ii = children.length; i < ii; i++) {
    const childElm = children[i];
    if (tagName === '*' || ((_a = childElm.nodeName) !== null && _a !== void 0 ? _a : '').toLowerCase() === tagName) {
      foundElms.push(childElm);
    }
    getElementsByTagName(childElm, tagName, foundElms);
  }
}
function resetElement(elm) {
  resetEventListeners(elm);
  delete elm.__attributeMap;
  delete elm.__shadowRoot;
  delete elm.__style;
}
function insertBefore(parentNode, newNode, referenceNode) {
  if (newNode !== referenceNode) {
    newNode.remove();
    newNode.parentNode = parentNode;
    newNode.ownerDocument = parentNode.ownerDocument;
    if (referenceNode != null) {
      const index = parentNode.childNodes.indexOf(referenceNode);
      if (index > -1) {
        parentNode.childNodes.splice(index, 0, newNode);
      }
      else {
        throw new Error(`referenceNode not found in parentNode.childNodes`);
      }
    }
    else {
      parentNode.childNodes.push(newNode);
    }
    connectNode(parentNode.ownerDocument, newNode);
  }
  return newNode;
}
class MockHTMLElement extends MockElement {
  constructor(ownerDocument, nodeName) {
    super(ownerDocument, typeof nodeName === 'string' ? nodeName.toUpperCase() : null);
    this.namespaceURI = 'http://www.w3.org/1999/xhtml';
  }
  get tagName() {
    var _a;
    return (_a = this.nodeName) !== null && _a !== void 0 ? _a : '';
  }
  set tagName(value) {
    this.nodeName = value;
  }
  get attributes() {
    if (this.__attributeMap == null) {
      const attrMap = createAttributeProxy(true);
      this.__attributeMap = attrMap;
      return attrMap;
    }
    return this.__attributeMap;
  }
  set attributes(attrs) {
    this.__attributeMap = attrs;
  }
}
class MockTextNode extends MockNode {
  constructor(ownerDocument, text) {
    super(ownerDocument, 3 /* NODE_TYPES.TEXT_NODE */, "#text" /* NODE_NAMES.TEXT_NODE */, text);
  }
  cloneNode(_deep) {
    return new MockTextNode(null, this.nodeValue);
  }
  get textContent() {
    return this.nodeValue;
  }
  set textContent(text) {
    this.nodeValue = text;
  }
  get data() {
    return this.nodeValue;
  }
  set data(text) {
    this.nodeValue = text;
  }
  get wholeText() {
    if (this.parentNode != null) {
      const text = [];
      for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
        const childNode = this.parentNode.childNodes[i];
        if (childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
          text.push(childNode.nodeValue);
        }
      }
      return text.join('');
    }
    return this.nodeValue;
  }
}
function getTextContent(childNodes, text) {
  for (let i = 0, ii = childNodes.length; i < ii; i++) {
    const childNode = childNodes[i];
    if (childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
      text.push(childNode.nodeValue);
    }
    else if (childNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
      getTextContent(childNode.childNodes, text);
    }
  }
}
function setTextContent(elm, text) {
  for (let i = elm.childNodes.length - 1; i >= 0; i--) {
    elm.removeChild(elm.childNodes[i]);
  }
  const textNode = new MockTextNode(elm.ownerDocument, text);
  elm.appendChild(textNode);
}

class MockComment extends MockNode {
  constructor(ownerDocument, data) {
    super(ownerDocument, 8 /* NODE_TYPES.COMMENT_NODE */, "#comment" /* NODE_NAMES.COMMENT_NODE */, data);
  }
  cloneNode(_deep) {
    return new MockComment(null, this.nodeValue);
  }
  get textContent() {
    return this.nodeValue;
  }
  set textContent(text) {
    this.nodeValue = text;
  }
}

class MockDocumentFragment extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, null);
    this.nodeName = "#document-fragment" /* NODE_NAMES.DOCUMENT_FRAGMENT_NODE */;
    this.nodeType = 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */;
  }
  getElementById(id) {
    return getElementById(this, id);
  }
  cloneNode(deep) {
    const cloned = new MockDocumentFragment(null);
    if (deep) {
      for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
        const childNode = this.childNodes[i];
        if (childNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
          childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */ ||
          childNode.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */) {
          const clonedChildNode = this.childNodes[i].cloneNode(true);
          cloned.appendChild(clonedChildNode);
        }
      }
    }
    return cloned;
  }
}

class MockDocumentTypeNode extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, '!DOCTYPE');
    this.nodeType = 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */;
    this.setAttribute('html', '');
  }
}

class MockCSSRule {
  constructor(parentStyleSheet) {
    this.parentStyleSheet = parentStyleSheet;
    this.cssText = '';
    this.type = 0;
  }
}
class MockCSSStyleSheet {
  constructor(ownerNode) {
    this.type = 'text/css';
    this.parentStyleSheet = null;
    this.cssRules = [];
    this.ownerNode = ownerNode;
  }
  get rules() {
    return this.cssRules;
  }
  set rules(rules) {
    this.cssRules = rules;
  }
  deleteRule(index) {
    if (index >= 0 && index < this.cssRules.length) {
      this.cssRules.splice(index, 1);
      updateStyleTextNode(this.ownerNode);
    }
  }
  insertRule(rule, index = 0) {
    if (typeof index !== 'number') {
      index = 0;
    }
    if (index < 0) {
      index = 0;
    }
    if (index > this.cssRules.length) {
      index = this.cssRules.length;
    }
    const cssRule = new MockCSSRule(this);
    cssRule.cssText = rule;
    this.cssRules.splice(index, 0, cssRule);
    updateStyleTextNode(this.ownerNode);
    return index;
  }
}
function getStyleElementText(styleElm) {
  const output = [];
  for (let i = 0; i < styleElm.childNodes.length; i++) {
    output.push(styleElm.childNodes[i].nodeValue);
  }
  return output.join('');
}
function setStyleElementText(styleElm, text) {
  // keeping the innerHTML and the sheet.cssRules connected
  // is not technically correct, but since we're doing
  // SSR we'll need to turn any assigned cssRules into
  // real text, not just properties that aren't rendered
  const sheet = styleElm.sheet;
  sheet.cssRules.length = 0;
  sheet.insertRule(text);
  updateStyleTextNode(styleElm);
}
function updateStyleTextNode(styleElm) {
  const childNodeLen = styleElm.childNodes.length;
  if (childNodeLen > 1) {
    for (let i = childNodeLen - 1; i >= 1; i--) {
      styleElm.removeChild(styleElm.childNodes[i]);
    }
  }
  else if (childNodeLen < 1) {
    styleElm.appendChild(styleElm.ownerDocument.createTextNode(''));
  }
  const textNode = styleElm.childNodes[0];
  textNode.nodeValue = styleElm.sheet.cssRules.map((r) => r.cssText).join('\n');
}

function createElement(ownerDocument, tagName) {
  if (typeof tagName !== 'string' || tagName === '' || !/^[a-z0-9-_:]+$/i.test(tagName)) {
    throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
  }
  tagName = tagName.toLowerCase();
  switch (tagName) {
    case 'a':
      return new MockAnchorElement(ownerDocument);
    case 'base':
      return new MockBaseElement(ownerDocument);
    case 'button':
      return new MockButtonElement(ownerDocument);
    case 'canvas':
      return new MockCanvasElement(ownerDocument);
    case 'form':
      return new MockFormElement(ownerDocument);
    case 'img':
      return new MockImageElement(ownerDocument);
    case 'input':
      return new MockInputElement(ownerDocument);
    case 'link':
      return new MockLinkElement(ownerDocument);
    case 'meta':
      return new MockMetaElement(ownerDocument);
    case 'script':
      return new MockScriptElement(ownerDocument);
    case 'style':
      return new MockStyleElement(ownerDocument);
    case 'template':
      return new MockTemplateElement(ownerDocument);
    case 'title':
      return new MockTitleElement(ownerDocument);
  }
  if (ownerDocument != null && tagName.includes('-')) {
    const win = ownerDocument.defaultView;
    if (win != null && win.customElements != null) {
      return createCustomElement(win.customElements, ownerDocument, tagName);
    }
  }
  return new MockHTMLElement(ownerDocument, tagName);
}
function createElementNS(ownerDocument, namespaceURI, tagName) {
  if (namespaceURI === 'http://www.w3.org/1999/xhtml') {
    return createElement(ownerDocument, tagName);
  }
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
    switch (tagName.toLowerCase()) {
      case 'text':
      case 'tspan':
      case 'tref':
      case 'altglyph':
      case 'textpath':
        return new MockSVGTextContentElement(ownerDocument, tagName);
      case 'circle':
      case 'ellipse':
      case 'image':
      case 'line':
      case 'path':
      case 'polygon':
      case 'polyline':
      case 'rect':
      case 'use':
        return new MockSVGGraphicsElement(ownerDocument, tagName);
      case 'svg':
        return new MockSVGSVGElement(ownerDocument, tagName);
      default:
        return new MockSVGElement(ownerDocument, tagName);
    }
  }
  else {
    return new MockElement(ownerDocument, tagName);
  }
}
class MockAnchorElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'a');
  }
  get href() {
    return fullUrl(this, 'href');
  }
  set href(value) {
    this.setAttribute('href', value);
  }
  get pathname() {
    return new URL(this.href).pathname;
  }
}
class MockButtonElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'button');
  }
}
patchPropAttributes(MockButtonElement.prototype, {
  type: String,
}, {
  type: 'submit',
});
class MockImageElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'img');
  }
  get draggable() {
    return this.getAttributeNS(null, 'draggable') !== 'false';
  }
  set draggable(value) {
    this.setAttributeNS(null, 'draggable', value);
  }
  get src() {
    return fullUrl(this, 'src');
  }
  set src(value) {
    this.setAttribute('src', value);
  }
}
patchPropAttributes(MockImageElement.prototype, {
  height: Number,
  width: Number,
});
class MockInputElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'input');
  }
  get list() {
    const listId = this.getAttribute('list');
    if (listId) {
      return this.ownerDocument.getElementById(listId);
    }
    return null;
  }
}
patchPropAttributes(MockInputElement.prototype, {
  accept: String,
  autocomplete: String,
  autofocus: Boolean,
  capture: String,
  checked: Boolean,
  disabled: Boolean,
  form: String,
  formaction: String,
  formenctype: String,
  formmethod: String,
  formnovalidate: String,
  formtarget: String,
  height: Number,
  inputmode: String,
  max: String,
  maxLength: Number,
  min: String,
  minLength: Number,
  multiple: Boolean,
  name: String,
  pattern: String,
  placeholder: String,
  required: Boolean,
  readOnly: Boolean,
  size: Number,
  spellCheck: Boolean,
  src: String,
  step: String,
  type: String,
  value: String,
  width: Number,
}, {
  type: 'text',
});
class MockFormElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'form');
  }
}
patchPropAttributes(MockFormElement.prototype, {
  name: String,
});
class MockLinkElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'link');
  }
  get href() {
    return fullUrl(this, 'href');
  }
  set href(value) {
    this.setAttribute('href', value);
  }
}
patchPropAttributes(MockLinkElement.prototype, {
  crossorigin: String,
  media: String,
  rel: String,
  type: String,
});
class MockMetaElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'meta');
  }
}
patchPropAttributes(MockMetaElement.prototype, {
  charset: String,
  content: String,
  name: String,
});
class MockScriptElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'script');
  }
  get src() {
    return fullUrl(this, 'src');
  }
  set src(value) {
    this.setAttribute('src', value);
  }
}
patchPropAttributes(MockScriptElement.prototype, {
  type: String,
});
class MockDOMMatrix {
  constructor() {
    this.a = 1;
    this.b = 0;
    this.c = 0;
    this.d = 1;
    this.e = 0;
    this.f = 0;
    this.m11 = 1;
    this.m12 = 0;
    this.m13 = 0;
    this.m14 = 0;
    this.m21 = 0;
    this.m22 = 1;
    this.m23 = 0;
    this.m24 = 0;
    this.m31 = 0;
    this.m32 = 0;
    this.m33 = 1;
    this.m34 = 0;
    this.m41 = 0;
    this.m42 = 0;
    this.m43 = 0;
    this.m44 = 1;
    this.is2D = true;
    this.isIdentity = true;
  }
  static fromMatrix() {
    return new MockDOMMatrix();
  }
  inverse() {
    return new MockDOMMatrix();
  }
  flipX() {
    return new MockDOMMatrix();
  }
  flipY() {
    return new MockDOMMatrix();
  }
  multiply() {
    return new MockDOMMatrix();
  }
  rotate() {
    return new MockDOMMatrix();
  }
  rotateAxisAngle() {
    return new MockDOMMatrix();
  }
  rotateFromVector() {
    return new MockDOMMatrix();
  }
  scale() {
    return new MockDOMMatrix();
  }
  scaleNonUniform() {
    return new MockDOMMatrix();
  }
  skewX() {
    return new MockDOMMatrix();
  }
  skewY() {
    return new MockDOMMatrix();
  }
  toJSON() { }
  toString() { }
  transformPoint() {
    return new MockDOMPoint();
  }
  translate() {
    return new MockDOMMatrix();
  }
}
class MockDOMPoint {
  constructor() {
    this.w = 1;
    this.x = 0;
    this.y = 0;
    this.z = 0;
  }
  toJSON() { }
  matrixTransform() {
    return new MockDOMMatrix();
  }
}
class MockSVGRect {
  constructor() {
    this.height = 10;
    this.width = 10;
    this.x = 0;
    this.y = 0;
  }
}
class MockStyleElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'style');
    this.sheet = new MockCSSStyleSheet(this);
  }
  get innerHTML() {
    return getStyleElementText(this);
  }
  set innerHTML(value) {
    setStyleElementText(this, value);
  }
  get innerText() {
    return getStyleElementText(this);
  }
  set innerText(value) {
    setStyleElementText(this, value);
  }
  get textContent() {
    return getStyleElementText(this);
  }
  set textContent(value) {
    setStyleElementText(this, value);
  }
}
class MockSVGElement extends MockElement {
  // SVGElement properties and methods
  get ownerSVGElement() {
    return null;
  }
  get viewportElement() {
    return null;
  }
  onunload() {
    /**/
  }
  // SVGGeometryElement properties and methods
  get pathLength() {
    return 0;
  }
  isPointInFill(_pt) {
    return false;
  }
  isPointInStroke(_pt) {
    return false;
  }
  getTotalLength() {
    return 0;
  }
}
class MockSVGGraphicsElement extends MockSVGElement {
  getBBox(_options) {
    return new MockSVGRect();
  }
  getCTM() {
    return new MockDOMMatrix();
  }
  getScreenCTM() {
    return new MockDOMMatrix();
  }
}
class MockSVGSVGElement extends MockSVGGraphicsElement {
  createSVGPoint() {
    return new MockDOMPoint();
  }
}
class MockSVGTextContentElement extends MockSVGGraphicsElement {
  getComputedTextLength() {
    return 0;
  }
}
class MockBaseElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'base');
  }
  get href() {
    return fullUrl(this, 'href');
  }
  set href(value) {
    this.setAttribute('href', value);
  }
}
class MockTemplateElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'template');
    this.content = new MockDocumentFragment(ownerDocument);
  }
  get innerHTML() {
    return this.content.innerHTML;
  }
  set innerHTML(html) {
    this.content.innerHTML = html;
  }
  cloneNode(deep) {
    const cloned = new MockTemplateElement(null);
    cloned.attributes = cloneAttributes(this.attributes);
    const styleCssText = this.getAttribute('style');
    if (styleCssText != null && styleCssText.length > 0) {
      cloned.setAttribute('style', styleCssText);
    }
    cloned.content = this.content.cloneNode(deep);
    if (deep) {
      for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
        const clonedChildNode = this.childNodes[i].cloneNode(true);
        cloned.appendChild(clonedChildNode);
      }
    }
    return cloned;
  }
}
class MockTitleElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'title');
  }
  get text() {
    return this.textContent;
  }
  set text(value) {
    this.textContent = value;
  }
}
class MockCanvasElement extends MockHTMLElement {
  constructor(ownerDocument) {
    super(ownerDocument, 'canvas');
  }
  getContext() {
    return {
      fillRect() {
        return;
      },
      clearRect() { },
      getImageData: function (_, __, w, h) {
        return {
          data: new Array(w * h * 4),
        };
      },
      putImageData() { },
      createImageData: function () {
        return [];
      },
      setTransform() { },
      drawImage() { },
      save() { },
      fillText() { },
      restore() { },
      beginPath() { },
      moveTo() { },
      lineTo() { },
      closePath() { },
      stroke() { },
      translate() { },
      scale() { },
      rotate() { },
      arc() { },
      fill() { },
      measureText() {
        return { width: 0 };
      },
      transform() { },
      rect() { },
      clip() { },
    };
  }
}
function fullUrl(elm, attrName) {
  const val = elm.getAttribute(attrName) || '';
  if (elm.ownerDocument != null) {
    const win = elm.ownerDocument.defaultView;
    if (win != null) {
      const loc = win.location;
      if (loc != null) {
        try {
          const url = new URL(val, loc.href);
          return url.href;
        }
        catch (e) { }
      }
    }
  }
  return val.replace(/\'|\"/g, '').trim();
}
function patchPropAttributes(prototype, attrs, defaults = {}) {
  Object.keys(attrs).forEach((propName) => {
    const attr = attrs[propName];
    const defaultValue = defaults[propName];
    if (attr === Boolean) {
      Object.defineProperty(prototype, propName, {
        get() {
          return this.hasAttribute(propName);
        },
        set(value) {
          if (value) {
            this.setAttribute(propName, '');
          }
          else {
            this.removeAttribute(propName);
          }
        },
      });
    }
    else if (attr === Number) {
      Object.defineProperty(prototype, propName, {
        get() {
          const value = this.getAttribute(propName);
          return value ? parseInt(value, 10) : defaultValue === undefined ? 0 : defaultValue;
        },
        set(value) {
          this.setAttribute(propName, value);
        },
      });
    }
    else {
      Object.defineProperty(prototype, propName, {
        get() {
          return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || '';
        },
        set(value) {
          this.setAttribute(propName, value);
        },
      });
    }
  });
}
MockElement.prototype.cloneNode = function (deep) {
  // because we're creating elements, which extending specific HTML base classes there
  // is a MockElement circular reference that bundling has trouble dealing with so
  // the fix is to add cloneNode() to MockElement's prototype after the HTML classes
  const cloned = createElement(this.ownerDocument, this.nodeName);
  cloned.attributes = cloneAttributes(this.attributes);
  const styleCssText = this.getAttribute('style');
  if (styleCssText != null && styleCssText.length > 0) {
    cloned.setAttribute('style', styleCssText);
  }
  if (deep) {
    for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
      const clonedChildNode = this.childNodes[i].cloneNode(true);
      cloned.appendChild(clonedChildNode);
    }
  }
  return cloned;
};

let sharedDocument;
function parseHtmlToDocument(html, ownerDocument = null) {
  if (ownerDocument == null) {
    if (sharedDocument == null) {
      sharedDocument = new MockDocument();
    }
    ownerDocument = sharedDocument;
  }
  return parseDocumentUtil(ownerDocument, html);
}

const consoleNoop = () => {
  /**/
};
function createConsole() {
  return {
    debug: consoleNoop,
    error: consoleNoop,
    info: consoleNoop,
    log: consoleNoop,
    warn: consoleNoop,
    dir: consoleNoop,
    dirxml: consoleNoop,
    table: consoleNoop,
    trace: consoleNoop,
    group: consoleNoop,
    groupCollapsed: consoleNoop,
    groupEnd: consoleNoop,
    clear: consoleNoop,
    count: consoleNoop,
    countReset: consoleNoop,
    assert: consoleNoop,
    profile: consoleNoop,
    profileEnd: consoleNoop,
    time: consoleNoop,
    timeLog: consoleNoop,
    timeEnd: consoleNoop,
    timeStamp: consoleNoop,
    context: consoleNoop,
    memory: consoleNoop,
  };
}

class MockHeaders {
  constructor(init) {
    this._values = [];
    if (typeof init === 'object') {
      if (typeof init[Symbol.iterator] === 'function') {
        const kvs = [];
        for (const kv of init) {
          if (typeof kv[Symbol.iterator] === 'function') {
            kvs.push([...kv]);
          }
        }
        for (const kv of kvs) {
          this.append(kv[0], kv[1]);
        }
      }
      else {
        for (const key in init) {
          this.append(key, init[key]);
        }
      }
    }
  }
  append(key, value) {
    this._values.push([key, value + '']);
  }
  delete(key) {
    key = key.toLowerCase();
    for (let i = this._values.length - 1; i >= 0; i--) {
      if (this._values[i][0].toLowerCase() === key) {
        this._values.splice(i, 1);
      }
    }
  }
  entries() {
    const entries = [];
    for (const kv of this.keys()) {
      entries.push([kv, this.get(kv)]);
    }
    let index = -1;
    return {
      next() {
        index++;
        return {
          value: entries[index],
          done: !entries[index],
        };
      },
      [Symbol.iterator]() {
        return this;
      },
    };
  }
  forEach(cb) {
    for (const kv of this.entries()) {
      cb(kv[1], kv[0]);
    }
  }
  get(key) {
    const rtn = [];
    key = key.toLowerCase();
    for (const kv of this._values) {
      if (kv[0].toLowerCase() === key) {
        rtn.push(kv[1]);
      }
    }
    return rtn.length > 0 ? rtn.join(', ') : null;
  }
  has(key) {
    key = key.toLowerCase();
    for (const kv of this._values) {
      if (kv[0].toLowerCase() === key) {
        return true;
      }
    }
    return false;
  }
  keys() {
    const keys = [];
    for (const kv of this._values) {
      const key = kv[0].toLowerCase();
      if (!keys.includes(key)) {
        keys.push(key);
      }
    }
    let index = -1;
    return {
      next() {
        index++;
        return {
          value: keys[index],
          done: !keys[index],
        };
      },
      [Symbol.iterator]() {
        return this;
      },
    };
  }
  set(key, value) {
    for (const kv of this._values) {
      if (kv[0].toLowerCase() === key.toLowerCase()) {
        kv[1] = value + '';
        return;
      }
    }
    this.append(key, value);
  }
  values() {
    const values = this._values;
    let index = -1;
    return {
      next() {
        index++;
        const done = !values[index];
        return {
          value: done ? undefined : values[index][1],
          done,
        };
      },
      [Symbol.iterator]() {
        return this;
      },
    };
  }
  [Symbol.iterator]() {
    return this.entries();
  }
}

class MockDOMParser {
  parseFromString(htmlToParse, mimeType) {
    if (mimeType !== 'text/html') {
      console.error('XML parsing not implemented yet, continuing as html');
    }
    return parseHtmlToDocument(htmlToParse);
  }
}

class MockRequest {
  constructor(input, init = {}) {
    this._method = 'GET';
    this._url = '/';
    this.bodyUsed = false;
    this.cache = 'default';
    this.credentials = 'same-origin';
    this.integrity = '';
    this.keepalive = false;
    this.mode = 'cors';
    this.redirect = 'follow';
    this.referrer = 'about:client';
    this.referrerPolicy = '';
    if (typeof input === 'string') {
      this.url = input;
    }
    else if (input) {
      Object.assign(this, input);
      this.headers = new MockHeaders(input.headers);
    }
    Object.assign(this, init);
    if (init.headers) {
      this.headers = new MockHeaders(init.headers);
    }
    if (!this.headers) {
      this.headers = new MockHeaders();
    }
  }
  get url() {
    if (typeof this._url === 'string') {
      return new URL(this._url, location.href).href;
    }
    return new URL('/', location.href).href;
  }
  set url(value) {
    this._url = value;
  }
  get method() {
    if (typeof this._method === 'string') {
      return this._method.toUpperCase();
    }
    return 'GET';
  }
  set method(value) {
    this._method = value;
  }
  clone() {
    const clone = { ...this };
    clone.headers = new MockHeaders(this.headers);
    return new MockRequest(clone);
  }
}
class MockResponse {
  constructor(body, init = {}) {
    this.ok = true;
    this.status = 200;
    this.statusText = '';
    this.type = 'default';
    this.url = '';
    this._body = body;
    if (init) {
      Object.assign(this, init);
    }
    this.headers = new MockHeaders(init.headers);
  }
  async json() {
    return JSON.parse(this._body);
  }
  async text() {
    return this._body;
  }
  clone() {
    const initClone = { ...this };
    initClone.headers = new MockHeaders(this.headers);
    return new MockResponse(this._body, initClone);
  }
}

function addGlobalsToWindowPrototype(mockWinPrototype) {
  GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
    Object.defineProperty(mockWinPrototype, cstrName, {
      get() {
        return this['__' + cstrName] || Cstr;
      },
      set(cstr) {
        this['__' + cstrName] = cstr;
      },
      configurable: true,
      enumerable: true,
    });
  });
}
const GLOBAL_CONSTRUCTORS = [
  ['CustomEvent', MockCustomEvent],
  ['Event', MockEvent],
  ['Headers', MockHeaders],
  ['FocusEvent', MockFocusEvent],
  ['KeyboardEvent', MockKeyboardEvent],
  ['MouseEvent', MockMouseEvent],
  ['Request', MockRequest],
  ['Response', MockResponse],
  ['DOMParser', MockDOMParser],
  ['HTMLAnchorElement', MockAnchorElement],
  ['HTMLBaseElement', MockBaseElement],
  ['HTMLButtonElement', MockButtonElement],
  ['HTMLCanvasElement', MockCanvasElement],
  ['HTMLFormElement', MockFormElement],
  ['HTMLImageElement', MockImageElement],
  ['HTMLInputElement', MockInputElement],
  ['HTMLLinkElement', MockLinkElement],
  ['HTMLMetaElement', MockMetaElement],
  ['HTMLScriptElement', MockScriptElement],
  ['HTMLStyleElement', MockStyleElement],
  ['HTMLTemplateElement', MockTemplateElement],
  ['HTMLTitleElement', MockTitleElement],
];

class MockHistory {
  constructor() {
    this.items = [];
  }
  get length() {
    return this.items.length;
  }
  back() {
    this.go(-1);
  }
  forward() {
    this.go(1);
  }
  go(_value) {
    //
  }
  pushState(_state, _title, _url) {
    //
  }
  replaceState(_state, _title, _url) {
    //
  }
}

class MockIntersectionObserver {
  constructor() {
    /**/
  }
  disconnect() {
    /**/
  }
  observe() {
    /**/
  }
  takeRecords() {
    return [];
  }
  unobserve() {
    /**/
  }
}

class MockLocation {
  constructor() {
    this.ancestorOrigins = null;
    this.protocol = '';
    this.host = '';
    this.hostname = '';
    this.port = '';
    this.pathname = '';
    this.search = '';
    this.hash = '';
    this.username = '';
    this.password = '';
    this.origin = '';
    this._href = '';
  }
  get href() {
    return this._href;
  }
  set href(value) {
    const url = new URL(value, 'http://mockdoc.stenciljs.com');
    this._href = url.href;
    this.protocol = url.protocol;
    this.host = url.host;
    this.hostname = url.hostname;
    this.port = url.port;
    this.pathname = url.pathname;
    this.search = url.search;
    this.hash = url.hash;
    this.username = url.username;
    this.password = url.password;
    this.origin = url.origin;
  }
  assign(_url) {
    //
  }
  reload(_forcedReload) {
    //
  }
  replace(_url) {
    //
  }
  toString() {
    return this.href;
  }
}

class MockNavigator {
  constructor() {
    this.appCodeName = 'MockNavigator';
    this.appName = 'MockNavigator';
    this.appVersion = 'MockNavigator';
    this.platform = 'MockNavigator';
    this.userAgent = 'MockNavigator';
  }
}

/**
 * https://developer.mozilla.org/en-US/docs/Web/API/Performance
 */
class MockPerformance {
  constructor() {
    this.timeOrigin = Date.now();
    this.eventCounts = new Map();
  }
  addEventListener() {
    //
  }
  clearMarks() {
    //
  }
  clearMeasures() {
    //
  }
  clearResourceTimings() {
    //
  }
  dispatchEvent() {
    return true;
  }
  getEntries() {
    return [];
  }
  getEntriesByName() {
    return [];
  }
  getEntriesByType() {
    return [];
  }
  // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will
  // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  // associated errors returned by the type checker)
  // @ts-ignore
  mark() {
    //
  }
  // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will
  // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  // associated errors returned by the type checker)
  // @ts-ignore
  measure() {
    //
  }
  get navigation() {
    return {};
  }
  now() {
    return Date.now() - this.timeOrigin;
  }
  get onresourcetimingbufferfull() {
    return null;
  }
  removeEventListener() {
    //
  }
  setResourceTimingBufferSize() {
    //
  }
  get timing() {
    return {};
  }
  toJSON() {
    //
  }
}
function resetPerformance(perf) {
  if (perf != null) {
    try {
      perf.timeOrigin = Date.now();
    }
    catch (e) { }
  }
}

class MockStorage {
  constructor() {
    this.items = new Map();
  }
  key(_value) {
    //
  }
  getItem(key) {
    key = String(key);
    if (this.items.has(key)) {
      return this.items.get(key);
    }
    return null;
  }
  setItem(key, value) {
    if (value == null) {
      value = 'null';
    }
    this.items.set(String(key), String(value));
  }
  removeItem(key) {
    this.items.delete(String(key));
  }
  clear() {
    this.items.clear();
  }
}

const nativeClearInterval = clearInterval;
const nativeClearTimeout = clearTimeout;
const nativeSetInterval = setInterval;
const nativeSetTimeout = setTimeout;
const nativeURL = URL;
class MockWindow {
  constructor(html = null) {
    if (html !== false) {
      this.document = new MockDocument(html, this);
    }
    else {
      this.document = null;
    }
    this.performance = new MockPerformance();
    this.customElements = new MockCustomElementRegistry(this);
    this.console = createConsole();
    resetWindowDefaults(this);
    resetWindowDimensions(this);
  }
  addEventListener(type, handler) {
    addEventListener(this, type, handler);
  }
  alert(msg) {
    if (this.console) {
      this.console.debug(msg);
    }
    else {
      console.debug(msg);
    }
  }
  blur() {
    /**/
  }
  cancelAnimationFrame(id) {
    this.__clearTimeout(id);
  }
  cancelIdleCallback(id) {
    this.__clearTimeout(id);
  }
  get CharacterData() {
    if (this.__charDataCstr == null) {
      const ownerDocument = this.document;
      this.__charDataCstr = class extends MockNode {
        constructor() {
          super(ownerDocument, 0, 'test', '');
          throw new Error('Illegal constructor: cannot construct CharacterData');
        }
      };
    }
    return this.__charDataCstr;
  }
  set CharacterData(charDataCstr) {
    this.__charDataCstr = charDataCstr;
  }
  clearInterval(id) {
    this.__clearInterval(id);
  }
  clearTimeout(id) {
    this.__clearTimeout(id);
  }
  close() {
    resetWindow(this);
  }
  confirm() {
    return false;
  }
  get CSS() {
    return {
      supports: () => true,
    };
  }
  get Document() {
    if (this.__docCstr == null) {
      const win = this;
      this.__docCstr = class extends MockDocument {
        constructor() {
          super(false, win);
          throw new Error('Illegal constructor: cannot construct Document');
        }
      };
    }
    return this.__docCstr;
  }
  set Document(docCstr) {
    this.__docCstr = docCstr;
  }
  get DocumentFragment() {
    if (this.__docFragCstr == null) {
      const ownerDocument = this.document;
      this.__docFragCstr = class extends MockDocumentFragment {
        constructor() {
          super(ownerDocument);
          throw new Error('Illegal constructor: cannot construct DocumentFragment');
        }
      };
    }
    return this.__docFragCstr;
  }
  set DocumentFragment(docFragCstr) {
    this.__docFragCstr = docFragCstr;
  }
  get DocumentType() {
    if (this.__docTypeCstr == null) {
      const ownerDocument = this.document;
      this.__docTypeCstr = class extends MockNode {
        constructor() {
          super(ownerDocument, 0, 'test', '');
          throw new Error('Illegal constructor: cannot construct DocumentType');
        }
      };
    }
    return this.__docTypeCstr;
  }
  set DocumentType(docTypeCstr) {
    this.__docTypeCstr = docTypeCstr;
  }
  get DOMTokenList() {
    if (this.__domTokenListCstr == null) {
      this.__domTokenListCstr = class MockDOMTokenList {
      };
    }
    return this.__domTokenListCstr;
  }
  set DOMTokenList(domTokenListCstr) {
    this.__domTokenListCstr = domTokenListCstr;
  }
  dispatchEvent(ev) {
    return dispatchEvent(this, ev);
  }
  get Element() {
    if (this.__elementCstr == null) {
      const ownerDocument = this.document;
      this.__elementCstr = class extends MockElement {
        constructor() {
          super(ownerDocument, '');
          throw new Error('Illegal constructor: cannot construct Element');
        }
      };
    }
    return this.__elementCstr;
  }
  fetch(input, init) {
    if (typeof fetch === 'function') {
      return fetch(input, init);
    }
    throw new Error(`fetch() not implemented`);
  }
  focus() {
    /**/
  }
  getComputedStyle(_) {
    return {
      cssText: '',
      length: 0,
      parentRule: null,
      getPropertyPriority() {
        return null;
      },
      getPropertyValue() {
        return '';
      },
      item() {
        return null;
      },
      removeProperty() {
        return null;
      },
      setProperty() {
        return null;
      },
    };
  }
  get globalThis() {
    return this;
  }
  get history() {
    if (this.__history == null) {
      this.__history = new MockHistory();
    }
    return this.__history;
  }
  set history(hsty) {
    this.__history = hsty;
  }
  get JSON() {
    return JSON;
  }
  get HTMLElement() {
    if (this.__htmlElementCstr == null) {
      const ownerDocument = this.document;
      this.__htmlElementCstr = class extends MockHTMLElement {
        constructor() {
          super(ownerDocument, '');
          const observedAttributes = this.constructor.observedAttributes;
          if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === 'function') {
            observedAttributes.forEach((attrName) => {
              const attrValue = this.getAttribute(attrName);
              if (attrValue != null) {
                this.attributeChangedCallback(attrName, null, attrValue);
              }
            });
          }
        }
      };
    }
    return this.__htmlElementCstr;
  }
  set HTMLElement(htmlElementCstr) {
    this.__htmlElementCstr = htmlElementCstr;
  }
  get IntersectionObserver() {
    return MockIntersectionObserver;
  }
  get localStorage() {
    if (this.__localStorage == null) {
      this.__localStorage = new MockStorage();
    }
    return this.__localStorage;
  }
  set localStorage(locStorage) {
    this.__localStorage = locStorage;
  }
  get location() {
    if (this.__location == null) {
      this.__location = new MockLocation();
    }
    return this.__location;
  }
  set location(val) {
    if (typeof val === 'string') {
      if (this.__location == null) {
        this.__location = new MockLocation();
      }
      this.__location.href = val;
    }
    else {
      this.__location = val;
    }
  }
  matchMedia() {
    return {
      matches: false,
    };
  }
  get Node() {
    if (this.__nodeCstr == null) {
      const ownerDocument = this.document;
      this.__nodeCstr = class extends MockNode {
        constructor() {
          super(ownerDocument, 0, 'test', '');
          throw new Error('Illegal constructor: cannot construct Node');
        }
      };
    }
    return this.__nodeCstr;
  }
  get NodeList() {
    if (this.__nodeListCstr == null) {
      const ownerDocument = this.document;
      this.__nodeListCstr = class extends MockNodeList {
        constructor() {
          super(ownerDocument, [], 0);
          throw new Error('Illegal constructor: cannot construct NodeList');
        }
      };
    }
    return this.__nodeListCstr;
  }
  get navigator() {
    if (this.__navigator == null) {
      this.__navigator = new MockNavigator();
    }
    return this.__navigator;
  }
  set navigator(nav) {
    this.__navigator = nav;
  }
  get parent() {
    return null;
  }
  prompt() {
    return '';
  }
  open() {
    return null;
  }
  get origin() {
    return this.location.origin;
  }
  removeEventListener(type, handler) {
    removeEventListener(this, type, handler);
  }
  requestAnimationFrame(callback) {
    return this.setTimeout(() => {
      callback(Date.now());
    }, 0);
  }
  requestIdleCallback(callback) {
    return this.setTimeout(() => {
      callback({
        didTimeout: false,
        timeRemaining: () => 0,
      });
    }, 0);
  }
  scroll(_x, _y) {
    /**/
  }
  scrollBy(_x, _y) {
    /**/
  }
  scrollTo(_x, _y) {
    /**/
  }
  get self() {
    return this;
  }
  get sessionStorage() {
    if (this.__sessionStorage == null) {
      this.__sessionStorage = new MockStorage();
    }
    return this.__sessionStorage;
  }
  set sessionStorage(locStorage) {
    this.__sessionStorage = locStorage;
  }
  setInterval(callback, ms, ...args) {
    if (this.__timeouts == null) {
      this.__timeouts = new Set();
    }
    ms = Math.min(ms, this.__maxTimeout);
    if (this.__allowInterval) {
      const intervalId = this.__setInterval(() => {
        if (this.__timeouts) {
          this.__timeouts.delete(intervalId);
          try {
            callback(...args);
          }
          catch (e) {
            if (this.console) {
              this.console.error(e);
            }
            else {
              console.error(e);
            }
          }
        }
      }, ms);
      if (this.__timeouts) {
        this.__timeouts.add(intervalId);
      }
      return intervalId;
    }
    const timeoutId = this.__setTimeout(() => {
      if (this.__timeouts) {
        this.__timeouts.delete(timeoutId);
        try {
          callback(...args);
        }
        catch (e) {
          if (this.console) {
            this.console.error(e);
          }
          else {
            console.error(e);
          }
        }
      }
    }, ms);
    if (this.__timeouts) {
      this.__timeouts.add(timeoutId);
    }
    return timeoutId;
  }
  setTimeout(callback, ms, ...args) {
    if (this.__timeouts == null) {
      this.__timeouts = new Set();
    }
    ms = Math.min(ms, this.__maxTimeout);
    const timeoutId = this.__setTimeout(() => {
      if (this.__timeouts) {
        this.__timeouts.delete(timeoutId);
        try {
          callback(...args);
        }
        catch (e) {
          if (this.console) {
            this.console.error(e);
          }
          else {
            console.error(e);
          }
        }
      }
    }, ms);
    if (this.__timeouts) {
      this.__timeouts.add(timeoutId);
    }
    return timeoutId;
  }
  get top() {
    return this;
  }
  get window() {
    return this;
  }
  onanimationstart() {
    /**/
  }
  onanimationend() {
    /**/
  }
  onanimationiteration() {
    /**/
  }
  onabort() {
    /**/
  }
  onauxclick() {
    /**/
  }
  onbeforecopy() {
    /**/
  }
  onbeforecut() {
    /**/
  }
  onbeforepaste() {
    /**/
  }
  onblur() {
    /**/
  }
  oncancel() {
    /**/
  }
  oncanplay() {
    /**/
  }
  oncanplaythrough() {
    /**/
  }
  onchange() {
    /**/
  }
  onclick() {
    /**/
  }
  onclose() {
    /**/
  }
  oncontextmenu() {
    /**/
  }
  oncopy() {
    /**/
  }
  oncuechange() {
    /**/
  }
  oncut() {
    /**/
  }
  ondblclick() {
    /**/
  }
  ondrag() {
    /**/
  }
  ondragend() {
    /**/
  }
  ondragenter() {
    /**/
  }
  ondragleave() {
    /**/
  }
  ondragover() {
    /**/
  }
  ondragstart() {
    /**/
  }
  ondrop() {
    /**/
  }
  ondurationchange() {
    /**/
  }
  onemptied() {
    /**/
  }
  onended() {
    /**/
  }
  onerror() {
    /**/
  }
  onfocus() {
    /**/
  }
  onfocusin() {
    /**/
  }
  onfocusout() {
    /**/
  }
  onformdata() {
    /**/
  }
  onfullscreenchange() {
    /**/
  }
  onfullscreenerror() {
    /**/
  }
  ongotpointercapture() {
    /**/
  }
  oninput() {
    /**/
  }
  oninvalid() {
    /**/
  }
  onkeydown() {
    /**/
  }
  onkeypress() {
    /**/
  }
  onkeyup() {
    /**/
  }
  onload() {
    /**/
  }
  onloadeddata() {
    /**/
  }
  onloadedmetadata() {
    /**/
  }
  onloadstart() {
    /**/
  }
  onlostpointercapture() {
    /**/
  }
  onmousedown() {
    /**/
  }
  onmouseenter() {
    /**/
  }
  onmouseleave() {
    /**/
  }
  onmousemove() {
    /**/
  }
  onmouseout() {
    /**/
  }
  onmouseover() {
    /**/
  }
  onmouseup() {
    /**/
  }
  onmousewheel() {
    /**/
  }
  onpaste() {
    /**/
  }
  onpause() {
    /**/
  }
  onplay() {
    /**/
  }
  onplaying() {
    /**/
  }
  onpointercancel() {
    /**/
  }
  onpointerdown() {
    /**/
  }
  onpointerenter() {
    /**/
  }
  onpointerleave() {
    /**/
  }
  onpointermove() {
    /**/
  }
  onpointerout() {
    /**/
  }
  onpointerover() {
    /**/
  }
  onpointerup() {
    /**/
  }
  onprogress() {
    /**/
  }
  onratechange() {
    /**/
  }
  onreset() {
    /**/
  }
  onresize() {
    /**/
  }
  onscroll() {
    /**/
  }
  onsearch() {
    /**/
  }
  onseeked() {
    /**/
  }
  onseeking() {
    /**/
  }
  onselect() {
    /**/
  }
  onselectstart() {
    /**/
  }
  onstalled() {
    /**/
  }
  onsubmit() {
    /**/
  }
  onsuspend() {
    /**/
  }
  ontimeupdate() {
    /**/
  }
  ontoggle() {
    /**/
  }
  onvolumechange() {
    /**/
  }
  onwaiting() {
    /**/
  }
  onwebkitfullscreenchange() {
    /**/
  }
  onwebkitfullscreenerror() {
    /**/
  }
  onwheel() {
    /**/
  }
}
addGlobalsToWindowPrototype(MockWindow.prototype);
function resetWindowDefaults(win) {
  win.__clearInterval = nativeClearInterval;
  win.__clearTimeout = nativeClearTimeout;
  win.__setInterval = nativeSetInterval;
  win.__setTimeout = nativeSetTimeout;
  win.__maxTimeout = 30000;
  win.__allowInterval = true;
  win.URL = nativeURL;
}
function cloneWindow(srcWin, opts = {}) {
  if (srcWin == null) {
    return null;
  }
  const clonedWin = new MockWindow(false);
  if (!opts.customElementProxy) {
    // TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences
    // @ts-ignore
    srcWin.customElements = null;
  }
  if (srcWin.document != null) {
    const clonedDoc = new MockDocument(false, clonedWin);
    clonedWin.document = clonedDoc;
    clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
  }
  else {
    clonedWin.document = new MockDocument(null, clonedWin);
  }
  return clonedWin;
}
function cloneDocument(srcDoc) {
  if (srcDoc == null) {
    return null;
  }
  const dstWin = cloneWindow(srcDoc.defaultView);
  return dstWin.document;
}
function resetWindow(win) {
  if (win != null) {
    if (win.__timeouts) {
      win.__timeouts.forEach((timeoutId) => {
        nativeClearInterval(timeoutId);
        nativeClearTimeout(timeoutId);
      });
      win.__timeouts.clear();
    }
    if (win.customElements && win.customElements.clear) {
      win.customElements.clear();
    }
    resetDocument(win.document);
    resetPerformance(win.performance);
    for (const key in win) {
      if (win.hasOwnProperty(key) && key !== 'document' && key !== 'performance' && key !== 'customElements') {
        delete win[key];
      }
    }
    resetWindowDefaults(win);
    resetWindowDimensions(win);
    resetEventListeners(win);
    if (win.document != null) {
      try {
        win.document.defaultView = win;
      }
      catch (e) { }
    }
    // ensure we don't hold onto nodeFetch values
    win.fetch = null;
    win.Headers = null;
    win.Request = null;
    win.Response = null;
    win.FetchError = null;
  }
}
function resetWindowDimensions(win) {
  try {
    win.devicePixelRatio = 1;
    win.innerHeight = 768;
    win.innerWidth = 1366;
    win.pageXOffset = 0;
    win.pageYOffset = 0;
    win.screenLeft = 0;
    win.screenTop = 0;
    win.screenX = 0;
    win.screenY = 0;
    win.scrollX = 0;
    win.scrollY = 0;
    win.screen = {
      availHeight: win.innerHeight,
      availLeft: 0,
      availTop: 0,
      availWidth: win.innerWidth,
      colorDepth: 24,
      height: win.innerHeight,
      keepAwake: false,
      orientation: {
        angle: 0,
        type: 'portrait-primary',
      },
      pixelDepth: 24,
      width: win.innerWidth,
    };
  }
  catch (e) { }
}

class MockDocument extends MockHTMLElement {
  constructor(html = null, win = null) {
    super(null, null);
    this.nodeName = "#document" /* NODE_NAMES.DOCUMENT_NODE */;
    this.nodeType = 9 /* NODE_TYPES.DOCUMENT_NODE */;
    this.defaultView = win;
    this.cookie = '';
    this.referrer = '';
    this.appendChild(this.createDocumentTypeNode());
    if (typeof html === 'string') {
      const parsedDoc = parseDocumentUtil(this, html);
      const documentElement = parsedDoc.children.find((elm) => elm.nodeName === 'HTML');
      if (documentElement != null) {
        this.appendChild(documentElement);
        setOwnerDocument(documentElement, this);
      }
    }
    else if (html !== false) {
      const documentElement = new MockHTMLElement(this, 'html');
      this.appendChild(documentElement);
      documentElement.appendChild(new MockHTMLElement(this, 'head'));
      documentElement.appendChild(new MockHTMLElement(this, 'body'));
    }
  }
  get dir() {
    return this.documentElement.dir;
  }
  set dir(value) {
    this.documentElement.dir = value;
  }
  get location() {
    if (this.defaultView != null) {
      return this.defaultView.location;
    }
    return null;
  }
  set location(val) {
    if (this.defaultView != null) {
      this.defaultView.location = val;
    }
  }
  get baseURI() {
    const baseNode = this.head.childNodes.find((node) => node.nodeName === 'BASE');
    if (baseNode) {
      return baseNode.href;
    }
    return this.URL;
  }
  get URL() {
    return this.location.href;
  }
  get styleSheets() {
    return this.querySelectorAll('style');
  }
  get scripts() {
    return this.querySelectorAll('script');
  }
  get forms() {
    return this.querySelectorAll('form');
  }
  get images() {
    return this.querySelectorAll('img');
  }
  get scrollingElement() {
    return this.documentElement;
  }
  get documentElement() {
    for (let i = this.childNodes.length - 1; i >= 0; i--) {
      if (this.childNodes[i].nodeName === 'HTML') {
        return this.childNodes[i];
      }
    }
    const documentElement = new MockHTMLElement(this, 'html');
    this.appendChild(documentElement);
    return documentElement;
  }
  set documentElement(documentElement) {
    for (let i = this.childNodes.length - 1; i >= 0; i--) {
      if (this.childNodes[i].nodeType !== 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */) {
        this.childNodes[i].remove();
      }
    }
    if (documentElement != null) {
      this.appendChild(documentElement);
      setOwnerDocument(documentElement, this);
    }
  }
  get head() {
    const documentElement = this.documentElement;
    for (let i = 0; i < documentElement.childNodes.length; i++) {
      if (documentElement.childNodes[i].nodeName === 'HEAD') {
        return documentElement.childNodes[i];
      }
    }
    const head = new MockHTMLElement(this, 'head');
    documentElement.insertBefore(head, documentElement.firstChild);
    return head;
  }
  set head(head) {
    const documentElement = this.documentElement;
    for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
      if (documentElement.childNodes[i].nodeName === 'HEAD') {
        documentElement.childNodes[i].remove();
      }
    }
    if (head != null) {
      documentElement.insertBefore(head, documentElement.firstChild);
      setOwnerDocument(head, this);
    }
  }
  get body() {
    const documentElement = this.documentElement;
    for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
      if (documentElement.childNodes[i].nodeName === 'BODY') {
        return documentElement.childNodes[i];
      }
    }
    const body = new MockHTMLElement(this, 'body');
    documentElement.appendChild(body);
    return body;
  }
  set body(body) {
    const documentElement = this.documentElement;
    for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
      if (documentElement.childNodes[i].nodeName === 'BODY') {
        documentElement.childNodes[i].remove();
      }
    }
    if (body != null) {
      documentElement.appendChild(body);
      setOwnerDocument(body, this);
    }
  }
  appendChild(newNode) {
    newNode.remove();
    newNode.parentNode = this;
    this.childNodes.push(newNode);
    return newNode;
  }
  createComment(data) {
    return new MockComment(this, data);
  }
  createAttribute(attrName) {
    return new MockAttr(attrName.toLowerCase(), '');
  }
  createAttributeNS(namespaceURI, attrName) {
    return new MockAttr(attrName, '', namespaceURI);
  }
  createElement(tagName) {
    if (tagName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
      const doc = new MockDocument(false);
      doc.nodeName = tagName;
      doc.parentNode = null;
      return doc;
    }
    return createElement(this, tagName);
  }
  createElementNS(namespaceURI, tagName) {
    const elmNs = createElementNS(this, namespaceURI, tagName);
    elmNs.namespaceURI = namespaceURI;
    return elmNs;
  }
  createTextNode(text) {
    return new MockTextNode(this, text);
  }
  createDocumentFragment() {
    return new MockDocumentFragment(this);
  }
  createDocumentTypeNode() {
    return new MockDocumentTypeNode(this);
  }
  getElementById(id) {
    return getElementById(this, id);
  }
  getElementsByName(elmName) {
    return getElementsByName(this, elmName.toLowerCase());
  }
  get title() {
    const title = this.head.childNodes.find((elm) => elm.nodeName === 'TITLE');
    if (title != null && typeof title.textContent === 'string') {
      return title.textContent.trim();
    }
    return '';
  }
  set title(value) {
    const head = this.head;
    let title = head.childNodes.find((elm) => elm.nodeName === 'TITLE');
    if (title == null) {
      title = this.createElement('title');
      head.appendChild(title);
    }
    title.textContent = value;
  }
}
function createDocument(html = null) {
  return new MockWindow(html).document;
}
function resetDocument(doc) {
  if (doc != null) {
    resetEventListeners(doc);
    const documentElement = doc.documentElement;
    if (documentElement != null) {
      resetElement(documentElement);
      for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
        const childNode = documentElement.childNodes[i];
        resetElement(childNode);
        childNode.childNodes.length = 0;
      }
    }
    for (const key in doc) {
      if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
        delete doc[key];
      }
    }
    try {
      doc.nodeName = "#document" /* NODE_NAMES.DOCUMENT_NODE */;
    }
    catch (e) { }
    try {
      doc.nodeType = 9 /* NODE_TYPES.DOCUMENT_NODE */;
    }
    catch (e) { }
    try {
      doc.cookie = '';
    }
    catch (e) { }
    try {
      doc.referrer = '';
    }
    catch (e) { }
  }
}
const DOC_KEY_KEEPERS = new Set([
  'nodeName',
  'nodeType',
  'nodeValue',
  'ownerDocument',
  'parentNode',
  'childNodes',
  '_shadowRoot',
]);
function getElementById(elm, id) {
  const children = elm.children;
  for (let i = 0, ii = children.length; i < ii; i++) {
    const childElm = children[i];
    if (childElm.id === id) {
      return childElm;
    }
    const childElmFound = getElementById(childElm, id);
    if (childElmFound != null) {
      return childElmFound;
    }
  }
  return null;
}
function getElementsByName(elm, elmName, foundElms = []) {
  const children = elm.children;
  for (let i = 0, ii = children.length; i < ii; i++) {
    const childElm = children[i];
    if (childElm.name && childElm.name.toLowerCase() === elmName) {
      foundElms.push(childElm);
    }
    getElementsByName(childElm, elmName, foundElms);
  }
  return foundElms;
}
function setOwnerDocument(elm, ownerDocument) {
  for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
    elm.childNodes[i].ownerDocument = ownerDocument;
    if (elm.childNodes[i].nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
      setOwnerDocument(elm.childNodes[i], ownerDocument);
    }
  }
}

const isWindows$1 = typeof process === 'object' &&
  process &&
  process.platform === 'win32';
var path$1 = isWindows$1 ? { sep: '\\' } : { sep: '/' };

var balancedMatch$1 = balanced$1;
function balanced$1(a, b, str) {
  if (a instanceof RegExp) a = maybeMatch$1(a, str);
  if (b instanceof RegExp) b = maybeMatch$1(b, str);

  var r = range$1(a, b, str);

  return r && {
  start: r[0],
  end: r[1],
  pre: str.slice(0, r[0]),
  body: str.slice(r[0] + a.length, r[1]),
  post: str.slice(r[1] + b.length)
  };
}

function maybeMatch$1(reg, str) {
  var m = str.match(reg);
  return m ? m[0] : null;
}

balanced$1.range = range$1;
function range$1(a, b, str) {
  var begs, beg, left, right, result;
  var ai = str.indexOf(a);
  var bi = str.indexOf(b, ai + 1);
  var i = ai;

  if (ai >= 0 && bi > 0) {
  begs = [];
  left = str.length;

  while (i >= 0 && !result) {
    if (i == ai) {
    begs.push(i);
    ai = str.indexOf(a, i + 1);
    } else if (begs.length == 1) {
    result = [ begs.pop(), bi ];
    } else {
    beg = begs.pop();
    if (beg < left) {
      left = beg;
      right = bi;
    }

    bi = str.indexOf(b, i + 1);
    }

    i = ai < bi && ai >= 0 ? ai : bi;
  }

  if (begs.length) {
    result = [ left, right ];
  }
  }

  return result;
}

var braceExpansion$1 = expandTop$1;

var escSlash$1 = '\0SLASH'+Math.random()+'\0';
var escOpen$1 = '\0OPEN'+Math.random()+'\0';
var escClose$1 = '\0CLOSE'+Math.random()+'\0';
var escComma$1 = '\0COMMA'+Math.random()+'\0';
var escPeriod$1 = '\0PERIOD'+Math.random()+'\0';

function numeric$1(str) {
  return parseInt(str, 10) == str
  ? parseInt(str, 10)
  : str.charCodeAt(0);
}

function escapeBraces$1(str) {
  return str.split('\\\\').join(escSlash$1)
      .split('\\{').join(escOpen$1)
      .split('\\}').join(escClose$1)
      .split('\\,').join(escComma$1)
      .split('\\.').join(escPeriod$1);
}

function unescapeBraces$1(str) {
  return str.split(escSlash$1).join('\\')
      .split(escOpen$1).join('{')
      .split(escClose$1).join('}')
      .split(escComma$1).join(',')
      .split(escPeriod$1).join('.');
}


// Basically just str.split(","), but handling cases
// where we have nested braced sections, which should be
// treated as individual members, like {a,{b,c},d}
function parseCommaParts$1(str) {
  if (!str)
  return [''];

  var parts = [];
  var m = balancedMatch$1('{', '}', str);

  if (!m)
  return str.split(',');

  var pre = m.pre;
  var body = m.body;
  var post = m.post;
  var p = pre.split(',');

  p[p.length-1] += '{' + body + '}';
  var postParts = parseCommaParts$1(post);
  if (post.length) {
  p[p.length-1] += postParts.shift();
  p.push.apply(p, postParts);
  }

  parts.push.apply(parts, p);

  return parts;
}

function expandTop$1(str) {
  if (!str)
  return [];

  // I don't know why Bash 4.3 does this, but it does.
  // Anything starting with {} will have the first two bytes preserved
  // but *only* at the top level, so {},a}b will not expand to anything,
  // but a{},b}c will be expanded to [a}c,abc].
  // One could argue that this is a bug in Bash, but since the goal of
  // this module is to match Bash's rules, we escape a leading {}
  if (str.substr(0, 2) === '{}') {
  str = '\\{\\}' + str.substr(2);
  }

  return expand$1(escapeBraces$1(str), true).map(unescapeBraces$1);
}

function embrace$1(str) {
  return '{' + str + '}';
}
function isPadded$1(el) {
  return /^-?0\d/.test(el);
}

function lte$1(i, y) {
  return i <= y;
}
function gte$1(i, y) {
  return i >= y;
}

function expand$1(str, isTop) {
  var expansions = [];

  var m = balancedMatch$1('{', '}', str);
  if (!m) return [str];

  // no need to expand pre, since it is guaranteed to be free of brace-sets
  var pre = m.pre;
  var post = m.post.length
  ? expand$1(m.post, false)
  : [''];

  if (/\$$/.test(m.pre)) {
  for (var k = 0; k < post.length; k++) {
    var expansion = pre+ '{' + m.body + '}' + post[k];
    expansions.push(expansion);
  }
  } else {
  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  var isSequence = isNumericSequence || isAlphaSequence;
  var isOptions = m.body.indexOf(',') >= 0;
  if (!isSequence && !isOptions) {
    // {a},b}
    if (m.post.match(/,.*\}/)) {
    str = m.pre + '{' + m.body + escClose$1 + m.post;
    return expand$1(str);
    }
    return [str];
  }

  var n;
  if (isSequence) {
    n = m.body.split(/\.\./);
  } else {
    n = parseCommaParts$1(m.body);
    if (n.length === 1) {
    // x{{a,b}}y ==> x{a}y x{b}y
    n = expand$1(n[0], false).map(embrace$1);
    if (n.length === 1) {
      return post.map(function(p) {
      return m.pre + n[0] + p;
      });
    }
    }
  }

  // at this point, n is the parts, and we know it's not a comma set
  // with a single entry.
  var N;

  if (isSequence) {
    var x = numeric$1(n[0]);
    var y = numeric$1(n[1]);
    var width = Math.max(n[0].length, n[1].length);
    var incr = n.length == 3
    ? Math.abs(numeric$1(n[2]))
    : 1;
    var test = lte$1;
    var reverse = y < x;
    if (reverse) {
    incr *= -1;
    test = gte$1;
    }
    var pad = n.some(isPadded$1);

    N = [];

    for (var i = x; test(i, y); i += incr) {
    var c;
    if (isAlphaSequence) {
      c = String.fromCharCode(i);
      if (c === '\\')
      c = '';
    } else {
      c = String(i);
      if (pad) {
      var need = width - c.length;
      if (need > 0) {
        var z = new Array(need + 1).join('0');
        if (i < 0)
        c = '-' + z + c.slice(1);
        else
        c = z + c;
      }
      }
    }
    N.push(c);
    }
  } else {
    N = [];

    for (var j = 0; j < n.length; j++) {
    N.push.apply(N, expand$1(n[j], false));
    }
  }

  for (var j = 0; j < N.length; j++) {
    for (var k = 0; k < post.length; k++) {
    var expansion = pre + N[j] + post[k];
    if (!isTop || isSequence || expansion)
      expansions.push(expansion);
    }
  }
  }

  return expansions;
}

var minimatch_1$1 = createCommonjsModule$1(function (module) {
const minimatch = module.exports = (p, pattern, options = {}) => {
  assertValidPattern(pattern);

  // shortcut: comments match nothing.
  if (!options.nocomment && pattern.charAt(0) === '#') {
  return false
  }

  return new Minimatch(pattern, options).match(p)
};

module.exports = minimatch;


minimatch.sep = path$1.sep;

const GLOBSTAR = Symbol('globstar **');
minimatch.GLOBSTAR = GLOBSTAR;


const plTypes = {
  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  '?': { open: '(?:', close: ')?' },
  '+': { open: '(?:', close: ')+' },
  '*': { open: '(?:', close: ')*' },
  '@': { open: '(?:', close: ')' }
};

// any single thing other than /
// don't need to escape / when using new RegExp()
const qmark = '[^/]';

// * => any number of characters
const star = qmark + '*?';

// ** when dots are allowed.  Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';

// not a ^ or / followed by a dot,
// followed by anything, any number of times.
const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';

// "abc" -> { a:true, b:true, c:true }
const charSet = s => s.split('').reduce((set, c) => {
  set[c] = true;
  return set
}, {});

// characters that need to be escaped in RegExp.
const reSpecials = charSet('().*{}+?[]^$\\!');

// characters that indicate we have to add the pattern start
const addPatternStartSet = charSet('[.(');

// normalizes slashes.
const slashSplit = /\/+/;

minimatch.filter = (pattern, options = {}) =>
  (p, i, list) => minimatch(p, pattern, options);

const ext = (a, b = {}) => {
  const t = {};
  Object.keys(a).forEach(k => t[k] = a[k]);
  Object.keys(b).forEach(k => t[k] = b[k]);
  return t
};

minimatch.defaults = def => {
  if (!def || typeof def !== 'object' || !Object.keys(def).length) {
  return minimatch
  }

  const orig = minimatch;

  const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
  m.Minimatch = class Minimatch extends orig.Minimatch {
  constructor (pattern, options) {
    super(pattern, ext(def, options));
  }
  };
  m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch;
  m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
  m.defaults = options => orig.defaults(ext(def, options));
  m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
  m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
  m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));

  return m
};





// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);

const braceExpand = (pattern, options = {}) => {
  assertValidPattern(pattern);

  // Thanks to Yeting Li <https://github.com/yetingli> for
  // improving this regexp to avoid a ReDOS vulnerability.
  if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
  // shortcut. no need to expand.
  return [pattern]
  }

  return braceExpansion$1(pattern)
};

const MAX_PATTERN_LENGTH = 1024 * 64;
const assertValidPattern = pattern => {
  if (typeof pattern !== 'string') {
  throw new TypeError('invalid pattern')
  }

  if (pattern.length > MAX_PATTERN_LENGTH) {
  throw new TypeError('pattern is too long')
  }
};

// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion.  Otherwise, any series
// of * is equivalent to a single *.  Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
const SUBPARSE = Symbol('subparse');

minimatch.makeRe = (pattern, options) =>
  new Minimatch(pattern, options || {}).makeRe();

minimatch.match = (list, pattern, options = {}) => {
  const mm = new Minimatch(pattern, options);
  list = list.filter(f => mm.match(f));
  if (mm.options.nonull && !list.length) {
  list.push(pattern);
  }
  return list
};

// replace stuff like \* with *
const globUnescape = s => s.replace(/\\(.)/g, '$1');
const charUnescape = s => s.replace(/\\([^-\]])/g, '$1');
const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&');

class Minimatch {
  constructor (pattern, options) {
  assertValidPattern(pattern);

  if (!options) options = {};

  this.options = options;
  this.set = [];
  this.pattern = pattern;
  this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||
    options.allowWindowsEscape === false;
  if (this.windowsPathsNoEscape) {
    this.pattern = this.pattern.replace(/\\/g, '/');
  }
  this.regexp = null;
  this.negate = false;
  this.comment = false;
  this.empty = false;
  this.partial = !!options.partial;

  // make the set of regexps etc.
  this.make();
  }

  debug () {}

  make () {
  const pattern = this.pattern;
  const options = this.options;

  // empty patterns and comments match nothing.
  if (!options.nocomment && pattern.charAt(0) === '#') {
    this.comment = true;
    return
  }
  if (!pattern) {
    this.empty = true;
    return
  }

  // step 1: figure out negation, etc.
  this.parseNegate();

  // step 2: expand braces
  let set = this.globSet = this.braceExpand();

  if (options.debug) this.debug = (...args) => console.error(...args);

  this.debug(this.pattern, set);

  // step 3: now we have a set, so turn each one into a series of path-portion
  // matching patterns.
  // These will be regexps, except in the case of "**", which is
  // set to the GLOBSTAR object for globstar behavior,
  // and will not contain any / characters
  set = this.globParts = set.map(s => s.split(slashSplit));

  this.debug(this.pattern, set);

  // glob --> regexps
  set = set.map((s, si, set) => s.map(this.parse, this));

  this.debug(this.pattern, set);

  // filter out everything that didn't compile properly.
  set = set.filter(s => s.indexOf(false) === -1);

  this.debug(this.pattern, set);

  this.set = set;
  }

  parseNegate () {
  if (this.options.nonegate) return

  const pattern = this.pattern;
  let negate = false;
  let negateOffset = 0;

  for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
    negate = !negate;
    negateOffset++;
  }

  if (negateOffset) this.pattern = pattern.slice(negateOffset);
  this.negate = negate;
  }

  // set partial to true to test if, for example,
  // "/a/b" matches the start of "/*/b/*/d"
  // Partial means, if you run out of file before you run
  // out of pattern, then that's fine, as long as all
  // the parts match.
  matchOne (file, pattern, partial) {
  var options = this.options;

  this.debug('matchOne',
    { 'this': this, file: file, pattern: pattern });

  this.debug('matchOne', file.length, pattern.length);

  for (var fi = 0,
    pi = 0,
    fl = file.length,
    pl = pattern.length
    ; (fi < fl) && (pi < pl)
    ; fi++, pi++) {
    this.debug('matchOne loop');
    var p = pattern[pi];
    var f = file[fi];

    this.debug(pattern, p, f);

    // should be impossible.
    // some invalid regexp stuff in the set.
    /* istanbul ignore if */
    if (p === false) return false

    if (p === GLOBSTAR) {
    this.debug('GLOBSTAR', [pattern, p, f]);

    // "**"
    // a/**/b/**/c would match the following:
    // a/b/x/y/z/c
    // a/x/y/z/b/c
    // a/b/x/b/x/c
    // a/b/c
    // To do this, take the rest of the pattern after
    // the **, and see if it would match the file remainder.
    // If so, return success.
    // If not, the ** "swallows" a segment, and try again.
    // This is recursively awful.
    //
    // a/**/b/**/c matching a/b/x/y/z/c
    // - a matches a
    // - doublestar
    //   - matchOne(b/x/y/z/c, b/**/c)
    //   - b matches b
    //   - doublestar
    //     - matchOne(x/y/z/c, c) -> no
    //     - matchOne(y/z/c, c) -> no
    //     - matchOne(z/c, c) -> no
    //     - matchOne(c, c) yes, hit
    var fr = fi;
    var pr = pi + 1;
    if (pr === pl) {
      this.debug('** at the end');
      // a ** at the end will just swallow the rest.
      // We have found a match.
      // however, it will not swallow /.x, unless
      // options.dot is set.
      // . and .. are *never* matched by **, for explosively
      // exponential reasons.
      for (; fi < fl; fi++) {
      if (file[fi] === '.' || file[fi] === '..' ||
        (!options.dot && file[fi].charAt(0) === '.')) return false
      }
      return true
    }

    // ok, let's see if we can swallow whatever we can.
    while (fr < fl) {
      var swallowee = file[fr];

      this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);

      // XXX remove this slice.  Just pass the start index.
      if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
      this.debug('globstar found match!', fr, fl, swallowee);
      // found a match.
      return true
      } else {
      // can't swallow "." or ".." ever.
      // can only swallow ".foo" when explicitly asked.
      if (swallowee === '.' || swallowee === '..' ||
        (!options.dot && swallowee.charAt(0) === '.')) {
        this.debug('dot detected!', file, fr, pattern, pr);
        break
      }

      // ** swallows a segment, and continue.
      this.debug('globstar swallow a segment, and continue');
      fr++;
      }
    }

    // no match was found.
    // However, in partial mode, we can't say this is necessarily over.
    // If there's more *pattern* left, then
    /* istanbul ignore if */
    if (partial) {
      // ran out of file
      this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
      if (fr === fl) return true
    }
    return false
    }

    // something other than **
    // non-magic patterns just have to match exactly
    // patterns with magic have been turned into regexps.
    var hit;
    if (typeof p === 'string') {
    hit = f === p;
    this.debug('string match', p, f, hit);
    } else {
    hit = f.match(p);
    this.debug('pattern match', p, f, hit);
    }

    if (!hit) return false
  }

  // Note: ending in / means that we'll get a final ""
  // at the end of the pattern.  This can only match a
  // corresponding "" at the end of the file.
  // If the file ends in /, then it can only match a
  // a pattern that ends in /, unless the pattern just
  // doesn't have any more for it. But, a/b/ should *not*
  // match "a/b/*", even though "" matches against the
  // [^/]*? pattern, except in partial mode, where it might
  // simply not be reached yet.
  // However, a/b/ should still satisfy a/*

  // now either we fell off the end of the pattern, or we're done.
  if (fi === fl && pi === pl) {
    // ran out of pattern and filename at the same time.
    // an exact hit!
    return true
  } else if (fi === fl) {
    // ran out of file, but still had pattern left.
    // this is ok if we're doing the match as part of
    // a glob fs traversal.
    return partial
  } else /* istanbul ignore else */ if (pi === pl) {
    // ran out of pattern, still have file left.
    // this is only acceptable if we're on the very last
    // empty segment of a file with a trailing slash.
    // a/* should match a/b/
    return (fi === fl - 1) && (file[fi] === '')
  }

  // should be unreachable.
  /* istanbul ignore next */
  throw new Error('wtf?')
  }

  braceExpand () {
  return braceExpand(this.pattern, this.options)
  }

  parse (pattern, isSub) {
  assertValidPattern(pattern);

  const options = this.options;

  // shortcuts
  if (pattern === '**') {
    if (!options.noglobstar)
    return GLOBSTAR
    else
    pattern = '*';
  }
  if (pattern === '') return ''

  let re = '';
  let hasMagic = !!options.nocase;
  let escaping = false;
  // ? => one single character
  const patternListStack = [];
  const negativeLists = [];
  let stateChar;
  let inClass = false;
  let reClassStart = -1;
  let classStart = -1;
  let cs;
  let pl;
  let sp;
  // . and .. never match anything that doesn't start with .,
  // even when options.dot is set.
  const patternStart = pattern.charAt(0) === '.' ? '' // anything
  // not (start or / followed by . or .. followed by / or end)
  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  : '(?!\\.)';

  const clearStateChar = () => {
    if (stateChar) {
    // we had some state-tracking character
    // that wasn't consumed by this pass.
    switch (stateChar) {
      case '*':
      re += star;
      hasMagic = true;
      break
      case '?':
      re += qmark;
      hasMagic = true;
      break
      default:
      re += '\\' + stateChar;
      break
    }
    this.debug('clearStateChar %j %j', stateChar, re);
    stateChar = false;
    }
  };

  for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {
    this.debug('%s\t%s %s %j', pattern, i, re, c);

    // skip over any that are escaped.
    if (escaping) {
    /* istanbul ignore next - completely not allowed, even escaped. */
    if (c === '/') {
      return false
    }

    if (reSpecials[c]) {
      re += '\\';
    }
    re += c;
    escaping = false;
    continue
    }

    switch (c) {
    /* istanbul ignore next */
    case '/': {
      // Should already be path-split by now.
      return false
    }

    case '\\':
      if (inClass && pattern.charAt(i + 1) === '-') {
      re += c;
      continue
      }

      clearStateChar();
      escaping = true;
    continue

    // the various stateChar values
    // for the "extglob" stuff.
    case '?':
    case '*':
    case '+':
    case '@':
    case '!':
      this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);

      // all of those are literals inside a class, except that
      // the glob [!a] means [^a] in regexp
      if (inClass) {
      this.debug('  in class');
      if (c === '!' && i === classStart + 1) c = '^';
      re += c;
      continue
      }

      // if we already have a stateChar, then it means
      // that there was something like ** or +? in there.
      // Handle the stateChar, then proceed with this one.
      this.debug('call clearStateChar %j', stateChar);
      clearStateChar();
      stateChar = c;
      // if extglob is disabled, then +(asdf|foo) isn't a thing.
      // just clear the statechar *now*, rather than even diving into
      // the patternList stuff.
      if (options.noext) clearStateChar();
    continue

    case '(':
      if (inClass) {
      re += '(';
      continue
      }

      if (!stateChar) {
      re += '\\(';
      continue
      }

      patternListStack.push({
      type: stateChar,
      start: i - 1,
      reStart: re.length,
      open: plTypes[stateChar].open,
      close: plTypes[stateChar].close
      });
      // negation is (?:(?!js)[^/]*)
      re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
      this.debug('plType %j %j', stateChar, re);
      stateChar = false;
    continue

    case ')':
      if (inClass || !patternListStack.length) {
      re += '\\)';
      continue
      }

      clearStateChar();
      hasMagic = true;
      pl = patternListStack.pop();
      // negation is (?:(?!js)[^/]*)
      // The others are (?:<pattern>)<type>
      re += pl.close;
      if (pl.type === '!') {
      negativeLists.push(pl);
      }
      pl.reEnd = re.length;
    continue

    case '|':
      if (inClass || !patternListStack.length) {
      re += '\\|';
      continue
      }

      clearStateChar();
      re += '|';
    continue

    // these are mostly the same in regexp and glob
    case '[':
      // swallow any state-tracking char before the [
      clearStateChar();

      if (inClass) {
      re += '\\' + c;
      continue
      }

      inClass = true;
      classStart = i;
      reClassStart = re.length;
      re += c;
    continue

    case ']':
      //  a right bracket shall lose its special
      //  meaning and represent itself in
      //  a bracket expression if it occurs
      //  first in the list.  -- POSIX.2 2.8.3.2
      if (i === classStart + 1 || !inClass) {
      re += '\\' + c;
      continue
      }

      // split where the last [ was, make sure we don't have
      // an invalid re. if so, re-walk the contents of the
      // would-be class to re-translate any characters that
      // were passed through as-is
      // TODO: It would probably be faster to determine this
      // without a try/catch and a new RegExp, but it's tricky
      // to do safely.  For now, this is safe and works.
      cs = pattern.substring(classStart + 1, i);
      try {
      RegExp('[' + braExpEscape(charUnescape(cs)) + ']');
      // looks good, finish up the class.
      re += c;
      } catch (er) {
      // out of order ranges in JS are errors, but in glob syntax,
      // they're just a range that matches nothing.
      re = re.substring(0, reClassStart) + '(?:$.)'; // match nothing ever
      }
      hasMagic = true;
      inClass = false;
    continue

    default:
      // swallow any state char that wasn't consumed
      clearStateChar();

      if (reSpecials[c] && !(c === '^' && inClass)) {
      re += '\\';
      }

      re += c;
      break

    } // switch
  } // for

  // handle the case where we left a class open.
  // "[abc" is valid, equivalent to "\[abc"
  if (inClass) {
    // split where the last [ was, and escape it
    // this is a huge pita.  We now have to re-walk
    // the contents of the would-be class to re-translate
    // any characters that were passed through as-is
    cs = pattern.slice(classStart + 1);
    sp = this.parse(cs, SUBPARSE);
    re = re.substring(0, reClassStart) + '\\[' + sp[0];
    hasMagic = hasMagic || sp[1];
  }

  // handle the case where we had a +( thing at the *end*
  // of the pattern.
  // each pattern list stack adds 3 chars, and we need to go through
  // and escape any | chars that were passed through as-is for the regexp.
  // Go through and escape them, taking care not to double-escape any
  // | chars that were already escaped.
  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
    let tail;
    tail = re.slice(pl.reStart + pl.open.length);
    this.debug('setting tail', re, pl);
    // maybe some even number of \, then maybe 1 \, followed by a |
    tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
    /* istanbul ignore else - should already be done */
    if (!$2) {
      // the | isn't already escaped, so escape it.
      $2 = '\\';
    }

    // need to escape all those slashes *again*, without escaping the
    // one that we need for escaping the | character.  As it works out,
    // escaping an even number of slashes can be done by simply repeating
    // it exactly after itself.  That's why this trick works.
    //
    // I am sorry that you have to see this.
    return $1 + $1 + $2 + '|'
    });

    this.debug('tail=%j\n   %s', tail, tail, pl, re);
    const t = pl.type === '*' ? star
    : pl.type === '?' ? qmark
    : '\\' + pl.type;

    hasMagic = true;
    re = re.slice(0, pl.reStart) + t + '\\(' + tail;
  }

  // handle trailing things that only matter at the very end.
  clearStateChar();
  if (escaping) {
    // trailing \\
    re += '\\\\';
  }

  // only need to apply the nodot start if the re starts with
  // something that could conceivably capture a dot
  const addPatternStart = addPatternStartSet[re.charAt(0)];

  // Hack to work around lack of negative lookbehind in JS
  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  // like 'a.xyz.yz' doesn't match.  So, the first negative
  // lookahead, has to look ALL the way ahead, to the end of
  // the pattern.
  for (let n = negativeLists.length - 1; n > -1; n--) {
    const nl = negativeLists[n];

    const nlBefore = re.slice(0, nl.reStart);
    const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
    let nlAfter = re.slice(nl.reEnd);
    const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;

    // Handle nested stuff like *(*.js|!(*.json)), where open parens
    // mean that we should *not* include the ) in the bit that is considered
    // "after" the negated section.
    const openParensBefore = nlBefore.split('(').length - 1;
    let cleanAfter = nlAfter;
    for (let i = 0; i < openParensBefore; i++) {
    cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
    }
    nlAfter = cleanAfter;

    const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '';
    re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  }

  // if the re is not "" at this point, then we need to make sure
  // it doesn't match against an empty path part.
  // Otherwise a/* will match a/, which it should not.
  if (re !== '' && hasMagic) {
    re = '(?=.)' + re;
  }

  if (addPatternStart) {
    re = patternStart + re;
  }

  // parsing just a piece of a larger pattern.
  if (isSub === SUBPARSE) {
    return [re, hasMagic]
  }

  // skip the regexp for non-magical patterns
  // unescape anything in it, though, so that it'll be
  // an exact match against a file etc.
  if (!hasMagic) {
    return globUnescape(pattern)
  }

  const flags = options.nocase ? 'i' : '';
  try {
    return Object.assign(new RegExp('^' + re + '$', flags), {
    _glob: pattern,
    _src: re,
    })
  } catch (er) /* istanbul ignore next - should be impossible */ {
    // If it was an invalid regular expression, then it can't match
    // anything.  This trick looks for a character after the end of
    // the string, which is of course impossible, except in multi-line
    // mode, but it's not a /m regex.
    return new RegExp('$.')
  }
  }

  makeRe () {
  if (this.regexp || this.regexp === false) return this.regexp

  // at this point, this.set is a 2d array of partial
  // pattern strings, or "**".
  //
  // It's better to use .match().  This function shouldn't
  // be used, really, but it's pretty convenient sometimes,
  // when you just want to work with a regex.
  const set = this.set;

  if (!set.length) {
    this.regexp = false;
    return this.regexp
  }
  const options = this.options;

  const twoStar = options.noglobstar ? star
    : options.dot ? twoStarDot
    : twoStarNoDot;
  const flags = options.nocase ? 'i' : '';

  // coalesce globstars and regexpify non-globstar patterns
  // if it's the only item, then we just do one twoStar
  // if it's the first, and there are more, prepend (\/|twoStar\/)? to next
  // if it's the last, append (\/twoStar|) to previous
  // if it's in the middle, append (\/|\/twoStar\/) to previous
  // then filter out GLOBSTAR symbols
  let re = set.map(pattern => {
    pattern = pattern.map(p =>
    typeof p === 'string' ? regExpEscape(p)
    : p === GLOBSTAR ? GLOBSTAR
    : p._src
    ).reduce((set, p) => {
    if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
      set.push(p);
    }
    return set
    }, []);
    pattern.forEach((p, i) => {
    if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {
      return
    }
    if (i === 0) {
      if (pattern.length > 1) {
      pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1];
      } else {
      pattern[i] = twoStar;
      }
    } else if (i === pattern.length - 1) {
      pattern[i-1] += '(?:\\\/|' + twoStar + ')?';
    } else {
      pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1];
      pattern[i+1] = GLOBSTAR;
    }
    });
    return pattern.filter(p => p !== GLOBSTAR).join('/')
  }).join('|');

  // must match entire pattern
  // ending in a * or ** will make it less strict.
  re = '^(?:' + re + ')$';

  // can match anything, as long as it's not this.
  if (this.negate) re = '^(?!' + re + ').*$';

  try {
    this.regexp = new RegExp(re, flags);
  } catch (ex) /* istanbul ignore next - should be impossible */ {
    this.regexp = false;
  }
  return this.regexp
  }

  match (f, partial = this.partial) {
  this.debug('match', f, this.pattern);
  // short-circuit in the case of busted things.
  // comments, etc.
  if (this.comment) return false
  if (this.empty) return f === ''

  if (f === '/' && partial) return true

  const options = this.options;

  // windows: need to use /, not \
  if (path$1.sep !== '/') {
    f = f.split(path$1.sep).join('/');
  }

  // treat the test path as a set of pathparts.
  f = f.split(slashSplit);
  this.debug(this.pattern, 'split', f);

  // just ONE of the pattern sets in this.set needs to match
  // in order for it to be valid.  If negating, then just one
  // match means that we have failed.
  // Either way, return on the first hit.

  const set = this.set;
  this.debug(this.pattern, 'set', set);

  // Find the basename of the path by looking for the last non-empty segment
  let filename;
  for (let i = f.length - 1; i >= 0; i--) {
    filename = f[i];
    if (filename) break
  }

  for (let i = 0; i < set.length; i++) {
    const pattern = set[i];
    let file = f;
    if (options.matchBase && pattern.length === 1) {
    file = [filename];
    }
    const hit = this.matchOne(file, pattern, partial);
    if (hit) {
    if (options.flipNegate) return true
    return !this.negate
    }
  }

  // didn't get any hits.  this is success if it's a negative
  // pattern, failure otherwise.
  if (options.flipNegate) return false
  return this.negate
  }

  static defaults (def) {
  return minimatch.defaults(def).Minimatch
  }
}

minimatch.Minimatch = Minimatch;
});

const getComponentAssetsCopyTasks = (config, buildCtx, dest, collectionsPath) => {
  if (!dest) {
    return [];
  }
  // get a list of all the directories to copy
  // these paths should be absolute
  const copyTasks = [];
  const cmps = buildCtx.components;
  cmps
    .filter((cmp) => cmp.assetsDirs != null && cmp.assetsDirs.length > 0)
    .forEach((cmp) => {
    if (!collectionsPath) {
      cmp.assetsDirs.forEach((assetsMeta) => {
        copyTasks.push({
          src: assetsMeta.absolutePath,
          dest: join(dest, assetsMeta.cmpRelativePath),
          warn: false,
          keepDirStructure: false,
        });
      });
    }
    else if (!cmp.excludeFromCollection && !cmp.isCollectionDependency) {
      cmp.assetsDirs.forEach((assetsMeta) => {
        const collectionDirDestination = join(dest, relative$1(config.srcDir, assetsMeta.absolutePath));
        copyTasks.push({
          src: assetsMeta.absolutePath,
          dest: collectionDirDestination,
          warn: false,
          keepDirStructure: false,
        });
      });
    }
  });
  buildCtx.debug(`getComponentAssetsCopyTasks: ${copyTasks.length}`);
  return copyTasks;
};
const canSkipAssetsCopy = (compilerCtx, entryModules, filesChanged) => {
  if (!compilerCtx.hasSuccessfulBuild) {
    // always copy assets if we haven't had a successful build yet
    // cannot skip build
    return false;
  }
  // assume we want to skip copying assets again
  let shouldSkipAssetsCopy = true;
  // loop through each of the changed files
  filesChanged.forEach((changedFile) => {
    // get the directory of where the changed file is in
    const changedFileDirPath = normalizePath$2(dirname(changedFile));
    // loop through all the possible asset directories
    entryModules.forEach((entryModule) => {
      entryModule.cmps.forEach((cmp) => {
        if (cmp.assetsDirs != null) {
          // loop through each of the asset directories of each component
          cmp.assetsDirs.forEach((assetsDir) => {
            // get the absolute of the asset directory
            const assetDirPath = normalizePath$2(assetsDir.absolutePath);
            // if the changed file directory is this asset directory
            // then we should recopy everything over again
            if (changedFileDirPath === assetDirPath) {
              shouldSkipAssetsCopy = false;
              return;
            }
          });
        }
      });
    });
  });
  return shouldSkipAssetsCopy;
};

const getSrcAbsPath = (config, src) => {
  if (isAbsolute$1(src)) {
    return src;
  }
  return join(config.srcDir, src);
};
const getDestAbsPath = (src, destAbsPath, destRelPath) => {
  if (destRelPath) {
    if (isAbsolute$1(destRelPath)) {
      return destRelPath;
    }
    else {
      return join(destAbsPath, destRelPath);
    }
  }
  if (isAbsolute$1(src)) {
    throw new Error(`copy task, "dest" property must exist if "src" property is an absolute path: ${src}`);
  }
  return destAbsPath;
};

const outputCopy = async (config, compilerCtx, buildCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetCopy);
  if (outputTargets.length === 0) {
    return;
  }
  const changedFiles = [...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.dirsAdded];
  const copyTasks = [];
  const needsCopyAssets = !canSkipAssetsCopy(compilerCtx, buildCtx.entryModules, buildCtx.filesChanged);
  outputTargets.forEach((o) => {
    if (needsCopyAssets && o.copyAssets) {
      copyTasks.push(...getComponentAssetsCopyTasks(config, buildCtx, o.dir, o.copyAssets === 'collection'));
    }
    copyTasks.push(...getCopyTasks(config, buildCtx, o, changedFiles));
  });
  if (copyTasks.length > 0) {
    const timespan = buildCtx.createTimeSpan(`copy started`);
    let copiedFiles = 0;
    try {
      const copyResults = await config.sys.copy(copyTasks, config.srcDir);
      if (copyResults != null) {
        buildCtx.diagnostics.push(...copyResults.diagnostics);
        compilerCtx.fs.cancelDeleteDirectoriesFromDisk(copyResults.dirPaths);
        compilerCtx.fs.cancelDeleteFilesFromDisk(copyResults.filePaths);
        copiedFiles = copyResults.filePaths.length;
      }
    }
    catch (e) {
      const err = buildError(buildCtx.diagnostics);
      if (e instanceof Error) {
        err.messageText = e.message;
      }
    }
    timespan.finish(`copy finished (${copiedFiles} file${copiedFiles === 1 ? '' : 's'})`);
  }
};
const getCopyTasks = (config, buildCtx, o, changedFiles) => {
  if (!Array.isArray(o.copy)) {
    return [];
  }
  const copyTasks = !buildCtx.isRebuild || buildCtx.requiresFullBuild ? o.copy : filterCopyTasks(config, o.copy, changedFiles);
  return copyTasks.map((t) => transformToAbs(t, o.dir));
};
const filterCopyTasks = (config, tasks, changedFiles) => {
  if (Array.isArray(tasks)) {
    return tasks.filter((copy) => {
      let copySrc = copy.src;
      if (isGlob(copySrc)) {
        // test the glob
        copySrc = join(config.srcDir, copySrc);
        if (changedFiles.some(minimatch_1$1.filter(copySrc))) {
          return true;
        }
      }
      else {
        copySrc = normalizePath$2(getSrcAbsPath(config, copySrc + '/'));
        if (changedFiles.some((f) => f.startsWith(copySrc))) {
          return true;
        }
      }
      return false;
    });
  }
  return [];
};
const transformToAbs = (copyTask, dest) => {
  return {
    src: copyTask.src,
    dest: getDestAbsPath(copyTask.src, dest, copyTask.dest),
    keepDirStructure: typeof copyTask.keepDirStructure === 'boolean' ? copyTask.keepDirStructure : copyTask.dest == null,
    warn: copyTask.warn !== false,
  };
};

/**
 * Decorators on class declarations that we remove as part of the compilation
 * process
 */
const CLASS_DECORATORS_TO_REMOVE = ['Component'];
/**
 * Decorators on class members that we remove as part of the compilation
 * process
 */
const MEMBER_DECORATORS_TO_REMOVE = ['Element', 'Event', 'Listen', 'Method', 'Prop', 'State', 'Watch'];
/**
 * Decorators whose 'decorees' we need to rewrite during compilation from
 * class fields to instead initialize them in a constructor.
 */
const CONSTRUCTOR_DEFINED_MEMBER_DECORATORS = ['State', 'Prop'];

/**
 * Determine if a class member is private or not
 * @param member the class member to evaluate
 * @returns `true` if the member has the `private` or `protected` modifier attached to it. `false` otherwise
 */
const isMemberPrivate = (member) => {
  var _a;
  return !!((_a = retrieveTsModifiers(member)) === null || _a === void 0 ? void 0 : _a.some((m) => m.kind === t.SyntaxKind.PrivateKeyword || m.kind === t.SyntaxKind.ProtectedKeyword));
};
/**
 * Convert a JavaScript value to the TypeScript Intermediate Representation
 * (IR) for a literal Abstract Syntax Tree (AST) node with that same value. The
 * value to convert may be a primitive type like `string`, `boolean`, etc or
 * may be an `Object`, `Array`, etc.
 *
 * Note that this function takes a param (`refs`) with a default value,
 * normally a value should _not_ be passed for this parameter since it is
 * intended to be used for recursive calls.
 *
 * @param val the value to convert
 * @param refs a set of references, used in recursive calls to avoid
 * circular references when creating object literal IR instances. **note that
 * you shouldn't pass this parameter unless you know what you're doing!**
 * @returns TypeScript IR for a literal corresponding to the JavaScript value
 * with which the function was called
 */
const convertValueToLiteral = (val, refs = null) => {
  if (refs == null) {
    refs = new WeakSet();
  }
  if (val === String) {
    return t.factory.createIdentifier('String');
  }
  if (val === Number) {
    return t.factory.createIdentifier('Number');
  }
  if (val === Boolean) {
    return t.factory.createIdentifier('Boolean');
  }
  if (val === undefined) {
    return t.factory.createIdentifier('undefined');
  }
  if (val === null) {
    return t.factory.createIdentifier('null');
  }
  if (Array.isArray(val)) {
    return arrayToArrayLiteral(val, refs);
  }
  if (typeof val === 'object') {
    if (val.__identifier && val.__escapedText) {
      return t.factory.createIdentifier(val.__escapedText);
    }
    return objectToObjectLiteral(val, refs);
  }
  // the remainder of the implementation of this function was derived from the deprecated `createLiteral` function
  // found in typescript@4.8.4
  if (typeof val === 'number') {
    return t.factory.createNumericLiteral(val);
  }
  if (typeof val === 'object' && 'base10Value' in val) {
    return t.factory.createBigIntLiteral(val);
  }
  if (typeof val === 'boolean') {
    return val ? t.factory.createTrue() : t.factory.createFalse();
  }
  if (typeof val === 'string') {
    return t.factory.createStringLiteral(val, undefined);
  }
  return t.factory.createStringLiteralFromNode(val);
};
/**
 * Convert a JavaScript Array instance to TypeScript's Intermediate
 * Representation (IR) for an array literal. This is done by recursively using
 * {@link convertValueToLiteral} to create a new array consisting of the
 * TypeScript IR of each element in the array to be converted, and then creating
 * the TypeScript IR for _that_ array.
 *
 * @param list the array instance to convert
 * @param refs a set of references to objects, used when converting objects to
 * avoid circular references
 * @returns TypeScript IR for the array we want to convert
 */
const arrayToArrayLiteral = (list, refs) => {
  const newList = list.map((l) => {
    return convertValueToLiteral(l, refs);
  });
  return t.factory.createArrayLiteralExpression(newList);
};
/**
 * Convert a JavaScript object (i.e. an object existing at runtime) to the
 * corresponding TypeScript Intermediate Representation (IR)
 * ({@see ts.ObjectLiteralExpression}) for an object literal. This function
 * takes an argument holding a `WeakSet` of references to objects which is
 * used to avoid circular references. Objects that are converted in this
 * function are added to the set, and if an object is already present then an
 * `undefined` literal (in TypeScript IR) is returned instead of another
 * object literal, as continuing to convert a circular reference would, well,
 * never end!
 *
 * @param obj the JavaScript object to convert to TypeScript IR
 * @param refs a set of references to objects, used to avoid circular references
 * @returns a TypeScript object literal expression
 */
const objectToObjectLiteral = (obj, refs) => {
  if (refs.has(obj)) {
    return t.factory.createIdentifier('undefined');
  }
  refs.add(obj);
  const newProperties = Object.keys(obj).map((key) => {
    const prop = t.factory.createPropertyAssignment(t.factory.createStringLiteral(key), convertValueToLiteral(obj[key], refs));
    return prop;
  });
  return t.factory.createObjectLiteralExpression(newProperties, true);
};
/**
 * Create a TypeScript getter declaration AST node corresponding to a
 * supplied prop name and return value
 *
 * @param propName the name of the prop to access
 * @param returnExpression a TypeScript AST node to return from the getter
 * @returns an AST node representing a getter
 */
const createStaticGetter = (propName, returnExpression) => {
  return t.factory.createGetAccessorDeclaration([t.factory.createToken(t.SyntaxKind.StaticKeyword)], propName, [], undefined, t.factory.createBlock([t.factory.createReturnStatement(returnExpression)]));
};
const getStaticValue = (staticMembers, staticName) => {
  const staticMember = staticMembers.find((member) => member.name.escapedText === staticName);
  if (!staticMember || !staticMember.body || !staticMember.body.statements) {
    return null;
  }
  const rtnStatement = staticMember.body.statements.find((s) => s.kind === t.SyntaxKind.ReturnStatement);
  if (!rtnStatement || !rtnStatement.expression) {
    return null;
  }
  const expKind = rtnStatement.expression.kind;
  if (expKind === t.SyntaxKind.StringLiteral) {
    return rtnStatement.expression.text;
  }
  if (expKind === t.SyntaxKind.NoSubstitutionTemplateLiteral) {
    return rtnStatement.expression.text;
  }
  if (expKind === t.SyntaxKind.TrueKeyword) {
    return true;
  }
  if (expKind === t.SyntaxKind.FalseKeyword) {
    return false;
  }
  if (expKind === t.SyntaxKind.ObjectLiteralExpression) {
    return objectLiteralToObjectMap(rtnStatement.expression);
  }
  if (expKind === t.SyntaxKind.ArrayLiteralExpression &&
    rtnStatement.expression.elements) {
    return arrayLiteralToArray(rtnStatement.expression);
  }
  if (expKind === t.SyntaxKind.Identifier) {
    const identifier = rtnStatement.expression;
    if (typeof identifier.escapedText === 'string') {
      return getIdentifierValue(identifier.escapedText);
    }
    if (identifier.escapedText) {
      const obj = {};
      Object.keys(identifier.escapedText).forEach((key) => {
        obj[key] = getIdentifierValue(identifier.escapedText[key]);
      });
      return obj;
    }
  }
  return null;
};
const arrayLiteralToArray = (arr) => {
  return arr.elements.map((element) => {
    let val;
    switch (element.kind) {
      case t.SyntaxKind.ObjectLiteralExpression:
        val = objectLiteralToObjectMap(element);
        break;
      case t.SyntaxKind.StringLiteral:
        val = element.text;
        break;
      case t.SyntaxKind.TrueKeyword:
        val = true;
        break;
      case t.SyntaxKind.FalseKeyword:
        val = false;
        break;
      case t.SyntaxKind.Identifier:
        const escapedText = element.escapedText;
        if (escapedText === 'String') {
          val = String;
        }
        else if (escapedText === 'Number') {
          val = Number;
        }
        else if (escapedText === 'Boolean') {
          val = Boolean;
        }
        break;
      case t.SyntaxKind.PropertyAccessExpression:
      default:
        val = element;
    }
    return val;
  });
};
const objectLiteralToObjectMap = (objectLiteral) => {
  const properties = objectLiteral.properties;
  const final = {};
  for (const propAssignment of properties) {
    const propName = getTextOfPropertyName(propAssignment.name);
    let val;
    if (t.isShorthandPropertyAssignment(propAssignment)) {
      val = getIdentifierValue(propName);
    }
    else if (t.isPropertyAssignment(propAssignment)) {
      switch (propAssignment.initializer.kind) {
        case t.SyntaxKind.ArrayLiteralExpression:
          val = arrayLiteralToArray(propAssignment.initializer);
          break;
        case t.SyntaxKind.ObjectLiteralExpression:
          val = objectLiteralToObjectMap(propAssignment.initializer);
          break;
        case t.SyntaxKind.StringLiteral:
          val = propAssignment.initializer.text;
          break;
        case t.SyntaxKind.NoSubstitutionTemplateLiteral:
          val = propAssignment.initializer.text;
          break;
        case t.SyntaxKind.TrueKeyword:
          val = true;
          break;
        case t.SyntaxKind.FalseKeyword:
          val = false;
          break;
        case t.SyntaxKind.Identifier:
          const escapedText = propAssignment.initializer.escapedText;
          if (escapedText === 'String') {
            val = String;
          }
          else if (escapedText === 'Number') {
            val = Number;
          }
          else if (escapedText === 'Boolean') {
            val = Boolean;
          }
          else if (escapedText === 'undefined') {
            val = undefined;
          }
          else if (escapedText === 'null') {
            val = null;
          }
          else {
            val = getIdentifierValue(propAssignment.initializer.escapedText);
          }
          break;
        case t.SyntaxKind.PropertyAccessExpression:
        default:
          val = propAssignment.initializer;
      }
    }
    final[propName] = val;
  }
  return final;
};
const getIdentifierValue = (escapedText) => {
  const identifier = {
    __identifier: true,
    __escapedText: escapedText,
  };
  return identifier;
};
const getTextOfPropertyName = (propName) => {
  switch (propName.kind) {
    case t.SyntaxKind.Identifier:
      return propName.text;
    case t.SyntaxKind.StringLiteral:
    case t.SyntaxKind.NumericLiteral:
      return propName.text;
    case t.SyntaxKind.ComputedPropertyName:
      const expression = propName.expression;
      if (t.isStringLiteral(expression) || t.isNumericLiteral(expression)) {
        return propName.expression.text;
      }
  }
  return undefined;
};
/**
 * Generate a series of type references for a given AST node
 * @param baseNode the AST node to pull type references from
 * @param sourceFile the source file in which the provided `baseNode` exists
 * @returns the generated series of type references
 */
const getAttributeTypeInfo = (baseNode, sourceFile) => {
  const allReferences = {};
  getAllTypeReferences(baseNode).forEach((typeName) => {
    allReferences[typeName] = getTypeReferenceLocation(typeName, sourceFile);
  });
  return allReferences;
};
/**
 * Get the text-based name from a TypeScript `EntityName`, which is an identifier of some form
 * @param entity a TypeScript `EntityName` to retrieve the name of an entity from
 * @returns the entity's name
 */
const getEntityName = (entity) => {
  if (t.isIdentifier(entity)) {
    return entity.escapedText.toString();
  }
  else {
    // We have qualified name - e.g. const x: Foo.Bar.Baz;
    // Recurse until we find the 'base' of the qualified name
    return getEntityName(entity.left);
  }
};
/**
 * Recursively walks the provided AST to collect all TypeScript type references that are found
 * @param node the node to walk to retrieve type information
 * @returns the collected type references
 */
const getAllTypeReferences = (node) => {
  const referencedTypes = [];
  const visit = (node) => {
    /**
     * A type reference node will refer to some type T.
     * e.g: In `const foo: Bar = {...}` the reference node will contain semantic information about `Bar`.
     * In TypeScript, types that are also keywords (e.g. `number` in `const foo: number`) are not `TypeReferenceNode`s.
     */
    if (t.isTypeReferenceNode(node)) {
      referencedTypes.push(getEntityName(node.typeName));
      if (node.typeArguments) {
        // a type may contain types itself (e.g. generics - Foo<Bar>)
        node.typeArguments
          .filter((typeArg) => t.isTypeReferenceNode(typeArg))
          .forEach((typeRef) => {
          const typeName = typeRef.typeName;
          if (typeName && typeName.escapedText) {
            referencedTypes.push(typeName.escapedText.toString());
          }
        });
      }
    }
    return t.forEachChild(node, visit);
  };
  visit(node);
  return referencedTypes;
};
const validateReferences = (diagnostics, references, node) => {
  Object.keys(references).forEach((refName) => {
    const ref = references[refName];
    if (ref.path === '@stencil/core' && readOnlyArrayHasStringMember(MEMBER_DECORATORS_TO_REMOVE, refName)) {
      const err = buildError(diagnostics);
      augmentDiagnosticWithNode(err, node);
    }
  });
};
/**
 * Determine where a TypeScript type reference originates from. This is accomplished by interrogating the AST node in
 * which the type's name appears
 *
 * A type may originate:
 * - from the same file where it is used (a type is declared in some file, `foo.ts`, and later used in the same file)
 * - from another file (I.E. it is imported and should have an import statement somewhere in the file)
 * - from a global context
 * - etc.
 *
 * The type may be declared using the `type` or `interface` keywords.
 *
 * @param typeName the name of the type to find the origination of
 * @param tsNode the TypeScript AST node being searched for the provided `typeName`
 * @returns the context stating where the type originates from
 */
const getTypeReferenceLocation = (typeName, tsNode) => {
  const sourceFileObj = tsNode.getSourceFile();
  // Loop through all top level imports to find any reference to the type for 'import' reference location
  const importTypeDeclaration = sourceFileObj.statements.find((st) => {
    const statement = t.isImportDeclaration(st) &&
      st.importClause &&
      t.isImportClause(st.importClause) &&
      st.importClause.namedBindings &&
      t.isNamedImports(st.importClause.namedBindings) &&
      Array.isArray(st.importClause.namedBindings.elements) &&
      st.importClause.namedBindings.elements.find((nbe) => nbe.name.getText() === typeName);
    if (!statement) {
      return false;
    }
    return true;
  });
  if (importTypeDeclaration) {
    const localImportPath = importTypeDeclaration.moduleSpecifier.text;
    return {
      location: 'import',
      path: localImportPath,
    };
  }
  // Loop through all top level exports to find if any reference to the type for 'local' reference location
  const isExported = sourceFileObj.statements.some((st) => {
    const statementModifiers = retrieveTsModifiers(st);
    // Is the interface defined in the file and exported
    const isInterfaceDeclarationExported = t.isInterfaceDeclaration(st) &&
      st.name.getText() === typeName &&
      Array.isArray(statementModifiers) &&
      statementModifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
    const isTypeAliasDeclarationExported = t.isTypeAliasDeclaration(st) &&
      st.name.getText() === typeName &&
      Array.isArray(statementModifiers) &&
      statementModifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
    // Is the interface exported through a named export
    const isTypeInExportDeclaration = t.isExportDeclaration(st) &&
      t.isNamedExports(st.exportClause) &&
      st.exportClause.elements.some((nee) => nee.name.getText() === typeName);
    return isInterfaceDeclarationExported || isTypeAliasDeclarationExported || isTypeInExportDeclaration;
  });
  if (isExported) {
    return {
      location: 'local',
    };
  }
  // This is most likely a global type, if it is a local that is not exported then typescript will inform the dev
  return {
    location: 'global',
  };
};
const resolveType = (checker, type) => {
  const set = new Set();
  parseDocsType(checker, type, set);
  // normalize booleans
  const hasTrue = set.delete('true');
  const hasFalse = set.delete('false');
  if (hasTrue || hasFalse) {
    set.add('boolean');
  }
  let parts = Array.from(set.keys()).sort();
  // TODO(STENCIL-366): Get this section of code under tests that directly exercises this behavior
  if (parts.length > 1) {
    parts = parts.map((p) => (p.indexOf('=>') >= 0 ? `(${p})` : p));
  }
  if (parts.length > 20) {
    return typeToString(checker, type);
  }
  else {
    return parts.join(' | ');
  }
};
/**
 * Formats a TypeScript `Type` entity as a string
 * @param checker a reference to the TypeScript type checker
 * @param type a TypeScript `Type` entity to format
 * @returns the formatted string
 */
const typeToString = (checker, type) => {
  const TYPE_FORMAT_FLAGS = t.TypeFormatFlags.NoTruncation | t.TypeFormatFlags.InTypeAlias | t.TypeFormatFlags.InElementType;
  return checker.typeToString(type, undefined, TYPE_FORMAT_FLAGS);
};
const parseDocsType = (checker, type, parts) => {
  if (type.isUnion()) {
    type.types.forEach((t) => {
      parseDocsType(checker, t, parts);
    });
  }
  else {
    const text = typeToString(checker, type);
    parts.add(text);
  }
};
const getModuleFromSourceFile = (compilerCtx, tsSourceFile) => {
  const sourceFilePath = normalizePath$2(tsSourceFile.fileName);
  const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
  if (moduleFile != null) {
    return moduleFile;
  }
  const moduleFiles = Array.from(compilerCtx.moduleMap.values());
  return moduleFiles.find((m) => m.jsFilePath === sourceFilePath);
};
const getComponentMeta = (compilerCtx, tsSourceFile, node) => {
  const meta = compilerCtx.nodeMap.get(node);
  if (meta) {
    return meta;
  }
  const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  if (moduleFile != null && node.members != null) {
    const staticMembers = node.members.filter(isStaticGetter);
    const tagName = getComponentTagName(staticMembers);
    if (typeof tagName === 'string') {
      return moduleFile.cmps.find((cmp) => cmp.tagName === tagName);
    }
  }
  return undefined;
};
const getComponentTagName = (staticMembers) => {
  if (staticMembers.length > 0) {
    const tagName = getStaticValue(staticMembers, 'is');
    if (typeof tagName === 'string' && tagName.includes('-')) {
      return tagName;
    }
  }
  return null;
};
const isStaticGetter = (member) => {
  var _a;
  const modifiers = retrieveTsModifiers(member);
  return ((_a = (member.kind === t.SyntaxKind.GetAccessor &&
    Array.isArray(modifiers) &&
    modifiers.some(({ kind }) => kind === t.SyntaxKind.StaticKeyword))) !== null && _a !== void 0 ? _a : false);
};
/**
 * Create a serialized representation of a TypeScript `Symbol` entity to expose the Symbol's text and attached JSDoc.
 * Note that the `Symbol` being serialized is not the same as the JavaScript primitive 'symbol'.
 * @param checker a reference to the TypeScript type checker
 * @param symbol the `Symbol` to serialize
 * @returns the serialized `Symbol` data
 */
const serializeSymbol = (checker, symbol) => {
  if (!checker || !symbol) {
    return {
      tags: [],
      text: '',
    };
  }
  return {
    tags: mapJSDocTagInfo(symbol.getJsDocTags()),
    text: t.displayPartsToString(symbol.getDocumentationComment(checker)),
  };
};
/**
 * Maps a TypeScript 4.3+ JSDocTagInfo to a flattened Stencil CompilerJsDocTagInfo.
 * @param tags A readonly array of JSDocTagInfo objects.
 * @returns An array of CompilerJsDocTagInfo objects.
 */
const mapJSDocTagInfo = (tags) => {
  // The text following a tag is split semantically by TS 4.3+, e.g. '@param foo the first parameter' ->
  // [{text: 'foo', kind: 'parameterName'}, {text: ' ', kind: 'space'}, {text: 'the first parameter', kind: 'text'}], so
  // we join the elements to reconstruct the text.
  return tags.map((tag) => { var _a; return ({ ...tag, text: (_a = tag.text) === null || _a === void 0 ? void 0 : _a.map((part) => part.text).join('') }); });
};
const isInternal = (jsDocs) => {
  return jsDocs && jsDocs.tags.some((s) => s.name === 'internal');
};
const isMethod = (member, methodName) => {
  return t.isMethodDeclaration(member) && member.name && member.name.escapedText === methodName;
};
const createImportStatement = (importFnNames, importPath) => {
  // ESM Imports
  // import { importNames } from 'importPath';
  const importSpecifiers = importFnNames.map((importKey) => {
    const splt = importKey.split(' as ');
    let importAs = importKey;
    let importFnName = importKey;
    if (splt.length > 1) {
      importAs = splt[1];
      importFnName = splt[0];
    }
    return t.factory.createImportSpecifier(false, typeof importFnName === 'string' && importFnName !== importAs
      ? t.factory.createIdentifier(importFnName)
      : undefined, t.factory.createIdentifier(importAs));
  });
  return t.factory.createImportDeclaration(undefined, t.factory.createImportClause(false, undefined, t.factory.createNamedImports(importSpecifiers)), t.factory.createStringLiteral(importPath));
};
const createRequireStatement = (importFnNames, importPath) => {
  // CommonJS require()
  // const { a, b, c } = require(importPath);
  const importBinding = t.factory.createObjectBindingPattern(importFnNames.map((importKey) => {
    const splt = importKey.split(' as ');
    let importAs = importKey;
    let importFnName = importKey;
    if (splt.length > 1) {
      importAs = splt[1];
      importFnName = splt[0];
    }
    return t.factory.createBindingElement(undefined, importFnName, importAs);
  }));
  return t.factory.createVariableStatement(undefined, t.factory.createVariableDeclarationList([
    t.factory.createVariableDeclaration(importBinding, undefined, undefined, t.factory.createCallExpression(t.factory.createIdentifier('require'), [], [t.factory.createStringLiteral(importPath)])),
  ], t.NodeFlags.Const));
};
/**
 * Helper method for retrieving all decorators & modifiers from a TypeScript {@link ts.Node} entity.
 *
 * Starting with TypeScript v4.8, decorators and modifiers have been coalesced into a single field, and retrieving
 * decorators directly has been deprecated. This helper function pulls all decorators & modifiers out of said field.
 *
 * @see {@link https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#decorators-are-placed-on-modifiers-on-typescripts-syntax-trees|The TypeScript 4.8 Announcement}
 *
 * @param node the node to pull decorators & modifiers out of
 * @returns a list containing decorators & modifiers on the node
 */
const retrieveModifierLike = (node) => {
  var _a, _b;
  return [...((_a = retrieveTsDecorators(node)) !== null && _a !== void 0 ? _a : []), ...((_b = retrieveTsModifiers(node)) !== null && _b !== void 0 ? _b : [])];
};
/**
 * Helper method for retrieving decorators from a TypeScript {@link ts.Node} entity.
 *
 * Starting with TypeScript v4.8, decorators and modifiers have been coalesced into a single field, and retrieving
 * decorators directly has been deprecated. This helper function is a utility that wraps various helper functions that
 * the TypeScript compiler exposes for pulling decorators out of said field.
 *
 * @see {@link https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#decorators-are-placed-on-modifiers-on-typescripts-syntax-trees|The TypeScript 4.8 Announcement}
 *
 * @param node the node to pull decorators out of
 * @returns a list containing 1+ decorators on the node, otherwise undefined
 */
const retrieveTsDecorators = (node) => {
  return t.canHaveDecorators(node) ? t.getDecorators(node) : undefined;
};
/**
 * Helper method for retrieving modifiers from a TypeScript {@link ts.Node} entity.
 *
 * Starting with TypeScript v4.8, decorators and modifiers have been coalesced into a single field, and retrieving
 * modifiers directly has been deprecated. This helper function is a utility that wraps various helper functions that
 * the TypeScript compiler exposes for pulling modifiers out of said field.
 *
 * @see {@link https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#decorators-are-placed-on-modifiers-on-typescripts-syntax-trees|The TypeScript 4.8 Announcement}
 *
 * @param node the node to pull modifiers out of
 * @returns a list containing 1+ modifiers on the node, otherwise undefined
 */
const retrieveTsModifiers = (node) => {
  return t.canHaveModifiers(node) ? t.getModifiers(node) : undefined;
};

/**
 * This method is responsible for replacing user-defined import path aliases ({@link https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping})
 * with generated relative import paths during the transformation step of the TS compilation process.
 * This action is taken to prevent issues with import paths not being transpiled at build time resulting in
 * unknown imports in output code for some output targets (`dist-collection` for instance). Output targets that do not run through a bundler
 * are unable to resolve imports using the aliased path names and TS intentionally does not replace resolved paths as a part of
 * their compiler ({@link https://github.com/microsoft/TypeScript/issues/10866})
 *
 * @param config The Stencil configuration object.
 * @param destinationFilePath The location on disk the file will be written to.
 * @param outputTarget The configuration for the collection output target.
 * @returns A factory for creating a {@link ts.Transformer}.
 */
const mapImportsToPathAliases = (config, destinationFilePath, outputTarget) => {
  return (transformCtx) => {
    const compilerHost = t.createCompilerHost(config.tsCompilerOptions);
    const visit = (sourceFile) => (node) => {
      var _a, _b;
      // Only transform paths when the `transformAliasedImportPaths` flag is
      // set on the output target config
      //
      // We should only attempt to transform standard module imports:
      // - import * as ts from 'typescript';
      // - import { Foo, Bar } from 'baz';
      // - import { Foo as Bar } from 'baz';
      // - import Foo from 'bar';
      // We should NOT transform other import declaration types:
      // - import a = Foo.Bar
      if (outputTarget.transformAliasedImportPaths &&
        t.isImportDeclaration(node) &&
        t.isStringLiteral(node.moduleSpecifier)) {
        let importPath = node.moduleSpecifier.text;
        // We will ignore transforming any paths that are already relative paths or
        // imports from external modules/packages
        if (!importPath.startsWith('.')) {
          const module = t.resolveModuleName(importPath, sourceFile, config.tsCompilerOptions, compilerHost);
          const hasResolvedFileName = ((_a = module.resolvedModule) === null || _a === void 0 ? void 0 : _a.resolvedFileName) != null;
          const isModuleFromNodeModules = ((_b = module.resolvedModule) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport) === true;
          const shouldTranspileImportPath = hasResolvedFileName && !isModuleFromNodeModules;
          if (shouldTranspileImportPath) {
            // Create a regular expression that will be used to remove the last file extension
            // from the import path
            const extensionRegex = new RegExp(Object.values(t.Extension)
              .map((extension) => `${extension}$`)
              .join('|'));
            // In order to make sure the relative path works when the destination depth is different than the source
            // file structure depth, we need to determine where the resolved file exists relative to the destination directory
            const resolvePathInDestination = module.resolvedModule.resolvedFileName.replace(config.srcDir, outputTarget.collectionDir);
            importPath = normalizePath$2(relative$1(dirname(destinationFilePath), resolvePathInDestination).replace(extensionRegex, ''));
          }
        }
        return transformCtx.factory.updateImportDeclaration(node, retrieveTsModifiers(node), node.importClause, transformCtx.factory.createStringLiteral(importPath), node.assertClause);
      }
      return t.visitEachChild(node, visit(sourceFile), transformCtx);
    };
    return (tsSourceFile) => {
      return t.visitEachChild(tsSourceFile, visit(tsSourceFile.fileName), transformCtx);
    };
  };
};

/**
 * Main output target function for `dist-collection`. This function takes the compiled output from a
 * {@link ts.Program}, runs each file through a transformer to transpile import path aliases, and then writes
 * the output code and source maps to disk in the specified collection directory.
 *
 * @param config The validated Stencil config.
 * @param compilerCtx The current compiler context.
 * @param buildCtx The current build context.
 * @param changedModuleFiles The changed modules returned from the TS compiler.
 * @returns An empty promise. Resolved once all functions finish.
 */
const outputCollection = async (config, compilerCtx, buildCtx, changedModuleFiles) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
  if (outputTargets.length === 0) {
    return;
  }
  const bundlingEventMessage = `generate collections${config.sourceMap ? ' + source maps' : ''}`;
  const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`, true);
  try {
    await Promise.all(changedModuleFiles.map(async (mod) => {
      let code = mod.staticSourceFileText;
      if (config.preamble) {
        code = `${generatePreamble(config)}\n${code}`;
      }
      const mapCode = mod.sourceMapFileText;
      await Promise.all(outputTargets.map(async (target) => {
        const relPath = relative$1(config.srcDir, mod.jsFilePath);
        const filePath = join(target.collectionDir, relPath);
        // Transpile the already transpiled modules to apply
        // a transformer to convert aliased import paths to relative paths
        // We run this even if the transformer will perform no action
        // to avoid race conditions between multiple output targets that
        // may be writing to the same location
        const { outputText } = t.transpileModule(code, {
          fileName: mod.sourceFilePath,
          compilerOptions: {
            target: t.ScriptTarget.Latest,
          },
          transformers: {
            after: [mapImportsToPathAliases(config, filePath, target)],
          },
        });
        await compilerCtx.fs.writeFile(filePath, outputText, { outputTargetType: target.type });
        if (mod.sourceMapPath) {
          const relativeSourceMapPath = relative$1(config.srcDir, mod.sourceMapPath);
          const sourceMapOutputFilePath = join(target.collectionDir, relativeSourceMapPath);
          await compilerCtx.fs.writeFile(sourceMapOutputFilePath, mapCode, { outputTargetType: target.type });
        }
      }));
    }));
    await writeCollectionManifests(config, compilerCtx, buildCtx, outputTargets);
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
  timespan.finish(`${bundlingEventMessage} finished`);
};
const writeCollectionManifests = async (config, compilerCtx, buildCtx, outputTargets) => {
  const collectionData = JSON.stringify(serializeCollectionManifest(config, compilerCtx, buildCtx), null, 2);
  return Promise.all(outputTargets.map((o) => writeCollectionManifest(compilerCtx, collectionData, o)));
};
// this maps the json data to our internal data structure
// mapping is so that the internal data structure "could"
// change, but the external user data will always use the same api
// over the top lame mapping functions is basically so we can loosely
// couple core component meta data between specific versions of the compiler
const writeCollectionManifest = async (compilerCtx, collectionData, outputTarget) => {
  // get the absolute path to the directory where the collection will be saved
  const collectionDir = normalizePath$2(outputTarget.collectionDir);
  // create an absolute file path to the actual collection json file
  const collectionFilePath = normalizePath$2(join(collectionDir, COLLECTION_MANIFEST_FILE_NAME));
  // don't bother serializing/writing the collection if we're not creating a distribution
  await compilerCtx.fs.writeFile(collectionFilePath, collectionData);
};
const serializeCollectionManifest = (config, compilerCtx, buildCtx) => {
  // create the single collection we're going to fill up with data
  const collectionManifest = {
    entries: buildCtx.moduleFiles
      .filter((mod) => !mod.isCollectionDependency && mod.cmps.length > 0)
      .map((mod) => relative$1(config.srcDir, mod.jsFilePath)),
    compiler: {
      name: '@stencil/core',
      version: version$3,
      typescriptVersion,
    },
    collections: serializeCollectionDependencies(compilerCtx),
    bundles: config.bundles.map((b) => ({
      components: b.components.slice().sort(),
    })),
  };
  if (config.globalScript) {
    const mod = compilerCtx.moduleMap.get(normalizePath$2(config.globalScript));
    if (mod) {
      collectionManifest.global = relative$1(config.srcDir, mod.jsFilePath);
    }
  }
  return collectionManifest;
};
const serializeCollectionDependencies = (compilerCtx) => {
  const collectionDeps = compilerCtx.collections.map((c) => ({
    name: c.collectionName,
    tags: flatOne(c.moduleFiles.map((m) => m.cmps))
      .map((cmp) => cmp.tagName)
      .sort(),
  }));
  return sortBy(collectionDeps, (item) => item.name);
};

/**
 * Node builtin modules as of v14.5.0
 */
const NODE_BUILTINS = [
  '_http_agent',
  '_http_client',
  '_http_common',
  '_http_incoming',
  '_http_outgoing',
  '_http_server',
  '_stream_duplex',
  '_stream_passthrough',
  '_stream_readable',
  '_stream_transform',
  '_stream_wrap',
  '_stream_writable',
  '_tls_common',
  '_tls_wrap',
  'assert',
  'async_hooks',
  'buffer',
  'child_process',
  'cluster',
  'console',
  'constants',
  'crypto',
  'dgram',
  'dns',
  'domain',
  'events',
  'fs',
  'fs/promises',
  'http',
  'http2',
  'https',
  'inspector',
  'module',
  'net',
  'os',
  'path',
  'perf_hooks',
  'process',
  'punycode',
  'querystring',
  'readline',
  'repl',
  'stream',
  'string_decoder',
  'sys',
  'timers',
  'tls',
  'trace_events',
  'tty',
  'url',
  'util',
  'v8',
  'vm',
  'worker_threads',
  'zlib',
];
class Module$1 {
  static get builtinModules() {
    return NODE_BUILTINS;
  }
}

// Rollup 2.42.3

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

function createCommonjsModule(fn, basedir, module) {
	return module = {
		path: basedir,
		exports: {},
		require: function (path, base) {
			return commonjsRequire();
		}
	}, fn(module, module.exports), module.exports;
}

function commonjsRequire () {
	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
}

const WIN_SLASH = '\\\\/';
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;

/**
 * Posix glob regex
 */

const DOT_LITERAL = '\\.';
const PLUS_LITERAL = '\\+';
const QMARK_LITERAL = '\\?';
const SLASH_LITERAL = '\\/';
const ONE_CHAR = '(?=.)';
const QMARK = '[^/]';
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
const NO_DOT = `(?!${DOT_LITERAL})`;
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
const STAR = `${QMARK}*?`;

const POSIX_CHARS = {
  DOT_LITERAL,
  PLUS_LITERAL,
  QMARK_LITERAL,
  SLASH_LITERAL,
  ONE_CHAR,
  QMARK,
  END_ANCHOR,
  DOTS_SLASH,
  NO_DOT,
  NO_DOTS,
  NO_DOT_SLASH,
  NO_DOTS_SLASH,
  QMARK_NO_DOT,
  STAR,
  START_ANCHOR
};

/**
 * Windows glob regex
 */

const WINDOWS_CHARS = {
  ...POSIX_CHARS,

  SLASH_LITERAL: `[${WIN_SLASH}]`,
  QMARK: WIN_NO_SLASH,
  STAR: `${WIN_NO_SLASH}*?`,
  DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  NO_DOT: `(?!${DOT_LITERAL})`,
  NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
};

/**
 * POSIX Bracket Regex
 */

const POSIX_REGEX_SOURCE$1 = {
  alnum: 'a-zA-Z0-9',
  alpha: 'a-zA-Z',
  ascii: '\\x00-\\x7F',
  blank: ' \\t',
  cntrl: '\\x00-\\x1F\\x7F',
  digit: '0-9',
  graph: '\\x21-\\x7E',
  lower: 'a-z',
  print: '\\x20-\\x7E ',
  punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
  space: ' \\t\\r\\n\\v\\f',
  upper: 'A-Z',
  word: 'A-Za-z0-9_',
  xdigit: 'A-Fa-f0-9'
};

var constants = {
  MAX_LENGTH: 1024 * 64,
  POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,

  // regular expressions
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,

  // Replace globs with equivalent patterns to reduce parsing time.
  REPLACEMENTS: {
  '***': '*',
  '**/**': '**',
  '**/**/**': '**'
  },

  // Digits
  CHAR_0: 48, /* 0 */
  CHAR_9: 57, /* 9 */

  // Alphabet chars.
  CHAR_UPPERCASE_A: 65, /* A */
  CHAR_LOWERCASE_A: 97, /* a */
  CHAR_UPPERCASE_Z: 90, /* Z */
  CHAR_LOWERCASE_Z: 122, /* z */

  CHAR_LEFT_PARENTHESES: 40, /* ( */
  CHAR_RIGHT_PARENTHESES: 41, /* ) */

  CHAR_ASTERISK: 42, /* * */

  // Non-alphabetic chars.
  CHAR_AMPERSAND: 38, /* & */
  CHAR_AT: 64, /* @ */
  CHAR_BACKWARD_SLASH: 92, /* \ */
  CHAR_CARRIAGE_RETURN: 13, /* \r */
  CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
  CHAR_COLON: 58, /* : */
  CHAR_COMMA: 44, /* , */
  CHAR_DOT: 46, /* . */
  CHAR_DOUBLE_QUOTE: 34, /* " */
  CHAR_EQUAL: 61, /* = */
  CHAR_EXCLAMATION_MARK: 33, /* ! */
  CHAR_FORM_FEED: 12, /* \f */
  CHAR_FORWARD_SLASH: 47, /* / */
  CHAR_GRAVE_ACCENT: 96, /* ` */
  CHAR_HASH: 35, /* # */
  CHAR_HYPHEN_MINUS: 45, /* - */
  CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
  CHAR_LEFT_CURLY_BRACE: 123, /* { */
  CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
  CHAR_LINE_FEED: 10, /* \n */
  CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
  CHAR_PERCENT: 37, /* % */
  CHAR_PLUS: 43, /* + */
  CHAR_QUESTION_MARK: 63, /* ? */
  CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
  CHAR_RIGHT_CURLY_BRACE: 125, /* } */
  CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
  CHAR_SEMICOLON: 59, /* ; */
  CHAR_SINGLE_QUOTE: 39, /* ' */
  CHAR_SPACE: 32, /*   */
  CHAR_TAB: 9, /* \t */
  CHAR_UNDERSCORE: 95, /* _ */
  CHAR_VERTICAL_LINE: 124, /* | */
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */

  SEP: path$5.sep,

  /**
   * Create EXTGLOB_CHARS
   */

  extglobChars(chars) {
  return {
    '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
    '?': { type: 'qmark', open: '(?:', close: ')?' },
    '+': { type: 'plus', open: '(?:', close: ')+' },
    '*': { type: 'star', open: '(?:', close: ')*' },
    '@': { type: 'at', open: '(?:', close: ')' }
  };
  },

  /**
   * Create GLOB_CHARS
   */

  globChars(win32) {
  return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  }
};

var utils$1 = createCommonjsModule(function (module, exports) {


const win32 = process.platform === 'win32';
const {
  REGEX_BACKSLASH,
  REGEX_REMOVE_BACKSLASH,
  REGEX_SPECIAL_CHARS,
  REGEX_SPECIAL_CHARS_GLOBAL
} = constants;

exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');

exports.removeBackslashes = str => {
  return str.replace(REGEX_REMOVE_BACKSLASH, match => {
  return match === '\\' ? '' : match;
  });
};

exports.supportsLookbehinds = () => {
  const segs = process.version.slice(1).split('.').map(Number);
  if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
  return true;
  }
  return false;
};

exports.isWindows = options => {
  if (options && typeof options.windows === 'boolean') {
  return options.windows;
  }
  return win32 === true || path$5.sep === '\\';
};

exports.escapeLast = (input, char, lastIdx) => {
  const idx = input.lastIndexOf(char, lastIdx);
  if (idx === -1) return input;
  if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
  return `${input.slice(0, idx)}\\${input.slice(idx)}`;
};

exports.removePrefix = (input, state = {}) => {
  let output = input;
  if (output.startsWith('./')) {
  output = output.slice(2);
  state.prefix = './';
  }
  return output;
};

exports.wrapOutput = (input, state = {}, options = {}) => {
  const prepend = options.contains ? '' : '^';
  const append = options.contains ? '' : '$';

  let output = `${prepend}(?:${input})${append}`;
  if (state.negated === true) {
  output = `(?:^(?!${output}).*$)`;
  }
  return output;
};
});

const {
  CHAR_ASTERISK,       /* * */
  CHAR_AT,           /* @ */
  CHAR_BACKWARD_SLASH,     /* \ */
  CHAR_COMMA,        /* , */
  CHAR_DOT,          /* . */
  CHAR_EXCLAMATION_MARK,   /* ! */
  CHAR_FORWARD_SLASH,    /* / */
  CHAR_LEFT_CURLY_BRACE,   /* { */
  CHAR_LEFT_PARENTHESES,   /* ( */
  CHAR_LEFT_SQUARE_BRACKET,  /* [ */
  CHAR_PLUS,         /* + */
  CHAR_QUESTION_MARK,    /* ? */
  CHAR_RIGHT_CURLY_BRACE,  /* } */
  CHAR_RIGHT_PARENTHESES,  /* ) */
  CHAR_RIGHT_SQUARE_BRACKET  /* ] */
} = constants;

const isPathSeparator = code => {
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
};

const depth = token => {
  if (token.isPrefix !== true) {
  token.depth = token.isGlobstar ? Infinity : 1;
  }
};

/**
 * Quickly scans a glob pattern and returns an object with a handful of
 * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
 * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
 * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
 *
 * ```js
 * const pm = require('picomatch');
 * console.log(pm.scan('foo/bar/*.js'));
 * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
 * ```
 * @param {String} `str`
 * @param {Object} `options`
 * @return {Object} Returns an object with tokens and regex source string.
 * @api public
 */

const scan = (input, options) => {
  const opts = options || {};

  const length = input.length - 1;
  const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  const slashes = [];
  const tokens = [];
  const parts = [];

  let str = input;
  let index = -1;
  let start = 0;
  let lastIndex = 0;
  let isBrace = false;
  let isBracket = false;
  let isGlob = false;
  let isExtglob = false;
  let isGlobstar = false;
  let braceEscaped = false;
  let backslashes = false;
  let negated = false;
  let negatedExtglob = false;
  let finished = false;
  let braces = 0;
  let prev;
  let code;
  let token = { value: '', depth: 0, isGlob: false };

  const eos = () => index >= length;
  const peek = () => str.charCodeAt(index + 1);
  const advance = () => {
  prev = code;
  return str.charCodeAt(++index);
  };

  while (index < length) {
  code = advance();
  let next;

  if (code === CHAR_BACKWARD_SLASH) {
    backslashes = token.backslashes = true;
    code = advance();

    if (code === CHAR_LEFT_CURLY_BRACE) {
    braceEscaped = true;
    }
    continue;
  }

  if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
    braces++;

    while (eos() !== true && (code = advance())) {
    if (code === CHAR_BACKWARD_SLASH) {
      backslashes = token.backslashes = true;
      advance();
      continue;
    }

    if (code === CHAR_LEFT_CURLY_BRACE) {
      braces++;
      continue;
    }

    if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
      isBrace = token.isBrace = true;
      isGlob = token.isGlob = true;
      finished = true;

      if (scanToEnd === true) {
      continue;
      }

      break;
    }

    if (braceEscaped !== true && code === CHAR_COMMA) {
      isBrace = token.isBrace = true;
      isGlob = token.isGlob = true;
      finished = true;

      if (scanToEnd === true) {
      continue;
      }

      break;
    }

    if (code === CHAR_RIGHT_CURLY_BRACE) {
      braces--;

      if (braces === 0) {
      braceEscaped = false;
      isBrace = token.isBrace = true;
      finished = true;
      break;
      }
    }
    }

    if (scanToEnd === true) {
    continue;
    }

    break;
  }

  if (code === CHAR_FORWARD_SLASH) {
    slashes.push(index);
    tokens.push(token);
    token = { value: '', depth: 0, isGlob: false };

    if (finished === true) continue;
    if (prev === CHAR_DOT && index === (start + 1)) {
    start += 2;
    continue;
    }

    lastIndex = index + 1;
    continue;
  }

  if (opts.noext !== true) {
    const isExtglobChar = code === CHAR_PLUS
    || code === CHAR_AT
    || code === CHAR_ASTERISK
    || code === CHAR_QUESTION_MARK
    || code === CHAR_EXCLAMATION_MARK;

    if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
    isGlob = token.isGlob = true;
    isExtglob = token.isExtglob = true;
    finished = true;
    if (code === CHAR_EXCLAMATION_MARK && index === start) {
      negatedExtglob = true;
    }

    if (scanToEnd === true) {
      while (eos() !== true && (code = advance())) {
      if (code === CHAR_BACKWARD_SLASH) {
        backslashes = token.backslashes = true;
        code = advance();
        continue;
      }

      if (code === CHAR_RIGHT_PARENTHESES) {
        isGlob = token.isGlob = true;
        finished = true;
        break;
      }
      }
      continue;
    }
    break;
    }
  }

  if (code === CHAR_ASTERISK) {
    if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
    isGlob = token.isGlob = true;
    finished = true;

    if (scanToEnd === true) {
    continue;
    }
    break;
  }

  if (code === CHAR_QUESTION_MARK) {
    isGlob = token.isGlob = true;
    finished = true;

    if (scanToEnd === true) {
    continue;
    }
    break;
  }

  if (code === CHAR_LEFT_SQUARE_BRACKET) {
    while (eos() !== true && (next = advance())) {
    if (next === CHAR_BACKWARD_SLASH) {
      backslashes = token.backslashes = true;
      advance();
      continue;
    }

    if (next === CHAR_RIGHT_SQUARE_BRACKET) {
      isBracket = token.isBracket = true;
      isGlob = token.isGlob = true;
      finished = true;
      break;
    }
    }

    if (scanToEnd === true) {
    continue;
    }

    break;
  }

  if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
    negated = token.negated = true;
    start++;
    continue;
  }

  if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
    isGlob = token.isGlob = true;

    if (scanToEnd === true) {
    while (eos() !== true && (code = advance())) {
      if (code === CHAR_LEFT_PARENTHESES) {
      backslashes = token.backslashes = true;
      code = advance();
      continue;
      }

      if (code === CHAR_RIGHT_PARENTHESES) {
      finished = true;
      break;
      }
    }
    continue;
    }
    break;
  }

  if (isGlob === true) {
    finished = true;

    if (scanToEnd === true) {
    continue;
    }

    break;
  }
  }

  if (opts.noext === true) {
  isExtglob = false;
  isGlob = false;
  }

  let base = str;
  let prefix = '';
  let glob = '';

  if (start > 0) {
  prefix = str.slice(0, start);
  str = str.slice(start);
  lastIndex -= start;
  }

  if (base && isGlob === true && lastIndex > 0) {
  base = str.slice(0, lastIndex);
  glob = str.slice(lastIndex);
  } else if (isGlob === true) {
  base = '';
  glob = str;
  } else {
  base = str;
  }

  if (base && base !== '' && base !== '/' && base !== str) {
  if (isPathSeparator(base.charCodeAt(base.length - 1))) {
    base = base.slice(0, -1);
  }
  }

  if (opts.unescape === true) {
  if (glob) glob = utils$1.removeBackslashes(glob);

  if (base && backslashes === true) {
    base = utils$1.removeBackslashes(base);
  }
  }

  const state = {
  prefix,
  input,
  start,
  base,
  glob,
  isBrace,
  isBracket,
  isGlob,
  isExtglob,
  isGlobstar,
  negated,
  negatedExtglob
  };

  if (opts.tokens === true) {
  state.maxDepth = 0;
  if (!isPathSeparator(code)) {
    tokens.push(token);
  }
  state.tokens = tokens;
  }

  if (opts.parts === true || opts.tokens === true) {
  let prevIndex;

  for (let idx = 0; idx < slashes.length; idx++) {
    const n = prevIndex ? prevIndex + 1 : start;
    const i = slashes[idx];
    const value = input.slice(n, i);
    if (opts.tokens) {
    if (idx === 0 && start !== 0) {
      tokens[idx].isPrefix = true;
      tokens[idx].value = prefix;
    } else {
      tokens[idx].value = value;
    }
    depth(tokens[idx]);
    state.maxDepth += tokens[idx].depth;
    }
    if (idx !== 0 || value !== '') {
    parts.push(value);
    }
    prevIndex = i;
  }

  if (prevIndex && prevIndex + 1 < input.length) {
    const value = input.slice(prevIndex + 1);
    parts.push(value);

    if (opts.tokens) {
    tokens[tokens.length - 1].value = value;
    depth(tokens[tokens.length - 1]);
    state.maxDepth += tokens[tokens.length - 1].depth;
    }
  }

  state.slashes = slashes;
  state.parts = parts;
  }

  return state;
};

var scan_1 = scan;

/**
 * Constants
 */

const {
  MAX_LENGTH,
  POSIX_REGEX_SOURCE,
  REGEX_NON_SPECIAL_CHARS,
  REGEX_SPECIAL_CHARS_BACKREF,
  REPLACEMENTS
} = constants;

/**
 * Helpers
 */

const expandRange = (args, options) => {
  if (typeof options.expandRange === 'function') {
  return options.expandRange(...args, options);
  }

  args.sort();
  const value = `[${args.join('-')}]`;

  try {
  /* eslint-disable-next-line no-new */
  new RegExp(value);
  } catch (ex) {
  return args.map(v => utils$1.escapeRegex(v)).join('..');
  }

  return value;
};

/**
 * Create the message for a syntax error
 */

const syntaxError = (type, char) => {
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
};

/**
 * Parse the given input string.
 * @param {String} input
 * @param {Object} options
 * @return {Object}
 */

const parse$1 = (input, options) => {
  if (typeof input !== 'string') {
  throw new TypeError('Expected a string');
  }

  input = REPLACEMENTS[input] || input;

  const opts = { ...options };
  const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;

  let len = input.length;
  if (len > max) {
  throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  }

  const bos = { type: 'bos', value: '', output: opts.prepend || '' };
  const tokens = [bos];

  const capture = opts.capture ? '' : '?:';
  const win32 = utils$1.isWindows(options);

  // create constants based on platform, for windows or posix
  const PLATFORM_CHARS = constants.globChars(win32);
  const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);

  const {
  DOT_LITERAL,
  PLUS_LITERAL,
  SLASH_LITERAL,
  ONE_CHAR,
  DOTS_SLASH,
  NO_DOT,
  NO_DOT_SLASH,
  NO_DOTS_SLASH,
  QMARK,
  QMARK_NO_DOT,
  STAR,
  START_ANCHOR
  } = PLATFORM_CHARS;

  const globstar = opts => {
  return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  };

  const nodot = opts.dot ? '' : NO_DOT;
  const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  let star = opts.bash === true ? globstar(opts) : STAR;

  if (opts.capture) {
  star = `(${star})`;
  }

  // minimatch options support
  if (typeof opts.noext === 'boolean') {
  opts.noextglob = opts.noext;
  }

  const state = {
  input,
  index: -1,
  start: 0,
  dot: opts.dot === true,
  consumed: '',
  output: '',
  prefix: '',
  backtrack: false,
  negated: false,
  brackets: 0,
  braces: 0,
  parens: 0,
  quotes: 0,
  globstar: false,
  tokens
  };

  input = utils$1.removePrefix(input, state);
  len = input.length;

  const extglobs = [];
  const braces = [];
  const stack = [];
  let prev = bos;
  let value;

  /**
   * Tokenizing helpers
   */

  const eos = () => state.index === len - 1;
  const peek = state.peek = (n = 1) => input[state.index + n];
  const advance = state.advance = () => input[++state.index] || '';
  const remaining = () => input.slice(state.index + 1);
  const consume = (value = '', num = 0) => {
  state.consumed += value;
  state.index += num;
  };

  const append = token => {
  state.output += token.output != null ? token.output : token.value;
  consume(token.value);
  };

  const negate = () => {
  let count = 1;

  while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
    advance();
    state.start++;
    count++;
  }

  if (count % 2 === 0) {
    return false;
  }

  state.negated = true;
  state.start++;
  return true;
  };

  const increment = type => {
  state[type]++;
  stack.push(type);
  };

  const decrement = type => {
  state[type]--;
  stack.pop();
  };

  /**
   * Push tokens onto the tokens array. This helper speeds up
   * tokenizing by 1) helping us avoid backtracking as much as possible,
   * and 2) helping us avoid creating extra tokens when consecutive
   * characters are plain text. This improves performance and simplifies
   * lookbehinds.
   */

  const push = tok => {
  if (prev.type === 'globstar') {
    const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
    const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));

    if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
    state.output = state.output.slice(0, -prev.output.length);
    prev.type = 'star';
    prev.value = '*';
    prev.output = star;
    state.output += prev.output;
    }
  }

  if (extglobs.length && tok.type !== 'paren') {
    extglobs[extglobs.length - 1].inner += tok.value;
  }

  if (tok.value || tok.output) append(tok);
  if (prev && prev.type === 'text' && tok.type === 'text') {
    prev.value += tok.value;
    prev.output = (prev.output || '') + tok.value;
    return;
  }

  tok.prev = prev;
  tokens.push(tok);
  prev = tok;
  };

  const extglobOpen = (type, value) => {
  const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };

  token.prev = prev;
  token.parens = state.parens;
  token.output = state.output;
  const output = (opts.capture ? '(' : '') + token.open;

  increment('parens');
  push({ type, value, output: state.output ? '' : ONE_CHAR });
  push({ type: 'paren', extglob: true, value: advance(), output });
  extglobs.push(token);
  };

  const extglobClose = token => {
  let output = token.close + (opts.capture ? ')' : '');
  let rest;

  if (token.type === 'negate') {
    let extglobStar = star;

    if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
    extglobStar = globstar(opts);
    }

    if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
    output = token.close = `)$))${extglobStar}`;
    }

    if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
    // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
    // In this case, we need to parse the string and use it in the output of the original pattern.
    // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
    //
    // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
    const expression = parse$1(rest, { ...options, fastpaths: false }).output;

    output = token.close = `)${expression})${extglobStar})`;
    }

    if (token.prev.type === 'bos') {
    state.negatedExtglob = true;
    }
  }

  push({ type: 'paren', extglob: true, value, output });
  decrement('parens');
  };

  /**
   * Fast paths
   */

  if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  let backslashes = false;

  let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
    if (first === '\\') {
    backslashes = true;
    return m;
    }

    if (first === '?') {
    if (esc) {
      return esc + first + (rest ? QMARK.repeat(rest.length) : '');
    }
    if (index === 0) {
      return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
    }
    return QMARK.repeat(chars.length);
    }

    if (first === '.') {
    return DOT_LITERAL.repeat(chars.length);
    }

    if (first === '*') {
    if (esc) {
      return esc + first + (rest ? star : '');
    }
    return star;
    }
    return esc ? m : `\\${m}`;
  });

  if (backslashes === true) {
    if (opts.unescape === true) {
    output = output.replace(/\\/g, '');
    } else {
    output = output.replace(/\\+/g, m => {
      return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
    });
    }
  }

  if (output === input && opts.contains === true) {
    state.output = input;
    return state;
  }

  state.output = utils$1.wrapOutput(output, state, options);
  return state;
  }

  /**
   * Tokenize input until we reach end-of-string
   */

  while (!eos()) {
  value = advance();

  if (value === '\u0000') {
    continue;
  }

  /**
   * Escaped characters
   */

  if (value === '\\') {
    const next = peek();

    if (next === '/' && opts.bash !== true) {
    continue;
    }

    if (next === '.' || next === ';') {
    continue;
    }

    if (!next) {
    value += '\\';
    push({ type: 'text', value });
    continue;
    }

    // collapse slashes to reduce potential for exploits
    const match = /^\\+/.exec(remaining());
    let slashes = 0;

    if (match && match[0].length > 2) {
    slashes = match[0].length;
    state.index += slashes;
    if (slashes % 2 !== 0) {
      value += '\\';
    }
    }

    if (opts.unescape === true) {
    value = advance();
    } else {
    value += advance();
    }

    if (state.brackets === 0) {
    push({ type: 'text', value });
    continue;
    }
  }

  /**
   * If we're inside a regex character class, continue
   * until we reach the closing bracket.
   */

  if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
    if (opts.posix !== false && value === ':') {
    const inner = prev.value.slice(1);
    if (inner.includes('[')) {
      prev.posix = true;

      if (inner.includes(':')) {
      const idx = prev.value.lastIndexOf('[');
      const pre = prev.value.slice(0, idx);
      const rest = prev.value.slice(idx + 2);
      const posix = POSIX_REGEX_SOURCE[rest];
      if (posix) {
        prev.value = pre + posix;
        state.backtrack = true;
        advance();

        if (!bos.output && tokens.indexOf(prev) === 1) {
        bos.output = ONE_CHAR;
        }
        continue;
      }
      }
    }
    }

    if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
    value = `\\${value}`;
    }

    if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
    value = `\\${value}`;
    }

    if (opts.posix === true && value === '!' && prev.value === '[') {
    value = '^';
    }

    prev.value += value;
    append({ value });
    continue;
  }

  /**
   * If we're inside a quoted string, continue
   * until we reach the closing double quote.
   */

  if (state.quotes === 1 && value !== '"') {
    value = utils$1.escapeRegex(value);
    prev.value += value;
    append({ value });
    continue;
  }

  /**
   * Double quotes
   */

  if (value === '"') {
    state.quotes = state.quotes === 1 ? 0 : 1;
    if (opts.keepQuotes === true) {
    push({ type: 'text', value });
    }
    continue;
  }

  /**
   * Parentheses
   */

  if (value === '(') {
    increment('parens');
    push({ type: 'paren', value });
    continue;
  }

  if (value === ')') {
    if (state.parens === 0 && opts.strictBrackets === true) {
    throw new SyntaxError(syntaxError('opening', '('));
    }

    const extglob = extglobs[extglobs.length - 1];
    if (extglob && state.parens === extglob.parens + 1) {
    extglobClose(extglobs.pop());
    continue;
    }

    push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
    decrement('parens');
    continue;
  }

  /**
   * Square brackets
   */

  if (value === '[') {
    if (opts.nobracket === true || !remaining().includes(']')) {
    if (opts.nobracket !== true && opts.strictBrackets === true) {
      throw new SyntaxError(syntaxError('closing', ']'));
    }

    value = `\\${value}`;
    } else {
    increment('brackets');
    }

    push({ type: 'bracket', value });
    continue;
  }

  if (value === ']') {
    if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
    push({ type: 'text', value, output: `\\${value}` });
    continue;
    }

    if (state.brackets === 0) {
    if (opts.strictBrackets === true) {
      throw new SyntaxError(syntaxError('opening', '['));
    }

    push({ type: 'text', value, output: `\\${value}` });
    continue;
    }

    decrement('brackets');

    const prevValue = prev.value.slice(1);
    if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
    value = `/${value}`;
    }

    prev.value += value;
    append({ value });

    // when literal brackets are explicitly disabled
    // assume we should match with a regex character class
    if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) {
    continue;
    }

    const escaped = utils$1.escapeRegex(prev.value);
    state.output = state.output.slice(0, -prev.value.length);

    // when literal brackets are explicitly enabled
    // assume we should escape the brackets to match literal characters
    if (opts.literalBrackets === true) {
    state.output += escaped;
    prev.value = escaped;
    continue;
    }

    // when the user specifies nothing, try to match both
    prev.value = `(${capture}${escaped}|${prev.value})`;
    state.output += prev.value;
    continue;
  }

  /**
   * Braces
   */

  if (value === '{' && opts.nobrace !== true) {
    increment('braces');

    const open = {
    type: 'brace',
    value,
    output: '(',
    outputIndex: state.output.length,
    tokensIndex: state.tokens.length
    };

    braces.push(open);
    push(open);
    continue;
  }

  if (value === '}') {
    const brace = braces[braces.length - 1];

    if (opts.nobrace === true || !brace) {
    push({ type: 'text', value, output: value });
    continue;
    }

    let output = ')';

    if (brace.dots === true) {
    const arr = tokens.slice();
    const range = [];

    for (let i = arr.length - 1; i >= 0; i--) {
      tokens.pop();
      if (arr[i].type === 'brace') {
      break;
      }
      if (arr[i].type !== 'dots') {
      range.unshift(arr[i].value);
      }
    }

    output = expandRange(range, opts);
    state.backtrack = true;
    }

    if (brace.comma !== true && brace.dots !== true) {
    const out = state.output.slice(0, brace.outputIndex);
    const toks = state.tokens.slice(brace.tokensIndex);
    brace.value = brace.output = '\\{';
    value = output = '\\}';
    state.output = out;
    for (const t of toks) {
      state.output += (t.output || t.value);
    }
    }

    push({ type: 'brace', value, output });
    decrement('braces');
    braces.pop();
    continue;
  }

  /**
   * Pipes
   */

  if (value === '|') {
    if (extglobs.length > 0) {
    extglobs[extglobs.length - 1].conditions++;
    }
    push({ type: 'text', value });
    continue;
  }

  /**
   * Commas
   */

  if (value === ',') {
    let output = value;

    const brace = braces[braces.length - 1];
    if (brace && stack[stack.length - 1] === 'braces') {
    brace.comma = true;
    output = '|';
    }

    push({ type: 'comma', value, output });
    continue;
  }

  /**
   * Slashes
   */

  if (value === '/') {
    // if the beginning of the glob is "./", advance the start
    // to the current index, and don't add the "./" characters
    // to the state. This greatly simplifies lookbehinds when
    // checking for BOS characters like "!" and "." (not "./")
    if (prev.type === 'dot' && state.index === state.start + 1) {
    state.start = state.index + 1;
    state.consumed = '';
    state.output = '';
    tokens.pop();
    prev = bos; // reset "prev" to the first token
    continue;
    }

    push({ type: 'slash', value, output: SLASH_LITERAL });
    continue;
  }

  /**
   * Dots
   */

  if (value === '.') {
    if (state.braces > 0 && prev.type === 'dot') {
    if (prev.value === '.') prev.output = DOT_LITERAL;
    const brace = braces[braces.length - 1];
    prev.type = 'dots';
    prev.output += value;
    prev.value += value;
    brace.dots = true;
    continue;
    }

    if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
    push({ type: 'text', value, output: DOT_LITERAL });
    continue;
    }

    push({ type: 'dot', value, output: DOT_LITERAL });
    continue;
  }

  /**
   * Question marks
   */

  if (value === '?') {
    const isGroup = prev && prev.value === '(';
    if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
    extglobOpen('qmark', value);
    continue;
    }

    if (prev && prev.type === 'paren') {
    const next = peek();
    let output = value;

    if (next === '<' && !utils$1.supportsLookbehinds()) {
      throw new Error('Node.js v10 or higher is required for regex lookbehinds');
    }

    if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
      output = `\\${value}`;
    }

    push({ type: 'text', value, output });
    continue;
    }

    if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
    push({ type: 'qmark', value, output: QMARK_NO_DOT });
    continue;
    }

    push({ type: 'qmark', value, output: QMARK });
    continue;
  }

  /**
   * Exclamation
   */

  if (value === '!') {
    if (opts.noextglob !== true && peek() === '(') {
    if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
      extglobOpen('negate', value);
      continue;
    }
    }

    if (opts.nonegate !== true && state.index === 0) {
    negate();
    continue;
    }
  }

  /**
   * Plus
   */

  if (value === '+') {
    if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
    extglobOpen('plus', value);
    continue;
    }

    if ((prev && prev.value === '(') || opts.regex === false) {
    push({ type: 'plus', value, output: PLUS_LITERAL });
    continue;
    }

    if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
    push({ type: 'plus', value });
    continue;
    }

    push({ type: 'plus', value: PLUS_LITERAL });
    continue;
  }

  /**
   * Plain text
   */

  if (value === '@') {
    if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
    push({ type: 'at', extglob: true, value, output: '' });
    continue;
    }

    push({ type: 'text', value });
    continue;
  }

  /**
   * Plain text
   */

  if (value !== '*') {
    if (value === '$' || value === '^') {
    value = `\\${value}`;
    }

    const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
    if (match) {
    value += match[0];
    state.index += match[0].length;
    }

    push({ type: 'text', value });
    continue;
  }

  /**
   * Stars
   */

  if (prev && (prev.type === 'globstar' || prev.star === true)) {
    prev.type = 'star';
    prev.star = true;
    prev.value += value;
    prev.output = star;
    state.backtrack = true;
    state.globstar = true;
    consume(value);
    continue;
  }

  let rest = remaining();
  if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
    extglobOpen('star', value);
    continue;
  }

  if (prev.type === 'star') {
    if (opts.noglobstar === true) {
    consume(value);
    continue;
    }

    const prior = prev.prev;
    const before = prior.prev;
    const isStart = prior.type === 'slash' || prior.type === 'bos';
    const afterStar = before && (before.type === 'star' || before.type === 'globstar');

    if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
    push({ type: 'star', value, output: '' });
    continue;
    }

    const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
    const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
    if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
    push({ type: 'star', value, output: '' });
    continue;
    }

    // strip consecutive `/**/`
    while (rest.slice(0, 3) === '/**') {
    const after = input[state.index + 4];
    if (after && after !== '/') {
      break;
    }
    rest = rest.slice(3);
    consume('/**', 3);
    }

    if (prior.type === 'bos' && eos()) {
    prev.type = 'globstar';
    prev.value += value;
    prev.output = globstar(opts);
    state.output = prev.output;
    state.globstar = true;
    consume(value);
    continue;
    }

    if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
    state.output = state.output.slice(0, -(prior.output + prev.output).length);
    prior.output = `(?:${prior.output}`;

    prev.type = 'globstar';
    prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
    prev.value += value;
    state.globstar = true;
    state.output += prior.output + prev.output;
    consume(value);
    continue;
    }

    if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
    const end = rest[1] !== void 0 ? '|$' : '';

    state.output = state.output.slice(0, -(prior.output + prev.output).length);
    prior.output = `(?:${prior.output}`;

    prev.type = 'globstar';
    prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
    prev.value += value;

    state.output += prior.output + prev.output;
    state.globstar = true;

    consume(value + advance());

    push({ type: 'slash', value: '/', output: '' });
    continue;
    }

    if (prior.type === 'bos' && rest[0] === '/') {
    prev.type = 'globstar';
    prev.value += value;
    prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
    state.output = prev.output;
    state.globstar = true;
    consume(value + advance());
    push({ type: 'slash', value: '/', output: '' });
    continue;
    }

    // remove single star from output
    state.output = state.output.slice(0, -prev.output.length);

    // reset previous token to globstar
    prev.type = 'globstar';
    prev.output = globstar(opts);
    prev.value += value;

    // reset output with globstar
    state.output += prev.output;
    state.globstar = true;
    consume(value);
    continue;
  }

  const token = { type: 'star', value, output: star };

  if (opts.bash === true) {
    token.output = '.*?';
    if (prev.type === 'bos' || prev.type === 'slash') {
    token.output = nodot + token.output;
    }
    push(token);
    continue;
  }

  if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
    token.output = value;
    push(token);
    continue;
  }

  if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
    if (prev.type === 'dot') {
    state.output += NO_DOT_SLASH;
    prev.output += NO_DOT_SLASH;

    } else if (opts.dot === true) {
    state.output += NO_DOTS_SLASH;
    prev.output += NO_DOTS_SLASH;

    } else {
    state.output += nodot;
    prev.output += nodot;
    }

    if (peek() !== '*') {
    state.output += ONE_CHAR;
    prev.output += ONE_CHAR;
    }
  }

  push(token);
  }

  while (state.brackets > 0) {
  if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
  state.output = utils$1.escapeLast(state.output, '[');
  decrement('brackets');
  }

  while (state.parens > 0) {
  if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
  state.output = utils$1.escapeLast(state.output, '(');
  decrement('parens');
  }

  while (state.braces > 0) {
  if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
  state.output = utils$1.escapeLast(state.output, '{');
  decrement('braces');
  }

  if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
  push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
  }

  // rebuild the output if we had to backtrack at any point
  if (state.backtrack === true) {
  state.output = '';

  for (const token of state.tokens) {
    state.output += token.output != null ? token.output : token.value;

    if (token.suffix) {
    state.output += token.suffix;
    }
  }
  }

  return state;
};

/**
 * Fast paths for creating regular expressions for common glob patterns.
 * This can significantly speed up processing and has very little downside
 * impact when none of the fast paths match.
 */

parse$1.fastpaths = (input, options) => {
  const opts = { ...options };
  const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  const len = input.length;
  if (len > max) {
  throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  }

  input = REPLACEMENTS[input] || input;
  const win32 = utils$1.isWindows(options);

  // create constants based on platform, for windows or posix
  const {
  DOT_LITERAL,
  SLASH_LITERAL,
  ONE_CHAR,
  DOTS_SLASH,
  NO_DOT,
  NO_DOTS,
  NO_DOTS_SLASH,
  STAR,
  START_ANCHOR
  } = constants.globChars(win32);

  const nodot = opts.dot ? NO_DOTS : NO_DOT;
  const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  const capture = opts.capture ? '' : '?:';
  const state = { negated: false, prefix: '' };
  let star = opts.bash === true ? '.*?' : STAR;

  if (opts.capture) {
  star = `(${star})`;
  }

  const globstar = opts => {
  if (opts.noglobstar === true) return star;
  return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  };

  const create = str => {
  switch (str) {
    case '*':
    return `${nodot}${ONE_CHAR}${star}`;

    case '.*':
    return `${DOT_LITERAL}${ONE_CHAR}${star}`;

    case '*.*':
    return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;

    case '*/*':
    return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;

    case '**':
    return nodot + globstar(opts);

    case '**/*':
    return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;

    case '**/*.*':
    return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;

    case '**/.*':
    return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;

    default: {
    const match = /^(.*?)\.(\w+)$/.exec(str);
    if (!match) return;

    const source = create(match[1]);
    if (!source) return;

    return source + DOT_LITERAL + match[2];
    }
  }
  };

  const output = utils$1.removePrefix(input, state);
  let source = create(output);

  if (source && opts.strictSlashes !== true) {
  source += `${SLASH_LITERAL}?`;
  }

  return source;
};

var parse_1 = parse$1;

const isObject$2 = val => val && typeof val === 'object' && !Array.isArray(val);

/**
 * Creates a matcher function from one or more glob patterns. The
 * returned function takes a string to match as its first argument,
 * and returns true if the string is a match. The returned matcher
 * function also takes a boolean as the second argument that, when true,
 * returns an object with additional information.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch(glob[, options]);
 *
 * const isMatch = picomatch('*.!(*a)');
 * console.log(isMatch('a.a')); //=> false
 * console.log(isMatch('a.b')); //=> true
 * ```
 * @name picomatch
 * @param {String|Array} `globs` One or more glob patterns.
 * @param {Object=} `options`
 * @return {Function=} Returns a matcher function.
 * @api public
 */

const picomatch$1 = (glob, options, returnState = false) => {
  if (Array.isArray(glob)) {
  const fns = glob.map(input => picomatch$1(input, options, returnState));
  const arrayMatcher = str => {
    for (const isMatch of fns) {
    const state = isMatch(str);
    if (state) return state;
    }
    return false;
  };
  return arrayMatcher;
  }

  const isState = isObject$2(glob) && glob.tokens && glob.input;

  if (glob === '' || (typeof glob !== 'string' && !isState)) {
  throw new TypeError('Expected pattern to be a non-empty string');
  }

  const opts = options || {};
  const posix = utils$1.isWindows(options);
  const regex = isState
  ? picomatch$1.compileRe(glob, options)
  : picomatch$1.makeRe(glob, options, false, true);

  const state = regex.state;
  delete regex.state;

  let isIgnored = () => false;
  if (opts.ignore) {
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
  isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
  }

  const matcher = (input, returnObject = false) => {
  const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix });
  const result = { glob, state, regex, posix, input, output, match, isMatch };

  if (typeof opts.onResult === 'function') {
    opts.onResult(result);
  }

  if (isMatch === false) {
    result.isMatch = false;
    return returnObject ? result : false;
  }

  if (isIgnored(input)) {
    if (typeof opts.onIgnore === 'function') {
    opts.onIgnore(result);
    }
    result.isMatch = false;
    return returnObject ? result : false;
  }

  if (typeof opts.onMatch === 'function') {
    opts.onMatch(result);
  }
  return returnObject ? result : true;
  };

  if (returnState) {
  matcher.state = state;
  }

  return matcher;
};

/**
 * Test `input` with the given `regex`. This is used by the main
 * `picomatch()` function to test the input string.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch.test(input, regex[, options]);
 *
 * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
 * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
 * ```
 * @param {String} `input` String to test.
 * @param {RegExp} `regex`
 * @return {Object} Returns an object with matching info.
 * @api public
 */

picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
  if (typeof input !== 'string') {
  throw new TypeError('Expected input to be a string');
  }

  if (input === '') {
  return { isMatch: false, output: '' };
  }

  const opts = options || {};
  const format = opts.format || (posix ? utils$1.toPosixSlashes : null);
  let match = input === glob;
  let output = (match && format) ? format(input) : input;

  if (match === false) {
  output = format ? format(input) : input;
  match = output === glob;
  }

  if (match === false || opts.capture === true) {
  if (opts.matchBase === true || opts.basename === true) {
    match = picomatch$1.matchBase(input, regex, options, posix);
  } else {
    match = regex.exec(output);
  }
  }

  return { isMatch: Boolean(match), match, output };
};

/**
 * Match the basename of a filepath.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch.matchBase(input, glob[, options]);
 * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
 * ```
 * @param {String} `input` String to test.
 * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
 * @return {Boolean}
 * @api public
 */

picomatch$1.matchBase = (input, glob, options, posix = utils$1.isWindows(options)) => {
  const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
  return regex.test(path$5.basename(input));
};

/**
 * Returns true if **any** of the given glob `patterns` match the specified `string`.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch.isMatch(string, patterns[, options]);
 *
 * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
 * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
 * ```
 * @param {String|Array} str The string to test.
 * @param {String|Array} patterns One or more glob patterns to use for matching.
 * @param {Object} [options] See available [options](#options).
 * @return {Boolean} Returns true if any patterns match `str`
 * @api public
 */

picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str);

/**
 * Parse a glob pattern to create the source string for a regular
 * expression.
 *
 * ```js
 * const picomatch = require('picomatch');
 * const result = picomatch.parse(pattern[, options]);
 * ```
 * @param {String} `pattern`
 * @param {Object} `options`
 * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
 * @api public
 */

picomatch$1.parse = (pattern, options) => {
  if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
  return parse_1(pattern, { ...options, fastpaths: false });
};

/**
 * Scan a glob pattern to separate the pattern into segments.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch.scan(input[, options]);
 *
 * const result = picomatch.scan('!./foo/*.js');
 * console.log(result);
 * { prefix: '!./',
 *   input: '!./foo/*.js',
 *   start: 3,
 *   base: 'foo',
 *   glob: '*.js',
 *   isBrace: false,
 *   isBracket: false,
 *   isGlob: true,
 *   isExtglob: false,
 *   isGlobstar: false,
 *   negated: true }
 * ```
 * @param {String} `input` Glob pattern to scan.
 * @param {Object} `options`
 * @return {Object} Returns an object with
 * @api public
 */

picomatch$1.scan = (input, options) => scan_1(input, options);

/**
 * Compile a regular expression from the `state` object returned by the
 * [parse()](#parse) method.
 *
 * @param {Object} `state`
 * @param {Object} `options`
 * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
 * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
 * @return {RegExp}
 * @api public
 */

picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => {
  if (returnOutput === true) {
  return state.output;
  }

  const opts = options || {};
  const prepend = opts.contains ? '' : '^';
  const append = opts.contains ? '' : '$';

  let source = `${prepend}(?:${state.output})${append}`;
  if (state && state.negated === true) {
  source = `^(?!${source}).*$`;
  }

  const regex = picomatch$1.toRegex(source, options);
  if (returnState === true) {
  regex.state = state;
  }

  return regex;
};

/**
 * Create a regular expression from a parsed glob pattern.
 *
 * ```js
 * const picomatch = require('picomatch');
 * const state = picomatch.parse('*.js');
 * // picomatch.compileRe(state[, options]);
 *
 * console.log(picomatch.compileRe(state));
 * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
 * ```
 * @param {String} `state` The object returned from the `.parse` method.
 * @param {Object} `options`
 * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
 * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
 * @return {RegExp} Returns a regex created from the given pattern.
 * @api public
 */

picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  if (!input || typeof input !== 'string') {
  throw new TypeError('Expected a non-empty string');
  }

  let parsed = { negated: false, fastpaths: true };

  if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
  parsed.output = parse_1.fastpaths(input, options);
  }

  if (!parsed.output) {
  parsed = parse_1(input, options);
  }

  return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
};

/**
 * Create a regular expression from the given regex source string.
 *
 * ```js
 * const picomatch = require('picomatch');
 * // picomatch.toRegex(source[, options]);
 *
 * const { output } = picomatch.parse('*.js');
 * console.log(picomatch.toRegex(output));
 * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
 * ```
 * @param {String} `source` Regular expression source string.
 * @param {Object} `options`
 * @return {RegExp}
 * @api public
 */

picomatch$1.toRegex = (source, options) => {
  try {
  const opts = options || {};
  return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
  } catch (err) {
  if (options && options.debug === true) throw err;
  return /$^/;
  }
};

/**
 * Picomatch constants.
 * @return {Object}
 */

picomatch$1.constants = constants;

/**
 * Expose "picomatch"
 */

var picomatch_1 = picomatch$1;

var picomatch = picomatch_1;

function walk$1(ast, { enter, leave }) {
	return visit(ast, null, enter, leave);
}

let should_skip = false;
let should_remove = false;
let replacement = null;
const context = {
	skip: () => should_skip = true,
	remove: () => should_remove = true,
	replace: (node) => replacement = node
};

function replace$1(parent, prop, index, node) {
	if (parent) {
		if (index !== null) {
			parent[prop][index] = node;
		} else {
			parent[prop] = node;
		}
	}
}

function remove(parent, prop, index) {
	if (parent) {
		if (index !== null) {
			parent[prop].splice(index, 1);
		} else {
			delete parent[prop];
		}
	}
}

function visit(
	node,
	parent,
	enter,
	leave,
	prop,
	index
) {
	if (node) {
		if (enter) {
			const _should_skip = should_skip;
			const _should_remove = should_remove;
			const _replacement = replacement;
			should_skip = false;
			should_remove = false;
			replacement = null;

			enter.call(context, node, parent, prop, index);

			if (replacement) {
				node = replacement;
				replace$1(parent, prop, index, node);
			}

			if (should_remove) {
				remove(parent, prop, index);
			}

			const skipped = should_skip;
			const removed = should_remove;

			should_skip = _should_skip;
			should_remove = _should_remove;
			replacement = _replacement;

			if (skipped) return node;
			if (removed) return null;
		}

		for (const key in node) {
			const value = (node )[key];

			if (typeof value !== 'object') {
				continue;
			}

			else if (Array.isArray(value)) {
				for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
					if (value[j] !== null && typeof value[j].type === 'string') {
						if (!visit(value[j], node, enter, leave, key, k)) {
							// removed
							j--;
						}
					}
				}
			}

			else if (value !== null && typeof value.type === 'string') {
				visit(value, node, enter, leave, key, null);
			}
		}

		if (leave) {
			const _replacement = replacement;
			const _should_remove = should_remove;
			replacement = null;
			should_remove = false;

			leave.call(context, node, parent, prop, index);

			if (replacement) {
				node = replacement;
				replace$1(parent, prop, index, node);
			}

			if (should_remove) {
				remove(parent, prop, index);
			}

			const removed = should_remove;

			replacement = _replacement;
			should_remove = _should_remove;

			if (removed) return null;
		}
	}

	return node;
}

const extractors$1 = {
  ArrayPattern(names, param) {
    for (const element of param.elements) {
      if (element)
        extractors$1[element.type](names, element);
    }
  },
  AssignmentPattern(names, param) {
    extractors$1[param.left.type](names, param.left);
  },
  Identifier(names, param) {
    names.push(param.name);
  },
  MemberExpression() { },
  ObjectPattern(names, param) {
    for (const prop of param.properties) {
      // @ts-ignore Typescript reports that this is not a valid type
      if (prop.type === 'RestElement') {
        extractors$1.RestElement(names, prop);
      }
      else {
        extractors$1[prop.value.type](names, prop.value);
      }
    }
  },
  RestElement(names, param) {
    extractors$1[param.argument.type](names, param.argument);
  }
};
const extractAssignedNames$1 = function extractAssignedNames(param) {
  const names = [];
  extractors$1[param.type](names, param);
  return names;
};

const blockDeclarations$1 = {
  const: true,
  let: true
};
class Scope$1$1 {
  constructor(options = {}) {
    this.parent = options.parent;
    this.isBlockScope = !!options.block;
    this.declarations = Object.create(null);
    if (options.params) {
      options.params.forEach((param) => {
        extractAssignedNames$1(param).forEach((name) => {
          this.declarations[name] = true;
        });
      });
    }
  }
  addDeclaration(node, isBlockDeclaration, isVar) {
    if (!isBlockDeclaration && this.isBlockScope) {
      // it's a `var` or function node, and this
      // is a block scope, so we need to go up
      this.parent.addDeclaration(node, isBlockDeclaration, isVar);
    }
    else if (node.id) {
      extractAssignedNames$1(node.id).forEach((name) => {
        this.declarations[name] = true;
      });
    }
  }
  contains(name) {
    return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
  }
}
const attachScopes$1 = function attachScopes(ast, propertyName = 'scope') {
  let scope = new Scope$1$1();
  walk$1(ast, {
    enter(n, parent) {
      const node = n;
      // function foo () {...}
      // class Foo {...}
      if (/(Function|Class)Declaration/.test(node.type)) {
        scope.addDeclaration(node, false, false);
      }
      // var foo = 1
      if (node.type === 'VariableDeclaration') {
        const { kind } = node;
        const isBlockDeclaration = blockDeclarations$1[kind];
        // don't add const/let declarations in the body of a for loop #113
        const parentType = parent ? parent.type : '';
        if (!(isBlockDeclaration && /ForOfStatement/.test(parentType))) {
          node.declarations.forEach((declaration) => {
            scope.addDeclaration(declaration, isBlockDeclaration, true);
          });
        }
      }
      let newScope;
      // create new function scope
      if (/Function/.test(node.type)) {
        const func = node;
        newScope = new Scope$1$1({
          parent: scope,
          block: false,
          params: func.params
        });
        // named function expressions - the name is considered
        // part of the function's scope
        if (func.type === 'FunctionExpression' && func.id) {
          newScope.addDeclaration(func, false, false);
        }
      }
      // create new block scope
      if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
        newScope = new Scope$1$1({
          parent: scope,
          block: true
        });
      }
      // catch clause has its own block scope
      if (node.type === 'CatchClause') {
        newScope = new Scope$1$1({
          parent: scope,
          params: node.param ? [node.param] : [],
          block: true
        });
      }
      if (newScope) {
        Object.defineProperty(node, propertyName, {
          value: newScope,
          configurable: true
        });
        scope = newScope;
      }
    },
    leave(n) {
      const node = n;
      if (node[propertyName])
        scope = scope.parent;
    }
  });
  return scope;
};

// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray$4(arg) {
  return Array.isArray(arg);
}
function ensureArray$3(thing) {
  if (isArray$4(thing))
    return thing;
  if (thing == null)
    return [];
  return [thing];
}

function getMatcherString$3(id, resolutionBase) {
  if (resolutionBase === false) {
    return id;
  }
  // resolve('') is valid and will default to process.cwd()
  const basePath = resolve$3(resolutionBase || '')
    .split(sep)
    .join('/')
    // escape all possible (posix + win) path characters that might interfere with regex
    .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  // Note that we use posix.join because:
  // 1. the basePath has been normalized to use /
  // 2. the incoming glob (id) matcher, also uses /
  // otherwise Node will force backslash (\) on windows
  return posix$1.join(basePath, id);
}
const createFilter$3 = function createFilter(include, exclude, options) {
  const resolutionBase = options && options.resolve;
  const getMatcher = (id) => id instanceof RegExp
    ? id
    : {
      test: (what) => {
        // this refactor is a tad overly verbose but makes for easy debugging
        const pattern = getMatcherString$3(id, resolutionBase);
        const fn = picomatch(pattern, { dot: true });
        const result = fn(what);
        return result;
      }
    };
  const includeMatchers = ensureArray$3(include).map(getMatcher);
  const excludeMatchers = ensureArray$3(exclude).map(getMatcher);
  return function result(id) {
    if (typeof id !== 'string')
      return false;
    if (/\0/.test(id))
      return false;
    const pathId = id.split(sep).join('/');
    for (let i = 0; i < excludeMatchers.length; ++i) {
      const matcher = excludeMatchers[i];
      if (matcher.test(pathId))
        return false;
    }
    for (let i = 0; i < includeMatchers.length; ++i) {
      const matcher = includeMatchers[i];
      if (matcher.test(pathId))
        return true;
    }
    return !includeMatchers.length;
  };
};

const reservedWords$3 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins$4 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const forbiddenIdentifiers$3 = new Set(`${reservedWords$3} ${builtins$4}`.split(' '));
forbiddenIdentifiers$3.add('');
const makeLegalIdentifier$1 = function makeLegalIdentifier(str) {
  let identifier = str
    .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
    .replace(/[^$_a-zA-Z0-9]/g, '_');
  if (/\d/.test(identifier[0]) || forbiddenIdentifiers$3.has(identifier)) {
    identifier = `_${identifier}`;
  }
  return identifier || '_';
};

var commondir$1 = function (basedir, relfiles) {
  if (relfiles) {
    var files = relfiles.map(function (r) {
      return path$5.resolve(basedir, r);
    });
  }
  else {
    var files = basedir;
  }

  var res = files.slice(1).reduce(function (ps, file) {
    if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
      throw new Error('relative path without a basedir');
    }

    var xs = file.split(/\/+|\\+/);
    for (
      var i = 0;
      ps[i] === xs[i] && i < Math.min(ps.length, xs.length);
      i++
    );
    return ps.slice(0, i);
  }, files[0].split(/\/+|\\+/));

  // Windows correctly handles paths with forward-slashes
  return res.length > 1 ? res.join('/') : '/'
};

// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */

/** @typedef {{
	skip: () => void;
	remove: () => void;
	replace: (node: BaseNode) => void;
}} WalkerContext */

class WalkerBase {
	constructor() {
		/** @type {boolean} */
		this.should_skip = false;

		/** @type {boolean} */
		this.should_remove = false;

		/** @type {BaseNode | null} */
		this.replacement = null;

		/** @type {WalkerContext} */
		this.context = {
			skip: () => (this.should_skip = true),
			remove: () => (this.should_remove = true),
			replace: (node) => (this.replacement = node)
		};
	}

	/**
	 *
	 * @param {any} parent
	 * @param {string} prop
	 * @param {number} index
	 * @param {BaseNode} node
	 */
	replace(parent, prop, index, node) {
		if (parent) {
			if (index !== null) {
				parent[prop][index] = node;
			} else {
				parent[prop] = node;
			}
		}
	}

	/**
	 *
	 * @param {any} parent
	 * @param {string} prop
	 * @param {number} index
	 */
	remove(parent, prop, index) {
		if (parent) {
			if (index !== null) {
				parent[prop].splice(index, 1);
			} else {
				delete parent[prop];
			}
		}
	}
}

// @ts-check

/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./walker.js').WalkerContext} WalkerContext */

/** @typedef {(
 *  this: WalkerContext,
 *  node: BaseNode,
 *  parent: BaseNode,
 *  key: string,
 *  index: number
 * ) => void} SyncHandler */

class SyncWalker extends WalkerBase {
	/**
	 *
	 * @param {SyncHandler} enter
	 * @param {SyncHandler} leave
	 */
	constructor(enter, leave) {
		super();

		/** @type {SyncHandler} */
		this.enter = enter;

		/** @type {SyncHandler} */
		this.leave = leave;
	}

	/**
	 *
	 * @param {BaseNode} node
	 * @param {BaseNode} parent
	 * @param {string} [prop]
	 * @param {number} [index]
	 * @returns {BaseNode}
	 */
	visit(node, parent, prop, index) {
		if (node) {
			if (this.enter) {
				const _should_skip = this.should_skip;
				const _should_remove = this.should_remove;
				const _replacement = this.replacement;
				this.should_skip = false;
				this.should_remove = false;
				this.replacement = null;

				this.enter.call(this.context, node, parent, prop, index);

				if (this.replacement) {
					node = this.replacement;
					this.replace(parent, prop, index, node);
				}

				if (this.should_remove) {
					this.remove(parent, prop, index);
				}

				const skipped = this.should_skip;
				const removed = this.should_remove;

				this.should_skip = _should_skip;
				this.should_remove = _should_remove;
				this.replacement = _replacement;

				if (skipped) return node;
				if (removed) return null;
			}

			for (const key in node) {
				const value = node[key];

				if (typeof value !== "object") {
					continue;
				} else if (Array.isArray(value)) {
					for (let i = 0; i < value.length; i += 1) {
						if (value[i] !== null && typeof value[i].type === 'string') {
							if (!this.visit(value[i], node, key, i)) {
								// removed
								i--;
							}
						}
					}
				} else if (value !== null && typeof value.type === "string") {
					this.visit(value, node, key, null);
				}
			}

			if (this.leave) {
				const _replacement = this.replacement;
				const _should_remove = this.should_remove;
				this.replacement = null;
				this.should_remove = false;

				this.leave.call(this.context, node, parent, prop, index);

				if (this.replacement) {
					node = this.replacement;
					this.replace(parent, prop, index, node);
				}

				if (this.should_remove) {
					this.remove(parent, prop, index);
				}

				const removed = this.should_remove;

				this.replacement = _replacement;
				this.should_remove = _should_remove;

				if (removed) return null;
			}
		}

		return node;
	}
}

// @ts-check

/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./sync.js').SyncHandler} SyncHandler */
/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */

/**
 *
 * @param {BaseNode} ast
 * @param {{
 *   enter?: SyncHandler
 *   leave?: SyncHandler
 * }} walker
 * @returns {BaseNode}
 */
function walk(ast, { enter, leave }) {
	const instance = new SyncWalker(enter, leave);
	return instance.visit(ast, null);
}

var chars$2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function encode$1(decoded) {
  var sourceFileIndex = 0; // second field
  var sourceCodeLine = 0; // third field
  var sourceCodeColumn = 0; // fourth field
  var nameIndex = 0; // fifth field
  var mappings = '';
  for (var i = 0; i < decoded.length; i++) {
    var line = decoded[i];
    if (i > 0)
      mappings += ';';
    if (line.length === 0)
      continue;
    var generatedCodeColumn = 0; // first field
    var lineMappings = [];
    for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
      var segment = line_1[_i];
      var segmentMappings = encodeInteger$1(segment[0] - generatedCodeColumn);
      generatedCodeColumn = segment[0];
      if (segment.length > 1) {
        segmentMappings +=
          encodeInteger$1(segment[1] - sourceFileIndex) +
            encodeInteger$1(segment[2] - sourceCodeLine) +
            encodeInteger$1(segment[3] - sourceCodeColumn);
        sourceFileIndex = segment[1];
        sourceCodeLine = segment[2];
        sourceCodeColumn = segment[3];
      }
      if (segment.length === 5) {
        segmentMappings += encodeInteger$1(segment[4] - nameIndex);
        nameIndex = segment[4];
      }
      lineMappings.push(segmentMappings);
    }
    mappings += lineMappings.join(',');
  }
  return mappings;
}
function encodeInteger$1(num) {
  var result = '';
  num = num < 0 ? (-num << 1) | 1 : num << 1;
  do {
    var clamped = num & 31;
    num >>>= 5;
    if (num > 0) {
      clamped |= 32;
    }
    result += chars$2[clamped];
  } while (num > 0);
  return result;
}

var BitSet$1 = function BitSet(arg) {
	this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
};

BitSet$1.prototype.add = function add (n) {
	this.bits[n >> 5] |= 1 << (n & 31);
};

BitSet$1.prototype.has = function has (n) {
	return !!(this.bits[n >> 5] & (1 << (n & 31)));
};

var Chunk$1$1 = function Chunk(start, end, content) {
	this.start = start;
	this.end = end;
	this.original = content;

	this.intro = '';
	this.outro = '';

	this.content = content;
	this.storeName = false;
	this.edited = false;

	// we make these non-enumerable, for sanity while debugging
	Object.defineProperties(this, {
		previous: { writable: true, value: null },
		next: { writable: true, value: null },
	});
};

Chunk$1$1.prototype.appendLeft = function appendLeft (content) {
	this.outro += content;
};

Chunk$1$1.prototype.appendRight = function appendRight (content) {
	this.intro = this.intro + content;
};

Chunk$1$1.prototype.clone = function clone () {
	var chunk = new Chunk$1$1(this.start, this.end, this.original);

	chunk.intro = this.intro;
	chunk.outro = this.outro;
	chunk.content = this.content;
	chunk.storeName = this.storeName;
	chunk.edited = this.edited;

	return chunk;
};

Chunk$1$1.prototype.contains = function contains (index) {
	return this.start < index && index < this.end;
};

Chunk$1$1.prototype.eachNext = function eachNext (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.next;
	}
};

Chunk$1$1.prototype.eachPrevious = function eachPrevious (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.previous;
	}
};

Chunk$1$1.prototype.edit = function edit (content, storeName, contentOnly) {
	this.content = content;
	if (!contentOnly) {
		this.intro = '';
		this.outro = '';
	}
	this.storeName = storeName;

	this.edited = true;

	return this;
};

Chunk$1$1.prototype.prependLeft = function prependLeft (content) {
	this.outro = content + this.outro;
};

Chunk$1$1.prototype.prependRight = function prependRight (content) {
	this.intro = content + this.intro;
};

Chunk$1$1.prototype.split = function split (index) {
	var sliceIndex = index - this.start;

	var originalBefore = this.original.slice(0, sliceIndex);
	var originalAfter = this.original.slice(sliceIndex);

	this.original = originalBefore;

	var newChunk = new Chunk$1$1(index, this.end, originalAfter);
	newChunk.outro = this.outro;
	this.outro = '';

	this.end = index;

	if (this.edited) {
		// TODO is this block necessary?...
		newChunk.edit('', false);
		this.content = '';
	} else {
		this.content = originalBefore;
	}

	newChunk.next = this.next;
	if (newChunk.next) { newChunk.next.previous = newChunk; }
	newChunk.previous = this;
	this.next = newChunk;

	return newChunk;
};

Chunk$1$1.prototype.toString = function toString () {
	return this.intro + this.content + this.outro;
};

Chunk$1$1.prototype.trimEnd = function trimEnd (rx) {
	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.start + trimmed.length).edit('', undefined, true);
		}
		return true;
	} else {
		this.edit('', undefined, true);

		this.intro = this.intro.replace(rx, '');
		if (this.intro.length) { return true; }
	}
};

Chunk$1$1.prototype.trimStart = function trimStart (rx) {
	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.end - trimmed.length);
			this.edit('', undefined, true);
		}
		return true;
	} else {
		this.edit('', undefined, true);

		this.outro = this.outro.replace(rx, '');
		if (this.outro.length) { return true; }
	}
};

var btoa$1$1 = function () {
	throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
	btoa$1$1 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
} else if (typeof Buffer === 'function') {
	btoa$1$1 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
}

var SourceMap$1 = function SourceMap(properties) {
	this.version = 3;
	this.file = properties.file;
	this.sources = properties.sources;
	this.sourcesContent = properties.sourcesContent;
	this.names = properties.names;
	this.mappings = encode$1(properties.mappings);
};

SourceMap$1.prototype.toString = function toString () {
	return JSON.stringify(this);
};

SourceMap$1.prototype.toUrl = function toUrl () {
	return 'data:application/json;charset=utf-8;base64,' + btoa$1$1(this.toString());
};

function guessIndent$1(code) {
	var lines = code.split('\n');

	var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
	var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });

	if (tabbed.length === 0 && spaced.length === 0) {
		return null;
	}

	// More lines tabbed than spaced? Assume tabs, and
	// default to tabs in the case of a tie (or nothing
	// to go on)
	if (tabbed.length >= spaced.length) {
		return '\t';
	}

	// Otherwise, we need to guess the multiple
	var min = spaced.reduce(function (previous, current) {
		var numSpaces = /^ +/.exec(current)[0].length;
		return Math.min(numSpaces, previous);
	}, Infinity);

	return new Array(min + 1).join(' ');
}

function getRelativePath$1(from, to) {
	var fromParts = from.split(/[/\\]/);
	var toParts = to.split(/[/\\]/);

	fromParts.pop(); // get dirname

	while (fromParts[0] === toParts[0]) {
		fromParts.shift();
		toParts.shift();
	}

	if (fromParts.length) {
		var i = fromParts.length;
		while (i--) { fromParts[i] = '..'; }
	}

	return fromParts.concat(toParts).join('/');
}

var toString$1$1 = Object.prototype.toString;

function isObject$1(thing) {
	return toString$1$1.call(thing) === '[object Object]';
}

function getLocator$1$1(source) {
	var originalLines = source.split('\n');
	var lineOffsets = [];

	for (var i = 0, pos = 0; i < originalLines.length; i++) {
		lineOffsets.push(pos);
		pos += originalLines[i].length + 1;
	}

	return function locate(index) {
		var i = 0;
		var j = lineOffsets.length;
		while (i < j) {
			var m = (i + j) >> 1;
			if (index < lineOffsets[m]) {
				j = m;
			} else {
				i = m + 1;
			}
		}
		var line = i - 1;
		var column = index - lineOffsets[line];
		return { line: line, column: column };
	};
}

var Mappings$1 = function Mappings(hires) {
	this.hires = hires;
	this.generatedCodeLine = 0;
	this.generatedCodeColumn = 0;
	this.raw = [];
	this.rawSegments = this.raw[this.generatedCodeLine] = [];
	this.pending = null;
};

Mappings$1.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
	if (content.length) {
		var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
		if (nameIndex >= 0) {
			segment.push(nameIndex);
		}
		this.rawSegments.push(segment);
	} else if (this.pending) {
		this.rawSegments.push(this.pending);
	}

	this.advance(content);
	this.pending = null;
};

Mappings$1.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
	var originalCharIndex = chunk.start;
	var first = true;

	while (originalCharIndex < chunk.end) {
		if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
			this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
		}

		if (original[originalCharIndex] === '\n') {
			loc.line += 1;
			loc.column = 0;
			this.generatedCodeLine += 1;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
			this.generatedCodeColumn = 0;
			first = true;
		} else {
			loc.column += 1;
			this.generatedCodeColumn += 1;
			first = false;
		}

		originalCharIndex += 1;
	}

	this.pending = null;
};

Mappings$1.prototype.advance = function advance (str) {
	if (!str) { return; }

	var lines = str.split('\n');

	if (lines.length > 1) {
		for (var i = 0; i < lines.length - 1; i++) {
			this.generatedCodeLine++;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
		}
		this.generatedCodeColumn = 0;
	}

	this.generatedCodeColumn += lines[lines.length - 1].length;
};

var n$1 = '\n';

var warned$1 = {
	insertLeft: false,
	insertRight: false,
	storeName: false,
};

var MagicString$1 = function MagicString(string, options) {
	if ( options === void 0 ) options = {};

	var chunk = new Chunk$1$1(0, string.length, string);

	Object.defineProperties(this, {
		original: { writable: true, value: string },
		outro: { writable: true, value: '' },
		intro: { writable: true, value: '' },
		firstChunk: { writable: true, value: chunk },
		lastChunk: { writable: true, value: chunk },
		lastSearchedChunk: { writable: true, value: chunk },
		byStart: { writable: true, value: {} },
		byEnd: { writable: true, value: {} },
		filename: { writable: true, value: options.filename },
		indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
		sourcemapLocations: { writable: true, value: new BitSet$1() },
		storedNames: { writable: true, value: {} },
		indentStr: { writable: true, value: guessIndent$1(string) },
	});

	this.byStart[0] = chunk;
	this.byEnd[string.length] = chunk;
};

MagicString$1.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
	this.sourcemapLocations.add(char);
};

MagicString$1.prototype.append = function append (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.outro += content;
	return this;
};

MagicString$1.prototype.appendLeft = function appendLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.appendLeft(content);
	} else {
		this.intro += content;
	}
	return this;
};

MagicString$1.prototype.appendRight = function appendRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.appendRight(content);
	} else {
		this.outro += content;
	}
	return this;
};

MagicString$1.prototype.clone = function clone () {
	var cloned = new MagicString$1(this.original, { filename: this.filename });

	var originalChunk = this.firstChunk;
	var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());

	while (originalChunk) {
		cloned.byStart[clonedChunk.start] = clonedChunk;
		cloned.byEnd[clonedChunk.end] = clonedChunk;

		var nextOriginalChunk = originalChunk.next;
		var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();

		if (nextClonedChunk) {
			clonedChunk.next = nextClonedChunk;
			nextClonedChunk.previous = clonedChunk;

			clonedChunk = nextClonedChunk;
		}

		originalChunk = nextOriginalChunk;
	}

	cloned.lastChunk = clonedChunk;

	if (this.indentExclusionRanges) {
		cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
	}

	cloned.sourcemapLocations = new BitSet$1(this.sourcemapLocations);

	cloned.intro = this.intro;
	cloned.outro = this.outro;

	return cloned;
};

MagicString$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
		var this$1$1 = this;

	options = options || {};

	var sourceIndex = 0;
	var names = Object.keys(this.storedNames);
	var mappings = new Mappings$1(options.hires);

	var locate = getLocator$1$1(this.original);

	if (this.intro) {
		mappings.advance(this.intro);
	}

	this.firstChunk.eachNext(function (chunk) {
		var loc = locate(chunk.start);

		if (chunk.intro.length) { mappings.advance(chunk.intro); }

		if (chunk.edited) {
			mappings.addEdit(
				sourceIndex,
				chunk.content,
				loc,
				chunk.storeName ? names.indexOf(chunk.original) : -1
			);
		} else {
			mappings.addUneditedChunk(sourceIndex, chunk, this$1$1.original, loc, this$1$1.sourcemapLocations);
		}

		if (chunk.outro.length) { mappings.advance(chunk.outro); }
	});

	return {
		file: options.file ? options.file.split(/[/\\]/).pop() : null,
		sources: [options.source ? getRelativePath$1(options.file || '', options.source) : null],
		sourcesContent: options.includeContent ? [this.original] : [null],
		names: names,
		mappings: mappings.raw,
	};
};

MagicString$1.prototype.generateMap = function generateMap (options) {
	return new SourceMap$1(this.generateDecodedMap(options));
};

MagicString$1.prototype.getIndentString = function getIndentString () {
	return this.indentStr === null ? '\t' : this.indentStr;
};

MagicString$1.prototype.indent = function indent (indentStr, options) {
	var pattern = /^[^\r\n]/gm;

	if (isObject$1(indentStr)) {
		options = indentStr;
		indentStr = undefined;
	}

	indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';

	if (indentStr === '') { return this; } // noop

	options = options || {};

	// Process exclusion ranges
	var isExcluded = {};

	if (options.exclude) {
		var exclusions =
			typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
		exclusions.forEach(function (exclusion) {
			for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
				isExcluded[i] = true;
			}
		});
	}

	var shouldIndentNextCharacter = options.indentStart !== false;
	var replacer = function (match) {
		if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
		shouldIndentNextCharacter = true;
		return match;
	};

	this.intro = this.intro.replace(pattern, replacer);

	var charIndex = 0;
	var chunk = this.firstChunk;

	while (chunk) {
		var end = chunk.end;

		if (chunk.edited) {
			if (!isExcluded[charIndex]) {
				chunk.content = chunk.content.replace(pattern, replacer);

				if (chunk.content.length) {
					shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
				}
			}
		} else {
			charIndex = chunk.start;

			while (charIndex < end) {
				if (!isExcluded[charIndex]) {
					var char = this.original[charIndex];

					if (char === '\n') {
						shouldIndentNextCharacter = true;
					} else if (char !== '\r' && shouldIndentNextCharacter) {
						shouldIndentNextCharacter = false;

						if (charIndex === chunk.start) {
							chunk.prependRight(indentStr);
						} else {
							this._splitChunk(chunk, charIndex);
							chunk = chunk.next;
							chunk.prependRight(indentStr);
						}
					}
				}

				charIndex += 1;
			}
		}

		charIndex = chunk.end;
		chunk = chunk.next;
	}

	this.outro = this.outro.replace(pattern, replacer);

	return this;
};

MagicString$1.prototype.insert = function insert () {
	throw new Error(
		'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
	);
};

MagicString$1.prototype.insertLeft = function insertLeft (index, content) {
	if (!warned$1.insertLeft) {
		console.warn(
			'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
		); // eslint-disable-line no-console
		warned$1.insertLeft = true;
	}

	return this.appendLeft(index, content);
};

MagicString$1.prototype.insertRight = function insertRight (index, content) {
	if (!warned$1.insertRight) {
		console.warn(
			'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
		); // eslint-disable-line no-console
		warned$1.insertRight = true;
	}

	return this.prependRight(index, content);
};

MagicString$1.prototype.move = function move (start, end, index) {
	if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }

	this._split(start);
	this._split(end);
	this._split(index);

	var first = this.byStart[start];
	var last = this.byEnd[end];

	var oldLeft = first.previous;
	var oldRight = last.next;

	var newRight = this.byStart[index];
	if (!newRight && last === this.lastChunk) { return this; }
	var newLeft = newRight ? newRight.previous : this.lastChunk;

	if (oldLeft) { oldLeft.next = oldRight; }
	if (oldRight) { oldRight.previous = oldLeft; }

	if (newLeft) { newLeft.next = first; }
	if (newRight) { newRight.previous = last; }

	if (!first.previous) { this.firstChunk = last.next; }
	if (!last.next) {
		this.lastChunk = first.previous;
		this.lastChunk.next = null;
	}

	first.previous = newLeft;
	last.next = newRight || null;

	if (!newLeft) { this.firstChunk = first; }
	if (!newRight) { this.lastChunk = last; }
	return this;
};

MagicString$1.prototype.overwrite = function overwrite (start, end, content, options) {
	if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (end > this.original.length) { throw new Error('end is out of bounds'); }
	if (start === end)
		{ throw new Error(
			'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
		); }

	this._split(start);
	this._split(end);

	if (options === true) {
		if (!warned$1.storeName) {
			console.warn(
				'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
			); // eslint-disable-line no-console
			warned$1.storeName = true;
		}

		options = { storeName: true };
	}
	var storeName = options !== undefined ? options.storeName : false;
	var contentOnly = options !== undefined ? options.contentOnly : false;

	if (storeName) {
		var original = this.original.slice(start, end);
		Object.defineProperty(this.storedNames, original, { writable: true, value: true, enumerable: true });
	}

	var first = this.byStart[start];
	var last = this.byEnd[end];

	if (first) {
		var chunk = first;
		while (chunk !== last) {
			if (chunk.next !== this.byStart[chunk.end]) {
				throw new Error('Cannot overwrite across a split point');
			}
			chunk = chunk.next;
			chunk.edit('', false);
		}

		first.edit(content, storeName, contentOnly);
	} else {
		// must be inserting at the end
		var newChunk = new Chunk$1$1(start, end, '').edit(content, storeName);

		// TODO last chunk in the array may not be the last chunk, if it's moved...
		last.next = newChunk;
		newChunk.previous = last;
	}
	return this;
};

MagicString$1.prototype.prepend = function prepend (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.intro = content + this.intro;
	return this;
};

MagicString$1.prototype.prependLeft = function prependLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.prependLeft(content);
	} else {
		this.intro = content + this.intro;
	}
	return this;
};

MagicString$1.prototype.prependRight = function prependRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.prependRight(content);
	} else {
		this.outro = content + this.outro;
	}
	return this;
};

MagicString$1.prototype.remove = function remove (start, end) {
	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (start === end) { return this; }

	if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
	if (start > end) { throw new Error('end must be greater than start'); }

	this._split(start);
	this._split(end);

	var chunk = this.byStart[start];

	while (chunk) {
		chunk.intro = '';
		chunk.outro = '';
		chunk.edit('');

		chunk = end > chunk.end ? this.byStart[chunk.end] : null;
	}
	return this;
};

MagicString$1.prototype.lastChar = function lastChar () {
	if (this.outro.length) { return this.outro[this.outro.length - 1]; }
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length) { return chunk.outro[chunk.outro.length - 1]; }
		if (chunk.content.length) { return chunk.content[chunk.content.length - 1]; }
		if (chunk.intro.length) { return chunk.intro[chunk.intro.length - 1]; }
	} while ((chunk = chunk.previous));
	if (this.intro.length) { return this.intro[this.intro.length - 1]; }
	return '';
};

MagicString$1.prototype.lastLine = function lastLine () {
	var lineIndex = this.outro.lastIndexOf(n$1);
	if (lineIndex !== -1) { return this.outro.substr(lineIndex + 1); }
	var lineStr = this.outro;
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length > 0) {
			lineIndex = chunk.outro.lastIndexOf(n$1);
			if (lineIndex !== -1) { return chunk.outro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.outro + lineStr;
		}

		if (chunk.content.length > 0) {
			lineIndex = chunk.content.lastIndexOf(n$1);
			if (lineIndex !== -1) { return chunk.content.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.content + lineStr;
		}

		if (chunk.intro.length > 0) {
			lineIndex = chunk.intro.lastIndexOf(n$1);
			if (lineIndex !== -1) { return chunk.intro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.intro + lineStr;
		}
	} while ((chunk = chunk.previous));
	lineIndex = this.intro.lastIndexOf(n$1);
	if (lineIndex !== -1) { return this.intro.substr(lineIndex + 1) + lineStr; }
	return this.intro + lineStr;
};

MagicString$1.prototype.slice = function slice (start, end) {
		if ( start === void 0 ) start = 0;
		if ( end === void 0 ) end = this.original.length;

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	var result = '';

	// find start chunk
	var chunk = this.firstChunk;
	while (chunk && (chunk.start > start || chunk.end <= start)) {
		// found end chunk before start
		if (chunk.start < end && chunk.end >= end) {
			return result;
		}

		chunk = chunk.next;
	}

	if (chunk && chunk.edited && chunk.start !== start)
		{ throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }

	var startChunk = chunk;
	while (chunk) {
		if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
			result += chunk.intro;
		}

		var containsEnd = chunk.start < end && chunk.end >= end;
		if (containsEnd && chunk.edited && chunk.end !== end)
			{ throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }

		var sliceStart = startChunk === chunk ? start - chunk.start : 0;
		var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;

		result += chunk.content.slice(sliceStart, sliceEnd);

		if (chunk.outro && (!containsEnd || chunk.end === end)) {
			result += chunk.outro;
		}

		if (containsEnd) {
			break;
		}

		chunk = chunk.next;
	}

	return result;
};

// TODO deprecate this? not really very useful
MagicString$1.prototype.snip = function snip (start, end) {
	var clone = this.clone();
	clone.remove(0, start);
	clone.remove(end, clone.original.length);

	return clone;
};

MagicString$1.prototype._split = function _split (index) {
	if (this.byStart[index] || this.byEnd[index]) { return; }

	var chunk = this.lastSearchedChunk;
	var searchForward = index > chunk.end;

	while (chunk) {
		if (chunk.contains(index)) { return this._splitChunk(chunk, index); }

		chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
	}
};

MagicString$1.prototype._splitChunk = function _splitChunk (chunk, index) {
	if (chunk.edited && chunk.content.length) {
		// zero-length edited chunks are a special case (overlapping replacements)
		var loc = getLocator$1$1(this.original)(index);
		throw new Error(
			("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
		);
	}

	var newChunk = chunk.split(index);

	this.byEnd[index] = chunk;
	this.byStart[index] = newChunk;
	this.byEnd[newChunk.end] = newChunk;

	if (chunk === this.lastChunk) { this.lastChunk = newChunk; }

	this.lastSearchedChunk = chunk;
	return true;
};

MagicString$1.prototype.toString = function toString () {
	var str = this.intro;

	var chunk = this.firstChunk;
	while (chunk) {
		str += chunk.toString();
		chunk = chunk.next;
	}

	return str + this.outro;
};

MagicString$1.prototype.isEmpty = function isEmpty () {
	var chunk = this.firstChunk;
	do {
		if (
			(chunk.intro.length && chunk.intro.trim()) ||
			(chunk.content.length && chunk.content.trim()) ||
			(chunk.outro.length && chunk.outro.trim())
		)
			{ return false; }
	} while ((chunk = chunk.next));
	return true;
};

MagicString$1.prototype.length = function length () {
	var chunk = this.firstChunk;
	var length = 0;
	do {
		length += chunk.intro.length + chunk.content.length + chunk.outro.length;
	} while ((chunk = chunk.next));
	return length;
};

MagicString$1.prototype.trimLines = function trimLines () {
	return this.trim('[\\r\\n]');
};

MagicString$1.prototype.trim = function trim (charType) {
	return this.trimStart(charType).trimEnd(charType);
};

MagicString$1.prototype.trimEndAborted = function trimEndAborted (charType) {
	var rx = new RegExp((charType || '\\s') + '+$');

	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var chunk = this.lastChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimEnd(rx);

		// if chunk was trimmed, we have a new lastChunk
		if (chunk.end !== end) {
			if (this.lastChunk === chunk) {
				this.lastChunk = chunk.next;
			}

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.previous;
	} while (chunk);

	return false;
};

MagicString$1.prototype.trimEnd = function trimEnd (charType) {
	this.trimEndAborted(charType);
	return this;
};
MagicString$1.prototype.trimStartAborted = function trimStartAborted (charType) {
	var rx = new RegExp('^' + (charType || '\\s') + '+');

	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var chunk = this.firstChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimStart(rx);

		if (chunk.end !== end) {
			// special case...
			if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.next;
	} while (chunk);

	return false;
};

MagicString$1.prototype.trimStart = function trimStart (charType) {
	this.trimStartAborted(charType);
	return this;
};

function isReference(node, parent) {
  if (node.type === 'MemberExpression') {
    return !node.computed && isReference(node.object, node);
  }
  if (node.type === 'Identifier') {
    if (!parent)
      return true;
    switch (parent.type) {
      // disregard `bar` in `foo.bar`
      case 'MemberExpression': return parent.computed || node === parent.object;
      // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
      case 'MethodDefinition': return parent.computed;
      // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
      case 'FieldDefinition': return parent.computed || node === parent.value;
      // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
      case 'Property': return parent.computed || node === parent.value;
      // disregard the `bar` in `export { foo as bar }` or
      // the foo in `import { foo as bar }`
      case 'ExportSpecifier':
      case 'ImportSpecifier': return node === parent.local;
      // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
      case 'LabeledStatement':
      case 'BreakStatement':
      case 'ContinueStatement': return false;
      default: return true;
    }
  }
  return false;
}

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.


var isWindows = process.platform === 'win32';

function rethrow() {
  // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
  // is fairly slow to generate.
  var callback;
  callback = missingCallback;

  return callback;

  function missingCallback(err) {
  if (err) {
    if (process.throwDeprecation)
    throw err;  // Forgot a callback but don't know where? Use NODE_DEBUG=fs
    else if (!process.noDeprecation) {
    var msg = 'fs: missing callback ' + (err.stack || err.message);
    if (process.traceDeprecation)
      console.trace(msg);
    else
      console.error(msg);
    }
  }
  }
}

function maybeCallback(cb) {
  return typeof cb === 'function' ? cb : rethrow();
}

// Regexp that finds the next partion of a (partial) path
// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
if (isWindows) {
  var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
} else {
  var nextPartRe = /(.*?)(?:[\/]+|$)/g;
}

// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
if (isWindows) {
  var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
} else {
  var splitRootRe = /^[\/]*/;
}

var realpathSync$1 = function realpathSync(p, cache) {
  // make p is absolute
  p = path$5.resolve(p);

  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  return cache[p];
  }

  var original = p,
    seenLinks = {},
    knownHard = {};

  // current character position in p
  var pos;
  // the partial path so far, including a trailing slash if any
  var current;
  // the partial path without a trailing slash (except when pointing at a root)
  var base;
  // the partial path scanned in the previous round, with slash
  var previous;

  start();

  function start() {
  // Skip over roots
  var m = splitRootRe.exec(p);
  pos = m[0].length;
  current = m[0];
  base = m[0];
  previous = '';

  // On windows, check that the root exists. On unix there is no need.
  if (isWindows && !knownHard[base]) {
    fs$3.lstatSync(base);
    knownHard[base] = true;
  }
  }

  // walk down the path, swapping out linked pathparts for their real
  // values
  // NB: p.length changes.
  while (pos < p.length) {
  // find the next part
  nextPartRe.lastIndex = pos;
  var result = nextPartRe.exec(p);
  previous = current;
  current += result[0];
  base = previous + result[1];
  pos = nextPartRe.lastIndex;

  // continue if not a symlink
  if (knownHard[base] || (cache && cache[base] === base)) {
    continue;
  }

  var resolvedLink;
  if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
    // some known symbolic link.  no need to stat again.
    resolvedLink = cache[base];
  } else {
    var stat = fs$3.lstatSync(base);
    if (!stat.isSymbolicLink()) {
    knownHard[base] = true;
    if (cache) cache[base] = base;
    continue;
    }

    // read the link if it wasn't read before
    // dev/ino always return 0 on windows, so skip the check.
    var linkTarget = null;
    if (!isWindows) {
    var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
    if (seenLinks.hasOwnProperty(id)) {
      linkTarget = seenLinks[id];
    }
    }
    if (linkTarget === null) {
    fs$3.statSync(base);
    linkTarget = fs$3.readlinkSync(base);
    }
    resolvedLink = path$5.resolve(previous, linkTarget);
    // track this, if given a cache.
    if (cache) cache[base] = resolvedLink;
    if (!isWindows) seenLinks[id] = linkTarget;
  }

  // resolve the link, then start over
  p = path$5.resolve(resolvedLink, p.slice(pos));
  start();
  }

  if (cache) cache[original] = p;

  return p;
};


var realpath$2 = function realpath(p, cache, cb) {
  if (typeof cb !== 'function') {
  cb = maybeCallback(cache);
  cache = null;
  }

  // make p is absolute
  p = path$5.resolve(p);

  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  return process.nextTick(cb.bind(null, null, cache[p]));
  }

  var original = p,
    seenLinks = {},
    knownHard = {};

  // current character position in p
  var pos;
  // the partial path so far, including a trailing slash if any
  var current;
  // the partial path without a trailing slash (except when pointing at a root)
  var base;
  // the partial path scanned in the previous round, with slash
  var previous;

  start();

  function start() {
  // Skip over roots
  var m = splitRootRe.exec(p);
  pos = m[0].length;
  current = m[0];
  base = m[0];
  previous = '';

  // On windows, check that the root exists. On unix there is no need.
  if (isWindows && !knownHard[base]) {
    fs$3.lstat(base, function(err) {
    if (err) return cb(err);
    knownHard[base] = true;
    LOOP();
    });
  } else {
    process.nextTick(LOOP);
  }
  }

  // walk down the path, swapping out linked pathparts for their real
  // values
  function LOOP() {
  // stop if scanned past end of path
  if (pos >= p.length) {
    if (cache) cache[original] = p;
    return cb(null, p);
  }

  // find the next part
  nextPartRe.lastIndex = pos;
  var result = nextPartRe.exec(p);
  previous = current;
  current += result[0];
  base = previous + result[1];
  pos = nextPartRe.lastIndex;

  // continue if not a symlink
  if (knownHard[base] || (cache && cache[base] === base)) {
    return process.nextTick(LOOP);
  }

  if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
    // known symbolic link.  no need to stat again.
    return gotResolvedLink(cache[base]);
  }

  return fs$3.lstat(base, gotStat);
  }

  function gotStat(err, stat) {
  if (err) return cb(err);

  // if not a symlink, skip to the next path part
  if (!stat.isSymbolicLink()) {
    knownHard[base] = true;
    if (cache) cache[base] = base;
    return process.nextTick(LOOP);
  }

  // stat & read the link if not read before
  // call gotTarget as soon as the link target is known
  // dev/ino always return 0 on windows, so skip the check.
  if (!isWindows) {
    var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
    if (seenLinks.hasOwnProperty(id)) {
    return gotTarget(null, seenLinks[id], base);
    }
  }
  fs$3.stat(base, function(err) {
    if (err) return cb(err);

    fs$3.readlink(base, function(err, target) {
    if (!isWindows) seenLinks[id] = target;
    gotTarget(err, target);
    });
  });
  }

  function gotTarget(err, target, base) {
  if (err) return cb(err);

  var resolvedLink = path$5.resolve(previous, target);
  if (cache) cache[base] = resolvedLink;
  gotResolvedLink(resolvedLink);
  }

  function gotResolvedLink(resolvedLink) {
  // resolve the link, then start over
  p = path$5.resolve(resolvedLink, p.slice(pos));
  start();
  }
};

var old = {
	realpathSync: realpathSync$1,
	realpath: realpath$2
};

var fs_realpath = realpath$1;
realpath$1.realpath = realpath$1;
realpath$1.sync = realpathSync;
realpath$1.realpathSync = realpathSync;
realpath$1.monkeypatch = monkeypatch;
realpath$1.unmonkeypatch = unmonkeypatch;


var origRealpath = fs$3.realpath;
var origRealpathSync = fs$3.realpathSync;

var version$2 = process.version;
var ok = /^v[0-5]\./.test(version$2);


function newError (er) {
  return er && er.syscall === 'realpath' && (
  er.code === 'ELOOP' ||
  er.code === 'ENOMEM' ||
  er.code === 'ENAMETOOLONG'
  )
}

function realpath$1 (p, cache, cb) {
  if (ok) {
  return origRealpath(p, cache, cb)
  }

  if (typeof cache === 'function') {
  cb = cache;
  cache = null;
  }
  origRealpath(p, cache, function (er, result) {
  if (newError(er)) {
    old.realpath(p, cache, cb);
  } else {
    cb(er, result);
  }
  });
}

function realpathSync (p, cache) {
  if (ok) {
  return origRealpathSync(p, cache)
  }

  try {
  return origRealpathSync(p, cache)
  } catch (er) {
  if (newError(er)) {
    return old.realpathSync(p, cache)
  } else {
    throw er
  }
  }
}

function monkeypatch () {
  fs$3.realpath = realpath$1;
  fs$3.realpathSync = realpathSync;
}

function unmonkeypatch () {
  fs$3.realpath = origRealpath;
  fs$3.realpathSync = origRealpathSync;
}

var concatMap = function (xs, fn) {
  var res = [];
  for (var i = 0; i < xs.length; i++) {
    var x = fn(xs[i], i);
    if (isArray$3(x)) res.push.apply(res, x);
    else res.push(x);
  }
  return res;
};

var isArray$3 = Array.isArray || function (xs) {
  return Object.prototype.toString.call(xs) === '[object Array]';
};

var balancedMatch = balanced;
function balanced(a, b, str) {
  if (a instanceof RegExp) a = maybeMatch(a, str);
  if (b instanceof RegExp) b = maybeMatch(b, str);

  var r = range(a, b, str);

  return r && {
  start: r[0],
  end: r[1],
  pre: str.slice(0, r[0]),
  body: str.slice(r[0] + a.length, r[1]),
  post: str.slice(r[1] + b.length)
  };
}

function maybeMatch(reg, str) {
  var m = str.match(reg);
  return m ? m[0] : null;
}

balanced.range = range;
function range(a, b, str) {
  var begs, beg, left, right, result;
  var ai = str.indexOf(a);
  var bi = str.indexOf(b, ai + 1);
  var i = ai;

  if (ai >= 0 && bi > 0) {
  begs = [];
  left = str.length;

  while (i >= 0 && !result) {
    if (i == ai) {
    begs.push(i);
    ai = str.indexOf(a, i + 1);
    } else if (begs.length == 1) {
    result = [ begs.pop(), bi ];
    } else {
    beg = begs.pop();
    if (beg < left) {
      left = beg;
      right = bi;
    }

    bi = str.indexOf(b, i + 1);
    }

    i = ai < bi && ai >= 0 ? ai : bi;
  }

  if (begs.length) {
    result = [ left, right ];
  }
  }

  return result;
}

var braceExpansion = expandTop;

var escSlash = '\0SLASH'+Math.random()+'\0';
var escOpen = '\0OPEN'+Math.random()+'\0';
var escClose = '\0CLOSE'+Math.random()+'\0';
var escComma = '\0COMMA'+Math.random()+'\0';
var escPeriod = '\0PERIOD'+Math.random()+'\0';

function numeric(str) {
  return parseInt(str, 10) == str
  ? parseInt(str, 10)
  : str.charCodeAt(0);
}

function escapeBraces(str) {
  return str.split('\\\\').join(escSlash)
      .split('\\{').join(escOpen)
      .split('\\}').join(escClose)
      .split('\\,').join(escComma)
      .split('\\.').join(escPeriod);
}

function unescapeBraces(str) {
  return str.split(escSlash).join('\\')
      .split(escOpen).join('{')
      .split(escClose).join('}')
      .split(escComma).join(',')
      .split(escPeriod).join('.');
}


// Basically just str.split(","), but handling cases
// where we have nested braced sections, which should be
// treated as individual members, like {a,{b,c},d}
function parseCommaParts(str) {
  if (!str)
  return [''];

  var parts = [];
  var m = balancedMatch('{', '}', str);

  if (!m)
  return str.split(',');

  var pre = m.pre;
  var body = m.body;
  var post = m.post;
  var p = pre.split(',');

  p[p.length-1] += '{' + body + '}';
  var postParts = parseCommaParts(post);
  if (post.length) {
  p[p.length-1] += postParts.shift();
  p.push.apply(p, postParts);
  }

  parts.push.apply(parts, p);

  return parts;
}

function expandTop(str) {
  if (!str)
  return [];

  // I don't know why Bash 4.3 does this, but it does.
  // Anything starting with {} will have the first two bytes preserved
  // but *only* at the top level, so {},a}b will not expand to anything,
  // but a{},b}c will be expanded to [a}c,abc].
  // One could argue that this is a bug in Bash, but since the goal of
  // this module is to match Bash's rules, we escape a leading {}
  if (str.substr(0, 2) === '{}') {
  str = '\\{\\}' + str.substr(2);
  }

  return expand(escapeBraces(str), true).map(unescapeBraces);
}

function embrace(str) {
  return '{' + str + '}';
}
function isPadded(el) {
  return /^-?0\d/.test(el);
}

function lte(i, y) {
  return i <= y;
}
function gte(i, y) {
  return i >= y;
}

function expand(str, isTop) {
  var expansions = [];

  var m = balancedMatch('{', '}', str);
  if (!m || /\$$/.test(m.pre)) return [str];

  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  var isSequence = isNumericSequence || isAlphaSequence;
  var isOptions = m.body.indexOf(',') >= 0;
  if (!isSequence && !isOptions) {
  // {a},b}
  if (m.post.match(/,.*\}/)) {
    str = m.pre + '{' + m.body + escClose + m.post;
    return expand(str);
  }
  return [str];
  }

  var n;
  if (isSequence) {
  n = m.body.split(/\.\./);
  } else {
  n = parseCommaParts(m.body);
  if (n.length === 1) {
    // x{{a,b}}y ==> x{a}y x{b}y
    n = expand(n[0], false).map(embrace);
    if (n.length === 1) {
    var post = m.post.length
      ? expand(m.post, false)
      : [''];
    return post.map(function(p) {
      return m.pre + n[0] + p;
    });
    }
  }
  }

  // at this point, n is the parts, and we know it's not a comma set
  // with a single entry.

  // no need to expand pre, since it is guaranteed to be free of brace-sets
  var pre = m.pre;
  var post = m.post.length
  ? expand(m.post, false)
  : [''];

  var N;

  if (isSequence) {
  var x = numeric(n[0]);
  var y = numeric(n[1]);
  var width = Math.max(n[0].length, n[1].length);
  var incr = n.length == 3
    ? Math.abs(numeric(n[2]))
    : 1;
  var test = lte;
  var reverse = y < x;
  if (reverse) {
    incr *= -1;
    test = gte;
  }
  var pad = n.some(isPadded);

  N = [];

  for (var i = x; test(i, y); i += incr) {
    var c;
    if (isAlphaSequence) {
    c = String.fromCharCode(i);
    if (c === '\\')
      c = '';
    } else {
    c = String(i);
    if (pad) {
      var need = width - c.length;
      if (need > 0) {
      var z = new Array(need + 1).join('0');
      if (i < 0)
        c = '-' + z + c.slice(1);
      else
        c = z + c;
      }
    }
    }
    N.push(c);
  }
  } else {
  N = concatMap(n, function(el) { return expand(el, false) });
  }

  for (var j = 0; j < N.length; j++) {
  for (var k = 0; k < post.length; k++) {
    var expansion = pre + N[j] + post[k];
    if (!isTop || isSequence || expansion)
    expansions.push(expansion);
  }
  }

  return expansions;
}

var minimatch_1 = minimatch;
minimatch.Minimatch = Minimatch$1;

var path = (function () { try { return path$5 } catch (e) {}}()) || {
  sep: '/'
};
minimatch.sep = path.sep;

var GLOBSTAR = minimatch.GLOBSTAR = Minimatch$1.GLOBSTAR = {};


var plTypes = {
  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  '?': { open: '(?:', close: ')?' },
  '+': { open: '(?:', close: ')+' },
  '*': { open: '(?:', close: ')*' },
  '@': { open: '(?:', close: ')' }
};

// any single thing other than /
// don't need to escape / when using new RegExp()
var qmark = '[^/]';

// * => any number of characters
var star = qmark + '*?';

// ** when dots are allowed.  Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';

// not a ^ or / followed by a dot,
// followed by anything, any number of times.
var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';

// characters that need to be escaped in RegExp.
var reSpecials = charSet('().*{}+?[]^$\\!');

// "abc" -> { a:true, b:true, c:true }
function charSet (s) {
  return s.split('').reduce(function (set, c) {
  set[c] = true;
  return set
  }, {})
}

// normalizes slashes.
var slashSplit = /\/+/;

minimatch.filter = filter;
function filter (pattern, options) {
  options = options || {};
  return function (p, i, list) {
  return minimatch(p, pattern, options)
  }
}

function ext (a, b) {
  b = b || {};
  var t = {};
  Object.keys(a).forEach(function (k) {
  t[k] = a[k];
  });
  Object.keys(b).forEach(function (k) {
  t[k] = b[k];
  });
  return t
}

minimatch.defaults = function (def) {
  if (!def || typeof def !== 'object' || !Object.keys(def).length) {
  return minimatch
  }

  var orig = minimatch;

  var m = function minimatch (p, pattern, options) {
  return orig(p, pattern, ext(def, options))
  };

  m.Minimatch = function Minimatch (pattern, options) {
  return new orig.Minimatch(pattern, ext(def, options))
  };
  m.Minimatch.defaults = function defaults (options) {
  return orig.defaults(ext(def, options)).Minimatch
  };

  m.filter = function filter (pattern, options) {
  return orig.filter(pattern, ext(def, options))
  };

  m.defaults = function defaults (options) {
  return orig.defaults(ext(def, options))
  };

  m.makeRe = function makeRe (pattern, options) {
  return orig.makeRe(pattern, ext(def, options))
  };

  m.braceExpand = function braceExpand (pattern, options) {
  return orig.braceExpand(pattern, ext(def, options))
  };

  m.match = function (list, pattern, options) {
  return orig.match(list, pattern, ext(def, options))
  };

  return m
};

Minimatch$1.defaults = function (def) {
  return minimatch.defaults(def).Minimatch
};

function minimatch (p, pattern, options) {
  assertValidPattern(pattern);

  if (!options) options = {};

  // shortcut: comments match nothing.
  if (!options.nocomment && pattern.charAt(0) === '#') {
  return false
  }

  return new Minimatch$1(pattern, options).match(p)
}

function Minimatch$1 (pattern, options) {
  if (!(this instanceof Minimatch$1)) {
  return new Minimatch$1(pattern, options)
  }

  assertValidPattern(pattern);

  if (!options) options = {};

  pattern = pattern.trim();

  // windows support: need to use /, not \
  if (!options.allowWindowsEscape && path.sep !== '/') {
  pattern = pattern.split(path.sep).join('/');
  }

  this.options = options;
  this.set = [];
  this.pattern = pattern;
  this.regexp = null;
  this.negate = false;
  this.comment = false;
  this.empty = false;
  this.partial = !!options.partial;

  // make the set of regexps etc.
  this.make();
}

Minimatch$1.prototype.debug = function () {};

Minimatch$1.prototype.make = make;
function make () {
  var pattern = this.pattern;
  var options = this.options;

  // empty patterns and comments match nothing.
  if (!options.nocomment && pattern.charAt(0) === '#') {
  this.comment = true;
  return
  }
  if (!pattern) {
  this.empty = true;
  return
  }

  // step 1: figure out negation, etc.
  this.parseNegate();

  // step 2: expand braces
  var set = this.globSet = this.braceExpand();

  if (options.debug) this.debug = function debug() { console.error.apply(console, arguments); };

  this.debug(this.pattern, set);

  // step 3: now we have a set, so turn each one into a series of path-portion
  // matching patterns.
  // These will be regexps, except in the case of "**", which is
  // set to the GLOBSTAR object for globstar behavior,
  // and will not contain any / characters
  set = this.globParts = set.map(function (s) {
  return s.split(slashSplit)
  });

  this.debug(this.pattern, set);

  // glob --> regexps
  set = set.map(function (s, si, set) {
  return s.map(this.parse, this)
  }, this);

  this.debug(this.pattern, set);

  // filter out everything that didn't compile properly.
  set = set.filter(function (s) {
  return s.indexOf(false) === -1
  });

  this.debug(this.pattern, set);

  this.set = set;
}

Minimatch$1.prototype.parseNegate = parseNegate;
function parseNegate () {
  var pattern = this.pattern;
  var negate = false;
  var options = this.options;
  var negateOffset = 0;

  if (options.nonegate) return

  for (var i = 0, l = pattern.length
  ; i < l && pattern.charAt(i) === '!'
  ; i++) {
  negate = !negate;
  negateOffset++;
  }

  if (negateOffset) this.pattern = pattern.substr(negateOffset);
  this.negate = negate;
}

// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
minimatch.braceExpand = function (pattern, options) {
  return braceExpand(pattern, options)
};

Minimatch$1.prototype.braceExpand = braceExpand;

function braceExpand (pattern, options) {
  if (!options) {
  if (this instanceof Minimatch$1) {
    options = this.options;
  } else {
    options = {};
  }
  }

  pattern = typeof pattern === 'undefined'
  ? this.pattern : pattern;

  assertValidPattern(pattern);

  // Thanks to Yeting Li <https://github.com/yetingli> for
  // improving this regexp to avoid a ReDOS vulnerability.
  if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
  // shortcut. no need to expand.
  return [pattern]
  }

  return braceExpansion(pattern)
}

var MAX_PATTERN_LENGTH = 1024 * 64;
var assertValidPattern = function (pattern) {
  if (typeof pattern !== 'string') {
  throw new TypeError('invalid pattern')
  }

  if (pattern.length > MAX_PATTERN_LENGTH) {
  throw new TypeError('pattern is too long')
  }
};

// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion.  Otherwise, any series
// of * is equivalent to a single *.  Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
Minimatch$1.prototype.parse = parse$2;
var SUBPARSE = {};
function parse$2 (pattern, isSub) {
  assertValidPattern(pattern);

  var options = this.options;

  // shortcuts
  if (pattern === '**') {
  if (!options.noglobstar)
    return GLOBSTAR
  else
    pattern = '*';
  }
  if (pattern === '') return ''

  var re = '';
  var hasMagic = !!options.nocase;
  var escaping = false;
  // ? => one single character
  var patternListStack = [];
  var negativeLists = [];
  var stateChar;
  var inClass = false;
  var reClassStart = -1;
  var classStart = -1;
  // . and .. never match anything that doesn't start with .,
  // even when options.dot is set.
  var patternStart = pattern.charAt(0) === '.' ? '' // anything
  // not (start or / followed by . or .. followed by / or end)
  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  : '(?!\\.)';
  var self = this;

  function clearStateChar () {
  if (stateChar) {
    // we had some state-tracking character
    // that wasn't consumed by this pass.
    switch (stateChar) {
    case '*':
      re += star;
      hasMagic = true;
    break
    case '?':
      re += qmark;
      hasMagic = true;
    break
    default:
      re += '\\' + stateChar;
    break
    }
    self.debug('clearStateChar %j %j', stateChar, re);
    stateChar = false;
  }
  }

  for (var i = 0, len = pattern.length, c
  ; (i < len) && (c = pattern.charAt(i))
  ; i++) {
  this.debug('%s\t%s %s %j', pattern, i, re, c);

  // skip over any that are escaped.
  if (escaping && reSpecials[c]) {
    re += '\\' + c;
    escaping = false;
    continue
  }

  switch (c) {
    /* istanbul ignore next */
    case '/': {
    // completely not allowed, even escaped.
    // Should already be path-split by now.
    return false
    }

    case '\\':
    clearStateChar();
    escaping = true;
    continue

    // the various stateChar values
    // for the "extglob" stuff.
    case '?':
    case '*':
    case '+':
    case '@':
    case '!':
    this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);

    // all of those are literals inside a class, except that
    // the glob [!a] means [^a] in regexp
    if (inClass) {
      this.debug('  in class');
      if (c === '!' && i === classStart + 1) c = '^';
      re += c;
      continue
    }

    // if we already have a stateChar, then it means
    // that there was something like ** or +? in there.
    // Handle the stateChar, then proceed with this one.
    self.debug('call clearStateChar %j', stateChar);
    clearStateChar();
    stateChar = c;
    // if extglob is disabled, then +(asdf|foo) isn't a thing.
    // just clear the statechar *now*, rather than even diving into
    // the patternList stuff.
    if (options.noext) clearStateChar();
    continue

    case '(':
    if (inClass) {
      re += '(';
      continue
    }

    if (!stateChar) {
      re += '\\(';
      continue
    }

    patternListStack.push({
      type: stateChar,
      start: i - 1,
      reStart: re.length,
      open: plTypes[stateChar].open,
      close: plTypes[stateChar].close
    });
    // negation is (?:(?!js)[^/]*)
    re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
    this.debug('plType %j %j', stateChar, re);
    stateChar = false;
    continue

    case ')':
    if (inClass || !patternListStack.length) {
      re += '\\)';
      continue
    }

    clearStateChar();
    hasMagic = true;
    var pl = patternListStack.pop();
    // negation is (?:(?!js)[^/]*)
    // The others are (?:<pattern>)<type>
    re += pl.close;
    if (pl.type === '!') {
      negativeLists.push(pl);
    }
    pl.reEnd = re.length;
    continue

    case '|':
    if (inClass || !patternListStack.length || escaping) {
      re += '\\|';
      escaping = false;
      continue
    }

    clearStateChar();
    re += '|';
    continue

    // these are mostly the same in regexp and glob
    case '[':
    // swallow any state-tracking char before the [
    clearStateChar();

    if (inClass) {
      re += '\\' + c;
      continue
    }

    inClass = true;
    classStart = i;
    reClassStart = re.length;
    re += c;
    continue

    case ']':
    //  a right bracket shall lose its special
    //  meaning and represent itself in
    //  a bracket expression if it occurs
    //  first in the list.  -- POSIX.2 2.8.3.2
    if (i === classStart + 1 || !inClass) {
      re += '\\' + c;
      escaping = false;
      continue
    }

    // handle the case where we left a class open.
    // "[z-a]" is valid, equivalent to "\[z-a\]"
    // split where the last [ was, make sure we don't have
    // an invalid re. if so, re-walk the contents of the
    // would-be class to re-translate any characters that
    // were passed through as-is
    // TODO: It would probably be faster to determine this
    // without a try/catch and a new RegExp, but it's tricky
    // to do safely.  For now, this is safe and works.
    var cs = pattern.substring(classStart + 1, i);
    try {
      RegExp('[' + cs + ']');
    } catch (er) {
      // not a valid class!
      var sp = this.parse(cs, SUBPARSE);
      re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
      hasMagic = hasMagic || sp[1];
      inClass = false;
      continue
    }

    // finish up the class.
    hasMagic = true;
    inClass = false;
    re += c;
    continue

    default:
    // swallow any state char that wasn't consumed
    clearStateChar();

    if (escaping) {
      // no need
      escaping = false;
    } else if (reSpecials[c]
      && !(c === '^' && inClass)) {
      re += '\\';
    }

    re += c;

  } // switch
  } // for

  // handle the case where we left a class open.
  // "[abc" is valid, equivalent to "\[abc"
  if (inClass) {
  // split where the last [ was, and escape it
  // this is a huge pita.  We now have to re-walk
  // the contents of the would-be class to re-translate
  // any characters that were passed through as-is
  cs = pattern.substr(classStart + 1);
  sp = this.parse(cs, SUBPARSE);
  re = re.substr(0, reClassStart) + '\\[' + sp[0];
  hasMagic = hasMagic || sp[1];
  }

  // handle the case where we had a +( thing at the *end*
  // of the pattern.
  // each pattern list stack adds 3 chars, and we need to go through
  // and escape any | chars that were passed through as-is for the regexp.
  // Go through and escape them, taking care not to double-escape any
  // | chars that were already escaped.
  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  var tail = re.slice(pl.reStart + pl.open.length);
  this.debug('setting tail', re, pl);
  // maybe some even number of \, then maybe 1 \, followed by a |
  tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
    if (!$2) {
    // the | isn't already escaped, so escape it.
    $2 = '\\';
    }

    // need to escape all those slashes *again*, without escaping the
    // one that we need for escaping the | character.  As it works out,
    // escaping an even number of slashes can be done by simply repeating
    // it exactly after itself.  That's why this trick works.
    //
    // I am sorry that you have to see this.
    return $1 + $1 + $2 + '|'
  });

  this.debug('tail=%j\n   %s', tail, tail, pl, re);
  var t = pl.type === '*' ? star
    : pl.type === '?' ? qmark
    : '\\' + pl.type;

  hasMagic = true;
  re = re.slice(0, pl.reStart) + t + '\\(' + tail;
  }

  // handle trailing things that only matter at the very end.
  clearStateChar();
  if (escaping) {
  // trailing \\
  re += '\\\\';
  }

  // only need to apply the nodot start if the re starts with
  // something that could conceivably capture a dot
  var addPatternStart = false;
  switch (re.charAt(0)) {
  case '[': case '.': case '(': addPatternStart = true;
  }

  // Hack to work around lack of negative lookbehind in JS
  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  // like 'a.xyz.yz' doesn't match.  So, the first negative
  // lookahead, has to look ALL the way ahead, to the end of
  // the pattern.
  for (var n = negativeLists.length - 1; n > -1; n--) {
  var nl = negativeLists[n];

  var nlBefore = re.slice(0, nl.reStart);
  var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  var nlAfter = re.slice(nl.reEnd);

  nlLast += nlAfter;

  // Handle nested stuff like *(*.js|!(*.json)), where open parens
  // mean that we should *not* include the ) in the bit that is considered
  // "after" the negated section.
  var openParensBefore = nlBefore.split('(').length - 1;
  var cleanAfter = nlAfter;
  for (i = 0; i < openParensBefore; i++) {
    cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
  }
  nlAfter = cleanAfter;

  var dollar = '';
  if (nlAfter === '' && isSub !== SUBPARSE) {
    dollar = '$';
  }
  var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  re = newRe;
  }

  // if the re is not "" at this point, then we need to make sure
  // it doesn't match against an empty path part.
  // Otherwise a/* will match a/, which it should not.
  if (re !== '' && hasMagic) {
  re = '(?=.)' + re;
  }

  if (addPatternStart) {
  re = patternStart + re;
  }

  // parsing just a piece of a larger pattern.
  if (isSub === SUBPARSE) {
  return [re, hasMagic]
  }

  // skip the regexp for non-magical patterns
  // unescape anything in it, though, so that it'll be
  // an exact match against a file etc.
  if (!hasMagic) {
  return globUnescape(pattern)
  }

  var flags = options.nocase ? 'i' : '';
  try {
  var regExp = new RegExp('^' + re + '$', flags);
  } catch (er) /* istanbul ignore next - should be impossible */ {
  // If it was an invalid regular expression, then it can't match
  // anything.  This trick looks for a character after the end of
  // the string, which is of course impossible, except in multi-line
  // mode, but it's not a /m regex.
  return new RegExp('$.')
  }

  regExp._glob = pattern;
  regExp._src = re;

  return regExp
}

minimatch.makeRe = function (pattern, options) {
  return new Minimatch$1(pattern, options || {}).makeRe()
};

Minimatch$1.prototype.makeRe = makeRe;
function makeRe () {
  if (this.regexp || this.regexp === false) return this.regexp

  // at this point, this.set is a 2d array of partial
  // pattern strings, or "**".
  //
  // It's better to use .match().  This function shouldn't
  // be used, really, but it's pretty convenient sometimes,
  // when you just want to work with a regex.
  var set = this.set;

  if (!set.length) {
  this.regexp = false;
  return this.regexp
  }
  var options = this.options;

  var twoStar = options.noglobstar ? star
  : options.dot ? twoStarDot
  : twoStarNoDot;
  var flags = options.nocase ? 'i' : '';

  var re = set.map(function (pattern) {
  return pattern.map(function (p) {
    return (p === GLOBSTAR) ? twoStar
    : (typeof p === 'string') ? regExpEscape(p)
    : p._src
  }).join('\\\/')
  }).join('|');

  // must match entire pattern
  // ending in a * or ** will make it less strict.
  re = '^(?:' + re + ')$';

  // can match anything, as long as it's not this.
  if (this.negate) re = '^(?!' + re + ').*$';

  try {
  this.regexp = new RegExp(re, flags);
  } catch (ex) /* istanbul ignore next - should be impossible */ {
  this.regexp = false;
  }
  return this.regexp
}

minimatch.match = function (list, pattern, options) {
  options = options || {};
  var mm = new Minimatch$1(pattern, options);
  list = list.filter(function (f) {
  return mm.match(f)
  });
  if (mm.options.nonull && !list.length) {
  list.push(pattern);
  }
  return list
};

Minimatch$1.prototype.match = function match (f, partial) {
  if (typeof partial === 'undefined') partial = this.partial;
  this.debug('match', f, this.pattern);
  // short-circuit in the case of busted things.
  // comments, etc.
  if (this.comment) return false
  if (this.empty) return f === ''

  if (f === '/' && partial) return true

  var options = this.options;

  // windows: need to use /, not \
  if (path.sep !== '/') {
  f = f.split(path.sep).join('/');
  }

  // treat the test path as a set of pathparts.
  f = f.split(slashSplit);
  this.debug(this.pattern, 'split', f);

  // just ONE of the pattern sets in this.set needs to match
  // in order for it to be valid.  If negating, then just one
  // match means that we have failed.
  // Either way, return on the first hit.

  var set = this.set;
  this.debug(this.pattern, 'set', set);

  // Find the basename of the path by looking for the last non-empty segment
  var filename;
  var i;
  for (i = f.length - 1; i >= 0; i--) {
  filename = f[i];
  if (filename) break
  }

  for (i = 0; i < set.length; i++) {
  var pattern = set[i];
  var file = f;
  if (options.matchBase && pattern.length === 1) {
    file = [filename];
  }
  var hit = this.matchOne(file, pattern, partial);
  if (hit) {
    if (options.flipNegate) return true
    return !this.negate
  }
  }

  // didn't get any hits.  this is success if it's a negative
  // pattern, failure otherwise.
  if (options.flipNegate) return false
  return this.negate
};

// set partial to true to test if, for example,
// "/a/b" matches the start of "/*/b/*/d"
// Partial means, if you run out of file before you run
// out of pattern, then that's fine, as long as all
// the parts match.
Minimatch$1.prototype.matchOne = function (file, pattern, partial) {
  var options = this.options;

  this.debug('matchOne',
  { 'this': this, file: file, pattern: pattern });

  this.debug('matchOne', file.length, pattern.length);

  for (var fi = 0,
    pi = 0,
    fl = file.length,
    pl = pattern.length
    ; (fi < fl) && (pi < pl)
    ; fi++, pi++) {
  this.debug('matchOne loop');
  var p = pattern[pi];
  var f = file[fi];

  this.debug(pattern, p, f);

  // should be impossible.
  // some invalid regexp stuff in the set.
  /* istanbul ignore if */
  if (p === false) return false

  if (p === GLOBSTAR) {
    this.debug('GLOBSTAR', [pattern, p, f]);

    // "**"
    // a/**/b/**/c would match the following:
    // a/b/x/y/z/c
    // a/x/y/z/b/c
    // a/b/x/b/x/c
    // a/b/c
    // To do this, take the rest of the pattern after
    // the **, and see if it would match the file remainder.
    // If so, return success.
    // If not, the ** "swallows" a segment, and try again.
    // This is recursively awful.
    //
    // a/**/b/**/c matching a/b/x/y/z/c
    // - a matches a
    // - doublestar
    //   - matchOne(b/x/y/z/c, b/**/c)
    //   - b matches b
    //   - doublestar
    //     - matchOne(x/y/z/c, c) -> no
    //     - matchOne(y/z/c, c) -> no
    //     - matchOne(z/c, c) -> no
    //     - matchOne(c, c) yes, hit
    var fr = fi;
    var pr = pi + 1;
    if (pr === pl) {
    this.debug('** at the end');
    // a ** at the end will just swallow the rest.
    // We have found a match.
    // however, it will not swallow /.x, unless
    // options.dot is set.
    // . and .. are *never* matched by **, for explosively
    // exponential reasons.
    for (; fi < fl; fi++) {
      if (file[fi] === '.' || file[fi] === '..' ||
      (!options.dot && file[fi].charAt(0) === '.')) return false
    }
    return true
    }

    // ok, let's see if we can swallow whatever we can.
    while (fr < fl) {
    var swallowee = file[fr];

    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);

    // XXX remove this slice.  Just pass the start index.
    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
      this.debug('globstar found match!', fr, fl, swallowee);
      // found a match.
      return true
    } else {
      // can't swallow "." or ".." ever.
      // can only swallow ".foo" when explicitly asked.
      if (swallowee === '.' || swallowee === '..' ||
      (!options.dot && swallowee.charAt(0) === '.')) {
      this.debug('dot detected!', file, fr, pattern, pr);
      break
      }

      // ** swallows a segment, and continue.
      this.debug('globstar swallow a segment, and continue');
      fr++;
    }
    }

    // no match was found.
    // However, in partial mode, we can't say this is necessarily over.
    // If there's more *pattern* left, then
    /* istanbul ignore if */
    if (partial) {
    // ran out of file
    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
    if (fr === fl) return true
    }
    return false
  }

  // something other than **
  // non-magic patterns just have to match exactly
  // patterns with magic have been turned into regexps.
  var hit;
  if (typeof p === 'string') {
    hit = f === p;
    this.debug('string match', p, f, hit);
  } else {
    hit = f.match(p);
    this.debug('pattern match', p, f, hit);
  }

  if (!hit) return false
  }

  // Note: ending in / means that we'll get a final ""
  // at the end of the pattern.  This can only match a
  // corresponding "" at the end of the file.
  // If the file ends in /, then it can only match a
  // a pattern that ends in /, unless the pattern just
  // doesn't have any more for it. But, a/b/ should *not*
  // match "a/b/*", even though "" matches against the
  // [^/]*? pattern, except in partial mode, where it might
  // simply not be reached yet.
  // However, a/b/ should still satisfy a/*

  // now either we fell off the end of the pattern, or we're done.
  if (fi === fl && pi === pl) {
  // ran out of pattern and filename at the same time.
  // an exact hit!
  return true
  } else if (fi === fl) {
  // ran out of file, but still had pattern left.
  // this is ok if we're doing the match as part of
  // a glob fs traversal.
  return partial
  } else /* istanbul ignore else */ if (pi === pl) {
  // ran out of pattern, still have file left.
  // this is only acceptable if we're on the very last
  // empty segment of a file with a trailing slash.
  // a/* should match a/b/
  return (fi === fl - 1) && (file[fi] === '')
  }

  // should be unreachable.
  /* istanbul ignore next */
  throw new Error('wtf?')
};

// replace stuff like \* with *
function globUnescape (s) {
  return s.replace(/\\(.)/g, '$1')
}

function regExpEscape (s) {
  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
}

var inherits_browser$1 = createCommonjsModule(function (module) {
if (typeof Object.create === 'function') {
  // implementation from standard node.js 'util' module
  module.exports = function inherits(ctor, superCtor) {
  if (superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
    constructor: {
      value: ctor,
      enumerable: false,
      writable: true,
      configurable: true
    }
    });
  }
  };
} else {
  // old school shim for old browsers
  module.exports = function inherits(ctor, superCtor) {
  if (superCtor) {
    ctor.super_ = superCtor;
    var TempCtor = function () {};
    TempCtor.prototype = superCtor.prototype;
    ctor.prototype = new TempCtor();
    ctor.prototype.constructor = ctor;
  }
  };
}
});

var inherits$1 = createCommonjsModule(function (module) {
try {
  var util = require$$0$1;
  /* istanbul ignore next */
  if (typeof util.inherits !== 'function') throw '';
  module.exports = util.inherits;
} catch (e) {
  /* istanbul ignore next */
  module.exports = inherits_browser$1;
}
});

// Copyright Joyent, Inc. and other Node contributors.

var R = typeof Reflect === 'object' ? Reflect : null;
var ReflectApply = R && typeof R.apply === 'function'
  ? R.apply
  : function ReflectApply(target, receiver, args) {
  return Function.prototype.apply.call(target, receiver, args);
  };

var ReflectOwnKeys;
if (R && typeof R.ownKeys === 'function') {
  ReflectOwnKeys = R.ownKeys;
} else if (Object.getOwnPropertySymbols) {
  ReflectOwnKeys = function ReflectOwnKeys(target) {
  return Object.getOwnPropertyNames(target)
    .concat(Object.getOwnPropertySymbols(target));
  };
} else {
  ReflectOwnKeys = function ReflectOwnKeys(target) {
  return Object.getOwnPropertyNames(target);
  };
}

function ProcessEmitWarning(warning) {
  if (console && console.warn) console.warn(warning);
}

var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  return value !== value;
};

function EventEmitter() {
  EventEmitter.init.call(this);
}
var events = EventEmitter;
var once_1$1 = once$1;

// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;

EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;

// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;

function checkListener(listener) {
  if (typeof listener !== 'function') {
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  }
}

Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  enumerable: true,
  get: function() {
  return defaultMaxListeners;
  },
  set: function(arg) {
  if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
    throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  }
  defaultMaxListeners = arg;
  }
});

EventEmitter.init = function() {

  if (this._events === undefined ||
    this._events === Object.getPrototypeOf(this)._events) {
  this._events = Object.create(null);
  this._eventsCount = 0;
  }

  this._maxListeners = this._maxListeners || undefined;
};

// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  }
  this._maxListeners = n;
  return this;
};

function _getMaxListeners(that) {
  if (that._maxListeners === undefined)
  return EventEmitter.defaultMaxListeners;
  return that._maxListeners;
}

EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  return _getMaxListeners(this);
};

EventEmitter.prototype.emit = function emit(type) {
  var args = [];
  for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  var doError = (type === 'error');

  var events = this._events;
  if (events !== undefined)
  doError = (doError && events.error === undefined);
  else if (!doError)
  return false;

  // If there is no 'error' event listener then throw.
  if (doError) {
  var er;
  if (args.length > 0)
    er = args[0];
  if (er instanceof Error) {
    // Note: The comments on the `throw` lines are intentional, they show
    // up in Node's output if this results in an unhandled exception.
    throw er; // Unhandled 'error' event
  }
  // At least give some kind of context to the user
  var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  err.context = er;
  throw err; // Unhandled 'error' event
  }

  var handler = events[type];

  if (handler === undefined)
  return false;

  if (typeof handler === 'function') {
  ReflectApply(handler, this, args);
  } else {
  var len = handler.length;
  var listeners = arrayClone(handler, len);
  for (var i = 0; i < len; ++i)
    ReflectApply(listeners[i], this, args);
  }

  return true;
};

function _addListener(target, type, listener, prepend) {
  var m;
  var events;
  var existing;

  checkListener(listener);

  events = target._events;
  if (events === undefined) {
  events = target._events = Object.create(null);
  target._eventsCount = 0;
  } else {
  // To avoid recursion in the case that type === "newListener"! Before
  // adding it to the listeners, first emit "newListener".
  if (events.newListener !== undefined) {
    target.emit('newListener', type,
          listener.listener ? listener.listener : listener);

    // Re-assign `events` because a newListener handler could have caused the
    // this._events to be assigned to a new object
    events = target._events;
  }
  existing = events[type];
  }

  if (existing === undefined) {
  // Optimize the case of one listener. Don't need the extra array object.
  existing = events[type] = listener;
  ++target._eventsCount;
  } else {
  if (typeof existing === 'function') {
    // Adding the second element, need to change to array.
    existing = events[type] =
    prepend ? [listener, existing] : [existing, listener];
    // If we've already got an array, just append.
  } else if (prepend) {
    existing.unshift(listener);
  } else {
    existing.push(listener);
  }

  // Check for listener leak
  m = _getMaxListeners(target);
  if (m > 0 && existing.length > m && !existing.warned) {
    existing.warned = true;
    // No error code for this since it is a Warning
    // eslint-disable-next-line no-restricted-syntax
    var w = new Error('Possible EventEmitter memory leak detected. ' +
              existing.length + ' ' + String(type) + ' listeners ' +
              'added. Use emitter.setMaxListeners() to ' +
              'increase limit');
    w.name = 'MaxListenersExceededWarning';
    w.emitter = target;
    w.type = type;
    w.count = existing.length;
    ProcessEmitWarning(w);
  }
  }

  return target;
}

EventEmitter.prototype.addListener = function addListener(type, listener) {
  return _addListener(this, type, listener, false);
};

EventEmitter.prototype.on = EventEmitter.prototype.addListener;

EventEmitter.prototype.prependListener =
  function prependListener(type, listener) {
    return _addListener(this, type, listener, true);
  };

function onceWrapper() {
  if (!this.fired) {
  this.target.removeListener(this.type, this.wrapFn);
  this.fired = true;
  if (arguments.length === 0)
    return this.listener.call(this.target);
  return this.listener.apply(this.target, arguments);
  }
}

function _onceWrap(target, type, listener) {
  var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  var wrapped = onceWrapper.bind(state);
  wrapped.listener = listener;
  state.wrapFn = wrapped;
  return wrapped;
}

EventEmitter.prototype.once = function once(type, listener) {
  checkListener(listener);
  this.on(type, _onceWrap(this, type, listener));
  return this;
};

EventEmitter.prototype.prependOnceListener =
  function prependOnceListener(type, listener) {
    checkListener(listener);
    this.prependListener(type, _onceWrap(this, type, listener));
    return this;
  };

// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
  function removeListener(type, listener) {
    var list, events, position, i, originalListener;

    checkListener(listener);

    events = this._events;
    if (events === undefined)
    return this;

    list = events[type];
    if (list === undefined)
    return this;

    if (list === listener || list.listener === listener) {
    if (--this._eventsCount === 0)
      this._events = Object.create(null);
    else {
      delete events[type];
      if (events.removeListener)
      this.emit('removeListener', type, list.listener || listener);
    }
    } else if (typeof list !== 'function') {
    position = -1;

    for (i = list.length - 1; i >= 0; i--) {
      if (list[i] === listener || list[i].listener === listener) {
      originalListener = list[i].listener;
      position = i;
      break;
      }
    }

    if (position < 0)
      return this;

    if (position === 0)
      list.shift();
    else {
      spliceOne(list, position);
    }

    if (list.length === 1)
      events[type] = list[0];

    if (events.removeListener !== undefined)
      this.emit('removeListener', type, originalListener || listener);
    }

    return this;
  };

EventEmitter.prototype.off = EventEmitter.prototype.removeListener;

EventEmitter.prototype.removeAllListeners =
  function removeAllListeners(type) {
    var listeners, events, i;

    events = this._events;
    if (events === undefined)
    return this;

    // not listening for removeListener, no need to emit
    if (events.removeListener === undefined) {
    if (arguments.length === 0) {
      this._events = Object.create(null);
      this._eventsCount = 0;
    } else if (events[type] !== undefined) {
      if (--this._eventsCount === 0)
      this._events = Object.create(null);
      else
      delete events[type];
    }
    return this;
    }

    // emit removeListener for all listeners on all events
    if (arguments.length === 0) {
    var keys = Object.keys(events);
    var key;
    for (i = 0; i < keys.length; ++i) {
      key = keys[i];
      if (key === 'removeListener') continue;
      this.removeAllListeners(key);
    }
    this.removeAllListeners('removeListener');
    this._events = Object.create(null);
    this._eventsCount = 0;
    return this;
    }

    listeners = events[type];

    if (typeof listeners === 'function') {
    this.removeListener(type, listeners);
    } else if (listeners !== undefined) {
    // LIFO order
    for (i = listeners.length - 1; i >= 0; i--) {
      this.removeListener(type, listeners[i]);
    }
    }

    return this;
  };

function _listeners(target, type, unwrap) {
  var events = target._events;

  if (events === undefined)
  return [];

  var evlistener = events[type];
  if (evlistener === undefined)
  return [];

  if (typeof evlistener === 'function')
  return unwrap ? [evlistener.listener || evlistener] : [evlistener];

  return unwrap ?
  unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}

EventEmitter.prototype.listeners = function listeners(type) {
  return _listeners(this, type, true);
};

EventEmitter.prototype.rawListeners = function rawListeners(type) {
  return _listeners(this, type, false);
};

EventEmitter.listenerCount = function(emitter, type) {
  if (typeof emitter.listenerCount === 'function') {
  return emitter.listenerCount(type);
  } else {
  return listenerCount.call(emitter, type);
  }
};

EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
  var events = this._events;

  if (events !== undefined) {
  var evlistener = events[type];

  if (typeof evlistener === 'function') {
    return 1;
  } else if (evlistener !== undefined) {
    return evlistener.length;
  }
  }

  return 0;
}

EventEmitter.prototype.eventNames = function eventNames() {
  return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};

function arrayClone(arr, n) {
  var copy = new Array(n);
  for (var i = 0; i < n; ++i)
  copy[i] = arr[i];
  return copy;
}

function spliceOne(list, index) {
  for (; index + 1 < list.length; index++)
  list[index] = list[index + 1];
  list.pop();
}

function unwrapListeners(arr) {
  var ret = new Array(arr.length);
  for (var i = 0; i < ret.length; ++i) {
  ret[i] = arr[i].listener || arr[i];
  }
  return ret;
}

function once$1(emitter, name) {
  return new Promise(function (resolve, reject) {
  function errorListener(err) {
    emitter.removeListener(name, resolver);
    reject(err);
  }

  function resolver() {
    if (typeof emitter.removeListener === 'function') {
    emitter.removeListener('error', errorListener);
    }
    resolve([].slice.call(arguments));
  }
  eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  if (name !== 'error') {
    addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  }
  });
}

function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  if (typeof emitter.on === 'function') {
  eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  }
}

function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  if (typeof emitter.on === 'function') {
  if (flags.once) {
    emitter.once(name, listener);
  } else {
    emitter.on(name, listener);
  }
  } else if (typeof emitter.addEventListener === 'function') {
  // EventTarget does not have `error` event semantics like Node
  // EventEmitters, we do not listen for `error` events here.
  emitter.addEventListener(name, function wrapListener(arg) {
    // IE does not have builtin `{ once: true }` support so we
    // have to do it manually.
    if (flags.once) {
    emitter.removeEventListener(name, wrapListener);
    }
    listener(arg);
  });
  } else {
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  }
}
events.once = once_1$1;

/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty$1.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};

var isBuffer = function isBuffer(arg) {
  return arg instanceof Buffer;
};

var inherits$2 = require$$0$1.inherits;

var util = createCommonjsModule(function (module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var formatRegExp = /%[sdj%]/g;
exports.format = function(f) {
  if (!isString(f)) {
  var objects = [];
  for (var i = 0; i < arguments.length; i++) {
    objects.push(inspect(arguments[i]));
  }
  return objects.join(' ');
  }

  var i = 1;
  var args = arguments;
  var len = args.length;
  var str = String(f).replace(formatRegExp, function(x) {
  if (x === '%%') return '%';
  if (i >= len) return x;
  switch (x) {
    case '%s': return String(args[i++]);
    case '%d': return Number(args[i++]);
    case '%j':
    try {
      return JSON.stringify(args[i++]);
    } catch (_) {
      return '[Circular]';
    }
    default:
    return x;
  }
  });
  for (var x = args[i]; i < len; x = args[++i]) {
  if (isNull(x) || !isObject(x)) {
    str += ' ' + x;
  } else {
    str += ' ' + inspect(x);
  }
  }
  return str;
};


// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) {
  // Allow for deprecating things in the process of starting up.
  if (isUndefined(commonjsGlobal.process)) {
  return function() {
    return exports.deprecate(fn, msg).apply(this, arguments);
  };
  }

  if (process.noDeprecation === true) {
  return fn;
  }

  var warned = false;
  function deprecated() {
  if (!warned) {
    if (process.throwDeprecation) {
    throw new Error(msg);
    } else if (process.traceDeprecation) {
    console.trace(msg);
    } else {
    console.error(msg);
    }
    warned = true;
  }
  return fn.apply(this, arguments);
  }

  return deprecated;
};


var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
  if (isUndefined(debugEnviron))
  debugEnviron = '';
  set = set.toUpperCase();
  if (!debugs[set]) {
  if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
    var pid = process.pid;
    debugs[set] = function() {
    var msg = exports.format.apply(exports, arguments);
    console.error('%s %d: %s', set, pid, msg);
    };
  } else {
    debugs[set] = function() {};
  }
  }
  return debugs[set];
};


/**
 * Echos the value of a value. Trys to print the value out
 * in the best way possible given the different types.
 *
 * @param {Object} obj The object to print out.
 * @param {Object} opts Optional options object that alters the output.
 */
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
  // default options
  var ctx = {
  seen: [],
  stylize: stylizeNoColor
  };
  // legacy...
  if (arguments.length >= 3) ctx.depth = arguments[2];
  if (arguments.length >= 4) ctx.colors = arguments[3];
  if (isBoolean(opts)) {
  // legacy...
  ctx.showHidden = opts;
  } else if (opts) {
  // got an "options" object
  exports._extend(ctx, opts);
  }
  // set default options
  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  if (isUndefined(ctx.depth)) ctx.depth = 2;
  if (isUndefined(ctx.colors)) ctx.colors = false;
  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  if (ctx.colors) ctx.stylize = stylizeWithColor;
  return formatValue(ctx, obj, ctx.depth);
}
exports.inspect = inspect;


// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
  'bold' : [1, 22],
  'italic' : [3, 23],
  'underline' : [4, 24],
  'inverse' : [7, 27],
  'white' : [37, 39],
  'grey' : [90, 39],
  'black' : [30, 39],
  'blue' : [34, 39],
  'cyan' : [36, 39],
  'green' : [32, 39],
  'magenta' : [35, 39],
  'red' : [31, 39],
  'yellow' : [33, 39]
};

// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
  'special': 'cyan',
  'number': 'yellow',
  'boolean': 'yellow',
  'undefined': 'grey',
  'null': 'bold',
  'string': 'green',
  'date': 'magenta',
  // "name": intentionally not styling
  'regexp': 'red'
};


function stylizeWithColor(str, styleType) {
  var style = inspect.styles[styleType];

  if (style) {
  return '\u001b[' + inspect.colors[style][0] + 'm' + str +
       '\u001b[' + inspect.colors[style][1] + 'm';
  } else {
  return str;
  }
}


function stylizeNoColor(str, styleType) {
  return str;
}


function arrayToHash(array) {
  var hash = {};

  array.forEach(function(val, idx) {
  hash[val] = true;
  });

  return hash;
}


function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (ctx.customInspect &&
    value &&
    isFunction(value.inspect) &&
    // Filter out the util module, it's inspect function is special
    value.inspect !== exports.inspect &&
    // Also filter out any prototype objects using the circular check.
    !(value.constructor && value.constructor.prototype === value)) {
  var ret = value.inspect(recurseTimes, ctx);
  if (!isString(ret)) {
    ret = formatValue(ctx, ret, recurseTimes);
  }
  return ret;
  }

  // Primitive types cannot have properties
  var primitive = formatPrimitive(ctx, value);
  if (primitive) {
  return primitive;
  }

  // Look up the keys of the object.
  var keys = Object.keys(value);
  var visibleKeys = arrayToHash(keys);

  if (ctx.showHidden) {
  keys = Object.getOwnPropertyNames(value);
  }

  // IE doesn't make error fields non-enumerable
  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  if (isError(value)
    && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  return formatError(value);
  }

  // Some type of object without properties can be shortcutted.
  if (keys.length === 0) {
  if (isFunction(value)) {
    var name = value.name ? ': ' + value.name : '';
    return ctx.stylize('[Function' + name + ']', 'special');
  }
  if (isRegExp(value)) {
    return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  }
  if (isDate(value)) {
    return ctx.stylize(Date.prototype.toString.call(value), 'date');
  }
  if (isError(value)) {
    return formatError(value);
  }
  }

  var base = '', array = false, braces = ['{', '}'];

  // Make Array say that they are Array
  if (isArray(value)) {
  array = true;
  braces = ['[', ']'];
  }

  // Make functions say that they are functions
  if (isFunction(value)) {
  var n = value.name ? ': ' + value.name : '';
  base = ' [Function' + n + ']';
  }

  // Make RegExps say that they are RegExps
  if (isRegExp(value)) {
  base = ' ' + RegExp.prototype.toString.call(value);
  }

  // Make dates with properties first say the date
  if (isDate(value)) {
  base = ' ' + Date.prototype.toUTCString.call(value);
  }

  // Make error with message first say the error
  if (isError(value)) {
  base = ' ' + formatError(value);
  }

  if (keys.length === 0 && (!array || value.length == 0)) {
  return braces[0] + base + braces[1];
  }

  if (recurseTimes < 0) {
  if (isRegExp(value)) {
    return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  } else {
    return ctx.stylize('[Object]', 'special');
  }
  }

  ctx.seen.push(value);

  var output;
  if (array) {
  output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  } else {
  output = keys.map(function(key) {
    return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  });
  }

  ctx.seen.pop();

  return reduceToSingleString(output, base, braces);
}


function formatPrimitive(ctx, value) {
  if (isUndefined(value))
  return ctx.stylize('undefined', 'undefined');
  if (isString(value)) {
  var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
                       .replace(/'/g, "\\'")
                       .replace(/\\"/g, '"') + '\'';
  return ctx.stylize(simple, 'string');
  }
  if (isNumber(value))
  return ctx.stylize('' + value, 'number');
  if (isBoolean(value))
  return ctx.stylize('' + value, 'boolean');
  // For some reason typeof null is "object", so special case here.
  if (isNull(value))
  return ctx.stylize('null', 'null');
}


function formatError(value) {
  return '[' + Error.prototype.toString.call(value) + ']';
}


function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  var output = [];
  for (var i = 0, l = value.length; i < l; ++i) {
  if (hasOwnProperty(value, String(i))) {
    output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
      String(i), true));
  } else {
    output.push('');
  }
  }
  keys.forEach(function(key) {
  if (!key.match(/^\d+$/)) {
    output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
      key, true));
  }
  });
  return output;
}


function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  var name, str, desc;
  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  if (desc.get) {
  if (desc.set) {
    str = ctx.stylize('[Getter/Setter]', 'special');
  } else {
    str = ctx.stylize('[Getter]', 'special');
  }
  } else {
  if (desc.set) {
    str = ctx.stylize('[Setter]', 'special');
  }
  }
  if (!hasOwnProperty(visibleKeys, key)) {
  name = '[' + key + ']';
  }
  if (!str) {
  if (ctx.seen.indexOf(desc.value) < 0) {
    if (isNull(recurseTimes)) {
    str = formatValue(ctx, desc.value, null);
    } else {
    str = formatValue(ctx, desc.value, recurseTimes - 1);
    }
    if (str.indexOf('\n') > -1) {
    if (array) {
      str = str.split('\n').map(function(line) {
      return '  ' + line;
      }).join('\n').substr(2);
    } else {
      str = '\n' + str.split('\n').map(function(line) {
      return '   ' + line;
      }).join('\n');
    }
    }
  } else {
    str = ctx.stylize('[Circular]', 'special');
  }
  }
  if (isUndefined(name)) {
  if (array && key.match(/^\d+$/)) {
    return str;
  }
  name = JSON.stringify('' + key);
  if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
    name = name.substr(1, name.length - 2);
    name = ctx.stylize(name, 'name');
  } else {
    name = name.replace(/'/g, "\\'")
         .replace(/\\"/g, '"')
         .replace(/(^"|"$)/g, "'");
    name = ctx.stylize(name, 'string');
  }
  }

  return name + ': ' + str;
}


function reduceToSingleString(output, base, braces) {
  var length = output.reduce(function(prev, cur) {
  if (cur.indexOf('\n') >= 0) ;
  return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  }, 0);

  if (length > 60) {
  return braces[0] +
       (base === '' ? '' : base + '\n ') +
       ' ' +
       output.join(',\n  ') +
       ' ' +
       braces[1];
  }

  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}


// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
  return Array.isArray(ar);
}
exports.isArray = isArray;

function isBoolean(arg) {
  return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;

function isNull(arg) {
  return arg === null;
}
exports.isNull = isNull;

function isNullOrUndefined(arg) {
  return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;

function isNumber(arg) {
  return typeof arg === 'number';
}
exports.isNumber = isNumber;

function isString(arg) {
  return typeof arg === 'string';
}
exports.isString = isString;

function isSymbol(arg) {
  return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;

function isUndefined(arg) {
  return arg === void 0;
}
exports.isUndefined = isUndefined;

function isRegExp(re) {
  return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;

function isObject(arg) {
  return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;

function isDate(d) {
  return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;

function isError(e) {
  return isObject(e) &&
    (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;

function isFunction(arg) {
  return typeof arg === 'function';
}
exports.isFunction = isFunction;

function isPrimitive(arg) {
  return arg === null ||
     typeof arg === 'boolean' ||
     typeof arg === 'number' ||
     typeof arg === 'string' ||
     typeof arg === 'symbol' ||  // ES6 symbol
     typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;

exports.isBuffer = isBuffer;

function objectToString(o) {
  return Object.prototype.toString.call(o);
}


function pad(n) {
  return n < 10 ? '0' + n.toString(10) : n.toString(10);
}


var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
        'Oct', 'Nov', 'Dec'];

// 26 Feb 16:19:34
function timestamp() {
  var d = new Date();
  var time = [pad(d.getHours()),
        pad(d.getMinutes()),
        pad(d.getSeconds())].join(':');
  return [d.getDate(), months[d.getMonth()], time].join(' ');
}


// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};


/**
 * Inherit the prototype methods from one constructor into another.
 *
 * The Function.prototype.inherits from lang.js rewritten as a standalone
 * function (not on Function.prototype). NOTE: If this file is to be loaded
 * during bootstrapping this function needs to be rewritten using some native
 * functions as prototype setup using normal JavaScript does not work as
 * expected during bootstrapping (see mirror.js in r114903).
 *
 * @param {function} ctor Constructor function which needs to inherit the
 *   prototype.
 * @param {function} superCtor Constructor function to inherit prototype from.
 */
exports.inherits = inherits$2;

exports._extend = function(origin, add) {
  // Don't do anything if add isn't an object
  if (!add || !isObject(add)) return origin;

  var keys = Object.keys(add);
  var i = keys.length;
  while (i--) {
  origin[keys[i]] = add[keys[i]];
  }
  return origin;
};

function hasOwnProperty(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}
});

var assert_1 = createCommonjsModule(function (module) {



// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
// original notice:

/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
function compare(a, b) {
  if (a === b) {
  return 0;
  }

  var x = a.length;
  var y = b.length;

  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  if (a[i] !== b[i]) {
    x = a[i];
    y = b[i];
    break;
  }
  }

  if (x < y) {
  return -1;
  }
  if (y < x) {
  return 1;
  }
  return 0;
}
function isBuffer(b) {
  if (commonjsGlobal.Buffer && typeof commonjsGlobal.Buffer.isBuffer === 'function') {
  return commonjsGlobal.Buffer.isBuffer(b);
  }
  return !!(b != null && b._isBuffer);
}

// based on node assert, original notice:
// NB: The URL to the CommonJS spec is kept just for tradition.
//   node-assert has evolved a lot since then, both in API and behavior.

// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
//
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
//
// Originally from narwhal.js (http://narwhaljs.org)
// Copyright (c) 2009 Thomas Robinson <280north.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the 'Software'), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


var hasOwn = Object.prototype.hasOwnProperty;
var pSlice = Array.prototype.slice;
var functionsHaveNames = (function () {
  return function foo() {}.name === 'foo';
}());
function pToString (obj) {
  return Object.prototype.toString.call(obj);
}
function isView(arrbuf) {
  if (isBuffer(arrbuf)) {
  return false;
  }
  if (typeof commonjsGlobal.ArrayBuffer !== 'function') {
  return false;
  }
  if (typeof ArrayBuffer.isView === 'function') {
  return ArrayBuffer.isView(arrbuf);
  }
  if (!arrbuf) {
  return false;
  }
  if (arrbuf instanceof DataView) {
  return true;
  }
  if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  return true;
  }
  return false;
}
// 1. The assert module provides functions that throw
// AssertionError's when particular conditions are not met. The
// assert module must conform to the following interface.

var assert = module.exports = ok;

// 2. The AssertionError is defined in assert.
// new assert.AssertionError({ message: message,
//               actual: actual,
//               expected: expected })

var regex = /\s*function\s+([^\(\s]*)\s*/;
// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
function getName(func) {
  if (!util.isFunction(func)) {
  return;
  }
  if (functionsHaveNames) {
  return func.name;
  }
  var str = func.toString();
  var match = str.match(regex);
  return match && match[1];
}
assert.AssertionError = function AssertionError(options) {
  this.name = 'AssertionError';
  this.actual = options.actual;
  this.expected = options.expected;
  this.operator = options.operator;
  if (options.message) {
  this.message = options.message;
  this.generatedMessage = false;
  } else {
  this.message = getMessage(this);
  this.generatedMessage = true;
  }
  var stackStartFunction = options.stackStartFunction || fail;
  if (Error.captureStackTrace) {
  Error.captureStackTrace(this, stackStartFunction);
  } else {
  // non v8 browsers so we can have a stacktrace
  var err = new Error();
  if (err.stack) {
    var out = err.stack;

    // try to strip useless frames
    var fn_name = getName(stackStartFunction);
    var idx = out.indexOf('\n' + fn_name);
    if (idx >= 0) {
    // once we have located the function frame
    // we need to strip out everything before it (and its line)
    var next_line = out.indexOf('\n', idx + 1);
    out = out.substring(next_line + 1);
    }

    this.stack = out;
  }
  }
};

// assert.AssertionError instanceof Error
util.inherits(assert.AssertionError, Error);

function truncate(s, n) {
  if (typeof s === 'string') {
  return s.length < n ? s : s.slice(0, n);
  } else {
  return s;
  }
}
function inspect(something) {
  if (functionsHaveNames || !util.isFunction(something)) {
  return util.inspect(something);
  }
  var rawname = getName(something);
  var name = rawname ? ': ' + rawname : '';
  return '[Function' +  name + ']';
}
function getMessage(self) {
  return truncate(inspect(self.actual), 128) + ' ' +
     self.operator + ' ' +
     truncate(inspect(self.expected), 128);
}

// At present only the three keys mentioned above are used and
// understood by the spec. Implementations or sub modules can pass
// other keys to the AssertionError's constructor - they will be
// ignored.

// 3. All of the following functions must throw an AssertionError
// when a corresponding condition is not met, with a message that
// may be undefined if not provided.  All assertion methods provide
// both the actual and expected values to the assertion error for
// display purposes.

function fail(actual, expected, message, operator, stackStartFunction) {
  throw new assert.AssertionError({
  message: message,
  actual: actual,
  expected: expected,
  operator: operator,
  stackStartFunction: stackStartFunction
  });
}

// EXTENSION! allows for well behaved errors defined elsewhere.
assert.fail = fail;

// 4. Pure assertion tests whether a value is truthy, as determined
// by !!guard.
// assert.ok(guard, message_opt);
// This statement is equivalent to assert.equal(true, !!guard,
// message_opt);. To test strictly for the value true, use
// assert.strictEqual(true, guard, message_opt);.

function ok(value, message) {
  if (!value) fail(value, true, message, '==', assert.ok);
}
assert.ok = ok;

// 5. The equality assertion tests shallow, coercive equality with
// ==.
// assert.equal(actual, expected, message_opt);

assert.equal = function equal(actual, expected, message) {
  if (actual != expected) fail(actual, expected, message, '==', assert.equal);
};

// 6. The non-equality assertion tests for whether two objects are not equal
// with != assert.notEqual(actual, expected, message_opt);

assert.notEqual = function notEqual(actual, expected, message) {
  if (actual == expected) {
  fail(actual, expected, message, '!=', assert.notEqual);
  }
};

// 7. The equivalence assertion tests a deep equality relation.
// assert.deepEqual(actual, expected, message_opt);

assert.deepEqual = function deepEqual(actual, expected, message) {
  if (!_deepEqual(actual, expected, false)) {
  fail(actual, expected, message, 'deepEqual', assert.deepEqual);
  }
};

assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  if (!_deepEqual(actual, expected, true)) {
  fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
  }
};

function _deepEqual(actual, expected, strict, memos) {
  // 7.1. All identical values are equivalent, as determined by ===.
  if (actual === expected) {
  return true;
  } else if (isBuffer(actual) && isBuffer(expected)) {
  return compare(actual, expected) === 0;

  // 7.2. If the expected value is a Date object, the actual value is
  // equivalent if it is also a Date object that refers to the same time.
  } else if (util.isDate(actual) && util.isDate(expected)) {
  return actual.getTime() === expected.getTime();

  // 7.3 If the expected value is a RegExp object, the actual value is
  // equivalent if it is also a RegExp object with the same source and
  // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
  } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  return actual.source === expected.source &&
       actual.global === expected.global &&
       actual.multiline === expected.multiline &&
       actual.lastIndex === expected.lastIndex &&
       actual.ignoreCase === expected.ignoreCase;

  // 7.4. Other pairs that do not both pass typeof value == 'object',
  // equivalence is determined by ==.
  } else if ((actual === null || typeof actual !== 'object') &&
       (expected === null || typeof expected !== 'object')) {
  return strict ? actual === expected : actual == expected;

  // If both values are instances of typed arrays, wrap their underlying
  // ArrayBuffers in a Buffer each to increase performance
  // This optimization requires the arrays to have the same type as checked by
  // Object.prototype.toString (aka pToString). Never perform binary
  // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
  // bit patterns are not identical.
  } else if (isView(actual) && isView(expected) &&
       pToString(actual) === pToString(expected) &&
       !(actual instanceof Float32Array ||
         actual instanceof Float64Array)) {
  return compare(new Uint8Array(actual.buffer),
           new Uint8Array(expected.buffer)) === 0;

  // 7.5 For all other Object pairs, including Array objects, equivalence is
  // determined by having the same number of owned properties (as verified
  // with Object.prototype.hasOwnProperty.call), the same set of keys
  // (although not necessarily the same order), equivalent values for every
  // corresponding key, and an identical 'prototype' property. Note: this
  // accounts for both named and indexed properties on Arrays.
  } else if (isBuffer(actual) !== isBuffer(expected)) {
  return false;
  } else {
  memos = memos || {actual: [], expected: []};

  var actualIndex = memos.actual.indexOf(actual);
  if (actualIndex !== -1) {
    if (actualIndex === memos.expected.indexOf(expected)) {
    return true;
    }
  }

  memos.actual.push(actual);
  memos.expected.push(expected);

  return objEquiv(actual, expected, strict, memos);
  }
}

function isArguments(object) {
  return Object.prototype.toString.call(object) == '[object Arguments]';
}

function objEquiv(a, b, strict, actualVisitedObjects) {
  if (a === null || a === undefined || b === null || b === undefined)
  return false;
  // if one is a primitive, the other must be same
  if (util.isPrimitive(a) || util.isPrimitive(b))
  return a === b;
  if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
  return false;
  var aIsArgs = isArguments(a);
  var bIsArgs = isArguments(b);
  if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
  return false;
  if (aIsArgs) {
  a = pSlice.call(a);
  b = pSlice.call(b);
  return _deepEqual(a, b, strict);
  }
  var ka = objectKeys(a);
  var kb = objectKeys(b);
  var key, i;
  // having the same number of owned properties (keys incorporates
  // hasOwnProperty)
  if (ka.length !== kb.length)
  return false;
  //the same set of keys (although not necessarily the same order),
  ka.sort();
  kb.sort();
  //~~~cheap key test
  for (i = ka.length - 1; i >= 0; i--) {
  if (ka[i] !== kb[i])
    return false;
  }
  //equivalent values for every corresponding key, and
  //~~~possibly expensive deep test
  for (i = ka.length - 1; i >= 0; i--) {
  key = ka[i];
  if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
    return false;
  }
  return true;
}

// 8. The non-equivalence assertion tests for any deep inequality.
// assert.notDeepEqual(actual, expected, message_opt);

assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  if (_deepEqual(actual, expected, false)) {
  fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
  }
};

assert.notDeepStrictEqual = notDeepStrictEqual;
function notDeepStrictEqual(actual, expected, message) {
  if (_deepEqual(actual, expected, true)) {
  fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
  }
}


// 9. The strict equality assertion tests strict equality, as determined by ===.
// assert.strictEqual(actual, expected, message_opt);

assert.strictEqual = function strictEqual(actual, expected, message) {
  if (actual !== expected) {
  fail(actual, expected, message, '===', assert.strictEqual);
  }
};

// 10. The strict non-equality assertion tests for strict inequality, as
// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);

assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  if (actual === expected) {
  fail(actual, expected, message, '!==', assert.notStrictEqual);
  }
};

function expectedException(actual, expected) {
  if (!actual || !expected) {
  return false;
  }

  if (Object.prototype.toString.call(expected) == '[object RegExp]') {
  return expected.test(actual);
  }

  try {
  if (actual instanceof expected) {
    return true;
  }
  } catch (e) {
  // Ignore.  The instanceof check doesn't work for arrow functions.
  }

  if (Error.isPrototypeOf(expected)) {
  return false;
  }

  return expected.call({}, actual) === true;
}

function _tryBlock(block) {
  var error;
  try {
  block();
  } catch (e) {
  error = e;
  }
  return error;
}

function _throws(shouldThrow, block, expected, message) {
  var actual;

  if (typeof block !== 'function') {
  throw new TypeError('"block" argument must be a function');
  }

  if (typeof expected === 'string') {
  message = expected;
  expected = null;
  }

  actual = _tryBlock(block);

  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
      (message ? ' ' + message : '.');

  if (shouldThrow && !actual) {
  fail(actual, expected, 'Missing expected exception' + message);
  }

  var userProvidedMessage = typeof message === 'string';
  var isUnwantedException = !shouldThrow && util.isError(actual);
  var isUnexpectedException = !shouldThrow && actual && !expected;

  if ((isUnwantedException &&
    userProvidedMessage &&
    expectedException(actual, expected)) ||
    isUnexpectedException) {
  fail(actual, expected, 'Got unwanted exception' + message);
  }

  if ((shouldThrow && actual && expected &&
    !expectedException(actual, expected)) || (!shouldThrow && actual)) {
  throw actual;
  }
}

// 11. Expected to throw an error:
// assert.throws(block, Error_opt, message_opt);

assert.throws = function(block, /*optional*/error, /*optional*/message) {
  _throws(true, block, error, message);
};

// EXTENSION! This is annoying to write outside this module.
assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
  _throws(false, block, error, message);
};

assert.ifError = function(err) { if (err) throw err; };

// Expose a strict only variant of assert
function strict(value, message) {
  if (!value) fail(value, true, message, '==', strict);
}
assert.strict = objectAssign(strict, assert, {
  equal: assert.strictEqual,
  deepEqual: assert.deepStrictEqual,
  notEqual: assert.notStrictEqual,
  notDeepEqual: assert.notDeepStrictEqual
});
assert.strict.strict = assert.strict;

var objectKeys = Object.keys || function (obj) {
  var keys = [];
  for (var key in obj) {
  if (hasOwn.call(obj, key)) keys.push(key);
  }
  return keys;
};
});

function posix(path) {
	return path.charAt(0) === '/';
}

function win32(path) {
	// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
	var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
	var result = splitDeviceRe.exec(path);
	var device = result[1] || '';
	var isUnc = Boolean(device && device.charAt(1) !== ':');

	// UNC paths are always absolute
	return Boolean(result[2] || isUnc);
}

var pathIsAbsolute = process.platform === 'win32' ? win32 : posix;
var posix_1 = posix;
var win32_1 = win32;
pathIsAbsolute.posix = posix_1;
pathIsAbsolute.win32 = win32_1;

var setopts_1 = setopts$2;
var ownProp_1 = ownProp$2;
var makeAbs_1 = makeAbs;
var finish_1 = finish;
var mark_1 = mark;
var isIgnored_1 = isIgnored$2;
var childrenIgnored_1 = childrenIgnored$2;

function ownProp$2 (obj, field) {
  return Object.prototype.hasOwnProperty.call(obj, field)
}





var Minimatch = minimatch_1.Minimatch;

function alphasort (a, b) {
  return a.localeCompare(b, 'en')
}

function setupIgnores (self, options) {
  self.ignore = options.ignore || [];

  if (!Array.isArray(self.ignore))
  self.ignore = [self.ignore];

  if (self.ignore.length) {
  self.ignore = self.ignore.map(ignoreMap);
  }
}

// ignore patterns are always in dot:true mode.
function ignoreMap (pattern) {
  var gmatcher = null;
  if (pattern.slice(-3) === '/**') {
  var gpattern = pattern.replace(/(\/\*\*)+$/, '');
  gmatcher = new Minimatch(gpattern, { dot: true });
  }

  return {
  matcher: new Minimatch(pattern, { dot: true }),
  gmatcher: gmatcher
  }
}

function setopts$2 (self, pattern, options) {
  if (!options)
  options = {};

  // base-matching: just use globstar for that.
  if (options.matchBase && -1 === pattern.indexOf("/")) {
  if (options.noglobstar) {
    throw new Error("base matching requires globstar")
  }
  pattern = "**/" + pattern;
  }

  self.silent = !!options.silent;
  self.pattern = pattern;
  self.strict = options.strict !== false;
  self.realpath = !!options.realpath;
  self.realpathCache = options.realpathCache || Object.create(null);
  self.follow = !!options.follow;
  self.dot = !!options.dot;
  self.mark = !!options.mark;
  self.nodir = !!options.nodir;
  if (self.nodir)
  self.mark = true;
  self.sync = !!options.sync;
  self.nounique = !!options.nounique;
  self.nonull = !!options.nonull;
  self.nosort = !!options.nosort;
  self.nocase = !!options.nocase;
  self.stat = !!options.stat;
  self.noprocess = !!options.noprocess;
  self.absolute = !!options.absolute;
  self.fs = options.fs || fs$3;

  self.maxLength = options.maxLength || Infinity;
  self.cache = options.cache || Object.create(null);
  self.statCache = options.statCache || Object.create(null);
  self.symlinks = options.symlinks || Object.create(null);

  setupIgnores(self, options);

  self.changedCwd = false;
  var cwd = process.cwd();
  if (!ownProp$2(options, "cwd"))
  self.cwd = cwd;
  else {
  self.cwd = path$5.resolve(options.cwd);
  self.changedCwd = self.cwd !== cwd;
  }

  self.root = options.root || path$5.resolve(self.cwd, "/");
  self.root = path$5.resolve(self.root);
  if (process.platform === "win32")
  self.root = self.root.replace(/\\/g, "/");

  // TODO: is an absolute `cwd` supposed to be resolved against `root`?
  // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
  self.cwdAbs = pathIsAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd);
  if (process.platform === "win32")
  self.cwdAbs = self.cwdAbs.replace(/\\/g, "/");
  self.nomount = !!options.nomount;

  // disable comments and negation in Minimatch.
  // Note that they are not supported in Glob itself anyway.
  options.nonegate = true;
  options.nocomment = true;
  // always treat \ in patterns as escapes, not path separators
  options.allowWindowsEscape = false;

  self.minimatch = new Minimatch(pattern, options);
  self.options = self.minimatch.options;
}

function finish (self) {
  var nou = self.nounique;
  var all = nou ? [] : Object.create(null);

  for (var i = 0, l = self.matches.length; i < l; i ++) {
  var matches = self.matches[i];
  if (!matches || Object.keys(matches).length === 0) {
    if (self.nonull) {
    // do like the shell, and spit out the literal glob
    var literal = self.minimatch.globSet[i];
    if (nou)
      all.push(literal);
    else
      all[literal] = true;
    }
  } else {
    // had matches
    var m = Object.keys(matches);
    if (nou)
    all.push.apply(all, m);
    else
    m.forEach(function (m) {
      all[m] = true;
    });
  }
  }

  if (!nou)
  all = Object.keys(all);

  if (!self.nosort)
  all = all.sort(alphasort);

  // at *some* point we statted all of these
  if (self.mark) {
  for (var i = 0; i < all.length; i++) {
    all[i] = self._mark(all[i]);
  }
  if (self.nodir) {
    all = all.filter(function (e) {
    var notDir = !(/\/$/.test(e));
    var c = self.cache[e] || self.cache[makeAbs(self, e)];
    if (notDir && c)
      notDir = c !== 'DIR' && !Array.isArray(c);
    return notDir
    });
  }
  }

  if (self.ignore.length)
  all = all.filter(function(m) {
    return !isIgnored$2(self, m)
  });

  self.found = all;
}

function mark (self, p) {
  var abs = makeAbs(self, p);
  var c = self.cache[abs];
  var m = p;
  if (c) {
  var isDir = c === 'DIR' || Array.isArray(c);
  var slash = p.slice(-1) === '/';

  if (isDir && !slash)
    m += '/';
  else if (!isDir && slash)
    m = m.slice(0, -1);

  if (m !== p) {
    var mabs = makeAbs(self, m);
    self.statCache[mabs] = self.statCache[abs];
    self.cache[mabs] = self.cache[abs];
  }
  }

  return m
}

// lotta situps...
function makeAbs (self, f) {
  var abs = f;
  if (f.charAt(0) === '/') {
  abs = path$5.join(self.root, f);
  } else if (pathIsAbsolute(f) || f === '') {
  abs = f;
  } else if (self.changedCwd) {
  abs = path$5.resolve(self.cwd, f);
  } else {
  abs = path$5.resolve(f);
  }

  if (process.platform === 'win32')
  abs = abs.replace(/\\/g, '/');

  return abs
}


// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
function isIgnored$2 (self, path) {
  if (!self.ignore.length)
  return false

  return self.ignore.some(function(item) {
  return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  })
}

function childrenIgnored$2 (self, path) {
  if (!self.ignore.length)
  return false

  return self.ignore.some(function(item) {
  return !!(item.gmatcher && item.gmatcher.match(path))
  })
}

var common$2 = {
	setopts: setopts_1,
	ownProp: ownProp_1,
	makeAbs: makeAbs_1,
	finish: finish_1,
	mark: mark_1,
	isIgnored: isIgnored_1,
	childrenIgnored: childrenIgnored_1
};

var sync = globSync;
globSync.GlobSync = GlobSync$1;





var setopts$1 = common$2.setopts;
var ownProp$1 = common$2.ownProp;
var childrenIgnored$1 = common$2.childrenIgnored;
var isIgnored$1 = common$2.isIgnored;

function globSync (pattern, options) {
  if (typeof options === 'function' || arguments.length === 3)
  throw new TypeError('callback provided to sync glob\n'+
            'See: https://github.com/isaacs/node-glob/issues/167')

  return new GlobSync$1(pattern, options).found
}

function GlobSync$1 (pattern, options) {
  if (!pattern)
  throw new Error('must provide pattern')

  if (typeof options === 'function' || arguments.length === 3)
  throw new TypeError('callback provided to sync glob\n'+
            'See: https://github.com/isaacs/node-glob/issues/167')

  if (!(this instanceof GlobSync$1))
  return new GlobSync$1(pattern, options)

  setopts$1(this, pattern, options);

  if (this.noprocess)
  return this

  var n = this.minimatch.set.length;
  this.matches = new Array(n);
  for (var i = 0; i < n; i ++) {
  this._process(this.minimatch.set[i], i, false);
  }
  this._finish();
}

GlobSync$1.prototype._finish = function () {
  assert_1.ok(this instanceof GlobSync$1);
  if (this.realpath) {
  var self = this;
  this.matches.forEach(function (matchset, index) {
    var set = self.matches[index] = Object.create(null);
    for (var p in matchset) {
    try {
      p = self._makeAbs(p);
      var real = fs_realpath.realpathSync(p, self.realpathCache);
      set[real] = true;
    } catch (er) {
      if (er.syscall === 'stat')
      set[self._makeAbs(p)] = true;
      else
      throw er
    }
    }
  });
  }
  common$2.finish(this);
};


GlobSync$1.prototype._process = function (pattern, index, inGlobStar) {
  assert_1.ok(this instanceof GlobSync$1);

  // Get the first [n] parts of pattern that are all strings.
  var n = 0;
  while (typeof pattern[n] === 'string') {
  n ++;
  }
  // now n is the index of the first one that is *not* a string.

  // See if there's anything else
  var prefix;
  switch (n) {
  // if not, then this is rather simple
  case pattern.length:
    this._processSimple(pattern.join('/'), index);
    return

  case 0:
    // pattern *starts* with some non-trivial item.
    // going to readdir(cwd), but not include the prefix in matches.
    prefix = null;
    break

  default:
    // pattern has some string bits in the front.
    // whatever it starts with, whether that's 'absolute' like /foo/bar,
    // or 'relative' like '../baz'
    prefix = pattern.slice(0, n).join('/');
    break
  }

  var remain = pattern.slice(n);

  // get the list of entries.
  var read;
  if (prefix === null)
  read = '.';
  else if (pathIsAbsolute(prefix) ||
    pathIsAbsolute(pattern.map(function (p) {
    return typeof p === 'string' ? p : '[*]'
    }).join('/'))) {
  if (!prefix || !pathIsAbsolute(prefix))
    prefix = '/' + prefix;
  read = prefix;
  } else
  read = prefix;

  var abs = this._makeAbs(read);

  //if ignored, skip processing
  if (childrenIgnored$1(this, read))
  return

  var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
  if (isGlobStar)
  this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
  else
  this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
};


GlobSync$1.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  var entries = this._readdir(abs, inGlobStar);

  // if the abs isn't a dir, then nothing can match!
  if (!entries)
  return

  // It will only match dot entries if it starts with a dot, or if
  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
  var pn = remain[0];
  var negate = !!this.minimatch.negate;
  var rawGlob = pn._glob;
  var dotOk = this.dot || rawGlob.charAt(0) === '.';

  var matchedEntries = [];
  for (var i = 0; i < entries.length; i++) {
  var e = entries[i];
  if (e.charAt(0) !== '.' || dotOk) {
    var m;
    if (negate && !prefix) {
    m = !e.match(pn);
    } else {
    m = e.match(pn);
    }
    if (m)
    matchedEntries.push(e);
  }
  }

  var len = matchedEntries.length;
  // If there are no matched entries, then nothing matches.
  if (len === 0)
  return

  // if this is the last remaining pattern bit, then no need for
  // an additional stat *unless* the user has specified mark or
  // stat explicitly.  We know they exist, since readdir returned
  // them.

  if (remain.length === 1 && !this.mark && !this.stat) {
  if (!this.matches[index])
    this.matches[index] = Object.create(null);

  for (var i = 0; i < len; i ++) {
    var e = matchedEntries[i];
    if (prefix) {
    if (prefix.slice(-1) !== '/')
      e = prefix + '/' + e;
    else
      e = prefix + e;
    }

    if (e.charAt(0) === '/' && !this.nomount) {
    e = path$5.join(this.root, e);
    }
    this._emitMatch(index, e);
  }
  // This was the last one, and no stats were needed
  return
  }

  // now test all matched entries as stand-ins for that part
  // of the pattern.
  remain.shift();
  for (var i = 0; i < len; i ++) {
  var e = matchedEntries[i];
  var newPattern;
  if (prefix)
    newPattern = [prefix, e];
  else
    newPattern = [e];
  this._process(newPattern.concat(remain), index, inGlobStar);
  }
};


GlobSync$1.prototype._emitMatch = function (index, e) {
  if (isIgnored$1(this, e))
  return

  var abs = this._makeAbs(e);

  if (this.mark)
  e = this._mark(e);

  if (this.absolute) {
  e = abs;
  }

  if (this.matches[index][e])
  return

  if (this.nodir) {
  var c = this.cache[abs];
  if (c === 'DIR' || Array.isArray(c))
    return
  }

  this.matches[index][e] = true;

  if (this.stat)
  this._stat(e);
};


GlobSync$1.prototype._readdirInGlobStar = function (abs) {
  // follow all symlinked directories forever
  // just proceed as if this is a non-globstar situation
  if (this.follow)
  return this._readdir(abs, false)

  var entries;
  var lstat;
  try {
  lstat = this.fs.lstatSync(abs);
  } catch (er) {
  if (er.code === 'ENOENT') {
    // lstat failed, doesn't exist
    return null
  }
  }

  var isSym = lstat && lstat.isSymbolicLink();
  this.symlinks[abs] = isSym;

  // If it's not a symlink or a dir, then it's definitely a regular file.
  // don't bother doing a readdir in that case.
  if (!isSym && lstat && !lstat.isDirectory())
  this.cache[abs] = 'FILE';
  else
  entries = this._readdir(abs, false);

  return entries
};

GlobSync$1.prototype._readdir = function (abs, inGlobStar) {

  if (inGlobStar && !ownProp$1(this.symlinks, abs))
  return this._readdirInGlobStar(abs)

  if (ownProp$1(this.cache, abs)) {
  var c = this.cache[abs];
  if (!c || c === 'FILE')
    return null

  if (Array.isArray(c))
    return c
  }

  try {
  return this._readdirEntries(abs, this.fs.readdirSync(abs))
  } catch (er) {
  this._readdirError(abs, er);
  return null
  }
};

GlobSync$1.prototype._readdirEntries = function (abs, entries) {
  // if we haven't asked to stat everything, then just
  // assume that everything in there exists, so we can avoid
  // having to stat it a second time.
  if (!this.mark && !this.stat) {
  for (var i = 0; i < entries.length; i ++) {
    var e = entries[i];
    if (abs === '/')
    e = abs + e;
    else
    e = abs + '/' + e;
    this.cache[e] = true;
  }
  }

  this.cache[abs] = entries;

  // mark and cache dir-ness
  return entries
};

GlobSync$1.prototype._readdirError = function (f, er) {
  // handle errors, and cache the information
  switch (er.code) {
  case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  case 'ENOTDIR': // totally normal. means it *does* exist.
    var abs = this._makeAbs(f);
    this.cache[abs] = 'FILE';
    if (abs === this.cwdAbs) {
    var error = new Error(er.code + ' invalid cwd ' + this.cwd);
    error.path = this.cwd;
    error.code = er.code;
    throw error
    }
    break

  case 'ENOENT': // not terribly unusual
  case 'ELOOP':
  case 'ENAMETOOLONG':
  case 'UNKNOWN':
    this.cache[this._makeAbs(f)] = false;
    break

  default: // some unusual error.  Treat as failure.
    this.cache[this._makeAbs(f)] = false;
    if (this.strict)
    throw er
    if (!this.silent)
    console.error('glob error', er);
    break
  }
};

GlobSync$1.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {

  var entries = this._readdir(abs, inGlobStar);

  // no entries means not a dir, so it can never have matches
  // foo.txt/** doesn't match foo.txt
  if (!entries)
  return

  // test without the globstar, and with every child both below
  // and replacing the globstar.
  var remainWithoutGlobStar = remain.slice(1);
  var gspref = prefix ? [ prefix ] : [];
  var noGlobStar = gspref.concat(remainWithoutGlobStar);

  // the noGlobStar pattern exits the inGlobStar state
  this._process(noGlobStar, index, false);

  var len = entries.length;
  var isSym = this.symlinks[abs];

  // If it's a symlink, and we're in a globstar, then stop
  if (isSym && inGlobStar)
  return

  for (var i = 0; i < len; i++) {
  var e = entries[i];
  if (e.charAt(0) === '.' && !this.dot)
    continue

  // these two cases enter the inGlobStar state
  var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  this._process(instead, index, true);

  var below = gspref.concat(entries[i], remain);
  this._process(below, index, true);
  }
};

GlobSync$1.prototype._processSimple = function (prefix, index) {
  // XXX review this.  Shouldn't it be doing the mounting etc
  // before doing stat?  kinda weird?
  var exists = this._stat(prefix);

  if (!this.matches[index])
  this.matches[index] = Object.create(null);

  // If it doesn't exist, then just mark the lack of results
  if (!exists)
  return

  if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
  var trail = /[\/\\]$/.test(prefix);
  if (prefix.charAt(0) === '/') {
    prefix = path$5.join(this.root, prefix);
  } else {
    prefix = path$5.resolve(this.root, prefix);
    if (trail)
    prefix += '/';
  }
  }

  if (process.platform === 'win32')
  prefix = prefix.replace(/\\/g, '/');

  // Mark this as a match
  this._emitMatch(index, prefix);
};

// Returns either 'DIR', 'FILE', or false
GlobSync$1.prototype._stat = function (f) {
  var abs = this._makeAbs(f);
  var needDir = f.slice(-1) === '/';

  if (f.length > this.maxLength)
  return false

  if (!this.stat && ownProp$1(this.cache, abs)) {
  var c = this.cache[abs];

  if (Array.isArray(c))
    c = 'DIR';

  // It exists, but maybe not how we need it
  if (!needDir || c === 'DIR')
    return c

  if (needDir && c === 'FILE')
    return false

  // otherwise we have to stat, because maybe c=true
  // if we know it exists, but not what it is.
  }
  var stat = this.statCache[abs];
  if (!stat) {
  var lstat;
  try {
    lstat = this.fs.lstatSync(abs);
  } catch (er) {
    if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
    this.statCache[abs] = false;
    return false
    }
  }

  if (lstat && lstat.isSymbolicLink()) {
    try {
    stat = this.fs.statSync(abs);
    } catch (er) {
    stat = lstat;
    }
  } else {
    stat = lstat;
  }
  }

  this.statCache[abs] = stat;

  var c = true;
  if (stat)
  c = stat.isDirectory() ? 'DIR' : 'FILE';

  this.cache[abs] = this.cache[abs] || c;

  if (needDir && c === 'FILE')
  return false

  return c
};

GlobSync$1.prototype._mark = function (p) {
  return common$2.mark(this, p)
};

GlobSync$1.prototype._makeAbs = function (f) {
  return common$2.makeAbs(this, f)
};

// Returns a wrapper function that returns a wrapped callback
// The wrapper function should do some stuff, and return a
// presumably different callback function.
// This makes sure that own properties are retained, so that
// decorations and such are not lost along the way.
var wrappy_1 = wrappy;
function wrappy (fn, cb) {
  if (fn && cb) return wrappy(fn)(cb)

  if (typeof fn !== 'function')
  throw new TypeError('need wrapper function')

  Object.keys(fn).forEach(function (k) {
  wrapper[k] = fn[k];
  });

  return wrapper

  function wrapper() {
  var args = new Array(arguments.length);
  for (var i = 0; i < args.length; i++) {
    args[i] = arguments[i];
  }
  var ret = fn.apply(this, args);
  var cb = args[args.length-1];
  if (typeof ret === 'function' && ret !== cb) {
    Object.keys(cb).forEach(function (k) {
    ret[k] = cb[k];
    });
  }
  return ret
  }
}

var once_1 = wrappy_1(once);
var strict = wrappy_1(onceStrict);

once.proto = once(function () {
  Object.defineProperty(Function.prototype, 'once', {
  value: function () {
    return once(this)
  },
  configurable: true
  });

  Object.defineProperty(Function.prototype, 'onceStrict', {
  value: function () {
    return onceStrict(this)
  },
  configurable: true
  });
});

function once (fn) {
  var f = function () {
  if (f.called) return f.value
  f.called = true;
  return f.value = fn.apply(this, arguments)
  };
  f.called = false;
  return f
}

function onceStrict (fn) {
  var f = function () {
  if (f.called)
    throw new Error(f.onceError)
  f.called = true;
  return f.value = fn.apply(this, arguments)
  };
  var name = fn.name || 'Function wrapped with `once`';
  f.onceError = name + " shouldn't be called more than once";
  f.called = false;
  return f
}
once_1.strict = strict;

var reqs = Object.create(null);


var inflight_1 = wrappy_1(inflight);

function inflight (key, cb) {
  if (reqs[key]) {
  reqs[key].push(cb);
  return null
  } else {
  reqs[key] = [cb];
  return makeres(key)
  }
}

function makeres (key) {
  return once_1(function RES () {
  var cbs = reqs[key];
  var len = cbs.length;
  var args = slice(arguments);

  // XXX It's somewhat ambiguous whether a new callback added in this
  // pass should be queued for later execution if something in the
  // list of callbacks throws, or if it should just be discarded.
  // However, it's such an edge case that it hardly matters, and either
  // choice is likely as surprising as the other.
  // As it happens, we do go ahead and schedule it for later execution.
  try {
    for (var i = 0; i < len; i++) {
    cbs[i].apply(null, args);
    }
  } finally {
    if (cbs.length > len) {
    // added more in the interim.
    // de-zalgo, just in case, but don't call again.
    cbs.splice(0, len);
    process.nextTick(function () {
      RES.apply(null, args);
    });
    } else {
    delete reqs[key];
    }
  }
  })
}

function slice (args) {
  var length = args.length;
  var array = [];

  for (var i = 0; i < length; i++) array[i] = args[i];
  return array
}

// Approach:
//
// 1. Get the minimatch set
// 2. For each pattern in the set, PROCESS(pattern, false)
// 3. Store matches per-set, then uniq them
//
// PROCESS(pattern, inGlobStar)
// Get the first [n] items from pattern that are all strings
// Join these together.  This is PREFIX.
//   If there is no more remaining, then stat(PREFIX) and
//   add to matches if it succeeds.  END.
//
// If inGlobStar and PREFIX is symlink and points to dir
//   set ENTRIES = []
// else readdir(PREFIX) as ENTRIES
//   If fail, END
//
// with ENTRIES
//   If pattern[n] is GLOBSTAR
//   // handle the case where the globstar match is empty
//   // by pruning it out, and testing the resulting pattern
//   PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
//   // handle other cases.
//   for ENTRY in ENTRIES (not dotfiles)
//     // attach globstar + tail onto the entry
//     // Mark that this entry is a globstar match
//     PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
//
//   else // not globstar
//   for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
//     Test ENTRY against pattern[n]
//     If fails, continue
//     If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
//
// Caveat:
//   Cache all stats and readdirs results to minimize syscall.  Since all
//   we ever care about is existence and directory-ness, we can just keep
//   `true` for files, and [children,...] for directories, or `false` for
//   things that don't exist.

var glob_1 = glob;

var EE = events.EventEmitter;





var setopts = common$2.setopts;
var ownProp = common$2.ownProp;


var childrenIgnored = common$2.childrenIgnored;
var isIgnored = common$2.isIgnored;



function glob (pattern, options, cb) {
  if (typeof options === 'function') cb = options, options = {};
  if (!options) options = {};

  if (options.sync) {
  if (cb)
    throw new TypeError('callback provided to sync glob')
  return sync(pattern, options)
  }

  return new Glob(pattern, options, cb)
}

glob.sync = sync;
var GlobSync = glob.GlobSync = sync.GlobSync;

// old api surface
glob.glob = glob;

function extend (origin, add) {
  if (add === null || typeof add !== 'object') {
  return origin
  }

  var keys = Object.keys(add);
  var i = keys.length;
  while (i--) {
  origin[keys[i]] = add[keys[i]];
  }
  return origin
}

glob.hasMagic = function (pattern, options_) {
  var options = extend({}, options_);
  options.noprocess = true;

  var g = new Glob(pattern, options);
  var set = g.minimatch.set;

  if (!pattern)
  return false

  if (set.length > 1)
  return true

  for (var j = 0; j < set[0].length; j++) {
  if (typeof set[0][j] !== 'string')
    return true
  }

  return false
};

glob.Glob = Glob;
inherits$1(Glob, EE);
function Glob (pattern, options, cb) {
  if (typeof options === 'function') {
  cb = options;
  options = null;
  }

  if (options && options.sync) {
  if (cb)
    throw new TypeError('callback provided to sync glob')
  return new GlobSync(pattern, options)
  }

  if (!(this instanceof Glob))
  return new Glob(pattern, options, cb)

  setopts(this, pattern, options);
  this._didRealPath = false;

  // process each pattern in the minimatch set
  var n = this.minimatch.set.length;

  // The matches are stored as {<filename>: true,...} so that
  // duplicates are automagically pruned.
  // Later, we do an Object.keys() on these.
  // Keep them as a list so we can fill in when nonull is set.
  this.matches = new Array(n);

  if (typeof cb === 'function') {
  cb = once_1(cb);
  this.on('error', cb);
  this.on('end', function (matches) {
    cb(null, matches);
  });
  }

  var self = this;
  this._processing = 0;

  this._emitQueue = [];
  this._processQueue = [];
  this.paused = false;

  if (this.noprocess)
  return this

  if (n === 0)
  return done()

  var sync = true;
  for (var i = 0; i < n; i ++) {
  this._process(this.minimatch.set[i], i, false, done);
  }
  sync = false;

  function done () {
  --self._processing;
  if (self._processing <= 0) {
    if (sync) {
    process.nextTick(function () {
      self._finish();
    });
    } else {
    self._finish();
    }
  }
  }
}

Glob.prototype._finish = function () {
  assert_1(this instanceof Glob);
  if (this.aborted)
  return

  if (this.realpath && !this._didRealpath)
  return this._realpath()

  common$2.finish(this);
  this.emit('end', this.found);
};

Glob.prototype._realpath = function () {
  if (this._didRealpath)
  return

  this._didRealpath = true;

  var n = this.matches.length;
  if (n === 0)
  return this._finish()

  var self = this;
  for (var i = 0; i < this.matches.length; i++)
  this._realpathSet(i, next);

  function next () {
  if (--n === 0)
    self._finish();
  }
};

Glob.prototype._realpathSet = function (index, cb) {
  var matchset = this.matches[index];
  if (!matchset)
  return cb()

  var found = Object.keys(matchset);
  var self = this;
  var n = found.length;

  if (n === 0)
  return cb()

  var set = this.matches[index] = Object.create(null);
  found.forEach(function (p, i) {
  // If there's a problem with the stat, then it means that
  // one or more of the links in the realpath couldn't be
  // resolved.  just return the abs value in that case.
  p = self._makeAbs(p);
  fs_realpath.realpath(p, self.realpathCache, function (er, real) {
    if (!er)
    set[real] = true;
    else if (er.syscall === 'stat')
    set[p] = true;
    else
    self.emit('error', er); // srsly wtf right here

    if (--n === 0) {
    self.matches[index] = set;
    cb();
    }
  });
  });
};

Glob.prototype._mark = function (p) {
  return common$2.mark(this, p)
};

Glob.prototype._makeAbs = function (f) {
  return common$2.makeAbs(this, f)
};

Glob.prototype.abort = function () {
  this.aborted = true;
  this.emit('abort');
};

Glob.prototype.pause = function () {
  if (!this.paused) {
  this.paused = true;
  this.emit('pause');
  }
};

Glob.prototype.resume = function () {
  if (this.paused) {
  this.emit('resume');
  this.paused = false;
  if (this._emitQueue.length) {
    var eq = this._emitQueue.slice(0);
    this._emitQueue.length = 0;
    for (var i = 0; i < eq.length; i ++) {
    var e = eq[i];
    this._emitMatch(e[0], e[1]);
    }
  }
  if (this._processQueue.length) {
    var pq = this._processQueue.slice(0);
    this._processQueue.length = 0;
    for (var i = 0; i < pq.length; i ++) {
    var p = pq[i];
    this._processing--;
    this._process(p[0], p[1], p[2], p[3]);
    }
  }
  }
};

Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  assert_1(this instanceof Glob);
  assert_1(typeof cb === 'function');

  if (this.aborted)
  return

  this._processing++;
  if (this.paused) {
  this._processQueue.push([pattern, index, inGlobStar, cb]);
  return
  }

  //console.error('PROCESS %d', this._processing, pattern)

  // Get the first [n] parts of pattern that are all strings.
  var n = 0;
  while (typeof pattern[n] === 'string') {
  n ++;
  }
  // now n is the index of the first one that is *not* a string.

  // see if there's anything else
  var prefix;
  switch (n) {
  // if not, then this is rather simple
  case pattern.length:
    this._processSimple(pattern.join('/'), index, cb);
    return

  case 0:
    // pattern *starts* with some non-trivial item.
    // going to readdir(cwd), but not include the prefix in matches.
    prefix = null;
    break

  default:
    // pattern has some string bits in the front.
    // whatever it starts with, whether that's 'absolute' like /foo/bar,
    // or 'relative' like '../baz'
    prefix = pattern.slice(0, n).join('/');
    break
  }

  var remain = pattern.slice(n);

  // get the list of entries.
  var read;
  if (prefix === null)
  read = '.';
  else if (pathIsAbsolute(prefix) ||
    pathIsAbsolute(pattern.map(function (p) {
    return typeof p === 'string' ? p : '[*]'
    }).join('/'))) {
  if (!prefix || !pathIsAbsolute(prefix))
    prefix = '/' + prefix;
  read = prefix;
  } else
  read = prefix;

  var abs = this._makeAbs(read);

  //if ignored, skip _processing
  if (childrenIgnored(this, read))
  return cb()

  var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
  if (isGlobStar)
  this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
  else
  this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
};

Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  var self = this;
  this._readdir(abs, inGlobStar, function (er, entries) {
  return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  });
};

Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {

  // if the abs isn't a dir, then nothing can match!
  if (!entries)
  return cb()

  // It will only match dot entries if it starts with a dot, or if
  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
  var pn = remain[0];
  var negate = !!this.minimatch.negate;
  var rawGlob = pn._glob;
  var dotOk = this.dot || rawGlob.charAt(0) === '.';

  var matchedEntries = [];
  for (var i = 0; i < entries.length; i++) {
  var e = entries[i];
  if (e.charAt(0) !== '.' || dotOk) {
    var m;
    if (negate && !prefix) {
    m = !e.match(pn);
    } else {
    m = e.match(pn);
    }
    if (m)
    matchedEntries.push(e);
  }
  }

  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)

  var len = matchedEntries.length;
  // If there are no matched entries, then nothing matches.
  if (len === 0)
  return cb()

  // if this is the last remaining pattern bit, then no need for
  // an additional stat *unless* the user has specified mark or
  // stat explicitly.  We know they exist, since readdir returned
  // them.

  if (remain.length === 1 && !this.mark && !this.stat) {
  if (!this.matches[index])
    this.matches[index] = Object.create(null);

  for (var i = 0; i < len; i ++) {
    var e = matchedEntries[i];
    if (prefix) {
    if (prefix !== '/')
      e = prefix + '/' + e;
    else
      e = prefix + e;
    }

    if (e.charAt(0) === '/' && !this.nomount) {
    e = path$5.join(this.root, e);
    }
    this._emitMatch(index, e);
  }
  // This was the last one, and no stats were needed
  return cb()
  }

  // now test all matched entries as stand-ins for that part
  // of the pattern.
  remain.shift();
  for (var i = 0; i < len; i ++) {
  var e = matchedEntries[i];
  if (prefix) {
    if (prefix !== '/')
    e = prefix + '/' + e;
    else
    e = prefix + e;
  }
  this._process([e].concat(remain), index, inGlobStar, cb);
  }
  cb();
};

Glob.prototype._emitMatch = function (index, e) {
  if (this.aborted)
  return

  if (isIgnored(this, e))
  return

  if (this.paused) {
  this._emitQueue.push([index, e]);
  return
  }

  var abs = pathIsAbsolute(e) ? e : this._makeAbs(e);

  if (this.mark)
  e = this._mark(e);

  if (this.absolute)
  e = abs;

  if (this.matches[index][e])
  return

  if (this.nodir) {
  var c = this.cache[abs];
  if (c === 'DIR' || Array.isArray(c))
    return
  }

  this.matches[index][e] = true;

  var st = this.statCache[abs];
  if (st)
  this.emit('stat', e, st);

  this.emit('match', e);
};

Glob.prototype._readdirInGlobStar = function (abs, cb) {
  if (this.aborted)
  return

  // follow all symlinked directories forever
  // just proceed as if this is a non-globstar situation
  if (this.follow)
  return this._readdir(abs, false, cb)

  var lstatkey = 'lstat\0' + abs;
  var self = this;
  var lstatcb = inflight_1(lstatkey, lstatcb_);

  if (lstatcb)
  self.fs.lstat(abs, lstatcb);

  function lstatcb_ (er, lstat) {
  if (er && er.code === 'ENOENT')
    return cb()

  var isSym = lstat && lstat.isSymbolicLink();
  self.symlinks[abs] = isSym;

  // If it's not a symlink or a dir, then it's definitely a regular file.
  // don't bother doing a readdir in that case.
  if (!isSym && lstat && !lstat.isDirectory()) {
    self.cache[abs] = 'FILE';
    cb();
  } else
    self._readdir(abs, false, cb);
  }
};

Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  if (this.aborted)
  return

  cb = inflight_1('readdir\0'+abs+'\0'+inGlobStar, cb);
  if (!cb)
  return

  //console.error('RD %j %j', +inGlobStar, abs)
  if (inGlobStar && !ownProp(this.symlinks, abs))
  return this._readdirInGlobStar(abs, cb)

  if (ownProp(this.cache, abs)) {
  var c = this.cache[abs];
  if (!c || c === 'FILE')
    return cb()

  if (Array.isArray(c))
    return cb(null, c)
  }

  var self = this;
  self.fs.readdir(abs, readdirCb(this, abs, cb));
};

function readdirCb (self, abs, cb) {
  return function (er, entries) {
  if (er)
    self._readdirError(abs, er, cb);
  else
    self._readdirEntries(abs, entries, cb);
  }
}

Glob.prototype._readdirEntries = function (abs, entries, cb) {
  if (this.aborted)
  return

  // if we haven't asked to stat everything, then just
  // assume that everything in there exists, so we can avoid
  // having to stat it a second time.
  if (!this.mark && !this.stat) {
  for (var i = 0; i < entries.length; i ++) {
    var e = entries[i];
    if (abs === '/')
    e = abs + e;
    else
    e = abs + '/' + e;
    this.cache[e] = true;
  }
  }

  this.cache[abs] = entries;
  return cb(null, entries)
};

Glob.prototype._readdirError = function (f, er, cb) {
  if (this.aborted)
  return

  // handle errors, and cache the information
  switch (er.code) {
  case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  case 'ENOTDIR': // totally normal. means it *does* exist.
    var abs = this._makeAbs(f);
    this.cache[abs] = 'FILE';
    if (abs === this.cwdAbs) {
    var error = new Error(er.code + ' invalid cwd ' + this.cwd);
    error.path = this.cwd;
    error.code = er.code;
    this.emit('error', error);
    this.abort();
    }
    break

  case 'ENOENT': // not terribly unusual
  case 'ELOOP':
  case 'ENAMETOOLONG':
  case 'UNKNOWN':
    this.cache[this._makeAbs(f)] = false;
    break

  default: // some unusual error.  Treat as failure.
    this.cache[this._makeAbs(f)] = false;
    if (this.strict) {
    this.emit('error', er);
    // If the error is handled, then we abort
    // if not, we threw out of here
    this.abort();
    }
    if (!this.silent)
    console.error('glob error', er);
    break
  }

  return cb()
};

Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  var self = this;
  this._readdir(abs, inGlobStar, function (er, entries) {
  self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  });
};


Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  //console.error('pgs2', prefix, remain[0], entries)

  // no entries means not a dir, so it can never have matches
  // foo.txt/** doesn't match foo.txt
  if (!entries)
  return cb()

  // test without the globstar, and with every child both below
  // and replacing the globstar.
  var remainWithoutGlobStar = remain.slice(1);
  var gspref = prefix ? [ prefix ] : [];
  var noGlobStar = gspref.concat(remainWithoutGlobStar);

  // the noGlobStar pattern exits the inGlobStar state
  this._process(noGlobStar, index, false, cb);

  var isSym = this.symlinks[abs];
  var len = entries.length;

  // If it's a symlink, and we're in a globstar, then stop
  if (isSym && inGlobStar)
  return cb()

  for (var i = 0; i < len; i++) {
  var e = entries[i];
  if (e.charAt(0) === '.' && !this.dot)
    continue

  // these two cases enter the inGlobStar state
  var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  this._process(instead, index, true, cb);

  var below = gspref.concat(entries[i], remain);
  this._process(below, index, true, cb);
  }

  cb();
};

Glob.prototype._processSimple = function (prefix, index, cb) {
  // XXX review this.  Shouldn't it be doing the mounting etc
  // before doing stat?  kinda weird?
  var self = this;
  this._stat(prefix, function (er, exists) {
  self._processSimple2(prefix, index, er, exists, cb);
  });
};
Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {

  //console.error('ps2', prefix, exists)

  if (!this.matches[index])
  this.matches[index] = Object.create(null);

  // If it doesn't exist, then just mark the lack of results
  if (!exists)
  return cb()

  if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
  var trail = /[\/\\]$/.test(prefix);
  if (prefix.charAt(0) === '/') {
    prefix = path$5.join(this.root, prefix);
  } else {
    prefix = path$5.resolve(this.root, prefix);
    if (trail)
    prefix += '/';
  }
  }

  if (process.platform === 'win32')
  prefix = prefix.replace(/\\/g, '/');

  // Mark this as a match
  this._emitMatch(index, prefix);
  cb();
};

// Returns either 'DIR', 'FILE', or false
Glob.prototype._stat = function (f, cb) {
  var abs = this._makeAbs(f);
  var needDir = f.slice(-1) === '/';

  if (f.length > this.maxLength)
  return cb()

  if (!this.stat && ownProp(this.cache, abs)) {
  var c = this.cache[abs];

  if (Array.isArray(c))
    c = 'DIR';

  // It exists, but maybe not how we need it
  if (!needDir || c === 'DIR')
    return cb(null, c)

  if (needDir && c === 'FILE')
    return cb()

  // otherwise we have to stat, because maybe c=true
  // if we know it exists, but not what it is.
  }
  var stat = this.statCache[abs];
  if (stat !== undefined) {
  if (stat === false)
    return cb(null, stat)
  else {
    var type = stat.isDirectory() ? 'DIR' : 'FILE';
    if (needDir && type === 'FILE')
    return cb()
    else
    return cb(null, type, stat)
  }
  }

  var self = this;
  var statcb = inflight_1('stat\0' + abs, lstatcb_);
  if (statcb)
  self.fs.lstat(abs, statcb);

  function lstatcb_ (er, lstat) {
  if (lstat && lstat.isSymbolicLink()) {
    // If it's a symlink, then treat it as the target, unless
    // the target does not exist, then treat it as a file.
    return self.fs.stat(abs, function (er, stat) {
    if (er)
      self._stat2(f, abs, null, lstat, cb);
    else
      self._stat2(f, abs, er, stat, cb);
    })
  } else {
    self._stat2(f, abs, er, lstat, cb);
  }
  }
};

Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  this.statCache[abs] = false;
  return cb()
  }

  var needDir = f.slice(-1) === '/';
  this.statCache[abs] = stat;

  if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
  return cb(null, false, stat)

  var c = true;
  if (stat)
  c = stat.isDirectory() ? 'DIR' : 'FILE';
  this.cache[abs] = this.cache[abs] || c;

  if (needDir && c === 'FILE')
  return cb()

  return cb(null, c, stat)
};

var peerDependencies = {
	rollup: "^2.22.0"
};

const PROXY_SUFFIX = '?commonjs-proxy';
const getProxyId = (id) => `\0${id}${PROXY_SUFFIX}`;
const getIdFromProxyId = (proxyId) => proxyId.slice(1, -PROXY_SUFFIX.length);

const EXTERNAL_SUFFIX = '?commonjs-external';
const getExternalProxyId = (id) => `\0${id}${EXTERNAL_SUFFIX}`;
const getIdFromExternalProxyId = (proxyId) => proxyId.slice(1, -EXTERNAL_SUFFIX.length);

const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
  if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);
  return path;
};

const DYNAMIC_REGISTER_PREFIX = '\0commonjs-dynamic-register:';
const DYNAMIC_JSON_PREFIX = '\0commonjs-dynamic-json:';
const DYNAMIC_PACKAGES_ID = '\0commonjs-dynamic-packages';

const HELPERS_ID = '\0commonjsHelpers.js';

// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
// This will no longer be necessary once Rollup switches to ES6 output, likely
// in Rollup 3

// The "hasOwnProperty" call in "getDefaultExportFromCjs" is technically not
// needed, but for consumers that use Rollup's old interop pattern, it will fix
// rollup/rollup-plugin-commonjs#224
// We should remove it once Rollup core and this plugin are updated to not use
// this pattern any more
const HELPERS = `
export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

export function getDefaultExportFromCjs (x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}

export function createCommonjsModule(fn, basedir, module) {
	return module = {
		path: basedir,
		exports: {},
		require: function (path, base) {
			return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
		}
	}, fn(module, module.exports), module.exports;
}

export function getDefaultExportFromNamespaceIfPresent (n) {
	return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
}

export function getDefaultExportFromNamespaceIfNotNamed (n) {
	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
}

export function getAugmentedNamespace(n) {
	if (n.__esModule) return n;
	var a = Object.defineProperty({}, '__esModule', {value: true});
	Object.keys(n).forEach(function (k) {
		var d = Object.getOwnPropertyDescriptor(n, k);
		Object.defineProperty(a, k, d.get ? d : {
			enumerable: true,
			get: function () {
				return n[k];
			}
		});
	});
	return a;
}
`;

const HELPER_NON_DYNAMIC = `
export function commonjsRequire () {
	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
}
`;

const HELPERS_DYNAMIC = `
export function commonjsRegister (path, loader) {
	DYNAMIC_REQUIRE_LOADERS[path] = loader;
}

const DYNAMIC_REQUIRE_LOADERS = Object.create(null);
const DYNAMIC_REQUIRE_CACHE = Object.create(null);
const DEFAULT_PARENT_MODULE = {
	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []
};
const CHECKED_EXTENSIONS = ['', '.js', '.json'];

function normalize (path) {
	path = path.replace(/\\\\/g, '/');
	const parts = path.split('/');
	const slashed = parts[0] === '';
	for (let i = 1; i < parts.length; i++) {
		if (parts[i] === '.' || parts[i] === '') {
			parts.splice(i--, 1);
		}
	}
	for (let i = 1; i < parts.length; i++) {
		if (parts[i] !== '..') continue;
		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {
			parts.splice(--i, 2);
			i--;
		}
	}
	path = parts.join('/');
	if (slashed && path[0] !== '/')
	  path = '/' + path;
	else if (path.length === 0)
	  path = '.';
	return path;
}

function join () {
	if (arguments.length === 0)
	  return '.';
	let joined;
	for (let i = 0; i < arguments.length; ++i) {
	  let arg = arguments[i];
	  if (arg.length > 0) {
		if (joined === undefined)
		  joined = arg;
		else
		  joined += '/' + arg;
	  }
	}
	if (joined === undefined)
	  return '.';

	return joined;
}

function isPossibleNodeModulesPath (modulePath) {
	let c0 = modulePath[0];
	if (c0 === '/' || c0 === '\\\\') return false;
	let c1 = modulePath[1], c2 = modulePath[2];
	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||
		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;
	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))
		return false;
	return true;
}

function dirname (path) {
  if (path.length === 0)
  return '.';

  let i = path.length - 1;
  while (i > 0) {
  const c = path.charCodeAt(i);
  if ((c === 47 || c === 92) && i !== path.length - 1)
    break;
  i--;
  }

  if (i > 0)
  return path.substr(0, i);

  if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)
  return path.charAt(0);

  return '.';
}

export function commonjsRequire (path, originalModuleDir) {
	const shouldTryNodeModules = isPossibleNodeModulesPath(path);
	path = normalize(path);
	let relPath;
	while (true) {
		if (!shouldTryNodeModules) {
			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;
		} else if (originalModuleDir) {
			relPath = normalize(originalModuleDir + '/node_modules/' + path);
		} else {
			relPath = normalize(join('node_modules', path));
		}
		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {
			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];
			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
			if (cachedModule) return cachedModule.exports;
			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
			if (loader) {
				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
					id: resolvedPath,
					filename: resolvedPath,
					path: dirname(resolvedPath),
					exports: {},
					parent: DEFAULT_PARENT_MODULE,
					loaded: false,
					children: [],
					paths: [],
					require: function (path, base) {
					  return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
					}
				};
				try {
					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
				} catch (error) {
					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
					throw error;
				}
				cachedModule.loaded = true;
				return cachedModule.exports;
			};
		}
		if (!shouldTryNodeModules) break;
		const nextDir = normalize(originalModuleDir + '/..');
		if (nextDir === originalModuleDir) break;
		originalModuleDir = nextDir;
	}
	return require(path);
}

commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;
`;

function getHelpersModule(isDynamicRequireModulesEnabled) {
  return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;
}

/* eslint-disable no-undefined */

const operators = {
  '==': (x) => equals(x.left, x.right, false),

  '!=': (x) => not(operators['=='](x)),

  '===': (x) => equals(x.left, x.right, true),

  '!==': (x) => not(operators['==='](x)),

  '!': (x) => isFalsy(x.argument),

  '&&': (x) => isTruthy(x.left) && isTruthy(x.right),

  '||': (x) => isTruthy(x.left) || isTruthy(x.right)
};

function flatten(node) {
  const parts = [];

  while (node.type === 'MemberExpression') {
  if (node.computed) return null;

  parts.unshift(node.property.name);
  // eslint-disable-next-line no-param-reassign
  node = node.object;
  }

  if (node.type !== 'Identifier') return null;

  const { name } = node;
  parts.unshift(name);

  return { name, keypath: parts.join('.') };
}

function isTruthy(node) {
  if (node.type === 'Literal') return !!node.value;
  if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
  if (node.operator in operators) return operators[node.operator](node);
  return undefined;
}

function isFalsy(node) {
  return not(isTruthy(node));
}

function not(value) {
  return value === undefined ? value : !value;
}

function equals(a, b, strict) {
  if (a.type !== b.type) return undefined;
  // eslint-disable-next-line eqeqeq
  if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
  return undefined;
}

/* eslint-disable import/prefer-default-export */

function getName(id) {
  const name = makeLegalIdentifier$1(basename(id, extname$1(id)));
  if (name !== 'index') {
  return name;
  }
  const segments = dirname(id).split(sep);
  return makeLegalIdentifier$1(segments[segments.length - 1]);
}

/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */

const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(
  ' '
);
const blacklist = { __esModule: true };
reserved.forEach((word) => (blacklist[word] = true));

const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;

const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;

function deconflict(scope, globals, identifier) {
  let i = 1;
  let deconflicted = makeLegalIdentifier$1(identifier);

  while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
  deconflicted = `${identifier}_${i}`;
  i += 1;
  }
  scope.declarations[deconflicted] = true;

  return deconflicted;
}

function tryParse(parse, code, id) {
  try {
  return parse(code, { allowReturnOutsideFunction: true });
  } catch (err) {
  err.message += ` in ${id}`;
  throw err;
  }
}

function normalizePathSlashes(path) {
  return path.replace(/\\/g, '/');
}

function hasCjsKeywords(code, ignoreGlobal) {
  const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
  return firstpass.test(code);
}

function checkEsModule(parse, code, id) {
  const ast = tryParse(parse, code, id);

  let isEsModule = false;
  let hasDefaultExport = false;
  let hasNamedExports = false;
  for (const node of ast.body) {
  if (node.type === 'ExportDefaultDeclaration') {
    isEsModule = true;
    hasDefaultExport = true;
  } else if (node.type === 'ExportNamedDeclaration') {
    isEsModule = true;
    if (node.declaration) {
    hasNamedExports = true;
    } else {
    for (const specifier of node.specifiers) {
      if (specifier.exported.name === 'default') {
      hasDefaultExport = true;
      } else {
      hasNamedExports = true;
      }
    }
    }
  } else if (node.type === 'ExportAllDeclaration') {
    isEsModule = true;
    if (node.exported && node.exported.name === 'default') {
    hasDefaultExport = true;
    } else {
    hasNamedExports = true;
    }
  } else if (node.type === 'ImportDeclaration') {
    isEsModule = true;
  }
  }

  return { isEsModule, hasDefaultExport, hasNamedExports, ast };
}

function getDefinePropertyCallName(node, targetName) {
  if (node.type !== 'CallExpression') return;

  const {
  callee: { object, property }
  } = node;

  if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;

  if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;

  if (node.arguments.length !== 3) return;

  const [target, val] = node.arguments;
  if (target.type !== 'Identifier' || target.name !== targetName) return;
  // eslint-disable-next-line consistent-return
  return val.value;
}

function transformCommonjs(
  parse,
  code,
  id,
  isEsModule,
  ignoreGlobal,
  ignoreRequire,
  sourceMap,
  isDynamicRequireModulesEnabled,
  dynamicRequireModuleSet,
  commonDir,
  astCache
) {
  const ast = astCache || tryParse(parse, code, id);

  const magicString = new MagicString$1(code);

  const required = {};
  // Because objects have no guaranteed ordering, yet we need it,
  // we need to keep track of the order in a array
  const sources = [];

  let uid = 0;

  let scope = attachScopes$1(ast, 'scope');
  const uses = { module: false, exports: false, global: false, require: false };

  let lexicalDepth = 0;
  let programDepth = 0;

  const globals = new Set();

  // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
  const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');

  // TODO handle transpiled modules
  let shouldWrap = /__esModule/.test(code);
  let usesCommonjsHelpers = false;

  function isRequireStatement(node) {
  if (!node) return false;
  if (node.type !== 'CallExpression') return false;

  // Weird case of `require()` or `module.require()` without arguments
  if (node.arguments.length === 0) return false;

  return isRequireIdentifier(node.callee);
  }

  function isRequireIdentifier(node) {
  if (!node) return false;

  if (node.type === 'Identifier' && node.name === 'require' /* `require` */) {
    // `require` is hidden by a variable in local scope
    if (scope.contains('require')) return false;

    return true;
  } else if (node.type === 'MemberExpression' /* `[something].[something]` */) {
    // `module.[something]`
    if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false;

    // `module` is hidden by a variable in local scope
    if (scope.contains('module')) return false;

    // `module.require(...)`
    if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;

    return true;
  }

  return false;
  }

  function hasDynamicArguments(node) {
  return (
    node.arguments.length > 1 ||
    (node.arguments[0].type !== 'Literal' &&
    (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
  );
  }

  function isStaticRequireStatement(node) {
  if (!isRequireStatement(node)) return false;
  return !hasDynamicArguments(node);
  }

  function isNodeRequireStatement(parent) {
  const reservedMethod = ['resolve', 'cache', 'main'];
  return !!(parent && parent.property && reservedMethod.indexOf(parent.property.name) > -1);
  }

  function isIgnoredRequireStatement(requiredNode) {
  return ignoreRequire(requiredNode.arguments[0].value);
  }

  function getRequireStringArg(node) {
  return node.arguments[0].type === 'Literal'
    ? node.arguments[0].value
    : node.arguments[0].quasis[0].value.cooked;
  }

  function getRequired(node, name) {
  let sourceId = getRequireStringArg(node);
  const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);
  if (isDynamicRegister) {
    sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);
  }

  const existing = required[sourceId];
  // eslint-disable-next-line no-undefined
  if (existing === undefined) {
    const isDynamic = hasDynamicModuleForPath(sourceId);

    if (!name) {
    do {
      name = `require$$${uid}`;
      uid += 1;
    } while (scope.contains(name));
    }

    if (isDynamicRegister && sourceId.endsWith('.json')) {
    sourceId = DYNAMIC_JSON_PREFIX + sourceId;
    }

    if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {
    sources.push([sourceId, !isDynamicRegister]);
    }

    required[sourceId] = { source: sourceId, name, importsDefault: false, isDynamic };
  }

  return required[sourceId];
  }

  function hasDynamicModuleForPath(source) {
  if (!/[/\\]/.test(source)) {
    try {
    const resolvedPath = normalizePathSlashes(
      resolve$2.sync(source, { basedir: dirname(id) })
    );
    if (dynamicRequireModuleSet.has(resolvedPath)) {
      return true;
    }
    } catch (ex) {
    // Probably a node.js internal module
    return false;
    }

    return false;
  }

  for (const attemptExt of ['', '.js', '.json']) {
    const resolvedPath = normalizePathSlashes(resolve$3(dirname(id), source + attemptExt));
    if (dynamicRequireModuleSet.has(resolvedPath)) {
    return true;
    }
  }

  return false;
  }

  function shouldUseSimulatedRequire(required) {
  return (
    hasDynamicModuleForPath(required.source) &&
    // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.
    (required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'))
  );
  }

  // do a first pass, see which names are assigned to. This is necessary to prevent
  // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
  // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
  const assignedTo = new Set();
  walk(ast, {
  enter(node) {
    if (node.type !== 'AssignmentExpression') return;
    if (node.left.type === 'MemberExpression') return;

    extractAssignedNames$1(node.left).forEach((name) => {
    assignedTo.add(name);
    });
  }
  });

  walk(ast, {
  enter(node, parent) {
    if (sourceMap) {
    magicString.addSourcemapLocation(node.start);
    magicString.addSourcemapLocation(node.end);
    }

    // skip dead branches
    if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {
    if (node === parent.consequent && isFalsy(parent.test)) {
      this.skip();
      return;
    }
    if (node === parent.alternate && isTruthy(parent.test)) {
      this.skip();
      return;
    }
    }

    if (node._skip) {
    this.skip();
    return;
    }

    programDepth += 1;

    if (node.scope) ({ scope } = node);
    if (functionType.test(node.type)) lexicalDepth += 1;

    // if toplevel return, we need to wrap it
    if (node.type === 'ReturnStatement' && lexicalDepth === 0) {
    shouldWrap = true;
    }

    // rewrite `this` as `commonjsHelpers.commonjsGlobal`
    if (node.type === 'ThisExpression' && lexicalDepth === 0) {
    uses.global = true;
    if (!ignoreGlobal) {
      magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
      storeName: true
      });
      usesCommonjsHelpers = true;
    }
    return;
    }

    // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
    if (node.type === 'UnaryExpression' && node.operator === 'typeof') {
    const flattened = flatten(node.argument);
    if (!flattened) return;

    if (scope.contains(flattened.name)) return;

    if (
      flattened.keypath === 'module.exports' ||
      flattened.keypath === 'module' ||
      flattened.keypath === 'exports'
    ) {
      magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });
    }
    }

    // rewrite `require` (if not already handled) `global` and `define`, and handle free references to
    // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule
    if (node.type === 'Identifier') {
    if (isReference(node, parent) && !scope.contains(node.name)) {
      if (node.name in uses) {
      if (isRequireIdentifier(node)) {
        if (isNodeRequireStatement(parent)) {
        return;
        }

        if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {
        return;
        }

        if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {
        magicString.appendLeft(
          parent.end - 1,
          `,${JSON.stringify(
          dirname(id) === '.'
            ? null /* default behavior */
            : getVirtualPathForDynamicRequirePath(
              normalizePathSlashes(dirname(id)),
              commonDir
            )
          )}`
        );
        }

        magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
        storeName: true
        });
        usesCommonjsHelpers = true;
      }

      uses[node.name] = true;
      if (node.name === 'global' && !ignoreGlobal) {
        magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
        storeName: true
        });
        usesCommonjsHelpers = true;
      }

      // if module or exports are used outside the context of an assignment
      // expression, we need to wrap the module
      if (node.name === 'module' || node.name === 'exports') {
        shouldWrap = true;
      }
      }

      if (node.name === 'define') {
      magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });
      }

      globals.add(node.name);
    }

    return;
    }

    // Is this an assignment to exports or module.exports?
    if (node.type === 'AssignmentExpression') {
    if (node.left.type !== 'MemberExpression') return;

    const flattened = flatten(node.left);
    if (!flattened) return;

    if (scope.contains(flattened.name)) return;

    const match = exportsPattern.exec(flattened.keypath);
    if (!match || flattened.keypath === 'exports') return;

    uses[flattened.name] = true;

    // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
    // if this isn't top-level, we'll need to wrap the module
    if (programDepth > 3) shouldWrap = true;

    node.left._skip = true;

    if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
      node.right.properties.forEach((prop) => {
      if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
      const { name } = prop.key;
      if (name === makeLegalIdentifier$1(name)) ;
      });
      return;
    }
    return;
    }

    const name = getDefinePropertyCallName(node, 'exports');
    if (name && name === makeLegalIdentifier$1(name)) ;

    // if this is `var x = require('x')`, we can do `import x from 'x'`
    if (
    node.type === 'VariableDeclarator' &&
    node.id.type === 'Identifier' &&
    isStaticRequireStatement(node.init) &&
    !isIgnoredRequireStatement(node.init)
    ) {
    // for now, only do this for top-level requires. maybe fix this in future
    if (scope.parent) return;

    // edge case — CJS allows you to assign to imports. ES doesn't
    if (assignedTo.has(node.id.name)) return;

    const required = getRequired(node.init, node.id.name);
    required.importsDefault = true;

    if (required.name === node.id.name && !required.isDynamic) {
      node._shouldRemove = true;
    }
    }

    if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {
    return;
    }

    const required = getRequired(node);

    if (parent.type === 'ExpressionStatement') {
    // is a bare import, e.g. `require('foo');`
    magicString.remove(parent.start, parent.end);
    } else {
    required.importsDefault = true;

    if (shouldUseSimulatedRequire(required)) {
      magicString.overwrite(
      node.start,
      node.end,
      `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(
        getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir)
      )}, ${JSON.stringify(
        dirname(id) === '.'
        ? null /* default behavior */
        : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
      )})`
      );
      usesCommonjsHelpers = true;
    } else {
      magicString.overwrite(node.start, node.end, required.name);
    }
    }

    node.callee._skip = true;
  },

  leave(node) {
    programDepth -= 1;
    if (node.scope) scope = scope.parent;
    if (functionType.test(node.type)) lexicalDepth -= 1;

    if (node.type === 'VariableDeclaration') {
    let keepDeclaration = false;
    let c = node.declarations[0].start;

    for (let i = 0; i < node.declarations.length; i += 1) {
      const declarator = node.declarations[i];

      if (declarator._shouldRemove) {
      magicString.remove(c, declarator.end);
      } else {
      if (!keepDeclaration) {
        magicString.remove(c, declarator.start);
        keepDeclaration = true;
      }

      c = declarator.end;
      }
    }

    if (!keepDeclaration) {
      magicString.remove(node.start, node.end);
    }
    }
  }
  });

  if (
  !sources.length &&
  !uses.module &&
  !uses.exports &&
  !uses.require &&
  (ignoreGlobal || !uses.global)
  ) {
  // not a CommonJS module
  return null;
  }

  // If `isEsModule` is on, it means it has ES6 import/export statements,
  //   which just can't be wrapped in a function.
  if (isEsModule) shouldWrap = false;

  usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;

  const importBlock = `${(usesCommonjsHelpers
  ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`]
  : []
  )
  .concat(
    sources.map(
    ([source]) =>
      // import the actual module before the proxy, so that we know
      // what kind of proxy to build
      `import '${source}';`
    ),
    sources
    .filter(([, importProxy]) => importProxy)
    .map(([source]) => {
      const { name, importsDefault } = required[source];
      return `import ${importsDefault ? `${name} from ` : ``}'${
      source.startsWith('\0') ? source : getProxyId(source)
      }';`;
    })
  )
  .join('\n')}\n\n`;

  const namedExportDeclarations = [];
  let wrapperStart = '';
  let wrapperEnd = '';

  const moduleName = deconflict(scope, globals, getName(id));
  if (!isEsModule) {
  const exportModuleExports = {
    str: `export { ${moduleName} as __moduleExports };`,
    name: '__moduleExports'
  };

  namedExportDeclarations.push(exportModuleExports);
  }

  const defaultExportPropertyAssignments = [];
  let hasDefaultExport = false;

  if (shouldWrap) {
  const args = `module${uses.exports ? ', exports' : ''}`;

  wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`;

  wrapperEnd = `\n}`;
  if (isDynamicRequireModulesEnabled) {
    wrapperEnd += `, ${JSON.stringify(
    getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
    )}`;
  }

  wrapperEnd += `);`;
  } else {
  const names = [];

  for (const node of ast.body) {
    if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {
    const { left } = node.expression;
    const flattened = flatten(left);

    if (!flattened) {
      continue;
    }

    const match = exportsPattern.exec(flattened.keypath);
    if (!match) {
      continue;
    }

    if (flattened.keypath === 'module.exports') {
      hasDefaultExport = true;
      magicString.overwrite(left.start, left.end, `var ${moduleName}`);
    } else {
      const [, name] = match;
      const deconflicted = deconflict(scope, globals, name);

      names.push({ name, deconflicted });

      magicString.overwrite(node.start, left.end, `var ${deconflicted}`);

      const declaration =
      name === deconflicted
        ? `export { ${name} };`
        : `export { ${deconflicted} as ${name} };`;

      if (name !== 'default') {
      namedExportDeclarations.push({
        str: declaration,
        name
      });
      }

      defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);
    }
    }
  }

  if (!(isEsModule || hasDefaultExport)) {
    wrapperEnd = `\n\nvar ${moduleName} = {\n${names
    .map(({ name, deconflicted }) => `\t${name}: ${deconflicted}`)
    .join(',\n')}\n};`;
  }
  }

  magicString
  .trim()
  .prepend(importBlock + wrapperStart)
  .trim()
  .append(wrapperEnd);

  const defaultExport =
  code.indexOf('__esModule') >= 0
    ? `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`
    : `export default ${moduleName};`;

  const named = namedExportDeclarations
  .filter((x) => x.name !== 'default' || !hasDefaultExport)
  .map((x) => x.str);

  magicString.append(
  `\n\n${(isEsModule ? [] : [defaultExport])
    .concat(named)
    .concat(hasDefaultExport ? defaultExportPropertyAssignments : [])
    .join('\n')}`
  );

  code = magicString.toString();
  const map = sourceMap ? magicString.generateMap() : null;

  return { code, map, syntheticNamedExports: isEsModule ? false : '__moduleExports' };
}

function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {
  let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;
  for (const dir of dynamicRequireModuleDirPaths) {
  let entryPoint = 'index.js';

  try {
    if (existsSync(join(dir, 'package.json'))) {
    entryPoint =
      JSON.parse(readFileSync(join(dir, 'package.json'), { encoding: 'utf8' })).main ||
      entryPoint;
    }
  } catch (ignored) {
    // ignored
  }

  code += `\ncommonjsRegister(${JSON.stringify(
    getVirtualPathForDynamicRequirePath(dir, commonDir)
  )}, function (module, exports) {
  module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});
});`;
  }
  return code;
}

function getDynamicPackagesEntryIntro(
  id,
  dynamicRequireModuleDirPaths,
  dynamicRequireModuleSet
) {
  try {
  const code = readFileSync(id, { encoding: 'utf8' });
  let dynamicImports = Array.from(
    dynamicRequireModuleSet,
    (dynamicId) => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`
  ).join('\n');

  if (dynamicRequireModuleDirPaths.length) {
    dynamicImports += `require(${JSON.stringify(
    DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID
    )});`;
  }

  return `${dynamicImports}\n${code}`;
  } catch (ex) {
  this.warn(`Failed to read file ${id}, dynamic modules might not work correctly`);
  return null;
  }
}

function getDynamicRequirePaths(patterns) {
  const dynamicRequireModuleSet = new Set();
  for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
  const isNegated = pattern.startsWith('!');
  const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
  for (const path of glob_1.sync(isNegated ? pattern.substr(1) : pattern)) {
    modifySet(normalizePathSlashes(resolve$3(path)));
  }
  }
  const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(
  (path) => {
    try {
    if (statSync(path).isDirectory()) return true;
    } catch (ignored) {
    // Nothing to do here
    }
    return false;
  }
  );
  return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };
}

/* eslint-disable no-undefined */
const isCjsPromises = new Map();

function getIsCjsPromise(id) {
  let isCjsPromise = isCjsPromises.get(id);
  if (isCjsPromise) return isCjsPromise.promise;

  const promise = new Promise((resolve) => {
  isCjsPromise = {
    resolve,
    promise: undefined
  };
  isCjsPromises.set(id, isCjsPromise);
  });
  isCjsPromise.promise = promise;

  return promise;
}

function setIsCjsPromise(id, resolution) {
  const isCjsPromise = isCjsPromises.get(id);
  if (isCjsPromise) {
  if (isCjsPromise.resolve) {
    isCjsPromise.resolve(resolution);
    isCjsPromise.resolve = undefined;
  }
  } else {
  isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });
  }
}

// e.g. id === "commonjsHelpers?commonjsRegister"
function getSpecificHelperProxy(id) {
  return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;
}

function getUnknownRequireProxy(id, requireReturnsDefault) {
  if (requireReturnsDefault === true || id.endsWith('.json')) {
  return `export {default} from ${JSON.stringify(id)};`;
  }
  const name = getName(id);
  const exported =
  requireReturnsDefault === 'auto'
    ? `import {getDefaultExportFromNamespaceIfNotNamed} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
    : requireReturnsDefault === 'preferred'
    ? `import {getDefaultExportFromNamespaceIfPresent} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
    : !requireReturnsDefault
    ? `import {getAugmentedNamespace} from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
    : `export default ${name};`;
  return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
}

function getDynamicJsonProxy(id, commonDir) {
  const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));
  return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
  getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
  )}, function (module, exports) {
  module.exports = require(${JSON.stringify(normalizedPath)});
});`;
}

function getDynamicRequireProxy(normalizedPath, commonDir) {
  return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
  getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
  )}, function (module, exports) {
  ${readFileSync(normalizedPath, { encoding: 'utf8' })}
});`;
}

async function getStaticRequireProxy(
  id,
  requireReturnsDefault,
  esModulesWithDefaultExport,
  esModulesWithNamedExports
) {
  const name = getName(id);
  const isCjs = await getIsCjsPromise(id);
  if (isCjs) {
  return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;
  } else if (isCjs === null) {
  return getUnknownRequireProxy(id, requireReturnsDefault);
  } else if (!requireReturnsDefault) {
  return `import {getAugmentedNamespace} from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
    id
  )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
  } else if (
  requireReturnsDefault !== true &&
  (requireReturnsDefault === 'namespace' ||
    !esModulesWithDefaultExport.has(id) ||
    (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))
  ) {
  return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
  }
  return `export {default} from ${JSON.stringify(id)};`;
}

/* eslint-disable no-param-reassign, no-undefined */

function getCandidatesForExtension(resolved, extension) {
  return [resolved + extension, `${resolved}${sep}index${extension}`];
}

function getCandidates(resolved, extensions) {
  return extensions.reduce(
  (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
  [resolved]
  );
}

function getResolveId(extensions) {
  function resolveExtensions(importee, importer) {
  // not our problem
  if (importee[0] !== '.' || !importer) return undefined;

  const resolved = resolve$3(dirname(importer), importee);
  const candidates = getCandidates(resolved, extensions);

  for (let i = 0; i < candidates.length; i += 1) {
    try {
    const stats = statSync(candidates[i]);
    if (stats.isFile()) return { id: candidates[i] };
    } catch (err) {
    /* noop */
    }
  }

  return undefined;
  }

  function resolveId(importee, importer) {
  const isProxyModule = importee.endsWith(PROXY_SUFFIX);
  if (isProxyModule) {
    importee = getIdFromProxyId(importee);
  }
  if (importee.startsWith('\0')) {
    if (
    importee.startsWith(HELPERS_ID) ||
    importee === DYNAMIC_PACKAGES_ID ||
    importee.startsWith(DYNAMIC_JSON_PREFIX)
    ) {
    return importee;
    }
    if (!isProxyModule) {
    return null;
    }
  }

  if (importer && importer.endsWith(PROXY_SUFFIX)) {
    importer = getIdFromProxyId(importer);
  }

  return this.resolve(importee, importer, { skipSelf: true }).then((resolved) => {
    if (!resolved) {
    resolved = resolveExtensions(importee, importer);
    }
    if (isProxyModule) {
    if (!resolved) {
      return { id: getExternalProxyId(importee), external: false };
    }
    resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);
    resolved.external = false;
    return resolved;
    }
    return resolved;
  });
  }

  return resolveId;
}

function commonjs(options = {}) {
  const extensions = options.extensions || ['.js'];
  const filter = createFilter$3(options.include, options.exclude);
  const {
  ignoreGlobal,
  requireReturnsDefault: requireReturnsDefaultOption,
  esmExternals
  } = options;
  const getRequireReturnsDefault =
  typeof requireReturnsDefaultOption === 'function'
    ? requireReturnsDefaultOption
    : () => requireReturnsDefaultOption;
  let esmExternalIds;
  const isEsmExternal =
  typeof esmExternals === 'function'
    ? esmExternals
    : Array.isArray(esmExternals)
    ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
    : () => esmExternals;

  const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(
  options.dynamicRequireTargets
  );
  const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;
  const commonDir = isDynamicRequireModulesEnabled
  ? commondir$1(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))
  : null;

  const esModulesWithDefaultExport = new Set();
  const esModulesWithNamedExports = new Set();

  const ignoreRequire =
  typeof options.ignore === 'function'
    ? options.ignore
    : Array.isArray(options.ignore)
    ? (id) => options.ignore.includes(id)
    : () => false;

  const resolveId = getResolveId(extensions);

  const sourceMap = options.sourceMap !== false;

  function transformAndCheckExports(code, id) {
  const { isEsModule, hasDefaultExport, hasNamedExports, ast } = checkEsModule(
    this.parse,
    code,
    id
  );
  if (hasDefaultExport) {
    esModulesWithDefaultExport.add(id);
  }
  if (hasNamedExports) {
    esModulesWithNamedExports.add(id);
  }

  if (
    !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&
    (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))
  ) {
    setIsCjsPromise(id, false);
    return null;
  }

  const transformed = transformCommonjs(
    this.parse,
    code,
    id,
    isEsModule,
    ignoreGlobal || isEsModule,
    ignoreRequire,
    sourceMap,
    isDynamicRequireModulesEnabled,
    dynamicRequireModuleSet,
    commonDir,
    ast
  );

  setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));
  return transformed;
  }

  return {
  name: 'commonjs',

  buildStart() {
    if (options.namedExports != null) {
    this.warn(
      'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
    );
    }

    const [major, minor] = this.meta.rollupVersion.split('.').map(Number);
    const minVersion = peerDependencies.rollup.slice(2);
    const [minMajor, minMinor] = minVersion.split('.').map(Number);
    if (major < minMajor || (major === minMajor && minor < minMinor)) {
    this.error(
      `Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`
    );
    }
  },

  resolveId,

  load(id) {
    if (id === HELPERS_ID) {
    return getHelpersModule(isDynamicRequireModulesEnabled);
    }

    if (id.startsWith(HELPERS_ID)) {
    return getSpecificHelperProxy(id);
    }

    if (id.endsWith(EXTERNAL_SUFFIX)) {
    const actualId = getIdFromExternalProxyId(id);
    return getUnknownRequireProxy(
      actualId,
      isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
    );
    }

    if (id === DYNAMIC_PACKAGES_ID) {
    return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);
    }

    if (id.startsWith(DYNAMIC_JSON_PREFIX)) {
    return getDynamicJsonProxy(id, commonDir);
    }

    const normalizedPath = normalizePathSlashes(id);
    if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {
    return getDynamicRequireProxy(normalizedPath, commonDir);
    }

    if (id.endsWith(PROXY_SUFFIX)) {
    const actualId = getIdFromProxyId(id);
    return getStaticRequireProxy(
      actualId,
      getRequireReturnsDefault(actualId),
      esModulesWithDefaultExport,
      esModulesWithNamedExports
    );
    }

    if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
    return getDynamicPackagesEntryIntro(
      id,
      dynamicRequireModuleDirPaths,
      dynamicRequireModuleSet
    );
    }

    return null;
  },

  transform(code, id) {
    const extName = extname$1(id);
    if (
    extName !== '.cjs' &&
    id !== DYNAMIC_PACKAGES_ID &&
    !id.startsWith(DYNAMIC_JSON_PREFIX) &&
    (!filter(id) || !extensions.includes(extName))
    ) {
    setIsCjsPromise(id, null);
    return null;
    }

    let transformed;
    try {
    transformed = transformAndCheckExports.call(this, code, id);
    } catch (err) {
    transformed = null;
    setIsCjsPromise(id, false);
    this.error(err, err.loc);
    }

    return transformed;
  }
  };
}

const addExtension = function addExtension(filename, ext = '.js') {
  let result = `${filename}`;
  if (!extname$1(filename))
    result += ext;
  return result;
};

const extractors$2 = {
  ArrayPattern(names, param) {
    for (const element of param.elements) {
      if (element)
        extractors$2[element.type](names, element);
    }
  },
  AssignmentPattern(names, param) {
    extractors$2[param.left.type](names, param.left);
  },
  Identifier(names, param) {
    names.push(param.name);
  },
  MemberExpression() { },
  ObjectPattern(names, param) {
    for (const prop of param.properties) {
      // @ts-ignore Typescript reports that this is not a valid type
      if (prop.type === 'RestElement') {
        extractors$2.RestElement(names, prop);
      }
      else {
        extractors$2[prop.value.type](names, prop.value);
      }
    }
  },
  RestElement(names, param) {
    extractors$2[param.argument.type](names, param.argument);
  }
};
const extractAssignedNames$2 = function extractAssignedNames(param) {
  const names = [];
  extractors$2[param.type](names, param);
  return names;
};

const blockDeclarations = {
  const: true,
  let: true
};
class Scope$2 {
  constructor(options = {}) {
    this.parent = options.parent;
    this.isBlockScope = !!options.block;
    this.declarations = Object.create(null);
    if (options.params) {
      options.params.forEach((param) => {
        extractAssignedNames$2(param).forEach((name) => {
          this.declarations[name] = true;
        });
      });
    }
  }
  addDeclaration(node, isBlockDeclaration, isVar) {
    if (!isBlockDeclaration && this.isBlockScope) {
      // it's a `var` or function node, and this
      // is a block scope, so we need to go up
      this.parent.addDeclaration(node, isBlockDeclaration, isVar);
    }
    else if (node.id) {
      extractAssignedNames$2(node.id).forEach((name) => {
        this.declarations[name] = true;
      });
    }
  }
  contains(name) {
    return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
  }
}
const attachScopes = function attachScopes(ast, propertyName = 'scope') {
  let scope = new Scope$2();
  walk(ast, {
    enter(n, parent) {
      const node = n;
      // function foo () {...}
      // class Foo {...}
      if (/(Function|Class)Declaration/.test(node.type)) {
        scope.addDeclaration(node, false, false);
      }
      // var foo = 1
      if (node.type === 'VariableDeclaration') {
        const { kind } = node;
        const isBlockDeclaration = blockDeclarations[kind];
        node.declarations.forEach((declaration) => {
          scope.addDeclaration(declaration, isBlockDeclaration, true);
        });
      }
      let newScope;
      // create new function scope
      if (/Function/.test(node.type)) {
        const func = node;
        newScope = new Scope$2({
          parent: scope,
          block: false,
          params: func.params
        });
        // named function expressions - the name is considered
        // part of the function's scope
        if (func.type === 'FunctionExpression' && func.id) {
          newScope.addDeclaration(func, false, false);
        }
      }
      // create new for scope
      if (/For(In|Of)?Statement/.test(node.type)) {
        newScope = new Scope$2({
          parent: scope,
          block: true
        });
      }
      // create new block scope
      if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
        newScope = new Scope$2({
          parent: scope,
          block: true
        });
      }
      // catch clause has its own block scope
      if (node.type === 'CatchClause') {
        newScope = new Scope$2({
          parent: scope,
          params: node.param ? [node.param] : [],
          block: true
        });
      }
      if (newScope) {
        Object.defineProperty(node, propertyName, {
          value: newScope,
          configurable: true
        });
        scope = newScope;
      }
    },
    leave(n) {
      const node = n;
      if (node[propertyName])
        scope = scope.parent;
    }
  });
  return scope;
};

// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray$2(arg) {
  return Array.isArray(arg);
}
function ensureArray$2(thing) {
  if (isArray$2(thing))
    return thing;
  if (thing == null)
    return [];
  return [thing];
}

const normalizePath = function normalizePath(filename) {
  return filename.split(win32$1.sep).join(posix$1.sep);
};

function getMatcherString$2(id, resolutionBase) {
  if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
    return normalizePath(id);
  }
  // resolve('') is valid and will default to process.cwd()
  const basePath = normalizePath(resolve$3(resolutionBase || ''))
    // escape all possible (posix + win) path characters that might interfere with regex
    .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  // Note that we use posix.join because:
  // 1. the basePath has been normalized to use /
  // 2. the incoming glob (id) matcher, also uses /
  // otherwise Node will force backslash (\) on windows
  return posix$1.join(basePath, normalizePath(id));
}
const createFilter$2 = function createFilter(include, exclude, options) {
  const resolutionBase = options && options.resolve;
  const getMatcher = (id) => id instanceof RegExp
    ? id
    : {
      test: (what) => {
        // this refactor is a tad overly verbose but makes for easy debugging
        const pattern = getMatcherString$2(id, resolutionBase);
        const fn = picomatch(pattern, { dot: true });
        const result = fn(what);
        return result;
      }
    };
  const includeMatchers = ensureArray$2(include).map(getMatcher);
  const excludeMatchers = ensureArray$2(exclude).map(getMatcher);
  return function result(id) {
    if (typeof id !== 'string')
      return false;
    if (/\0/.test(id))
      return false;
    const pathId = normalizePath(id);
    for (let i = 0; i < excludeMatchers.length; ++i) {
      const matcher = excludeMatchers[i];
      if (matcher.test(pathId))
        return false;
    }
    for (let i = 0; i < includeMatchers.length; ++i) {
      const matcher = includeMatchers[i];
      if (matcher.test(pathId))
        return true;
    }
    return !includeMatchers.length;
  };
};

const reservedWords$2 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins$3 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const forbiddenIdentifiers$2 = new Set(`${reservedWords$2} ${builtins$3}`.split(' '));
forbiddenIdentifiers$2.add('');
const makeLegalIdentifier = function makeLegalIdentifier(str) {
  let identifier = str
    .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
    .replace(/[^$_a-zA-Z0-9]/g, '_');
  if (/\d/.test(identifier[0]) || forbiddenIdentifiers$2.has(identifier)) {
    identifier = `_${identifier}`;
  }
  return identifier || '_';
};

function stringify(obj) {
  return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
}
function serializeArray(arr, indent, baseIndent) {
  let output = '[';
  const separator = indent ? `\n${baseIndent}${indent}` : '';
  for (let i = 0; i < arr.length; i++) {
    const key = arr[i];
    output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
  }
  return `${output}${indent ? `\n${baseIndent}` : ''}]`;
}
function serializeObject(obj, indent, baseIndent) {
  let output = '{';
  const separator = indent ? `\n${baseIndent}${indent}` : '';
  const entries = Object.entries(obj);
  for (let i = 0; i < entries.length; i++) {
    const [key, value] = entries[i];
    const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
    output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
  }
  return `${output}${indent ? `\n${baseIndent}` : ''}}`;
}
function serialize(obj, indent, baseIndent) {
  if (typeof obj === 'object' && obj !== null) {
    if (Array.isArray(obj))
      return serializeArray(obj, indent, baseIndent);
    if (obj instanceof Date)
      return `new Date(${obj.getTime()})`;
    if (obj instanceof RegExp)
      return obj.toString();
    return serializeObject(obj, indent, baseIndent);
  }
  if (typeof obj === 'number') {
    if (obj === Infinity)
      return 'Infinity';
    if (obj === -Infinity)
      return '-Infinity';
    if (obj === 0)
      return 1 / obj === Infinity ? '0' : '-0';
    if (obj !== obj)
      return 'NaN'; // eslint-disable-line no-self-compare
  }
  if (typeof obj === 'symbol') {
    const key = Symbol.keyFor(obj);
    // eslint-disable-next-line no-undefined
    if (key !== undefined)
      return `Symbol.for(${stringify(key)})`;
  }
  if (typeof obj === 'bigint')
    return `${obj}n`;
  return stringify(obj);
}
const dataToEsm = function dataToEsm(data, options = {}) {
  const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
  const _ = options.compact ? '' : ' ';
  const n = options.compact ? '' : '\n';
  const declarationType = options.preferConst ? 'const' : 'var';
  if (options.namedExports === false ||
    typeof data !== 'object' ||
    Array.isArray(data) ||
    data instanceof Date ||
    data instanceof RegExp ||
    data === null) {
    const code = serialize(data, options.compact ? null : t, '');
    const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
    return `export default${magic}${code};`;
  }
  let namedExportCode = '';
  const defaultExportRows = [];
  for (const [key, value] of Object.entries(data)) {
    if (key === makeLegalIdentifier(key)) {
      if (options.objectShorthand)
        defaultExportRows.push(key);
      else
        defaultExportRows.push(`${key}:${_}${key}`);
      namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
    }
    else {
      defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
    }
  }
  return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
};

// TODO: remove this in next major
var index = {
  addExtension,
  attachScopes,
  createFilter: createFilter$2,
  dataToEsm,
  extractAssignedNames: extractAssignedNames$2,
  makeLegalIdentifier,
  normalizePath
};

function json(options) {
  if ( options === void 0 ) options = {};

  var filter = createFilter$2(options.include, options.exclude);
  var indent = 'indent' in options ? options.indent : '\t';

  return {
  name: 'json',

  // eslint-disable-next-line no-shadow
  transform: function transform(code, id) {
    if (id.slice(-5) !== '.json' || !filter(id)) { return null; }

    try {
    var parsed = JSON.parse(code);
    return {
      code: dataToEsm(parsed, {
      preferConst: options.preferConst,
      compact: options.compact,
      namedExports: options.namedExports,
      indent: indent
      }),
      map: { mappings: '' }
    };
    } catch (err) {
    var message = 'Could not parse JSON file';
    this.error({ message: message, id: id, cause: err });
    return null;
    }
  }
  };
}

const {builtinModules} = Module$1;

const ignoreList = [
	'sys'
];

// eslint-disable-next-line node/no-deprecated-api
var builtinModules_1 = (builtinModules)
	.filter(x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x))
	.sort();

var isMergeableObject = function isMergeableObject(value) {
	return isNonNullObject(value)
		&& !isSpecial(value)
};

function isNonNullObject(value) {
	return !!value && typeof value === 'object'
}

function isSpecial(value) {
	var stringValue = Object.prototype.toString.call(value);

	return stringValue === '[object RegExp]'
		|| stringValue === '[object Date]'
		|| isReactElement(value)
}

// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;

function isReactElement(value) {
	return value.$$typeof === REACT_ELEMENT_TYPE
}

function emptyTarget(val) {
	return Array.isArray(val) ? [] : {}
}

function cloneUnlessOtherwiseSpecified(value, options) {
	return (options.clone !== false && options.isMergeableObject(value))
		? deepmerge(emptyTarget(value), value, options)
		: value
}

function defaultArrayMerge(target, source, options) {
	return target.concat(source).map(function(element) {
		return cloneUnlessOtherwiseSpecified(element, options)
	})
}

function getMergeFunction(key, options) {
	if (!options.customMerge) {
		return deepmerge
	}
	var customMerge = options.customMerge(key);
	return typeof customMerge === 'function' ? customMerge : deepmerge
}

function getEnumerableOwnPropertySymbols(target) {
	return Object.getOwnPropertySymbols
		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
			return target.propertyIsEnumerable(symbol)
		})
		: []
}

function getKeys(target) {
	return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}

function propertyIsOnObject(object, property) {
	try {
		return property in object
	} catch(_) {
		return false
	}
}

// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
	return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
		&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
			&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}

function mergeObject(target, source, options) {
	var destination = {};
	if (options.isMergeableObject(target)) {
		getKeys(target).forEach(function(key) {
			destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
		});
	}
	getKeys(source).forEach(function(key) {
		if (propertyIsUnsafe(target, key)) {
			return
		}

		if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
			destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
		} else {
			destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
		}
	});
	return destination
}

function deepmerge(target, source, options) {
	options = options || {};
	options.arrayMerge = options.arrayMerge || defaultArrayMerge;
	options.isMergeableObject = options.isMergeableObject || isMergeableObject;
	// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
	// implementations can use it. The caller may not replace it.
	options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;

	var sourceIsArray = Array.isArray(source);
	var targetIsArray = Array.isArray(target);
	var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;

	if (!sourceAndTargetTypesMatch) {
		return cloneUnlessOtherwiseSpecified(source, options)
	} else if (sourceIsArray) {
		return options.arrayMerge(target, source, options)
	} else {
		return mergeObject(target, source, options)
	}
}

deepmerge.all = function deepmergeAll(array, options) {
	if (!Array.isArray(array)) {
		throw new Error('first argument should be an array')
	}

	return array.reduce(function(prev, next) {
		return deepmerge(prev, next, options)
	}, {})
};

var deepmerge_1 = deepmerge;

var cjs$1 = deepmerge_1;

// no idea what these regular expressions do,
// but i extracted it from https://github.com/yahoo/js-module-formats/blob/master/index.js#L18
var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;

var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;

var isModule = function (sauce) {
  return ES6ImportExportRegExp.test(sauce)
  || ES6AliasRegExp.test(sauce);
};

// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray$1(arg) {
  return Array.isArray(arg);
}
function ensureArray$1(thing) {
  if (isArray$1(thing))
    return thing;
  if (thing == null)
    return [];
  return [thing];
}

function getMatcherString$1(id, resolutionBase) {
  if (resolutionBase === false) {
    return id;
  }
  // resolve('') is valid and will default to process.cwd()
  const basePath = resolve$3(resolutionBase || '')
    .split(sep)
    .join('/')
    // escape all possible (posix + win) path characters that might interfere with regex
    .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  // Note that we use posix.join because:
  // 1. the basePath has been normalized to use /
  // 2. the incoming glob (id) matcher, also uses /
  // otherwise Node will force backslash (\) on windows
  return posix$1.join(basePath, id);
}
const createFilter$1 = function createFilter(include, exclude, options) {
  const resolutionBase = options && options.resolve;
  const getMatcher = (id) => id instanceof RegExp
    ? id
    : {
      test: (what) => {
        // this refactor is a tad overly verbose but makes for easy debugging
        const pattern = getMatcherString$1(id, resolutionBase);
        const fn = picomatch(pattern, { dot: true });
        const result = fn(what);
        return result;
      }
    };
  const includeMatchers = ensureArray$1(include).map(getMatcher);
  const excludeMatchers = ensureArray$1(exclude).map(getMatcher);
  return function result(id) {
    if (typeof id !== 'string')
      return false;
    if (/\0/.test(id))
      return false;
    const pathId = id.split(sep).join('/');
    for (let i = 0; i < excludeMatchers.length; ++i) {
      const matcher = excludeMatchers[i];
      if (matcher.test(pathId))
        return false;
    }
    for (let i = 0; i < includeMatchers.length; ++i) {
      const matcher = includeMatchers[i];
      if (matcher.test(pathId))
        return true;
    }
    return !includeMatchers.length;
  };
};

const reservedWords$1$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins$2 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const forbiddenIdentifiers$1 = new Set(`${reservedWords$1$1} ${builtins$2}`.split(' '));
forbiddenIdentifiers$1.add('');

const exists = promisify(fs$3.exists);
const readFile$1 = promisify(fs$3.readFile);
const realpath = promisify(fs$3.realpath);
const stat = promisify(fs$3.stat);

const onError = (error) => {
  if (error.code === 'ENOENT') {
  return false;
  }
  throw error;
};

const makeCache = (fn) => {
  const cache = new Map();
  const wrapped = async (param, done) => {
  if (cache.has(param) === false) {
    cache.set(
    param,
    fn(param).catch((err) => {
      cache.delete(param);
      throw err;
    })
    );
  }

  try {
    const result = cache.get(param);
    const value = await result;
    return done(null, value);
  } catch (error) {
    return done(error);
  }
  };

  wrapped.clear = () => cache.clear();

  return wrapped;
};

const isDirCached = makeCache(async (file) => {
  try {
  const stats = await stat(file);
  return stats.isDirectory();
  } catch (error) {
  return onError(error);
  }
});

const isFileCached = makeCache(async (file) => {
  try {
  const stats = await stat(file);
  return stats.isFile();
  } catch (error) {
  return onError(error);
  }
});

const readCachedFile = makeCache(readFile$1);

const resolveId$1 = promisify(resolve$2);

// returns the imported package name for bare module imports
function getPackageName(id) {
  if (id.startsWith('.') || id.startsWith('/')) {
  return null;
  }

  const split = id.split('/');

  // @my-scope/my-package/foo.js -> @my-scope/my-package
  // @my-scope/my-package -> @my-scope/my-package
  if (split[0][0] === '@') {
  return `${split[0]}/${split[1]}`;
  }

  // my-package/foo.js -> my-package
  // my-package -> my-package
  return split[0];
}

function getMainFields(options) {
  let mainFields;
  if (options.mainFields) {
  ({ mainFields } = options);
  } else {
  mainFields = ['module', 'main'];
  }
  if (options.browser && mainFields.indexOf('browser') === -1) {
  return ['browser'].concat(mainFields);
  }
  if (!mainFields.length) {
  throw new Error('Please ensure at least one `mainFields` value is specified');
  }
  return mainFields;
}

function getPackageInfo(options) {
  const { cache, extensions, pkg, mainFields, preserveSymlinks, useBrowserOverrides } = options;
  let { pkgPath } = options;

  if (cache.has(pkgPath)) {
  return cache.get(pkgPath);
  }

  // browserify/resolve doesn't realpath paths returned in its packageFilter callback
  if (!preserveSymlinks) {
  pkgPath = realpathSync$2(pkgPath);
  }

  const pkgRoot = dirname(pkgPath);

  const packageInfo = {
  // copy as we are about to munge the `main` field of `pkg`.
  packageJson: Object.assign({}, pkg),

  // path to package.json file
  packageJsonPath: pkgPath,

  // directory containing the package.json
  root: pkgRoot,

  // which main field was used during resolution of this module (main, module, or browser)
  resolvedMainField: 'main',

  // whether the browser map was used to resolve the entry point to this module
  browserMappedMain: false,

  // the entry point of the module with respect to the selected main field and any
  // relevant browser mappings.
  resolvedEntryPoint: ''
  };

  let overriddenMain = false;
  for (let i = 0; i < mainFields.length; i++) {
  const field = mainFields[i];
  if (typeof pkg[field] === 'string') {
    pkg.main = pkg[field];
    packageInfo.resolvedMainField = field;
    overriddenMain = true;
    break;
  }
  }

  const internalPackageInfo = {
  cachedPkg: pkg,
  hasModuleSideEffects: () => null,
  hasPackageEntry: overriddenMain !== false || mainFields.indexOf('main') !== -1,
  packageBrowserField:
    useBrowserOverrides &&
    typeof pkg.browser === 'object' &&
    Object.keys(pkg.browser).reduce((browser, key) => {
    let resolved = pkg.browser[key];
    if (resolved && resolved[0] === '.') {
      resolved = resolve$3(pkgRoot, resolved);
    }
    /* eslint-disable no-param-reassign */
    browser[key] = resolved;
    if (key[0] === '.') {
      const absoluteKey = resolve$3(pkgRoot, key);
      browser[absoluteKey] = resolved;
      if (!extname$1(key)) {
      extensions.reduce((subBrowser, ext) => {
        subBrowser[absoluteKey + ext] = subBrowser[key];
        return subBrowser;
      }, browser);
      }
    }
    return browser;
    }, {}),
  packageInfo
  };

  const browserMap = internalPackageInfo.packageBrowserField;
  if (
  useBrowserOverrides &&
  typeof pkg.browser === 'object' &&
  // eslint-disable-next-line no-prototype-builtins
  browserMap.hasOwnProperty(pkg.main)
  ) {
  packageInfo.resolvedEntryPoint = browserMap[pkg.main];
  packageInfo.browserMappedMain = true;
  } else {
  // index.node is technically a valid default entrypoint as well...
  packageInfo.resolvedEntryPoint = resolve$3(pkgRoot, pkg.main || 'index.js');
  packageInfo.browserMappedMain = false;
  }

  const packageSideEffects = pkg.sideEffects;
  if (typeof packageSideEffects === 'boolean') {
  internalPackageInfo.hasModuleSideEffects = () => packageSideEffects;
  } else if (Array.isArray(packageSideEffects)) {
  internalPackageInfo.hasModuleSideEffects = createFilter$1(packageSideEffects, null, {
    resolve: pkgRoot
  });
  }

  cache.set(pkgPath, internalPackageInfo);
  return internalPackageInfo;
}

function normalizeInput(input) {
  if (Array.isArray(input)) {
  return input;
  } else if (typeof input === 'object') {
  return Object.values(input);
  }

  // otherwise it's a string
  return [input];
}

// Resolve module specifiers in order. Promise resolves to the first module that resolves
// successfully, or the error that resulted from the last attempted module resolution.
function resolveImportSpecifiers(importSpecifierList, resolveOptions) {
  let promise = Promise.resolve();

  for (let i = 0; i < importSpecifierList.length; i++) {
  promise = promise.then((value) => {
    // if we've already resolved to something, just return it.
    if (value) {
    return value;
    }

    return resolveId$1(importSpecifierList[i], resolveOptions).then((result) => {
    if (!resolveOptions.preserveSymlinks) {
      result = realpathSync$2(result);
    }
    return result;
    });
  });

  if (i < importSpecifierList.length - 1) {
    // swallow MODULE_NOT_FOUND errors from all but the last resolution
    promise = promise.catch((error) => {
    if (error.code !== 'MODULE_NOT_FOUND') {
      throw error;
    }
    });
  }
  }

  return promise;
}

/* eslint-disable no-param-reassign, no-shadow, no-undefined */

const builtins$1$1 = new Set(builtinModules_1);
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
const nullFn = () => null;
const deepFreeze = (object) => {
  Object.freeze(object);

  for (const value of Object.values(object)) {
  if (typeof value === 'object' && !Object.isFrozen(value)) {
    deepFreeze(value);
  }
  }

  return object;
};
const defaults = {
  customResolveOptions: {},
  dedupe: [],
  // It's important that .mjs is listed before .js so that Rollup will interpret npm modules
  // which deploy both ESM .mjs and CommonJS .js files as ESM.
  extensions: ['.mjs', '.js', '.json', '.node'],
  resolveOnly: []
};
deepFreeze(cjs$1({}, defaults));

function nodeResolve(opts = {}) {
  const options = Object.assign({}, defaults, opts);
  const { customResolveOptions, extensions, jail } = options;
  const warnings = [];
  const packageInfoCache = new Map();
  const idToPackageInfo = new Map();
  const mainFields = getMainFields(options);
  const useBrowserOverrides = mainFields.indexOf('browser') !== -1;
  const isPreferBuiltinsSet = options.preferBuiltins === true || options.preferBuiltins === false;
  const preferBuiltins = isPreferBuiltinsSet ? options.preferBuiltins : true;
  const rootDir = options.rootDir || process.cwd();
  let { dedupe } = options;
  let rollupOptions;

  if (options.only) {
  warnings.push('node-resolve: The `only` options is deprecated, please use `resolveOnly`');
  options.resolveOnly = options.only;
  }

  if (typeof dedupe !== 'function') {
  dedupe = (importee) =>
    options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
  }

  const resolveOnly = options.resolveOnly.map((pattern) => {
  if (pattern instanceof RegExp) {
    return pattern;
  }
  const normalized = pattern.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  return new RegExp(`^${normalized}$`);
  });

  const browserMapCache = new Map();
  let preserveSymlinks;

  return {
  name: 'node-resolve',

  buildStart(options) {
    rollupOptions = options;

    for (const warning of warnings) {
    this.warn(warning);
    }

    ({ preserveSymlinks } = options);
  },

  generateBundle() {
    readCachedFile.clear();
    isFileCached.clear();
    isDirCached.clear();
  },

  async resolveId(importee, importer) {
    if (importee === ES6_BROWSER_EMPTY) {
    return importee;
    }
    // ignore IDs with null character, these belong to other plugins
    if (/\0/.test(importee)) return null;

    // strip hash and query params from import
    const [withoutHash, hash] = importee.split('#');
    const [importPath, params] = withoutHash.split('?');
    const importSuffix = `${params ? `?${params}` : ''}${hash ? `#${hash}` : ''}`;
    importee = importPath;

    const basedir = !importer || dedupe(importee) ? rootDir : dirname(importer);

    // https://github.com/defunctzombie/package-browser-field-spec
    const browser = browserMapCache.get(importer);
    if (useBrowserOverrides && browser) {
    const resolvedImportee = resolve$3(basedir, importee);
    if (browser[importee] === false || browser[resolvedImportee] === false) {
      return ES6_BROWSER_EMPTY;
    }
    const browserImportee =
      browser[importee] ||
      browser[resolvedImportee] ||
      browser[`${resolvedImportee}.js`] ||
      browser[`${resolvedImportee}.json`];
    if (browserImportee) {
      importee = browserImportee;
    }
    }

    const parts = importee.split(/[/\\]/);
    let id = parts.shift();
    let isRelativeImport = false;

    if (id[0] === '@' && parts.length > 0) {
    // scoped packages
    id += `/${parts.shift()}`;
    } else if (id[0] === '.') {
    // an import relative to the parent dir of the importer
    id = resolve$3(basedir, importee);
    isRelativeImport = true;
    }

    if (
    !isRelativeImport &&
    resolveOnly.length &&
    !resolveOnly.some((pattern) => pattern.test(id))
    ) {
    if (normalizeInput(rollupOptions.input).includes(importee)) {
      return null;
    }
    return false;
    }

    let hasModuleSideEffects = nullFn;
    let hasPackageEntry = true;
    let packageBrowserField = false;
    let packageInfo;

    const filter = (pkg, pkgPath) => {
    const info = getPackageInfo({
      cache: packageInfoCache,
      extensions,
      pkg,
      pkgPath,
      mainFields,
      preserveSymlinks,
      useBrowserOverrides
    });

    ({ packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField } = info);

    return info.cachedPkg;
    };

    let resolveOptions = {
    basedir,
    packageFilter: filter,
    readFile: readCachedFile,
    isFile: isFileCached,
    isDirectory: isDirCached,
    extensions
    };

    if (preserveSymlinks !== undefined) {
    resolveOptions.preserveSymlinks = preserveSymlinks;
    }

    const importSpecifierList = [];

    if (importer === undefined && !importee[0].match(/^\.?\.?\//)) {
    // For module graph roots (i.e. when importer is undefined), we
    // need to handle 'path fragments` like `foo/bar` that are commonly
    // found in rollup config files. If importee doesn't look like a
    // relative or absolute path, we make it relative and attempt to
    // resolve it. If we don't find anything, we try resolving it as we
    // got it.
    importSpecifierList.push(`./${importee}`);
    }

    const importeeIsBuiltin = builtins$1$1.has(importee);

    if (importeeIsBuiltin && (!preferBuiltins || !isPreferBuiltinsSet)) {
    // The `resolve` library will not resolve packages with the same
    // name as a node built-in module. If we're resolving something
    // that's a builtin, and we don't prefer to find built-ins, we
    // first try to look up a local module with that name. If we don't
    // find anything, we resolve the builtin which just returns back
    // the built-in's name.
    importSpecifierList.push(`${importee}/`);
    }

    // TypeScript files may import '.js' to refer to either '.ts' or '.tsx'
    if (importer && importee.endsWith('.js')) {
    for (const ext of ['.ts', '.tsx']) {
      if (importer.endsWith(ext) && extensions.includes(ext)) {
      importSpecifierList.push(importee.replace(/.js$/, ext));
      }
    }
    }

    importSpecifierList.push(importee);
    resolveOptions = Object.assign(resolveOptions, customResolveOptions);

    try {
    let resolved = await resolveImportSpecifiers(importSpecifierList, resolveOptions);

    if (resolved && packageBrowserField) {
      if (Object.prototype.hasOwnProperty.call(packageBrowserField, resolved)) {
      if (!packageBrowserField[resolved]) {
        browserMapCache.set(resolved, packageBrowserField);
        return ES6_BROWSER_EMPTY;
      }
      resolved = packageBrowserField[resolved];
      }
      browserMapCache.set(resolved, packageBrowserField);
    }

    if (hasPackageEntry && !preserveSymlinks && resolved) {
      const fileExists = await exists(resolved);
      if (fileExists) {
      resolved = await realpath(resolved);
      }
    }

    idToPackageInfo.set(resolved, packageInfo);

    if (hasPackageEntry) {
      if (builtins$1$1.has(resolved) && preferBuiltins && isPreferBuiltinsSet) {
      return null;
      } else if (importeeIsBuiltin && preferBuiltins) {
      if (!isPreferBuiltinsSet) {
        this.warn(
        `preferring built-in module '${importee}' over local alternative at '${resolved}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning`
        );
      }
      return null;
      } else if (jail && resolved.indexOf(normalize$1(jail.trim(sep))) !== 0) {
      return null;
      }
    }

    if (resolved && options.modulesOnly) {
      const code = await readFile$1(resolved, 'utf-8');
      if (isModule(code)) {
      return {
        id: `${resolved}${importSuffix}`,
        moduleSideEffects: hasModuleSideEffects(resolved)
      };
      }
      return null;
    }
    const result = {
      id: `${resolved}${importSuffix}`,
      moduleSideEffects: hasModuleSideEffects(resolved)
    };
    return result;
    } catch (error) {
    return null;
    }
  },

  load(importee) {
    if (importee === ES6_BROWSER_EMPTY) {
    return 'export default {};';
    }
    return null;
  },

  getPackageInfoForId(id) {
    return idToPackageInfo.get(id);
  }
  };
}

var BitSet$2 = function BitSet(arg) {
	this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
};

BitSet$2.prototype.add = function add (n) {
	this.bits[n >> 5] |= 1 << (n & 31);
};

BitSet$2.prototype.has = function has (n) {
	return !!(this.bits[n >> 5] & (1 << (n & 31)));
};

var Chunk$2 = function Chunk(start, end, content) {
	this.start = start;
	this.end = end;
	this.original = content;

	this.intro = '';
	this.outro = '';

	this.content = content;
	this.storeName = false;
	this.edited = false;

	// we make these non-enumerable, for sanity while debugging
	Object.defineProperties(this, {
		previous: { writable: true, value: null },
		next: { writable: true, value: null },
	});
};

Chunk$2.prototype.appendLeft = function appendLeft (content) {
	this.outro += content;
};

Chunk$2.prototype.appendRight = function appendRight (content) {
	this.intro = this.intro + content;
};

Chunk$2.prototype.clone = function clone () {
	var chunk = new Chunk$2(this.start, this.end, this.original);

	chunk.intro = this.intro;
	chunk.outro = this.outro;
	chunk.content = this.content;
	chunk.storeName = this.storeName;
	chunk.edited = this.edited;

	return chunk;
};

Chunk$2.prototype.contains = function contains (index) {
	return this.start < index && index < this.end;
};

Chunk$2.prototype.eachNext = function eachNext (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.next;
	}
};

Chunk$2.prototype.eachPrevious = function eachPrevious (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.previous;
	}
};

Chunk$2.prototype.edit = function edit (content, storeName, contentOnly) {
	this.content = content;
	if (!contentOnly) {
		this.intro = '';
		this.outro = '';
	}
	this.storeName = storeName;

	this.edited = true;

	return this;
};

Chunk$2.prototype.prependLeft = function prependLeft (content) {
	this.outro = content + this.outro;
};

Chunk$2.prototype.prependRight = function prependRight (content) {
	this.intro = content + this.intro;
};

Chunk$2.prototype.split = function split (index) {
	var sliceIndex = index - this.start;

	var originalBefore = this.original.slice(0, sliceIndex);
	var originalAfter = this.original.slice(sliceIndex);

	this.original = originalBefore;

	var newChunk = new Chunk$2(index, this.end, originalAfter);
	newChunk.outro = this.outro;
	this.outro = '';

	this.end = index;

	if (this.edited) {
		// TODO is this block necessary?...
		newChunk.edit('', false);
		this.content = '';
	} else {
		this.content = originalBefore;
	}

	newChunk.next = this.next;
	if (newChunk.next) { newChunk.next.previous = newChunk; }
	newChunk.previous = this;
	this.next = newChunk;

	return newChunk;
};

Chunk$2.prototype.toString = function toString () {
	return this.intro + this.content + this.outro;
};

Chunk$2.prototype.trimEnd = function trimEnd (rx) {
	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.start + trimmed.length).edit('', undefined, true);
		}
		return true;
	} else {
		this.edit('', undefined, true);

		this.intro = this.intro.replace(rx, '');
		if (this.intro.length) { return true; }
	}
};

Chunk$2.prototype.trimStart = function trimStart (rx) {
	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.end - trimmed.length);
			this.edit('', undefined, true);
		}
		return true;
	} else {
		this.edit('', undefined, true);

		this.outro = this.outro.replace(rx, '');
		if (this.outro.length) { return true; }
	}
};

var btoa$2 = function () {
	throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
	btoa$2 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
} else if (typeof Buffer === 'function') {
	btoa$2 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
}

var SourceMap$2 = function SourceMap(properties) {
	this.version = 3;
	this.file = properties.file;
	this.sources = properties.sources;
	this.sourcesContent = properties.sourcesContent;
	this.names = properties.names;
	this.mappings = encode$1(properties.mappings);
};

SourceMap$2.prototype.toString = function toString () {
	return JSON.stringify(this);
};

SourceMap$2.prototype.toUrl = function toUrl () {
	return 'data:application/json;charset=utf-8;base64,' + btoa$2(this.toString());
};

function guessIndent$2(code) {
	var lines = code.split('\n');

	var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
	var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });

	if (tabbed.length === 0 && spaced.length === 0) {
		return null;
	}

	// More lines tabbed than spaced? Assume tabs, and
	// default to tabs in the case of a tie (or nothing
	// to go on)
	if (tabbed.length >= spaced.length) {
		return '\t';
	}

	// Otherwise, we need to guess the multiple
	var min = spaced.reduce(function (previous, current) {
		var numSpaces = /^ +/.exec(current)[0].length;
		return Math.min(numSpaces, previous);
	}, Infinity);

	return new Array(min + 1).join(' ');
}

function getRelativePath$2(from, to) {
	var fromParts = from.split(/[/\\]/);
	var toParts = to.split(/[/\\]/);

	fromParts.pop(); // get dirname

	while (fromParts[0] === toParts[0]) {
		fromParts.shift();
		toParts.shift();
	}

	if (fromParts.length) {
		var i = fromParts.length;
		while (i--) { fromParts[i] = '..'; }
	}

	return fromParts.concat(toParts).join('/');
}

var toString$2 = Object.prototype.toString;

function isObject$3(thing) {
	return toString$2.call(thing) === '[object Object]';
}

function getLocator$2(source) {
	var originalLines = source.split('\n');
	var lineOffsets = [];

	for (var i = 0, pos = 0; i < originalLines.length; i++) {
		lineOffsets.push(pos);
		pos += originalLines[i].length + 1;
	}

	return function locate(index) {
		var i = 0;
		var j = lineOffsets.length;
		while (i < j) {
			var m = (i + j) >> 1;
			if (index < lineOffsets[m]) {
				j = m;
			} else {
				i = m + 1;
			}
		}
		var line = i - 1;
		var column = index - lineOffsets[line];
		return { line: line, column: column };
	};
}

var Mappings$2 = function Mappings(hires) {
	this.hires = hires;
	this.generatedCodeLine = 0;
	this.generatedCodeColumn = 0;
	this.raw = [];
	this.rawSegments = this.raw[this.generatedCodeLine] = [];
	this.pending = null;
};

Mappings$2.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
	if (content.length) {
		var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
		if (nameIndex >= 0) {
			segment.push(nameIndex);
		}
		this.rawSegments.push(segment);
	} else if (this.pending) {
		this.rawSegments.push(this.pending);
	}

	this.advance(content);
	this.pending = null;
};

Mappings$2.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
	var originalCharIndex = chunk.start;
	var first = true;

	while (originalCharIndex < chunk.end) {
		if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
			this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
		}

		if (original[originalCharIndex] === '\n') {
			loc.line += 1;
			loc.column = 0;
			this.generatedCodeLine += 1;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
			this.generatedCodeColumn = 0;
			first = true;
		} else {
			loc.column += 1;
			this.generatedCodeColumn += 1;
			first = false;
		}

		originalCharIndex += 1;
	}

	this.pending = null;
};

Mappings$2.prototype.advance = function advance (str) {
	if (!str) { return; }

	var lines = str.split('\n');

	if (lines.length > 1) {
		for (var i = 0; i < lines.length - 1; i++) {
			this.generatedCodeLine++;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
		}
		this.generatedCodeColumn = 0;
	}

	this.generatedCodeColumn += lines[lines.length - 1].length;
};

var n$2 = '\n';

var warned$2 = {
	insertLeft: false,
	insertRight: false,
	storeName: false,
};

var MagicString$2 = function MagicString(string, options) {
	if ( options === void 0 ) options = {};

	var chunk = new Chunk$2(0, string.length, string);

	Object.defineProperties(this, {
		original: { writable: true, value: string },
		outro: { writable: true, value: '' },
		intro: { writable: true, value: '' },
		firstChunk: { writable: true, value: chunk },
		lastChunk: { writable: true, value: chunk },
		lastSearchedChunk: { writable: true, value: chunk },
		byStart: { writable: true, value: {} },
		byEnd: { writable: true, value: {} },
		filename: { writable: true, value: options.filename },
		indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
		sourcemapLocations: { writable: true, value: new BitSet$2() },
		storedNames: { writable: true, value: {} },
		indentStr: { writable: true, value: guessIndent$2(string) },
	});

	this.byStart[0] = chunk;
	this.byEnd[string.length] = chunk;
};

MagicString$2.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
	this.sourcemapLocations.add(char);
};

MagicString$2.prototype.append = function append (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.outro += content;
	return this;
};

MagicString$2.prototype.appendLeft = function appendLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.appendLeft(content);
	} else {
		this.intro += content;
	}
	return this;
};

MagicString$2.prototype.appendRight = function appendRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.appendRight(content);
	} else {
		this.outro += content;
	}
	return this;
};

MagicString$2.prototype.clone = function clone () {
	var cloned = new MagicString$2(this.original, { filename: this.filename });

	var originalChunk = this.firstChunk;
	var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());

	while (originalChunk) {
		cloned.byStart[clonedChunk.start] = clonedChunk;
		cloned.byEnd[clonedChunk.end] = clonedChunk;

		var nextOriginalChunk = originalChunk.next;
		var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();

		if (nextClonedChunk) {
			clonedChunk.next = nextClonedChunk;
			nextClonedChunk.previous = clonedChunk;

			clonedChunk = nextClonedChunk;
		}

		originalChunk = nextOriginalChunk;
	}

	cloned.lastChunk = clonedChunk;

	if (this.indentExclusionRanges) {
		cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
	}

	cloned.sourcemapLocations = new BitSet$2(this.sourcemapLocations);

	cloned.intro = this.intro;
	cloned.outro = this.outro;

	return cloned;
};

MagicString$2.prototype.generateDecodedMap = function generateDecodedMap (options) {
		var this$1$1 = this;

	options = options || {};

	var sourceIndex = 0;
	var names = Object.keys(this.storedNames);
	var mappings = new Mappings$2(options.hires);

	var locate = getLocator$2(this.original);

	if (this.intro) {
		mappings.advance(this.intro);
	}

	this.firstChunk.eachNext(function (chunk) {
		var loc = locate(chunk.start);

		if (chunk.intro.length) { mappings.advance(chunk.intro); }

		if (chunk.edited) {
			mappings.addEdit(
				sourceIndex,
				chunk.content,
				loc,
				chunk.storeName ? names.indexOf(chunk.original) : -1
			);
		} else {
			mappings.addUneditedChunk(sourceIndex, chunk, this$1$1.original, loc, this$1$1.sourcemapLocations);
		}

		if (chunk.outro.length) { mappings.advance(chunk.outro); }
	});

	return {
		file: options.file ? options.file.split(/[/\\]/).pop() : null,
		sources: [options.source ? getRelativePath$2(options.file || '', options.source) : null],
		sourcesContent: options.includeContent ? [this.original] : [null],
		names: names,
		mappings: mappings.raw,
	};
};

MagicString$2.prototype.generateMap = function generateMap (options) {
	return new SourceMap$2(this.generateDecodedMap(options));
};

MagicString$2.prototype.getIndentString = function getIndentString () {
	return this.indentStr === null ? '\t' : this.indentStr;
};

MagicString$2.prototype.indent = function indent (indentStr, options) {
	var pattern = /^[^\r\n]/gm;

	if (isObject$3(indentStr)) {
		options = indentStr;
		indentStr = undefined;
	}

	indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';

	if (indentStr === '') { return this; } // noop

	options = options || {};

	// Process exclusion ranges
	var isExcluded = {};

	if (options.exclude) {
		var exclusions =
			typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
		exclusions.forEach(function (exclusion) {
			for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
				isExcluded[i] = true;
			}
		});
	}

	var shouldIndentNextCharacter = options.indentStart !== false;
	var replacer = function (match) {
		if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
		shouldIndentNextCharacter = true;
		return match;
	};

	this.intro = this.intro.replace(pattern, replacer);

	var charIndex = 0;
	var chunk = this.firstChunk;

	while (chunk) {
		var end = chunk.end;

		if (chunk.edited) {
			if (!isExcluded[charIndex]) {
				chunk.content = chunk.content.replace(pattern, replacer);

				if (chunk.content.length) {
					shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
				}
			}
		} else {
			charIndex = chunk.start;

			while (charIndex < end) {
				if (!isExcluded[charIndex]) {
					var char = this.original[charIndex];

					if (char === '\n') {
						shouldIndentNextCharacter = true;
					} else if (char !== '\r' && shouldIndentNextCharacter) {
						shouldIndentNextCharacter = false;

						if (charIndex === chunk.start) {
							chunk.prependRight(indentStr);
						} else {
							this._splitChunk(chunk, charIndex);
							chunk = chunk.next;
							chunk.prependRight(indentStr);
						}
					}
				}

				charIndex += 1;
			}
		}

		charIndex = chunk.end;
		chunk = chunk.next;
	}

	this.outro = this.outro.replace(pattern, replacer);

	return this;
};

MagicString$2.prototype.insert = function insert () {
	throw new Error(
		'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
	);
};

MagicString$2.prototype.insertLeft = function insertLeft (index, content) {
	if (!warned$2.insertLeft) {
		console.warn(
			'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
		); // eslint-disable-line no-console
		warned$2.insertLeft = true;
	}

	return this.appendLeft(index, content);
};

MagicString$2.prototype.insertRight = function insertRight (index, content) {
	if (!warned$2.insertRight) {
		console.warn(
			'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
		); // eslint-disable-line no-console
		warned$2.insertRight = true;
	}

	return this.prependRight(index, content);
};

MagicString$2.prototype.move = function move (start, end, index) {
	if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }

	this._split(start);
	this._split(end);
	this._split(index);

	var first = this.byStart[start];
	var last = this.byEnd[end];

	var oldLeft = first.previous;
	var oldRight = last.next;

	var newRight = this.byStart[index];
	if (!newRight && last === this.lastChunk) { return this; }
	var newLeft = newRight ? newRight.previous : this.lastChunk;

	if (oldLeft) { oldLeft.next = oldRight; }
	if (oldRight) { oldRight.previous = oldLeft; }

	if (newLeft) { newLeft.next = first; }
	if (newRight) { newRight.previous = last; }

	if (!first.previous) { this.firstChunk = last.next; }
	if (!last.next) {
		this.lastChunk = first.previous;
		this.lastChunk.next = null;
	}

	first.previous = newLeft;
	last.next = newRight || null;

	if (!newLeft) { this.firstChunk = first; }
	if (!newRight) { this.lastChunk = last; }
	return this;
};

MagicString$2.prototype.overwrite = function overwrite (start, end, content, options) {
	if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (end > this.original.length) { throw new Error('end is out of bounds'); }
	if (start === end)
		{ throw new Error(
			'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
		); }

	this._split(start);
	this._split(end);

	if (options === true) {
		if (!warned$2.storeName) {
			console.warn(
				'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
			); // eslint-disable-line no-console
			warned$2.storeName = true;
		}

		options = { storeName: true };
	}
	var storeName = options !== undefined ? options.storeName : false;
	var contentOnly = options !== undefined ? options.contentOnly : false;

	if (storeName) {
		var original = this.original.slice(start, end);
		Object.defineProperty(this.storedNames, original, { writable: true, value: true, enumerable: true });
	}

	var first = this.byStart[start];
	var last = this.byEnd[end];

	if (first) {
		var chunk = first;
		while (chunk !== last) {
			if (chunk.next !== this.byStart[chunk.end]) {
				throw new Error('Cannot overwrite across a split point');
			}
			chunk = chunk.next;
			chunk.edit('', false);
		}

		first.edit(content, storeName, contentOnly);
	} else {
		// must be inserting at the end
		var newChunk = new Chunk$2(start, end, '').edit(content, storeName);

		// TODO last chunk in the array may not be the last chunk, if it's moved...
		last.next = newChunk;
		newChunk.previous = last;
	}
	return this;
};

MagicString$2.prototype.prepend = function prepend (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.intro = content + this.intro;
	return this;
};

MagicString$2.prototype.prependLeft = function prependLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.prependLeft(content);
	} else {
		this.intro = content + this.intro;
	}
	return this;
};

MagicString$2.prototype.prependRight = function prependRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.prependRight(content);
	} else {
		this.outro = content + this.outro;
	}
	return this;
};

MagicString$2.prototype.remove = function remove (start, end) {
	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (start === end) { return this; }

	if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
	if (start > end) { throw new Error('end must be greater than start'); }

	this._split(start);
	this._split(end);

	var chunk = this.byStart[start];

	while (chunk) {
		chunk.intro = '';
		chunk.outro = '';
		chunk.edit('');

		chunk = end > chunk.end ? this.byStart[chunk.end] : null;
	}
	return this;
};

MagicString$2.prototype.lastChar = function lastChar () {
	if (this.outro.length) { return this.outro[this.outro.length - 1]; }
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length) { return chunk.outro[chunk.outro.length - 1]; }
		if (chunk.content.length) { return chunk.content[chunk.content.length - 1]; }
		if (chunk.intro.length) { return chunk.intro[chunk.intro.length - 1]; }
	} while ((chunk = chunk.previous));
	if (this.intro.length) { return this.intro[this.intro.length - 1]; }
	return '';
};

MagicString$2.prototype.lastLine = function lastLine () {
	var lineIndex = this.outro.lastIndexOf(n$2);
	if (lineIndex !== -1) { return this.outro.substr(lineIndex + 1); }
	var lineStr = this.outro;
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length > 0) {
			lineIndex = chunk.outro.lastIndexOf(n$2);
			if (lineIndex !== -1) { return chunk.outro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.outro + lineStr;
		}

		if (chunk.content.length > 0) {
			lineIndex = chunk.content.lastIndexOf(n$2);
			if (lineIndex !== -1) { return chunk.content.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.content + lineStr;
		}

		if (chunk.intro.length > 0) {
			lineIndex = chunk.intro.lastIndexOf(n$2);
			if (lineIndex !== -1) { return chunk.intro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.intro + lineStr;
		}
	} while ((chunk = chunk.previous));
	lineIndex = this.intro.lastIndexOf(n$2);
	if (lineIndex !== -1) { return this.intro.substr(lineIndex + 1) + lineStr; }
	return this.intro + lineStr;
};

MagicString$2.prototype.slice = function slice (start, end) {
		if ( start === void 0 ) start = 0;
		if ( end === void 0 ) end = this.original.length;

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	var result = '';

	// find start chunk
	var chunk = this.firstChunk;
	while (chunk && (chunk.start > start || chunk.end <= start)) {
		// found end chunk before start
		if (chunk.start < end && chunk.end >= end) {
			return result;
		}

		chunk = chunk.next;
	}

	if (chunk && chunk.edited && chunk.start !== start)
		{ throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }

	var startChunk = chunk;
	while (chunk) {
		if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
			result += chunk.intro;
		}

		var containsEnd = chunk.start < end && chunk.end >= end;
		if (containsEnd && chunk.edited && chunk.end !== end)
			{ throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }

		var sliceStart = startChunk === chunk ? start - chunk.start : 0;
		var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;

		result += chunk.content.slice(sliceStart, sliceEnd);

		if (chunk.outro && (!containsEnd || chunk.end === end)) {
			result += chunk.outro;
		}

		if (containsEnd) {
			break;
		}

		chunk = chunk.next;
	}

	return result;
};

// TODO deprecate this? not really very useful
MagicString$2.prototype.snip = function snip (start, end) {
	var clone = this.clone();
	clone.remove(0, start);
	clone.remove(end, clone.original.length);

	return clone;
};

MagicString$2.prototype._split = function _split (index) {
	if (this.byStart[index] || this.byEnd[index]) { return; }

	var chunk = this.lastSearchedChunk;
	var searchForward = index > chunk.end;

	while (chunk) {
		if (chunk.contains(index)) { return this._splitChunk(chunk, index); }

		chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
	}
};

MagicString$2.prototype._splitChunk = function _splitChunk (chunk, index) {
	if (chunk.edited && chunk.content.length) {
		// zero-length edited chunks are a special case (overlapping replacements)
		var loc = getLocator$2(this.original)(index);
		throw new Error(
			("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
		);
	}

	var newChunk = chunk.split(index);

	this.byEnd[index] = chunk;
	this.byStart[index] = newChunk;
	this.byEnd[newChunk.end] = newChunk;

	if (chunk === this.lastChunk) { this.lastChunk = newChunk; }

	this.lastSearchedChunk = chunk;
	return true;
};

MagicString$2.prototype.toString = function toString () {
	var str = this.intro;

	var chunk = this.firstChunk;
	while (chunk) {
		str += chunk.toString();
		chunk = chunk.next;
	}

	return str + this.outro;
};

MagicString$2.prototype.isEmpty = function isEmpty () {
	var chunk = this.firstChunk;
	do {
		if (
			(chunk.intro.length && chunk.intro.trim()) ||
			(chunk.content.length && chunk.content.trim()) ||
			(chunk.outro.length && chunk.outro.trim())
		)
			{ return false; }
	} while ((chunk = chunk.next));
	return true;
};

MagicString$2.prototype.length = function length () {
	var chunk = this.firstChunk;
	var length = 0;
	do {
		length += chunk.intro.length + chunk.content.length + chunk.outro.length;
	} while ((chunk = chunk.next));
	return length;
};

MagicString$2.prototype.trimLines = function trimLines () {
	return this.trim('[\\r\\n]');
};

MagicString$2.prototype.trim = function trim (charType) {
	return this.trimStart(charType).trimEnd(charType);
};

MagicString$2.prototype.trimEndAborted = function trimEndAborted (charType) {
	var rx = new RegExp((charType || '\\s') + '+$');

	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var chunk = this.lastChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimEnd(rx);

		// if chunk was trimmed, we have a new lastChunk
		if (chunk.end !== end) {
			if (this.lastChunk === chunk) {
				this.lastChunk = chunk.next;
			}

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.previous;
	} while (chunk);

	return false;
};

MagicString$2.prototype.trimEnd = function trimEnd (charType) {
	this.trimEndAborted(charType);
	return this;
};
MagicString$2.prototype.trimStartAborted = function trimStartAborted (charType) {
	var rx = new RegExp('^' + (charType || '\\s') + '+');

	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var chunk = this.firstChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimStart(rx);

		if (chunk.end !== end) {
			// special case...
			if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.next;
	} while (chunk);

	return false;
};

MagicString$2.prototype.trimStart = function trimStart (charType) {
	this.trimStartAborted(charType);
	return this;
};

// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray$5(arg) {
  return Array.isArray(arg);
}
function ensureArray$4(thing) {
  if (isArray$5(thing))
    return thing;
  if (thing == null)
    return [];
  return [thing];
}

function getMatcherString(id, resolutionBase) {
  if (resolutionBase === false) {
    return id;
  }
  // resolve('') is valid and will default to process.cwd()
  const basePath = resolve$3(resolutionBase || '')
    .split(sep)
    .join('/')
    // escape all possible (posix + win) path characters that might interfere with regex
    .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  // Note that we use posix.join because:
  // 1. the basePath has been normalized to use /
  // 2. the incoming glob (id) matcher, also uses /
  // otherwise Node will force backslash (\) on windows
  return posix$1.join(basePath, id);
}
const createFilter = function createFilter(include, exclude, options) {
  const resolutionBase = options && options.resolve;
  const getMatcher = (id) => id instanceof RegExp
    ? id
    : {
      test: (what) => {
        // this refactor is a tad overly verbose but makes for easy debugging
        const pattern = getMatcherString(id, resolutionBase);
        const fn = picomatch(pattern, { dot: true });
        const result = fn(what);
        return result;
      }
    };
  const includeMatchers = ensureArray$4(include).map(getMatcher);
  const excludeMatchers = ensureArray$4(exclude).map(getMatcher);
  return function result(id) {
    if (typeof id !== 'string')
      return false;
    if (/\0/.test(id))
      return false;
    const pathId = id.split(sep).join('/');
    for (let i = 0; i < excludeMatchers.length; ++i) {
      const matcher = excludeMatchers[i];
      if (matcher.test(pathId))
        return false;
    }
    for (let i = 0; i < includeMatchers.length; ++i) {
      const matcher = includeMatchers[i];
      if (matcher.test(pathId))
        return true;
    }
    return !includeMatchers.length;
  };
};

const reservedWords$4 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins$5 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const forbiddenIdentifiers = new Set(`${reservedWords$4} ${builtins$5}`.split(' '));
forbiddenIdentifiers.add('');

function escape(str) {
  return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
}

function ensureFunction(functionOrValue) {
  if (typeof functionOrValue === 'function') { return functionOrValue; }
  return function () { return functionOrValue; };
}

function longest(a, b) {
  return b.length - a.length;
}

function getReplacements(options) {
  if (options.values) {
  return Object.assign({}, options.values);
  }
  var values = Object.assign({}, options);
  delete values.delimiters;
  delete values.include;
  delete values.exclude;
  delete values.sourcemap;
  delete values.sourceMap;
  return values;
}

function mapToFunctions(object) {
  return Object.keys(object).reduce(function (fns, key) {
  var functions = Object.assign({}, fns);
  functions[key] = ensureFunction(object[key]);
  return functions;
  }, {});
}

function replace(options) {
  if ( options === void 0 ) options = {};

  var filter = createFilter(options.include, options.exclude);
  var delimiters = options.delimiters;
  var functionValues = mapToFunctions(getReplacements(options));
  var keys = Object.keys(functionValues)
  .sort(longest)
  .map(escape);
  var pattern = delimiters
  ? new RegExp(((escape(delimiters[0])) + "(" + (keys.join('|')) + ")" + (escape(delimiters[1]))), 'g')
  : new RegExp(("\\b(" + (keys.join('|')) + ")\\b"), 'g');

  return {
  name: 'replace',

  renderChunk: function renderChunk(code, chunk) {
    var id = chunk.fileName;
    if (!keys.length) { return null; }
    if (!filter(id)) { return null; }
    return executeReplacement(code, id);
  },

  transform: function transform(code, id) {
    if (!keys.length) { return null; }
    if (!filter(id)) { return null; }
    return executeReplacement(code, id);
  }
  };

  function executeReplacement(code, id) {
  var magicString = new MagicString$2(code);
  if (!codeHasReplacements(code, id, magicString)) {
    return null;
  }

  var result = { code: magicString.toString() };
  if (isSourceMapEnabled()) {
    result.map = magicString.generateMap({ hires: true });
  }
  return result;
  }

  function codeHasReplacements(code, id, magicString) {
  var result = false;
  var match;

  // eslint-disable-next-line no-cond-assign
  while ((match = pattern.exec(code))) {
    result = true;

    var start = match.index;
    var end = start + match[0].length;
    var replacement = String(functionValues[match[1]](id));
    magicString.overwrite(start, end, replacement);
  }
  return result;
  }

  function isSourceMapEnabled() {
  return options.sourceMap !== false && options.sourcemap !== false;
  }
}

var minimalisticAssert = assert;

function assert(val, msg) {
  if (!val)
  throw new Error(msg || 'Assertion failed');
}

assert.equal = function assertEqual(l, r, msg) {
  if (l != r)
  throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
};

var inherits_browser = createCommonjsModule$1(function (module) {
if (typeof Object.create === 'function') {
  // implementation from standard node.js 'util' module
  module.exports = function inherits(ctor, superCtor) {
  if (superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
    constructor: {
      value: ctor,
      enumerable: false,
      writable: true,
      configurable: true
    }
    });
  }
  };
} else {
  // old school shim for old browsers
  module.exports = function inherits(ctor, superCtor) {
  if (superCtor) {
    ctor.super_ = superCtor;
    var TempCtor = function () {};
    TempCtor.prototype = superCtor.prototype;
    ctor.prototype = new TempCtor();
    ctor.prototype.constructor = ctor;
  }
  };
}
});

const require$$0 = /*@__PURE__*/getAugmentedNamespace$1(util$4);

var inherits = createCommonjsModule$1(function (module) {
try {
  var util = require$$0;
  /* istanbul ignore next */
  if (typeof util.inherits !== 'function') throw '';
  module.exports = util.inherits;
} catch (e) {
  /* istanbul ignore next */
  module.exports = inherits_browser;
}
});

var inherits_1 = inherits;

function isSurrogatePair(msg, i) {
  if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  return false;
  }
  if (i < 0 || i + 1 >= msg.length) {
  return false;
  }
  return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
}

function toArray(msg, enc) {
  if (Array.isArray(msg))
  return msg.slice();
  if (!msg)
  return [];
  var res = [];
  if (typeof msg === 'string') {
  if (!enc) {
    // Inspired by stringToUtf8ByteArray() in closure-library by Google
    // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
    // Apache License 2.0
    // https://github.com/google/closure-library/blob/master/LICENSE
    var p = 0;
    for (var i = 0; i < msg.length; i++) {
    var c = msg.charCodeAt(i);
    if (c < 128) {
      res[p++] = c;
    } else if (c < 2048) {
      res[p++] = (c >> 6) | 192;
      res[p++] = (c & 63) | 128;
    } else if (isSurrogatePair(msg, i)) {
      c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
      res[p++] = (c >> 18) | 240;
      res[p++] = ((c >> 12) & 63) | 128;
      res[p++] = ((c >> 6) & 63) | 128;
      res[p++] = (c & 63) | 128;
    } else {
      res[p++] = (c >> 12) | 224;
      res[p++] = ((c >> 6) & 63) | 128;
      res[p++] = (c & 63) | 128;
    }
    }
  } else if (enc === 'hex') {
    msg = msg.replace(/[^a-z0-9]+/ig, '');
    if (msg.length % 2 !== 0)
    msg = '0' + msg;
    for (i = 0; i < msg.length; i += 2)
    res.push(parseInt(msg[i] + msg[i + 1], 16));
  }
  } else {
  for (i = 0; i < msg.length; i++)
    res[i] = msg[i] | 0;
  }
  return res;
}
var toArray_1 = toArray;

function toHex(msg) {
  var res = '';
  for (var i = 0; i < msg.length; i++)
  res += zero2(msg[i].toString(16));
  return res;
}
var toHex_1 = toHex;

function htonl(w) {
  var res = (w >>> 24) |
      ((w >>> 8) & 0xff00) |
      ((w << 8) & 0xff0000) |
      ((w & 0xff) << 24);
  return res >>> 0;
}
var htonl_1 = htonl;

function toHex32(msg, endian) {
  var res = '';
  for (var i = 0; i < msg.length; i++) {
  var w = msg[i];
  if (endian === 'little')
    w = htonl(w);
  res += zero8(w.toString(16));
  }
  return res;
}
var toHex32_1 = toHex32;

function zero2(word) {
  if (word.length === 1)
  return '0' + word;
  else
  return word;
}
var zero2_1 = zero2;

function zero8(word) {
  if (word.length === 7)
  return '0' + word;
  else if (word.length === 6)
  return '00' + word;
  else if (word.length === 5)
  return '000' + word;
  else if (word.length === 4)
  return '0000' + word;
  else if (word.length === 3)
  return '00000' + word;
  else if (word.length === 2)
  return '000000' + word;
  else if (word.length === 1)
  return '0000000' + word;
  else
  return word;
}
var zero8_1 = zero8;

function join32(msg, start, end, endian) {
  var len = end - start;
  minimalisticAssert(len % 4 === 0);
  var res = new Array(len / 4);
  for (var i = 0, k = start; i < res.length; i++, k += 4) {
  var w;
  if (endian === 'big')
    w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  else
    w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  res[i] = w >>> 0;
  }
  return res;
}
var join32_1 = join32;

function split32(msg, endian) {
  var res = new Array(msg.length * 4);
  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  var m = msg[i];
  if (endian === 'big') {
    res[k] = m >>> 24;
    res[k + 1] = (m >>> 16) & 0xff;
    res[k + 2] = (m >>> 8) & 0xff;
    res[k + 3] = m & 0xff;
  } else {
    res[k + 3] = m >>> 24;
    res[k + 2] = (m >>> 16) & 0xff;
    res[k + 1] = (m >>> 8) & 0xff;
    res[k] = m & 0xff;
  }
  }
  return res;
}
var split32_1 = split32;

function rotr32$1(w, b) {
  return (w >>> b) | (w << (32 - b));
}
var rotr32_1 = rotr32$1;

function rotl32(w, b) {
  return (w << b) | (w >>> (32 - b));
}
var rotl32_1 = rotl32;

function sum32$1(a, b) {
  return (a + b) >>> 0;
}
var sum32_1 = sum32$1;

function sum32_3(a, b, c) {
  return (a + b + c) >>> 0;
}
var sum32_3_1 = sum32_3;

function sum32_4$1(a, b, c, d) {
  return (a + b + c + d) >>> 0;
}
var sum32_4_1 = sum32_4$1;

function sum32_5$1(a, b, c, d, e) {
  return (a + b + c + d + e) >>> 0;
}
var sum32_5_1 = sum32_5$1;

function sum64(buf, pos, ah, al) {
  var bh = buf[pos];
  var bl = buf[pos + 1];

  var lo = (al + bl) >>> 0;
  var hi = (lo < al ? 1 : 0) + ah + bh;
  buf[pos] = hi >>> 0;
  buf[pos + 1] = lo;
}
var sum64_1 = sum64;

function sum64_hi(ah, al, bh, bl) {
  var lo = (al + bl) >>> 0;
  var hi = (lo < al ? 1 : 0) + ah + bh;
  return hi >>> 0;
}
var sum64_hi_1 = sum64_hi;

function sum64_lo(ah, al, bh, bl) {
  var lo = al + bl;
  return lo >>> 0;
}
var sum64_lo_1 = sum64_lo;

function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  var carry = 0;
  var lo = al;
  lo = (lo + bl) >>> 0;
  carry += lo < al ? 1 : 0;
  lo = (lo + cl) >>> 0;
  carry += lo < cl ? 1 : 0;
  lo = (lo + dl) >>> 0;
  carry += lo < dl ? 1 : 0;

  var hi = ah + bh + ch + dh + carry;
  return hi >>> 0;
}
var sum64_4_hi_1 = sum64_4_hi;

function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  var lo = al + bl + cl + dl;
  return lo >>> 0;
}
var sum64_4_lo_1 = sum64_4_lo;

function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  var carry = 0;
  var lo = al;
  lo = (lo + bl) >>> 0;
  carry += lo < al ? 1 : 0;
  lo = (lo + cl) >>> 0;
  carry += lo < cl ? 1 : 0;
  lo = (lo + dl) >>> 0;
  carry += lo < dl ? 1 : 0;
  lo = (lo + el) >>> 0;
  carry += lo < el ? 1 : 0;

  var hi = ah + bh + ch + dh + eh + carry;
  return hi >>> 0;
}
var sum64_5_hi_1 = sum64_5_hi;

function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  var lo = al + bl + cl + dl + el;

  return lo >>> 0;
}
var sum64_5_lo_1 = sum64_5_lo;

function rotr64_hi(ah, al, num) {
  var r = (al << (32 - num)) | (ah >>> num);
  return r >>> 0;
}
var rotr64_hi_1 = rotr64_hi;

function rotr64_lo(ah, al, num) {
  var r = (ah << (32 - num)) | (al >>> num);
  return r >>> 0;
}
var rotr64_lo_1 = rotr64_lo;

function shr64_hi(ah, al, num) {
  return ah >>> num;
}
var shr64_hi_1 = shr64_hi;

function shr64_lo(ah, al, num) {
  var r = (ah << (32 - num)) | (al >>> num);
  return r >>> 0;
}
var shr64_lo_1 = shr64_lo;

var utils = {
	inherits: inherits_1,
	toArray: toArray_1,
	toHex: toHex_1,
	htonl: htonl_1,
	toHex32: toHex32_1,
	zero2: zero2_1,
	zero8: zero8_1,
	join32: join32_1,
	split32: split32_1,
	rotr32: rotr32_1,
	rotl32: rotl32_1,
	sum32: sum32_1,
	sum32_3: sum32_3_1,
	sum32_4: sum32_4_1,
	sum32_5: sum32_5_1,
	sum64: sum64_1,
	sum64_hi: sum64_hi_1,
	sum64_lo: sum64_lo_1,
	sum64_4_hi: sum64_4_hi_1,
	sum64_4_lo: sum64_4_lo_1,
	sum64_5_hi: sum64_5_hi_1,
	sum64_5_lo: sum64_5_lo_1,
	rotr64_hi: rotr64_hi_1,
	rotr64_lo: rotr64_lo_1,
	shr64_hi: shr64_hi_1,
	shr64_lo: shr64_lo_1
};

function BlockHash$1() {
  this.pending = null;
  this.pendingTotal = 0;
  this.blockSize = this.constructor.blockSize;
  this.outSize = this.constructor.outSize;
  this.hmacStrength = this.constructor.hmacStrength;
  this.padLength = this.constructor.padLength / 8;
  this.endian = 'big';

  this._delta8 = this.blockSize / 8;
  this._delta32 = this.blockSize / 32;
}
var BlockHash_1 = BlockHash$1;

BlockHash$1.prototype.update = function update(msg, enc) {
  // Convert message to array, pad it, and join into 32bit blocks
  msg = utils.toArray(msg, enc);
  if (!this.pending)
  this.pending = msg;
  else
  this.pending = this.pending.concat(msg);
  this.pendingTotal += msg.length;

  // Enough data, try updating
  if (this.pending.length >= this._delta8) {
  msg = this.pending;

  // Process pending data in blocks
  var r = msg.length % this._delta8;
  this.pending = msg.slice(msg.length - r, msg.length);
  if (this.pending.length === 0)
    this.pending = null;

  msg = utils.join32(msg, 0, msg.length - r, this.endian);
  for (var i = 0; i < msg.length; i += this._delta32)
    this._update(msg, i, i + this._delta32);
  }

  return this;
};

BlockHash$1.prototype.digest = function digest(enc) {
  this.update(this._pad());
  minimalisticAssert(this.pending === null);

  return this._digest(enc);
};

BlockHash$1.prototype._pad = function pad() {
  var len = this.pendingTotal;
  var bytes = this._delta8;
  var k = bytes - ((len + this.padLength) % bytes);
  var res = new Array(k + this.padLength);
  res[0] = 0x80;
  for (var i = 1; i < k; i++)
  res[i] = 0;

  // Append length
  len <<= 3;
  if (this.endian === 'big') {
  for (var t = 8; t < this.padLength; t++)
    res[i++] = 0;

  res[i++] = 0;
  res[i++] = 0;
  res[i++] = 0;
  res[i++] = 0;
  res[i++] = (len >>> 24) & 0xff;
  res[i++] = (len >>> 16) & 0xff;
  res[i++] = (len >>> 8) & 0xff;
  res[i++] = len & 0xff;
  } else {
  res[i++] = len & 0xff;
  res[i++] = (len >>> 8) & 0xff;
  res[i++] = (len >>> 16) & 0xff;
  res[i++] = (len >>> 24) & 0xff;
  res[i++] = 0;
  res[i++] = 0;
  res[i++] = 0;
  res[i++] = 0;

  for (t = 8; t < this.padLength; t++)
    res[i++] = 0;
  }

  return res;
};

var common$1 = {
	BlockHash: BlockHash_1
};

var rotr32 = utils.rotr32;

function ft_1(s, x, y, z) {
  if (s === 0)
  return ch32$1(x, y, z);
  if (s === 1 || s === 3)
  return p32(x, y, z);
  if (s === 2)
  return maj32$1(x, y, z);
}
var ft_1_1 = ft_1;

function ch32$1(x, y, z) {
  return (x & y) ^ ((~x) & z);
}
var ch32_1 = ch32$1;

function maj32$1(x, y, z) {
  return (x & y) ^ (x & z) ^ (y & z);
}
var maj32_1 = maj32$1;

function p32(x, y, z) {
  return x ^ y ^ z;
}
var p32_1 = p32;

function s0_256$1(x) {
  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
}
var s0_256_1 = s0_256$1;

function s1_256$1(x) {
  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
}
var s1_256_1 = s1_256$1;

function g0_256$1(x) {
  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
}
var g0_256_1 = g0_256$1;

function g1_256$1(x) {
  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
}
var g1_256_1 = g1_256$1;

var common = {
	ft_1: ft_1_1,
	ch32: ch32_1,
	maj32: maj32_1,
	p32: p32_1,
	s0_256: s0_256_1,
	s1_256: s1_256_1,
	g0_256: g0_256_1,
	g1_256: g1_256_1
};

var sum32 = utils.sum32;
var sum32_4 = utils.sum32_4;
var sum32_5 = utils.sum32_5;
var ch32 = common.ch32;
var maj32 = common.maj32;
var s0_256 = common.s0_256;
var s1_256 = common.s1_256;
var g0_256 = common.g0_256;
var g1_256 = common.g1_256;

var BlockHash = common$1.BlockHash;

var sha256_K = [
  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
];

function SHA256() {
  if (!(this instanceof SHA256))
  return new SHA256();

  BlockHash.call(this);
  this.h = [
  0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  ];
  this.k = sha256_K;
  this.W = new Array(64);
}
utils.inherits(SHA256, BlockHash);
var _256 = SHA256;

SHA256.blockSize = 512;
SHA256.outSize = 256;
SHA256.hmacStrength = 192;
SHA256.padLength = 64;

SHA256.prototype._update = function _update(msg, start) {
  var W = this.W;

  for (var i = 0; i < 16; i++)
  W[i] = msg[start + i];
  for (; i < W.length; i++)
  W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);

  var a = this.h[0];
  var b = this.h[1];
  var c = this.h[2];
  var d = this.h[3];
  var e = this.h[4];
  var f = this.h[5];
  var g = this.h[6];
  var h = this.h[7];

  minimalisticAssert(this.k.length === W.length);
  for (i = 0; i < W.length; i++) {
  var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  var T2 = sum32(s0_256(a), maj32(a, b, c));
  h = g;
  g = f;
  f = e;
  e = sum32(d, T1);
  d = c;
  c = b;
  b = a;
  a = sum32(T1, T2);
  }

  this.h[0] = sum32(this.h[0], a);
  this.h[1] = sum32(this.h[1], b);
  this.h[2] = sum32(this.h[2], c);
  this.h[3] = sum32(this.h[3], d);
  this.h[4] = sum32(this.h[4], e);
  this.h[5] = sum32(this.h[5], f);
  this.h[6] = sum32(this.h[6], g);
  this.h[7] = sum32(this.h[7], h);
};

SHA256.prototype._digest = function digest(enc) {
  if (enc === 'hex')
  return utils.toHex32(this.h, 'big');
  else
  return utils.split32(this.h, 'big');
};

//@ts-ignore
const createHash$1 = () => _256();

/*
  @license
	Rollup.js v2.42.3
	Mon, 22 Mar 2021 14:48:44 GMT - commit f67e6c9b2cb4066f2ddcdb6d45308f840b2ac62f


	https://github.com/rollup/rollup

	Released under the MIT License.
*/

var version$1 = "2.42.3";

var charToInteger = {};
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
for (var i = 0; i < chars$1.length; i++) {
  charToInteger[chars$1.charCodeAt(i)] = i;
}
function decode(mappings) {
  var decoded = [];
  var line = [];
  var segment = [
    0,
    0,
    0,
    0,
    0,
  ];
  var j = 0;
  for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {
    var c = mappings.charCodeAt(i);
    if (c === 44) { // ","
      segmentify(line, segment, j);
      j = 0;
    }
    else if (c === 59) { // ";"
      segmentify(line, segment, j);
      j = 0;
      decoded.push(line);
      line = [];
      segment[0] = 0;
    }
    else {
      var integer = charToInteger[c];
      if (integer === undefined) {
        throw new Error('Invalid character (' + String.fromCharCode(c) + ')');
      }
      var hasContinuationBit = integer & 32;
      integer &= 31;
      value += integer << shift;
      if (hasContinuationBit) {
        shift += 5;
      }
      else {
        var shouldNegate = value & 1;
        value >>>= 1;
        if (shouldNegate) {
          value = value === 0 ? -0x80000000 : -value;
        }
        segment[j] += value;
        j++;
        value = shift = 0; // reset
      }
    }
  }
  segmentify(line, segment, j);
  decoded.push(line);
  return decoded;
}
function segmentify(line, segment, j) {
  // This looks ugly, but we're creating specialized arrays with a specific
  // length. This is much faster than creating a new array (which v8 expands to
  // a capacity of 17 after pushing the first item), or slicing out a subarray
  // (which is slow). Length 4 is assumed to be the most frequent, followed by
  // length 5 (since not everything will have an associated name), followed by
  // length 1 (it's probably rare for a source substring to not have an
  // associated segment data).
  if (j === 4)
    line.push([segment[0], segment[1], segment[2], segment[3]]);
  else if (j === 5)
    line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);
  else if (j === 1)
    line.push([segment[0]]);
}
function encode(decoded) {
  var sourceFileIndex = 0; // second field
  var sourceCodeLine = 0; // third field
  var sourceCodeColumn = 0; // fourth field
  var nameIndex = 0; // fifth field
  var mappings = '';
  for (var i = 0; i < decoded.length; i++) {
    var line = decoded[i];
    if (i > 0)
      mappings += ';';
    if (line.length === 0)
      continue;
    var generatedCodeColumn = 0; // first field
    var lineMappings = [];
    for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
      var segment = line_1[_i];
      var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);
      generatedCodeColumn = segment[0];
      if (segment.length > 1) {
        segmentMappings +=
          encodeInteger(segment[1] - sourceFileIndex) +
            encodeInteger(segment[2] - sourceCodeLine) +
            encodeInteger(segment[3] - sourceCodeColumn);
        sourceFileIndex = segment[1];
        sourceCodeLine = segment[2];
        sourceCodeColumn = segment[3];
      }
      if (segment.length === 5) {
        segmentMappings += encodeInteger(segment[4] - nameIndex);
        nameIndex = segment[4];
      }
      lineMappings.push(segmentMappings);
    }
    mappings += lineMappings.join(',');
  }
  return mappings;
}
function encodeInteger(num) {
  var result = '';
  num = num < 0 ? (-num << 1) | 1 : num << 1;
  do {
    var clamped = num & 31;
    num >>>= 5;
    if (num > 0) {
      clamped |= 32;
    }
    result += chars$1[clamped];
  } while (num > 0);
  return result;
}

var BitSet = function BitSet(arg) {
	this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
};

BitSet.prototype.add = function add (n) {
	this.bits[n >> 5] |= 1 << (n & 31);
};

BitSet.prototype.has = function has (n) {
	return !!(this.bits[n >> 5] & (1 << (n & 31)));
};

var Chunk$1 = function Chunk(start, end, content) {
	this.start = start;
	this.end = end;
	this.original = content;

	this.intro = '';
	this.outro = '';

	this.content = content;
	this.storeName = false;
	this.edited = false;

	// we make these non-enumerable, for sanity while debugging
	Object.defineProperties(this, {
		previous: { writable: true, value: null },
		next:   { writable: true, value: null }
	});
};

Chunk$1.prototype.appendLeft = function appendLeft (content) {
	this.outro += content;
};

Chunk$1.prototype.appendRight = function appendRight (content) {
	this.intro = this.intro + content;
};

Chunk$1.prototype.clone = function clone () {
	var chunk = new Chunk$1(this.start, this.end, this.original);

	chunk.intro = this.intro;
	chunk.outro = this.outro;
	chunk.content = this.content;
	chunk.storeName = this.storeName;
	chunk.edited = this.edited;

	return chunk;
};

Chunk$1.prototype.contains = function contains (index) {
	return this.start < index && index < this.end;
};

Chunk$1.prototype.eachNext = function eachNext (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.next;
	}
};

Chunk$1.prototype.eachPrevious = function eachPrevious (fn) {
	var chunk = this;
	while (chunk) {
		fn(chunk);
		chunk = chunk.previous;
	}
};

Chunk$1.prototype.edit = function edit (content, storeName, contentOnly) {
	this.content = content;
	if (!contentOnly) {
		this.intro = '';
		this.outro = '';
	}
	this.storeName = storeName;

	this.edited = true;

	return this;
};

Chunk$1.prototype.prependLeft = function prependLeft (content) {
	this.outro = content + this.outro;
};

Chunk$1.prototype.prependRight = function prependRight (content) {
	this.intro = content + this.intro;
};

Chunk$1.prototype.split = function split (index) {
	var sliceIndex = index - this.start;

	var originalBefore = this.original.slice(0, sliceIndex);
	var originalAfter = this.original.slice(sliceIndex);

	this.original = originalBefore;

	var newChunk = new Chunk$1(index, this.end, originalAfter);
	newChunk.outro = this.outro;
	this.outro = '';

	this.end = index;

	if (this.edited) {
		// TODO is this block necessary?...
		newChunk.edit('', false);
		this.content = '';
	} else {
		this.content = originalBefore;
	}

	newChunk.next = this.next;
	if (newChunk.next) { newChunk.next.previous = newChunk; }
	newChunk.previous = this;
	this.next = newChunk;

	return newChunk;
};

Chunk$1.prototype.toString = function toString () {
	return this.intro + this.content + this.outro;
};

Chunk$1.prototype.trimEnd = function trimEnd (rx) {
	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.start + trimmed.length).edit('', undefined, true);
		}
		return true;

	} else {
		this.edit('', undefined, true);

		this.intro = this.intro.replace(rx, '');
		if (this.intro.length) { return true; }
	}
};

Chunk$1.prototype.trimStart = function trimStart (rx) {
	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var trimmed = this.content.replace(rx, '');

	if (trimmed.length) {
		if (trimmed !== this.content) {
			this.split(this.end - trimmed.length);
			this.edit('', undefined, true);
		}
		return true;

	} else {
		this.edit('', undefined, true);

		this.outro = this.outro.replace(rx, '');
		if (this.outro.length) { return true; }
	}
};

var btoa$1 = function () {
	throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
	btoa$1 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
} else if (typeof Buffer === 'function') {
	btoa$1 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
}

var SourceMap = function SourceMap(properties) {
	this.version = 3;
	this.file = properties.file;
	this.sources = properties.sources;
	this.sourcesContent = properties.sourcesContent;
	this.names = properties.names;
	this.mappings = encode(properties.mappings);
};

SourceMap.prototype.toString = function toString () {
	return JSON.stringify(this);
};

SourceMap.prototype.toUrl = function toUrl () {
	return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString());
};

function guessIndent(code) {
	var lines = code.split('\n');

	var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
	var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });

	if (tabbed.length === 0 && spaced.length === 0) {
		return null;
	}

	// More lines tabbed than spaced? Assume tabs, and
	// default to tabs in the case of a tie (or nothing
	// to go on)
	if (tabbed.length >= spaced.length) {
		return '\t';
	}

	// Otherwise, we need to guess the multiple
	var min = spaced.reduce(function (previous, current) {
		var numSpaces = /^ +/.exec(current)[0].length;
		return Math.min(numSpaces, previous);
	}, Infinity);

	return new Array(min + 1).join(' ');
}

function getRelativePath(from, to) {
	var fromParts = from.split(/[/\\]/);
	var toParts = to.split(/[/\\]/);

	fromParts.pop(); // get dirname

	while (fromParts[0] === toParts[0]) {
		fromParts.shift();
		toParts.shift();
	}

	if (fromParts.length) {
		var i = fromParts.length;
		while (i--) { fromParts[i] = '..'; }
	}

	return fromParts.concat(toParts).join('/');
}

var toString$1 = Object.prototype.toString;

function isObject(thing) {
	return toString$1.call(thing) === '[object Object]';
}

function getLocator$1(source) {
	var originalLines = source.split('\n');
	var lineOffsets = [];

	for (var i = 0, pos = 0; i < originalLines.length; i++) {
		lineOffsets.push(pos);
		pos += originalLines[i].length + 1;
	}

	return function locate(index) {
		var i = 0;
		var j = lineOffsets.length;
		while (i < j) {
			var m = (i + j) >> 1;
			if (index < lineOffsets[m]) {
				j = m;
			} else {
				i = m + 1;
			}
		}
		var line = i - 1;
		var column = index - lineOffsets[line];
		return { line: line, column: column };
	};
}

var Mappings = function Mappings(hires) {
	this.hires = hires;
	this.generatedCodeLine = 0;
	this.generatedCodeColumn = 0;
	this.raw = [];
	this.rawSegments = this.raw[this.generatedCodeLine] = [];
	this.pending = null;
};

Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
	if (content.length) {
		var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
		if (nameIndex >= 0) {
			segment.push(nameIndex);
		}
		this.rawSegments.push(segment);
	} else if (this.pending) {
		this.rawSegments.push(this.pending);
	}

	this.advance(content);
	this.pending = null;
};

Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
	var originalCharIndex = chunk.start;
	var first = true;

	while (originalCharIndex < chunk.end) {
		if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
			this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
		}

		if (original[originalCharIndex] === '\n') {
			loc.line += 1;
			loc.column = 0;
			this.generatedCodeLine += 1;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
			this.generatedCodeColumn = 0;
			first = true;
		} else {
			loc.column += 1;
			this.generatedCodeColumn += 1;
			first = false;
		}

		originalCharIndex += 1;
	}

	this.pending = null;
};

Mappings.prototype.advance = function advance (str) {
	if (!str) { return; }

	var lines = str.split('\n');

	if (lines.length > 1) {
		for (var i = 0; i < lines.length - 1; i++) {
			this.generatedCodeLine++;
			this.raw[this.generatedCodeLine] = this.rawSegments = [];
		}
		this.generatedCodeColumn = 0;
	}

	this.generatedCodeColumn += lines[lines.length - 1].length;
};

var n = '\n';

var warned = {
	insertLeft: false,
	insertRight: false,
	storeName: false
};

var MagicString = function MagicString(string, options) {
	if ( options === void 0 ) options = {};

	var chunk = new Chunk$1(0, string.length, string);

	Object.defineProperties(this, {
		original:        { writable: true, value: string },
		outro:         { writable: true, value: '' },
		intro:         { writable: true, value: '' },
		firstChunk:      { writable: true, value: chunk },
		lastChunk:       { writable: true, value: chunk },
		lastSearchedChunk:   { writable: true, value: chunk },
		byStart:         { writable: true, value: {} },
		byEnd:         { writable: true, value: {} },
		filename:        { writable: true, value: options.filename },
		indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
		sourcemapLocations:  { writable: true, value: new BitSet() },
		storedNames:       { writable: true, value: {} },
		indentStr:       { writable: true, value: guessIndent(string) }
	});

	this.byStart[0] = chunk;
	this.byEnd[string.length] = chunk;
};

MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
	this.sourcemapLocations.add(char);
};

MagicString.prototype.append = function append (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.outro += content;
	return this;
};

MagicString.prototype.appendLeft = function appendLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.appendLeft(content);
	} else {
		this.intro += content;
	}
	return this;
};

MagicString.prototype.appendRight = function appendRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.appendRight(content);
	} else {
		this.outro += content;
	}
	return this;
};

MagicString.prototype.clone = function clone () {
	var cloned = new MagicString(this.original, { filename: this.filename });

	var originalChunk = this.firstChunk;
	var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());

	while (originalChunk) {
		cloned.byStart[clonedChunk.start] = clonedChunk;
		cloned.byEnd[clonedChunk.end] = clonedChunk;

		var nextOriginalChunk = originalChunk.next;
		var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();

		if (nextClonedChunk) {
			clonedChunk.next = nextClonedChunk;
			nextClonedChunk.previous = clonedChunk;

			clonedChunk = nextClonedChunk;
		}

		originalChunk = nextOriginalChunk;
	}

	cloned.lastChunk = clonedChunk;

	if (this.indentExclusionRanges) {
		cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
	}

	cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);

	cloned.intro = this.intro;
	cloned.outro = this.outro;

	return cloned;
};

MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) {
		var this$1 = this;

	options = options || {};

	var sourceIndex = 0;
	var names = Object.keys(this.storedNames);
	var mappings = new Mappings(options.hires);

	var locate = getLocator$1(this.original);

	if (this.intro) {
		mappings.advance(this.intro);
	}

	this.firstChunk.eachNext(function (chunk) {
		var loc = locate(chunk.start);

		if (chunk.intro.length) { mappings.advance(chunk.intro); }

		if (chunk.edited) {
			mappings.addEdit(
				sourceIndex,
				chunk.content,
				loc,
				chunk.storeName ? names.indexOf(chunk.original) : -1
			);
		} else {
			mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
		}

		if (chunk.outro.length) { mappings.advance(chunk.outro); }
	});

	return {
		file: options.file ? options.file.split(/[/\\]/).pop() : null,
		sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
		sourcesContent: options.includeContent ? [this.original] : [null],
		names: names,
		mappings: mappings.raw
	};
};

MagicString.prototype.generateMap = function generateMap (options) {
	return new SourceMap(this.generateDecodedMap(options));
};

MagicString.prototype.getIndentString = function getIndentString () {
	return this.indentStr === null ? '\t' : this.indentStr;
};

MagicString.prototype.indent = function indent (indentStr, options) {
	var pattern = /^[^\r\n]/gm;

	if (isObject(indentStr)) {
		options = indentStr;
		indentStr = undefined;
	}

	indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';

	if (indentStr === '') { return this; } // noop

	options = options || {};

	// Process exclusion ranges
	var isExcluded = {};

	if (options.exclude) {
		var exclusions =
			typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
		exclusions.forEach(function (exclusion) {
			for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
				isExcluded[i] = true;
			}
		});
	}

	var shouldIndentNextCharacter = options.indentStart !== false;
	var replacer = function (match) {
		if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
		shouldIndentNextCharacter = true;
		return match;
	};

	this.intro = this.intro.replace(pattern, replacer);

	var charIndex = 0;
	var chunk = this.firstChunk;

	while (chunk) {
		var end = chunk.end;

		if (chunk.edited) {
			if (!isExcluded[charIndex]) {
				chunk.content = chunk.content.replace(pattern, replacer);

				if (chunk.content.length) {
					shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
				}
			}
		} else {
			charIndex = chunk.start;

			while (charIndex < end) {
				if (!isExcluded[charIndex]) {
					var char = this.original[charIndex];

					if (char === '\n') {
						shouldIndentNextCharacter = true;
					} else if (char !== '\r' && shouldIndentNextCharacter) {
						shouldIndentNextCharacter = false;

						if (charIndex === chunk.start) {
							chunk.prependRight(indentStr);
						} else {
							this._splitChunk(chunk, charIndex);
							chunk = chunk.next;
							chunk.prependRight(indentStr);
						}
					}
				}

				charIndex += 1;
			}
		}

		charIndex = chunk.end;
		chunk = chunk.next;
	}

	this.outro = this.outro.replace(pattern, replacer);

	return this;
};

MagicString.prototype.insert = function insert () {
	throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
};

MagicString.prototype.insertLeft = function insertLeft (index, content) {
	if (!warned.insertLeft) {
		console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
		warned.insertLeft = true;
	}

	return this.appendLeft(index, content);
};

MagicString.prototype.insertRight = function insertRight (index, content) {
	if (!warned.insertRight) {
		console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
		warned.insertRight = true;
	}

	return this.prependRight(index, content);
};

MagicString.prototype.move = function move (start, end, index) {
	if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }

	this._split(start);
	this._split(end);
	this._split(index);

	var first = this.byStart[start];
	var last = this.byEnd[end];

	var oldLeft = first.previous;
	var oldRight = last.next;

	var newRight = this.byStart[index];
	if (!newRight && last === this.lastChunk) { return this; }
	var newLeft = newRight ? newRight.previous : this.lastChunk;

	if (oldLeft) { oldLeft.next = oldRight; }
	if (oldRight) { oldRight.previous = oldLeft; }

	if (newLeft) { newLeft.next = first; }
	if (newRight) { newRight.previous = last; }

	if (!first.previous) { this.firstChunk = last.next; }
	if (!last.next) {
		this.lastChunk = first.previous;
		this.lastChunk.next = null;
	}

	first.previous = newLeft;
	last.next = newRight || null;

	if (!newLeft) { this.firstChunk = first; }
	if (!newRight) { this.lastChunk = last; }
	return this;
};

MagicString.prototype.overwrite = function overwrite (start, end, content, options) {
	if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (end > this.original.length) { throw new Error('end is out of bounds'); }
	if (start === end)
		{ throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }

	this._split(start);
	this._split(end);

	if (options === true) {
		if (!warned.storeName) {
			console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
			warned.storeName = true;
		}

		options = { storeName: true };
	}
	var storeName = options !== undefined ? options.storeName : false;
	var contentOnly = options !== undefined ? options.contentOnly : false;

	if (storeName) {
		var original = this.original.slice(start, end);
		this.storedNames[original] = true;
	}

	var first = this.byStart[start];
	var last = this.byEnd[end];

	if (first) {
		if (end > first.end && first.next !== this.byStart[first.end]) {
			throw new Error('Cannot overwrite across a split point');
		}

		first.edit(content, storeName, contentOnly);

		if (first !== last) {
			var chunk = first.next;
			while (chunk !== last) {
				chunk.edit('', false);
				chunk = chunk.next;
			}

			chunk.edit('', false);
		}
	} else {
		// must be inserting at the end
		var newChunk = new Chunk$1(start, end, '').edit(content, storeName);

		// TODO last chunk in the array may not be the last chunk, if it's moved...
		last.next = newChunk;
		newChunk.previous = last;
	}
	return this;
};

MagicString.prototype.prepend = function prepend (content) {
	if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }

	this.intro = content + this.intro;
	return this;
};

MagicString.prototype.prependLeft = function prependLeft (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byEnd[index];

	if (chunk) {
		chunk.prependLeft(content);
	} else {
		this.intro = content + this.intro;
	}
	return this;
};

MagicString.prototype.prependRight = function prependRight (index, content) {
	if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }

	this._split(index);

	var chunk = this.byStart[index];

	if (chunk) {
		chunk.prependRight(content);
	} else {
		this.outro = content + this.outro;
	}
	return this;
};

MagicString.prototype.remove = function remove (start, end) {
	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	if (start === end) { return this; }

	if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
	if (start > end) { throw new Error('end must be greater than start'); }

	this._split(start);
	this._split(end);

	var chunk = this.byStart[start];

	while (chunk) {
		chunk.intro = '';
		chunk.outro = '';
		chunk.edit('');

		chunk = end > chunk.end ? this.byStart[chunk.end] : null;
	}
	return this;
};

MagicString.prototype.lastChar = function lastChar () {
	if (this.outro.length)
		{ return this.outro[this.outro.length - 1]; }
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length)
			{ return chunk.outro[chunk.outro.length - 1]; }
		if (chunk.content.length)
			{ return chunk.content[chunk.content.length - 1]; }
		if (chunk.intro.length)
			{ return chunk.intro[chunk.intro.length - 1]; }
	} while (chunk = chunk.previous);
	if (this.intro.length)
		{ return this.intro[this.intro.length - 1]; }
	return '';
};

MagicString.prototype.lastLine = function lastLine () {
	var lineIndex = this.outro.lastIndexOf(n);
	if (lineIndex !== -1)
		{ return this.outro.substr(lineIndex + 1); }
	var lineStr = this.outro;
	var chunk = this.lastChunk;
	do {
		if (chunk.outro.length > 0) {
			lineIndex = chunk.outro.lastIndexOf(n);
			if (lineIndex !== -1)
				{ return chunk.outro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.outro + lineStr;
		}

		if (chunk.content.length > 0) {
			lineIndex = chunk.content.lastIndexOf(n);
			if (lineIndex !== -1)
				{ return chunk.content.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.content + lineStr;
		}

		if (chunk.intro.length > 0) {
			lineIndex = chunk.intro.lastIndexOf(n);
			if (lineIndex !== -1)
				{ return chunk.intro.substr(lineIndex + 1) + lineStr; }
			lineStr = chunk.intro + lineStr;
		}
	} while (chunk = chunk.previous);
	lineIndex = this.intro.lastIndexOf(n);
	if (lineIndex !== -1)
		{ return this.intro.substr(lineIndex + 1) + lineStr; }
	return this.intro + lineStr;
};

MagicString.prototype.slice = function slice (start, end) {
		if ( start === void 0 ) start = 0;
		if ( end === void 0 ) end = this.original.length;

	while (start < 0) { start += this.original.length; }
	while (end < 0) { end += this.original.length; }

	var result = '';

	// find start chunk
	var chunk = this.firstChunk;
	while (chunk && (chunk.start > start || chunk.end <= start)) {
		// found end chunk before start
		if (chunk.start < end && chunk.end >= end) {
			return result;
		}

		chunk = chunk.next;
	}

	if (chunk && chunk.edited && chunk.start !== start)
		{ throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }

	var startChunk = chunk;
	while (chunk) {
		if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
			result += chunk.intro;
		}

		var containsEnd = chunk.start < end && chunk.end >= end;
		if (containsEnd && chunk.edited && chunk.end !== end)
			{ throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }

		var sliceStart = startChunk === chunk ? start - chunk.start : 0;
		var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;

		result += chunk.content.slice(sliceStart, sliceEnd);

		if (chunk.outro && (!containsEnd || chunk.end === end)) {
			result += chunk.outro;
		}

		if (containsEnd) {
			break;
		}

		chunk = chunk.next;
	}

	return result;
};

// TODO deprecate this? not really very useful
MagicString.prototype.snip = function snip (start, end) {
	var clone = this.clone();
	clone.remove(0, start);
	clone.remove(end, clone.original.length);

	return clone;
};

MagicString.prototype._split = function _split (index) {
	if (this.byStart[index] || this.byEnd[index]) { return; }

	var chunk = this.lastSearchedChunk;
	var searchForward = index > chunk.end;

	while (chunk) {
		if (chunk.contains(index)) { return this._splitChunk(chunk, index); }

		chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
	}
};

MagicString.prototype._splitChunk = function _splitChunk (chunk, index) {
	if (chunk.edited && chunk.content.length) {
		// zero-length edited chunks are a special case (overlapping replacements)
		var loc = getLocator$1(this.original)(index);
		throw new Error(
			("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
		);
	}

	var newChunk = chunk.split(index);

	this.byEnd[index] = chunk;
	this.byStart[index] = newChunk;
	this.byEnd[newChunk.end] = newChunk;

	if (chunk === this.lastChunk) { this.lastChunk = newChunk; }

	this.lastSearchedChunk = chunk;
	return true;
};

MagicString.prototype.toString = function toString () {
	var str = this.intro;

	var chunk = this.firstChunk;
	while (chunk) {
		str += chunk.toString();
		chunk = chunk.next;
	}

	return str + this.outro;
};

MagicString.prototype.isEmpty = function isEmpty () {
	var chunk = this.firstChunk;
	do {
		if (chunk.intro.length && chunk.intro.trim() ||
				chunk.content.length && chunk.content.trim() ||
				chunk.outro.length && chunk.outro.trim())
			{ return false; }
	} while (chunk = chunk.next);
	return true;
};

MagicString.prototype.length = function length () {
	var chunk = this.firstChunk;
	var length = 0;
	do {
		length += chunk.intro.length + chunk.content.length + chunk.outro.length;
	} while (chunk = chunk.next);
	return length;
};

MagicString.prototype.trimLines = function trimLines () {
	return this.trim('[\\r\\n]');
};

MagicString.prototype.trim = function trim (charType) {
	return this.trimStart(charType).trimEnd(charType);
};

MagicString.prototype.trimEndAborted = function trimEndAborted (charType) {
	var rx = new RegExp((charType || '\\s') + '+$');

	this.outro = this.outro.replace(rx, '');
	if (this.outro.length) { return true; }

	var chunk = this.lastChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimEnd(rx);

		// if chunk was trimmed, we have a new lastChunk
		if (chunk.end !== end) {
			if (this.lastChunk === chunk) {
				this.lastChunk = chunk.next;
			}

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.previous;
	} while (chunk);

	return false;
};

MagicString.prototype.trimEnd = function trimEnd (charType) {
	this.trimEndAborted(charType);
	return this;
};
MagicString.prototype.trimStartAborted = function trimStartAborted (charType) {
	var rx = new RegExp('^' + (charType || '\\s') + '+');

	this.intro = this.intro.replace(rx, '');
	if (this.intro.length) { return true; }

	var chunk = this.firstChunk;

	do {
		var end = chunk.end;
		var aborted = chunk.trimStart(rx);

		if (chunk.end !== end) {
			// special case...
			if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }

			this.byEnd[chunk.end] = chunk;
			this.byStart[chunk.next.start] = chunk.next;
			this.byEnd[chunk.next.end] = chunk.next;
		}

		if (aborted) { return true; }
		chunk = chunk.next;
	} while (chunk);

	return false;
};

MagicString.prototype.trimStart = function trimStart (charType) {
	this.trimStartAborted(charType);
	return this;
};

var hasOwnProp = Object.prototype.hasOwnProperty;

var Bundle$1 = function Bundle(options) {
	if ( options === void 0 ) options = {};

	this.intro = options.intro || '';
	this.separator = options.separator !== undefined ? options.separator : '\n';
	this.sources = [];
	this.uniqueSources = [];
	this.uniqueSourceIndexByFilename = {};
};

Bundle$1.prototype.addSource = function addSource (source) {
	if (source instanceof MagicString) {
		return this.addSource({
			content: source,
			filename: source.filename,
			separator: this.separator
		});
	}

	if (!isObject(source) || !source.content) {
		throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`');
	}

	['filename', 'indentExclusionRanges', 'separator'].forEach(function (option) {
		if (!hasOwnProp.call(source, option)) { source[option] = source.content[option]; }
	});

	if (source.separator === undefined) {
		// TODO there's a bunch of this sort of thing, needs cleaning up
		source.separator = this.separator;
	}

	if (source.filename) {
		if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
			this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
			this.uniqueSources.push({ filename: source.filename, content: source.content.original });
		} else {
			var uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
			if (source.content.original !== uniqueSource.content) {
				throw new Error(("Illegal source: same filename (" + (source.filename) + "), different contents"));
			}
		}
	}

	this.sources.push(source);
	return this;
};

Bundle$1.prototype.append = function append (str, options) {
	this.addSource({
		content: new MagicString(str),
		separator: (options && options.separator) || ''
	});

	return this;
};

Bundle$1.prototype.clone = function clone () {
	var bundle = new Bundle$1({
		intro: this.intro,
		separator: this.separator
	});

	this.sources.forEach(function (source) {
		bundle.addSource({
			filename: source.filename,
			content: source.content.clone(),
			separator: source.separator
		});
	});

	return bundle;
};

Bundle$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
		var this$1 = this;
		if ( options === void 0 ) options = {};

	var names = [];
	this.sources.forEach(function (source) {
		Object.keys(source.content.storedNames).forEach(function (name) {
			if (!~names.indexOf(name)) { names.push(name); }
		});
	});

	var mappings = new Mappings(options.hires);

	if (this.intro) {
		mappings.advance(this.intro);
	}

	this.sources.forEach(function (source, i) {
		if (i > 0) {
			mappings.advance(this$1.separator);
		}

		var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1;
		var magicString = source.content;
		var locate = getLocator$1(magicString.original);

		if (magicString.intro) {
			mappings.advance(magicString.intro);
		}

		magicString.firstChunk.eachNext(function (chunk) {
			var loc = locate(chunk.start);

			if (chunk.intro.length) { mappings.advance(chunk.intro); }

			if (source.filename) {
				if (chunk.edited) {
					mappings.addEdit(
						sourceIndex,
						chunk.content,
						loc,
						chunk.storeName ? names.indexOf(chunk.original) : -1
					);
				} else {
					mappings.addUneditedChunk(
						sourceIndex,
						chunk,
						magicString.original,
						loc,
						magicString.sourcemapLocations
					);
				}
			} else {
				mappings.advance(chunk.content);
			}

			if (chunk.outro.length) { mappings.advance(chunk.outro); }
		});

		if (magicString.outro) {
			mappings.advance(magicString.outro);
		}
	});

	return {
		file: options.file ? options.file.split(/[/\\]/).pop() : null,
		sources: this.uniqueSources.map(function (source) {
			return options.file ? getRelativePath(options.file, source.filename) : source.filename;
		}),
		sourcesContent: this.uniqueSources.map(function (source) {
			return options.includeContent ? source.content : null;
		}),
		names: names,
		mappings: mappings.raw
	};
};

Bundle$1.prototype.generateMap = function generateMap (options) {
	return new SourceMap(this.generateDecodedMap(options));
};

Bundle$1.prototype.getIndentString = function getIndentString () {
	var indentStringCounts = {};

	this.sources.forEach(function (source) {
		var indentStr = source.content.indentStr;

		if (indentStr === null) { return; }

		if (!indentStringCounts[indentStr]) { indentStringCounts[indentStr] = 0; }
		indentStringCounts[indentStr] += 1;
	});

	return (
		Object.keys(indentStringCounts).sort(function (a, b) {
			return indentStringCounts[a] - indentStringCounts[b];
		})[0] || '\t'
	);
};

Bundle$1.prototype.indent = function indent (indentStr) {
		var this$1 = this;

	if (!arguments.length) {
		indentStr = this.getIndentString();
	}

	if (indentStr === '') { return this; } // noop

	var trailingNewline = !this.intro || this.intro.slice(-1) === '\n';

	this.sources.forEach(function (source, i) {
		var separator = source.separator !== undefined ? source.separator : this$1.separator;
		var indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator));

		source.content.indent(indentStr, {
			exclude: source.indentExclusionRanges,
			indentStart: indentStart //: trailingNewline || /\r?\n$/.test( separator )  //true///\r?\n/.test( separator )
		});

		trailingNewline = source.content.lastChar() === '\n';
	});

	if (this.intro) {
		this.intro =
			indentStr +
			this.intro.replace(/^[^\n]/gm, function (match, index) {
				return index > 0 ? indentStr + match : match;
			});
	}

	return this;
};

Bundle$1.prototype.prepend = function prepend (str) {
	this.intro = str + this.intro;
	return this;
};

Bundle$1.prototype.toString = function toString () {
		var this$1 = this;

	var body = this.sources
		.map(function (source, i) {
			var separator = source.separator !== undefined ? source.separator : this$1.separator;
			var str = (i > 0 ? separator : '') + source.content.toString();

			return str;
		})
		.join('');

	return this.intro + body;
};

Bundle$1.prototype.isEmpty = function isEmpty () {
	if (this.intro.length && this.intro.trim())
		{ return false; }
	if (this.sources.some(function (source) { return !source.content.isEmpty(); }))
		{ return false; }
	return true;
};

Bundle$1.prototype.length = function length () {
	return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length);
};

Bundle$1.prototype.trimLines = function trimLines () {
	return this.trim('[\\r\\n]');
};

Bundle$1.prototype.trim = function trim (charType) {
	return this.trimStart(charType).trimEnd(charType);
};

Bundle$1.prototype.trimStart = function trimStart (charType) {
	var rx = new RegExp('^' + (charType || '\\s') + '+');
	this.intro = this.intro.replace(rx, '');

	if (!this.intro) {
		var source;
		var i = 0;

		do {
			source = this.sources[i++];
			if (!source) {
				break;
			}
		} while (!source.content.trimStartAborted(charType));
	}

	return this;
};

Bundle$1.prototype.trimEnd = function trimEnd (charType) {
	var rx = new RegExp((charType || '\\s') + '+$');

	var source;
	var i = this.sources.length - 1;

	do {
		source = this.sources[i--];
		if (!source) {
			this.intro = this.intro.replace(rx, '');
			break;
		}
	} while (!source.content.trimEndAborted(charType));

	return this;
};

function relative(from, to) {
  const fromParts = from.split(/[/\\]/).filter(Boolean);
  const toParts = to.split(/[/\\]/).filter(Boolean);
  if (fromParts[0] === '.')
    fromParts.shift();
  if (toParts[0] === '.')
    toParts.shift();
  while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
    fromParts.shift();
    toParts.shift();
  }
  while (toParts[0] === '..' && fromParts.length > 0) {
    toParts.shift();
    fromParts.pop();
  }
  while (fromParts.pop()) {
    toParts.unshift('..');
  }
  return toParts.join('/');
}

const ArrowFunctionExpression$1 = 'ArrowFunctionExpression';
const BlockStatement$1 = 'BlockStatement';
const CallExpression$1 = 'CallExpression';
const ChainExpression$1 = 'ChainExpression';
const ExpressionStatement$1 = 'ExpressionStatement';
const Identifier$1 = 'Identifier';
const ImportDefaultSpecifier$1 = 'ImportDefaultSpecifier';
const ImportNamespaceSpecifier$1 = 'ImportNamespaceSpecifier';
const NewExpression$1 = 'NewExpression';
const Program$1 = 'Program';
const Property$1 = 'Property';
const ReturnStatement$1 = 'ReturnStatement';

function treeshakeNode(node, code, start, end) {
  code.remove(start, end);
  if (node.annotations) {
    for (const annotation of node.annotations) {
      if (!annotation.comment) {
        continue;
      }
      if (annotation.comment.start < start) {
        code.remove(annotation.comment.start, annotation.comment.end);
      }
      else {
        return;
      }
    }
  }
}
function removeAnnotations(node, code) {
  if (!node.annotations && node.parent.type === ExpressionStatement$1) {
    node = node.parent;
  }
  if (node.annotations) {
    for (const annotation of node.annotations.filter((a) => a.comment)) {
      code.remove(annotation.comment.start, annotation.comment.end);
    }
  }
}

const NO_SEMICOLON = { isNoStatement: true };
// This assumes there are only white-space and comments between start and the string we are looking for
function findFirstOccurrenceOutsideComment(code, searchString, start = 0) {
  let searchPos, charCodeAfterSlash;
  searchPos = code.indexOf(searchString, start);
  while (true) {
    start = code.indexOf('/', start);
    if (start === -1 || start >= searchPos)
      return searchPos;
    charCodeAfterSlash = code.charCodeAt(++start);
    ++start;
    // With our assumption, '/' always starts a comment. Determine comment type:
    start =
      charCodeAfterSlash === 47 /*"/"*/
        ? code.indexOf('\n', start) + 1
        : code.indexOf('*/', start) + 2;
    if (start > searchPos) {
      searchPos = code.indexOf(searchString, start);
    }
  }
}
const NON_WHITESPACE = /\S/g;
function findNonWhiteSpace(code, index) {
  NON_WHITESPACE.lastIndex = index;
  const result = NON_WHITESPACE.exec(code);
  return result.index;
}
// This assumes "code" only contains white-space and comments
// Returns position of line-comment if applicable
function findFirstLineBreakOutsideComment(code) {
  let lineBreakPos, charCodeAfterSlash, start = 0;
  lineBreakPos = code.indexOf('\n', start);
  while (true) {
    start = code.indexOf('/', start);
    if (start === -1 || start > lineBreakPos)
      return [lineBreakPos, lineBreakPos + 1];
    // With our assumption, '/' always starts a comment. Determine comment type:
    charCodeAfterSlash = code.charCodeAt(start + 1);
    if (charCodeAfterSlash === 47 /*"/"*/)
      return [start, lineBreakPos + 1];
    start = code.indexOf('*/', start + 3) + 2;
    if (start > lineBreakPos) {
      lineBreakPos = code.indexOf('\n', start);
    }
  }
}
function renderStatementList(statements, code, start, end, options) {
  let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart;
  let nextNode = statements[0];
  let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries;
  if (nextNodeNeedsBoundaries) {
    nextNodeStart =
      start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1];
  }
  for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) {
    currentNode = nextNode;
    currentNodeStart = nextNodeStart;
    currentNodeNeedsBoundaries = nextNodeNeedsBoundaries;
    nextNode = statements[nextIndex];
    nextNodeNeedsBoundaries =
      nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries;
    if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) {
      nextNodeStart =
        currentNode.end +
          findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
      if (currentNode.included) {
        currentNodeNeedsBoundaries
          ? currentNode.render(code, options, {
            end: nextNodeStart,
            start: currentNodeStart
          })
          : currentNode.render(code, options);
      }
      else {
        treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
      }
    }
    else {
      currentNode.render(code, options);
    }
  }
}
// This assumes that the first character is not part of the first node
function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) {
  const splitUpNodes = [];
  let node, nextNode, nextNodeStart, contentEnd, char;
  let separator = start - 1;
  for (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) {
    nextNode = nodes[nextIndex];
    if (node !== undefined) {
      separator =
        node.end +
          findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ',');
    }
    nextNodeStart = contentEnd =
      separator +
        1 +
        findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1];
    while (((char = code.original.charCodeAt(nextNodeStart)),
      char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/)
      nextNodeStart++;
    if (node !== undefined) {
      splitUpNodes.push({
        contentEnd,
        end: nextNodeStart,
        node,
        separator,
        start
      });
    }
    node = nextNode;
    start = nextNodeStart;
  }
  splitUpNodes.push({
    contentEnd: end,
    end,
    node: node,
    separator: null,
    start
  });
  return splitUpNodes;
}
// This assumes there are only white-space and comments between start and end
function removeLineBreaks(code, start, end) {
  while (true) {
    const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end));
    if (removeStart === -1) {
      break;
    }
    code.remove(start + removeStart, (start += removeEnd));
  }
}

function getSystemExportStatement(exportedVariables, options) {
  const _ = options.compact ? '' : ' ';
  if (exportedVariables.length === 1 &&
    options.exportNamesByVariable.get(exportedVariables[0]).length === 1) {
    const variable = exportedVariables[0];
    return `exports('${options.exportNamesByVariable.get(variable)}',${_}${variable.getName()})`;
  }
  else {
    return `exports({${_}${exportedVariables
      .map(variable => {
      return options.exportNamesByVariable
        .get(variable)
        .map(exportName => `${exportName}:${_}${variable.getName()}`)
        .join(`,${_}`);
    })
      .join(`,${_}`)}${_}})`;
  }
}
function getSystemExportFunctionLeft(exportedVariables, setFromExpression, options) {
  const _ = options.compact ? '' : ' ';
  const s = options.compact ? '' : ';';
  return `function${_}(v)${_}{${_}return exports({${_}${exportedVariables
    .map(variable => {
    return options.exportNamesByVariable
      .get(variable)
      .map(exportName => `${exportName}:${_}${setFromExpression ? variable.getName() : 'v'}`)
      .join(`,${_}`);
  })
    .join(`,${_}`)}${_}}),${_}v${s}${_}}(`;
}

const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
const base$1 = 64;
function toBase64(num) {
  let outStr = '';
  do {
    const curDigit = num % base$1;
    num = Math.floor(num / base$1);
    outStr = chars[curDigit] + outStr;
  } while (num !== 0);
  return outStr;
}

const RESERVED_NAMES = {
  // @ts-ignore
  __proto__: null,
  await: true,
  break: true,
  case: true,
  catch: true,
  class: true,
  const: true,
  continue: true,
  debugger: true,
  default: true,
  delete: true,
  do: true,
  else: true,
  enum: true,
  eval: true,
  export: true,
  extends: true,
  false: true,
  finally: true,
  for: true,
  function: true,
  if: true,
  implements: true,
  import: true,
  in: true,
  instanceof: true,
  interface: true,
  let: true,
  new: true,
  null: true,
  package: true,
  private: true,
  protected: true,
  public: true,
  return: true,
  static: true,
  super: true,
  switch: true,
  this: true,
  throw: true,
  true: true,
  try: true,
  typeof: true,
  undefined: true,
  var: true,
  void: true,
  while: true,
  with: true,
  yield: true
};

function getSafeName(baseName, usedNames) {
  let safeName = baseName;
  let count = 1;
  while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) {
    safeName = `${baseName}$${toBase64(count++)}`;
  }
  usedNames.add(safeName);
  return safeName;
}

const NO_ARGS = [];

function getOrCreate(map, key, init) {
  const existing = map.get(key);
  if (existing) {
    return existing;
  }
  const value = init();
  map.set(key, value);
  return value;
}

const UnknownKey = Symbol('Unknown Key');
const EMPTY_PATH = [];
const UNKNOWN_PATH = [UnknownKey];
const EntitiesKey = Symbol('Entities');
class PathTracker {
  constructor() {
    this.entityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } });
  }
  getEntities(path) {
    let currentPaths = this.entityPaths;
    for (const pathSegment of path) {
      currentPaths = currentPaths[pathSegment] =
        currentPaths[pathSegment] ||
          Object.create(null, { [EntitiesKey]: { value: new Set() } });
    }
    return currentPaths[EntitiesKey];
  }
}
const SHARED_RECURSION_TRACKER = new PathTracker();
class DiscriminatedPathTracker {
  constructor() {
    this.entityPaths = Object.create(null, {
      [EntitiesKey]: { value: new Map() }
    });
  }
  getEntities(path, discriminator) {
    let currentPaths = this.entityPaths;
    for (const pathSegment of path) {
      currentPaths = currentPaths[pathSegment] =
        currentPaths[pathSegment] ||
          Object.create(null, { [EntitiesKey]: { value: new Map() } });
    }
    return getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set());
  }
}

function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
  return Object.create(inheritedDescriptions, memberDescriptions);
}
const UnknownValue = Symbol('Unknown Value');
const UNKNOWN_EXPRESSION = {
  deoptimizePath: () => { },
  getLiteralValueAtPath: () => UnknownValue,
  getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
  hasEffectsWhenAccessedAtPath: path => path.length > 0,
  hasEffectsWhenAssignedAtPath: path => path.length > 0,
  hasEffectsWhenCalledAtPath: () => true,
  include: () => { },
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  },
  included: true,
  toString: () => '[[UNKNOWN]]'
};
const UNDEFINED_EXPRESSION = {
  deoptimizePath: () => { },
  getLiteralValueAtPath: () => undefined,
  getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
  hasEffectsWhenAccessedAtPath: path => path.length > 0,
  hasEffectsWhenAssignedAtPath: path => path.length > 0,
  hasEffectsWhenCalledAtPath: () => true,
  include: () => { },
  includeCallArguments() { },
  included: true,
  toString: () => 'undefined'
};
const returnsUnknown = {
  value: {
    callsArgs: null,
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_EXPRESSION
  }
};
const mutatesSelfReturnsUnknown = {
  value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: null, mutatesSelf: true }
};
const callsArgReturnsUnknown = {
  value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: [0], mutatesSelf: false }
};
class UnknownArrayExpression {
  constructor() {
    this.included = false;
  }
  deoptimizePath() { }
  getLiteralValueAtPath() {
    return UnknownValue;
  }
  getReturnExpressionWhenCalledAtPath(path) {
    if (path.length === 1) {
      return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
    }
    return UNKNOWN_EXPRESSION;
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenAssignedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length === 1) {
      return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
    }
    return true;
  }
  include() {
    this.included = true;
  }
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  }
  toString() {
    return '[[UNKNOWN ARRAY]]';
  }
}
const returnsArray = {
  value: {
    callsArgs: null,
    mutatesSelf: false,
    returns: UnknownArrayExpression,
    returnsPrimitive: null
  }
};
const mutatesSelfReturnsArray = {
  value: {
    callsArgs: null,
    mutatesSelf: true,
    returns: UnknownArrayExpression,
    returnsPrimitive: null
  }
};
const callsArgReturnsArray = {
  value: {
    callsArgs: [0],
    mutatesSelf: false,
    returns: UnknownArrayExpression,
    returnsPrimitive: null
  }
};
const callsArgMutatesSelfReturnsArray = {
  value: {
    callsArgs: [0],
    mutatesSelf: true,
    returns: UnknownArrayExpression,
    returnsPrimitive: null
  }
};
const UNKNOWN_LITERAL_BOOLEAN = {
  deoptimizePath: () => { },
  getLiteralValueAtPath: () => UnknownValue,
  getReturnExpressionWhenCalledAtPath: path => {
    if (path.length === 1) {
      return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]);
    }
    return UNKNOWN_EXPRESSION;
  },
  hasEffectsWhenAccessedAtPath: path => path.length > 1,
  hasEffectsWhenAssignedAtPath: path => path.length > 0,
  hasEffectsWhenCalledAtPath: path => {
    if (path.length === 1) {
      const subPath = path[0];
      return typeof subPath !== 'string' || !literalBooleanMembers[subPath];
    }
    return true;
  },
  include: () => { },
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  },
  included: true,
  toString: () => '[[UNKNOWN BOOLEAN]]'
};
const returnsBoolean = {
  value: {
    callsArgs: null,
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
  }
};
const callsArgReturnsBoolean = {
  value: {
    callsArgs: [0],
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
  }
};
const UNKNOWN_LITERAL_NUMBER = {
  deoptimizePath: () => { },
  getLiteralValueAtPath: () => UnknownValue,
  getReturnExpressionWhenCalledAtPath: path => {
    if (path.length === 1) {
      return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]);
    }
    return UNKNOWN_EXPRESSION;
  },
  hasEffectsWhenAccessedAtPath: path => path.length > 1,
  hasEffectsWhenAssignedAtPath: path => path.length > 0,
  hasEffectsWhenCalledAtPath: path => {
    if (path.length === 1) {
      const subPath = path[0];
      return typeof subPath !== 'string' || !literalNumberMembers[subPath];
    }
    return true;
  },
  include: () => { },
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  },
  included: true,
  toString: () => '[[UNKNOWN NUMBER]]'
};
const returnsNumber = {
  value: {
    callsArgs: null,
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  }
};
const mutatesSelfReturnsNumber = {
  value: {
    callsArgs: null,
    mutatesSelf: true,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  }
};
const callsArgReturnsNumber = {
  value: {
    callsArgs: [0],
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  }
};
const UNKNOWN_LITERAL_STRING = {
  deoptimizePath: () => { },
  getLiteralValueAtPath: () => UnknownValue,
  getReturnExpressionWhenCalledAtPath: path => {
    if (path.length === 1) {
      return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);
    }
    return UNKNOWN_EXPRESSION;
  },
  hasEffectsWhenAccessedAtPath: path => path.length > 1,
  hasEffectsWhenAssignedAtPath: path => path.length > 0,
  hasEffectsWhenCalledAtPath: (path, callOptions, context) => {
    if (path.length === 1) {
      return hasMemberEffectWhenCalled(literalStringMembers, path[0], true, callOptions, context);
    }
    return true;
  },
  include: () => { },
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  },
  included: true,
  toString: () => '[[UNKNOWN STRING]]'
};
const returnsString = {
  value: {
    callsArgs: null,
    mutatesSelf: false,
    returns: null,
    returnsPrimitive: UNKNOWN_LITERAL_STRING
  }
};
class UnknownObjectExpression {
  constructor() {
    this.included = false;
  }
  deoptimizePath() { }
  getLiteralValueAtPath() {
    return UnknownValue;
  }
  getReturnExpressionWhenCalledAtPath(path) {
    if (path.length === 1) {
      return getMemberReturnExpressionWhenCalled(objectMembers, path[0]);
    }
    return UNKNOWN_EXPRESSION;
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenAssignedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length === 1) {
      return hasMemberEffectWhenCalled(objectMembers, path[0], this.included, callOptions, context);
    }
    return true;
  }
  include() {
    this.included = true;
  }
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  }
  toString() {
    return '[[UNKNOWN OBJECT]]';
  }
}
const objectMembers = assembleMemberDescriptions({
  hasOwnProperty: returnsBoolean,
  isPrototypeOf: returnsBoolean,
  propertyIsEnumerable: returnsBoolean,
  toLocaleString: returnsString,
  toString: returnsString,
  valueOf: returnsUnknown
});
const arrayMembers = assembleMemberDescriptions({
  concat: returnsArray,
  copyWithin: mutatesSelfReturnsArray,
  every: callsArgReturnsBoolean,
  fill: mutatesSelfReturnsArray,
  filter: callsArgReturnsArray,
  find: callsArgReturnsUnknown,
  findIndex: callsArgReturnsNumber,
  forEach: callsArgReturnsUnknown,
  includes: returnsBoolean,
  indexOf: returnsNumber,
  join: returnsString,
  lastIndexOf: returnsNumber,
  map: callsArgReturnsArray,
  pop: mutatesSelfReturnsUnknown,
  push: mutatesSelfReturnsNumber,
  reduce: callsArgReturnsUnknown,
  reduceRight: callsArgReturnsUnknown,
  reverse: mutatesSelfReturnsArray,
  shift: mutatesSelfReturnsUnknown,
  slice: returnsArray,
  some: callsArgReturnsBoolean,
  sort: callsArgMutatesSelfReturnsArray,
  splice: mutatesSelfReturnsArray,
  unshift: mutatesSelfReturnsNumber
}, objectMembers);
const literalBooleanMembers = assembleMemberDescriptions({
  valueOf: returnsBoolean
}, objectMembers);
const literalNumberMembers = assembleMemberDescriptions({
  toExponential: returnsString,
  toFixed: returnsString,
  toLocaleString: returnsString,
  toPrecision: returnsString,
  valueOf: returnsNumber
}, objectMembers);
const literalStringMembers = assembleMemberDescriptions({
  charAt: returnsString,
  charCodeAt: returnsNumber,
  codePointAt: returnsNumber,
  concat: returnsString,
  endsWith: returnsBoolean,
  includes: returnsBoolean,
  indexOf: returnsNumber,
  lastIndexOf: returnsNumber,
  localeCompare: returnsNumber,
  match: returnsBoolean,
  normalize: returnsString,
  padEnd: returnsString,
  padStart: returnsString,
  repeat: returnsString,
  replace: {
    value: {
      callsArgs: [1],
      mutatesSelf: false,
      returns: null,
      returnsPrimitive: UNKNOWN_LITERAL_STRING
    }
  },
  search: returnsNumber,
  slice: returnsString,
  split: returnsArray,
  startsWith: returnsBoolean,
  substr: returnsString,
  substring: returnsString,
  toLocaleLowerCase: returnsString,
  toLocaleUpperCase: returnsString,
  toLowerCase: returnsString,
  toUpperCase: returnsString,
  trim: returnsString,
  valueOf: returnsString
}, objectMembers);
function getLiteralMembersForValue(value) {
  switch (typeof value) {
    case 'boolean':
      return literalBooleanMembers;
    case 'number':
      return literalNumberMembers;
    case 'string':
      return literalStringMembers;
    default:
      return Object.create(null);
  }
}
function hasMemberEffectWhenCalled(members, memberName, parentIncluded, callOptions, context) {
  if (typeof memberName !== 'string' ||
    !members[memberName] ||
    (members[memberName].mutatesSelf && parentIncluded))
    return true;
  if (!members[memberName].callsArgs)
    return false;
  for (const argIndex of members[memberName].callsArgs) {
    if (callOptions.args[argIndex] &&
      callOptions.args[argIndex].hasEffectsWhenCalledAtPath(EMPTY_PATH, {
        args: NO_ARGS,
        withNew: false
      }, context))
      return true;
  }
  return false;
}
function getMemberReturnExpressionWhenCalled(members, memberName) {
  if (typeof memberName !== 'string' || !members[memberName])
    return UNKNOWN_EXPRESSION;
  return members[memberName].returnsPrimitive !== null
    ? members[memberName].returnsPrimitive
    : new members[memberName].returns();
}

const BROKEN_FLOW_NONE = 0;
const BROKEN_FLOW_BREAK_CONTINUE = 1;
const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;
function createInclusionContext() {
  return {
    brokenFlow: BROKEN_FLOW_NONE,
    includedCallArguments: new Set(),
    includedLabels: new Set()
  };
}
function createHasEffectsContext() {
  return {
    accessed: new PathTracker(),
    assigned: new PathTracker(),
    brokenFlow: BROKEN_FLOW_NONE,
    called: new DiscriminatedPathTracker(),
    ignore: {
      breaks: false,
      continues: false,
      labels: new Set(),
      returnAwaitYield: false
    },
    includedLabels: new Set(),
    instantiated: new DiscriminatedPathTracker(),
    replacedVariableInits: new Map()
  };
}

class Variable {
  constructor(name) {
    this.alwaysRendered = false;
    this.included = false;
    this.isId = false;
    this.isReassigned = false;
    this.renderBaseName = null;
    this.renderName = null;
    this.name = name;
  }
  /**
   * Binds identifiers that reference this variable to this variable.
   * Necessary to be able to change variable names.
   */
  addReference(_identifier) { }
  deoptimizePath(_path) { }
  getBaseVariableName() {
    return this.renderBaseName || this.renderName || this.name;
  }
  getLiteralValueAtPath(_path, _recursionTracker, _origin) {
    return UnknownValue;
  }
  getName() {
    const name = this.renderName || this.name;
    return this.renderBaseName
      ? `${this.renderBaseName}${RESERVED_NAMES[name] ? `['${name}']` : `.${name}`}`
      : name;
  }
  getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
    return UNKNOWN_EXPRESSION;
  }
  hasEffectsWhenAccessedAtPath(path, _context) {
    return path.length > 0;
  }
  hasEffectsWhenAssignedAtPath(_path, _context) {
    return true;
  }
  hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
    return true;
  }
  /**
   * Marks this variable as being part of the bundle, which is usually the case when one of
   * its identifiers becomes part of the bundle. Returns true if it has not been included
   * previously.
   * Once a variable is included, it should take care all its declarations are included.
   */
  include() {
    this.included = true;
  }
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  }
  markCalledFromTryStatement() { }
  setRenderNames(baseName, name) {
    this.renderBaseName = baseName;
    this.renderName = name;
  }
}

// To avoid infinite recursions
const MAX_PATH_DEPTH = 7;
class LocalVariable extends Variable {
  constructor(name, declarator, init, context) {
    super(name);
    this.additionalInitializers = null;
    this.calledFromTryStatement = false;
    this.expressionsToBeDeoptimized = [];
    this.declarations = declarator ? [declarator] : [];
    this.init = init;
    this.deoptimizationTracker = context.deoptimizationTracker;
    this.module = context.module;
  }
  addDeclaration(identifier, init) {
    this.declarations.push(identifier);
    if (this.additionalInitializers === null) {
      this.additionalInitializers = this.init === null ? [] : [this.init];
      this.init = UNKNOWN_EXPRESSION;
      this.isReassigned = true;
    }
    if (init !== null) {
      this.additionalInitializers.push(init);
    }
  }
  consolidateInitializers() {
    if (this.additionalInitializers !== null) {
      for (const initializer of this.additionalInitializers) {
        initializer.deoptimizePath(UNKNOWN_PATH);
      }
      this.additionalInitializers = null;
    }
  }
  deoptimizePath(path) {
    if (path.length > MAX_PATH_DEPTH || this.isReassigned)
      return;
    const trackedEntities = this.deoptimizationTracker.getEntities(path);
    if (trackedEntities.has(this))
      return;
    trackedEntities.add(this);
    if (path.length === 0) {
      if (!this.isReassigned) {
        this.isReassigned = true;
        const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
        this.expressionsToBeDeoptimized = [];
        for (const expression of expressionsToBeDeoptimized) {
          expression.deoptimizeCache();
        }
        if (this.init) {
          this.init.deoptimizePath(UNKNOWN_PATH);
        }
      }
    }
    else if (this.init) {
      this.init.deoptimizePath(path);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
      return UnknownValue;
    }
    const trackedEntities = recursionTracker.getEntities(path);
    if (trackedEntities.has(this.init)) {
      return UnknownValue;
    }
    this.expressionsToBeDeoptimized.push(origin);
    trackedEntities.add(this.init);
    const value = this.init.getLiteralValueAtPath(path, recursionTracker, origin);
    trackedEntities.delete(this.init);
    return value;
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
      return UNKNOWN_EXPRESSION;
    }
    const trackedEntities = recursionTracker.getEntities(path);
    if (trackedEntities.has(this.init)) {
      return UNKNOWN_EXPRESSION;
    }
    this.expressionsToBeDeoptimized.push(origin);
    trackedEntities.add(this.init);
    const value = this.init.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
    trackedEntities.delete(this.init);
    return value;
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    if (this.isReassigned || path.length > MAX_PATH_DEPTH)
      return true;
    const trackedExpressions = context.accessed.getEntities(path);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return (this.init && this.init.hasEffectsWhenAccessedAtPath(path, context));
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (this.included || path.length > MAX_PATH_DEPTH)
      return true;
    if (path.length === 0)
      return false;
    if (this.isReassigned)
      return true;
    const trackedExpressions = context.assigned.getEntities(path);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return (this.init && this.init.hasEffectsWhenAssignedAtPath(path, context));
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length > MAX_PATH_DEPTH || this.isReassigned)
      return true;
    const trackedExpressions = (callOptions.withNew
      ? context.instantiated
      : context.called).getEntities(path, callOptions);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return (this.init && this.init.hasEffectsWhenCalledAtPath(path, callOptions, context));
  }
  include() {
    if (!this.included) {
      this.included = true;
      for (const declaration of this.declarations) {
        // If node is a default export, it can save a tree-shaking run to include the full declaration now
        if (!declaration.included)
          declaration.include(createInclusionContext(), false);
        let node = declaration.parent;
        while (!node.included) {
          // We do not want to properly include parents in case they are part of a dead branch
          // in which case .include() might pull in more dead code
          node.included = true;
          if (node.type === Program$1)
            break;
          node = node.parent;
        }
      }
    }
  }
  includeCallArguments(context, args) {
    if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {
      for (const arg of args) {
        arg.include(context, false);
      }
    }
    else if (this.init) {
      context.includedCallArguments.add(this.init);
      this.init.includeCallArguments(context, args);
      context.includedCallArguments.delete(this.init);
    }
  }
  markCalledFromTryStatement() {
    this.calledFromTryStatement = true;
  }
}

class Scope$1 {
  constructor() {
    this.children = [];
    this.variables = new Map();
  }
  addDeclaration(identifier, context, init, _isHoisted) {
    const name = identifier.name;
    let variable = this.variables.get(name);
    if (variable) {
      variable.addDeclaration(identifier, init);
    }
    else {
      variable = new LocalVariable(identifier.name, identifier, init || UNDEFINED_EXPRESSION, context);
      this.variables.set(name, variable);
    }
    return variable;
  }
  contains(name) {
    return this.variables.has(name);
  }
  findVariable(_name) {
    throw new Error('Internal Error: findVariable needs to be implemented by a subclass');
  }
}

class ChildScope extends Scope$1 {
  constructor(parent) {
    super();
    this.accessedOutsideVariables = new Map();
    this.parent = parent;
    parent.children.push(this);
  }
  addAccessedDynamicImport(importExpression) {
    (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression);
    if (this.parent instanceof ChildScope) {
      this.parent.addAccessedDynamicImport(importExpression);
    }
  }
  addAccessedGlobals(globals, accessedGlobalsByScope) {
    const accessedGlobals = accessedGlobalsByScope.get(this) || new Set();
    for (const name of globals) {
      accessedGlobals.add(name);
    }
    accessedGlobalsByScope.set(this, accessedGlobals);
    if (this.parent instanceof ChildScope) {
      this.parent.addAccessedGlobals(globals, accessedGlobalsByScope);
    }
  }
  addNamespaceMemberAccess(name, variable) {
    this.accessedOutsideVariables.set(name, variable);
    this.parent.addNamespaceMemberAccess(name, variable);
  }
  addReturnExpression(expression) {
    this.parent instanceof ChildScope && this.parent.addReturnExpression(expression);
  }
  addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
    for (const variable of this.accessedOutsideVariables.values()) {
      if (variable.included) {
        usedNames.add(variable.getBaseVariableName());
        if (format === 'system' && exportNamesByVariable.has(variable)) {
          usedNames.add('exports');
        }
      }
    }
    const accessedGlobals = accessedGlobalsByScope.get(this);
    if (accessedGlobals) {
      for (const name of accessedGlobals) {
        usedNames.add(name);
      }
    }
  }
  contains(name) {
    return this.variables.has(name) || this.parent.contains(name);
  }
  deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
    const usedNames = new Set();
    this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
    if (this.accessedDynamicImports) {
      for (const importExpression of this.accessedDynamicImports) {
        if (importExpression.inlineNamespace) {
          usedNames.add(importExpression.inlineNamespace.getBaseVariableName());
        }
      }
    }
    for (const [name, variable] of this.variables) {
      if (variable.included || variable.alwaysRendered) {
        variable.setRenderNames(null, getSafeName(name, usedNames));
      }
    }
    for (const scope of this.children) {
      scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
    }
  }
  findLexicalBoundary() {
    return this.parent.findLexicalBoundary();
  }
  findVariable(name) {
    const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
    if (knownVariable) {
      return knownVariable;
    }
    const variable = this.parent.findVariable(name);
    this.accessedOutsideVariables.set(name, variable);
    return variable;
  }
}

function getLocator(source, options) {
  if (options === void 0) { options = {}; }
  var offsetLine = options.offsetLine || 0;
  var offsetColumn = options.offsetColumn || 0;
  var originalLines = source.split('\n');
  var start = 0;
  var lineRanges = originalLines.map(function (line, i) {
    var end = start + line.length + 1;
    var range = { start: start, end: end, line: i };
    start = end;
    return range;
  });
  var i = 0;
  function rangeContains(range, index) {
    return range.start <= index && index < range.end;
  }
  function getLocation(range, index) {
    return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };
  }
  function locate(search, startIndex) {
    if (typeof search === 'string') {
      search = source.indexOf(search, startIndex || 0);
    }
    var range = lineRanges[i];
    var d = search >= range.end ? 1 : -1;
    while (range) {
      if (rangeContains(range, search))
        return getLocation(range, search);
      i += d;
      range = lineRanges[i];
    }
  }
  return locate;
}
function locate(source, search, options) {
  if (typeof options === 'number') {
    throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');
  }
  return getLocator(source, options)(search, options && options.startIndex);
}

const keys = {
  Literal: [],
  Program: ['body']
};
function getAndCreateKeys(esTreeNode) {
  keys[esTreeNode.type] = Object.keys(esTreeNode).filter(key => key !== '_rollupAnnotations' && typeof esTreeNode[key] === 'object');
  return keys[esTreeNode.type];
}

const INCLUDE_PARAMETERS = 'variables';
class NodeBase {
  constructor(esTreeNode, parent, parentScope) {
    this.included = false;
    this.esTreeNode = esTreeNode;
    this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);
    this.parent = parent;
    this.context = parent.context;
    this.createScope(parentScope);
    this.parseNode(esTreeNode);
    this.initialise();
    this.context.magicString.addSourcemapLocation(this.start);
    this.context.magicString.addSourcemapLocation(this.end);
  }
  addExportedVariables(_variables, _exportNamesByVariable) { }
  /**
   * Override this to bind assignments to variables and do any initialisations that
   * require the scopes to be populated with variables.
   */
  bind() {
    for (const key of this.keys) {
      const value = this[key];
      if (value === null)
        continue;
      if (Array.isArray(value)) {
        for (const child of value) {
          if (child !== null)
            child.bind();
        }
      }
      else {
        value.bind();
      }
    }
  }
  /**
   * Override if this node should receive a different scope than the parent scope.
   */
  createScope(parentScope) {
    this.scope = parentScope;
  }
  deoptimizePath(_path) { }
  getLiteralValueAtPath(_path, _recursionTracker, _origin) {
    return UnknownValue;
  }
  getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
    return UNKNOWN_EXPRESSION;
  }
  hasEffects(context) {
    for (const key of this.keys) {
      const value = this[key];
      if (value === null)
        continue;
      if (Array.isArray(value)) {
        for (const child of value) {
          if (child !== null && child.hasEffects(context))
            return true;
        }
      }
      else if (value.hasEffects(context))
        return true;
    }
    return false;
  }
  hasEffectsWhenAccessedAtPath(path, _context) {
    return path.length > 0;
  }
  hasEffectsWhenAssignedAtPath(_path, _context) {
    return true;
  }
  hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
    return true;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    for (const key of this.keys) {
      const value = this[key];
      if (value === null)
        continue;
      if (Array.isArray(value)) {
        for (const child of value) {
          if (child !== null)
            child.include(context, includeChildrenRecursively);
        }
      }
      else {
        value.include(context, includeChildrenRecursively);
      }
    }
  }
  includeAsSingleStatement(context, includeChildrenRecursively) {
    this.include(context, includeChildrenRecursively);
  }
  includeCallArguments(context, args) {
    for (const arg of args) {
      arg.include(context, false);
    }
  }
  /**
   * Override to perform special initialisation steps after the scope is initialised
   */
  initialise() { }
  insertSemicolon(code) {
    if (code.original[this.end - 1] !== ';') {
      code.appendLeft(this.end, ';');
    }
  }
  parseNode(esTreeNode) {
    for (const key of Object.keys(esTreeNode)) {
      // That way, we can override this function to add custom initialisation and then call super.parseNode
      if (this.hasOwnProperty(key))
        continue;
      const value = esTreeNode[key];
      if (key === '_rollupAnnotations') {
        this.annotations = value;
      }
      else if (typeof value !== 'object' || value === null) {
        this[key] = value;
      }
      else if (Array.isArray(value)) {
        this[key] = [];
        for (const child of value) {
          this[key].push(child === null
            ? null
            : new (this.context.nodeConstructors[child.type] ||
              this.context.nodeConstructors.UnknownNode)(child, this, this.scope));
        }
      }
      else {
        this[key] = new (this.context.nodeConstructors[value.type] ||
          this.context.nodeConstructors.UnknownNode)(value, this, this.scope);
      }
    }
  }
  render(code, options) {
    for (const key of this.keys) {
      const value = this[key];
      if (value === null)
        continue;
      if (Array.isArray(value)) {
        for (const child of value) {
          if (child !== null)
            child.render(code, options);
        }
      }
      else {
        value.render(code, options);
      }
    }
  }
  shouldBeIncluded(context) {
    return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext()));
  }
}

class ClassNode extends NodeBase {
  createScope(parentScope) {
    this.scope = new ChildScope(parentScope);
  }
  hasEffectsWhenAccessedAtPath(path) {
    if (path.length <= 1)
      return false;
    return path.length > 2 || path[0] !== 'prototype';
  }
  hasEffectsWhenAssignedAtPath(path) {
    if (path.length <= 1)
      return false;
    return path.length > 2 || path[0] !== 'prototype';
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (!callOptions.withNew)
      return true;
    return (this.body.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
      (this.superClass !== null &&
        this.superClass.hasEffectsWhenCalledAtPath(path, callOptions, context)));
  }
  initialise() {
    if (this.id !== null) {
      this.id.declare('class', this);
    }
  }
}

class ClassDeclaration extends ClassNode {
  initialise() {
    super.initialise();
    if (this.id !== null) {
      this.id.variable.isId = true;
    }
  }
  parseNode(esTreeNode) {
    if (esTreeNode.id !== null) {
      this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope.parent);
    }
    super.parseNode(esTreeNode);
  }
  render(code, options) {
    if (options.format === 'system' &&
      this.id &&
      options.exportNamesByVariable.has(this.id.variable)) {
      code.appendLeft(this.end, `${options.compact ? '' : ' '}${getSystemExportStatement([this.id.variable], options)};`);
    }
    super.render(code, options);
  }
}

class ArgumentsVariable extends LocalVariable {
  constructor(context) {
    super('arguments', null, UNKNOWN_EXPRESSION, context);
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenAssignedAtPath() {
    return true;
  }
  hasEffectsWhenCalledAtPath() {
    return true;
  }
}

class ThisVariable extends LocalVariable {
  constructor(context) {
    super('this', null, null, context);
  }
  getLiteralValueAtPath() {
    return UnknownValue;
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    return (this.getInit(context).hasEffectsWhenAccessedAtPath(path, context) ||
      super.hasEffectsWhenAccessedAtPath(path, context));
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return (this.getInit(context).hasEffectsWhenAssignedAtPath(path, context) ||
      super.hasEffectsWhenAssignedAtPath(path, context));
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    return (this.getInit(context).hasEffectsWhenCalledAtPath(path, callOptions, context) ||
      super.hasEffectsWhenCalledAtPath(path, callOptions, context));
  }
  getInit(context) {
    return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;
  }
}

class SpreadElement extends NodeBase {
  bind() {
    super.bind();
    // Only properties of properties of the argument could become subject to reassignment
    // This will also reassign the return values of iterators
    this.argument.deoptimizePath([UnknownKey, UnknownKey]);
  }
}

class ParameterScope extends ChildScope {
  constructor(parent, context) {
    super(parent);
    this.parameters = [];
    this.hasRest = false;
    this.context = context;
    this.hoistedBodyVarScope = new ChildScope(this);
  }
  /**
   * Adds a parameter to this scope. Parameters must be added in the correct
   * order, e.g. from left to right.
   */
  addParameterDeclaration(identifier) {
    const name = identifier.name;
    let variable = this.hoistedBodyVarScope.variables.get(name);
    if (variable) {
      variable.addDeclaration(identifier, null);
    }
    else {
      variable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context);
    }
    this.variables.set(name, variable);
    return variable;
  }
  addParameterVariables(parameters, hasRest) {
    this.parameters = parameters;
    for (const parameterList of parameters) {
      for (const parameter of parameterList) {
        parameter.alwaysRendered = true;
      }
    }
    this.hasRest = hasRest;
  }
  includeCallArguments(context, args) {
    let calledFromTryStatement = false;
    let argIncluded = false;
    const restParam = this.hasRest && this.parameters[this.parameters.length - 1];
    for (const checkedArg of args) {
      if (checkedArg instanceof SpreadElement) {
        for (const arg of args) {
          arg.include(context, false);
        }
        break;
      }
    }
    for (let index = args.length - 1; index >= 0; index--) {
      const paramVars = this.parameters[index] || restParam;
      const arg = args[index];
      if (paramVars) {
        calledFromTryStatement = false;
        if (paramVars.length === 0) {
          // handle empty destructuring
          argIncluded = true;
        }
        else {
          for (const variable of paramVars) {
            if (variable.included) {
              argIncluded = true;
            }
            if (variable.calledFromTryStatement) {
              calledFromTryStatement = true;
            }
          }
        }
      }
      if (!argIncluded && arg.shouldBeIncluded(context)) {
        argIncluded = true;
      }
      if (argIncluded) {
        arg.include(context, calledFromTryStatement);
      }
    }
  }
}

class ReturnValueScope extends ParameterScope {
  constructor() {
    super(...arguments);
    this.returnExpression = null;
    this.returnExpressions = [];
  }
  addReturnExpression(expression) {
    this.returnExpressions.push(expression);
  }
  getReturnExpression() {
    if (this.returnExpression === null)
      this.updateReturnExpression();
    return this.returnExpression;
  }
  updateReturnExpression() {
    if (this.returnExpressions.length === 1) {
      this.returnExpression = this.returnExpressions[0];
    }
    else {
      this.returnExpression = UNKNOWN_EXPRESSION;
      for (const expression of this.returnExpressions) {
        expression.deoptimizePath(UNKNOWN_PATH);
      }
    }
  }
}

class FunctionScope extends ReturnValueScope {
  constructor(parent, context) {
    super(parent, context);
    this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));
    this.variables.set('this', (this.thisVariable = new ThisVariable(context)));
  }
  findLexicalBoundary() {
    return this;
  }
  includeCallArguments(context, args) {
    super.includeCallArguments(context, args);
    if (this.argumentsVariable.included) {
      for (const arg of args) {
        if (!arg.included) {
          arg.include(context, false);
        }
      }
    }
  }
}

//@ts-check
/** @typedef { import('estree').Node} Node */
/** @typedef {Node | {
 *   type: 'PropertyDefinition';
 *   computed: boolean;
 *   value: Node
 * }} NodeWithPropertyDefinition */

/**
 *
 * @param {NodeWithPropertyDefinition} node
 * @param {NodeWithPropertyDefinition} parent
 * @returns boolean
 */
function is_reference (node, parent) {
	if (node.type === 'MemberExpression') {
		return !node.computed && is_reference(node.object, node);
	}

	if (node.type === 'Identifier') {
		if (!parent) return true;

		switch (parent.type) {
			// disregard `bar` in `foo.bar`
			case 'MemberExpression': return parent.computed || node === parent.object;

			// disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
			case 'MethodDefinition': return parent.computed;

			// disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
			case 'PropertyDefinition': return parent.computed || node === parent.value;

			// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
			case 'Property': return parent.computed || node === parent.value;

			// disregard the `bar` in `export { foo as bar }` or
			// the foo in `import { foo as bar }`
			case 'ExportSpecifier':
			case 'ImportSpecifier': return node === parent.local;

			// disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
			case 'LabeledStatement':
			case 'BreakStatement':
			case 'ContinueStatement': return false;
			default: return true;
		}
	}

	return false;
}

const BLANK = Object.freeze(Object.create(null));
const EMPTY_OBJECT = Object.freeze({});
const EMPTY_ARRAY = Object.freeze([]);

const ValueProperties = Symbol('Value Properties');
const PURE = { pure: true };
const IMPURE = { pure: false };
// We use shortened variables to reduce file size here
/* OBJECT */
const O = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: IMPURE
};
/* PURE FUNCTION */
const PF = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: PURE
};
/* CONSTRUCTOR */
const C = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: IMPURE,
  prototype: O
};
/* PURE CONSTRUCTOR */
const PC = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: PURE,
  prototype: O
};
const ARRAY_TYPE = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: PURE,
  from: PF,
  of: PF,
  prototype: O
};
const INTL_MEMBER = {
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: PURE,
  supportedLocalesOf: PC
};
const knownGlobals = {
  // Placeholders for global objects to avoid shape mutations
  global: O,
  globalThis: O,
  self: O,
  window: O,
  // Common globals
  // @ts-ignore
  __proto__: null,
  [ValueProperties]: IMPURE,
  Array: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: IMPURE,
    from: O,
    isArray: PF,
    of: PF,
    prototype: O
  },
  ArrayBuffer: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    isView: PF,
    prototype: O
  },
  Atomics: O,
  BigInt: C,
  BigInt64Array: C,
  BigUint64Array: C,
  Boolean: PC,
  // @ts-ignore
  constructor: C,
  DataView: PC,
  Date: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    now: PF,
    parse: PF,
    prototype: O,
    UTC: PF
  },
  decodeURI: PF,
  decodeURIComponent: PF,
  encodeURI: PF,
  encodeURIComponent: PF,
  Error: PC,
  escape: PF,
  eval: O,
  EvalError: PC,
  Float32Array: ARRAY_TYPE,
  Float64Array: ARRAY_TYPE,
  Function: C,
  // @ts-ignore
  hasOwnProperty: O,
  Infinity: O,
  Int16Array: ARRAY_TYPE,
  Int32Array: ARRAY_TYPE,
  Int8Array: ARRAY_TYPE,
  isFinite: PF,
  isNaN: PF,
  // @ts-ignore
  isPrototypeOf: O,
  JSON: O,
  Map: PC,
  Math: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: IMPURE,
    abs: PF,
    acos: PF,
    acosh: PF,
    asin: PF,
    asinh: PF,
    atan: PF,
    atan2: PF,
    atanh: PF,
    cbrt: PF,
    ceil: PF,
    clz32: PF,
    cos: PF,
    cosh: PF,
    exp: PF,
    expm1: PF,
    floor: PF,
    fround: PF,
    hypot: PF,
    imul: PF,
    log: PF,
    log10: PF,
    log1p: PF,
    log2: PF,
    max: PF,
    min: PF,
    pow: PF,
    random: PF,
    round: PF,
    sign: PF,
    sin: PF,
    sinh: PF,
    sqrt: PF,
    tan: PF,
    tanh: PF,
    trunc: PF
  },
  NaN: O,
  Number: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    isFinite: PF,
    isInteger: PF,
    isNaN: PF,
    isSafeInteger: PF,
    parseFloat: PF,
    parseInt: PF,
    prototype: O
  },
  Object: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    create: PF,
    getNotifier: PF,
    getOwn: PF,
    getOwnPropertyDescriptor: PF,
    getOwnPropertyNames: PF,
    getOwnPropertySymbols: PF,
    getPrototypeOf: PF,
    is: PF,
    isExtensible: PF,
    isFrozen: PF,
    isSealed: PF,
    keys: PF,
    prototype: O
  },
  parseFloat: PF,
  parseInt: PF,
  Promise: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: IMPURE,
    all: PF,
    prototype: O,
    race: PF,
    resolve: PF
  },
  // @ts-ignore
  propertyIsEnumerable: O,
  Proxy: O,
  RangeError: PC,
  ReferenceError: PC,
  Reflect: O,
  RegExp: PC,
  Set: PC,
  SharedArrayBuffer: C,
  String: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    fromCharCode: PF,
    fromCodePoint: PF,
    prototype: O,
    raw: PF
  },
  Symbol: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: PURE,
    for: PF,
    keyFor: PF,
    prototype: O
  },
  SyntaxError: PC,
  // @ts-ignore
  toLocaleString: O,
  // @ts-ignore
  toString: O,
  TypeError: PC,
  Uint16Array: ARRAY_TYPE,
  Uint32Array: ARRAY_TYPE,
  Uint8Array: ARRAY_TYPE,
  Uint8ClampedArray: ARRAY_TYPE,
  // Technically, this is a global, but it needs special handling
  // undefined: ?,
  unescape: PF,
  URIError: PC,
  // @ts-ignore
  valueOf: O,
  WeakMap: PC,
  WeakSet: PC,
  // Additional globals shared by Node and Browser that are not strictly part of the language
  clearInterval: C,
  clearTimeout: C,
  console: O,
  Intl: {
    // @ts-ignore
    __proto__: null,
    [ValueProperties]: IMPURE,
    Collator: INTL_MEMBER,
    DateTimeFormat: INTL_MEMBER,
    ListFormat: INTL_MEMBER,
    NumberFormat: INTL_MEMBER,
    PluralRules: INTL_MEMBER,
    RelativeTimeFormat: INTL_MEMBER
  },
  setInterval: C,
  setTimeout: C,
  TextDecoder: C,
  TextEncoder: C,
  URL: C,
  URLSearchParams: C,
  // Browser specific globals
  AbortController: C,
  AbortSignal: C,
  addEventListener: O,
  alert: O,
  AnalyserNode: C,
  Animation: C,
  AnimationEvent: C,
  applicationCache: O,
  ApplicationCache: C,
  ApplicationCacheErrorEvent: C,
  atob: O,
  Attr: C,
  Audio: C,
  AudioBuffer: C,
  AudioBufferSourceNode: C,
  AudioContext: C,
  AudioDestinationNode: C,
  AudioListener: C,
  AudioNode: C,
  AudioParam: C,
  AudioProcessingEvent: C,
  AudioScheduledSourceNode: C,
  AudioWorkletNode: C,
  BarProp: C,
  BaseAudioContext: C,
  BatteryManager: C,
  BeforeUnloadEvent: C,
  BiquadFilterNode: C,
  Blob: C,
  BlobEvent: C,
  blur: O,
  BroadcastChannel: C,
  btoa: O,
  ByteLengthQueuingStrategy: C,
  Cache: C,
  caches: O,
  CacheStorage: C,
  cancelAnimationFrame: O,
  cancelIdleCallback: O,
  CanvasCaptureMediaStreamTrack: C,
  CanvasGradient: C,
  CanvasPattern: C,
  CanvasRenderingContext2D: C,
  ChannelMergerNode: C,
  ChannelSplitterNode: C,
  CharacterData: C,
  clientInformation: O,
  ClipboardEvent: C,
  close: O,
  closed: O,
  CloseEvent: C,
  Comment: C,
  CompositionEvent: C,
  confirm: O,
  ConstantSourceNode: C,
  ConvolverNode: C,
  CountQueuingStrategy: C,
  createImageBitmap: O,
  Credential: C,
  CredentialsContainer: C,
  crypto: O,
  Crypto: C,
  CryptoKey: C,
  CSS: C,
  CSSConditionRule: C,
  CSSFontFaceRule: C,
  CSSGroupingRule: C,
  CSSImportRule: C,
  CSSKeyframeRule: C,
  CSSKeyframesRule: C,
  CSSMediaRule: C,
  CSSNamespaceRule: C,
  CSSPageRule: C,
  CSSRule: C,
  CSSRuleList: C,
  CSSStyleDeclaration: C,
  CSSStyleRule: C,
  CSSStyleSheet: C,
  CSSSupportsRule: C,
  CustomElementRegistry: C,
  customElements: O,
  CustomEvent: C,
  DataTransfer: C,
  DataTransferItem: C,
  DataTransferItemList: C,
  defaultstatus: O,
  defaultStatus: O,
  DelayNode: C,
  DeviceMotionEvent: C,
  DeviceOrientationEvent: C,
  devicePixelRatio: O,
  dispatchEvent: O,
  document: O,
  Document: C,
  DocumentFragment: C,
  DocumentType: C,
  DOMError: C,
  DOMException: C,
  DOMImplementation: C,
  DOMMatrix: C,
  DOMMatrixReadOnly: C,
  DOMParser: C,
  DOMPoint: C,
  DOMPointReadOnly: C,
  DOMQuad: C,
  DOMRect: C,
  DOMRectReadOnly: C,
  DOMStringList: C,
  DOMStringMap: C,
  DOMTokenList: C,
  DragEvent: C,
  DynamicsCompressorNode: C,
  Element: C,
  ErrorEvent: C,
  Event: C,
  EventSource: C,
  EventTarget: C,
  external: O,
  fetch: O,
  File: C,
  FileList: C,
  FileReader: C,
  find: O,
  focus: O,
  FocusEvent: C,
  FontFace: C,
  FontFaceSetLoadEvent: C,
  FormData: C,
  frames: O,
  GainNode: C,
  Gamepad: C,
  GamepadButton: C,
  GamepadEvent: C,
  getComputedStyle: O,
  getSelection: O,
  HashChangeEvent: C,
  Headers: C,
  history: O,
  History: C,
  HTMLAllCollection: C,
  HTMLAnchorElement: C,
  HTMLAreaElement: C,
  HTMLAudioElement: C,
  HTMLBaseElement: C,
  HTMLBodyElement: C,
  HTMLBRElement: C,
  HTMLButtonElement: C,
  HTMLCanvasElement: C,
  HTMLCollection: C,
  HTMLContentElement: C,
  HTMLDataElement: C,
  HTMLDataListElement: C,
  HTMLDetailsElement: C,
  HTMLDialogElement: C,
  HTMLDirectoryElement: C,
  HTMLDivElement: C,
  HTMLDListElement: C,
  HTMLDocument: C,
  HTMLElement: C,
  HTMLEmbedElement: C,
  HTMLFieldSetElement: C,
  HTMLFontElement: C,
  HTMLFormControlsCollection: C,
  HTMLFormElement: C,
  HTMLFrameElement: C,
  HTMLFrameSetElement: C,
  HTMLHeadElement: C,
  HTMLHeadingElement: C,
  HTMLHRElement: C,
  HTMLHtmlElement: C,
  HTMLIFrameElement: C,
  HTMLImageElement: C,
  HTMLInputElement: C,
  HTMLLabelElement: C,
  HTMLLegendElement: C,
  HTMLLIElement: C,
  HTMLLinkElement: C,
  HTMLMapElement: C,
  HTMLMarqueeElement: C,
  HTMLMediaElement: C,
  HTMLMenuElement: C,
  HTMLMetaElement: C,
  HTMLMeterElement: C,
  HTMLModElement: C,
  HTMLObjectElement: C,
  HTMLOListElement: C,
  HTMLOptGroupElement: C,
  HTMLOptionElement: C,
  HTMLOptionsCollection: C,
  HTMLOutputElement: C,
  HTMLParagraphElement: C,
  HTMLParamElement: C,
  HTMLPictureElement: C,
  HTMLPreElement: C,
  HTMLProgressElement: C,
  HTMLQuoteElement: C,
  HTMLScriptElement: C,
  HTMLSelectElement: C,
  HTMLShadowElement: C,
  HTMLSlotElement: C,
  HTMLSourceElement: C,
  HTMLSpanElement: C,
  HTMLStyleElement: C,
  HTMLTableCaptionElement: C,
  HTMLTableCellElement: C,
  HTMLTableColElement: C,
  HTMLTableElement: C,
  HTMLTableRowElement: C,
  HTMLTableSectionElement: C,
  HTMLTemplateElement: C,
  HTMLTextAreaElement: C,
  HTMLTimeElement: C,
  HTMLTitleElement: C,
  HTMLTrackElement: C,
  HTMLUListElement: C,
  HTMLUnknownElement: C,
  HTMLVideoElement: C,
  IDBCursor: C,
  IDBCursorWithValue: C,
  IDBDatabase: C,
  IDBFactory: C,
  IDBIndex: C,
  IDBKeyRange: C,
  IDBObjectStore: C,
  IDBOpenDBRequest: C,
  IDBRequest: C,
  IDBTransaction: C,
  IDBVersionChangeEvent: C,
  IdleDeadline: C,
  IIRFilterNode: C,
  Image: C,
  ImageBitmap: C,
  ImageBitmapRenderingContext: C,
  ImageCapture: C,
  ImageData: C,
  indexedDB: O,
  innerHeight: O,
  innerWidth: O,
  InputEvent: C,
  IntersectionObserver: C,
  IntersectionObserverEntry: C,
  isSecureContext: O,
  KeyboardEvent: C,
  KeyframeEffect: C,
  length: O,
  localStorage: O,
  location: O,
  Location: C,
  locationbar: O,
  matchMedia: O,
  MediaDeviceInfo: C,
  MediaDevices: C,
  MediaElementAudioSourceNode: C,
  MediaEncryptedEvent: C,
  MediaError: C,
  MediaKeyMessageEvent: C,
  MediaKeySession: C,
  MediaKeyStatusMap: C,
  MediaKeySystemAccess: C,
  MediaList: C,
  MediaQueryList: C,
  MediaQueryListEvent: C,
  MediaRecorder: C,
  MediaSettingsRange: C,
  MediaSource: C,
  MediaStream: C,
  MediaStreamAudioDestinationNode: C,
  MediaStreamAudioSourceNode: C,
  MediaStreamEvent: C,
  MediaStreamTrack: C,
  MediaStreamTrackEvent: C,
  menubar: O,
  MessageChannel: C,
  MessageEvent: C,
  MessagePort: C,
  MIDIAccess: C,
  MIDIConnectionEvent: C,
  MIDIInput: C,
  MIDIInputMap: C,
  MIDIMessageEvent: C,
  MIDIOutput: C,
  MIDIOutputMap: C,
  MIDIPort: C,
  MimeType: C,
  MimeTypeArray: C,
  MouseEvent: C,
  moveBy: O,
  moveTo: O,
  MutationEvent: C,
  MutationObserver: C,
  MutationRecord: C,
  name: O,
  NamedNodeMap: C,
  NavigationPreloadManager: C,
  navigator: O,
  Navigator: C,
  NetworkInformation: C,
  Node: C,
  NodeFilter: O,
  NodeIterator: C,
  NodeList: C,
  Notification: C,
  OfflineAudioCompletionEvent: C,
  OfflineAudioContext: C,
  offscreenBuffering: O,
  OffscreenCanvas: C,
  open: O,
  openDatabase: O,
  Option: C,
  origin: O,
  OscillatorNode: C,
  outerHeight: O,
  outerWidth: O,
  PageTransitionEvent: C,
  pageXOffset: O,
  pageYOffset: O,
  PannerNode: C,
  parent: O,
  Path2D: C,
  PaymentAddress: C,
  PaymentRequest: C,
  PaymentRequestUpdateEvent: C,
  PaymentResponse: C,
  performance: O,
  Performance: C,
  PerformanceEntry: C,
  PerformanceLongTaskTiming: C,
  PerformanceMark: C,
  PerformanceMeasure: C,
  PerformanceNavigation: C,
  PerformanceNavigationTiming: C,
  PerformanceObserver: C,
  PerformanceObserverEntryList: C,
  PerformancePaintTiming: C,
  PerformanceResourceTiming: C,
  PerformanceTiming: C,
  PeriodicWave: C,
  Permissions: C,
  PermissionStatus: C,
  personalbar: O,
  PhotoCapabilities: C,
  Plugin: C,
  PluginArray: C,
  PointerEvent: C,
  PopStateEvent: C,
  postMessage: O,
  Presentation: C,
  PresentationAvailability: C,
  PresentationConnection: C,
  PresentationConnectionAvailableEvent: C,
  PresentationConnectionCloseEvent: C,
  PresentationConnectionList: C,
  PresentationReceiver: C,
  PresentationRequest: C,
  print: O,
  ProcessingInstruction: C,
  ProgressEvent: C,
  PromiseRejectionEvent: C,
  prompt: O,
  PushManager: C,
  PushSubscription: C,
  PushSubscriptionOptions: C,
  queueMicrotask: O,
  RadioNodeList: C,
  Range: C,
  ReadableStream: C,
  RemotePlayback: C,
  removeEventListener: O,
  Request: C,
  requestAnimationFrame: O,
  requestIdleCallback: O,
  resizeBy: O,
  ResizeObserver: C,
  ResizeObserverEntry: C,
  resizeTo: O,
  Response: C,
  RTCCertificate: C,
  RTCDataChannel: C,
  RTCDataChannelEvent: C,
  RTCDtlsTransport: C,
  RTCIceCandidate: C,
  RTCIceTransport: C,
  RTCPeerConnection: C,
  RTCPeerConnectionIceEvent: C,
  RTCRtpReceiver: C,
  RTCRtpSender: C,
  RTCSctpTransport: C,
  RTCSessionDescription: C,
  RTCStatsReport: C,
  RTCTrackEvent: C,
  screen: O,
  Screen: C,
  screenLeft: O,
  ScreenOrientation: C,
  screenTop: O,
  screenX: O,
  screenY: O,
  ScriptProcessorNode: C,
  scroll: O,
  scrollbars: O,
  scrollBy: O,
  scrollTo: O,
  scrollX: O,
  scrollY: O,
  SecurityPolicyViolationEvent: C,
  Selection: C,
  ServiceWorker: C,
  ServiceWorkerContainer: C,
  ServiceWorkerRegistration: C,
  sessionStorage: O,
  ShadowRoot: C,
  SharedWorker: C,
  SourceBuffer: C,
  SourceBufferList: C,
  speechSynthesis: O,
  SpeechSynthesisEvent: C,
  SpeechSynthesisUtterance: C,
  StaticRange: C,
  status: O,
  statusbar: O,
  StereoPannerNode: C,
  stop: O,
  Storage: C,
  StorageEvent: C,
  StorageManager: C,
  styleMedia: O,
  StyleSheet: C,
  StyleSheetList: C,
  SubtleCrypto: C,
  SVGAElement: C,
  SVGAngle: C,
  SVGAnimatedAngle: C,
  SVGAnimatedBoolean: C,
  SVGAnimatedEnumeration: C,
  SVGAnimatedInteger: C,
  SVGAnimatedLength: C,
  SVGAnimatedLengthList: C,
  SVGAnimatedNumber: C,
  SVGAnimatedNumberList: C,
  SVGAnimatedPreserveAspectRatio: C,
  SVGAnimatedRect: C,
  SVGAnimatedString: C,
  SVGAnimatedTransformList: C,
  SVGAnimateElement: C,
  SVGAnimateMotionElement: C,
  SVGAnimateTransformElement: C,
  SVGAnimationElement: C,
  SVGCircleElement: C,
  SVGClipPathElement: C,
  SVGComponentTransferFunctionElement: C,
  SVGDefsElement: C,
  SVGDescElement: C,
  SVGDiscardElement: C,
  SVGElement: C,
  SVGEllipseElement: C,
  SVGFEBlendElement: C,
  SVGFEColorMatrixElement: C,
  SVGFEComponentTransferElement: C,
  SVGFECompositeElement: C,
  SVGFEConvolveMatrixElement: C,
  SVGFEDiffuseLightingElement: C,
  SVGFEDisplacementMapElement: C,
  SVGFEDistantLightElement: C,
  SVGFEDropShadowElement: C,
  SVGFEFloodElement: C,
  SVGFEFuncAElement: C,
  SVGFEFuncBElement: C,
  SVGFEFuncGElement: C,
  SVGFEFuncRElement: C,
  SVGFEGaussianBlurElement: C,
  SVGFEImageElement: C,
  SVGFEMergeElement: C,
  SVGFEMergeNodeElement: C,
  SVGFEMorphologyElement: C,
  SVGFEOffsetElement: C,
  SVGFEPointLightElement: C,
  SVGFESpecularLightingElement: C,
  SVGFESpotLightElement: C,
  SVGFETileElement: C,
  SVGFETurbulenceElement: C,
  SVGFilterElement: C,
  SVGForeignObjectElement: C,
  SVGGElement: C,
  SVGGeometryElement: C,
  SVGGradientElement: C,
  SVGGraphicsElement: C,
  SVGImageElement: C,
  SVGLength: C,
  SVGLengthList: C,
  SVGLinearGradientElement: C,
  SVGLineElement: C,
  SVGMarkerElement: C,
  SVGMaskElement: C,
  SVGMatrix: C,
  SVGMetadataElement: C,
  SVGMPathElement: C,
  SVGNumber: C,
  SVGNumberList: C,
  SVGPathElement: C,
  SVGPatternElement: C,
  SVGPoint: C,
  SVGPointList: C,
  SVGPolygonElement: C,
  SVGPolylineElement: C,
  SVGPreserveAspectRatio: C,
  SVGRadialGradientElement: C,
  SVGRect: C,
  SVGRectElement: C,
  SVGScriptElement: C,
  SVGSetElement: C,
  SVGStopElement: C,
  SVGStringList: C,
  SVGStyleElement: C,
  SVGSVGElement: C,
  SVGSwitchElement: C,
  SVGSymbolElement: C,
  SVGTextContentElement: C,
  SVGTextElement: C,
  SVGTextPathElement: C,
  SVGTextPositioningElement: C,
  SVGTitleElement: C,
  SVGTransform: C,
  SVGTransformList: C,
  SVGTSpanElement: C,
  SVGUnitTypes: C,
  SVGUseElement: C,
  SVGViewElement: C,
  TaskAttributionTiming: C,
  Text: C,
  TextEvent: C,
  TextMetrics: C,
  TextTrack: C,
  TextTrackCue: C,
  TextTrackCueList: C,
  TextTrackList: C,
  TimeRanges: C,
  toolbar: O,
  top: O,
  Touch: C,
  TouchEvent: C,
  TouchList: C,
  TrackEvent: C,
  TransitionEvent: C,
  TreeWalker: C,
  UIEvent: C,
  ValidityState: C,
  visualViewport: O,
  VisualViewport: C,
  VTTCue: C,
  WaveShaperNode: C,
  WebAssembly: O,
  WebGL2RenderingContext: C,
  WebGLActiveInfo: C,
  WebGLBuffer: C,
  WebGLContextEvent: C,
  WebGLFramebuffer: C,
  WebGLProgram: C,
  WebGLQuery: C,
  WebGLRenderbuffer: C,
  WebGLRenderingContext: C,
  WebGLSampler: C,
  WebGLShader: C,
  WebGLShaderPrecisionFormat: C,
  WebGLSync: C,
  WebGLTexture: C,
  WebGLTransformFeedback: C,
  WebGLUniformLocation: C,
  WebGLVertexArrayObject: C,
  WebSocket: C,
  WheelEvent: C,
  Window: C,
  Worker: C,
  WritableStream: C,
  XMLDocument: C,
  XMLHttpRequest: C,
  XMLHttpRequestEventTarget: C,
  XMLHttpRequestUpload: C,
  XMLSerializer: C,
  XPathEvaluator: C,
  XPathExpression: C,
  XPathResult: C,
  XSLTProcessor: C
};
for (const global of ['window', 'global', 'self', 'globalThis']) {
  knownGlobals[global] = knownGlobals;
}
function getGlobalAtPath(path) {
  let currentGlobal = knownGlobals;
  for (const pathSegment of path) {
    if (typeof pathSegment !== 'string') {
      return null;
    }
    currentGlobal = currentGlobal[pathSegment];
    if (!currentGlobal) {
      return null;
    }
  }
  return currentGlobal[ValueProperties];
}
function isPureGlobal(path) {
  const globalAtPath = getGlobalAtPath(path);
  return globalAtPath !== null && globalAtPath.pure;
}
function isGlobalMember(path) {
  if (path.length === 1) {
    return path[0] === 'undefined' || getGlobalAtPath(path) !== null;
  }
  return getGlobalAtPath(path.slice(0, -1)) !== null;
}

class GlobalVariable extends Variable {
  constructor() {
    super(...arguments);
    this.isReassigned = true;
  }
  hasEffectsWhenAccessedAtPath(path) {
    return !isGlobalMember([this.name, ...path]);
  }
  hasEffectsWhenCalledAtPath(path) {
    return !isPureGlobal([this.name, ...path]);
  }
}

class Identifier extends NodeBase {
  constructor() {
    super(...arguments);
    this.variable = null;
    this.bound = false;
  }
  addExportedVariables(variables, exportNamesByVariable) {
    if (this.variable !== null && exportNamesByVariable.has(this.variable)) {
      variables.push(this.variable);
    }
  }
  bind() {
    if (this.bound)
      return;
    this.bound = true;
    if (this.variable === null && is_reference(this, this.parent)) {
      this.variable = this.scope.findVariable(this.name);
      this.variable.addReference(this);
    }
    if (this.variable !== null &&
      this.variable instanceof LocalVariable &&
      this.variable.additionalInitializers !== null) {
      this.variable.consolidateInitializers();
    }
  }
  declare(kind, init) {
    let variable;
    switch (kind) {
      case 'var':
        variable = this.scope.addDeclaration(this, this.context, init, true);
        break;
      case 'function':
        // in strict mode, functions are only hoisted within a scope but not across block scopes
        variable = this.scope.addDeclaration(this, this.context, init, false);
        break;
      case 'let':
      case 'const':
      case 'class':
        variable = this.scope.addDeclaration(this, this.context, init, false);
        break;
      case 'parameter':
        variable = this.scope.addParameterDeclaration(this);
        break;
      /* istanbul ignore next */
      default:
        /* istanbul ignore next */
        throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`);
    }
    return [(this.variable = variable)];
  }
  deoptimizePath(path) {
    if (!this.bound)
      this.bind();
    if (path.length === 0 && !this.scope.contains(this.name)) {
      this.disallowImportReassignment();
    }
    this.variable.deoptimizePath(path);
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (!this.bound)
      this.bind();
    return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    if (!this.bound)
      this.bind();
    return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  }
  hasEffects() {
    return (this.context.options.treeshake.unknownGlobalSideEffects &&
      this.variable instanceof GlobalVariable &&
      this.variable.hasEffectsWhenAccessedAtPath(EMPTY_PATH));
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    return this.variable !== null && this.variable.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path, context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  include() {
    if (!this.included) {
      this.included = true;
      if (this.variable !== null) {
        this.context.includeVariableInModule(this.variable);
      }
    }
  }
  includeCallArguments(context, args) {
    this.variable.includeCallArguments(context, args);
  }
  render(code, _options, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
    if (this.variable) {
      const name = this.variable.getName();
      if (name !== this.name) {
        code.overwrite(this.start, this.end, name, {
          contentOnly: true,
          storeName: true
        });
        if (isShorthandProperty) {
          code.prependRight(this.start, `${this.name}: `);
        }
      }
      // In strict mode, any variable named "eval" must be the actual "eval" function
      if (name === 'eval' &&
        renderedParentType === CallExpression$1 &&
        isCalleeOfRenderedParent) {
        code.appendRight(this.start, '0, ');
      }
    }
  }
  disallowImportReassignment() {
    return this.context.error({
      code: 'ILLEGAL_REASSIGNMENT',
      message: `Illegal reassignment to import '${this.name}'`
    }, this.start);
  }
}

class RestElement extends NodeBase {
  constructor() {
    super(...arguments);
    this.declarationInit = null;
  }
  addExportedVariables(variables, exportNamesByVariable) {
    this.argument.addExportedVariables(variables, exportNamesByVariable);
  }
  bind() {
    super.bind();
    if (this.declarationInit !== null) {
      this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
    }
  }
  declare(kind, init) {
    this.declarationInit = init;
    return this.argument.declare(kind, UNKNOWN_EXPRESSION);
  }
  deoptimizePath(path) {
    path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return path.length > 0 || this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
  }
}

class FunctionNode extends NodeBase {
  constructor() {
    super(...arguments);
    this.isPrototypeDeoptimized = false;
  }
  createScope(parentScope) {
    this.scope = new FunctionScope(parentScope, this.context);
  }
  deoptimizePath(path) {
    if (path.length === 1) {
      if (path[0] === 'prototype') {
        this.isPrototypeDeoptimized = true;
      }
      else if (path[0] === UnknownKey) {
        this.isPrototypeDeoptimized = true;
        // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
        // which means the return expression needs to be reassigned as well
        this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
      }
    }
  }
  getReturnExpressionWhenCalledAtPath(path) {
    return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
  }
  hasEffects() {
    return this.id !== null && this.id.hasEffects();
  }
  hasEffectsWhenAccessedAtPath(path) {
    if (path.length <= 1)
      return false;
    return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
  }
  hasEffectsWhenAssignedAtPath(path) {
    if (path.length <= 1) {
      return false;
    }
    return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length > 0)
      return true;
    for (const param of this.params) {
      if (param.hasEffects(context))
        return true;
    }
    const thisInit = context.replacedVariableInits.get(this.scope.thisVariable);
    context.replacedVariableInits.set(this.scope.thisVariable, callOptions.withNew ? new UnknownObjectExpression() : UNKNOWN_EXPRESSION);
    const { brokenFlow, ignore } = context;
    context.ignore = {
      breaks: false,
      continues: false,
      labels: new Set(),
      returnAwaitYield: true
    };
    if (this.body.hasEffects(context))
      return true;
    context.brokenFlow = brokenFlow;
    if (thisInit) {
      context.replacedVariableInits.set(this.scope.thisVariable, thisInit);
    }
    else {
      context.replacedVariableInits.delete(this.scope.thisVariable);
    }
    context.ignore = ignore;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (this.id)
      this.id.include();
    const hasArguments = this.scope.argumentsVariable.included;
    for (const param of this.params) {
      if (!(param instanceof Identifier) || hasArguments) {
        param.include(context, includeChildrenRecursively);
      }
    }
    const { brokenFlow } = context;
    context.brokenFlow = BROKEN_FLOW_NONE;
    this.body.include(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
  includeCallArguments(context, args) {
    this.scope.includeCallArguments(context, args);
  }
  initialise() {
    if (this.id !== null) {
      this.id.declare('function', this);
    }
    this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
    this.body.addImplicitReturnExpressionToScope();
  }
  parseNode(esTreeNode) {
    this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
    super.parseNode(esTreeNode);
  }
}
FunctionNode.prototype.preventChildBlockScope = true;

class FunctionDeclaration extends FunctionNode {
  initialise() {
    super.initialise();
    if (this.id !== null) {
      this.id.variable.isId = true;
    }
  }
  parseNode(esTreeNode) {
    if (esTreeNode.id !== null) {
      this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope
        .parent);
    }
    super.parseNode(esTreeNode);
  }
}

// The header ends at the first non-white-space after "default"
function getDeclarationStart(code, start) {
  return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);
}
function getIdInsertPosition(code, declarationKeyword, endMarker, start) {
  const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;
  code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd));
  const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
  if (generatorStarPos === -1) {
    return declarationEnd;
  }
  return declarationEnd + generatorStarPos + 1;
}
class ExportDefaultDeclaration extends NodeBase {
  include(context, includeChildrenRecursively) {
    super.include(context, includeChildrenRecursively);
    if (includeChildrenRecursively) {
      this.context.includeVariableInModule(this.variable);
    }
  }
  initialise() {
    const declaration = this.declaration;
    this.declarationName =
      (declaration.id && declaration.id.name) || this.declaration.name;
    this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.context.getModuleName(), this, this.context);
    this.context.addExport(this);
  }
  render(code, options, nodeRenderOptions) {
    const { start, end } = nodeRenderOptions;
    const declarationStart = getDeclarationStart(code.original, this.start);
    if (this.declaration instanceof FunctionDeclaration) {
      this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options);
    }
    else if (this.declaration instanceof ClassDeclaration) {
      this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options);
    }
    else if (this.variable.getOriginalVariable() !== this.variable) {
      // Remove altogether to prevent re-declaring the same variable
      treeshakeNode(this, code, start, end);
      return;
    }
    else if (this.variable.included) {
      this.renderVariableDeclaration(code, declarationStart, options);
    }
    else {
      code.remove(this.start, declarationStart);
      this.declaration.render(code, options, {
        isCalleeOfRenderedParent: false,
        renderedParentType: ExpressionStatement$1
      });
      if (code.original[this.end - 1] !== ';') {
        code.appendLeft(this.end, ';');
      }
      return;
    }
    this.declaration.render(code, options);
  }
  renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
    const name = this.variable.getName();
    // Remove `export default`
    code.remove(this.start, declarationStart);
    if (needsId) {
      code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`);
    }
    if (options.format === 'system' &&
      this.declaration instanceof ClassDeclaration &&
      options.exportNamesByVariable.has(this.variable)) {
      code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
    }
  }
  renderVariableDeclaration(code, declarationStart, options) {
    const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/
    const systemExportNames = options.format === 'system' && options.exportNamesByVariable.get(this.variable);
    if (systemExportNames) {
      code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = exports('${systemExportNames[0]}', `);
      code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';'));
    }
    else {
      code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = `);
      if (!hasTrailingSemicolon) {
        code.appendLeft(this.end, ';');
      }
    }
  }
}
ExportDefaultDeclaration.prototype.needsBoundaries = true;

class UndefinedVariable extends Variable {
  constructor() {
    super('undefined');
  }
  getLiteralValueAtPath() {
    return undefined;
  }
}

class ExportDefaultVariable extends LocalVariable {
  constructor(name, exportDefaultDeclaration, context) {
    super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context);
    this.hasId = false;
    this.originalId = null;
    this.originalVariable = null;
    const declaration = exportDefaultDeclaration.declaration;
    if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) &&
      declaration.id) {
      this.hasId = true;
      this.originalId = declaration.id;
    }
    else if (declaration instanceof Identifier) {
      this.originalId = declaration;
    }
  }
  addReference(identifier) {
    if (!this.hasId) {
      this.name = identifier.name;
    }
  }
  getAssignedVariableName() {
    return (this.originalId && this.originalId.name) || null;
  }
  getBaseVariableName() {
    const original = this.getOriginalVariable();
    if (original === this) {
      return super.getBaseVariableName();
    }
    else {
      return original.getBaseVariableName();
    }
  }
  getDirectOriginalVariable() {
    return this.originalId &&
      (this.hasId ||
        !(this.originalId.variable.isReassigned ||
          this.originalId.variable instanceof UndefinedVariable ||
          // this avoids a circular dependency
          'syntheticNamespace' in this.originalId.variable))
      ? this.originalId.variable
      : null;
  }
  getName() {
    const original = this.getOriginalVariable();
    if (original === this) {
      return super.getName();
    }
    else {
      return original.getName();
    }
  }
  getOriginalVariable() {
    if (this.originalVariable)
      return this.originalVariable;
    let original = this;
    let currentVariable;
    const checkedVariables = new Set();
    do {
      checkedVariables.add(original);
      currentVariable = original;
      original = currentVariable.getDirectOriginalVariable();
    } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));
    return (this.originalVariable = original || currentVariable);
  }
}

const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';

class ExportShimVariable extends Variable {
  constructor(module) {
    super(MISSING_EXPORT_SHIM_VARIABLE);
    this.module = module;
  }
}

class NamespaceVariable extends Variable {
  constructor(context, syntheticNamedExports) {
    super(context.getModuleName());
    this.memberVariables = null;
    this.mergedNamespaces = [];
    this.referencedEarly = false;
    this.references = [];
    this.context = context;
    this.module = context.module;
    this.syntheticNamedExports = syntheticNamedExports;
  }
  addReference(identifier) {
    this.references.push(identifier);
    this.name = identifier.name;
  }
  // This is only called if "UNKNOWN_PATH" is reassigned as in all other situations, either the
  // build fails due to an illegal namespace reassignment or MemberExpression already forwards
  // the reassignment to the right variable. This means we lost track of this variable and thus
  // need to reassign all exports.
  deoptimizePath() {
    const memberVariables = this.getMemberVariables();
    for (const key of Object.keys(memberVariables)) {
      memberVariables[key].deoptimizePath(UNKNOWN_PATH);
    }
  }
  getMemberVariables() {
    if (this.memberVariables) {
      return this.memberVariables;
    }
    const memberVariables = Object.create(null);
    for (const name of this.context.getExports().concat(this.context.getReexports())) {
      if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
        memberVariables[name] = this.context.traceExport(name);
      }
    }
    return (this.memberVariables = memberVariables);
  }
  include() {
    this.included = true;
    this.context.includeAllExports();
  }
  prepareNamespace(mergedNamespaces) {
    this.mergedNamespaces = mergedNamespaces;
    const moduleExecIndex = this.context.getModuleExecIndex();
    for (const identifier of this.references) {
      if (identifier.context.getModuleExecIndex() <= moduleExecIndex) {
        this.referencedEarly = true;
        break;
      }
    }
  }
  renderBlock(options) {
    const _ = options.compact ? '' : ' ';
    const n = options.compact ? '' : '\n';
    const t = options.indent;
    const memberVariables = this.getMemberVariables();
    const members = Object.keys(memberVariables).map(name => {
      const original = memberVariables[name];
      if (this.referencedEarly || original.isReassigned) {
        return `${t}get ${name}${_}()${_}{${_}return ${original.getName()}${options.compact ? '' : ';'}${_}}`;
      }
      const safeName = RESERVED_NAMES[name] ? `'${name}'` : name;
      return `${t}${safeName}: ${original.getName()}`;
    });
    if (options.namespaceToStringTag) {
      members.unshift(`${t}[Symbol.toStringTag]:${_}'Module'`);
    }
    const needsObjectAssign = this.mergedNamespaces.length > 0 || this.syntheticNamedExports;
    if (!needsObjectAssign)
      members.unshift(`${t}__proto__:${_}null`);
    let output = `{${n}${members.join(`,${n}`)}${n}}`;
    if (needsObjectAssign) {
      const assignmentArgs = ['/*#__PURE__*/Object.create(null)'];
      if (this.mergedNamespaces.length > 0) {
        assignmentArgs.push(...this.mergedNamespaces.map(variable => variable.getName()));
      }
      if (this.syntheticNamedExports) {
        assignmentArgs.push(this.module.getSyntheticNamespace().getName());
      }
      if (members.length > 0) {
        assignmentArgs.push(output);
      }
      output = `/*#__PURE__*/Object.assign(${assignmentArgs.join(`,${_}`)})`;
    }
    if (options.freeze) {
      output = `/*#__PURE__*/Object.freeze(${output})`;
    }
    const name = this.getName();
    output = `${options.varOrConst} ${name}${_}=${_}${output};`;
    if (options.format === 'system' && options.exportNamesByVariable.has(this)) {
      output += `${n}${getSystemExportStatement([this], options)};`;
    }
    return output;
  }
  renderFirst() {
    return this.referencedEarly;
  }
}
NamespaceVariable.prototype.isNamespace = true;

class SyntheticNamedExportVariable extends Variable {
  constructor(context, name, syntheticNamespace) {
    super(name);
    this.baseVariable = null;
    this.context = context;
    this.module = context.module;
    this.syntheticNamespace = syntheticNamespace;
  }
  getBaseVariable() {
    if (this.baseVariable)
      return this.baseVariable;
    let baseVariable = this.syntheticNamespace;
    while (baseVariable instanceof ExportDefaultVariable ||
      baseVariable instanceof SyntheticNamedExportVariable) {
      if (baseVariable instanceof ExportDefaultVariable) {
        const original = baseVariable.getOriginalVariable();
        if (original === baseVariable)
          break;
        baseVariable = original;
      }
      if (baseVariable instanceof SyntheticNamedExportVariable) {
        baseVariable = baseVariable.syntheticNamespace;
      }
    }
    return (this.baseVariable = baseVariable);
  }
  getBaseVariableName() {
    return this.syntheticNamespace.getBaseVariableName();
  }
  getName() {
    const name = this.name;
    return `${this.syntheticNamespace.getName()}${getPropertyAccess(name)}`;
  }
  include() {
    if (!this.included) {
      this.included = true;
      this.context.includeVariableInModule(this.syntheticNamespace);
    }
  }
  setRenderNames(baseName, name) {
    super.setRenderNames(baseName, name);
  }
}
const getPropertyAccess = (name) => {
  return !RESERVED_NAMES[name] && /^(?!\d)[\w$]+$/.test(name)
    ? `.${name}`
    : `[${JSON.stringify(name)}]`;
};

class ExternalVariable extends Variable {
  constructor(module, name) {
    super(name);
    this.module = module;
    this.isNamespace = name === '*';
    this.referenced = false;
  }
  addReference(identifier) {
    this.referenced = true;
    if (this.name === 'default' || this.name === '*') {
      this.module.suggestName(identifier.name);
    }
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > (this.isNamespace ? 1 : 0);
  }
  include() {
    if (!this.included) {
      this.included = true;
      this.module.used = true;
    }
  }
}

const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
const builtins$1 = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
const blacklisted = new Set(reservedWords$1.concat(builtins$1));
const illegalCharacters = /[^$_a-zA-Z0-9]/g;
const startsWithDigit = (str) => /\d/.test(str[0]);
function isLegal(str) {
  if (startsWithDigit(str) || blacklisted.has(str)) {
    return false;
  }
  return !illegalCharacters.test(str);
}
function makeLegal(str) {
  str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');
  if (startsWithDigit(str) || blacklisted.has(str))
    str = `_${str}`;
  return str || '_';
}

const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
const relativePath$1 = /^\.?\.\//;
function isAbsolute(path) {
  return absolutePath.test(path);
}
function isRelative(path) {
  return relativePath$1.test(path);
}
function normalize(path) {
  if (path.indexOf('\\') == -1)
    return path;
  return path.replace(/\\/g, '/');
}

class ExternalModule {
  constructor(options, id, hasModuleSideEffects, meta) {
    this.options = options;
    this.id = id;
    this.defaultVariableName = '';
    this.dynamicImporters = [];
    this.importers = [];
    this.mostCommonSuggestion = 0;
    this.namespaceVariableName = '';
    this.reexported = false;
    this.renderPath = undefined;
    this.renormalizeRenderPath = false;
    this.used = false;
    this.variableName = '';
    this.execIndex = Infinity;
    this.suggestedVariableName = makeLegal(id.split(/[\\/]/).pop());
    this.nameSuggestions = Object.create(null);
    this.declarations = Object.create(null);
    this.exportedVariables = new Map();
    const module = this;
    this.info = {
      ast: null,
      code: null,
      dynamicallyImportedIds: EMPTY_ARRAY,
      get dynamicImporters() {
        return module.dynamicImporters.sort();
      },
      hasModuleSideEffects,
      id,
      implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
      implicitlyLoadedBefore: EMPTY_ARRAY,
      importedIds: EMPTY_ARRAY,
      get importers() {
        return module.importers.sort();
      },
      isEntry: false,
      isExternal: true,
      meta,
      syntheticNamedExports: false
    };
  }
  getVariableForExportName(name) {
    let declaration = this.declarations[name];
    if (declaration)
      return declaration;
    this.declarations[name] = declaration = new ExternalVariable(this, name);
    this.exportedVariables.set(declaration, name);
    return declaration;
  }
  setRenderPath(options, inputBase) {
    this.renderPath =
      typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];
    if (!this.renderPath) {
      if (!isAbsolute(this.id)) {
        this.renderPath = this.id;
      }
      else {
        this.renderPath = normalize(relative$1(inputBase, this.id));
        this.renormalizeRenderPath = true;
      }
    }
    return this.renderPath;
  }
  suggestName(name) {
    if (!this.nameSuggestions[name])
      this.nameSuggestions[name] = 0;
    this.nameSuggestions[name] += 1;
    if (this.nameSuggestions[name] > this.mostCommonSuggestion) {
      this.mostCommonSuggestion = this.nameSuggestions[name];
      this.suggestedVariableName = name;
    }
  }
  warnUnusedImports() {
    const unused = Object.keys(this.declarations).filter(name => {
      if (name === '*')
        return false;
      const declaration = this.declarations[name];
      return !declaration.included && !this.reexported && !declaration.referenced;
    });
    if (unused.length === 0)
      return;
    const names = unused.length === 1
      ? `'${unused[0]}' is`
      : `${unused
        .slice(0, -1)
        .map(name => `'${name}'`)
        .join(', ')} and '${unused.slice(-1)}' are`;
    this.options.onwarn({
      code: 'UNUSED_EXTERNAL_IMPORT',
      message: `${names} imported from external module '${this.id}' but never used`,
      names: unused,
      source: this.id
    });
  }
}

function removeJsExtension(name) {
  return name.endsWith('.js') ? name.slice(0, -3) : name;
}

function getCompleteAmdId(options, chunkId) {
  if (!options.autoId) {
    return options.id || '';
  }
  else {
    return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`;
  }
}

const INTEROP_DEFAULT_VARIABLE = '_interopDefault';
const INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy';
const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace';
const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';
const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';
const defaultInteropHelpersByInteropType = {
  auto: INTEROP_DEFAULT_VARIABLE,
  default: null,
  defaultOnly: null,
  esModule: null,
  false: null,
  true: INTEROP_DEFAULT_LEGACY_VARIABLE
};
function isDefaultAProperty(interopType, externalLiveBindings) {
  return (interopType === 'esModule' ||
    (externalLiveBindings && (interopType === 'auto' || interopType === 'true')));
}
const namespaceInteropHelpersByInteropType = {
  auto: INTEROP_NAMESPACE_VARIABLE,
  default: INTEROP_NAMESPACE_DEFAULT_VARIABLE,
  defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,
  esModule: null,
  false: null,
  true: INTEROP_NAMESPACE_VARIABLE
};
function canDefaultBeTakenFromNamespace(interopType, externalLiveBindings) {
  return (isDefaultAProperty(interopType, externalLiveBindings) &&
    defaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE);
}
function getDefaultOnlyHelper() {
  return INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE;
}
function getHelpersBlock(usedHelpers, accessedGlobals, _, n, s, t, liveBindings, freeze, namespaceToStringTag) {
  return HELPER_NAMES.map(variable => usedHelpers.has(variable) || accessedGlobals.has(variable)
    ? HELPER_GENERATORS[variable](_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers)
    : '').join('');
}
const HELPER_GENERATORS = {
  [INTEROP_DEFAULT_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_VARIABLE}${_}(e)${_}{${_}return ` +
    `e${_}&&${_}e.__esModule${_}?${_}` +
    `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
  [INTEROP_DEFAULT_LEGACY_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_LEGACY_VARIABLE}${_}(e)${_}{${_}return ` +
    `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` +
    `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
  [INTEROP_NAMESPACE_VARIABLE]: (_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers) => `function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` +
    (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)
      ? `${t}return e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${s}${n}`
      : `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` +
        createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag)) +
    `}${n}${n}`,
  [INTEROP_NAMESPACE_DEFAULT_VARIABLE]: (_, n, _s, t, liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` +
    createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag) +
    `}${n}${n}`,
  [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE]: (_, n, _s, t, _liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE}(e)${_}{${n}` +
    `${t}return ${getFrozen(`{__proto__: null,${namespaceToStringTag ? `${_}[Symbol.toStringTag]:${_}'Module',` : ''}${_}'default':${_}e}`, freeze)};${n}` +
    `}${n}${n}`
};
function getDefaultLiveBinding(_) {
  return `e${_}:${_}{${_}'default':${_}e${_}}`;
}
function getDefaultStatic(_) {
  return `e['default']${_}:${_}e`;
}
function createNamespaceObject(_, n, t, i, liveBindings, freeze, namespaceToStringTag) {
  return (`${i}var n${_}=${_}${namespaceToStringTag
    ? `{__proto__:${_}null,${_}[Symbol.toStringTag]:${_}'Module'}`
    : 'Object.create(null)'};${n}` +
    `${i}if${_}(e)${_}{${n}` +
    `${i}${t}Object.keys(e).forEach(function${_}(k)${_}{${n}` +
    (liveBindings ? copyPropertyLiveBinding : copyPropertyStatic)(_, n, t, i + t + t) +
    `${i}${t}});${n}` +
    `${i}}${n}` +
    `${i}n['default']${_}=${_}e;${n}` +
    `${i}return ${getFrozen('n', freeze)};${n}`);
}
function copyPropertyLiveBinding(_, n, t, i) {
  return (`${i}if${_}(k${_}!==${_}'default')${_}{${n}` +
    `${i}${t}var d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +
    `${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +
    `${i}${t}${t}enumerable:${_}true,${n}` +
    `${i}${t}${t}get:${_}function${_}()${_}{${n}` +
    `${i}${t}${t}${t}return e[k];${n}` +
    `${i}${t}${t}}${n}` +
    `${i}${t}});${n}` +
    `${i}}${n}`);
}
function copyPropertyStatic(_, n, _t, i) {
  return `${i}n[k]${_}=${_}e[k];${n}`;
}
function getFrozen(fragment, freeze) {
  return freeze ? `Object.freeze(${fragment})` : fragment;
}
const HELPER_NAMES = Object.keys(HELPER_GENERATORS);

function getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, mechanism = 'return ') {
  const _ = compact ? '' : ' ';
  const n = compact ? '' : '\n';
  if (!namedExportsMode) {
    return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings)};`;
  }
  let exportBlock = '';
  for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
    if (reexports && namedExportsMode) {
      for (const specifier of reexports) {
        if (specifier.reexported !== '*') {
          const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
          if (exportBlock)
            exportBlock += n;
          exportBlock +=
            specifier.imported !== '*' && specifier.needsLiveBinding
              ? `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` +
                `${t}enumerable:${_}true,${n}` +
                `${t}get:${_}function${_}()${_}{${n}` +
                `${t}${t}return ${importName};${n}${t}}${n}});`
              : `exports.${specifier.reexported}${_}=${_}${importName};`;
        }
      }
    }
  }
  for (const chunkExport of exports) {
    const lhs = `exports.${chunkExport.exported}`;
    const rhs = chunkExport.local;
    if (lhs !== rhs) {
      if (exportBlock)
        exportBlock += n;
      exportBlock += `${lhs}${_}=${_}${rhs};`;
    }
  }
  for (const { name, reexports } of dependencies) {
    if (reexports && namedExportsMode) {
      for (const specifier of reexports) {
        if (specifier.reexported === '*') {
          if (exportBlock)
            exportBlock += n;
          if (specifier.needsLiveBinding) {
            exportBlock +=
              `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
                `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
                `${t}${t}enumerable:${_}true,${n}` +
                `${t}${t}get:${_}function${_}()${_}{${n}` +
                `${t}${t}${t}return ${name}[k];${n}` +
                `${t}${t}}${n}${t}});${n}});`;
          }
          else {
            exportBlock +=
              `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
                `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}exports[k]${_}=${_}${name}[k];${n}});`;
          }
        }
      }
    }
  }
  if (exportBlock) {
    return `${n}${n}${exportBlock}`;
  }
  return '';
}
function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings) {
  if (exports.length > 0) {
    return exports[0].local;
  }
  else {
    for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
      if (reexports) {
        return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
      }
    }
  }
}
function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings) {
  if (imported === 'default') {
    if (!isChunk) {
      const moduleInterop = String(interop(moduleId));
      const variableName = defaultInteropHelpersByInteropType[moduleInterop]
        ? defaultVariableName
        : moduleVariableName;
      return isDefaultAProperty(moduleInterop, externalLiveBindings)
        ? `${variableName}['default']`
        : variableName;
    }
    return depNamedExportsMode ? `${moduleVariableName}['default']` : moduleVariableName;
  }
  if (imported === '*') {
    return (isChunk
      ? !depNamedExportsMode
      : namespaceInteropHelpersByInteropType[String(interop(moduleId))])
      ? namespaceVariableName
      : moduleVariableName;
  }
  return `${moduleVariableName}.${imported}`;
}
function getEsModuleExport(_) {
  return `Object.defineProperty(exports,${_}'__esModule',${_}{${_}value:${_}true${_}});`;
}
function getNamespaceToStringExport(_) {
  return `exports[Symbol.toStringTag]${_}=${_}'Module';`;
}
function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, _, n) {
  let namespaceMarkers = '';
  if (hasNamedExports) {
    if (addEsModule) {
      namespaceMarkers += getEsModuleExport(_);
    }
    if (addNamespaceToStringTag) {
      if (namespaceMarkers) {
        namespaceMarkers += n;
      }
      namespaceMarkers += getNamespaceToStringExport(_);
    }
  }
  return namespaceMarkers;
}

function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t) {
  const neededInteropHelpers = new Set();
  const interopStatements = [];
  const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => {
    neededInteropHelpers.add(helper);
    interopStatements.push(`${varOrConst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`);
  };
  for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) {
    if (isChunk) {
      for (const { imported, reexported } of [
        ...(imports || []),
        ...(reexports || [])
      ]) {
        if (imported === '*' && reexported !== '*') {
          if (!namedExportsMode) {
            addInteropStatement(namespaceVariableName, getDefaultOnlyHelper(), name);
          }
          break;
        }
      }
    }
    else {
      const moduleInterop = String(interop(id));
      let hasDefault = false;
      let hasNamespace = false;
      for (const { imported, reexported } of [
        ...(imports || []),
        ...(reexports || [])
      ]) {
        let helper;
        let variableName;
        if (imported === 'default') {
          if (!hasDefault) {
            hasDefault = true;
            if (defaultVariableName !== namespaceVariableName) {
              variableName = defaultVariableName;
              helper = defaultInteropHelpersByInteropType[moduleInterop];
            }
          }
        }
        else if (imported === '*' && reexported !== '*') {
          if (!hasNamespace) {
            hasNamespace = true;
            helper = namespaceInteropHelpersByInteropType[moduleInterop];
            variableName = namespaceVariableName;
          }
        }
        if (helper) {
          addInteropStatement(variableName, helper, name);
        }
      }
    }
  }
  return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, _, n, s, t, externalLiveBindings, freeze, namespaceToStringTag)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;
}

// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.
// The assumption is that this makes sense for all relative ids:
// https://requirejs.org/docs/api.html#jsfiles
function removeExtensionFromRelativeAmdId(id) {
  return id[0] === '.' ? removeJsExtension(id) : id;
}

const builtins = {
  assert: true,
  buffer: true,
  console: true,
  constants: true,
  domain: true,
  events: true,
  http: true,
  https: true,
  os: true,
  path: true,
  process: true,
  punycode: true,
  querystring: true,
  stream: true,
  string_decoder: true,
  timers: true,
  tty: true,
  url: true,
  util: true,
  vm: true,
  zlib: true
};
function warnOnBuiltins(warn, dependencies) {
  const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);
  if (!externalBuiltins.length)
    return;
  const detail = externalBuiltins.length === 1
    ? `module ('${externalBuiltins[0]}')`
    : `modules (${externalBuiltins
      .slice(0, -1)
      .map(name => `'${name}'`)
      .join(', ')} and '${externalBuiltins.slice(-1)}')`;
  warn({
    code: 'MISSING_NODE_BUILTINS',
    message: `Creating a browser bundle that depends on Node.js built-in ${detail}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,
    modules: externalBuiltins
  });
}

function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
  warnOnBuiltins(warn, dependencies);
  const deps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
  const args = dependencies.map(m => m.name);
  const n = compact ? '' : '\n';
  const s = compact ? '' : ';';
  const _ = compact ? '' : ' ';
  if (namedExportsMode && hasExports) {
    args.unshift(`exports`);
    deps.unshift(`'exports'`);
  }
  if (accessedGlobals.has('require')) {
    args.unshift('require');
    deps.unshift(`'require'`);
  }
  if (accessedGlobals.has('module')) {
    args.unshift('module');
    deps.unshift(`'module'`);
  }
  const completeAmdId = getCompleteAmdId(amd, id);
  const params = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
    (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);
  const useStrict = strict ? `${_}'use strict';` : '';
  magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
  const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
  if (namespaceMarkers) {
    namespaceMarkers = n + n + namespaceMarkers;
  }
  magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  return magicString
    .indent(t)
    .prepend(`${amd.define}(${params}function${_}(${args.join(`,${_}`)})${_}{${useStrict}${n}${n}`)
    .append(`${n}${n}});`);
}

function cjs(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst }, { compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
  const n = compact ? '' : '\n';
  const s = compact ? '' : ';';
  const _ = compact ? '' : ' ';
  const useStrict = strict ? `'use strict';${n}${n}` : '';
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
  if (namespaceMarkers) {
    namespaceMarkers += n + n;
  }
  const importBlock = getImportBlock$1(dependencies, compact, varOrConst, n, _);
  const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
  magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
  const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, `module.exports${_}=${_}`);
  return magicString.append(`${exportBlock}${outro}`);
}
function getImportBlock$1(dependencies, compact, varOrConst, n, _) {
  let importBlock = '';
  let definingVariable = false;
  for (const { id, name, reexports, imports } of dependencies) {
    if (!reexports && !imports) {
      if (importBlock) {
        importBlock += !compact || definingVariable ? `;${n}` : ',';
      }
      definingVariable = false;
      importBlock += `require('${id}')`;
    }
    else {
      importBlock +=
        compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${varOrConst} `;
      definingVariable = true;
      importBlock += `${name}${_}=${_}require('${id}')`;
    }
  }
  if (importBlock) {
    return `${importBlock};${n}${n}`;
  }
  return '';
}

function es(magicString, { intro, outro, dependencies, exports, varOrConst }, { compact }) {
  const _ = compact ? '' : ' ';
  const n = compact ? '' : '\n';
  const importBlock = getImportBlock(dependencies, _);
  if (importBlock.length > 0)
    intro += importBlock.join(n) + n + n;
  if (intro)
    magicString.prepend(intro);
  const exportBlock = getExportBlock(exports, _, varOrConst);
  if (exportBlock.length)
    magicString.append(n + n + exportBlock.join(n).trim());
  if (outro)
    magicString.append(outro);
  return magicString.trim();
}
function getImportBlock(dependencies, _) {
  const importBlock = [];
  for (const { id, reexports, imports, name } of dependencies) {
    if (!reexports && !imports) {
      importBlock.push(`import${_}'${id}';`);
      continue;
    }
    if (imports) {
      let defaultImport = null;
      let starImport = null;
      const importedNames = [];
      for (const specifier of imports) {
        if (specifier.imported === 'default') {
          defaultImport = specifier;
        }
        else if (specifier.imported === '*') {
          starImport = specifier;
        }
        else {
          importedNames.push(specifier);
        }
      }
      if (starImport) {
        importBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`);
      }
      if (defaultImport && importedNames.length === 0) {
        importBlock.push(`import ${defaultImport.local} from${_}'${id}';`);
      }
      else if (importedNames.length > 0) {
        importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
          .map(specifier => {
          if (specifier.imported === specifier.local) {
            return specifier.imported;
          }
          else {
            return `${specifier.imported} as ${specifier.local}`;
          }
        })
          .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
      }
    }
    if (reexports) {
      let starExport = null;
      const namespaceReexports = [];
      const namedReexports = [];
      for (const specifier of reexports) {
        if (specifier.reexported === '*') {
          starExport = specifier;
        }
        else if (specifier.imported === '*') {
          namespaceReexports.push(specifier);
        }
        else {
          namedReexports.push(specifier);
        }
      }
      if (starExport) {
        importBlock.push(`export${_}*${_}from${_}'${id}';`);
      }
      if (namespaceReexports.length > 0) {
        if (!imports ||
          !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) {
          importBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`);
        }
        for (const specifier of namespaceReexports) {
          importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
        }
      }
      if (namedReexports.length > 0) {
        importBlock.push(`export${_}{${_}${namedReexports
          .map(specifier => {
          if (specifier.imported === specifier.reexported) {
            return specifier.imported;
          }
          else {
            return `${specifier.imported} as ${specifier.reexported}`;
          }
        })
          .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
      }
    }
  }
  return importBlock;
}
function getExportBlock(exports, _, varOrConst) {
  const exportBlock = [];
  const exportDeclaration = [];
  for (const specifier of exports) {
    if (specifier.exported === 'default') {
      exportBlock.push(`export default ${specifier.local};`);
    }
    else {
      if (specifier.expression) {
        exportBlock.push(`${varOrConst} ${specifier.local}${_}=${_}${specifier.expression};`);
      }
      exportDeclaration.push(specifier.exported === specifier.local
        ? specifier.local
        : `${specifier.local} as ${specifier.exported}`);
    }
  }
  if (exportDeclaration.length) {
    exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
  }
  return exportBlock;
}

function spaces(i) {
  let result = '';
  while (i--)
    result += ' ';
  return result;
}
function tabsToSpaces(str) {
  return str.replace(/^\t+/, match => match.split('\t').join('  '));
}
function getCodeFrame(source, line, column) {
  let lines = source.split('\n');
  const frameStart = Math.max(0, line - 3);
  let frameEnd = Math.min(line + 2, lines.length);
  lines = lines.slice(frameStart, frameEnd);
  while (!/\S/.test(lines[lines.length - 1])) {
    lines.pop();
    frameEnd -= 1;
  }
  const digits = String(frameEnd).length;
  return lines
    .map((str, i) => {
    const isErrorLine = frameStart + i + 1 === line;
    let lineNum = String(i + frameStart + 1);
    while (lineNum.length < digits)
      lineNum = ` ${lineNum}`;
    if (isErrorLine) {
      const indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^';
      return `${lineNum}: ${tabsToSpaces(str)}\n${indicator}`;
    }
    return `${lineNum}: ${tabsToSpaces(str)}`;
  })
    .join('\n');
}

function sanitizeFileName(name) {
  const match = /^[a-z]:/i.exec(name);
  const driveLetter = match ? match[0] : "";
  // A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
  // Otherwise, avoid them because they can refer to NTFS alternate data streams.
  return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
}

function getAliasName(id) {
  const base = basename(id);
  return base.substr(0, base.length - extname$1(id).length);
}
function relativeId(id) {
  if (!isAbsolute(id))
    return id;
  return relative$1(resolve$3(), id);
}
function isPlainPathFragment(name) {
  // not starting with "/", "./", "../"
  return (name[0] !== '/' &&
    !(name[0] === '.' && (name[1] === '/' || name[1] === '.')) &&
    sanitizeFileName(name) === name &&
    !isAbsolute(name));
}

function error(base) {
  if (!(base instanceof Error))
    base = Object.assign(new Error(base.message), base);
  throw base;
}
function augmentCodeLocation(props, pos, source, id) {
  if (typeof pos === 'object') {
    const { line, column } = pos;
    props.loc = { file: id, line, column };
  }
  else {
    props.pos = pos;
    const { line, column } = locate(source, pos, { offsetLine: 1 });
    props.loc = { file: id, line, column };
  }
  if (props.frame === undefined) {
    const { line, column } = props.loc;
    props.frame = getCodeFrame(source, line, column);
  }
}
var Errors;
(function (Errors) {
  Errors["ALREADY_CLOSED"] = "ALREADY_CLOSED";
  Errors["ASSET_NOT_FINALISED"] = "ASSET_NOT_FINALISED";
  Errors["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND";
  Errors["ASSET_SOURCE_ALREADY_SET"] = "ASSET_SOURCE_ALREADY_SET";
  Errors["ASSET_SOURCE_MISSING"] = "ASSET_SOURCE_MISSING";
  Errors["BAD_LOADER"] = "BAD_LOADER";
  Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK";
  Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED";
  Errors["CHUNK_INVALID"] = "CHUNK_INVALID";
  Errors["CIRCULAR_REEXPORT"] = "CIRCULAR_REEXPORT";
  Errors["CYCLIC_CROSS_CHUNK_REEXPORT"] = "CYCLIC_CROSS_CHUNK_REEXPORT";
  Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE";
  Errors["EXTERNAL_SYNTHETIC_EXPORTS"] = "EXTERNAL_SYNTHETIC_EXPORTS";
  Errors["FILE_NAME_CONFLICT"] = "FILE_NAME_CONFLICT";
  Errors["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
  Errors["INPUT_HOOK_IN_OUTPUT_PLUGIN"] = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
  Errors["INVALID_CHUNK"] = "INVALID_CHUNK";
  Errors["INVALID_EXPORT_OPTION"] = "INVALID_EXPORT_OPTION";
  Errors["INVALID_EXTERNAL_ID"] = "INVALID_EXTERNAL_ID";
  Errors["INVALID_OPTION"] = "INVALID_OPTION";
  Errors["INVALID_PLUGIN_HOOK"] = "INVALID_PLUGIN_HOOK";
  Errors["INVALID_ROLLUP_PHASE"] = "INVALID_ROLLUP_PHASE";
  Errors["MISSING_EXPORT"] = "MISSING_EXPORT";
  Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT";
  Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS";
  Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT";
  Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE";
  Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR";
  Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS";
  Errors["SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT"] = "SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT";
  Errors["UNEXPECTED_NAMED_IMPORT"] = "UNEXPECTED_NAMED_IMPORT";
  Errors["UNRESOLVED_ENTRY"] = "UNRESOLVED_ENTRY";
  Errors["UNRESOLVED_IMPORT"] = "UNRESOLVED_IMPORT";
  Errors["VALIDATION_ERROR"] = "VALIDATION_ERROR";
})(Errors || (Errors = {}));
function errAssetNotFinalisedForFileName(name) {
  return {
    code: Errors.ASSET_NOT_FINALISED,
    message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first.`
  };
}
function errCannotEmitFromOptionsHook() {
  return {
    code: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK,
    message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
  };
}
function errChunkNotGeneratedForFileName(name) {
  return {
    code: Errors.CHUNK_NOT_GENERATED,
    message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.`
  };
}
function errChunkInvalid({ fileName, code }, exception) {
  const errorProps = {
    code: Errors.CHUNK_INVALID,
    message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.`
  };
  augmentCodeLocation(errorProps, exception.loc, code, fileName);
  return errorProps;
}
function errCircularReexport(exportName, importedModule) {
  return {
    code: Errors.CIRCULAR_REEXPORT,
    id: importedModule,
    message: `"${exportName}" cannot be exported from ${relativeId(importedModule)} as it is a reexport that references itself.`
  };
}
function errCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) {
  return {
    code: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,
    exporter,
    importer,
    message: `Export "${exportName}" of module ${relativeId(exporter)} was reexported through module ${relativeId(reexporter)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${relativeId(importer)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
    reexporter
  };
}
function errAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
  return {
    code: Errors.ASSET_NOT_FOUND,
    message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
  };
}
function errAssetSourceAlreadySet(name) {
  return {
    code: Errors.ASSET_SOURCE_ALREADY_SET,
    message: `Unable to set the source for asset "${name}", source already set.`
  };
}
function errNoAssetSourceSet(assetName) {
  return {
    code: Errors.ASSET_SOURCE_MISSING,
    message: `Plugin error creating asset "${assetName}" - no asset source set.`
  };
}
function errBadLoader(id) {
  return {
    code: Errors.BAD_LOADER,
    message: `Error loading ${relativeId(id)}: plugin load hook should return a string, a { code, map } object, or nothing/null`
  };
}
function errDeprecation(deprecation) {
  return {
    code: Errors.DEPRECATED_FEATURE,
    ...(typeof deprecation === 'string' ? { message: deprecation } : deprecation)
  };
}
function errFileReferenceIdNotFoundForFilename(assetReferenceId) {
  return {
    code: Errors.FILE_NOT_FOUND,
    message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
  };
}
function errFileNameConflict(fileName) {
  return {
    code: Errors.FILE_NAME_CONFLICT,
    message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
  };
}
function errInputHookInOutputPlugin(pluginName, hookName) {
  return {
    code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,
    message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
  };
}
function errCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
  return {
    code: Errors.INVALID_CHUNK,
    message: `Cannot assign ${relativeId(moduleId)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
  };
}
function errInvalidExportOptionValue(optionValue) {
  return {
    code: Errors.INVALID_EXPORT_OPTION,
    message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}"`,
    url: `https://rollupjs.org/guide/en/#outputexports`
  };
}
function errIncompatibleExportOptionValue(optionValue, keys, entryModule) {
  return {
    code: 'INVALID_EXPORT_OPTION',
    message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${keys.join(', ')}`
  };
}
function errInternalIdCannotBeExternal(source, importer) {
  return {
    code: Errors.INVALID_EXTERNAL_ID,
    message: `'${source}' is imported as an external by ${relativeId(importer)}, but is already an existing non-external module id.`
  };
}
function errInvalidOption(option, explanation) {
  return {
    code: Errors.INVALID_OPTION,
    message: `Invalid value for option "${option}" - ${explanation}.`
  };
}
function errInvalidRollupPhaseForAddWatchFile() {
  return {
    code: Errors.INVALID_ROLLUP_PHASE,
    message: `Cannot call addWatchFile after the build has finished.`
  };
}
function errInvalidRollupPhaseForChunkEmission() {
  return {
    code: Errors.INVALID_ROLLUP_PHASE,
    message: `Cannot emit chunks after module loading has finished.`
  };
}
function errMissingExport(exportName, importingModule, importedModule) {
  return {
    code: Errors.MISSING_EXPORT,
    message: `'${exportName}' is not exported by ${relativeId(importedModule)}, imported by ${relativeId(importingModule)}`,
    url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
  };
}
function errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
  return {
    code: Errors.MISSING_IMPLICIT_DEPENDANT,
    message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
  };
}
function errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
  return {
    code: Errors.MISSING_IMPLICIT_DEPENDANT,
    message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
  };
}
function errImplicitDependantIsNotIncluded(module) {
  const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort();
  return {
    code: Errors.MISSING_IMPLICIT_DEPENDANT,
    message: `Module "${relativeId(module.id)}" that should be implicitly loaded before "${implicitDependencies.length === 1
      ? implicitDependencies[0]
      : `${implicitDependencies.slice(0, -1).join('", "')}" and "${implicitDependencies.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
  };
}
function errMixedExport(facadeModuleId, name) {
  return {
    code: Errors.MIXED_EXPORTS,
    id: facadeModuleId,
    message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,
    url: `https://rollupjs.org/guide/en/#outputexports`
  };
}
function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) {
  return {
    code: Errors.NAMESPACE_CONFLICT,
    message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports '${name}' from both ${relativeId(reexportingModule.exportsAll[name])} and ${relativeId(additionalExportAllModule.exportsAll[name])} (will be ignored)`,
    name,
    reexporter: reexportingModule.id,
    sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]]
  };
}
function errNoTransformMapOrAstWithoutCode(pluginName) {
  return {
    code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
    message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
      'a "code". This will be ignored.'
  };
}
function errPreferNamedExports(facadeModuleId) {
  const file = relativeId(facadeModuleId);
  return {
    code: Errors.PREFER_NAMED_EXPORTS,
    id: facadeModuleId,
    message: `Entry module "${file}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${file}" to use named exports only.`,
    url: `https://rollupjs.org/guide/en/#outputexports`
  };
}
function errSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
  return {
    code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
    id,
    message: `Module "${relativeId(id)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}' needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
      ? `an export named "${syntheticNamedExportsOption}"`
      : 'a default export'} that does not reexport an unresolved named export of the same module.`
  };
}
function errUnexpectedNamedImport(id, imported, isReexport) {
  const importType = isReexport ? 'reexport' : 'import';
  return {
    code: Errors.UNEXPECTED_NAMED_IMPORT,
    id,
    message: `The named export "${imported}" was ${importType}ed from the external module ${relativeId(id)} even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
    url: 'https://rollupjs.org/guide/en/#outputinterop'
  };
}
function errUnexpectedNamespaceReexport(id) {
  return {
    code: Errors.UNEXPECTED_NAMED_IMPORT,
    id,
    message: `There was a namespace "*" reexport from the external module ${relativeId(id)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
    url: 'https://rollupjs.org/guide/en/#outputinterop'
  };
}
function errEntryCannotBeExternal(unresolvedId) {
  return {
    code: Errors.UNRESOLVED_ENTRY,
    message: `Entry module cannot be external (${relativeId(unresolvedId)}).`
  };
}
function errUnresolvedEntry(unresolvedId) {
  return {
    code: Errors.UNRESOLVED_ENTRY,
    message: `Could not resolve entry module (${relativeId(unresolvedId)}).`
  };
}
function errUnresolvedImport(source, importer) {
  return {
    code: Errors.UNRESOLVED_IMPORT,
    message: `Could not resolve '${source}' from ${relativeId(importer)}`
  };
}
function errUnresolvedImportTreatedAsExternal(source, importer) {
  return {
    code: Errors.UNRESOLVED_IMPORT,
    importer: relativeId(importer),
    message: `'${source}' is imported by ${relativeId(importer)}, but could not be resolved – treating it as an external dependency`,
    source,
    url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'
  };
}
function errExternalSyntheticExports(source, importer) {
  return {
    code: Errors.EXTERNAL_SYNTHETIC_EXPORTS,
    importer: relativeId(importer),
    message: `External '${source}' can not have 'syntheticNamedExports' enabled.`,
    source
  };
}
function errFailedValidation(message) {
  return {
    code: Errors.VALIDATION_ERROR,
    message
  };
}
function errAlreadyClosed() {
  return {
    code: Errors.ALREADY_CLOSED,
    message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
  };
}
function warnDeprecation(deprecation, activeDeprecation, options) {
  warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
}
function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
  if (activeDeprecation || strictDeprecations) {
    const warning = errDeprecation(deprecation);
    if (strictDeprecations) {
      return error(warning);
    }
    warn(warning);
  }
}

// Generate strings which dereference dotted properties, but use array notation `['prop-deref']`
// if the property name isn't trivial
const shouldUseDot = /^[a-zA-Z$_][a-zA-Z0-9$_]*$/;
function property(prop) {
  return shouldUseDot.test(prop) ? `.${prop}` : `['${prop}']`;
}
function keypath(keypath) {
  return keypath
    .split('.')
    .map(property)
    .join('');
}

function setupNamespace(name, root, globals, compact) {
  const _ = compact ? '' : ' ';
  const parts = name.split('.');
  parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
  parts.pop();
  let acc = root;
  return (parts
    .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}${compact ? '' : ';'}`))
    .join(compact ? ',' : '\n') + (compact && parts.length ? ';' : '\n'));
}
function assignToDeepVariable(deepName, root, globals, compact, assignment) {
  const _ = compact ? '' : ' ';
  const parts = deepName.split('.');
  parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
  const last = parts.pop();
  let acc = root;
  let deepAssignment = parts
    .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}`))
    .concat(`${acc}${property(last)}`)
    .join(`,${_}`)
    .concat(`${_}=${_}${assignment}`);
  if (parts.length > 0) {
    deepAssignment = `(${deepAssignment})`;
  }
  return deepAssignment;
}

function trimEmptyImports(dependencies) {
  let i = dependencies.length;
  while (i--) {
    const { imports, reexports } = dependencies[i];
    if (imports || reexports) {
      return dependencies.slice(0, i + 1);
    }
  }
  return [];
}

const thisProp = (name) => `this${keypath(name)}`;
function iife(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }) {
  const _ = compact ? '' : ' ';
  const s = compact ? '' : ';';
  const n = compact ? '' : '\n';
  const isNamespaced = name && name.indexOf('.') !== -1;
  const useVariableAssignment = !extend && !isNamespaced;
  if (name && useVariableAssignment && !isLegal(name)) {
    return error({
      code: 'ILLEGAL_IDENTIFIER_AS_NAME',
      message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`
    });
  }
  warnOnBuiltins(warn, dependencies);
  const external = trimEmptyImports(dependencies);
  const deps = external.map(dep => dep.globalName || 'null');
  const args = external.map(m => m.name);
  if (hasExports && !name) {
    warn({
      code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
      message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`
    });
  }
  if (namedExportsMode && hasExports) {
    if (extend) {
      deps.unshift(`${thisProp(name)}${_}=${_}${thisProp(name)}${_}||${_}{}`);
      args.unshift('exports');
    }
    else {
      deps.unshift('{}');
      args.unshift('exports');
    }
  }
  const useStrict = strict ? `${t}'use strict';${n}` : '';
  const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
  magicString.prepend(`${intro}${interopBlock}`);
  let wrapperIntro = `(function${_}(${args.join(`,${_}`)})${_}{${n}${useStrict}${n}`;
  if (hasExports) {
    if (name && !(extend && namedExportsMode)) {
      wrapperIntro =
        (useVariableAssignment ? `${varOrConst} ${name}` : thisProp(name)) +
          `${_}=${_}${wrapperIntro}`;
    }
    if (isNamespaced) {
      wrapperIntro = setupNamespace(name, 'this', globals, compact) + wrapperIntro;
    }
  }
  let wrapperOutro = `${n}${n}}(${deps.join(`,${_}`)}));`;
  if (hasExports && !extend && namedExportsMode) {
    wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
  }
  const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
  if (namespaceMarkers) {
    namespaceMarkers = n + n + namespaceMarkers;
  }
  magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  return magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro);
}

function getStarExcludes({ dependencies, exports }) {
  const starExcludes = new Set(exports.map(expt => expt.exported));
  if (!starExcludes.has('default'))
    starExcludes.add('default');
  // also include reexport names
  for (const { reexports } of dependencies) {
    if (reexports) {
      for (const reexport of reexports) {
        if (reexport.imported !== '*' && !starExcludes.has(reexport.reexported))
          starExcludes.add(reexport.reexported);
      }
    }
  }
  return starExcludes;
}
const getStarExcludesBlock = (starExcludes, varOrConst, _, t, n) => starExcludes
  ? `${n}${t}${varOrConst} _starExcludes${_}=${_}{${_}${[...starExcludes]
    .map(prop => `${prop}:${_}1`)
    .join(`,${_}`)}${_}};`
  : '';
const getImportBindingsBlock = (importBindings, _, t, n) => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
function getExportsBlock(exports, _, t, n) {
  if (exports.length === 0) {
    return '';
  }
  if (exports.length === 1) {
    return `${t}${t}${t}exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;
  }
  return (`${t}${t}${t}exports({${n}` +
    exports.map(({ name, value }) => `${t}${t}${t}${t}${name}:${_}${value}`).join(`,${n}`) +
    `${n}${t}${t}${t}});${n}${n}`);
}
const getHoistedExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  .filter(expt => expt.hoisted || expt.uninitialized)
  .map(expt => ({ name: expt.exported, value: expt.uninitialized ? 'void 0' : expt.local })), _, t, n);
const getMissingExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)
  .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), _, t, n);
const getSyntheticExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  .filter(expt => expt.expression)
  .map(expt => ({ name: expt.exported, value: expt.local })), _, t, n);
function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, outro, usesTopLevelAwait, varOrConst }, options) {
  const n = options.compact ? '' : '\n';
  const _ = options.compact ? '' : ' ';
  const dependencyIds = dependencies.map(m => `'${m.id}'`);
  const importBindings = [];
  let starExcludes;
  const setters = [];
  for (const { imports, reexports } of dependencies) {
    const setter = [];
    if (imports) {
      for (const specifier of imports) {
        importBindings.push(specifier.local);
        if (specifier.imported === '*') {
          setter.push(`${specifier.local}${_}=${_}module;`);
        }
        else {
          setter.push(`${specifier.local}${_}=${_}module.${specifier.imported};`);
        }
      }
    }
    if (reexports) {
      let createdSetter = false;
      // bulk-reexport form
      if (reexports.length > 1 ||
        (reexports.length === 1 &&
          (reexports[0].reexported === '*' || reexports[0].imported === '*'))) {
        // star reexports
        for (const specifier of reexports) {
          if (specifier.reexported !== '*')
            continue;
          // need own exports list for deduping in star export case
          if (!starExcludes) {
            starExcludes = getStarExcludes({ dependencies, exports });
          }
          if (!createdSetter) {
            setter.push(`${varOrConst} _setter${_}=${_}{};`);
            createdSetter = true;
          }
          setter.push(`for${_}(var _$p${_}in${_}module)${_}{`);
          setter.push(`${t}if${_}(!_starExcludes[_$p])${_}_setter[_$p]${_}=${_}module[_$p];`);
          setter.push('}');
        }
        // star import reexport
        for (const specifier of reexports) {
          if (specifier.imported !== '*' || specifier.reexported === '*')
            continue;
          setter.push(`exports('${specifier.reexported}',${_}module);`);
        }
        // reexports
        for (const specifier of reexports) {
          if (specifier.reexported === '*' || specifier.imported === '*')
            continue;
          if (!createdSetter) {
            setter.push(`${varOrConst} _setter${_}=${_}{};`);
            createdSetter = true;
          }
          setter.push(`_setter.${specifier.reexported}${_}=${_}module.${specifier.imported};`);
        }
        if (createdSetter) {
          setter.push('exports(_setter);');
        }
      }
      else {
        // single reexport
        for (const specifier of reexports) {
          setter.push(`exports('${specifier.reexported}',${_}module.${specifier.imported});`);
        }
      }
    }
    setters.push(setter.join(`${n}${t}${t}${t}`));
  }
  const registeredName = options.name ? `'${options.name}',${_}` : '';
  const wrapperParams = accessedGlobals.has('module')
    ? `exports,${_}module`
    : hasExports
      ? 'exports'
      : '';
  let wrapperStart = `System.register(${registeredName}[` +
    dependencyIds.join(`,${_}`) +
    `],${_}function${_}(${wrapperParams})${_}{${n}${t}${options.strict ? "'use strict';" : ''}` +
    getStarExcludesBlock(starExcludes, varOrConst, _, t, n) +
    getImportBindingsBlock(importBindings, _, t, n) +
    `${n}${t}return${_}{${setters.length
      ? `${n}${t}${t}setters:${_}[${setters
        .map(s => s
        ? `function${_}(module)${_}{${n}${t}${t}${t}${s}${n}${t}${t}}`
        : options.systemNullSetters
          ? `null`
          : `function${_}()${_}{}`)
        .join(`,${_}`)}],`
      : ''}${n}`;
  wrapperStart +=
    `${t}${t}execute:${_}${usesTopLevelAwait ? `async${_}` : ''}function${_}()${_}{${n}${n}` +
      getHoistedExportsBlock(exports, _, t, n);
  const wrapperEnd = `${n}${n}` +
    getSyntheticExportsBlock(exports, _, t, n) +
    getMissingExportsBlock(exports, _, t, n) +
    `${t}${t}}${n}${t}}${options.compact ? '' : ';'}${n}});`;
  if (intro)
    magicString.prepend(intro);
  if (outro)
    magicString.append(outro);
  return magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart);
}

function globalProp(name, globalVar) {
  if (!name)
    return 'null';
  return `${globalVar}${keypath(name)}`;
}
function safeAccess(name, globalVar, _) {
  const parts = name.split('.');
  let acc = globalVar;
  return parts.map(part => (acc += property(part))).join(`${_}&&${_}`);
}
function umd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, namespaceToStringTag, globals, noConflict, strict }) {
  const _ = compact ? '' : ' ';
  const n = compact ? '' : '\n';
  const s = compact ? '' : ';';
  const factoryVar = compact ? 'f' : 'factory';
  const globalVar = compact ? 'g' : 'global';
  if (hasExports && !name) {
    return error({
      code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
      message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'
    });
  }
  warnOnBuiltins(warn, dependencies);
  const amdDeps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
  const cjsDeps = dependencies.map(m => `require('${m.id}')`);
  const trimmedImports = trimEmptyImports(dependencies);
  const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar));
  const factoryArgs = trimmedImports.map(m => m.name);
  if (namedExportsMode && (hasExports || noConflict)) {
    amdDeps.unshift(`'exports'`);
    cjsDeps.unshift(`exports`);
    globalDeps.unshift(assignToDeepVariable(name, globalVar, globals, compact, `${extend ? `${globalProp(name, globalVar)}${_}||${_}` : ''}{}`));
    factoryArgs.unshift('exports');
  }
  const completeAmdId = getCompleteAmdId(amd, id);
  const amdParams = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
    (amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``);
  const define = amd.define;
  const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``;
  const useStrict = strict ? `${_}'use strict';${n}` : ``;
  let iifeExport;
  if (noConflict) {
    const noConflictExportsVar = compact ? 'e' : 'exports';
    let factory;
    if (!namedExportsMode && hasExports) {
      factory = `var ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(name, globalVar, globals, compact, `${factoryVar}(${globalDeps.join(`,${_}`)})`)};`;
    }
    else {
      const module = globalDeps.shift();
      factory =
        `var ${noConflictExportsVar}${_}=${_}${module};${n}` +
          `${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`;
    }
    iifeExport =
      `(function${_}()${_}{${n}` +
        `${t}${t}var current${_}=${_}${safeAccess(name, globalVar, _)};${n}` +
        `${t}${t}${factory}${n}` +
        `${t}${t}${noConflictExportsVar}.noConflict${_}=${_}function${_}()${_}{${_}` +
        `${globalProp(name, globalVar)}${_}=${_}current;${_}return ${noConflictExportsVar}${compact ? '' : '; '}};${n}` +
        `${t}}())`;
  }
  else {
    iifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`;
    if (!namedExportsMode && hasExports) {
      iifeExport = assignToDeepVariable(name, globalVar, globals, compact, iifeExport);
    }
  }
  const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0;
  const globalParam = iifeNeedsGlobal ? `${globalVar},${_}` : '';
  const globalArg = iifeNeedsGlobal ? `this,${_}` : '';
  const iifeStart = iifeNeedsGlobal
    ? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}`
    : '';
  const iifeEnd = iifeNeedsGlobal ? ')' : '';
  const cjsIntro = iifeNeedsGlobal
    ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` +
      `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}`
    : '';
  // factory function should be wrapped by parentheses to avoid lazy parsing
  const wrapperIntro = `(function${_}(${globalParam}${factoryVar})${_}{${n}` +
    cjsIntro +
    `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` +
    `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` +
    `}(${globalArg}(function${_}(${factoryArgs.join(', ')})${_}{${useStrict}${n}`;
  const wrapperOutro = n + n + '})));';
  magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
  const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
  if (namespaceMarkers) {
    namespaceMarkers = n + n + namespaceMarkers;
  }
  magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);
}

var finalisers = { system, amd, cjs, es, iife, umd };

const extractors = {
  ArrayPattern(names, param) {
    for (const element of param.elements) {
      if (element)
        extractors[element.type](names, element);
    }
  },
  AssignmentPattern(names, param) {
    extractors[param.left.type](names, param.left);
  },
  Identifier(names, param) {
    names.push(param.name);
  },
  MemberExpression() { },
  ObjectPattern(names, param) {
    for (const prop of param.properties) {
      if (prop.type === 'RestElement') {
        extractors.RestElement(names, prop);
      }
      else {
        extractors[prop.value.type](names, prop.value);
      }
    }
  },
  RestElement(names, param) {
    extractors[param.argument.type](names, param.argument);
  }
};
const extractAssignedNames = function extractAssignedNames(param) {
  const names = [];
  extractors[param.type](names, param);
  return names;
};

class ExportAllDeclaration extends NodeBase {
  hasEffects() {
    return false;
  }
  initialise() {
    this.context.addExport(this);
  }
  render(code, _options, nodeRenderOptions) {
    code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
  }
}
ExportAllDeclaration.prototype.needsBoundaries = true;

class ArrayExpression extends NodeBase {
  bind() {
    super.bind();
    for (const element of this.elements) {
      if (element !== null)
        element.deoptimizePath(UNKNOWN_PATH);
    }
  }
  getReturnExpressionWhenCalledAtPath(path) {
    if (path.length !== 1)
      return UNKNOWN_EXPRESSION;
    return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length === 1) {
      return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
    }
    return true;
  }
}

class ArrayPattern extends NodeBase {
  addExportedVariables(variables, exportNamesByVariable) {
    for (const element of this.elements) {
      if (element !== null) {
        element.addExportedVariables(variables, exportNamesByVariable);
      }
    }
  }
  declare(kind) {
    const variables = [];
    for (const element of this.elements) {
      if (element !== null) {
        variables.push(...element.declare(kind, UNKNOWN_EXPRESSION));
      }
    }
    return variables;
  }
  deoptimizePath(path) {
    if (path.length === 0) {
      for (const element of this.elements) {
        if (element !== null) {
          element.deoptimizePath(path);
        }
      }
    }
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (path.length > 0)
      return true;
    for (const element of this.elements) {
      if (element !== null && element.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
        return true;
    }
    return false;
  }
}

class BlockScope extends ChildScope {
  addDeclaration(identifier, context, init, isHoisted) {
    if (isHoisted) {
      return this.parent.addDeclaration(identifier, context, UNKNOWN_EXPRESSION, isHoisted);
    }
    else {
      return super.addDeclaration(identifier, context, init, false);
    }
  }
}

class ExpressionStatement extends NodeBase {
  initialise() {
    if (this.directive &&
      this.directive !== 'use strict' &&
      this.parent.type === Program$1) {
      this.context.warn(
      // This is necessary, because either way (deleting or not) can lead to errors.
      {
        code: 'MODULE_LEVEL_DIRECTIVE',
        message: `Module level directives cause errors when bundled, '${this.directive}' was ignored.`
      }, this.start);
    }
  }
  render(code, options) {
    super.render(code, options);
    if (this.included)
      this.insertSemicolon(code);
  }
  shouldBeIncluded(context) {
    if (this.directive && this.directive !== 'use strict')
      return this.parent.type !== Program$1;
    return super.shouldBeIncluded(context);
  }
}

class BlockStatement extends NodeBase {
  constructor() {
    super(...arguments);
    this.directlyIncluded = false;
  }
  addImplicitReturnExpressionToScope() {
    const lastStatement = this.body[this.body.length - 1];
    if (!lastStatement || lastStatement.type !== ReturnStatement$1) {
      this.scope.addReturnExpression(UNKNOWN_EXPRESSION);
    }
  }
  createScope(parentScope) {
    this.scope = this.parent.preventChildBlockScope
      ? parentScope
      : new BlockScope(parentScope);
  }
  hasEffects(context) {
    if (this.deoptimizeBody)
      return true;
    for (const node of this.body) {
      if (node.hasEffects(context))
        return true;
      if (context.brokenFlow)
        break;
    }
    return false;
  }
  include(context, includeChildrenRecursively) {
    if (!this.deoptimizeBody || !this.directlyIncluded) {
      this.included = true;
      this.directlyIncluded = true;
      if (this.deoptimizeBody)
        includeChildrenRecursively = true;
      for (const node of this.body) {
        if (includeChildrenRecursively || node.shouldBeIncluded(context))
          node.include(context, includeChildrenRecursively);
      }
    }
  }
  initialise() {
    const firstBodyStatement = this.body[0];
    this.deoptimizeBody =
      firstBodyStatement instanceof ExpressionStatement &&
        firstBodyStatement.directive === 'use asm';
  }
  render(code, options) {
    if (this.body.length) {
      renderStatementList(this.body, code, this.start + 1, this.end - 1, options);
    }
    else {
      super.render(code, options);
    }
  }
}

class ArrowFunctionExpression extends NodeBase {
  createScope(parentScope) {
    this.scope = new ReturnValueScope(parentScope, this.context);
  }
  deoptimizePath(path) {
    // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
    // which means the return expression needs to be reassigned
    if (path.length === 1 && path[0] === UnknownKey) {
      this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
    }
  }
  getReturnExpressionWhenCalledAtPath(path) {
    return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
  }
  hasEffects() {
    return false;
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenAssignedAtPath(path) {
    return path.length > 1;
  }
  hasEffectsWhenCalledAtPath(path, _callOptions, context) {
    if (path.length > 0)
      return true;
    for (const param of this.params) {
      if (param.hasEffects(context))
        return true;
    }
    const { ignore, brokenFlow } = context;
    context.ignore = {
      breaks: false,
      continues: false,
      labels: new Set(),
      returnAwaitYield: true
    };
    if (this.body.hasEffects(context))
      return true;
    context.ignore = ignore;
    context.brokenFlow = brokenFlow;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    for (const param of this.params) {
      if (!(param instanceof Identifier)) {
        param.include(context, includeChildrenRecursively);
      }
    }
    const { brokenFlow } = context;
    context.brokenFlow = BROKEN_FLOW_NONE;
    this.body.include(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
  includeCallArguments(context, args) {
    this.scope.includeCallArguments(context, args);
  }
  initialise() {
    this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
    if (this.body instanceof BlockStatement) {
      this.body.addImplicitReturnExpressionToScope();
    }
    else {
      this.scope.addReturnExpression(this.body);
    }
  }
  parseNode(esTreeNode) {
    if (esTreeNode.body.type === BlockStatement$1) {
      this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
    }
    super.parseNode(esTreeNode);
  }
}
ArrowFunctionExpression.prototype.preventChildBlockScope = true;

class AssignmentExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.deoptimized = false;
  }
  hasEffects(context) {
    if (!this.deoptimized)
      this.applyDeoptimizations();
    return (this.right.hasEffects(context) ||
      this.left.hasEffects(context) ||
      this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    return path.length > 0 && this.right.hasEffectsWhenAccessedAtPath(path, context);
  }
  include(context, includeChildrenRecursively) {
    if (!this.deoptimized)
      this.applyDeoptimizations();
    this.included = true;
    let hasEffectsContext;
    if (includeChildrenRecursively ||
      this.operator !== '=' ||
      this.left.included ||
      ((hasEffectsContext = createHasEffectsContext()),
        this.left.hasEffects(hasEffectsContext) ||
          this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, hasEffectsContext))) {
      this.left.include(context, includeChildrenRecursively);
    }
    this.right.include(context, includeChildrenRecursively);
  }
  render(code, options, { preventASI, renderedParentType } = BLANK) {
    if (this.left.included) {
      this.left.render(code, options);
      this.right.render(code, options);
    }
    else {
      const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', this.left.end) + 1);
      code.remove(this.start, inclusionStart);
      if (preventASI) {
        removeLineBreaks(code, inclusionStart, this.right.start);
      }
      this.right.render(code, options, {
        renderedParentType: renderedParentType || this.parent.type
      });
    }
    if (options.format === 'system') {
      const exportNames = this.left.variable && options.exportNamesByVariable.get(this.left.variable);
      if (this.left.type === 'Identifier' && exportNames) {
        const _ = options.compact ? '' : ' ';
        const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
        const operation = this.operator.length > 1 ? `${exportNames[0]}${_}${this.operator.slice(0, -1)}${_}` : '';
        code.overwrite(operatorPos, findNonWhiteSpace(code.original, operatorPos + this.operator.length), `=${_}${exportNames.length === 1
          ? `exports('${exportNames[0]}',${_}`
          : getSystemExportFunctionLeft([this.left.variable], false, options)}${operation}`);
        code.appendLeft(this.right.end, ')');
      }
      else {
        const systemPatternExports = [];
        this.left.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
        if (systemPatternExports.length > 0) {
          code.prependRight(this.start, `(${getSystemExportFunctionLeft(systemPatternExports, true, options)}`);
          code.appendLeft(this.end, '))');
        }
      }
    }
  }
  applyDeoptimizations() {
    this.deoptimized = true;
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.deoptimizePath(UNKNOWN_PATH);
  }
}

class AssignmentPattern extends NodeBase {
  addExportedVariables(variables, exportNamesByVariable) {
    this.left.addExportedVariables(variables, exportNamesByVariable);
  }
  bind() {
    super.bind();
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.deoptimizePath(UNKNOWN_PATH);
  }
  declare(kind, init) {
    return this.left.declare(kind, init);
  }
  deoptimizePath(path) {
    path.length === 0 && this.left.deoptimizePath(path);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return path.length > 0 || this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
  }
  render(code, options, { isShorthandProperty } = BLANK) {
    this.left.render(code, options, { isShorthandProperty });
    this.right.render(code, options);
  }
}

class AwaitExpression extends NodeBase {
  hasEffects(context) {
    return !context.ignore.returnAwaitYield || this.argument.hasEffects(context);
  }
  include(context, includeChildrenRecursively) {
    if (!this.included) {
      this.included = true;
      checkTopLevelAwait: if (!this.context.usesTopLevelAwait) {
        let parent = this.parent;
        do {
          if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
            break checkTopLevelAwait;
        } while ((parent = parent.parent));
        this.context.usesTopLevelAwait = true;
      }
    }
    this.argument.include(context, includeChildrenRecursively);
  }
}

const binaryOperators = {
  '!=': (left, right) => left != right,
  '!==': (left, right) => left !== right,
  '%': (left, right) => left % right,
  '&': (left, right) => left & right,
  '*': (left, right) => left * right,
  // At the moment, "**" will be transpiled to Math.pow
  '**': (left, right) => left ** right,
  '+': (left, right) => left + right,
  '-': (left, right) => left - right,
  '/': (left, right) => left / right,
  '<': (left, right) => left < right,
  '<<': (left, right) => left << right,
  '<=': (left, right) => left <= right,
  '==': (left, right) => left == right,
  '===': (left, right) => left === right,
  '>': (left, right) => left > right,
  '>=': (left, right) => left >= right,
  '>>': (left, right) => left >> right,
  '>>>': (left, right) => left >>> right,
  '^': (left, right) => left ^ right,
  in: () => UnknownValue,
  instanceof: () => UnknownValue,
  '|': (left, right) => left | right
};
class BinaryExpression extends NodeBase {
  deoptimizeCache() { }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (path.length > 0)
      return UnknownValue;
    const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
    if (leftValue === UnknownValue)
      return UnknownValue;
    const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
    if (rightValue === UnknownValue)
      return UnknownValue;
    const operatorFn = binaryOperators[this.operator];
    if (!operatorFn)
      return UnknownValue;
    return operatorFn(leftValue, rightValue);
  }
  hasEffects(context) {
    // support some implicit type coercion runtime errors
    if (this.operator === '+' &&
      this.parent instanceof ExpressionStatement &&
      this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '')
      return true;
    return super.hasEffects(context);
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
}

class BreakStatement extends NodeBase {
  hasEffects(context) {
    if (this.label) {
      if (!context.ignore.labels.has(this.label.name))
        return true;
      context.includedLabels.add(this.label.name);
      context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
    }
    else {
      if (!context.ignore.breaks)
        return true;
      context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
    }
    return false;
  }
  include(context) {
    this.included = true;
    if (this.label) {
      this.label.include();
      context.includedLabels.add(this.label.name);
    }
    context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
  }
}

class Literal extends NodeBase {
  getLiteralValueAtPath(path) {
    if (path.length > 0 ||
      // unknown literals can also be null but do not start with an "n"
      (this.value === null && this.context.code.charCodeAt(this.start) !== 110) ||
      typeof this.value === 'bigint' ||
      // to support shims for regular expressions
      this.context.code.charCodeAt(this.start) === 47) {
      return UnknownValue;
    }
    return this.value;
  }
  getReturnExpressionWhenCalledAtPath(path) {
    if (path.length !== 1)
      return UNKNOWN_EXPRESSION;
    return getMemberReturnExpressionWhenCalled(this.members, path[0]);
  }
  hasEffectsWhenAccessedAtPath(path) {
    if (this.value === null) {
      return path.length > 0;
    }
    return path.length > 1;
  }
  hasEffectsWhenAssignedAtPath(path) {
    return path.length > 0;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length === 1) {
      return hasMemberEffectWhenCalled(this.members, path[0], this.included, callOptions, context);
    }
    return true;
  }
  initialise() {
    this.members = getLiteralMembersForValue(this.value);
  }
  parseNode(esTreeNode) {
    this.value = esTreeNode.value;
    this.regex = esTreeNode.regex;
    super.parseNode(esTreeNode);
  }
  render(code) {
    if (typeof this.value === 'string') {
      code.indentExclusionRanges.push([this.start + 1, this.end - 1]);
    }
  }
}

function getResolvablePropertyKey(memberExpression) {
  return memberExpression.computed
    ? getResolvableComputedPropertyKey(memberExpression.property)
    : memberExpression.property.name;
}
function getResolvableComputedPropertyKey(propertyKey) {
  if (propertyKey instanceof Literal) {
    return String(propertyKey.value);
  }
  return null;
}
function getPathIfNotComputed(memberExpression) {
  const nextPathKey = memberExpression.propertyKey;
  const object = memberExpression.object;
  if (typeof nextPathKey === 'string') {
    if (object instanceof Identifier) {
      return [
        { key: object.name, pos: object.start },
        { key: nextPathKey, pos: memberExpression.property.start }
      ];
    }
    if (object instanceof MemberExpression) {
      const parentPath = getPathIfNotComputed(object);
      return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]);
    }
  }
  return null;
}
function getStringFromPath(path) {
  let pathString = path[0].key;
  for (let index = 1; index < path.length; index++) {
    pathString += '.' + path[index].key;
  }
  return pathString;
}
class MemberExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.variable = null;
    this.bound = false;
    this.expressionsToBeDeoptimized = [];
    this.replacement = null;
    this.wasPathDeoptimizedWhileOptimized = false;
  }
  bind() {
    if (this.bound)
      return;
    this.bound = true;
    const path = getPathIfNotComputed(this);
    const baseVariable = path && this.scope.findVariable(path[0].key);
    if (baseVariable && baseVariable.isNamespace) {
      const resolvedVariable = this.resolveNamespaceVariables(baseVariable, path.slice(1));
      if (!resolvedVariable) {
        super.bind();
      }
      else if (typeof resolvedVariable === 'string') {
        this.replacement = resolvedVariable;
      }
      else {
        this.variable = resolvedVariable;
        this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable);
      }
    }
    else {
      super.bind();
      // ensure the propertyKey is set for the tree-shaking passes
      this.getPropertyKey();
    }
  }
  deoptimizeCache() {
    const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
    this.expressionsToBeDeoptimized = [];
    this.propertyKey = UnknownKey;
    if (this.wasPathDeoptimizedWhileOptimized) {
      this.object.deoptimizePath(UNKNOWN_PATH);
    }
    for (const expression of expressionsToBeDeoptimized) {
      expression.deoptimizeCache();
    }
  }
  deoptimizePath(path) {
    if (!this.bound)
      this.bind();
    if (path.length === 0)
      this.disallowNamespaceReassignment();
    if (this.variable) {
      this.variable.deoptimizePath(path);
    }
    else {
      const propertyKey = this.getPropertyKey();
      if (propertyKey === UnknownKey) {
        this.object.deoptimizePath(UNKNOWN_PATH);
      }
      else {
        this.wasPathDeoptimizedWhileOptimized = true;
        this.object.deoptimizePath([propertyKey, ...path]);
      }
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (!this.bound)
      this.bind();
    if (this.variable !== null) {
      return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
    }
    this.expressionsToBeDeoptimized.push(origin);
    return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    if (!this.bound)
      this.bind();
    if (this.variable !== null) {
      return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
    }
    this.expressionsToBeDeoptimized.push(origin);
    return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
  }
  hasEffects(context) {
    const propertyReadSideEffects = this.context.options.treeshake
      .propertyReadSideEffects;
    return (propertyReadSideEffects === 'always' ||
      this.property.hasEffects(context) ||
      this.object.hasEffects(context) ||
      (propertyReadSideEffects &&
        this.object.hasEffectsWhenAccessedAtPath([this.propertyKey], context)));
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    if (this.variable !== null) {
      return this.variable.hasEffectsWhenAccessedAtPath(path, context);
    }
    return this.object.hasEffectsWhenAccessedAtPath([this.propertyKey, ...path], context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (this.variable !== null) {
      return this.variable.hasEffectsWhenAssignedAtPath(path, context);
    }
    return this.object.hasEffectsWhenAssignedAtPath([this.propertyKey, ...path], context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (this.variable !== null) {
      return this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
    }
    return this.object.hasEffectsWhenCalledAtPath([this.propertyKey, ...path], callOptions, context);
  }
  include(context, includeChildrenRecursively) {
    if (!this.included) {
      this.included = true;
      if (this.variable !== null) {
        this.context.includeVariableInModule(this.variable);
      }
    }
    this.object.include(context, includeChildrenRecursively);
    this.property.include(context, includeChildrenRecursively);
  }
  includeCallArguments(context, args) {
    if (this.variable) {
      this.variable.includeCallArguments(context, args);
    }
    else {
      super.includeCallArguments(context, args);
    }
  }
  initialise() {
    this.propertyKey = getResolvablePropertyKey(this);
  }
  render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) {
    const isCalleeOfDifferentParent = renderedParentType === CallExpression$1 && isCalleeOfRenderedParent;
    if (this.variable || this.replacement) {
      let replacement = this.variable ? this.variable.getName() : this.replacement;
      if (isCalleeOfDifferentParent)
        replacement = '0, ' + replacement;
      code.overwrite(this.start, this.end, replacement, {
        contentOnly: true,
        storeName: true
      });
    }
    else {
      if (isCalleeOfDifferentParent) {
        code.appendRight(this.start, '0, ');
      }
      const surroundingElement = renderedParentType || renderedSurroundingElement;
      this.object.render(code, options, surroundingElement ? { renderedSurroundingElement: surroundingElement } : BLANK);
      this.property.render(code, options);
    }
  }
  disallowNamespaceReassignment() {
    if (this.object instanceof Identifier) {
      const variable = this.scope.findVariable(this.object.name);
      if (variable.isNamespace) {
        if (this.variable) {
          this.context.includeVariableInModule(this.variable);
        }
        this.context.warn({
          code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
          message: `Illegal reassignment to import '${this.object.name}'`
        }, this.start);
      }
    }
  }
  getPropertyKey() {
    if (this.propertyKey === null) {
      this.propertyKey = UnknownKey;
      const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
      return (this.propertyKey = value === UnknownValue ? UnknownKey : String(value));
    }
    return this.propertyKey;
  }
  resolveNamespaceVariables(baseVariable, path) {
    if (path.length === 0)
      return baseVariable;
    if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable)
      return null;
    const exportName = path[0].key;
    const variable = baseVariable.context.traceExport(exportName);
    if (!variable) {
      const fileName = baseVariable.context.fileName;
      this.context.warn({
        code: 'MISSING_EXPORT',
        exporter: relativeId(fileName),
        importer: relativeId(this.context.fileName),
        message: `'${exportName}' is not exported by '${relativeId(fileName)}'`,
        missing: exportName,
        url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
      }, path[0].pos);
      return 'undefined';
    }
    return this.resolveNamespaceVariables(variable, path.slice(1));
  }
}

class CallExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.expressionsToBeDeoptimized = [];
    this.returnExpression = null;
    this.wasPathDeoptmizedWhileOptimized = false;
  }
  bind() {
    super.bind();
    if (this.callee instanceof Identifier) {
      const variable = this.scope.findVariable(this.callee.name);
      if (variable.isNamespace) {
        this.context.warn({
          code: 'CANNOT_CALL_NAMESPACE',
          message: `Cannot call a namespace ('${this.callee.name}')`
        }, this.start);
      }
      if (this.callee.name === 'eval') {
        this.context.warn({
          code: 'EVAL',
          message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
          url: 'https://rollupjs.org/guide/en/#avoiding-eval'
        }, this.start);
      }
    }
    // ensure the returnExpression is set for the tree-shaking passes
    this.getReturnExpression(SHARED_RECURSION_TRACKER);
    // This deoptimizes "this" for non-namespace calls until we have a better solution
    if (this.callee instanceof MemberExpression && !this.callee.variable) {
      this.callee.object.deoptimizePath(UNKNOWN_PATH);
    }
    for (const argument of this.arguments) {
      // This will make sure all properties of parameters behave as "unknown"
      argument.deoptimizePath(UNKNOWN_PATH);
    }
  }
  deoptimizeCache() {
    if (this.returnExpression !== UNKNOWN_EXPRESSION) {
      this.returnExpression = null;
      const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
      const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
      if (returnExpression !== UNKNOWN_EXPRESSION) {
        // We need to replace here because is possible new expressions are added
        // while we are deoptimizing the old ones
        this.expressionsToBeDeoptimized = [];
        if (this.wasPathDeoptmizedWhileOptimized) {
          returnExpression.deoptimizePath(UNKNOWN_PATH);
          this.wasPathDeoptmizedWhileOptimized = false;
        }
      }
      for (const expression of expressionsToBeDeoptimized) {
        expression.deoptimizeCache();
      }
    }
  }
  deoptimizePath(path) {
    if (path.length === 0)
      return;
    const trackedEntities = this.context.deoptimizationTracker.getEntities(path);
    if (trackedEntities.has(this))
      return;
    trackedEntities.add(this);
    const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
    if (returnExpression !== UNKNOWN_EXPRESSION) {
      this.wasPathDeoptmizedWhileOptimized = true;
      returnExpression.deoptimizePath(path);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    const returnExpression = this.getReturnExpression(recursionTracker);
    if (returnExpression === UNKNOWN_EXPRESSION) {
      return UnknownValue;
    }
    const trackedEntities = recursionTracker.getEntities(path);
    if (trackedEntities.has(returnExpression)) {
      return UnknownValue;
    }
    this.expressionsToBeDeoptimized.push(origin);
    trackedEntities.add(returnExpression);
    const value = returnExpression.getLiteralValueAtPath(path, recursionTracker, origin);
    trackedEntities.delete(returnExpression);
    return value;
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    const returnExpression = this.getReturnExpression(recursionTracker);
    if (this.returnExpression === UNKNOWN_EXPRESSION) {
      return UNKNOWN_EXPRESSION;
    }
    const trackedEntities = recursionTracker.getEntities(path);
    if (trackedEntities.has(returnExpression)) {
      return UNKNOWN_EXPRESSION;
    }
    this.expressionsToBeDeoptimized.push(origin);
    trackedEntities.add(returnExpression);
    const value = returnExpression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
    trackedEntities.delete(returnExpression);
    return value;
  }
  hasEffects(context) {
    var _a;
    for (const argument of this.arguments) {
      if (argument.hasEffects(context))
        return true;
    }
    if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
      return false;
    return (this.callee.hasEffects(context) ||
      this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    const trackedExpressions = context.accessed.getEntities(path);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return this.returnExpression.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (path.length === 0)
      return true;
    const trackedExpressions = context.assigned.getEntities(path);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    const trackedExpressions = (callOptions.withNew
      ? context.instantiated
      : context.called).getEntities(path, callOptions);
    if (trackedExpressions.has(this))
      return false;
    trackedExpressions.add(this);
    return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  include(context, includeChildrenRecursively) {
    if (includeChildrenRecursively) {
      super.include(context, includeChildrenRecursively);
      if (includeChildrenRecursively === INCLUDE_PARAMETERS &&
        this.callee instanceof Identifier &&
        this.callee.variable) {
        this.callee.variable.markCalledFromTryStatement();
      }
    }
    else {
      this.included = true;
      this.callee.include(context, false);
    }
    this.callee.includeCallArguments(context, this.arguments);
    if (!this.returnExpression.included) {
      this.returnExpression.include(context, false);
    }
  }
  initialise() {
    this.callOptions = {
      args: this.arguments,
      withNew: false
    };
  }
  render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
    const surroundingELement = renderedParentType || renderedSurroundingElement;
    this.callee.render(code, options, surroundingELement ? { renderedSurroundingElement: surroundingELement } : BLANK);
    if (this.arguments.length > 0) {
      if (this.arguments[this.arguments.length - 1].included) {
        for (const arg of this.arguments) {
          arg.render(code, options);
        }
      }
      else {
        let lastIncludedIndex = this.arguments.length - 2;
        while (lastIncludedIndex >= 0 && !this.arguments[lastIncludedIndex].included) {
          lastIncludedIndex--;
        }
        if (lastIncludedIndex >= 0) {
          for (let index = 0; index <= lastIncludedIndex; index++) {
            this.arguments[index].render(code, options);
          }
          code.remove(findFirstOccurrenceOutsideComment(code.original, ',', this.arguments[lastIncludedIndex].end), this.end - 1);
        }
        else {
          code.remove(findFirstOccurrenceOutsideComment(code.original, '(', this.callee.end) + 1, this.end - 1);
        }
      }
    }
  }
  getReturnExpression(recursionTracker) {
    if (this.returnExpression === null) {
      this.returnExpression = UNKNOWN_EXPRESSION;
      return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, recursionTracker, this));
    }
    return this.returnExpression;
  }
}

class CatchScope extends ParameterScope {
  addDeclaration(identifier, context, init, isHoisted) {
    if (isHoisted) {
      return this.parent.addDeclaration(identifier, context, init, isHoisted);
    }
    else {
      return super.addDeclaration(identifier, context, init, false);
    }
  }
}

class CatchClause extends NodeBase {
  createScope(parentScope) {
    this.scope = new CatchScope(parentScope, this.context);
  }
  initialise() {
    if (this.param) {
      this.param.declare('parameter', UNKNOWN_EXPRESSION);
    }
  }
  parseNode(esTreeNode) {
    this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope);
    super.parseNode(esTreeNode);
  }
}
CatchClause.prototype.preventChildBlockScope = true;

class ChainExpression extends NodeBase {
}

class ClassBodyScope extends ChildScope {
  findLexicalBoundary() {
    return this;
  }
}

class MethodDefinition extends NodeBase {
  hasEffects(context) {
    return this.key.hasEffects(context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    return (path.length > 0 || this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
  }
}

class ClassBody extends NodeBase {
  createScope(parentScope) {
    this.scope = new ClassBodyScope(parentScope);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (path.length > 0)
      return true;
    return (this.classConstructor !== null &&
      this.classConstructor.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
  }
  initialise() {
    for (const method of this.body) {
      if (method instanceof MethodDefinition && method.kind === 'constructor') {
        this.classConstructor = method;
        return;
      }
    }
    this.classConstructor = null;
  }
}

class ClassExpression extends ClassNode {
  render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
    super.render(code, options);
    const surroundingElement = renderedParentType || renderedSurroundingElement;
    if (surroundingElement === ExpressionStatement$1) {
      code.appendRight(this.start, '(');
      code.prependLeft(this.end, ')');
    }
  }
}

class MultiExpression {
  constructor(expressions) {
    this.included = false;
    this.expressions = expressions;
  }
  deoptimizePath(path) {
    for (const expression of this.expressions) {
      expression.deoptimizePath(path);
    }
  }
  getLiteralValueAtPath() {
    return UnknownValue;
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    return new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)));
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    for (const expression of this.expressions) {
      if (expression.hasEffectsWhenAccessedAtPath(path, context))
        return true;
    }
    return false;
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    for (const expression of this.expressions) {
      if (expression.hasEffectsWhenAssignedAtPath(path, context))
        return true;
    }
    return false;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    for (const expression of this.expressions) {
      if (expression.hasEffectsWhenCalledAtPath(path, callOptions, context))
        return true;
    }
    return false;
  }
  include(context, includeChildrenRecursively) {
    // This is only relevant to include values that do not have an AST representation,
    // such as UnknownArrayExpression. Thus we only need to include them once.
    for (const expression of this.expressions) {
      if (!expression.included) {
        expression.include(context, includeChildrenRecursively);
      }
    }
  }
  includeCallArguments() { }
}

class ConditionalExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.expressionsToBeDeoptimized = [];
    this.isBranchResolutionAnalysed = false;
    this.usedBranch = null;
    this.wasPathDeoptimizedWhileOptimized = false;
  }
  bind() {
    super.bind();
    // ensure the usedBranch is set for the tree-shaking passes
    this.getUsedBranch();
  }
  deoptimizeCache() {
    if (this.usedBranch !== null) {
      const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent;
      this.usedBranch = null;
      const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
      this.expressionsToBeDeoptimized = [];
      if (this.wasPathDeoptimizedWhileOptimized) {
        unusedBranch.deoptimizePath(UNKNOWN_PATH);
      }
      for (const expression of expressionsToBeDeoptimized) {
        expression.deoptimizeCache();
      }
    }
  }
  deoptimizePath(path) {
    if (path.length > 0) {
      const usedBranch = this.getUsedBranch();
      if (usedBranch === null) {
        this.consequent.deoptimizePath(path);
        this.alternate.deoptimizePath(path);
      }
      else {
        this.wasPathDeoptimizedWhileOptimized = true;
        usedBranch.deoptimizePath(path);
      }
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    const usedBranch = this.getUsedBranch();
    if (usedBranch === null)
      return UnknownValue;
    this.expressionsToBeDeoptimized.push(origin);
    return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    const usedBranch = this.getUsedBranch();
    if (usedBranch === null)
      return new MultiExpression([
        this.consequent.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
        this.alternate.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
      ]);
    this.expressionsToBeDeoptimized.push(origin);
    return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  }
  hasEffects(context) {
    if (this.test.hasEffects(context))
      return true;
    if (this.usedBranch === null) {
      return this.consequent.hasEffects(context) || this.alternate.hasEffects(context);
    }
    return this.usedBranch.hasEffects(context);
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    if (this.usedBranch === null) {
      return (this.consequent.hasEffectsWhenAccessedAtPath(path, context) ||
        this.alternate.hasEffectsWhenAccessedAtPath(path, context));
    }
    return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (path.length === 0)
      return true;
    if (this.usedBranch === null) {
      return (this.consequent.hasEffectsWhenAssignedAtPath(path, context) ||
        this.alternate.hasEffectsWhenAssignedAtPath(path, context));
    }
    return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (this.usedBranch === null) {
      return (this.consequent.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
        this.alternate.hasEffectsWhenCalledAtPath(path, callOptions, context));
    }
    return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (includeChildrenRecursively ||
      this.test.shouldBeIncluded(context) ||
      this.usedBranch === null) {
      this.test.include(context, includeChildrenRecursively);
      this.consequent.include(context, includeChildrenRecursively);
      this.alternate.include(context, includeChildrenRecursively);
    }
    else {
      this.usedBranch.include(context, includeChildrenRecursively);
    }
  }
  includeCallArguments(context, args) {
    if (this.usedBranch === null) {
      this.consequent.includeCallArguments(context, args);
      this.alternate.includeCallArguments(context, args);
    }
    else {
      this.usedBranch.includeCallArguments(context, args);
    }
  }
  render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
    if (!this.test.included) {
      const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
      const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included
        ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)
        : colonPos) + 1);
      if (preventASI) {
        removeLineBreaks(code, inclusionStart, this.usedBranch.start);
      }
      code.remove(this.start, inclusionStart);
      if (this.consequent.included) {
        code.remove(colonPos, this.end);
      }
      removeAnnotations(this, code);
      this.usedBranch.render(code, options, {
        isCalleeOfRenderedParent: renderedParentType
          ? isCalleeOfRenderedParent
          : this.parent.callee === this,
        preventASI: true,
        renderedParentType: renderedParentType || this.parent.type
      });
    }
    else {
      super.render(code, options);
    }
  }
  getUsedBranch() {
    if (this.isBranchResolutionAnalysed) {
      return this.usedBranch;
    }
    this.isBranchResolutionAnalysed = true;
    const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
    return testValue === UnknownValue
      ? null
      : (this.usedBranch = testValue ? this.consequent : this.alternate);
  }
}

class ContinueStatement extends NodeBase {
  hasEffects(context) {
    if (this.label) {
      if (!context.ignore.labels.has(this.label.name))
        return true;
      context.includedLabels.add(this.label.name);
      context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
    }
    else {
      if (!context.ignore.continues)
        return true;
      context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
    }
    return false;
  }
  include(context) {
    this.included = true;
    if (this.label) {
      this.label.include();
      context.includedLabels.add(this.label.name);
    }
    context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
  }
}

class DoWhileStatement extends NodeBase {
  hasEffects(context) {
    if (this.test.hasEffects(context))
      return true;
    const { brokenFlow, ignore: { breaks, continues } } = context;
    context.ignore.breaks = true;
    context.ignore.continues = true;
    if (this.body.hasEffects(context))
      return true;
    context.ignore.breaks = breaks;
    context.ignore.continues = continues;
    context.brokenFlow = brokenFlow;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.test.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    this.body.includeAsSingleStatement(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
}

class EmptyStatement extends NodeBase {
  hasEffects() {
    return false;
  }
}

class ExportNamedDeclaration extends NodeBase {
  bind() {
    // Do not bind specifiers
    if (this.declaration !== null)
      this.declaration.bind();
  }
  hasEffects(context) {
    return this.declaration !== null && this.declaration.hasEffects(context);
  }
  initialise() {
    this.context.addExport(this);
  }
  render(code, options, nodeRenderOptions) {
    const { start, end } = nodeRenderOptions;
    if (this.declaration === null) {
      code.remove(start, end);
    }
    else {
      code.remove(this.start, this.declaration.start);
      this.declaration.render(code, options, { start, end });
    }
  }
}
ExportNamedDeclaration.prototype.needsBoundaries = true;

class ExportSpecifier extends NodeBase {
}

class ForInStatement extends NodeBase {
  bind() {
    this.left.bind();
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.bind();
    this.body.bind();
  }
  createScope(parentScope) {
    this.scope = new BlockScope(parentScope);
  }
  hasEffects(context) {
    if ((this.left &&
      (this.left.hasEffects(context) ||
        this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))) ||
      (this.right && this.right.hasEffects(context)))
      return true;
    const { brokenFlow, ignore: { breaks, continues } } = context;
    context.ignore.breaks = true;
    context.ignore.continues = true;
    if (this.body.hasEffects(context))
      return true;
    context.ignore.breaks = breaks;
    context.ignore.continues = continues;
    context.brokenFlow = brokenFlow;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.left.include(context, includeChildrenRecursively || true);
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    this.body.includeAsSingleStatement(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
  render(code, options) {
    this.left.render(code, options, NO_SEMICOLON);
    this.right.render(code, options, NO_SEMICOLON);
    // handle no space between "in" and the right side
    if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) {
      code.prependLeft(this.right.start, ' ');
    }
    this.body.render(code, options);
  }
}

class ForOfStatement extends NodeBase {
  bind() {
    this.left.bind();
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.bind();
    this.body.bind();
  }
  createScope(parentScope) {
    this.scope = new BlockScope(parentScope);
  }
  hasEffects() {
    // Placeholder until proper Symbol.Iterator support
    return true;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.left.include(context, includeChildrenRecursively || true);
    this.left.deoptimizePath(EMPTY_PATH);
    this.right.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    this.body.includeAsSingleStatement(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
  render(code, options) {
    this.left.render(code, options, NO_SEMICOLON);
    this.right.render(code, options, NO_SEMICOLON);
    // handle no space between "of" and the right side
    if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) {
      code.prependLeft(this.right.start, ' ');
    }
    this.body.render(code, options);
  }
}

class ForStatement extends NodeBase {
  createScope(parentScope) {
    this.scope = new BlockScope(parentScope);
  }
  hasEffects(context) {
    if ((this.init && this.init.hasEffects(context)) ||
      (this.test && this.test.hasEffects(context)) ||
      (this.update && this.update.hasEffects(context)))
      return true;
    const { brokenFlow, ignore: { breaks, continues } } = context;
    context.ignore.breaks = true;
    context.ignore.continues = true;
    if (this.body.hasEffects(context))
      return true;
    context.ignore.breaks = breaks;
    context.ignore.continues = continues;
    context.brokenFlow = brokenFlow;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (this.init)
      this.init.includeAsSingleStatement(context, includeChildrenRecursively);
    if (this.test)
      this.test.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    if (this.update)
      this.update.include(context, includeChildrenRecursively);
    this.body.includeAsSingleStatement(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
  render(code, options) {
    if (this.init)
      this.init.render(code, options, NO_SEMICOLON);
    if (this.test)
      this.test.render(code, options, NO_SEMICOLON);
    if (this.update)
      this.update.render(code, options, NO_SEMICOLON);
    this.body.render(code, options);
  }
}

class FunctionExpression extends FunctionNode {
  render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
    super.render(code, options);
    const surroundingElement = renderedParentType || renderedSurroundingElement;
    if (surroundingElement === ExpressionStatement$1) {
      code.appendRight(this.start, '(');
      code.prependLeft(this.end, ')');
    }
  }
}

class TrackingScope extends BlockScope {
  constructor() {
    super(...arguments);
    this.hoistedDeclarations = [];
  }
  addDeclaration(identifier, context, init, isHoisted) {
    this.hoistedDeclarations.push(identifier);
    return this.parent.addDeclaration(identifier, context, init, isHoisted);
  }
}

const unset = Symbol('unset');
class IfStatement extends NodeBase {
  constructor() {
    super(...arguments);
    this.testValue = unset;
  }
  deoptimizeCache() {
    this.testValue = UnknownValue;
  }
  hasEffects(context) {
    if (this.test.hasEffects(context)) {
      return true;
    }
    const testValue = this.getTestValue();
    if (testValue === UnknownValue) {
      const { brokenFlow } = context;
      if (this.consequent.hasEffects(context))
        return true;
      const consequentBrokenFlow = context.brokenFlow;
      context.brokenFlow = brokenFlow;
      if (this.alternate === null)
        return false;
      if (this.alternate.hasEffects(context))
        return true;
      context.brokenFlow =
        context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
      return false;
    }
    return testValue
      ? this.consequent.hasEffects(context)
      : this.alternate !== null && this.alternate.hasEffects(context);
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (includeChildrenRecursively) {
      this.includeRecursively(includeChildrenRecursively, context);
    }
    else {
      const testValue = this.getTestValue();
      if (testValue === UnknownValue) {
        this.includeUnknownTest(context);
      }
      else {
        this.includeKnownTest(context, testValue);
      }
    }
  }
  parseNode(esTreeNode) {
    this.consequentScope = new TrackingScope(this.scope);
    this.consequent = new (this.context.nodeConstructors[esTreeNode.consequent.type] ||
      this.context.nodeConstructors.UnknownNode)(esTreeNode.consequent, this, this.consequentScope);
    if (esTreeNode.alternate) {
      this.alternateScope = new TrackingScope(this.scope);
      this.alternate = new (this.context.nodeConstructors[esTreeNode.alternate.type] ||
        this.context.nodeConstructors.UnknownNode)(esTreeNode.alternate, this, this.alternateScope);
    }
    super.parseNode(esTreeNode);
  }
  render(code, options) {
    // Note that unknown test values are always included
    const testValue = this.getTestValue();
    const hoistedDeclarations = [];
    const includesIfElse = this.test.included;
    const noTreeshake = !this.context.options.treeshake;
    if (includesIfElse) {
      this.test.render(code, options);
    }
    else {
      removeAnnotations(this, code);
      code.remove(this.start, this.consequent.start);
    }
    if (this.consequent.included && (noTreeshake || testValue === UnknownValue || testValue)) {
      this.consequent.render(code, options);
    }
    else {
      code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : '');
      hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations);
    }
    if (this.alternate) {
      if (this.alternate.included && (noTreeshake || testValue === UnknownValue || !testValue)) {
        if (includesIfElse) {
          if (code.original.charCodeAt(this.alternate.start - 1) === 101) {
            code.prependLeft(this.alternate.start, ' ');
          }
        }
        else {
          code.remove(this.consequent.end, this.alternate.start);
        }
        this.alternate.render(code, options);
      }
      else {
        if (includesIfElse && this.shouldKeepAlternateBranch()) {
          code.overwrite(this.alternate.start, this.end, ';');
        }
        else {
          code.remove(this.consequent.end, this.end);
        }
        hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations);
      }
    }
    this.renderHoistedDeclarations(hoistedDeclarations, code);
  }
  getTestValue() {
    if (this.testValue === unset) {
      return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
    }
    return this.testValue;
  }
  includeKnownTest(context, testValue) {
    if (this.test.shouldBeIncluded(context)) {
      this.test.include(context, false);
    }
    if (testValue && this.consequent.shouldBeIncluded(context)) {
      this.consequent.includeAsSingleStatement(context, false);
    }
    if (this.alternate !== null && !testValue && this.alternate.shouldBeIncluded(context)) {
      this.alternate.includeAsSingleStatement(context, false);
    }
  }
  includeRecursively(includeChildrenRecursively, context) {
    this.test.include(context, includeChildrenRecursively);
    this.consequent.include(context, includeChildrenRecursively);
    if (this.alternate !== null) {
      this.alternate.include(context, includeChildrenRecursively);
    }
  }
  includeUnknownTest(context) {
    this.test.include(context, false);
    const { brokenFlow } = context;
    let consequentBrokenFlow = BROKEN_FLOW_NONE;
    if (this.consequent.shouldBeIncluded(context)) {
      this.consequent.includeAsSingleStatement(context, false);
      consequentBrokenFlow = context.brokenFlow;
      context.brokenFlow = brokenFlow;
    }
    if (this.alternate !== null && this.alternate.shouldBeIncluded(context)) {
      this.alternate.includeAsSingleStatement(context, false);
      context.brokenFlow =
        context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
    }
  }
  renderHoistedDeclarations(hoistedDeclarations, code) {
    const hoistedVars = [
      ...new Set(hoistedDeclarations.map(identifier => {
        const variable = identifier.variable;
        return variable.included ? variable.getName() : '';
      }))
    ]
      .filter(Boolean)
      .join(', ');
    if (hoistedVars) {
      const parentType = this.parent.type;
      const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1;
      code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);
      if (needsBraces) {
        code.appendLeft(this.end, ` }`);
      }
    }
  }
  shouldKeepAlternateBranch() {
    let currentParent = this.parent;
    do {
      if (currentParent instanceof IfStatement && currentParent.alternate) {
        return true;
      }
      if (currentParent instanceof BlockStatement) {
        return false;
      }
      currentParent = currentParent.parent;
    } while (currentParent);
    return false;
  }
}

class ImportDeclaration extends NodeBase {
  bind() { }
  hasEffects() {
    return false;
  }
  initialise() {
    this.context.addImport(this);
  }
  render(code, _options, nodeRenderOptions) {
    code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
  }
}
ImportDeclaration.prototype.needsBoundaries = true;

class ImportDefaultSpecifier extends NodeBase {
}

class ImportExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.inlineNamespace = null;
    this.mechanism = null;
    this.resolution = null;
  }
  hasEffects() {
    return true;
  }
  include(context, includeChildrenRecursively) {
    if (!this.included) {
      this.included = true;
      this.context.includeDynamicImport(this);
      this.scope.addAccessedDynamicImport(this);
    }
    this.source.include(context, includeChildrenRecursively);
  }
  initialise() {
    this.context.addDynamicImport(this);
  }
  render(code, options) {
    if (this.inlineNamespace) {
      const _ = options.compact ? '' : ' ';
      const s = options.compact ? '' : ';';
      code.overwrite(this.start, this.end, `Promise.resolve().then(function${_}()${_}{${_}return ${this.inlineNamespace.getName()}${s}${_}})`);
      return;
    }
    if (this.mechanism) {
      code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left);
      code.overwrite(this.end - 1, this.end, this.mechanism.right);
    }
    this.source.render(code, options);
  }
  renderFinalResolution(code, resolution, namespaceExportName, options) {
    code.overwrite(this.source.start, this.source.end, resolution);
    if (namespaceExportName) {
      const _ = options.compact ? '' : ' ';
      const s = options.compact ? '' : ';';
      code.prependLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`);
    }
  }
  setExternalResolution(exportMode, resolution, options, pluginDriver, accessedGlobalsByScope) {
    this.resolution = resolution;
    const accessedGlobals = [...(accessedImportGlobals[options.format] || [])];
    let helper;
    ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver));
    if (helper) {
      accessedGlobals.push(helper);
    }
    if (accessedGlobals.length > 0) {
      this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
    }
  }
  setInternalResolution(inlineNamespace) {
    this.inlineNamespace = inlineNamespace;
  }
  getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver) {
    const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
      {
        customResolution: typeof this.resolution === 'string' ? this.resolution : null,
        format: options.format,
        moduleId: this.context.module.id,
        targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null
      }
    ]);
    if (mechanism) {
      return { helper: null, mechanism };
    }
    switch (options.format) {
      case 'cjs': {
        const _ = options.compact ? '' : ' ';
        const s = options.compact ? '' : ';';
        const leftStart = `Promise.resolve().then(function${_}()${_}{${_}return`;
        const helper = this.getInteropHelper(resolution, exportMode, options.interop);
        return {
          helper,
          mechanism: helper
            ? {
              left: `${leftStart} /*#__PURE__*/${helper}(require(`,
              right: `))${s}${_}})`
            }
            : {
              left: `${leftStart} require(`,
              right: `)${s}${_}})`
            }
        };
      }
      case 'amd': {
        const _ = options.compact ? '' : ' ';
        const resolve = options.compact ? 'c' : 'resolve';
        const reject = options.compact ? 'e' : 'reject';
        const helper = this.getInteropHelper(resolution, exportMode, options.interop);
        const resolveNamespace = helper
          ? `function${_}(m)${_}{${_}${resolve}(/*#__PURE__*/${helper}(m));${_}}`
          : resolve;
        return {
          helper,
          mechanism: {
            left: `new Promise(function${_}(${resolve},${_}${reject})${_}{${_}require([`,
            right: `],${_}${resolveNamespace},${_}${reject})${_}})`
          }
        };
      }
      case 'system':
        return {
          helper: null,
          mechanism: {
            left: 'module.import(',
            right: ')'
          }
        };
      case 'es':
        if (options.dynamicImportFunction) {
          return {
            helper: null,
            mechanism: {
              left: `${options.dynamicImportFunction}(`,
              right: ')'
            }
          };
        }
    }
    return { helper: null, mechanism: null };
  }
  getInteropHelper(resolution, exportMode, interop) {
    return exportMode === 'external'
      ? namespaceInteropHelpersByInteropType[String(interop(resolution instanceof ExternalModule ? resolution.id : null))]
      : exportMode === 'default'
        ? getDefaultOnlyHelper()
        : null;
  }
}
const accessedImportGlobals = {
  amd: ['require'],
  cjs: ['require'],
  system: ['module']
};

class ImportNamespaceSpecifier extends NodeBase {
}

class ImportSpecifier extends NodeBase {
}

class LabeledStatement extends NodeBase {
  hasEffects(context) {
    const brokenFlow = context.brokenFlow;
    context.ignore.labels.add(this.label.name);
    if (this.body.hasEffects(context))
      return true;
    context.ignore.labels.delete(this.label.name);
    if (context.includedLabels.has(this.label.name)) {
      context.includedLabels.delete(this.label.name);
      context.brokenFlow = brokenFlow;
    }
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    const brokenFlow = context.brokenFlow;
    this.body.include(context, includeChildrenRecursively);
    if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {
      this.label.include();
      context.includedLabels.delete(this.label.name);
      context.brokenFlow = brokenFlow;
    }
  }
  render(code, options) {
    if (this.label.included) {
      this.label.render(code, options);
    }
    else {
      code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1));
    }
    this.body.render(code, options);
  }
}

class LogicalExpression extends NodeBase {
  constructor() {
    super(...arguments);
    // We collect deoptimization information if usedBranch !== null
    this.expressionsToBeDeoptimized = [];
    this.isBranchResolutionAnalysed = false;
    this.unusedBranch = null;
    this.usedBranch = null;
    this.wasPathDeoptimizedWhileOptimized = false;
  }
  bind() {
    super.bind();
    // ensure the usedBranch is set for the tree-shaking passes
    this.getUsedBranch();
  }
  deoptimizeCache() {
    if (this.usedBranch !== null) {
      this.usedBranch = null;
      const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
      this.expressionsToBeDeoptimized = [];
      if (this.wasPathDeoptimizedWhileOptimized) {
        this.unusedBranch.deoptimizePath(UNKNOWN_PATH);
      }
      for (const expression of expressionsToBeDeoptimized) {
        expression.deoptimizeCache();
      }
    }
  }
  deoptimizePath(path) {
    const usedBranch = this.getUsedBranch();
    if (usedBranch === null) {
      this.left.deoptimizePath(path);
      this.right.deoptimizePath(path);
    }
    else {
      this.wasPathDeoptimizedWhileOptimized = true;
      usedBranch.deoptimizePath(path);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    const usedBranch = this.getUsedBranch();
    if (usedBranch === null)
      return UnknownValue;
    this.expressionsToBeDeoptimized.push(origin);
    return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    const usedBranch = this.getUsedBranch();
    if (usedBranch === null)
      return new MultiExpression([
        this.left.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
        this.right.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
      ]);
    this.expressionsToBeDeoptimized.push(origin);
    return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  }
  hasEffects(context) {
    if (this.left.hasEffects(context)) {
      return true;
    }
    if (this.usedBranch !== this.left) {
      return this.right.hasEffects(context);
    }
    return false;
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    if (this.usedBranch === null) {
      return (this.left.hasEffectsWhenAccessedAtPath(path, context) ||
        this.right.hasEffectsWhenAccessedAtPath(path, context));
    }
    return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (path.length === 0)
      return true;
    if (this.usedBranch === null) {
      return (this.left.hasEffectsWhenAssignedAtPath(path, context) ||
        this.right.hasEffectsWhenAssignedAtPath(path, context));
    }
    return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (this.usedBranch === null) {
      return (this.left.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
        this.right.hasEffectsWhenCalledAtPath(path, callOptions, context));
    }
    return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (includeChildrenRecursively ||
      (this.usedBranch === this.right && this.left.shouldBeIncluded(context)) ||
      this.usedBranch === null) {
      this.left.include(context, includeChildrenRecursively);
      this.right.include(context, includeChildrenRecursively);
    }
    else {
      this.usedBranch.include(context, includeChildrenRecursively);
    }
  }
  render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
    if (!this.left.included || !this.right.included) {
      const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
      if (this.right.included) {
        const removePos = findNonWhiteSpace(code.original, operatorPos + 2);
        code.remove(this.start, removePos);
        if (preventASI) {
          removeLineBreaks(code, removePos, this.right.start);
        }
      }
      else {
        code.remove(operatorPos, this.end);
      }
      removeAnnotations(this, code);
      this.usedBranch.render(code, options, {
        isCalleeOfRenderedParent: renderedParentType
          ? isCalleeOfRenderedParent
          : this.parent.callee === this,
        preventASI,
        renderedParentType: renderedParentType || this.parent.type
      });
    }
    else {
      this.left.render(code, options, { preventASI });
      this.right.render(code, options);
    }
  }
  getUsedBranch() {
    if (!this.isBranchResolutionAnalysed) {
      this.isBranchResolutionAnalysed = true;
      const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
      if (leftValue === UnknownValue) {
        return null;
      }
      else {
        if ((this.operator === '||' && leftValue) ||
          (this.operator === '&&' && !leftValue) ||
          (this.operator === '??' && leftValue != null)) {
          this.usedBranch = this.left;
          this.unusedBranch = this.right;
        }
        else {
          this.usedBranch = this.right;
          this.unusedBranch = this.left;
        }
      }
    }
    return this.usedBranch;
  }
}

const ASSET_PREFIX = 'ROLLUP_ASSET_URL_';
const CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_';
const FILE_PREFIX = 'ROLLUP_FILE_URL_';
class MetaProperty extends NodeBase {
  addAccessedGlobals(format, accessedGlobalsByScope) {
    const metaProperty = this.metaProperty;
    const accessedGlobals = (metaProperty &&
      (metaProperty.startsWith(FILE_PREFIX) ||
        metaProperty.startsWith(ASSET_PREFIX) ||
        metaProperty.startsWith(CHUNK_PREFIX))
      ? accessedFileUrlGlobals
      : accessedMetaUrlGlobals)[format];
    if (accessedGlobals.length > 0) {
      this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
    }
  }
  getReferencedFileName(outputPluginDriver) {
    const metaProperty = this.metaProperty;
    if (metaProperty && metaProperty.startsWith(FILE_PREFIX)) {
      return outputPluginDriver.getFileName(metaProperty.substr(FILE_PREFIX.length));
    }
    return null;
  }
  hasEffects() {
    return false;
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  include() {
    if (!this.included) {
      this.included = true;
      if (this.meta.name === 'import') {
        this.context.addImportMeta(this);
        const parent = this.parent;
        this.metaProperty =
          parent instanceof MemberExpression && typeof parent.propertyKey === 'string'
            ? parent.propertyKey
            : null;
      }
    }
  }
  renderFinalMechanism(code, chunkId, format, outputPluginDriver) {
    var _a;
    const parent = this.parent;
    const metaProperty = this.metaProperty;
    if (metaProperty &&
      (metaProperty.startsWith(FILE_PREFIX) ||
        metaProperty.startsWith(ASSET_PREFIX) ||
        metaProperty.startsWith(CHUNK_PREFIX))) {
      let referenceId = null;
      let assetReferenceId = null;
      let chunkReferenceId = null;
      let fileName;
      if (metaProperty.startsWith(FILE_PREFIX)) {
        referenceId = metaProperty.substr(FILE_PREFIX.length);
        fileName = outputPluginDriver.getFileName(referenceId);
      }
      else if (metaProperty.startsWith(ASSET_PREFIX)) {
        warnDeprecation(`Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
        assetReferenceId = metaProperty.substr(ASSET_PREFIX.length);
        fileName = outputPluginDriver.getFileName(assetReferenceId);
      }
      else {
        warnDeprecation(`Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
        chunkReferenceId = metaProperty.substr(CHUNK_PREFIX.length);
        fileName = outputPluginDriver.getFileName(chunkReferenceId);
      }
      const relativePath = normalize(relative$1(dirname(chunkId), fileName));
      let replacement;
      if (assetReferenceId !== null) {
        replacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [
          {
            assetFileName: fileName,
            chunkId,
            format,
            moduleId: this.context.module.id,
            relativeAssetPath: relativePath
          }
        ]);
      }
      if (!replacement) {
        replacement =
          outputPluginDriver.hookFirstSync('resolveFileUrl', [
            {
              assetReferenceId,
              chunkId,
              chunkReferenceId,
              fileName,
              format,
              moduleId: this.context.module.id,
              referenceId: referenceId || assetReferenceId || chunkReferenceId,
              relativePath
            }
          ]) || relativeUrlMechanisms[format](relativePath);
      }
      code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
      return;
    }
    const replacement = outputPluginDriver.hookFirstSync('resolveImportMeta', [
      metaProperty,
      {
        chunkId,
        format,
        moduleId: this.context.module.id
      }
    ]) || ((_a = importMetaMechanisms[format]) === null || _a === void 0 ? void 0 : _a.call(importMetaMechanisms, metaProperty, chunkId));
    if (typeof replacement === 'string') {
      if (parent instanceof MemberExpression) {
        code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
      }
      else {
        code.overwrite(this.start, this.end, replacement, { contentOnly: true });
      }
    }
  }
}
const accessedMetaUrlGlobals = {
  amd: ['document', 'module', 'URL'],
  cjs: ['document', 'require', 'URL'],
  es: [],
  iife: ['document', 'URL'],
  system: ['module'],
  umd: ['document', 'require', 'URL']
};
const accessedFileUrlGlobals = {
  amd: ['document', 'require', 'URL'],
  cjs: ['document', 'require', 'URL'],
  es: [],
  iife: ['document', 'URL'],
  system: ['module', 'URL'],
  umd: ['document', 'require', 'URL']
};
const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
const getRelativeUrlFromDocument = (relativePath) => getResolveUrl(`'${relativePath}', document.currentScript && document.currentScript.src || document.baseURI`);
const getGenericImportMetaMechanism = (getUrl) => (prop, chunkId) => {
  const urlMechanism = getUrl(chunkId);
  return prop === null ? `({ url: ${urlMechanism} })` : prop === 'url' ? urlMechanism : 'undefined';
};
const getUrlFromDocument = (chunkId) => `(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
const relativeUrlMechanisms = {
  amd: relativePath => {
    if (relativePath[0] !== '.')
      relativePath = './' + relativePath;
    return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);
  },
  cjs: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`,
  es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`),
  iife: relativePath => getRelativeUrlFromDocument(relativePath),
  system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),
  umd: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`
};
const importMetaMechanisms = {
  amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)),
  cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`),
  iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)),
  system: prop => (prop === null ? `module.meta` : `module.meta.${prop}`),
  umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`)
};

class NewExpression extends NodeBase {
  bind() {
    super.bind();
    for (const argument of this.arguments) {
      // This will make sure all properties of parameters behave as "unknown"
      argument.deoptimizePath(UNKNOWN_PATH);
    }
  }
  hasEffects(context) {
    var _a;
    for (const argument of this.arguments) {
      if (argument.hasEffects(context))
        return true;
    }
    if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
      return false;
    return (this.callee.hasEffects(context) ||
      this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  initialise() {
    this.callOptions = {
      args: this.arguments,
      withNew: true
    };
  }
}

class ObjectExpression extends NodeBase {
  constructor() {
    super(...arguments);
    this.deoptimizedPaths = new Set();
    // We collect deoptimization information if we can resolve a computed property access
    this.expressionsToBeDeoptimized = new Map();
    this.hasUnknownDeoptimizedProperty = false;
    this.propertyMap = null;
    this.unmatchablePropertiesRead = [];
    this.unmatchablePropertiesWrite = [];
  }
  bind() {
    super.bind();
    // ensure the propertyMap is set for the tree-shaking passes
    this.getPropertyMap();
  }
  // We could also track this per-property but this would quickly become much more complex
  deoptimizeCache() {
    if (!this.hasUnknownDeoptimizedProperty)
      this.deoptimizeAllProperties();
  }
  deoptimizePath(path) {
    if (this.hasUnknownDeoptimizedProperty)
      return;
    const propertyMap = this.getPropertyMap();
    const key = path[0];
    if (path.length === 1) {
      if (typeof key !== 'string') {
        this.deoptimizeAllProperties();
        return;
      }
      if (!this.deoptimizedPaths.has(key)) {
        this.deoptimizedPaths.add(key);
        // we only deoptimizeCache exact matches as in all other cases,
        // we do not return a literal value or return expression
        const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key);
        if (expressionsToBeDeoptimized) {
          for (const expression of expressionsToBeDeoptimized) {
            expression.deoptimizeCache();
          }
        }
      }
    }
    const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);
    for (const property of typeof key === 'string'
      ? propertyMap[key]
        ? propertyMap[key].propertiesRead
        : []
      : this.properties) {
      property.deoptimizePath(subPath);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    const propertyMap = this.getPropertyMap();
    const key = path[0];
    if (path.length === 0 ||
      this.hasUnknownDeoptimizedProperty ||
      typeof key !== 'string' ||
      this.deoptimizedPaths.has(key)) {
      return UnknownValue;
    }
    if (path.length === 1 &&
      !propertyMap[key] &&
      !objectMembers[key] &&
      this.unmatchablePropertiesRead.length === 0) {
      getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
      return undefined;
    }
    if (!propertyMap[key] ||
      propertyMap[key].exactMatchRead === null ||
      propertyMap[key].propertiesRead.length > 1) {
      return UnknownValue;
    }
    getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
    return propertyMap[key].exactMatchRead.getLiteralValueAtPath(path.slice(1), recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    const propertyMap = this.getPropertyMap();
    const key = path[0];
    if (path.length === 0 ||
      this.hasUnknownDeoptimizedProperty ||
      typeof key !== 'string' ||
      this.deoptimizedPaths.has(key)) {
      return UNKNOWN_EXPRESSION;
    }
    if (path.length === 1 &&
      objectMembers[key] &&
      this.unmatchablePropertiesRead.length === 0 &&
      (!propertyMap[key] || propertyMap[key].exactMatchRead === null)) {
      return getMemberReturnExpressionWhenCalled(objectMembers, key);
    }
    if (!propertyMap[key] ||
      propertyMap[key].exactMatchRead === null ||
      propertyMap[key].propertiesRead.length > 1) {
      return UNKNOWN_EXPRESSION;
    }
    getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
    return propertyMap[key].exactMatchRead.getReturnExpressionWhenCalledAtPath(path.slice(1), recursionTracker, origin);
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (path.length === 0)
      return false;
    const key = path[0];
    const propertyMap = this.propertyMap;
    if (path.length > 1 &&
      (this.hasUnknownDeoptimizedProperty ||
        typeof key !== 'string' ||
        this.deoptimizedPaths.has(key) ||
        !propertyMap[key] ||
        propertyMap[key].exactMatchRead === null))
      return true;
    const subPath = path.slice(1);
    for (const property of typeof key !== 'string'
      ? this.properties
      : propertyMap[key]
        ? propertyMap[key].propertiesRead
        : []) {
      if (property.hasEffectsWhenAccessedAtPath(subPath, context))
        return true;
    }
    return false;
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    const key = path[0];
    const propertyMap = this.propertyMap;
    if (path.length > 1 &&
      (this.hasUnknownDeoptimizedProperty ||
        this.deoptimizedPaths.has(key) ||
        !propertyMap[key] ||
        propertyMap[key].exactMatchRead === null)) {
      return true;
    }
    const subPath = path.slice(1);
    for (const property of typeof key !== 'string'
      ? this.properties
      : path.length > 1
        ? propertyMap[key].propertiesRead
        : propertyMap[key]
          ? propertyMap[key].propertiesWrite
          : []) {
      if (property.hasEffectsWhenAssignedAtPath(subPath, context))
        return true;
    }
    return false;
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    const key = path[0];
    if (typeof key !== 'string' ||
      this.hasUnknownDeoptimizedProperty ||
      this.deoptimizedPaths.has(key) ||
      (this.propertyMap[key]
        ? !this.propertyMap[key].exactMatchRead
        : path.length > 1 || !objectMembers[key])) {
      return true;
    }
    const subPath = path.slice(1);
    if (this.propertyMap[key]) {
      for (const property of this.propertyMap[key].propertiesRead) {
        if (property.hasEffectsWhenCalledAtPath(subPath, callOptions, context))
          return true;
      }
    }
    if (path.length === 1 && objectMembers[key])
      return hasMemberEffectWhenCalled(objectMembers, key, this.included, callOptions, context);
    return false;
  }
  render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
    super.render(code, options);
    const surroundingElement = renderedParentType || renderedSurroundingElement;
    if (surroundingElement === ExpressionStatement$1 ||
      surroundingElement === ArrowFunctionExpression$1) {
      code.appendRight(this.start, '(');
      code.prependLeft(this.end, ')');
    }
  }
  deoptimizeAllProperties() {
    this.hasUnknownDeoptimizedProperty = true;
    for (const property of this.properties) {
      property.deoptimizePath(UNKNOWN_PATH);
    }
    for (const expressionsToBeDeoptimized of this.expressionsToBeDeoptimized.values()) {
      for (const expression of expressionsToBeDeoptimized) {
        expression.deoptimizeCache();
      }
    }
  }
  getPropertyMap() {
    if (this.propertyMap !== null) {
      return this.propertyMap;
    }
    const propertyMap = (this.propertyMap = Object.create(null));
    for (let index = this.properties.length - 1; index >= 0; index--) {
      const property = this.properties[index];
      if (property instanceof SpreadElement) {
        this.unmatchablePropertiesRead.push(property);
        continue;
      }
      const isWrite = property.kind !== 'get';
      const isRead = property.kind !== 'set';
      let key;
      if (property.computed) {
        const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
        if (keyValue === UnknownValue) {
          if (isRead) {
            this.unmatchablePropertiesRead.push(property);
          }
          else {
            this.unmatchablePropertiesWrite.push(property);
          }
          continue;
        }
        key = String(keyValue);
      }
      else if (property.key instanceof Identifier) {
        key = property.key.name;
      }
      else {
        key = String(property.key.value);
      }
      const propertyMapProperty = propertyMap[key];
      if (!propertyMapProperty) {
        propertyMap[key] = {
          exactMatchRead: isRead ? property : null,
          exactMatchWrite: isWrite ? property : null,
          propertiesRead: isRead ? [property, ...this.unmatchablePropertiesRead] : [],
          propertiesWrite: isWrite && !isRead ? [property, ...this.unmatchablePropertiesWrite] : []
        };
        continue;
      }
      if (isRead && propertyMapProperty.exactMatchRead === null) {
        propertyMapProperty.exactMatchRead = property;
        propertyMapProperty.propertiesRead.push(property, ...this.unmatchablePropertiesRead);
      }
      if (isWrite && !isRead && propertyMapProperty.exactMatchWrite === null) {
        propertyMapProperty.exactMatchWrite = property;
        propertyMapProperty.propertiesWrite.push(property, ...this.unmatchablePropertiesWrite);
      }
    }
    return propertyMap;
  }
}

class ObjectPattern extends NodeBase {
  addExportedVariables(variables, exportNamesByVariable) {
    for (const property of this.properties) {
      if (property.type === Property$1) {
        property.value.addExportedVariables(variables, exportNamesByVariable);
      }
      else {
        property.argument.addExportedVariables(variables, exportNamesByVariable);
      }
    }
  }
  declare(kind, init) {
    const variables = [];
    for (const property of this.properties) {
      variables.push(...property.declare(kind, init));
    }
    return variables;
  }
  deoptimizePath(path) {
    if (path.length === 0) {
      for (const property of this.properties) {
        property.deoptimizePath(path);
      }
    }
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (path.length > 0)
      return true;
    for (const property of this.properties) {
      if (property.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
        return true;
    }
    return false;
  }
}

class PrivateIdentifier extends NodeBase {
}

class Program extends NodeBase {
  constructor() {
    super(...arguments);
    this.hasCachedEffect = false;
  }
  hasEffects(context) {
    // We are caching here to later more efficiently identify side-effect-free modules
    if (this.hasCachedEffect)
      return true;
    for (const node of this.body) {
      if (node.hasEffects(context)) {
        return (this.hasCachedEffect = true);
      }
    }
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    for (const node of this.body) {
      if (includeChildrenRecursively || node.shouldBeIncluded(context)) {
        node.include(context, includeChildrenRecursively);
      }
    }
  }
  render(code, options) {
    if (this.body.length) {
      renderStatementList(this.body, code, this.start, this.end, options);
    }
    else {
      super.render(code, options);
    }
  }
}

class Property extends NodeBase {
  constructor() {
    super(...arguments);
    this.declarationInit = null;
    this.returnExpression = null;
  }
  bind() {
    super.bind();
    if (this.kind === 'get') {
      // ensure the returnExpression is set for the tree-shaking passes
      this.getReturnExpression();
    }
    if (this.declarationInit !== null) {
      this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
    }
  }
  declare(kind, init) {
    this.declarationInit = init;
    return this.value.declare(kind, UNKNOWN_EXPRESSION);
  }
  // As getter properties directly receive their values from function expressions that always
  // have a fixed return value, there is no known situation where a getter is deoptimized.
  deoptimizeCache() { }
  deoptimizePath(path) {
    if (this.kind === 'get') {
      this.getReturnExpression().deoptimizePath(path);
    }
    else {
      this.value.deoptimizePath(path);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (this.kind === 'get') {
      return this.getReturnExpression().getLiteralValueAtPath(path, recursionTracker, origin);
    }
    return this.value.getLiteralValueAtPath(path, recursionTracker, origin);
  }
  getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
    if (this.kind === 'get') {
      return this.getReturnExpression().getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
    }
    return this.value.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  }
  hasEffects(context) {
    const propertyReadSideEffects = this.context.options.treeshake.propertyReadSideEffects;
    return this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always' ||
      this.key.hasEffects(context) ||
      this.value.hasEffects(context);
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    if (this.kind === 'get') {
      const trackedExpressions = context.accessed.getEntities(path);
      if (trackedExpressions.has(this))
        return false;
      trackedExpressions.add(this);
      return (this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context) ||
        (path.length > 0 && this.returnExpression.hasEffectsWhenAccessedAtPath(path, context)));
    }
    return this.value.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    if (this.kind === 'get') {
      const trackedExpressions = context.assigned.getEntities(path);
      if (trackedExpressions.has(this))
        return false;
      trackedExpressions.add(this);
      return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
    }
    if (this.kind === 'set') {
      const trackedExpressions = context.assigned.getEntities(path);
      if (trackedExpressions.has(this))
        return false;
      trackedExpressions.add(this);
      return this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context);
    }
    return this.value.hasEffectsWhenAssignedAtPath(path, context);
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    if (this.kind === 'get') {
      const trackedExpressions = (callOptions.withNew
        ? context.instantiated
        : context.called).getEntities(path, callOptions);
      if (trackedExpressions.has(this))
        return false;
      trackedExpressions.add(this);
      return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
    }
    return this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  initialise() {
    this.accessorCallOptions = {
      args: NO_ARGS,
      withNew: false
    };
  }
  render(code, options) {
    if (!this.shorthand) {
      this.key.render(code, options);
    }
    this.value.render(code, options, { isShorthandProperty: this.shorthand });
  }
  getReturnExpression() {
    if (this.returnExpression === null) {
      this.returnExpression = UNKNOWN_EXPRESSION;
      return (this.returnExpression = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
    }
    return this.returnExpression;
  }
}

class PropertyDefinition extends NodeBase {
  hasEffects(context) {
    return (this.key.hasEffects(context) ||
      (this.static && this.value !== null && this.value.hasEffects(context)));
  }
}

class ReturnStatement extends NodeBase {
  hasEffects(context) {
    if (!context.ignore.returnAwaitYield ||
      (this.argument !== null && this.argument.hasEffects(context)))
      return true;
    context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (this.argument) {
      this.argument.include(context, includeChildrenRecursively);
    }
    context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  }
  initialise() {
    this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION);
  }
  render(code, options) {
    if (this.argument) {
      this.argument.render(code, options, { preventASI: true });
      if (this.argument.start === this.start + 6 /* 'return'.length */) {
        code.prependLeft(this.start + 6, ' ');
      }
    }
  }
}

class SequenceExpression extends NodeBase {
  deoptimizePath(path) {
    if (path.length > 0)
      this.expressions[this.expressions.length - 1].deoptimizePath(path);
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin);
  }
  hasEffects(context) {
    for (const expression of this.expressions) {
      if (expression.hasEffects(context))
        return true;
    }
    return false;
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    return (path.length > 0 &&
      this.expressions[this.expressions.length - 1].hasEffectsWhenAccessedAtPath(path, context));
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return (path.length === 0 ||
      this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context));
  }
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
    return this.expressions[this.expressions.length - 1].hasEffectsWhenCalledAtPath(path, callOptions, context);
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    for (let i = 0; i < this.expressions.length - 1; i++) {
      const node = this.expressions[i];
      if (includeChildrenRecursively || node.shouldBeIncluded(context))
        node.include(context, includeChildrenRecursively);
    }
    this.expressions[this.expressions.length - 1].include(context, includeChildrenRecursively);
  }
  render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
    let includedNodes = 0;
    for (const { node, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) {
      if (!node.included) {
        treeshakeNode(node, code, start, end);
        continue;
      }
      includedNodes++;
      if (includedNodes === 1 && preventASI) {
        removeLineBreaks(code, start, node.start);
      }
      if (node === this.expressions[this.expressions.length - 1] && includedNodes === 1) {
        node.render(code, options, {
          isCalleeOfRenderedParent: renderedParentType
            ? isCalleeOfRenderedParent
            : this.parent.callee === this,
          renderedParentType: renderedParentType || this.parent.type
        });
      }
      else {
        node.render(code, options);
      }
    }
  }
}

class Super extends NodeBase {
}

class SwitchCase extends NodeBase {
  hasEffects(context) {
    if (this.test && this.test.hasEffects(context))
      return true;
    for (const node of this.consequent) {
      if (context.brokenFlow)
        break;
      if (node.hasEffects(context))
        return true;
    }
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (this.test)
      this.test.include(context, includeChildrenRecursively);
    for (const node of this.consequent) {
      if (includeChildrenRecursively || node.shouldBeIncluded(context))
        node.include(context, includeChildrenRecursively);
    }
  }
  render(code, options, nodeRenderOptions) {
    if (this.consequent.length) {
      this.test && this.test.render(code, options);
      const testEnd = this.test
        ? this.test.end
        : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
      const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1;
      renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options);
    }
    else {
      super.render(code, options);
    }
  }
}
SwitchCase.prototype.needsBoundaries = true;

class SwitchStatement extends NodeBase {
  createScope(parentScope) {
    this.scope = new BlockScope(parentScope);
  }
  hasEffects(context) {
    if (this.discriminant.hasEffects(context))
      return true;
    const { brokenFlow, ignore: { breaks } } = context;
    let minBrokenFlow = Infinity;
    context.ignore.breaks = true;
    for (const switchCase of this.cases) {
      if (switchCase.hasEffects(context))
        return true;
      minBrokenFlow = context.brokenFlow < minBrokenFlow ? context.brokenFlow : minBrokenFlow;
      context.brokenFlow = brokenFlow;
    }
    if (this.defaultCase !== null && !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
      context.brokenFlow = minBrokenFlow;
    }
    context.ignore.breaks = breaks;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.discriminant.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    let minBrokenFlow = Infinity;
    let isCaseIncluded = includeChildrenRecursively ||
      (this.defaultCase !== null && this.defaultCase < this.cases.length - 1);
    for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) {
      const switchCase = this.cases[caseIndex];
      if (switchCase.included) {
        isCaseIncluded = true;
      }
      if (!isCaseIncluded) {
        const hasEffectsContext = createHasEffectsContext();
        hasEffectsContext.ignore.breaks = true;
        isCaseIncluded = switchCase.hasEffects(hasEffectsContext);
      }
      if (isCaseIncluded) {
        switchCase.include(context, includeChildrenRecursively);
        minBrokenFlow = minBrokenFlow < context.brokenFlow ? minBrokenFlow : context.brokenFlow;
        context.brokenFlow = brokenFlow;
      }
      else {
        minBrokenFlow = brokenFlow;
      }
    }
    if (isCaseIncluded &&
      this.defaultCase !== null &&
      !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
      context.brokenFlow = minBrokenFlow;
    }
  }
  initialise() {
    for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) {
      if (this.cases[caseIndex].test === null) {
        this.defaultCase = caseIndex;
        return;
      }
    }
    this.defaultCase = null;
  }
  render(code, options) {
    this.discriminant.render(code, options);
    if (this.cases.length > 0) {
      renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options);
    }
  }
}

class TaggedTemplateExpression extends NodeBase {
  bind() {
    super.bind();
    if (this.tag.type === Identifier$1) {
      const name = this.tag.name;
      const variable = this.scope.findVariable(name);
      if (variable.isNamespace) {
        this.context.warn({
          code: 'CANNOT_CALL_NAMESPACE',
          message: `Cannot call a namespace ('${name}')`,
        }, this.start);
      }
      if (name === 'eval') {
        this.context.warn({
          code: 'EVAL',
          message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
          url: 'https://rollupjs.org/guide/en/#avoiding-eval',
        }, this.start);
      }
    }
  }
  hasEffects(context) {
    return (super.hasEffects(context) ||
      this.tag.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  }
  initialise() {
    this.callOptions = {
      args: NO_ARGS,
      withNew: false,
    };
  }
}

class TemplateElement extends NodeBase {
  bind() { }
  hasEffects() {
    return false;
  }
  include() {
    this.included = true;
  }
  parseNode(esTreeNode) {
    this.value = esTreeNode.value;
    super.parseNode(esTreeNode);
  }
  render() { }
}

class TemplateLiteral extends NodeBase {
  getLiteralValueAtPath(path) {
    if (path.length > 0 || this.quasis.length !== 1) {
      return UnknownValue;
    }
    return this.quasis[0].value.cooked;
  }
  render(code, options) {
    code.indentExclusionRanges.push([this.start, this.end]);
    super.render(code, options);
  }
}

class ModuleScope extends ChildScope {
  constructor(parent, context) {
    super(parent);
    this.context = context;
    this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context));
  }
  addExportDefaultDeclaration(name, exportDefaultDeclaration, context) {
    const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);
    this.variables.set('default', variable);
    return variable;
  }
  addNamespaceMemberAccess() { }
  deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
    // all module level variables are already deconflicted when deconflicting the chunk
    for (const scope of this.children)
      scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
  }
  findLexicalBoundary() {
    return this;
  }
  findVariable(name) {
    const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
    if (knownVariable) {
      return knownVariable;
    }
    const variable = this.context.traceVariable(name) || this.parent.findVariable(name);
    if (variable instanceof GlobalVariable) {
      this.accessedOutsideVariables.set(name, variable);
    }
    return variable;
  }
}

class ThisExpression extends NodeBase {
  bind() {
    super.bind();
    this.variable = this.scope.findVariable('this');
  }
  hasEffectsWhenAccessedAtPath(path, context) {
    return path.length > 0 && this.variable.hasEffectsWhenAccessedAtPath(path, context);
  }
  hasEffectsWhenAssignedAtPath(path, context) {
    return this.variable.hasEffectsWhenAssignedAtPath(path, context);
  }
  initialise() {
    this.alias =
      this.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null;
    if (this.alias === 'undefined') {
      this.context.warn({
        code: 'THIS_IS_UNDEFINED',
        message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
        url: `https://rollupjs.org/guide/en/#error-this-is-undefined`
      }, this.start);
    }
  }
  render(code) {
    if (this.alias !== null) {
      code.overwrite(this.start, this.end, this.alias, {
        contentOnly: false,
        storeName: true
      });
    }
  }
}

class ThrowStatement extends NodeBase {
  hasEffects() {
    return true;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.argument.include(context, includeChildrenRecursively);
    context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  }
  render(code, options) {
    this.argument.render(code, options, { preventASI: true });
    if (this.argument.start === this.start + 5 /* 'throw'.length */) {
      code.prependLeft(this.start + 5, ' ');
    }
  }
}

class TryStatement extends NodeBase {
  constructor() {
    super(...arguments);
    this.directlyIncluded = false;
    this.includedLabelsAfterBlock = null;
  }
  hasEffects(context) {
    return ((this.context.options.treeshake.tryCatchDeoptimization
      ? this.block.body.length > 0
      : this.block.hasEffects(context)) ||
      (this.finalizer !== null && this.finalizer.hasEffects(context)));
  }
  include(context, includeChildrenRecursively) {
    var _a;
    const tryCatchDeoptimization = (_a = this.context.options.treeshake) === null || _a === void 0 ? void 0 : _a.tryCatchDeoptimization;
    const { brokenFlow } = context;
    if (!this.directlyIncluded || !tryCatchDeoptimization) {
      this.included = true;
      this.directlyIncluded = true;
      this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively);
      if (context.includedLabels.size > 0) {
        this.includedLabelsAfterBlock = [...context.includedLabels];
      }
      context.brokenFlow = brokenFlow;
    }
    else if (this.includedLabelsAfterBlock) {
      for (const label of this.includedLabelsAfterBlock) {
        context.includedLabels.add(label);
      }
    }
    if (this.handler !== null) {
      this.handler.include(context, includeChildrenRecursively);
      context.brokenFlow = brokenFlow;
    }
    if (this.finalizer !== null) {
      this.finalizer.include(context, includeChildrenRecursively);
    }
  }
}

const unaryOperators = {
  '!': value => !value,
  '+': value => +value,
  '-': value => -value,
  delete: () => UnknownValue,
  typeof: value => typeof value,
  void: () => undefined,
  '~': value => ~value
};
class UnaryExpression extends NodeBase {
  bind() {
    super.bind();
    if (this.operator === 'delete') {
      this.argument.deoptimizePath(EMPTY_PATH);
    }
  }
  getLiteralValueAtPath(path, recursionTracker, origin) {
    if (path.length > 0)
      return UnknownValue;
    const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
    if (argumentValue === UnknownValue)
      return UnknownValue;
    return unaryOperators[this.operator](argumentValue);
  }
  hasEffects(context) {
    if (this.operator === 'typeof' && this.argument instanceof Identifier)
      return false;
    return (this.argument.hasEffects(context) ||
      (this.operator === 'delete' &&
        this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)));
  }
  hasEffectsWhenAccessedAtPath(path) {
    if (this.operator === 'void') {
      return path.length > 0;
    }
    return path.length > 1;
  }
}

class UnknownNode extends NodeBase {
  hasEffects() {
    return true;
  }
  include(context) {
    super.include(context, true);
  }
}

class UpdateExpression extends NodeBase {
  bind() {
    super.bind();
    this.argument.deoptimizePath(EMPTY_PATH);
    if (this.argument instanceof Identifier) {
      const variable = this.scope.findVariable(this.argument.name);
      variable.isReassigned = true;
    }
  }
  hasEffects(context) {
    return (this.argument.hasEffects(context) ||
      this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
  }
  hasEffectsWhenAccessedAtPath(path) {
    return path.length > 1;
  }
  render(code, options) {
    this.argument.render(code, options);
    if (options.format === 'system') {
      const variable = this.argument.variable;
      const exportNames = options.exportNamesByVariable.get(variable);
      if (exportNames && exportNames.length) {
        const _ = options.compact ? '' : ' ';
        const name = variable.getName();
        if (this.prefix) {
          if (exportNames.length === 1) {
            code.overwrite(this.start, this.end, `exports('${exportNames[0]}',${_}${this.operator}${name})`);
          }
          else {
            code.overwrite(this.start, this.end, `(${this.operator}${name},${_}${getSystemExportStatement([variable], options)},${_}${name})`);
          }
        }
        else if (exportNames.length > 1) {
          code.overwrite(this.start, this.end, `(${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name}))`);
        }
        else {
          let op;
          switch (this.operator) {
            case '++':
              op = `${name}${_}+${_}1`;
              break;
            case '--':
              op = `${name}${_}-${_}1`;
              break;
          }
          code.overwrite(this.start, this.end, `(exports('${exportNames[0]}',${_}${op}),${_}${name}${this.operator})`);
        }
      }
    }
  }
}

function isReassignedExportsMember(variable, exportNamesByVariable) {
  return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned);
}

function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) {
  for (const declarator of declarations) {
    if (!declarator.id.included)
      return false;
    if (declarator.id.type === Identifier$1) {
      if (exportNamesByVariable.has(declarator.id.variable))
        return false;
    }
    else {
      const exportedVariables = [];
      declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable);
      if (exportedVariables.length > 0)
        return false;
    }
  }
  return true;
}
class VariableDeclaration extends NodeBase {
  deoptimizePath() {
    for (const declarator of this.declarations) {
      declarator.deoptimizePath(EMPTY_PATH);
    }
  }
  hasEffectsWhenAssignedAtPath() {
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    for (const declarator of this.declarations) {
      if (includeChildrenRecursively || declarator.shouldBeIncluded(context))
        declarator.include(context, includeChildrenRecursively);
    }
  }
  includeAsSingleStatement(context, includeChildrenRecursively) {
    this.included = true;
    for (const declarator of this.declarations) {
      if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) {
        declarator.include(context, includeChildrenRecursively);
        declarator.id.include(context, includeChildrenRecursively);
      }
    }
  }
  initialise() {
    for (const declarator of this.declarations) {
      declarator.declareDeclarator(this.kind);
    }
  }
  render(code, options, nodeRenderOptions = BLANK) {
    if (areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) {
      for (const declarator of this.declarations) {
        declarator.render(code, options);
      }
      if (!nodeRenderOptions.isNoStatement &&
        code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) {
        code.appendLeft(this.end, ';');
      }
    }
    else {
      this.renderReplacedDeclarations(code, options, nodeRenderOptions);
    }
  }
  renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement) {
    if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) {
      code.remove(this.end - 1, this.end);
    }
    if (!isNoStatement) {
      separatorString += ';';
    }
    if (lastSeparatorPos !== null) {
      if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ &&
        (code.original.charCodeAt(this.end) === 10 /*"\n"*/ ||
          code.original.charCodeAt(this.end) === 13) /*"\r"*/) {
        actualContentEnd--;
        if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) {
          actualContentEnd--;
        }
      }
      if (actualContentEnd === lastSeparatorPos + 1) {
        code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString);
      }
      else {
        code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
        code.remove(actualContentEnd, renderedContentEnd);
      }
    }
    else {
      code.appendLeft(renderedContentEnd, separatorString);
    }
    if (systemPatternExports.length > 0) {
      code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`);
    }
  }
  renderReplacedDeclarations(code, options, { isNoStatement }) {
    const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0));
    let actualContentEnd, renderedContentEnd;
    renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);
    let lastSeparatorPos = renderedContentEnd - 1;
    code.remove(this.start, lastSeparatorPos);
    let isInDeclaration = false;
    let hasRenderedContent = false;
    let separatorString = '', leadingString, nextSeparatorString;
    const systemPatternExports = [];
    for (const { node, start, separator, contentEnd, end } of separatedNodes) {
      if (!node.included) {
        code.remove(start, end);
        continue;
      }
      leadingString = '';
      nextSeparatorString = '';
      if (!node.id.included ||
        (node.id instanceof Identifier &&
          isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) {
        if (hasRenderedContent) {
          separatorString += ';';
        }
        isInDeclaration = false;
      }
      else {
        if (options.format === 'system' && node.init !== null) {
          if (node.id.type !== Identifier$1) {
            node.id.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
          }
          else {
            const exportNames = options.exportNamesByVariable.get(node.id.variable);
            if (exportNames) {
              const _ = options.compact ? '' : ' ';
              const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end);
              code.prependLeft(findNonWhiteSpace(code.original, operatorPos + 1), exportNames.length === 1
                ? `exports('${exportNames[0]}',${_}`
                : getSystemExportFunctionLeft([node.id.variable], false, options));
              nextSeparatorString += ')';
            }
          }
        }
        if (isInDeclaration) {
          separatorString += ',';
        }
        else {
          if (hasRenderedContent) {
            separatorString += ';';
          }
          leadingString += `${this.kind} `;
          isInDeclaration = true;
        }
      }
      if (renderedContentEnd === lastSeparatorPos + 1) {
        code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString);
      }
      else {
        code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
        code.appendLeft(renderedContentEnd, leadingString);
      }
      node.render(code, options);
      actualContentEnd = contentEnd;
      renderedContentEnd = end;
      hasRenderedContent = true;
      lastSeparatorPos = separator;
      separatorString = nextSeparatorString;
    }
    this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement);
  }
}

class VariableDeclarator extends NodeBase {
  declareDeclarator(kind) {
    this.id.declare(kind, this.init || UNDEFINED_EXPRESSION);
  }
  deoptimizePath(path) {
    this.id.deoptimizePath(path);
  }
  hasEffects(context) {
    return this.id.hasEffects(context) || (this.init !== null && this.init.hasEffects(context));
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    if (includeChildrenRecursively || this.id.shouldBeIncluded(context)) {
      this.id.include(context, includeChildrenRecursively);
    }
    if (this.init) {
      this.init.include(context, includeChildrenRecursively);
    }
  }
  render(code, options) {
    const renderId = this.id.included;
    if (renderId) {
      this.id.render(code, options);
    }
    else {
      const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);
      code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
    }
    if (this.init) {
      this.init.render(code, options, renderId ? BLANK : { renderedParentType: ExpressionStatement$1 });
    }
    else if (this.id instanceof Identifier &&
      isReassignedExportsMember(this.id.variable, options.exportNamesByVariable)) {
      const _ = options.compact ? '' : ' ';
      code.appendLeft(this.end, `${_}=${_}void 0`);
    }
  }
}

class WhileStatement extends NodeBase {
  hasEffects(context) {
    if (this.test.hasEffects(context))
      return true;
    const { brokenFlow, ignore: { breaks, continues } } = context;
    context.ignore.breaks = true;
    context.ignore.continues = true;
    if (this.body.hasEffects(context))
      return true;
    context.ignore.breaks = breaks;
    context.ignore.continues = continues;
    context.brokenFlow = brokenFlow;
    return false;
  }
  include(context, includeChildrenRecursively) {
    this.included = true;
    this.test.include(context, includeChildrenRecursively);
    const { brokenFlow } = context;
    this.body.includeAsSingleStatement(context, includeChildrenRecursively);
    context.brokenFlow = brokenFlow;
  }
}

class YieldExpression extends NodeBase {
  bind() {
    super.bind();
    if (this.argument !== null) {
      this.argument.deoptimizePath(UNKNOWN_PATH);
    }
  }
  hasEffects(context) {
    return (!context.ignore.returnAwaitYield ||
      (this.argument !== null && this.argument.hasEffects(context)));
  }
  render(code, options) {
    if (this.argument) {
      this.argument.render(code, options, { preventASI: true });
      if (this.argument.start === this.start + 5 /* 'yield'.length */) {
        code.prependLeft(this.start + 5, ' ');
      }
    }
  }
}

const nodeConstructors = {
  ArrayExpression,
  ArrayPattern,
  ArrowFunctionExpression,
  AssignmentExpression,
  AssignmentPattern,
  AwaitExpression,
  BinaryExpression,
  BlockStatement,
  BreakStatement,
  CallExpression,
  CatchClause,
  ChainExpression,
  ClassBody,
  ClassDeclaration,
  ClassExpression,
  ConditionalExpression,
  ContinueStatement,
  DoWhileStatement,
  EmptyStatement,
  ExportAllDeclaration,
  ExportDefaultDeclaration,
  ExportNamedDeclaration,
  ExportSpecifier,
  ExpressionStatement,
  ForInStatement,
  ForOfStatement,
  ForStatement,
  FunctionDeclaration,
  FunctionExpression,
  Identifier,
  IfStatement,
  ImportDeclaration,
  ImportDefaultSpecifier,
  ImportExpression,
  ImportNamespaceSpecifier,
  ImportSpecifier,
  LabeledStatement,
  Literal,
  LogicalExpression,
  MemberExpression,
  MetaProperty,
  MethodDefinition,
  NewExpression,
  ObjectExpression,
  ObjectPattern,
  PrivateIdentifier,
  Program,
  Property,
  PropertyDefinition,
  RestElement,
  ReturnStatement,
  SequenceExpression,
  SpreadElement,
  Super,
  SwitchCase,
  SwitchStatement,
  TaggedTemplateExpression,
  TemplateElement,
  TemplateLiteral,
  ThisExpression,
  ThrowStatement,
  TryStatement,
  UnaryExpression,
  UnknownNode,
  UpdateExpression,
  VariableDeclaration,
  VariableDeclarator,
  WhileStatement,
  YieldExpression
};

function getId(m) {
  return m.id;
}

function getOriginalLocation(sourcemapChain, location) {
  // This cast is guaranteed. If it were a missing Map, it wouldn't have a mappings.
  const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings);
  while (filteredSourcemapChain.length > 0) {
    const sourcemap = filteredSourcemapChain.pop();
    const line = sourcemap.mappings[location.line - 1];
    let locationFound = false;
    if (line !== undefined) {
      for (const segment of line) {
        if (segment[0] >= location.column) {
          if (segment.length === 1)
            break;
          location = {
            column: segment[3],
            line: segment[2] + 1,
            name: segment.length === 5 ? sourcemap.names[segment[4]] : undefined,
            source: sourcemap.sources[segment[1]]
          };
          locationFound = true;
          break;
        }
      }
    }
    if (!locationFound) {
      throw new Error("Can't resolve original location of error.");
    }
  }
  return location;
}

// this looks ridiculous, but it prevents sourcemap tooling from mistaking
// this for an actual sourceMappingURL
let SOURCEMAPPING_URL = 'sourceMa';
SOURCEMAPPING_URL += 'ppingURL';
const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]';
const SOURCEMAPPING_URL_LINE_COMMENT_RE = `//#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`;
const SOURCEMAPPING_URL_BLOCK_COMMENT_RE = `/\\*#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+\\*/`;
const SOURCEMAPPING_URL_COMMENT_RE = new RegExp(`(${SOURCEMAPPING_URL_LINE_COMMENT_RE})|(${SOURCEMAPPING_URL_BLOCK_COMMENT_RE})`, 'g');

const NOOP = () => { };
let getStartTime = () => [0, 0];
let getElapsedTime = () => 0;
let getMemory = () => 0;
let timers = {};
const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
function setTimeHelpers() {
  if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
    getStartTime = process.hrtime.bind(process);
    getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
  }
  else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
    getStartTime = () => [performance.now(), 0];
    getElapsedTime = previous => performance.now() - previous[0];
  }
  if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
    getMemory = () => process.memoryUsage().heapUsed;
  }
}
function getPersistedLabel(label, level) {
  switch (level) {
    case 1:
      return `# ${label}`;
    case 2:
      return `## ${label}`;
    case 3:
      return label;
    default:
      return `${'  '.repeat(level - 4)}- ${label}`;
  }
}
function timeStartImpl(label, level = 3) {
  label = getPersistedLabel(label, level);
  if (!timers.hasOwnProperty(label)) {
    timers[label] = {
      memory: 0,
      startMemory: undefined,
      startTime: undefined,
      time: 0,
      totalMemory: 0
    };
  }
  const currentMemory = getMemory();
  timers[label].startTime = getStartTime();
  timers[label].startMemory = currentMemory;
}
function timeEndImpl(label, level = 3) {
  label = getPersistedLabel(label, level);
  if (timers.hasOwnProperty(label)) {
    const currentMemory = getMemory();
    timers[label].time += getElapsedTime(timers[label].startTime);
    timers[label].totalMemory = Math.max(timers[label].totalMemory, currentMemory);
    timers[label].memory += currentMemory - timers[label].startMemory;
  }
}
function getTimings() {
  const newTimings = {};
  for (const label of Object.keys(timers)) {
    newTimings[label] = [timers[label].time, timers[label].memory, timers[label].totalMemory];
  }
  return newTimings;
}
let timeStart = NOOP, timeEnd = NOOP;
const TIMED_PLUGIN_HOOKS = {
  load: true,
  resolveDynamicImport: true,
  resolveId: true,
  transform: true
};
function getPluginWithTimers(plugin, index) {
  const timedPlugin = {};
  for (const hook of Object.keys(plugin)) {
    if (TIMED_PLUGIN_HOOKS[hook] === true) {
      let timerLabel = `plugin ${index}`;
      if (plugin.name) {
        timerLabel += ` (${plugin.name})`;
      }
      timerLabel += ` - ${hook}`;
      timedPlugin[hook] = function () {
        timeStart(timerLabel, 4);
        let result = plugin[hook].apply(this === timedPlugin ? plugin : this, arguments);
        timeEnd(timerLabel, 4);
        if (result && typeof result.then === 'function') {
          timeStart(`${timerLabel} (async)`, 4);
          result = result.then(() => timeEnd(`${timerLabel} (async)`, 4));
        }
        return result;
      };
    }
    else {
      timedPlugin[hook] = plugin[hook];
    }
  }
  return timedPlugin;
}
function initialiseTimers(inputOptions) {
  if (inputOptions.perf) {
    timers = {};
    setTimeHelpers();
    timeStart = timeStartImpl;
    timeEnd = timeEndImpl;
    inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
  }
  else {
    timeStart = NOOP;
    timeEnd = NOOP;
  }
}

function markModuleAndImpureDependenciesAsExecuted(baseModule) {
  baseModule.isExecuted = true;
  const modules = [baseModule];
  const visitedModules = new Set();
  for (const module of modules) {
    for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) {
      if (!(dependency instanceof ExternalModule) &&
        !dependency.isExecuted &&
        (dependency.info.hasModuleSideEffects || module.implicitlyLoadedBefore.has(dependency)) &&
        !visitedModules.has(dependency.id)) {
        dependency.isExecuted = true;
        visitedModules.add(dependency.id);
        modules.push(dependency);
      }
    }
  }
}

const MISSING_EXPORT_SHIM_DESCRIPTION = {
  identifier: null,
  localName: MISSING_EXPORT_SHIM_VARIABLE
};
function findSourceMappingURLComments(ast, code) {
  const ret = [];
  const addCommentsPos = (start, end) => {
    if (start == end) {
      return;
    }
    let sourcemappingUrlMatch;
    const interStatmentCode = code.slice(start, end);
    while (sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode)) {
      ret.push([start + sourcemappingUrlMatch.index, start + SOURCEMAPPING_URL_COMMENT_RE.lastIndex]);
    }
  };
  let prevStmtEnd = 0;
  for (const stmt of ast.body) {
    addCommentsPos(prevStmtEnd, stmt.start);
    prevStmtEnd = stmt.end;
  }
  addCommentsPos(prevStmtEnd, code.length);
  return ret;
}
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
  const searchedModules = searchedNamesAndModules.get(name);
  if (searchedModules) {
    if (searchedModules.has(target)) {
      return isExportAllSearch ? null : error(errCircularReexport(name, target.id));
    }
    searchedModules.add(target);
  }
  else {
    searchedNamesAndModules.set(name, new Set([target]));
  }
  return target.getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules);
}
function getAndExtendSideEffectModules(variable, module) {
  const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set());
  let currentVariable = variable;
  const referencedVariables = new Set([currentVariable]);
  while (true) {
    const importingModule = currentVariable.module;
    currentVariable =
      currentVariable instanceof ExportDefaultVariable
        ? currentVariable.getDirectOriginalVariable()
        : currentVariable instanceof SyntheticNamedExportVariable
          ? currentVariable.syntheticNamespace
          : null;
    if (!currentVariable || referencedVariables.has(currentVariable)) {
      break;
    }
    referencedVariables.add(currentVariable);
    sideEffectModules.add(importingModule);
    const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable);
    if (originalSideEffects) {
      for (const module of originalSideEffects) {
        sideEffectModules.add(module);
      }
    }
  }
  return sideEffectModules;
}
class Module {
  constructor(graph, id, options, isEntry, hasModuleSideEffects, syntheticNamedExports, meta) {
    this.graph = graph;
    this.id = id;
    this.options = options;
    this.alternativeReexportModules = new Map();
    this.ast = null;
    this.chunkFileNames = new Set();
    this.chunkName = null;
    this.cycles = new Set();
    this.dependencies = new Set();
    this.dynamicDependencies = new Set();
    this.dynamicImporters = [];
    this.dynamicImports = [];
    this.execIndex = Infinity;
    this.exportAllSources = new Set();
    this.exports = Object.create(null);
    this.exportsAll = Object.create(null);
    this.implicitlyLoadedAfter = new Set();
    this.implicitlyLoadedBefore = new Set();
    this.importDescriptions = Object.create(null);
    this.importers = [];
    this.importMetas = [];
    this.imports = new Set();
    this.includedDynamicImporters = [];
    this.isExecuted = false;
    this.isUserDefinedEntryPoint = false;
    this.preserveSignature = this.options.preserveEntrySignatures;
    this.reexportDescriptions = Object.create(null);
    this.sideEffectDependenciesByVariable = new Map();
    this.sources = new Set();
    this.userChunkNames = new Set();
    this.usesTopLevelAwait = false;
    this.allExportNames = null;
    this.exportAllModules = [];
    this.exportNamesByVariable = null;
    this.exportShimVariable = new ExportShimVariable(this);
    this.relevantDependencies = null;
    this.syntheticExports = new Map();
    this.syntheticNamespace = null;
    this.transformDependencies = [];
    this.transitiveReexports = null;
    this.excludeFromSourcemap = /\0/.test(id);
    this.context = options.moduleContext(id);
    const module = this;
    this.info = {
      ast: null,
      code: null,
      get dynamicallyImportedIds() {
        const dynamicallyImportedIds = [];
        for (const { resolution } of module.dynamicImports) {
          if (resolution instanceof Module || resolution instanceof ExternalModule) {
            dynamicallyImportedIds.push(resolution.id);
          }
        }
        return dynamicallyImportedIds;
      },
      get dynamicImporters() {
        return module.dynamicImporters.sort();
      },
      hasModuleSideEffects,
      id,
      get implicitlyLoadedAfterOneOf() {
        return Array.from(module.implicitlyLoadedAfter, getId);
      },
      get implicitlyLoadedBefore() {
        return Array.from(module.implicitlyLoadedBefore, getId);
      },
      get importedIds() {
        return Array.from(module.sources, source => module.resolvedIds[source].id);
      },
      get importers() {
        return module.importers.sort();
      },
      isEntry,
      isExternal: false,
      meta,
      syntheticNamedExports
    };
  }
  basename() {
    const base = basename(this.id);
    const ext = extname$1(this.id);
    return makeLegal(ext ? base.slice(0, -ext.length) : base);
  }
  bindReferences() {
    this.ast.bind();
  }
  error(props, pos) {
    this.addLocationToLogProps(props, pos);
    return error(props);
  }
  getAllExportNames() {
    if (this.allExportNames) {
      return this.allExportNames;
    }
    const allExportNames = (this.allExportNames = new Set());
    for (const name of Object.keys(this.exports)) {
      allExportNames.add(name);
    }
    for (const name of Object.keys(this.reexportDescriptions)) {
      allExportNames.add(name);
    }
    for (const module of this.exportAllModules) {
      if (module instanceof ExternalModule) {
        allExportNames.add(`*${module.id}`);
        continue;
      }
      for (const name of module.getAllExportNames()) {
        if (name !== 'default')
          allExportNames.add(name);
      }
    }
    return allExportNames;
  }
  getDependenciesToBeIncluded() {
    if (this.relevantDependencies)
      return this.relevantDependencies;
    const relevantDependencies = new Set();
    const necessaryDependencies = new Set();
    const alwaysCheckedDependencies = new Set();
    let dependencyVariables = this.imports.keys();
    if (this.info.isEntry ||
      this.includedDynamicImporters.length > 0 ||
      this.namespace.included ||
      this.implicitlyLoadedAfter.size > 0) {
      dependencyVariables = new Set(dependencyVariables);
      for (const exportName of [...this.getReexports(), ...this.getExports()]) {
        dependencyVariables.add(this.getVariableForExportName(exportName));
      }
    }
    for (let variable of dependencyVariables) {
      const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);
      if (sideEffectDependencies) {
        for (const module of sideEffectDependencies) {
          alwaysCheckedDependencies.add(module);
        }
      }
      if (variable instanceof SyntheticNamedExportVariable) {
        variable = variable.getBaseVariable();
      }
      else if (variable instanceof ExportDefaultVariable) {
        variable = variable.getOriginalVariable();
      }
      necessaryDependencies.add(variable.module);
    }
    if (this.options.treeshake && this.info.hasModuleSideEffects !== 'no-treeshake') {
      this.addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies);
    }
    else {
      for (const dependency of this.dependencies) {
        relevantDependencies.add(dependency);
      }
    }
    for (const dependency of necessaryDependencies) {
      relevantDependencies.add(dependency);
    }
    return (this.relevantDependencies = relevantDependencies);
  }
  getExportNamesByVariable() {
    if (this.exportNamesByVariable) {
      return this.exportNamesByVariable;
    }
    const exportNamesByVariable = new Map();
    for (const exportName of this.getAllExportNames()) {
      if (exportName === this.info.syntheticNamedExports)
        continue;
      let tracedVariable = this.getVariableForExportName(exportName);
      if (tracedVariable instanceof ExportDefaultVariable) {
        tracedVariable = tracedVariable.getOriginalVariable();
      }
      if (!tracedVariable ||
        !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) {
        continue;
      }
      const existingExportNames = exportNamesByVariable.get(tracedVariable);
      if (existingExportNames) {
        existingExportNames.push(exportName);
      }
      else {
        exportNamesByVariable.set(tracedVariable, [exportName]);
      }
    }
    return (this.exportNamesByVariable = exportNamesByVariable);
  }
  getExports() {
    return Object.keys(this.exports);
  }
  getReexports() {
    if (this.transitiveReexports) {
      return this.transitiveReexports;
    }
    // to avoid infinite recursion when using circular `export * from X`
    this.transitiveReexports = [];
    const reexports = new Set();
    for (const name in this.reexportDescriptions) {
      reexports.add(name);
    }
    for (const module of this.exportAllModules) {
      if (module instanceof ExternalModule) {
        reexports.add(`*${module.id}`);
      }
      else {
        for (const name of [...module.getReexports(), ...module.getExports()]) {
          if (name !== 'default')
            reexports.add(name);
        }
      }
    }
    return (this.transitiveReexports = [...reexports]);
  }
  getRenderedExports() {
    // only direct exports are counted here, not reexports at all
    const renderedExports = [];
    const removedExports = [];
    for (const exportName in this.exports) {
      const variable = this.getVariableForExportName(exportName);
      (variable && variable.included ? renderedExports : removedExports).push(exportName);
    }
    return { renderedExports, removedExports };
  }
  getSyntheticNamespace() {
    if (this.syntheticNamespace === null) {
      this.syntheticNamespace = undefined;
      this.syntheticNamespace = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string'
        ? this.info.syntheticNamedExports
        : 'default');
    }
    if (!this.syntheticNamespace) {
      return error(errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports));
    }
    return this.syntheticNamespace;
  }
  getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules) {
    if (name[0] === '*') {
      if (name.length === 1) {
        // export * from './other'
        return this.namespace;
      }
      else {
        // export * from 'external'
        const module = this.graph.modulesById.get(name.slice(1));
        return module.getVariableForExportName('*');
      }
    }
    // export { foo } from './other'
    const reexportDeclaration = this.reexportDescriptions[name];
    if (reexportDeclaration) {
      const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
      if (!variable) {
        return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
      }
      if (importerForSideEffects) {
        setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
      }
      return variable;
    }
    const exportDeclaration = this.exports[name];
    if (exportDeclaration) {
      if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {
        return this.exportShimVariable;
      }
      const name = exportDeclaration.localName;
      const variable = this.traceVariable(name, importerForSideEffects);
      if (importerForSideEffects) {
        getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, () => new Set()).add(this);
        setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
      }
      return variable;
    }
    if (name !== 'default') {
      let foundSyntheticDeclaration = null;
      for (const module of this.exportAllModules) {
        const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules);
        if (declaration) {
          if (!(declaration instanceof SyntheticNamedExportVariable)) {
            return declaration;
          }
          if (!foundSyntheticDeclaration) {
            foundSyntheticDeclaration = declaration;
          }
        }
      }
      if (foundSyntheticDeclaration) {
        return foundSyntheticDeclaration;
      }
    }
    if (this.info.syntheticNamedExports) {
      let syntheticExport = this.syntheticExports.get(name);
      if (!syntheticExport) {
        const syntheticNamespace = this.getSyntheticNamespace();
        syntheticExport = new SyntheticNamedExportVariable(this.astContext, name, syntheticNamespace);
        this.syntheticExports.set(name, syntheticExport);
        return syntheticExport;
      }
      return syntheticExport;
    }
    // we don't want to create shims when we are just
    // probing export * modules for exports
    if (!isExportAllSearch) {
      if (this.options.shimMissingExports) {
        this.shimMissingExport(name);
        return this.exportShimVariable;
      }
    }
    return null;
  }
  hasEffects() {
    return (this.info.hasModuleSideEffects === 'no-treeshake' ||
      (this.ast.included && this.ast.hasEffects(createHasEffectsContext())));
  }
  include() {
    const context = createInclusionContext();
    if (this.ast.shouldBeIncluded(context))
      this.ast.include(context, false);
  }
  includeAllExports(includeNamespaceMembers) {
    if (!this.isExecuted) {
      this.graph.needsTreeshakingPass = true;
      markModuleAndImpureDependenciesAsExecuted(this);
    }
    for (const exportName of this.getExports()) {
      if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {
        const variable = this.getVariableForExportName(exportName);
        variable.deoptimizePath(UNKNOWN_PATH);
        if (!variable.included) {
          this.includeVariable(variable);
        }
      }
    }
    for (const name of this.getReexports()) {
      const variable = this.getVariableForExportName(name);
      variable.deoptimizePath(UNKNOWN_PATH);
      if (!variable.included) {
        this.includeVariable(variable);
      }
      if (variable instanceof ExternalVariable) {
        variable.module.reexported = true;
      }
    }
    if (includeNamespaceMembers) {
      this.namespace.prepareNamespace(this.includeAndGetAdditionalMergedNamespaces());
    }
  }
  includeAllInBundle() {
    this.ast.include(createInclusionContext(), true);
  }
  isIncluded() {
    return this.ast.included || this.namespace.included;
  }
  linkImports() {
    this.addModulesToImportDescriptions(this.importDescriptions);
    this.addModulesToImportDescriptions(this.reexportDescriptions);
    for (const name in this.exports) {
      if (name !== 'default' && name !== this.info.syntheticNamedExports) {
        this.exportsAll[name] = this.id;
      }
    }
    const externalExportAllModules = [];
    for (const source of this.exportAllSources) {
      const module = this.graph.modulesById.get(this.resolvedIds[source].id);
      if (module instanceof ExternalModule) {
        externalExportAllModules.push(module);
        continue;
      }
      this.exportAllModules.push(module);
      for (const name in module.exportsAll) {
        if (name in this.exportsAll) {
          this.options.onwarn(errNamespaceConflict(name, this, module));
        }
        else {
          this.exportsAll[name] = module.exportsAll[name];
        }
      }
    }
    this.exportAllModules.push(...externalExportAllModules);
  }
  render(options) {
    const magicString = this.magicString.clone();
    this.ast.render(magicString, options);
    this.usesTopLevelAwait = this.astContext.usesTopLevelAwait;
    return magicString;
  }
  setSource({ alwaysRemovedCode, ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) {
    this.info.code = code;
    this.originalCode = originalCode;
    this.originalSourcemap = originalSourcemap;
    this.sourcemapChain = sourcemapChain;
    if (transformFiles) {
      this.transformFiles = transformFiles;
    }
    this.transformDependencies = transformDependencies;
    this.customTransformCache = customTransformCache;
    this.updateOptions(moduleOptions);
    timeStart('generate ast', 3);
    this.alwaysRemovedCode = alwaysRemovedCode || [];
    if (!ast) {
      ast = this.tryParse();
    }
    this.alwaysRemovedCode.push(...findSourceMappingURLComments(ast, this.info.code));
    timeEnd('generate ast', 3);
    this.resolvedIds = resolvedIds || Object.create(null);
    // By default, `id` is the file name. Custom resolvers and loaders
    // can change that, but it makes sense to use it for the source file name
    const fileName = this.id;
    this.magicString = new MagicString(code, {
      filename: (this.excludeFromSourcemap ? null : fileName),
      indentExclusionRanges: []
    });
    for (const [start, end] of this.alwaysRemovedCode) {
      this.magicString.remove(start, end);
    }
    timeStart('analyse ast', 3);
    this.astContext = {
      addDynamicImport: this.addDynamicImport.bind(this),
      addExport: this.addExport.bind(this),
      addImport: this.addImport.bind(this),
      addImportMeta: this.addImportMeta.bind(this),
      code,
      deoptimizationTracker: this.graph.deoptimizationTracker,
      error: this.error.bind(this),
      fileName,
      getExports: this.getExports.bind(this),
      getModuleExecIndex: () => this.execIndex,
      getModuleName: this.basename.bind(this),
      getReexports: this.getReexports.bind(this),
      importDescriptions: this.importDescriptions,
      includeAllExports: () => this.includeAllExports(true),
      includeDynamicImport: this.includeDynamicImport.bind(this),
      includeVariableInModule: this.includeVariableInModule.bind(this),
      magicString: this.magicString,
      module: this,
      moduleContext: this.context,
      nodeConstructors,
      options: this.options,
      traceExport: this.getVariableForExportName.bind(this),
      traceVariable: this.traceVariable.bind(this),
      usesTopLevelAwait: false,
      warn: this.warn.bind(this)
    };
    this.scope = new ModuleScope(this.graph.scope, this.astContext);
    this.namespace = new NamespaceVariable(this.astContext, this.info.syntheticNamedExports);
    this.ast = new Program(ast, { type: 'Module', context: this.astContext }, this.scope);
    this.info.ast = ast;
    timeEnd('analyse ast', 3);
  }
  toJSON() {
    return {
      alwaysRemovedCode: this.alwaysRemovedCode,
      ast: this.ast.esTreeNode,
      code: this.info.code,
      customTransformCache: this.customTransformCache,
      dependencies: Array.from(this.dependencies, getId),
      id: this.id,
      meta: this.info.meta,
      moduleSideEffects: this.info.hasModuleSideEffects,
      originalCode: this.originalCode,
      originalSourcemap: this.originalSourcemap,
      resolvedIds: this.resolvedIds,
      sourcemapChain: this.sourcemapChain,
      syntheticNamedExports: this.info.syntheticNamedExports,
      transformDependencies: this.transformDependencies,
      transformFiles: this.transformFiles
    };
  }
  traceVariable(name, importerForSideEffects) {
    const localVariable = this.scope.variables.get(name);
    if (localVariable) {
      return localVariable;
    }
    if (name in this.importDescriptions) {
      const importDeclaration = this.importDescriptions[name];
      const otherModule = importDeclaration.module;
      if (otherModule instanceof Module && importDeclaration.name === '*') {
        return otherModule.namespace;
      }
      const declaration = otherModule.getVariableForExportName(importDeclaration.name, importerForSideEffects || this);
      if (!declaration) {
        return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start);
      }
      return declaration;
    }
    return null;
  }
  tryParse() {
    try {
      return this.graph.contextParse(this.info.code);
    }
    catch (err) {
      let message = err.message.replace(/ \(\d+:\d+\)$/, '');
      if (this.id.endsWith('.json')) {
        message += ' (Note that you need @rollup/plugin-json to import JSON files)';
      }
      else if (!this.id.endsWith('.js')) {
        message += ' (Note that you need plugins to import files that are not JavaScript)';
      }
      return this.error({
        code: 'PARSE_ERROR',
        message,
        parserError: err
      }, err.pos);
    }
  }
  updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) {
    if (moduleSideEffects != null) {
      this.info.hasModuleSideEffects = moduleSideEffects;
    }
    if (syntheticNamedExports != null) {
      this.info.syntheticNamedExports = syntheticNamedExports;
    }
    if (meta != null) {
      this.info.meta = { ...this.info.meta, ...meta };
    }
  }
  warn(props, pos) {
    this.addLocationToLogProps(props, pos);
    this.options.onwarn(props);
  }
  addDynamicImport(node) {
    let argument = node.source;
    if (argument instanceof TemplateLiteral) {
      if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) {
        argument = argument.quasis[0].value.cooked;
      }
    }
    else if (argument instanceof Literal && typeof argument.value === 'string') {
      argument = argument.value;
    }
    this.dynamicImports.push({ node, resolution: null, argument });
  }
  addExport(node) {
    if (node instanceof ExportDefaultDeclaration) {
      // export default foo;
      this.exports.default = {
        identifier: node.variable.getAssignedVariableName(),
        localName: 'default'
      };
    }
    else if (node instanceof ExportAllDeclaration) {
      const source = node.source.value;
      this.sources.add(source);
      if (node.exported) {
        // export * as name from './other'
        const name = node.exported.name;
        this.reexportDescriptions[name] = {
          localName: '*',
          module: null,
          source,
          start: node.start
        };
      }
      else {
        // export * from './other'
        this.exportAllSources.add(source);
      }
    }
    else if (node.source instanceof Literal) {
      // export { name } from './other'
      const source = node.source.value;
      this.sources.add(source);
      for (const specifier of node.specifiers) {
        const name = specifier.exported.name;
        this.reexportDescriptions[name] = {
          localName: specifier.local.name,
          module: null,
          source,
          start: specifier.start
        };
      }
    }
    else if (node.declaration) {
      const declaration = node.declaration;
      if (declaration instanceof VariableDeclaration) {
        // export var { foo, bar } = ...
        // export var foo = 1, bar = 2;
        for (const declarator of declaration.declarations) {
          for (const localName of extractAssignedNames(declarator.id)) {
            this.exports[localName] = { identifier: null, localName };
          }
        }
      }
      else {
        // export function foo () {}
        const localName = declaration.id.name;
        this.exports[localName] = { identifier: null, localName };
      }
    }
    else {
      // export { foo, bar, baz }
      for (const specifier of node.specifiers) {
        const localName = specifier.local.name;
        const exportedName = specifier.exported.name;
        this.exports[exportedName] = { identifier: null, localName };
      }
    }
  }
  addImport(node) {
    const source = node.source.value;
    this.sources.add(source);
    for (const specifier of node.specifiers) {
      const isDefault = specifier.type === ImportDefaultSpecifier$1;
      const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
      const name = isDefault
        ? 'default'
        : isNamespace
          ? '*'
          : specifier.imported.name;
      this.importDescriptions[specifier.local.name] = {
        module: null,
        name,
        source,
        start: specifier.start
      };
    }
  }
  addImportMeta(node) {
    this.importMetas.push(node);
  }
  addLocationToLogProps(props, pos) {
    props.id = this.id;
    props.pos = pos;
    let code = this.info.code;
    let { column, line } = locate(code, pos, { offsetLine: 1 });
    try {
      ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));
      code = this.originalCode;
    }
    catch (e) {
      this.options.onwarn({
        code: 'SOURCEMAP_ERROR',
        id: this.id,
        loc: {
          column,
          file: this.id,
          line
        },
        message: `Error when using sourcemap for reporting an error: ${e.message}`,
        pos
      });
    }
    augmentCodeLocation(props, { column, line }, code, this.id);
  }
  addModulesToImportDescriptions(importDescription) {
    for (const name of Object.keys(importDescription)) {
      const specifier = importDescription[name];
      const id = this.resolvedIds[specifier.source].id;
      specifier.module = this.graph.modulesById.get(id);
    }
  }
  addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) {
    const handledDependencies = new Set();
    const addSideEffectDependencies = (possibleDependencies) => {
      for (const dependency of possibleDependencies) {
        if (handledDependencies.has(dependency)) {
          continue;
        }
        handledDependencies.add(dependency);
        if (necessaryDependencies.has(dependency)) {
          relevantDependencies.add(dependency);
          continue;
        }
        if (!(dependency.info.hasModuleSideEffects || alwaysCheckedDependencies.has(dependency))) {
          continue;
        }
        if (dependency instanceof ExternalModule || dependency.hasEffects()) {
          relevantDependencies.add(dependency);
          continue;
        }
        addSideEffectDependencies(dependency.dependencies);
      }
    };
    addSideEffectDependencies(this.dependencies);
    addSideEffectDependencies(alwaysCheckedDependencies);
  }
  includeAndGetAdditionalMergedNamespaces() {
    const mergedNamespaces = [];
    for (const module of this.exportAllModules) {
      if (module instanceof ExternalModule) {
        const externalVariable = module.getVariableForExportName('*');
        externalVariable.include();
        this.imports.add(externalVariable);
        mergedNamespaces.push(externalVariable);
      }
      else if (module.info.syntheticNamedExports) {
        const syntheticNamespace = module.getSyntheticNamespace();
        syntheticNamespace.include();
        this.imports.add(syntheticNamespace);
        mergedNamespaces.push(syntheticNamespace);
      }
    }
    return mergedNamespaces;
  }
  includeDynamicImport(node) {
    const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution;
    if (resolution instanceof Module) {
      resolution.includedDynamicImporters.push(this);
      resolution.includeAllExports(true);
    }
  }
  includeVariable(variable) {
    if (!variable.included) {
      variable.include();
      this.graph.needsTreeshakingPass = true;
      const variableModule = variable.module;
      if (variableModule && variableModule instanceof Module) {
        if (!variableModule.isExecuted) {
          markModuleAndImpureDependenciesAsExecuted(variableModule);
        }
        if (variableModule !== this) {
          const sideEffectModules = getAndExtendSideEffectModules(variable, this);
          for (const module of sideEffectModules) {
            if (!module.isExecuted) {
              markModuleAndImpureDependenciesAsExecuted(module);
            }
          }
        }
      }
    }
  }
  includeVariableInModule(variable) {
    this.includeVariable(variable);
    const variableModule = variable.module;
    if (variableModule && variableModule !== this) {
      this.imports.add(variable);
    }
  }
  shimMissingExport(name) {
    this.options.onwarn({
      code: 'SHIMMED_EXPORT',
      exporter: relativeId(this.id),
      exportName: name,
      message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.`
    });
    this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION;
  }
}
// if there is a cyclic import in the reexport chain, we should not
// import from the original module but from the cyclic module to not
// mess up execution order.
function setAlternativeExporterIfCyclic(variable, importer, reexporter) {
  if (variable.module instanceof Module && variable.module !== reexporter) {
    const exporterCycles = variable.module.cycles;
    if (exporterCycles.size > 0) {
      const importerCycles = reexporter.cycles;
      for (const cycleSymbol of importerCycles) {
        if (exporterCycles.has(cycleSymbol)) {
          importer.alternativeReexportModules.set(variable, reexporter);
          break;
        }
      }
    }
  }
}

class Source {
  constructor(filename, content) {
    this.isOriginal = true;
    this.filename = filename;
    this.content = content;
  }
  traceSegment(line, column, name) {
    return { line, column, name, source: this };
  }
}
class Link {
  constructor(map, sources) {
    this.sources = sources;
    this.names = map.names;
    this.mappings = map.mappings;
  }
  traceMappings() {
    const sources = [];
    const sourcesContent = [];
    const names = [];
    const mappings = [];
    for (const line of this.mappings) {
      const tracedLine = [];
      for (const segment of line) {
        if (segment.length == 1)
          continue;
        const source = this.sources[segment[1]];
        if (!source)
          continue;
        const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : '');
        if (traced) {
          // newer sources are more likely to be used, so search backwards.
          let sourceIndex = sources.lastIndexOf(traced.source.filename);
          if (sourceIndex === -1) {
            sourceIndex = sources.length;
            sources.push(traced.source.filename);
            sourcesContent[sourceIndex] = traced.source.content;
          }
          else if (sourcesContent[sourceIndex] == null) {
            sourcesContent[sourceIndex] = traced.source.content;
          }
          else if (traced.source.content != null &&
            sourcesContent[sourceIndex] !== traced.source.content) {
            return error({
              message: `Multiple conflicting contents for sourcemap source ${traced.source.filename}`
            });
          }
          const tracedSegment = [
            segment[0],
            sourceIndex,
            traced.line,
            traced.column
          ];
          if (traced.name) {
            let nameIndex = names.indexOf(traced.name);
            if (nameIndex === -1) {
              nameIndex = names.length;
              names.push(traced.name);
            }
            tracedSegment[4] = nameIndex;
          }
          tracedLine.push(tracedSegment);
        }
      }
      mappings.push(tracedLine);
    }
    return { sources, sourcesContent, names, mappings };
  }
  traceSegment(line, column, name) {
    const segments = this.mappings[line];
    if (!segments)
      return null;
    // binary search through segments for the given column
    let i = 0;
    let j = segments.length - 1;
    while (i <= j) {
      const m = (i + j) >> 1;
      const segment = segments[m];
      if (segment[0] === column) {
        if (segment.length == 1)
          return null;
        const source = this.sources[segment[1]];
        if (!source)
          return null;
        return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
      }
      if (segment[0] > column) {
        j = m - 1;
      }
      else {
        i = m + 1;
      }
    }
    return null;
  }
}
function getLinkMap(warn) {
  return function linkMap(source, map) {
    if (map.mappings) {
      return new Link(map, [source]);
    }
    warn({
      code: 'SOURCEMAP_BROKEN',
      message: `Sourcemap is likely to be incorrect: a plugin (${map.plugin}) was used to transform ` +
        "files, but didn't generate a sourcemap for the transformation. Consult the plugin " +
        'documentation for help',
      plugin: map.plugin,
      url: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`
    });
    return new Link({
      mappings: [],
      names: []
    }, [source]);
  };
}
function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
  let source;
  if (!originalSourcemap) {
    source = new Source(id, originalCode);
  }
  else {
    const sources = originalSourcemap.sources;
    const sourcesContent = originalSourcemap.sourcesContent || [];
    const directory = dirname(id) || '.';
    const sourceRoot = originalSourcemap.sourceRoot || '.';
    const baseSources = sources.map((source, i) => new Source(resolve$3(directory, sourceRoot, source), sourcesContent[i]));
    source = new Link(originalSourcemap, baseSources);
  }
  return sourcemapChain.reduce(linkMap, source);
}
function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, warn) {
  const linkMap = getLinkMap(warn);
  const moduleSources = modules
    .filter(module => !module.excludeFromSourcemap)
    .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
  // DecodedSourceMap (from magic-string) uses a number[] instead of the more
  // correct SourceMapSegment tuples. Cast it here to gain type safety.
  let source = new Link(map, moduleSources);
  source = bundleSourcemapChain.reduce(linkMap, source);
  let { sources, sourcesContent, names, mappings } = source.traceMappings();
  if (file) {
    const directory = dirname(file);
    sources = sources.map((source) => relative$1(directory, source));
    file = basename(file);
  }
  sourcesContent = (excludeContent ? null : sourcesContent);
  return new SourceMap({ file, sources, sourcesContent, names, mappings });
}
function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn) {
  if (!sourcemapChain.length) {
    return originalSourcemap;
  }
  const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(warn));
  const map = source.traceMappings();
  return { version: 3, ...map };
}

const createHash = () => createHash$1();

const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
  amd: deconflictImportsOther,
  cjs: deconflictImportsOther,
  es: deconflictImportsEsmOrSystem,
  iife: deconflictImportsOther,
  system: deconflictImportsEsmOrSystem,
  umd: deconflictImportsOther
};
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
  const reversedModules = modules.slice().reverse();
  for (const module of reversedModules) {
    module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
  }
  deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
  DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
  for (const module of reversedModules) {
    module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
  }
}
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) {
  // This is needed for namespace reexports
  for (const dependency of dependenciesToBeDeconflicted.dependencies) {
    if (preserveModules || dependency instanceof ExternalModule) {
      dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
    }
  }
  for (const variable of imports) {
    const module = variable.module;
    const name = variable.name;
    if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {
      variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName);
    }
    else if (module instanceof ExternalModule && name === 'default') {
      variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
        ? module.suggestedVariableName + '__default'
        : module.suggestedVariableName, usedNames));
    }
    else {
      variable.setRenderNames(null, getSafeName(name, usedNames));
    }
  }
  for (const variable of syntheticExports) {
    variable.setRenderNames(null, getSafeName(variable.name, usedNames));
  }
}
function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule) {
  for (const chunkOrExternalModule of dependencies) {
    chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames);
  }
  for (const externalModuleOrChunk of deconflictedNamespace) {
    externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames);
  }
  for (const externalModule of deconflictedDefault) {
    if (deconflictedNamespace.has(externalModule) &&
      canDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)) {
      externalModule.defaultVariableName = externalModule.namespaceVariableName;
    }
    else {
      externalModule.defaultVariableName = getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames);
    }
  }
  for (const variable of imports) {
    const module = variable.module;
    if (module instanceof ExternalModule) {
      const name = variable.name;
      if (name === 'default') {
        const moduleInterop = String(interop(module.id));
        const variableName = defaultInteropHelpersByInteropType[moduleInterop]
          ? module.defaultVariableName
          : module.variableName;
        if (isDefaultAProperty(moduleInterop, externalLiveBindings)) {
          variable.setRenderNames(variableName, 'default');
        }
        else {
          variable.setRenderNames(null, variableName);
        }
      }
      else if (name === '*') {
        variable.setRenderNames(null, namespaceInteropHelpersByInteropType[String(interop(module.id))]
          ? module.namespaceVariableName
          : module.variableName);
      }
      else {
        // if the second parameter is `null`, it uses its "name" for the property name
        variable.setRenderNames(module.variableName, null);
      }
    }
    else {
      const chunk = chunkByModule.get(module);
      if (preserveModules && variable.isNamespace) {
        variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName);
      }
      else if (chunk.exportMode === 'default') {
        variable.setRenderNames(null, chunk.variableName);
      }
      else {
        variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable));
      }
    }
  }
}
function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
  for (const module of modules) {
    for (const variable of module.scope.variables.values()) {
      if (variable.included &&
        // this will only happen for exports in some formats
        !(variable.renderBaseName ||
          (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
        variable.setRenderNames(null, getSafeName(variable.name, usedNames));
      }
    }
    if (includedNamespaces.has(module)) {
      const namespace = module.namespace;
      namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
    }
  }
}

const needsEscapeRegEx = /[\\'\r\n\u2028\u2029]/;
const quoteNewlineRegEx = /(['\r\n\u2028\u2029])/g;
const backSlashRegEx = /\\/g;
function escapeId(id) {
  if (!id.match(needsEscapeRegEx))
    return id;
  return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1');
}

function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
  let nameIndex = 0;
  for (const variable of exports) {
    let exportName = variable.name[0];
    if (exportsByName[exportName]) {
      do {
        exportName = toBase64(++nameIndex);
        // skip past leading number identifiers
        if (exportName.charCodeAt(0) === 49 /* '1' */) {
          nameIndex += 9 * 64 ** (exportName.length - 1);
          exportName = toBase64(nameIndex);
        }
      } while (RESERVED_NAMES[exportName] || exportsByName[exportName]);
    }
    exportsByName[exportName] = variable;
    exportNamesByVariable.set(variable, [exportName]);
  }
}
function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
  for (const variable of exports) {
    let nameIndex = 0;
    let exportName = variable.name;
    while (exportsByName[exportName]) {
      exportName = variable.name + '$' + ++nameIndex;
    }
    exportsByName[exportName] = variable;
    exportNamesByVariable.set(variable, [exportName]);
  }
}

function getExportMode(chunk, { exports: exportMode, name, format }, unsetOptions, facadeModuleId, warn) {
  const exportKeys = chunk.getExportNames();
  if (exportMode === 'default') {
    if (exportKeys.length !== 1 || exportKeys[0] !== 'default') {
      return error(errIncompatibleExportOptionValue('default', exportKeys, facadeModuleId));
    }
  }
  else if (exportMode === 'none' && exportKeys.length) {
    return error(errIncompatibleExportOptionValue('none', exportKeys, facadeModuleId));
  }
  if (exportMode === 'auto') {
    if (exportKeys.length === 0) {
      exportMode = 'none';
    }
    else if (exportKeys.length === 1 && exportKeys[0] === 'default') {
      if (format === 'cjs' && unsetOptions.has('exports')) {
        warn(errPreferNamedExports(facadeModuleId));
      }
      exportMode = 'default';
    }
    else {
      if (format !== 'es' && exportKeys.indexOf('default') !== -1) {
        warn(errMixedExport(facadeModuleId, name));
      }
      exportMode = 'named';
    }
  }
  return exportMode;
}

function guessIndentString(code) {
  const lines = code.split('\n');
  const tabbed = lines.filter(line => /^\t+/.test(line));
  const spaced = lines.filter(line => /^ {2,}/.test(line));
  if (tabbed.length === 0 && spaced.length === 0) {
    return null;
  }
  // More lines tabbed than spaced? Assume tabs, and
  // default to tabs in the case of a tie (or nothing
  // to go on)
  if (tabbed.length >= spaced.length) {
    return '\t';
  }
  // Otherwise, we need to guess the multiple
  const min = spaced.reduce((previous, current) => {
    const numSpaces = /^ +/.exec(current)[0].length;
    return Math.min(numSpaces, previous);
  }, Infinity);
  return new Array(min + 1).join(' ');
}
function getIndentString(modules, options) {
  if (options.indent !== true)
    return options.indent;
  for (let i = 0; i < modules.length; i++) {
    const indent = guessIndentString(modules[i].originalCode);
    if (indent !== null)
      return indent;
  }
  return '\t';
}

function getStaticDependencies(chunk, orderedModules, chunkByModule) {
  const staticDependencyBlocks = [];
  const handledDependencies = new Set();
  for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {
    const module = orderedModules[modulePos];
    if (!handledDependencies.has(module)) {
      const staticDependencies = [];
      addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);
      staticDependencyBlocks.unshift(staticDependencies);
    }
  }
  const dependencies = new Set();
  for (const block of staticDependencyBlocks) {
    for (const dependency of block) {
      dependencies.add(dependency);
    }
  }
  return dependencies;
}
function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule) {
  const dependencies = module.getDependenciesToBeIncluded();
  for (const dependency of dependencies) {
    if (dependency instanceof ExternalModule) {
      staticDependencies.push(dependency);
      continue;
    }
    const dependencyChunk = chunkByModule.get(dependency);
    if (dependencyChunk !== chunk) {
      staticDependencies.push(dependencyChunk);
      continue;
    }
    if (!handledModules.has(dependency)) {
      handledModules.add(dependency);
      addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);
    }
  }
}

function decodedSourcemap(map) {
  if (!map)
    return null;
  if (typeof map === 'string') {
    map = JSON.parse(map);
  }
  if (map.mappings === '') {
    return {
      mappings: [],
      names: [],
      sources: [],
      version: 3
    };
  }
  let mappings;
  if (typeof map.mappings === 'string') {
    mappings = decode(map.mappings);
  }
  else {
    mappings = map.mappings;
  }
  return { ...map, mappings };
}

function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemapChain }) {
  const renderChunkReducer = (code, result, plugin) => {
    if (result == null)
      return code;
    if (typeof result === 'string')
      result = {
        code: result,
        map: undefined
      };
    // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning
    if (result.map !== null) {
      const map = decodedSourcemap(result.map);
      sourcemapChain.push(map || { missing: true, plugin: plugin.name });
    }
    return result.code;
  };
  return outputPluginDriver.hookReduceArg0('renderChunk', [code, renderChunk, options], renderChunkReducer);
}

function renderNamePattern(pattern, patternName, replacements) {
  if (!isPlainPathFragment(pattern))
    return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`));
  return pattern.replace(/\[(\w+)\]/g, (_match, type) => {
    if (!replacements.hasOwnProperty(type)) {
      return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`));
    }
    const replacement = replacements[type]();
    if (!isPlainPathFragment(replacement))
      return error(errFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`));
    return replacement;
  });
}
function makeUnique(name, existingNames) {
  const existingNamesLowercase = new Set(Object.keys(existingNames).map(key => key.toLowerCase()));
  if (!existingNamesLowercase.has(name.toLocaleLowerCase()))
    return name;
  const ext = extname$1(name);
  name = name.substr(0, name.length - ext.length);
  let uniqueName, uniqueIndex = 1;
  while (existingNamesLowercase.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()))
    ;
  return uniqueName;
}

const NON_ASSET_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
function getGlobalName(module, globals, hasExports, warn) {
  const globalName = typeof globals === 'function' ? globals(module.id) : globals[module.id];
  if (globalName) {
    return globalName;
  }
  if (hasExports) {
    warn({
      code: 'MISSING_GLOBAL_NAME',
      guess: module.variableName,
      message: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`,
      source: module.id
    });
    return module.variableName;
  }
}
class Chunk {
  constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
    this.orderedModules = orderedModules;
    this.inputOptions = inputOptions;
    this.outputOptions = outputOptions;
    this.unsetOptions = unsetOptions;
    this.pluginDriver = pluginDriver;
    this.modulesById = modulesById;
    this.chunkByModule = chunkByModule;
    this.facadeChunkByModule = facadeChunkByModule;
    this.includedNamespaces = includedNamespaces;
    this.manualChunkAlias = manualChunkAlias;
    this.entryModules = [];
    this.exportMode = 'named';
    this.facadeModule = null;
    this.id = null;
    this.namespaceVariableName = '';
    this.variableName = '';
    this.accessedGlobalsByScope = new Map();
    this.dependencies = new Set();
    this.dynamicDependencies = new Set();
    this.dynamicEntryModules = [];
    this.exportNamesByVariable = new Map();
    this.exports = new Set();
    this.exportsByName = Object.create(null);
    this.fileName = null;
    this.implicitEntryModules = [];
    this.implicitlyLoadedBefore = new Set();
    this.imports = new Set();
    this.indentString = undefined;
    this.isEmpty = true;
    this.name = null;
    this.needsExportsShim = false;
    this.renderedDependencies = null;
    this.renderedExports = null;
    this.renderedHash = undefined;
    this.renderedModules = Object.create(null);
    this.renderedModuleSources = new Map();
    this.renderedSource = null;
    this.sortedExportNames = null;
    this.strictFacade = false;
    this.usedModules = undefined;
    this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;
    const chunkModules = new Set(orderedModules);
    for (const module of orderedModules) {
      if (module.namespace.included) {
        includedNamespaces.add(module);
      }
      if (this.isEmpty && module.isIncluded()) {
        this.isEmpty = false;
      }
      if (module.info.isEntry || outputOptions.preserveModules) {
        this.entryModules.push(module);
      }
      for (const importer of module.includedDynamicImporters) {
        if (!chunkModules.has(importer)) {
          this.dynamicEntryModules.push(module);
          // Modules with synthetic exports need an artificial namespace for dynamic imports
          if (module.info.syntheticNamedExports && !outputOptions.preserveModules) {
            includedNamespaces.add(module);
            this.exports.add(module.namespace);
          }
        }
      }
      if (module.implicitlyLoadedAfter.size > 0) {
        this.implicitEntryModules.push(module);
      }
    }
    this.suggestedVariableName = makeLegal(this.generateVariableName());
  }
  static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
    const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
    chunk.assignFacadeName(facadeName, facadedModule);
    if (!facadeChunkByModule.has(facadedModule)) {
      facadeChunkByModule.set(facadedModule, chunk);
    }
    for (const dependency of facadedModule.getDependenciesToBeIncluded()) {
      chunk.dependencies.add(dependency instanceof Module ? chunkByModule.get(dependency) : dependency);
    }
    if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) &&
      facadedModule.info.hasModuleSideEffects &&
      facadedModule.hasEffects()) {
      chunk.dependencies.add(chunkByModule.get(facadedModule));
    }
    chunk.ensureReexportsAreAvailableForModule(facadedModule);
    chunk.facadeModule = facadedModule;
    chunk.strictFacade = true;
    return chunk;
  }
  canModuleBeFacade(module, exposedVariables) {
    const moduleExportNamesByVariable = module.getExportNamesByVariable();
    for (const exposedVariable of this.exports) {
      if (!moduleExportNamesByVariable.has(exposedVariable)) {
        if (moduleExportNamesByVariable.size === 0 &&
          module.isUserDefinedEntryPoint &&
          module.preserveSignature === 'strict' &&
          this.unsetOptions.has('preserveEntrySignatures')) {
          this.inputOptions.onwarn({
            code: 'EMPTY_FACADE',
            id: module.id,
            message: `To preserve the export signature of the entry module "${relativeId(module.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,
            url: 'https://rollupjs.org/guide/en/#preserveentrysignatures'
          });
        }
        return false;
      }
    }
    for (const exposedVariable of exposedVariables) {
      if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
        return false;
      }
    }
    return true;
  }
  generateExports() {
    this.sortedExportNames = null;
    const remainingExports = new Set(this.exports);
    if (this.facadeModule !== null &&
      (this.facadeModule.preserveSignature !== false || this.strictFacade)) {
      const exportNamesByVariable = this.facadeModule.getExportNamesByVariable();
      for (const [variable, exportNames] of exportNamesByVariable) {
        this.exportNamesByVariable.set(variable, [...exportNames]);
        for (const exportName of exportNames) {
          this.exportsByName[exportName] = variable;
        }
        remainingExports.delete(variable);
      }
    }
    if (this.outputOptions.minifyInternalExports) {
      assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
    }
    else {
      assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
    }
    if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry))
      this.exportMode = getExportMode(this, this.outputOptions, this.unsetOptions, this.facadeModule.id, this.inputOptions.onwarn);
  }
  generateFacades() {
    var _a;
    const facades = [];
    const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]);
    const exposedVariables = new Set(this.dynamicEntryModules.map(module => module.namespace));
    for (const module of entryModules) {
      if (module.preserveSignature) {
        for (const exportedVariable of module.getExportNamesByVariable().keys()) {
          exposedVariables.add(exportedVariable);
        }
      }
    }
    for (const module of entryModules) {
      const requiredFacades = Array.from(module.userChunkNames, name => ({
        name
      }));
      if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {
        requiredFacades.push({});
      }
      requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));
      if (requiredFacades.length === 0) {
        requiredFacades.push({});
      }
      if (!this.facadeModule) {
        const needsStrictFacade = module.preserveSignature === 'strict' ||
          (module.preserveSignature === 'exports-only' &&
            module.getExportNamesByVariable().size !== 0);
        if (!needsStrictFacade ||
          this.outputOptions.preserveModules ||
          this.canModuleBeFacade(module, exposedVariables)) {
          this.facadeModule = module;
          this.facadeChunkByModule.set(module, this);
          if (module.preserveSignature) {
            this.strictFacade = needsStrictFacade;
          }
          this.assignFacadeName(requiredFacades.shift(), module);
        }
      }
      for (const facadeName of requiredFacades) {
        facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
      }
    }
    for (const module of this.dynamicEntryModules) {
      if (module.info.syntheticNamedExports)
        continue;
      if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
        this.facadeModule = module;
        this.facadeChunkByModule.set(module, this);
        this.strictFacade = true;
        this.assignFacadeName({}, module);
      }
      else if (this.facadeModule === module &&
        !this.strictFacade &&
        this.canModuleBeFacade(module, exposedVariables)) {
        this.strictFacade = true;
      }
      else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) {
        this.includedNamespaces.add(module);
        this.exports.add(module.namespace);
      }
    }
    return facades;
  }
  generateId(addons, options, existingNames, includeHash) {
    if (this.fileName !== null) {
      return this.fileName;
    }
    const [pattern, patternName] = this.facadeModule && this.facadeModule.isUserDefinedEntryPoint
      ? [options.entryFileNames, 'output.entryFileNames']
      : [options.chunkFileNames, 'output.chunkFileNames'];
    return makeUnique(renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, patternName, {
      format: () => options.format,
      hash: () => includeHash
        ? this.computeContentHashWithDependencies(addons, options, existingNames)
        : '[hash]',
      name: () => this.getChunkName()
    }), existingNames);
  }
  generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
    const id = this.orderedModules[0].id;
    const sanitizedId = sanitizeFileName(id);
    let path;
    if (isAbsolute(id)) {
      const extension = extname$1(id);
      const pattern = unsetOptions.has('entryFileNames')
        ? NON_ASSET_EXTENSIONS.includes(extension)
          ? '[name].js'
          : '[name][extname].js'
        : options.entryFileNames;
      const currentDir = dirname(sanitizedId);
      const fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, 'output.entryFileNames', {
        ext: () => extension.substr(1),
        extname: () => extension,
        format: () => options.format,
        name: () => this.getChunkName()
      });
      const currentPath = `${currentDir}/${fileName}`;
      const { preserveModulesRoot } = options;
      if (preserveModulesRoot && currentPath.startsWith(preserveModulesRoot)) {
        path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, '');
      }
      else {
        path = relative(preserveModulesRelativeDir, currentPath);
      }
    }
    else {
      path = `_virtual/${basename(sanitizedId)}`;
    }
    return makeUnique(normalize(path), existingNames);
  }
  getChunkInfo() {
    const facadeModule = this.facadeModule;
    const getChunkName = this.getChunkName.bind(this);
    return {
      exports: this.getExportNames(),
      facadeModuleId: facadeModule && facadeModule.id,
      isDynamicEntry: this.dynamicEntryModules.length > 0,
      isEntry: facadeModule !== null && facadeModule.info.isEntry,
      isImplicitEntry: this.implicitEntryModules.length > 0,
      modules: this.renderedModules,
      get name() {
        return getChunkName();
      },
      type: 'chunk'
    };
  }
  getChunkInfoWithFileNames() {
    return Object.assign(this.getChunkInfo(), {
      code: undefined,
      dynamicImports: Array.from(this.dynamicDependencies, getId),
      fileName: this.id,
      implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId),
      importedBindings: this.getImportedBindingsPerDependency(),
      imports: Array.from(this.dependencies, getId),
      map: undefined,
      referencedFiles: this.getReferencedFiles()
    });
  }
  getChunkName() {
    return this.name || (this.name = sanitizeFileName(this.getFallbackChunkName()));
  }
  getExportNames() {
    return (this.sortedExportNames || (this.sortedExportNames = Object.keys(this.exportsByName).sort()));
  }
  getRenderedHash() {
    if (this.renderedHash)
      return this.renderedHash;
    const hash = createHash();
    const hashAugmentation = this.pluginDriver.hookReduceValueSync('augmentChunkHash', '', [this.getChunkInfo()], (augmentation, pluginHash) => {
      if (pluginHash) {
        augmentation += pluginHash;
      }
      return augmentation;
    });
    hash.update(hashAugmentation);
    hash.update(this.renderedSource.toString());
    hash.update(this.getExportNames()
      .map(exportName => {
      const variable = this.exportsByName[exportName];
      return `${relativeId(variable.module.id).replace(/\\/g, '/')}:${variable.name}:${exportName}`;
    })
      .join(','));
    return (this.renderedHash = hash.digest('hex'));
  }
  getVariableExportName(variable) {
    if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) {
      return '*';
    }
    return this.exportNamesByVariable.get(variable)[0];
  }
  link() {
    this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);
    for (const module of this.orderedModules) {
      this.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);
      this.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);
      this.setUpChunkImportsAndExportsForModule(module);
    }
  }
  // prerender allows chunk hashes and names to be generated before finalizing
  preRender(options, inputBase) {
    const magicString = new Bundle$1({ separator: options.compact ? '' : '\n\n' });
    this.usedModules = [];
    this.indentString = getIndentString(this.orderedModules, options);
    const n = options.compact ? '' : '\n';
    const _ = options.compact ? '' : ' ';
    const renderOptions = {
      compact: options.compact,
      dynamicImportFunction: options.dynamicImportFunction,
      exportNamesByVariable: this.exportNamesByVariable,
      format: options.format,
      freeze: options.freeze,
      indent: this.indentString,
      namespaceToStringTag: options.namespaceToStringTag,
      outputPluginDriver: this.pluginDriver,
      varOrConst: options.preferConst ? 'const' : 'var'
    };
    // for static and dynamic entry points, inline the execution list to avoid loading latency
    if (options.hoistTransitiveImports &&
      !this.outputOptions.preserveModules &&
      this.facadeModule !== null) {
      for (const dep of this.dependencies) {
        if (dep instanceof Chunk)
          this.inlineChunkDependencies(dep);
      }
    }
    this.prepareDynamicImportsAndImportMetas();
    this.setIdentifierRenderResolutions(options);
    let hoistedSource = '';
    const renderedModules = this.renderedModules;
    for (const module of this.orderedModules) {
      let renderedLength = 0;
      if (module.isIncluded() || this.includedNamespaces.has(module)) {
        const source = module.render(renderOptions).trim();
        renderedLength = source.length();
        if (renderedLength) {
          if (options.compact && source.lastLine().indexOf('//') !== -1)
            source.append('\n');
          this.renderedModuleSources.set(module, source);
          magicString.addSource(source);
          this.usedModules.push(module);
        }
        const namespace = module.namespace;
        if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {
          const rendered = namespace.renderBlock(renderOptions);
          if (namespace.renderFirst())
            hoistedSource += n + rendered;
          else
            magicString.addSource(new MagicString(rendered));
        }
      }
      const { renderedExports, removedExports } = module.getRenderedExports();
      renderedModules[module.id] = {
        originalLength: module.originalCode.length,
        removedExports,
        renderedExports,
        renderedLength
      };
    }
    if (hoistedSource)
      magicString.prepend(hoistedSource + n + n);
    if (this.needsExportsShim) {
      magicString.prepend(`${n}${renderOptions.varOrConst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);
    }
    if (options.compact) {
      this.renderedSource = magicString;
    }
    else {
      this.renderedSource = magicString.trim();
    }
    this.renderedHash = undefined;
    if (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {
      const chunkName = this.getChunkName();
      this.inputOptions.onwarn({
        chunkName,
        code: 'EMPTY_BUNDLE',
        message: `Generated an empty chunk: "${chunkName}"`
      });
    }
    this.setExternalRenderPaths(options, inputBase);
    this.renderedDependencies = this.getChunkDependencyDeclarations(options);
    this.renderedExports =
      this.exportMode === 'none' ? [] : this.getChunkExportDeclarations(options.format);
  }
  async render(options, addons, outputChunk) {
    timeStart('render format', 2);
    const format = options.format;
    const finalise = finalisers[format];
    if (options.dynamicImportFunction && format !== 'es') {
      this.inputOptions.onwarn({
        code: 'INVALID_OPTION',
        message: '"output.dynamicImportFunction" is ignored for formats other than "es".'
      });
    }
    // populate ids in the rendered declarations only here
    // as chunk ids known only after prerender
    for (const dependency of this.dependencies) {
      const renderedDependency = this.renderedDependencies.get(dependency);
      if (dependency instanceof ExternalModule) {
        const originalId = dependency.renderPath;
        renderedDependency.id = escapeId(dependency.renormalizeRenderPath ? this.getRelativePath(originalId, false) : originalId);
      }
      else {
        renderedDependency.namedExportsMode = dependency.exportMode !== 'default';
        renderedDependency.id = escapeId(this.getRelativePath(dependency.id, false));
      }
    }
    this.finaliseDynamicImports(options);
    this.finaliseImportMetas(format);
    const hasExports = this.renderedExports.length !== 0 ||
      [...this.renderedDependencies.values()].some(dep => (dep.reexports && dep.reexports.length !== 0));
    let usesTopLevelAwait = false;
    const accessedGlobals = new Set();
    for (const module of this.orderedModules) {
      if (module.usesTopLevelAwait) {
        usesTopLevelAwait = true;
      }
      const accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope);
      if (accessedGlobalVariables) {
        for (const name of accessedGlobalVariables) {
          accessedGlobals.add(name);
        }
      }
    }
    if (usesTopLevelAwait && format !== 'es' && format !== 'system') {
      return error({
        code: 'INVALID_TLA_FORMAT',
        message: `Module format ${format} does not support top-level await. Use the "es" or "system" output formats rather.`
      });
    }
    /* istanbul ignore next */
    if (!this.id) {
      throw new Error('Internal Error: expecting chunk id');
    }
    const magicString = finalise(this.renderedSource, {
      accessedGlobals,
      dependencies: [...this.renderedDependencies.values()],
      exports: this.renderedExports,
      hasExports,
      id: this.id,
      indentString: this.indentString,
      intro: addons.intro,
      isEntryFacade: this.outputOptions.preserveModules ||
        (this.facadeModule !== null && this.facadeModule.info.isEntry),
      isModuleFacade: this.facadeModule !== null,
      namedExportsMode: this.exportMode !== 'default',
      outro: addons.outro,
      usesTopLevelAwait,
      varOrConst: options.preferConst ? 'const' : 'var',
      warn: this.inputOptions.onwarn
    }, options);
    if (addons.banner)
      magicString.prepend(addons.banner);
    if (addons.footer)
      magicString.append(addons.footer);
    const prevCode = magicString.toString();
    timeEnd('render format', 2);
    let map = null;
    const chunkSourcemapChain = [];
    let code = await renderChunk({
      code: prevCode,
      options,
      outputPluginDriver: this.pluginDriver,
      renderChunk: outputChunk,
      sourcemapChain: chunkSourcemapChain
    });
    if (options.sourcemap) {
      timeStart('sourcemap', 2);
      let file;
      if (options.file)
        file = resolve$3(options.sourcemapFile || options.file);
      else if (options.dir)
        file = resolve$3(options.dir, this.id);
      else
        file = resolve$3(this.id);
      const decodedMap = magicString.generateDecodedMap({});
      map = collapseSourcemaps(file, decodedMap, this.usedModules, chunkSourcemapChain, options.sourcemapExcludeSources, this.inputOptions.onwarn);
      map.sources = map.sources
        .map(sourcePath => {
        const { sourcemapPathTransform } = options;
        if (sourcemapPathTransform) {
          const newSourcePath = sourcemapPathTransform(sourcePath, `${file}.map`);
          if (typeof newSourcePath !== 'string') {
            error(errFailedValidation(`sourcemapPathTransform function must return a string.`));
          }
          return newSourcePath;
        }
        return sourcePath;
      })
        .map(normalize);
      timeEnd('sourcemap', 2);
    }
    if (!options.compact && code[code.length - 1] !== '\n')
      code += '\n';
    return { code, map };
  }
  addDependenciesToChunk(moduleDependencies, chunkDependencies) {
    for (const module of moduleDependencies) {
      if (module instanceof Module) {
        const chunk = this.chunkByModule.get(module);
        if (chunk && chunk !== this) {
          chunkDependencies.add(chunk);
        }
      }
      else {
        chunkDependencies.add(module);
      }
    }
  }
  assignFacadeName({ fileName, name }, facadedModule) {
    if (fileName) {
      this.fileName = fileName;
    }
    else {
      this.name = sanitizeFileName(name || facadedModule.chunkName || getAliasName(facadedModule.id));
    }
  }
  checkCircularDependencyImport(variable, importingModule) {
    const variableModule = variable.module;
    if (variableModule instanceof Module) {
      const exportChunk = this.chunkByModule.get(variableModule);
      let alternativeReexportModule;
      do {
        alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
        if (alternativeReexportModule) {
          const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
          if (exportingChunk && exportingChunk !== exportChunk) {
            this.inputOptions.onwarn(errCyclicCrossChunkReexport(variableModule.getExportNamesByVariable().get(variable)[0], variableModule.id, alternativeReexportModule.id, importingModule.id));
          }
          importingModule = alternativeReexportModule;
        }
      } while (alternativeReexportModule);
    }
  }
  computeContentHashWithDependencies(addons, options, existingNames) {
    const hash = createHash();
    hash.update([addons.intro, addons.outro, addons.banner, addons.footer].map(addon => addon || '').join(':'));
    hash.update(options.format);
    const dependenciesForHashing = new Set([this]);
    for (const current of dependenciesForHashing) {
      if (current instanceof ExternalModule) {
        hash.update(':' + current.renderPath);
      }
      else {
        hash.update(current.getRenderedHash());
        hash.update(current.generateId(addons, options, existingNames, false));
      }
      if (current instanceof ExternalModule)
        continue;
      for (const dependency of [...current.dependencies, ...current.dynamicDependencies]) {
        dependenciesForHashing.add(dependency);
      }
    }
    return hash.digest('hex').substr(0, 8);
  }
  ensureReexportsAreAvailableForModule(module) {
    const map = module.getExportNamesByVariable();
    for (const exportedVariable of map.keys()) {
      const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
      const importedVariable = isSynthetic
        ? exportedVariable.getBaseVariable()
        : exportedVariable;
      if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
        this.checkCircularDependencyImport(importedVariable, module);
        const exportingModule = importedVariable.module;
        if (exportingModule instanceof Module) {
          const chunk = this.chunkByModule.get(exportingModule);
          if (chunk && chunk !== this) {
            chunk.exports.add(importedVariable);
            if (isSynthetic) {
              this.imports.add(importedVariable);
            }
          }
        }
      }
    }
  }
  finaliseDynamicImports(options) {
    const stripKnownJsExtensions = options.format === 'amd';
    for (const [module, code] of this.renderedModuleSources) {
      for (const { node, resolution } of module.dynamicImports) {
        const chunk = this.chunkByModule.get(resolution);
        const facadeChunk = this.facadeChunkByModule.get(resolution);
        if (!resolution || !node.included || chunk === this) {
          continue;
        }
        const renderedResolution = resolution instanceof Module
          ? `'${this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions)}'`
          : resolution instanceof ExternalModule
            ? `'${resolution.renormalizeRenderPath
              ? this.getRelativePath(resolution.renderPath, stripKnownJsExtensions)
              : resolution.renderPath}'`
            : resolution;
        node.renderFinalResolution(code, renderedResolution, resolution instanceof Module &&
          !(facadeChunk === null || facadeChunk === void 0 ? void 0 : facadeChunk.strictFacade) &&
          chunk.exportNamesByVariable.get(resolution.namespace)[0], options);
      }
    }
  }
  finaliseImportMetas(format) {
    for (const [module, code] of this.renderedModuleSources) {
      for (const importMeta of module.importMetas) {
        importMeta.renderFinalMechanism(code, this.id, format, this.pluginDriver);
      }
    }
  }
  generateVariableName() {
    if (this.manualChunkAlias) {
      return this.manualChunkAlias;
    }
    const moduleForNaming = this.entryModules[0] ||
      this.implicitEntryModules[0] ||
      this.dynamicEntryModules[0] ||
      this.orderedModules[this.orderedModules.length - 1];
    if (moduleForNaming) {
      return moduleForNaming.chunkName || getAliasName(moduleForNaming.id);
    }
    return 'chunk';
  }
  getChunkDependencyDeclarations(options) {
    const importSpecifiers = this.getImportSpecifiers();
    const reexportSpecifiers = this.getReexportSpecifiers();
    const dependencyDeclaration = new Map();
    for (const dep of this.dependencies) {
      const imports = importSpecifiers.get(dep) || null;
      const reexports = reexportSpecifiers.get(dep) || null;
      const namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default';
      dependencyDeclaration.set(dep, {
        defaultVariableName: dep.defaultVariableName,
        globalName: (dep instanceof ExternalModule &&
          (options.format === 'umd' || options.format === 'iife') &&
          getGlobalName(dep, options.globals, (imports || reexports) !== null, this.inputOptions.onwarn)),
        id: undefined,
        imports,
        isChunk: dep instanceof Chunk,
        name: dep.variableName,
        namedExportsMode,
        namespaceVariableName: dep.namespaceVariableName,
        reexports
      });
    }
    return dependencyDeclaration;
  }
  getChunkExportDeclarations(format) {
    const exports = [];
    for (const exportName of this.getExportNames()) {
      if (exportName[0] === '*')
        continue;
      const variable = this.exportsByName[exportName];
      if (!(variable instanceof SyntheticNamedExportVariable)) {
        const module = variable.module;
        if (module && this.chunkByModule.get(module) !== this)
          continue;
      }
      let expression = null;
      let hoisted = false;
      let uninitialized = false;
      let local = variable.getName();
      if (variable instanceof LocalVariable) {
        if (variable.init === UNDEFINED_EXPRESSION) {
          uninitialized = true;
        }
        for (const declaration of variable.declarations) {
          if (declaration.parent instanceof FunctionDeclaration ||
            (declaration instanceof ExportDefaultDeclaration &&
              declaration.declaration instanceof FunctionDeclaration)) {
            hoisted = true;
            break;
          }
        }
      }
      else if (variable instanceof SyntheticNamedExportVariable) {
        expression = local;
        if (format === 'es' && exportName !== 'default') {
          local = variable.renderName;
        }
      }
      exports.push({
        exported: exportName,
        expression,
        hoisted,
        local,
        uninitialized
      });
    }
    return exports;
  }
  getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) {
    const dependencies = new Set();
    const deconflictedDefault = new Set();
    const deconflictedNamespace = new Set();
    for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) {
      if (addNonNamespacesAndInteropHelpers || variable.isNamespace) {
        const module = variable.module;
        if (module instanceof ExternalModule) {
          dependencies.add(module);
          if (addNonNamespacesAndInteropHelpers) {
            if (variable.name === 'default') {
              if (defaultInteropHelpersByInteropType[String(interop(module.id))]) {
                deconflictedDefault.add(module);
              }
            }
            else if (variable.name === '*') {
              if (namespaceInteropHelpersByInteropType[String(interop(module.id))]) {
                deconflictedNamespace.add(module);
              }
            }
          }
        }
        else {
          const chunk = this.chunkByModule.get(module);
          if (chunk !== this) {
            dependencies.add(chunk);
            if (addNonNamespacesAndInteropHelpers &&
              chunk.exportMode === 'default' &&
              variable.isNamespace) {
              deconflictedNamespace.add(chunk);
            }
          }
        }
      }
    }
    if (addDependenciesWithoutBindings) {
      for (const dependency of this.dependencies) {
        dependencies.add(dependency);
      }
    }
    return { deconflictedDefault, deconflictedNamespace, dependencies };
  }
  getFallbackChunkName() {
    if (this.manualChunkAlias) {
      return this.manualChunkAlias;
    }
    if (this.fileName) {
      return getAliasName(this.fileName);
    }
    return getAliasName(this.orderedModules[this.orderedModules.length - 1].id);
  }
  getImportedBindingsPerDependency() {
    const importSpecifiers = {};
    for (const [dependency, declaration] of this.renderedDependencies) {
      const specifiers = new Set();
      if (declaration.imports) {
        for (const { imported } of declaration.imports) {
          specifiers.add(imported);
        }
      }
      if (declaration.reexports) {
        for (const { imported } of declaration.reexports) {
          specifiers.add(imported);
        }
      }
      importSpecifiers[dependency.id] = [...specifiers];
    }
    return importSpecifiers;
  }
  getImportSpecifiers() {
    const { interop } = this.outputOptions;
    const importsByDependency = new Map();
    for (const variable of this.imports) {
      const module = variable.module;
      let dependency;
      let imported;
      if (module instanceof ExternalModule) {
        dependency = module;
        imported = variable.name;
        if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
          return error(errUnexpectedNamedImport(module.id, imported, false));
        }
      }
      else {
        dependency = this.chunkByModule.get(module);
        imported = dependency.getVariableExportName(variable);
      }
      getOrCreate(importsByDependency, dependency, () => []).push({
        imported,
        local: variable.getName()
      });
    }
    return importsByDependency;
  }
  getReexportSpecifiers() {
    const { externalLiveBindings, interop } = this.outputOptions;
    const reexportSpecifiers = new Map();
    for (let exportName of this.getExportNames()) {
      let dependency;
      let imported;
      let needsLiveBinding = false;
      if (exportName[0] === '*') {
        const id = exportName.substr(1);
        if (interop(id) === 'defaultOnly') {
          this.inputOptions.onwarn(errUnexpectedNamespaceReexport(id));
        }
        needsLiveBinding = externalLiveBindings;
        dependency = this.modulesById.get(id);
        imported = exportName = '*';
      }
      else {
        const variable = this.exportsByName[exportName];
        if (variable instanceof SyntheticNamedExportVariable)
          continue;
        const module = variable.module;
        if (module instanceof Module) {
          dependency = this.chunkByModule.get(module);
          if (dependency === this)
            continue;
          imported = dependency.getVariableExportName(variable);
          needsLiveBinding = variable.isReassigned;
        }
        else {
          dependency = module;
          imported = variable.name;
          if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
            return error(errUnexpectedNamedImport(module.id, imported, true));
          }
          needsLiveBinding =
            externalLiveBindings &&
              (imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true));
        }
      }
      getOrCreate(reexportSpecifiers, dependency, () => []).push({
        imported,
        needsLiveBinding,
        reexported: exportName
      });
    }
    return reexportSpecifiers;
  }
  getReferencedFiles() {
    const referencedFiles = [];
    for (const module of this.orderedModules) {
      for (const meta of module.importMetas) {
        const fileName = meta.getReferencedFileName(this.pluginDriver);
        if (fileName) {
          referencedFiles.push(fileName);
        }
      }
    }
    return referencedFiles;
  }
  getRelativePath(targetPath, stripJsExtension) {
    let relativePath = normalize(relative(dirname(this.id), targetPath));
    if (stripJsExtension && relativePath.endsWith('.js')) {
      relativePath = relativePath.slice(0, -3);
    }
    if (relativePath === '..')
      return '../../' + basename(targetPath);
    if (relativePath === '')
      return '../' + basename(targetPath);
    return relativePath.startsWith('../') ? relativePath : './' + relativePath;
  }
  inlineChunkDependencies(chunk) {
    for (const dep of chunk.dependencies) {
      if (this.dependencies.has(dep))
        continue;
      this.dependencies.add(dep);
      if (dep instanceof Chunk) {
        this.inlineChunkDependencies(dep);
      }
    }
  }
  prepareDynamicImportsAndImportMetas() {
    var _a;
    const accessedGlobalsByScope = this.accessedGlobalsByScope;
    for (const module of this.orderedModules) {
      for (const { node, resolution } of module.dynamicImports) {
        if (node.included) {
          if (resolution instanceof Module) {
            const chunk = this.chunkByModule.get(resolution);
            if (chunk === this) {
              node.setInternalResolution(resolution.namespace);
            }
            else {
              node.setExternalResolution(((_a = this.facadeChunkByModule.get(resolution)) === null || _a === void 0 ? void 0 : _a.exportMode) || chunk.exportMode, resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
            }
          }
          else {
            node.setExternalResolution('external', resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
          }
        }
      }
      for (const importMeta of module.importMetas) {
        importMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope);
      }
    }
  }
  setExternalRenderPaths(options, inputBase) {
    for (const dependency of [...this.dependencies, ...this.dynamicDependencies]) {
      if (dependency instanceof ExternalModule) {
        dependency.setRenderPath(options, inputBase);
      }
    }
  }
  setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) {
    const syntheticExports = new Set();
    for (const exportName of this.getExportNames()) {
      const exportVariable = this.exportsByName[exportName];
      if (exportVariable instanceof ExportShimVariable) {
        this.needsExportsShim = true;
      }
      if (format !== 'es' &&
        format !== 'system' &&
        exportVariable.isReassigned &&
        !exportVariable.isId) {
        exportVariable.setRenderNames('exports', exportName);
      }
      else if (exportVariable instanceof SyntheticNamedExportVariable) {
        syntheticExports.add(exportVariable);
      }
      else {
        exportVariable.setRenderNames(null, null);
      }
    }
    const usedNames = new Set(['Object', 'Promise']);
    if (this.needsExportsShim) {
      usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
    }
    if (namespaceToStringTag) {
      usedNames.add('Symbol');
    }
    switch (format) {
      case 'system':
        usedNames.add('module').add('exports');
        break;
      case 'es':
        break;
      case 'cjs':
        usedNames.add('module').add('require').add('__filename').add('__dirname');
      // fallthrough
      default:
        usedNames.add('exports');
        for (const helper of HELPER_NAMES) {
          usedNames.add(helper);
        }
    }
    deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
  }
  setUpChunkImportsAndExportsForModule(module) {
    const moduleImports = new Set(module.imports);
    // when we are not preserving modules, we need to make all namespace variables available for
    // rendering the namespace object
    if (!this.outputOptions.preserveModules) {
      if (this.includedNamespaces.has(module)) {
        const memberVariables = module.namespace.getMemberVariables();
        for (const name of Object.keys(memberVariables)) {
          moduleImports.add(memberVariables[name]);
        }
      }
    }
    for (let variable of moduleImports) {
      if (variable instanceof ExportDefaultVariable) {
        variable = variable.getOriginalVariable();
      }
      if (variable instanceof SyntheticNamedExportVariable) {
        variable = variable.getBaseVariable();
      }
      const chunk = this.chunkByModule.get(variable.module);
      if (chunk !== this) {
        this.imports.add(variable);
        if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) &&
          variable.module instanceof Module) {
          chunk.exports.add(variable);
          this.checkCircularDependencyImport(variable, module);
        }
      }
    }
    if (this.includedNamespaces.has(module) ||
      (module.info.isEntry && module.preserveSignature !== false) ||
      module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) {
      this.ensureReexportsAreAvailableForModule(module);
    }
    for (const { node, resolution } of module.dynamicImports) {
      if (node.included &&
        resolution instanceof Module &&
        this.chunkByModule.get(resolution) === this &&
        !this.includedNamespaces.has(resolution)) {
        this.includedNamespaces.add(resolution);
        this.ensureReexportsAreAvailableForModule(resolution);
      }
    }
  }
}

const concatSep = (out, next) => (next ? `${out}\n${next}` : out);
const concatDblSep = (out, next) => (next ? `${out}\n\n${next}` : out);
async function createAddons(options, outputPluginDriver) {
  try {
    let [banner, footer, intro, outro] = await Promise.all([
      outputPluginDriver.hookReduceValue('banner', options.banner(), [], concatSep),
      outputPluginDriver.hookReduceValue('footer', options.footer(), [], concatSep),
      outputPluginDriver.hookReduceValue('intro', options.intro(), [], concatDblSep),
      outputPluginDriver.hookReduceValue('outro', options.outro(), [], concatDblSep)
    ]);
    if (intro)
      intro += '\n\n';
    if (outro)
      outro = `\n\n${outro}`;
    if (banner.length)
      banner += '\n';
    if (footer.length)
      footer = '\n' + footer;
    return { intro, outro, banner, footer };
  }
  catch (err) {
    return error({
      code: 'ADDON_ERROR',
      message: `Could not retrieve ${err.hook}. Check configuration of plugin ${err.plugin}.
\tError Message: ${err.message}`
    });
  }
}

function getChunkAssignments(entryModules, manualChunkAliasByEntry) {
  const chunkDefinitions = [];
  const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
  const manualChunkModulesByAlias = Object.create(null);
  for (const [entry, alias] of manualChunkAliasByEntry) {
    const chunkModules = (manualChunkModulesByAlias[alias] =
      manualChunkModulesByAlias[alias] || []);
    addStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);
  }
  for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {
    chunkDefinitions.push({ alias, modules });
  }
  const assignedEntryPointsByModule = new Map();
  const { dependentEntryPointsByModule, dynamicEntryModules } = analyzeModuleGraph(entryModules);
  const dynamicallyDependentEntryPointsByDynamicEntry = getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules);
  const staticEntries = new Set(entryModules);
  function assignEntryToStaticDependencies(entry, dynamicDependentEntryPoints) {
    const modulesToHandle = new Set([entry]);
    for (const module of modulesToHandle) {
      const assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());
      if (dynamicDependentEntryPoints &&
        areEntryPointsContainedOrDynamicallyDependent(dynamicDependentEntryPoints, dependentEntryPointsByModule.get(module))) {
        continue;
      }
      else {
        assignedEntryPoints.add(entry);
      }
      for (const dependency of module.getDependenciesToBeIncluded()) {
        if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
          modulesToHandle.add(dependency);
        }
      }
    }
  }
  function areEntryPointsContainedOrDynamicallyDependent(entryPoints, containedIn) {
    const entriesToCheck = new Set(entryPoints);
    for (const entry of entriesToCheck) {
      if (!containedIn.has(entry)) {
        if (staticEntries.has(entry))
          return false;
        const dynamicallyDependentEntryPoints = dynamicallyDependentEntryPointsByDynamicEntry.get(entry);
        for (const dependentEntry of dynamicallyDependentEntryPoints) {
          entriesToCheck.add(dependentEntry);
        }
      }
    }
    return true;
  }
  for (const entry of entryModules) {
    if (!modulesInManualChunks.has(entry)) {
      assignEntryToStaticDependencies(entry, null);
    }
  }
  for (const entry of dynamicEntryModules) {
    if (!modulesInManualChunks.has(entry)) {
      assignEntryToStaticDependencies(entry, dynamicallyDependentEntryPointsByDynamicEntry.get(entry));
    }
  }
  chunkDefinitions.push(...createChunks([...entryModules, ...dynamicEntryModules], assignedEntryPointsByModule));
  return chunkDefinitions;
}
function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) {
  const modulesToHandle = new Set([entry]);
  for (const module of modulesToHandle) {
    modulesInManualChunks.add(module);
    manualChunkModules.push(module);
    for (const dependency of module.dependencies) {
      if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
        modulesToHandle.add(dependency);
      }
    }
  }
}
function analyzeModuleGraph(entryModules) {
  const dynamicEntryModules = new Set();
  const dependentEntryPointsByModule = new Map();
  const entriesToHandle = new Set(entryModules);
  for (const currentEntry of entriesToHandle) {
    const modulesToHandle = new Set([currentEntry]);
    for (const module of modulesToHandle) {
      getOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);
      for (const dependency of module.getDependenciesToBeIncluded()) {
        if (!(dependency instanceof ExternalModule)) {
          modulesToHandle.add(dependency);
        }
      }
      for (const { resolution } of module.dynamicImports) {
        if (resolution instanceof Module && resolution.includedDynamicImporters.length > 0) {
          dynamicEntryModules.add(resolution);
          entriesToHandle.add(resolution);
        }
      }
      for (const dependency of module.implicitlyLoadedBefore) {
        dynamicEntryModules.add(dependency);
        entriesToHandle.add(dependency);
      }
    }
  }
  return { dependentEntryPointsByModule, dynamicEntryModules };
}
function getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules) {
  const dynamicallyDependentEntryPointsByDynamicEntry = new Map();
  for (const dynamicEntry of dynamicEntryModules) {
    const dynamicDependentEntryPoints = getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, dynamicEntry, () => new Set());
    for (const importer of [
      ...dynamicEntry.includedDynamicImporters,
      ...dynamicEntry.implicitlyLoadedAfter
    ]) {
      for (const entryPoint of dependentEntryPointsByModule.get(importer)) {
        dynamicDependentEntryPoints.add(entryPoint);
      }
    }
  }
  return dynamicallyDependentEntryPointsByDynamicEntry;
}
function createChunks(allEntryPoints, assignedEntryPointsByModule) {
  const chunkModules = Object.create(null);
  for (const [module, assignedEntryPoints] of assignedEntryPointsByModule) {
    let chunkSignature = '';
    for (const entry of allEntryPoints) {
      chunkSignature += assignedEntryPoints.has(entry) ? 'X' : '_';
    }
    const chunk = chunkModules[chunkSignature];
    if (chunk) {
      chunk.push(module);
    }
    else {
      chunkModules[chunkSignature] = [module];
    }
  }
  return Object.keys(chunkModules).map(chunkSignature => ({
    alias: null,
    modules: chunkModules[chunkSignature]
  }));
}

// ported from https://github.com/substack/node-commondir
function commondir(files) {
  if (files.length === 0)
    return '/';
  if (files.length === 1)
    return dirname(files[0]);
  const commonSegments = files.slice(1).reduce((commonSegments, file) => {
    const pathSegements = file.split(/\/+|\\+/);
    let i;
    for (i = 0; commonSegments[i] === pathSegements[i] &&
      i < Math.min(commonSegments.length, pathSegements.length); i++)
      ;
    return commonSegments.slice(0, i);
  }, files[0].split(/\/+|\\+/));
  // Windows correctly handles paths with forward-slashes
  return commonSegments.length > 1 ? commonSegments.join('/') : '/';
}

const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1;
function sortByExecutionOrder(units) {
  units.sort(compareExecIndex);
}
function analyseModuleExecution(entryModules) {
  let nextExecIndex = 0;
  const cyclePaths = [];
  const analysedModules = new Set();
  const dynamicImports = new Set();
  const parents = new Map();
  const orderedModules = [];
  const analyseModule = (module) => {
    if (module instanceof Module) {
      for (const dependency of module.dependencies) {
        if (parents.has(dependency)) {
          if (!analysedModules.has(dependency)) {
            cyclePaths.push(getCyclePath(dependency, module, parents));
          }
          continue;
        }
        parents.set(dependency, module);
        analyseModule(dependency);
      }
      for (const dependency of module.implicitlyLoadedBefore) {
        dynamicImports.add(dependency);
      }
      for (const { resolution } of module.dynamicImports) {
        if (resolution instanceof Module) {
          dynamicImports.add(resolution);
        }
      }
      orderedModules.push(module);
    }
    module.execIndex = nextExecIndex++;
    analysedModules.add(module);
  };
  for (const curEntry of entryModules) {
    if (!parents.has(curEntry)) {
      parents.set(curEntry, null);
      analyseModule(curEntry);
    }
  }
  for (const curEntry of dynamicImports) {
    if (!parents.has(curEntry)) {
      parents.set(curEntry, null);
      analyseModule(curEntry);
    }
  }
  return { orderedModules, cyclePaths };
}
function getCyclePath(module, parent, parents) {
  const cycleSymbol = Symbol(module.id);
  const path = [relativeId(module.id)];
  let nextModule = parent;
  module.cycles.add(cycleSymbol);
  while (nextModule !== module) {
    nextModule.cycles.add(cycleSymbol);
    path.push(relativeId(nextModule.id));
    nextModule = parents.get(nextModule);
  }
  path.push(path[0]);
  path.reverse();
  return path;
}

var BuildPhase;
(function (BuildPhase) {
  BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE";
  BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE";
  BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
})(BuildPhase || (BuildPhase = {}));

function generateAssetFileName(name, source, output) {
  const emittedName = name || 'asset';
  return makeUnique(renderNamePattern(typeof output.assetFileNames === 'function'
    ? output.assetFileNames({ name, source, type: 'asset' })
    : output.assetFileNames, 'output.assetFileNames', {
    hash() {
      const hash = createHash();
      hash.update(emittedName);
      hash.update(':');
      hash.update(source);
      return hash.digest('hex').substr(0, 8);
    },
    ext: () => extname$1(emittedName).substr(1),
    extname: () => extname$1(emittedName),
    name: () => emittedName.substr(0, emittedName.length - extname$1(emittedName).length)
  }), output.bundle);
}
function reserveFileNameInBundle(fileName, bundle, warn) {
  if (fileName in bundle) {
    warn(errFileNameConflict(fileName));
  }
  bundle[fileName] = FILE_PLACEHOLDER;
}
const FILE_PLACEHOLDER = {
  type: 'placeholder'
};
function hasValidType(emittedFile) {
  return Boolean(emittedFile &&
    (emittedFile.type === 'asset' ||
      emittedFile.type === 'chunk'));
}
function hasValidName(emittedFile) {
  const validatedName = emittedFile.fileName || emittedFile.name;
  return (!validatedName || (typeof validatedName === 'string' && isPlainPathFragment(validatedName)));
}
function getValidSource(source, emittedFile, fileReferenceId) {
  if (!(typeof source === 'string' || source instanceof Uint8Array)) {
    const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId;
    return error(errFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`));
  }
  return source;
}
function getAssetFileName(file, referenceId) {
  if (typeof file.fileName !== 'string') {
    return error(errAssetNotFinalisedForFileName(file.name || referenceId));
  }
  return file.fileName;
}
function getChunkFileName(file, facadeChunkByModule) {
  var _a;
  const fileName = file.fileName || (file.module && ((_a = facadeChunkByModule === null || facadeChunkByModule === void 0 ? void 0 : facadeChunkByModule.get(file.module)) === null || _a === void 0 ? void 0 : _a.id));
  if (!fileName)
    return error(errChunkNotGeneratedForFileName(file.fileName || file.name));
  return fileName;
}
class FileEmitter {
  constructor(graph, options, baseFileEmitter) {
    this.graph = graph;
    this.options = options;
    this.facadeChunkByModule = null;
    this.output = null;
    this.assertAssetsFinalized = () => {
      for (const [referenceId, emittedFile] of this.filesByReferenceId.entries()) {
        if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string')
          return error(errNoAssetSourceSet(emittedFile.name || referenceId));
      }
    };
    this.emitFile = (emittedFile) => {
      if (!hasValidType(emittedFile)) {
        return error(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
      }
      if (!hasValidName(emittedFile)) {
        return error(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${emittedFile.fileName || emittedFile.name}".`));
      }
      if (emittedFile.type === 'chunk') {
        return this.emitChunk(emittedFile);
      }
      else {
        return this.emitAsset(emittedFile);
      }
    };
    this.getFileName = (fileReferenceId) => {
      const emittedFile = this.filesByReferenceId.get(fileReferenceId);
      if (!emittedFile)
        return error(errFileReferenceIdNotFoundForFilename(fileReferenceId));
      if (emittedFile.type === 'chunk') {
        return getChunkFileName(emittedFile, this.facadeChunkByModule);
      }
      else {
        return getAssetFileName(emittedFile, fileReferenceId);
      }
    };
    this.setAssetSource = (referenceId, requestedSource) => {
      const consumedFile = this.filesByReferenceId.get(referenceId);
      if (!consumedFile)
        return error(errAssetReferenceIdNotFoundForSetSource(referenceId));
      if (consumedFile.type !== 'asset') {
        return error(errFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`));
      }
      if (consumedFile.source !== undefined) {
        return error(errAssetSourceAlreadySet(consumedFile.name || referenceId));
      }
      const source = getValidSource(requestedSource, consumedFile, referenceId);
      if (this.output) {
        this.finalizeAsset(consumedFile, source, referenceId, this.output);
      }
      else {
        consumedFile.source = source;
      }
    };
    this.setOutputBundle = (outputBundle, assetFileNames, facadeChunkByModule) => {
      this.output = {
        assetFileNames,
        bundle: outputBundle
      };
      this.facadeChunkByModule = facadeChunkByModule;
      for (const emittedFile of this.filesByReferenceId.values()) {
        if (emittedFile.fileName) {
          reserveFileNameInBundle(emittedFile.fileName, this.output.bundle, this.options.onwarn);
        }
      }
      for (const [referenceId, consumedFile] of this.filesByReferenceId.entries()) {
        if (consumedFile.type === 'asset' && consumedFile.source !== undefined) {
          this.finalizeAsset(consumedFile, consumedFile.source, referenceId, this.output);
        }
      }
    };
    this.filesByReferenceId = baseFileEmitter
      ? new Map(baseFileEmitter.filesByReferenceId)
      : new Map();
  }
  assignReferenceId(file, idBase) {
    let referenceId;
    do {
      const hash = createHash();
      if (referenceId) {
        hash.update(referenceId);
      }
      else {
        hash.update(idBase);
      }
      referenceId = hash.digest('hex').substr(0, 8);
    } while (this.filesByReferenceId.has(referenceId));
    this.filesByReferenceId.set(referenceId, file);
    return referenceId;
  }
  emitAsset(emittedAsset) {
    const source = typeof emittedAsset.source !== 'undefined'
      ? getValidSource(emittedAsset.source, emittedAsset, null)
      : undefined;
    const consumedAsset = {
      fileName: emittedAsset.fileName,
      name: emittedAsset.name,
      source,
      type: 'asset'
    };
    const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || emittedAsset.type);
    if (this.output) {
      if (emittedAsset.fileName) {
        reserveFileNameInBundle(emittedAsset.fileName, this.output.bundle, this.options.onwarn);
      }
      if (source !== undefined) {
        this.finalizeAsset(consumedAsset, source, referenceId, this.output);
      }
    }
    return referenceId;
  }
  emitChunk(emittedChunk) {
    if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
      return error(errInvalidRollupPhaseForChunkEmission());
    }
    if (typeof emittedChunk.id !== 'string') {
      return error(errFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`));
    }
    const consumedChunk = {
      fileName: emittedChunk.fileName,
      module: null,
      name: emittedChunk.name || emittedChunk.id,
      type: 'chunk'
    };
    this.graph.moduleLoader
      .emitChunk(emittedChunk)
      .then(module => (consumedChunk.module = module))
      .catch(() => {
      // Avoid unhandled Promise rejection as the error will be thrown later
      // once module loading has finished
    });
    return this.assignReferenceId(consumedChunk, emittedChunk.id);
  }
  finalizeAsset(consumedFile, source, referenceId, output) {
    const fileName = consumedFile.fileName ||
      findExistingAssetFileNameWithSource(output.bundle, source) ||
      generateAssetFileName(consumedFile.name, source, output);
    // We must not modify the original assets to avoid interaction between outputs
    const assetWithFileName = { ...consumedFile, source, fileName };
    this.filesByReferenceId.set(referenceId, assetWithFileName);
    const options = this.options;
    output.bundle[fileName] = {
      fileName,
      name: consumedFile.name,
      get isAsset() {
        warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', true, options);
        return true;
      },
      source,
      type: 'asset'
    };
  }
}
function findExistingAssetFileNameWithSource(bundle, source) {
  for (const fileName of Object.keys(bundle)) {
    const outputFile = bundle[fileName];
    if (outputFile.type === 'asset' && areSourcesEqual(source, outputFile.source))
      return fileName;
  }
  return null;
}
function areSourcesEqual(sourceA, sourceB) {
  if (typeof sourceA === 'string') {
    return sourceA === sourceB;
  }
  if (typeof sourceB === 'string') {
    return false;
  }
  if ('equals' in sourceA) {
    return sourceA.equals(sourceB);
  }
  if (sourceA.length !== sourceB.length) {
    return false;
  }
  for (let index = 0; index < sourceA.length; index++) {
    if (sourceA[index] !== sourceB[index]) {
      return false;
    }
  }
  return true;
}

class Bundle {
  constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) {
    this.outputOptions = outputOptions;
    this.unsetOptions = unsetOptions;
    this.inputOptions = inputOptions;
    this.pluginDriver = pluginDriver;
    this.graph = graph;
    this.facadeChunkByModule = new Map();
    this.includedNamespaces = new Set();
  }
  async generate(isWrite) {
    timeStart('GENERATE', 1);
    const outputBundle = Object.create(null);
    this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions.assetFileNames, this.facadeChunkByModule);
    try {
      await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]);
      timeStart('generate chunks', 2);
      const chunks = await this.generateChunks();
      if (chunks.length > 1) {
        validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn);
      }
      const inputBase = commondir(getAbsoluteEntryModulePaths(chunks));
      timeEnd('generate chunks', 2);
      timeStart('render modules', 2);
      // We need to create addons before prerender because at the moment, there
      // can be no async code between prerender and render due to internal state
      const addons = await createAddons(this.outputOptions, this.pluginDriver);
      this.prerenderChunks(chunks, inputBase);
      timeEnd('render modules', 2);
      await this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle);
    }
    catch (error) {
      await this.pluginDriver.hookParallel('renderError', [error]);
      throw error;
    }
    await this.pluginDriver.hookSeq('generateBundle', [
      this.outputOptions,
      outputBundle,
      isWrite
    ]);
    this.finaliseAssets(outputBundle);
    timeEnd('GENERATE', 1);
    return outputBundle;
  }
  async addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle) {
    this.assignChunkIds(chunks, inputBase, addons, outputBundle);
    for (const chunk of chunks) {
      outputBundle[chunk.id] = chunk.getChunkInfoWithFileNames();
    }
    await Promise.all(chunks.map(async (chunk) => {
      const outputChunk = outputBundle[chunk.id];
      Object.assign(outputChunk, await chunk.render(this.outputOptions, addons, outputChunk));
    }));
  }
  async addManualChunks(manualChunks) {
    const manualChunkAliasByEntry = new Map();
    const chunkEntries = await Promise.all(Object.keys(manualChunks).map(async (alias) => ({
      alias,
      entries: await this.graph.moduleLoader.addAdditionalModules(manualChunks[alias])
    })));
    for (const { alias, entries } of chunkEntries) {
      for (const entry of entries) {
        addModuleToManualChunk(alias, entry, manualChunkAliasByEntry);
      }
    }
    return manualChunkAliasByEntry;
  }
  assignChunkIds(chunks, inputBase, addons, bundle) {
    const entryChunks = [];
    const otherChunks = [];
    for (const chunk of chunks) {
      (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint
        ? entryChunks
        : otherChunks).push(chunk);
    }
    // make sure entry chunk names take precedence with regard to deconflicting
    const chunksForNaming = entryChunks.concat(otherChunks);
    for (const chunk of chunksForNaming) {
      if (this.outputOptions.file) {
        chunk.id = basename(this.outputOptions.file);
      }
      else if (this.outputOptions.preserveModules) {
        chunk.id = chunk.generateIdPreserveModules(inputBase, this.outputOptions, bundle, this.unsetOptions);
      }
      else {
        chunk.id = chunk.generateId(addons, this.outputOptions, bundle, true);
      }
      bundle[chunk.id] = FILE_PLACEHOLDER;
    }
  }
  assignManualChunks(getManualChunk) {
    const manualChunkAliasByEntry = new Map();
    const manualChunksApi = {
      getModuleIds: () => this.graph.modulesById.keys(),
      getModuleInfo: this.graph.getModuleInfo
    };
    for (const module of this.graph.modulesById.values()) {
      if (module instanceof Module) {
        const manualChunkAlias = getManualChunk(module.id, manualChunksApi);
        if (typeof manualChunkAlias === 'string') {
          addModuleToManualChunk(manualChunkAlias, module, manualChunkAliasByEntry);
        }
      }
    }
    return manualChunkAliasByEntry;
  }
  finaliseAssets(outputBundle) {
    for (const key of Object.keys(outputBundle)) {
      const file = outputBundle[key];
      if (!file.type) {
        warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', true, this.inputOptions);
        file.type = 'asset';
      }
      if (this.outputOptions.validate && typeof file.code == 'string') {
        try {
          this.graph.contextParse(file.code, {
            allowHashBang: true,
            ecmaVersion: 'latest'
          });
        }
        catch (exception) {
          this.inputOptions.onwarn(errChunkInvalid(file, exception));
        }
      }
    }
    this.pluginDriver.finaliseAssets();
  }
  async generateChunks() {
    const { manualChunks } = this.outputOptions;
    const manualChunkAliasByEntry = typeof manualChunks === 'object'
      ? await this.addManualChunks(manualChunks)
      : this.assignManualChunks(manualChunks);
    const chunks = [];
    const chunkByModule = new Map();
    for (const { alias, modules } of this.outputOptions.inlineDynamicImports
      ? [{ alias: null, modules: getIncludedModules(this.graph.modulesById) }]
      : this.outputOptions.preserveModules
        ? getIncludedModules(this.graph.modulesById).map(module => ({
          alias: null,
          modules: [module]
        }))
        : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
      sortByExecutionOrder(modules);
      const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
      chunks.push(chunk);
      for (const module of modules) {
        chunkByModule.set(module, chunk);
      }
    }
    for (const chunk of chunks) {
      chunk.link();
    }
    const facades = [];
    for (const chunk of chunks) {
      facades.push(...chunk.generateFacades());
    }
    return [...chunks, ...facades];
  }
  prerenderChunks(chunks, inputBase) {
    for (const chunk of chunks) {
      chunk.generateExports();
    }
    for (const chunk of chunks) {
      chunk.preRender(this.outputOptions, inputBase);
    }
  }
}
function getAbsoluteEntryModulePaths(chunks) {
  const absoluteEntryModulePaths = [];
  for (const chunk of chunks) {
    for (const entryModule of chunk.entryModules) {
      if (isAbsolute(entryModule.id)) {
        absoluteEntryModulePaths.push(entryModule.id);
      }
    }
  }
  return absoluteEntryModulePaths;
}
function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
  if (outputOptions.format === 'umd' || outputOptions.format === 'iife')
    return error({
      code: 'INVALID_OPTION',
      message: 'UMD and IIFE output formats are not supported for code-splitting builds.'
    });
  if (typeof outputOptions.file === 'string')
    return error({
      code: 'INVALID_OPTION',
      message: 'When building multiple chunks, the "output.dir" option must be used, not "output.file". ' +
        'To inline dynamic imports, set the "inlineDynamicImports" option.'
    });
  if (outputOptions.sourcemapFile)
    return error({
      code: 'INVALID_OPTION',
      message: '"output.sourcemapFile" is only supported for single-file builds.'
    });
  if (!outputOptions.amd.autoId && outputOptions.amd.id)
    onWarn({
      code: 'INVALID_OPTION',
      message: '"output.amd.id" is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath".'
    });
}
function getIncludedModules(modulesById) {
  return [...modulesById.values()].filter(module => module instanceof Module &&
    (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0));
}
function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
  const existingAlias = manualChunkAliasByEntry.get(module);
  if (typeof existingAlias === 'string' && existingAlias !== alias) {
    return error(errCannotAssignModuleToChunk(module.id, alias, existingAlias));
  }
  manualChunkAliasByEntry.set(module, alias);
}

// Reserved word lists for various dialects of the language

var reservedWords = {
  3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
  5: "class enum extends super const export import",
  6: "enum",
  strict: "implements interface let package private protected public static yield",
  strictBind: "eval arguments"
};

// And the keywords

var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";

var keywords = {
  5: ecma5AndLessKeywords,
  "5module": ecma5AndLessKeywords + " export import",
  6: ecma5AndLessKeywords + " const class extends export import super"
};

var keywordRelationalOperator = /^in(stanceof)?$/;

// ## Character categories

// Big ugly regular expressions that match characters in the
// whitespace, identifier, and identifier-start categories. These
// are only applied when a character is found to actually have a
// code point above 128.
// Generated by `bin/generate-identifier-regex.js`.
var nonASCIIidentifierStartChars = "\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\u08a0-\u08b4\u08b6-\u08c7\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\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\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";
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\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\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\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-\u0ecd\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\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-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";

var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");

nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;

// These are a run-length and offset encoded representation of the
// >0xffff code points that are a valid part of identifiers. The
// offset starts at 0x10000, and each pair of numbers represents an
// offset to the next range, and then a size of the range. They were
// generated by bin/generate-identifier-regex.js

// eslint-disable-next-line comma-spacing
var astralIdentifierStartCodes = [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,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,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,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,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,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];

// eslint-disable-next-line comma-spacing
var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];

// This has a complexity linear to the value of the code. The
// assumption is that looking up astral identifier characters is
// rare.
function isInAstralSet(code, set) {
  var pos = 0x10000;
  for (var i = 0; i < set.length; i += 2) {
  pos += set[i];
  if (pos > code) { return false }
  pos += set[i + 1];
  if (pos >= code) { return true }
  }
}

// Test whether a given character code starts an identifier.

function isIdentifierStart(code, astral) {
  if (code < 65) { return code === 36 }
  if (code < 91) { return true }
  if (code < 97) { return code === 95 }
  if (code < 123) { return true }
  if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
  if (astral === false) { return false }
  return isInAstralSet(code, astralIdentifierStartCodes)
}

// Test whether a given character is part of an identifier.

function isIdentifierChar(code, astral) {
  if (code < 48) { return code === 36 }
  if (code < 58) { return true }
  if (code < 65) { return false }
  if (code < 91) { return true }
  if (code < 97) { return code === 95 }
  if (code < 123) { return true }
  if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
  if (astral === false) { return false }
  return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
}

// ## Token types

// The assignment of fine-grained, information-carrying type objects
// allows the tokenizer to store the information it has about a
// token in a way that is very cheap for the parser to look up.

// All token type variables start with an underscore, to make them
// easy to recognize.

// The `beforeExpr` property is used to disambiguate between regular
// expressions and divisions. It is set on all token types that can
// be followed by an expression (thus, a slash after them would be a
// regular expression).
//
// The `startsExpr` property is used to check if the token ends a
// `yield` expression. It is set on all token types that either can
// directly start an expression (like a quotation mark) or can
// continue an expression (like the body of a string).
//
// `isLoop` marks a keyword as starting a loop, which is important
// to know when parsing a label, in order to allow or disallow
// continue jumps to that label.

var TokenType = function TokenType(label, conf) {
  if ( conf === void 0 ) conf = {};

  this.label = label;
  this.keyword = conf.keyword;
  this.beforeExpr = !!conf.beforeExpr;
  this.startsExpr = !!conf.startsExpr;
  this.isLoop = !!conf.isLoop;
  this.isAssign = !!conf.isAssign;
  this.prefix = !!conf.prefix;
  this.postfix = !!conf.postfix;
  this.binop = conf.binop || null;
  this.updateContext = null;
};

function binop(name, prec) {
  return new TokenType(name, {beforeExpr: true, binop: prec})
}
var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};

// Map keyword names to token types.

var keywords$1 = {};

// Succinct definitions of keyword token types
function kw(name, options) {
  if ( options === void 0 ) options = {};

  options.keyword = name;
  return keywords$1[name] = new TokenType(name, options)
}

var types = {
  num: new TokenType("num", startsExpr),
  regexp: new TokenType("regexp", startsExpr),
  string: new TokenType("string", startsExpr),
  name: new TokenType("name", startsExpr),
  eof: new TokenType("eof"),

  // Punctuation token types.
  bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
  bracketR: new TokenType("]"),
  braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
  braceR: new TokenType("}"),
  parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
  parenR: new TokenType(")"),
  comma: new TokenType(",", beforeExpr),
  semi: new TokenType(";", beforeExpr),
  colon: new TokenType(":", beforeExpr),
  dot: new TokenType("."),
  question: new TokenType("?", beforeExpr),
  questionDot: new TokenType("?."),
  arrow: new TokenType("=>", beforeExpr),
  template: new TokenType("template"),
  invalidTemplate: new TokenType("invalidTemplate"),
  ellipsis: new TokenType("...", beforeExpr),
  backQuote: new TokenType("`", startsExpr),
  dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),

  // Operators. These carry several kinds of properties to help the
  // parser use them properly (the presence of these properties is
  // what categorizes them as operators).
  //
  // `binop`, when present, specifies that this operator is a binary
  // operator, and will refer to its precedence.
  //
  // `prefix` and `postfix` mark the operator as a prefix or postfix
  // unary operator.
  //
  // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  // binary operators with a very low precedence, that should result
  // in AssignmentExpression nodes.

  eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
  assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
  incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
  prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
  logicalOR: binop("||", 1),
  logicalAND: binop("&&", 2),
  bitwiseOR: binop("|", 3),
  bitwiseXOR: binop("^", 4),
  bitwiseAND: binop("&", 5),
  equality: binop("==/!=/===/!==", 6),
  relational: binop("</>/<=/>=", 7),
  bitShift: binop("<</>>/>>>", 8),
  plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
  modulo: binop("%", 10),
  star: binop("*", 10),
  slash: binop("/", 10),
  starstar: new TokenType("**", {beforeExpr: true}),
  coalesce: binop("??", 1),

  // Keyword token types.
  _break: kw("break"),
  _case: kw("case", beforeExpr),
  _catch: kw("catch"),
  _continue: kw("continue"),
  _debugger: kw("debugger"),
  _default: kw("default", beforeExpr),
  _do: kw("do", {isLoop: true, beforeExpr: true}),
  _else: kw("else", beforeExpr),
  _finally: kw("finally"),
  _for: kw("for", {isLoop: true}),
  _function: kw("function", startsExpr),
  _if: kw("if"),
  _return: kw("return", beforeExpr),
  _switch: kw("switch"),
  _throw: kw("throw", beforeExpr),
  _try: kw("try"),
  _var: kw("var"),
  _const: kw("const"),
  _while: kw("while", {isLoop: true}),
  _with: kw("with"),
  _new: kw("new", {beforeExpr: true, startsExpr: true}),
  _this: kw("this", startsExpr),
  _super: kw("super", startsExpr),
  _class: kw("class", startsExpr),
  _extends: kw("extends", beforeExpr),
  _export: kw("export"),
  _import: kw("import", startsExpr),
  _null: kw("null", startsExpr),
  _true: kw("true", startsExpr),
  _false: kw("false", startsExpr),
  _in: kw("in", {beforeExpr: true, binop: 7}),
  _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
  _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
  _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
  _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
};

// Matches a whole line break (where CRLF is considered a single
// line break). Used to count lines.

var lineBreak = /\r\n?|\n|\u2028|\u2029/;
var lineBreakG = new RegExp(lineBreak.source, "g");

function isNewLine(code, ecma2019String) {
  return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))
}

var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;

var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;

var ref = Object.prototype;
var hasOwnProperty = ref.hasOwnProperty;
var toString = ref.toString;

// Checks if an object has a property.

function has(obj, propName) {
  return hasOwnProperty.call(obj, propName)
}

var isArray = Array.isArray || (function (obj) { return (
  toString.call(obj) === "[object Array]"
); });

function wordsRegexp(words) {
  return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
}

// These are used when `options.locations` is on, for the
// `startLoc` and `endLoc` properties.

var Position = function Position(line, col) {
  this.line = line;
  this.column = col;
};

Position.prototype.offset = function offset (n) {
  return new Position(this.line, this.column + n)
};

var SourceLocation = function SourceLocation(p, start, end) {
  this.start = start;
  this.end = end;
  if (p.sourceFile !== null) { this.source = p.sourceFile; }
};

// The `getLineInfo` function is mostly useful when the
// `locations` option is off (for performance reasons) and you
// want to find the line/column position for a given character
// offset. `input` should be the code string that the offset refers
// into.

function getLineInfo(input, offset) {
  for (var line = 1, cur = 0;;) {
  lineBreakG.lastIndex = cur;
  var match = lineBreakG.exec(input);
  if (match && match.index < offset) {
    ++line;
    cur = match.index + match[0].length;
  } else {
    return new Position(line, offset - cur)
  }
  }
}

// A second argument must be given to configure the parser process.
// These options are recognized (only `ecmaVersion` is required):

var defaultOptions = {
  // `ecmaVersion` indicates the ECMAScript version to parse. Must be
  // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
  // (2019), 11 (2020), 12 (2021), or `"latest"` (the latest version
  // the library supports). This influences support for strict mode,
  // the set of reserved words, and support for new syntax features.
  ecmaVersion: null,
  // `sourceType` indicates the mode the code should be parsed in.
  // Can be either `"script"` or `"module"`. This influences global
  // strict mode and parsing of `import` and `export` declarations.
  sourceType: "script",
  // `onInsertedSemicolon` can be a callback that will be called
  // when a semicolon is automatically inserted. It will be passed
  // the position of the comma as an offset, and if `locations` is
  // enabled, it is given the location as a `{line, column}` object
  // as second argument.
  onInsertedSemicolon: null,
  // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
  // trailing commas.
  onTrailingComma: null,
  // By default, reserved words are only enforced if ecmaVersion >= 5.
  // Set `allowReserved` to a boolean value to explicitly turn this on
  // an off. When this option has the value "never", reserved words
  // and keywords can also not be used as property names.
  allowReserved: null,
  // When enabled, a return at the top level is not considered an
  // error.
  allowReturnOutsideFunction: false,
  // When enabled, import/export statements are not constrained to
  // appearing at the top of the program.
  allowImportExportEverywhere: false,
  // When enabled, await identifiers are allowed to appear at the top-level scope,
  // but they are still not allowed in non-async functions.
  allowAwaitOutsideFunction: false,
  // When enabled, hashbang directive in the beginning of file
  // is allowed and treated as a line comment.
  allowHashBang: false,
  // When `locations` is on, `loc` properties holding objects with
  // `start` and `end` properties in `{line, column}` form (with
  // line being 1-based and column 0-based) will be attached to the
  // nodes.
  locations: false,
  // A function can be passed as `onToken` option, which will
  // cause Acorn to call that function with object in the same
  // format as tokens returned from `tokenizer().getToken()`. Note
  // that you are not allowed to call the parser from the
  // callback—that will corrupt its internal state.
  onToken: null,
  // A function can be passed as `onComment` option, which will
  // cause Acorn to call that function with `(block, text, start,
  // end)` parameters whenever a comment is skipped. `block` is a
  // boolean indicating whether this is a block (`/* */`) comment,
  // `text` is the content of the comment, and `start` and `end` are
  // character offsets that denote the start and end of the comment.
  // When the `locations` option is on, two more parameters are
  // passed, the full `{line, column}` locations of the start and
  // end of the comments. Note that you are not allowed to call the
  // parser from the callback—that will corrupt its internal state.
  onComment: null,
  // Nodes have their start and end characters offsets recorded in
  // `start` and `end` properties (directly on the node, rather than
  // the `loc` object, which holds line/column data. To also add a
  // [semi-standardized][range] `range` property holding a `[start,
  // end]` array with the same numbers, set the `ranges` option to
  // `true`.
  //
  // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
  ranges: false,
  // It is possible to parse multiple files into a single AST by
  // passing the tree produced by parsing the first file as
  // `program` option in subsequent parses. This will add the
  // toplevel forms of the parsed file to the `Program` (top) node
  // of an existing parse tree.
  program: null,
  // When `locations` is on, you can pass this to record the source
  // file in every node's `loc` object.
  sourceFile: null,
  // This value, if given, is stored in every node, whether
  // `locations` is on or off.
  directSourceFile: null,
  // When enabled, parenthesized expressions are represented by
  // (non-standard) ParenthesizedExpression nodes
  preserveParens: false
};

// Interpret and default an options object

var warnedAboutEcmaVersion = false;

function getOptions(opts) {
  var options = {};

  for (var opt in defaultOptions)
  { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; }

  if (options.ecmaVersion === "latest") {
  options.ecmaVersion = 1e8;
  } else if (options.ecmaVersion == null) {
  if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
    warnedAboutEcmaVersion = true;
    console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
  }
  options.ecmaVersion = 11;
  } else if (options.ecmaVersion >= 2015) {
  options.ecmaVersion -= 2009;
  }

  if (options.allowReserved == null)
  { options.allowReserved = options.ecmaVersion < 5; }

  if (isArray(options.onToken)) {
  var tokens = options.onToken;
  options.onToken = function (token) { return tokens.push(token); };
  }
  if (isArray(options.onComment))
  { options.onComment = pushComment(options, options.onComment); }

  return options
}

function pushComment(options, array) {
  return function(block, text, start, end, startLoc, endLoc) {
  var comment = {
    type: block ? "Block" : "Line",
    value: text,
    start: start,
    end: end
  };
  if (options.locations)
    { comment.loc = new SourceLocation(this, startLoc, endLoc); }
  if (options.ranges)
    { comment.range = [start, end]; }
  array.push(comment);
  }
}

// Each scope gets a bitset that may contain these flags
var
  SCOPE_TOP = 1,
  SCOPE_FUNCTION = 2,
  SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,
  SCOPE_ASYNC = 4,
  SCOPE_GENERATOR = 8,
  SCOPE_ARROW = 16,
  SCOPE_SIMPLE_CATCH = 32,
  SCOPE_SUPER = 64,
  SCOPE_DIRECT_SUPER = 128;

function functionFlags(async, generator) {
  return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
}

// Used in checkLVal* and declareName to determine the type of a binding
var
  BIND_NONE = 0, // Not a binding
  BIND_VAR = 1, // Var-style binding
  BIND_LEXICAL = 2, // Let- or const-style binding
  BIND_FUNCTION = 3, // Function declaration
  BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
  BIND_OUTSIDE = 5; // Special case for function names as bound inside the function

var Parser = function Parser(options, input, startPos) {
  this.options = options = getOptions(options);
  this.sourceFile = options.sourceFile;
  this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
  var reserved = "";
  if (options.allowReserved !== true) {
  reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
  if (options.sourceType === "module") { reserved += " await"; }
  }
  this.reservedWords = wordsRegexp(reserved);
  var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
  this.reservedWordsStrict = wordsRegexp(reservedStrict);
  this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
  this.input = String(input);

  // Used to signal to callers of `readWord1` whether the word
  // contained any escape sequences. This is needed because words with
  // escape sequences must not be interpreted as keywords.
  this.containsEsc = false;

  // Set up token state

  // The current position of the tokenizer in the input.
  if (startPos) {
  this.pos = startPos;
  this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
  this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
  } else {
  this.pos = this.lineStart = 0;
  this.curLine = 1;
  }

  // Properties of the current token:
  // Its type
  this.type = types.eof;
  // For tokens that include more information than their type, the value
  this.value = null;
  // Its start and end offset
  this.start = this.end = this.pos;
  // And, if locations are used, the {line, column} object
  // corresponding to those offsets
  this.startLoc = this.endLoc = this.curPosition();

  // Position information for the previous token
  this.lastTokEndLoc = this.lastTokStartLoc = null;
  this.lastTokStart = this.lastTokEnd = this.pos;

  // The context stack is used to superficially track syntactic
  // context to predict whether a regular expression is allowed in a
  // given position.
  this.context = this.initialContext();
  this.exprAllowed = true;

  // Figure out if it's a module code.
  this.inModule = options.sourceType === "module";
  this.strict = this.inModule || this.strictDirective(this.pos);

  // Used to signify the start of a potential arrow function
  this.potentialArrowAt = -1;

  // Positions to delayed-check that yield/await does not exist in default parameters.
  this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
  // Labels in scope.
  this.labels = [];
  // Thus-far undefined exports.
  this.undefinedExports = Object.create(null);

  // If enabled, skip leading hashbang line.
  if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
  { this.skipLineComment(2); }

  // Scope tracking for duplicate variable names (see scope.js)
  this.scopeStack = [];
  this.enterScope(SCOPE_TOP);

  // For RegExp validation
  this.regexpState = null;
};

var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },inNonArrowFunction: { configurable: true } };

Parser.prototype.parse = function parse () {
  var node = this.options.program || this.startNode();
  this.nextToken();
  return this.parseTopLevel(node)
};

prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 };
prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
prototypeAccessors.inNonArrowFunction.get = function () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 };

Parser.extend = function extend () {
  var plugins = [], len = arguments.length;
  while ( len-- ) plugins[ len ] = arguments[ len ];

  var cls = this;
  for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
  return cls
};

Parser.parse = function parse (input, options) {
  return new this(options, input).parse()
};

Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
  var parser = new this(options, input, pos);
  parser.nextToken();
  return parser.parseExpression()
};

Parser.tokenizer = function tokenizer (input, options) {
  return new this(options, input)
};

Object.defineProperties( Parser.prototype, prototypeAccessors );

var pp = Parser.prototype;

// ## Parser utilities

var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
pp.strictDirective = function(start) {
  for (;;) {
  // Try to find string literal.
  skipWhiteSpace.lastIndex = start;
  start += skipWhiteSpace.exec(this.input)[0].length;
  var match = literal.exec(this.input.slice(start));
  if (!match) { return false }
  if ((match[1] || match[2]) === "use strict") {
    skipWhiteSpace.lastIndex = start + match[0].length;
    var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
    var next = this.input.charAt(end);
    return next === ";" || next === "}" ||
    (lineBreak.test(spaceAfter[0]) &&
     !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
  }
  start += match[0].length;

  // Skip semicolon, if any.
  skipWhiteSpace.lastIndex = start;
  start += skipWhiteSpace.exec(this.input)[0].length;
  if (this.input[start] === ";")
    { start++; }
  }
};

// Predicate that tests whether the next token is of the given
// type, and if yes, consumes it as a side effect.

pp.eat = function(type) {
  if (this.type === type) {
  this.next();
  return true
  } else {
  return false
  }
};

// Tests whether parsed token is a contextual keyword.

pp.isContextual = function(name) {
  return this.type === types.name && this.value === name && !this.containsEsc
};

// Consumes contextual keyword if possible.

pp.eatContextual = function(name) {
  if (!this.isContextual(name)) { return false }
  this.next();
  return true
};

// Asserts that following token is given contextual keyword.

pp.expectContextual = function(name) {
  if (!this.eatContextual(name)) { this.unexpected(); }
};

// Test whether a semicolon can be inserted at the current position.

pp.canInsertSemicolon = function() {
  return this.type === types.eof ||
  this.type === types.braceR ||
  lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
};

pp.insertSemicolon = function() {
  if (this.canInsertSemicolon()) {
  if (this.options.onInsertedSemicolon)
    { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
  return true
  }
};

// Consume a semicolon, or, failing that, see if we are allowed to
// pretend that there is a semicolon at this position.

pp.semicolon = function() {
  if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); }
};

pp.afterTrailingComma = function(tokType, notNext) {
  if (this.type === tokType) {
  if (this.options.onTrailingComma)
    { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
  if (!notNext)
    { this.next(); }
  return true
  }
};

// Expect a token of a given type. If found, consume it, otherwise,
// raise an unexpected token error.

pp.expect = function(type) {
  this.eat(type) || this.unexpected();
};

// Raise an unexpected token error.

pp.unexpected = function(pos) {
  this.raise(pos != null ? pos : this.start, "Unexpected token");
};

function DestructuringErrors() {
  this.shorthandAssign =
  this.trailingComma =
  this.parenthesizedAssign =
  this.parenthesizedBind =
  this.doubleProto =
  -1;
}

pp.checkPatternErrors = function(refDestructuringErrors, isAssign) {
  if (!refDestructuringErrors) { return }
  if (refDestructuringErrors.trailingComma > -1)
  { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
  var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
  if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); }
};

pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
  if (!refDestructuringErrors) { return false }
  var shorthandAssign = refDestructuringErrors.shorthandAssign;
  var doubleProto = refDestructuringErrors.doubleProto;
  if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
  if (shorthandAssign >= 0)
  { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
  if (doubleProto >= 0)
  { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
};

pp.checkYieldAwaitInDefaultParams = function() {
  if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
  { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
  if (this.awaitPos)
  { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
};

pp.isSimpleAssignTarget = function(expr) {
  if (expr.type === "ParenthesizedExpression")
  { return this.isSimpleAssignTarget(expr.expression) }
  return expr.type === "Identifier" || expr.type === "MemberExpression"
};

var pp$1 = Parser.prototype;

// ### Statement parsing

// Parse a program. Initializes the parser, reads any number of
// statements, and wraps them in a Program node.  Optionally takes a
// `program` argument.  If present, the statements will be appended
// to its body instead of creating a new node.

pp$1.parseTopLevel = function(node) {
  var exports = Object.create(null);
  if (!node.body) { node.body = []; }
  while (this.type !== types.eof) {
  var stmt = this.parseStatement(null, true, exports);
  node.body.push(stmt);
  }
  if (this.inModule)
  { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
    {
    var name = list[i];

    this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
    } }
  this.adaptDirectivePrologue(node.body);
  this.next();
  node.sourceType = this.options.sourceType;
  return this.finishNode(node, "Program")
};

var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};

pp$1.isLet = function(context) {
  if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
  skipWhiteSpace.lastIndex = this.pos;
  var skip = skipWhiteSpace.exec(this.input);
  var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  // For ambiguous cases, determine if a LexicalDeclaration (or only a
  // Statement) is allowed here. If context is not empty then only a Statement
  // is allowed. However, `let [` is an explicit negative lookahead for
  // ExpressionStatement, so special-case it first.
  if (nextCh === 91) { return true } // '['
  if (context) { return false }

  if (nextCh === 123) { return true } // '{'
  if (isIdentifierStart(nextCh, true)) {
  var pos = next + 1;
  while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
  var ident = this.input.slice(next, pos);
  if (!keywordRelationalOperator.test(ident)) { return true }
  }
  return false
};

// check 'async [no LineTerminator here] function'
// - 'async /*foo*/ function' is OK.
// - 'async /*\n*/ function' is invalid.
pp$1.isAsyncFunction = function() {
  if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
  { return false }

  skipWhiteSpace.lastIndex = this.pos;
  var skip = skipWhiteSpace.exec(this.input);
  var next = this.pos + skip[0].length;
  return !lineBreak.test(this.input.slice(this.pos, next)) &&
  this.input.slice(next, next + 8) === "function" &&
  (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))
};

// Parse a single statement.
//
// If expecting a statement and finding a slash operator, parse a
// regular expression literal. This is to handle cases like
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
// does not help.

pp$1.parseStatement = function(context, topLevel, exports) {
  var starttype = this.type, node = this.startNode(), kind;

  if (this.isLet(context)) {
  starttype = types._var;
  kind = "let";
  }

  // Most types of statements are recognized by the keyword they
  // start with. Many are trivial to parse, some require a bit of
  // complexity.

  switch (starttype) {
  case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
  case types._debugger: return this.parseDebuggerStatement(node)
  case types._do: return this.parseDoStatement(node)
  case types._for: return this.parseForStatement(node)
  case types._function:
  // Function as sole body of either an if statement or a labeled statement
  // works, but not when it is part of a labeled statement that is the sole
  // body of an if statement.
  if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
  return this.parseFunctionStatement(node, false, !context)
  case types._class:
  if (context) { this.unexpected(); }
  return this.parseClass(node, true)
  case types._if: return this.parseIfStatement(node)
  case types._return: return this.parseReturnStatement(node)
  case types._switch: return this.parseSwitchStatement(node)
  case types._throw: return this.parseThrowStatement(node)
  case types._try: return this.parseTryStatement(node)
  case types._const: case types._var:
  kind = kind || this.value;
  if (context && kind !== "var") { this.unexpected(); }
  return this.parseVarStatement(node, kind)
  case types._while: return this.parseWhileStatement(node)
  case types._with: return this.parseWithStatement(node)
  case types.braceL: return this.parseBlock(true, node)
  case types.semi: return this.parseEmptyStatement(node)
  case types._export:
  case types._import:
  if (this.options.ecmaVersion > 10 && starttype === types._import) {
    skipWhiteSpace.lastIndex = this.pos;
    var skip = skipWhiteSpace.exec(this.input);
    var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
    if (nextCh === 40 || nextCh === 46) // '(' or '.'
    { return this.parseExpressionStatement(node, this.parseExpression()) }
  }

  if (!this.options.allowImportExportEverywhere) {
    if (!topLevel)
    { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
    if (!this.inModule)
    { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
  }
  return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports)

  // If the statement does not start with a statement keyword or a
  // brace, it's an ExpressionStatement or LabeledStatement. We
  // simply start parsing an expression, and afterwards, if the
  // next token is a colon and the expression was a simple
  // Identifier node, we switch to interpreting it as a label.
  default:
  if (this.isAsyncFunction()) {
    if (context) { this.unexpected(); }
    this.next();
    return this.parseFunctionStatement(node, true, !context)
  }

  var maybeName = this.value, expr = this.parseExpression();
  if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon))
    { return this.parseLabeledStatement(node, maybeName, expr, context) }
  else { return this.parseExpressionStatement(node, expr) }
  }
};

pp$1.parseBreakContinueStatement = function(node, keyword) {
  var isBreak = keyword === "break";
  this.next();
  if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; }
  else if (this.type !== types.name) { this.unexpected(); }
  else {
  node.label = this.parseIdent();
  this.semicolon();
  }

  // Verify that there is an actual destination to break or
  // continue to.
  var i = 0;
  for (; i < this.labels.length; ++i) {
  var lab = this.labels[i];
  if (node.label == null || lab.name === node.label.name) {
    if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
    if (node.label && isBreak) { break }
  }
  }
  if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
  return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
};

pp$1.parseDebuggerStatement = function(node) {
  this.next();
  this.semicolon();
  return this.finishNode(node, "DebuggerStatement")
};

pp$1.parseDoStatement = function(node) {
  this.next();
  this.labels.push(loopLabel);
  node.body = this.parseStatement("do");
  this.labels.pop();
  this.expect(types._while);
  node.test = this.parseParenExpression();
  if (this.options.ecmaVersion >= 6)
  { this.eat(types.semi); }
  else
  { this.semicolon(); }
  return this.finishNode(node, "DoWhileStatement")
};

// Disambiguating between a `for` and a `for`/`in` or `for`/`of`
// loop is non-trivial. Basically, we have to parse the init `var`
// statement or expression, disallowing the `in` operator (see
// the second parameter to `parseExpression`), and then check
// whether the next token is `in` or `of`. When there is no init
// part (semicolon immediately after the opening parenthesis), it
// is a regular `for` loop.

pp$1.parseForStatement = function(node) {
  this.next();
  var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
  this.labels.push(loopLabel);
  this.enterScope(0);
  this.expect(types.parenL);
  if (this.type === types.semi) {
  if (awaitAt > -1) { this.unexpected(awaitAt); }
  return this.parseFor(node, null)
  }
  var isLet = this.isLet();
  if (this.type === types._var || this.type === types._const || isLet) {
  var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
  this.next();
  this.parseVar(init$1, true, kind);
  this.finishNode(init$1, "VariableDeclaration");
  if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
    if (this.options.ecmaVersion >= 9) {
    if (this.type === types._in) {
      if (awaitAt > -1) { this.unexpected(awaitAt); }
    } else { node.await = awaitAt > -1; }
    }
    return this.parseForIn(node, init$1)
  }
  if (awaitAt > -1) { this.unexpected(awaitAt); }
  return this.parseFor(node, init$1)
  }
  var refDestructuringErrors = new DestructuringErrors;
  var init = this.parseExpression(true, refDestructuringErrors);
  if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
  if (this.options.ecmaVersion >= 9) {
    if (this.type === types._in) {
    if (awaitAt > -1) { this.unexpected(awaitAt); }
    } else { node.await = awaitAt > -1; }
  }
  this.toAssignable(init, false, refDestructuringErrors);
  this.checkLValPattern(init);
  return this.parseForIn(node, init)
  } else {
  this.checkExpressionErrors(refDestructuringErrors, true);
  }
  if (awaitAt > -1) { this.unexpected(awaitAt); }
  return this.parseFor(node, init)
};

pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) {
  this.next();
  return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
};

pp$1.parseIfStatement = function(node) {
  this.next();
  node.test = this.parseParenExpression();
  // allow function declarations in branches, but only in non-strict mode
  node.consequent = this.parseStatement("if");
  node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
  return this.finishNode(node, "IfStatement")
};

pp$1.parseReturnStatement = function(node) {
  if (!this.inFunction && !this.options.allowReturnOutsideFunction)
  { this.raise(this.start, "'return' outside of function"); }
  this.next();

  // In `return` (and `break`/`continue`), the keywords with
  // optional arguments, we eagerly look for a semicolon or the
  // possibility to insert one.

  if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; }
  else { node.argument = this.parseExpression(); this.semicolon(); }
  return this.finishNode(node, "ReturnStatement")
};

pp$1.parseSwitchStatement = function(node) {
  this.next();
  node.discriminant = this.parseParenExpression();
  node.cases = [];
  this.expect(types.braceL);
  this.labels.push(switchLabel);
  this.enterScope(0);

  // Statements under must be grouped (by label) in SwitchCase
  // nodes. `cur` is used to keep the node that we are currently
  // adding statements to.

  var cur;
  for (var sawDefault = false; this.type !== types.braceR;) {
  if (this.type === types._case || this.type === types._default) {
    var isCase = this.type === types._case;
    if (cur) { this.finishNode(cur, "SwitchCase"); }
    node.cases.push(cur = this.startNode());
    cur.consequent = [];
    this.next();
    if (isCase) {
    cur.test = this.parseExpression();
    } else {
    if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
    sawDefault = true;
    cur.test = null;
    }
    this.expect(types.colon);
  } else {
    if (!cur) { this.unexpected(); }
    cur.consequent.push(this.parseStatement(null));
  }
  }
  this.exitScope();
  if (cur) { this.finishNode(cur, "SwitchCase"); }
  this.next(); // Closing brace
  this.labels.pop();
  return this.finishNode(node, "SwitchStatement")
};

pp$1.parseThrowStatement = function(node) {
  this.next();
  if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
  { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
  node.argument = this.parseExpression();
  this.semicolon();
  return this.finishNode(node, "ThrowStatement")
};

// Reused empty array added for node fields that are always empty.

var empty = [];

pp$1.parseTryStatement = function(node) {
  this.next();
  node.block = this.parseBlock();
  node.handler = null;
  if (this.type === types._catch) {
  var clause = this.startNode();
  this.next();
  if (this.eat(types.parenL)) {
    clause.param = this.parseBindingAtom();
    var simple = clause.param.type === "Identifier";
    this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
    this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
    this.expect(types.parenR);
  } else {
    if (this.options.ecmaVersion < 10) { this.unexpected(); }
    clause.param = null;
    this.enterScope(0);
  }
  clause.body = this.parseBlock(false);
  this.exitScope();
  node.handler = this.finishNode(clause, "CatchClause");
  }
  node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
  if (!node.handler && !node.finalizer)
  { this.raise(node.start, "Missing catch or finally clause"); }
  return this.finishNode(node, "TryStatement")
};

pp$1.parseVarStatement = function(node, kind) {
  this.next();
  this.parseVar(node, false, kind);
  this.semicolon();
  return this.finishNode(node, "VariableDeclaration")
};

pp$1.parseWhileStatement = function(node) {
  this.next();
  node.test = this.parseParenExpression();
  this.labels.push(loopLabel);
  node.body = this.parseStatement("while");
  this.labels.pop();
  return this.finishNode(node, "WhileStatement")
};

pp$1.parseWithStatement = function(node) {
  if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
  this.next();
  node.object = this.parseParenExpression();
  node.body = this.parseStatement("with");
  return this.finishNode(node, "WithStatement")
};

pp$1.parseEmptyStatement = function(node) {
  this.next();
  return this.finishNode(node, "EmptyStatement")
};

pp$1.parseLabeledStatement = function(node, maybeName, expr, context) {
  for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
  {
  var label = list[i$1];

  if (label.name === maybeName)
    { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  } }
  var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null;
  for (var i = this.labels.length - 1; i >= 0; i--) {
  var label$1 = this.labels[i];
  if (label$1.statementStart === node.start) {
    // Update information about previous labels on this node
    label$1.statementStart = this.start;
    label$1.kind = kind;
  } else { break }
  }
  this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
  node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
  this.labels.pop();
  node.label = expr;
  return this.finishNode(node, "LabeledStatement")
};

pp$1.parseExpressionStatement = function(node, expr) {
  node.expression = expr;
  this.semicolon();
  return this.finishNode(node, "ExpressionStatement")
};

// Parse a semicolon-enclosed block of statements, handling `"use
// strict"` declarations when `allowStrict` is true (used for
// function bodies).

pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
  if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
  if ( node === void 0 ) node = this.startNode();

  node.body = [];
  this.expect(types.braceL);
  if (createNewLexicalScope) { this.enterScope(0); }
  while (this.type !== types.braceR) {
  var stmt = this.parseStatement(null);
  node.body.push(stmt);
  }
  if (exitStrict) { this.strict = false; }
  this.next();
  if (createNewLexicalScope) { this.exitScope(); }
  return this.finishNode(node, "BlockStatement")
};

// Parse a regular `for` loop. The disambiguation code in
// `parseStatement` will already have parsed the init statement or
// expression.

pp$1.parseFor = function(node, init) {
  node.init = init;
  this.expect(types.semi);
  node.test = this.type === types.semi ? null : this.parseExpression();
  this.expect(types.semi);
  node.update = this.type === types.parenR ? null : this.parseExpression();
  this.expect(types.parenR);
  node.body = this.parseStatement("for");
  this.exitScope();
  this.labels.pop();
  return this.finishNode(node, "ForStatement")
};

// Parse a `for`/`in` and `for`/`of` loop, which are almost
// same from parser's perspective.

pp$1.parseForIn = function(node, init) {
  var isForIn = this.type === types._in;
  this.next();

  if (
  init.type === "VariableDeclaration" &&
  init.declarations[0].init != null &&
  (
    !isForIn ||
    this.options.ecmaVersion < 8 ||
    this.strict ||
    init.kind !== "var" ||
    init.declarations[0].id.type !== "Identifier"
  )
  ) {
  this.raise(
    init.start,
    ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
  );
  }
  node.left = init;
  node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
  this.expect(types.parenR);
  node.body = this.parseStatement("for");
  this.exitScope();
  this.labels.pop();
  return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
};

// Parse a list of variable declarations.

pp$1.parseVar = function(node, isFor, kind) {
  node.declarations = [];
  node.kind = kind;
  for (;;) {
  var decl = this.startNode();
  this.parseVarId(decl, kind);
  if (this.eat(types.eq)) {
    decl.init = this.parseMaybeAssign(isFor);
  } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
    this.unexpected();
  } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) {
    this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
  } else {
    decl.init = null;
  }
  node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
  if (!this.eat(types.comma)) { break }
  }
  return node
};

pp$1.parseVarId = function(decl, kind) {
  decl.id = this.parseBindingAtom();
  this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
};

var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;

// Parse a function declaration or literal (depending on the
// `statement & FUNC_STATEMENT`).

// Remove `allowExpressionBody` for 7.0.0, as it is only called with false
pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
  this.initFunction(node);
  if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
  if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT))
    { this.unexpected(); }
  node.generator = this.eat(types.star);
  }
  if (this.options.ecmaVersion >= 8)
  { node.async = !!isAsync; }

  if (statement & FUNC_STATEMENT) {
  node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent();
  if (node.id && !(statement & FUNC_HANGING_STATEMENT))
    // If it is a regular function declaration in sloppy mode, then it is
    // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
    // mode depends on properties of the current scope (see
    // treatFunctionsAsVar).
    { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
  }

  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;
  this.enterScope(functionFlags(node.async, node.generator));

  if (!(statement & FUNC_STATEMENT))
  { node.id = this.type === types.name ? this.parseIdent() : null; }

  this.parseFunctionParams(node);
  this.parseFunctionBody(node, allowExpressionBody, false);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
};

pp$1.parseFunctionParams = function(node) {
  this.expect(types.parenL);
  node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
  this.checkYieldAwaitInDefaultParams();
};

// Parse a class declaration or literal (depending on the
// `isStatement` parameter).

pp$1.parseClass = function(node, isStatement) {
  this.next();

  // ecma-262 14.6 Class Definitions
  // A class definition is always strict mode code.
  var oldStrict = this.strict;
  this.strict = true;

  this.parseClassId(node, isStatement);
  this.parseClassSuper(node);
  var classBody = this.startNode();
  var hadConstructor = false;
  classBody.body = [];
  this.expect(types.braceL);
  while (this.type !== types.braceR) {
  var element = this.parseClassElement(node.superClass !== null);
  if (element) {
    classBody.body.push(element);
    if (element.type === "MethodDefinition" && element.kind === "constructor") {
    if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
    hadConstructor = true;
    }
  }
  }
  this.strict = oldStrict;
  this.next();
  node.body = this.finishNode(classBody, "ClassBody");
  return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
};

pp$1.parseClassElement = function(constructorAllowsSuper) {
  var this$1 = this;

  if (this.eat(types.semi)) { return null }

  var method = this.startNode();
  var tryContextual = function (k, noLineBreak) {
  if ( noLineBreak === void 0 ) noLineBreak = false;

  var start = this$1.start, startLoc = this$1.startLoc;
  if (!this$1.eatContextual(k)) { return false }
  if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true }
  if (method.key) { this$1.unexpected(); }
  method.computed = false;
  method.key = this$1.startNodeAt(start, startLoc);
  method.key.name = k;
  this$1.finishNode(method.key, "Identifier");
  return false
  };

  method.kind = "method";
  method.static = tryContextual("static");
  var isGenerator = this.eat(types.star);
  var isAsync = false;
  if (!isGenerator) {
  if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
    isAsync = true;
    isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
  } else if (tryContextual("get")) {
    method.kind = "get";
  } else if (tryContextual("set")) {
    method.kind = "set";
  }
  }
  if (!method.key) { this.parsePropertyName(method); }
  var key = method.key;
  var allowsDirectSuper = false;
  if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
    key.type === "Literal" && key.value === "constructor")) {
  if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
  if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
  if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
  method.kind = "constructor";
  allowsDirectSuper = constructorAllowsSuper;
  } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
  this.raise(key.start, "Classes may not have a static property named prototype");
  }
  this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
  if (method.kind === "get" && method.value.params.length !== 0)
  { this.raiseRecoverable(method.value.start, "getter should have no params"); }
  if (method.kind === "set" && method.value.params.length !== 1)
  { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
  if (method.kind === "set" && method.value.params[0].type === "RestElement")
  { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
  return method
};

pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
  method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
  return this.finishNode(method, "MethodDefinition")
};

pp$1.parseClassId = function(node, isStatement) {
  if (this.type === types.name) {
  node.id = this.parseIdent();
  if (isStatement)
    { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
  } else {
  if (isStatement === true)
    { this.unexpected(); }
  node.id = null;
  }
};

pp$1.parseClassSuper = function(node) {
  node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
};

// Parses module export declaration.

pp$1.parseExport = function(node, exports) {
  this.next();
  // export * from '...'
  if (this.eat(types.star)) {
  if (this.options.ecmaVersion >= 11) {
    if (this.eatContextual("as")) {
    node.exported = this.parseIdent(true);
    this.checkExport(exports, node.exported.name, this.lastTokStart);
    } else {
    node.exported = null;
    }
  }
  this.expectContextual("from");
  if (this.type !== types.string) { this.unexpected(); }
  node.source = this.parseExprAtom();
  this.semicolon();
  return this.finishNode(node, "ExportAllDeclaration")
  }
  if (this.eat(types._default)) { // export default ...
  this.checkExport(exports, "default", this.lastTokStart);
  var isAsync;
  if (this.type === types._function || (isAsync = this.isAsyncFunction())) {
    var fNode = this.startNode();
    this.next();
    if (isAsync) { this.next(); }
    node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
  } else if (this.type === types._class) {
    var cNode = this.startNode();
    node.declaration = this.parseClass(cNode, "nullableID");
  } else {
    node.declaration = this.parseMaybeAssign();
    this.semicolon();
  }
  return this.finishNode(node, "ExportDefaultDeclaration")
  }
  // export var|const|let|function|class ...
  if (this.shouldParseExportStatement()) {
  node.declaration = this.parseStatement(null);
  if (node.declaration.type === "VariableDeclaration")
    { this.checkVariableExport(exports, node.declaration.declarations); }
  else
    { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); }
  node.specifiers = [];
  node.source = null;
  } else { // export { x, y as z } [from '...']
  node.declaration = null;
  node.specifiers = this.parseExportSpecifiers(exports);
  if (this.eatContextual("from")) {
    if (this.type !== types.string) { this.unexpected(); }
    node.source = this.parseExprAtom();
  } else {
    for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
    // check for keywords used as local names
    var spec = list[i];

    this.checkUnreserved(spec.local);
    // check if export is defined
    this.checkLocalExport(spec.local);
    }

    node.source = null;
  }
  this.semicolon();
  }
  return this.finishNode(node, "ExportNamedDeclaration")
};

pp$1.checkExport = function(exports, name, pos) {
  if (!exports) { return }
  if (has(exports, name))
  { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
  exports[name] = true;
};

pp$1.checkPatternExport = function(exports, pat) {
  var type = pat.type;
  if (type === "Identifier")
  { this.checkExport(exports, pat.name, pat.start); }
  else if (type === "ObjectPattern")
  { for (var i = 0, list = pat.properties; i < list.length; i += 1)
    {
    var prop = list[i];

    this.checkPatternExport(exports, prop);
    } }
  else if (type === "ArrayPattern")
  { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
    var elt = list$1[i$1];

    if (elt) { this.checkPatternExport(exports, elt); }
  } }
  else if (type === "Property")
  { this.checkPatternExport(exports, pat.value); }
  else if (type === "AssignmentPattern")
  { this.checkPatternExport(exports, pat.left); }
  else if (type === "RestElement")
  { this.checkPatternExport(exports, pat.argument); }
  else if (type === "ParenthesizedExpression")
  { this.checkPatternExport(exports, pat.expression); }
};

pp$1.checkVariableExport = function(exports, decls) {
  if (!exports) { return }
  for (var i = 0, list = decls; i < list.length; i += 1)
  {
  var decl = list[i];

  this.checkPatternExport(exports, decl.id);
  }
};

pp$1.shouldParseExportStatement = function() {
  return this.type.keyword === "var" ||
  this.type.keyword === "const" ||
  this.type.keyword === "class" ||
  this.type.keyword === "function" ||
  this.isLet() ||
  this.isAsyncFunction()
};

// Parses a comma-separated list of module exports.

pp$1.parseExportSpecifiers = function(exports) {
  var nodes = [], first = true;
  // export { x, y as z } [from '...']
  this.expect(types.braceL);
  while (!this.eat(types.braceR)) {
  if (!first) {
    this.expect(types.comma);
    if (this.afterTrailingComma(types.braceR)) { break }
  } else { first = false; }

  var node = this.startNode();
  node.local = this.parseIdent(true);
  node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local;
  this.checkExport(exports, node.exported.name, node.exported.start);
  nodes.push(this.finishNode(node, "ExportSpecifier"));
  }
  return nodes
};

// Parses import declaration.

pp$1.parseImport = function(node) {
  this.next();
  // import '...'
  if (this.type === types.string) {
  node.specifiers = empty;
  node.source = this.parseExprAtom();
  } else {
  node.specifiers = this.parseImportSpecifiers();
  this.expectContextual("from");
  node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected();
  }
  this.semicolon();
  return this.finishNode(node, "ImportDeclaration")
};

// Parses a comma-separated list of module imports.

pp$1.parseImportSpecifiers = function() {
  var nodes = [], first = true;
  if (this.type === types.name) {
  // import defaultObj, { x, y as z } from '...'
  var node = this.startNode();
  node.local = this.parseIdent();
  this.checkLValSimple(node.local, BIND_LEXICAL);
  nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
  if (!this.eat(types.comma)) { return nodes }
  }
  if (this.type === types.star) {
  var node$1 = this.startNode();
  this.next();
  this.expectContextual("as");
  node$1.local = this.parseIdent();
  this.checkLValSimple(node$1.local, BIND_LEXICAL);
  nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
  return nodes
  }
  this.expect(types.braceL);
  while (!this.eat(types.braceR)) {
  if (!first) {
    this.expect(types.comma);
    if (this.afterTrailingComma(types.braceR)) { break }
  } else { first = false; }

  var node$2 = this.startNode();
  node$2.imported = this.parseIdent(true);
  if (this.eatContextual("as")) {
    node$2.local = this.parseIdent();
  } else {
    this.checkUnreserved(node$2.imported);
    node$2.local = node$2.imported;
  }
  this.checkLValSimple(node$2.local, BIND_LEXICAL);
  nodes.push(this.finishNode(node$2, "ImportSpecifier"));
  }
  return nodes
};

// Set `ExpressionStatement#directive` property for directive prologues.
pp$1.adaptDirectivePrologue = function(statements) {
  for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
  statements[i].directive = statements[i].expression.raw.slice(1, -1);
  }
};
pp$1.isDirectiveCandidate = function(statement) {
  return (
  statement.type === "ExpressionStatement" &&
  statement.expression.type === "Literal" &&
  typeof statement.expression.value === "string" &&
  // Reject parenthesized strings.
  (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
  )
};

var pp$2 = Parser.prototype;

// Convert existing expression atom to assignable pattern
// if possible.

pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
  if (this.options.ecmaVersion >= 6 && node) {
  switch (node.type) {
  case "Identifier":
    if (this.inAsync && node.name === "await")
    { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
    break

  case "ObjectPattern":
  case "ArrayPattern":
  case "AssignmentPattern":
  case "RestElement":
    break

  case "ObjectExpression":
    node.type = "ObjectPattern";
    if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
    for (var i = 0, list = node.properties; i < list.length; i += 1) {
    var prop = list[i];

    this.toAssignable(prop, isBinding);
    // Early error:
    //   AssignmentRestProperty[Yield, Await] :
    //   `...` DestructuringAssignmentTarget[Yield, Await]
    //
    //   It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
    if (
      prop.type === "RestElement" &&
      (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
    ) {
      this.raise(prop.argument.start, "Unexpected token");
    }
    }
    break

  case "Property":
    // AssignmentProperty has type === "Property"
    if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
    this.toAssignable(node.value, isBinding);
    break

  case "ArrayExpression":
    node.type = "ArrayPattern";
    if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
    this.toAssignableList(node.elements, isBinding);
    break

  case "SpreadElement":
    node.type = "RestElement";
    this.toAssignable(node.argument, isBinding);
    if (node.argument.type === "AssignmentPattern")
    { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
    break

  case "AssignmentExpression":
    if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
    node.type = "AssignmentPattern";
    delete node.operator;
    this.toAssignable(node.left, isBinding);
    break

  case "ParenthesizedExpression":
    this.toAssignable(node.expression, isBinding, refDestructuringErrors);
    break

  case "ChainExpression":
    this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
    break

  case "MemberExpression":
    if (!isBinding) { break }

  default:
    this.raise(node.start, "Assigning to rvalue");
  }
  } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
  return node
};

// Convert list of expression atoms to binding list.

pp$2.toAssignableList = function(exprList, isBinding) {
  var end = exprList.length;
  for (var i = 0; i < end; i++) {
  var elt = exprList[i];
  if (elt) { this.toAssignable(elt, isBinding); }
  }
  if (end) {
  var last = exprList[end - 1];
  if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
    { this.unexpected(last.argument.start); }
  }
  return exprList
};

// Parses spread element.

pp$2.parseSpread = function(refDestructuringErrors) {
  var node = this.startNode();
  this.next();
  node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  return this.finishNode(node, "SpreadElement")
};

pp$2.parseRestBinding = function() {
  var node = this.startNode();
  this.next();

  // RestElement inside of a function parameter must be an identifier
  if (this.options.ecmaVersion === 6 && this.type !== types.name)
  { this.unexpected(); }

  node.argument = this.parseBindingAtom();

  return this.finishNode(node, "RestElement")
};

// Parses lvalue (assignable) atom.

pp$2.parseBindingAtom = function() {
  if (this.options.ecmaVersion >= 6) {
  switch (this.type) {
  case types.bracketL:
    var node = this.startNode();
    this.next();
    node.elements = this.parseBindingList(types.bracketR, true, true);
    return this.finishNode(node, "ArrayPattern")

  case types.braceL:
    return this.parseObj(true)
  }
  }
  return this.parseIdent()
};

pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
  var elts = [], first = true;
  while (!this.eat(close)) {
  if (first) { first = false; }
  else { this.expect(types.comma); }
  if (allowEmpty && this.type === types.comma) {
    elts.push(null);
  } else if (allowTrailingComma && this.afterTrailingComma(close)) {
    break
  } else if (this.type === types.ellipsis) {
    var rest = this.parseRestBinding();
    this.parseBindingListItem(rest);
    elts.push(rest);
    if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
    this.expect(close);
    break
  } else {
    var elem = this.parseMaybeDefault(this.start, this.startLoc);
    this.parseBindingListItem(elem);
    elts.push(elem);
  }
  }
  return elts
};

pp$2.parseBindingListItem = function(param) {
  return param
};

// Parses assignment pattern around given atom if possible.

pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
  left = left || this.parseBindingAtom();
  if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left }
  var node = this.startNodeAt(startPos, startLoc);
  node.left = left;
  node.right = this.parseMaybeAssign();
  return this.finishNode(node, "AssignmentPattern")
};

// The following three functions all verify that a node is an lvalue —
// something that can be bound, or assigned to. In order to do so, they perform
// a variety of checks:
//
// - Check that none of the bound/assigned-to identifiers are reserved words.
// - Record name declarations for bindings in the appropriate scope.
// - Check duplicate argument names, if checkClashes is set.
//
// If a complex binding pattern is encountered (e.g., object and array
// destructuring), the entire pattern is recursively checked.
//
// There are three versions of checkLVal*() appropriate for different
// circumstances:
//
// - checkLValSimple() shall be used if the syntactic construct supports
//   nothing other than identifiers and member expressions. Parenthesized
//   expressions are also correctly handled. This is generally appropriate for
//   constructs for which the spec says
//
//   > It is a Syntax Error if AssignmentTargetType of [the production] is not
//   > simple.
//
//   It is also appropriate for checking if an identifier is valid and not
//   defined elsewhere, like import declarations or function/class identifiers.
//
//   Examples where this is used include:
//   a += …;
//   import a from '…';
//   where a is the node to be checked.
//
// - checkLValPattern() shall be used if the syntactic construct supports
//   anything checkLValSimple() supports, as well as object and array
//   destructuring patterns. This is generally appropriate for constructs for
//   which the spec says
//
//   > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
//   > an ArrayLiteral and AssignmentTargetType of [the production] is not
//   > simple.
//
//   Examples where this is used include:
//   (a = …);
//   const a = …;
//   try { … } catch (a) { … }
//   where a is the node to be checked.
//
// - checkLValInnerPattern() shall be used if the syntactic construct supports
//   anything checkLValPattern() supports, as well as default assignment
//   patterns, rest elements, and other constructs that may appear within an
//   object or array destructuring pattern.
//
//   As a special case, function parameters also use checkLValInnerPattern(),
//   as they also support defaults and rest constructs.
//
// These functions deliberately support both assignment and binding constructs,
// as the logic for both is exceedingly similar. If the node is the target of
// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
// should be set to the appropriate BIND_* constant, like BIND_VAR or
// BIND_LEXICAL.
//
// If the function is called with a non-BIND_NONE bindingType, then
// additionally a checkClashes object may be specified to allow checking for
// duplicate argument names. checkClashes is ignored if the provided construct
// is an assignment (i.e., bindingType is BIND_NONE).

pp$2.checkLValSimple = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  var isBind = bindingType !== BIND_NONE;

  switch (expr.type) {
  case "Identifier":
  if (this.strict && this.reservedWordsStrictBind.test(expr.name))
    { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
  if (isBind) {
    if (bindingType === BIND_LEXICAL && expr.name === "let")
    { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
    if (checkClashes) {
    if (has(checkClashes, expr.name))
      { this.raiseRecoverable(expr.start, "Argument name clash"); }
    checkClashes[expr.name] = true;
    }
    if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
  }
  break

  case "ChainExpression":
  this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
  break

  case "MemberExpression":
  if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
  break

  case "ParenthesizedExpression":
  if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
  return this.checkLValSimple(expr.expression, bindingType, checkClashes)

  default:
  this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
  }
};

pp$2.checkLValPattern = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  switch (expr.type) {
  case "ObjectPattern":
  for (var i = 0, list = expr.properties; i < list.length; i += 1) {
    var prop = list[i];

  this.checkLValInnerPattern(prop, bindingType, checkClashes);
  }
  break

  case "ArrayPattern":
  for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
    var elem = list$1[i$1];

  if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
  }
  break

  default:
  this.checkLValSimple(expr, bindingType, checkClashes);
  }
};

pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  switch (expr.type) {
  case "Property":
  // AssignmentProperty has type === "Property"
  this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
  break

  case "AssignmentPattern":
  this.checkLValPattern(expr.left, bindingType, checkClashes);
  break

  case "RestElement":
  this.checkLValPattern(expr.argument, bindingType, checkClashes);
  break

  default:
  this.checkLValPattern(expr, bindingType, checkClashes);
  }
};

// A recursive descent parser operates by defining functions for all

var pp$3 = Parser.prototype;

// Check if property name clashes with already added.
// Object/class getters and setters are not allowed to clash —
// either with each other or with an init property — and in
// strict mode, init properties are also not allowed to be repeated.

pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
  if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
  { return }
  if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
  { return }
  var key = prop.key;
  var name;
  switch (key.type) {
  case "Identifier": name = key.name; break
  case "Literal": name = String(key.value); break
  default: return
  }
  var kind = prop.kind;
  if (this.options.ecmaVersion >= 6) {
  if (name === "__proto__" && kind === "init") {
    if (propHash.proto) {
    if (refDestructuringErrors) {
      if (refDestructuringErrors.doubleProto < 0)
      { refDestructuringErrors.doubleProto = key.start; }
      // Backwards-compat kludge. Can be removed in version 6.0
    } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
    }
    propHash.proto = true;
  }
  return
  }
  name = "$" + name;
  var other = propHash[name];
  if (other) {
  var redefinition;
  if (kind === "init") {
    redefinition = this.strict && other.init || other.get || other.set;
  } else {
    redefinition = other.init || other[kind];
  }
  if (redefinition)
    { this.raiseRecoverable(key.start, "Redefinition of property"); }
  } else {
  other = propHash[name] = {
    init: false,
    get: false,
    set: false
  };
  }
  other[kind] = true;
};

// ### Expression parsing

// These nest, from the most general expression type at the top to
// 'atomic', nondivisible expression types at the bottom. Most of
// the functions will simply let the function(s) below them parse,
// and, *if* the syntactic construct they handle is present, wrap
// the AST node that the inner parser gave them in another node.

// Parse a full expression. The optional arguments are used to
// forbid the `in` operator (in for loops initalization expressions)
// and provide reference for storing '=' operator inside shorthand
// property assignment in contexts where both object expression
// and object pattern might appear (so it's possible to raise
// delayed syntax error at correct position).

pp$3.parseExpression = function(noIn, refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
  if (this.type === types.comma) {
  var node = this.startNodeAt(startPos, startLoc);
  node.expressions = [expr];
  while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
  return this.finishNode(node, "SequenceExpression")
  }
  return expr
};

// Parse an assignment expression. This includes applications of
// operators like `+=`.

pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
  if (this.isContextual("yield")) {
  if (this.inGenerator) { return this.parseYield(noIn) }
  // The tokenizer will assume an expression is allowed after
  // `yield`, but this isn't that kind of yield
  else { this.exprAllowed = false; }
  }

  var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
  if (refDestructuringErrors) {
  oldParenAssign = refDestructuringErrors.parenthesizedAssign;
  oldTrailingComma = refDestructuringErrors.trailingComma;
  refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
  } else {
  refDestructuringErrors = new DestructuringErrors;
  ownDestructuringErrors = true;
  }

  var startPos = this.start, startLoc = this.startLoc;
  if (this.type === types.parenL || this.type === types.name)
  { this.potentialArrowAt = this.start; }
  var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
  if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
  if (this.type.isAssign) {
  var node = this.startNodeAt(startPos, startLoc);
  node.operator = this.value;
  if (this.type === types.eq)
    { left = this.toAssignable(left, false, refDestructuringErrors); }
  if (!ownDestructuringErrors) {
    refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
  }
  if (refDestructuringErrors.shorthandAssign >= left.start)
    { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
  if (this.type === types.eq)
    { this.checkLValPattern(left); }
  else
    { this.checkLValSimple(left); }
  node.left = left;
  this.next();
  node.right = this.parseMaybeAssign(noIn);
  return this.finishNode(node, "AssignmentExpression")
  } else {
  if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
  }
  if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
  if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
  return left
};

// Parse a ternary conditional (`?:`) operator.

pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseExprOps(noIn, refDestructuringErrors);
  if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  if (this.eat(types.question)) {
  var node = this.startNodeAt(startPos, startLoc);
  node.test = expr;
  node.consequent = this.parseMaybeAssign();
  this.expect(types.colon);
  node.alternate = this.parseMaybeAssign(noIn);
  return this.finishNode(node, "ConditionalExpression")
  }
  return expr
};

// Start the precedence parser.

pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseMaybeUnary(refDestructuringErrors, false);
  if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)
};

// Parse binary operators with the operator precedence parsing
// algorithm. `left` is the left-hand side of the operator.
// `minPrec` provides context that allows the function to stop and
// defer further parser to one of its callers when it encounters an
// operator that has a lower precedence than the set it is parsing.

pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
  var prec = this.type.binop;
  if (prec != null && (!noIn || this.type !== types._in)) {
  if (prec > minPrec) {
    var logical = this.type === types.logicalOR || this.type === types.logicalAND;
    var coalesce = this.type === types.coalesce;
    if (coalesce) {
    // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
    // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
    prec = types.logicalAND.binop;
    }
    var op = this.value;
    this.next();
    var startPos = this.start, startLoc = this.startLoc;
    var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
    var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
    if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
    this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
    }
    return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
  }
  }
  return left
};

pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
  var node = this.startNodeAt(startPos, startLoc);
  node.left = left;
  node.operator = op;
  node.right = right;
  return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
};

// Parse unary operators, both prefix and postfix.

pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
  var startPos = this.start, startLoc = this.startLoc, expr;
  if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {
  expr = this.parseAwait();
  sawUnary = true;
  } else if (this.type.prefix) {
  var node = this.startNode(), update = this.type === types.incDec;
  node.operator = this.value;
  node.prefix = true;
  this.next();
  node.argument = this.parseMaybeUnary(null, true);
  this.checkExpressionErrors(refDestructuringErrors, true);
  if (update) { this.checkLValSimple(node.argument); }
  else if (this.strict && node.operator === "delete" &&
       node.argument.type === "Identifier")
    { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
  else { sawUnary = true; }
  expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
  } else {
  expr = this.parseExprSubscripts(refDestructuringErrors);
  if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  while (this.type.postfix && !this.canInsertSemicolon()) {
    var node$1 = this.startNodeAt(startPos, startLoc);
    node$1.operator = this.value;
    node$1.prefix = false;
    node$1.argument = expr;
    this.checkLValSimple(expr);
    this.next();
    expr = this.finishNode(node$1, "UpdateExpression");
  }
  }

  if (!sawUnary && this.eat(types.starstar))
  { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) }
  else
  { return expr }
};

// Parse call, dot, and `[]`-subscript expressions.

pp$3.parseExprSubscripts = function(refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseExprAtom(refDestructuringErrors);
  if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
  { return expr }
  var result = this.parseSubscripts(expr, startPos, startLoc);
  if (refDestructuringErrors && result.type === "MemberExpression") {
  if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
  if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
  }
  return result
};

pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
  var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
    this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
    this.potentialArrowAt === base.start;
  var optionalChained = false;

  while (true) {
  var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);

  if (element.optional) { optionalChained = true; }
  if (element === base || element.type === "ArrowFunctionExpression") {
    if (optionalChained) {
    var chainNode = this.startNodeAt(startPos, startLoc);
    chainNode.expression = element;
    element = this.finishNode(chainNode, "ChainExpression");
    }
    return element
  }

  base = element;
  }
};

pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
  var optionalSupported = this.options.ecmaVersion >= 11;
  var optional = optionalSupported && this.eat(types.questionDot);
  if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }

  var computed = this.eat(types.bracketL);
  if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
  var node = this.startNodeAt(startPos, startLoc);
  node.object = base;
  node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
  node.computed = !!computed;
  if (computed) { this.expect(types.bracketR); }
  if (optionalSupported) {
    node.optional = optional;
  }
  base = this.finishNode(node, "MemberExpression");
  } else if (!noCalls && this.eat(types.parenL)) {
  var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;
  var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
  if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
    this.checkPatternErrors(refDestructuringErrors, false);
    this.checkYieldAwaitInDefaultParams();
    if (this.awaitIdentPos > 0)
    { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
    this.yieldPos = oldYieldPos;
    this.awaitPos = oldAwaitPos;
    this.awaitIdentPos = oldAwaitIdentPos;
    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
  }
  this.checkExpressionErrors(refDestructuringErrors, true);
  this.yieldPos = oldYieldPos || this.yieldPos;
  this.awaitPos = oldAwaitPos || this.awaitPos;
  this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
  var node$1 = this.startNodeAt(startPos, startLoc);
  node$1.callee = base;
  node$1.arguments = exprList;
  if (optionalSupported) {
    node$1.optional = optional;
  }
  base = this.finishNode(node$1, "CallExpression");
  } else if (this.type === types.backQuote) {
  if (optional || optionalChained) {
    this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
  }
  var node$2 = this.startNodeAt(startPos, startLoc);
  node$2.tag = base;
  node$2.quasi = this.parseTemplate({isTagged: true});
  base = this.finishNode(node$2, "TaggedTemplateExpression");
  }
  return base
};

// Parse an atomic expression — either a single token that is an
// expression, an expression started by a keyword like `function` or
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
// or `{}`.

pp$3.parseExprAtom = function(refDestructuringErrors) {
  // If a division operator appears in an expression position, the
  // tokenizer got confused, and we force it to read a regexp instead.
  if (this.type === types.slash) { this.readRegexp(); }

  var node, canBeArrow = this.potentialArrowAt === this.start;
  switch (this.type) {
  case types._super:
  if (!this.allowSuper)
    { this.raise(this.start, "'super' keyword outside a method"); }
  node = this.startNode();
  this.next();
  if (this.type === types.parenL && !this.allowDirectSuper)
    { this.raise(node.start, "super() call outside constructor of a subclass"); }
  // The `super` keyword can appear at below:
  // SuperProperty:
  //   super [ Expression ]
  //   super . IdentifierName
  // SuperCall:
  //   super ( Arguments )
  if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
    { this.unexpected(); }
  return this.finishNode(node, "Super")

  case types._this:
  node = this.startNode();
  this.next();
  return this.finishNode(node, "ThisExpression")

  case types.name:
  var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
  var id = this.parseIdent(false);
  if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
    { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
  if (canBeArrow && !this.canInsertSemicolon()) {
    if (this.eat(types.arrow))
    { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) }
    if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) {
    id = this.parseIdent(false);
    if (this.canInsertSemicolon() || !this.eat(types.arrow))
      { this.unexpected(); }
    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
    }
  }
  return id

  case types.regexp:
  var value = this.value;
  node = this.parseLiteral(value.value);
  node.regex = {pattern: value.pattern, flags: value.flags};
  return node

  case types.num: case types.string:
  return this.parseLiteral(this.value)

  case types._null: case types._true: case types._false:
  node = this.startNode();
  node.value = this.type === types._null ? null : this.type === types._true;
  node.raw = this.type.keyword;
  this.next();
  return this.finishNode(node, "Literal")

  case types.parenL:
  var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
  if (refDestructuringErrors) {
    if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
    { refDestructuringErrors.parenthesizedAssign = start; }
    if (refDestructuringErrors.parenthesizedBind < 0)
    { refDestructuringErrors.parenthesizedBind = start; }
  }
  return expr

  case types.bracketL:
  node = this.startNode();
  this.next();
  node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors);
  return this.finishNode(node, "ArrayExpression")

  case types.braceL:
  return this.parseObj(false, refDestructuringErrors)

  case types._function:
  node = this.startNode();
  this.next();
  return this.parseFunction(node, 0)

  case types._class:
  return this.parseClass(this.startNode(), false)

  case types._new:
  return this.parseNew()

  case types.backQuote:
  return this.parseTemplate()

  case types._import:
  if (this.options.ecmaVersion >= 11) {
    return this.parseExprImport()
  } else {
    return this.unexpected()
  }

  default:
  this.unexpected();
  }
};

pp$3.parseExprImport = function() {
  var node = this.startNode();

  // Consume `import` as an identifier for `import.meta`.
  // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
  if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
  var meta = this.parseIdent(true);

  switch (this.type) {
  case types.parenL:
  return this.parseDynamicImport(node)
  case types.dot:
  node.meta = meta;
  return this.parseImportMeta(node)
  default:
  this.unexpected();
  }
};

pp$3.parseDynamicImport = function(node) {
  this.next(); // skip `(`

  // Parse node.source.
  node.source = this.parseMaybeAssign();

  // Verify ending.
  if (!this.eat(types.parenR)) {
  var errorPos = this.start;
  if (this.eat(types.comma) && this.eat(types.parenR)) {
    this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
  } else {
    this.unexpected(errorPos);
  }
  }

  return this.finishNode(node, "ImportExpression")
};

pp$3.parseImportMeta = function(node) {
  this.next(); // skip `.`

  var containsEsc = this.containsEsc;
  node.property = this.parseIdent(true);

  if (node.property.name !== "meta")
  { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
  if (containsEsc)
  { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
  if (this.options.sourceType !== "module")
  { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }

  return this.finishNode(node, "MetaProperty")
};

pp$3.parseLiteral = function(value) {
  var node = this.startNode();
  node.value = value;
  node.raw = this.input.slice(this.start, this.end);
  if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
  this.next();
  return this.finishNode(node, "Literal")
};

pp$3.parseParenExpression = function() {
  this.expect(types.parenL);
  var val = this.parseExpression();
  this.expect(types.parenR);
  return val
};

pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
  var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
  if (this.options.ecmaVersion >= 6) {
  this.next();

  var innerStartPos = this.start, innerStartLoc = this.startLoc;
  var exprList = [], first = true, lastIsComma = false;
  var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
  this.yieldPos = 0;
  this.awaitPos = 0;
  // Do not save awaitIdentPos to allow checking awaits nested in parameters
  while (this.type !== types.parenR) {
    first ? first = false : this.expect(types.comma);
    if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) {
    lastIsComma = true;
    break
    } else if (this.type === types.ellipsis) {
    spreadStart = this.start;
    exprList.push(this.parseParenItem(this.parseRestBinding()));
    if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
    break
    } else {
    exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
    }
  }
  var innerEndPos = this.start, innerEndLoc = this.startLoc;
  this.expect(types.parenR);

  if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
    this.checkPatternErrors(refDestructuringErrors, false);
    this.checkYieldAwaitInDefaultParams();
    this.yieldPos = oldYieldPos;
    this.awaitPos = oldAwaitPos;
    return this.parseParenArrowList(startPos, startLoc, exprList)
  }

  if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
  if (spreadStart) { this.unexpected(spreadStart); }
  this.checkExpressionErrors(refDestructuringErrors, true);
  this.yieldPos = oldYieldPos || this.yieldPos;
  this.awaitPos = oldAwaitPos || this.awaitPos;

  if (exprList.length > 1) {
    val = this.startNodeAt(innerStartPos, innerStartLoc);
    val.expressions = exprList;
    this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
  } else {
    val = exprList[0];
  }
  } else {
  val = this.parseParenExpression();
  }

  if (this.options.preserveParens) {
  var par = this.startNodeAt(startPos, startLoc);
  par.expression = val;
  return this.finishNode(par, "ParenthesizedExpression")
  } else {
  return val
  }
};

pp$3.parseParenItem = function(item) {
  return item
};

pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
  return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
};

// New's precedence is slightly tricky. It must allow its argument to
// be a `[]` or dot subscript expression, but not a call — at least,
// not without wrapping it in parentheses. Thus, it uses the noCalls
// argument to parseSubscripts to prevent it from consuming the
// argument list.

var empty$1 = [];

pp$3.parseNew = function() {
  if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
  var node = this.startNode();
  var meta = this.parseIdent(true);
  if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
  node.meta = meta;
  var containsEsc = this.containsEsc;
  node.property = this.parseIdent(true);
  if (node.property.name !== "target")
    { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
  if (containsEsc)
    { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
  if (!this.inNonArrowFunction)
    { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
  return this.finishNode(node, "MetaProperty")
  }
  var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
  node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
  if (isImport && node.callee.type === "ImportExpression") {
  this.raise(startPos, "Cannot use new with import()");
  }
  if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
  else { node.arguments = empty$1; }
  return this.finishNode(node, "NewExpression")
};

// Parse template expression.

pp$3.parseTemplateElement = function(ref) {
  var isTagged = ref.isTagged;

  var elem = this.startNode();
  if (this.type === types.invalidTemplate) {
  if (!isTagged) {
    this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
  }
  elem.value = {
    raw: this.value,
    cooked: null
  };
  } else {
  elem.value = {
    raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
    cooked: this.value
  };
  }
  this.next();
  elem.tail = this.type === types.backQuote;
  return this.finishNode(elem, "TemplateElement")
};

pp$3.parseTemplate = function(ref) {
  if ( ref === void 0 ) ref = {};
  var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;

  var node = this.startNode();
  this.next();
  node.expressions = [];
  var curElt = this.parseTemplateElement({isTagged: isTagged});
  node.quasis = [curElt];
  while (!curElt.tail) {
  if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); }
  this.expect(types.dollarBraceL);
  node.expressions.push(this.parseExpression());
  this.expect(types.braceR);
  node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
  }
  this.next();
  return this.finishNode(node, "TemplateLiteral")
};

pp$3.isAsyncProp = function(prop) {
  return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
  (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
  !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
};

// Parse an object literal or binding pattern.

pp$3.parseObj = function(isPattern, refDestructuringErrors) {
  var node = this.startNode(), first = true, propHash = {};
  node.properties = [];
  this.next();
  while (!this.eat(types.braceR)) {
  if (!first) {
    this.expect(types.comma);
    if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
  } else { first = false; }

  var prop = this.parseProperty(isPattern, refDestructuringErrors);
  if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
  node.properties.push(prop);
  }
  return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
};

pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
  var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
  if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
  if (isPattern) {
    prop.argument = this.parseIdent(false);
    if (this.type === types.comma) {
    this.raise(this.start, "Comma is not permitted after the rest element");
    }
    return this.finishNode(prop, "RestElement")
  }
  // To disallow parenthesized identifier via `this.toAssignable()`.
  if (this.type === types.parenL && refDestructuringErrors) {
    if (refDestructuringErrors.parenthesizedAssign < 0) {
    refDestructuringErrors.parenthesizedAssign = this.start;
    }
    if (refDestructuringErrors.parenthesizedBind < 0) {
    refDestructuringErrors.parenthesizedBind = this.start;
    }
  }
  // Parse argument.
  prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  // To disallow trailing comma via `this.toAssignable()`.
  if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
    refDestructuringErrors.trailingComma = this.start;
  }
  // Finish
  return this.finishNode(prop, "SpreadElement")
  }
  if (this.options.ecmaVersion >= 6) {
  prop.method = false;
  prop.shorthand = false;
  if (isPattern || refDestructuringErrors) {
    startPos = this.start;
    startLoc = this.startLoc;
  }
  if (!isPattern)
    { isGenerator = this.eat(types.star); }
  }
  var containsEsc = this.containsEsc;
  this.parsePropertyName(prop);
  if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
  isAsync = true;
  isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
  this.parsePropertyName(prop, refDestructuringErrors);
  } else {
  isAsync = false;
  }
  this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
  return this.finishNode(prop, "Property")
};

pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
  if ((isGenerator || isAsync) && this.type === types.colon)
  { this.unexpected(); }

  if (this.eat(types.colon)) {
  prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
  prop.kind = "init";
  } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) {
  if (isPattern) { this.unexpected(); }
  prop.kind = "init";
  prop.method = true;
  prop.value = this.parseMethod(isGenerator, isAsync);
  } else if (!isPattern && !containsEsc &&
       this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
       (prop.key.name === "get" || prop.key.name === "set") &&
       (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
  if (isGenerator || isAsync) { this.unexpected(); }
  prop.kind = prop.key.name;
  this.parsePropertyName(prop);
  prop.value = this.parseMethod(false);
  var paramCount = prop.kind === "get" ? 0 : 1;
  if (prop.value.params.length !== paramCount) {
    var start = prop.value.start;
    if (prop.kind === "get")
    { this.raiseRecoverable(start, "getter should have no params"); }
    else
    { this.raiseRecoverable(start, "setter should have exactly one param"); }
  } else {
    if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
    { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
  }
  } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
  if (isGenerator || isAsync) { this.unexpected(); }
  this.checkUnreserved(prop.key);
  if (prop.key.name === "await" && !this.awaitIdentPos)
    { this.awaitIdentPos = startPos; }
  prop.kind = "init";
  if (isPattern) {
    prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  } else if (this.type === types.eq && refDestructuringErrors) {
    if (refDestructuringErrors.shorthandAssign < 0)
    { refDestructuringErrors.shorthandAssign = this.start; }
    prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  } else {
    prop.value = this.copyNode(prop.key);
  }
  prop.shorthand = true;
  } else { this.unexpected(); }
};

pp$3.parsePropertyName = function(prop) {
  if (this.options.ecmaVersion >= 6) {
  if (this.eat(types.bracketL)) {
    prop.computed = true;
    prop.key = this.parseMaybeAssign();
    this.expect(types.bracketR);
    return prop.key
  } else {
    prop.computed = false;
  }
  }
  return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
};

// Initialize empty function node.

pp$3.initFunction = function(node) {
  node.id = null;
  if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
  if (this.options.ecmaVersion >= 8) { node.async = false; }
};

// Parse object or class method.

pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
  var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

  this.initFunction(node);
  if (this.options.ecmaVersion >= 6)
  { node.generator = isGenerator; }
  if (this.options.ecmaVersion >= 8)
  { node.async = !!isAsync; }

  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;
  this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));

  this.expect(types.parenL);
  node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
  this.checkYieldAwaitInDefaultParams();
  this.parseFunctionBody(node, false, true);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, "FunctionExpression")
};

// Parse arrow function expression with given parameters.

pp$3.parseArrowExpression = function(node, params, isAsync) {
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

  this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
  this.initFunction(node);
  if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }

  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;

  node.params = this.toAssignableList(params, true);
  this.parseFunctionBody(node, true, false);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, "ArrowFunctionExpression")
};

// Parse function body and check parameters.

pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
  var isExpression = isArrowFunction && this.type !== types.braceL;
  var oldStrict = this.strict, useStrict = false;

  if (isExpression) {
  node.body = this.parseMaybeAssign();
  node.expression = true;
  this.checkParams(node, false);
  } else {
  var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
  if (!oldStrict || nonSimple) {
    useStrict = this.strictDirective(this.end);
    // If this is a strict mode function, verify that argument names
    // are not repeated, and it does not try to bind the words `eval`
    // or `arguments`.
    if (useStrict && nonSimple)
    { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
  }
  // Start a new scope with regard to labels and the `inFunction`
  // flag (restore them to their old value afterwards).
  var oldLabels = this.labels;
  this.labels = [];
  if (useStrict) { this.strict = true; }

  // Add the params to varDeclaredNames to ensure that an error is thrown
  // if a let/const declaration in the function clashes with one of the params.
  this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
  // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
  if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
  node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
  node.expression = false;
  this.adaptDirectivePrologue(node.body.body);
  this.labels = oldLabels;
  }
  this.exitScope();
};

pp$3.isSimpleParamList = function(params) {
  for (var i = 0, list = params; i < list.length; i += 1)
  {
  var param = list[i];

  if (param.type !== "Identifier") { return false
  } }
  return true
};

// Checks function params for various disallowed patterns such as using "eval"
// or "arguments" and duplicate parameters.

pp$3.checkParams = function(node, allowDuplicates) {
  var nameHash = Object.create(null);
  for (var i = 0, list = node.params; i < list.length; i += 1)
  {
  var param = list[i];

  this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
  }
};

// Parses a comma-separated list of expressions, and returns them as
// an array. `close` is the token type that ends the list, and
// `allowEmpty` can be turned on to allow subsequent commas with
// nothing in between them to be parsed as `null` (which is needed
// for array literals).

pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
  var elts = [], first = true;
  while (!this.eat(close)) {
  if (!first) {
    this.expect(types.comma);
    if (allowTrailingComma && this.afterTrailingComma(close)) { break }
  } else { first = false; }

  var elt = (void 0);
  if (allowEmpty && this.type === types.comma)
    { elt = null; }
  else if (this.type === types.ellipsis) {
    elt = this.parseSpread(refDestructuringErrors);
    if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0)
    { refDestructuringErrors.trailingComma = this.start; }
  } else {
    elt = this.parseMaybeAssign(false, refDestructuringErrors);
  }
  elts.push(elt);
  }
  return elts
};

pp$3.checkUnreserved = function(ref) {
  var start = ref.start;
  var end = ref.end;
  var name = ref.name;

  if (this.inGenerator && name === "yield")
  { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
  if (this.inAsync && name === "await")
  { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
  if (this.keywords.test(name))
  { this.raise(start, ("Unexpected keyword '" + name + "'")); }
  if (this.options.ecmaVersion < 6 &&
  this.input.slice(start, end).indexOf("\\") !== -1) { return }
  var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
  if (re.test(name)) {
  if (!this.inAsync && name === "await")
    { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
  this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
  }
};

// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.

pp$3.parseIdent = function(liberal, isBinding) {
  var node = this.startNode();
  if (this.type === types.name) {
  node.name = this.value;
  } else if (this.type.keyword) {
  node.name = this.type.keyword;

  // To fix https://github.com/acornjs/acorn/issues/575
  // `class` and `function` keywords push new context into this.context.
  // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
  // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
  if ((node.name === "class" || node.name === "function") &&
    (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
    this.context.pop();
  }
  } else {
  this.unexpected();
  }
  this.next(!!liberal);
  this.finishNode(node, "Identifier");
  if (!liberal) {
  this.checkUnreserved(node);
  if (node.name === "await" && !this.awaitIdentPos)
    { this.awaitIdentPos = node.start; }
  }
  return node
};

// Parses yield expression inside generator.

pp$3.parseYield = function(noIn) {
  if (!this.yieldPos) { this.yieldPos = this.start; }

  var node = this.startNode();
  this.next();
  if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {
  node.delegate = false;
  node.argument = null;
  } else {
  node.delegate = this.eat(types.star);
  node.argument = this.parseMaybeAssign(noIn);
  }
  return this.finishNode(node, "YieldExpression")
};

pp$3.parseAwait = function() {
  if (!this.awaitPos) { this.awaitPos = this.start; }

  var node = this.startNode();
  this.next();
  node.argument = this.parseMaybeUnary(null, true);
  return this.finishNode(node, "AwaitExpression")
};

var pp$4 = Parser.prototype;

// This function is used to raise exceptions on parse errors. It
// takes an offset integer (into the current `input`) to indicate
// the location of the error, attaches the position to the end
// of the error message, and then raises a `SyntaxError` with that
// message.

pp$4.raise = function(pos, message) {
  var loc = getLineInfo(this.input, pos);
  message += " (" + loc.line + ":" + loc.column + ")";
  var err = new SyntaxError(message);
  err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
  throw err
};

pp$4.raiseRecoverable = pp$4.raise;

pp$4.curPosition = function() {
  if (this.options.locations) {
  return new Position(this.curLine, this.pos - this.lineStart)
  }
};

var pp$5 = Parser.prototype;

var Scope = function Scope(flags) {
  this.flags = flags;
  // A list of var-declared names in the current lexical scope
  this.var = [];
  // A list of lexically-declared names in the current lexical scope
  this.lexical = [];
  // A list of lexically-declared FunctionDeclaration names in the current lexical scope
  this.functions = [];
};

// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.

pp$5.enterScope = function(flags) {
  this.scopeStack.push(new Scope(flags));
};

pp$5.exitScope = function() {
  this.scopeStack.pop();
};

// The spec says:
// > At the top level of a function, or script, function declarations are
// > treated like var declarations rather than like lexical declarations.
pp$5.treatFunctionsAsVarInScope = function(scope) {
  return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
};

pp$5.declareName = function(name, bindingType, pos) {
  var redeclared = false;
  if (bindingType === BIND_LEXICAL) {
  var scope = this.currentScope();
  redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
  scope.lexical.push(name);
  if (this.inModule && (scope.flags & SCOPE_TOP))
    { delete this.undefinedExports[name]; }
  } else if (bindingType === BIND_SIMPLE_CATCH) {
  var scope$1 = this.currentScope();
  scope$1.lexical.push(name);
  } else if (bindingType === BIND_FUNCTION) {
  var scope$2 = this.currentScope();
  if (this.treatFunctionsAsVar)
    { redeclared = scope$2.lexical.indexOf(name) > -1; }
  else
    { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
  scope$2.functions.push(name);
  } else {
  for (var i = this.scopeStack.length - 1; i >= 0; --i) {
    var scope$3 = this.scopeStack[i];
    if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
      !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
    redeclared = true;
    break
    }
    scope$3.var.push(name);
    if (this.inModule && (scope$3.flags & SCOPE_TOP))
    { delete this.undefinedExports[name]; }
    if (scope$3.flags & SCOPE_VAR) { break }
  }
  }
  if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
};

pp$5.checkLocalExport = function(id) {
  // scope.functions must be empty as Module code is always strict.
  if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
    this.scopeStack[0].var.indexOf(id.name) === -1) {
  this.undefinedExports[id.name] = id;
  }
};

pp$5.currentScope = function() {
  return this.scopeStack[this.scopeStack.length - 1]
};

pp$5.currentVarScope = function() {
  for (var i = this.scopeStack.length - 1;; i--) {
  var scope = this.scopeStack[i];
  if (scope.flags & SCOPE_VAR) { return scope }
  }
};

// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
pp$5.currentThisScope = function() {
  for (var i = this.scopeStack.length - 1;; i--) {
  var scope = this.scopeStack[i];
  if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
  }
};

var Node = function Node(parser, pos, loc) {
  this.type = "";
  this.start = pos;
  this.end = 0;
  if (parser.options.locations)
  { this.loc = new SourceLocation(parser, loc); }
  if (parser.options.directSourceFile)
  { this.sourceFile = parser.options.directSourceFile; }
  if (parser.options.ranges)
  { this.range = [pos, 0]; }
};

// Start an AST node, attaching a start offset.

var pp$6 = Parser.prototype;

pp$6.startNode = function() {
  return new Node(this, this.start, this.startLoc)
};

pp$6.startNodeAt = function(pos, loc) {
  return new Node(this, pos, loc)
};

// Finish an AST node, adding `type` and `end` properties.

function finishNodeAt(node, type, pos, loc) {
  node.type = type;
  node.end = pos;
  if (this.options.locations)
  { node.loc.end = loc; }
  if (this.options.ranges)
  { node.range[1] = pos; }
  return node
}

pp$6.finishNode = function(node, type) {
  return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
};

// Finish node at given position

pp$6.finishNodeAt = function(node, type, pos, loc) {
  return finishNodeAt.call(this, node, type, pos, loc)
};

pp$6.copyNode = function(node) {
  var newNode = new Node(this, node.start, this.startLoc);
  for (var prop in node) { newNode[prop] = node[prop]; }
  return newNode
};

// The algorithm used to determine whether a regexp can appear at a

var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
  this.token = token;
  this.isExpr = !!isExpr;
  this.preserveSpace = !!preserveSpace;
  this.override = override;
  this.generator = !!generator;
};

var types$1 = {
  b_stat: new TokContext("{", false),
  b_expr: new TokContext("{", true),
  b_tmpl: new TokContext("${", false),
  p_stat: new TokContext("(", false),
  p_expr: new TokContext("(", true),
  q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
  f_stat: new TokContext("function", false),
  f_expr: new TokContext("function", true),
  f_expr_gen: new TokContext("function", true, false, null, true),
  f_gen: new TokContext("function", false, false, null, true)
};

var pp$7 = Parser.prototype;

pp$7.initialContext = function() {
  return [types$1.b_stat]
};

pp$7.braceIsBlock = function(prevType) {
  var parent = this.curContext();
  if (parent === types$1.f_expr || parent === types$1.f_stat)
  { return true }
  if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
  { return !parent.isExpr }

  // The check for `tt.name && exprAllowed` detects whether we are
  // after a `yield` or `of` construct. See the `updateContext` for
  // `tt.name`.
  if (prevType === types._return || prevType === types.name && this.exprAllowed)
  { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
  if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
  { return true }
  if (prevType === types.braceL)
  { return parent === types$1.b_stat }
  if (prevType === types._var || prevType === types._const || prevType === types.name)
  { return false }
  return !this.exprAllowed
};

pp$7.inGeneratorContext = function() {
  for (var i = this.context.length - 1; i >= 1; i--) {
  var context = this.context[i];
  if (context.token === "function")
    { return context.generator }
  }
  return false
};

pp$7.updateContext = function(prevType) {
  var update, type = this.type;
  if (type.keyword && prevType === types.dot)
  { this.exprAllowed = false; }
  else if (update = type.updateContext)
  { update.call(this, prevType); }
  else
  { this.exprAllowed = type.beforeExpr; }
};

// Token-specific context update code

types.parenR.updateContext = types.braceR.updateContext = function() {
  if (this.context.length === 1) {
  this.exprAllowed = true;
  return
  }
  var out = this.context.pop();
  if (out === types$1.b_stat && this.curContext().token === "function") {
  out = this.context.pop();
  }
  this.exprAllowed = !out.isExpr;
};

types.braceL.updateContext = function(prevType) {
  this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
  this.exprAllowed = true;
};

types.dollarBraceL.updateContext = function() {
  this.context.push(types$1.b_tmpl);
  this.exprAllowed = true;
};

types.parenL.updateContext = function(prevType) {
  var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
  this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
  this.exprAllowed = true;
};

types.incDec.updateContext = function() {
  // tokExprAllowed stays unchanged
};

types._function.updateContext = types._class.updateContext = function(prevType) {
  if (prevType.beforeExpr && prevType !== types._else &&
    !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
    !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
    !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
  { this.context.push(types$1.f_expr); }
  else
  { this.context.push(types$1.f_stat); }
  this.exprAllowed = false;
};

types.backQuote.updateContext = function() {
  if (this.curContext() === types$1.q_tmpl)
  { this.context.pop(); }
  else
  { this.context.push(types$1.q_tmpl); }
  this.exprAllowed = false;
};

types.star.updateContext = function(prevType) {
  if (prevType === types._function) {
  var index = this.context.length - 1;
  if (this.context[index] === types$1.f_expr)
    { this.context[index] = types$1.f_expr_gen; }
  else
    { this.context[index] = types$1.f_gen; }
  }
  this.exprAllowed = true;
};

types.name.updateContext = function(prevType) {
  var allowed = false;
  if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
  if (this.value === "of" && !this.exprAllowed ||
    this.value === "yield" && this.inGeneratorContext())
    { allowed = true; }
  }
  this.exprAllowed = allowed;
};

// This file contains Unicode properties extracted from the ECMAScript
// specification. The lists are extracted like so:
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)

// #table-binary-unicode-properties
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
var ecma11BinaryProperties = ecma10BinaryProperties;
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
var unicodeBinaryProperties = {
  9: ecma9BinaryProperties,
  10: ecma10BinaryProperties,
  11: ecma11BinaryProperties,
  12: ecma12BinaryProperties
};

// #table-unicode-general-category-values
var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";

// #table-unicode-script-values
var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
var unicodeScriptValues = {
  9: ecma9ScriptValues,
  10: ecma10ScriptValues,
  11: ecma11ScriptValues,
  12: ecma12ScriptValues
};

var data = {};
function buildUnicodeData(ecmaVersion) {
  var d = data[ecmaVersion] = {
  binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
  nonBinary: {
    General_Category: wordsRegexp(unicodeGeneralCategoryValues),
    Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
  }
  };
  d.nonBinary.Script_Extensions = d.nonBinary.Script;

  d.nonBinary.gc = d.nonBinary.General_Category;
  d.nonBinary.sc = d.nonBinary.Script;
  d.nonBinary.scx = d.nonBinary.Script_Extensions;
}
buildUnicodeData(9);
buildUnicodeData(10);
buildUnicodeData(11);
buildUnicodeData(12);

var pp$8 = Parser.prototype;

var RegExpValidationState = function RegExpValidationState(parser) {
  this.parser = parser;
  this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
  this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
  this.source = "";
  this.flags = "";
  this.start = 0;
  this.switchU = false;
  this.switchN = false;
  this.pos = 0;
  this.lastIntValue = 0;
  this.lastStringValue = "";
  this.lastAssertionIsQuantifiable = false;
  this.numCapturingParens = 0;
  this.maxBackReference = 0;
  this.groupNames = [];
  this.backReferenceNames = [];
};

RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
  var unicode = flags.indexOf("u") !== -1;
  this.start = start | 0;
  this.source = pattern + "";
  this.flags = flags;
  this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
  this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
};

RegExpValidationState.prototype.raise = function raise (message) {
  this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
};

// If u flag is given, this returns the code point at the index (it combines a surrogate pair).
// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
RegExpValidationState.prototype.at = function at (i, forceU) {
  if ( forceU === void 0 ) forceU = false;

  var s = this.source;
  var l = s.length;
  if (i >= l) {
  return -1
  }
  var c = s.charCodeAt(i);
  if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
  return c
  }
  var next = s.charCodeAt(i + 1);
  return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
};

RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
  if ( forceU === void 0 ) forceU = false;

  var s = this.source;
  var l = s.length;
  if (i >= l) {
  return l
  }
  var c = s.charCodeAt(i), next;
  if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
    (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
  return i + 1
  }
  return i + 2
};

RegExpValidationState.prototype.current = function current (forceU) {
  if ( forceU === void 0 ) forceU = false;

  return this.at(this.pos, forceU)
};

RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
  if ( forceU === void 0 ) forceU = false;

  return this.at(this.nextIndex(this.pos, forceU), forceU)
};

RegExpValidationState.prototype.advance = function advance (forceU) {
  if ( forceU === void 0 ) forceU = false;

  this.pos = this.nextIndex(this.pos, forceU);
};

RegExpValidationState.prototype.eat = function eat (ch, forceU) {
  if ( forceU === void 0 ) forceU = false;

  if (this.current(forceU) === ch) {
  this.advance(forceU);
  return true
  }
  return false
};

function codePointToString(ch) {
  if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
  ch -= 0x10000;
  return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
}

/**
 * Validate the flags part of a given RegExpLiteral.
 *
 * @param {RegExpValidationState} state The state to validate RegExp.
 * @returns {void}
 */
pp$8.validateRegExpFlags = function(state) {
  var validFlags = state.validFlags;
  var flags = state.flags;

  for (var i = 0; i < flags.length; i++) {
  var flag = flags.charAt(i);
  if (validFlags.indexOf(flag) === -1) {
    this.raise(state.start, "Invalid regular expression flag");
  }
  if (flags.indexOf(flag, i + 1) > -1) {
    this.raise(state.start, "Duplicate regular expression flag");
  }
  }
};

/**
 * Validate the pattern part of a given RegExpLiteral.
 *
 * @param {RegExpValidationState} state The state to validate RegExp.
 * @returns {void}
 */
pp$8.validateRegExpPattern = function(state) {
  this.regexp_pattern(state);

  // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
  // parsing contains a |GroupName|, reparse with the goal symbol
  // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
  // exception if _P_ did not conform to the grammar, if any elements of _P_
  // were not matched by the parse, or if any Early Error conditions exist.
  if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
  state.switchN = true;
  this.regexp_pattern(state);
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
pp$8.regexp_pattern = function(state) {
  state.pos = 0;
  state.lastIntValue = 0;
  state.lastStringValue = "";
  state.lastAssertionIsQuantifiable = false;
  state.numCapturingParens = 0;
  state.maxBackReference = 0;
  state.groupNames.length = 0;
  state.backReferenceNames.length = 0;

  this.regexp_disjunction(state);

  if (state.pos !== state.source.length) {
  // Make the same messages as V8.
  if (state.eat(0x29 /* ) */)) {
    state.raise("Unmatched ')'");
  }
  if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
    state.raise("Lone quantifier brackets");
  }
  }
  if (state.maxBackReference > state.numCapturingParens) {
  state.raise("Invalid escape");
  }
  for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
  var name = list[i];

  if (state.groupNames.indexOf(name) === -1) {
    state.raise("Invalid named capture referenced");
  }
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
pp$8.regexp_disjunction = function(state) {
  this.regexp_alternative(state);
  while (state.eat(0x7C /* | */)) {
  this.regexp_alternative(state);
  }

  // Make the same message as V8.
  if (this.regexp_eatQuantifier(state, true)) {
  state.raise("Nothing to repeat");
  }
  if (state.eat(0x7B /* { */)) {
  state.raise("Lone quantifier brackets");
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
pp$8.regexp_alternative = function(state) {
  while (state.pos < state.source.length && this.regexp_eatTerm(state))
  { }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
pp$8.regexp_eatTerm = function(state) {
  if (this.regexp_eatAssertion(state)) {
  // Handle `QuantifiableAssertion Quantifier` alternative.
  // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
  // is a QuantifiableAssertion.
  if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
    // Make the same message as V8.
    if (state.switchU) {
    state.raise("Invalid quantifier");
    }
  }
  return true
  }

  if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
  this.regexp_eatQuantifier(state);
  return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
pp$8.regexp_eatAssertion = function(state) {
  var start = state.pos;
  state.lastAssertionIsQuantifiable = false;

  // ^, $
  if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
  return true
  }

  // \b \B
  if (state.eat(0x5C /* \ */)) {
  if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
    return true
  }
  state.pos = start;
  }

  // Lookahead / Lookbehind
  if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
  var lookbehind = false;
  if (this.options.ecmaVersion >= 9) {
    lookbehind = state.eat(0x3C /* < */);
  }
  if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
    this.regexp_disjunction(state);
    if (!state.eat(0x29 /* ) */)) {
    state.raise("Unterminated group");
    }
    state.lastAssertionIsQuantifiable = !lookbehind;
    return true
  }
  }

  state.pos = start;
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
pp$8.regexp_eatQuantifier = function(state, noError) {
  if ( noError === void 0 ) noError = false;

  if (this.regexp_eatQuantifierPrefix(state, noError)) {
  state.eat(0x3F /* ? */);
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
pp$8.regexp_eatQuantifierPrefix = function(state, noError) {
  return (
  state.eat(0x2A /* * */) ||
  state.eat(0x2B /* + */) ||
  state.eat(0x3F /* ? */) ||
  this.regexp_eatBracedQuantifier(state, noError)
  )
};
pp$8.regexp_eatBracedQuantifier = function(state, noError) {
  var start = state.pos;
  if (state.eat(0x7B /* { */)) {
  var min = 0, max = -1;
  if (this.regexp_eatDecimalDigits(state)) {
    min = state.lastIntValue;
    if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
    max = state.lastIntValue;
    }
    if (state.eat(0x7D /* } */)) {
    // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
    if (max !== -1 && max < min && !noError) {
      state.raise("numbers out of order in {} quantifier");
    }
    return true
    }
  }
  if (state.switchU && !noError) {
    state.raise("Incomplete quantifier");
  }
  state.pos = start;
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
pp$8.regexp_eatAtom = function(state) {
  return (
  this.regexp_eatPatternCharacters(state) ||
  state.eat(0x2E /* . */) ||
  this.regexp_eatReverseSolidusAtomEscape(state) ||
  this.regexp_eatCharacterClass(state) ||
  this.regexp_eatUncapturingGroup(state) ||
  this.regexp_eatCapturingGroup(state)
  )
};
pp$8.regexp_eatReverseSolidusAtomEscape = function(state) {
  var start = state.pos;
  if (state.eat(0x5C /* \ */)) {
  if (this.regexp_eatAtomEscape(state)) {
    return true
  }
  state.pos = start;
  }
  return false
};
pp$8.regexp_eatUncapturingGroup = function(state) {
  var start = state.pos;
  if (state.eat(0x28 /* ( */)) {
  if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
    this.regexp_disjunction(state);
    if (state.eat(0x29 /* ) */)) {
    return true
    }
    state.raise("Unterminated group");
  }
  state.pos = start;
  }
  return false
};
pp$8.regexp_eatCapturingGroup = function(state) {
  if (state.eat(0x28 /* ( */)) {
  if (this.options.ecmaVersion >= 9) {
    this.regexp_groupSpecifier(state);
  } else if (state.current() === 0x3F /* ? */) {
    state.raise("Invalid group");
  }
  this.regexp_disjunction(state);
  if (state.eat(0x29 /* ) */)) {
    state.numCapturingParens += 1;
    return true
  }
  state.raise("Unterminated group");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
pp$8.regexp_eatExtendedAtom = function(state) {
  return (
  state.eat(0x2E /* . */) ||
  this.regexp_eatReverseSolidusAtomEscape(state) ||
  this.regexp_eatCharacterClass(state) ||
  this.regexp_eatUncapturingGroup(state) ||
  this.regexp_eatCapturingGroup(state) ||
  this.regexp_eatInvalidBracedQuantifier(state) ||
  this.regexp_eatExtendedPatternCharacter(state)
  )
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
pp$8.regexp_eatInvalidBracedQuantifier = function(state) {
  if (this.regexp_eatBracedQuantifier(state, true)) {
  state.raise("Nothing to repeat");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
pp$8.regexp_eatSyntaxCharacter = function(state) {
  var ch = state.current();
  if (isSyntaxCharacter(ch)) {
  state.lastIntValue = ch;
  state.advance();
  return true
  }
  return false
};
function isSyntaxCharacter(ch) {
  return (
  ch === 0x24 /* $ */ ||
  ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
  ch === 0x2E /* . */ ||
  ch === 0x3F /* ? */ ||
  ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
  ch >= 0x7B /* { */ && ch <= 0x7D /* } */
  )
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
// But eat eager.
pp$8.regexp_eatPatternCharacters = function(state) {
  var start = state.pos;
  var ch = 0;
  while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
  state.advance();
  }
  return state.pos !== start
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
pp$8.regexp_eatExtendedPatternCharacter = function(state) {
  var ch = state.current();
  if (
  ch !== -1 &&
  ch !== 0x24 /* $ */ &&
  !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
  ch !== 0x2E /* . */ &&
  ch !== 0x3F /* ? */ &&
  ch !== 0x5B /* [ */ &&
  ch !== 0x5E /* ^ */ &&
  ch !== 0x7C /* | */
  ) {
  state.advance();
  return true
  }
  return false
};

// GroupSpecifier ::
//   [empty]
//   `?` GroupName
pp$8.regexp_groupSpecifier = function(state) {
  if (state.eat(0x3F /* ? */)) {
  if (this.regexp_eatGroupName(state)) {
    if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
    state.raise("Duplicate capture group name");
    }
    state.groupNames.push(state.lastStringValue);
    return
  }
  state.raise("Invalid group");
  }
};

// GroupName ::
//   `<` RegExpIdentifierName `>`
// Note: this updates `state.lastStringValue` property with the eaten name.
pp$8.regexp_eatGroupName = function(state) {
  state.lastStringValue = "";
  if (state.eat(0x3C /* < */)) {
  if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
    return true
  }
  state.raise("Invalid capture group name");
  }
  return false
};

// RegExpIdentifierName ::
//   RegExpIdentifierStart
//   RegExpIdentifierName RegExpIdentifierPart
// Note: this updates `state.lastStringValue` property with the eaten name.
pp$8.regexp_eatRegExpIdentifierName = function(state) {
  state.lastStringValue = "";
  if (this.regexp_eatRegExpIdentifierStart(state)) {
  state.lastStringValue += codePointToString(state.lastIntValue);
  while (this.regexp_eatRegExpIdentifierPart(state)) {
    state.lastStringValue += codePointToString(state.lastIntValue);
  }
  return true
  }
  return false
};

// RegExpIdentifierStart ::
//   UnicodeIDStart
//   `$`
//   `_`
//   `\` RegExpUnicodeEscapeSequence[+U]
pp$8.regexp_eatRegExpIdentifierStart = function(state) {
  var start = state.pos;
  var forceU = this.options.ecmaVersion >= 11;
  var ch = state.current(forceU);
  state.advance(forceU);

  if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  ch = state.lastIntValue;
  }
  if (isRegExpIdentifierStart(ch)) {
  state.lastIntValue = ch;
  return true
  }

  state.pos = start;
  return false
};
function isRegExpIdentifierStart(ch) {
  return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
}

// RegExpIdentifierPart ::
//   UnicodeIDContinue
//   `$`
//   `_`
//   `\` RegExpUnicodeEscapeSequence[+U]
//   <ZWNJ>
//   <ZWJ>
pp$8.regexp_eatRegExpIdentifierPart = function(state) {
  var start = state.pos;
  var forceU = this.options.ecmaVersion >= 11;
  var ch = state.current(forceU);
  state.advance(forceU);

  if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  ch = state.lastIntValue;
  }
  if (isRegExpIdentifierPart(ch)) {
  state.lastIntValue = ch;
  return true
  }

  state.pos = start;
  return false
};
function isRegExpIdentifierPart(ch) {
  return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
pp$8.regexp_eatAtomEscape = function(state) {
  if (
  this.regexp_eatBackReference(state) ||
  this.regexp_eatCharacterClassEscape(state) ||
  this.regexp_eatCharacterEscape(state) ||
  (state.switchN && this.regexp_eatKGroupName(state))
  ) {
  return true
  }
  if (state.switchU) {
  // Make the same message as V8.
  if (state.current() === 0x63 /* c */) {
    state.raise("Invalid unicode escape");
  }
  state.raise("Invalid escape");
  }
  return false
};
pp$8.regexp_eatBackReference = function(state) {
  var start = state.pos;
  if (this.regexp_eatDecimalEscape(state)) {
  var n = state.lastIntValue;
  if (state.switchU) {
    // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
    if (n > state.maxBackReference) {
    state.maxBackReference = n;
    }
    return true
  }
  if (n <= state.numCapturingParens) {
    return true
  }
  state.pos = start;
  }
  return false
};
pp$8.regexp_eatKGroupName = function(state) {
  if (state.eat(0x6B /* k */)) {
  if (this.regexp_eatGroupName(state)) {
    state.backReferenceNames.push(state.lastStringValue);
    return true
  }
  state.raise("Invalid named reference");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
pp$8.regexp_eatCharacterEscape = function(state) {
  return (
  this.regexp_eatControlEscape(state) ||
  this.regexp_eatCControlLetter(state) ||
  this.regexp_eatZero(state) ||
  this.regexp_eatHexEscapeSequence(state) ||
  this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
  (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
  this.regexp_eatIdentityEscape(state)
  )
};
pp$8.regexp_eatCControlLetter = function(state) {
  var start = state.pos;
  if (state.eat(0x63 /* c */)) {
  if (this.regexp_eatControlLetter(state)) {
    return true
  }
  state.pos = start;
  }
  return false
};
pp$8.regexp_eatZero = function(state) {
  if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
  state.lastIntValue = 0;
  state.advance();
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
pp$8.regexp_eatControlEscape = function(state) {
  var ch = state.current();
  if (ch === 0x74 /* t */) {
  state.lastIntValue = 0x09; /* \t */
  state.advance();
  return true
  }
  if (ch === 0x6E /* n */) {
  state.lastIntValue = 0x0A; /* \n */
  state.advance();
  return true
  }
  if (ch === 0x76 /* v */) {
  state.lastIntValue = 0x0B; /* \v */
  state.advance();
  return true
  }
  if (ch === 0x66 /* f */) {
  state.lastIntValue = 0x0C; /* \f */
  state.advance();
  return true
  }
  if (ch === 0x72 /* r */) {
  state.lastIntValue = 0x0D; /* \r */
  state.advance();
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
pp$8.regexp_eatControlLetter = function(state) {
  var ch = state.current();
  if (isControlLetter(ch)) {
  state.lastIntValue = ch % 0x20;
  state.advance();
  return true
  }
  return false
};
function isControlLetter(ch) {
  return (
  (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
  (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
  )
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
  if ( forceU === void 0 ) forceU = false;

  var start = state.pos;
  var switchU = forceU || state.switchU;

  if (state.eat(0x75 /* u */)) {
  if (this.regexp_eatFixedHexDigits(state, 4)) {
    var lead = state.lastIntValue;
    if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
    var leadSurrogateEnd = state.pos;
    if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
      var trail = state.lastIntValue;
      if (trail >= 0xDC00 && trail <= 0xDFFF) {
      state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
      return true
      }
    }
    state.pos = leadSurrogateEnd;
    state.lastIntValue = lead;
    }
    return true
  }
  if (
    switchU &&
    state.eat(0x7B /* { */) &&
    this.regexp_eatHexDigits(state) &&
    state.eat(0x7D /* } */) &&
    isValidUnicode(state.lastIntValue)
  ) {
    return true
  }
  if (switchU) {
    state.raise("Invalid unicode escape");
  }
  state.pos = start;
  }

  return false
};
function isValidUnicode(ch) {
  return ch >= 0 && ch <= 0x10FFFF
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
pp$8.regexp_eatIdentityEscape = function(state) {
  if (state.switchU) {
  if (this.regexp_eatSyntaxCharacter(state)) {
    return true
  }
  if (state.eat(0x2F /* / */)) {
    state.lastIntValue = 0x2F; /* / */
    return true
  }
  return false
  }

  var ch = state.current();
  if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
  state.lastIntValue = ch;
  state.advance();
  return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
pp$8.regexp_eatDecimalEscape = function(state) {
  state.lastIntValue = 0;
  var ch = state.current();
  if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
  do {
    state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
    state.advance();
  } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
pp$8.regexp_eatCharacterClassEscape = function(state) {
  var ch = state.current();

  if (isCharacterClassEscape(ch)) {
  state.lastIntValue = -1;
  state.advance();
  return true
  }

  if (
  state.switchU &&
  this.options.ecmaVersion >= 9 &&
  (ch === 0x50 /* P */ || ch === 0x70 /* p */)
  ) {
  state.lastIntValue = -1;
  state.advance();
  if (
    state.eat(0x7B /* { */) &&
    this.regexp_eatUnicodePropertyValueExpression(state) &&
    state.eat(0x7D /* } */)
  ) {
    return true
  }
  state.raise("Invalid property name");
  }

  return false
};
function isCharacterClassEscape(ch) {
  return (
  ch === 0x64 /* d */ ||
  ch === 0x44 /* D */ ||
  ch === 0x73 /* s */ ||
  ch === 0x53 /* S */ ||
  ch === 0x77 /* w */ ||
  ch === 0x57 /* W */
  )
}

// UnicodePropertyValueExpression ::
//   UnicodePropertyName `=` UnicodePropertyValue
//   LoneUnicodePropertyNameOrValue
pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
  var start = state.pos;

  // UnicodePropertyName `=` UnicodePropertyValue
  if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
  var name = state.lastStringValue;
  if (this.regexp_eatUnicodePropertyValue(state)) {
    var value = state.lastStringValue;
    this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
    return true
  }
  }
  state.pos = start;

  // LoneUnicodePropertyNameOrValue
  if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
  var nameOrValue = state.lastStringValue;
  this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
  return true
  }
  return false
};
pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
  if (!has(state.unicodeProperties.nonBinary, name))
  { state.raise("Invalid property name"); }
  if (!state.unicodeProperties.nonBinary[name].test(value))
  { state.raise("Invalid property value"); }
};
pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
  if (!state.unicodeProperties.binary.test(nameOrValue))
  { state.raise("Invalid property name"); }
};

// UnicodePropertyName ::
//   UnicodePropertyNameCharacters
pp$8.regexp_eatUnicodePropertyName = function(state) {
  var ch = 0;
  state.lastStringValue = "";
  while (isUnicodePropertyNameCharacter(ch = state.current())) {
  state.lastStringValue += codePointToString(ch);
  state.advance();
  }
  return state.lastStringValue !== ""
};
function isUnicodePropertyNameCharacter(ch) {
  return isControlLetter(ch) || ch === 0x5F /* _ */
}

// UnicodePropertyValue ::
//   UnicodePropertyValueCharacters
pp$8.regexp_eatUnicodePropertyValue = function(state) {
  var ch = 0;
  state.lastStringValue = "";
  while (isUnicodePropertyValueCharacter(ch = state.current())) {
  state.lastStringValue += codePointToString(ch);
  state.advance();
  }
  return state.lastStringValue !== ""
};
function isUnicodePropertyValueCharacter(ch) {
  return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
}

// LoneUnicodePropertyNameOrValue ::
//   UnicodePropertyValueCharacters
pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
  return this.regexp_eatUnicodePropertyValue(state)
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
pp$8.regexp_eatCharacterClass = function(state) {
  if (state.eat(0x5B /* [ */)) {
  state.eat(0x5E /* ^ */);
  this.regexp_classRanges(state);
  if (state.eat(0x5D /* ] */)) {
    return true
  }
  // Unreachable since it threw "unterminated regular expression" error before.
  state.raise("Unterminated character class");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
pp$8.regexp_classRanges = function(state) {
  while (this.regexp_eatClassAtom(state)) {
  var left = state.lastIntValue;
  if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
    var right = state.lastIntValue;
    if (state.switchU && (left === -1 || right === -1)) {
    state.raise("Invalid character class");
    }
    if (left !== -1 && right !== -1 && left > right) {
    state.raise("Range out of order in character class");
    }
  }
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
pp$8.regexp_eatClassAtom = function(state) {
  var start = state.pos;

  if (state.eat(0x5C /* \ */)) {
  if (this.regexp_eatClassEscape(state)) {
    return true
  }
  if (state.switchU) {
    // Make the same message as V8.
    var ch$1 = state.current();
    if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
    state.raise("Invalid class escape");
    }
    state.raise("Invalid escape");
  }
  state.pos = start;
  }

  var ch = state.current();
  if (ch !== 0x5D /* ] */) {
  state.lastIntValue = ch;
  state.advance();
  return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
pp$8.regexp_eatClassEscape = function(state) {
  var start = state.pos;

  if (state.eat(0x62 /* b */)) {
  state.lastIntValue = 0x08; /* <BS> */
  return true
  }

  if (state.switchU && state.eat(0x2D /* - */)) {
  state.lastIntValue = 0x2D; /* - */
  return true
  }

  if (!state.switchU && state.eat(0x63 /* c */)) {
  if (this.regexp_eatClassControlLetter(state)) {
    return true
  }
  state.pos = start;
  }

  return (
  this.regexp_eatCharacterClassEscape(state) ||
  this.regexp_eatCharacterEscape(state)
  )
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
pp$8.regexp_eatClassControlLetter = function(state) {
  var ch = state.current();
  if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
  state.lastIntValue = ch % 0x20;
  state.advance();
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
pp$8.regexp_eatHexEscapeSequence = function(state) {
  var start = state.pos;
  if (state.eat(0x78 /* x */)) {
  if (this.regexp_eatFixedHexDigits(state, 2)) {
    return true
  }
  if (state.switchU) {
    state.raise("Invalid escape");
  }
  state.pos = start;
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
pp$8.regexp_eatDecimalDigits = function(state) {
  var start = state.pos;
  var ch = 0;
  state.lastIntValue = 0;
  while (isDecimalDigit(ch = state.current())) {
  state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
  state.advance();
  }
  return state.pos !== start
};
function isDecimalDigit(ch) {
  return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
pp$8.regexp_eatHexDigits = function(state) {
  var start = state.pos;
  var ch = 0;
  state.lastIntValue = 0;
  while (isHexDigit(ch = state.current())) {
  state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  state.advance();
  }
  return state.pos !== start
};
function isHexDigit(ch) {
  return (
  (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
  (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
  (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
  )
}
function hexToInt(ch) {
  if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
  return 10 + (ch - 0x41 /* A */)
  }
  if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
  return 10 + (ch - 0x61 /* a */)
  }
  return ch - 0x30 /* 0 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
// Allows only 0-377(octal) i.e. 0-255(decimal).
pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) {
  if (this.regexp_eatOctalDigit(state)) {
  var n1 = state.lastIntValue;
  if (this.regexp_eatOctalDigit(state)) {
    var n2 = state.lastIntValue;
    if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
    state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
    } else {
    state.lastIntValue = n1 * 8 + n2;
    }
  } else {
    state.lastIntValue = n1;
  }
  return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
pp$8.regexp_eatOctalDigit = function(state) {
  var ch = state.current();
  if (isOctalDigit(ch)) {
  state.lastIntValue = ch - 0x30; /* 0 */
  state.advance();
  return true
  }
  state.lastIntValue = 0;
  return false
};
function isOctalDigit(ch) {
  return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
pp$8.regexp_eatFixedHexDigits = function(state, length) {
  var start = state.pos;
  state.lastIntValue = 0;
  for (var i = 0; i < length; ++i) {
  var ch = state.current();
  if (!isHexDigit(ch)) {
    state.pos = start;
    return false
  }
  state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  state.advance();
  }
  return true
};

// Object type used to represent tokens. Note that normally, tokens
// simply exist as properties on the parser object. This is only
// used for the onToken callback and the external tokenizer.

var Token = function Token(p) {
  this.type = p.type;
  this.value = p.value;
  this.start = p.start;
  this.end = p.end;
  if (p.options.locations)
  { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
  if (p.options.ranges)
  { this.range = [p.start, p.end]; }
};

// ## Tokenizer

var pp$9 = Parser.prototype;

// Move to the next token

pp$9.next = function(ignoreEscapeSequenceInKeyword) {
  if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
  { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
  if (this.options.onToken)
  { this.options.onToken(new Token(this)); }

  this.lastTokEnd = this.end;
  this.lastTokStart = this.start;
  this.lastTokEndLoc = this.endLoc;
  this.lastTokStartLoc = this.startLoc;
  this.nextToken();
};

pp$9.getToken = function() {
  this.next();
  return new Token(this)
};

// If we're in an ES6 environment, make parsers iterable
if (typeof Symbol !== "undefined")
  { pp$9[Symbol.iterator] = function() {
  var this$1 = this;

  return {
    next: function () {
    var token = this$1.getToken();
    return {
      done: token.type === types.eof,
      value: token
    }
    }
  }
  }; }

// Toggle strict mode. Re-reads the next number or string to please
// pedantic tests (`"use strict"; 010;` should fail).

pp$9.curContext = function() {
  return this.context[this.context.length - 1]
};

// Read a single token, updating the parser object's token-related
// properties.

pp$9.nextToken = function() {
  var curContext = this.curContext();
  if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }

  this.start = this.pos;
  if (this.options.locations) { this.startLoc = this.curPosition(); }
  if (this.pos >= this.input.length) { return this.finishToken(types.eof) }

  if (curContext.override) { return curContext.override(this) }
  else { this.readToken(this.fullCharCodeAtPos()); }
};

pp$9.readToken = function(code) {
  // Identifier or keyword. '\uXXXX' sequences are allowed in
  // identifiers, so '\' also dispatches to that.
  if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
  { return this.readWord() }

  return this.getTokenFromCode(code)
};

pp$9.fullCharCodeAtPos = function() {
  var code = this.input.charCodeAt(this.pos);
  if (code <= 0xd7ff || code >= 0xe000) { return code }
  var next = this.input.charCodeAt(this.pos + 1);
  return (code << 10) + next - 0x35fdc00
};

pp$9.skipBlockComment = function() {
  var startLoc = this.options.onComment && this.curPosition();
  var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
  if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
  this.pos = end + 2;
  if (this.options.locations) {
  lineBreakG.lastIndex = start;
  var match;
  while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
    ++this.curLine;
    this.lineStart = match.index + match[0].length;
  }
  }
  if (this.options.onComment)
  { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
               startLoc, this.curPosition()); }
};

pp$9.skipLineComment = function(startSkip) {
  var start = this.pos;
  var startLoc = this.options.onComment && this.curPosition();
  var ch = this.input.charCodeAt(this.pos += startSkip);
  while (this.pos < this.input.length && !isNewLine(ch)) {
  ch = this.input.charCodeAt(++this.pos);
  }
  if (this.options.onComment)
  { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
               startLoc, this.curPosition()); }
};

// Called at the start of the parse and after every token. Skips
// whitespace and comments, and.

pp$9.skipSpace = function() {
  loop: while (this.pos < this.input.length) {
  var ch = this.input.charCodeAt(this.pos);
  switch (ch) {
  case 32: case 160: // ' '
    ++this.pos;
    break
  case 13:
    if (this.input.charCodeAt(this.pos + 1) === 10) {
    ++this.pos;
    }
  case 10: case 8232: case 8233:
    ++this.pos;
    if (this.options.locations) {
    ++this.curLine;
    this.lineStart = this.pos;
    }
    break
  case 47: // '/'
    switch (this.input.charCodeAt(this.pos + 1)) {
    case 42: // '*'
    this.skipBlockComment();
    break
    case 47:
    this.skipLineComment(2);
    break
    default:
    break loop
    }
    break
  default:
    if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
    ++this.pos;
    } else {
    break loop
    }
  }
  }
};

// Called at the end of every token. Sets `end`, `val`, and
// maintains `context` and `exprAllowed`, and skips the space after
// the token, so that the next one's `start` will point at the
// right position.

pp$9.finishToken = function(type, val) {
  this.end = this.pos;
  if (this.options.locations) { this.endLoc = this.curPosition(); }
  var prevType = this.type;
  this.type = type;
  this.value = val;

  this.updateContext(prevType);
};

// ### Token reading

// This is the function that is called to fetch the next token. It
// is somewhat obscure, because it works in character codes rather
// than characters, and because operator parsing has been inlined
// into it.
//
// All in the name of speed.
//
pp$9.readToken_dot = function() {
  var next = this.input.charCodeAt(this.pos + 1);
  if (next >= 48 && next <= 57) { return this.readNumber(true) }
  var next2 = this.input.charCodeAt(this.pos + 2);
  if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
  this.pos += 3;
  return this.finishToken(types.ellipsis)
  } else {
  ++this.pos;
  return this.finishToken(types.dot)
  }
};

pp$9.readToken_slash = function() { // '/'
  var next = this.input.charCodeAt(this.pos + 1);
  if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
  if (next === 61) { return this.finishOp(types.assign, 2) }
  return this.finishOp(types.slash, 1)
};

pp$9.readToken_mult_modulo_exp = function(code) { // '%*'
  var next = this.input.charCodeAt(this.pos + 1);
  var size = 1;
  var tokentype = code === 42 ? types.star : types.modulo;

  // exponentiation operator ** and **=
  if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
  ++size;
  tokentype = types.starstar;
  next = this.input.charCodeAt(this.pos + 2);
  }

  if (next === 61) { return this.finishOp(types.assign, size + 1) }
  return this.finishOp(tokentype, size)
};

pp$9.readToken_pipe_amp = function(code) { // '|&'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === code) {
  if (this.options.ecmaVersion >= 12) {
    var next2 = this.input.charCodeAt(this.pos + 2);
    if (next2 === 61) { return this.finishOp(types.assign, 3) }
  }
  return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2)
  }
  if (next === 61) { return this.finishOp(types.assign, 2) }
  return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1)
};

pp$9.readToken_caret = function() { // '^'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 61) { return this.finishOp(types.assign, 2) }
  return this.finishOp(types.bitwiseXOR, 1)
};

pp$9.readToken_plus_min = function(code) { // '+-'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === code) {
  if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
    (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
    // A `-->` line comment
    this.skipLineComment(3);
    this.skipSpace();
    return this.nextToken()
  }
  return this.finishOp(types.incDec, 2)
  }
  if (next === 61) { return this.finishOp(types.assign, 2) }
  return this.finishOp(types.plusMin, 1)
};

pp$9.readToken_lt_gt = function(code) { // '<>'
  var next = this.input.charCodeAt(this.pos + 1);
  var size = 1;
  if (next === code) {
  size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
  if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
  return this.finishOp(types.bitShift, size)
  }
  if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
    this.input.charCodeAt(this.pos + 3) === 45) {
  // `<!--`, an XML-style comment that should be interpreted as a line comment
  this.skipLineComment(4);
  this.skipSpace();
  return this.nextToken()
  }
  if (next === 61) { size = 2; }
  return this.finishOp(types.relational, size)
};

pp$9.readToken_eq_excl = function(code) { // '=!'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
  if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
  this.pos += 2;
  return this.finishToken(types.arrow)
  }
  return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
};

pp$9.readToken_question = function() { // '?'
  var ecmaVersion = this.options.ecmaVersion;
  if (ecmaVersion >= 11) {
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 46) {
    var next2 = this.input.charCodeAt(this.pos + 2);
    if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
  }
  if (next === 63) {
    if (ecmaVersion >= 12) {
    var next2$1 = this.input.charCodeAt(this.pos + 2);
    if (next2$1 === 61) { return this.finishOp(types.assign, 3) }
    }
    return this.finishOp(types.coalesce, 2)
  }
  }
  return this.finishOp(types.question, 1)
};

pp$9.getTokenFromCode = function(code) {
  switch (code) {
  // The interpretation of a dot depends on whether it is followed
  // by a digit or another two dots.
  case 46: // '.'
  return this.readToken_dot()

  // Punctuation tokens.
  case 40: ++this.pos; return this.finishToken(types.parenL)
  case 41: ++this.pos; return this.finishToken(types.parenR)
  case 59: ++this.pos; return this.finishToken(types.semi)
  case 44: ++this.pos; return this.finishToken(types.comma)
  case 91: ++this.pos; return this.finishToken(types.bracketL)
  case 93: ++this.pos; return this.finishToken(types.bracketR)
  case 123: ++this.pos; return this.finishToken(types.braceL)
  case 125: ++this.pos; return this.finishToken(types.braceR)
  case 58: ++this.pos; return this.finishToken(types.colon)

  case 96: // '`'
  if (this.options.ecmaVersion < 6) { break }
  ++this.pos;
  return this.finishToken(types.backQuote)

  case 48: // '0'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
  if (this.options.ecmaVersion >= 6) {
    if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
    if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
  }

  // Anything else beginning with a digit is an integer, octal
  // number, or float.
  case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
  return this.readNumber(false)

  // Quotes produce strings.
  case 34: case 39: // '"', "'"
  return this.readString(code)

  // Operators are parsed inline in tiny state machines. '=' (61) is
  // often referred to. `finishOp` simply skips the amount of
  // characters it is given as second argument, and returns a token
  // of the type given by its first argument.

  case 47: // '/'
  return this.readToken_slash()

  case 37: case 42: // '%*'
  return this.readToken_mult_modulo_exp(code)

  case 124: case 38: // '|&'
  return this.readToken_pipe_amp(code)

  case 94: // '^'
  return this.readToken_caret()

  case 43: case 45: // '+-'
  return this.readToken_plus_min(code)

  case 60: case 62: // '<>'
  return this.readToken_lt_gt(code)

  case 61: case 33: // '=!'
  return this.readToken_eq_excl(code)

  case 63: // '?'
  return this.readToken_question()

  case 126: // '~'
  return this.finishOp(types.prefix, 1)
  }

  this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
};

pp$9.finishOp = function(type, size) {
  var str = this.input.slice(this.pos, this.pos + size);
  this.pos += size;
  return this.finishToken(type, str)
};

pp$9.readRegexp = function() {
  var escaped, inClass, start = this.pos;
  for (;;) {
  if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
  var ch = this.input.charAt(this.pos);
  if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
  if (!escaped) {
    if (ch === "[") { inClass = true; }
    else if (ch === "]" && inClass) { inClass = false; }
    else if (ch === "/" && !inClass) { break }
    escaped = ch === "\\";
  } else { escaped = false; }
  ++this.pos;
  }
  var pattern = this.input.slice(start, this.pos);
  ++this.pos;
  var flagsStart = this.pos;
  var flags = this.readWord1();
  if (this.containsEsc) { this.unexpected(flagsStart); }

  // Validate pattern
  var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
  state.reset(start, pattern, flags);
  this.validateRegExpFlags(state);
  this.validateRegExpPattern(state);

  // Create Literal#value property value.
  var value = null;
  try {
  value = new RegExp(pattern, flags);
  } catch (e) {
  // ESTree requires null if it failed to instantiate RegExp object.
  // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
  }

  return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value})
};

// Read an integer in the given radix. Return null if zero digits
// were read, the integer value otherwise. When `len` is given, this
// will return `null` unless the integer has exactly `len` digits.

pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
  // `len` is used for character escape sequences. In that case, disallow separators.
  var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;

  // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
  // and isn't fraction part nor exponent part. In that case, if the first digit
  // is zero then disallow separators.
  var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;

  var start = this.pos, total = 0, lastCode = 0;
  for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
  var code = this.input.charCodeAt(this.pos), val = (void 0);

  if (allowSeparators && code === 95) {
    if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
    if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
    if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
    lastCode = code;
    continue
  }

  if (code >= 97) { val = code - 97 + 10; } // a
  else if (code >= 65) { val = code - 65 + 10; } // A
  else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
  else { val = Infinity; }
  if (val >= radix) { break }
  lastCode = code;
  total = total * radix + val;
  }

  if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
  if (this.pos === start || len != null && this.pos - start !== len) { return null }

  return total
};

function stringToNumber(str, isLegacyOctalNumericLiteral) {
  if (isLegacyOctalNumericLiteral) {
  return parseInt(str, 8)
  }

  // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
  return parseFloat(str.replace(/_/g, ""))
}

function stringToBigInt(str) {
  if (typeof BigInt !== "function") {
  return null
  }

  // `BigInt(value)` throws syntax error if the string contains numeric separators.
  return BigInt(str.replace(/_/g, ""))
}

pp$9.readRadixNumber = function(radix) {
  var start = this.pos;
  this.pos += 2; // 0x
  var val = this.readInt(radix);
  if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
  if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
  val = stringToBigInt(this.input.slice(start, this.pos));
  ++this.pos;
  } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  return this.finishToken(types.num, val)
};

// Read an integer, octal integer, or floating-point number.

pp$9.readNumber = function(startsWithDot) {
  var start = this.pos;
  if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
  var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
  if (octal && this.strict) { this.raise(start, "Invalid number"); }
  var next = this.input.charCodeAt(this.pos);
  if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
  var val$1 = stringToBigInt(this.input.slice(start, this.pos));
  ++this.pos;
  if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  return this.finishToken(types.num, val$1)
  }
  if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
  if (next === 46 && !octal) { // '.'
  ++this.pos;
  this.readInt(10);
  next = this.input.charCodeAt(this.pos);
  }
  if ((next === 69 || next === 101) && !octal) { // 'eE'
  next = this.input.charCodeAt(++this.pos);
  if (next === 43 || next === 45) { ++this.pos; } // '+-'
  if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
  }
  if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }

  var val = stringToNumber(this.input.slice(start, this.pos), octal);
  return this.finishToken(types.num, val)
};

// Read a string value, interpreting backslash-escapes.

pp$9.readCodePoint = function() {
  var ch = this.input.charCodeAt(this.pos), code;

  if (ch === 123) { // '{'
  if (this.options.ecmaVersion < 6) { this.unexpected(); }
  var codePos = ++this.pos;
  code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
  ++this.pos;
  if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
  } else {
  code = this.readHexChar(4);
  }
  return code
};

function codePointToString$1(code) {
  // UTF-16 Decoding
  if (code <= 0xFFFF) { return String.fromCharCode(code) }
  code -= 0x10000;
  return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
}

pp$9.readString = function(quote) {
  var out = "", chunkStart = ++this.pos;
  for (;;) {
  if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
  var ch = this.input.charCodeAt(this.pos);
  if (ch === quote) { break }
  if (ch === 92) { // '\'
    out += this.input.slice(chunkStart, this.pos);
    out += this.readEscapedChar(false);
    chunkStart = this.pos;
  } else {
    if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); }
    ++this.pos;
  }
  }
  out += this.input.slice(chunkStart, this.pos++);
  return this.finishToken(types.string, out)
};

// Reads template string tokens.

var INVALID_TEMPLATE_ESCAPE_ERROR = {};

pp$9.tryReadTemplateToken = function() {
  this.inTemplateElement = true;
  try {
  this.readTmplToken();
  } catch (err) {
  if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
    this.readInvalidTemplateToken();
  } else {
    throw err
  }
  }

  this.inTemplateElement = false;
};

pp$9.invalidStringToken = function(position, message) {
  if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
  throw INVALID_TEMPLATE_ESCAPE_ERROR
  } else {
  this.raise(position, message);
  }
};

pp$9.readTmplToken = function() {
  var out = "", chunkStart = this.pos;
  for (;;) {
  if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
  var ch = this.input.charCodeAt(this.pos);
  if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
    if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) {
    if (ch === 36) {
      this.pos += 2;
      return this.finishToken(types.dollarBraceL)
    } else {
      ++this.pos;
      return this.finishToken(types.backQuote)
    }
    }
    out += this.input.slice(chunkStart, this.pos);
    return this.finishToken(types.template, out)
  }
  if (ch === 92) { // '\'
    out += this.input.slice(chunkStart, this.pos);
    out += this.readEscapedChar(true);
    chunkStart = this.pos;
  } else if (isNewLine(ch)) {
    out += this.input.slice(chunkStart, this.pos);
    ++this.pos;
    switch (ch) {
    case 13:
    if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
    case 10:
    out += "\n";
    break
    default:
    out += String.fromCharCode(ch);
    break
    }
    if (this.options.locations) {
    ++this.curLine;
    this.lineStart = this.pos;
    }
    chunkStart = this.pos;
  } else {
    ++this.pos;
  }
  }
};

// Reads a template token to search for the end, without validating any escape sequences
pp$9.readInvalidTemplateToken = function() {
  for (; this.pos < this.input.length; this.pos++) {
  switch (this.input[this.pos]) {
  case "\\":
    ++this.pos;
    break

  case "$":
    if (this.input[this.pos + 1] !== "{") {
    break
    }
  // falls through

  case "`":
    return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos))

  // no default
  }
  }
  this.raise(this.start, "Unterminated template");
};

// Used to read escaped characters

pp$9.readEscapedChar = function(inTemplate) {
  var ch = this.input.charCodeAt(++this.pos);
  ++this.pos;
  switch (ch) {
  case 110: return "\n" // 'n' -> '\n'
  case 114: return "\r" // 'r' -> '\r'
  case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
  case 117: return codePointToString$1(this.readCodePoint()) // 'u'
  case 116: return "\t" // 't' -> '\t'
  case 98: return "\b" // 'b' -> '\b'
  case 118: return "\u000b" // 'v' -> '\u000b'
  case 102: return "\f" // 'f' -> '\f'
  case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
  case 10: // ' \n'
  if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
  return ""
  case 56:
  case 57:
  if (this.strict) {
    this.invalidStringToken(
    this.pos - 1,
    "Invalid escape sequence"
    );
  }
  if (inTemplate) {
    var codePos = this.pos - 1;

    this.invalidStringToken(
    codePos,
    "Invalid escape sequence in template string"
    );

    return null
  }
  default:
  if (ch >= 48 && ch <= 55) {
    var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
    var octal = parseInt(octalStr, 8);
    if (octal > 255) {
    octalStr = octalStr.slice(0, -1);
    octal = parseInt(octalStr, 8);
    }
    this.pos += octalStr.length - 1;
    ch = this.input.charCodeAt(this.pos);
    if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
    this.invalidStringToken(
      this.pos - 1 - octalStr.length,
      inTemplate
      ? "Octal literal in template string"
      : "Octal literal in strict mode"
    );
    }
    return String.fromCharCode(octal)
  }
  if (isNewLine(ch)) {
    // Unicode new line characters after \ get removed from output in both
    // template literals and strings
    return ""
  }
  return String.fromCharCode(ch)
  }
};

// Used to read character escape sequences ('\x', '\u', '\U').

pp$9.readHexChar = function(len) {
  var codePos = this.pos;
  var n = this.readInt(16, len);
  if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
  return n
};

// Read an identifier, and return it as a string. Sets `this.containsEsc`
// to whether the word contained a '\u' escape.
//
// Incrementally adds only escaped chars, adding other chunks as-is
// as a micro-optimization.

pp$9.readWord1 = function() {
  this.containsEsc = false;
  var word = "", first = true, chunkStart = this.pos;
  var astral = this.options.ecmaVersion >= 6;
  while (this.pos < this.input.length) {
  var ch = this.fullCharCodeAtPos();
  if (isIdentifierChar(ch, astral)) {
    this.pos += ch <= 0xffff ? 1 : 2;
  } else if (ch === 92) { // "\"
    this.containsEsc = true;
    word += this.input.slice(chunkStart, this.pos);
    var escStart = this.pos;
    if (this.input.charCodeAt(++this.pos) !== 117) // "u"
    { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
    ++this.pos;
    var esc = this.readCodePoint();
    if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
    { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
    word += codePointToString$1(esc);
    chunkStart = this.pos;
  } else {
    break
  }
  first = false;
  }
  return word + this.input.slice(chunkStart, this.pos)
};

// Read an identifier or keyword token. Will check for reserved
// words when necessary.

pp$9.readWord = function() {
  var word = this.readWord1();
  var type = types.name;
  if (this.keywords.test(word)) {
  type = keywords$1[word];
  }
  return this.finishToken(type, word)
};

// Acorn is a tiny, fast JavaScript parser written in JavaScript.

var version = "8.0.5";

Parser.acorn = {
  Parser: Parser,
  version: version,
  defaultOptions: defaultOptions,
  Position: Position,
  SourceLocation: SourceLocation,
  getLineInfo: getLineInfo,
  Node: Node,
  TokenType: TokenType,
  tokTypes: types,
  keywordTypes: keywords$1,
  TokContext: TokContext,
  tokContexts: types$1,
  isIdentifierChar: isIdentifierChar,
  isIdentifierStart: isIdentifierStart,
  Token: Token,
  isNewLine: isNewLine,
  lineBreak: lineBreak,
  lineBreakG: lineBreakG,
  nonASCIIwhitespace: nonASCIIwhitespace
};

// The main exported interface (under `self.acorn` when in the
// browser) is a `parse` function that takes a code string and
// returns an abstract syntax tree as specified by [Mozilla parser
// API][api].
//
// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API

function parse(input, options) {
  return Parser.parse(input, options)
}

// This function tries to parse a single expression at a given
// offset in a string. Useful for parsing mixed-language formats
// that embed JavaScript expressions.

function parseExpressionAt(input, pos, options) {
  return Parser.parseExpressionAt(input, pos, options)
}

// Acorn is organized as a tokenizer and a recursive-descent parser.
// The `tokenizer` export provides an interface to the tokenizer.

function tokenizer(input, options) {
  return Parser.tokenizer(input, options)
}

var acorn = {
  __proto__: null,
  Node: Node,
  Parser: Parser,
  Position: Position,
  SourceLocation: SourceLocation,
  TokContext: TokContext,
  Token: Token,
  TokenType: TokenType,
  defaultOptions: defaultOptions,
  getLineInfo: getLineInfo,
  isIdentifierChar: isIdentifierChar,
  isIdentifierStart: isIdentifierStart,
  isNewLine: isNewLine,
  keywordTypes: keywords$1,
  lineBreak: lineBreak,
  lineBreakG: lineBreakG,
  nonASCIIwhitespace: nonASCIIwhitespace,
  parse: parse,
  parseExpressionAt: parseExpressionAt,
  tokContexts: types$1,
  tokTypes: types,
  tokenizer: tokenizer,
  version: version
};

class GlobalScope extends Scope$1 {
  constructor() {
    super();
    this.variables.set('undefined', new UndefinedVariable());
  }
  findVariable(name) {
    let variable = this.variables.get(name);
    if (!variable) {
      variable = new GlobalVariable(name);
      this.variables.set(name, variable);
    }
    return variable;
  }
}

const readFile = (file) => new Promise((fulfil, reject) => readFile$2(file, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents))));
function mkdirpath(path) {
  const dir = dirname(path);
  try {
    readdirSync(dir);
  }
  catch (err) {
    mkdirpath(dir);
    try {
      mkdirSync(dir);
    }
    catch (err2) {
      if (err2.code !== 'EEXIST') {
        throw err2;
      }
    }
  }
}
function writeFile(dest, data) {
  return new Promise((fulfil, reject) => {
    mkdirpath(dest);
    writeFile$1(dest, data, err => {
      if (err) {
        reject(err);
      }
      else {
        fulfil();
      }
    });
  });
}

function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
  let skipped = null;
  let replaceContext = null;
  if (skip) {
    skipped = new Set();
    for (const skippedCall of skip) {
      if (source === skippedCall.source && importer === skippedCall.importer) {
        skipped.add(skippedCall.plugin);
      }
    }
    replaceContext = (pluginContext, plugin) => ({
      ...pluginContext,
      resolve: (source, importer, { custom, skipSelf } = BLANK) => {
        return moduleLoaderResolveId(source, importer, custom, skipSelf ? [...skip, { importer, plugin, source }] : skip);
      }
    });
  }
  return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions }], replaceContext, skipped);
}

async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
  const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions);
  if (pluginResult != null)
    return pluginResult;
  // external modules (non-entry modules that start with neither '.' or '/')
  // are skipped at this stage.
  if (importer !== undefined && !isAbsolute(source) && source[0] !== '.')
    return null;
  // `resolve` processes paths from right to left, prepending them until an
  // absolute path is created. Absolute importees therefore shortcircuit the
  // resolve call and require no special handing on our part.
  // See https://nodejs.org/api/path.html#path_path_resolve_paths
  return addJsExtensionIfNecessary(importer ? resolve$3(dirname(importer), source) : resolve$3(source), preserveSymlinks);
}
function addJsExtensionIfNecessary(file, preserveSymlinks) {
  let found = findFile(file, preserveSymlinks);
  if (found)
    return found;
  found = findFile(file + '.mjs', preserveSymlinks);
  if (found)
    return found;
  found = findFile(file + '.js', preserveSymlinks);
  return found;
}
function findFile(file, preserveSymlinks) {
  try {
    const stats = lstatSync(file);
    if (!preserveSymlinks && stats.isSymbolicLink())
      return findFile(realpathSync$2(file), preserveSymlinks);
    if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) {
      // check case
      const name = basename(file);
      const files = readdirSync(dirname(file));
      if (files.indexOf(name) !== -1)
        return file;
    }
  }
  catch (_a) {
    // suppress
  }
}

const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
function throwPluginError(err, plugin, { hook, id } = {}) {
  if (typeof err === 'string')
    err = { message: err };
  if (err.code && err.code !== Errors.PLUGIN_ERROR) {
    err.pluginCode = err.code;
  }
  err.code = Errors.PLUGIN_ERROR;
  err.plugin = plugin;
  if (hook) {
    err.hook = hook;
  }
  if (id) {
    err.id = id;
  }
  return error(err);
}
const deprecatedHooks = [
  { active: true, deprecated: 'resolveAssetUrl', replacement: 'resolveFileUrl' }
];
function warnDeprecatedHooks(plugins, options) {
  for (const { active, deprecated, replacement } of deprecatedHooks) {
    for (const plugin of plugins) {
      if (deprecated in plugin) {
        warnDeprecation({
          message: `The "${deprecated}" hook used by plugin ${plugin.name} is deprecated. The "${replacement}" hook should be used instead.`,
          plugin: plugin.name
        }, active, options);
      }
    }
  }
}

function createPluginCache(cache) {
  return {
    has(id) {
      const item = cache[id];
      if (!item)
        return false;
      item[0] = 0;
      return true;
    },
    get(id) {
      const item = cache[id];
      if (!item)
        return undefined;
      item[0] = 0;
      return item[1];
    },
    set(id, value) {
      cache[id] = [0, value];
    },
    delete(id) {
      return delete cache[id];
    }
  };
}
function getTrackedPluginCache(pluginCache, onUse) {
  return {
    has(id) {
      onUse();
      return pluginCache.has(id);
    },
    get(id) {
      onUse();
      return pluginCache.get(id);
    },
    set(id, value) {
      onUse();
      return pluginCache.set(id, value);
    },
    delete(id) {
      onUse();
      return pluginCache.delete(id);
    }
  };
}
const NO_CACHE = {
  has() {
    return false;
  },
  get() {
    return undefined;
  },
  set() { },
  delete() {
    return false;
  }
};
function uncacheablePluginError(pluginName) {
  if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
    pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
    return error({
      code: 'ANONYMOUS_PLUGIN_CACHE',
      message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
    });
  }
  return error({
    code: 'DUPLICATE_PLUGIN_NAME',
    message: `The plugin name ${pluginName} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
  });
}
function getCacheForUncacheablePlugin(pluginName) {
  return {
    has() {
      return uncacheablePluginError(pluginName);
    },
    get() {
      return uncacheablePluginError(pluginName);
    },
    set() {
      return uncacheablePluginError(pluginName);
    },
    delete() {
      return uncacheablePluginError(pluginName);
    }
  };
}

function transform(source, module, pluginDriver, warn) {
  const id = module.id;
  const sourcemapChain = [];
  let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
  const originalCode = source.code;
  let ast = source.ast;
  const transformDependencies = [];
  const emittedFiles = [];
  let customTransformCache = false;
  const useCustomTransformCache = () => (customTransformCache = true);
  let curPlugin;
  const curSource = source.code;
  function transformReducer(previousCode, result, plugin) {
    let code;
    let map;
    if (typeof result === 'string') {
      code = result;
    }
    else if (result && typeof result === 'object') {
      module.updateOptions(result);
      if (result.code == null) {
        if (result.map || result.ast) {
          warn(errNoTransformMapOrAstWithoutCode(plugin.name));
        }
        return previousCode;
      }
      ({ code, map, ast } = result);
    }
    else {
      return previousCode;
    }
    // strict null check allows 'null' maps to not be pushed to the chain,
    // while 'undefined' gets the missing map warning
    if (map !== null) {
      sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || {
        missing: true,
        plugin: plugin.name
      });
    }
    return code;
  }
  return pluginDriver
    .hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
    curPlugin = plugin;
    return {
      ...pluginContext,
      cache: customTransformCache
        ? pluginContext.cache
        : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
      warn(warning, pos) {
        if (typeof warning === 'string')
          warning = { message: warning };
        if (pos)
          augmentCodeLocation(warning, pos, curSource, id);
        warning.id = id;
        warning.hook = 'transform';
        pluginContext.warn(warning);
      },
      error(err, pos) {
        if (typeof err === 'string')
          err = { message: err };
        if (pos)
          augmentCodeLocation(err, pos, curSource, id);
        err.id = id;
        err.hook = 'transform';
        return pluginContext.error(err);
      },
      emitAsset(name, source) {
        emittedFiles.push({ type: 'asset', name, source });
        return pluginContext.emitAsset(name, source);
      },
      emitChunk(id, options) {
        emittedFiles.push({ type: 'chunk', id, name: options && options.name });
        return pluginContext.emitChunk(id, options);
      },
      emitFile(emittedFile) {
        emittedFiles.push(emittedFile);
        return pluginDriver.emitFile(emittedFile);
      },
      addWatchFile(id) {
        transformDependencies.push(id);
        pluginContext.addWatchFile(id);
      },
      setAssetSource() {
        return this.error({
          code: 'INVALID_SETASSETSOURCE',
          message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
        });
      },
      getCombinedSourcemap() {
        const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
        if (!combinedMap) {
          const magicString = new MagicString(originalCode);
          return magicString.generateMap({ includeContent: true, hires: true, source: id });
        }
        if (originalSourcemap !== combinedMap) {
          originalSourcemap = combinedMap;
          sourcemapChain.length = 0;
        }
        return new SourceMap({
          ...combinedMap,
          file: null,
          sourcesContent: combinedMap.sourcesContent
        });
      }
    };
  })
    .catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
    .then(code => {
    if (!customTransformCache) {
      // files emitted by a transform hook need to be emitted again if the hook is skipped
      if (emittedFiles.length)
        module.transformFiles = emittedFiles;
    }
    return {
      ast,
      code,
      customTransformCache,
      meta: module.info.meta,
      originalCode,
      originalSourcemap,
      sourcemapChain,
      transformDependencies
    };
  });
}

class ModuleLoader {
  constructor(graph, modulesById, options, pluginDriver) {
    this.graph = graph;
    this.modulesById = modulesById;
    this.options = options;
    this.pluginDriver = pluginDriver;
    this.implicitEntryModules = new Set();
    this.indexedEntryModules = [];
    this.latestLoadModulesPromise = Promise.resolve();
    this.nextEntryModuleIndex = 0;
    this.resolveId = async (source, importer, customOptions, skip = null) => {
      return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
        ? false
        : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions), importer, source));
    };
    this.hasModuleSideEffects = options.treeshake
      ? options.treeshake.moduleSideEffects
      : () => true;
  }
  async addAdditionalModules(unresolvedModules) {
    const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
    await this.awaitLoadModulesPromise();
    return result;
  }
  async addEntryModules(unresolvedEntryModules, isUserDefined) {
    const firstEntryModuleIndex = this.nextEntryModuleIndex;
    this.nextEntryModuleIndex += unresolvedEntryModules.length;
    const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => {
      let moduleIndex = firstEntryModuleIndex;
      for (let index = 0; index < entryModules.length; index++) {
        const entryModule = entryModules[index];
        entryModule.isUserDefinedEntryPoint =
          entryModule.isUserDefinedEntryPoint || isUserDefined;
        addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined);
        const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule);
        if (!existingIndexedModule) {
          this.indexedEntryModules.push({ module: entryModule, index: moduleIndex });
        }
        else {
          existingIndexedModule.index = Math.min(existingIndexedModule.index, moduleIndex);
        }
        moduleIndex++;
      }
      this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1);
      return entryModules;
    }));
    await this.awaitLoadModulesPromise();
    return {
      entryModules: this.indexedEntryModules.map(({ module }) => module),
      implicitEntryModules: [...this.implicitEntryModules],
      newEntryModules
    };
  }
  async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) {
    const unresolvedModule = {
      fileName: fileName || null,
      id,
      importer,
      name: name || null
    };
    const module = implicitlyLoadedAfterOneOf
      ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf)
      : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0];
    if (preserveSignature != null) {
      module.preserveSignature = preserveSignature;
    }
    return module;
  }
  addDefaultsToResolvedId(resolvedId) {
    var _a, _b;
    if (!resolvedId) {
      return null;
    }
    const external = resolvedId.external || false;
    return {
      external,
      id: resolvedId.id,
      meta: resolvedId.meta || EMPTY_OBJECT,
      moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, external),
      syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
    };
  }
  addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
    return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
      addChunkNamesToModule(entryModule, unresolvedModule, false);
      if (!entryModule.info.isEntry) {
        this.implicitEntryModules.add(entryModule);
        const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id)));
        for (const module of implicitlyLoadedAfterModules) {
          entryModule.implicitlyLoadedAfter.add(module);
        }
        for (const dependant of entryModule.implicitlyLoadedAfter) {
          dependant.implicitlyLoadedBefore.add(entryModule);
        }
      }
      return entryModule;
    }));
  }
  async addModuleSource(id, importer, module) {
    var _a;
    timeStart('load modules', 3);
    let source;
    try {
      source = (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await readFile(id));
    }
    catch (err) {
      timeEnd('load modules', 3);
      let msg = `Could not load ${id}`;
      if (importer)
        msg += ` (imported by ${relativeId(importer)})`;
      msg += `: ${err.message}`;
      err.message = msg;
      throw err;
    }
    timeEnd('load modules', 3);
    const sourceDescription = typeof source === 'string'
      ? { code: source }
      : typeof source === 'object' && typeof source.code === 'string'
        ? source
        : error(errBadLoader(id));
    const cachedModule = this.graph.cachedModules.get(id);
    if (cachedModule &&
      !cachedModule.customTransformCache &&
      cachedModule.originalCode === sourceDescription.code) {
      if (cachedModule.transformFiles) {
        for (const emittedFile of cachedModule.transformFiles)
          this.pluginDriver.emitFile(emittedFile);
      }
      module.setSource(cachedModule);
    }
    else {
      module.updateOptions(sourceDescription);
      module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onwarn));
    }
  }
  async awaitLoadModulesPromise() {
    let startingPromise;
    do {
      startingPromise = this.latestLoadModulesPromise;
      await startingPromise;
    } while (startingPromise !== this.latestLoadModulesPromise);
  }
  extendLoadModulesPromise(loadNewModulesPromise) {
    this.latestLoadModulesPromise = Promise.all([
      loadNewModulesPromise,
      this.latestLoadModulesPromise
    ]);
    this.latestLoadModulesPromise.catch(() => {
      /* Avoid unhandled Promise rejections */
    });
    return loadNewModulesPromise;
  }
  async fetchDynamicDependencies(module) {
    const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => {
      const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
        ? dynamicImport.argument
        : dynamicImport.argument.esTreeNode, module.id);
      if (resolvedId === null)
        return null;
      if (typeof resolvedId === 'string') {
        dynamicImport.resolution = resolvedId;
        return null;
      }
      return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId));
    }));
    for (const dependency of dependencies) {
      if (dependency) {
        module.dynamicDependencies.add(dependency);
        dependency.dynamicImporters.push(module.id);
      }
    }
  }
  async fetchModule({ id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry) {
    const existingModule = this.modulesById.get(id);
    if (existingModule instanceof Module) {
      if (isEntry) {
        existingModule.info.isEntry = true;
        this.implicitEntryModules.delete(existingModule);
        for (const dependant of existingModule.implicitlyLoadedAfter) {
          dependant.implicitlyLoadedBefore.delete(existingModule);
        }
        existingModule.implicitlyLoadedAfter.clear();
      }
      return existingModule;
    }
    const module = new Module(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta);
    this.modulesById.set(id, module);
    this.graph.watchFiles[id] = true;
    await this.addModuleSource(id, importer, module);
    await this.pluginDriver.hookParallel('moduleParsed', [module.info]);
    await Promise.all([
      this.fetchStaticDependencies(module),
      this.fetchDynamicDependencies(module)
    ]);
    module.linkImports();
    return module;
  }
  fetchResolvedDependency(source, importer, resolvedId) {
    if (resolvedId.external) {
      if (!this.modulesById.has(resolvedId.id)) {
        this.modulesById.set(resolvedId.id, new ExternalModule(this.options, resolvedId.id, resolvedId.moduleSideEffects, resolvedId.meta));
      }
      const externalModule = this.modulesById.get(resolvedId.id);
      if (!(externalModule instanceof ExternalModule)) {
        return error(errInternalIdCannotBeExternal(source, importer));
      }
      return Promise.resolve(externalModule);
    }
    else {
      return this.fetchModule(resolvedId, importer, false);
    }
  }
  async fetchStaticDependencies(module) {
    for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] =
      module.resolvedIds[source] ||
        this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id)))))) {
      module.dependencies.add(dependency);
      dependency.importers.push(module.id);
    }
  }
  getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) {
    if (resolveIdResult) {
      if (typeof resolveIdResult === 'object') {
        return {
          ...resolveIdResult,
          external: resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true)
        };
      }
      const external = this.options.external(resolveIdResult, importer, true);
      return {
        external,
        id: external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult
      };
    }
    const id = normalizeRelativeExternalId(source, importer);
    if (resolveIdResult !== false && !this.options.external(id, importer, true)) {
      return null;
    }
    return {
      external: true,
      id
    };
  }
  handleResolveId(resolvedId, source, importer) {
    if (resolvedId === null) {
      if (isRelative(source)) {
        return error(errUnresolvedImport(source, importer));
      }
      this.options.onwarn(errUnresolvedImportTreatedAsExternal(source, importer));
      return {
        external: true,
        id: source,
        meta: EMPTY_OBJECT,
        moduleSideEffects: this.hasModuleSideEffects(source, true),
        syntheticNamedExports: false
      };
    }
    else {
      if (resolvedId.external && resolvedId.syntheticNamedExports) {
        this.options.onwarn(errExternalSyntheticExports(source, importer));
      }
    }
    return resolvedId;
  }
  async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore) {
    const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT);
    if (resolveIdResult == null) {
      return error(implicitlyLoadedBefore === null
        ? errUnresolvedEntry(unresolvedId)
        : errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore));
    }
    if (resolveIdResult === false ||
      (typeof resolveIdResult === 'object' && resolveIdResult.external)) {
      return error(implicitlyLoadedBefore === null
        ? errEntryCannotBeExternal(unresolvedId)
        : errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
    }
    return this.fetchModule(this.addDefaultsToResolvedId(typeof resolveIdResult === 'object' ? resolveIdResult : { id: resolveIdResult }), undefined, isEntry);
  }
  async resolveDynamicImport(module, specifier, importer) {
    const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [
      specifier,
      importer
    ]);
    if (typeof specifier !== 'string') {
      if (typeof resolution === 'string') {
        return resolution;
      }
      if (!resolution) {
        return null;
      }
      return {
        external: false,
        moduleSideEffects: true,
        ...resolution
      };
    }
    if (resolution == null) {
      return (module.resolvedIds[specifier] =
        module.resolvedIds[specifier] ||
          this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT), specifier, module.id));
    }
    return this.handleResolveId(this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
  }
}
function normalizeRelativeExternalId(source, importer) {
  return isRelative(source)
    ? importer
      ? resolve$3(importer, '..', source)
      : resolve$3(source)
    : source;
}
function addChunkNamesToModule(module, { fileName, name }, isUserDefined) {
  if (fileName !== null) {
    module.chunkFileNames.add(fileName);
  }
  else if (name !== null) {
    if (module.chunkName === null) {
      module.chunkName = name;
    }
    if (isUserDefined) {
      module.userChunkNames.add(name);
    }
  }
}

function getDeprecatedContextHandler(handler, handlerName, newHandlerName, pluginName, activeDeprecation, options) {
  let deprecationWarningShown = false;
  return ((...args) => {
    if (!deprecationWarningShown) {
      deprecationWarningShown = true;
      warnDeprecation({
        message: `The "this.${handlerName}" plugin context function used by plugin ${pluginName} is deprecated. The "this.${newHandlerName}" plugin context function should be used instead.`,
        plugin: pluginName
      }, activeDeprecation, options);
    }
    return handler(...args);
  });
}
function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) {
  let cacheable = true;
  if (typeof plugin.cacheKey !== 'string') {
    if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
      plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) ||
      existingPluginNames.has(plugin.name)) {
      cacheable = false;
    }
    else {
      existingPluginNames.add(plugin.name);
    }
  }
  let cacheInstance;
  if (!pluginCache) {
    cacheInstance = NO_CACHE;
  }
  else if (cacheable) {
    const cacheKey = plugin.cacheKey || plugin.name;
    cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null)));
  }
  else {
    cacheInstance = getCacheForUncacheablePlugin(plugin.name);
  }
  const context = {
    addWatchFile(id) {
      if (graph.phase >= BuildPhase.GENERATE) {
        return this.error(errInvalidRollupPhaseForAddWatchFile());
      }
      graph.watchFiles[id] = true;
    },
    cache: cacheInstance,
    emitAsset: getDeprecatedContextHandler((name, source) => fileEmitter.emitFile({ type: 'asset', name, source }), 'emitAsset', 'emitFile', plugin.name, true, options),
    emitChunk: getDeprecatedContextHandler((id, options) => fileEmitter.emitFile({ type: 'chunk', id, name: options && options.name }), 'emitChunk', 'emitFile', plugin.name, true, options),
    emitFile: fileEmitter.emitFile,
    error(err) {
      return throwPluginError(err, plugin.name);
    },
    getAssetFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getAssetFileName', 'getFileName', plugin.name, true, options),
    getChunkFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getChunkFileName', 'getFileName', plugin.name, true, options),
    getFileName: fileEmitter.getFileName,
    getModuleIds: () => graph.modulesById.keys(),
    getModuleInfo: graph.getModuleInfo,
    getWatchFiles: () => Object.keys(graph.watchFiles),
    isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options),
    meta: {
      rollupVersion: version$1,
      watchMode: graph.watchMode
    },
    get moduleIds() {
      function* wrappedModuleIds() {
        warnDeprecation({
          message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,
          plugin: plugin.name
        }, false, options);
        yield* moduleIds;
      }
      const moduleIds = graph.modulesById.keys();
      return wrappedModuleIds();
    },
    parse: graph.contextParse.bind(graph),
    resolve(source, importer, { custom, skipSelf } = BLANK) {
      return graph.moduleLoader.resolveId(source, importer, custom, skipSelf ? [{ importer, plugin, source }] : null);
    },
    resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader
      .resolveId(source, importer, BLANK)
      .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options),
    setAssetSource: fileEmitter.setAssetSource,
    warn(warning) {
      if (typeof warning === 'string')
        warning = { message: warning };
      if (warning.code)
        warning.pluginCode = warning.code;
      warning.code = 'PLUGIN_WARNING';
      warning.plugin = plugin.name;
      options.onwarn(warning);
    }
  };
  return context;
}

const inputHookNames = {
  buildEnd: 1,
  buildStart: 1,
  closeBundle: 1,
  closeWatcher: 1,
  load: 1,
  moduleParsed: 1,
  options: 1,
  resolveDynamicImport: 1,
  resolveId: 1,
  transform: 1,
  watchChange: 1
};
const inputHooks = Object.keys(inputHookNames);
function throwInvalidHookError(hookName, pluginName) {
  return error({
    code: 'INVALID_PLUGIN_HOOK',
    message: `Error running plugin hook ${hookName} for ${pluginName}, expected a function hook.`
  });
}
class PluginDriver {
  constructor(graph, options, userPlugins, pluginCache, basePluginDriver) {
    this.graph = graph;
    this.options = options;
    this.pluginContexts = new Map();
    warnDeprecatedHooks(userPlugins, options);
    this.pluginCache = pluginCache;
    this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter);
    this.emitFile = this.fileEmitter.emitFile;
    this.getFileName = this.fileEmitter.getFileName;
    this.finaliseAssets = this.fileEmitter.assertAssetsFinalized;
    this.setOutputBundle = this.fileEmitter.setOutputBundle;
    this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);
    const existingPluginNames = new Set();
    for (const plugin of this.plugins) {
      this.pluginContexts.set(plugin, getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames));
    }
    if (basePluginDriver) {
      for (const plugin of userPlugins) {
        for (const hook of inputHooks) {
          if (hook in plugin) {
            options.onwarn(errInputHookInOutputPlugin(plugin.name, hook));
          }
        }
      }
    }
  }
  createOutputPluginDriver(plugins) {
    return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this);
  }
  // chains, first non-null result stops and returns
  hookFirst(hookName, args, replaceContext, skipped) {
    let promise = Promise.resolve(undefined);
    for (const plugin of this.plugins) {
      if (skipped && skipped.has(plugin))
        continue;
      promise = promise.then(result => {
        if (result != null)
          return result;
        return this.runHook(hookName, args, plugin, false, replaceContext);
      });
    }
    return promise;
  }
  // chains synchronously, first non-null result stops and returns
  hookFirstSync(hookName, args, replaceContext) {
    for (const plugin of this.plugins) {
      const result = this.runHookSync(hookName, args, plugin, replaceContext);
      if (result != null)
        return result;
    }
    return null;
  }
  // parallel, ignores returns
  hookParallel(hookName, args, replaceContext) {
    const promises = [];
    for (const plugin of this.plugins) {
      const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
      if (!hookPromise)
        continue;
      promises.push(hookPromise);
    }
    return Promise.all(promises).then(() => { });
  }
  // chains, reduces returned value, handling the reduced value as the first hook argument
  hookReduceArg0(hookName, [arg0, ...rest], reduce, replaceContext) {
    let promise = Promise.resolve(arg0);
    for (const plugin of this.plugins) {
      promise = promise.then(arg0 => {
        const args = [arg0, ...rest];
        const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
        if (!hookPromise)
          return arg0;
        return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin));
      });
    }
    return promise;
  }
  // chains synchronously, reduces returned value, handling the reduced value as the first hook argument
  hookReduceArg0Sync(hookName, [arg0, ...rest], reduce, replaceContext) {
    for (const plugin of this.plugins) {
      const args = [arg0, ...rest];
      const result = this.runHookSync(hookName, args, plugin, replaceContext);
      arg0 = reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin);
    }
    return arg0;
  }
  // chains, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
  hookReduceValue(hookName, initialValue, args, reduce, replaceContext) {
    let promise = Promise.resolve(initialValue);
    for (const plugin of this.plugins) {
      promise = promise.then(value => {
        const hookPromise = this.runHook(hookName, args, plugin, true, replaceContext);
        if (!hookPromise)
          return value;
        return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), value, result, plugin));
      });
    }
    return promise;
  }
  // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
  hookReduceValueSync(hookName, initialValue, args, reduce, replaceContext) {
    let acc = initialValue;
    for (const plugin of this.plugins) {
      const result = this.runHookSync(hookName, args, plugin, replaceContext);
      acc = reduce.call(this.pluginContexts.get(plugin), acc, result, plugin);
    }
    return acc;
  }
  // chains, ignores returns
  hookSeq(hookName, args, replaceContext) {
    let promise = Promise.resolve();
    for (const plugin of this.plugins) {
      promise = promise.then(() => this.runHook(hookName, args, plugin, false, replaceContext));
    }
    return promise;
  }
  // chains synchronously, ignores returns
  hookSeqSync(hookName, args, replaceContext) {
    for (const plugin of this.plugins) {
      this.runHookSync(hookName, args, plugin, replaceContext);
    }
  }
  runHook(hookName, args, plugin, permitValues, hookContext) {
    const hook = plugin[hookName];
    if (!hook)
      return undefined;
    let context = this.pluginContexts.get(plugin);
    if (hookContext) {
      context = hookContext(context, plugin);
    }
    return Promise.resolve()
      .then(() => {
      // permit values allows values to be returned instead of a functional hook
      if (typeof hook !== 'function') {
        if (permitValues)
          return hook;
        return throwInvalidHookError(hookName, plugin.name);
      }
      return hook.apply(context, args);
    })
      .catch(err => throwPluginError(err, plugin.name, { hook: hookName }));
  }
  /**
   * Run a sync plugin hook and return the result.
   * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
   * @param args Arguments passed to the plugin hook.
   * @param plugin The acutal plugin
   * @param hookContext When passed, the plugin context can be overridden.
   */
  runHookSync(hookName, args, plugin, hookContext) {
    const hook = plugin[hookName];
    if (!hook)
      return undefined;
    let context = this.pluginContexts.get(plugin);
    if (hookContext) {
      context = hookContext(context, plugin);
    }
    try {
      // permit values allows values to be returned instead of a functional hook
      if (typeof hook !== 'function') {
        return throwInvalidHookError(hookName, plugin.name);
      }
      return hook.apply(context, args);
    }
    catch (err) {
      return throwPluginError(err, plugin.name, { hook: hookName });
    }
  }
}

// AST walker module for Mozilla Parser API compatible trees

function skipThrough(node, st, c) { c(node, st); }
function ignore(_node, _st, _c) {}

// Node walkers.

var base = {};

base.Program = base.BlockStatement = function (node, st, c) {
  for (var i = 0, list = node.body; i < list.length; i += 1)
  {
  var stmt = list[i];

  c(stmt, st, "Statement");
  }
};
base.Statement = skipThrough;
base.EmptyStatement = ignore;
base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =
  function (node, st, c) { return c(node.expression, st, "Expression"); };
base.IfStatement = function (node, st, c) {
  c(node.test, st, "Expression");
  c(node.consequent, st, "Statement");
  if (node.alternate) { c(node.alternate, st, "Statement"); }
};
base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
base.BreakStatement = base.ContinueStatement = ignore;
base.WithStatement = function (node, st, c) {
  c(node.object, st, "Expression");
  c(node.body, st, "Statement");
};
base.SwitchStatement = function (node, st, c) {
  c(node.discriminant, st, "Expression");
  for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
  var cs = list$1[i$1];

  if (cs.test) { c(cs.test, st, "Expression"); }
  for (var i = 0, list = cs.consequent; i < list.length; i += 1)
    {
    var cons = list[i];

    c(cons, st, "Statement");
  }
  }
};
base.SwitchCase = function (node, st, c) {
  if (node.test) { c(node.test, st, "Expression"); }
  for (var i = 0, list = node.consequent; i < list.length; i += 1)
  {
  var cons = list[i];

  c(cons, st, "Statement");
  }
};
base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
  if (node.argument) { c(node.argument, st, "Expression"); }
};
base.ThrowStatement = base.SpreadElement =
  function (node, st, c) { return c(node.argument, st, "Expression"); };
base.TryStatement = function (node, st, c) {
  c(node.block, st, "Statement");
  if (node.handler) { c(node.handler, st); }
  if (node.finalizer) { c(node.finalizer, st, "Statement"); }
};
base.CatchClause = function (node, st, c) {
  if (node.param) { c(node.param, st, "Pattern"); }
  c(node.body, st, "Statement");
};
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
  c(node.test, st, "Expression");
  c(node.body, st, "Statement");
};
base.ForStatement = function (node, st, c) {
  if (node.init) { c(node.init, st, "ForInit"); }
  if (node.test) { c(node.test, st, "Expression"); }
  if (node.update) { c(node.update, st, "Expression"); }
  c(node.body, st, "Statement");
};
base.ForInStatement = base.ForOfStatement = function (node, st, c) {
  c(node.left, st, "ForInit");
  c(node.right, st, "Expression");
  c(node.body, st, "Statement");
};
base.ForInit = function (node, st, c) {
  if (node.type === "VariableDeclaration") { c(node, st); }
  else { c(node, st, "Expression"); }
};
base.DebuggerStatement = ignore;

base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
base.VariableDeclaration = function (node, st, c) {
  for (var i = 0, list = node.declarations; i < list.length; i += 1)
  {
  var decl = list[i];

  c(decl, st);
  }
};
base.VariableDeclarator = function (node, st, c) {
  c(node.id, st, "Pattern");
  if (node.init) { c(node.init, st, "Expression"); }
};

base.Function = function (node, st, c) {
  if (node.id) { c(node.id, st, "Pattern"); }
  for (var i = 0, list = node.params; i < list.length; i += 1)
  {
  var param = list[i];

  c(param, st, "Pattern");
  }
  c(node.body, st, node.expression ? "Expression" : "Statement");
};

base.Pattern = function (node, st, c) {
  if (node.type === "Identifier")
  { c(node, st, "VariablePattern"); }
  else if (node.type === "MemberExpression")
  { c(node, st, "MemberPattern"); }
  else
  { c(node, st); }
};
base.VariablePattern = ignore;
base.MemberPattern = skipThrough;
base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
base.ArrayPattern = function (node, st, c) {
  for (var i = 0, list = node.elements; i < list.length; i += 1) {
  var elt = list[i];

  if (elt) { c(elt, st, "Pattern"); }
  }
};
base.ObjectPattern = function (node, st, c) {
  for (var i = 0, list = node.properties; i < list.length; i += 1) {
  var prop = list[i];

  if (prop.type === "Property") {
    if (prop.computed) { c(prop.key, st, "Expression"); }
    c(prop.value, st, "Pattern");
  } else if (prop.type === "RestElement") {
    c(prop.argument, st, "Pattern");
  }
  }
};

base.Expression = skipThrough;
base.ThisExpression = base.Super = base.MetaProperty = ignore;
base.ArrayExpression = function (node, st, c) {
  for (var i = 0, list = node.elements; i < list.length; i += 1) {
  var elt = list[i];

  if (elt) { c(elt, st, "Expression"); }
  }
};
base.ObjectExpression = function (node, st, c) {
  for (var i = 0, list = node.properties; i < list.length; i += 1)
  {
  var prop = list[i];

  c(prop, st);
  }
};
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
base.SequenceExpression = function (node, st, c) {
  for (var i = 0, list = node.expressions; i < list.length; i += 1)
  {
  var expr = list[i];

  c(expr, st, "Expression");
  }
};
base.TemplateLiteral = function (node, st, c) {
  for (var i = 0, list = node.quasis; i < list.length; i += 1)
  {
  var quasi = list[i];

  c(quasi, st);
  }

  for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)
  {
  var expr = list$1[i$1];

  c(expr, st, "Expression");
  }
};
base.TemplateElement = ignore;
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
  c(node.argument, st, "Expression");
};
base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
  c(node.left, st, "Expression");
  c(node.right, st, "Expression");
};
base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
  c(node.left, st, "Pattern");
  c(node.right, st, "Expression");
};
base.ConditionalExpression = function (node, st, c) {
  c(node.test, st, "Expression");
  c(node.consequent, st, "Expression");
  c(node.alternate, st, "Expression");
};
base.NewExpression = base.CallExpression = function (node, st, c) {
  c(node.callee, st, "Expression");
  if (node.arguments)
  { for (var i = 0, list = node.arguments; i < list.length; i += 1)
    {
    var arg = list[i];

    c(arg, st, "Expression");
    } }
};
base.MemberExpression = function (node, st, c) {
  c(node.object, st, "Expression");
  if (node.computed) { c(node.property, st, "Expression"); }
};
base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
  if (node.declaration)
  { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
  if (node.source) { c(node.source, st, "Expression"); }
};
base.ExportAllDeclaration = function (node, st, c) {
  if (node.exported)
  { c(node.exported, st); }
  c(node.source, st, "Expression");
};
base.ImportDeclaration = function (node, st, c) {
  for (var i = 0, list = node.specifiers; i < list.length; i += 1)
  {
  var spec = list[i];

  c(spec, st);
  }
  c(node.source, st, "Expression");
};
base.ImportExpression = function (node, st, c) {
  c(node.source, st, "Expression");
};
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;

base.TaggedTemplateExpression = function (node, st, c) {
  c(node.tag, st, "Expression");
  c(node.quasi, st, "Expression");
};
base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
base.Class = function (node, st, c) {
  if (node.id) { c(node.id, st, "Pattern"); }
  if (node.superClass) { c(node.superClass, st, "Expression"); }
  c(node.body, st);
};
base.ClassBody = function (node, st, c) {
  for (var i = 0, list = node.body; i < list.length; i += 1)
  {
  var elt = list[i];

  c(elt, st);
  }
};
base.MethodDefinition = base.Property = function (node, st, c) {
  if (node.computed) { c(node.key, st, "Expression"); }
  c(node.value, st, "Expression");
};

// patch up acorn-walk until class-fields are officially supported
base.PropertyDefinition = function (node, st, c) {
  if (node.computed) {
    c(node.key, st, 'Expression');
  }
  if (node.value) {
    c(node.value, st, 'Expression');
  }
};
function handlePureAnnotationsOfNode(node, state, type = node.type) {
  let commentNode = state.commentNodes[state.commentIndex];
  while (commentNode && node.start >= commentNode.end) {
    markPureNode(node, commentNode);
    commentNode = state.commentNodes[++state.commentIndex];
  }
  if (commentNode && commentNode.end <= node.end) {
    base[type](node, state, handlePureAnnotationsOfNode);
  }
}
function markPureNode(node, comment) {
  if (node._rollupAnnotations) {
    node._rollupAnnotations.push({ comment });
  }
  else {
    node._rollupAnnotations = [{ comment }];
  }
  while (node.type === ExpressionStatement$1 || node.type === ChainExpression$1) {
    node = node.expression;
  }
  if (node.type === CallExpression$1 || node.type === NewExpression$1) {
    if (node._rollupAnnotations) {
      node._rollupAnnotations.push({ pure: true });
    }
    else {
      node._rollupAnnotations = [{ pure: true }];
    }
  }
}
const pureCommentRegex = /[@#]__PURE__/;
const isPureComment = (comment) => pureCommentRegex.test(comment.value);
function markPureCallExpressions(comments, esTreeAst) {
  handlePureAnnotationsOfNode(esTreeAst, {
    commentIndex: 0,
    commentNodes: comments.filter(isPureComment)
  });
}

function normalizeEntryModules(entryModules) {
  if (Array.isArray(entryModules)) {
    return entryModules.map(id => ({
      fileName: null,
      id,
      implicitlyLoadedAfter: [],
      importer: undefined,
      name: null
    }));
  }
  return Object.keys(entryModules).map(name => ({
    fileName: null,
    id: entryModules[name],
    implicitlyLoadedAfter: [],
    importer: undefined,
    name
  }));
}
class Graph {
  constructor(options, watcher) {
    var _a, _b;
    this.options = options;
    this.entryModules = [];
    this.modulesById = new Map();
    this.needsTreeshakingPass = false;
    this.phase = BuildPhase.LOAD_AND_PARSE;
    this.watchFiles = Object.create(null);
    this.watchMode = false;
    this.externalModules = [];
    this.implicitEntryModules = [];
    this.modules = [];
    this.getModuleInfo = (moduleId) => {
      const foundModule = this.modulesById.get(moduleId);
      if (!foundModule)
        return null;
      return foundModule.info;
    };
    this.deoptimizationTracker = new PathTracker();
    this.cachedModules = new Map();
    if (options.cache !== false) {
      if ((_a = options.cache) === null || _a === void 0 ? void 0 : _a.modules) {
        for (const module of options.cache.modules)
          this.cachedModules.set(module.id, module);
      }
      this.pluginCache = ((_b = options.cache) === null || _b === void 0 ? void 0 : _b.plugins) || Object.create(null);
      // increment access counter
      for (const name in this.pluginCache) {
        const cache = this.pluginCache[name];
        for (const key of Object.keys(cache))
          cache[key][0]++;
      }
    }
    if (watcher) {
      this.watchMode = true;
      const handleChange = (...args) => this.pluginDriver.hookSeqSync('watchChange', args);
      const handleClose = () => this.pluginDriver.hookSeqSync('closeWatcher', []);
      watcher.on('change', handleChange);
      watcher.on('close', handleClose);
      watcher.once('restart', () => {
        watcher.removeListener('change', handleChange);
        watcher.removeListener('close', handleClose);
      });
    }
    this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
    this.scope = new GlobalScope();
    this.acornParser = Parser.extend(...options.acornInjectPlugins);
    this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
  }
  async build() {
    timeStart('generate module graph', 2);
    await this.generateModuleGraph();
    timeEnd('generate module graph', 2);
    timeStart('sort modules', 2);
    this.phase = BuildPhase.ANALYSE;
    this.sortModules();
    timeEnd('sort modules', 2);
    timeStart('mark included statements', 2);
    this.includeStatements();
    timeEnd('mark included statements', 2);
    this.phase = BuildPhase.GENERATE;
  }
  contextParse(code, options = {}) {
    const onCommentOrig = options.onComment;
    const comments = [];
    if (onCommentOrig && typeof onCommentOrig == 'function') {
      options.onComment = (block, text, start, end, ...args) => {
        comments.push({ type: block ? "Block" : "Line", value: text, start, end });
        return onCommentOrig.call(options, block, text, start, end, ...args);
      };
    }
    else {
      options.onComment = comments;
    }
    const ast = this.acornParser.parse(code, {
      ...this.options.acorn,
      ...options
    });
    if (typeof onCommentOrig == 'object') {
      onCommentOrig.push(...comments);
    }
    options.onComment = onCommentOrig;
    markPureCallExpressions(comments, ast);
    return ast;
  }
  getCache() {
    // handle plugin cache eviction
    for (const name in this.pluginCache) {
      const cache = this.pluginCache[name];
      let allDeleted = true;
      for (const key of Object.keys(cache)) {
        if (cache[key][0] >= this.options.experimentalCacheExpiry)
          delete cache[key];
        else
          allDeleted = false;
      }
      if (allDeleted)
        delete this.pluginCache[name];
    }
    return {
      modules: this.modules.map(module => module.toJSON()),
      plugins: this.pluginCache
    };
  }
  async generateModuleGraph() {
    ({
      entryModules: this.entryModules,
      implicitEntryModules: this.implicitEntryModules
    } = await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true));
    if (this.entryModules.length === 0) {
      throw new Error('You must supply options.input to rollup');
    }
    for (const module of this.modulesById.values()) {
      if (module instanceof Module) {
        this.modules.push(module);
      }
      else {
        this.externalModules.push(module);
      }
    }
  }
  includeStatements() {
    for (const module of [...this.entryModules, ...this.implicitEntryModules]) {
      if (module.preserveSignature !== false) {
        module.includeAllExports(false);
      }
      else {
        markModuleAndImpureDependenciesAsExecuted(module);
      }
    }
    if (this.options.treeshake) {
      let treeshakingPass = 1;
      do {
        timeStart(`treeshaking pass ${treeshakingPass}`, 3);
        this.needsTreeshakingPass = false;
        for (const module of this.modules) {
          if (module.isExecuted) {
            if (module.info.hasModuleSideEffects === 'no-treeshake') {
              module.includeAllInBundle();
            }
            else {
              module.include();
            }
          }
        }
        timeEnd(`treeshaking pass ${treeshakingPass++}`, 3);
      } while (this.needsTreeshakingPass);
    }
    else {
      for (const module of this.modules)
        module.includeAllInBundle();
    }
    for (const externalModule of this.externalModules)
      externalModule.warnUnusedImports();
    for (const module of this.implicitEntryModules) {
      for (const dependant of module.implicitlyLoadedAfter) {
        if (!(dependant.info.isEntry || dependant.isIncluded())) {
          error(errImplicitDependantIsNotIncluded(dependant));
        }
      }
    }
  }
  sortModules() {
    const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules);
    for (const cyclePath of cyclePaths) {
      this.options.onwarn({
        code: 'CIRCULAR_DEPENDENCY',
        cycle: cyclePath,
        importer: cyclePath[0],
        message: `Circular dependency: ${cyclePath.join(' -> ')}`
      });
    }
    this.modules = orderedModules;
    for (const module of this.modules) {
      module.bindReferences();
    }
    this.warnForMissingExports();
  }
  warnForMissingExports() {
    for (const module of this.modules) {
      for (const importName of Object.keys(module.importDescriptions)) {
        const importDescription = module.importDescriptions[importName];
        if (importDescription.name !== '*' &&
          !importDescription.module.getVariableForExportName(importDescription.name)) {
          module.warn({
            code: 'NON_EXISTENT_EXPORT',
            message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`,
            name: importDescription.name,
            source: importDescription.module.id
          }, importDescription.start);
        }
      }
    }
  }
}

function ensureArray(items) {
  if (Array.isArray(items)) {
    return items.filter(Boolean);
  }
  if (items) {
    return [items];
  }
  return [];
}

function getAugmentedNamespace(n) {
	if (n.__esModule) return n;
	var a = Object.defineProperty({}, '__esModule', {value: true});
	Object.keys(n).forEach(function (k) {
		var d = Object.getOwnPropertyDescriptor(n, k);
		Object.defineProperty(a, k, d.get ? d : {
			enumerable: true,
			get: function () {
				return n[k];
			}
		});
	});
	return a;
}

var require$$1 = /*@__PURE__*/getAugmentedNamespace(acorn);

const getPrototype = Object.getPrototypeOf || (o => o.__proto__);

const getAcorn$1 = Parser => {
  if (Parser.acorn) return Parser.acorn

  const acorn = require$$1;

  if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) {
  throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`)
  }

  // Make sure `Parser` comes from the same acorn as we `require`d,
  // otherwise the comparisons fail.
  for (let cur = Parser; cur && cur !== acorn.Parser; cur = getPrototype(cur)) {
  if (cur !== acorn.Parser) {
    throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
  }
  }
  return acorn
};

var acornPrivateClassElements = function(Parser) {
  // Only load this plugin once.
  if (Parser.prototype.parsePrivateName) {
  return Parser
  }

  const acorn = getAcorn$1(Parser);

  Parser = class extends Parser {
  _branch() {
    this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input);
    this.__branch.end = this.end;
    this.__branch.pos = this.pos;
    this.__branch.type = this.type;
    this.__branch.value = this.value;
    this.__branch.containsEsc = this.containsEsc;
    return this.__branch
  }

  parsePrivateClassElementName(element) {
    element.computed = false;
    element.key = this.parsePrivateName();
    if (element.key.name == "constructor") this.raise(element.key.start, "Classes may not have a private element named constructor");
    const accept = {get: "set", set: "get"}[element.kind];
    const privateBoundNames = this._privateBoundNames;
    if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) {
    this.raise(element.start, "Duplicate private element");
    }
    privateBoundNames[element.key.name] = element.kind || true;
    delete this._unresolvedPrivateNames[element.key.name];
    return element.key
  }

  parsePrivateName() {
    const node = this.startNode();
    node.name = this.value;
    this.next();
    this.finishNode(node, "PrivateIdentifier");
    if (this.options.allowReserved == "never") this.checkUnreserved(node);
    return node
  }

  // Parse # token
  getTokenFromCode(code) {
    if (code === 35) {
    ++this.pos;
    const word = this.readWord1();
    return this.finishToken(this.privateIdentifierToken, word)
    }
    return super.getTokenFromCode(code)
  }

  // Manage stacks and check for undeclared private names
  parseClass(node, isStatement) {
    const oldOuterPrivateBoundNames = this._outerPrivateBoundNames;
    this._outerPrivateBoundNames = this._privateBoundNames;
    this._privateBoundNames = Object.create(this._privateBoundNames || null);
    const oldOuterUnresolvedPrivateNames = this._outerUnresolvedPrivateNames;
    this._outerUnresolvedPrivateNames = this._unresolvedPrivateNames;
    this._unresolvedPrivateNames = Object.create(null);

    const _return = super.parseClass(node, isStatement);

    const unresolvedPrivateNames = this._unresolvedPrivateNames;
    this._privateBoundNames = this._outerPrivateBoundNames;
    this._outerPrivateBoundNames = oldOuterPrivateBoundNames;
    this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
    this._outerUnresolvedPrivateNames = oldOuterUnresolvedPrivateNames;
    if (!this._unresolvedPrivateNames) {
    const names = Object.keys(unresolvedPrivateNames);
    if (names.length) {
      names.sort((n1, n2) => unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]);
      this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name");
    }
    } else Object.assign(this._unresolvedPrivateNames, unresolvedPrivateNames);
    return _return
  }

  // Class heritage is evaluated with outer private environment
  parseClassSuper(node) {
    const privateBoundNames = this._privateBoundNames;
    this._privateBoundNames = this._outerPrivateBoundNames;
    const unresolvedPrivateNames = this._unresolvedPrivateNames;
    this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
    const _return = super.parseClassSuper(node);
    this._privateBoundNames = privateBoundNames;
    this._unresolvedPrivateNames = unresolvedPrivateNames;
    return _return
  }

  // Parse private element access
  parseSubscript(base, startPos, startLoc, _noCalls, _maybeAsyncArrow, _optionalChained) {
    const optionalSupported = this.options.ecmaVersion >= 11 && acorn.tokTypes.questionDot;
    const branch = this._branch();
    if (!(
    (branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) &&
    branch.type == this.privateIdentifierToken
    )) {
    return super.parseSubscript.apply(this, arguments)
    }
    let optional = false;
    if (!this.eat(acorn.tokTypes.dot)) {
    this.expect(acorn.tokTypes.questionDot);
    optional = true;
    }
    let node = this.startNodeAt(startPos, startLoc);
    node.object = base;
    node.computed = false;
    if (optionalSupported) {
    node.optional = optional;
    }
    if (this.type == this.privateIdentifierToken) {
    if (base.type == "Super") {
      this.raise(this.start, "Cannot access private element on super");
    }
    node.property = this.parsePrivateName();
    if (!this._privateBoundNames || !this._privateBoundNames[node.property.name]) {
      if (!this._unresolvedPrivateNames) {
      this.raise(node.property.start, "Usage of undeclared private name");
      }
      this._unresolvedPrivateNames[node.property.name] = node.property.start;
    }
    } else {
    node.property = this.parseIdent(true);
    }
    return this.finishNode(node, "MemberExpression")
  }

  // Prohibit delete of private class elements
  parseMaybeUnary(refDestructuringErrors, sawUnary) {
    const _return = super.parseMaybeUnary(refDestructuringErrors, sawUnary);
    if (_return.operator == "delete") {
    if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateIdentifier") {
      this.raise(_return.start, "Private elements may not be deleted");
    }
    }
    return _return
  }
  };
  Parser.prototype.privateIdentifierToken = new acorn.TokenType("privateIdentifier");
  return Parser
};

const privateClassElements$1 = acornPrivateClassElements;

var acornClassFields = function(Parser) {
  const acorn = Parser.acorn || require$$1;
  const tt = acorn.tokTypes;

  Parser = privateClassElements$1(Parser);
  return class extends Parser {
  _maybeParseFieldValue(field) {
    if (this.eat(tt.eq)) {
    const oldInFieldValue = this._inFieldValue;
    this._inFieldValue = true;
    if (this.type === tt.name && this.value === "await" && (this.inAsync || this.options.allowAwaitOutsideFunction)) {
      field.value = this.parseAwait();
    } else field.value = this.parseExpression();
    this._inFieldValue = oldInFieldValue;
    } else field.value = null;
  }

  // Parse fields
  parseClassElement(_constructorAllowsSuper) {
    if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateIdentifierToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
    const branch = this._branch();
    if (branch.type == tt.bracketL) {
      let count = 0;
      do {
      if (branch.eat(tt.bracketL)) ++count;
      else if (branch.eat(tt.bracketR)) --count;
      else branch.next();
      } while (count > 0)
    } else branch.next(true);
    let isField = branch.type == tt.eq || branch.type == tt.semi;
    if (!isField && branch.canInsertSemicolon()) {
      isField = branch.type != tt.parenL;
    }
    if (isField) {
      const node = this.startNode();
      if (this.type == this.privateIdentifierToken) {
      this.parsePrivateClassElementName(node);
      } else {
      this.parsePropertyName(node);
      }
      if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
        (node.key.type === "Literal" && node.key.value === "constructor")) {
      this.raise(node.key.start, "Classes may not have a field called constructor");
      }
      this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
      this._maybeParseFieldValue(node);
      this.exitScope();
      this.finishNode(node, "PropertyDefinition");
      this.semicolon();
      return node
    }
    }

    return super.parseClassElement.apply(this, arguments)
  }

  // Prohibit arguments in class field initializers
  parseIdent(liberal, isBinding) {
    const ident = super.parseIdent(liberal, isBinding);
    if (this._inFieldValue && ident.name == "arguments") this.raise(ident.start, "A class field initializer may not contain arguments");
    return ident
  }
  }
};

const privateClassElements = acornPrivateClassElements;

var acornStaticClassFeatures = function(Parser) {
  const ExtendedParser = privateClassElements(Parser);

  const acorn = Parser.acorn || require$$1;
  const tt = acorn.tokTypes;

  return class extends ExtendedParser {
  _maybeParseFieldValue(field) {
    if (this.eat(tt.eq)) {
    const oldInFieldValue = this._inStaticFieldScope;
    this._inStaticFieldScope = this.currentThisScope();
    field.value = this.parseExpression();
    this._inStaticFieldScope = oldInFieldValue;
    } else field.value = null;
  }

  // Parse fields
  parseClassElement(_constructorAllowsSuper) {
    if (this.options.ecmaVersion < 8 || !this.isContextual("static")) {
    return super.parseClassElement.apply(this, arguments)
    }

    const branch = this._branch();
    branch.next();
    if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateIdentifierToken].indexOf(branch.type) == -1 && !branch.type.keyword) {
    return super.parseClassElement.apply(this, arguments)
    }
    if (branch.type == tt.bracketL) {
    let count = 0;
    do {
      if (branch.eat(tt.bracketL)) ++count;
      else if (branch.eat(tt.bracketR)) --count;
      else branch.next();
    } while (count > 0)
    } else branch.next();
    if (branch.type != tt.eq && !branch.canInsertSemicolon() && branch.type != tt.semi) {
    return super.parseClassElement.apply(this, arguments)
    }

    const node = this.startNode();
    node.static = this.eatContextual("static");
    if (this.type == this.privateIdentifierToken) {
    this.parsePrivateClassElementName(node);
    } else {
    this.parsePropertyName(node);
    }
    if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
      (node.key.type === "Literal" && !node.computed && node.key.value === "constructor")) {
    this.raise(node.key.start, "Classes may not have a field called constructor");
    }
    if ((node.key.name || node.key.value) === "prototype" && !node.computed) {
    this.raise(node.key.start, "Classes may not have a static property named prototype");
    }

    this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
    this._maybeParseFieldValue(node);
    this.exitScope();
    this.finishNode(node, "PropertyDefinition");
    this.semicolon();
    return node
  }

  // Parse private static methods
  parsePropertyName(prop) {
    if (prop.static && this.type == this.privateIdentifierToken) {
    this.parsePrivateClassElementName(prop);
    } else {
    super.parsePropertyName(prop);
    }
  }

  // Prohibit arguments in class field initializers
  parseIdent(liberal, isBinding) {
    const ident = super.parseIdent(liberal, isBinding);
    if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") {
    this.raise(ident.start, "A static class field initializer may not contain arguments");
    }
    return ident
  }
  }
};

const defaultOnWarn = warning => console.warn(warning.message || warning);
function warnUnknownOptions(passedOptions, validOptions, optionType, warn, ignoredKeys = /$./) {
  const validOptionSet = new Set(validOptions);
  const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key)));
  if (unknownOptions.length > 0) {
    warn({
      code: 'UNKNOWN_OPTION',
      message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${[
        ...validOptionSet
      ]
        .sort()
        .join(', ')}`
    });
  }
}

function normalizeInputOptions(config) {
  var _a, _b;
  // These are options that may trigger special warnings or behaviour later
  // if the user did not select an explicit value
  const unsetOptions = new Set();
  const context = (_a = config.context) !== null && _a !== void 0 ? _a : 'undefined';
  const onwarn = getOnwarn(config);
  const strictDeprecations = config.strictDeprecations || false;
  const options = {
    acorn: getAcorn(config),
    acornInjectPlugins: getAcornInjectPlugins(config),
    cache: getCache(config),
    context,
    experimentalCacheExpiry: (_b = config.experimentalCacheExpiry) !== null && _b !== void 0 ? _b : 10,
    external: getIdMatcher(config.external),
    inlineDynamicImports: getInlineDynamicImports$1(config, onwarn, strictDeprecations),
    input: getInput(config),
    manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
    moduleContext: getModuleContext(config, context),
    onwarn,
    perf: config.perf || false,
    plugins: ensureArray(config.plugins),
    preserveEntrySignatures: getPreserveEntrySignatures(config, unsetOptions),
    preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
    preserveSymlinks: config.preserveSymlinks || false,
    shimMissingExports: config.shimMissingExports || false,
    strictDeprecations,
    treeshake: getTreeshake(config, onwarn, strictDeprecations)
  };
  warnUnknownOptions(config, [...Object.keys(options), 'watch'], 'input options', options.onwarn, /^(output)$/);
  return { options, unsetOptions };
}
const getOnwarn = (config) => {
  return config.onwarn
    ? warning => {
      warning.toString = () => {
        let str = '';
        if (warning.plugin)
          str += `(${warning.plugin} plugin) `;
        if (warning.loc)
          str += `${relativeId(warning.loc.file)} (${warning.loc.line}:${warning.loc.column}) `;
        str += warning.message;
        return str;
      };
      config.onwarn(warning, defaultOnWarn);
    }
    : defaultOnWarn;
};
const getAcorn = (config) => ({
  allowAwaitOutsideFunction: true,
  ecmaVersion: 'latest',
  preserveParens: false,
  sourceType: 'module',
  ...config.acorn
});
const getAcornInjectPlugins = (config) => [
  acornClassFields,
  acornStaticClassFeatures,
  ...ensureArray(config.acornInjectPlugins)
];
const getCache = (config) => {
  var _a;
  return ((_a = config.cache) === null || _a === void 0 ? void 0 : _a.cache) || config.cache;
};
const getIdMatcher = (option) => {
  if (option === true) {
    return () => true;
  }
  if (typeof option === 'function') {
    return (id, ...args) => (!id.startsWith('\0') && option(id, ...args)) || false;
  }
  if (option) {
    const ids = new Set();
    const matchers = [];
    for (const value of ensureArray(option)) {
      if (value instanceof RegExp) {
        matchers.push(value);
      }
      else {
        ids.add(value);
      }
    }
    return (id, ..._args) => ids.has(id) || matchers.some(matcher => matcher.test(id));
  }
  return () => false;
};
const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
  const configInlineDynamicImports = config.inlineDynamicImports;
  if (configInlineDynamicImports) {
    warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', false, warn, strictDeprecations);
  }
  return configInlineDynamicImports;
};
const getInput = (config) => {
  const configInput = config.input;
  return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput;
};
const getManualChunks$1 = (config, warn, strictDeprecations) => {
  const configManualChunks = config.manualChunks;
  if (configManualChunks) {
    warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', false, warn, strictDeprecations);
  }
  return configManualChunks;
};
const getModuleContext = (config, context) => {
  const configModuleContext = config.moduleContext;
  if (typeof configModuleContext === 'function') {
    return id => { var _a; return (_a = configModuleContext(id)) !== null && _a !== void 0 ? _a : context; };
  }
  if (configModuleContext) {
    const contextByModuleId = Object.create(null);
    for (const key of Object.keys(configModuleContext)) {
      contextByModuleId[resolve$3(key)] = configModuleContext[key];
    }
    return id => contextByModuleId[id] || context;
  }
  return () => context;
};
const getPreserveEntrySignatures = (config, unsetOptions) => {
  const configPreserveEntrySignatures = config.preserveEntrySignatures;
  if (configPreserveEntrySignatures == null) {
    unsetOptions.add('preserveEntrySignatures');
  }
  return configPreserveEntrySignatures !== null && configPreserveEntrySignatures !== void 0 ? configPreserveEntrySignatures : 'strict';
};
const getPreserveModules$1 = (config, warn, strictDeprecations) => {
  const configPreserveModules = config.preserveModules;
  if (configPreserveModules) {
    warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', false, warn, strictDeprecations);
  }
  return configPreserveModules;
};
const getTreeshake = (config, warn, strictDeprecations) => {
  const configTreeshake = config.treeshake;
  if (configTreeshake === false) {
    return false;
  }
  if (configTreeshake && configTreeshake !== true) {
    if (typeof configTreeshake.pureExternalModules !== 'undefined') {
      warnDeprecationWithOptions(`The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, true, warn, strictDeprecations);
    }
    return {
      annotations: configTreeshake.annotations !== false,
      moduleSideEffects: getHasModuleSideEffects(configTreeshake.moduleSideEffects, configTreeshake.pureExternalModules, warn),
      propertyReadSideEffects: configTreeshake.propertyReadSideEffects === 'always' && 'always' ||
        configTreeshake.propertyReadSideEffects !== false,
      tryCatchDeoptimization: configTreeshake.tryCatchDeoptimization !== false,
      unknownGlobalSideEffects: configTreeshake.unknownGlobalSideEffects !== false
    };
  }
  return {
    annotations: true,
    moduleSideEffects: () => true,
    propertyReadSideEffects: true,
    tryCatchDeoptimization: true,
    unknownGlobalSideEffects: true
  };
};
const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules, warn) => {
  if (typeof moduleSideEffectsOption === 'boolean') {
    return () => moduleSideEffectsOption;
  }
  if (moduleSideEffectsOption === 'no-external') {
    return (_id, external) => !external;
  }
  if (typeof moduleSideEffectsOption === 'function') {
    return (id, external) => !id.startsWith('\0') ? moduleSideEffectsOption(id, external) !== false : true;
  }
  if (Array.isArray(moduleSideEffectsOption)) {
    const ids = new Set(moduleSideEffectsOption);
    return id => ids.has(id);
  }
  if (moduleSideEffectsOption) {
    warn(errInvalidOption('treeshake.moduleSideEffects', 'please use one of false, "no-external", a function or an array'));
  }
  const isPureExternalModule = getIdMatcher(pureExternalModules);
  return (id, external) => !(external && isPureExternalModule(id));
};

function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
  var _a, _b, _c, _d, _e, _f, _g;
  // These are options that may trigger special warnings or behaviour later
  // if the user did not select an explicit value
  const unsetOptions = new Set(unsetInputOptions);
  const compact = config.compact || false;
  const format = getFormat(config);
  const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
  const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
  const file = getFile(config, preserveModules, inputOptions);
  const outputOptions = {
    amd: getAmd(config),
    assetFileNames: (_a = config.assetFileNames) !== null && _a !== void 0 ? _a : 'assets/[name]-[hash][extname]',
    banner: getAddon(config, 'banner'),
    chunkFileNames: (_b = config.chunkFileNames) !== null && _b !== void 0 ? _b : '[name]-[hash].js',
    compact,
    dir: getDir(config, file),
    dynamicImportFunction: getDynamicImportFunction(config, inputOptions),
    entryFileNames: getEntryFileNames(config, unsetOptions),
    esModule: (_c = config.esModule) !== null && _c !== void 0 ? _c : true,
    exports: getExports(config, unsetOptions),
    extend: config.extend || false,
    externalLiveBindings: (_d = config.externalLiveBindings) !== null && _d !== void 0 ? _d : true,
    file,
    footer: getAddon(config, 'footer'),
    format,
    freeze: (_e = config.freeze) !== null && _e !== void 0 ? _e : true,
    globals: config.globals || {},
    hoistTransitiveImports: (_f = config.hoistTransitiveImports) !== null && _f !== void 0 ? _f : true,
    indent: getIndent(config, compact),
    inlineDynamicImports,
    interop: getInterop(config, inputOptions),
    intro: getAddon(config, 'intro'),
    manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions),
    minifyInternalExports: getMinifyInternalExports(config, format, compact),
    name: config.name,
    namespaceToStringTag: config.namespaceToStringTag || false,
    noConflict: config.noConflict || false,
    outro: getAddon(config, 'outro'),
    paths: config.paths || {},
    plugins: ensureArray(config.plugins),
    preferConst: config.preferConst || false,
    preserveModules,
    preserveModulesRoot: getPreserveModulesRoot(config),
    sourcemap: config.sourcemap || false,
    sourcemapExcludeSources: config.sourcemapExcludeSources || false,
    sourcemapFile: config.sourcemapFile,
    sourcemapPathTransform: config.sourcemapPathTransform,
    strict: (_g = config.strict) !== null && _g !== void 0 ? _g : true,
    systemNullSetters: config.systemNullSetters || false,
    validate: config.validate || false
  };
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onwarn);
  return { options: outputOptions, unsetOptions };
}
const getFile = (config, preserveModules, inputOptions) => {
  const file = config.file;
  if (typeof file === 'string') {
    if (preserveModules) {
      return error({
        code: 'INVALID_OPTION',
        message: 'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.'
      });
    }
    if (!Array.isArray(inputOptions.input))
      return error({
        code: 'INVALID_OPTION',
        message: 'You must set "output.dir" instead of "output.file" when providing named inputs.'
      });
  }
  return file;
};
const getFormat = (config) => {
  const configFormat = config.format;
  switch (configFormat) {
    case undefined:
    case 'es':
    case 'esm':
    case 'module':
      return 'es';
    case 'cjs':
    case 'commonjs':
      return 'cjs';
    case 'system':
    case 'systemjs':
      return 'system';
    case 'amd':
    case 'iife':
    case 'umd':
      return configFormat;
    default:
      return error({
        message: `You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".`,
        url: `https://rollupjs.org/guide/en/#outputformat`
      });
  }
};
const getInlineDynamicImports = (config, inputOptions) => {
  var _a;
  const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) ||
    false;
  const { input } = inputOptions;
  if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) {
    return error({
      code: 'INVALID_OPTION',
      message: 'Multiple inputs are not supported for "output.inlineDynamicImports".'
    });
  }
  return inlineDynamicImports;
};
const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
  var _a;
  const preserveModules = ((_a = config.preserveModules) !== null && _a !== void 0 ? _a : inputOptions.preserveModules) || false;
  if (preserveModules) {
    if (inlineDynamicImports) {
      return error({
        code: 'INVALID_OPTION',
        message: `The "output.inlineDynamicImports" option is not supported for "output.preserveModules".`
      });
    }
    if (inputOptions.preserveEntrySignatures === false) {
      return error({
        code: 'INVALID_OPTION',
        message: 'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".'
      });
    }
  }
  return preserveModules;
};
const getPreserveModulesRoot = (config) => {
  const preserveModulesRoot = config.preserveModulesRoot;
  if (preserveModulesRoot === null || preserveModulesRoot === undefined) {
    return undefined;
  }
  return resolve$3(preserveModulesRoot);
};
const getAmd = (config) => {
  const collection = {
    autoId: false,
    basePath: '',
    define: 'define',
    ...config.amd
  };
  if ((collection.autoId || collection.basePath) && collection.id) {
    return error({
      code: 'INVALID_OPTION',
      message: '"output.amd.autoId"/"output.amd.basePath" and "output.amd.id" cannot be used together.'
    });
  }
  if (collection.basePath && !collection.autoId) {
    return error({
      code: 'INVALID_OPTION',
      message: '"output.amd.basePath" only works with "output.amd.autoId".'
    });
  }
  let normalized;
  if (collection.autoId) {
    normalized = {
      autoId: true,
      basePath: collection.basePath,
      define: collection.define
    };
  }
  else {
    normalized = {
      autoId: false,
      define: collection.define,
      id: collection.id
    };
  }
  return normalized;
};
const getAddon = (config, name) => {
  const configAddon = config[name];
  if (typeof configAddon === 'function') {
    return configAddon;
  }
  return () => configAddon || '';
};
const getDir = (config, file) => {
  const dir = config.dir;
  if (typeof dir === 'string' && typeof file === 'string') {
    return error({
      code: 'INVALID_OPTION',
      message: 'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'
    });
  }
  return dir;
};
const getDynamicImportFunction = (config, inputOptions) => {
  const configDynamicImportFunction = config.dynamicImportFunction;
  if (configDynamicImportFunction) {
    warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, false, inputOptions);
  }
  return configDynamicImportFunction;
};
const getEntryFileNames = (config, unsetOptions) => {
  const configEntryFileNames = config.entryFileNames;
  if (configEntryFileNames == null) {
    unsetOptions.add('entryFileNames');
  }
  return configEntryFileNames !== null && configEntryFileNames !== void 0 ? configEntryFileNames : '[name].js';
};
function getExports(config, unsetOptions) {
  const configExports = config.exports;
  if (configExports == null) {
    unsetOptions.add('exports');
  }
  else if (!['default', 'named', 'none', 'auto'].includes(configExports)) {
    return error(errInvalidExportOptionValue(configExports));
  }
  return configExports || 'auto';
}
const getIndent = (config, compact) => {
  if (compact) {
    return '';
  }
  const configIndent = config.indent;
  return configIndent === false ? '' : configIndent !== null && configIndent !== void 0 ? configIndent : true;
};
const ALLOWED_INTEROP_TYPES = new Set(['auto', 'esModule', 'default', 'defaultOnly', true, false]);
const getInterop = (config, inputOptions) => {
  const configInterop = config.interop;
  const validatedInteropTypes = new Set();
  const validateInterop = (interop) => {
    if (!validatedInteropTypes.has(interop)) {
      validatedInteropTypes.add(interop);
      if (!ALLOWED_INTEROP_TYPES.has(interop)) {
        return error({
          code: 'INVALID_OPTION',
          message: `The value ${JSON.stringify(interop)} is not supported for "output.interop". Use one of ${Array.from(ALLOWED_INTEROP_TYPES.values(), value => JSON.stringify(value)).join(', ')} instead.`,
          url: 'https://rollupjs.org/guide/en/#outputinterop'
        });
      }
      if (typeof interop === 'boolean') {
        warnDeprecation({
          message: `The boolean value "${interop}" for the "output.interop" option is deprecated. Use ${interop ? '"auto"' : '"esModule", "default" or "defaultOnly"'} instead.`,
          url: 'https://rollupjs.org/guide/en/#outputinterop'
        }, false, inputOptions);
      }
    }
    return interop;
  };
  if (typeof configInterop === 'function') {
    const interopPerId = Object.create(null);
    let defaultInterop = null;
    return id => id === null
      ? defaultInterop || validateInterop((defaultInterop = configInterop(id)))
      : id in interopPerId
        ? interopPerId[id]
        : validateInterop((interopPerId[id] = configInterop(id)));
  }
  return configInterop === undefined ? () => true : () => validateInterop(configInterop);
};
const getManualChunks = (config, inlineDynamicImports, preserveModules, inputOptions) => {
  const configManualChunks = config.manualChunks || inputOptions.manualChunks;
  if (configManualChunks) {
    if (inlineDynamicImports) {
      return error({
        code: 'INVALID_OPTION',
        message: 'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".'
      });
    }
    if (preserveModules) {
      return error({
        code: 'INVALID_OPTION',
        message: 'The "output.manualChunks" option is not supported for "output.preserveModules".'
      });
    }
  }
  return configManualChunks || {};
};
const getMinifyInternalExports = (config, format, compact) => { var _a; return (_a = config.minifyInternalExports) !== null && _a !== void 0 ? _a : (compact || format === 'es' || format === 'system'); };

function rollup(rawInputOptions) {
  return rollupInternal(rawInputOptions, null);
}
async function rollupInternal(rawInputOptions, watcher) {
  const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null);
  initialiseTimers(inputOptions);
  const graph = new Graph(inputOptions, watcher);
  // remove the cache option from the memory after graph creation (cache is not used anymore)
  const useCache = rawInputOptions.cache !== false;
  delete inputOptions.cache;
  delete rawInputOptions.cache;
  timeStart('BUILD', 1);
  try {
    await graph.pluginDriver.hookParallel('buildStart', [inputOptions]);
    await graph.build();
  }
  catch (err) {
    const watchFiles = Object.keys(graph.watchFiles);
    if (watchFiles.length > 0) {
      err.watchFiles = watchFiles;
    }
    await graph.pluginDriver.hookParallel('buildEnd', [err]);
    await graph.pluginDriver.hookParallel('closeBundle', []);
    throw err;
  }
  await graph.pluginDriver.hookParallel('buildEnd', []);
  timeEnd('BUILD', 1);
  const result = {
    cache: useCache ? graph.getCache() : undefined,
    closed: false,
    async close() {
      if (result.closed)
        return;
      result.closed = true;
      await graph.pluginDriver.hookParallel('closeBundle', []);
    },
    async generate(rawOutputOptions) {
      if (result.closed)
        return error(errAlreadyClosed());
      return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph);
    },
    watchFiles: Object.keys(graph.watchFiles),
    async write(rawOutputOptions) {
      if (result.closed)
        return error(errAlreadyClosed());
      return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph);
    }
  };
  if (inputOptions.perf)
    result.getTimings = getTimings;
  return result;
}
async function getInputOptions(rawInputOptions, watchMode) {
  if (!rawInputOptions) {
    throw new Error('You must supply an options object to rollup');
  }
  const rawPlugins = ensureArray(rawInputOptions.plugins);
  const { options, unsetOptions } = normalizeInputOptions(await rawPlugins.reduce(applyOptionHook(watchMode), Promise.resolve(rawInputOptions)));
  normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX);
  return { options, unsetOptions };
}
function applyOptionHook(watchMode) {
  return async (inputOptions, plugin) => {
    if (plugin.options)
      return (plugin.options.call({ meta: { rollupVersion: version$1, watchMode } }, await inputOptions) || inputOptions);
    return inputOptions;
  };
}
function normalizePlugins(plugins, anonymousPrefix) {
  for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
    const plugin = plugins[pluginIndex];
    if (!plugin.name) {
      plugin.name = `${anonymousPrefix}${pluginIndex + 1}`;
    }
  }
}
async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) {
  const { options: outputOptions, outputPluginDriver, unsetOptions } = getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions);
  const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph);
  const generated = await bundle.generate(isWrite);
  if (isWrite) {
    if (!outputOptions.dir && !outputOptions.file) {
      return error({
        code: 'MISSING_OPTION',
        message: 'You must specify "output.file" or "output.dir" for the build.'
      });
    }
    await Promise.all(Object.keys(generated).map(chunkId => writeOutputFile(generated[chunkId], outputOptions)));
    await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]);
  }
  return createOutput(generated);
}
function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) {
  if (!rawOutputOptions) {
    throw new Error('You must supply an options object');
  }
  const rawPlugins = ensureArray(rawOutputOptions.plugins);
  normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
  const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins);
  return {
    ...getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver),
    outputPluginDriver
  };
}
function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) {
  return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions.output || rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => {
    const emitError = () => pluginContext.error(errCannotEmitFromOptionsHook());
    return {
      ...pluginContext,
      emitFile: emitError,
      setAssetSource: emitError
    };
  }), inputOptions, unsetInputOptions);
}
function createOutput(outputBundle) {
  return {
    output: Object.keys(outputBundle)
      .map(fileName => outputBundle[fileName])
      .filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => {
      const fileTypeA = getSortingFileType(outputFileA);
      const fileTypeB = getSortingFileType(outputFileB);
      if (fileTypeA === fileTypeB)
        return 0;
      return fileTypeA < fileTypeB ? -1 : 1;
    })
  };
}
var SortingFileType;
(function (SortingFileType) {
  SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK";
  SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK";
  SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET";
})(SortingFileType || (SortingFileType = {}));
function getSortingFileType(file) {
  if (file.type === 'asset') {
    return SortingFileType.ASSET;
  }
  if (file.isEntry) {
    return SortingFileType.ENTRY_CHUNK;
  }
  return SortingFileType.SECONDARY_CHUNK;
}
function writeOutputFile(outputFile, outputOptions) {
  const fileName = resolve$3(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName);
  let writeSourceMapPromise;
  let source;
  if (outputFile.type === 'asset') {
    source = outputFile.source;
  }
  else {
    source = outputFile.code;
    if (outputOptions.sourcemap && outputFile.map) {
      let url;
      if (outputOptions.sourcemap === 'inline') {
        url = outputFile.map.toUrl();
      }
      else {
        url = `${basename(outputFile.fileName)}.map`;
        writeSourceMapPromise = writeFile(`${fileName}.map`, outputFile.map.toString());
      }
      if (outputOptions.sourcemap !== 'hidden') {
        source += `//# ${SOURCEMAPPING_URL}=${url}\n`;
      }
    }
  }
  return Promise.all([writeFile(fileName, source), writeSourceMapPromise]);
}

const lazyComponentPlugin = (buildCtx) => {
  const entrys = new Map();
  const plugin = {
    name: 'lazyComponentPlugin',
    resolveId(importee) {
      const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === importee);
      if (entryModule) {
        entrys.set(importee, entryModule);
        return importee;
      }
      return null;
    },
    load(id) {
      const entryModule = entrys.get(id);
      if (entryModule) {
        return entryModule.cmps.map(createComponentExport).join('\n');
      }
      return null;
    },
  };
  return plugin;
};
const createComponentExport = (cmp) => {
  const originalClassName = cmp.componentClassName;
  const underscoredClassName = cmp.tagName.replace(/-/g, '_');
  const filePath = normalizePath$2(cmp.sourceFilePath);
  return `export { ${originalClassName} as ${underscoredClassName} } from '${filePath}';`;
};

const removeCollectionImports = (compilerCtx) => {
  /*
    // remove side effect collection imports like:
    import 'ionicons';

    // do not remove collection imports with importClauses:
    import * as asdf 'ionicons';
    import { asdf } '@ionic/core';
  */
  return () => {
    return (tsSourceFile) => {
      let madeUpdates = false;
      const statements = tsSourceFile.statements.slice();
      for (let i = statements.length - 1; i >= 0; i--) {
        const n = statements[i];
        if (t.isImportDeclaration(n)) {
          if (!n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
            // must not have an import clause
            // must have a module specifier and
            // the module specifier must be a string literal
            const importPath = n.moduleSpecifier.text;
            // test if this side effect import is a collection
            const isCollectionImport = compilerCtx.collections.some((c) => {
              return c.collectionName === importPath || c.moduleId === importPath;
            });
            if (isCollectionImport) {
              // turns out this is a side effect import is a collection,
              // we actually don't want to include this in the JS output
              // we've already gather the types we needed, kthxbai
              madeUpdates = true;
              statements.splice(i, 1);
            }
          }
        }
      }
      if (madeUpdates) {
        return t.factory.updateSourceFile(tsSourceFile, statements);
      }
      return tsSourceFile;
    };
  };
};

const STENCIL_CORE_ID = '@stencil/core';
const STENCIL_INTERNAL_ID = '@stencil/core/internal';
const STENCIL_APP_DATA_ID = '@stencil/core/internal/app-data';
const STENCIL_APP_GLOBALS_ID = '@stencil/core/internal/app-globals';
const STENCIL_HYDRATE_FACTORY_ID = '@stencil/core/hydrate-factory';
const STENCIL_INTERNAL_CLIENT_ID = '@stencil/core/internal/client';
const STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID = '@stencil/core/internal/client/patch-browser';
const STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID = '@stencil/core/internal/client/patch-esm';
const STENCIL_INTERNAL_HYDRATE_ID = '@stencil/core/internal/hydrate';
const STENCIL_MOCK_DOC_ID = '@stencil/core/mock-doc';
const APP_DATA_CONDITIONAL = '?app-data=conditional';
const LAZY_BROWSER_ENTRY_ID = '@lazy-browser-entrypoint' + APP_DATA_CONDITIONAL;
const LAZY_EXTERNAL_ENTRY_ID = '@lazy-external-entrypoint' + APP_DATA_CONDITIONAL;
const USER_INDEX_ENTRY_ID = '@user-index-entrypoint';

const appDataPlugin = (config, compilerCtx, buildCtx, build, platform) => {
  if (!platform) {
    return {
      name: 'appDataPlugin',
    };
  }
  const globalScripts = getGlobalScriptData(config, compilerCtx);
  return {
    name: 'appDataPlugin',
    resolveId(id, importer) {
      if (id === STENCIL_APP_DATA_ID || id === STENCIL_APP_GLOBALS_ID) {
        if (platform === 'worker') {
          this.error('@stencil/core packages cannot be imported from a worker.');
        }
        if (platform === 'hydrate' || STENCIL_APP_GLOBALS_ID) {
          // hydrate will always bundle app-data and runtime
          // and the load() fn will build a custom globals import
          return id;
        }
        else if (platform === 'client' && importer && importer.endsWith(APP_DATA_CONDITIONAL)) {
          // since the importer ends with ?app-data=conditional we know that
          // we need to build custom app-data based off of component metadata
          // return the same "id" so that the "load()" method knows to
          // build custom app-data
          return id;
        }
        // for a client build that does not have ?app-data=conditional at the end then we
        // do not want to create custom app-data, but should use the default
      }
      return null;
    },
    load(id) {
      if (id === STENCIL_APP_GLOBALS_ID) {
        const s = new MagicString$3(``);
        appendGlobalScripts(globalScripts, s);
        return s.toString();
      }
      if (id === STENCIL_APP_DATA_ID) {
        // build custom app-data based off of component metadata
        const s = new MagicString$3(``);
        appendNamespace(config, s);
        appendBuildConditionals(config, build, s);
        appendEnv(config, s);
        return s.toString();
      }
      if (id !== config.globalScript) {
        return null;
      }
      const module = compilerCtx.moduleMap.get(config.globalScript);
      if (!module) {
        return null;
      }
      else if (!module.sourceMapFileText) {
        return {
          code: module.staticSourceFileText,
          map: null,
        };
      }
      const sourceMap = JSON.parse(module.sourceMapFileText);
      sourceMap.sources = sourceMap.sources.map((src) => basename(src));
      return { code: module.staticSourceFileText, map: sourceMap };
    },
    transform(code, id) {
      id = normalizePath$2(id);
      if (globalScripts.some((s) => s.path === id)) {
        const program = this.parse(code, {});
        const needsDefault = !program.body.some((s) => s.type === 'ExportDefaultDeclaration');
        const defaultExport = needsDefault ? '\nexport const globalFn = () => {};\nexport default globalFn;' : '';
        code = getContextImport(platform) + code + defaultExport;
        const compilerOptions = { ...config.tsCompilerOptions };
        compilerOptions.module = t.ModuleKind.ESNext;
        const results = t.transpileModule(code, {
          compilerOptions,
          fileName: id,
          transformers: {
            after: [removeCollectionImports(compilerCtx)],
          },
        });
        buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(results.diagnostics));
        if (config.sourceMap) {
          // generate the sourcemap for global script
          const codeMs = new MagicString$3(code);
          const codeMap = codeMs.generateMap({
            source: id,
            // this is the name of the sourcemap, not to be confused with the `file` field in a generated sourcemap
            file: id + '.map',
            includeContent: true,
            hires: true,
          });
          return { code: results.outputText, map: codeMap };
        }
        return { code: results.outputText };
      }
      return null;
    },
  };
};
const getGlobalScriptData = (config, compilerCtx) => {
  const globalScripts = [];
  if (isString$1(config.globalScript)) {
    const mod = compilerCtx.moduleMap.get(config.globalScript);
    const globalScript = compilerCtx.version === 2 ? config.globalScript : mod && mod.jsFilePath;
    if (globalScript) {
      globalScripts.push({
        defaultName: createJsVarName(config.namespace + 'GlobalScript'),
        path: normalizePath$2(globalScript),
      });
    }
  }
  compilerCtx.collections.forEach((collection) => {
    if (collection.global != null && isString$1(collection.global.sourceFilePath)) {
      let defaultName = createJsVarName(collection.collectionName + 'GlobalScript');
      if (globalScripts.some((s) => s.defaultName === defaultName)) {
        defaultName += globalScripts.length;
      }
      globalScripts.push({
        defaultName,
        path: normalizePath$2(collection.global.sourceFilePath),
      });
    }
  });
  return globalScripts;
};
const appendGlobalScripts = (globalScripts, s) => {
  if (globalScripts.length === 1) {
    s.prepend(`import appGlobalScript from '${globalScripts[0].path}';\n`);
    s.append(`export const globalScripts = appGlobalScript;\n`);
  }
  else if (globalScripts.length > 1) {
    globalScripts.forEach((globalScript) => {
      s.prepend(`import ${globalScript.defaultName} from '${globalScript.path}';\n`);
    });
    s.append(`export const globalScripts = () => {\n`);
    globalScripts.forEach((globalScript) => {
      s.append(`  ${globalScript.defaultName}();\n`);
    });
    s.append(`};\n`);
  }
  else {
    s.append(`export const globalScripts = () => {};\n`);
  }
};
const appendBuildConditionals = (config, build, s) => {
  const buildData = Object.keys(build)
    .sort()
    .map((key) => key + ': ' + (build[key] ? 'true' : 'false'))
    .join(', ');
  s.append(`export const BUILD = /* ${config.fsNamespace} */ { ${buildData} };\n`);
};
const appendEnv = (config, s) => {
  s.append(`export const Env = /* ${config.fsNamespace} */ ${JSON.stringify(config.env)};\n`);
};
const appendNamespace = (config, s) => {
  s.append(`export const NAMESPACE = '${config.fsNamespace}';\n`);
};
const getContextImport = (platform) => {
  return `import { Context } from '${platform === 'hydrate' ? STENCIL_INTERNAL_HYDRATE_ID : STENCIL_CORE_ID}';\n`;
};

const coreResolvePlugin = (config, compilerCtx, platform, externalRuntime) => {
  const compilerExe = config.sys.getCompilerExecutingPath();
  const internalClient = getStencilInternalModule(config, compilerExe, 'client/index.js');
  const internalClientPatchBrowser = getStencilInternalModule(config, compilerExe, 'client/patch-browser.js');
  const internalClientPatchEsm = getStencilInternalModule(config, compilerExe, 'client/patch-esm.js');
  const internalHydrate = getStencilInternalModule(config, compilerExe, 'hydrate/index.js');
  return {
    name: 'coreResolvePlugin',
    resolveId(id) {
      if (id === STENCIL_CORE_ID || id === STENCIL_INTERNAL_ID) {
        if (platform === 'client') {
          if (externalRuntime) {
            return {
              id: STENCIL_INTERNAL_CLIENT_ID,
              external: true,
            };
          }
          // adding ?app-data=conditional as an identifier to ensure we don't
          // use the default app-data, but build a custom one based on component meta
          return internalClient + APP_DATA_CONDITIONAL;
        }
        if (platform === 'hydrate') {
          return internalHydrate;
        }
      }
      if (id === STENCIL_INTERNAL_CLIENT_ID) {
        if (externalRuntime) {
          // not bundling the client runtime and the user's component together this
          // must be the custom elements build, where @stencil/core/internal/client
          // is an import, rather than bundling
          return {
            id: STENCIL_INTERNAL_CLIENT_ID,
            external: true,
          };
        }
        // importing @stencil/core/internal/client directly, so it shouldn't get
        // the custom app-data conditionals
        return internalClient;
      }
      if (id === STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID) {
        if (externalRuntime) {
          return {
            id: STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID,
            external: true,
          };
        }
        return internalClientPatchBrowser;
      }
      if (id === STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID) {
        if (externalRuntime) {
          return {
            id: STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID,
            external: true,
          };
        }
        return internalClientPatchEsm;
      }
      if (id === STENCIL_INTERNAL_HYDRATE_ID) {
        return internalHydrate;
      }
      return null;
    },
    async load(filePath) {
      if (filePath && !filePath.startsWith('\0')) {
        filePath = normalizeFsPath(filePath);
        if (filePath === internalClient || filePath === internalHydrate) {
          if (platform === 'worker') {
            return `
export const Build = {
  isDev: ${config.devMode},
  isBrowser: true,
  isServer: false,
  isTesting: false,
};`;
          }
          let code = await compilerCtx.fs.readFile(filePath);
          if (typeof code !== 'string' && isRemoteUrl(compilerExe)) {
            const url = getStencilModuleUrl(compilerExe, filePath);
            code = await fetchModuleAsync(config.sys, compilerCtx.fs, packageVersions, url, filePath);
          }
          if (typeof code === 'string') {
            const hydratedFlag = config.hydratedFlag;
            if (hydratedFlag) {
              const hydratedFlagHead = getHydratedFlagHead(hydratedFlag);
              if (HYDRATED_CSS !== hydratedFlagHead) {
                code = code.replace(HYDRATED_CSS, hydratedFlagHead);
                if (hydratedFlag.name !== 'hydrated') {
                  code = code.replace(`.classList.add("hydrated")`, `.classList.add("${hydratedFlag.name}")`);
                  code = code.replace(`.classList.add('hydrated')`, `.classList.add('${hydratedFlag.name}')`);
                  code = code.replace(`.setAttribute("hydrated",`, `.setAttribute("${hydratedFlag.name}",`);
                  code = code.replace(`.setAttribute('hydrated',`, `.setAttribute('${hydratedFlag.name}',`);
                }
              }
            }
            else {
              code = code.replace(HYDRATED_CSS, '{}');
            }
          }
          return code;
        }
      }
      return null;
    },
    resolveImportMeta(prop, { format }) {
      if (config.extras.dynamicImportShim && prop === 'url' && format === 'es') {
        return '""';
      }
      return null;
    },
  };
};
const getStencilInternalModule = (config, compilerExe, internalModule) => {
  if (isRemoteUrl(compilerExe)) {
    return normalizePath$2(config.sys.getLocalModulePath({
      rootDir: config.rootDir,
      moduleId: '@stencil/core',
      path: 'internal/' + internalModule,
    }));
  }
  const compilerExeDir = dirname(compilerExe);
  return normalizePath$2(join(compilerExeDir, '..', 'internal', internalModule));
};
const getHydratedFlagHead = (h) => {
  // {visibility:hidden}.hydrated{visibility:inherit}
  let initial;
  let hydrated;
  if (!String(h.initialValue) || h.initialValue === '' || h.initialValue == null) {
    initial = '';
  }
  else {
    initial = `{${h.property}:${h.initialValue}}`;
  }
  const selector = h.selector === 'attribute' ? `[${h.name}]` : `.${h.name}`;
  if (!String(h.hydratedValue) || h.hydratedValue === '' || h.hydratedValue == null) {
    hydrated = '';
  }
  else {
    hydrated = `${selector}{${h.property}:${h.hydratedValue}}`;
  }
  return initial + hydrated;
};

const DEV_MODULE_CACHE_BUSTER = 0;
const DEV_MODULE_DIR = `~dev-module`;

const devNodeModuleResolveId = async (config, inMemoryFs, resolvedId, importee) => {
  if (!shouldCheckDevModule(resolvedId, importee)) {
    return resolvedId;
  }
  const resolvedPath = resolvedId.id;
  const pkgPath = getPackageJsonPath(resolvedPath, importee);
  if (!pkgPath) {
    return resolvedId;
  }
  const pkgJsonStr = await inMemoryFs.readFile(pkgPath);
  if (!pkgJsonStr) {
    return resolvedId;
  }
  let pkgJsonData;
  try {
    pkgJsonData = JSON.parse(pkgJsonStr);
  }
  catch (e) { }
  if (!pkgJsonData || !pkgJsonData.version) {
    return resolvedId;
  }
  resolvedId.id = serializeDevNodeModuleUrl(config, pkgJsonData.name, pkgJsonData.version, resolvedPath);
  resolvedId.external = true;
  return resolvedId;
};
const shouldCheckDevModule = (resolvedId, importee) => resolvedId &&
  importee &&
  resolvedId.id &&
  resolvedId.id.includes('node_modules') &&
  (resolvedId.id.endsWith('.js') || resolvedId.id.endsWith('.mjs')) &&
  !resolvedId.external &&
  !importee.startsWith('.') &&
  !importee.startsWith('/');
const getPackageJsonPath = (resolvedPath, importee) => {
  let currentPath = resolvedPath;
  for (let i = 0; i < 10; i++) {
    currentPath = dirname(currentPath);
    const aBasename = basename(currentPath);
    const upDir = dirname(currentPath);
    const bBasename = basename(upDir);
    if (aBasename === importee && bBasename === 'node_modules') {
      return join(currentPath, 'package.json');
    }
  }
  return null;
};
const serializeDevNodeModuleUrl = (config, moduleId, moduleVersion, resolvedPath) => {
  resolvedPath = relative$1(config.rootDir, resolvedPath);
  let id = `/${DEV_MODULE_DIR}/`;
  id += encodeURIComponent(moduleId) + '@';
  id += encodeURIComponent(moduleVersion) + '.js';
  id += '?p=' + encodeURIComponent(resolvedPath);
  return id;
};

const extFormatPlugin = (config) => {
  return {
    name: 'extFormatPlugin',
    transform(code, importPath) {
      if (/\0/.test(importPath)) {
        return null;
      }
      const { ext, filePath, format } = normalizeFsPathQuery(importPath);
      // ?format= param takes precedence before file extension
      switch (format) {
        case 'url':
          return { code: formatUrl(config, this, code, filePath, ext), map: null };
        case 'text':
          return { code: formatText(code, filePath), map: null };
      }
      // didn't provide a ?format= param
      // check if it's a known extension we should format
      if (FORMAT_TEXT_EXTS.includes(ext)) {
        return { code: formatText(code, filePath), map: null };
      }
      if (FORMAT_URL_MIME[ext]) {
        return { code: formatUrl(config, this, code, filePath, ext), map: null };
      }
      return null;
    },
  };
};
const FORMAT_TEXT_EXTS = ['txt', 'frag', 'vert'];
const FORMAT_URL_MIME = {
  svg: 'image/svg+xml',
};
const DATAURL_MAX_IMAGE_SIZE = 4 * 1024; // 4KiB
const formatText = (code, filePath) => {
  const varName = createJsVarName(basename(filePath));
  return `const ${varName} = ${JSON.stringify(code)};export default ${varName};`;
};
const formatUrl = (config, pluginCtx, code, filePath, ext) => {
  const mime = FORMAT_URL_MIME[ext];
  if (!mime) {
    pluginCtx.warn(`Unsupported url format for "${ext}" extension.`);
    return formatText('', filePath);
  }
  const varName = createJsVarName(basename(filePath));
  const base64 = config.sys.encodeToBase64(code);
  if (config.devMode && base64.length > DATAURL_MAX_IMAGE_SIZE) {
    pluginCtx.warn(`Importing large files will bloat your bundle size, please use external assets instead.`);
  }
  return `const ${varName} = 'data:${mime};base64,${base64}';export default ${varName};`;
};

/**
 * Parse CSS imports into an object which contains a manifest of imports and a
 * stylesheet with all imports resolved and concatenated.
 *
 * @param config the current config
 * @param compilerCtx the compiler context (we need filesystem access)
 * @param buildCtx the build context, we'll need access to diagnostics
 * @param srcFilePath the source filepath
 * @param resolvedFilePath the resolved filepath
 * @param styleText style text we start with
 * @param styleDocs optional array of style document objects
 * @returns an object with concatenated styleText and imports
 */
const parseCssImports = async (config, compilerCtx, buildCtx, srcFilePath, resolvedFilePath, styleText, styleDocs) => {
  const isCssEntry = resolvedFilePath.toLowerCase().endsWith('.css');
  const allCssImports = [];
  // a Set of previously-resolved file paths that we add to as we traverse the
  // import tree (to avoid a possible circular dependency and infinite loop)
  const resolvedFilePaths = new Set();
  const concatStyleText = await resolveAndFlattenImports(srcFilePath, resolvedFilePath, styleText);
  return {
    imports: allCssImports,
    styleText: concatStyleText,
  };
  /**
   * Resolve and flatten all imports for a given CSS file, recursively crawling
   * the tree of imports to resolve them all and produce a concatenated
   * stylesheet. We declare this function here, within `parseCssImports`, in order
   * to get access to `compilerCtx`, `buildCtx`, and more without having to pass
   * a whole bunch of arguments.
   *
   * @param srcFilePath the source filepath
   * @param resolvedFilePath the resolved filepath
   * @param styleText style text we start with*
   * @returns concatenated styles assembled from the various imported stylesheets
   */
  async function resolveAndFlattenImports(srcFilePath, resolvedFilePath, styleText) {
    // if we've seen this path before we early return
    if (resolvedFilePaths.has(resolvedFilePath)) {
      return styleText;
    }
    resolvedFilePaths.add(resolvedFilePath);
    if (styleDocs != null) {
      parseStyleDocs(styleDocs, styleText);
    }
    const cssImports = await getCssImports(config, compilerCtx, buildCtx, resolvedFilePath, styleText);
    if (cssImports.length === 0) {
      return styleText;
    }
    // add any newly-found imports to the 'global' list
    for (const cssImport of cssImports) {
      if (!allCssImports.includes(cssImport.filePath)) {
        allCssImports.push(cssImport.filePath);
      }
    }
    // Recur down the tree of CSS imports, resolving all the imports in
    // the children of the current file (and, by extension, in their children
    // and so on)
    await Promise.all(cssImports.map(async (cssImportData) => {
      cssImportData.styleText = await loadStyleText(compilerCtx, cssImportData);
      if (typeof cssImportData.styleText === 'string') {
        cssImportData.styleText = await resolveAndFlattenImports(cssImportData.filePath, cssImportData.filePath, cssImportData.styleText);
      }
      else {
        // we had some error loading the file from disk, so write a diagnostic
        const err = buildError(buildCtx.diagnostics);
        err.messageText = `Unable to read css import: ${cssImportData.srcImport}`;
        err.absFilePath = srcFilePath;
      }
    }));
    // replace import statements with the actual CSS code in children modules
    return replaceImportDeclarations(styleText, cssImports, isCssEntry);
  }
};
/**
 * Load the style text for a CSS file from disk, based on the filepaths set in
 * our import data.
 *
 * @param compilerCtx the compiler context
 * @param cssImportData the import data for the file we want to read
 * @returns the contents of the file, if it can be read without error
 */
const loadStyleText = async (compilerCtx, cssImportData) => {
  let styleText = null;
  try {
    styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
  }
  catch (e) {
    if (cssImportData.altFilePath) {
      try {
        styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
      }
      catch (e) { }
    }
  }
  return styleText;
};
/**
 * Get a manifest of all the CSS imports in a given CSS file
 *
 * @param config the current config
 * @param compilerCtx the compiler context (we need the filesystem)
 * @param buildCtx the build context, in case we need to set a diagnostic
 * @param filePath the filepath we're working with
 * @param styleText the CSS for which we want to retrieve import data
 * @returns a Promise wrapping a list of CSS import data objects
 */
const getCssImports = async (config, compilerCtx, buildCtx, filePath, styleText) => {
  var _a;
  const imports = [];
  if (!styleText.includes('@import')) {
    // no @import at all, so don't bother
    return imports;
  }
  styleText = stripCssComments(styleText);
  const dir = dirname(filePath);
  const importeeExt = ((_a = filePath.split('.').pop()) !== null && _a !== void 0 ? _a : '').toLowerCase();
  let r;
  const IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
  while ((r = IMPORT_RE.exec(styleText))) {
    const cssImportData = {
      srcImport: r[0],
      url: r[4].replace(/[\"\'\)]/g, ''),
      filePath: '',
    };
    if (!isLocalCssImport(cssImportData.srcImport)) {
      // do nothing for @import url(http://external.css)
      config.logger.debug(`did not resolve external css @import: ${cssImportData.srcImport}`);
      continue;
    }
    if (isCssNodeModule(cssImportData.url)) {
      // node resolve this path cuz it starts with ~
      await resolveCssNodeModule(config, compilerCtx, buildCtx.diagnostics, filePath, cssImportData);
    }
    else if (isAbsolute$1(cssImportData.url)) {
      // absolute path already
      cssImportData.filePath = normalizePath$2(cssImportData.url);
    }
    else {
      // relative path
      cssImportData.filePath = normalizePath$2(join(dir, cssImportData.url));
    }
    if (importeeExt !== 'css' && !cssImportData.filePath.toLowerCase().endsWith('.css')) {
      cssImportData.filePath += `.${importeeExt}`;
      if (importeeExt === 'scss') {
        const fileName = '_' + basename(cssImportData.filePath);
        const dirPath = dirname(cssImportData.filePath);
        cssImportData.altFilePath = normalizePath$2(join(dirPath, fileName));
      }
    }
    // we set `filePath` to `""` when the object is created above, so if it
    // hasn't been changed in the intervening conditionals then we didn't resolve
    // a filepath for it.
    if (cssImportData.filePath !== '') {
      imports.push(cssImportData);
    }
  }
  return imports;
};
const isCssNodeModule = (url) => url.startsWith('~');
const resolveCssNodeModule = async (config, compilerCtx, diagnostics, filePath, cssImportData) => {
  try {
    const m = getModuleId(cssImportData.url);
    const resolved = await resolveModuleIdAsync(config.sys, compilerCtx.fs, {
      moduleId: m.moduleId,
      containingFile: filePath,
      exts: [],
      packageFilter: (pkg) => {
        if (m.filePath !== '') {
          pkg.main = m.filePath;
        }
        return pkg;
      },
    });
    cssImportData.filePath = resolved.resolveId;
    cssImportData.updatedImport = `@import "${cssImportData.filePath}";`;
  }
  catch (e) {
    const d = buildError(diagnostics);
    d.messageText = `Unable to resolve node module for CSS @import: ${cssImportData.url}`;
    d.absFilePath = filePath;
  }
};
const isLocalCssImport = (srcImport) => {
  srcImport = srcImport.toLowerCase();
  if (srcImport.includes('url(')) {
    srcImport = srcImport.replace(/\"/g, '');
    srcImport = srcImport.replace(/\'/g, '');
    srcImport = srcImport.replace(/\s/g, '');
    if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
      return false;
    }
  }
  return true;
};
/**
 * Replace import declarations (like '@import "foobar";') with the actual CSS
 * written in the imported module, allowing us to produce a single file from a
 * tree of stylesheets.
 *
 * @param styleText the text within which we want to replace @import statements
 * @param cssImports information about imported modules
 * @param isCssEntry whether we're dealing with a CSS file
 * @returns an updated string with the requisite substitutions
 */
const replaceImportDeclarations = (styleText, cssImports, isCssEntry) => {
  for (const cssImport of cssImports) {
    if (isCssEntry) {
      if (typeof cssImport.styleText === 'string') {
        styleText = styleText.replace(cssImport.srcImport, cssImport.styleText);
      }
    }
    else if (typeof cssImport.updatedImport === 'string') {
      styleText = styleText.replace(cssImport.srcImport, cssImport.updatedImport);
    }
  }
  return styleText;
};

const runPluginResolveId = async (pluginCtx, importee) => {
  for (const plugin of pluginCtx.config.plugins) {
    if (isFunction(plugin.resolveId)) {
      try {
        const results = plugin.resolveId(importee, null, pluginCtx);
        if (results != null) {
          if (isFunction(results.then)) {
            const promiseResults = await results;
            if (promiseResults != null) {
              return promiseResults;
            }
          }
          else if (isString$1(results)) {
            return results;
          }
        }
      }
      catch (e) {
        catchError(pluginCtx.diagnostics, e);
      }
    }
  }
  // default resolvedId
  return importee;
};
const runPluginLoad = async (pluginCtx, id) => {
  for (const plugin of pluginCtx.config.plugins) {
    if (isFunction(plugin.load)) {
      try {
        const results = plugin.load(id, pluginCtx);
        if (results != null) {
          if (isFunction(results.then)) {
            const promiseResults = await results;
            if (promiseResults != null) {
              return promiseResults;
            }
          }
          else if (isString$1(results)) {
            return results;
          }
        }
      }
      catch (e) {
        catchError(pluginCtx.diagnostics, e);
      }
    }
  }
  // default load()
  return pluginCtx.fs.readFile(id);
};
const runPluginTransforms = async (config, compilerCtx, buildCtx, id, cmp) => {
  const pluginCtx = {
    config: config,
    sys: config.sys,
    fs: compilerCtx.fs,
    cache: compilerCtx.cache,
    diagnostics: [],
  };
  const resolvedId = await runPluginResolveId(pluginCtx, id);
  const sourceText = await runPluginLoad(pluginCtx, resolvedId);
  if (!isString$1(sourceText)) {
    const diagnostic = buildError(buildCtx.diagnostics);
    diagnostic.header = `Unable to find "${basename(id)}"`;
    diagnostic.messageText = `The file "${relative$1(config.rootDir, id)}" was unable to load.`;
    return null;
  }
  const transformResults = {
    code: sourceText,
    id: id,
  };
  const isRawCssFile = transformResults.id.toLowerCase().endsWith('.css');
  const shouldParseCssDocs = cmp != null && config.outputTargets.some(isOutputTargetDocs);
  if (isRawCssFile) {
    // concat all css @imports into one file
    // when the entry file is a .css file (not .scss)
    // do this BEFORE transformations on css files
    if (shouldParseCssDocs && cmp != null) {
      cmp.styleDocs = cmp.styleDocs || [];
      const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code, cmp.styleDocs);
      transformResults.code = cssParseResults.styleText;
      transformResults.dependencies = cssParseResults.imports;
    }
    else {
      const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
      transformResults.code = cssParseResults.styleText;
      transformResults.dependencies = cssParseResults.imports;
    }
  }
  for (const plugin of pluginCtx.config.plugins) {
    if (isFunction(plugin.transform)) {
      try {
        let pluginTransformResults;
        const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
        if (results != null) {
          if (isFunction(results.then)) {
            pluginTransformResults = await results;
          }
          else {
            pluginTransformResults = results;
          }
          if (pluginTransformResults != null) {
            if (isString$1(pluginTransformResults)) {
              transformResults.code = pluginTransformResults;
            }
            else {
              if (isString$1(pluginTransformResults.code)) {
                transformResults.code = pluginTransformResults.code;
              }
              if (isString$1(pluginTransformResults.id)) {
                transformResults.id = pluginTransformResults.id;
              }
            }
          }
        }
      }
      catch (e) {
        catchError(buildCtx.diagnostics, e);
      }
    }
  }
  buildCtx.diagnostics.push(...pluginCtx.diagnostics);
  if (!isRawCssFile) {
    // sass precompiler just ran and converted @import "my.css" into @import url("my.css")
    // because of the ".css" extension. Sass did NOT concat the ".css" files into the output
    // but only updated it to use url() instead. Let's go ahead and concat the url() css
    // files into one file like we did for raw .css files.
    // do this AFTER transformations on non-css files
    if (shouldParseCssDocs && cmp != null) {
      cmp.styleDocs = cmp.styleDocs || [];
      const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code, cmp.styleDocs);
      transformResults.code = cssParseResults.styleText;
      transformResults.dependencies = cssParseResults.imports;
    }
    else {
      const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
      transformResults.code = cssParseResults.styleText;
      transformResults.dependencies = cssParseResults.imports;
    }
  }
  return transformResults;
};
const runPluginTransformsEsmImports = async (config, compilerCtx, buildCtx, code, id) => {
  const pluginCtx = {
    config: config,
    sys: config.sys,
    fs: compilerCtx.fs,
    cache: compilerCtx.cache,
    diagnostics: [],
  };
  const transformResults = {
    code,
    id,
    map: null,
    diagnostics: [],
    dependencies: [],
  };
  const isRawCssFile = id.toLowerCase().endsWith('.css');
  if (isRawCssFile) {
    // concat all css @imports into one file
    // when the entry file is a .css file (not .scss)
    // do this BEFORE transformations on css files
    const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
    transformResults.code = cssParseResults.styleText;
    if (Array.isArray(cssParseResults.imports)) {
      transformResults.dependencies.push(...cssParseResults.imports);
    }
  }
  for (const plugin of pluginCtx.config.plugins) {
    if (isFunction(plugin.transform)) {
      try {
        let pluginTransformResults;
        const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
        if (results != null) {
          if (isFunction(results.then)) {
            pluginTransformResults = await results;
          }
          else {
            pluginTransformResults = results;
          }
          if (pluginTransformResults != null) {
            if (isString$1(pluginTransformResults)) {
              transformResults.code = pluginTransformResults;
            }
            else {
              if (isString$1(pluginTransformResults.code)) {
                transformResults.code = pluginTransformResults.code;
              }
              if (isString$1(pluginTransformResults.id)) {
                transformResults.id = pluginTransformResults.id;
              }
              if (Array.isArray(pluginTransformResults.dependencies)) {
                const imports = pluginTransformResults.dependencies.filter((f) => !transformResults.dependencies.includes(f));
                transformResults.dependencies.push(...imports);
              }
            }
          }
        }
      }
      catch (e) {
        catchError(transformResults.diagnostics, e);
      }
    }
  }
  transformResults.diagnostics.push(...pluginCtx.diagnostics);
  if (!isRawCssFile) {
    // precompilers just ran and converted @import "my.css" into @import url("my.css")
    // because of the ".css" extension. Precompilers did NOT concat the ".css" files into
    // the output but only updated it to use url() instead. Let's go ahead and concat
    // the url() css files into one file like we did for raw .css files. Do this
    // AFTER transformations on non-css files
    const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
    transformResults.code = cssParseResults.styleText;
    if (Array.isArray(cssParseResults.imports)) {
      const imports = cssParseResults.imports.filter((f) => !transformResults.dependencies.includes(f));
      transformResults.dependencies.push(...imports);
    }
  }
  return transformResults;
};

/**
 * A Rollup plugin which bundles up some transformation of CSS imports as well
 * as writing some files to disk for the `DIST_COLLECTION` output target.
 *
 * @param config a user-supplied configuration
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param bundleOpts bundle options for Rollup
 * @returns a Rollup plugin which carries out the necessary work
 */
const extTransformsPlugin = (config, compilerCtx, buildCtx, bundleOpts) => {
  return {
    name: 'extTransformsPlugin',
    /**
     * A custom function targeting the `transform` build hook in Rollup. See here for details:
     * https://rollupjs.org/guide/en/#transform
     *
     * Here we are ignoring the first argument (which contains the module's source code) and
     * only looking at the `id` argument. We use that `id` to get information about the module
     * in question from disk ourselves so that we can then do some transformations on it.
     *
     * @param _ an unused parameter (normally the code for a given module)
     * @param id the id of a module
     * @returns metadata for Rollup or null if no transformation should be done
     */
    async transform(_, id) {
      var _a, _b;
      if (/\0/.test(id)) {
        return null;
      }
      // The `id` here was possibly previously updated using
      // `serializeImportPath` to annotate the filepath with various metadata
      // serialized to query-params. If that was done for this particular `id`
      // then the `data` prop will not be null.
      const { data } = parseImportPath(id);
      if (data != null) {
        let cmp = undefined;
        const filePath = normalizeFsPath(id);
        const code = await compilerCtx.fs.readFile(filePath);
        if (typeof code !== 'string') {
          return null;
        }
        const pluginTransforms = await runPluginTransformsEsmImports(config, compilerCtx, buildCtx, code, filePath);
        // We need to check whether the current build is a dev-mode watch build w/ HMR enabled in
        // order to know how we'll want to set `commentOriginalSelector` (below). If we are doing
        // a hydrate build we need to set this to `true` because commenting-out selectors is what
        // gives us support for scoped CSS w/ hydrated components (we don't support shadow DOM and
        // styling via that route for them). However, we don't want to comment selectors in dev
        // mode when using HMR in the browser, since there we _do_ support putting stylesheets into
        // the shadow DOM and commenting out e.g. the `:host` selector in those stylesheets will
        // break components' CSS when an HMR update is sent to the browser.
        //
        // See https://github.com/ionic-team/stencil/issues/3461 for details
        const isDevWatchHMRBuild = config.flags.watch &&
          config.flags.dev &&
          config.flags.serve &&
          ((_b = (_a = config.devServer) === null || _a === void 0 ? void 0 : _a.reloadStrategy) !== null && _b !== void 0 ? _b : null) === 'hmr';
        const commentOriginalSelector = bundleOpts.platform === 'hydrate' && data.encapsulation === 'shadow' && !isDevWatchHMRBuild;
        if (data.tag) {
          cmp = buildCtx.components.find((c) => c.tagName === data.tag);
          const moduleFile = cmp && compilerCtx.moduleMap.get(cmp.sourceFilePath);
          if (moduleFile) {
            const collectionDirs = config.outputTargets.filter(isOutputTargetDistCollection);
            const relPath = relative$1(config.srcDir, pluginTransforms.id);
            // If we found a `moduleFile` in the module map above then we
            // should write the transformed CSS file (found in the return value
            // of `runPluginTransformsEsmImports`, above) to disk.
            await Promise.all(collectionDirs.map(async (outputTarget) => {
              const collectionPath = join(outputTarget.collectionDir, relPath);
              await compilerCtx.fs.writeFile(collectionPath, pluginTransforms.code);
            }));
          }
        }
        const cssTransformResults = await compilerCtx.worker.transformCssToEsm({
          file: pluginTransforms.id,
          input: pluginTransforms.code,
          tag: data.tag,
          encapsulation: data.encapsulation,
          mode: data.mode,
          commentOriginalSelector,
          sourceMap: config.sourceMap,
          minify: config.minifyCss,
          autoprefixer: config.autoprefixCss,
          docs: config.buildDocs,
        });
        // Set style docs
        if (cmp) {
          cmp.styleDocs = cssTransformResults.styleDocs;
        }
        // Track dependencies
        for (const dep of pluginTransforms.dependencies) {
          this.addWatchFile(dep);
          compilerCtx.addWatchFile(dep);
        }
        buildCtx.diagnostics.push(...pluginTransforms.diagnostics);
        buildCtx.diagnostics.push(...cssTransformResults.diagnostics);
        const didError = hasError(cssTransformResults.diagnostics) || hasError(pluginTransforms.diagnostics);
        if (didError) {
          this.error('Plugin CSS transform error');
        }
        const hasUpdatedStyle = buildCtx.stylesUpdated.some((s) => {
          return s.styleTag === data.tag && s.styleMode === data.mode && s.styleText === cssTransformResults.styleText;
        });
        if (!hasUpdatedStyle) {
          buildCtx.stylesUpdated.push({
            styleTag: data.tag,
            styleMode: data.mode,
            styleText: cssTransformResults.styleText,
          });
        }
        return {
          code: cssTransformResults.output,
          map: cssTransformResults.map,
          moduleSideEffects: false,
        };
      }
      return null;
    },
  };
};

const fileLoadPlugin = (fs) => {
  return {
    name: 'fileLoadPlugin',
    load(id) {
      const fsFilePath = normalizeFsPath(id);
      if (id.endsWith('.d.ts')) {
        return '';
      }
      return fs.readFile(fsFilePath);
    },
  };
};

/**
 * Rollup plugin that aids in resolving the entry points (1 or more files) for a Stencil project. For example, a project
 * using the `dist-custom-elements` output target may have a single 'entry point' for each file containing a component.
 * Each of those files will be independently resolved and loaded by this plugin for further processing by Rollup later
 * in the bundling process.
 *
 * @param entries the Stencil project files to process. It should be noted that the keys in this object may not
 * necessarily be an absolute or relative path to a file, but may be a Rollup Virtual Module (which begin with \0).
 * @returns the rollup plugin that loads and process a Stencil project's entry points
 */
const loaderPlugin = (entries = {}) => {
  return {
    name: 'stencilLoaderPlugin',
    /**
     * A rollup build hook for resolving the imports of individual Stencil project files. This hook only resolves
     * modules that are contained in the plugin's `entries` argument. [Source](https://rollupjs.org/guide/en/#resolveid)
     * @param id the importee to resolve
     * @returns a string that resolves an import to some id, null otherwise
     */
    resolveId(id) {
      if (id in entries) {
        return {
          id,
        };
      }
      return null;
    },
    /**
     * A rollup build hook for loading individual Stencil project files [Source](https://rollupjs.org/guide/en/#load)
     * @param id the path of the module to load. It should be noted that the keys in this object may not necessarily
     * be an absolute or relative path to a file, but may be a Rollup Virtual Module.
     * @returns the module matched, null otherwise
     */
    load(id) {
      if (id in entries) {
        return entries[id];
      }
      return null;
    },
  };
};

const pluginHelper = (config, builtCtx, platform) => {
  return {
    name: 'pluginHelper',
    resolveId(importee, importer) {
      if (/\0/.test(importee)) {
        // ignore IDs with null character, these belong to other plugins
        return null;
      }
      if (importee.endsWith('/')) {
        importee = importee.slice(0, -1);
      }
      if (builtIns.has(importee)) {
        let fromMsg = '';
        if (importer) {
          fromMsg = ` from ${relative$1(config.rootDir, importer)}`;
        }
        const diagnostic = buildError(builtCtx.diagnostics);
        diagnostic.header = `Node Polyfills Required`;
        diagnostic.messageText = `For the import "${importee}" to be bundled${fromMsg}, ensure the "rollup-plugin-node-polyfills" plugin is installed and added to the stencil config plugins (${platform}). Please see the bundling docs for more information.
    Further information: https://stenciljs.com/docs/module-bundling`;
      }
      return null;
    },
  };
};
const builtIns = new Set([
  'child_process',
  'cluster',
  'dgram',
  'dns',
  'module',
  'net',
  'readline',
  'repl',
  'tls',
  'assert',
  'console',
  'constants',
  'domain',
  'events',
  'path',
  'punycode',
  'querystring',
  '_stream_duplex',
  '_stream_passthrough',
  '_stream_readable',
  '_stream_writable',
  '_stream_transform',
  'string_decoder',
  'sys',
  'tty',
  'crypto',
  'fs',
  'Buffer',
  'buffer',
  'global',
  'http',
  'https',
  'os',
  'process',
  'stream',
  'timers',
  'url',
  'util',
  'vm',
  'zlib',
]);

const serverPlugin = (config, platform) => {
  const isHydrateBundle = platform === 'hydrate';
  const serverVarid = `@removed-server-code`;
  const isServerOnlyModule = (id) => {
    if (isString$1(id)) {
      id = normalizeFsPath(id);
      return id.includes('.server/') || id.endsWith('.server');
    }
    return false;
  };
  const externals = isHydrateBundle
    ? config.outputTargets.filter(isOutputTargetHydrate).flatMap((o) => o.external)
    : [];
  return {
    name: 'serverPlugin',
    resolveId(id, importer) {
      if (id === serverVarid) {
        return id;
      }
      if (isHydrateBundle) {
        if (externals.includes(id)) {
          // don't attempt to bundle node builtins for the hydrate bundle
          return {
            id,
            external: true,
          };
        }
        if (isServerOnlyModule(importer) && !id.startsWith('.') && !isAbsolute$1(id)) {
          // do not bundle if the importer is a server-only module
          // and the module it is importing is a node module
          return {
            id,
            external: true,
          };
        }
      }
      else {
        if (isServerOnlyModule(id)) {
          // any path that has .server in it shouldn't actually
          // be bundled in the web build, only the hydrate build
          return serverVarid;
        }
      }
      return null;
    },
    load(id) {
      if (id === serverVarid) {
        return {
          code: 'export default {};',
          syntheticNamedExports: true,
        };
      }
      return null;
    },
  };
};

const fetchModuleSync = (sys, inMemoryFs, pkgVersions, url, filePath) => {
  if (skipFilePathFetch(filePath)) {
    return undefined;
  }
  const content = fetchUrlSync(url);
  if (isString$1(content)) {
    writeFetchSuccessSync(sys, inMemoryFs, url, filePath, content, pkgVersions);
  }
  return content;
};
const fetchUrlSync = (url) => {
  if (known404Urls.has(url) || skipUrlFetch(url)) {
    return undefined;
  }
  try {
    const xhr = new XMLHttpRequest();
    xhr.open('GET', url, false);
    xhr.send(null);
    if (xhr.status >= 200 && xhr.status <= 299) {
      return xhr.responseText;
    }
  }
  catch (e) { }
  known404Urls.add(url);
  return undefined;
};

const resolveRemoteModuleIdSync = (config, inMemoryFs, opts) => {
  const packageJson = resolveRemotePackageJsonSync(config, inMemoryFs, opts.moduleId);
  if (packageJson) {
    const resolveModuleSyncOpts = {
      ...opts,
      exts: ['.js', '.mjs'],
    };
    const resolvedUrl = resolveModuleIdSync(config.sys, inMemoryFs, resolveModuleSyncOpts);
    if (typeof resolvedUrl === 'string') {
      return {
        resolvedUrl,
        packageJson,
      };
    }
  }
  return null;
};
const resolveRemotePackageJsonSync = (config, inMemoryFs, moduleId) => {
  if (inMemoryFs) {
    const filePath = normalizePath$2(config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId, path: 'package.json' }));
    let pkgJson = inMemoryFs.readFileSync(filePath);
    if (!isString$1(pkgJson) && IS_WEB_WORKER_ENV) {
      const url = config.sys.getRemoteModuleUrl({ moduleId, path: 'package.json' });
      pkgJson = fetchModuleSync(config.sys, inMemoryFs, packageVersions, url, filePath);
    }
    if (typeof pkgJson === 'string') {
      try {
        return JSON.parse(pkgJson);
      }
      catch (e) { }
    }
  }
  return null;
};
const resolveModuleIdSync = (sys, inMemoryFs, opts) => {
  if (inMemoryFs) {
    const resolverOpts = createCustomResolverSync(sys, inMemoryFs, opts.exts);
    resolverOpts.basedir = dirname(opts.containingFile);
    resolverOpts.packageFilter = opts.packageFilter;
    const resolvedModule = resolve$2.sync(opts.moduleId, resolverOpts);
    return resolvedModule;
  }
  return null;
};
const createCustomResolverSync = (sys, inMemoryFs, exts) => {
  return {
    isFile(filePath) {
      const fsFilePath = normalizeFsPath(filePath);
      const stat = inMemoryFs.statSync(fsFilePath);
      if (stat.isFile) {
        return true;
      }
      if (shouldFetchModule(fsFilePath)) {
        const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
        if (!endsWithExt) {
          return false;
        }
        const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
        const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, fsFilePath);
        return typeof content === 'string';
      }
      return false;
    },
    isDirectory(dirPath) {
      const fsDirPath = normalizeFsPath(dirPath);
      const stat = inMemoryFs.statSync(fsDirPath);
      if (stat.isDirectory) {
        return true;
      }
      if (shouldFetchModule(fsDirPath)) {
        if (basename(fsDirPath) === 'node_modules') {
          // just the /node_modules directory
          inMemoryFs.sys.createDirSync(fsDirPath);
          inMemoryFs.clearFileCache(fsDirPath);
          return true;
        }
        if (isCommonDirModuleFile(fsDirPath)) {
          // don't bother seeing if it's a directory if it has a common file extension
          return false;
        }
        const checkFileExists = (fileName) => {
          const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
          const filePath = getCommonDirName(fsDirPath, fileName);
          const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, filePath);
          return isString$1(content);
        };
        return COMMON_DIR_FILENAMES.some(checkFileExists);
      }
      return false;
    },
    readFileSync(p) {
      const data = inMemoryFs.readFileSync(p);
      if (isString$1(data)) {
        return data;
      }
      throw new Error(`file not found: ${p}`);
    },
    realpathSync(p) {
      const fsFilePath = normalizeFsPath(p);
      try {
        return sys.realpathSync(fsFilePath);
      }
      catch (realpathErr) {
        if (isErrnoException(realpathErr)) {
          if (realpathErr.code !== 'ENOENT') {
            throw realpathErr;
          }
        }
      }
      return fsFilePath;
    },
    extensions: exts,
  };
};
/**
 * Type guard to determine if an Error is an instance of `ErrnoException`. For the purposes of this type guard, we
 * must ensure that the `code` field is present. This type guard was written with the `ErrnoException` definition from
 * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d121716ed123957f6a86f8985eb013fcaddab345/types/node/globals.d.ts#L183-L188
 * in mind.
 * @param err the entity to check the type of
 * @returns true if the provided value is an instance of `ErrnoException`, `false` otherwise
 */
function isErrnoException(err) {
  return err instanceof Error && err.hasOwnProperty('code');
}

const patchTsSystemFileSystem = (config, compilerSys, inMemoryFs, tsSys) => {
  const realpath = (path) => {
    const rp = compilerSys.realpathSync(path);
    if (isString$1(rp)) {
      return rp;
    }
    return path;
  };
  const getAccessibleFileSystemEntries = (path) => {
    try {
      const entries = compilerSys.readDirSync(path || '.').sort();
      const files = [];
      const directories = [];
      for (const absPath of entries) {
        // This is necessary because on some file system node fails to exclude
        // "." and "..". See https://github.com/nodejs/node/issues/4002
        const stat = inMemoryFs.statSync(absPath);
        if (!stat) {
          continue;
        }
        const entry = basename(absPath);
        if (stat.isFile) {
          files.push(entry);
        }
        else if (stat.isDirectory) {
          directories.push(entry);
        }
      }
      return { files, directories };
    }
    catch (e) {
      return { files: [], directories: [] };
    }
  };
  tsSys.createDirectory = (p) => {
    compilerSys.createDirSync(p, { recursive: true });
  };
  tsSys.directoryExists = (p) => {
    const s = inMemoryFs.statSync(p);
    return s.isDirectory;
  };
  tsSys.exit = compilerSys.exit;
  tsSys.fileExists = (p) => {
    let filePath = p;
    if (isRemoteUrl(p)) {
      filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
    }
    const s = inMemoryFs.statSync(filePath);
    return !!(s && s.isFile);
  };
  tsSys.getCurrentDirectory = compilerSys.getCurrentDirectory;
  tsSys.getExecutingFilePath = compilerSys.getCompilerExecutingPath;
  tsSys.getDirectories = (p) => {
    const items = compilerSys.readDirSync(p);
    return items.filter((itemPath) => {
      const s = inMemoryFs.statSync(itemPath);
      return !!(s && s.exists && s.isDirectory);
    });
  };
  tsSys.readDirectory = (path, extensions, exclude, include, depth) => {
    const cwd = compilerSys.getCurrentDirectory();
    // TODO(STENCIL-344): Replace `matchFiles` with a function that is publicly exposed
    return t.matchFiles(path, extensions, exclude, include, IS_CASE_SENSITIVE_FILE_NAMES, cwd, depth, getAccessibleFileSystemEntries, realpath);
  };
  tsSys.readFile = (p) => {
    let filePath = p;
    const isUrl = isRemoteUrl(p);
    if (isUrl) {
      filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
    }
    let content = inMemoryFs.readFileSync(filePath, { useCache: isUrl });
    if (typeof content !== 'string' && isUrl) {
      if (IS_WEB_WORKER_ENV) {
        content = fetchUrlSync(p);
        if (typeof content === 'string') {
          inMemoryFs.writeFile(filePath, content);
        }
      }
      else {
        config.logger.error(`ts.sys can only request http resources from within a web worker: ${p}`);
      }
    }
    return content;
  };
  tsSys.writeFile = (p, data) => inMemoryFs.writeFile(p, data);
  return tsSys;
};
const patchTsSystemWatch = (compilerSystem, tsSys) => {
  tsSys.watchDirectory = (p, cb, recursive) => {
    const watcher = compilerSystem.watchDirectory(p, (filePath) => {
      cb(filePath);
    }, recursive);
    return {
      close() {
        watcher.close();
      },
    };
  };
  tsSys.watchFile = (p, cb) => {
    const watcher = compilerSystem.watchFile(p, (filePath, eventKind) => {
      if (eventKind === 'fileAdd') {
        cb(filePath, t.FileWatcherEventKind.Created);
      }
      else if (eventKind === 'fileUpdate') {
        cb(filePath, t.FileWatcherEventKind.Changed);
      }
      else if (eventKind === 'fileDelete') {
        cb(filePath, t.FileWatcherEventKind.Deleted);
      }
    });
    return {
      close() {
        watcher.close();
      },
    };
  };
};
const patchTypescript = (config, inMemoryFs) => {
  if (!t.__patched) {
    if (config.sys) {
      patchTsSystemFileSystem(config, config.sys, inMemoryFs, t.sys);
      patchTsSystemWatch(config.sys, t.sys);
    }
    patchTypeScriptResolveModule(config, inMemoryFs);
    patchTypeScriptGetParsedCommandLineOfConfigFile();
    t.__patched = true;
  }
};
const patchTypeScriptSysMinimum = () => {
  if (!t.sys) {
    // patches just the bare minimum
    // if ts.sys already exists then it must be node ts.sys
    // otherwise we're browser
    // will be updated later on with the stencil sys
    t.sys = {
      args: [],
      createDirectory: noop$1,
      directoryExists: () => false,
      exit: noop$1,
      fileExists: () => false,
      getCurrentDirectory,
      getDirectories: () => [],
      getExecutingFilePath: () => './',
      readDirectory: () => [],
      readFile: noop$1,
      newLine: '\n',
      resolvePath: resolve$3,
      useCaseSensitiveFileNames: false,
      write: noop$1,
      writeFile: noop$1,
    };
  }
};
patchTypeScriptSysMinimum();
const getTypescriptPathFromUrl = (config, tsExecutingUrl, url) => {
  const tsBaseUrl = new URL('..', tsExecutingUrl).href;
  if (url.startsWith(tsBaseUrl)) {
    const tsFilePath = url.replace(tsBaseUrl, '/');
    const tsNodePath = config.sys.getLocalModulePath({
      rootDir: config.rootDir,
      moduleId: '@stencil/core',
      path: tsFilePath,
    });
    return normalizePath$2(tsNodePath);
  }
  return url;
};
const patchTypeScriptGetParsedCommandLineOfConfigFile = () => {
  const orgGetParsedCommandLineOfConfigFile = t.getParsedCommandLineOfConfigFile;
  t.getParsedCommandLineOfConfigFile = (configFileName, optionsToExtend, host, extendedConfigCache) => {
    const results = orgGetParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache);
    // manually filter out any .spec or .e2e files
    results.fileNames = results.fileNames.filter((f) => {
      // filter e2e tests
      if (f.includes('.e2e.') || f.includes('/e2e.')) {
        return false;
      }
      // filter spec tests
      if (f.includes('.spec.') || f.includes('/spec.')) {
        return false;
      }
      return true;
    });
    return results;
  };
};

const patchTypeScriptResolveModule = (config, inMemoryFs) => {
  let compilerExe;
  if (config.sys) {
    compilerExe = config.sys.getCompilerExecutingPath();
  }
  else if (IS_BROWSER_ENV) {
    compilerExe = location.href;
  }
  if (shouldPatchRemoteTypeScript(compilerExe)) {
    const resolveModuleName = (t.__resolveModuleName = t.resolveModuleName);
    t.resolveModuleName = (moduleName, containingFile, compilerOptions, host, cache, redirectedReference) => {
      const resolvedModule = patchedTsResolveModule(config, inMemoryFs, moduleName, containingFile);
      if (resolvedModule) {
        return resolvedModule;
      }
      return resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
    };
  }
};
const tsResolveModuleName = (config, compilerCtx, moduleName, containingFile) => {
  const resolveModuleName = t.__resolveModuleName || t.resolveModuleName;
  if (moduleName && resolveModuleName && config.tsCompilerOptions) {
    const host = patchTsSystemFileSystem(config, config.sys, compilerCtx.fs, t.sys);
    const compilerOptions = { ...config.tsCompilerOptions };
    compilerOptions.resolveJsonModule = true;
    return resolveModuleName(moduleName, containingFile, compilerOptions, host);
  }
  return null;
};
const tsResolveModuleNamePackageJsonPath = (config, compilerCtx, moduleName, containingFile) => {
  try {
    const resolvedModule = tsResolveModuleName(config, compilerCtx, moduleName, containingFile);
    if (resolvedModule && resolvedModule.resolvedModule && resolvedModule.resolvedModule.resolvedFileName) {
      const rootDir = resolve$3('/');
      let resolvedFileName = resolvedModule.resolvedModule.resolvedFileName;
      for (let i = 0; i < 30; i++) {
        if (rootDir === resolvedFileName) {
          return null;
        }
        resolvedFileName = dirname(resolvedFileName);
        const pkgJsonPath = join(resolvedFileName, 'package.json');
        const exists = config.sys.accessSync(pkgJsonPath);
        if (exists) {
          return normalizePath$2(pkgJsonPath);
        }
      }
    }
  }
  catch (e) {
    config.logger.error(e);
  }
  return null;
};
const patchedTsResolveModule = (config, inMemoryFs, moduleName, containingFile) => {
  if (isLocalModule(moduleName)) {
    const containingDir = dirname(containingFile);
    let resolvedFileName = join(containingDir, moduleName);
    resolvedFileName = normalizePath$2(ensureExtension(resolvedFileName, containingFile));
    if (isAbsolute$1(resolvedFileName) && !inMemoryFs.accessSync(resolvedFileName)) {
      return null;
    }
    if (!isAbsolute$1(resolvedFileName) && !resolvedFileName.startsWith('.') && !resolvedFileName.startsWith('/')) {
      resolvedFileName = './' + resolvedFileName;
    }
    const rtn = {
      resolvedModule: {
        extension: getTsResolveExtension(resolvedFileName),
        resolvedFileName,
        packageId: {
          name: moduleName,
          subModuleName: '',
          version: version$3,
        },
      },
    };
    rtn.failedLookupLocations = [];
    return rtn;
  }
  // node module id
  return tsResolveNodeModule(config, inMemoryFs, moduleName, containingFile);
};
const tsResolveNodeModule = (config, inMemoryFs, moduleId, containingFile) => {
  if (isStencilCoreImport(moduleId)) {
    const rtn = {
      resolvedModule: {
        extension: t.Extension.Dts,
        resolvedFileName: normalizePath$2(config.sys.getLocalModulePath({
          rootDir: config.rootDir,
          moduleId: '@stencil/core',
          path: 'internal/index.d.ts',
        })),
        packageId: {
          name: moduleId,
          subModuleName: '',
          version: version$3,
        },
      },
    };
    rtn.failedLookupLocations = [];
    return rtn;
  }
  const resolved = resolveRemoteModuleIdSync(config, inMemoryFs, {
    moduleId,
    containingFile,
  });
  if (resolved) {
    const rtn = {
      resolvedModule: {
        extension: t.Extension.Js,
        resolvedFileName: resolved.resolvedUrl,
        packageId: {
          name: moduleId,
          subModuleName: '',
          version: resolved.packageJson.version,
        },
      },
    };
    rtn.failedLookupLocations = [];
    return rtn;
  }
  return null;
};
const ensureExtension = (fileName, containingFile) => {
  if (!basename(fileName).includes('.') && isString$1(containingFile)) {
    containingFile = containingFile.toLowerCase();
    if (isJsFile(containingFile)) {
      fileName += '.js';
    }
    else if (isDtsFile(containingFile)) {
      fileName += '.d.ts';
    }
    else if (isTsxFile(containingFile)) {
      fileName += '.tsx';
    }
    else if (isTsFile(containingFile)) {
      fileName += '.ts';
    }
    else if (isJsxFile(containingFile)) {
      fileName += '.jsx';
    }
  }
  return fileName;
};
const getTsResolveExtension = (p) => {
  if (isDtsFile(p)) {
    return t.Extension.Dts;
  }
  if (isTsxFile(p)) {
    return t.Extension.Tsx;
  }
  if (isJsFile(p)) {
    return t.Extension.Js;
  }
  if (isJsxFile(p)) {
    return t.Extension.Jsx;
  }
  if (isJsonFile(p)) {
    return t.Extension.Json;
  }
  return t.Extension.Ts;
};
const shouldPatchRemoteTypeScript = (compilerExe) => !IS_NODE_ENV && isRemoteUrl(compilerExe);

const getModule = (compilerCtx, filePath) => compilerCtx.moduleMap.get(normalizePath$2(filePath));
const createModule = (staticSourceFile, // this is NOT the original
staticSourceFileText, emitFilepath) => ({
  sourceFilePath: normalizePath$2(staticSourceFile.fileName),
  jsFilePath: emitFilepath,
  staticSourceFile,
  staticSourceFileText,
  cmps: [],
  coreRuntimeApis: [],
  collectionName: null,
  dtsFilePath: null,
  excludeFromCollection: false,
  externalImports: [],
  hasVdomAttribute: false,
  hasVdomClass: false,
  hasVdomFunctional: false,
  hasVdomKey: false,
  hasVdomListener: false,
  hasVdomPropOrAttr: false,
  hasVdomRef: false,
  hasVdomRender: false,
  hasVdomStyle: false,
  hasVdomText: false,
  hasVdomXlink: false,
  htmlAttrNames: [],
  htmlParts: [],
  htmlTagNames: [],
  isCollectionDependency: false,
  isLegacy: false,
  localImports: [],
  originalCollectionComponentPath: null,
  originalImports: [],
  potentialCmpRefs: [],
  sourceMapPath: null,
  sourceMapFileText: null,
});

/**
 * Rollup plugin that aids in resolving the TypeScript files and performing the transpilation step.
 * @param compilerCtx the current compiler context
 * @param bundleOpts Rollup bundling options to apply during TypeScript compilation
 * @param config the Stencil configuration for the project
 * @returns the rollup plugin for handling TypeScript files.
 */
const typescriptPlugin = (compilerCtx, bundleOpts, config) => {
  return {
    name: `${bundleOpts.id}TypescriptPlugin`,
    /**
     * A rollup build hook for loading TypeScript files and their associated source maps (if they exist).
     * [Source](https://rollupjs.org/guide/en/#load)
     * @param id the path of the file to load
     * @returns the module matched (with its sourcemap if it exists), null otherwise
     */
    load(id) {
      if (isAbsolute$1(id)) {
        const fsFilePath = normalizeFsPath(id);
        const module = getModule(compilerCtx, fsFilePath);
        if (module) {
          if (!module.sourceMapFileText) {
            return { code: module.staticSourceFileText, map: null };
          }
          const sourceMap = JSON.parse(module.sourceMapFileText);
          sourceMap.sources = sourceMap.sources.map((src) => basename(src));
          return { code: module.staticSourceFileText, map: sourceMap };
        }
      }
      return null;
    },
    /**
     * Performs TypeScript compilation/transpilation, including applying any transformations against the Abstract Syntax
     * Tree (AST) specific to stencil
     * @param _code the code to modify, unused
     * @param id module's identifier
     * @returns the transpiled code, with its associated sourcemap. null otherwise
     */
    transform(_code, id) {
      if (isAbsolute$1(id)) {
        const fsFilePath = normalizeFsPath(id);
        const mod = getModule(compilerCtx, fsFilePath);
        if (mod && mod.cmps.length > 0) {
          const tsResult = t.transpileModule(mod.staticSourceFileText, {
            compilerOptions: config.tsCompilerOptions,
            fileName: mod.sourceFilePath,
            transformers: { before: bundleOpts.customTransformers },
          });
          const sourceMap = tsResult.sourceMapText ? JSON.parse(tsResult.sourceMapText) : null;
          return { code: tsResult.outputText, map: sourceMap };
        }
      }
      return null;
    },
  };
};
const resolveIdWithTypeScript = (config, compilerCtx) => {
  return {
    name: `resolveIdWithTypeScript`,
    async resolveId(importee, importer) {
      if (/\0/.test(importee) || !isString$1(importer)) {
        return null;
      }
      const tsResolved = tsResolveModuleName(config, compilerCtx, importee, importer);
      if (tsResolved && tsResolved.resolvedModule) {
        // this is probably a .d.ts file for whatever reason in how TS resolves this
        // use this resolved file as the "importer"
        const tsResolvedPath = tsResolved.resolvedModule.resolvedFileName;
        if (isString$1(tsResolvedPath) && !tsResolvedPath.endsWith('.d.ts')) {
          return tsResolvedPath;
        }
      }
      return null;
    },
  };
};

const userIndexPlugin = (config, compilerCtx) => {
  return {
    name: 'userIndexPlugin',
    async resolveId(importee) {
      if (importee === USER_INDEX_ENTRY_ID) {
        const usersIndexJsPath = join(config.srcDir, 'index.ts');
        const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
        if (hasUserIndex) {
          return usersIndexJsPath;
        }
        return importee;
      }
      return null;
    },
    async load(id) {
      if (id === USER_INDEX_ENTRY_ID) {
        return `//! Autogenerated index`;
      }
      return null;
    },
  };
};

const workerPlugin = (config, compilerCtx, buildCtx, platform, inlineWorkers) => {
  if (platform === 'worker' || platform === 'hydrate') {
    return {
      name: 'workerPlugin',
      transform(_, id) {
        if (id.endsWith('?worker') || id.endsWith('?worker-inline')) {
          return getMockedWorkerMain();
        }
        return null;
      },
    };
  }
  const workersMap = new Map();
  return {
    name: 'workerPlugin',
    buildStart() {
      workersMap.clear();
    },
    resolveId(id) {
      if (id === WORKER_HELPER_ID) {
        return {
          id,
          moduleSideEffects: false,
        };
      }
      return null;
    },
    load(id) {
      if (id === WORKER_HELPER_ID) {
        return WORKER_HELPERS;
      }
      return null;
    },
    async transform(_, id) {
      if (/\0/.test(id)) {
        return null;
      }
      // Canonical worker path
      if (id.endsWith('?worker')) {
        const workerEntryPath = normalizeFsPath(id);
        const workerName = getWorkerName(workerEntryPath);
        const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
        const referenceId = this.emitFile({
          type: 'asset',
          source: code,
          name: workerName + '.js',
        });
        dependencies.forEach((id) => this.addWatchFile(id));
        return {
          code: getWorkerMain(referenceId, workerName, workerMsgId),
          moduleSideEffects: false,
        };
      }
      else if (id.endsWith('?worker-inline')) {
        const workerEntryPath = normalizeFsPath(id);
        const workerName = getWorkerName(workerEntryPath);
        const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
        const referenceId = this.emitFile({
          type: 'asset',
          source: code,
          name: workerName + '.js',
        });
        dependencies.forEach((id) => this.addWatchFile(id));
        return {
          code: getInlineWorker(referenceId, workerName, workerMsgId),
          moduleSideEffects: false,
        };
      }
      // Proxy worker path
      const workerEntryPath = getWorkerEntryPath(id);
      if (workerEntryPath != null) {
        const worker = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
        if (worker) {
          if (inlineWorkers) {
            return {
              code: getInlineWorkerProxy(workerEntryPath, worker.workerMsgId, worker.exports),
              moduleSideEffects: false,
            };
          }
          else {
            return {
              code: getWorkerProxy(workerEntryPath, worker.exports),
              moduleSideEffects: false,
            };
          }
        }
      }
      return null;
    },
  };
};
const getWorkerEntryPath = (id) => {
  if (WORKER_SUFFIX.some((p) => id.endsWith(p))) {
    return normalizeFsPath(id);
  }
  return null;
};
const getWorker = async (config, compilerCtx, buildCtx, ctx, workersMap, workerEntryPath) => {
  let worker = workersMap.get(workerEntryPath);
  if (!worker) {
    worker = await buildWorker(config, compilerCtx, buildCtx, ctx, workerEntryPath);
    workersMap.set(workerEntryPath, worker);
  }
  return worker;
};
const getWorkerName = (id) => {
  const parts = id.split('/').filter((i) => !i.includes('index'));
  id = parts[parts.length - 1];
  return id.replace('.tsx', '').replace('.ts', '');
};
const buildWorker = async (config, compilerCtx, buildCtx, ctx, workerEntryPath) => {
  const workerName = getWorkerName(workerEntryPath);
  const workerMsgId = `stencil.${workerName}`;
  const build = await bundleOutput(config, compilerCtx, buildCtx, {
    platform: 'worker',
    id: workerName,
    inputs: {
      [workerName]: workerEntryPath,
    },
    inlineDynamicImports: true,
  });
  if (build) {
    // Generate commonjs output so we can intercept exports at runtime
    const output = await build.generate({
      format: 'commonjs',
      banner: `${generatePreamble(config)}\n(()=>{\n`,
      footer: '})();',
      intro: getWorkerIntro(workerMsgId, config.devMode),
      esModule: false,
      preferConst: true,
      externalLiveBindings: false,
    });
    const entryPoint = output.output[0];
    if (entryPoint.imports.length > 0) {
      ctx.error('Workers should not have any external imports: ' + JSON.stringify(entryPoint.imports));
    }
    // Optimize code
    let code = entryPoint.code;
    const results = await optimizeModule(config, compilerCtx, {
      input: code,
      sourceTarget: config.buildEs5 ? 'es5' : 'es2017',
      isCore: false,
      minify: config.minifyJs,
      inlineHelpers: true,
    });
    buildCtx.diagnostics.push(...results.diagnostics);
    if (!hasError(results.diagnostics)) {
      code = results.output;
    }
    return {
      code,
      exports: entryPoint.exports,
      workerMsgId,
      dependencies: Object.keys(entryPoint.modules).filter((id) => !/\0/.test(id) && id !== workerEntryPath),
    };
  }
  return null;
};
const WORKER_SUFFIX = ['.worker.ts', '.worker.tsx', '.worker/index.ts', '.worker/index.tsx'];
const WORKER_HELPER_ID = '@worker-helper';
const GET_TRANSFERABLES = `
const isInstanceOf = (value, className) => {
  const C = globalThis[className];
  return C != null && value instanceof C;
}
const getTransferables = (value) => {
  if (value != null) {
  if (
    isInstanceOf(value, "ArrayBuffer") ||
    isInstanceOf(value, "MessagePort") ||
    isInstanceOf(value, "ImageBitmap") ||
    isInstanceOf(value, "OffscreenCanvas")
  ) {
    return [value];
  }
  if (typeof value === "object") {
    if (value.constructor === Object) {
    value = Object.values(value);
    }
    if (Array.isArray(value)) {
    return value.flatMap(getTransferables);
    }
    return getTransferables(value.buffer);
  }
  }
  return [];
};`;
const getWorkerIntro = (workerMsgId, isDev) => `
${GET_TRANSFERABLES}
const exports = {};
const workerMsgId = '${workerMsgId}';
const workerMsgCallbackId = workerMsgId + '.cb';
addEventListener('message', async ({data}) => {
  if (data && data[0] === workerMsgId) {
  let id = data[1];
  let method = data[2];
  let args = data[3];
  let i = 0;
  let argsLen = args.length;
  let value;
  let err;

  try {
    for (; i < argsLen; i++) {
    if (Array.isArray(args[i]) && args[i][0] === workerMsgCallbackId) {
      const callbackId = args[i][1];
      args[i] = (...cbArgs) => {
      postMessage(
        [workerMsgCallbackId, callbackId, cbArgs]
      );
      };
    }
    }
    ${isDev
  ? `
    value = exports[method](...args);
    if (!value || !value.then) {
    throw new Error('The exported method "' + method + '" does not return a Promise, make sure it is an "async" function');
    }
    value = await value;
    `
  : `
    value = await exports[method](...args);`}

  } catch (e) {
    value = null;
    if (e instanceof Error) {
    err = {
      isError: true,
      value: {
      message: e.message,
      name: e.name,
      stack: e.stack,
      }
    };
    } else {
    err = {
      isError: false,
      value: e
    };
    }
    value = undefined;
  }

  const transferables = getTransferables(value);
  ${isDev ? `if (transferables.length > 0) console.debug('Transfering', transferables);` : ''}

  postMessage(
    [workerMsgId, id, value, err],
    transferables
  );
  }
});
`;
const WORKER_HELPERS = `
import { consoleError } from '${STENCIL_INTERNAL_ID}';

${GET_TRANSFERABLES}

let pendingIds = 0;
let callbackIds = 0;
const pending = new Map();
const callbacks = new Map();

export const createWorker = (workerPath, workerName, workerMsgId) => {
  const worker = new Worker(workerPath, {name:workerName});

  worker.addEventListener('message', ({data}) => {
  if (data) {
    const workerMsg = data[0];
    const id = data[1];
    const value = data[2];

    if (workerMsg === workerMsgId) {
    const err = data[3];
    const [resolve, reject, callbackIds] = pending.get(id);
    pending.delete(id);

    if (err) {
      const errObj = (err.isError)
      ? Object.assign(new Error(err.value.message), err.value)
      : err.value;

      consoleError(errObj);
      reject(errObj);
    } else {
      if (callbackIds) {
      callbackIds.forEach(id => callbacks.delete(id));
      }
      resolve(value);
    }
    } else if (workerMsg === workerMsgId + '.cb') {
    try {
      callbacks.get(id)(...value);
    } catch (e) {
      consoleError(e);
    }
    }
  }
  });

  return worker;
};

export const createWorkerProxy = (worker, workerMsgId, exportedMethod) => (
  (...args) => new Promise((resolve, reject) => {
  let pendingId = pendingIds++;
  let i = 0;
  let argLen = args.length;
  let mainData = [resolve, reject];
  pending.set(pendingId, mainData);

  for (; i < argLen; i++) {
    if (typeof args[i] === 'function') {
    const callbackId = callbackIds++;
    callbacks.set(callbackId, args[i]);
    args[i] = [workerMsgId + '.cb', callbackId];
    (mainData[2] = mainData[2] || []).push(callbackId);
    }
  }
  const postMessage = (w) => (
    w.postMessage(
    [workerMsgId, pendingId, exportedMethod, args],
    getTransferables(args)
    )
  );
  if (worker.then) {
    worker.then(postMessage);
  } else {
    postMessage(worker);
  }
  })
);
`;
const getWorkerMain = (referenceId, workerName, workerMsgId) => {
  return `
import { createWorker } from '${WORKER_HELPER_ID}';
export const workerName = '${workerName}';
export const workerMsgId = '${workerMsgId}';
export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
export const worker = /*@__PURE__*/createWorker(workerPath, workerName, workerMsgId);
`;
};
const getInlineWorker = (referenceId, workerName, workerMsgId) => {
  return `
import { createWorker } from '${WORKER_HELPER_ID}';
export const workerName = '${workerName}';
export const workerMsgId = '${workerMsgId}';
export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
const url = URL.createObjectURL(blob);
export const worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
URL.revokeObjectURL(url);
`;
};
const getMockedWorkerMain = () => {
  // for the hydrate build the workers won't actually work
  // however, we still need to make the {worker} export
  // kick-in otherwise bundling chokes
  return `
export const workerName = 'mocked-worker';
export const workerMsgId = workerName;
export const workerPath = workerName;
export const worker = { name: workerName };
`;
};
const getWorkerProxy = (workerEntryPath, exportedMethods) => {
  return `
import { createWorkerProxy } from '${WORKER_HELPER_ID}';
import { worker, workerName, workerMsgId } from '${workerEntryPath}?worker';
${exportedMethods
    .map((exportedMethod) => {
    return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(worker, workerMsgId, '${exportedMethod}');`;
  })
    .join('\n')}
`;
};
const getInlineWorkerProxy = (workerEntryPath, workerMsgId, exportedMethods) => {
  return `
import { createWorkerProxy } from '${WORKER_HELPER_ID}';
const workerPromise = import('${workerEntryPath}?worker-inline').then(m => m.worker);
${exportedMethods
    .map((exportedMethod) => {
    return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(workerPromise, '${workerMsgId}', '${exportedMethod}');`;
  })
    .join('\n')}
`;
};

const bundleOutput = async (config, compilerCtx, buildCtx, bundleOpts) => {
  try {
    const rollupOptions = getRollupOptions(config, compilerCtx, buildCtx, bundleOpts);
    const rollupBuild = await rollup(rollupOptions);
    compilerCtx.rollupCache.set(bundleOpts.id, rollupBuild.cache);
    return rollupBuild;
  }
  catch (e) {
    if (!buildCtx.hasError) {
      // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
      // breakable) and type safety (so that the error variable may be something other than `any`)
      loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
    }
  }
  return undefined;
};
/**
 * Build the rollup options that will be used to transpile, minify, and otherwise transform a Stencil project
 * @param config the Stencil configuration for the project
 * @param compilerCtx the current compiler context
 * @param buildCtx a context object containing information about the current build
 * @param bundleOpts Rollup bundling options to apply to the base configuration setup by this function
 * @returns the rollup options to be used
 */
const getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
  var _a;
  const customResolveOptions = createCustomResolverAsync(config.sys, compilerCtx.fs, [
    '.tsx',
    '.ts',
    '.js',
    '.mjs',
    '.json',
    '.d.ts',
  ]);
  const nodeResolvePlugin = nodeResolve({
    mainFields: ['collection:main', 'jsnext:main', 'es2017', 'es2015', 'module', 'main'],
    customResolveOptions,
    browser: true,
    rootDir: config.rootDir,
    ...config.nodeResolve,
  });
  const orgNodeResolveId = nodeResolvePlugin.resolveId;
  const orgNodeResolveId2 = (nodeResolvePlugin.resolveId = async function (importee, importer) {
    const [realImportee, query] = importee.split('?');
    const resolved = await orgNodeResolveId.call(nodeResolvePlugin, realImportee, importer);
    if (resolved) {
      if (isString$1(resolved)) {
        return query ? resolved + '?' + query : resolved;
      }
      return {
        ...resolved,
        id: query ? resolved.id + '?' + query : resolved.id,
      };
    }
    return resolved;
  });
  if (config.devServer && config.devServer.experimentalDevModules) {
    nodeResolvePlugin.resolveId = async function (importee, importer) {
      const resolvedId = await orgNodeResolveId2.call(nodeResolvePlugin, importee, importer);
      return devNodeModuleResolveId(config, compilerCtx.fs, resolvedId, importee);
    };
  }
  const beforePlugins = config.rollupPlugins.before || [];
  const afterPlugins = config.rollupPlugins.after || [];
  const rollupOptions = {
    input: bundleOpts.inputs,
    plugins: [
      coreResolvePlugin(config, compilerCtx, bundleOpts.platform, bundleOpts.externalRuntime),
      appDataPlugin(config, compilerCtx, buildCtx, bundleOpts.conditionals, bundleOpts.platform),
      lazyComponentPlugin(buildCtx),
      loaderPlugin(bundleOpts.loader),
      userIndexPlugin(config, compilerCtx),
      typescriptPlugin(compilerCtx, bundleOpts, config),
      extFormatPlugin(config),
      extTransformsPlugin(config, compilerCtx, buildCtx, bundleOpts),
      workerPlugin(config, compilerCtx, buildCtx, bundleOpts.platform, !!bundleOpts.inlineWorkers),
      serverPlugin(config, bundleOpts.platform),
      ...beforePlugins,
      nodeResolvePlugin,
      resolveIdWithTypeScript(config, compilerCtx),
      commonjs({
        include: /node_modules/,
        sourceMap: config.sourceMap,
        transformMixedEsModules: false,
        ...config.commonjs,
      }),
      ...afterPlugins,
      pluginHelper(config, buildCtx, bundleOpts.platform),
      json({
        preferConst: true,
      }),
      replace({
        'process.env.NODE_ENV': config.devMode ? '"development"' : '"production"',
      }),
      fileLoadPlugin(compilerCtx.fs),
    ],
    treeshake: getTreeshakeOption(config, bundleOpts),
    inlineDynamicImports: bundleOpts.inlineDynamicImports,
    preserveEntrySignatures: (_a = bundleOpts.preserveEntrySignatures) !== null && _a !== void 0 ? _a : 'strict',
    onwarn: createOnWarnFn(buildCtx.diagnostics),
    cache: compilerCtx.rollupCache.get(bundleOpts.id),
  };
  return rollupOptions;
};
const getTreeshakeOption = (config, bundleOpts) => {
  if (bundleOpts.platform === 'hydrate') {
    return {
      propertyReadSideEffects: false,
      tryCatchDeoptimization: false,
    };
  }
  const treeshake = !config.devMode && config.rollupConfig.inputOptions.treeshake !== false
    ? {
      propertyReadSideEffects: false,
      tryCatchDeoptimization: false,
    }
    : false;
  return treeshake;
};

/**
 * Import and define components along with any component dependents within the `dist-custom-elements` output.
 * Adds `defineCustomElement()` function for all components.
 * @param compilerCtx - current compiler context
 * @param components - all current components within the stencil buildCtx
 * @param outputTarget - the output target being compiled
 * @returns a TS AST transformer factory function
 */
const addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) => {
  return () => {
    return (tsSourceFile) => {
      const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
      const newStatements = [];
      const caseStatements = [];
      const tagNames = [];
      if (moduleFile.cmps.length) {
        const principalComponent = moduleFile.cmps[0];
        tagNames.push(principalComponent.tagName);
        // define the current component - `customElements.define(tagName, MyProxiedComponent);`
        const customElementsDefineCallExpression = t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'define'), undefined, [t.factory.createIdentifier('tagName'), t.factory.createIdentifier(principalComponent.componentClassName)]);
        // create a `case` block that defines the current component. We'll add them to our switch statement later.
        caseStatements.push(createCustomElementsDefineCase(principalComponent.tagName, customElementsDefineCallExpression));
        setupComponentDependencies(moduleFile, components, newStatements, caseStatements, tagNames);
        addDefineCustomElementFunction(tagNames, newStatements, caseStatements);
        if (outputTarget.autoDefineCustomElements) {
          const conditionalDefineCustomElementCall = createAutoDefinitionExpression(principalComponent.componentClassName);
          newStatements.push(conditionalDefineCustomElementCall);
        }
      }
      tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [...tsSourceFile.statements, ...newStatements]);
      return tsSourceFile;
    };
  };
};
/**
 * Adds dependent component import statements and sets up and case blocks
 * @param moduleFile current components' module
 * @param components all current components within the stencil buildCtx
 * @param newStatements new top level statement array to add to that will get added to the AST
 * @param caseStatements an array of case statement blocks to add to. Will get added to `defineCustomElement` later
 * @param tagNames array of all related component tag-names to add to
 */
const setupComponentDependencies = (moduleFile, components, newStatements, caseStatements, tagNames) => {
  moduleFile.cmps.forEach((cmp) => {
    cmp.dependencies.forEach((dCmp) => {
      const foundDep = components.find((dComp) => dComp.tagName === dCmp);
      const exportName = dashToPascalCase$1(foundDep.tagName);
      const importAs = `$${exportName}DefineCustomElement`;
      tagNames.push(foundDep.tagName);
      // Will add `import { defineCustomElement as $ComponentDefineCustomElement } from 'my-nested-component.tsx';`
      newStatements.push(createImportStatement([`defineCustomElement as ${importAs}`], foundDep.sourceFilePath));
      // define a dependent component by recursively calling their own `defineCustomElement()`
      const callExpression = t.factory.createCallExpression(t.factory.createIdentifier(importAs), undefined, []);
      // `case` blocks that define the dependent components. We'll add them to our switch statement later.
      caseStatements.push(createCustomElementsDefineCase(foundDep.tagName, callExpression));
    });
  });
};
/**
 * Creates a case block which will be used to define components. e.g.
 * ``` javascript
 * case "my-component":
 *   if (!customElements.get(tagName)) {
 *   customElements.define(tagName, MyProxiedComponent);
 *   // OR for dependent components
 *   defineCustomElement(tagName);
 *   }
 *   break;
 * } });
  ```
 * @param tagName the components' tagName saved within stencil.
 * @param actionExpression the actual expression to call to define the customElement
 * @returns ts AST CaseClause
 */
const createCustomElementsDefineCase = (tagName, actionExpression) => {
  return t.factory.createCaseClause(t.factory.createStringLiteral(tagName), [
    t.factory.createIfStatement(t.factory.createPrefixUnaryExpression(t.SyntaxKind.ExclamationToken, t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'get'), undefined, [t.factory.createIdentifier('tagName')])), t.factory.createBlock([t.factory.createExpressionStatement(actionExpression)])),
    t.factory.createBreakStatement(),
  ]);
};
/**
 * Add the main `defineCustomElement` function e.g.
 * ```javascript
 * function defineCustomElement() {
 *  if (typeof customElements === 'undefined') {
 *  return;
 *  }
 *  const components = ['my-component'];
 *   components.forEach(tagName => {
 *   switch (tagName) {
 *     case "my-component":
 *     if (!customElements.get(tagName)) {
 *       customElements.define(tagName, MyProxiedComponent);
 *       // OR for dependent components
 *       defineCustomElement(tagName);
 *     }
 *     break;
 *   }
 *   });
 * }
 ```
 * @param tagNames all components that will be defined
 * @param newStatements new top level statement array that will get added to the AST
 * @param caseStatements an array of case statement blocks. Will get added to `defineCustomElement` later
 */
const addDefineCustomElementFunction = (tagNames, newStatements, caseStatements) => {
  const newExpression = t.factory.createFunctionDeclaration([t.factory.createModifier(t.SyntaxKind.ExportKeyword)], undefined, t.factory.createIdentifier('defineCustomElement'), undefined, [], undefined, t.factory.createBlock([
    t.factory.createIfStatement(t.factory.createStrictEquality(t.factory.createTypeOfExpression(t.factory.createIdentifier('customElements')), t.factory.createStringLiteral('undefined')), t.factory.createBlock([t.factory.createReturnStatement()])),
    t.factory.createVariableStatement(undefined, t.factory.createVariableDeclarationList([
      t.factory.createVariableDeclaration('components', undefined, undefined, t.factory.createArrayLiteralExpression(tagNames.map((tagName) => t.factory.createStringLiteral(tagName)))),
    ], t.NodeFlags.Const)),
    t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('components'), 'forEach'), undefined, [
      t.factory.createArrowFunction(undefined, undefined, [
        t.factory.createParameterDeclaration(undefined, undefined, t.factory.createIdentifier('tagName'), undefined, undefined),
      ], undefined, t.factory.createToken(t.SyntaxKind.EqualsGreaterThanToken), t.factory.createBlock([
        t.factory.createSwitchStatement(t.factory.createIdentifier('tagName'), t.factory.createCaseBlock(caseStatements)),
      ])),
    ])),
  ], true));
  newStatements.push(newExpression);
};
/**
 * Create a call to `defineCustomElement` for the principle web component.
 * ```typescript
 * defineCustomElement(MyPrincipalComponent);
 * ```
 * @param componentName the component's class name to use as the first argument to `defineCustomElement`
 * @returns the expression statement described above
 */
function createAutoDefinitionExpression(componentName) {
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier('defineCustomElement'), undefined, [
    t.factory.createIdentifier(componentName),
  ]));
}

const ATTACH_SHADOW = '__stencil_attachShadow';
const CREATE_EVENT = '__stencil_createEvent';
const DEFINE_CUSTOM_ELEMENT = '__stencil_defineCustomElement';
const GET_CONNECT = '__stencil_getConnect';
const GET_CONTEXT = '__stencil_getContext';
const GET_ELEMENT = '__stencil_getElement';
const HOST = '__stencil_Host';
const HTML_ELEMENT = 'HTMLElement';
const PROXY_CUSTOM_ELEMENT = '__stencil_proxyCustomElement';
const REGISTER_INSTANCE = '__stencil_registerInstance';
const REGISTER_HOST = '__stencil_registerHost';
const H = '__stencil_h';
const RUNTIME_APIS = {
  attachShadow: `attachShadow as ${ATTACH_SHADOW}`,
  createEvent: `createEvent as ${CREATE_EVENT}`,
  defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
  getConnect: `getConnect as ${GET_CONNECT}`,
  getContext: `getContext as ${GET_CONTEXT}`,
  getElement: `getElement as ${GET_ELEMENT}`,
  h: `h as ${H}`,
  legacyH: `h`,
  Host: `Host as ${HOST}`,
  HTMLElement: HTML_ELEMENT,
  proxyCustomElement: `proxyCustomElement as ${PROXY_CUSTOM_ELEMENT}`,
  registerHost: `registerHost as ${REGISTER_HOST}`,
  registerInstance: `registerInstance as ${REGISTER_INSTANCE}`,
};
const addCoreRuntimeApi = (moduleFile, coreRuntimeApi) => {
  if (!moduleFile.coreRuntimeApis.includes(coreRuntimeApi)) {
    moduleFile.coreRuntimeApis.push(coreRuntimeApi);
  }
};
const addLegacyApis = (moduleFile) => {
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.legacyH);
};

const addModuleMetadataProxies = (tsSourceFile, moduleFile) => {
  const statements = tsSourceFile.statements.slice();
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.proxyCustomElement);
  statements.push(...moduleFile.cmps.map(addComponentMetadataProxy));
  return t.factory.updateSourceFile(tsSourceFile, statements);
};
const addComponentMetadataProxy = (compilerMeta) => {
  return t.factory.createExpressionStatement(createComponentMetadataProxy(compilerMeta));
};
/**
 * Create a call expression for wrapping a component in a proxy. This call expression takes a form:
 * ```ts
 * PROXY_CUSTOM_ELEMENT(ComponentClassName, Metadata);
 * ```
 * where
 * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
 * name at compile name
 * - `ComponentClassName` is the name Stencil component's class
 * - `Metadata` is the compiler metadata associated with the Stencil component
 *
 * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
 * @returns the generated call expression
 */
const createComponentMetadataProxy = (compilerMeta) => {
  const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  const literalCmpClassName = t.factory.createIdentifier(compilerMeta.componentClassName);
  const literalMeta = convertValueToLiteral(compactMeta);
  return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [literalCmpClassName, literalMeta]);
};
/**
 * Create a call expression for wrapping a component represented as an anonymous class in a proxy. This call expression
 * takes a form:
 * ```ts
 * PROXY_CUSTOM_ELEMENT(Clazz, Metadata);
 * ```
 * where
 * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
 * name at compile name
 * - `Clazz` is an anonymous class to be proxied
 * - `Metadata` is the compiler metadata associated with the Stencil component
 *
 * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
 * @param clazz the anonymous class to proxy
 * @returns the generated call expression
 */
const createAnonymousClassMetadataProxy = (compilerMeta, clazz) => {
  const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  const literalMeta = convertValueToLiteral(compactMeta);
  return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [clazz, literalMeta]);
};

const addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
  if (importFnNames.length === 0) {
    return tsSourceFile;
  }
  if (transformOpts.module === 'cjs') {
    // CommonJS require()
    const newRequire = createRequireStatement(importFnNames, importPath);
    const statements = tsSourceFile.statements.slice();
    statements.splice(2, 0, newRequire);
    return t.factory.updateSourceFile(tsSourceFile, statements);
  }
  // ESM Imports
  const newImport = createImportStatement(importFnNames, importPath);
  const statements = tsSourceFile.statements.slice();
  statements.unshift(newImport);
  return t.factory.updateSourceFile(tsSourceFile, statements);
};

/**
 * Proxy custom elements for the `dist-custom-elements` output target. This function searches for a Stencil component's
 * class initializer (found on the righthand side of the '=' operator):
 *
 * ```ts
 * const MyComponent = class extends HTMLElement { // Implementation omitted }
 * ```
 *
 * and wraps the initializer into a `proxyCustomElement` call:
 *
 * ```ts
 * const MyComponent = proxyCustomElement(class extends HTMLElement { // Implementation omitted }, componentMetadata);
 * ```
 *
 * This is to work around an issue where treeshaking does not work for webpack users, whose details are captured in full
 * in [this issue on the webpack GitHub repo](https://github.com/webpack/webpack/issues/14963).
 *
 * @param compilerCtx current compiler context
 * @param transformOpts transpilation options for the current build
 * @returns a TypeScript AST transformer factory function that performs the above described transformation
 */
const proxyCustomElement = (compilerCtx, transformOpts) => {
  return () => {
    return (tsSourceFile) => {
      const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
      if (!moduleFile.cmps.length) {
        return tsSourceFile;
      }
      const principalComponent = moduleFile.cmps[0];
      for (const [stmtIndex, stmt] of tsSourceFile.statements.entries()) {
        if (t.isVariableStatement(stmt)) {
          for (const [declarationIndex, declaration] of stmt.declarationList.declarations.entries()) {
            if (declaration.name.getText() !== principalComponent.componentClassName) {
              continue;
            }
            // wrap the Stencil component's class declaration in a component proxy
            const proxyCreationCall = createAnonymousClassMetadataProxy(principalComponent, declaration.initializer);
            t.addSyntheticLeadingComment(proxyCreationCall, t.SyntaxKind.MultiLineCommentTrivia, '@__PURE__', false);
            // update the component's variable declaration to use the new initializer
            const proxiedComponentDeclaration = t.factory.updateVariableDeclaration(declaration, declaration.name, declaration.exclamationToken, declaration.type, proxyCreationCall);
            // update the declaration list that contains the updated variable declaration
            const updatedDeclarationList = t.factory.updateVariableDeclarationList(stmt.declarationList, [
              ...stmt.declarationList.declarations.slice(0, declarationIndex),
              proxiedComponentDeclaration,
              ...stmt.declarationList.declarations.slice(declarationIndex + 1),
            ]);
            // update the variable statement containing the updated declaration list
            const updatedVariableStatement = t.factory.updateVariableStatement(stmt, [t.factory.createModifier(t.SyntaxKind.ExportKeyword)], updatedDeclarationList);
            // update the source file's statements to use the new variable statement
            tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [
              ...tsSourceFile.statements.slice(0, stmtIndex),
              updatedVariableStatement,
              ...tsSourceFile.statements.slice(stmtIndex + 1),
            ]);
            // finally, ensure that the proxyCustomElement function is imported
            tsSourceFile = addImports(transformOpts, tsSourceFile, [RUNTIME_APIS.proxyCustomElement], transformOpts.coreImportPath);
            return tsSourceFile;
          }
        }
      }
      return tsSourceFile;
    };
  };
};

const defineCustomElement = (tsSourceFile, moduleFile, transformOpts) => {
  let statements = tsSourceFile.statements.slice();
  statements.push(...moduleFile.cmps.map((cmp) => {
    return addDefineCustomElement(moduleFile, cmp);
  }));
  if (transformOpts.module === 'cjs') {
    // remove commonjs exports keyword from component classes
    statements = removeComponentCjsExport(statements, moduleFile);
  }
  return t.factory.updateSourceFile(tsSourceFile, statements);
};
const addDefineCustomElement = (moduleFile, compilerMeta) => {
  if (compilerMeta.isPlain) {
    // add customElements.define('cmp-a', CmpClass);
    return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), t.factory.createIdentifier('define')), [], [
      t.factory.createStringLiteral(compilerMeta.tagName),
      t.factory.createIdentifier(compilerMeta.componentClassName),
    ]));
  }
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.defineCustomElement);
  const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  const liternalCmpClassName = t.factory.createIdentifier(compilerMeta.componentClassName);
  const liternalMeta = convertValueToLiteral(compactMeta);
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier(DEFINE_CUSTOM_ELEMENT), [], [liternalCmpClassName, liternalMeta]));
};
const removeComponentCjsExport = (statements, moduleFile) => {
  const cmpClassNames = new Set(moduleFile.cmps.map((cmp) => cmp.componentClassName));
  return statements.filter((s) => {
    if (s.kind === t.SyntaxKind.ExpressionStatement) {
      const exp = s.expression;
      if (exp && exp.kind === t.SyntaxKind.BinaryExpression) {
        const left = exp.left;
        if (left && left.kind === t.SyntaxKind.PropertyAccessExpression) {
          if (left.expression && left.expression.kind === t.SyntaxKind.Identifier) {
            const leftText = left.expression;
            if (leftText.text === 'exports') {
              const right = exp.right;
              if (right && cmpClassNames.has(right.text)) {
                return false;
              }
            }
          }
        }
      }
    }
    return true;
  });
};

const updateStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
  // add style imports built from @Component() styleUrl option
  if (transformOpts.module === 'cjs') {
    return updateCjsStyleRequires(transformOpts, tsSourceFile, moduleFile);
  }
  return updateEsmStyleImports(transformOpts, tsSourceFile, moduleFile);
};
const updateEsmStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
  const styleImports = [];
  let statements = tsSourceFile.statements.slice();
  let updateSourceFile = false;
  moduleFile.cmps.forEach((cmp) => {
    cmp.styles.forEach((style) => {
      if (typeof style.styleIdentifier === 'string') {
        updateSourceFile = true;
        if (style.externalStyles.length > 0) {
          // add style imports built from @Component() styleUrl option
          styleImports.push(createEsmStyleImport(transformOpts, tsSourceFile, cmp, style));
        }
        else {
          // update existing esm import of a style identifier
          statements = updateEsmStyleImportPath(transformOpts, tsSourceFile, statements, cmp, style);
        }
      }
    });
  });
  if (updateSourceFile) {
    let lastImportIndex = -1;
    for (let i = 0; i < statements.length; i++) {
      if (t.isImportDeclaration(statements[i])) {
        lastImportIndex = i;
      }
    }
    statements.splice(lastImportIndex + 1, 0, ...styleImports);
    return t.factory.updateSourceFile(tsSourceFile, statements);
  }
  return tsSourceFile;
};
const updateEsmStyleImportPath = (transformOpts, tsSourceFile, statements, cmp, style) => {
  for (let i = 0; i < statements.length; i++) {
    const n = statements[i];
    if (t.isImportDeclaration(n) && n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
      if (n.importClause.name && n.importClause.name.escapedText === style.styleIdentifier) {
        const orgImportPath = n.moduleSpecifier.text;
        const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, orgImportPath);
        statements[i] = t.factory.updateImportDeclaration(n, retrieveTsModifiers(n), n.importClause, t.factory.createStringLiteral(importPath), undefined);
        break;
      }
    }
  }
  return statements;
};
const createEsmStyleImport = (transformOpts, tsSourceFile, cmp, style) => {
  const importName = t.factory.createIdentifier(style.styleIdentifier);
  const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
  return t.factory.createImportDeclaration(undefined, t.factory.createImportClause(false, importName, undefined), t.factory.createStringLiteral(importPath));
};
const updateCjsStyleRequires = (transformOpts, tsSourceFile, moduleFile) => {
  const styleRequires = [];
  moduleFile.cmps.forEach((cmp) => {
    cmp.styles.forEach((style) => {
      if (typeof style.styleIdentifier === 'string' && style.externalStyles.length > 0) {
        // add style imports built from @Component() styleUrl option
        styleRequires.push(createCjsStyleRequire(transformOpts, tsSourceFile, cmp, style));
      }
    });
  });
  if (styleRequires.length > 0) {
    return t.factory.updateSourceFile(tsSourceFile, [...styleRequires, ...tsSourceFile.statements]);
  }
  return tsSourceFile;
};
const createCjsStyleRequire = (transformOpts, tsSourceFile, cmp, style) => {
  const importName = t.factory.createIdentifier(style.styleIdentifier);
  const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
  return t.factory.createVariableStatement(undefined, t.factory.createVariableDeclarationList([
    t.factory.createVariableDeclaration(importName, undefined, undefined, t.factory.createCallExpression(t.factory.createIdentifier('require'), [], [t.factory.createStringLiteral(importPath)])),
  ], t.NodeFlags.Const));
};
const getStyleImportPath = (transformOpts, tsSourceFile, cmp, style, importPath) => {
  const importData = {
    importeePath: importPath,
    importerPath: tsSourceFile.fileName,
    tag: cmp.tagName,
    encapsulation: cmp.encapsulation,
    mode: style.modeName,
  };
  return serializeImportPath(importData, transformOpts.styleImportData);
};

const transformHostData = (classElements, moduleFile) => {
  const hasHostData = classElements.some((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'hostData');
  if (hasHostData) {
    const renderIndex = classElements.findIndex((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'render');
    if (renderIndex >= 0) {
      const renderMethod = classElements[renderIndex];
      classElements[renderIndex] = t.factory.updateMethodDeclaration(renderMethod, retrieveModifierLike(renderMethod), renderMethod.asteriskToken, t.factory.createIdentifier(INTERNAL_RENDER), renderMethod.questionToken, renderMethod.typeParameters, renderMethod.parameters, renderMethod.type, renderMethod.body);
    }
    classElements.push(syntheticRender(moduleFile, renderIndex >= 0));
  }
};
const syntheticRender = (moduleFile, hasRender) => {
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.Host);
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.h);
  const hArguments = [
    // __stencil_Host
    t.factory.createIdentifier(HOST),
    // this.hostData()
    t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), 'hostData'), undefined, undefined),
  ];
  if (hasRender) {
    hArguments.push(
    // this.render()
    t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), INTERNAL_RENDER), undefined, undefined));
  }
  /**
   * render() {
   *   return h(arguments);
   * }
   */
  return t.factory.createMethodDeclaration(undefined, undefined, 'render', undefined, undefined, [], undefined, t.factory.createBlock([
    t.factory.createReturnStatement(t.factory.createCallExpression(t.factory.createIdentifier(H), undefined, hArguments)),
  ]));
};
const INTERNAL_RENDER = '__stencil_render';

const removeStaticMetaProperties = (classNode) => {
  if (classNode.members == null) {
    return [];
  }
  return classNode.members.filter((classMember) => {
    var _a;
    if ((_a = retrieveTsModifiers(classMember)) === null || _a === void 0 ? void 0 : _a.some((m) => m.kind === t.SyntaxKind.StaticKeyword)) {
      const memberName = classMember.name.escapedText;
      if (REMOVE_STATIC_GETTERS.has(memberName)) {
        return false;
      }
    }
    return true;
  });
};
const REMOVE_STATIC_GETTERS = new Set([
  'is',
  'properties',
  'encapsulation',
  'elementRef',
  'events',
  'listeners',
  'methods',
  'states',
  'originalStyleUrls',
  'styleMode',
  'style',
  'styles',
  'styleUrl',
  'watchers',
  'styleUrls',
  'contextProps',
  'connectProps',
]);

const updateComponentClass = (transformOpts, classNode, heritageClauses, members) => {
  var _a, _b, _c;
  let classModifiers = (_b = (_a = retrieveTsModifiers(classNode)) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
  if (transformOpts.module === 'cjs') {
    // CommonJS, leave component class as is
    if (transformOpts.componentExport === 'customelement') {
      // remove export from class
      classModifiers = classModifiers.filter((m) => {
        return m.kind !== t.SyntaxKind.ExportKeyword;
      });
    }
    return t.factory.updateClassDeclaration(classNode, [...((_c = retrieveTsDecorators(classNode)) !== null && _c !== void 0 ? _c : []), ...classModifiers], classNode.name, classNode.typeParameters, heritageClauses, members);
  }
  // ESM with export
  return createConstClass(transformOpts, classNode, heritageClauses, members);
};
const createConstClass = (transformOpts, classNode, heritageClauses, members) => {
  var _a;
  const className = classNode.name;
  const classModifiers = ((_a = retrieveTsModifiers(classNode)) !== null && _a !== void 0 ? _a : []).filter((m) => {
    // remove the export
    return m.kind !== t.SyntaxKind.ExportKeyword;
  });
  const constModifiers = [];
  if (transformOpts.componentExport !== 'customelement') {
    constModifiers.push(t.factory.createModifier(t.SyntaxKind.ExportKeyword));
  }
  return t.factory.createVariableStatement(constModifiers, t.factory.createVariableDeclarationList([
    t.factory.createVariableDeclaration(className, undefined, undefined, t.factory.createClassExpression(classModifiers, undefined, classNode.typeParameters, heritageClauses, members)),
  ], t.NodeFlags.Const));
};

const addWatchers = (classMembers, cmp) => {
  if (cmp.watchers.length > 0) {
    const watcherObj = {};
    cmp.watchers.forEach(({ propName, methodName }) => {
      watcherObj[propName] = watcherObj[propName] || [];
      watcherObj[propName].push(methodName);
    });
    classMembers.push(createStaticGetter('watchers', convertValueToLiteral(watcherObj)));
  }
};

const addNativeConnectedCallback = (classMembers, cmp) => {
  // function call to stencil's exported connectedCallback(elm, plt)
  // TODO: fast path
  if (cmp.isPlain && cmp.hasRenderFn) {
    const fnCall = t.factory.createExpressionStatement(t.factory.createAssignment(t.factory.createPropertyAccessExpression(t.factory.createThis(), 'textContent'), t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), 'render'), undefined, undefined)));
    const connectedCallback = classMembers.find((classMember) => {
      return t.isMethodDeclaration(classMember) && classMember.name.escapedText === 'connectedCallback';
    });
    if (connectedCallback != null) {
      // class already has a connectedCallback(), so update it
      const callbackMethod = t.factory.createMethodDeclaration(undefined, undefined, 'connectedCallback', undefined, undefined, [], undefined, t.factory.createBlock([fnCall, ...connectedCallback.body.statements], true));
      const index = classMembers.indexOf(connectedCallback);
      classMembers[index] = callbackMethod;
    }
    else {
      // class doesn't have a connectedCallback(), so add it
      const callbackMethod = t.factory.createMethodDeclaration(undefined, undefined, 'connectedCallback', undefined, undefined, [], undefined, t.factory.createBlock([fnCall], true));
      classMembers.push(callbackMethod);
    }
  }
};

const addCreateEvents = (moduleFile, cmp) => {
  return cmp.events.map((ev) => {
    addCoreRuntimeApi(moduleFile, RUNTIME_APIS.createEvent);
    return t.factory.createExpressionStatement(t.factory.createAssignment(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier(ev.method)), t.factory.createCallExpression(t.factory.createIdentifier(CREATE_EVENT), undefined, [
      t.factory.createThis(),
      t.factory.createStringLiteral(ev.name),
      t.factory.createNumericLiteral(computeFlags(ev)),
    ])));
  });
};
const computeFlags = (eventMeta) => {
  let flags = 0;
  if (eventMeta.bubbles) {
    flags |= 4 /* EVENT_FLAGS.Bubbles */;
  }
  if (eventMeta.composed) {
    flags |= 2 /* EVENT_FLAGS.Composed */;
  }
  if (eventMeta.cancelable) {
    flags |= 1 /* EVENT_FLAGS.Cancellable */;
  }
  return flags;
};

const addLegacyProps = (moduleFile, cmp) => {
  if (cmp.legacyConnect.length > 0) {
    addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getConnect);
  }
  if (cmp.legacyContext.length > 0) {
    addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getContext);
  }
  return [
    ...cmp.legacyConnect.map((c) => getStatement(c.name, GET_CONNECT, c.connect)),
    ...cmp.legacyContext.map((c) => getStatement(c.name, GET_CONTEXT, c.context)),
  ];
};
const getStatement = (propName, method, arg) => {
  return t.factory.createExpressionStatement(t.factory.createAssignment(t.factory.createPropertyAccessExpression(t.factory.createThis(), propName), t.factory.createCallExpression(t.factory.createIdentifier(method), undefined, [
    t.factory.createThis(),
    t.factory.createStringLiteral(arg),
  ])));
};

const updateNativeConstructor = (classMembers, moduleFile, cmp, ensureSuper) => {
  if (cmp.isPlain) {
    return;
  }
  const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
  if (cstrMethodIndex >= 0) {
    // add to the existing constructor()
    const cstrMethod = classMembers[cstrMethodIndex];
    let statements = [
      ...nativeInit(moduleFile, cmp),
      ...addCreateEvents(moduleFile, cmp),
      ...cstrMethod.body.statements,
      ...addLegacyProps(moduleFile, cmp),
    ];
    if (ensureSuper) {
      const hasSuper = cstrMethod.body.statements.some((s) => s.kind === t.SyntaxKind.SuperKeyword);
      if (!hasSuper) {
        statements = [createNativeConstructorSuper(), ...statements];
      }
    }
    classMembers[cstrMethodIndex] = t.factory.updateConstructorDeclaration(cstrMethod, retrieveTsModifiers(cstrMethod), cstrMethod.parameters, t.factory.updateBlock(cstrMethod.body, statements));
  }
  else {
    // create a constructor()
    let statements = [
      ...nativeInit(moduleFile, cmp),
      ...addCreateEvents(moduleFile, cmp),
      ...addLegacyProps(moduleFile, cmp),
    ];
    if (ensureSuper) {
      statements = [createNativeConstructorSuper(), ...statements];
    }
    const cstrMethod = t.factory.createConstructorDeclaration(undefined, [], t.factory.createBlock(statements, true));
    classMembers.unshift(cstrMethod);
  }
};
/**
 * Generates a series of expression statements used to help initialize a Stencil component
 * @param moduleFile the Stencil module that will be instantiated
 * @param cmp the component's metadata
 * @returns the generated expression statements
 */
const nativeInit = (moduleFile, cmp) => {
  const initStatements = [nativeRegisterHostStatement()];
  if (cmp.encapsulation === 'shadow') {
    initStatements.push(nativeAttachShadowStatement(moduleFile));
  }
  return initStatements;
};
const nativeRegisterHostStatement = () => {
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier('__registerHost')), undefined, undefined));
};
/**
 * Generates an expression statement for attaching a shadow DOM tree to an element.
 * @param moduleFile the Stencil module that will use the generated expression statement
 * @returns the generated expression statement
 */
const nativeAttachShadowStatement = (moduleFile) => {
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.attachShadow);
  // Create an expression statement, `this.__attachShadow();`
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier('__attachShadow')), undefined, undefined));
};
const createNativeConstructorSuper = () => {
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier('super'), undefined, undefined));
};

const addNativeElementGetter = (classMembers, cmp) => {
  // @Element() element;
  // is transformed into:
  // get element() { return this; }
  if (cmp.elementRef) {
    classMembers.push(t.factory.createGetAccessorDeclaration(undefined, cmp.elementRef, [], undefined, t.factory.createBlock([t.factory.createReturnStatement(t.factory.createThis())])));
  }
};

const addNativeComponentMeta = (classMembers, cmp) => {
  classMembers.push(createStaticGetter('is', convertValueToLiteral(cmp.tagName)));
};

const addNativeStaticStyle = (classMembers, cmp) => {
  if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
    if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
      // multiple style modes
      addMultipleModeStyleGetter(classMembers, cmp, cmp.styles);
    }
    else {
      // single style
      addSingleStyleGetter(classMembers, cmp, cmp.styles[0]);
    }
  }
};
const addMultipleModeStyleGetter = (classMembers, cmp, styles) => {
  const styleModes = [];
  styles.forEach((style) => {
    if (typeof style.styleStr === 'string') {
      // inline the style string
      // static get style() { return { "ios": "string" }; }
      const styleLiteral = createStyleLiteral$1(cmp, style);
      const propStr = t.factory.createPropertyAssignment(style.modeName, styleLiteral);
      styleModes.push(propStr);
    }
    else if (typeof style.styleIdentifier === 'string') {
      // direct import already written in the source code
      // import myTagIosStyle from './import-path.css';
      // static get style() { return { "ios": myTagIosStyle }; }
      const styleIdentifier = t.factory.createIdentifier(style.styleIdentifier);
      const propIdentifier = t.factory.createPropertyAssignment(style.modeName, styleIdentifier);
      styleModes.push(propIdentifier);
    }
    else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
      // import generated from @Component() styleUrls option
      // import myTagIosStyle from './import-path.css';
      // static get style() { return { "ios": myTagIosStyle }; }
      const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
      const propUrlIdentifier = t.factory.createPropertyAssignment(style.modeName, styleUrlIdentifier);
      styleModes.push(propUrlIdentifier);
    }
  });
  const styleObj = t.factory.createObjectLiteralExpression(styleModes, true);
  classMembers.push(createStaticGetter('style', styleObj));
};
const addSingleStyleGetter = (classMembers, cmp, style) => {
  if (typeof style.styleStr === 'string') {
    // inline the style string
    // static get style() { return "string"; }
    const styleLiteral = createStyleLiteral$1(cmp, style);
    classMembers.push(createStaticGetter('style', styleLiteral));
  }
  else if (typeof style.styleIdentifier === 'string') {
    // direct import already written in the source code
    // import myTagStyle from './import-path.css';
    // static get style() { return myTagStyle; }
    const styleIdentifier = t.factory.createIdentifier(style.styleIdentifier);
    classMembers.push(createStaticGetter('style', styleIdentifier));
  }
  else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
    // import generated from @Component() styleUrls option
    // import myTagStyle from './import-path.css';
    // static get style() { return myTagStyle; }
    const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
    classMembers.push(createStaticGetter('style', styleUrlIdentifier));
  }
};
const createStyleLiteral$1 = (cmp, style) => {
  if (cmp.encapsulation === 'scoped') {
    // scope the css first
    const scopeId = getScopeId(cmp.tagName, style.modeName);
    return t.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
  }
  return t.factory.createStringLiteral(style.styleStr);
};
const createStyleIdentifierFromUrl$1 = (cmp, style) => {
  style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
  style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
  if (style.modeName !== DEFAULT_STYLE_MODE) {
    style.styleIdentifier += dashToPascalCase$1(style.modeName);
  }
  style.styleIdentifier += 'Style';
  style.externalStyles = [style.externalStyles[0]];
  return t.factory.createIdentifier(style.styleIdentifier);
};

const updateNativeComponentClass = (transformOpts, classNode, moduleFile, cmp) => {
  const heritageClauses = updateNativeHostComponentHeritageClauses(classNode, moduleFile);
  const members = updateNativeHostComponentMembers(transformOpts, classNode, moduleFile, cmp);
  return updateComponentClass(transformOpts, classNode, heritageClauses, members);
};
const updateNativeHostComponentHeritageClauses = (classNode, moduleFile) => {
  if (classNode.heritageClauses != null && classNode.heritageClauses.length > 0) {
    return classNode.heritageClauses;
  }
  if (moduleFile.cmps.length >= 1) {
    addCoreRuntimeApi(moduleFile, RUNTIME_APIS.HTMLElement);
  }
  const heritageClause = t.factory.createHeritageClause(t.SyntaxKind.ExtendsKeyword, [
    t.factory.createExpressionWithTypeArguments(t.factory.createIdentifier(HTML_ELEMENT), []),
  ]);
  return [heritageClause];
};
const updateNativeHostComponentMembers = (transformOpts, classNode, moduleFile, cmp) => {
  const classMembers = removeStaticMetaProperties(classNode);
  updateNativeConstructor(classMembers, moduleFile, cmp, true);
  addNativeConnectedCallback(classMembers, cmp);
  addNativeElementGetter(classMembers, cmp);
  addWatchers(classMembers, cmp);
  if (cmp.isPlain) {
    addNativeComponentMeta(classMembers, cmp);
  }
  if (transformOpts.style === 'static') {
    addNativeStaticStyle(classMembers, cmp);
  }
  transformHostData(classMembers, moduleFile);
  return classMembers;
};

const nativeComponentTransform = (compilerCtx, transformOpts) => {
  return (transformCtx) => {
    return (tsSourceFile) => {
      const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
      const visitNode = (node) => {
        if (t.isClassDeclaration(node)) {
          const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
          if (cmp != null) {
            return updateNativeComponentClass(transformOpts, node, moduleFile, cmp);
          }
        }
        return t.visitEachChild(node, visitNode, transformCtx);
      };
      tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
      if (moduleFile.cmps.length > 0) {
        if (transformOpts.componentExport === 'customelement') {
          // define custom element, will have no export
          tsSourceFile = defineCustomElement(tsSourceFile, moduleFile, transformOpts);
        }
        else if (transformOpts.proxy === 'defineproperty') {
          // exporting as a module, but also add the component proxy fn
          tsSourceFile = addModuleMetadataProxies(tsSourceFile, moduleFile);
        }
        tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
      }
      if (moduleFile.isLegacy) {
        addLegacyApis(moduleFile);
      }
      tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
      return tsSourceFile;
    };
  };
};

const updateStencilCoreImports = (updatedCoreImportPath) => {
  return () => {
    return (tsSourceFile) => {
      if (STENCIL_CORE_ID === updatedCoreImportPath) {
        return tsSourceFile;
      }
      let madeChanges = false;
      const newStatements = [];
      tsSourceFile.statements.forEach((s) => {
        if (t.isImportDeclaration(s)) {
          if (s.moduleSpecifier != null && t.isStringLiteral(s.moduleSpecifier)) {
            if (s.moduleSpecifier.text === STENCIL_CORE_ID) {
              if (s.importClause &&
                s.importClause.namedBindings &&
                s.importClause.namedBindings.kind === t.SyntaxKind.NamedImports) {
                const origImports = s.importClause.namedBindings.elements;
                const keepImports = origImports.map((e) => e.getText()).filter((name) => KEEP_IMPORTS.has(name));
                if (keepImports.length > 0) {
                  const newImport = t.factory.updateImportDeclaration(s, undefined, t.factory.createImportClause(false, undefined, t.factory.createNamedImports(keepImports.map((name) => t.factory.createImportSpecifier(false, undefined, t.factory.createIdentifier(name))))), t.factory.createStringLiteral(updatedCoreImportPath), undefined);
                  newStatements.push(newImport);
                }
              }
              madeChanges = true;
              return;
            }
          }
        }
        newStatements.push(s);
      });
      if (madeChanges) {
        return t.factory.updateSourceFile(tsSourceFile, newStatements, tsSourceFile.isDeclarationFile, tsSourceFile.referencedFiles, tsSourceFile.typeReferenceDirectives, tsSourceFile.hasNoDefaultLib, tsSourceFile.libReferenceDirectives);
      }
      return tsSourceFile;
    };
  };
};
/**
 * A set of imports which we don't want to remove from an output file
 */
const KEEP_IMPORTS = new Set([
  'h',
  'setMode',
  'getMode',
  'setPlatformHelpers',
  'Build',
  'Env',
  'Host',
  'Fragment',
  'getAssetPath',
  'writeTask',
  'readTask',
  'getElement',
  'forceUpdate',
  'getRenderingRef',
  'forceModeUpdate',
  'setErrorHandler',
]);

const getBuildFeatures = (cmps) => {
  const slot = cmps.some((c) => c.htmlTagNames.includes('slot'));
  const shadowDom = cmps.some((c) => c.encapsulation === 'shadow');
  const slotRelocation = cmps.some((c) => c.encapsulation !== 'shadow' && c.htmlTagNames.includes('slot'));
  const f = {
    allRenderFn: cmps.every((c) => c.hasRenderFn),
    cmpDidLoad: cmps.some((c) => c.hasComponentDidLoadFn),
    cmpShouldUpdate: cmps.some((c) => c.hasComponentShouldUpdateFn),
    cmpDidUnload: cmps.some((c) => c.hasComponentDidUnloadFn),
    cmpDidUpdate: cmps.some((c) => c.hasComponentDidUpdateFn),
    cmpDidRender: cmps.some((c) => c.hasComponentDidRenderFn),
    cmpWillLoad: cmps.some((c) => c.hasComponentWillLoadFn),
    cmpWillUpdate: cmps.some((c) => c.hasComponentWillUpdateFn),
    cmpWillRender: cmps.some((c) => c.hasComponentWillRenderFn),
    connectedCallback: cmps.some((c) => c.hasConnectedCallbackFn),
    disconnectedCallback: cmps.some((c) => c.hasDisconnectedCallbackFn),
    element: cmps.some((c) => c.hasElement),
    event: cmps.some((c) => c.hasEvent),
    hasRenderFn: cmps.some((c) => c.hasRenderFn),
    lifecycle: cmps.some((c) => c.hasLifecycle),
    asyncLoading: false,
    hostListener: cmps.some((c) => c.hasListener),
    hostListenerTargetWindow: cmps.some((c) => c.hasListenerTargetWindow),
    hostListenerTargetDocument: cmps.some((c) => c.hasListenerTargetDocument),
    hostListenerTargetBody: cmps.some((c) => c.hasListenerTargetBody),
    hostListenerTargetParent: cmps.some((c) => c.hasListenerTargetParent),
    hostListenerTarget: cmps.some((c) => c.hasListenerTarget),
    member: cmps.some((c) => c.hasMember),
    method: cmps.some((c) => c.hasMethod),
    mode: cmps.some((c) => c.hasMode),
    observeAttribute: cmps.some((c) => c.hasAttribute),
    prop: cmps.some((c) => c.hasProp),
    propBoolean: cmps.some((c) => c.hasPropBoolean),
    propNumber: cmps.some((c) => c.hasPropNumber),
    propString: cmps.some((c) => c.hasPropString),
    propMutable: cmps.some((c) => c.hasPropMutable),
    reflect: cmps.some((c) => c.hasReflect),
    scoped: cmps.some((c) => c.encapsulation === 'scoped'),
    shadowDom,
    shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
    slot,
    slotRelocation,
    state: cmps.some((c) => c.hasState),
    style: cmps.some((c) => c.hasStyle),
    svg: cmps.some((c) => c.htmlTagNames.includes('svg')),
    updatable: cmps.some((c) => c.isUpdateable),
    vdomAttribute: cmps.some((c) => c.hasVdomAttribute),
    vdomXlink: cmps.some((c) => c.hasVdomXlink),
    vdomClass: cmps.some((c) => c.hasVdomClass),
    vdomFunctional: cmps.some((c) => c.hasVdomFunctional),
    vdomKey: cmps.some((c) => c.hasVdomKey),
    vdomListener: cmps.some((c) => c.hasVdomListener),
    vdomPropOrAttr: cmps.some((c) => c.hasVdomPropOrAttr),
    vdomRef: cmps.some((c) => c.hasVdomRef),
    vdomRender: cmps.some((c) => c.hasVdomRender),
    vdomStyle: cmps.some((c) => c.hasVdomStyle),
    vdomText: cmps.some((c) => c.hasVdomText),
    watchCallback: cmps.some((c) => c.hasWatchCallback),
    taskQueue: true,
  };
  f.asyncLoading = f.cmpWillUpdate || f.cmpWillLoad || f.cmpWillRender;
  f.vdomAttribute = f.vdomAttribute || f.reflect;
  f.vdomPropOrAttr = f.vdomPropOrAttr || f.reflect;
  return f;
};
const updateComponentBuildConditionals = (moduleMap, cmps) => {
  cmps.forEach((cmp) => {
    const importedModules = getModuleImports(moduleMap, cmp.sourceFilePath, []);
    importedModules.forEach((importedModule) => {
      // if the component already has a boolean true value it'll keep it
      // otherwise we get the boolean value from the imported module
      cmp.hasVdomAttribute = cmp.hasVdomAttribute || importedModule.hasVdomAttribute;
      cmp.hasVdomPropOrAttr = cmp.hasVdomPropOrAttr || importedModule.hasVdomPropOrAttr;
      cmp.hasVdomXlink = cmp.hasVdomXlink || importedModule.hasVdomXlink;
      cmp.hasVdomClass = cmp.hasVdomClass || importedModule.hasVdomClass;
      cmp.hasVdomFunctional = cmp.hasVdomFunctional || importedModule.hasVdomFunctional;
      cmp.hasVdomKey = cmp.hasVdomKey || importedModule.hasVdomKey;
      cmp.hasVdomListener = cmp.hasVdomListener || importedModule.hasVdomListener;
      cmp.hasVdomRef = cmp.hasVdomRef || importedModule.hasVdomRef;
      cmp.hasVdomRender = cmp.hasVdomRender || importedModule.hasVdomRender;
      cmp.hasVdomStyle = cmp.hasVdomStyle || importedModule.hasVdomStyle;
      cmp.hasVdomText = cmp.hasVdomText || importedModule.hasVdomText;
      cmp.htmlAttrNames.push(...importedModule.htmlAttrNames);
      cmp.htmlTagNames.push(...importedModule.htmlTagNames);
      cmp.potentialCmpRefs.push(...importedModule.potentialCmpRefs);
    });
    cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
    cmp.htmlTagNames = unique(cmp.htmlTagNames);
    cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
  });
};
const getModuleImports = (moduleMap, filePath, importedModules) => {
  let moduleFile = moduleMap.get(filePath);
  if (moduleFile == null) {
    moduleFile = moduleMap.get(filePath + '.tsx');
    if (moduleFile == null) {
      moduleFile = moduleMap.get(filePath + '.ts');
      if (moduleFile == null) {
        moduleFile = moduleMap.get(filePath + '.js');
      }
    }
  }
  if (moduleFile != null && !importedModules.some((m) => m.sourceFilePath === moduleFile.sourceFilePath)) {
    importedModules.push(moduleFile);
    moduleFile.localImports.forEach((localImport) => {
      getModuleImports(moduleMap, localImport, importedModules);
    });
  }
  return importedModules;
};
const updateBuildConditionals = (config, b) => {
  b.isDebug = config.logLevel === 'debug';
  b.isDev = !!config.devMode;
  b.isTesting = !!config._isTesting;
  b.devTools = b.isDev && !config._isTesting;
  b.profile = !!config.profile;
  b.hotModuleReplacement = !!(config.devMode &&
    config.devServer &&
    config.devServer.reloadStrategy === 'hmr' &&
    !config._isTesting);
  b.updatable = b.updatable || b.hydrateClientSide || b.hotModuleReplacement;
  b.member = b.member || b.updatable || b.mode || b.lifecycle;
  b.constructableCSS = !b.hotModuleReplacement || !!config._isTesting;
  b.asyncLoading = !!(b.asyncLoading || b.lazyLoad || b.taskQueue || b.initializeNextTick);
  b.cssAnnotations = true;
  b.appendChildSlotFix = config.extras.appendChildSlotFix;
  b.slotChildNodesFix = config.extras.slotChildNodesFix;
  b.cloneNodeFix = config.extras.cloneNodeFix;
  b.dynamicImportShim = config.extras.dynamicImportShim;
  b.lifecycleDOMEvents = !!(b.isDebug || config._isTesting || config.extras.lifecycleDOMEvents);
  b.safari10 = config.extras.safari10;
  b.scopedSlotTextContentFix = !!config.extras.scopedSlotTextContentFix;
  b.scriptDataOpts = config.extras.scriptDataOpts;
  b.shadowDomShim = config.extras.shadowDomShim;
  b.attachStyles = true;
  b.invisiblePrehydration = typeof config.invisiblePrehydration === 'undefined' ? true : config.invisiblePrehydration;
  if (b.shadowDomShim) {
    b.slotRelocation = b.slot;
  }
  if (config.hydratedFlag) {
    b.hydratedAttribute = config.hydratedFlag.selector === 'attribute';
    b.hydratedClass = config.hydratedFlag.selector === 'class';
  }
  else {
    b.hydratedAttribute = false;
    b.hydratedClass = false;
  }
};

const getCustomElementsBuildConditionals = (config, cmps) => {
  // because custom elements bundling does not customize the build conditionals by default
  // then the default in "import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data'"
  // needs to have the static build conditionals set for the custom elements build
  const build = getBuildFeatures(cmps);
  build.lazyLoad = false;
  build.hydrateClientSide = false;
  build.hydrateServerSide = false;
  build.asyncQueue = config.taskQueue === 'congestionAsync';
  build.taskQueue = config.taskQueue !== 'immediate';
  updateBuildConditionals(config, build);
  build.devTools = false;
  return build;
};

/**
 * Main output target function for `dist-custom-elements`. This function just
 * does some organizational work to call the other functions in this module,
 * which do actual work of generating the rollup configuration, creating an
 * entry chunk, running, the build, etc.
 *
 * @param config the validated compiler configuration we're using
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @returns an empty Promise which won't resolve until the work is done!
 */
const outputCustomElements = async (config, compilerCtx, buildCtx) => {
  if (!config.buildDist) {
    return;
  }
  const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
  if (outputTargets.length === 0) {
    return;
  }
  const bundlingEventMessage = 'generate custom elements';
  const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
  await Promise.all(outputTargets.map((target) => bundleCustomElements$1(config, compilerCtx, buildCtx, target)));
  timespan.finish(`${bundlingEventMessage} finished`);
};
/**
 * Get bundle options for our current build and compiler context which we'll use
 * to generate a Rollup build and so on.
 *
 * @param config a validated Stencil configuration object
 * @param buildCtx the current build context
 * @param compilerCtx the current compiler context
 * @param outputTarget the outputTarget we're currently dealing with
 * @returns bundle options suitable for generating a rollup configuration
 */
const getBundleOptions = (config, buildCtx, compilerCtx, outputTarget) => ({
  id: 'customElements',
  platform: 'client',
  conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
  customTransformers: getCustomElementCustomTransformer(config, compilerCtx, buildCtx.components, outputTarget),
  externalRuntime: !!outputTarget.externalRuntime,
  inlineWorkers: true,
  inputs: {
    // Here we prefix our index chunk with '\0' to tell Rollup that we're
    // going to be using virtual modules with this module. A leading '\0'
    // prevents other plugins from messing with the module. We generate a
    // string for the index chunk below in the `loader` property.
    //
    // @see {@link https://rollupjs.org/guide/en/#conventions} for more info.
    index: '\0core',
  },
  loader: {
    '\0core': generateEntryPoint$1(outputTarget),
  },
  inlineDynamicImports: outputTarget.inlineDynamicImports,
  preserveEntrySignatures: 'allow-extension',
});
/**
 * Get bundle options for rollup, run the rollup build, optionally minify the
 * output, and write files to disk.
 *
 * @param config the validated Stencil configuration we're using
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget the outputTarget we're currently dealing with
 * @returns an empty promise
 */
const bundleCustomElements$1 = async (config, compilerCtx, buildCtx, outputTarget) => {
  try {
    const bundleOpts = getBundleOptions(config, buildCtx, compilerCtx, outputTarget);
    addCustomElementInputs(buildCtx, bundleOpts);
    const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
    if (build) {
      const rollupOutput = await build.generate({
        banner: generatePreamble(config),
        format: 'esm',
        sourcemap: config.sourceMap,
        chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
        entryFileNames: '[name].js',
        hoistTransitiveImports: false,
        preferConst: true,
      });
      // the output target should have been validated at this point - as a result, we expect this field
      // to have been backfilled if it wasn't provided
      const outputTargetDir = outputTarget.dir;
      // besides, if it isn't here we do a diagnostic and an early return
      if (!isString$1(outputTargetDir)) {
        buildCtx.diagnostics.push({
          level: 'error',
          type: 'build',
          messageText: 'dist-custom-elements output target provided with no output target directory!',
        });
        return;
      }
      const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
      const files = rollupOutput.output.map(async (bundle) => {
        if (bundle.type === 'chunk') {
          let code = bundle.code;
          let sourceMap = rollupToStencilSourceMap(bundle.map);
          const optimizeResults = await optimizeModule(config, compilerCtx, {
            input: code,
            isCore: bundle.isEntry,
            minify,
            sourceMap,
          });
          buildCtx.diagnostics.push(...optimizeResults.diagnostics);
          if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
            code = optimizeResults.output;
          }
          if (optimizeResults.sourceMap) {
            sourceMap = optimizeResults.sourceMap;
            code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
            await compilerCtx.fs.writeFile(join(outputTargetDir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
              outputTargetType: outputTarget.type,
            });
          }
          await compilerCtx.fs.writeFile(join(outputTargetDir, bundle.fileName), code, {
            outputTargetType: outputTarget.type,
          });
        }
      });
      await Promise.all(files);
    }
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
};
/**
 * Create the virtual modules/input modules for the `dist-custom-elements` output target.
 * @param buildCtx the context for the current build
 * @param bundleOpts the bundle options to store the virtual modules under. acts as an output parameter
 */
const addCustomElementInputs = (buildCtx, bundleOpts) => {
  const components = buildCtx.components;
  // an array to store the imports of these modules that we're going to add to our entry chunk
  const indexImports = [];
  components.forEach((cmp) => {
    const exp = [];
    const exportName = dashToPascalCase$1(cmp.tagName);
    const importName = cmp.componentClassName;
    const importAs = `$Cmp${exportName}`;
    const coreKey = `\0${exportName}`;
    if (cmp.isPlain) {
      exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
      indexImports.push(`export { {${exportName} } from '${coreKey}';`);
    }
    else {
      // the `importName` may collide with the `exportName`, alias it just in case it does with `importAs`
      exp.push(`import { ${importName} as ${importAs}, defineCustomElement as cmpDefCustomEle } from '${cmp.sourceFilePath}';`);
      exp.push(`export const ${exportName} = ${importAs};`);
      exp.push(`export const defineCustomElement = cmpDefCustomEle;`);
      // Here we push an export (with a rename for `defineCustomElement`) for
      // this component onto our array which references the `coreKey` (prefixed
      // with `\0`). We have to do this so that our import is referencing the
      // correct virtual module, if we instead referenced, for instance,
      // `cmp.sourceFilePath`, we would end up with duplicated modules in our
      // output.
      indexImports.push(`export { ${exportName}, defineCustomElement as defineCustomElement${exportName} } from '${coreKey}';`);
    }
    bundleOpts.inputs[cmp.tagName] = coreKey;
    bundleOpts.loader[coreKey] = exp.join('\n');
  });
  bundleOpts.loader['\0core'] += indexImports.join('\n');
};
/**
 * Generate the entrypoint (`index.ts` file) contents for the `dist-custom-elements` output target
 * @param outputTarget the output target's configuration
 * @returns the stringified contents to be placed in the entrypoint
 */
const generateEntryPoint$1 = (outputTarget) => {
  const imp = [];
  imp.push(`export { setAssetPath, setNonce, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
  if (outputTarget.includeGlobalScripts !== false) {
    imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
  }
  return imp.join('\n') + '\n';
};
/**
 * Get the series of custom transformers that will be applied to a Stencil project's source code during the TypeScript
 * transpilation process
 *
 * @param config the configuration for the Stencil project
 * @param compilerCtx the current compiler context
 * @param components the components that will be compiled as a part of the current build
 * @param outputTarget the output target configuration
 * @returns a list of transformers to use in the transpilation process
 */
const getCustomElementCustomTransformer = (config, compilerCtx, components, outputTarget) => {
  const transformOpts = {
    coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
    componentExport: null,
    componentMetadata: null,
    currentDirectory: config.sys.getCurrentDirectory(),
    proxy: null,
    style: 'static',
    styleImportData: 'queryparams',
  };
  return [
    addDefineCustomElementFunctions(compilerCtx, components, outputTarget),
    updateStencilCoreImports(transformOpts.coreImportPath),
    nativeComponentTransform(compilerCtx, transformOpts),
    proxyCustomElement(compilerCtx, transformOpts),
    removeCollectionImports(compilerCtx),
  ];
};

const outputCustomElementsBundle = async (config, compilerCtx, buildCtx) => {
  if (!config.buildDist) {
    return;
  }
  const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
  if (outputTargets.length === 0) {
    return;
  }
  const bundlingEventMessage = `generate custom elements bundle${config.sourceMap ? ' + source maps' : ''}`;
  const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
  await Promise.all(outputTargets.map((o) => bundleCustomElements(config, compilerCtx, buildCtx, o)));
  timespan.finish(`${bundlingEventMessage} finished`);
};
const bundleCustomElements = async (config, compilerCtx, buildCtx, outputTarget) => {
  try {
    const bundleOpts = {
      id: 'customElementsBundle',
      platform: 'client',
      conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
      customTransformers: getCustomElementBundleCustomTransformer(config, compilerCtx),
      externalRuntime: !!outputTarget.externalRuntime,
      inlineWorkers: true,
      inputs: {
        index: '\0core',
      },
      loader: {
        '\0core': generateEntryPoint(outputTarget, buildCtx),
      },
      inlineDynamicImports: outputTarget.inlineDynamicImports,
      preserveEntrySignatures: 'allow-extension',
    };
    const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
    if (build) {
      const rollupOutput = await build.generate({
        banner: generatePreamble(config),
        format: 'esm',
        sourcemap: config.sourceMap,
        chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
        entryFileNames: '[name].js',
        hoistTransitiveImports: false,
        preferConst: true,
      });
      const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
      const files = rollupOutput.output.map(async (bundle) => {
        if (bundle.type === 'chunk') {
          let code = bundle.code;
          let sourceMap = rollupToStencilSourceMap(bundle.map);
          const optimizeResults = await optimizeModule(config, compilerCtx, {
            input: code,
            isCore: bundle.isEntry,
            minify,
            sourceMap,
          });
          buildCtx.diagnostics.push(...optimizeResults.diagnostics);
          if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
            code = optimizeResults.output;
            sourceMap = optimizeResults.sourceMap;
          }
          if (sourceMap) {
            code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
            await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
              outputTargetType: outputTarget.type,
            });
          }
          await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName), code, {
            outputTargetType: outputTarget.type,
          });
        }
      });
      await Promise.all(files);
    }
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
};
const generateEntryPoint = (outputTarget, buildCtx) => {
  const imp = [];
  const exp = [];
  const exportNames = [];
  imp.push(`import { proxyCustomElement } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export { setAssetPath, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
  if (outputTarget.includeGlobalScripts !== false) {
    imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
  }
  buildCtx.components.forEach((cmp) => {
    const exportName = dashToPascalCase$1(cmp.tagName);
    const importName = cmp.componentClassName;
    const importAs = `$Cmp${exportName}`;
    if (cmp.isPlain) {
      exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
    }
    else {
      const meta = stringifyRuntimeData(formatComponentRuntimeMeta(cmp, false));
      imp.push(`import { ${importName} as ${importAs} } from '${cmp.sourceFilePath}';`);
      exp.push(`export const ${exportName} = /*@__PURE__*/proxyCustomElement(${importAs}, ${meta});`);
    }
    exportNames.push(exportName);
  });
  exp.push(`export const defineCustomElements = (opts) => {`);
  exp.push(`  if (typeof customElements !== 'undefined') {`);
  exp.push(`    [`);
  exp.push(`      ${exportNames.join(',\n  ')}`);
  exp.push(`    ].forEach(cmp => {`);
  exp.push(`      if (!customElements.get(cmp.is)) {`);
  exp.push(`        customElements.define(cmp.is, cmp, opts);`);
  exp.push(`      }`);
  exp.push(`    });`);
  exp.push(`  }`);
  exp.push(`};`);
  return [...imp, ...exp].join('\n') + '\n';
};
const getCustomElementBundleCustomTransformer = (config, compilerCtx) => {
  const transformOpts = {
    coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
    componentExport: null,
    componentMetadata: null,
    currentDirectory: config.sys.getCurrentDirectory(),
    proxy: null,
    style: 'static',
    styleImportData: 'queryparams',
  };
  return [
    updateStencilCoreImports(transformOpts.coreImportPath),
    nativeComponentTransform(compilerCtx, transformOpts),
    removeCollectionImports(compilerCtx),
  ];
};

const updateLazyComponentConstructor = (classMembers, moduleFile, cmp) => {
  const cstrMethodArgs = [
    t.factory.createParameterDeclaration(undefined, undefined, t.factory.createIdentifier(HOST_REF_ARG)),
  ];
  const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
  if (cstrMethodIndex >= 0) {
    // add to the existing constructor()
    const cstrMethod = classMembers[cstrMethodIndex];
    const body = t.factory.updateBlock(cstrMethod.body, [
      registerInstanceStatement(moduleFile),
      ...addCreateEvents(moduleFile, cmp),
      ...cstrMethod.body.statements,
      ...addLegacyProps(moduleFile, cmp),
    ]);
    classMembers[cstrMethodIndex] = t.factory.updateConstructorDeclaration(cstrMethod, retrieveTsModifiers(cstrMethod), cstrMethodArgs, body);
  }
  else {
    // create a constructor()
    const cstrMethod = t.factory.createConstructorDeclaration(undefined, cstrMethodArgs, t.factory.createBlock([
      registerInstanceStatement(moduleFile),
      ...addCreateEvents(moduleFile, cmp),
      ...addLegacyProps(moduleFile, cmp),
    ], true));
    classMembers.unshift(cstrMethod);
  }
};
const registerInstanceStatement = (moduleFile) => {
  addCoreRuntimeApi(moduleFile, RUNTIME_APIS.registerInstance);
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier(REGISTER_INSTANCE), undefined, [
    t.factory.createThis(),
    t.factory.createIdentifier(HOST_REF_ARG),
  ]));
};
const HOST_REF_ARG = 'hostRef';

const addLazyElementGetter = (classMembers, moduleFile, cmp) => {
  // @Element() element;
  // is transformed into:
  // get element() { return __stencil_getElement(this); }
  if (cmp.elementRef) {
    addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getElement);
    classMembers.push(t.factory.createGetAccessorDeclaration(undefined, cmp.elementRef, [], undefined, t.factory.createBlock([
      t.factory.createReturnStatement(t.factory.createCallExpression(t.factory.createIdentifier(GET_ELEMENT), undefined, [
        t.factory.createThis(),
      ])),
    ])));
  }
};

/**
 * Adds static "style" getter within the class
 * ```typescript
 * const MyComponent = class {
 *   static get style() { return "styles"; }
 * }
 * ```
 * @param classMembers a class to existing members of a class. **this parameter will be mutated** rather than returning
 * a cloned version
 * @param cmp the metadata associated with the component being evaluated
 * @param commentOriginalSelector if `true`, add a comment with the original CSS selector to the style.
 */
const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelector) => {
  const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
  if (styleLiteral) {
    classMembers.push(createStaticGetter('style', styleLiteral));
  }
};
/**
 * Adds static "style" property to the class variable.
 *
 * ```typescript
 * const MyComponent = class {}
 * MyComponent.style = "styles";
 * ```
 *
 * @param styleStatements a list of statements containing style assignments to a class
 * @param cmp the metadata associated with the component being evaluated
 */
const addStaticStylePropertyToClass = (styleStatements, cmp) => {
  const styleLiteral = getStyleLiteral(cmp, false);
  if (styleLiteral) {
    const statement = t.factory.createExpressionStatement(t.factory.createAssignment(t.factory.createPropertyAccessExpression(t.factory.createIdentifier(cmp.componentClassName), 'style'), styleLiteral));
    styleStatements.push(statement);
  }
};
const getStyleLiteral = (cmp, commentOriginalSelector) => {
  if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
    if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
      // multiple style modes
      return getMultipleModeStyle(cmp, cmp.styles, commentOriginalSelector);
    }
    else {
      // single style
      return getSingleStyle(cmp, cmp.styles[0], commentOriginalSelector);
    }
  }
  return null;
};
const getMultipleModeStyle = (cmp, styles, commentOriginalSelector) => {
  const styleModes = [];
  styles.forEach((style) => {
    if (typeof style.styleStr === 'string') {
      // inline the style string
      // static get style() { return { ios: "string" }; }
      const styleLiteral = createStyleLiteral(cmp, style, commentOriginalSelector);
      const propStr = t.factory.createPropertyAssignment(style.modeName, styleLiteral);
      styleModes.push(propStr);
    }
    else if (typeof style.styleIdentifier === 'string') {
      // direct import already written in the source code
      // import myTagIosStyle from './import-path.css';
      // static get style() { return { ios: myTagIosStyle }; }
      const styleIdentifier = t.factory.createIdentifier(style.styleIdentifier);
      const propIdentifier = t.factory.createPropertyAssignment(style.modeName, styleIdentifier);
      styleModes.push(propIdentifier);
    }
    else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
      // import generated from @Component() styleUrls option
      // import myTagIosStyle from './import-path.css';
      // static get style() { return { ios: myTagIosStyle }; }
      const styleUrlIdentifier = createStyleIdentifierFromUrl(cmp, style);
      const propUrlIdentifier = t.factory.createPropertyAssignment(style.modeName, styleUrlIdentifier);
      styleModes.push(propUrlIdentifier);
    }
  });
  return t.factory.createObjectLiteralExpression(styleModes, true);
};
const getSingleStyle = (cmp, style, commentOriginalSelector) => {
  if (typeof style.styleStr === 'string') {
    // inline the style string
    // static get style() { return "string"; }
    return createStyleLiteral(cmp, style, commentOriginalSelector);
  }
  if (typeof style.styleIdentifier === 'string') {
    // direct import already written in the source code
    // import myTagStyle from './import-path.css';
    // static get style() { return myTagStyle; }
    return t.factory.createIdentifier(style.styleIdentifier);
  }
  if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
    // import generated from @Component() styleUrls option
    // import myTagStyle from './import-path.css';
    // static get style() { return myTagStyle; }
    return createStyleIdentifierFromUrl(cmp, style);
  }
  return null;
};
const createStyleLiteral = (cmp, style, commentOriginalSelector) => {
  if (cmp.encapsulation === 'scoped' || (commentOriginalSelector && cmp.encapsulation === 'shadow')) {
    // scope the css first
    const scopeId = getScopeId(cmp.tagName, style.modeName);
    return t.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, commentOriginalSelector));
  }
  return t.factory.createStringLiteral(style.styleStr);
};
const createStyleIdentifierFromUrl = (cmp, style) => {
  style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
  style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
  if (style.modeName !== DEFAULT_STYLE_MODE) {
    style.styleIdentifier += dashToPascalCase$1(style.modeName);
  }
  style.styleIdentifier += 'Style';
  style.externalStyles = [style.externalStyles[0]];
  return t.factory.createIdentifier(style.styleIdentifier);
};

const addHydrateRuntimeCmpMeta = (classMembers, cmp) => {
  const compactMeta = formatComponentRuntimeMeta(cmp, true);
  const cmpMeta = {
    $flags$: compactMeta[0],
    $tagName$: compactMeta[1],
    $members$: compactMeta[2],
    $listeners$: compactMeta[3],
    $lazyBundleId$: fakeBundleIds(),
    $attrsToReflect$: getHydrateAttrsToReflect(cmp),
  };
  // We always need shadow-dom shim in hydrate runtime
  if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
    cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
  }
  const staticMember = createStaticGetter('cmpMeta', convertValueToLiteral(cmpMeta));
  const commentOriginalSelector = cmp.encapsulation === 'shadow';
  addStaticStyleGetterWithinClass(classMembers, cmp, commentOriginalSelector);
  classMembers.push(staticMember);
};
const fakeBundleIds = (_cmp) => {
  return '-';
};
const getHydrateAttrsToReflect = (cmp) => {
  return cmp.properties.reduce((attrs, prop) => {
    if (prop.reflect) {
      attrs.push([prop.name, prop.attribute]);
    }
    return attrs;
  }, []);
};

const updateHydrateComponentClass = (classNode, moduleFile, cmp) => {
  return t.factory.updateClassDeclaration(classNode, retrieveModifierLike(classNode), classNode.name, classNode.typeParameters, classNode.heritageClauses, updateHydrateHostComponentMembers(classNode, moduleFile, cmp));
};
const updateHydrateHostComponentMembers = (classNode, moduleFile, cmp) => {
  const classMembers = removeStaticMetaProperties(classNode);
  updateLazyComponentConstructor(classMembers, moduleFile, cmp);
  addLazyElementGetter(classMembers, moduleFile, cmp);
  addWatchers(classMembers, cmp);
  addHydrateRuntimeCmpMeta(classMembers, cmp);
  transformHostData(classMembers, moduleFile);
  return classMembers;
};

const hydrateComponentTransform = (compilerCtx, transformOpts) => {
  return (transformCtx) => {
    return (tsSourceFile) => {
      const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
      const visitNode = (node) => {
        if (t.isClassDeclaration(node)) {
          const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
          if (cmp != null) {
            return updateHydrateComponentClass(node, moduleFile, cmp);
          }
        }
        return t.visitEachChild(node, visitNode, transformCtx);
      };
      tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
      if (moduleFile.cmps.length > 0) {
        tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
      }
      if (moduleFile.isLegacy) {
        addLegacyApis(moduleFile);
      }
      tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
      return tsSourceFile;
    };
  };
};

const getHydrateBuildConditionals$1 = (cmps) => {
  const build = getBuildFeatures(cmps);
  build.slotRelocation = true;
  build.lazyLoad = true;
  build.hydrateServerSide = true;
  build.cssVarShim = false;
  build.hydrateClientSide = true;
  build.isDebug = false;
  build.isDev = false;
  build.isTesting = false;
  build.devTools = false;
  build.lifecycleDOMEvents = false;
  build.profile = false;
  build.hotModuleReplacement = false;
  build.updatable = true;
  build.member = true;
  build.constructableCSS = false;
  build.asyncLoading = true;
  build.appendChildSlotFix = false;
  build.slotChildNodesFix = false;
  build.cloneNodeFix = false;
  build.cssAnnotations = true;
  build.shadowDomShim = true;
  build.safari10 = false;
  build.hydratedAttribute = false;
  build.hydratedClass = true;
  build.scriptDataOpts = false;
  build.dynamicImportShim = false;
  build.attachStyles = true;
  return build;
};

const bundleHydrateFactory = async (config, compilerCtx, buildCtx, _build, appFactoryEntryCode) => {
  try {
    const bundleOpts = {
      id: 'hydrate',
      platform: 'hydrate',
      conditionals: getHydrateBuildConditionals$1(buildCtx.components),
      customTransformers: getHydrateCustomTransformer(config, compilerCtx),
      inlineDynamicImports: true,
      inputs: {
        '@app-factory-entry': '@app-factory-entry',
      },
      loader: {
        '@app-factory-entry': appFactoryEntryCode,
      },
    };
    const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
    return rollupBuild;
  }
  catch (e) {
    if (!buildCtx.hasError) {
      // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
      // breakable) and type safety (so that the error variable may be something other than `any`)
      loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
    }
  }
  return undefined;
};
const getHydrateCustomTransformer = (config, compilerCtx) => {
  const transformOpts = {
    coreImportPath: STENCIL_INTERNAL_HYDRATE_ID,
    componentExport: null,
    componentMetadata: null,
    currentDirectory: config.sys.getCurrentDirectory(),
    proxy: null,
    style: 'static',
    styleImportData: 'queryparams',
  };
  return [
    updateStencilCoreImports(transformOpts.coreImportPath),
    hydrateComponentTransform(compilerCtx, transformOpts),
    removeCollectionImports(compilerCtx),
  ];
};

const HYDRATE_APP_CLOSURE_START = `/*hydrateAppClosure start*/`;
const HYDRATE_FACTORY_INTRO = `
export function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) {
  var globalThis = $stencilWindow;
  var self = $stencilWindow;
  var top = $stencilWindow;
  var parent = $stencilWindow;

  var addEventListener = $stencilWindow.addEventListener.bind($stencilWindow);
  var alert = $stencilWindow.alert.bind($stencilWindow);
  var blur = $stencilWindow.blur.bind($stencilWindow);
  var cancelAnimationFrame = $stencilWindow.cancelAnimationFrame.bind($stencilWindow);
  var cancelIdleCallback = $stencilWindow.cancelIdleCallback.bind($stencilWindow);
  var clearInterval = $stencilWindow.clearInterval.bind($stencilWindow);
  var clearTimeout = $stencilWindow.clearTimeout.bind($stencilWindow);
  var close = () => {};
  var confirm = $stencilWindow.confirm.bind($stencilWindow);
  var dispatchEvent = $stencilWindow.dispatchEvent.bind($stencilWindow);
  var focus = $stencilWindow.focus.bind($stencilWindow);
  var getComputedStyle = $stencilWindow.getComputedStyle.bind($stencilWindow);
  var matchMedia = $stencilWindow.matchMedia.bind($stencilWindow);
  var open = $stencilWindow.open.bind($stencilWindow);
  var prompt = $stencilWindow.prompt.bind($stencilWindow);
  var removeEventListener = $stencilWindow.removeEventListener.bind($stencilWindow);
  var requestAnimationFrame = $stencilWindow.requestAnimationFrame.bind($stencilWindow);
  var requestIdleCallback = $stencilWindow.requestIdleCallback.bind($stencilWindow);
  var setInterval = $stencilWindow.setInterval.bind($stencilWindow);
  var setTimeout = $stencilWindow.setTimeout.bind($stencilWindow);

  var CharacterData = $stencilWindow.CharacterData;
  var CSS = $stencilWindow.CSS;
  var CustomEvent = $stencilWindow.CustomEvent;
  var Document = $stencilWindow.Document;
  var DocumentFragment = $stencilWindow.DocumentFragment;
  var DocumentType = $stencilWindow.DocumentType;
  var DOMTokenList = $stencilWindow.DOMTokenList;
  var Element = $stencilWindow.Element;
  var Event = $stencilWindow.Event;
  var HTMLAnchorElement = $stencilWindow.HTMLAnchorElement;
  var HTMLBaseElement = $stencilWindow.HTMLBaseElement;
  var HTMLButtonElement = $stencilWindow.HTMLButtonElement;
  var HTMLCanvasElement = $stencilWindow.HTMLCanvasElement;
  var HTMLElement = $stencilWindow.HTMLElement;
  var HTMLFormElement = $stencilWindow.HTMLFormElement;
  var HTMLImageElement = $stencilWindow.HTMLImageElement;
  var HTMLInputElement = $stencilWindow.HTMLInputElement;
  var HTMLLinkElement = $stencilWindow.HTMLLinkElement;
  var HTMLMetaElement = $stencilWindow.HTMLMetaElement;
  var HTMLScriptElement = $stencilWindow.HTMLScriptElement;
  var HTMLStyleElement = $stencilWindow.HTMLStyleElement;
  var HTMLTemplateElement = $stencilWindow.HTMLTemplateElement;
  var HTMLTitleElement = $stencilWindow.HTMLTitleElement;
  var IntersectionObserver = $stencilWindow.IntersectionObserver;
  var KeyboardEvent = $stencilWindow.KeyboardEvent;
  var MouseEvent = $stencilWindow.MouseEvent;
  var Node = $stencilWindow.Node;
  var NodeList = $stencilWindow.NodeList;
  var URL = $stencilWindow.URL;

  var console = $stencilWindow.console;
  var customElements = $stencilWindow.customElements;
  var history = $stencilWindow.history;
  var localStorage = $stencilWindow.localStorage;
  var location = $stencilWindow.location;
  var navigator = $stencilWindow.navigator;
  var performance = $stencilWindow.performance;
  var sessionStorage = $stencilWindow.sessionStorage;

  var devicePixelRatio = $stencilWindow.devicePixelRatio;
  var innerHeight = $stencilWindow.innerHeight;
  var innerWidth = $stencilWindow.innerWidth;
  var origin = $stencilWindow.origin;
  var pageXOffset = $stencilWindow.pageXOffset;
  var pageYOffset = $stencilWindow.pageYOffset;
  var screen = $stencilWindow.screen;
  var screenLeft = $stencilWindow.screenLeft;
  var screenTop = $stencilWindow.screenTop;
  var screenX = $stencilWindow.screenX;
  var screenY = $stencilWindow.screenY;
  var scrollX = $stencilWindow.scrollX;
  var scrollY = $stencilWindow.scrollY;
  var exports = {};

  var fetch, FetchError, Headers, Request, Response;

  if (typeof $stencilWindow.fetch === 'function') {
  fetch = $stencilWindow.fetch;
  } else {
  fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); };
  }

  if (typeof $stencilWindow.FetchError === 'function') {
  FetchError = $stencilWindow.FetchError;
  } else {
  FetchError = $stencilWindow.FetchError = class FetchError { constructor() { throw new Error('FetchError is not implemented'); } };
  }

  if (typeof $stencilWindow.Headers === 'function') {
  Headers = $stencilWindow.Headers;
  } else {
  Headers = $stencilWindow.Headers = class Headers { constructor() { throw new Error('Headers is not implemented'); } };
  }

  if (typeof $stencilWindow.Request === 'function') {
  Request = $stencilWindow.Request;
  } else {
  Request = $stencilWindow.Request = class Request { constructor() { throw new Error('Request is not implemented'); } };
  }

  if (typeof $stencilWindow.Response === 'function') {
  Response = $stencilWindow.Response;
  } else {
  Response = $stencilWindow.Response = class Response { constructor() { throw new Error('Response is not implemented'); } };
  }

  function hydrateAppClosure($stencilWindow) {
  const window = $stencilWindow;
  const document = $stencilWindow.document;
  ${HYDRATE_APP_CLOSURE_START}
`;
const HYDRATE_FACTORY_OUTRO = `
  /*hydrateAppClosure end*/
  hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve);
  }

  hydrateAppClosure($stencilWindow);
}
`;

const updateToHydrateComponents = async (cmps) => {
  const hydrateCmps = await Promise.all(cmps.map(updateToHydrateComponent));
  return sortBy(hydrateCmps, (c) => c.cmp.componentClassName);
};
const updateToHydrateComponent = async (cmp) => {
  const cmpData = {
    filePath: cmp.sourceFilePath,
    exportLine: ``,
    cmp: cmp,
    uniqueComponentClassName: ``,
    importLine: ``,
  };
  const pascalCasedClassName = dashToPascalCase$1(toTitleCase(cmp.tagName));
  if (cmp.componentClassName !== pascalCasedClassName) {
    cmpData.uniqueComponentClassName = pascalCasedClassName;
    cmpData.importLine = `import { ${cmp.componentClassName} as ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
  }
  else {
    cmpData.uniqueComponentClassName = cmp.componentClassName;
    cmpData.importLine = `import { ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
  }
  return cmpData;
};

const relocateHydrateContextConst = (config, compilerCtx, code) => {
  // for whatever reason, const Context = {};
  // is not hoisted to the correct location when bundled,
  // so manually doing it here
  // /*hydrate context start*/export const Context = {};/*hydrate context end*/
  const globalScripts = getGlobalScriptData(config, compilerCtx);
  if (globalScripts.length > 0) {
    const startCode = code.indexOf('/*hydrate context start*/');
    if (startCode > -1) {
      const endCode = code.indexOf('/*hydrate context end*/') + '/*hydrate context end*/'.length;
      const hydrateContextCode = code.substring(startCode, endCode);
      code = code.replace(hydrateContextCode, '');
      return code.replace(HYDRATE_APP_CLOSURE_START, HYDRATE_APP_CLOSURE_START + '\n  ' + hydrateContextCode);
    }
  }
  return code;
};

const writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupOutput) => {
  return Promise.all(outputTargets.map((outputTarget) => {
    return writeHydrateOutput(config, compilerCtx, buildCtx, outputTarget, rollupOutput);
  }));
};
const writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
  const hydratePackageName = await getHydratePackageName(config, compilerCtx);
  const hydrateAppDirPath = outputTarget.dir;
  const hydrateCoreIndexPath = join(hydrateAppDirPath, 'index.js');
  const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, 'index.d.ts');
  const pkgJsonPath = join(hydrateAppDirPath, 'package.json');
  const pkgJsonCode = getHydratePackageJson(config, hydrateCoreIndexPath, hydrateCoreIndexDtsFilePath, hydratePackageName);
  await Promise.all([
    copyHydrateRunnerDts(config, compilerCtx, hydrateAppDirPath),
    compilerCtx.fs.writeFile(pkgJsonPath, pkgJsonCode),
  ]);
  // always remember a path to the hydrate app that the prerendering may need later on
  buildCtx.hydrateAppFilePath = hydrateCoreIndexPath;
  await Promise.all(rollupOutput.output.map(async (output) => {
    if (output.type === 'chunk') {
      output.code = relocateHydrateContextConst(config, compilerCtx, output.code);
      const filePath = join(hydrateAppDirPath, output.fileName);
      await compilerCtx.fs.writeFile(filePath, output.code, { immediateWrite: true });
    }
  }));
};
const getHydratePackageJson = (config, hydrateAppFilePath, hydrateDtsFilePath, hydratePackageName) => {
  const pkg = {
    name: hydratePackageName,
    description: `${config.namespace} component hydration app.`,
    main: basename(hydrateAppFilePath),
    types: basename(hydrateDtsFilePath),
  };
  return JSON.stringify(pkg, null, 2);
};
const getHydratePackageName = async (config, compilerCtx) => {
  try {
    const rootPkgFilePath = join(config.rootDir, 'package.json');
    const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
    const pkgData = JSON.parse(pkgStr);
    return `${pkgData.name}/hydrate`;
  }
  catch (e) { }
  return `${config.fsNamespace}/hydrate`;
};
const copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
  const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
  const srcHydrateDir = join(packageDir, 'internal', 'hydrate', 'runner.d.ts');
  const runnerDtsDestPath = join(hydrateAppDirPath, 'index.d.ts');
  await compilerCtx.fs.copyFile(srcHydrateDir, runnerDtsDestPath);
};

const generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
  try {
    const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
    const input = join(packageDir, 'internal', 'hydrate', 'runner.js');
    const mockDoc = join(packageDir, 'mock-doc', 'index.js');
    const rollupOptions = {
      ...config.rollupConfig.inputOptions,
      input,
      inlineDynamicImports: true,
      plugins: [
        {
          name: 'hydrateAppPlugin',
          resolveId(id) {
            if (id === STENCIL_HYDRATE_FACTORY_ID) {
              return id;
            }
            if (id === STENCIL_MOCK_DOC_ID) {
              return mockDoc;
            }
            return null;
          },
          load(id) {
            if (id === STENCIL_HYDRATE_FACTORY_ID) {
              return generateHydrateFactory(config, compilerCtx, buildCtx);
            }
            return null;
          },
        },
      ],
      treeshake: false,
      onwarn: createOnWarnFn(buildCtx.diagnostics),
    };
    const rollupAppBuild = await rollup(rollupOptions);
    const rollupOutput = await rollupAppBuild.generate({
      banner: generatePreamble(config),
      format: 'cjs',
      file: 'index.js',
    });
    await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
  }
  catch (e) {
    if (!buildCtx.hasError) {
      // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
      // breakable) and type safety (so that the error variable may be something other than `any`)
      loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
    }
  }
};
const generateHydrateFactory = async (config, compilerCtx, buildCtx) => {
  if (!buildCtx.hasError) {
    try {
      const cmps = buildCtx.components;
      const build = getHydrateBuildConditionals(config, cmps);
      const appFactoryEntryCode = await generateHydrateFactoryEntry(buildCtx);
      const rollupFactoryBuild = await bundleHydrateFactory(config, compilerCtx, buildCtx, build, appFactoryEntryCode);
      if (rollupFactoryBuild != null) {
        const rollupOutput = await rollupFactoryBuild.generate({
          format: 'cjs',
          esModule: false,
          strict: false,
          intro: HYDRATE_FACTORY_INTRO,
          outro: HYDRATE_FACTORY_OUTRO,
          preferConst: false,
        });
        if (!buildCtx.hasError && rollupOutput != null && Array.isArray(rollupOutput.output)) {
          return rollupOutput.output[0].code;
        }
      }
    }
    catch (e) {
      catchError(buildCtx.diagnostics, e);
    }
  }
  return '';
};
const generateHydrateFactoryEntry = async (buildCtx) => {
  const cmps = buildCtx.components;
  const hydrateCmps = await updateToHydrateComponents(cmps);
  const s = new MagicString$3('');
  s.append(`import { hydrateApp, registerComponents, styles } from '${STENCIL_INTERNAL_HYDRATE_ID}';\n`);
  hydrateCmps.forEach((cmpData) => s.append(cmpData.importLine + '\n'));
  s.append(`registerComponents([\n`);
  hydrateCmps.forEach((cmpData) => {
    s.append(`  ${cmpData.uniqueComponentClassName},\n`);
  });
  s.append(`]);\n`);
  s.append(`export { hydrateApp }\n`);
  return s.toString();
};
const getHydrateBuildConditionals = (config, cmps) => {
  const build = getBuildFeatures(cmps);
  build.lazyLoad = true;
  build.hydrateClientSide = false;
  build.hydrateServerSide = true;
  updateBuildConditionals(config, build);
  build.lifecycleDOMEvents = false;
  build.devTools = false;
  build.hotModuleReplacement = false;
  build.cloneNodeFix = false;
  build.appendChildSlotFix = false;
  build.slotChildNodesFix = false;
  build.safari10 = false;
  build.shadowDomShim = false;
  return build;
};

const outputHydrateScript = async (config, compilerCtx, buildCtx) => {
  const hydrateOutputTargets = config.outputTargets.filter(isOutputTargetHydrate);
  if (hydrateOutputTargets.length > 0) {
    const timespan = buildCtx.createTimeSpan(`generate hydrate app started`);
    await generateHydrateApp(config, compilerCtx, buildCtx, hydrateOutputTargets);
    timespan.finish(`generate hydrate app finished`);
  }
};

/**
 * Scan the provided `doc` for any known Stencil components
 * @param doc the Document to scan
 * @param cmps the compiler metadata of known Stencil components
 * @returns a list of all tags that were identified as known Stencil components
 */
const getUsedComponents = (doc, cmps) => {
  const tags = new Set(cmps.map((cmp) => cmp.tagName.toUpperCase()));
  const found = [];
  const searchComponents = (el) => {
    if (tags.has(el.tagName)) {
      found.push(el.tagName.toLowerCase());
    }
    for (let i = 0; i < el.childElementCount; i++) {
      searchComponents(el.children[i]);
    }
  };
  searchComponents(doc.documentElement);
  return found;
};

/**
 * Retrieve the component bundle groupings to be used when generating output
 * @param config the Stencil configuration used for the build
 * @param buildCtx the current build context
 * @param cmps the components that have been registered & defined for the current build
 * @returns the component bundling data
 */
function getDefaultBundles(config, buildCtx, cmps) {
  // get all of the user defined bundles in the Stencil config file
  const userConfigEntryPoints = getUserConfigBundles(config, buildCtx, cmps);
  if (userConfigEntryPoints.length > 0) {
    // prefer user defined entry points over anything else Stencil may derive
    return userConfigEntryPoints;
  }
  let entryPointsHints = config.entryComponentsHint;
  if (!entryPointsHints && buildCtx.indexDoc) {
    // attempt to scan an HTML file for known Stencil components
    entryPointsHints = getUsedComponents(buildCtx.indexDoc, cmps);
  }
  if (!entryPointsHints) {
    return [];
  }
  const mainBundle = unique([
    ...entryPointsHints,
    ...flatOne(entryPointsHints.map(resolveTag).map((cmp) => cmp.dependencies)),
  ]).map(resolveTag);
  function resolveTag(tag) {
    return cmps.find((cmp) => cmp.tagName === tag);
  }
  return [mainBundle];
}
/**
 * Retrieve and validate the `bundles` field on a project's Stencil configuration file
 * @param config the configuration file with a `bundles` field to inspect
 * @param buildCtx the current build context
 * @param cmps the components that have been registered & defined for the current build
 * @returns a three dimensional array with the compiler metadata for each component used
 */
function getUserConfigBundles(config, buildCtx, cmps) {
  const definedTags = new Set();
  const entryTags = config.bundles.map((b) => {
    return b.components
      .map((tag) => {
      const tagError = validateComponentTag(tag);
      if (tagError) {
        const err = buildError(buildCtx.diagnostics);
        err.header = `Stencil Config`;
        err.messageText = tagError;
      }
      const component = cmps.find((cmp) => cmp.tagName === tag);
      if (!component) {
        const warn = buildWarn(buildCtx.diagnostics);
        warn.header = `Stencil Config`;
        warn.messageText = `Component tag "${tag}" is defined in a bundle but no matching component was found within this app or its collections.`;
      }
      if (definedTags.has(tag)) {
        const warn = buildWarn(buildCtx.diagnostics);
        warn.header = `Stencil Config`;
        warn.messageText = `Component tag "${tag}" has been defined multiple times in the "bundles" config.`;
      }
      definedTags.add(tag);
      return component;
    })
      .sort();
  });
  return entryTags;
}

/**
 * Generate a list of all component tags that will be used by the output
 * @param config the Stencil configuration used for the build
 * @param defaultBundles metadata of the assumed components being used/bundled
 * @param allCmps all known components
 * @returns a set of all component tags that are used
 */
function computeUsedComponents(config, defaultBundles, allCmps) {
  if (!config.excludeUnusedDependencies) {
    // the user/config has specified that Stencil should use all the dependencies it's found, return the set of all
    // known tags
    return new Set(allCmps.map((c) => c.tagName));
  }
  const usedComponents = new Set();
  // All components
  defaultBundles.forEach((entry) => {
    entry.forEach((cmp) => usedComponents.add(cmp.tagName));
  });
  allCmps.forEach((cmp) => {
    if (!cmp.isCollectionDependency) {
      usedComponents.add(cmp.tagName);
    }
  });
  allCmps.forEach((cmp) => {
    if (cmp.isCollectionDependency) {
      if (cmp.dependents.some((dep) => usedComponents.has(dep))) {
        usedComponents.add(cmp.tagName);
      }
    }
  });
  return usedComponents;
}
/**
 * Generate the bundles that will be used during the bundling process
 * @param config the Stencil configuration used for the build
 * @param buildCtx the current build context
 * @returns the bundles to be used during the bundling process
 */
function generateComponentBundles(config, buildCtx) {
  const cmps = sortBy(buildCtx.components, (cmp) => cmp.dependents.length);
  const defaultBundles = getDefaultBundles(config, buildCtx, cmps);
  const usedComponents = computeUsedComponents(config, defaultBundles, cmps);
  if (config.devMode) {
    return cmps
      .filter((c) => usedComponents.has(c.tagName))
      .map((cmp) => [cmp]);
  }
  // Visit components that are already in one of the default bundlers
  const alreadyBundled = new Set();
  defaultBundles.forEach((entry) => {
    entry.forEach((cmp) => alreadyBundled.add(cmp));
  });
  const bundlers = cmps
    .filter((cmp) => usedComponents.has(cmp.tagName) && !alreadyBundled.has(cmp))
    .map((c) => [c]);
  return [...defaultBundles, ...optimizeBundlers(bundlers, 0.6)].filter((b) => b.length > 0);
}
/**
 * Calculate and reorganize bundles based on a calculated similarity score between bundle entries
 * @param bundles the bundles to reorganize
 * @param threshold a numeric value used to determine whether or not bundles should be reorganized
 * @returns the reorganized bundles
 */
function optimizeBundlers(bundles, threshold) {
  /**
   * build a mapping of component tag names in each `bundles` entry to the index where that entry occurs in `bundles`:
   * ```ts
   * bundles = [
   *   [
   *   {
   *     tagName: 'my-foo', ...<other_fields>,
   *   },
   *   ],
   *   [
   *   {
   *     tagName: 'my-bar', ...<other_fields>,
   *   },
   *   {
   *     tagName: 'my-baz', ...<other_fields>,
   *   },
   *   ],
   * ];
   * // yields
   * {
   *   'my-foo': 0,
   *   'my-bar': 1,
   *   'my-baz': 1,
   * }
   * ```
   * note that in the event of a component being found >1 time, store the index of the last entry in which it's found
   */
  const cmpIndexMap = new Map();
  bundles.forEach((entry, index) => {
    entry.forEach((cmp) => {
      cmpIndexMap.set(cmp.tagName, index);
    });
  });
  // build a record of components
  const matrix = bundles.map((entry) => {
    const vector = new Uint8Array(bundles.length);
    entry.forEach((cmp) => {
      // for each dependent of a component, check to see if the dependent has been seen already when the `cmpIndexMap`
      // was originally built. If so, mark it with a '1'
      cmp.dependents.forEach((tag) => {
        const index = cmpIndexMap.get(tag);
        if (index !== undefined) {
          vector[index] = 1;
        }
      });
    });
    entry.forEach((cmp) => {
      // for each entry, check to see if the component has been seen already when the `cmpIndexMap` was originally
      // built. If so, mark it with a '0', potentially overriding a previously set value on the vector.
      const index = cmpIndexMap.get(cmp.tagName);
      if (index !== undefined) {
        vector[index] = 0;
      }
    });
    return vector;
  });
  // resolve similar components
  const newBundles = [];
  const visited = new Uint8Array(bundles.length);
  for (let i = 0; i < matrix.length; i++) {
    // check if bundle is visited (0 means it's not)
    if (visited[i] === 0) {
      const bundle = [...bundles[i]];
      visited[i] = 1;
      for (let j = i + 1; j < matrix.length; j++) {
        if (visited[j] === 0 && computeScore(matrix[i], matrix[j]) >= threshold) {
          bundle.push(...bundles[j]);
          visited[j] = 1;
        }
      }
      newBundles.push(bundle);
    }
  }
  return newBundles;
}
/**
 * Computes a 'score' between two arrays, that is defined as the number of times that the value at a given index is the
 * same in both arrays divided by the number of times the value in either array is high at the given index.
 * @param m0 the first array to calculate sameness with
 * @param m1 the second array to calculate sameness with
 * @returns the calculated score
 */
function computeScore(m0, m1) {
  let total = 0;
  let match = 0;
  for (let i = 0; i < m0.length; i++) {
    if (m0[i] === 1 || m1[i] === 1) {
      total++;
      if (m0[i] === m1[i]) {
        match++;
      }
    }
  }
  return match / total;
}

const generateModuleGraph = (cmps, bundleModules) => {
  const cmpMap = new Map();
  cmps.forEach((cmp) => {
    const bundle = bundleModules.find((b) => b.cmps.includes(cmp));
    if (bundle) {
      // add default case for no mode
      cmpMap.set(getScopeId(cmp.tagName), bundle.rollupResult.imports);
    }
  });
  return cmpMap;
};

const updateLazyComponentClass = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
  const members = updateLazyComponentMembers(transformOpts, styleStatements, classNode, moduleFile, cmp);
  return updateComponentClass(transformOpts, classNode, classNode.heritageClauses, members);
};
const updateLazyComponentMembers = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
  const classMembers = removeStaticMetaProperties(classNode);
  updateLazyComponentConstructor(classMembers, moduleFile, cmp);
  addLazyElementGetter(classMembers, moduleFile, cmp);
  addWatchers(classMembers, cmp);
  transformHostData(classMembers, moduleFile);
  if (transformOpts.style === 'static') {
    addStaticStylePropertyToClass(styleStatements, cmp);
  }
  return classMembers;
};

const lazyComponentTransform = (compilerCtx, transformOpts) => {
  return (transformCtx) => {
    return (tsSourceFile) => {
      const styleStatements = [];
      const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
      const visitNode = (node) => {
        if (t.isClassDeclaration(node)) {
          const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
          if (cmp != null) {
            return updateLazyComponentClass(transformOpts, styleStatements, node, moduleFile, cmp);
          }
        }
        return t.visitEachChild(node, visitNode, transformCtx);
      };
      tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
      if (moduleFile.cmps.length > 0) {
        tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
      }
      if (moduleFile.isLegacy) {
        addLegacyApis(moduleFile);
      }
      tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
      if (styleStatements.length > 0) {
        tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [...tsSourceFile.statements, ...styleStatements]);
      }
      return tsSourceFile;
    };
  };
};

/**
 * Generate rollup output based on a rollup build and a series of options.
 *
 * @param build a rollup build
 * @param options output options for rollup
 * @param config a user-supplied configuration object
 * @param entryModules a list of entry modules, for checking which chunks
 * contain components
 * @returns a Promise wrapping either build results or `null`
 */
const generateRollupOutput = async (build, options, config, entryModules) => {
  if (build == null) {
    return null;
  }
  const { output } = await build.generate(options);
  return output.map((chunk) => {
    if (chunk.type === 'chunk') {
      const isCore = Object.keys(chunk.modules).some((m) => m.includes(STENCIL_CORE_ID));
      return {
        type: 'chunk',
        fileName: chunk.fileName,
        map: chunk.map,
        code: chunk.code,
        moduleFormat: options.format,
        entryKey: chunk.name,
        imports: chunk.imports,
        isEntry: !!chunk.isEntry,
        isComponent: !!chunk.isEntry && entryModules.some((m) => m.entryKey === chunk.name),
        isBrowserLoader: chunk.isEntry && chunk.name === config.fsNamespace,
        isIndex: chunk.isEntry && chunk.name === 'index',
        isCore,
      };
    }
    else {
      return {
        type: 'asset',
        fileName: chunk.fileName,
        content: chunk.source,
      };
    }
  });
};

const writeLazyModule = async (config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix) => {
  // code = replaceStylePlaceholders(entryModule.cmps, modeName, code);
  const bundleId = await getBundleId(config, entryModule.entryKey, shouldHash, code, sufix);
  const fileName = `${bundleId}.entry.js`;
  if (sourceMap) {
    code = code + getSourceMappingUrlForEndOfFile(fileName);
  }
  await Promise.all(destinations.map((dst) => {
    compilerCtx.fs.writeFile(join(dst, fileName), code, { outputTargetType });
    if (!!sourceMap) {
      compilerCtx.fs.writeFile(join(dst, fileName) + '.map', JSON.stringify(sourceMap), { outputTargetType });
    }
  }));
  return {
    bundleId,
    fileName,
    code,
  };
};
const getBundleId = async (config, entryKey, shouldHash, code, sufix) => {
  if (shouldHash) {
    const hash = await config.sys.generateContentHash(code, config.hashedFileNameLength);
    return `p-${hash}${sufix}`;
  }
  const components = entryKey.split('.');
  let bundleId = components[0];
  if (components.length > 2) {
    bundleId = `${bundleId}_${components.length - 1}`;
  }
  return bundleId + sufix;
};

const generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType, destinations, results, sourceTarget, isBrowserBuild, sufix) => {
  var _a;
  if (!Array.isArray(destinations) || destinations.length === 0) {
    return [];
  }
  const shouldMinify = config.minifyJs && isBrowserBuild;
  const rollupResults = results.filter((r) => r.type === 'chunk');
  const entryComponentsResults = rollupResults.filter((rollupResult) => rollupResult.isComponent);
  const chunkResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && !rollupResult.isEntry);
  const bundleModules = await Promise.all(entryComponentsResults.map((rollupResult) => {
    return generateLazyEntryModule(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix);
  }));
  if (!!((_a = config.extras) === null || _a === void 0 ? void 0 : _a.experimentalImportInjection) && !isBrowserBuild) {
    addStaticImports(rollupResults, bundleModules);
  }
  await Promise.all(chunkResults.map((rollupResult) => {
    return writeLazyChunk(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild);
  }));
  const lazyRuntimeData = formatLazyBundlesRuntimeMeta(bundleModules);
  const entryResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && rollupResult.isEntry);
  await Promise.all(entryResults.map((rollupResult) => {
    return writeLazyEntry(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild);
  }));
  await Promise.all(results
    .filter((r) => r.type === 'asset')
    .map((r) => {
    return Promise.all(destinations.map((dest) => {
      return compilerCtx.fs.writeFile(join(dest, r.fileName), r.content);
    }));
  }));
  return bundleModules;
};
/**
 * Add imports for each bundle to Stencil's lazy loader. Some bundlers that are built atop of Rollup strictly impose
 * the limitations that are laid out in https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations.
 * This function injects an explicit import statement for each bundle that can be lazily loaded.
 * @param rollupChunkResults the results of running Rollup across a Stencil project
 * @param bundleModules lazy-loadable modules that can be resolved at runtime
 */
const addStaticImports = (rollupChunkResults, bundleModules) => {
  rollupChunkResults.filter(isStencilCoreResult).forEach((index) => {
    const generateCjs = isCjsFormat(index) ? generateCaseClauseCjs : generateCaseClause;
    index.code = index.code.replace('/*!__STENCIL_STATIC_IMPORT_SWITCH__*/', `
    if (!hmrVersionId || !BUILD.hotModuleReplacement) {
      const processMod = importedModule => {
        cmpModules.set(bundleId, importedModule);
        return importedModule[exportName];
      }
      switch(bundleId) {
        ${bundleModules.map((mod) => generateCjs(mod.output.bundleId)).join('')}
      }
    }`);
  });
};
/**
 * Determine if a Rollup output chunk contains Stencil runtime code
 * @param rollupChunkResult the rollup chunk output to test
 * @returns true if the output chunk contains Stencil runtime code, false otherwise
 */
const isStencilCoreResult = (rollupChunkResult) => {
  return (rollupChunkResult.isCore &&
    rollupChunkResult.entryKey === 'index' &&
    (rollupChunkResult.moduleFormat === 'es' ||
      rollupChunkResult.moduleFormat === 'esm' ||
      isCjsFormat(rollupChunkResult)));
};
/**
 * Helper function to determine if a Rollup chunk has a commonjs module format
 * @param rollupChunkResult the Rollup result to test
 * @returns true if the Rollup chunk has a commonjs module format, false otherwise
 */
const isCjsFormat = (rollupChunkResult) => {
  return rollupChunkResult.moduleFormat === 'cjs' || rollupChunkResult.moduleFormat === 'commonjs';
};
/**
 * Generate a 'case' clause to be used within a `switch` statement. The case clause generated will key-off the provided
 * bundle ID for a component, and load a file (tied to that ID) at runtime.
 * @param bundleId the name of the bundle to load
 * @returns the case clause that will load the component's file at runtime
 */
const generateCaseClause = (bundleId) => {
  return `
        case '${bundleId}':
          return import(
            /* webpackMode: "lazy" */
            './${bundleId}.entry.js').then(processMod, consoleError);`;
};
/**
 * Generate a 'case' clause to be used within a `switch` statement. The case clause generated will key-off the provided
 * bundle ID for a component, and load a CommonJS file (tied to that ID) at runtime.
 * @param bundleId the name of the bundle to load
 * @returns the case clause that will load the component's file at runtime
 */
const generateCaseClauseCjs = (bundleId) => {
  return `
        case '${bundleId}':
          return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
            /* webpackMode: "lazy" */
            './${bundleId}.entry.js')); }).then(processMod, consoleError);`;
};
const generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix) => {
  const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === rollupResult.entryKey);
  const shouldHash = config.hashFileNames && isBrowserBuild;
  const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, rollupResult.code, rollupResult.map);
  const output = await writeLazyModule(config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix);
  return {
    rollupResult,
    entryKey: rollupResult.entryKey,
    cmps: entryModule.cmps,
    output,
  };
};
const writeLazyChunk = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild) => {
  const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, rollupResult.isCore, isBrowserBuild, rollupResult.code, rollupResult.map);
  await Promise.all(destinations.map((dst) => {
    const filePath = join(dst, rollupResult.fileName);
    let fileCode = code;
    if (rollupResult.map) {
      fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
      compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
    }
    compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
  }));
};
const writeLazyEntry = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild) => {
  if (isBrowserBuild && ['loader'].includes(rollupResult.entryKey)) {
    return;
  }
  const inputCode = rollupResult.code.replace(`[/*!__STENCIL_LAZY_DATA__*/]`, `${lazyRuntimeData}`);
  const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, inputCode, rollupResult.map);
  await Promise.all(destinations.map((dst) => {
    const filePath = join(dst, rollupResult.fileName);
    let fileCode = code;
    if (sourceMap) {
      fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
      compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
    }
    return compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
  }));
};
const formatLazyBundlesRuntimeMeta = (bundleModules) => {
  const sortedBundles = bundleModules.slice().sort(sortBundleModules);
  const lazyBundles = sortedBundles.map(formatLazyRuntimeBundle);
  return stringifyRuntimeData(lazyBundles);
};
const formatLazyRuntimeBundle = (bundleModule) => {
  const bundleId = bundleModule.output.bundleId;
  const bundleCmps = bundleModule.cmps.slice().sort(sortBundleComponents);
  return [bundleId, bundleCmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
};
const sortBundleModules = (a, b) => {
  const aDependents = a.cmps.reduce((dependents, cmp) => {
    dependents.push(...cmp.dependents);
    return dependents;
  }, []);
  const bDependents = b.cmps.reduce((dependents, cmp) => {
    dependents.push(...cmp.dependents);
    return dependents;
  }, []);
  if (a.cmps.some((cmp) => bDependents.includes(cmp.tagName)))
    return 1;
  if (b.cmps.some((cmp) => aDependents.includes(cmp.tagName)))
    return -1;
  const aDependencies = a.cmps.reduce((dependencies, cmp) => {
    dependencies.push(...cmp.dependencies);
    return dependencies;
  }, []);
  const bDependencies = b.cmps.reduce((dependencies, cmp) => {
    dependencies.push(...cmp.dependencies);
    return dependencies;
  }, []);
  if (a.cmps.some((cmp) => bDependencies.includes(cmp.tagName)))
    return -1;
  if (b.cmps.some((cmp) => aDependencies.includes(cmp.tagName)))
    return 1;
  if (aDependents.length < bDependents.length)
    return -1;
  if (aDependents.length > bDependents.length)
    return 1;
  if (aDependencies.length > bDependencies.length)
    return -1;
  if (aDependencies.length < bDependencies.length)
    return 1;
  const aTags = a.cmps.map((cmp) => cmp.tagName);
  const bTags = b.cmps.map((cmp) => cmp.tagName);
  if (aTags.length > bTags.length)
    return -1;
  if (aTags.length < bTags.length)
    return 1;
  const aTagsStr = aTags.sort().join('.');
  const bTagsStr = bTags.sort().join('.');
  if (aTagsStr < bTagsStr)
    return -1;
  if (aTagsStr > bTagsStr)
    return 1;
  return 0;
};
const sortBundleComponents = (a, b) => {
  // <cmp-a>
  //   <cmp-b>
  //   <cmp-c></cmp-c>
  //   </cmp-b>
  // </cmp-a>
  // cmp-c is a dependency of cmp-a and cmp-b
  // cmp-c is a directDependency of cmp-b
  // cmp-a is a dependant of cmp-b and cmp-c
  // cmp-a is a directDependant of cmp-b
  if (a.directDependents.includes(b.tagName))
    return 1;
  if (b.directDependents.includes(a.tagName))
    return -1;
  if (a.directDependencies.includes(b.tagName))
    return 1;
  if (b.directDependencies.includes(a.tagName))
    return -1;
  if (a.dependents.includes(b.tagName))
    return 1;
  if (b.dependents.includes(a.tagName))
    return -1;
  if (a.dependencies.includes(b.tagName))
    return 1;
  if (b.dependencies.includes(a.tagName))
    return -1;
  if (a.dependents.length < b.dependents.length)
    return -1;
  if (a.dependents.length > b.dependents.length)
    return 1;
  if (a.dependencies.length > b.dependencies.length)
    return -1;
  if (a.dependencies.length < b.dependencies.length)
    return 1;
  if (a.tagName < b.tagName)
    return -1;
  if (a.tagName > b.tagName)
    return 1;
  return 0;
};
const convertChunk = async (config, compilerCtx, buildCtx, sourceTarget, shouldMinify, isCore, isBrowserBuild, code, rollupSrcMap) => {
  let sourceMap = rollupToStencilSourceMap(rollupSrcMap);
  const inlineHelpers = isBrowserBuild || !hasDependency(buildCtx, 'tslib');
  const optimizeResults = await optimizeModule(config, compilerCtx, {
    input: code,
    sourceMap: sourceMap,
    isCore,
    sourceTarget,
    inlineHelpers,
    minify: shouldMinify,
  });
  buildCtx.diagnostics.push(...optimizeResults.diagnostics);
  if (typeof optimizeResults.output === 'string') {
    code = optimizeResults.output;
    sourceMap = optimizeResults.sourceMap;
  }
  return { code, sourceMap };
};

const generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  const cjsOutputs = outputTargets.filter((o) => !!o.cjsDir);
  if (cjsOutputs.length > 0) {
    const outputTargetType = cjsOutputs[0].type;
    const esmOpts = {
      banner: generatePreamble(config),
      format: 'cjs',
      entryFileNames: '[name].cjs.js',
      assetFileNames: '[name]-[hash][extname]',
      preferConst: true,
      sourcemap: config.sourceMap,
    };
    const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
    if (results != null) {
      const destinations = cjsOutputs.map((o) => o.cjsDir);
      buildCtx.commonJsComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, destinations, results, 'es2017', false, '.cjs');
      await generateShortcuts$1(compilerCtx, results, cjsOutputs);
    }
  }
  return { name: 'cjs', buildCtx };
};
const generateShortcuts$1 = (compilerCtx, rollupResult, outputTargets) => {
  const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
  return Promise.all(outputTargets.map(async (o) => {
    if (o.cjsIndexFile) {
      const entryPointPath = join(o.cjsDir, indexFilename);
      const relativePath = relativeImport(o.cjsIndexFile, entryPointPath);
      const shortcutContent = `module.exports = require('${relativePath}');\n`;
      await compilerCtx.fs.writeFile(o.cjsIndexFile, shortcutContent, { outputTargetType: o.type });
    }
  }));
};

const generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  const esmEs5Outputs = config.buildEs5 ? outputTargets.filter((o) => !!o.esmEs5Dir && !o.isBrowserBuild) : [];
  const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !o.isBrowserBuild);
  if (esmOutputs.length + esmEs5Outputs.length > 0) {
    const esmOpts = {
      banner: generatePreamble(config),
      format: 'es',
      entryFileNames: '[name].js',
      assetFileNames: '[name]-[hash][extname]',
      preferConst: true,
      sourcemap: config.sourceMap,
    };
    const outputTargetType = esmOutputs[0].type;
    const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
    if (output != null) {
      const es2017destinations = esmOutputs.map((o) => o.esmDir);
      buildCtx.esmComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', false, '');
      const es5destinations = esmEs5Outputs.map((o) => o.esmEs5Dir);
      buildCtx.es5ComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es5destinations, output, 'es5', false, '');
      await copyPolyfills(config, compilerCtx, esmOutputs);
      await generateShortcuts(config, compilerCtx, outputTargets, output);
    }
  }
  return { name: 'esm', buildCtx };
};
const copyPolyfills = async (config, compilerCtx, outputTargets) => {
  const destinations = outputTargets.filter((o) => o.polyfills).map((o) => o.esmDir);
  if (destinations.length === 0) {
    return;
  }
  const src = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills');
  const files = await compilerCtx.fs.readdir(src);
  await Promise.all(destinations.map((dest) => {
    return Promise.all(files.map((f) => {
      return compilerCtx.fs.copyFile(f.absPath, join(dest, 'polyfills', f.relPath));
    }));
  }));
};
const generateShortcuts = (config, compilerCtx, outputTargets, rollupResult) => {
  const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
  return Promise.all(outputTargets.map(async (o) => {
    if (o.esmDir && o.esmIndexFile) {
      const entryPointPath = config.buildEs5 && o.esmEs5Dir ? join(o.esmEs5Dir, indexFilename) : join(o.esmDir, indexFilename);
      const relativePath = relativeImport(o.esmIndexFile, entryPointPath);
      const shortcutContent = `export * from '${relativePath}';`;
      await compilerCtx.fs.writeFile(o.esmIndexFile, shortcutContent, { outputTargetType: o.type });
    }
  }));
};

const generateEsmBrowser = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !!o.isBrowserBuild);
  if (esmOutputs.length) {
    const outputTargetType = esmOutputs[0].type;
    const esmOpts = {
      banner: generatePreamble(config),
      format: 'es',
      entryFileNames: '[name].esm.js',
      chunkFileNames: config.hashFileNames ? 'p-[hash].js' : '[name]-[hash].js',
      assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
      preferConst: true,
      sourcemap: config.sourceMap,
    };
    if (config.extras.dynamicImportShim) {
      // for Edge 16-18
      esmOpts.dynamicImportFunction = getDynamicImportFunction$1(config.fsNamespace);
    }
    const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
    if (output != null) {
      const es2017destinations = esmOutputs.map((o) => o.esmDir);
      buildCtx.esmBrowserComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', true, '');
    }
  }
  return { name: 'esm-browser', buildCtx };
};

const getClientPolyfill = async (config, compilerCtx, polyfillFile) => {
  const polyfillFilePath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills', polyfillFile);
  return compilerCtx.fs.readFile(polyfillFilePath);
};
const getAppBrowserCorePolyfills = async (config, compilerCtx) => {
  // read all the polyfill content, in this particular order
  const polyfills = INLINE_POLYFILLS.slice();
  if (config.extras.cssVarsShim) {
    polyfills.push(INLINE_CSS_SHIM);
  }
  const results = await Promise.all(polyfills.map((polyfillFile) => getClientPolyfill(config, compilerCtx, polyfillFile)));
  // concat the polyfills
  return results.join('\n').trim();
};
// order of the polyfills matters!! test test test
// actual source of the polyfills are found in /src/client/polyfills/
const INLINE_POLYFILLS = ['core-js.js', 'dom.js', 'es5-html-element.js', 'system.js'];
const INLINE_CSS_SHIM = 'css-shim.js';

const generateSystem = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  const systemOutputs = outputTargets.filter((o) => !!o.systemDir);
  if (systemOutputs.length > 0) {
    const esmOpts = {
      banner: generatePreamble(config),
      format: 'system',
      entryFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name].system.js',
      chunkFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name]-[hash].system.js',
      assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
      preferConst: true,
      sourcemap: config.sourceMap,
    };
    const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
    if (results != null) {
      const destinations = systemOutputs.map((o) => o.esmDir);
      buildCtx.systemComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargets[0].type, destinations, results, 'es5', true, '.system');
      await generateSystemLoaders(config, compilerCtx, results, systemOutputs);
    }
  }
  return { name: 'system', buildCtx };
};
const generateSystemLoaders = (config, compilerCtx, rollupResult, systemOutputs) => {
  const loaderFilename = rollupResult.find((r) => r.type === 'chunk' && r.isBrowserLoader).fileName;
  return Promise.all(systemOutputs.map((o) => writeSystemLoader(config, compilerCtx, loaderFilename, o)));
};
const writeSystemLoader = async (config, compilerCtx, loaderFilename, outputTarget) => {
  if (outputTarget.systemLoaderFile) {
    const entryPointPath = join(outputTarget.systemDir, loaderFilename);
    const relativePath = relativeImport(outputTarget.systemLoaderFile, entryPointPath);
    const loaderContent = await getSystemLoader(config, compilerCtx, relativePath, outputTarget.polyfills);
    await compilerCtx.fs.writeFile(outputTarget.systemLoaderFile, loaderContent, {
      outputTargetType: outputTarget.type,
    });
  }
};
const getSystemLoader = async (config, compilerCtx, corePath, includePolyfills) => {
  const polyfills = includePolyfills
    ? await getAppBrowserCorePolyfills(config, compilerCtx)
    : '/* polyfills excluded */';
  return `
'use strict';
(function () {
  var currentScript = document.currentScript;

  // Safari 10 support type="module" but still download and executes the nomodule script
  if (!currentScript || !currentScript.hasAttribute('nomodule') || !('onbeforeload' in currentScript)) {

  ${polyfills}

  // Figure out currentScript (for IE11, since it does not support currentScript)
  var regex = /\\/${config.fsNamespace}(\\.esm)?\\.js($|\\?|#)/;
  var scriptElm = currentScript || Array.from(document.querySelectorAll('script')).find(function(s) {
    return regex.test(s.src) || s.getAttribute('data-stencil-namespace') === "${config.fsNamespace}";
  });

  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
  var start = function() {
    // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
    var url = new URL('${corePath}', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
    System.import(url.href);
  };

  if (window.__cssshim) {
    window.__cssshim.i().then(start);
  } else {
    start();
  }

  // Note: using .call(window) here because the self-executing function needs
  // to be scoped to the window object for the ES6Promise polyfill to work
  }
}).call(window);
`;
};

const getLazyBuildConditionals = (config, cmps) => {
  const build = getBuildFeatures(cmps);
  build.lazyLoad = true;
  build.hydrateServerSide = false;
  build.cssVarShim = config.extras.cssVarsShim;
  build.transformTagName = config.extras.tagNameTransform;
  build.asyncQueue = config.taskQueue === 'congestionAsync';
  build.taskQueue = config.taskQueue !== 'immediate';
  build.initializeNextTick = config.extras.initializeNextTick;
  const hasHydrateOutputTargets = config.outputTargets.some(isOutputTargetHydrate);
  build.hydrateClientSide = hasHydrateOutputTargets;
  updateBuildConditionals(config, build);
  return build;
};

const outputLazy = async (config, compilerCtx, buildCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistLazy);
  if (outputTargets.length === 0) {
    return;
  }
  const bundleEventMessage = `generate lazy${config.sourceMap ? ' + source maps' : ''}`;
  const timespan = buildCtx.createTimeSpan(`${bundleEventMessage} started`);
  try {
    const bundleOpts = {
      id: 'lazy',
      platform: 'client',
      conditionals: getLazyBuildConditionals(config, buildCtx.components),
      customTransformers: getLazyCustomTransformer(config, compilerCtx),
      inlineWorkers: config.outputTargets.some(isOutputTargetDist),
      inputs: {
        [config.fsNamespace]: LAZY_BROWSER_ENTRY_ID,
        loader: LAZY_EXTERNAL_ENTRY_ID,
        index: USER_INDEX_ENTRY_ID,
      },
      loader: {
        [LAZY_EXTERNAL_ENTRY_ID]: getLazyEntry(false),
        [LAZY_BROWSER_ENTRY_ID]: getLazyEntry(true),
      },
    };
    // we've got the compiler context filled with app modules and collection dependency modules
    // figure out how all these components should be connected
    generateEntryModules(config, buildCtx);
    buildCtx.entryModules.forEach((entryModule) => {
      bundleOpts.inputs[entryModule.entryKey] = entryModule.entryKey;
    });
    const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
    if (rollupBuild != null) {
      const results = await Promise.all([
        generateEsmBrowser(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
        generateEsm(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
        generateSystem(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
        generateCjs(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
      ]);
      results.forEach((result) => {
        if (result.name === 'cjs') {
          buildCtx.commonJsComponentBundle = result.buildCtx.commonJsComponentBundle;
        }
        else if (result.name === 'system') {
          buildCtx.systemComponentBundle = result.buildCtx.systemComponentBundle;
        }
        else if (result.name === 'esm') {
          buildCtx.esmComponentBundle = result.buildCtx.esmComponentBundle;
          buildCtx.es5ComponentBundle = result.buildCtx.es5ComponentBundle;
        }
        else if (result.name === 'esm-browser') {
          buildCtx.esmBrowserComponentBundle = result.buildCtx.esmBrowserComponentBundle;
          buildCtx.buildResults = result.buildCtx.buildResults;
          buildCtx.components = result.buildCtx.components;
        }
      });
      if (buildCtx.esmBrowserComponentBundle != null) {
        buildCtx.componentGraph = generateModuleGraph(buildCtx.components, buildCtx.esmBrowserComponentBundle);
      }
    }
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
  timespan.finish(`${bundleEventMessage} finished`);
};
const getLazyCustomTransformer = (config, compilerCtx) => {
  const transformOpts = {
    coreImportPath: STENCIL_CORE_ID,
    componentExport: 'lazy',
    componentMetadata: null,
    currentDirectory: config.sys.getCurrentDirectory(),
    proxy: null,
    style: 'static',
    styleImportData: 'queryparams',
  };
  return [
    updateStencilCoreImports(transformOpts.coreImportPath),
    lazyComponentTransform(compilerCtx, transformOpts),
    removeCollectionImports(compilerCtx),
  ];
};
/**
 * Generate entry modules to be used by the build process by determining how modules and components are connected
 * @param config the Stencil configuration file that was provided as a part of the build step
 * @param buildCtx the current build context
 */
function generateEntryModules(config, buildCtx) {
  // figure out how modules and components connect
  try {
    const bundles = generateComponentBundles(config, buildCtx);
    buildCtx.entryModules = bundles.map(createEntryModule);
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
  buildCtx.debug(`generateEntryModules, ${buildCtx.entryModules.length} entryModules`);
}
/**
 * Generates an entry module to be used during the bundling process
 * @param cmps the component metadata to create a single entry module from
 * @returns the entry module generated
 */
function createEntryModule(cmps) {
  // generate a unique entry key based on the components within this entry module
  cmps = sortBy(cmps, (c) => c.tagName);
  const entryKey = cmps.map((c) => c.tagName).join('.') + '.entry';
  return {
    cmps,
    entryKey,
  };
}
const getLazyEntry = (isBrowser) => {
  const s = new MagicString$3(``);
  s.append(`export { setNonce } from '${STENCIL_CORE_ID}';\n`);
  s.append(`import { bootstrapLazy } from '${STENCIL_CORE_ID}';\n`);
  if (isBrowser) {
    s.append(`import { patchBrowser } from '${STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID}';\n`);
    s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
    s.append(`patchBrowser().then(options => {\n`);
    s.append(`  globalScripts();\n`);
    s.append(`  return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
    s.append(`});\n`);
  }
  else {
    s.append(`import { patchEsm } from '${STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID}';\n`);
    s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
    s.append(`export const defineCustomElements = (win, options) => {\n`);
    s.append(`  if (typeof window === 'undefined') return Promise.resolve();\n`);
    s.append(`  return patchEsm().then(() => {\n`);
    s.append(`  globalScripts();\n`);
    s.append(`  return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
    s.append(`  });\n`);
    s.append(`};\n`);
  }
  return s.toString();
};

const outputAngular = async (config, compilerCtx, buildCtx) => {
  if (!config.buildDist) {
    return;
  }
  const angularOutputTargets = config.outputTargets.filter(isOutputTargetAngular);
  if (angularOutputTargets.length === 0) {
    return;
  }
  const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
  await Promise.all(angularOutputTargets.map((outputTarget) => angularDirectiveProxyOutput(config, compilerCtx, buildCtx, outputTarget)));
  timespan.finish(`generate angular proxies finished`);
};
const angularDirectiveProxyOutput = (config, compilerCtx, buildCtx, outputTarget) => {
  const filteredComponents = getFilteredComponents(outputTarget.excludeComponents, buildCtx.components);
  return Promise.all([
    generateProxies(config, compilerCtx, buildCtx, filteredComponents, outputTarget),
    generateAngularArray(compilerCtx, filteredComponents, outputTarget),
    generateAngularUtils(compilerCtx, outputTarget),
  ]);
};
const getFilteredComponents = (excludeComponents = [], cmps) => {
  return sortBy(cmps, (cmp) => cmp.tagName).filter((c) => !excludeComponents.includes(c.tagName) && !c.internal);
};
const generateProxies = async (config, compilerCtx, buildCtx, components, outputTarget) => {
  const proxies = getProxies(components);
  const distTypesDir = dirname(buildCtx.packageJson.types);
  const dtsFilePath = join(config.rootDir, distTypesDir, GENERATED_DTS);
  const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
  const imports = `/* eslint-disable */
/* tslint:disable */
/* auto-generated angular directive proxies */
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone } from '@angular/core';`;
  const sourceImports = !outputTarget.componentCorePackage
    ? `import { Components } from '${componentsTypeFile}';`
    : `import { Components } from '${outputTarget.componentCorePackage}';`;
  const final = [imports, getProxyUtils(outputTarget), sourceImports, proxies];
  const finalText = final.join('\n') + '\n';
  const tsSourceFile = t.createSourceFile(GENERATED_DTS, finalText, t.ScriptTarget.Latest, false);
  const tsPrinter = t.createPrinter({
    newLine: t.NewLineKind.LineFeed,
  });
  const formattedCode = tsPrinter.printFile(tsSourceFile);
  return compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, formattedCode);
};
const getProxies = (components) => {
  return components.map(getProxy).join('\n');
};
const getProxyCmp = (inputs, methods) => {
  const hasInputs = inputs.length > 0;
  const hasMethods = methods.length > 0;
  const proxMeta = [];
  if (!hasInputs && !hasMethods) {
    return '';
  }
  if (hasInputs)
    proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
  if (hasMethods)
    proxMeta.push(`'methods': ['${methods.join(`', '`)}']`);
  return `@ProxyCmp({${proxMeta.join(', ')}})`;
};
const getProxy = (cmpMeta) => {
  // Collect component meta
  const inputs = getInputs(cmpMeta);
  const outputs = getOutputs(cmpMeta);
  const methods = getMethods(cmpMeta);
  const hasOutputs = outputs.length > 0;
  // Generate Angular @Directive
  const directiveOpts = [
    `selector: \'${cmpMeta.tagName}\'`,
    `changeDetection: ChangeDetectionStrategy.OnPush`,
    `template: '<ng-content></ng-content>'`,
  ];
  if (inputs.length > 0) {
    directiveOpts.push(`inputs: ['${inputs.join(`', '`)}']`);
  }
  const tagNameAsPascal = dashToPascalCase$1(cmpMeta.tagName);
  const lines = [
    `
export declare interface ${tagNameAsPascal} extends Components.${tagNameAsPascal} {}
${getProxyCmp(inputs, methods)}
@Component({ ${directiveOpts.join(', ')} })
export class ${tagNameAsPascal} {`,
  ];
  // Generate outputs
  outputs.forEach((output) => {
    lines.push(`  ${output}!: EventEmitter<CustomEvent>;`);
  });
  lines.push('  protected el: HTMLElement;');
  lines.push(`  constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
  c.detach();
  this.el = r.nativeElement;`);
  if (hasOutputs) {
    lines.push(`  proxyOutputs(this, this.el, ['${outputs.join(`', '`)}']);`);
  }
  lines.push(`  }`);
  lines.push(`}`);
  return lines.join('\n');
};
const getInputs = (cmpMeta) => {
  return [
    ...cmpMeta.properties.filter((prop) => !prop.internal).map((prop) => prop.name),
    ...cmpMeta.virtualProperties.map((prop) => prop.name),
  ].sort();
};
const getOutputs = (cmpMeta) => {
  return cmpMeta.events.filter((ev) => !ev.internal).map((prop) => prop.name);
};
const getMethods = (cmpMeta) => {
  return cmpMeta.methods.filter((method) => !method.internal).map((prop) => prop.name);
};
const getProxyUtils = (outputTarget) => {
  if (!outputTarget.directivesUtilsFile) {
    return PROXY_UTILS.replace(/export function/g, 'function');
  }
  else {
    const utilsPath = relativeImport(outputTarget.directivesProxyFile, outputTarget.directivesUtilsFile, '.ts');
    return `import { ProxyCmp, proxyOutputs } from '${utilsPath}';\n`;
  }
};
const generateAngularArray = (compilerCtx, components, outputTarget) => {
  if (!outputTarget.directivesArrayFile) {
    return Promise.resolve();
  }
  const proxyPath = relativeImport(outputTarget.directivesArrayFile, outputTarget.directivesProxyFile, '.ts');
  const directives = components
    .map((cmpMeta) => dashToPascalCase$1(cmpMeta.tagName))
    .map((className) => `  d.${className}`)
    .join(',\n');
  const c = `
import type * as d from '${proxyPath}';

export const DIRECTIVES = [
${directives}
];
`;
  return compilerCtx.fs.writeFile(outputTarget.directivesArrayFile, c);
};
const generateAngularUtils = async (compilerCtx, outputTarget) => {
  if (outputTarget.directivesUtilsFile) {
    await compilerCtx.fs.writeFile(outputTarget.directivesUtilsFile, '/* eslint-disable */\n/* tslint:disable */\n' + PROXY_UTILS);
  }
};
const PROXY_UTILS = `import { fromEvent } from 'rxjs';

export const proxyInputs = (Cmp: any, inputs: string[]) => {
  const Prototype = Cmp.prototype;
  inputs.forEach(item => {
  Object.defineProperty(Prototype, item, {
    get() {
    return this.el[item];
    },
    set(val: any) {
    this.z.runOutsideAngular(() => (this.el[item] = val));
    }
  });
  });
};

export const proxyMethods = (Cmp: any, methods: string[]) => {
  const Prototype = Cmp.prototype;
  methods.forEach(methodName => {
  Prototype[methodName] = function () {
    const args = arguments;
    return this.z.runOutsideAngular(() =>
    this.el[methodName].apply(this.el, args)
    );
  };
  });
};

export const proxyOutputs = (instance: any, el: any, events: string[]) => {
  events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
}

export function ProxyCmp(opts: { inputs?: any; methods?: any }) {
  const decorator =  function(cls: any){
  if (opts.inputs) {
    proxyInputs(cls, opts.inputs);
  }
  if (opts.methods) {
    proxyMethods(cls, opts.methods);
  }
  return cls;
  };
  return decorator;
}
`;
const GENERATED_DTS = 'components.d.ts';

const generateCustomDocs = async (config, docsData, outputTargets) => {
  const customOutputTargets = outputTargets.filter(isOutputTargetDocsCustom);
  if (customOutputTargets.length === 0) {
    return;
  }
  await Promise.all(customOutputTargets.map(async (customOutput) => {
    try {
      await customOutput.generator(docsData, config);
    }
    catch (e) {
      config.logger.error(`uncaught custom docs error: ${e}`);
    }
  }));
};

/**
 * A new BuildCtx object is created for every build
 * and rebuild.
 */
class BuildContext {
  constructor(config, compilerCtx) {
    this.buildId = -1;
    this.buildMessages = [];
    this.buildResults = null;
    this.bundleBuildCount = 0;
    this.collections = [];
    this.completedTasks = [];
    this.components = [];
    this.componentGraph = new Map();
    this.data = {};
    this.buildStats = undefined;
    this.diagnostics = [];
    this.dirsAdded = [];
    this.dirsDeleted = [];
    this.entryModules = [];
    this.filesAdded = [];
    this.filesChanged = [];
    this.filesDeleted = [];
    this.filesUpdated = [];
    this.filesWritten = [];
    this.globalStyle = undefined;
    this.hasConfigChanges = false;
    this.hasFinished = false;
    this.hasHtmlChanges = false;
    this.hasPrintedResults = false;
    this.hasServiceWorkerChanges = false;
    this.hasScriptChanges = true;
    this.hasStyleChanges = true;
    this.hydrateAppFilePath = null;
    this.indexBuildCount = 0;
    this.indexDoc = undefined;
    this.isRebuild = false;
    this.moduleFiles = [];
    this.outputs = [];
    this.packageJson = {};
    this.packageJsonFilePath = null;
    this.pendingCopyTasks = [];
    this.requiresFullBuild = true;
    this.scriptsAdded = [];
    this.scriptsDeleted = [];
    this.startTime = Date.now();
    this.styleBuildCount = 0;
    this.stylesPromise = null;
    this.stylesUpdated = [];
    this.timeSpan = null;
    this.transpileBuildCount = 0;
    this.config = config;
    this.compilerCtx = compilerCtx;
    this.buildId = ++this.compilerCtx.activeBuildId;
    this.debug = config.logger.debug.bind(config.logger);
  }
  start() {
    // get the build id from the incremented activeBuildId
    // print out a good message
    const msg = `${this.isRebuild ? 'rebuild' : 'build'}, ${this.config.fsNamespace}, ${this.config.devMode ? 'dev' : 'prod'} mode, started`;
    const buildLog = {
      buildId: this.buildId,
      messages: [],
      progress: 0,
    };
    this.compilerCtx.events.emit('buildLog', buildLog);
    // create a timespan for this build
    this.timeSpan = this.createTimeSpan(msg);
    // create a build timestamp for this build
    this.timestamp = getBuildTimestamp();
    // debug log our new build
    this.debug(`start build, ${this.timestamp}`);
    const buildStart = {
      buildId: this.buildId,
      timestamp: this.timestamp,
    };
    this.compilerCtx.events.emit('buildStart', buildStart);
  }
  createTimeSpan(msg, debug) {
    if (!this.hasFinished || debug) {
      if (debug) {
        if (this.config.watch) {
          msg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${msg}`;
        }
      }
      const timeSpan = this.config.logger.createTimeSpan(msg, debug, this.buildMessages);
      if (!debug && this.compilerCtx.events) {
        const buildLog = {
          buildId: this.buildId,
          messages: this.buildMessages,
          progress: getProgress(this.completedTasks),
        };
        this.compilerCtx.events.emit('buildLog', buildLog);
      }
      return {
        duration: () => {
          return timeSpan.duration();
        },
        finish: (finishedMsg, color, bold, newLineSuffix) => {
          if (!this.hasFinished || debug) {
            if (debug) {
              if (this.config.watch) {
                finishedMsg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${finishedMsg}`;
              }
            }
            timeSpan.finish(finishedMsg, color, bold, newLineSuffix);
            if (!debug) {
              const buildLog = {
                buildId: this.buildId,
                messages: this.buildMessages.slice(),
                progress: getProgress(this.completedTasks),
              };
              this.compilerCtx.events.emit('buildLog', buildLog);
            }
          }
          return timeSpan.duration();
        },
      };
    }
    return {
      duration() {
        return 0;
      },
      finish() {
        return 0;
      },
    };
  }
  debug(msg) {
    this.config.logger.debug(msg);
  }
  get hasError() {
    return hasError(this.diagnostics);
  }
  get hasWarning() {
    return hasWarning(this.diagnostics);
  }
  progress(t) {
    this.completedTasks.push(t);
  }
  async validateTypesBuild() {
    if (this.hasError) {
      // no need to wait on this one since
      // we already aborted this build
      return;
    }
    if (!this.validateTypesPromise) {
      // there is no pending validate types promise
      // so it probably already finished
      // so no need to wait on anything
      return;
    }
    if (!this.config.watch) {
      // this is not a watch build, so we need to make
      // sure that the type validation has finished
      this.debug(`build, non-watch, waiting on validateTypes`);
      await this.validateTypesPromise;
      this.debug(`build, non-watch, finished waiting on validateTypes`);
    }
  }
}
/**
 * Generate a timestamp of the format `YYYY-MM-DDThh:mm:ss`, using the number of seconds that have elapsed since
 * January 01, 1970, and the time this function was called
 * @returns the generated timestamp
 */
const getBuildTimestamp = () => {
  const d = new Date();
  // YYYY-MM-DDThh:mm:ss
  let timestamp = d.getUTCFullYear() + '-';
  timestamp += ('0' + (d.getUTCMonth() + 1)).slice(-2) + '-';
  timestamp += ('0' + d.getUTCDate()).slice(-2) + 'T';
  timestamp += ('0' + d.getUTCHours()).slice(-2) + ':';
  timestamp += ('0' + d.getUTCMinutes()).slice(-2) + ':';
  timestamp += ('0' + d.getUTCSeconds()).slice(-2);
  return timestamp;
};
const getProgress = (completedTasks) => {
  let progressIndex = 0;
  const taskKeys = Object.keys(ProgressTask);
  taskKeys.forEach((taskKey, index) => {
    if (completedTasks.includes(ProgressTask[taskKey])) {
      progressIndex = index;
    }
  });
  return (progressIndex + 1) / taskKeys.length;
};
const ProgressTask = {
  emptyOutputTargets: {},
  transpileApp: {},
  generateStyles: {},
  generateOutputTargets: {},
  validateTypesBuild: {},
  writeBuildFiles: {},
};

const AUTO_GENERATE_COMMENT = `<!-- Auto Generated Below -->`;
const NOTE = `*Built with [StencilJS](https://stenciljs.com/)*`;

/**
 * Generate metadata that will be used to generate any given documentation-related output target(s)
 * @param config the configuration associated with the current Stencil task run
 * @param compilerCtx the current compiler context
 * @param buildCtx the build context for the current Stencil task run
 * @returns the generated metadata
 */
const generateDocData = async (config, compilerCtx, buildCtx) => {
  return {
    timestamp: getBuildTimestamp(),
    compiler: {
      name: '@stencil/core',
      version: version$3,
      typescriptVersion,
    },
    components: await getDocsComponents(config, compilerCtx, buildCtx),
  };
};
/**
 * Derive the metadata for each Stencil component
 * @param config the configuration associated with the current Stencil task run
 * @param compilerCtx the current compiler context
 * @param buildCtx the build context for the current Stencil task run
 * @returns the derived metadata
 */
const getDocsComponents = async (config, compilerCtx, buildCtx) => {
  const results = await Promise.all(buildCtx.moduleFiles.map(async (moduleFile) => {
    const filePath = moduleFile.sourceFilePath;
    const dirPath = normalizePath$2(dirname(filePath));
    const readmePath = normalizePath$2(join(dirPath, 'readme.md'));
    const usagesDir = normalizePath$2(join(dirPath, 'usage'));
    const readme = await getUserReadmeContent(compilerCtx, readmePath);
    const usage = await generateUsages(compilerCtx, usagesDir);
    return moduleFile.cmps
      .filter((cmp) => !cmp.internal && !cmp.isCollectionDependency)
      .map((cmp) => ({
      dirPath,
      filePath: relative$1(config.rootDir, filePath),
      fileName: basename(filePath),
      readmePath,
      usagesDir,
      tag: cmp.tagName,
      readme,
      overview: cmp.docs.text,
      usage,
      docs: generateDocs(readme, cmp.docs),
      docsTags: cmp.docs.tags,
      encapsulation: getDocsEncapsulation(cmp),
      dependents: cmp.directDependents,
      dependencies: cmp.directDependencies,
      dependencyGraph: buildDocsDepGraph(cmp, buildCtx.components),
      deprecation: getDocsDeprecationText(cmp.docs.tags),
      props: getDocsProperties(cmp),
      methods: getDocsMethods(cmp.methods),
      events: getDocsEvents(cmp.events),
      styles: getDocsStyles(cmp),
      slots: getDocsSlots(cmp.docs.tags),
      parts: getDocsParts(cmp.htmlParts, cmp.docs.tags),
      listeners: getDocsListeners(cmp.listeners),
    }));
  }));
  return sortBy(flatOne(results), (cmp) => cmp.tag);
};
const buildDocsDepGraph = (cmp, cmps) => {
  const dependencies = {};
  function walk(tagName) {
    if (!dependencies[tagName]) {
      const cmp = cmps.find((c) => c.tagName === tagName);
      const deps = cmp.directDependencies;
      if (deps.length > 0) {
        dependencies[tagName] = deps;
        deps.forEach(walk);
      }
    }
  }
  walk(cmp.tagName);
  // load dependents
  cmp.directDependents.forEach((tagName) => {
    if (dependencies[tagName] && !dependencies[tagName].includes(cmp.tagName)) {
      dependencies[tagName].push(cmp.tagName);
    }
    else {
      dependencies[tagName] = [cmp.tagName];
    }
  });
  return dependencies;
};
/**
 * Determines the encapsulation string to use, based on the provided compiler metadata
 * @param cmp the metadata for a single component
 * @returns the encapsulation level, expressed as a string
 */
const getDocsEncapsulation = (cmp) => {
  if (cmp.encapsulation === 'shadow') {
    return 'shadow';
  }
  else if (cmp.encapsulation === 'scoped') {
    return 'scoped';
  }
  else {
    return 'none';
  }
};
const getDocsProperties = (cmpMeta) => {
  return sortBy([...getRealProperties(cmpMeta.properties), ...getVirtualProperties(cmpMeta.virtualProperties)], (p) => p.name);
};
const getRealProperties = (properties) => {
  return properties
    .filter((member) => !member.internal)
    .map((member) => ({
    name: member.name,
    type: member.complexType.resolved,
    mutable: member.mutable,
    attr: member.attribute,
    reflectToAttr: !!member.reflect,
    docs: member.docs.text,
    docsTags: member.docs.tags,
    default: member.defaultValue,
    deprecation: getDocsDeprecationText(member.docs.tags),
    values: parseTypeIntoValues(member.complexType.resolved),
    optional: member.optional,
    required: member.required,
  }));
};
const getVirtualProperties = (virtualProps) => {
  return virtualProps.map((member) => ({
    name: member.name,
    type: member.type,
    mutable: false,
    attr: member.name,
    reflectToAttr: false,
    docs: member.docs,
    docsTags: [],
    default: undefined,
    deprecation: undefined,
    values: parseTypeIntoValues(member.type),
    optional: true,
    required: false,
  }));
};
const parseTypeIntoValues = (type) => {
  if (typeof type === 'string') {
    const unions = type.split('|').map((u) => u.trim());
    const parsedUnions = [];
    unions.forEach((u) => {
      if (u === 'true') {
        parsedUnions.push({
          value: 'true',
          type: 'boolean',
        });
        return;
      }
      if (u === 'false') {
        parsedUnions.push({
          value: 'false',
          type: 'boolean',
        });
        return;
      }
      if (!Number.isNaN(parseFloat(u))) {
        // union is a number
        parsedUnions.push({
          value: u,
          type: 'number',
        });
        return;
      }
      if (/^("|').+("|')$/gm.test(u)) {
        // ionic is a string
        parsedUnions.push({
          value: u.slice(1, -1),
          type: 'string',
        });
        return;
      }
      parsedUnions.push({
        type: u,
      });
    });
    return parsedUnions;
  }
  return [];
};
const getDocsMethods = (methods) => {
  return sortBy(methods, (member) => member.name)
    .filter((member) => !member.internal)
    .map((member) => ({
    name: member.name,
    returns: {
      type: member.complexType.return,
      docs: member.docs.tags
        .filter((t) => t.name === 'return' || t.name === 'returns')
        .map((t) => t.text)
        .join('\n'),
    },
    signature: `${member.name}${member.complexType.signature}`,
    parameters: [],
    docs: member.docs.text,
    docsTags: member.docs.tags,
    deprecation: getDocsDeprecationText(member.docs.tags),
  }));
};
const getDocsEvents = (events) => {
  return sortBy(events, (eventMeta) => eventMeta.name.toLowerCase())
    .filter((eventMeta) => !eventMeta.internal)
    .map((eventMeta) => ({
    event: eventMeta.name,
    detail: eventMeta.complexType.resolved,
    bubbles: eventMeta.bubbles,
    cancelable: eventMeta.cancelable,
    composed: eventMeta.composed,
    docs: eventMeta.docs.text,
    docsTags: eventMeta.docs.tags,
    deprecation: getDocsDeprecationText(eventMeta.docs.tags),
  }));
};
const getDocsStyles = (cmpMeta) => {
  if (!cmpMeta.styleDocs) {
    return [];
  }
  return sortBy(cmpMeta.styleDocs, (o) => o.name.toLowerCase()).map((styleDoc) => {
    return {
      name: styleDoc.name,
      annotation: styleDoc.annotation || '',
      docs: styleDoc.docs || '',
    };
  });
};
const getDocsListeners = (listeners) => {
  return listeners.map((listener) => ({
    event: listener.name,
    target: listener.target,
    capture: listener.capture,
    passive: listener.passive,
  }));
};
/**
 * Get the text associated with a `@deprecated` tag, if one exists
 * @param tags the tags associated with a JSDoc block on a node in the AST
 * @returns the text associated with the first found `@deprecated` tag. If a `@deprecated` tag exists but does not
 * have associated text, an empty string is returned. If no such tag is found, return `undefined`
 */
const getDocsDeprecationText = (tags) => {
  const deprecation = tags.find((t) => t.name === 'deprecated');
  if (deprecation) {
    return deprecation.text || '';
  }
  return undefined;
};
const getDocsSlots = (tags) => {
  return sortBy(getNameText('slot', tags).map(([name, docs]) => ({ name, docs })), (a) => a.name);
};
const getDocsParts = (vdom, tags) => {
  const docsParts = getNameText('part', tags).map(([name, docs]) => ({ name, docs }));
  const vdomParts = vdom.map((name) => ({ name, docs: '' }));
  return sortBy(unique([...docsParts, ...vdomParts], (p) => p.name), (p) => p.name);
};
const getNameText = (name, tags) => {
  return tags
    .filter((tag) => tag.name === name && tag.text)
    .map(({ text }) => {
    const [namePart, ...rest] = (' ' + text).split(' - ');
    return [namePart.trim(), rest.join(' - ').trim()];
  });
};
/**
 * Attempts to read a pre-existing README.md file from disk, returning any content generated by the user.
 *
 * For simplicity's sake, it is assumed that all user-generated content will fall before {@link AUTO_GENERATE_COMMENT}
 *
 * @param compilerCtx the current compiler context
 * @param readmePath the path to the README file to read
 * @returns the user generated content that occurs before {@link AUTO_GENERATE_COMMENT}. If no user generated content
 * exists, or if there was an issue reading the file, return `undefined`
 */
const getUserReadmeContent = async (compilerCtx, readmePath) => {
  try {
    const existingContent = await compilerCtx.fs.readFile(readmePath);
    // subtract one to get everything up to, but not including the auto generated comment
    const userContentIndex = existingContent.indexOf(AUTO_GENERATE_COMMENT) - 1;
    if (userContentIndex >= 0) {
      return existingContent.substring(0, userContentIndex);
    }
  }
  catch (e) { }
  return undefined;
};
/**
 * Generate documentation for a given component based on the provided JSDoc and README contents
 * @param readme the contents of a component's README file, without any autogenerated contents
 * @param jsdoc the JSDoc associated with the component's declaration
 * @returns the generated documentation
 */
const generateDocs = (readme, jsdoc) => {
  const docs = jsdoc.text;
  if (docs !== '' || !readme) {
    // just return the existing docs if they exist. these would have been captured earlier in the compilation process.
    // if they don't exist, and there's no README to process, return an empty string.
    return docs;
  }
  /**
   * Parse the README, storing the first section of content.
   * Content is defined as the area between two non-consecutive lines that start with a '#':
   * ```
   * # Header 1
   * This is some content
   * # Header 2
   * This is more content
   * # Header 3
   * Again, content
   * ```
   * In the example above, this chunk of code is designed to capture "This is some content"
   */
  let isContent = false;
  const lines = readme.split('\n');
  const contentLines = [];
  for (const line of lines) {
    const isHeader = line.startsWith('#');
    if (isHeader && isContent) {
      // we were actively parsing content, but found a new header, break out
      break;
    }
    if (!isHeader && !isContent) {
      // we've found content for the first time, set this sentinel to `true`
      isContent = true;
    }
    if (isContent) {
      // we're actively parsing the first found block of content, add it to our list for later
      contentLines.push(line);
    }
  }
  return contentLines.join('\n').trim();
};
/**
 * This function is responsible for reading the contents of all markdown files in a provided `usage` directory and
 * returning their contents
 * @param compilerCtx the current compiler context
 * @param usagesDir the directory to read usage markdown files from
 * @returns an object that maps the filename containing the usage example, to the file's contents. If an error occurs,
 * an empty object is returned.
 */
const generateUsages = async (compilerCtx, usagesDir) => {
  const rtn = {};
  try {
    const usageFilePaths = await compilerCtx.fs.readdir(usagesDir);
    const usages = {};
    await Promise.all(usageFilePaths.map(async (f) => {
      if (!f.isFile) {
        return;
      }
      const fileName = basename(f.relPath);
      if (!fileName.toLowerCase().endsWith('.md')) {
        return;
      }
      const parts = fileName.split('.');
      parts.pop();
      const key = parts.join('.');
      usages[key] = await compilerCtx.fs.readFile(f.absPath);
    }));
    Object.keys(usages)
      .sort()
      .forEach((key) => {
      rtn[key] = usages[key];
    });
  }
  catch (e) { }
  return rtn;
};

const generateJsonDocs = async (config, compilerCtx, docsData, outputTargets) => {
  const jsonOutputTargets = outputTargets.filter(isOutputTargetDocsJson);
  if (jsonOutputTargets.length === 0) {
    return;
  }
  const docsDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'stencil-public-docs.d.ts');
  const docsDts = await compilerCtx.fs.readFile(docsDtsPath);
  const typesContent = `
/**
 * This is an autogenerated file created by the Stencil compiler.
 * DO NOT MODIFY IT MANUALLY
 */
${docsDts}
declare const _default: JsonDocs;
export default _default;
`;
  const json = {
    ...docsData,
    components: docsData.components.map((cmp) => ({
      filePath: cmp.filePath,
      encapsulation: cmp.encapsulation,
      tag: cmp.tag,
      readme: cmp.readme,
      docs: cmp.docs,
      docsTags: cmp.docsTags,
      usage: cmp.usage,
      props: cmp.props,
      methods: cmp.methods,
      events: cmp.events,
      listeners: cmp.listeners,
      styles: cmp.styles,
      slots: cmp.slots,
      parts: cmp.parts,
      dependents: cmp.dependents,
      dependencies: cmp.dependencies,
      dependencyGraph: cmp.dependencyGraph,
      deprecation: cmp.deprecation,
    })),
  };
  const jsonContent = JSON.stringify(json, null, 2);
  await Promise.all(jsonOutputTargets.map((jsonOutput) => {
    return writeDocsOutput(compilerCtx, jsonOutput, jsonContent, typesContent);
  }));
};
const writeDocsOutput = async (compilerCtx, jsonOutput, jsonContent, typesContent) => {
  return Promise.all([
    compilerCtx.fs.writeFile(jsonOutput.file, jsonContent),
    jsonOutput.typesFile ? compilerCtx.fs.writeFile(jsonOutput.typesFile, typesContent) : Promise.resolve(),
  ]);
};

class MarkdownTable {
  constructor() {
    this.rows = [];
  }
  addHeader(data) {
    this.addRow(data, true);
  }
  addRow(data, isHeader = false) {
    const colData = [];
    data.forEach((text) => {
      const col = {
        text: escapeMarkdownTableColumn(text),
        width: text.length,
      };
      colData.push(col);
    });
    this.rows.push({
      columns: colData,
      isHeader: isHeader,
    });
  }
  toMarkdown() {
    return createTable(this.rows);
  }
}
const escapeMarkdownTableColumn = (text) => {
  text = text.replace(/\r?\n/g, ' ');
  text = text.replace(/\|/g, '\\|');
  return text;
};
const createTable = (rows) => {
  const content = [];
  if (rows.length === 0) {
    return content;
  }
  normalizeColumCount(rows);
  normalizeColumnWidth(rows);
  const th = rows.find((r) => r.isHeader);
  if (th) {
    const headerRow = createRow(th);
    content.push(headerRow);
    content.push(createBorder(th));
  }
  const tds = rows.filter((r) => !r.isHeader);
  tds.forEach((td) => {
    content.push(createRow(td));
  });
  return content;
};
const createBorder = (th) => {
  const border = {
    columns: [],
    isHeader: false,
  };
  th.columns.forEach((c) => {
    const borderCol = {
      text: '',
      width: c.width,
    };
    while (borderCol.text.length < borderCol.width) {
      borderCol.text += '-';
    }
    border.columns.push(borderCol);
  });
  return createRow(border);
};
const createRow = (row) => {
  const content = ['| '];
  row.columns.forEach((c) => {
    content.push(c.text);
    content.push(' | ');
  });
  return content.join('').trim();
};
const normalizeColumCount = (rows) => {
  let columnCount = 0;
  rows.forEach((r) => {
    if (r.columns.length > columnCount) {
      columnCount = r.columns.length;
    }
  });
  rows.forEach((r) => {
    while (r.columns.length < columnCount) {
      r.columns.push({
        text: ``,
        width: 0,
      });
    }
  });
};
const normalizeColumnWidth = (rows) => {
  const columnCount = rows[0].columns.length;
  for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {
    let longestText = 0;
    rows.forEach((r) => {
      const col = r.columns[columnIndex];
      if (col.text.length > longestText) {
        longestText = col.text.length;
      }
    });
    rows.forEach((r) => {
      const col = r.columns[columnIndex];
      col.width = longestText;
      while (col.text.length < longestText) {
        col.text += ' ';
      }
    });
  }
};

const stylesToMarkdown = (styles) => {
  const content = [];
  if (styles.length === 0) {
    return content;
  }
  content.push(`## CSS Custom Properties`);
  content.push(``);
  const table = new MarkdownTable();
  table.addHeader(['Name', 'Description']);
  styles.forEach((style) => {
    table.addRow([`\`${style.name}\``, style.docs]);
  });
  content.push(...table.toMarkdown());
  content.push(``);
  content.push(``);
  return content;
};

const depsToMarkdown = (cmp, cmps) => {
  const content = [];
  const deps = Object.entries(cmp.dependencyGraph);
  if (deps.length === 0) {
    return content;
  }
  content.push(`## Dependencies`);
  content.push(``);
  if (cmp.dependents.length > 0) {
    const usedBy = cmp.dependents.map((tag) => ' - ' + getCmpLink(cmp, tag, cmps));
    content.push(`### Used by`);
    content.push(``);
    content.push(...usedBy);
    content.push(``);
  }
  if (cmp.dependencies.length > 0) {
    const dependsOn = cmp.dependencies.map((tag) => '- ' + getCmpLink(cmp, tag, cmps));
    content.push(`### Depends on`);
    content.push(``);
    content.push(...dependsOn);
    content.push(``);
  }
  content.push(`### Graph`);
  content.push('```mermaid');
  content.push('graph TD;');
  deps.forEach(([key, deps]) => {
    deps.forEach((dep) => {
      content.push(`  ${key} --> ${dep}`);
    });
  });
  content.push(`  style ${cmp.tag} fill:#f9f,stroke:#333,stroke-width:4px`);
  content.push('```');
  content.push(``);
  return content;
};
const getCmpLink = (from, to, cmps) => {
  const destCmp = cmps.find((c) => c.tag === to);
  if (destCmp) {
    const cmpRelPath = normalizePath$2(relative$1(from.dirPath, destCmp.dirPath));
    return `[${to}](${cmpRelPath})`;
  }
  return to;
};

const eventsToMarkdown = (events) => {
  const content = [];
  if (events.length === 0) {
    return content;
  }
  content.push(`## Events`);
  content.push(``);
  const table = new MarkdownTable();
  table.addHeader(['Event', 'Description', 'Type']);
  events.forEach((ev) => {
    table.addRow([`\`${ev.event}\``, getDocsField$2(ev), `\`CustomEvent<${ev.detail}>\``]);
  });
  content.push(...table.toMarkdown());
  content.push(``);
  content.push(``);
  return content;
};
const getDocsField$2 = (prop) => {
  return `${prop.deprecation !== undefined
    ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
    : ''}${prop.docs}`;
};

const methodsToMarkdown = (methods) => {
  const content = [];
  if (methods.length === 0) {
    return content;
  }
  content.push(`## Methods`);
  content.push(``);
  methods.forEach((method) => {
    content.push(`### \`${method.signature}\``);
    content.push(``);
    content.push(getDocsField$1(method));
    content.push(``);
    if (method.parameters.length > 0) {
      const parmsTable = new MarkdownTable();
      parmsTable.addHeader(['Name', 'Type', 'Description']);
      method.parameters.forEach(({ name, type, docs }) => {
        parmsTable.addRow(['`' + name + '`', '`' + type + '`', docs]);
      });
      content.push(`#### Parameters`);
      content.push(``);
      content.push(...parmsTable.toMarkdown());
      content.push(``);
    }
    if (method.returns) {
      content.push(`#### Returns`);
      content.push(``);
      content.push(`Type: \`${method.returns.type}\``);
      content.push(``);
      content.push(method.returns.docs);
      content.push(``);
    }
  });
  content.push(``);
  return content;
};
const getDocsField$1 = (prop) => {
  return `${prop.deprecation !== undefined
    ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
    : ''}${prop.docs}`;
};

/**
 * Generate an 'Overview' section for a markdown file
 * @param overview a component-level comment string to place in a markdown file
 * @returns The generated Overview section. If the provided overview is empty, return an empty list
 */
const overviewToMarkdown = (overview) => {
  if (!overview) {
    return [];
  }
  const content = [];
  content.push(`## Overview`);
  content.push('');
  content.push(`${overview.trim()}`);
  content.push('');
  return content;
};

const partsToMarkdown = (parts) => {
  const content = [];
  if (parts.length === 0) {
    return content;
  }
  content.push(`## Shadow Parts`);
  content.push(``);
  const table = new MarkdownTable();
  table.addHeader(['Part', 'Description']);
  parts.forEach((style) => {
    table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
  });
  content.push(...table.toMarkdown());
  content.push(``);
  content.push(``);
  return content;
};

const propsToMarkdown = (props) => {
  const content = [];
  if (props.length === 0) {
    return content;
  }
  content.push(`## Properties`);
  content.push(``);
  const table = new MarkdownTable();
  table.addHeader(['Property', 'Attribute', 'Description', 'Type', 'Default']);
  props.forEach((prop) => {
    table.addRow([
      getPropertyField(prop),
      getAttributeField(prop),
      getDocsField(prop),
      `\`${prop.type}\``,
      `\`${prop.default}\``,
    ]);
  });
  content.push(...table.toMarkdown());
  content.push(``);
  content.push(``);
  return content;
};
const getPropertyField = (prop) => {
  return `\`${prop.name}\`${prop.required ? ' _(required)_' : ''}`;
};
const getAttributeField = (prop) => {
  return prop.attr ? `\`${prop.attr}\`` : '--';
};
const getDocsField = (prop) => {
  return `${prop.deprecation !== undefined
    ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
    : ''}${prop.docs}`;
};

const slotsToMarkdown = (slots) => {
  const content = [];
  if (slots.length === 0) {
    return content;
  }
  content.push(`## Slots`);
  content.push(``);
  const table = new MarkdownTable();
  table.addHeader(['Slot', 'Description']);
  slots.forEach((style) => {
    table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
  });
  content.push(...table.toMarkdown());
  content.push(``);
  content.push(``);
  return content;
};

const usageToMarkdown = (usages) => {
  const content = [];
  const merged = mergeUsages(usages);
  if (merged.length === 0) {
    return content;
  }
  content.push(`## Usage`);
  merged.forEach(({ name, text }) => {
    content.push('');
    content.push(`### ${toTitleCase(name)}`);
    content.push('');
    content.push(text);
    content.push('');
  }),
    content.push('');
  content.push('');
  return content;
};
const mergeUsages = (usages) => {
  const keys = Object.keys(usages);
  const map = new Map();
  keys.forEach((key) => {
    const usage = usages[key].trim();
    const array = map.get(usage) || [];
    array.push(key);
    map.set(usage, array);
  });
  const merged = [];
  map.forEach((value, key) => {
    merged.push({
      name: value.join(' / '),
      text: key,
    });
  });
  return merged;
};

const generateReadme = async (config, compilerCtx, readmeOutputs, docsData, cmps) => {
  const isUpdate = !!docsData.readme;
  const userContent = isUpdate ? docsData.readme : getDefaultReadme(docsData);
  await Promise.all(readmeOutputs.map(async (readmeOutput) => {
    if (readmeOutput.dir) {
      const readmeContent = generateMarkdown(userContent, docsData, cmps, readmeOutput);
      const relPath = relative$1(config.srcDir, docsData.readmePath);
      const absPath = join(readmeOutput.dir, relPath);
      const results = await compilerCtx.fs.writeFile(absPath, readmeContent);
      if (results.changedContent) {
        if (isUpdate) {
          config.logger.info(`updated readme docs: ${docsData.tag}`);
        }
        else {
          config.logger.info(`created readme docs: ${docsData.tag}`);
        }
      }
    }
  }));
};
const generateMarkdown = (userContent, cmp, cmps, readmeOutput) => {
  //If the readmeOutput.dependencies is true or undefined the dependencies will be generated.
  const dependencies = readmeOutput.dependencies !== false ? depsToMarkdown(cmp, cmps) : [];
  return [
    userContent,
    AUTO_GENERATE_COMMENT,
    '',
    '',
    ...getDocsDeprecation(cmp),
    ...overviewToMarkdown(cmp.overview),
    ...usageToMarkdown(cmp.usage),
    ...propsToMarkdown(cmp.props),
    ...eventsToMarkdown(cmp.events),
    ...methodsToMarkdown(cmp.methods),
    ...slotsToMarkdown(cmp.slots),
    ...partsToMarkdown(cmp.parts),
    ...stylesToMarkdown(cmp.styles),
    ...dependencies,
    `----------------------------------------------`,
    '',
    readmeOutput.footer,
    '',
  ].join('\n');
};
const getDocsDeprecation = (cmp) => {
  if (cmp.deprecation !== undefined) {
    return [`> **[DEPRECATED]** ${cmp.deprecation}`, ''];
  }
  return [];
};
const getDefaultReadme = (docsData) => {
  return [`# ${docsData.tag}`, '', '', ''].join('\n');
};

const generateReadmeDocs = async (config, compilerCtx, docsData, outputTargets) => {
  const readmeOutputTargets = outputTargets.filter(isOutputTargetDocsReadme);
  if (readmeOutputTargets.length === 0) {
    return;
  }
  const strictCheck = readmeOutputTargets.some((o) => o.strict);
  if (strictCheck) {
    strictCheckDocs(config, docsData);
  }
  await Promise.all(docsData.components.map((cmpData) => {
    return generateReadme(config, compilerCtx, readmeOutputTargets, cmpData, docsData.components);
  }));
};
const strictCheckDocs = (config, docsData) => {
  docsData.components.forEach((component) => {
    component.props.forEach((prop) => {
      if (!prop.docs && prop.deprecation === undefined) {
        config.logger.warn(`Property "${prop.name}" of "${component.tag}" is not documented. ${component.filePath}`);
      }
    });
    component.methods.forEach((method) => {
      if (!method.docs && method.deprecation === undefined) {
        config.logger.warn(`Method "${method.name}" of "${component.tag}" is not documented. ${component.filePath}`);
      }
    });
    component.events.forEach((ev) => {
      if (!ev.docs && ev.deprecation === undefined) {
        config.logger.warn(`Event "${ev.event}" of "${component.tag}" is not documented. ${component.filePath}`);
      }
    });
    component.parts.forEach((ev) => {
      if (ev.docs === '') {
        config.logger.warn(`Part "${ev.name}" of "${component.tag}" is not documented. ${component.filePath}`);
      }
    });
  });
};

/**
 * Generate [custom data](https://github.com/microsoft/vscode-custom-data) to augment existing HTML types in VS Code.
 * This function writes the custom data as a JSON file to disk, which can be used in VS Code to inform the IDE about
 * custom elements generated by Stencil.
 *
 * The JSON generated by this function must conform to the
 * [HTML custom data schema](https://github.com/microsoft/vscode-html-languageservice/blob/e7ae8a7170df5e721a13cee1b86e293b24eb3b20/docs/customData.schema.json).
 *
 * This function generates custom data for HTML only at this time (it does not generate custom data for CSS).
 *
 * @param compilerCtx the current compiler context
 * @param docsData an intermediate representation documentation derived from compiled Stencil components
 * @param outputTargets the output target(s) the associated with the current build
 */
const generateVscodeDocs = async (compilerCtx, docsData, outputTargets) => {
  const vsCodeOutputTargets = outputTargets.filter(isOutputTargetDocsVscode);
  if (vsCodeOutputTargets.length === 0) {
    return;
  }
  await Promise.all(vsCodeOutputTargets.map(async (outputTarget) => {
    const json = {
      /**
       * the 'version' top-level field is required by the schema. changes to the JSON generated by Stencil must:
       * - comply with v1.X of the schema _OR_
       * - increment this field as a part of updating the JSON generation. This should be considered a breaking change
       *
       * {@link https://github.com/microsoft/vscode-html-languageservice/blob/e7ae8a7170df5e721a13cee1b86e293b24eb3b20/src/htmlLanguageTypes.ts#L184}
       */
      version: 1.1,
      tags: docsData.components.map((cmp) => ({
        name: cmp.tag,
        description: {
          kind: 'markdown',
          value: cmp.docs,
        },
        attributes: cmp.props
          .filter((p) => p.attr !== undefined && p.attr.length > 0)
          .map(serializeAttribute),
        references: getReferences(cmp, outputTarget.sourceCodeBaseUrl),
      })),
    };
    // fields in the custom data may have a value of `undefined`. calling `stringify` will remove such fields.
    const jsonContent = JSON.stringify(json, null, 2);
    await compilerCtx.fs.writeFile(outputTarget.file, jsonContent);
  }));
};
/**
 * Generate a 'references' section for a component's documentation.
 * @param cmp the Stencil component to generate a references section for
 * @param repoBaseUrl an optional URL, that when provided, will add a reference to the source code for the component
 * @returns the generated references section, or undefined if no references could be generated
 */
const getReferences = (cmp, repoBaseUrl) => {
  var _a;
  // collect any `@reference` JSDoc tags on the component
  const references = getNameText('reference', cmp.docsTags).map(([name, url]) => ({ name, url }));
  if (repoBaseUrl) {
    references.push({
      name: 'Source code',
      url: join(repoBaseUrl, (_a = cmp.filePath) !== null && _a !== void 0 ? _a : ''),
    });
  }
  if (references.length > 0) {
    return references;
  }
  return undefined;
};
/**
 * Serialize a component's class member decorated with `@Prop` to be written to disk
 * @param prop the intermediate representation of the documentation to serialize
 * @returns the serialized data
 */
const serializeAttribute = (prop) => {
  const attribute = {
    name: prop.attr,
    description: prop.docs,
  };
  const values = prop.values
    .filter((jsonDocValue) => jsonDocValue.type === 'string' && jsonDocValue.value !== undefined)
    .map((jsonDocValue) => ({ name: jsonDocValue.value }));
  if (values.length > 0) {
    attribute.values = values;
  }
  return attribute;
};

const outputCustom = async (config, compilerCtx, buildCtx, docs, outputTargets) => {
  const customOutputTargets = outputTargets.filter(isOutputTargetCustom);
  if (customOutputTargets.length === 0) {
    return;
  }
  await Promise.all(customOutputTargets.map(async (o) => {
    const timespan = buildCtx.createTimeSpan(`generating ${o.name} started`);
    try {
      await o.generator(config, compilerCtx, buildCtx, docs);
    }
    catch (e) {
      catchError(buildCtx.diagnostics, e);
    }
    timespan.finish(`generate ${o.name} finished`);
  }));
};

/**
 * Generate documentation-related output targets
 * @param config the configuration associated with the current Stencil task run
 * @param compilerCtx the current compiler context
 * @param buildCtx the build context for the current Stencil task run
 */
const outputDocs = async (config, compilerCtx, buildCtx) => {
  if (!config.buildDocs) {
    return;
  }
  const docsOutputTargets = config.outputTargets.filter((o) => isOutputTargetCustom(o) ||
    isOutputTargetDocsReadme(o) ||
    isOutputTargetDocsJson(o) ||
    isOutputTargetDocsCustom(o) ||
    isOutputTargetDocsVscode(o));
  if (docsOutputTargets.length === 0) {
    return;
  }
  // ensure all the styles are built first, which parses all the css docs
  await buildCtx.stylesPromise;
  const docsData = await generateDocData(config, compilerCtx, buildCtx);
  await Promise.all([
    generateReadmeDocs(config, compilerCtx, docsData, docsOutputTargets),
    generateJsonDocs(config, compilerCtx, docsData, docsOutputTargets),
    generateVscodeDocs(compilerCtx, docsData, docsOutputTargets),
    generateCustomDocs(config, docsData, docsOutputTargets),
    outputCustom(config, compilerCtx, buildCtx, docsData, docsOutputTargets),
  ]);
};

const outputLazyLoader = async (config, compilerCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistLazyLoader);
  if (outputTargets.length === 0) {
    return;
  }
  await Promise.all(outputTargets.map((o) => generateLoader(config, compilerCtx, o)));
};
const generateLoader = async (config, compilerCtx, outputTarget) => {
  const loaderPath = outputTarget.dir;
  const es2017Dir = outputTarget.esmDir;
  const es5Dir = outputTarget.esmEs5Dir || es2017Dir;
  const cjsDir = outputTarget.cjsDir;
  if (!loaderPath || !es2017Dir || !cjsDir) {
    return;
  }
  const es5HtmlElement = await getClientPolyfill(config, compilerCtx, 'es5-html-element.js');
  const packageJsonContent = JSON.stringify({
    name: config.fsNamespace + '-loader',
    private: true,
    typings: './index.d.ts',
    module: './index.js',
    main: './index.cjs.js',
    'jsnext:main': './index.es2017.js',
    es2015: './index.es2017.js',
    es2017: './index.es2017.js',
    unpkg: './cdn.js',
  }, null, 2);
  const es5EntryPoint = join(es5Dir, 'loader.js');
  const es2017EntryPoint = join(es2017Dir, 'loader.js');
  const polyfillsEntryPoint = join(es2017Dir, 'polyfills/index.js');
  const cjsEntryPoint = join(cjsDir, 'loader.cjs.js');
  const polyfillsExport = `export * from '${normalizePath$2(relative$1(loaderPath, polyfillsEntryPoint))}';`;
  const indexContent = `${generatePreamble(config)}
${es5HtmlElement}
${polyfillsExport}
export * from '${normalizePath$2(relative$1(loaderPath, es5EntryPoint))}';
`;
  const indexES2017Content = `${generatePreamble(config)}
${polyfillsExport}
export * from '${normalizePath$2(relative$1(loaderPath, es2017EntryPoint))}';
`;
  const indexCjsContent = `${generatePreamble(config)}
module.exports = require('${normalizePath$2(relative$1(loaderPath, cjsEntryPoint))}');
module.exports.applyPolyfills = function() { return Promise.resolve() };
`;
  const indexDtsPath = join(loaderPath, 'index.d.ts');
  await Promise.all([
    compilerCtx.fs.writeFile(join(loaderPath, 'package.json'), packageJsonContent),
    compilerCtx.fs.writeFile(join(loaderPath, 'index.d.ts'), generateIndexDts(indexDtsPath, outputTarget.componentDts)),
    compilerCtx.fs.writeFile(join(loaderPath, 'index.js'), indexContent),
    compilerCtx.fs.writeFile(join(loaderPath, 'index.cjs.js'), indexCjsContent),
    compilerCtx.fs.writeFile(join(loaderPath, 'cdn.js'), indexCjsContent),
    compilerCtx.fs.writeFile(join(loaderPath, 'index.es2017.js'), indexES2017Content),
  ]);
};
const generateIndexDts = (indexDtsPath, componentsDtsPath) => {
  return `export * from '${relativeImport(indexDtsPath, componentsDtsPath, '.d.ts')}';
export interface CustomElementsDefineOptions {
  exclude?: string[];
  resourcesUrl?: string;
  syncQueue?: boolean;
  jmp?: (c: Function) => any;
  raf?: (c: FrameRequestCallback) => number;
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
}
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
export declare function applyPolyfills(): Promise<void>;

/**
 * Used to specify a nonce value that corresponds with an application's CSP.
 * When set, the nonce will be added to all dynamically created script and style tags at runtime.
 * Alternatively, the nonce value can be set on a meta tag in the DOM head
 * (<meta name="csp-nonce" content="{ nonce value here }" />) which
 * will result in the same behavior.
 */
export declare function setNonce(nonce: string): void;
`;
};

/**
 * Entrypoint for generating types for one or more `dist-custom-elements` output targets defined in a Stencil project's
 * configuration
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 * @param typesDir the path to the directory where type declarations are saved
 */
const generateCustomElementsTypes = async (config, compilerCtx, buildCtx, typesDir) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
  await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput$1(config, compilerCtx, buildCtx, typesDir, outputTarget)));
};
/**
 * Generates types for a single `dist-custom-elements` output target definition in a Stencil project's configuration
 *
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 * @param typesDir path to the directory where type declarations are saved
 * @param outputTarget the output target for which types are being currently generated
 */
const generateCustomElementsTypesOutput$1 = async (config, compilerCtx, buildCtx, typesDir, outputTarget) => {
  // the path where we're going to write the typedef for the whole dist-custom-elements output
  const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
  // the directory where types for the individual components are written
  const componentsTypeDirectoryRelPath = relative$1(outputTarget.dir, typesDir);
  const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  const code = [
    `/* ${config.namespace} custom elements */`,
    ...components.map((component) => {
      const exportName = dashToPascalCase$1(component.tagName);
      const importName = component.componentClassName;
      // typedefs for individual components can be found under paths like
      // $TYPES_DIR/components/my-component/my-component.d.ts
      //
      // To construct this path we:
      //
      // - get the relative path to the component's source file from the source directory
      // - join that relative path to the relative path from the `index.d.ts` file to the
      //   directory where typedefs are saved
      const componentSourceRelPath = relative$1(config.srcDir, component.sourceFilePath).replace('.tsx', '');
      const componentDTSPath = join(componentsTypeDirectoryRelPath, componentSourceRelPath);
      return `export { ${importName} as ${exportName} } from '${componentDTSPath}';`;
    }),
    ``,
    `/**`,
    ` * Used to manually set the base path where assets can be found.`,
    ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
    ` * such as "setAssetPath(import.meta.url)". Other options include`,
    ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
    ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
    ` * But do note that this configuration depends on how your script is bundled, or lack of`,
    ` * bundling, and where your assets can be loaded from. Additionally custom bundling`,
    ` * will have to ensure the static assets are copied to its build directory.`,
    ` */`,
    `export declare const setAssetPath: (path: string) => void;`,
    ``,
    `/**`,
    ` * Used to specify a nonce value that corresponds with an application's CSP.`,
    ` * When set, the nonce will be added to all dynamically created script and style tags at runtime.`,
    ` * Alternatively, the nonce value can be set on a meta tag in the DOM head`,
    ` * (<meta name="csp-nonce" content="{ nonce value here }" />) which`,
    ` * will result in the same behavior.`,
    ` */`,
    `export declare const setNonce: (nonce: string) => void`,
    ``,
    `export interface SetPlatformOptions {`,
    `  raf?: (c: FrameRequestCallback) => number;`,
    `  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
    `  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
    `}`,
    `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
  ];
  const componentsDtsRelPath = relDts$1(outputTarget.dir, join(typesDir, 'components.d.ts'));
  const usersIndexJsPath = join(config.srcDir, 'index.ts');
  const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
  if (hasUserIndex) {
    const userIndexRelPath = normalizePath$2(dirname(componentsDtsRelPath));
    code.push(`export * from '${userIndexRelPath}';`);
  }
  else {
    code.push(`export * from '${componentsDtsRelPath}';`);
  }
  await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
    outputTargetType: outputTarget.type,
  });
  await Promise.all(components.map(async (cmp) => {
    const dtsCode = generateCustomElementType$1(componentsDtsRelPath, cmp);
    const fileName = `${cmp.tagName}.d.ts`;
    const filePath = join(outputTarget.dir, fileName);
    await compilerCtx.fs.writeFile(filePath, dtsCode, { outputTargetType: outputTarget.type });
  }));
};
/**
 * Generate a type declaration file for a specific Stencil component
 * @param componentsDtsRelPath the path to a root type declaration file from which commonly used entities can be
 * referenced from in the newly generated file
 * @param cmp the component to generate the type declaration file for
 * @returns the contents of the type declaration file for the provided `cmp`
 */
const generateCustomElementType$1 = (componentsDtsRelPath, cmp) => {
  const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
  const o = [
    `import type { Components, JSX } from "${componentsDtsRelPath}";`,
    ``,
    `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
    `export const ${tagNameAsPascal}: {`,
    `  prototype: ${tagNameAsPascal};`,
    `  new (): ${tagNameAsPascal};`,
    `};`,
    `/**`,
    ` * Used to define this component and all nested components recursively.`,
    ` */`,
    `export const defineCustomElement: () => void;`,
    ``,
  ];
  return o.join('\n');
};
/**
 * Determines the relative path between two provided paths. If a type declaration file extension is present on
 * `dtsPath`, it will be removed from the computed relative path.
 * @param fromPath the path from which to start at
 * @param dtsPath the destination path
 * @returns the relative path from the provided `fromPath` to the `dtsPath`
 */
const relDts$1 = (fromPath, dtsPath) => {
  dtsPath = relative$1(fromPath, dtsPath);
  if (!dtsPath.startsWith('.')) {
    dtsPath = '.' + dtsPath;
  }
  return normalizePath$2(dtsPath.replace('.d.ts', ''));
};

const generateCustomElementsBundleTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
  await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput(config, compilerCtx, buildCtx, distDtsFilePath, outputTarget)));
};
const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx, distDtsFilePath, outputTarget) => {
  const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
  const componentsDtsRelPath = relDts(outputTarget.dir, distDtsFilePath);
  const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  const code = [
    `/* ${config.namespace} custom elements bundle */`,
    ``,
    `import type { Components, JSX } from "${componentsDtsRelPath}";`,
    ``,
    ...components.map(generateCustomElementType),
    `/**`,
    ` * Utility to define all custom elements within this package using the tag name provided in the component's source. `,
    ` * When defining each custom element, it will also check it's safe to define by:`,
    ` *`,
    ` * 1. Ensuring the "customElements" registry is available in the global context (window).`,
    ` * 2. The component tag name is not already defined.`,
    ` *`,
    ` * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define) `,
    ` * method instead to define custom elements individually, or to provide a different tag name.`,
    ` */`,
    `export declare const defineCustomElements: (opts?: any) => void;`,
    ``,
    `/**`,
    ` * Used to manually set the base path where assets can be found.`,
    ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
    ` * such as "setAssetPath(import.meta.url)". Other options include`,
    ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
    ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
    ` * But do note that this configuration depends on how your script is bundled, or lack of`,
    ` * bunding, and where your assets can be loaded from. Additionally custom bundling`,
    ` * will have to ensure the static assets are copied to its build directory.`,
    ` */`,
    `export declare const setAssetPath: (path: string) => void;`,
    ``,
    `export interface SetPlatformOptions {`,
    `  raf?: (c: FrameRequestCallback) => number;`,
    `  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
    `  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
    `  ce?: (eventName: string, opts?: any) => CustomEvent;`,
    `}`,
    `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
    ``,
    `export type { Components, JSX };`,
    ``,
  ];
  const usersIndexJsPath = join(config.srcDir, 'index.ts');
  const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
  if (hasUserIndex) {
    const userIndexRelPath = normalizePath$2(dirname(componentsDtsRelPath));
    code.push(`export * from '${userIndexRelPath}';`);
  }
  else {
    code.push(`export * from '${componentsDtsRelPath}';`);
  }
  await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
    outputTargetType: outputTarget.type,
  });
};
const generateCustomElementType = (cmp) => {
  const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
  const o = [
    `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
    `export const ${tagNameAsPascal}: {`,
    `  prototype: ${tagNameAsPascal};`,
    `  new (): ${tagNameAsPascal};`,
    `};`,
    ``,
  ];
  return o.join('\n');
};
const relDts = (fromPath, dtsPath) => {
  dtsPath = relative$1(fromPath, dtsPath);
  if (!dtsPath.startsWith('.')) {
    dtsPath = '.' + dtsPath;
  }
  return normalizePath$2(dtsPath.replace('.d.ts', ''));
};

/**
 * Update a type declaration file's import declarations using the module `@stencil/core`
 * @param typesDir the directory where type declaration files are expected to exist
 * @param dtsFilePath the path of the type declaration file being updated, used to derive the correct import declaration
 * module
 * @param dtsContent the content of a type declaration file to update
 * @returns the updated type declaration file contents
 */
const updateStencilTypesImports = (typesDir, dtsFilePath, dtsContent) => {
  const dir = dirname(dtsFilePath);
  // determine the relative path between the directory of the .d.ts file and the types directory. this value may result
  // in '.' if they are the same
  const relPath = relative$1(dir, typesDir);
  let coreDtsPath = join(relPath, CORE_FILENAME);
  if (!coreDtsPath.startsWith('.')) {
    coreDtsPath = `./${coreDtsPath}`;
  }
  coreDtsPath = normalizePath$2(coreDtsPath);
  if (dtsContent.includes('@stencil/core')) {
    dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core\/internal('|")/g, `$1${coreDtsPath}$2`);
    dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core('|")/g, `$1${coreDtsPath}$2`);
  }
  return dtsContent;
};
/**
 * Utility for ensuring that naming collisions do not appear in type declaration files for a component's class members
 * decorated with @Prop, @Event, and @Method
 * @param typeReferences all type names used by a component class member
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param sourceFilePath the path to the source file of a component using the type being inspected
 * @param initialType the name of the type that may be updated
 * @returns the updated type name, which may be the same as the initial type name provided as an argument to this
 * function
 */
const updateTypeIdentifierNames = (typeReferences, typeImportData, sourceFilePath, initialType) => {
  let currentTypeName = initialType;
  // iterate over each of the type references, as there may be >1 reference to inspect
  for (const typeReference of Object.values(typeReferences)) {
    const importResolvedFile = getTypeImportPath(typeReference.path, sourceFilePath);
    if (!typeImportData.hasOwnProperty(importResolvedFile)) {
      continue;
    }
    for (const typesImportDatumElement of typeImportData[importResolvedFile]) {
      currentTypeName = updateTypeName(currentTypeName, typesImportDatumElement);
    }
  }
  return currentTypeName;
};
/**
 * Determine the path of a given type reference, relative to the path of a source file
 * @param importResolvedFile the path to the file containing the resolve type. may be absolute or relative
 * @param sourceFilePath the component source file path to resolve against
 * @returns the path of the type import
 */
const getTypeImportPath = (importResolvedFile, sourceFilePath) => {
  const isPathRelative = importResolvedFile && importResolvedFile.startsWith('.');
  if (isPathRelative) {
    importResolvedFile = resolve$3(dirname(sourceFilePath), importResolvedFile);
  }
  return importResolvedFile;
};
/**
 * Determine whether the string representation of a type should be replaced with an alias
 * @param currentTypeName the current string representation of a type
 * @param typeAlias a type member and a potential different name associated with the type member
 * @returns the updated string representation of a type. If the type is not updated, the original type name is returned
 */
const updateTypeName = (currentTypeName, typeAlias) => {
  if (!typeAlias.importName) {
    return currentTypeName;
  }
  // TODO(STENCIL-419): Update this functionality to no longer use a regex
  // negative lookahead specifying that quotes that designate a string in JavaScript cannot follow some expression
  const endingStrChar = '(?!("|\'|`))';
  /**
   * A regular expression that looks at type names along a [word boundary](https://www.regular-expressions.info/wordboundaries.html).
   * This is used as the best approximation for replacing type collisions, as this stage of compilation has only
   * 'flattened' type information in the form of a String.
   *
   * This regex should be expected to capture types that are found in generics, unions, intersections, etc., but not
   * those in string literals. We do not check for a starting quote (" | ' | `) here as some browsers do not support
   * negative lookbehind. This works "well enough" until STENCIL-419 is completed.
   */
  const typeNameRegex = new RegExp(`${typeAlias.localName}\\b${endingStrChar}`, 'g');
  return currentTypeName.replace(typeNameRegex, typeAlias.importName);
};
/**
 * Writes Stencil core typings file to disk for a dist-* output target
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @returns the results of writing one or more type declaration files to disk
 */
const copyStencilCoreDts = async (config, compilerCtx) => {
  const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes).filter((o) => o.typesDir);
  const srcStencilDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', CORE_DTS);
  const srcStencilCoreDts = await compilerCtx.fs.readFile(srcStencilDtsPath);
  return Promise.all(typesOutputTargets.map((o) => {
    const coreDtsFilePath = join(o.typesDir, CORE_DTS);
    return compilerCtx.fs.writeFile(coreDtsFilePath, srcStencilCoreDts, { outputTargetType: o.type });
  }));
};
const CORE_FILENAME = `stencil-public-runtime`;
const CORE_DTS = `${CORE_FILENAME}.d.ts`;

/**
 * Generates the individual event types for all @Event() decorated events in a component
 * @param cmpMeta component runtime metadata for a single component
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param cmpClassName The pascal cased name of the component class
 * @returns the generated type metadata
 */
const generateEventTypes = (cmpMeta, typeImportData, cmpClassName) => {
  return cmpMeta.events.map((cmpEvent) => {
    const name = `on${toTitleCase(cmpEvent.name)}`;
    const cmpEventDetailInterface = `${cmpClassName}CustomEvent`;
    const type = getEventType$1(cmpEvent, cmpEventDetailInterface, typeImportData, cmpMeta.sourceFilePath);
    const typeInfo = {
      name,
      type,
      optional: false,
      required: false,
      internal: cmpEvent.internal,
      jsdoc: getTextDocs(cmpEvent.docs),
    };
    return typeInfo;
  });
};
/**
 * Determine the correct type name for all type(s) used by a class member annotated with `@Event()`
 * @param cmpEvent the compiler metadata for a single `@Event()`
 * @param cmpEventDetailInterface the name of the custom event type to use in the generated type
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param componentSourcePath the path to the component on disk
 * @returns the type associated with a `@Event()`
 */
const getEventType$1 = (cmpEvent, cmpEventDetailInterface, typeImportData, componentSourcePath) => {
  if (!cmpEvent.complexType.original) {
    return 'CustomEvent';
  }
  const updatedTypeName = updateTypeIdentifierNames(cmpEvent.complexType.references, typeImportData, componentSourcePath, cmpEvent.complexType.original);
  return `(event: ${cmpEventDetailInterface}<${updatedTypeName}>) => void`;
};

/**
 * Generates the individual event types for all @Method() decorated events in a component
 * @param cmpMeta component runtime metadata for a single component
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @returns the generated type metadata
 */
const generateMethodTypes = (cmpMeta, typeImportData) => {
  return cmpMeta.methods.map((cmpMethod) => ({
    name: cmpMethod.name,
    type: getType$1(cmpMethod, typeImportData, cmpMeta.sourceFilePath),
    optional: false,
    required: false,
    internal: cmpMethod.internal,
    jsdoc: getTextDocs(cmpMethod.docs),
  }));
};
/**
 * Determine the correct type name for all type(s) used by a class member annotated with `@Method()`
 * @param cmpMethod the compiler metadata for a single `@Method()`
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param componentSourcePath the path to the component on disk
 * @returns the type associated with a `@Method()`
 */
function getType$1(cmpMethod, typeImportData, componentSourcePath) {
  return updateTypeIdentifierNames(cmpMethod.complexType.references, typeImportData, componentSourcePath, cmpMethod.complexType.signature);
}

/**
 * Generates the individual event types for all @Prop() decorated events in a component
 * @param cmpMeta component runtime metadata for a single component
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @returns the generated type metadata
 */
const generatePropTypes = (cmpMeta, typeImportData) => {
  return [
    ...cmpMeta.properties.map((cmpProp) => ({
      name: cmpProp.name,
      type: getType(cmpProp, typeImportData, cmpMeta.sourceFilePath),
      optional: cmpProp.optional,
      required: cmpProp.required,
      internal: cmpProp.internal,
      jsdoc: getTextDocs(cmpProp.docs),
    })),
    ...cmpMeta.virtualProperties.map((cmpProp) => ({
      name: cmpProp.name,
      type: cmpProp.type,
      optional: true,
      required: false,
      jsdoc: cmpProp.docs,
      internal: false,
    })),
  ];
};
/**
 * Determine the correct type name for all type(s) used by a class member annotated with `@Prop()`
 * @param cmpProp the compiler metadata for a single `@Prop()`
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param componentSourcePath the path to the component on disk
 * @returns the type associated with a `@Prop()`
 */
function getType(cmpProp, typeImportData, componentSourcePath) {
  return updateTypeIdentifierNames(cmpProp.complexType.references, typeImportData, componentSourcePath, cmpProp.complexType.original);
}

/**
 * Generate a string based on the types that are defined within a component
 * @param cmp the metadata for the component that a type definition string is generated for
 * @param typeImportData locally/imported/globally used type names, which may be used to prevent naming collisions
 * @param areTypesInternal `true` if types being generated are for a project's internal purposes, `false` otherwise
 * @returns the generated types string alongside additional metadata
 */
const generateComponentTypes = (cmp, typeImportData, areTypesInternal) => {
  const tagName = cmp.tagName.toLowerCase();
  const tagNameAsPascal = dashToPascalCase$1(tagName);
  const htmlElementName = `HTML${tagNameAsPascal}Element`;
  const propAttributes = generatePropTypes(cmp, typeImportData);
  const methodAttributes = generateMethodTypes(cmp, typeImportData);
  const eventAttributes = generateEventTypes(cmp, typeImportData, tagNameAsPascal);
  const componentAttributes = attributesToMultiLineString([...propAttributes, ...methodAttributes], false, areTypesInternal);
  const isDep = cmp.isCollectionDependency;
  const jsxAttributes = attributesToMultiLineString([...propAttributes, ...eventAttributes], true, areTypesInternal);
  const element = [
    addDocBlock(`    interface ${htmlElementName} extends Components.${tagNameAsPascal}, HTMLStencilElement {`, cmp.docs, 4),
    `    }`,
    `    var ${htmlElementName}: {`,
    `        prototype: ${htmlElementName};`,
    `        new (): ${htmlElementName};`,
    `    };`,
  ];
  return {
    isDep,
    tagName,
    tagNameAsPascal,
    htmlElementName,
    component: addDocBlock(`    interface ${tagNameAsPascal} {\n${componentAttributes}    }`, cmp.docs, 4),
    jsx: `  interface ${tagNameAsPascal} {\n${jsxAttributes}    }`,
    element: element.join(`\n`),
  };
};
const attributesToMultiLineString = (attributes, jsxAttributes, internal) => {
  const attributesStr = sortBy(attributes, (a) => a.name)
    .filter((type) => {
    if (jsxAttributes && !internal && type.internal) {
      return false;
    }
    return true;
  })
    .reduce((fullList, type) => {
    if (type.jsdoc) {
      fullList.push(`        /**`);
      fullList.push(...type.jsdoc.split('\n').map((line) => '          * ' + line));
      fullList.push(`         */`);
    }
    const optional = jsxAttributes ? !type.required : type.optional;
    fullList.push(`        "${type.name}"${optional ? '?' : ''}: ${type.type};`);
    return fullList;
  }, [])
    .join(`\n`);
  return attributesStr !== '' ? `${attributesStr}\n` : '';
};

/**
 * Generates the custom event interface for each component that combines the `CustomEvent` interface with
 * the HTMLElement target. This is used to allow implementers to use strict typings on event handlers.
 *
 * The generated interface accepts a generic for the event detail type. This allows implementers to use
 * custom typings for individual events without Stencil needing to generate an interface for each event.
 *
 * @param cmp The component compiler metadata
 * @returns The generated interface type definition.
 */
const generateEventDetailTypes = (cmp) => {
  const tagName = cmp.tagName.toLowerCase();
  const tagNameAsPascal = dashToPascalCase$1(tagName);
  const htmlElementName = `HTML${tagNameAsPascal}Element`;
  const isDep = cmp.isCollectionDependency;
  const cmpEventInterface = `${tagNameAsPascal}CustomEvent`;
  const cmpInterface = [
    `export interface ${cmpEventInterface}<T> extends CustomEvent<T> {`,
    `    detail: T;`,
    `    target: ${htmlElementName};`,
    `}`,
  ];
  return {
    isDep,
    tagName,
    tagNameAsPascal,
    htmlElementName,
    component: cmpInterface.join('\n'),
    jsx: cmpInterface.join('\n'),
    element: cmpInterface.join('\n'),
  };
};

const COMPONENTS_DTS_HEADER = `/* eslint-disable */
/* tslint:disable */
/**
 * This is an autogenerated file created by the Stencil compiler.
 * It contains typing information for all components that exist in this project.
 */`;
const sortImportNames = (a, b) => {
  const aName = a.localName.toLowerCase();
  const bName = b.localName.toLowerCase();
  if (aName < bName)
    return -1;
  if (aName > bName)
    return 1;
  if (a.localName < b.localName)
    return -1;
  if (a.localName > b.localName)
    return 1;
  return 0;
};

/**
 * Find all referenced types by a component and add them to the `importDataObj` parameter
 * @param importDataObj an output parameter that contains the imported types seen thus far by the compiler
 * @param typeCounts a map of seen types and the number of times the type has been seen
 * @param cmp the metadata associated with the component whose types are being inspected
 * @param filePath the path of the component file
 * @returns the updated import data
 */
const updateReferenceTypeImports = (importDataObj, typeCounts, cmp, filePath) => {
  const updateImportReferences = updateImportReferenceFactory(typeCounts, filePath);
  return [...cmp.properties, ...cmp.events, ...cmp.methods]
    .filter((cmpProp) => cmpProp.complexType && cmpProp.complexType.references)
    .reduce((typesImportData, cmpProp) => {
    return updateImportReferences(typesImportData, cmpProp.complexType.references);
  }, importDataObj);
};
/**
 * Factory function to create an `ImportReferenceUpdater` instance
 * @param typeCounts a key-value store of seen type names and the number of times the type name has been seen
 * @param filePath the path of the file containing the component whose imports are being inspected
 * @returns an `ImportReferenceUpdater` instance for updating import references in the provided `filePath`
 */
const updateImportReferenceFactory = (typeCounts, filePath) => {
  /**
   * Determines the number of times that a type identifier (name) has been used. If an identifier has been used before,
   * append the number of times the identifier has been seen to its name to avoid future naming collisions
   * @param name the identifier name to check for previous usages
   * @returns the identifier name, potentially with an integer appended to its name if it has been seen before.
   */
  function getIncrementTypeName(name) {
    const counter = typeCounts.get(name);
    if (counter === undefined) {
      typeCounts.set(name, 1);
      return name;
    }
    typeCounts.set(name, counter + 1);
    return `${name}${counter}`;
  }
  return (existingTypeImportData, typeReferences) => {
    Object.keys(typeReferences)
      .map((typeName) => {
      return [typeName, typeReferences[typeName]];
    })
      .forEach(([typeName, typeReference]) => {
      let importResolvedFile;
      // If global then there is no import statement needed
      if (typeReference.location === 'global') {
        return;
        // If local then import location is the current file
      }
      else if (typeReference.location === 'local') {
        importResolvedFile = filePath;
      }
      else if (typeReference.location === 'import') {
        importResolvedFile = typeReference.path;
      }
      // If this is a relative path make it absolute
      if (importResolvedFile.startsWith('.')) {
        importResolvedFile = resolve$3(dirname(filePath), importResolvedFile);
      }
      existingTypeImportData[importResolvedFile] = existingTypeImportData[importResolvedFile] || [];
      // If this file already has a reference to this type move on
      if (existingTypeImportData[importResolvedFile].find((df) => df.localName === typeName)) {
        return;
      }
      const newTypeName = getIncrementTypeName(typeName);
      existingTypeImportData[importResolvedFile].push({
        localName: typeName,
        importName: newTypeName,
      });
    });
    return existingTypeImportData;
  };
};

/**
 * Generates and writes a `components.d.ts` file to disk. This file may be written to the `src` directory of a project,
 * or be written to a directory that is meant to be distributed (e.g. the output directory of `dist-custom-elements`).
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 * @param destination the relative directory in the filesystem to write the type declaration file to
 * @returns `true` if the type declaration file written to disk has changed, `false` otherwise
 */
const generateAppTypes = async (config, compilerCtx, buildCtx, destination) => {
  // only gather components that are still root ts files we've found and have component metadata
  // the compilerCtx cache may still have files that may have been deleted/renamed
  const timespan = buildCtx.createTimeSpan(`generated app types started`, true);
  const areTypesInternal = destination === 'src';
  // Generate d.ts files for component types
  let componentTypesFileContent = generateComponentTypesFile(config, buildCtx, areTypesInternal);
  // immediately write the components.d.ts file to disk and put it into fs memory
  let componentsDtsFilePath = getComponentsDtsSrcFilePath(config);
  if (!areTypesInternal) {
    componentsDtsFilePath = resolve$3(destination, GENERATED_DTS$1);
    componentTypesFileContent = updateStencilTypesImports(destination, componentsDtsFilePath, componentTypesFileContent);
  }
  const writeResults = await compilerCtx.fs.writeFile(componentsDtsFilePath, componentTypesFileContent, {
    immediateWrite: true,
  });
  const hasComponentsDtsChanged = writeResults.changedContent;
  const componentsDtsRelFileName = relative$1(config.rootDir, componentsDtsFilePath);
  if (hasComponentsDtsChanged) {
    config.logger.debug(`generateAppTypes: ${componentsDtsRelFileName} has changed`);
  }
  timespan.finish(`generated app types finished: ${componentsDtsRelFileName}`);
  return hasComponentsDtsChanged;
};
/**
 * Generates a `components.d.ts` file's contents, which contains the typings for all components in a Stencil project
 * @param config the Stencil configuration associated with the project being compiled
 * @param buildCtx the context associated with the current build
 * @param areTypesInternal determines if non-exported type definitions are being generated or not
 * @returns the contents of the `components.d.ts` file
 */
const generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
  let typeImportData = {};
  const c = [];
  const allTypes = new Map();
  const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  const componentEventDetailTypes = [];
  const modules = components.map((cmp) => {
    /**
     * Generate a key-value store that uses the path to the file where an import is defined as the key, and an object
     * containing the import's original name and any 'new' name we give it to avoid collisions. We're generating this
     * data structure for each Stencil component in series, therefore the memory footprint of this entity will likely
     * grow as more components (with additional types) are processed.
     */
    typeImportData = updateReferenceTypeImports(typeImportData, allTypes, cmp, cmp.sourceFilePath);
    if (cmp.events.length > 0) {
      /**
       * Only generate event detail types for components that have events.
       */
      componentEventDetailTypes.push(generateEventDetailTypes(cmp));
    }
    return generateComponentTypes(cmp, typeImportData, areTypesInternal);
  });
  c.push(COMPONENTS_DTS_HEADER);
  c.push(`import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";`);
  // write the import statements for our type declaration file
  c.push(...Object.keys(typeImportData).map((filePath) => {
    const typeData = typeImportData[filePath];
    let importFilePath;
    if (isAbsolute$1(filePath)) {
      importFilePath = normalizePath$2('./' + relative$1(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, '');
    }
    else {
      importFilePath = filePath;
    }
    return `import { ${typeData
      .sort(sortImportNames)
      .map((td) => {
      if (td.localName === td.importName) {
        return `${td.importName}`;
      }
      else {
        return `${td.localName} as ${td.importName}`;
      }
    })
      .join(`, `)} } from "${importFilePath}";`;
  }));
  c.push(`export namespace Components {`);
  c.push(...modules.map((m) => `${m.component}`));
  c.push(`}`);
  c.push(...componentEventDetailTypes.map((m) => `${m.component}`));
  c.push(`declare global {`);
  c.push(...modules.map((m) => m.element));
  c.push(`    interface HTMLElementTagNameMap {`);
  c.push(...modules.map((m) => `        "${m.tagName}": ${m.htmlElementName};`));
  c.push(`    }`);
  c.push(`}`);
  c.push(`declare namespace LocalJSX {`);
  c.push(...modules.map((m) => {
    const docs = components.find((c) => c.tagName === m.tagName).docs;
    return addDocBlock(`  ${m.jsx}`, docs, 4);
  }));
  c.push(`    interface IntrinsicElements {`);
  c.push(...modules.map((m) => `        "${m.tagName}": ${m.tagNameAsPascal};`));
  c.push(`    }`);
  c.push(`}`);
  c.push(`export { LocalJSX as JSX };`);
  c.push(`declare module "@stencil/core" {`);
  c.push(`    export namespace JSX {`);
  c.push(`        interface IntrinsicElements {`);
  c.push(...modules.map((m) => {
    const docs = components.find((c) => c.tagName === m.tagName).docs;
    return addDocBlock(`            "${m.tagName}": LocalJSX.${m.tagNameAsPascal} & JSXBase.HTMLAttributes<${m.htmlElementName}>;`, docs, 12);
  }));
  c.push(`        }`);
  c.push(`    }`);
  c.push(`}`);
  return c.join(`\n`) + `\n`;
};

/**
 * For a single output target, generate types, then copy the Stencil core type declaration file
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 * @param outputTarget the output target to generate types for
 */
const generateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
  if (!buildCtx.hasError) {
    await generateTypesOutput(config, compilerCtx, buildCtx, outputTarget);
    await copyStencilCoreDts(config, compilerCtx);
  }
};
/**
 * Generate type definition files and write them to a dist directory
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 * @param outputTarget the output target to generate types for
 */
const generateTypesOutput = async (config, compilerCtx, buildCtx, outputTarget) => {
  // get all type declaration files in a project's src/ directory
  const srcDirItems = await compilerCtx.fs.readdir(config.srcDir, { recursive: false });
  const srcDtsFiles = srcDirItems.filter((srcItem) => srcItem.isFile && isDtsFile$1(srcItem.absPath));
  // Copy .d.ts files from src to dist
  // In addition, all references to @stencil/core are replaced
  const copiedDTSFilePaths = await Promise.all(srcDtsFiles.map(async (srcDtsFile) => {
    const relPath = relative$1(config.srcDir, srcDtsFile.absPath);
    const distPath = join(outputTarget.typesDir, relPath);
    const originalDtsContent = await compilerCtx.fs.readFile(srcDtsFile.absPath);
    const distDtsContent = updateStencilTypesImports(outputTarget.typesDir, distPath, originalDtsContent);
    await compilerCtx.fs.writeFile(distPath, distDtsContent);
    return distPath;
  }));
  const distDtsFilePath = copiedDTSFilePaths.slice(-1)[0];
  const distPath = outputTarget.typesDir;
  await generateAppTypes(config, compilerCtx, buildCtx, distPath);
  const { typesDir } = outputTarget;
  if (distDtsFilePath) {
    await generateCustomElementsBundleTypes(config, compilerCtx, buildCtx, distDtsFilePath);
    await generateCustomElementsTypes(config, compilerCtx, buildCtx, typesDir);
  }
};

/**
 * Entrypoint for generating types for all output targets
 * @param config the Stencil configuration associated with the project being compiled
 * @param compilerCtx the current compiler context
 * @param buildCtx the context associated with the current build
 */
const outputTypes = async (config, compilerCtx, buildCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
  if (outputTargets.length === 0) {
    return;
  }
  const timespan = buildCtx.createTimeSpan(`generate types started`, true);
  await Promise.all(outputTargets.map((outputsTarget) => generateTypes(config, compilerCtx, buildCtx, outputsTarget)));
  timespan.finish(`generate types finished`);
};

const generateEs5DisabledMessage = async (config, compilerCtx, outputTarget) => {
  // not doing an es5 right now
  // but it's possible during development the user
  // tests on a browser that doesn't support es2017
  const fileName = `${config.fsNamespace}.js`;
  const filePath = join(outputTarget.buildDir, fileName);
  await compilerCtx.fs.writeFile(filePath, getDisabledMessageScript(config));
  return fileName;
};
const getDisabledMessageScript = (config) => {
  const style = `
<style>
body {
  display: block !important;
  font-family: sans-serif;
  padding: 20px;
  line-height:22px;
}
h1 {
  font-size: 18px;
}
h2 {
  font-size: 14px;
  margin-top: 40px;
}
</style>
`;
  const htmlLegacy = `
  ${style}

  <h1>This Stencil app is disabled for this browser.</h1>

  <h2>Developers:</h2>
  <ul>
  <li>ES5 builds are disabled <strong>during development</strong> to take advantage of 2x faster build times.</li>
  <li>Please see the example below or our <a href="https://stenciljs.com/docs/stencil-config" target="_blank" rel="noopener noreferrer">config docs</a> if you would like to develop on a browser that does not fully support ES2017 and custom elements.</li>
  <li>Note that as of Stencil v2, ES5 builds and polyfills are <strong>disabled</strong> during production builds. You can enable these <a href="https://stenciljs.com/docs/config#buildes5" target="_blank" rel="noopener noreferrer">in your stencil.config.ts file</a>.</li>
  <li>When testing browsers it is recommended to always test in production mode, and ES5 builds should always be enabled during production builds.</li>
  <li><em>This is only an experiment and if it slows down app development then we will revert this and enable ES5 builds during dev.</em></li>
  </ul>


  <h2>Enabling ES5 builds during development:</h2>
  <pre>
  <code>npm run dev --es5</code>
  </pre>
  <p>For stencil-component-starter, use:</p>
  <pre>
  <code>npm start --es5</code>
  </pre>


  <h2>Enabling full production builds during development:</h2>
  <pre>
  <code>npm run dev --prod</code>
  </pre>
  <p>For stencil-component-starter, use:</p>
  <pre>
  <code>npm start --prod</code>
  </pre>

  <h2>Current Browser's Support:</h2>
  <ul>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import">ES Module Imports</a>: <span id="es-modules-test"></span></li>
  <li><a href="http://2ality.com/2017/01/import-operator.html">ES Dynamic Imports</a>: <span id="es-dynamic-modules-test"></span></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements">Custom Elements</a>: <span id="custom-elements-test"></span></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM">Shadow DOM</a>: <span id="shadow-dom-test"></span></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a>: <span id="fetch-test"></span></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables">CSS Variables</a>: <span id="css-variables-test"></span></li>
  </ul>

  <h2>Current Browser:</h2>
  <pre>
  <code id="current-browser-output"></code>
  </pre>
  `;
  const htmlUpdate = `
  ${style}

  <h1>Update src/index.html</h1>

  <p>Stencil recently changed how scripts are loaded in order to improve performance.</p>

  <h2>BEFORE:</h2>
  <p>Previously, a single script was included that handled loading the correct JavaScript based on browser support.</p>
  <pre>
  <code>${escapeHtml(`<script src="/build/${config.fsNamespace}.js"></script>
`)}</code>
  </pre>

  <h2 style="margin-top:0">AFTER:</h2>
  <p>The index.html should now include two scripts using the modern ES Module script pattern.
  Note that only one file will actually be requested and loaded based on the browser's native support for ES Modules.
  For more info, please see <a href="https://developers.google.com/web/fundamentals/primers/modules#browser" target="_blank" rel="noopener noreferrer">Using JavaScript modules on the web</a>.
  </p>
  <pre>
  <code>${escapeHtml(`<script`)} <span style="background:yellow">type="module"</span> src="/build/${config.fsNamespace}<span style="background:yellow">.esm</span>.js"${escapeHtml(`></script>`)}
  ${escapeHtml(`<script`)} <span style="background:yellow">nomodule</span> ${escapeHtml(`src="/build/${config.fsNamespace}.js"></script>`)}</code>
  </pre>
  `;
  return `${generatePreamble(config)}
(function() {
  function checkSupport() {
  if (!document.body) {
    setTimeout(checkSupport);
    return;
  }
  function supportsDynamicImports() {
    try {
    new Function('import("")');
    return true;
    } catch (e) {}
    return false;
  }
  var supportsEsModules = !!('noModule' in document.createElement('script'));

  if (!supportsEsModules) {
    document.body.innerHTML = '${inlineHTML(htmlLegacy)}';

    document.getElementById('current-browser-output').textContent = window.navigator.userAgent;
    document.getElementById('es-modules-test').textContent = supportsEsModules;
    document.getElementById('es-dynamic-modules-test').textContent = supportsDynamicImports();
    document.getElementById('shadow-dom-test').textContent = !!(document.head.attachShadow);
    document.getElementById('custom-elements-test').textContent = !!(window.customElements);
    document.getElementById('css-variables-test').textContent = !!(window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--c)'));
    document.getElementById('fetch-test').textContent = !!(window.fetch);
  } else {
    document.body.innerHTML = '${inlineHTML(htmlUpdate)}';
  }
  }

  setTimeout(checkSupport);
})();`;
};
const inlineHTML = (html) => {
  return html.replace(/\n/g, '\\n').replace(/\'/g, `\\'`).trim();
};

const addScriptDataAttribute = (config, doc, outputTarget) => {
  const resourcesUrl = getAbsoluteBuildDir(outputTarget);
  const entryEsmFilename = `${config.fsNamespace}.esm.js`;
  const entryNoModuleFilename = `${config.fsNamespace}.js`;
  const expectedEsmSrc = join(resourcesUrl, entryEsmFilename);
  const expectedNoModuleSrc = join(resourcesUrl, entryNoModuleFilename);
  const scripts = Array.from(doc.querySelectorAll('script'));
  const scriptEsm = scripts.find((s) => s.getAttribute('src') === expectedEsmSrc);
  const scriptNomodule = scripts.find((s) => s.getAttribute('src') === expectedNoModuleSrc);
  if (scriptEsm) {
    scriptEsm.setAttribute('data-stencil', '');
  }
  if (scriptNomodule) {
    scriptNomodule.setAttribute('data-stencil', '');
  }
};

const generateServiceWorker = async (config, buildCtx, workbox, outputTarget) => {
  const serviceWorker = await getServiceWorker(outputTarget);
  if (serviceWorker.unregister) {
    await config.sys.writeFile(serviceWorker.swDest, SELF_UNREGISTER_SW);
  }
  else if (serviceWorker.swSrc) {
    return Promise.all([copyLib(buildCtx, outputTarget, workbox), injectManifest(buildCtx, serviceWorker, workbox)]);
  }
  else {
    return generateSW(buildCtx, serviceWorker, workbox);
  }
};
const copyLib = async (buildCtx, outputTarget, workbox) => {
  const timeSpan = buildCtx.createTimeSpan(`copy service worker library started`, true);
  try {
    await workbox.copyWorkboxLibraries(outputTarget.appDir);
  }
  catch (e) {
    const d = buildWarn(buildCtx.diagnostics);
    d.messageText = 'Service worker library already exists';
  }
  timeSpan.finish(`copy service worker library finished`);
};
const generateSW = async (buildCtx, serviceWorker, workbox) => {
  const timeSpan = buildCtx.createTimeSpan(`generate service worker started`);
  try {
    await workbox.generateSW(serviceWorker);
    timeSpan.finish(`generate service worker finished`);
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
};
const injectManifest = async (buildCtx, serviceWorker, workbox) => {
  const timeSpan = buildCtx.createTimeSpan(`inject manifest into service worker started`);
  try {
    await workbox.injectManifest(serviceWorker);
    timeSpan.finish('inject manifest into service worker finished');
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
};
const hasServiceWorkerChanges = (config, buildCtx) => {
  if (config.devMode && !config.flags.serviceWorker) {
    return false;
  }
  const wwwServiceOutputs = config.outputTargets
    .filter(isOutputTargetWww)
    .filter((o) => o.serviceWorker && o.serviceWorker.swSrc);
  return wwwServiceOutputs.some((outputTarget) => {
    return buildCtx.filesChanged.some((fileChanged) => {
      if (outputTarget.serviceWorker) {
        return basename(fileChanged).toLowerCase() === basename(outputTarget.serviceWorker.swSrc).toLowerCase();
      }
      return false;
    });
  });
};
const getServiceWorker = async (outputTarget) => {
  if (!outputTarget.serviceWorker) {
    return undefined;
  }
  const serviceWorker = {
    ...outputTarget.serviceWorker,
  };
  if (serviceWorker.unregister !== true) {
    delete serviceWorker.unregister;
  }
  return serviceWorker;
};
const INDEX_ORG = 'index-org.html';
const getRegisterSW = (swUrl) => {
  return `
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
  window.addEventListener('load', function() {
  navigator.serviceWorker.register('${swUrl}')
    .then(function(reg) {
    reg.onupdatefound = function() {
      var installingWorker = reg.installing;
      installingWorker.onstatechange = function() {
      if (installingWorker.state === 'installed') {
        window.dispatchEvent(new Event('swUpdate'))
      }
      }
    }
    })
    .catch(function(err) { console.error('service worker error', err) });
  });
}`;
};
const UNREGISTER_SW = `
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
  // auto-unregister service worker during dev mode
  navigator.serviceWorker.getRegistration().then(function(registration) {
  if (registration) {
    registration.unregister().then(function() { location.reload(true) });
  }
  });
}
`;
const SELF_UNREGISTER_SW = `
self.addEventListener('install', function(e) {
  self.skipWaiting();
});

self.addEventListener('activate', function(e) {
  self.registration.unregister()
  .then(function() {
    return self.clients.matchAll();
  })
  .then(function(clients) {
    clients.forEach(client => client.navigate(client.url))
  });
});
`;

const generateServiceWorkerUrl = (outputTarget, serviceWorker) => {
  let swUrl = normalizePath$2(relative$1(outputTarget.appDir, serviceWorker.swDest));
  if (swUrl.charAt(0) !== '/') {
    swUrl = '/' + swUrl;
  }
  const baseUrl = new URL(outputTarget.baseUrl, 'http://config.stenciljs.com');
  let basePath = baseUrl.pathname;
  if (!basePath.endsWith('/')) {
    basePath += '/';
  }
  swUrl = basePath + swUrl.substring(1);
  return swUrl;
};

const updateIndexHtmlServiceWorker = async (config, buildCtx, doc, outputTarget) => {
  const serviceWorker = outputTarget.serviceWorker;
  if (serviceWorker !== false) {
    if ((serviceWorker && serviceWorker.unregister) || (!serviceWorker && config.devMode)) {
      injectUnregisterServiceWorker(doc);
    }
    else if (serviceWorker) {
      await injectRegisterServiceWorker(buildCtx, outputTarget, doc);
    }
  }
};
const injectRegisterServiceWorker = async (buildCtx, outputTarget, doc) => {
  const swUrl = generateServiceWorkerUrl(outputTarget, outputTarget.serviceWorker);
  const serviceWorker = getRegisterSwScript(doc, buildCtx, swUrl);
  doc.body.appendChild(serviceWorker);
};
const injectUnregisterServiceWorker = (doc) => {
  const script = doc.createElement('script');
  script.innerHTML = UNREGISTER_SW;
  doc.body.appendChild(script);
};
const getRegisterSwScript = (doc, buildCtx, swUrl) => {
  const script = doc.createElement('script');
  script.setAttribute('data-build', `${buildCtx.timestamp}`);
  script.innerHTML = getRegisterSW(swUrl);
  return script;
};

const generateHashedCopy = async (config, compilerCtx, path) => {
  try {
    const content = await compilerCtx.fs.readFile(path);
    const hash = await config.sys.generateContentHash(content, config.hashedFileNameLength);
    const hashedFileName = `p-${hash}${extname$1(path)}`;
    await compilerCtx.fs.writeFile(join(dirname(path), hashedFileName), content);
    return hashedFileName;
  }
  catch (e) { }
  return undefined;
};

const optimizeEsmImport = async (config, compilerCtx, doc, outputTarget) => {
  const resourcesUrl = getAbsoluteBuildDir(outputTarget);
  const entryFilename = `${config.fsNamespace}.esm.js`;
  const expectedSrc = join(resourcesUrl, entryFilename);
  const script = Array.from(doc.querySelectorAll('script')).find((s) => s.getAttribute('type') === 'module' && !s.hasAttribute('crossorigin') && s.getAttribute('src') === expectedSrc);
  if (!script) {
    return false;
  }
  script.setAttribute('data-resources-url', resourcesUrl);
  script.setAttribute('data-stencil-namespace', config.fsNamespace);
  const entryPath = join(outputTarget.buildDir, entryFilename);
  const content = await compilerCtx.fs.readFile(entryPath);
  if (isString$1(content)) {
    // If the script is too big, instead of inlining, we hash the file and change
    // the <script> to the new location
    if (config.allowInlineScripts && content.length < MAX_JS_INLINE_SIZE) {
      // Let's try to inline, we have to fix all the relative paths of the imports
      const results = updateImportPaths(content, resourcesUrl);
      if (results.orgImportPaths.length > 0) {
        // insert inline script
        script.removeAttribute('src');
        script.innerHTML = results.code;
      }
    }
    else {
      const hashedFile = await generateHashedCopy(config, compilerCtx, entryPath);
      if (hashedFile) {
        const hashedPath = join(resourcesUrl, hashedFile);
        script.setAttribute('src', hashedPath);
        injectModulePreloads(doc, [hashedPath]);
      }
    }
    return true;
  }
  return false;
};
const updateImportPaths = (code, newDir) => {
  const orgImportPaths = [];
  const tsSourceFile = t.createSourceFile('module.ts', code, t.ScriptTarget.Latest);
  t.transform(tsSourceFile, [readImportPaths(orgImportPaths)]);
  orgImportPaths.forEach((orgImportPath) => {
    const newPath = replacePathDir(orgImportPath, newDir);
    if (newPath) {
      code = code.replace(`"${orgImportPath}"`, `"${newPath}"`);
      code = code.replace(`'${orgImportPath}'`, `'${newPath}'`);
    }
  });
  return {
    code,
    orgImportPaths,
  };
};
const replacePathDir = (orgImportPath, newDir) => {
  if (orgImportPath.startsWith('./') && (orgImportPath.endsWith('.js') || orgImportPath.endsWith('.mjs'))) {
    return newDir + orgImportPath.substring(2);
  }
  return null;
};
const readImportPaths = (orgImportPaths) => {
  return () => {
    return (tsSourceFile) => {
      const importStatements = tsSourceFile.statements
        .filter(t.isImportDeclaration)
        .filter((s) => s.moduleSpecifier != null)
        .filter((s) => t.isStringLiteral(s.moduleSpecifier) && s.moduleSpecifier.text);
      importStatements.forEach((s) => {
        if (t.isStringLiteral(s.moduleSpecifier)) {
          orgImportPaths.push(s.moduleSpecifier.text);
        }
      });
      return tsSourceFile;
    };
  };
};
// https://twitter.com/addyosmani/status/1143938175926095872
const MAX_JS_INLINE_SIZE = 1 * 1024;

const inlineStyleSheets = (compilerCtx, doc, maxSize, outputTarget) => {
  const globalLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
  return Promise.all(globalLinks.map(async (link) => {
    const href = link.getAttribute('href');
    if (typeof href !== 'string' || !href.startsWith('/') || link.getAttribute('media') !== null) {
      return;
    }
    try {
      const fsPath = join(outputTarget.dir, href);
      const styles = await compilerCtx.fs.readFile(fsPath);
      if (styles.length > maxSize) {
        return;
      }
      // insert inline <style>
      const inlinedStyles = doc.createElement('style');
      inlinedStyles.innerHTML = styles;
      link.parentNode.insertBefore(inlinedStyles, link);
      link.remove();
    }
    catch (e) { }
  }));
};

const updateGlobalStylesLink = (config, doc, globalScriptFilename, outputTarget) => {
  if (!globalScriptFilename) {
    return;
  }
  const buildDir = getAbsoluteBuildDir(outputTarget);
  const originalPath = join(buildDir, config.fsNamespace + '.css');
  const newPath = join(buildDir, globalScriptFilename);
  if (originalPath === newPath) {
    return;
  }
  const replacer = new RegExp(escapeRegExp(originalPath) + '$');
  Array.from(doc.querySelectorAll('link')).forEach((link) => {
    const href = link.getAttribute('href');
    if (href) {
      const newHref = href.replace(replacer, newPath);
      if (newHref !== href) {
        link.setAttribute('href', newHref);
      }
    }
  });
};
const escapeRegExp = (text) => text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');

const outputWww = async (config, compilerCtx, buildCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetWww);
  if (outputTargets.length === 0) {
    return;
  }
  const timespan = buildCtx.createTimeSpan(`generate www started`, true);
  const criticalBundles = getCriticalPath(buildCtx);
  await Promise.all(outputTargets.map((outputTarget) => generateWww(config, compilerCtx, buildCtx, criticalBundles, outputTarget)));
  timespan.finish(`generate www finished`);
};
const getCriticalPath = (buildCtx) => {
  const componentGraph = buildCtx.componentGraph;
  if (!buildCtx.indexDoc || !componentGraph) {
    return [];
  }
  return unique(flatOne(getUsedComponents(buildCtx.indexDoc, buildCtx.components)
    .map((tagName) => getScopeId(tagName))
    .map((scopeId) => buildCtx.componentGraph.get(scopeId) || []))).sort();
};
const generateWww = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
  if (!config.buildEs5) {
    await generateEs5DisabledMessage(config, compilerCtx, outputTarget);
  }
  // Copy global styles into the build directory
  // Process
  if (buildCtx.indexDoc && outputTarget.indexHtml) {
    await generateIndexHtml(config, compilerCtx, buildCtx, criticalPath, outputTarget);
  }
  await generateHostConfig(compilerCtx, outputTarget);
};
const generateHostConfig = (compilerCtx, outputTarget) => {
  const buildDir = getAbsoluteBuildDir(outputTarget);
  const hostConfigPath = join(outputTarget.appDir, 'host.config.json');
  const hostConfigContent = JSON.stringify({
    hosting: {
      headers: [
        {
          source: join(buildDir, '/p-*'),
          headers: [
            {
              key: 'Cache-Control',
              value: 'max-age=31556952, s-maxage=31556952, immutable',
            },
          ],
        },
      ],
    },
  }, null, '  ');
  return compilerCtx.fs.writeFile(hostConfigPath, hostConfigContent, { outputTargetType: outputTarget.type });
};
const generateIndexHtml = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
  if (compilerCtx.hasSuccessfulBuild && !buildCtx.hasHtmlChanges) {
    // no need to rebuild index.html if there were no app file changes
    return;
  }
  // get the source index html content
  try {
    const doc = cloneDocument(buildCtx.indexDoc);
    addScriptDataAttribute(config, doc, outputTarget);
    // validateHtml(config, buildCtx, doc);
    await updateIndexHtmlServiceWorker(config, buildCtx, doc, outputTarget);
    if (!config.watch && !config.devMode) {
      const globalStylesFilename = await generateHashedCopy(config, compilerCtx, join(outputTarget.buildDir, `${config.fsNamespace}.css`));
      const scriptFound = await optimizeEsmImport(config, compilerCtx, doc, outputTarget);
      await inlineStyleSheets(compilerCtx, doc, MAX_CSS_INLINE_SIZE, outputTarget);
      updateGlobalStylesLink(config, doc, globalStylesFilename, outputTarget);
      if (scriptFound) {
        optimizeCriticalPath(doc, criticalPath, outputTarget);
      }
    }
    const indexContent = serializeNodeToHtml(doc);
    await compilerCtx.fs.writeFile(outputTarget.indexHtml, indexContent, { outputTargetType: outputTarget.type });
    if (outputTarget.serviceWorker && config.flags.prerender) {
      await compilerCtx.fs.writeFile(join(outputTarget.appDir, INDEX_ORG), indexContent, {
        outputTargetType: outputTarget.type,
      });
    }
    buildCtx.debug(`generateIndexHtml, write: ${relative$1(config.rootDir, outputTarget.indexHtml)}`);
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
};
const MAX_CSS_INLINE_SIZE = 3 * 1024;

const generateOutputTargets = async (config, compilerCtx, buildCtx) => {
  const timeSpan = buildCtx.createTimeSpan('generate outputs started', true);
  const changedModuleFiles = Array.from(compilerCtx.changedModules)
    .map((filename) => compilerCtx.moduleMap.get(filename))
    .filter((mod) => mod && !mod.isCollectionDependency);
  compilerCtx.changedModules.clear();
  invalidateRollupCaches(compilerCtx);
  await Promise.all([
    outputAngular(config, compilerCtx, buildCtx),
    outputCopy(config, compilerCtx, buildCtx),
    outputCollection(config, compilerCtx, buildCtx, changedModuleFiles),
    outputCustomElements(config, compilerCtx, buildCtx),
    outputCustomElementsBundle(config, compilerCtx, buildCtx),
    outputHydrateScript(config, compilerCtx, buildCtx),
    outputLazyLoader(config, compilerCtx),
    outputLazy(config, compilerCtx, buildCtx),
    outputWww(config, compilerCtx, buildCtx),
  ]);
  // must run after all the other outputs
  // since it validates files were created
  await outputDocs(config, compilerCtx, buildCtx);
  await outputTypes(config, compilerCtx, buildCtx);
  timeSpan.finish('generate outputs finished');
};
const invalidateRollupCaches = (compilerCtx) => {
  const invalidatedIds = compilerCtx.changedFiles;
  compilerCtx.rollupCache.forEach((cache) => {
    cache.modules.forEach((mod) => {
      if (mod.transformDependencies.some((id) => invalidatedIds.has(id))) {
        mod.originalCode = null;
      }
    });
  });
};

const isEmptable = (o) => isOutputTargetDist(o) ||
  isOutputTargetDistCustomElements(o) ||
  isOutputTargetDistCustomElementsBundle(o) ||
  isOutputTargetWww(o) ||
  isOutputTargetDistLazy(o) ||
  isOutputTargetDistLazyLoader(o) ||
  isOutputTargetHydrate(o);
const emptyOutputTargets = async (config, compilerCtx, buildCtx) => {
  if (buildCtx.isRebuild) {
    return;
  }
  const cleanDirs = config.outputTargets
    .filter(isEmptable)
    .filter((o) => o.empty === true)
    .map((o) => o.dir || o.esmDir)
    .filter(isString$1);
  if (cleanDirs.length === 0) {
    return;
  }
  const timeSpan = buildCtx.createTimeSpan(`cleaning ${cleanDirs.length} dirs`, true);
  await compilerCtx.fs.emptyDirs(cleanDirs);
  timeSpan.finish('cleaning dirs finished');
};

const optimizeCss = async (config, compilerCtx, diagnostics, styleText, filePath) => {
  if (typeof styleText !== 'string' || !styleText.length) {
    //  don't bother with invalid data
    return styleText;
  }
  if ((config.autoprefixCss === false || config.autoprefixCss === null) && !config.minifyCss) {
    // don't wanna autoprefix or minify, so just skip this
    return styleText;
  }
  if (typeof filePath === 'string') {
    filePath = normalizePath$2(filePath);
  }
  const opts = {
    input: styleText,
    filePath: filePath,
    autoprefixer: config.autoprefixCss,
    minify: config.minifyCss,
  };
  const cacheKey = await compilerCtx.cache.createKey('optimizeCss', optimizeCssId, opts);
  const cachedContent = await compilerCtx.cache.get(cacheKey);
  if (cachedContent != null) {
    // let's use the cached data we already figured out
    return cachedContent;
  }
  const minifyResults = await compilerCtx.worker.optimizeCss(opts);
  minifyResults.diagnostics.forEach((d) => {
    // collect up any diagnostics from minifying
    diagnostics.push(d);
  });
  if (typeof minifyResults.output === 'string' && !hasError(diagnostics)) {
    // cool, we got valid minified output
    // only cache if we got a cache key, if not it probably has an @import
    await compilerCtx.cache.put(cacheKey, minifyResults.output);
    return minifyResults.output;
  }
  return styleText;
};

const generateGlobalStyles = async (config, compilerCtx, buildCtx) => {
  const outputTargets = config.outputTargets.filter(isOutputTargetDistGlobalStyles);
  if (outputTargets.length === 0) {
    return;
  }
  const globalStyles = await buildGlobalStyles(config, compilerCtx, buildCtx);
  if (globalStyles) {
    await Promise.all(outputTargets.map((o) => compilerCtx.fs.writeFile(o.file, globalStyles)));
  }
};
const buildGlobalStyles = async (config, compilerCtx, buildCtx) => {
  let globalStylePath = config.globalStyle;
  if (!globalStylePath) {
    return null;
  }
  const canSkip = await canSkipGlobalStyles(config, compilerCtx, buildCtx);
  if (canSkip) {
    return compilerCtx.cachedGlobalStyle;
  }
  try {
    globalStylePath = normalizePath$2(globalStylePath);
    compilerCtx.addWatchFile(globalStylePath);
    const transformResults = await runPluginTransforms(config, compilerCtx, buildCtx, globalStylePath);
    if (transformResults) {
      const optimizedCss = await optimizeCss(config, compilerCtx, buildCtx.diagnostics, transformResults.code, globalStylePath);
      compilerCtx.cachedGlobalStyle = optimizedCss;
      if (Array.isArray(transformResults.dependencies)) {
        const cssModuleImports = compilerCtx.cssModuleImports.get(globalStylePath) || [];
        transformResults.dependencies.forEach((dep) => {
          compilerCtx.addWatchFile(dep);
          if (!cssModuleImports.includes(dep)) {
            cssModuleImports.push(dep);
          }
        });
        compilerCtx.cssModuleImports.set(globalStylePath, cssModuleImports);
      }
      return optimizedCss;
    }
  }
  catch (e) {
    const d = catchError(buildCtx.diagnostics, e);
    d.absFilePath = globalStylePath;
  }
  compilerCtx.cachedGlobalStyle = null;
  return null;
};
const canSkipGlobalStyles = async (config, compilerCtx, buildCtx) => {
  if (!compilerCtx.cachedGlobalStyle) {
    return false;
  }
  if (buildCtx.requiresFullBuild) {
    return false;
  }
  if (buildCtx.isRebuild && !buildCtx.hasStyleChanges) {
    return true;
  }
  if (buildCtx.filesChanged.includes(config.globalStyle)) {
    // changed file IS the global entry style
    return false;
  }
  const cssModuleImports = compilerCtx.cssModuleImports.get(config.globalStyle);
  if (cssModuleImports && buildCtx.filesChanged.some((f) => cssModuleImports.includes(f))) {
    return false;
  }
  const hasChangedImports = await hasChangedImportFile(config, compilerCtx, buildCtx, config.globalStyle, compilerCtx.cachedGlobalStyle, []);
  if (hasChangedImports) {
    return false;
  }
  return true;
};
const hasChangedImportFile = async (config, compilerCtx, buildCtx, filePath, content, noLoop) => {
  if (noLoop.includes(filePath)) {
    return false;
  }
  noLoop.push(filePath);
  return hasChangedImportContent(config, compilerCtx, buildCtx, filePath, content, noLoop);
};
const hasChangedImportContent = async (config, compilerCtx, buildCtx, filePath, content, checkedFiles) => {
  const cssImports = await getCssImports(config, compilerCtx, buildCtx, filePath, content);
  if (cssImports.length === 0) {
    // don't bother
    return false;
  }
  const isChangedImport = buildCtx.filesChanged.some((changedFilePath) => {
    return cssImports.some((c) => c.filePath === changedFilePath);
  });
  if (isChangedImport) {
    // one of the changed files is an import of this file
    return true;
  }
  // keep diggin'
  const promises = cssImports.map(async (cssImportData) => {
    try {
      const content = await compilerCtx.fs.readFile(cssImportData.filePath);
      return hasChangedImportFile(config, compilerCtx, buildCtx, cssImportData.filePath, content, checkedFiles);
    }
    catch (e) {
      return false;
    }
  });
  const results = await Promise.all(promises);
  return results.includes(true);
};

function resolveComponentDependencies(cmps) {
  computeDependencies(cmps);
  computeDependents(cmps);
}
function computeDependencies(cmps) {
  const visited = new Set();
  cmps.forEach((cmp) => {
    resolveTransitiveDependencies(cmp, cmps, visited);
    cmp.dependencies = unique(cmp.dependencies).sort();
  });
}
function computeDependents(cmps) {
  cmps.forEach((cmp) => {
    resolveTransitiveDependents(cmp, cmps);
  });
}
function resolveTransitiveDependencies(cmp, cmps, visited) {
  if (visited.has(cmp)) {
    return cmp.dependencies;
  }
  visited.add(cmp);
  const dependencies = unique(cmp.potentialCmpRefs.filter((tagName) => cmps.some((c) => c.tagName === tagName)));
  cmp.dependencies = cmp.directDependencies = dependencies;
  const transitiveDeps = flatOne(dependencies
    .map((tagName) => cmps.find((c) => c.tagName === tagName))
    .map((c) => resolveTransitiveDependencies(c, cmps, visited)));
  return (cmp.dependencies = [...dependencies, ...transitiveDeps]);
}
function resolveTransitiveDependents(cmp, cmps) {
  cmp.dependents = cmps
    .filter((c) => c.dependencies.includes(cmp.tagName))
    .map((c) => c.tagName)
    .sort();
  cmp.directDependents = cmps
    .filter((c) => c.directDependencies.includes(cmp.tagName))
    .map((c) => c.tagName)
    .sort();
}

const getDeclarationParameters = (decorator) => {
  if (!t.isCallExpression(decorator.expression)) {
    return [];
  }
  return decorator.expression.arguments.map(getDeclarationParameter);
};
const getDeclarationParameter = (arg) => {
  if (t.isObjectLiteralExpression(arg)) {
    return objectLiteralToObjectMap(arg);
  }
  else if (t.isStringLiteral(arg)) {
    return arg.text;
  }
  throw new Error(`invalid decorator argument: ${arg.getText()}`);
};
/**
 * Returns a function that checks if a decorator:
 * - is a call expression. these are decorators that are immediately followed by open/close parenthesis with optional
 *   arg(s), e.g. `@Prop()`
 * - the name of the decorator matches the provided `propName`
 *
 * @param propName the name of the decorator to match against
 * @returns true if the conditions above are both true, false otherwise
 */
const isDecoratorNamed = (propName) => {
  return (dec) => {
    return t.isCallExpression(dec.expression) && dec.expression.expression.getText() === propName;
  };
};

const styleToStatic = (newMembers, componentOptions) => {
  const defaultModeStyles = [];
  if (componentOptions.styleUrls) {
    if (Array.isArray(componentOptions.styleUrls)) {
      defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls));
    }
    else {
      defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls[DEFAULT_STYLE_MODE]));
    }
  }
  if (componentOptions.styleUrl) {
    defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrl));
  }
  let styleUrls = {};
  if (componentOptions.styleUrls && !Array.isArray(componentOptions.styleUrls)) {
    styleUrls = normalizeStyleUrls(componentOptions.styleUrls);
  }
  if (defaultModeStyles.length > 0) {
    styleUrls[DEFAULT_STYLE_MODE] = defaultModeStyles;
  }
  if (Object.keys(styleUrls).length > 0) {
    const originalStyleUrls = convertValueToLiteral(styleUrls);
    newMembers.push(createStaticGetter('originalStyleUrls', originalStyleUrls));
    const norlizedStyleExt = normalizeExtension(styleUrls);
    const normalizedStyleExp = convertValueToLiteral(norlizedStyleExt);
    newMembers.push(createStaticGetter('styleUrls', normalizedStyleExp));
  }
  if (typeof componentOptions.styles === 'string') {
    const styles = componentOptions.styles.trim();
    if (styles.length > 0) {
      // @Component({
      //   styles: ":host {...}"
      // })
      newMembers.push(createStaticGetter('styles', t.factory.createStringLiteral(styles)));
    }
  }
  else if (componentOptions.styles) {
    const convertIdentifier = componentOptions.styles;
    if (convertIdentifier.__identifier) {
      // import styles from './styles.css';
      // @Component({
      //   styles
      // })
      const stylesIdentifier = convertIdentifier.__escapedText;
      newMembers.push(createStaticGetter('styles', t.factory.createIdentifier(stylesIdentifier)));
    }
    else if (typeof convertIdentifier === 'object') {
      // import ios from './ios.css';
      // import md from './md.css';
      // @Component({
      //   styles: {
      //   ios
      //   md
      //   }
      // })
      if (Object.keys(convertIdentifier).length > 0) {
        newMembers.push(createStaticGetter('styles', convertValueToLiteral(convertIdentifier)));
      }
    }
  }
};
const normalizeExtension = (styleUrls) => {
  const compilerStyleUrls = {};
  Object.keys(styleUrls).forEach((key) => {
    compilerStyleUrls[key] = styleUrls[key].map((s) => useCss(s));
  });
  return compilerStyleUrls;
};
const useCss = (stylePath) => {
  const sourceFileDir = dirname(stylePath);
  const sourceFileExt = extname$1(stylePath);
  const sourceFileName = basename(stylePath, sourceFileExt);
  return join(sourceFileDir, sourceFileName + '.css');
};
const normalizeStyleUrls = (styleUrls) => {
  const compilerStyleUrls = {};
  Object.keys(styleUrls).forEach((key) => {
    compilerStyleUrls[key] = normalizeStyleUrl(styleUrls[key]);
  });
  return compilerStyleUrls;
};
const normalizeStyleUrl = (style) => {
  if (Array.isArray(style)) {
    return style;
  }
  if (style) {
    return [style];
  }
  return [];
};

const componentDecoratorToStatic = (config, typeChecker, diagnostics, cmpNode, newMembers, componentDecorator) => {
  const [componentOptions] = getDeclarationParameters(componentDecorator);
  if (!componentOptions) {
    return;
  }
  if (!validateComponent(config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator)) {
    return;
  }
  newMembers.push(createStaticGetter('is', convertValueToLiteral(componentOptions.tag.trim())));
  if (componentOptions.shadow) {
    newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('shadow')));
    if (typeof componentOptions.shadow !== 'boolean') {
      if (componentOptions.shadow.delegatesFocus === true) {
        newMembers.push(createStaticGetter('delegatesFocus', convertValueToLiteral(true)));
      }
    }
  }
  else if (componentOptions.scoped) {
    newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('scoped')));
  }
  styleToStatic(newMembers, componentOptions);
  const assetsDirs = componentOptions.assetsDirs || [];
  if (isString$1(componentOptions.assetsDir)) {
    assetsDirs.push(componentOptions.assetsDir);
    const warn = buildWarn(diagnostics);
    warn.messageText = `@Component option "assetsDir" should be renamed to "assetsDirs" and the value should be an array of strings.`;
    augmentDiagnosticWithNode(warn, componentDecorator);
  }
  if (assetsDirs.length > 0) {
    newMembers.push(createStaticGetter('assetsDirs', convertValueToLiteral(assetsDirs)));
  }
};
const validateComponent = (config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator) => {
  var _a;
  const extendNode = cmpNode.heritageClauses && cmpNode.heritageClauses.find((c) => c.token === t.SyntaxKind.ExtendsKeyword);
  if (extendNode) {
    const err = buildError(diagnostics);
    err.messageText = `Classes decorated with @Component can not extend from a base class.
  Stencil needs to be able to switch between different base classes in order to implement the different output targets such as: lazy and raw web components.`;
    augmentDiagnosticWithNode(err, extendNode);
    return false;
  }
  if (componentOptions.shadow && componentOptions.scoped) {
    const err = buildError(diagnostics);
    err.messageText = `Components cannot be "scoped" and "shadow" at the same time, they are mutually exclusive configurations.`;
    augmentDiagnosticWithNode(err, findTagNode('scoped', componentDecorator));
    return false;
  }
  const constructor = cmpNode.members.find(t.isConstructorDeclaration);
  if (constructor && constructor.parameters.length > 0) {
    const err = buildError(diagnostics);
    err.messageText = `Classes decorated with @Component can not have a "constructor" that takes arguments.
  All data required by a component must be passed by using class properties decorated with @Prop()`;
    augmentDiagnosticWithNode(err, constructor.parameters[0]);
    return false;
  }
  // check if class has more than one decorator
  const otherDecorator = (_a = retrieveTsDecorators(cmpNode)) === null || _a === void 0 ? void 0 : _a.find((d) => d !== componentDecorator);
  if (otherDecorator) {
    const err = buildError(diagnostics);
    err.messageText = `Classes decorated with @Component can not be decorated with more decorators.
  Stencil performs extensive static analysis on top of your components in order to generate the necessary metadata, runtime decorators at the components level make this task very hard.`;
    augmentDiagnosticWithNode(err, otherDecorator);
    return false;
  }
  const tag = componentOptions.tag;
  if (typeof tag !== 'string' || tag.trim().length === 0) {
    const err = buildError(diagnostics);
    err.messageText = `tag missing in component decorator`;
    augmentDiagnosticWithNode(err, componentDecorator);
    return false;
  }
  const tagError = validateComponentTag(tag);
  if (tagError) {
    const err = buildError(diagnostics);
    err.messageText = `${tagError}. Please refer to https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name for more info.`;
    augmentDiagnosticWithNode(err, findTagNode('tag', componentDecorator));
    return false;
  }
  if (!config._isTesting) {
    const nonTypeExports = typeChecker
      .getExportsOfModule(typeChecker.getSymbolAtLocation(cmpNode.getSourceFile()))
      .filter((symbol) => (symbol.flags & (t.SymbolFlags.Interface | t.SymbolFlags.TypeAlias)) === 0)
      .filter((symbol) => symbol.name !== cmpNode.name.text);
    nonTypeExports.forEach((symbol) => {
      const err = buildError(diagnostics);
      err.messageText = `To allow efficient bundling, modules using @Component() can only have a single export which is the component class itself.
    Any other exports should be moved to a separate file.
    For further information check out: https://stenciljs.com/docs/module-bundling`;
      const errorNode = symbol.valueDeclaration ? symbol.valueDeclaration : symbol.declarations[0];
      augmentDiagnosticWithNode(err, errorNode);
    });
    if (nonTypeExports.length > 0) {
      return false;
    }
  }
  return true;
};
const findTagNode = (propName, node) => {
  if (t.isDecorator(node) && t.isCallExpression(node.expression)) {
    const arg = node.expression.arguments[0];
    if (t.isObjectLiteralExpression(arg)) {
      arg.properties.forEach((p) => {
        if (t.isPropertyAssignment(p)) {
          if (p.name.getText() === propName) {
            node = p.initializer;
          }
        }
      });
    }
  }
  return node;
};

const elementDecoratorsToStatic = (diagnostics, decoratedMembers, typeChecker, newMembers) => {
  const elementRefs = decoratedMembers
    .filter(t.isPropertyDeclaration)
    .map((prop) => parseElementDecorator(diagnostics, typeChecker, prop))
    .filter((element) => !!element);
  if (elementRefs.length > 0) {
    newMembers.push(createStaticGetter('elementRef', t.factory.createStringLiteral(elementRefs[0])));
    if (elementRefs.length > 1) {
      const error = buildError(diagnostics);
      error.messageText = `It's not valid to add more than one Element() decorator`;
    }
  }
};
const parseElementDecorator = (_diagnostics, _typeChecker, prop) => {
  var _a;
  const elementDecorator = (_a = retrieveTsDecorators(prop)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('Element'));
  if (elementDecorator == null) {
    return null;
  }
  return prop.name.getText();
};

const eventDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, newMembers) => {
  const events = decoratedProps
    .filter(t.isPropertyDeclaration)
    .map((prop) => parseEventDecorator(diagnostics, typeChecker, prop))
    .filter((ev) => !!ev);
  if (events.length > 0) {
    newMembers.push(createStaticGetter('events', convertValueToLiteral(events)));
  }
};
/**
 * Parse a single instance of Stencil's `@Event()` decorator and generate metadata for the class member that is
 * decorated
 * @param diagnostics a list of diagnostics used as a part of the parsing process. Any parse errors/warnings shall be
 * added to this collection
 * @param typeChecker an instance of the TypeScript type checker, used to generate information about the `@Event()` and
 * its surrounding context in the AST
 * @param prop the property on the Stencil component class that is decorated with `@Event()`
 * @returns generated metadata for the class member decorated by `@Event()`, or `null` if none could be derived
 */
const parseEventDecorator = (diagnostics, typeChecker, prop) => {
  var _a;
  const eventDecorator = (_a = retrieveTsDecorators(prop)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('Event'));
  if (eventDecorator == null) {
    return null;
  }
  const memberName = prop.name.getText();
  if (!memberName) {
    return null;
  }
  const [eventOpts] = getDeclarationParameters(eventDecorator);
  const symbol = typeChecker.getSymbolAtLocation(prop.name);
  const eventName = getEventName(eventOpts, memberName);
  validateEventName(diagnostics, prop.name, eventName);
  const eventMeta = {
    method: memberName,
    name: eventName,
    bubbles: eventOpts && typeof eventOpts.bubbles === 'boolean' ? eventOpts.bubbles : true,
    cancelable: eventOpts && typeof eventOpts.cancelable === 'boolean' ? eventOpts.cancelable : true,
    composed: eventOpts && typeof eventOpts.composed === 'boolean' ? eventOpts.composed : true,
    docs: serializeSymbol(typeChecker, symbol),
    complexType: getComplexType$1(typeChecker, prop),
  };
  validateReferences(diagnostics, eventMeta.complexType.references, prop.type);
  return eventMeta;
};
const getEventName = (eventOptions, memberName) => {
  if (eventOptions && typeof eventOptions.eventName === 'string' && eventOptions.eventName.trim().length > 0) {
    // always use the event name if given
    return eventOptions.eventName.trim();
  }
  return memberName;
};
/**
 * Derive Stencil's class member type metadata from a node in the AST
 * @param typeChecker the TypeScript type checker
 * @param node the node in the AST to generate metadata for
 * @returns the generated metadata
 */
const getComplexType$1 = (typeChecker, node) => {
  const sourceFile = node.getSourceFile();
  const eventType = node.type ? getEventType(node.type) : null;
  return {
    original: eventType ? eventType.getText() : 'any',
    resolved: eventType ? resolveType(typeChecker, typeChecker.getTypeFromTypeNode(eventType)) : 'any',
    references: eventType ? getAttributeTypeInfo(eventType, sourceFile) : {},
  };
};
/**
 * Derive the type of the event from the typings of `EventEmitter`
 * @param type the AST node containing the `EventEmitter` typing
 * @returns the type taken from `EventEmitter`, or `null` if the type cannot be derived
 */
const getEventType = (type) => {
  if (t.isTypeReferenceNode(type) &&
    t.isIdentifier(type.typeName) &&
    type.typeName.text === 'EventEmitter' &&
    type.typeArguments &&
    type.typeArguments.length > 0) {
    return type.typeArguments[0];
  }
  return null;
};
/**
 * Helper function for validating the name of the event
 *
 * This function assumes that the name of the event has been determined prior to calling it
 *
 * @param diagnostics a list of diagnostics used as a part of the validation process. Any parse errors/warnings shall be
 * added to this collection
 * @param node the node in the AT containing the class member decorated with `@Event()`
 * @param eventName the name of the event
 */
const validateEventName = (diagnostics, node, eventName) => {
  // this regex checks for a string that begins with a capital letter - e.g. 'AskJeeves', 'Zoo', 'Spotify'
  if (/^[A-Z]/.test(eventName)) {
    const diagnostic = buildWarn(diagnostics);
    diagnostic.messageText = [
      `In order to be compatible with all event listeners on elements, the event name `,
      `cannot start with a capital letter. `,
      `Please lowercase the first character for the event to best work with all listeners.`,
    ].join('');
    augmentDiagnosticWithNode(diagnostic, node);
    return;
  }
  // this regex checks for a string that begins 'on', followed by a capital letter - e.g. 'onAbout', 'onZing', 'onBlur'
  if (/^on[A-Z]/.test(eventName)) {
    const warn = buildWarn(diagnostics);
    const suggestedEventName = eventName[2].toLowerCase() + eventName.slice(3);
    warn.messageText = `Events decorated with @Event() should describe the actual DOM event name, not the handler. In other words "${eventName}" would be better named as "${suggestedEventName}".`;
    augmentDiagnosticWithNode(warn, node);
    return;
  }
  if (DOM_EVENT_NAMES.has(eventName.toLowerCase())) {
    const diagnostic = buildWarn(diagnostics);
    diagnostic.messageText = `The event name conflicts with the "${eventName}" native DOM event name.`;
    augmentDiagnosticWithNode(diagnostic, node);
    return;
  }
};
const DOM_EVENT_NAMES = new Set([
  'CheckboxStateChange',
  'DOMContentLoaded',
  'DOMMenuItemActive',
  'DOMMenuItemInactive',
  'DOMMouseScroll',
  'MSManipulationStateChanged',
  'MSPointerHover',
  'MozAudioAvailable',
  'MozGamepadButtonDown',
  'MozGamepadButtonUp',
  'MozMousePixelScroll',
  'MozOrientation',
  'MozScrolledAreaChanged',
  'RadioStateChange',
  'SVGAbort',
  'SVGError',
  'SVGLoad',
  'SVGResize',
  'SVGScroll',
  'SVGUnload',
  'SVGZoom',
  'abort',
  'afterprint',
  'afterscriptexecute',
  'alerting',
  'animationcancel',
  'animationend',
  'animationiteration',
  'animationstart',
  'appinstalled',
  'audioend',
  'audioprocess',
  'audiostart',
  'auxclick',
  'beforeinstallprompt',
  'beforeprint',
  'beforescriptexecute',
  'beforeunload',
  'beginEvent',
  'blur',
  'boundary',
  'broadcast',
  'busy',
  'callschanged',
  'canplay',
  'canplaythrough',
  'cardstatechange',
  'cfstatechange',
  'change',
  'chargingchange',
  'chargingtimechange',
  'checking',
  'click',
  'command',
  'commandupdate',
  'compassneedscalibration',
  'complete',
  'compositionend',
  'compositionstart',
  'compositionupdate',
  'connected',
  'connecting',
  'connectionInfoUpdate',
  'contextmenu',
  'copy',
  'cut',
  'datachange',
  'dataerror',
  'dblclick',
  'delivered',
  'devicechange',
  'devicemotion',
  'deviceorientation',
  'dialing',
  'disabled',
  'dischargingtimechange',
  'disconnected',
  'disconnecting',
  'downloading',
  'drag',
  'dragend',
  'dragenter',
  'dragleave',
  'dragover',
  'dragstart',
  'drop',
  'durationchange',
  'emptied',
  'enabled',
  'end',
  'endEvent',
  'ended',
  'error',
  'focus',
  'focusin',
  'focusout',
  'fullscreenchange',
  'fullscreenerror',
  'gamepadconnected',
  'gamepaddisconnected',
  'gotpointercapture',
  'hashchange',
  'held',
  'holding',
  'icccardlockerror',
  'iccinfochange',
  'incoming',
  'input',
  'invalid',
  'keydown',
  'keypress',
  'keyup',
  'languagechange',
  'levelchange',
  'load',
  'loadeddata',
  'loadedmetadata',
  'loadend',
  'loadstart',
  'localized',
  'lostpointercapture',
  'mark',
  'message',
  'messageerror',
  'mousedown',
  'mouseenter',
  'mouseleave',
  'mousemove',
  'mouseout',
  'mouseover',
  'mouseup',
  'mousewheel',
  'mozbrowseractivitydone',
  'mozbrowserasyncscroll',
  'mozbrowseraudioplaybackchange',
  'mozbrowsercaretstatechanged',
  'mozbrowserclose',
  'mozbrowsercontextmenu',
  'mozbrowserdocumentfirstpaint',
  'mozbrowsererror',
  'mozbrowserfindchange',
  'mozbrowserfirstpaint',
  'mozbrowsericonchange',
  'mozbrowserloadend',
  'mozbrowserloadstart',
  'mozbrowserlocationchange',
  'mozbrowsermanifestchange',
  'mozbrowsermetachange',
  'mozbrowseropensearch',
  'mozbrowseropentab',
  'mozbrowseropenwindow',
  'mozbrowserresize',
  'mozbrowserscroll',
  'mozbrowserscrollareachanged',
  'mozbrowserscrollviewchange',
  'mozbrowsersecuritychange',
  'mozbrowserselectionstatechanged',
  'mozbrowsershowmodalprompt',
  'mozbrowsertitlechange',
  'mozbrowserusernameandpasswordrequired',
  'mozbrowservisibilitychange',
  'moztimechange',
  'msContentZoom',
  'nomatch',
  'notificationclick',
  'noupdate',
  'obsolete',
  'offline',
  'online',
  'orientationchange',
  'overflow',
  'pagehide',
  'pageshow',
  'paste',
  'pause',
  'play',
  'playing',
  'pointercancel',
  'pointerdown',
  'pointerenter',
  'pointerleave',
  'pointerlockchange',
  'pointerlockerror',
  'pointermove',
  'pointerout',
  'pointerover',
  'pointerup',
  'popstate',
  'popuphidden',
  'popuphiding',
  'popupshowing',
  'popupshown',
  'progress',
  'push',
  'pushsubscriptionchange',
  'ratechange',
  'readystatechange',
  'received',
  'repeatEvent',
  'reset',
  'resize',
  'resourcetimingbufferfull',
  'result',
  'resume',
  'resuming',
  'scroll',
  'seeked',
  'seeking',
  'select',
  'selectionchange',
  'selectstart',
  'sent',
  'show',
  'slotchange',
  'smartcard-insert',
  'smartcard-remove',
  'soundend',
  'soundstart',
  'speechend',
  'speechstart',
  'stalled',
  'start',
  'statechange',
  'statuschange',
  'stkcommand',
  'stksessionend',
  'storage',
  'submit',
  'suspend',
  'timeout',
  'timeupdate',
  'touchcancel',
  'touchend',
  'touchenter',
  'touchleave',
  'touchmove',
  'touchstart',
  'transitioncancel',
  'transitionend',
  'transitionrun',
  'transitionstart',
  'underflow',
  'unload',
  'updateready',
  'userproximity',
  'ussdreceived',
  'visibilitychange',
  'voicechange',
  'voiceschanged',
  'volumechange',
  'vrdisplayactivate',
  'vrdisplayblur',
  'vrdisplayconnect',
  'vrdisplaydeactivate',
  'vrdisplaydisconnect',
  'vrdisplayfocus',
  'vrdisplaypresentchange',
  'waiting',
  'wheel',
].map((e) => e.toLowerCase()));

const listenDecoratorsToStatic = (diagnostics, decoratedMembers, newMembers) => {
  const listeners = decoratedMembers
    .filter(t.isMethodDeclaration)
    .map((method) => parseListenDecorators(diagnostics, method));
  const flatListeners = flatOne(listeners);
  if (flatListeners.length > 0) {
    newMembers.push(createStaticGetter('listeners', convertValueToLiteral(flatListeners)));
  }
};
const parseListenDecorators = (diagnostics, method) => {
  var _a;
  const listenDecorators = ((_a = retrieveTsDecorators(method)) !== null && _a !== void 0 ? _a : []).filter(isDecoratorNamed('Listen'));
  if (listenDecorators.length === 0) {
    return [];
  }
  return listenDecorators.map((listenDecorator) => {
    const methodName = method.name.getText();
    const [listenText, listenOptions] = getDeclarationParameters(listenDecorator);
    const eventNames = listenText.split(',');
    if (eventNames.length > 1) {
      const err = buildError(diagnostics);
      err.messageText = 'Please use multiple @Listen() decorators instead of comma-separated names.';
      augmentDiagnosticWithNode(err, listenDecorator);
    }
    const listener = parseListener(eventNames[0], listenOptions, methodName);
    if (listener.target === 'parent') {
      const err = buildError(diagnostics);
      err.messageText =
        'The "parent" target is no longer available as of Stencil 2. Please use "window", "document" or "body" instead.';
      augmentDiagnosticWithNode(err, listenDecorator);
    }
    return listener;
  });
};
const parseListener = (eventName, opts = {}, methodName) => {
  const rawEventName = eventName.trim();
  const listener = {
    name: rawEventName,
    method: methodName,
    target: opts.target,
    capture: typeof opts.capture === 'boolean' ? opts.capture : false,
    passive: typeof opts.passive === 'boolean'
      ? opts.passive
      : // if the event name is kown to be a passive event then set it to true
        PASSIVE_TRUE_DEFAULTS.has(rawEventName.toLowerCase()),
  };
  return listener;
};
const PASSIVE_TRUE_DEFAULTS = new Set([
  'dragstart',
  'drag',
  'dragend',
  'dragenter',
  'dragover',
  'dragleave',
  'drop',
  'mouseenter',
  'mouseover',
  'mousemove',
  'mousedown',
  'mouseup',
  'mouseleave',
  'mouseout',
  'mousewheel',
  'pointerover',
  'pointerenter',
  'pointerdown',
  'pointermove',
  'pointerup',
  'pointercancel',
  'pointerout',
  'pointerleave',
  'resize',
  'scroll',
  'touchstart',
  'touchmove',
  'touchend',
  'touchenter',
  'touchleave',
  'touchcancel',
  'wheel',
]);

/**
 * Determine if a public class member collides with a reserved name for HTML elements, nodes, or JSX
 * @param diagnostics a collection of compiler diagnostics. If a naming collision is found, a diagnostic detected must
 * be added to this collection
 * @param memberName the name of the class member to check for collision
 * @param decorator the decorator associated with the class member, used in providing richer error diagnostics
 * @param memberType a string representing the class member's type. e.g. 'prop'. Used in providing richer error
 * diagnostics
 * @param node the TypeScript AST node at which the class member is defined
 */
const validatePublicName = (diagnostics, memberName, decorator, memberType, node) => {
  if (RESERVED_PUBLIC_MEMBERS.has(memberName.toLowerCase())) {
    const warn = buildWarn(diagnostics);
    warn.messageText = [
      `The ${decorator} name "${memberName}" is a reserved public name. `,
      `Please rename the "${memberName}" ${memberType} so it does not conflict with an existing standardized prototype member. `,
      `Reusing ${memberType} names that are already defined on the element's prototype may cause `,
      `unexpected runtime errors or user-interface issues on various browsers, so it's best to avoid them entirely.`,
    ].join('');
    augmentDiagnosticWithNode(warn, node);
    return;
  }
};
const HTML_ELEMENT_KEYS = [
  'title',
  'lang',
  'translate',
  'dir',
  // 'dataset',
  // 'hidden',
  'tabIndex',
  'accessKey',
  'draggable',
  // 'spellcheck',
  // 'autocapitalize',
  'contentEditable',
  'isContentEditable',
  // 'inputMode',
  'offsetParent',
  'offsetTop',
  'offsetLeft',
  'offsetWidth',
  'offsetHeight',
  'style',
  'innerText',
  'outerText',
  'oncopy',
  'oncut',
  'onpaste',
  'onabort',
  'onblur',
  'oncancel',
  'oncanplay',
  'oncanplaythrough',
  'onchange',
  'onclick',
  'onclose',
  'oncontextmenu',
  'oncuechange',
  'ondblclick',
  'ondrag',
  'ondragend',
  'ondragenter',
  'ondragleave',
  'ondragover',
  'ondragstart',
  'ondrop',
  'ondurationchange',
  'onemptied',
  'onended',
  'onerror',
  'onfocus',
  'onfocusin',
  'onfocusout',
  'oninput',
  'oninvalid',
  'onkeydown',
  'onkeypress',
  'onkeyup',
  'onload',
  'onloadeddata',
  'onloadedmetadata',
  'onloadstart',
  'onmousedown',
  'onmouseenter',
  'onmouseleave',
  'onmousemove',
  'onmouseout',
  'onmouseover',
  'onmouseup',
  'onmousewheel',
  'onpause',
  'onplay',
  'onplaying',
  'onprogress',
  'onratechange',
  'onreset',
  'onresize',
  'onscroll',
  'onseeked',
  'onseeking',
  'onselect',
  'onstalled',
  'onsubmit',
  'onsuspend',
  'ontimeupdate',
  'ontoggle',
  'onvolumechange',
  'onwaiting',
  'onwheel',
  'onauxclick',
  'ongotpointercapture',
  'onlostpointercapture',
  'onpointerdown',
  'onpointermove',
  'onpointerup',
  'onpointercancel',
  'onpointerover',
  'onpointerout',
  'onpointerenter',
  'onpointerleave',
  'onselectstart',
  'onselectionchange',
  'nonce',
  'click',
  'focus',
  'blur',
];
const ELEMENT_KEYS = [
  'namespaceURI',
  'prefix',
  'localName',
  'tagName',
  'id',
  'className',
  'classList',
  'slot',
  'attributes',
  'shadowRoot',
  'assignedSlot',
  'innerHTML',
  'outerHTML',
  'scrollTop',
  'scrollLeft',
  'scrollWidth',
  'scrollHeight',
  'clientTop',
  'clientLeft',
  'clientWidth',
  'clientHeight',
  'attributeStyleMap',
  'onbeforecopy',
  'onbeforecut',
  'onbeforepaste',
  'onsearch',
  'previousElementSibling',
  'nextElementSibling',
  'children',
  'firstElementChild',
  'lastElementChild',
  'childElementCount',
  'onfullscreenchange',
  'onfullscreenerror',
  'onwebkitfullscreenchange',
  'onwebkitfullscreenerror',
  'setPointerCapture',
  'releasePointerCapture',
  'hasPointerCapture',
  'hasAttributes',
  'getAttributeNames',
  'getAttribute',
  'getAttributeNS',
  'setAttribute',
  'setAttributeNS',
  'removeAttribute',
  'removeAttributeNS',
  'hasAttribute',
  'hasAttributeNS',
  'toggleAttribute',
  'getAttributeNode',
  'getAttributeNodeNS',
  'setAttributeNode',
  'setAttributeNodeNS',
  'removeAttributeNode',
  'closest',
  'matches',
  'webkitMatchesSelector',
  'attachShadow',
  'getElementsByTagName',
  'getElementsByTagNameNS',
  'getElementsByClassName',
  'insertAdjacentElement',
  'insertAdjacentText',
  'insertAdjacentHTML',
  'requestPointerLock',
  'getClientRects',
  'getBoundingClientRect',
  'scrollIntoView',
  'scroll',
  'scrollTo',
  'scrollBy',
  'scrollIntoViewIfNeeded',
  'animate',
  'computedStyleMap',
  'before',
  'after',
  'replaceWith',
  'remove',
  'prepend',
  'append',
  'querySelector',
  'querySelectorAll',
  'requestFullscreen',
  'webkitRequestFullScreen',
  'webkitRequestFullscreen',
  'part',
  'createShadowRoot',
  'getDestinationInsertionPoints',
];
const NODE_KEYS = [
  'ELEMENT_NODE',
  'ATTRIBUTE_NODE',
  'TEXT_NODE',
  'CDATA_SECTION_NODE',
  'ENTITY_REFERENCE_NODE',
  'ENTITY_NODE',
  'PROCESSING_INSTRUCTION_NODE',
  'COMMENT_NODE',
  'DOCUMENT_NODE',
  'DOCUMENT_TYPE_NODE',
  'DOCUMENT_FRAGMENT_NODE',
  'NOTATION_NODE',
  'DOCUMENT_POSITION_DISCONNECTED',
  'DOCUMENT_POSITION_PRECEDING',
  'DOCUMENT_POSITION_FOLLOWING',
  'DOCUMENT_POSITION_CONTAINS',
  'DOCUMENT_POSITION_CONTAINED_BY',
  'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
  'nodeType',
  'nodeName',
  'baseURI',
  'isConnected',
  'ownerDocument',
  'parentNode',
  'parentElement',
  'childNodes',
  'firstChild',
  'lastChild',
  'previousSibling',
  'nextSibling',
  'nodeValue',
  'textContent',
  'hasChildNodes',
  'getRootNode',
  'normalize',
  'cloneNode',
  'isEqualNode',
  'isSameNode',
  'compareDocumentPosition',
  'contains',
  'lookupPrefix',
  'lookupNamespaceURI',
  'isDefaultNamespace',
  'insertBefore',
  'appendChild',
  'replaceChild',
  'removeChild',
];
const JSX_KEYS = ['ref', 'key'];
const ALL_KEYS = [...HTML_ELEMENT_KEYS, ...ELEMENT_KEYS, ...NODE_KEYS, ...JSX_KEYS].map((p) => p.toLowerCase());
const RESERVED_PUBLIC_MEMBERS = new Set(ALL_KEYS);

const methodDecoratorsToStatic = (config, diagnostics, cmpNode, decoratedProps, typeChecker, newMembers) => {
  const tsSourceFile = cmpNode.getSourceFile();
  const methods = decoratedProps
    .filter(t.isMethodDeclaration)
    .map((method) => parseMethodDecorator(config, diagnostics, tsSourceFile, typeChecker, method))
    .filter((method) => !!method);
  if (methods.length > 0) {
    newMembers.push(createStaticGetter('methods', t.factory.createObjectLiteralExpression(methods, true)));
  }
};
const parseMethodDecorator = (config, diagnostics, tsSourceFile, typeChecker, method) => {
  var _a;
  const methodDecorator = (_a = retrieveTsDecorators(method)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('Method'));
  if (methodDecorator == null) {
    return null;
  }
  const methodName = method.name.getText();
  const flags = t.TypeFormatFlags.WriteArrowStyleSignature | t.TypeFormatFlags.NoTruncation;
  const signature = typeChecker.getSignatureFromDeclaration(method);
  const returnType = typeChecker.getReturnTypeOfSignature(signature);
  const returnTypeNode = typeChecker.typeToTypeNode(returnType, method, t.NodeBuilderFlags.NoTruncation | t.NodeBuilderFlags.NoTypeReduction);
  let returnString = typeToString(typeChecker, returnType);
  let signatureString = typeChecker.signatureToString(signature, method, flags, t.SignatureKind.Call);
  if (!config._isTesting) {
    if (returnString === 'void') {
      const warn = buildWarn(diagnostics);
      warn.header = '@Method requires async';
      warn.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
      augmentDiagnosticWithNode(warn, method.name);
      returnString = 'Promise<void>';
      signatureString = signatureString.replace(/=> void$/, '=> Promise<void>');
    }
    else if (!isTypePromise(returnString)) {
      const err = buildError(diagnostics);
      err.header = '@Method requires async';
      err.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
      augmentDiagnosticWithNode(err, method.name);
    }
  }
  if (isMemberPrivate(method)) {
    const err = buildError(diagnostics);
    err.messageText =
      'Methods decorated with the @Method() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/methods';
    augmentDiagnosticWithNode(err, retrieveTsModifiers(method)[0]);
  }
  // Validate if the method name does not conflict with existing public names
  validatePublicName(diagnostics, methodName, '@Method()', 'method', method.name);
  const methodMeta = {
    complexType: {
      signature: signatureString,
      parameters: signature.parameters.map((symbol) => serializeSymbol(typeChecker, symbol)),
      references: {
        ...getAttributeTypeInfo(returnTypeNode, tsSourceFile),
        ...getAttributeTypeInfo(method, tsSourceFile),
      },
      return: returnString,
    },
    docs: {
      text: t.displayPartsToString(signature.getDocumentationComment(typeChecker)),
      tags: mapJSDocTagInfo(signature.getJsDocTags()),
    },
  };
  validateReferences(diagnostics, methodMeta.complexType.references, method.type || method.name);
  const staticProp = t.factory.createPropertyAssignment(t.factory.createStringLiteral(methodName), convertValueToLiteral(methodMeta));
  return staticProp;
};
const isTypePromise = (typeStr) => {
  return /^Promise<.+>$/.test(typeStr);
};
const validateMethods = (diagnostics, members) => {
  members.filter(t.isMethodDeclaration).map((method) => {
    if (method.name.getText() === 'componentDidUnload') {
      const err = buildError(diagnostics);
      err.header = `Replace "componentDidUnload()" with "disconnectedCallback()"`;
      err.messageText = `The "componentDidUnload()" method was removed in Stencil 2. Please use the "disconnectedCallback()" method instead.`;
      augmentDiagnosticWithNode(err, method.name);
    }
  });
};

/**
 * Parse a collection of class members decorated with `@Prop()`
 *
 * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
 * added to this collection
 * @param decoratedProps a collection of class elements that may or may not my class members decorated with `@Prop`.
 * Only those decorated with `@Prop()` will be parsed.
 * @param typeChecker a reference to the TypeScript type checker
 * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
 * @param newMembers a collection that parsed `@Prop` annotated class members should be pushed to as a side effect of
 * calling this function
 */
const propDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, watchable, newMembers) => {
  const properties = decoratedProps
    .filter(t.isPropertyDeclaration)
    .map((prop) => parsePropDecorator(diagnostics, typeChecker, prop, watchable))
    .filter((prop) => prop != null);
  if (properties.length > 0) {
    newMembers.push(createStaticGetter('properties', t.factory.createObjectLiteralExpression(properties, true)));
  }
};
/**
 * Parse a single `@Prop` decorator annotated class member
 * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
 * added to this collection
 * @param typeChecker a reference to the TypeScript type checker
 * @param prop the TypeScript `PropertyDeclaration` to parse
 * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
 * @returns a property assignment expression to be added to the Stencil component's class
 */
const parsePropDecorator = (diagnostics, typeChecker, prop, watchable) => {
  var _a;
  const propDecorator = (_a = retrieveTsDecorators(prop)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('Prop'));
  if (propDecorator == null) {
    return null;
  }
  const decoratorParams = getDeclarationParameters(propDecorator);
  const propOptions = decoratorParams[0] || {};
  const propName = prop.name.getText();
  if (isMemberPrivate(prop)) {
    const err = buildError(diagnostics);
    err.messageText =
      'Properties decorated with the @Prop() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/properties';
    augmentDiagnosticWithNode(err, retrieveTsModifiers(prop)[0]);
  }
  if (/^on(-|[A-Z])/.test(propName)) {
    const warn = buildWarn(diagnostics);
    warn.messageText = `The @Prop() name "${propName}" looks like an event. Please use the "@Event()" decorator to expose events instead, not properties or methods.`;
    augmentDiagnosticWithNode(warn, prop.name);
  }
  else {
    validatePublicName(diagnostics, propName, '@Prop()', 'prop', prop.name);
  }
  const symbol = typeChecker.getSymbolAtLocation(prop.name);
  const type = typeChecker.getTypeAtLocation(prop);
  const typeStr = propTypeFromTSType(type);
  const propMeta = {
    type: typeStr,
    mutable: !!propOptions.mutable,
    complexType: getComplexType(typeChecker, prop, type),
    required: prop.exclamationToken !== undefined && propName !== 'mode',
    optional: prop.questionToken !== undefined,
    docs: serializeSymbol(typeChecker, symbol),
  };
  validateReferences(diagnostics, propMeta.complexType.references, prop.type);
  // prop can have an attribute if type is NOT "unknown"
  if (typeStr !== 'unknown') {
    propMeta.attribute = getAttributeName(propName, propOptions);
    propMeta.reflect = getReflect(diagnostics, propDecorator, propOptions);
  }
  // extract default value
  const initializer = prop.initializer;
  if (initializer) {
    propMeta.defaultValue = initializer.getText();
  }
  const staticProp = t.factory.createPropertyAssignment(t.factory.createStringLiteral(propName), convertValueToLiteral(propMeta));
  watchable.add(propName);
  return staticProp;
};
/**
 * Format the attribute name provided as an argument to `@Prop({attribute: ''}`
 * @param propName the prop's name, used as a fallback value
 * @param propOptions the options passed in to the `@Prop` call expression
 * @returns the formatted attribute name
 */
const getAttributeName = (propName, propOptions) => {
  if (propOptions.attribute === null) {
    return undefined;
  }
  if (typeof propOptions.attribute === 'string' && propOptions.attribute.trim().length > 0) {
    return propOptions.attribute.trim().toLowerCase();
  }
  return toDashCase(propName);
};
/**
 * Determines if the 'reflect' property should be applied to the class member decorated with `@Prop`
 * @param diagnostics a collection of compiler diagnostics. Any errors detected with setting 'reflect' must be added to
 * this collection
 * @param propDecorator the AST containing the Prop decorator
 * @param propOptions the options passed in to the `@Prop` call expression
 * @returns `true` if the prop should be reflected in the DOM, `false` otherwise
 */
const getReflect = (diagnostics, propDecorator, propOptions) => {
  if (typeof propOptions.reflect === 'boolean') {
    return propOptions.reflect;
  }
  if (typeof propOptions.reflectToAttr === 'boolean') {
    const err = buildError(diagnostics);
    err.header = `Rename "reflectToAttr" to "reflect"`;
    err.messageText = `@Prop option "reflectToAttr" should be renamed to "reflect".`;
    augmentDiagnosticWithNode(err, propDecorator);
    return propOptions.reflectToAttr;
  }
  return false;
};
const getComplexType = (typeChecker, node, type) => {
  const nodeType = node.type;
  return {
    original: nodeType ? nodeType.getText() : typeToString(typeChecker, type),
    resolved: resolveType(typeChecker, type),
    references: getAttributeTypeInfo(node, node.getSourceFile()),
  };
};
/**
 * Derives a Stencil-permitted prop type from the TypeScript compiler's output. This function may narrow the type of a
 * prop, as the types that can be returned from the TypeScript compiler may be more complex than what Stencil can/should
 * handle for props.
 * @param type the prop type to narrow
 * @returns a valid Stencil prop type
 */
const propTypeFromTSType = (type) => {
  const isAnyType = checkType(type, isAny);
  if (isAnyType) {
    return 'any';
  }
  const isStr = checkType(type, isString);
  const isNu = checkType(type, isNumber);
  const isBool = checkType(type, isBoolean);
  // if type is more than a primitive type at the same time, we mark it as any
  if (Number(isStr) + Number(isNu) + Number(isBool) > 1) {
    return 'any';
  }
  // at this point we know the prop's type is NOT the mix of primitive types
  if (isStr) {
    return 'string';
  }
  if (isNu) {
    return 'number';
  }
  if (isBool) {
    return 'boolean';
  }
  return 'unknown';
};
/**
 * Determines if a TypeScript compiler given `Type` is of a particular type according to the provided `check` parameter.
 * Union types (e.g. `boolean | number | string`) will be evaluated one type at a time.
 * @param type the TypeScript `Type` entity to evaluate
 * @param check a function that takes a TypeScript `Type` as its only argument and returns `true` if the `Type` conforms
 * to a particular type
 * @returns the result of the `check` argument. The result of `check` is `true` for one or more types in a union type,
 * return `true`.
 */
const checkType = (type, check) => {
  if (type.flags & t.TypeFlags.Union) {
    // if the type is a union, check each type in the union
    const union = type;
    if (union.types.some((type) => checkType(type, check))) {
      return true;
    }
  }
  return check(type);
};
/**
 * Determine if a TypeScript compiler `Type` is a boolean
 * @param t the `Type` to evaluate
 * @returns `true` if the `Type` has any boolean-similar flags, `false` otherwise
 */
const isBoolean = (t$1) => {
  if (t$1) {
    return !!(t$1.flags & (t.TypeFlags.Boolean | t.TypeFlags.BooleanLike));
  }
  return false;
};
/**
 * Determine if a TypeScript compiler `Type` is a number
 * @param t the `Type` to evaluate
 * @returns `true` if the `Type` has any number-similar flags, `false` otherwise
 */
const isNumber = (t$1) => {
  if (t$1) {
    return !!(t$1.flags & (t.TypeFlags.Number | t.TypeFlags.NumberLike | t.TypeFlags.NumberLiteral));
  }
  return false;
};
/**
 * Determine if a TypeScript compiler `Type` is a string
 * @param t the `Type` to evaluate
 * @returns `true` if the `Type` has any string-similar flags, `false` otherwise
 */
const isString = (t$1) => {
  if (t$1) {
    return !!(t$1.flags & (t.TypeFlags.String | t.TypeFlags.StringLike | t.TypeFlags.StringLiteral));
  }
  return false;
};
/**
 * Determine if a TypeScript compiler `Type` is of type any
 * @param t the `Type` to evaluate
 * @returns `true` if the `Type` has the `Any` flag set on it, `false` otherwise
 */
const isAny = (t$1) => {
  if (t$1) {
    return !!(t$1.flags & t.TypeFlags.Any);
  }
  return false;
};

/**
 * Convert class fields decorated with `@State` to static getters
 *
 * This function takes a list of decorated properties pulled off of a class
 * declaration AST Node and builds up equivalent static getter AST nodes
 * with which they can be replaced.
 *
 * @param decoratedProps TypeScript AST nodes representing class members
 * @param watchable set of names of fields which should be watched for changes
 * @param newMembers an out param containing new class members
 */
const stateDecoratorsToStatic = (decoratedProps, watchable, newMembers) => {
  const states = decoratedProps
    .filter(t.isPropertyDeclaration)
    .map((prop) => stateDecoratorToStatic(prop, watchable))
    .filter((state) => !!state);
  if (states.length > 0) {
    newMembers.push(createStaticGetter('states', t.factory.createObjectLiteralExpression(states, true)));
  }
};
/**
 * Convert a property declaration decorated with `@State` to a property
 * assignment AST node which maps the name of the state property to an empty
 * object.
 *
 * Note that this function will return null if the property declaration is
 * decorated with other decorators.
 *
 * @param prop A TypeScript AST node representing a class property declaration
 * @param watchable set of names of fields which should be watched for changes
 * @returns a property assignment AST Node which maps the name of the state
 * prop to an empty object
 */
const stateDecoratorToStatic = (prop, watchable) => {
  var _a;
  const stateDecorator = (_a = retrieveTsDecorators(prop)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('State'));
  if (stateDecorator == null) {
    return null;
  }
  const stateName = prop.name.getText();
  watchable.add(stateName);
  return t.factory.createPropertyAssignment(t.factory.createStringLiteral(stateName), t.factory.createObjectLiteralExpression([], true));
};

const watchDecoratorsToStatic = (config, diagnostics, decoratedProps, watchable, newMembers) => {
  const watchers = decoratedProps
    .filter(t.isMethodDeclaration)
    .map((method) => parseWatchDecorator(config, diagnostics, watchable, method));
  const flatWatchers = flatOne(watchers);
  if (flatWatchers.length > 0) {
    newMembers.push(createStaticGetter('watchers', convertValueToLiteral(flatWatchers)));
  }
};
const parseWatchDecorator = (config, diagnostics, watchable, method) => {
  var _a;
  const methodName = method.name.getText();
  const decorators = (_a = retrieveTsDecorators(method)) !== null && _a !== void 0 ? _a : [];
  return decorators.filter(isDecoratorNamed('Watch')).map((decorator) => {
    const [propName] = getDeclarationParameters(decorator);
    if (!watchable.has(propName)) {
      const diagnostic = config.devMode ? buildWarn(diagnostics) : buildError(diagnostics);
      diagnostic.messageText = `@Watch('${propName}') is trying to watch for changes in a property that does not exist.
    Make sure only properties decorated with @State() or @Prop() are watched.`;
      augmentDiagnosticWithNode(diagnostic, decorator);
    }
    return {
      propName,
      methodName,
    };
  });
};

const convertDecoratorsToStatic = (config, diagnostics, typeChecker) => {
  return (transformCtx) => {
    const visit = (node) => {
      if (t.isClassDeclaration(node)) {
        return visitClassDeclaration(config, diagnostics, typeChecker, node);
      }
      return t.visitEachChild(node, visit, transformCtx);
    };
    return (tsSourceFile) => {
      return t.visitEachChild(tsSourceFile, visit, transformCtx);
    };
  };
};
const visitClassDeclaration = (config, diagnostics, typeChecker, classNode) => {
  var _a, _b, _c;
  const componentDecorator = (_a = retrieveTsDecorators(classNode)) === null || _a === void 0 ? void 0 : _a.find(isDecoratorNamed('Component'));
  if (!componentDecorator) {
    return classNode;
  }
  const classMembers = classNode.members;
  const decoratedMembers = classMembers.filter((member) => { var _a, _b; return ((_b = (_a = retrieveTsDecorators(member)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0; });
  // create an array of all class members which are _not_ methods decorated
  // with a Stencil decorator. We do this here because we'll implement the
  // behavior specified for those decorated methods later on.
  const filteredMethodsAndFields = removeStencilMethodDecorators(Array.from(classMembers), diagnostics);
  // parser component decorator (Component)
  componentDecoratorToStatic(config, typeChecker, diagnostics, classNode, filteredMethodsAndFields, componentDecorator);
  // stores a reference to fields that should be watched for changes
  const watchable = new Set();
  // parse member decorators (Prop, State, Listen, Event, Method, Element and Watch)
  if (decoratedMembers.length > 0) {
    propDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, watchable, filteredMethodsAndFields);
    stateDecoratorsToStatic(decoratedMembers, watchable, filteredMethodsAndFields);
    eventDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, filteredMethodsAndFields);
    methodDecoratorsToStatic(config, diagnostics, classNode, decoratedMembers, typeChecker, filteredMethodsAndFields);
    elementDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, filteredMethodsAndFields);
    watchDecoratorsToStatic(config, diagnostics, decoratedMembers, watchable, filteredMethodsAndFields);
    listenDecoratorsToStatic(diagnostics, decoratedMembers, filteredMethodsAndFields);
  }
  // We call the `handleClassFields` method which handles transforming any
  // class fields, removing them from the class and adding statements to the
  // class' constructor which instantiate them there instead.
  const updatedClassFields = handleClassFields(classNode, filteredMethodsAndFields);
  validateMethods(diagnostics, classMembers);
  const currentDecorators = retrieveTsDecorators(classNode);
  return t.factory.updateClassDeclaration(classNode, [
    ...((_b = filterDecorators(currentDecorators, CLASS_DECORATORS_TO_REMOVE)) !== null && _b !== void 0 ? _b : []),
    ...((_c = retrieveTsModifiers(classNode)) !== null && _c !== void 0 ? _c : []),
  ], classNode.name, classNode.typeParameters, classNode.heritageClauses, updatedClassFields);
};
/**
 * Take a list of `ClassElement` AST nodes and remove any decorators from
 * method elements which are Stencil-specific decorators. We implement the
 * intended behavior for these Stencil-specific decorators (things like
 * `@Watch`, `@State`, etc) through a combination of compile- and
 * run-time changes, scaffolding, etc.
 *
 * This utility modifies these class elements to remove any Stencil-specific
 * decorators.
 *
 * @param classMembers a list of ClassElement AST nodes
 * @param diagnostics a collection of compiler diagnostics, to which an error
 * may be added
 * @returns a new list of the same ClassElement nodes, with any nodes which have
 * Stencil-specific decorators modified to remove them
 */
const removeStencilMethodDecorators = (classMembers, diagnostics) => {
  return classMembers.map((member) => {
    var _a;
    const currentDecorators = retrieveTsDecorators(member);
    const newDecorators = filterDecorators(currentDecorators, MEMBER_DECORATORS_TO_REMOVE);
    if (currentDecorators !== newDecorators) {
      if (t.isMethodDeclaration(member)) {
        return t.factory.updateMethodDeclaration(member, [...(newDecorators !== null && newDecorators !== void 0 ? newDecorators : []), ...((_a = retrieveTsModifiers(member)) !== null && _a !== void 0 ? _a : [])], member.asteriskToken, member.name, member.questionToken, member.typeParameters, member.parameters, member.type, member.body);
      }
      else if (t.isPropertyDeclaration(member)) {
        if (shouldInitializeInConstructor(member)) {
          // if the current class member is decorated with either 'State' or
          // 'Prop' we need to modify the property declaration to transform it
          // from a class field but we handle this in the `handleClassFields`
          // method below, so we just want to return the class member here
          // untouched.
          return member;
        }
        else {
          // update the property to remove decorators
          const modifiers = retrieveTsModifiers(member);
          return t.factory.updatePropertyDeclaration(member, [...(newDecorators !== null && newDecorators !== void 0 ? newDecorators : []), ...(modifiers !== null && modifiers !== void 0 ? modifiers : [])], member.name, member.questionToken, member.type, member.initializer);
        }
      }
      else {
        const err = buildError(diagnostics);
        err.messageText = 'Unknown class member encountered!';
        augmentDiagnosticWithNode(err, member);
      }
    }
    return member;
  });
};
/**
 * Generate a list of decorators from a syntax tree node that are not in a provided exclude list
 *
 * @param decorators the syntax tree node's decorators should be inspected
 * @param excludeList the names of decorators that should _not_ be included in the returned list
 * @returns a list of decorators on the AST node that are not in the provided list, or `undefined` if:
 * - there are no decorators on the node
 * - the node contains only decorators in the provided list
 */
const filterDecorators = (decorators, excludeList) => {
  if (decorators) {
    const updatedDecoratorList = decorators.filter((dec) => {
      // narrow the type of the syntax tree node, while retrieving the text of the identifier
      const decoratorName = t.isCallExpression(dec.expression) &&
        t.isIdentifier(dec.expression.expression) &&
        dec.expression.expression.text;
      // if the type narrowing logic short-circuited (i.e. returned 'false'), always return those decorators
      // otherwise, check if it is included in the provided exclude list
      return typeof decoratorName === 'boolean' || !excludeList.includes(decoratorName);
    });
    if (updatedDecoratorList.length === 0) {
      // handle the case of a zero-length list first, so an empty array is not created
      return undefined;
    }
    else if (updatedDecoratorList.length !== decorators.length) {
      // the updated decorator list is non-zero, but has a different length than the original decorator list,
      // create a new array of nodes from it
      return t.factory.createNodeArray(updatedDecoratorList);
    }
  }
  // return the node's original decorators, or undefined
  return decorators;
};
/**
 * This updates a Stencil component class declaration AST node to handle any
 * class fields with Stencil-specific decorators (`@State`, `@Prop`, etc). For
 * reasons explained below, we need to remove these fields from the class and
 * add code to the class's constructor to instantiate them manually.
 *
 * When a class field is decorated with a Stencil-defined decorator, we rely on
 * defining our own setters and getters (using `Object.defineProperty`) to
 * implement the behavior we want. Unfortunately, in ES2022 and newer versions
 * of the EcmaScript standard the behavior for class fields like the following
 * is incompatible with using manually-defined getters and setters:
 *
 * ```ts
 * class MyClass {
 *   foo = "bar"
 * }
 * ```
 *
 * In ES2022+ if we try to use `Object.defineProperty` on this class's
 * prototype in order to define a `set` and `get` function for the
 * property `foo` it will not override the default behavior of the
 * instance field `foo`, so doing something like the following:
 *
 * ```ts
 * Object.defineProperty(MyClass.prototype, "foo", {
 *   get() {
 *   return "Foo is: " + this.foo
 *   }
 * });
 * ```
 *
 * and then calling `myClassInstance.foo` will _not_ return `"Foo is: bar"` but
 * just `"bar"`. This is because the standard ECMAScript behavior is now to use
 * the internals of `Object.defineProperty` on a class instance to instantiate
 * fields, and that call at instantiation-time overrides what's set on the
 * prototype. For details, see the accepted ECMAScript proposal for this
 * behavior:
 *
 * https://github.com/tc39/proposal-class-fields#public-fields-created-with-objectdefineproperty
 *
 * Why is this important? With `target` set to an ECMAScript version prior to
 * ES2022 TypeScript by default would emit a class which instantiated the field
 * in its constructor, something like this:
 *
 * ```ts
 * class CompiledMyClass {
 *   constructor() {
 *   this.foo = "bar"
 *   }
 * }
 * ```
 *
 * This plays nicely with later using `Object.defineProperty` on the prototype
 * to define getters and setters, or simply with defining them right on the
 * class (see the code in `proxyComponent`, `proxyCustomElement`, and friends).
 *
 * However, with a `target` of ES2022 or higher (e.g. `ESNext`) default
 * behavior for TypeScript is instead to emit code like this:
 *
 * ```ts
 * class CompiledMyClass {
 *   foo = "bar"
 * }
 * ```
 *
 * This output is more correct because the compiled code 1) more closely
 * resembles the TypeScript source and 2) is using standard JS syntax instead
 * of desugaring it. There is an announcement in the release notes for
 * TypeScript v3.7 which explains some helpful background about the change,
 * and about the `useDefineForClassFields` TypeScript option which lets you
 * opt-in to the old output:
 *
 * https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier
 *
 * For our use-case, however, the ES2022+ behavior doesn't work, since we need
 * to be able to define getters and setters on these fields. We could require
 * that the TypeScript configuration used for Stencil have the
 * `useDefineForClassFields` setting set to `false`, but that would have the
 * undesirable side-effect that class fields which are _not_
 * decorated with a Stencil decorator would also be instantiated in the
 * constructor.
 *
 * So instead, we take matters into our own hands. When we encounter a class
 * field which is decorated with a Stencil decorator we remove it from the
 * class and add a statement to the constructor to instantiate it with the
 * correct default value.
 *
 * **Note**: this function will modify a constructor if one is already present on
 * the class or define a new one otherwise.
 *
 * @param classNode a TypeScript AST node for a Stencil component class
 * @param classMembers the class members that we need to update
 * @returns a list of updated class elements which can be inserted into the class
 */
function handleClassFields(classNode, classMembers) {
  var _a;
  const statements = [];
  const updatedClassMembers = [];
  for (const member of classMembers) {
    if (shouldInitializeInConstructor(member) && t.isPropertyDeclaration(member)) {
      const declarationName = t.getNameOfDeclaration(member);
      // The name of a class field declaration can be a computed property name,
      // like so:
      //
      // ```ts
      // const argName = "arghhh"
      //
      // class MyClass {
      //   [argName] = "best property around";
      // }
      // ```
      //
      // In this case we need to get the expression which evaluates to some
      // valid property name and call `.getText` on it. In the case that it's
      // _not_ a computed property name, like
      //
      // ```ts
      // class MyClass {
      //   argName = "best property around";
      // }
      // ```
      //
      // we can just call `.getText` on the name itself.
      const memberName = declarationName.kind === t.SyntaxKind.ComputedPropertyName
        ? declarationName.expression.getText()
        : declarationName.getText();
      // this is a class field that we'll need to handle, so lets push a statement for
      // initializing the value onto our statements list
      statements.push(t.factory.createExpressionStatement(t.factory.createBinaryExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier(memberName)), t.factory.createToken(t.SyntaxKind.EqualsToken),
      // if the member has no initializer we should default to setting it to
      // just 'undefined'
      (_a = member.initializer) !== null && _a !== void 0 ? _a : t.factory.createIdentifier('undefined'))));
    }
    else {
      // if it's not a class field that is decorated with a Stencil decorator then
      // we just push it onto our class member list
      updatedClassMembers.push(member);
    }
  }
  if (statements.length === 0) {
    // we didn't encounter any class fields we need to update, so we can
    // just return the list of class members (no need to create an empty
    // constructor)
    return updatedClassMembers;
  }
  else {
    // create or update a constructor which contains the initializing statements
    // we created above
    return updateConstructor(classNode, updatedClassMembers, statements);
  }
}
/**
 * Helper util for updating the constructor on a class declaration AST node.
 *
 * @param classNode the class node whose constructor will be updated
 * @param classMembers a list of class members for that class
 * @param statements a list of statements which should be added to the
 * constructor
 * @returns a list of updated class elements
 */
const updateConstructor = (classNode, classMembers, statements) => {
  var _a, _b, _c;
  const constructorIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
  const constructorMethod = classMembers[constructorIndex];
  if (constructorIndex >= 0 && t.isConstructorDeclaration(constructorMethod)) {
    const constructorBodyStatements = (_b = (_a = constructorMethod.body) === null || _a === void 0 ? void 0 : _a.statements) !== null && _b !== void 0 ? _b : t.factory.createNodeArray();
    const hasSuper = constructorBodyStatements.some((s) => s.kind === t.SyntaxKind.SuperKeyword);
    if (!hasSuper && needsSuper(classNode)) {
      // if there is no super and it needs one the statements comprising the
      // body of the constructor should be:
      //
      // 1. the `super()` call
      // 2. the new statements we've created to initialize fields
      // 3. the statements currently comprising the body of the constructor
      statements = [createConstructorBodyWithSuper(), ...statements, ...constructorBodyStatements];
    }
    else {
      // if no super is needed then the body of the constructor should be:
      //
      // 1. the new statements we've created to initialize fields
      // 2. the statements currently comprising the body of the constructor
      statements = [...statements, ...constructorBodyStatements];
    }
    classMembers[constructorIndex] = t.factory.updateConstructorDeclaration(constructorMethod, retrieveTsModifiers(constructorMethod), constructorMethod.parameters, t.factory.updateBlock((_c = constructorMethod === null || constructorMethod === void 0 ? void 0 : constructorMethod.body) !== null && _c !== void 0 ? _c : t.factory.createBlock([]), statements));
  }
  else {
    // we don't seem to have a constructor, so let's create one and stick it
    // into the array of class elements
    if (needsSuper(classNode)) {
      statements = [createConstructorBodyWithSuper(), ...statements];
    }
    classMembers = [
      t.factory.createConstructorDeclaration(undefined, [], t.factory.createBlock(statements, true)),
      ...classMembers,
    ];
  }
  return classMembers;
};
/**
 * Check that a given class declaration should have a `super()` call in its
 * constructor. This is something we can check by looking for a
 * {@link ts.HeritageClause} on the class's AST node.
 *
 * @param classDeclaration a class declaration AST node
 * @returns whether this class has parents or not
 */
const needsSuper = (classDeclaration) => {
  const hasHeritageClauses = classDeclaration.heritageClauses && classDeclaration.heritageClauses.length > 0;
  if (hasHeritageClauses) {
    // A {@link ts.SyntaxKind.HeritageClause} node may be for extending a
    // superclass _or_ for implementing an interface. We only want to add a
    // `super()` call to our synthetic constructor here in the case that there
    // is a superclass, so we can check for that situation by checking for the
    // presence of a heritage clause with the `.token` property set to
    // `ts.SyntaxKind.ExtendsKeyword`.
    return classDeclaration.heritageClauses.some((clause) => clause.token === t.SyntaxKind.ExtendsKeyword);
  }
  return false;
};
/**
 * Create a statement with a call to `super()` suitable for including in the body of a constructor.
 * @returns a {@link ts.ExpressionStatement} node equivalent to `super()`
 */
const createConstructorBodyWithSuper = () => {
  return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier('super'), undefined, undefined));
};
/**
 * Check whether a given class element should be rewritten from a class field
 * to a constructor-initialized value. This is basically the case for fields
 * decorated with `@Prop` and `@State`. See {@link handleClassFields} for more
 * details.
 *
 * @param member the member to check
 * @returns whether this should be rewritten or not
 */
const shouldInitializeInConstructor = (member) => {
  const currentDecorators = retrieveTsDecorators(member);
  if (currentDecorators === undefined) {
    // decorators have already been removed from this element, indicating that
    // we don't need to do anything
    return false;
  }
  const filteredDecorators = filterDecorators(currentDecorators, CONSTRUCTOR_DEFINED_MEMBER_DECORATORS);
  return currentDecorators !== filteredDecorators;
};

const gatherVdomMeta = (m, args) => {
  m.hasVdomRender = true;
  // Parse vdom tag
  const hTag = args[0];
  if (!t.isStringLiteral(hTag) && (!t.isIdentifier(hTag) || hTag.text !== 'Host')) {
    m.hasVdomFunctional = true;
  }
  // Parse attributes
  if (args.length > 1) {
    const objectLiteral = args[1];
    if (t.isCallExpression(objectLiteral) || t.isIdentifier(objectLiteral)) {
      m.hasVdomAttribute = true;
      m.hasVdomClass = true;
      m.hasVdomKey = true;
      m.hasVdomListener = true;
      m.hasVdomPropOrAttr = true;
      m.hasVdomRef = true;
      m.hasVdomStyle = true;
      m.hasVdomXlink = true;
    }
    else if (t.isObjectLiteralExpression(objectLiteral)) {
      objectLiteral.properties.forEach((prop) => {
        m.hasVdomAttribute = true;
        if (t.isSpreadAssignment(prop) || t.isComputedPropertyName(prop.name)) {
          m.hasVdomClass = true;
          m.hasVdomKey = true;
          m.hasVdomListener = true;
          m.hasVdomPropOrAttr = true;
          m.hasVdomRef = true;
          m.hasVdomStyle = true;
          m.hasVdomXlink = true;
        }
        else if (prop.name && prop.name.text && prop.name.text.length > 0) {
          const attrName = prop.name.text;
          if (attrName === 'key') {
            m.hasVdomKey = true;
          }
          else if (attrName === 'ref') {
            m.hasVdomRef = true;
          }
          else if (attrName === 'class' || attrName === 'className') {
            m.hasVdomClass = true;
          }
          else if (attrName === 'style') {
            m.hasVdomStyle = true;
          }
          else if (/^on(-|[A-Z])/.test(attrName)) {
            m.hasVdomListener = true;
          }
          else if (attrName.startsWith('xlink')) {
            m.hasVdomXlink = true;
            m.hasVdomPropOrAttr = true;
          }
          else {
            m.hasVdomPropOrAttr = true;
          }
          if (attrName === 'part' && t.isPropertyAssignment(prop) && t.isStringLiteral(prop.initializer)) {
            m.htmlParts.push(...prop.initializer.text
              .toLowerCase()
              .split(' ')
              .filter((part) => part.length > 0));
          }
          m.htmlAttrNames.push(attrName);
        }
      });
    }
  }
  // Parse children
  if (!m.hasVdomText) {
    for (let i = 2; i < args.length; i++) {
      const arg = args[i];
      if (!t.isCallExpression(arg) || !t.isIdentifier(arg.expression) || arg.expression.text !== 'h') {
        m.hasVdomText = true;
        break;
      }
    }
  }
};

const parseCallExpression = (m, node) => {
  if (node.arguments != null && node.arguments.length > 0) {
    if (t.isIdentifier(node.expression)) {
      // h('tag')
      visitCallExpressionArgs(m, node.expression, node.arguments);
    }
    else if (t.isPropertyAccessExpression(node.expression)) {
      // document.createElement('tag')
      const n = node.expression.name;
      if (t.isIdentifier(n) && n) {
        visitCallExpressionArgs(m, n, node.arguments);
      }
    }
  }
};
const visitCallExpressionArgs = (m, callExpressionName, args) => {
  const fnName = callExpressionName.escapedText;
  if (fnName === 'h' || fnName === H || fnName === 'createElement') {
    visitCallExpressionArg(m, args[0]);
    if (fnName === 'h' || fnName === H) {
      gatherVdomMeta(m, args);
    }
  }
  else if (args.length > 1 && fnName === 'createElementNS') {
    visitCallExpressionArg(m, args[1]);
  }
  else if (fnName === 'require' && args.length > 0 && m.originalImports) {
    const arg = args[0];
    if (t.isStringLiteral(arg)) {
      if (!m.originalImports.includes(arg.text)) {
        m.originalImports.push(arg.text);
      }
    }
  }
};
const visitCallExpressionArg = (m, arg) => {
  if (t.isStringLiteral(arg)) {
    let tag = arg.text;
    if (typeof tag === 'string') {
      tag = tag.toLowerCase();
      m.htmlTagNames.push(tag);
      if (tag.includes('-')) {
        m.potentialCmpRefs.push(tag);
      }
    }
  }
};

/**
 * Update an instance of TypeScript's Intermediate Representation (IR) for a
 * class declaration ({@link ts.ClassDeclaration}) with a static getter for the
 * compiler metadata that we produce as part of the compilation process.
 *
 * @param cmpNode an instance of the TypeScript IR for a class declaration (i.e.
 * a stencil component) to be updated
 * @param cmpMeta the component metadata corresponding to that component
 * @returns the updated typescript class declaration
 */
const addComponentMetaStatic = (cmpNode, cmpMeta) => {
  const publicCompilerMeta = getPublicCompilerMeta(cmpMeta);
  const cmpMetaStaticProp = createStaticGetter('COMPILER_META', convertValueToLiteral(publicCompilerMeta));
  const classMembers = [...cmpNode.members, cmpMetaStaticProp];
  return t.factory.updateClassDeclaration(cmpNode, retrieveModifierLike(cmpNode), cmpNode.name, cmpNode.typeParameters, cmpNode.heritageClauses, classMembers);
};
const getPublicCompilerMeta = (cmpMeta) => {
  const publicCompilerMeta = Object.assign({}, cmpMeta);
  // no need to copy all compiler meta data
  delete publicCompilerMeta.assetsDirs;
  delete publicCompilerMeta.dependencies;
  delete publicCompilerMeta.excludeFromCollection;
  delete publicCompilerMeta.isCollectionDependency;
  delete publicCompilerMeta.docs;
  delete publicCompilerMeta.jsFilePath;
  delete publicCompilerMeta.potentialCmpRefs;
  delete publicCompilerMeta.styleDocs;
  delete publicCompilerMeta.sourceFilePath;
  return publicCompilerMeta;
};

const setComponentBuildConditionals = (cmpMeta) => {
  if (cmpMeta.properties.length > 0) {
    cmpMeta.hasProp = true;
    cmpMeta.hasPropMutable = cmpMeta.properties.some((p) => p.mutable);
    cmpMeta.hasReflect = cmpMeta.properties.some((p) => p.reflect);
    cmpMeta.hasAttribute = cmpMeta.properties.some((p) => typeof p.attribute === 'string');
    cmpMeta.hasPropBoolean = cmpMeta.properties.some((p) => p.type === 'boolean');
    cmpMeta.hasPropNumber = cmpMeta.properties.some((p) => p.type === 'number');
    cmpMeta.hasPropString = cmpMeta.properties.some((p) => p.type === 'string');
  }
  if (cmpMeta.states.length > 0) {
    cmpMeta.hasState = true;
  }
  if (cmpMeta.watchers.length > 0) {
    cmpMeta.hasWatchCallback = true;
  }
  if (cmpMeta.methods.length > 0) {
    cmpMeta.hasMethod = true;
  }
  if (cmpMeta.events.length > 0) {
    cmpMeta.hasEvent = true;
  }
  if (cmpMeta.listeners.length > 0) {
    cmpMeta.hasListener = true;
    cmpMeta.hasListenerTargetWindow = cmpMeta.listeners.some((l) => l.target === 'window');
    cmpMeta.hasListenerTargetDocument = cmpMeta.listeners.some((l) => l.target === 'document');
    cmpMeta.hasListenerTargetBody = cmpMeta.listeners.some((l) => l.target === 'body');
    cmpMeta.hasListenerTargetParent = cmpMeta.listeners.some((l) => l.target === 'parent');
    cmpMeta.hasListenerTarget = cmpMeta.listeners.some((l) => !!l.target);
  }
  cmpMeta.hasMember = cmpMeta.hasProp || cmpMeta.hasState || cmpMeta.hasElement || cmpMeta.hasMethod;
  cmpMeta.isUpdateable = cmpMeta.hasProp || cmpMeta.hasState;
  if (cmpMeta.styles.length > 0) {
    cmpMeta.hasStyle = true;
    cmpMeta.hasMode = cmpMeta.styles.some((s) => s.modeName !== DEFAULT_STYLE_MODE);
  }
  cmpMeta.hasLifecycle =
    cmpMeta.hasComponentWillLoadFn ||
      cmpMeta.hasComponentDidLoadFn ||
      cmpMeta.hasComponentShouldUpdateFn ||
      cmpMeta.hasComponentWillUpdateFn ||
      cmpMeta.hasComponentDidUpdateFn ||
      cmpMeta.hasComponentWillRenderFn ||
      cmpMeta.hasComponentDidRenderFn;
  cmpMeta.isPlain =
    !cmpMeta.hasMember && !cmpMeta.hasStyle && !cmpMeta.hasLifecycle && !cmpMeta.hasListener && !cmpMeta.hasVdomRender;
};

const parseClassMethods = (cmpNode, cmpMeta) => {
  const classMembers = cmpNode.members;
  if (!classMembers || classMembers.length === 0) {
    return;
  }
  const classMethods = classMembers.filter((m) => t.isMethodDeclaration(m));
  if (classMethods.length === 0) {
    return;
  }
  const hasHostData = classMethods.some((m) => isMethod(m, 'hostData'));
  cmpMeta.hasAttributeChangedCallbackFn = classMethods.some((m) => isMethod(m, 'attributeChangedCallback'));
  cmpMeta.hasConnectedCallbackFn = classMethods.some((m) => isMethod(m, 'connectedCallback'));
  cmpMeta.hasDisconnectedCallbackFn = classMethods.some((m) => isMethod(m, 'disconnectedCallback'));
  cmpMeta.hasComponentWillLoadFn = classMethods.some((m) => isMethod(m, 'componentWillLoad'));
  cmpMeta.hasComponentWillUpdateFn = classMethods.some((m) => isMethod(m, 'componentWillUpdate'));
  cmpMeta.hasComponentWillRenderFn = classMethods.some((m) => isMethod(m, 'componentWillRender'));
  cmpMeta.hasComponentDidRenderFn = classMethods.some((m) => isMethod(m, 'componentDidRender'));
  cmpMeta.hasComponentDidLoadFn = classMethods.some((m) => isMethod(m, 'componentDidLoad'));
  cmpMeta.hasComponentShouldUpdateFn = classMethods.some((m) => isMethod(m, 'componentShouldUpdate'));
  cmpMeta.hasComponentDidUpdateFn = classMethods.some((m) => isMethod(m, 'componentDidUpdate'));
  cmpMeta.hasComponentDidUnloadFn = classMethods.some((m) => isMethod(m, 'componentDidUnload'));
  cmpMeta.hasLifecycle =
    cmpMeta.hasComponentWillLoadFn ||
      cmpMeta.hasComponentDidLoadFn ||
      cmpMeta.hasComponentWillUpdateFn ||
      cmpMeta.hasComponentDidUpdateFn;
  cmpMeta.hasRenderFn = classMethods.some((m) => isMethod(m, 'render')) || hasHostData;
  cmpMeta.hasVdomRender = cmpMeta.hasVdomRender || hasHostData;
};

const parseStaticElementRef = (staticMembers) => {
  const parsedElementRef = getStaticValue(staticMembers, 'elementRef');
  if (typeof parsedElementRef === 'string') {
    return parsedElementRef;
  }
  return null;
};

const parseStaticEncapsulation = (staticMembers) => {
  let encapsulation = getStaticValue(staticMembers, 'encapsulation');
  if (typeof encapsulation === 'string') {
    encapsulation = encapsulation.toLowerCase().trim();
    if (encapsulation === 'shadow' || encapsulation === 'scoped') {
      return encapsulation;
    }
  }
  return 'none';
};
const parseStaticShadowDelegatesFocus = (encapsulation, staticMembers) => {
  if (encapsulation === 'shadow') {
    const delegatesFocus = getStaticValue(staticMembers, 'delegatesFocus');
    return !!delegatesFocus;
  }
  return null;
};

const parseStaticEvents = (staticMembers) => {
  const parsedEvents = getStaticValue(staticMembers, 'events');
  if (!parsedEvents || parsedEvents.length === 0) {
    return [];
  }
  return parsedEvents.map((parsedEvent) => {
    return {
      name: parsedEvent.name,
      method: parsedEvent.method,
      bubbles: parsedEvent.bubbles,
      cancelable: parsedEvent.cancelable,
      composed: parsedEvent.composed,
      docs: parsedEvent.docs,
      complexType: parsedEvent.complexType,
      internal: isInternal(parsedEvent.docs),
    };
  });
};

const parseStaticListeners = (staticMembers) => {
  const parsedListeners = getStaticValue(staticMembers, 'listeners');
  if (!parsedListeners || parsedListeners.length === 0) {
    return [];
  }
  return parsedListeners.map((parsedListener) => {
    return {
      name: parsedListener.name,
      method: parsedListener.method,
      capture: !!parsedListener.capture,
      passive: !!parsedListener.passive,
      target: parsedListener.target,
    };
  });
};

const parseStaticMethods = (staticMembers) => {
  const parsedMethods = getStaticValue(staticMembers, 'methods');
  if (!parsedMethods) {
    return [];
  }
  const methodNames = Object.keys(parsedMethods);
  if (methodNames.length === 0) {
    return [];
  }
  return methodNames.map((methodName) => {
    return {
      name: methodName,
      docs: parsedMethods[methodName].docs,
      complexType: parsedMethods[methodName].complexType,
      internal: isInternal(parsedMethods[methodName].docs),
    };
  });
};

/**
 * Parse a list of {@link ts.ClassElement} objects representing static props
 * into a list of our own Intermediate Representation (IR) of properties on
 * components.
 *
 * @param staticMembers TypeScript IR for the properties on our component
 * @returns a manifest of compiler properties in our own Stencil IR
 */
const parseStaticProps = (staticMembers) => {
  const parsedProps = getStaticValue(staticMembers, 'properties');
  if (!parsedProps) {
    return [];
  }
  const propNames = Object.keys(parsedProps);
  if (propNames.length === 0) {
    return [];
  }
  return propNames.map((propName) => {
    const val = parsedProps[propName];
    return {
      name: propName,
      type: val.type,
      attribute: val.attribute ? val.attribute.toLowerCase() : undefined,
      reflect: typeof val.reflect === 'boolean' ? val.reflect : false,
      mutable: !!val.mutable,
      required: !!val.required,
      optional: !!val.optional,
      defaultValue: val.defaultValue,
      complexType: val.complexType,
      docs: val.docs,
      internal: isInternal(val.docs),
    };
  });
};

const parseStaticStates = (staticMembers) => {
  const parsedStates = getStaticValue(staticMembers, 'states');
  if (!parsedStates) {
    return [];
  }
  const stateNames = Object.keys(parsedStates);
  if (stateNames.length === 0) {
    return [];
  }
  return stateNames.map((stateName) => {
    return {
      name: stateName,
    };
  });
};

const parseStringLiteral = (m, node) => {
  if (typeof node.text === 'string' && node.text.includes('</')) {
    if (node.text.includes('<slot')) {
      m.htmlTagNames.push('slot');
    }
    if (node.text.includes('<svg')) {
      m.htmlTagNames.push('svg');
    }
  }
};

const normalizeStyles = (tagName, componentFilePath, styles) => {
  styles.forEach((style) => {
    if (style.modeName === DEFAULT_STYLE_MODE) {
      style.styleId = tagName.toUpperCase();
    }
    else {
      style.styleId = `${tagName.toUpperCase()}#${style.modeName}`;
    }
    if (Array.isArray(style.externalStyles)) {
      style.externalStyles.forEach((externalStyle) => {
        normalizeExternalStyle(componentFilePath, externalStyle);
      });
    }
  });
};
const normalizeExternalStyle = (componentFilePath, externalStyle) => {
  if (typeof externalStyle.originalComponentPath !== 'string' ||
    externalStyle.originalComponentPath.trim().length === 0) {
    return;
  }
  // get the absolute path of the directory which the component is sitting in
  const componentDir = dirname(componentFilePath);
  if (isAbsolute$1(externalStyle.originalComponentPath)) {
    // this path is absolute already!
    // add to our list of style absolute paths
    externalStyle.absolutePath = normalizePath$2(externalStyle.originalComponentPath);
    // if this is an absolute path already, let's convert it to be relative
    externalStyle.relativePath = normalizePath$2(relative$1(componentDir, externalStyle.originalComponentPath));
  }
  else {
    // this path is relative to the component
    // add to our list of style relative paths
    externalStyle.relativePath = normalizePath$2(externalStyle.originalComponentPath);
    // create the absolute path to the style file
    externalStyle.absolutePath = normalizePath$2(join(componentDir, externalStyle.originalComponentPath));
  }
};

const parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDependency, staticMembers) => {
  const styles = [];
  const styleUrlsProp = isCollectionDependency ? 'styleUrls' : 'originalStyleUrls';
  const parsedStyleUrls = getStaticValue(staticMembers, styleUrlsProp);
  let parsedStyle = getStaticValue(staticMembers, 'styles');
  if (parsedStyle) {
    if (typeof parsedStyle === 'string') {
      // styles: 'div { padding: 10px }'
      parsedStyle = parsedStyle.trim();
      if (parsedStyle.length > 0) {
        styles.push({
          modeName: DEFAULT_STYLE_MODE,
          styleId: null,
          styleStr: parsedStyle,
          styleIdentifier: null,
          externalStyles: [],
        });
        compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
      }
    }
    else if (parsedStyle.__identifier) {
      styles.push(parseStyleIdentifier(parsedStyle, DEFAULT_STYLE_MODE));
      compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
    }
    else if (typeof parsedStyle === 'object') {
      Object.keys(parsedStyle).forEach((modeName) => {
        const parsedStyleMode = parsedStyle[modeName];
        if (typeof parsedStyleMode === 'string') {
          styles.push({
            modeName: modeName,
            styleId: null,
            styleStr: parsedStyleMode,
            styleIdentifier: null,
            externalStyles: [],
          });
        }
        else {
          styles.push(parseStyleIdentifier(parsedStyleMode, modeName));
        }
        compilerCtx.styleModeNames.add(modeName);
      });
    }
  }
  if (parsedStyleUrls && typeof parsedStyleUrls === 'object') {
    Object.keys(parsedStyleUrls).forEach((modeName) => {
      const externalStyles = [];
      const styleObj = parsedStyleUrls[modeName];
      styleObj.forEach((styleUrl) => {
        if (typeof styleUrl === 'string' && styleUrl.trim().length > 0) {
          externalStyles.push({
            absolutePath: null,
            relativePath: null,
            originalComponentPath: styleUrl.trim(),
          });
        }
      });
      if (externalStyles.length > 0) {
        const style = {
          modeName: modeName,
          styleId: null,
          styleStr: null,
          styleIdentifier: null,
          externalStyles: externalStyles,
        };
        styles.push(style);
        compilerCtx.styleModeNames.add(modeName);
      }
    });
  }
  normalizeStyles(tagName, componentFilePath, styles);
  return sortBy(styles, (s) => s.modeName);
};
const parseStyleIdentifier = (parsedStyle, modeName) => {
  const style = {
    modeName: modeName,
    styleId: null,
    styleStr: null,
    styleIdentifier: parsedStyle.__escapedText,
    externalStyles: [],
  };
  return style;
};

const parseStaticWatchers = (staticMembers) => {
  const parsedWatchers = getStaticValue(staticMembers, 'watchers');
  if (!parsedWatchers || parsedWatchers.length === 0) {
    return [];
  }
  return parsedWatchers.map((parsedWatch) => {
    return {
      propName: parsedWatch.propName,
      methodName: parsedWatch.methodName,
    };
  });
};

/**
 * Given an instance of TypeScript's Intermediate Representation (IR) for a
 * class declaration ({@see ts.ClassDeclaration}) which represents a Stencil
 * component class declaration, parse and format various pieces of data about
 * static class members which we use in the compilation process
 *
 * @param compilerCtx the current compiler context
 * @param typeChecker a TypeScript type checker instance
 * @param cmpNode the TypeScript class declaration for the component
 * @param moduleFile Stencil's IR for a module, used here as an out param
 * @param transformOpts options which control various aspects of the
 * transformation
 * @returns the TypeScript class declaration IR instance with which the
 * function was called
 */
const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, transformOpts) => {
  if (cmpNode.members == null) {
    return cmpNode;
  }
  const staticMembers = cmpNode.members.filter(isStaticGetter);
  const tagName = getComponentTagName(staticMembers);
  if (tagName == null) {
    return cmpNode;
  }
  const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : undefined;
  const docs = serializeSymbol(typeChecker, symbol);
  const isCollectionDependency = moduleFile.isCollectionDependency;
  const encapsulation = parseStaticEncapsulation(staticMembers);
  const cmp = {
    tagName: tagName,
    excludeFromCollection: moduleFile.excludeFromCollection,
    isCollectionDependency,
    componentClassName: cmpNode.name ? cmpNode.name.text : '',
    elementRef: parseStaticElementRef(staticMembers),
    encapsulation,
    shadowDelegatesFocus: parseStaticShadowDelegatesFocus(encapsulation, staticMembers),
    properties: parseStaticProps(staticMembers),
    virtualProperties: parseVirtualProps(docs),
    states: parseStaticStates(staticMembers),
    methods: parseStaticMethods(staticMembers),
    listeners: parseStaticListeners(staticMembers),
    events: parseStaticEvents(staticMembers),
    watchers: parseStaticWatchers(staticMembers),
    styles: parseStaticStyles(compilerCtx, tagName, moduleFile.sourceFilePath, isCollectionDependency, staticMembers),
    legacyConnect: getStaticValue(staticMembers, 'connectProps') || [],
    legacyContext: getStaticValue(staticMembers, 'contextProps') || [],
    internal: isInternal(docs),
    assetsDirs: parseAssetsDirs(staticMembers, moduleFile.jsFilePath),
    styleDocs: [],
    docs,
    jsFilePath: moduleFile.jsFilePath,
    sourceFilePath: moduleFile.sourceFilePath,
    sourceMapPath: moduleFile.sourceMapPath,
    hasAttributeChangedCallbackFn: false,
    hasComponentWillLoadFn: false,
    hasComponentDidLoadFn: false,
    hasComponentShouldUpdateFn: false,
    hasComponentWillUpdateFn: false,
    hasComponentDidUpdateFn: false,
    hasComponentWillRenderFn: false,
    hasComponentDidRenderFn: false,
    hasComponentDidUnloadFn: false,
    hasConnectedCallbackFn: false,
    hasDisconnectedCallbackFn: false,
    hasElement: false,
    hasEvent: false,
    hasLifecycle: false,
    hasListener: false,
    hasListenerTarget: false,
    hasListenerTargetWindow: false,
    hasListenerTargetDocument: false,
    hasListenerTargetBody: false,
    hasListenerTargetParent: false,
    hasMember: false,
    hasMethod: false,
    hasMode: false,
    hasAttribute: false,
    hasProp: false,
    hasPropNumber: false,
    hasPropBoolean: false,
    hasPropString: false,
    hasPropMutable: false,
    hasReflect: false,
    hasRenderFn: false,
    hasState: false,
    hasStyle: false,
    hasVdomAttribute: false,
    hasVdomXlink: false,
    hasVdomClass: false,
    hasVdomFunctional: false,
    hasVdomKey: false,
    hasVdomListener: false,
    hasVdomPropOrAttr: false,
    hasVdomRef: false,
    hasVdomRender: false,
    hasVdomStyle: false,
    hasVdomText: false,
    hasWatchCallback: false,
    isPlain: false,
    htmlAttrNames: [],
    htmlTagNames: [],
    htmlParts: [],
    isUpdateable: false,
    potentialCmpRefs: [],
  };
  const visitComponentChildNode = (node) => {
    if (t.isCallExpression(node)) {
      parseCallExpression(cmp, node);
    }
    else if (t.isStringLiteral(node)) {
      parseStringLiteral(cmp, node);
    }
    node.forEachChild(visitComponentChildNode);
  };
  visitComponentChildNode(cmpNode);
  parseClassMethods(cmpNode, cmp);
  cmp.legacyConnect.forEach(({ connect }) => {
    cmp.htmlTagNames.push(connect);
    if (connect.includes('-')) {
      cmp.potentialCmpRefs.push(connect);
    }
  });
  cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
  cmp.htmlTagNames = unique(cmp.htmlTagNames);
  cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
  setComponentBuildConditionals(cmp);
  if (transformOpts && transformOpts.componentMetadata === 'compilerstatic') {
    cmpNode = addComponentMetaStatic(cmpNode, cmp);
  }
  // add to module map
  moduleFile.cmps.push(cmp);
  // add to node map
  compilerCtx.nodeMap.set(cmpNode, cmp);
  return cmpNode;
};
const parseVirtualProps = (docs) => {
  return docs.tags
    .filter(({ name }) => name === 'virtualProp')
    .map(parseVirtualProp)
    .filter((prop) => !!prop);
};
const parseVirtualProp = (tag) => {
  const results = /^\s*(?:\{([^}]+)\}\s+)?(\w+)\s+-\s+(.*)$/.exec(tag.text);
  if (!results) {
    return undefined;
  }
  const [, type, name, docs] = results;
  return {
    type: type == null ? 'any' : type.trim(),
    name: name.trim(),
    docs: docs.trim(),
  };
};
const parseAssetsDirs = (staticMembers, componentFilePath) => {
  const dirs = getStaticValue(staticMembers, 'assetsDirs') || [];
  const componentDir = normalizePath$2(dirname(componentFilePath));
  return dirs.map((dir) => {
    // get the relative path from the component file to the assets directory
    dir = normalizePath$2(dir.trim());
    let absolutePath = dir;
    let cmpRelativePath = dir;
    if (isAbsolute$1(dir)) {
      // if this is an absolute path already, let's convert it to be relative
      cmpRelativePath = relative$1(componentDir, dir);
    }
    else {
      // create the absolute path to the asset dir
      absolutePath = join(componentDir, dir);
    }
    return {
      absolutePath,
      cmpRelativePath,
      originalComponentPath: dir,
    };
  });
};

const parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
  if (collectionManifest.entries) {
    collectionManifest.entries.forEach((entryPath) => {
      const componentPath = join(collectionDir, entryPath);
      transpileCollectionModule(config, compilerCtx, buildCtx, collection, componentPath);
    });
  }
};
const transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
  const sourceText = compilerCtx.fs.readFileSync(inputFileName);
  const sourceFile = t.createSourceFile(inputFileName, sourceText, t.ScriptTarget.ES2017, true, t.ScriptKind.JS);
  return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, undefined, collection);
};

const parseCollectionManifest = (config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr) => {
  const collectionManifest = JSON.parse(collectionJsonStr);
  const compilerVersion = collectionManifest.compiler || {};
  const collection = {
    collectionName: collectionName,
    moduleId: collectionName,
    moduleFiles: [],
    dependencies: parseCollectionDependencies(collectionManifest),
    compiler: {
      name: compilerVersion.name || '',
      version: compilerVersion.version || '',
      typescriptVersion: compilerVersion.typescriptVersion || '',
    },
    bundles: parseBundles(collectionManifest),
  };
  parseGlobal(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
  parseCollectionComponents(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
  return collection;
};
const parseCollectionDependencies = (collectionManifest) => {
  return (collectionManifest.collections || []).map((c) => c.name);
};
const parseGlobal = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
  if (typeof collectionManifest.global !== 'string') {
    return;
  }
  const sourceFilePath = normalizePath$2(join(collectionDir, collectionManifest.global));
  const globalModule = transpileCollectionModule(config, compilerCtx, buildCtx, collection, sourceFilePath);
  collection.global = globalModule;
};
const parseBundles = (collectionManifest) => {
  if (invalidArrayData(collectionManifest.bundles)) {
    return [];
  }
  return collectionManifest.bundles.map((b) => {
    return {
      components: b.components.slice().sort(),
    };
  });
};
const invalidArrayData = (arr) => {
  return !arr || !Array.isArray(arr) || arr.length === 0;
};

const parseCollection = (config, compilerCtx, buildCtx, moduleId, pkgJsonFilePath, pkgData) => {
  // note this MUST be synchronous because this is used during transpile
  const collectionName = pkgData.name;
  let collection = compilerCtx.collections.find((c) => c.collectionName === collectionName);
  if (collection != null) {
    // we've already cached the collection, no need for another resolve/readFile/parse
    // thought being that /node_modules/ isn't changing between watch builds
    return collection;
  }
  // get the root directory of the dependency
  const collectionPackageRootDir = dirname(pkgJsonFilePath);
  // figure out the full path to the collection collection file
  const collectionFilePath = join(collectionPackageRootDir, pkgData.collection);
  const relPath = relative$1(config.rootDir, collectionFilePath);
  config.logger.debug(`load collection: ${collectionName}, ${relPath}`);
  // we haven't cached the collection yet, let's read this file
  // sync on purpose :(
  const collectionJsonStr = compilerCtx.fs.readFileSync(collectionFilePath);
  if (!collectionJsonStr) {
    return null;
  }
  // get the directory where the collection collection file is sitting
  const collectionDir = normalizePath$2(dirname(collectionFilePath));
  // parse the json string into our collection data
  collection = parseCollectionManifest(config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr);
  collection.moduleId = moduleId;
  if (pkgData.module && pkgData.module !== pkgData.main) {
    collection.hasExports = true;
  }
  // remember the source of this collection node_module
  collection.moduleDir = collectionPackageRootDir;
  // cache it for later yo
  compilerCtx.collections.push(collection);
  return collection;
};

const addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFile, moduleId, resolveCollections) => {
  if (!moduleFile.externalImports.includes(moduleId)) {
    moduleFile.externalImports.push(moduleId);
    moduleFile.externalImports.sort();
  }
  if (!resolveCollections || compilerCtx.resolvedCollections.has(moduleId)) {
    // we've already handled this collection moduleId before
    return;
  }
  let pkgJsonFilePath = tsResolveModuleNamePackageJsonPath(config, compilerCtx, moduleId, containingFile);
  // cache that we've already parsed this
  compilerCtx.resolvedCollections.add(moduleId);
  if (pkgJsonFilePath == null) {
    return;
  }
  const realPkgJsonFilePath = config.sys.realpathSync(pkgJsonFilePath);
  if (realPkgJsonFilePath.path) {
    pkgJsonFilePath = realPkgJsonFilePath.path;
  }
  if (pkgJsonFilePath === config.packageJsonFilePath) {
    // same package silly!
    return;
  }
  // open up and parse the package.json
  // sync on purpose :(
  const pkgJsonStr = compilerCtx.fs.readFileSync(pkgJsonFilePath);
  if (pkgJsonStr == null) {
    return;
  }
  const parsedPkgJson = parsePackageJson(pkgJsonStr, pkgJsonFilePath);
  if (parsedPkgJson.diagnostic) {
    buildCtx.diagnostics.push(parsedPkgJson.diagnostic);
    return;
  }
  if (!isString$1(parsedPkgJson.data.collection) || !parsedPkgJson.data.collection.endsWith('.json')) {
    // this import is not a stencil collection
    return;
  }
  if (!isString$1(parsedPkgJson.data.types) || !parsedPkgJson.data.types.endsWith('.d.ts')) {
    // this import should have types
    return;
  }
  // this import is a stencil collection
  // let's parse it and gather all the module data about it
  // internally it'll cached collection data if we've already done this
  const collection = parseCollection(config, compilerCtx, buildCtx, moduleId, parsedPkgJson.filePath, parsedPkgJson.data);
  if (!collection) {
    return;
  }
  // check if we already added this collection to the build context
  const alreadyHasCollection = buildCtx.collections.some((c) => {
    return c.collectionName === collection.collectionName;
  });
  if (alreadyHasCollection) {
    // we already have this collection in our build context
    return;
  }
  // let's add the collection to the build context
  buildCtx.collections.push(collection);
  if (Array.isArray(collection.dependencies)) {
    // this collection has more collections
    // let's keep digging down and discover all of them
    collection.dependencies.forEach((dependencyModuleId) => {
      const resolveFromDir = dirname(pkgJsonFilePath);
      addExternalImport(config, compilerCtx, buildCtx, moduleFile, resolveFromDir, dependencyModuleId, resolveCollections);
    });
  }
};

const parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
  if (importNode.moduleSpecifier && t.isStringLiteral(importNode.moduleSpecifier)) {
    let importPath = importNode.moduleSpecifier.text;
    if (!moduleFile.originalImports.includes(importPath)) {
      moduleFile.originalImports.push(importPath);
    }
    if (isAbsolute$1(importPath)) {
      // absolute import
      importPath = normalizePath$2(importPath);
      moduleFile.localImports.push(importPath);
    }
    else if (importPath.startsWith('.')) {
      // relative import
      importPath = normalizePath$2(resolve$3(dirPath, importPath));
      moduleFile.localImports.push(importPath);
    }
    else {
      // node resolve side effect import
      addExternalImport(config, compilerCtx, buildCtx, moduleFile, moduleFile.sourceFilePath, importPath, resolveCollections);
    }
  }
};

const updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText, emitFilePath, typeChecker, collection) => {
  const sourceFilePath = normalizePath$2(tsSourceFile.fileName);
  const prevModuleFile = getModule(compilerCtx, sourceFilePath);
  if (prevModuleFile && prevModuleFile.staticSourceFileText === sourceFileText) {
    return prevModuleFile;
  }
  const srcDirPath = dirname(sourceFilePath);
  const emitFileName = basename(emitFilePath);
  emitFilePath = normalizePath$2(join(srcDirPath, emitFileName));
  const moduleFile = createModule(tsSourceFile, sourceFileText, emitFilePath);
  if (emitFilePath.endsWith('.js.map')) {
    moduleFile.sourceMapPath = emitFilePath;
    moduleFile.sourceMapFileText = sourceFileText;
  }
  else if (prevModuleFile && prevModuleFile.sourceMapPath) {
    moduleFile.sourceMapPath = prevModuleFile.sourceMapPath;
    moduleFile.sourceMapFileText = prevModuleFile.sourceMapFileText;
  }
  const moduleFileKey = normalizePath$2(moduleFile.sourceFilePath);
  compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
  compilerCtx.changedModules.add(moduleFile.sourceFilePath);
  const visitNode = (node) => {
    if (t.isClassDeclaration(node)) {
      parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile);
      return;
    }
    else if (t.isImportDeclaration(node)) {
      parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
      return;
    }
    else if (t.isCallExpression(node)) {
      parseCallExpression(moduleFile, node);
    }
    else if (t.isStringLiteral(node)) {
      parseStringLiteral(moduleFile, node);
    }
    node.forEachChild(visitNode);
  };
  if (collection != null) {
    moduleFile.isCollectionDependency = true;
    moduleFile.collectionName = collection.collectionName;
    collection.moduleFiles.push(moduleFile);
  }
  visitNode(tsSourceFile);
  // TODO: workaround around const enums
  // find better way
  if (moduleFile.cmps.length > 0) {
    moduleFile.staticSourceFile = t.createSourceFile(sourceFilePath, sourceFileText, tsSourceFile.languageVersion, true, t.ScriptKind.JS);
  }
  return moduleFile;
};

const validateTranspiledComponents = (config, buildCtx) => {
  for (const cmp of buildCtx.components) {
    validateUniqueTagNames(config, buildCtx, cmp);
  }
};
const validateUniqueTagNames = (config, buildCtx, cmp) => {
  const tagName = cmp.tagName;
  const cmpsWithTagName = buildCtx.components.filter((c) => c.tagName === tagName);
  if (cmpsWithTagName.length > 1) {
    const err = buildError(buildCtx.diagnostics);
    err.header = `Component Tag Name "${tagName}" Must Be Unique`;
    err.messageText = `Please update the components so "${tagName}" is only used once: ${cmpsWithTagName
      .map((c) => relative$1(config.rootDir, c.sourceFilePath))
      .join(' ')}`;
  }
};

const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
  const tsSyntactic = loadTypeScriptDiagnostics(tsBuilder.getSyntacticDiagnostics());
  const tsGlobal = loadTypeScriptDiagnostics(tsBuilder.getGlobalDiagnostics());
  const tsOptions = loadTypeScriptDiagnostics(tsBuilder.getOptionsDiagnostics());
  buildCtx.diagnostics.push(...tsSyntactic);
  buildCtx.diagnostics.push(...tsGlobal);
  buildCtx.diagnostics.push(...tsOptions);
  if (buildCtx.hasError) {
    return false;
  }
  const tsProgram = tsBuilder.getProgram();
  const tsTypeChecker = tsProgram.getTypeChecker();
  const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
  const emittedDts = [];
  const emitCallback = (emitFilePath, data, _w, _e, tsSourceFiles) => {
    if (emitFilePath.endsWith('.js') || emitFilePath.endsWith('js.map')) {
      updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data, emitFilePath, tsTypeChecker, null);
    }
    else if (emitFilePath.endsWith('.d.ts')) {
      const srcDtsPath = normalizePath$2(tsSourceFiles[0].fileName);
      const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
      emittedDts.push(srcDtsPath);
      typesOutputTarget.forEach((o) => {
        const distPath = join(o.typesDir, relativeEmitFilepath);
        data = updateStencilTypesImports(o.typesDir, distPath, data);
        compilerCtx.fs.writeFile(distPath, data);
      });
    }
  };
  // Emit files that changed
  tsBuilder.emit(undefined, emitCallback, undefined, false, {
    before: [convertDecoratorsToStatic(config, buildCtx.diagnostics, tsTypeChecker)],
  });
  const changedmodules = Array.from(compilerCtx.changedModules.keys());
  buildCtx.debug('Transpiled modules: ' + JSON.stringify(changedmodules, null, '\n'));
  // Finalize components metadata
  buildCtx.moduleFiles = Array.from(compilerCtx.moduleMap.values());
  buildCtx.components = getComponentsFromModules(buildCtx.moduleFiles);
  updateComponentBuildConditionals(compilerCtx.moduleMap, buildCtx.components);
  resolveComponentDependencies(buildCtx.components);
  validateTranspiledComponents(config, buildCtx);
  if (buildCtx.hasError) {
    return false;
  }
  // create the components.d.ts file and write to disk
  const hasTypesChanged = await generateAppTypes(config, compilerCtx, buildCtx, 'src');
  if (hasTypesChanged) {
    return true;
  }
  if (typesOutputTarget.length > 0) {
    // copy src dts files that do not get emitted by the compiler
    // but we still want to ship them in the dist directory
    const srcRootDtsFiles = tsProgram
      .getRootFileNames()
      .filter((f) => f.endsWith('.d.ts') && !f.endsWith('components.d.ts'))
      .map(normalizePath$2)
      .filter((f) => !emittedDts.includes(f))
      .map((srcRootDtsFilePath) => {
      const relativeEmitFilepath = relative$1(config.srcDir, srcRootDtsFilePath);
      return Promise.all(typesOutputTarget.map(async (o) => {
        const distPath = join(o.typesDir, relativeEmitFilepath);
        let dtsContent = await compilerCtx.fs.readFile(srcRootDtsFilePath);
        dtsContent = updateStencilTypesImports(o.typesDir, distPath, dtsContent);
        await compilerCtx.fs.writeFile(distPath, dtsContent);
      }));
    });
    await Promise.all(srcRootDtsFiles);
  }
  if (config.validateTypes) {
    const tsSemantic = loadTypeScriptDiagnostics(tsBuilder.getSemanticDiagnostics());
    if (config.devMode) {
      tsSemantic.forEach((semanticDiagnostic) => {
        // Unused variable errors become warnings in dev mode
        if (semanticDiagnostic.code === '6133' || semanticDiagnostic.code === '6192') {
          semanticDiagnostic.level = 'warn';
        }
      });
    }
    buildCtx.diagnostics.push(...tsSemantic);
  }
  return false;
};
const getRelativeDts = (config, srcPath, emitDtsPath) => {
  const parts = [];
  for (let i = 0; i < 30; i++) {
    if (config.srcDir === srcPath) {
      break;
    }
    const b = basename(emitDtsPath);
    parts.push(b);
    emitDtsPath = join(emitDtsPath, '..');
    srcPath = normalizePath$2(join(srcPath, '..'));
  }
  return join(...parts.reverse());
};

const generateHmr = (config, compilerCtx, buildCtx) => {
  if (config.devServer == null || config.devServer.reloadStrategy == null) {
    return null;
  }
  const hmr = {
    reloadStrategy: config.devServer.reloadStrategy,
    versionId: Date.now().toString().substring(6) + '' + Math.round(Math.random() * 89999 + 10000),
  };
  if (buildCtx.scriptsAdded.length > 0) {
    hmr.scriptsAdded = buildCtx.scriptsAdded.slice();
  }
  if (buildCtx.scriptsDeleted.length > 0) {
    hmr.scriptsDeleted = buildCtx.scriptsDeleted.slice();
  }
  const excludeHmr = excludeHmrFiles(config, config.devServer.excludeHmr, buildCtx.filesChanged);
  if (excludeHmr.length > 0) {
    hmr.excludeHmr = excludeHmr.slice();
  }
  if (buildCtx.hasHtmlChanges) {
    hmr.indexHtmlUpdated = true;
  }
  if (buildCtx.hasServiceWorkerChanges) {
    hmr.serviceWorkerUpdated = true;
  }
  const outputTargetsWww = config.outputTargets.filter(isOutputTargetWww);
  const componentsUpdated = getComponentsUpdated(compilerCtx, buildCtx);
  if (componentsUpdated) {
    hmr.componentsUpdated = componentsUpdated;
  }
  if (Object.keys(buildCtx.stylesUpdated).length > 0) {
    hmr.inlineStylesUpdated = sortBy(buildCtx.stylesUpdated.map((s) => {
      return {
        styleId: getScopeId(s.styleTag, s.styleMode),
        styleTag: s.styleTag,
        styleText: s.styleText,
      };
    }), (s) => s.styleId);
  }
  const externalStylesUpdated = getExternalStylesUpdated(buildCtx, outputTargetsWww);
  if (externalStylesUpdated) {
    hmr.externalStylesUpdated = externalStylesUpdated;
  }
  const externalImagesUpdated = getImagesUpdated(buildCtx, outputTargetsWww);
  if (externalImagesUpdated) {
    hmr.imagesUpdated = externalImagesUpdated;
  }
  return hmr;
};
const getComponentsUpdated = (compilerCtx, buildCtx) => {
  // find all of the components that would be affected from the file changes
  if (!buildCtx.filesChanged) {
    return null;
  }
  const filesToLookForImporters = buildCtx.filesChanged.filter((f) => {
    return f.endsWith('.ts') || f.endsWith('.tsx') || f.endsWith('.js') || f.endsWith('.jsx');
  });
  if (filesToLookForImporters.length === 0) {
    return null;
  }
  const changedScriptFiles = [];
  const checkedFiles = new Set();
  const allModuleFiles = buildCtx.moduleFiles.filter((m) => m.localImports && m.localImports.length > 0);
  while (filesToLookForImporters.length > 0) {
    const scriptFile = filesToLookForImporters.shift();
    addTsFileImporters(allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile);
  }
  const tags = changedScriptFiles.reduce((tags, changedTsFile) => {
    const moduleFile = compilerCtx.moduleMap.get(changedTsFile);
    if (moduleFile != null) {
      moduleFile.cmps.forEach((cmp) => {
        if (typeof cmp.tagName === 'string') {
          if (!tags.includes(cmp.tagName)) {
            tags.push(cmp.tagName);
          }
        }
      });
    }
    return tags;
  }, []);
  if (tags.length === 0) {
    return null;
  }
  return tags.sort();
};
const addTsFileImporters = (allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile) => {
  if (!changedScriptFiles.includes(scriptFile)) {
    // add it to our list of files to transpile
    changedScriptFiles.push(scriptFile);
  }
  if (checkedFiles.has(scriptFile)) {
    // already checked this file
    return;
  }
  checkedFiles.add(scriptFile);
  // get all the ts files that import this ts file
  const tsFilesThatImportsThisTsFile = allModuleFiles.reduce((arr, moduleFile) => {
    moduleFile.localImports.forEach((localImport) => {
      let checkFile = localImport;
      if (checkFile === scriptFile) {
        arr.push(moduleFile.sourceFilePath);
        return;
      }
      checkFile = localImport + '.tsx';
      if (checkFile === scriptFile) {
        arr.push(moduleFile.sourceFilePath);
        return;
      }
      checkFile = localImport + '.ts';
      if (checkFile === scriptFile) {
        arr.push(moduleFile.sourceFilePath);
        return;
      }
      checkFile = localImport + '.js';
      if (checkFile === scriptFile) {
        arr.push(moduleFile.sourceFilePath);
        return;
      }
    });
    return arr;
  }, []);
  // add all the files that import this ts file to the list of ts files we need to look through
  tsFilesThatImportsThisTsFile.forEach((tsFileThatImportsThisTsFile) => {
    // if we add to this array, then the while look will keep working until it's empty
    filesToLookForImporters.push(tsFileThatImportsThisTsFile);
  });
};
const getExternalStylesUpdated = (buildCtx, outputTargetsWww) => {
  if (!buildCtx.isRebuild || outputTargetsWww.length === 0) {
    return null;
  }
  const cssFiles = buildCtx.filesWritten.filter((f) => f.endsWith('.css'));
  if (cssFiles.length === 0) {
    return null;
  }
  return cssFiles.map((cssFile) => basename(cssFile)).sort();
};
const getImagesUpdated = (buildCtx, outputTargetsWww) => {
  if (outputTargetsWww.length === 0) {
    return null;
  }
  const imageFiles = buildCtx.filesChanged.reduce((arr, filePath) => {
    if (IMAGE_EXT.some((ext) => filePath.toLowerCase().endsWith(ext))) {
      const fileName = basename(filePath);
      if (!arr.includes(fileName)) {
        arr.push(fileName);
      }
    }
    return arr;
  }, []);
  if (imageFiles.length === 0) {
    return null;
  }
  return imageFiles.sort();
};
/**
 * Determine a list of files (if any) which should be excluded from HMR updates.
 *
 * @param config a user-supplied config
 * @param excludeHmr a list of glob patterns that should be used to determine
 * whether to exclude a file or not (a file will be excluded if it matches one
 * @param filesChanged an array of files which are changed in the HMR update
 * currently under consideration
 * @returns a sorted list of files to exclude
 */
const excludeHmrFiles = (config, excludeHmr, filesChanged) => {
  const excludeFiles = [];
  if (!excludeHmr || excludeHmr.length === 0) {
    return excludeFiles;
  }
  excludeHmr.forEach((excludeHmr) => {
    return filesChanged
      .map((fileChanged) => {
      let shouldExclude = false;
      if (isGlob(excludeHmr)) {
        shouldExclude = minimatch_1$1(fileChanged, excludeHmr);
      }
      else {
        shouldExclude = normalizePath$2(excludeHmr) === normalizePath$2(fileChanged);
      }
      if (shouldExclude) {
        config.logger.debug(`excludeHmr: ${fileChanged}`);
        excludeFiles.push(basename(fileChanged));
      }
      return shouldExclude;
    })
      .some((r) => r);
  });
  return excludeFiles.sort();
};
const IMAGE_EXT = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.ico', '.svg'];

const generateBuildResults = (config, compilerCtx, buildCtx) => {
  const componentGraph = buildCtx.componentGraph ? fromEntries(buildCtx.componentGraph.entries()) : undefined;
  const buildResults = {
    buildId: buildCtx.buildId,
    diagnostics: normalizeDiagnostics(compilerCtx, buildCtx.diagnostics),
    dirsAdded: buildCtx.dirsAdded.slice().sort(),
    dirsDeleted: buildCtx.dirsDeleted.slice().sort(),
    duration: Date.now() - buildCtx.startTime,
    filesAdded: buildCtx.filesAdded.slice().sort(),
    filesChanged: buildCtx.filesChanged.slice().sort(),
    filesDeleted: buildCtx.filesDeleted.slice().sort(),
    filesUpdated: buildCtx.filesUpdated.slice().sort(),
    hasError: hasError(buildCtx.diagnostics),
    hasSuccessfulBuild: compilerCtx.hasSuccessfulBuild,
    isRebuild: buildCtx.isRebuild,
    namespace: config.namespace,
    outputs: compilerCtx.fs.getBuildOutputs(),
    rootDir: config.rootDir,
    srcDir: config.srcDir,
    timestamp: getBuildTimestamp(),
    componentGraph,
  };
  const hmr = generateHmr(config, compilerCtx, buildCtx);
  if (hmr != null) {
    buildResults.hmr = hmr;
  }
  if (isString$1(buildCtx.hydrateAppFilePath)) {
    buildResults.hydrateAppFilePath = buildCtx.hydrateAppFilePath;
  }
  compilerCtx.lastBuildResults = Object.assign({}, buildResults);
  return buildResults;
};

/**
 * Generates the Build Stats from the buildCtx. Writes any files to the file system.
 * @param config the project build configuration
 * @param buildCtx An instance of the build which holds the details about the build
 * @returns CompilerBuildStats or an Object including diagnostics.
 */
function generateBuildStats(config, buildCtx) {
  // TODO(STENCIL-461): Investigate making this return only a single type
  const buildResults = buildCtx.buildResults;
  let jsonData;
  try {
    if (buildResults.hasError) {
      jsonData = {
        diagnostics: buildResults.diagnostics,
      };
    }
    else {
      const stats = {
        timestamp: buildResults.timestamp,
        compiler: {
          name: config.sys.name,
          version: config.sys.version,
        },
        app: {
          namespace: config.namespace,
          fsNamespace: config.fsNamespace,
          components: Object.keys(buildResults.componentGraph).length,
          entries: Object.keys(buildResults.componentGraph).length,
          bundles: buildResults.outputs.reduce((total, en) => total + en.files.length, 0),
          outputs: getAppOutputs(config, buildResults),
        },
        options: {
          minifyJs: config.minifyJs,
          minifyCss: config.minifyCss,
          hashFileNames: config.hashFileNames,
          hashedFileNameLength: config.hashedFileNameLength,
          buildEs5: config.buildEs5,
        },
        formats: {
          esmBrowser: sanitizeBundlesForStats(buildCtx.esmBrowserComponentBundle),
          esm: sanitizeBundlesForStats(buildCtx.esmComponentBundle),
          es5: sanitizeBundlesForStats(buildCtx.es5ComponentBundle),
          system: sanitizeBundlesForStats(buildCtx.systemComponentBundle),
          commonjs: sanitizeBundlesForStats(buildCtx.commonJsComponentBundle),
        },
        components: getComponentsFileMap(config, buildCtx),
        entries: buildCtx.entryModules,
        componentGraph: buildResults.componentGraph,
        sourceGraph: getSourceGraph(config, buildCtx),
        rollupResults: buildCtx.rollupResults,
        collections: getCollections(config, buildCtx),
      };
      jsonData = stats;
    }
  }
  catch (e) {
    const diagnostic = {
      messageText: `Generate Build Stats Error: ` + e,
      level: `error`,
      type: `build`,
    };
    jsonData = {
      diagnostics: [diagnostic],
    };
  }
  return jsonData;
}
/**
 * Writes the files from the stats config to the file system
 * @param config the project build configuration
 * @param data the information to write out to disk (as specified by each stats output target specified in the provided
 * config)
 */
async function writeBuildStats(config, data) {
  const statsTargets = config.outputTargets.filter(isOutputTargetStats);
  await Promise.all(statsTargets.map(async (outputTarget) => {
    const result = await config.sys.writeFile(outputTarget.file, JSON.stringify(data, null, 2));
    if (result.error) {
      config.logger.warn([`Stats failed to write file to ${outputTarget.file}`]);
    }
  }));
}
function sanitizeBundlesForStats(bundleArray) {
  if (!bundleArray) {
    return [];
  }
  return bundleArray.map((bundle) => {
    return {
      key: bundle.entryKey,
      components: bundle.cmps.map((c) => c.tagName),
      bundleId: bundle.output.bundleId,
      fileName: bundle.output.fileName,
      imports: bundle.rollupResult.imports,
      // code: bundle.rollupResult.code, // (use this to debug)
      // Currently, this number is inaccurate vs what seems to be on disk.
      originalByteSize: byteSize(bundle.rollupResult.code),
    };
  });
}
function getSourceGraph(config, buildCtx) {
  const sourceGraph = {};
  sortBy(buildCtx.moduleFiles, (m) => m.sourceFilePath).forEach((moduleFile) => {
    const key = relativePath(config, moduleFile.sourceFilePath);
    sourceGraph[key] = moduleFile.localImports.map((localImport) => relativePath(config, localImport)).sort();
  });
  return sourceGraph;
}
function getAppOutputs(config, buildResults) {
  return buildResults.outputs.map((output) => {
    return {
      name: output.type,
      files: output.files.length,
      generatedFiles: output.files.map((file) => relativePath(config, file)),
    };
  });
}
function getComponentsFileMap(config, buildCtx) {
  return buildCtx.components.map((component) => {
    return {
      tag: component.tagName,
      path: relativePath(config, component.jsFilePath),
      source: relativePath(config, component.sourceFilePath),
      elementRef: component.elementRef,
      componentClassName: component.componentClassName,
      assetsDirs: component.assetsDirs,
      dependencies: component.dependencies,
      dependents: component.dependents,
      directDependencies: component.directDependencies,
      directDependents: component.directDependents,
      docs: component.docs,
      encapsulation: component.encapsulation,
      excludeFromCollection: component.excludeFromCollection,
      events: component.events,
      internal: component.internal,
      legacyConnect: component.legacyConnect,
      legacyContext: component.legacyContext,
      listeners: component.listeners,
      methods: component.methods,
      potentialCmpRefs: component.potentialCmpRefs,
      properties: component.properties,
      shadowDelegatesFocus: component.shadowDelegatesFocus,
      states: component.states,
    };
  });
}
function getCollections(config, buildCtx) {
  return buildCtx.collections
    .map((c) => {
    return {
      name: c.collectionName,
      source: relativePath(config, c.moduleDir),
      tags: c.moduleFiles.map((m) => m.cmps.map((cmp) => cmp.tagName)).sort(),
    };
  })
    .sort((a, b) => {
    if (a.name < b.name)
      return -1;
    if (a.name > b.name)
      return 1;
    return 0;
  });
}
function relativePath(config, file) {
  return config.sys.normalizePath(config.sys.platformPath.relative(config.rootDir, file));
}

/**
 * Finish a build as having completed successfully
 * @param buildCtx the build context for the build being aborted
 * @returns the build results
 */
const buildFinish = async (buildCtx) => {
  const results = await buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, false);
  const buildLog = {
    buildId: buildCtx.buildId,
    messages: buildCtx.buildMessages.slice(),
    progress: 1,
  };
  buildCtx.compilerCtx.events.emit('buildLog', buildLog);
  return results;
};
/**
 * Finish a build early due to failure. During the build process, a fatal error has occurred where the compiler cannot
 * continue further
 * @param buildCtx the build context for the build being aborted
 * @returns the build results
 */
const buildAbort = (buildCtx) => {
  return buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, true);
};
/**
 * Mark a build as done
 * @param config the Stencil configuration used for the build
 * @param compilerCtx the compiler context associated with the build
 * @param buildCtx the build context associated with the build to mark as done
 * @param aborted true if the build ended early due to failure, false otherwise
 * @returns the build results
 */
const buildDone = async (config, compilerCtx, buildCtx, aborted) => {
  if (buildCtx.hasFinished && buildCtx.buildResults) {
    // we've already marked this build as finished and
    // already created the build results, just return these
    return buildCtx.buildResults;
  }
  // create the build results data
  buildCtx.buildResults = generateBuildResults(config, compilerCtx, buildCtx);
  // After the build results are available on the buildCtx, call the stats and set it.
  // We will use this later to write the files.
  buildCtx.buildStats = generateBuildStats(config, buildCtx);
  await writeBuildStats(config, buildCtx.buildStats);
  buildCtx.debug(`${aborted ? 'aborted' : 'finished'} build, ${buildCtx.buildResults.duration}ms`);
  // log any errors/warnings
  if (!buildCtx.hasFinished) {
    // haven't set this build as finished yet
    if (!buildCtx.hasPrintedResults) {
      cleanDiagnosticsRelativePath(config, buildCtx.buildResults.diagnostics);
      config.logger.printDiagnostics(buildCtx.buildResults.diagnostics);
    }
    const hasChanges = buildCtx.hasScriptChanges || buildCtx.hasStyleChanges;
    if (buildCtx.isRebuild && hasChanges && buildCtx.buildResults.hmr && !aborted) {
      // this is a rebuild, and we've got hmr data
      // and this build hasn't been aborted
      logHmr(config.logger, buildCtx);
    }
    // create a nice pretty message stating what happened
    const buildText = buildCtx.isRebuild ? 'rebuild' : 'build';
    const watchText = config.watch ? ', watching for changes...' : '';
    let buildStatus = 'finished';
    let statusColor = 'green';
    if (buildCtx.hasError) {
      // gosh darn, build had errors
      // ಥ_ಥ
      buildStatus = 'failed';
      statusColor = 'red';
    }
    else {
      // successful build!
      // ┏(°.°)┛ ┗(°.°)┓ ┗(°.°)┛ ┏(°.°)┓
      compilerCtx.changedFiles.clear();
      compilerCtx.hasSuccessfulBuild = true;
      buildCtx.buildResults.hasSuccessfulBuild = true;
    }
    // print out the time it took to build
    // and add the duration to the build results
    if (!buildCtx.hasPrintedResults) {
      buildCtx.timeSpan.finish(`${buildText} ${buildStatus}${watchText}`, statusColor, true, true);
      buildCtx.hasPrintedResults = true;
    }
    // emit a buildFinish event for anyone who cares
    compilerCtx.events.emit('buildFinish', buildCtx.buildResults);
    // write all of our logs to disk if config'd to do so
    // do this even if there are errors or not the active build
    if (isFunction(config.logger.writeLogs)) {
      config.logger.writeLogs(buildCtx.isRebuild);
    }
  }
  // it's official, this build has finished
  buildCtx.hasFinished = true;
  if (!config.watch) {
    compilerCtx.reset();
    if (IS_NODE_ENV && global.gc) {
      buildCtx.debug(`triggering forced gc`);
      global.gc();
      buildCtx.debug(`forced gc finished`);
    }
  }
  return buildCtx.buildResults;
};
const logHmr = (logger, buildCtx) => {
  // this is a rebuild, and we've got hmr data
  // and this build hasn't been aborted
  const hmr = buildCtx.buildResults.hmr;
  if (hmr.componentsUpdated) {
    cleanupUpdateMsg(logger, `updated component`, hmr.componentsUpdated);
  }
  if (hmr.inlineStylesUpdated) {
    const inlineStyles = hmr.inlineStylesUpdated
      .map((s) => s.styleTag)
      .reduce((arr, v) => {
      if (!arr.includes(v)) {
        arr.push(v);
      }
      return arr;
    }, []);
    cleanupUpdateMsg(logger, `updated style`, inlineStyles);
  }
  if (hmr.externalStylesUpdated) {
    cleanupUpdateMsg(logger, `updated stylesheet`, hmr.externalStylesUpdated);
  }
  if (hmr.imagesUpdated) {
    cleanupUpdateMsg(logger, `updated image`, hmr.imagesUpdated);
  }
};
const cleanupUpdateMsg = (logger, msg, fileNames) => {
  if (fileNames.length > 0) {
    let fileMsg = '';
    if (fileNames.length > 7) {
      const remaining = fileNames.length - 6;
      fileNames = fileNames.slice(0, 6);
      fileMsg = fileNames.join(', ') + `, +${remaining} others`;
    }
    else {
      fileMsg = fileNames.join(', ');
    }
    if (fileNames.length > 1) {
      msg += 's';
    }
    logger.info(`${msg}: ${logger.cyan(fileMsg)}`);
  }
};
/**
 * Update the relative file path for diagnostics. The updates are done in place.
 * @param config the Stencil configuration associated with the current build
 * @param diagnostics the diagnostics to update
 */
const cleanDiagnosticsRelativePath = (config, diagnostics) => {
  diagnostics.forEach((diagnostic) => {
    if (!diagnostic.relFilePath && !isRemoteUrl(diagnostic.absFilePath) && diagnostic.absFilePath && config.rootDir) {
      diagnostic.relFilePath = relative$1(config.rootDir, diagnostic.absFilePath);
    }
  });
};

/**
 * Entrypoint to creating a service worker for every `www` output target
 * @param config the Stencil configuration used for the build
 * @param buildCtx the build context associated with the build to mark as done
 */
const outputServiceWorkers = async (config, buildCtx) => {
  const wwwServiceOutputs = config.outputTargets
    .filter(isOutputTargetWww)
    .filter((o) => typeof o.indexHtml === 'string' && !!o.serviceWorker);
  if (wwwServiceOutputs.length === 0 || config.sys.lazyRequire == null) {
    return;
  }
  // let's make sure they have what we need from workbox installed
  const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ['workbox-build']);
  if (diagnostics.length > 0) {
    buildCtx.diagnostics.push(...diagnostics);
  }
  else {
    // we've ensured workbox is installed, so let's require it now
    const workbox = config.sys.lazyRequire.require(config.rootDir, 'workbox-build');
    await Promise.all(wwwServiceOutputs.map((outputTarget) => generateServiceWorker(config, buildCtx, workbox, outputTarget)));
  }
};

const validateManifestJson = (config, compilerCtx, buildCtx) => {
  if (config.devMode) {
    return null;
  }
  const outputTargets = config.outputTargets.filter(isOutputTargetWww);
  return Promise.all(outputTargets.map(async (outputsTarget) => {
    const manifestFilePath = join(outputsTarget.dir, 'manifest.json');
    try {
      const manifestContent = await compilerCtx.fs.readFile(manifestFilePath);
      if (manifestContent) {
        try {
          const manifestData = JSON.parse(manifestContent);
          await validateManifestJsonData(compilerCtx, buildCtx, manifestFilePath, manifestData);
        }
        catch (e) {
          const err = buildError(buildCtx.diagnostics);
          err.header = `Invalid manifest.json: ${e}`;
          err.absFilePath = manifestFilePath;
        }
      }
    }
    catch (e) { }
  }));
};
const validateManifestJsonData = async (compilerCtx, buildCtx, manifestFilePath, manifestData) => {
  if (Array.isArray(manifestData.icons)) {
    await Promise.all(manifestData.icons.map((manifestIcon) => {
      return validateManifestJsonIcon(compilerCtx, buildCtx, manifestFilePath, manifestIcon);
    }));
  }
};
const validateManifestJsonIcon = async (compilerCtx, buildCtx, manifestFilePath, manifestIcon) => {
  let iconSrc = manifestIcon.src;
  if (typeof iconSrc !== 'string') {
    const msg = `Manifest icon missing "src"`;
    buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"icons"`);
    return;
  }
  if (iconSrc.startsWith('/')) {
    iconSrc = iconSrc.slice(1);
  }
  const manifestDir = dirname(manifestFilePath);
  const iconPath = join(manifestDir, iconSrc);
  const hasAccess = await compilerCtx.fs.access(iconPath);
  if (!hasAccess) {
    const msg = `Unable to find manifest icon "${manifestIcon.src}"`;
    buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"${manifestIcon.src}"`);
  }
};

/**
 * Validate the package.json file for a project, checking that various fields
 * are set correctly for the currently-configured output targets.
 *
 * @param config the project's Stencil config
 * @param compilerCtx the compiler context
 * @param buildCtx the build context
 * @returns an empty Promise
 */
const validateBuildPackageJson = async (config, compilerCtx, buildCtx) => {
  if (config.watch) {
    return;
  }
  if (buildCtx.packageJson == null) {
    return;
  }
  const distCollectionOutputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
  const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
  await Promise.all([
    ...distCollectionOutputTargets.map((distCollectionOT) => validateDistCollectionPkgJson(config, compilerCtx, buildCtx, distCollectionOT)),
    ...typesOutputTargets.map((typesOT) => validateTypes(config, compilerCtx, buildCtx, typesOT)),
    validateModule(config, compilerCtx, buildCtx),
  ]);
};
/**
 * Validate package.json contents for the `DIST_COLLECTION` output target,
 * checking that various fields like `files`, `main`, and so on are set
 * correctly.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget a DIST_COLLECTION output target
 */
const validateDistCollectionPkgJson = async (config, compilerCtx, buildCtx, outputTarget) => {
  await Promise.all([
    validatePackageFiles(config, compilerCtx, buildCtx, outputTarget),
    validateMain(config, compilerCtx, buildCtx, outputTarget),
    validateCollection$1(config, compilerCtx, buildCtx, outputTarget),
    validateBrowser(config, compilerCtx, buildCtx),
  ]);
};
/**
 * Validate that the `files` field in `package.json` contains directories and
 * files that are necessary for the `DIST_COLLECTION` output target.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget a DIST_COLLECTION output target
 */
const validatePackageFiles = async (config, compilerCtx, buildCtx, outputTarget) => {
  if (!config.devMode && Array.isArray(buildCtx.packageJson.files)) {
    const actualDistDir = normalizePath$2(relative$1(config.rootDir, outputTarget.dir));
    const validPaths = [`${actualDistDir}`, `${actualDistDir}/`, `./${actualDistDir}`, `./${actualDistDir}/`];
    const containsDistDir = buildCtx.packageJson.files.some((userPath) => validPaths.some((validPath) => normalizePath$2(userPath) === validPath));
    if (!containsDistDir) {
      const msg = `package.json "files" array must contain the distribution directory "${actualDistDir}/" when generating a distribution.`;
      packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
      return;
    }
    await Promise.all(buildCtx.packageJson.files.map(async (pkgFile) => {
      if (!isGlob(pkgFile)) {
        const packageJsonDir = dirname(config.packageJsonFilePath);
        const absPath = join(packageJsonDir, pkgFile);
        const hasAccess = await compilerCtx.fs.access(absPath);
        if (!hasAccess) {
          const msg = `Unable to find "${pkgFile}" within the package.json "files" array.`;
          packageJsonError(config, compilerCtx, buildCtx, msg, `"${pkgFile}"`);
        }
      }
    }));
  }
};
/**
 * Check that the `main` field is set correctly in `package.json` for the
 * `DIST_COLLECTION` output target.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget a DIST_COLLECTION output target
 */
const validateMain = (config, compilerCtx, buildCtx, outputTarget) => {
  const mainAbs = join(outputTarget.dir, 'index.cjs.js');
  const mainRel = relative$1(config.rootDir, mainAbs);
  if (!isString$1(buildCtx.packageJson.main) || buildCtx.packageJson.main === '') {
    const msg = `package.json "main" property is required when generating a distribution. It's recommended to set the "main" property to: ${mainRel}`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
  }
  else if (normalizePath$2(buildCtx.packageJson.main) !== normalizePath$2(mainRel)) {
    const msg = `package.json "main" property is set to "${buildCtx.packageJson.main}". It's recommended to set the "main" property to: ${mainRel}`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
  }
};
/**
 * Validate the package.json 'module' field, taking into account output targets
 * and other configuration details. This will look for a value for the `module`
 * field. If not present it will set a relevant warning message with an
 * output-target specific recommended value. If it is present and is not equal
 * to that recommended value it will set a different warning message.
 *
 * @param config the project's Stencil config
 * @param compilerCtx the compiler context
 * @param buildCtx the build context
 * @returns an empty Promise
 */
const validateModule = async (config, compilerCtx, buildCtx) => {
  const currentModule = buildCtx.packageJson.module;
  const recommendedRelPath = recommendedModulePath(config);
  if (!isString$1(currentModule)) {
    let msg = 'package.json "module" property is required when generating a distribution.';
    if (recommendedRelPath !== null) {
      msg += ` It's recommended to set the "module" property to: ${normalizePath$2(recommendedRelPath)}`;
    }
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
    return;
  }
  if (recommendedRelPath !== null && normalizePath$2(recommendedRelPath) !== normalizePath$2(currentModule)) {
    const msg = `package.json "module" property is set to "${currentModule}". It's recommended to set the "module" property to: ${normalizePath$2(recommendedRelPath)}`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
  }
};
// TODO(STENCIL-516): Investigate the hierarchy of these output targets
/**
 * Get the recommended `"module"` path for `package.json` given the output
 * targets that a user has set on their config.
 *
 * @param config the project's Stencil config
 * @returns a recommended module path or a null value to indicate no default
 * value is supplied
 */
function recommendedModulePath(config) {
  const customElementsBundleOT = config.outputTargets.find(isOutputTargetDistCustomElementsBundle);
  const customElementsOT = config.outputTargets.find(isOutputTargetDistCustomElements);
  const distCollectionOT = config.outputTargets.find(isOutputTargetDistCollection);
  if (distCollectionOT) {
    return relative$1(config.rootDir, join(distCollectionOT.dir, 'index.js'));
  }
  if (customElementsOT) {
    const componentsIndexAbs = join(customElementsOT.dir, 'index.js');
    return relative$1(config.rootDir, componentsIndexAbs);
  }
  if (customElementsBundleOT) {
    const customElementsAbs = join(customElementsBundleOT.dir, 'index.js');
    return relative$1(config.rootDir, customElementsAbs);
  }
  // if no output target for which we define a recommended output target is set
  // we return `null`
  return null;
}
/**
 * Check that the `types` field is set correctly in `package.json` for the
 * `DIST_COLLECTION` output target.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget a DIST_COLLECTION output target
 */
const validateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
  const typesAbs = getComponentsDtsTypesFilePath(outputTarget);
  const recommendedPath = relative$1(config.rootDir, typesAbs);
  if (!isString$1(buildCtx.packageJson.types) || buildCtx.packageJson.types === '') {
    const msg = `package.json "types" property is required when generating a distribution. It's recommended to set the "types" property to: ${recommendedPath}`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
  }
  else if (!buildCtx.packageJson.types.endsWith('.d.ts')) {
    const msg = `package.json "types" file must have a ".d.ts" extension: ${buildCtx.packageJson.types}`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
  }
  else {
    const typesFile = join(config.rootDir, buildCtx.packageJson.types);
    const typesFileExists = await compilerCtx.fs.access(typesFile);
    if (!typesFileExists) {
      let msg = `package.json "types" property is set to "${buildCtx.packageJson.types}" but cannot be found.`;
      if (normalizePath$2(buildCtx.packageJson.types) !== normalizePath$2(recommendedPath)) {
        msg += ` It's recommended to set the "types" property to: ${recommendedPath}`;
      }
      packageJsonError(config, compilerCtx, buildCtx, msg, `"types"`);
    }
  }
};
/**
 * Check that the `collection` field is set correctly in `package.json` for the
 * `DIST_COLLECTION` output target.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param outputTarget a DIST_COLLECTION output target
 */
const validateCollection$1 = (config, compilerCtx, buildCtx, outputTarget) => {
  if (outputTarget.collectionDir) {
    const collectionRel = join(relative$1(config.rootDir, outputTarget.collectionDir), COLLECTION_MANIFEST_FILE_NAME);
    if (!buildCtx.packageJson.collection || normalizePath$2(buildCtx.packageJson.collection) !== collectionRel) {
      const msg = `package.json "collection" property is required when generating a distribution and must be set to: ${collectionRel}`;
      packageJsonWarn(config, compilerCtx, buildCtx, msg, `"collection"`);
    }
  }
};
/**
 * Check that the `browser` field is set correctly in `package.json` for the
 * `DIST_COLLECTION` output target.
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 */
const validateBrowser = (config, compilerCtx, buildCtx) => {
  if (isString$1(buildCtx.packageJson.browser)) {
    const msg = `package.json "browser" property is set to "${buildCtx.packageJson.browser}". However, for maximum compatibility with all bundlers it's recommended to not set the "browser" property and instead ensure both "module" and "main" properties are set.`;
    packageJsonWarn(config, compilerCtx, buildCtx, msg, `"browser"`);
  }
};
/**
 * Build a diagnostic for an error resulting from a particular field in a
 * package.json file
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param msg an error string
 * @param jsonField the key for the field which caused the error, used for
 * finding the error line in the original JSON file
 * @returns a diagnostic object
 */
const packageJsonError = (config, compilerCtx, buildCtx, msg, jsonField) => {
  const err = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, jsonField);
  err.header = `Package Json`;
  return err;
};
/**
 * Build a diagnostic for a warning resulting from a particular field in a
 * package.json file
 *
 * @param config the stencil config
 * @param compilerCtx the current compiler context
 * @param buildCtx the current build context
 * @param msg an error string
 * @param jsonField the key for the field which caused the error, used for
 * finding the error line in the original JSON file
 * @returns a diagnostic object
 */
const packageJsonWarn = (config, compilerCtx, buildCtx, msg, jsonField) => {
  const warn = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, jsonField);
  warn.header = `Package Json`;
  warn.level = 'warn';
  return warn;
};

/**
 * Validate the existence and contents of certain files that were generated after writing the results of the build to
 * disk
 * @param config the Stencil configuration used for the build
 * @param compilerCtx the compiler context associated with the build
 * @param buildCtx the build context associated with the current build
 * @returns an array containing empty-Promise results
 */
const validateBuildFiles = (config, compilerCtx, buildCtx) => {
  if (buildCtx.hasError) {
    return null;
  }
  return Promise.all([
    validateBuildPackageJson(config, compilerCtx, buildCtx),
    validateManifestJson(config, compilerCtx, buildCtx),
  ]);
};

/**
 * Writes files to disk as a result of compilation
 * @param config the Stencil configuration used for the build
 * @param compilerCtx the compiler context associated with the build
 * @param buildCtx the build context associated with the current build
 */
const writeBuild = async (config, compilerCtx, buildCtx) => {
  const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
  let totalFilesWrote = 0;
  try {
    // commit all the writeFiles, mkdirs, rmdirs and unlinks to disk
    const commitResults = await compilerCtx.fs.commit();
    // get the results from the write to disk commit
    buildCtx.filesWritten = commitResults.filesWritten;
    buildCtx.filesDeleted = commitResults.filesDeleted;
    buildCtx.dirsDeleted = commitResults.dirsDeleted;
    buildCtx.dirsAdded = commitResults.dirsAdded;
    totalFilesWrote = commitResults.filesWritten.length;
    // successful write
    // kick off writing the cached file stuff
    buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
    await outputServiceWorkers(config, buildCtx);
    await validateBuildFiles(config, compilerCtx, buildCtx);
  }
  catch (e) {
    catchError(buildCtx.diagnostics, e);
  }
  timeSpan.finish(`writeBuildFiles finished, files wrote: ${totalFilesWrote}`);
};

const build = async (config, compilerCtx, buildCtx, tsBuilder) => {
  try {
    // reset process.cwd() for 3rd-party plugins
    process.chdir(config.rootDir);
    // empty the directories on the first build
    await emptyOutputTargets(config, compilerCtx, buildCtx);
    if (buildCtx.hasError)
      return buildAbort(buildCtx);
    if (config.srcIndexHtml) {
      const indexSrcHtml = await compilerCtx.fs.readFile(config.srcIndexHtml);
      if (isString$1(indexSrcHtml)) {
        buildCtx.indexDoc = createDocument(indexSrcHtml);
      }
    }
    await readPackageJson(config, compilerCtx, buildCtx);
    if (buildCtx.hasError)
      return buildAbort(buildCtx);
    // run typescript program
    const tsTimeSpan = buildCtx.createTimeSpan('transpile started');
    const componentDtsChanged = await runTsProgram(config, compilerCtx, buildCtx, tsBuilder);
    tsTimeSpan.finish('transpile finished');
    if (buildCtx.hasError)
      return buildAbort(buildCtx);
    if (config.watch && componentDtsChanged) {
      // silent abort for watch mode only
      return null;
    }
    // preprocess and generate styles before any outputTarget starts
    buildCtx.stylesPromise = generateGlobalStyles(config, compilerCtx, buildCtx);
    if (buildCtx.hasError)
      return buildAbort(buildCtx);
    // create outputs
    await generateOutputTargets(config, compilerCtx, buildCtx);
    if (buildCtx.hasError)
      return buildAbort(buildCtx);
    // write outputs
    await buildCtx.stylesPromise;
    await writeBuild(config, compilerCtx, buildCtx);
  }
  catch (e) {
    // ¯\_(ツ)_/¯
    catchError(buildCtx.diagnostics, e);
  }
  // TODO
  // clear changed files
  compilerCtx.changedFiles.clear();
  // return what we've learned today
  return buildFinish(buildCtx);
};

/**
 * Build a callable function to perform a full build of a Stencil project
 * @param config a Stencil configuration to apply to a full build of a Stencil project
 * @param compilerCtx the current Stencil compiler context
 * @returns the results of a full build of Stencil
 */
const createFullBuild = async (config, compilerCtx) => {
  return new Promise((resolve) => {
    let tsWatchProgram = null;
    compilerCtx.events.on('fileUpdate', (p) => {
      config.logger.debug(`fileUpdate: ${p}`);
      compilerCtx.fs.clearFileCache(p);
    });
    /**
     * A function that kicks off the transpilation process for both the TypeScript and Stencil compilers
     * @param tsBuilder the manager of the {@link ts.Program} state
     */
    const onBuild = async (tsBuilder) => {
      const buildCtx = new BuildContext(config, compilerCtx);
      buildCtx.isRebuild = false;
      buildCtx.requiresFullBuild = true;
      buildCtx.start();
      const result = await build(config, compilerCtx, buildCtx, tsBuilder);
      if (result !== null) {
        if (tsWatchProgram) {
          tsWatchProgram.close();
          tsWatchProgram = null;
        }
        resolve(result);
      }
    };
    createTsBuildProgram(config, onBuild).then((program) => {
      tsWatchProgram = program;
    });
  });
};

const compilerRequest = async (config, compilerCtx, data) => {
  const results = {
    path: data.path,
    nodeModuleId: null,
    nodeModuleVersion: null,
    nodeResolvedPath: null,
    cachePath: null,
    cacheHit: false,
    content: '',
    status: 404,
  };
  try {
    const parsedUrl = parseDevModuleUrl(config, data.path);
    Object.assign(results, parsedUrl);
    if (parsedUrl.nodeModuleId) {
      if (!parsedUrl.nodeModuleVersion) {
        results.content = `/* invalid module version */`;
        results.status = 400;
        return results;
      }
      if (!parsedUrl.nodeResolvedPath) {
        results.content = `/* invalid resolved path */`;
        results.status = 400;
        return results;
      }
      const useCache = await useDevModuleCache(config, parsedUrl.nodeResolvedPath);
      let cachePath = null;
      if (useCache) {
        cachePath = getDevModuleCachePath(config, parsedUrl);
        const cachedContent = await config.sys.readFile(cachePath);
        if (typeof cachedContent === 'string') {
          results.content = cachedContent;
          results.cachePath = cachePath;
          results.cacheHit = true;
          results.status = 200;
          return results;
        }
      }
      await bundleDevModule(config, compilerCtx, parsedUrl, results);
      if (results.status === 200 && useCache) {
        results.cachePath = cachePath;
        writeCachedFile(config, results);
      }
    }
    else {
      results.content = `/* invalid dev module */`;
      results.status = 400;
      return results;
    }
  }
  catch (e) {
    if (e) {
      if (e instanceof Error && e.stack) {
        results.content = `/*\n${e.stack}\n*/`;
      }
      else {
        results.content = `/*\n${e}\n*/`;
      }
    }
    results.status = 500;
  }
  return results;
};
const bundleDevModule = async (config, compilerCtx, parsedUrl, results) => {
  const buildCtx = new BuildContext(config, compilerCtx);
  try {
    const inputOpts = getRollupOptions(config, compilerCtx, buildCtx, {
      id: parsedUrl.nodeModuleId,
      platform: 'client',
      inputs: {
        index: parsedUrl.nodeResolvedPath,
      },
    });
    const rollupBuild = await rollup(inputOpts);
    const outputOpts = {
      banner: generatePreamble(config),
      format: 'es',
    };
    if (parsedUrl.nodeModuleId) {
      const commentPath = relative$1(config.rootDir, parsedUrl.nodeResolvedPath);
      outputOpts.intro = `/**\n * Dev Node Module: ${parsedUrl.nodeModuleId}, v${parsedUrl.nodeModuleVersion}\n * Entry: ${commentPath}\n * DEVELOPMENT PURPOSES ONLY!!\n */`;
      inputOpts.input = parsedUrl.nodeResolvedPath;
    }
    const r = await rollupBuild.generate(outputOpts);
    if (buildCtx.hasError) {
      results.status = 500;
      results.content = `console.error(${JSON.stringify(buildCtx.diagnostics)})`;
    }
    else if (r && r.output && r.output.length > 0) {
      results.content = r.output[0].code;
      results.status = 200;
    }
  }
  catch (e) {
    results.status = 500;
    const errorMsg = e instanceof Error ? e.stack : e + '';
    results.content = `console.error(${JSON.stringify(errorMsg)})`;
  }
};
const useDevModuleCache = async (config, p) => {
  if (config.enableCache) {
    for (let i = 0; i < 10; i++) {
      const n = basename(p);
      if (n === 'node_modules') {
        return true;
      }
      const isSymbolicLink = await config.sys.isSymbolicLink(p);
      if (isSymbolicLink) {
        return false;
      }
      p = dirname(p);
    }
  }
  return false;
};
const writeCachedFile = async (config, results) => {
  try {
    await config.sys.createDir(config.cacheDir);
    config.sys.writeFile(results.cachePath, results.content);
  }
  catch (e) {
    console.error(e);
  }
};
const parseDevModuleUrl = (config, u) => {
  const parsedUrl = {
    nodeModuleId: null,
    nodeModuleVersion: null,
    nodeResolvedPath: null,
  };
  if (u && u.includes(DEV_MODULE_DIR) && u.endsWith('.js')) {
    const url = new URL(u, 'https://stenciljs.com');
    let reqPath = basename(url.pathname);
    reqPath = reqPath.substring(0, reqPath.length - 3);
    const splt = reqPath.split('@');
    if (splt.length === 2) {
      parsedUrl.nodeModuleId = decodeURIComponent(splt[0]);
      parsedUrl.nodeModuleVersion = decodeURIComponent(splt[1]);
      parsedUrl.nodeResolvedPath = url.searchParams.get('p');
      if (parsedUrl.nodeResolvedPath) {
        parsedUrl.nodeResolvedPath = decodeURIComponent(parsedUrl.nodeResolvedPath);
        parsedUrl.nodeResolvedPath = join(config.rootDir, parsedUrl.nodeResolvedPath);
      }
    }
  }
  return parsedUrl;
};
const getDevModuleCachePath = (config, parsedUrl) => {
  return join(config.cacheDir, `dev_module_${parsedUrl.nodeModuleId}_${parsedUrl.nodeModuleVersion}_${DEV_MODULE_CACHE_BUSTER}.log`);
};

const filesChanged = (buildCtx) => {
  // files changed include updated, added and deleted
  return unique([...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.filesDeleted]).sort();
};
/**
 * Unary helper function mapping string to string and wrapping `basename`,
 * which normally takes two string arguments. This means it cannot be passed
 * to `Array.prototype.map`, but this little helper can!
 *
 * @param filePath a filepath to check out
 * @returns the basename for that filepath
 */
const unaryBasename = (filePath) => basename(filePath);
/**
 * Get the file extension for a path
 *
 * @param filePath a path
 * @returns the file extension (well, characters after the last `'.'`)
 */
const getExt = (filePath) => filePath.split('.').pop().toLowerCase();
/**
 * Script extensions which we want to be able to recognize
 */
const SCRIPT_EXT = ['ts', 'tsx', 'js', 'jsx'];
/**
 * Helper to check if a filepath has a script extension
 *
 * @param filePath a file extension
 * @returns whether the filepath has a script extension or not
 */
const hasScriptExt = (filePath) => SCRIPT_EXT.includes(getExt(filePath));
const STYLE_EXT = ['css', 'scss', 'sass', 'pcss', 'styl', 'stylus', 'less'];
/**
 * Helper to check if a filepath has a style extension
 *
 * @param filePath a file extension to check
 * @returns whether the filepath has a style extension or not
 */
const hasStyleExt = (filePath) => STYLE_EXT.includes(getExt(filePath));
/**
 * Get all scripts from a build context that were added
 *
 * @param buildCtx the build context
 * @returns an array of filepaths that were added
 */
const scriptsAdded = (buildCtx) => buildCtx.filesAdded.filter(hasScriptExt).map(unaryBasename);
/**
 * Get all scripts from a build context that were deleted
 *
 * @param buildCtx the build context
 * @returns an array of deleted filepaths
 */
const scriptsDeleted = (buildCtx) => buildCtx.filesDeleted.filter(hasScriptExt).map(unaryBasename);
/**
 * Check whether a build has script changes
 *
 * @param buildCtx the build context
 * @returns whether or not there are script changes
 */
const hasScriptChanges = (buildCtx) => buildCtx.filesChanged.some(hasScriptExt);
/**
 * Check whether a build has style changes
 *
 * @param buildCtx the build context
 * @returns whether or not there are style changes
 */
const hasStyleChanges = (buildCtx) => buildCtx.filesChanged.some(hasStyleExt);
/**
 * Check whether a build has html changes
 *
 * @param config the current config
 * @param buildCtx the build context
 * @returns whether or not HTML files were changed
 */
const hasHtmlChanges = (config, buildCtx) => {
  const anyHtmlChanged = buildCtx.filesChanged.some((f) => f.toLowerCase().endsWith('.html'));
  if (anyHtmlChanged) {
    // any *.html in any directory that changes counts and rebuilds
    return true;
  }
  const srcIndexHtmlChanged = buildCtx.filesChanged.some((fileChanged) => {
    // the src index index.html file has changed
    // this file name could be something other than index.html
    return fileChanged === config.srcIndexHtml;
  });
  return srcIndexHtmlChanged;
};
const isWatchIgnorePath = (config, path) => {
  if (isString$1(path)) {
    const isWatchIgnore = config.watchIgnoredRegex.some((reg) => reg.test(path));
    if (isWatchIgnore) {
      return true;
    }
    const outputTargets = config.outputTargets;
    const ignoreFiles = [
      ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.file),
      ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.typesFile),
      ...outputTargets.filter(isOutputTargetStats).map((o) => o.file),
      ...outputTargets.filter(isOutputTargetDocsVscode).map((o) => o.file),
    ];
    if (ignoreFiles.includes(path)) {
      return true;
    }
  }
  return false;
};

const createTsWatchProgram = async (config, buildCallback) => {
  let isRunning = false;
  let lastTsBuilder;
  let timeoutId;
  let rebuildTimer;
  const optionsToExtend = getTsOptionsToExtend(config);
  const tsWatchSys = {
    ...t.sys,
    setTimeout(callback, time) {
      clearInterval(rebuildTimer);
      const t = (timeoutId = setInterval(() => {
        if (!isRunning) {
          callback();
          clearInterval(t);
          timeoutId = rebuildTimer = null;
        }
      }, config.sys.watchTimeout || time));
      return t;
    },
    clearTimeout(id) {
      return clearInterval(id);
    },
  };
  config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId));
  const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
    config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
  }, (reportWatchStatus) => {
    config.logger.debug(reportWatchStatus.messageText);
  });
  tsWatchHost.afterProgramCreate = async (tsBuilder) => {
    lastTsBuilder = tsBuilder;
    isRunning = true;
    await buildCallback(tsBuilder);
    isRunning = false;
  };
  return {
    program: t.createWatchProgram(tsWatchHost),
    rebuild: () => {
      if (lastTsBuilder && !timeoutId) {
        rebuildTimer = tsWatchSys.setTimeout(() => tsWatchHost.afterProgramCreate(lastTsBuilder), 300);
      }
    },
  };
};

const createWatchBuild = async (config, compilerCtx) => {
  let isRebuild = false;
  let tsWatchProgram;
  let closeResolver;
  const watchWaiter = new Promise((resolve) => (closeResolver = resolve));
  const dirsAdded = new Set();
  const dirsDeleted = new Set();
  const filesAdded = new Set();
  const filesUpdated = new Set();
  const filesDeleted = new Set();
  const onBuild = async (tsBuilder) => {
    const buildCtx = new BuildContext(config, compilerCtx);
    buildCtx.isRebuild = isRebuild;
    buildCtx.requiresFullBuild = !isRebuild;
    buildCtx.dirsAdded = Array.from(dirsAdded.keys()).sort();
    buildCtx.dirsDeleted = Array.from(dirsDeleted.keys()).sort();
    buildCtx.filesAdded = Array.from(filesAdded.keys()).sort();
    buildCtx.filesUpdated = Array.from(filesUpdated.keys()).sort();
    buildCtx.filesDeleted = Array.from(filesDeleted.keys()).sort();
    buildCtx.filesChanged = filesChanged(buildCtx);
    buildCtx.scriptsAdded = scriptsAdded(buildCtx);
    buildCtx.scriptsDeleted = scriptsDeleted(buildCtx);
    buildCtx.hasScriptChanges = hasScriptChanges(buildCtx);
    buildCtx.hasStyleChanges = hasStyleChanges(buildCtx);
    buildCtx.hasHtmlChanges = hasHtmlChanges(config, buildCtx);
    buildCtx.hasServiceWorkerChanges = hasServiceWorkerChanges(config, buildCtx);
    dirsAdded.clear();
    dirsDeleted.clear();
    filesAdded.clear();
    filesUpdated.clear();
    filesDeleted.clear();
    emitFsChange(compilerCtx, buildCtx);
    buildCtx.start();
    const result = await build(config, compilerCtx, buildCtx, tsBuilder);
    if (result && !result.hasError) {
      isRebuild = true;
    }
  };
  const start = async () => {
    const srcRead = watchSrcDirectory(config, compilerCtx);
    const otherRead = watchRootFiles(config, compilerCtx);
    await srcRead;
    await otherRead;
    tsWatchProgram = await createTsWatchProgram(config, onBuild);
    return watchWaiter;
  };
  const watchingDirs = new Map();
  const watchingFiles = new Map();
  const onFsChange = (p, eventKind) => {
    if (tsWatchProgram && !isWatchIgnorePath(config, p)) {
      updateCompilerCtxCache(config, compilerCtx, p, eventKind);
      switch (eventKind) {
        case 'dirAdd':
          dirsAdded.add(p);
          break;
        case 'dirDelete':
          dirsDeleted.add(p);
          break;
        case 'fileAdd':
          filesAdded.add(p);
          break;
        case 'fileUpdate':
          filesUpdated.add(p);
          break;
        case 'fileDelete':
          filesDeleted.add(p);
          break;
      }
      config.logger.debug(`onFsChange ${eventKind}: ${p}`);
      tsWatchProgram.rebuild();
    }
  };
  const onDirChange = (p, eventKind) => {
    if (eventKind != null) {
      onFsChange(p, eventKind);
    }
  };
  const close = async () => {
    watchingDirs.forEach((w) => w.close());
    watchingFiles.forEach((w) => w.close());
    watchingDirs.clear();
    watchingFiles.clear();
    if (tsWatchProgram) {
      tsWatchProgram.program.close();
      tsWatchProgram = null;
    }
    const watcherCloseResults = {
      exitCode: 0,
    };
    closeResolver(watcherCloseResults);
    return watcherCloseResults;
  };
  const request = async (data) => compilerRequest(config, compilerCtx, data);
  compilerCtx.addWatchFile = (filePath) => {
    if (isString$1(filePath) && !watchingFiles.has(filePath) && !isWatchIgnorePath(config, filePath)) {
      watchingFiles.set(filePath, config.sys.watchFile(filePath, onFsChange));
    }
  };
  compilerCtx.addWatchDir = (dirPath, recursive) => {
    if (isString$1(dirPath) && !watchingDirs.has(dirPath) && !isWatchIgnorePath(config, dirPath)) {
      watchingDirs.set(dirPath, config.sys.watchDirectory(dirPath, onDirChange, recursive));
    }
  };
  config.sys.addDestory(close);
  return {
    start,
    close,
    on: compilerCtx.events.on,
    request,
  };
};
const watchSrcDirectory = async (config, compilerCtx) => {
  const srcFiles = await compilerCtx.fs.readdir(config.srcDir, {
    recursive: true,
    excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
    excludeExtensions: [
      '.md',
      '.markdown',
      '.txt',
      '.spec.ts',
      '.spec.tsx',
      '.e2e.ts',
      '.e2e.tsx',
      '.gitignore',
      '.editorconfig',
    ],
  });
  srcFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
  compilerCtx.addWatchDir(config.srcDir, true);
};
const watchRootFiles = async (config, compilerCtx) => {
  // non-src files that cause a rebuild
  // mainly for root level config files, and getting an event when they change
  const rootFiles = await compilerCtx.fs.readdir(config.rootDir, {
    recursive: false,
    excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
  });
  rootFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
};
const emitFsChange = (compilerCtx, buildCtx) => {
  if (buildCtx.dirsAdded.length > 0 ||
    buildCtx.dirsDeleted.length > 0 ||
    buildCtx.filesUpdated.length > 0 ||
    buildCtx.filesAdded.length > 0 ||
    buildCtx.filesDeleted.length > 0) {
    compilerCtx.events.emit('fsChange', {
      dirsAdded: buildCtx.dirsAdded.slice(),
      dirsDeleted: buildCtx.dirsDeleted.slice(),
      filesUpdated: buildCtx.filesUpdated.slice(),
      filesAdded: buildCtx.filesAdded.slice(),
      filesDeleted: buildCtx.filesDeleted.slice(),
    });
  }
};
const updateCompilerCtxCache = (config, compilerCtx, path, kind) => {
  compilerCtx.fs.clearFileCache(path);
  compilerCtx.changedFiles.add(path);
  if (kind === 'fileDelete') {
    compilerCtx.moduleMap.delete(path);
  }
  else if (kind === 'dirDelete') {
    const fsRootDir = resolve$3('/');
    compilerCtx.moduleMap.forEach((_, moduleFilePath) => {
      let moduleAncestorDir = dirname(moduleFilePath);
      for (let i = 0; i < 50; i++) {
        if (moduleAncestorDir === config.rootDir || moduleAncestorDir === fsRootDir) {
          break;
        }
        if (moduleAncestorDir === path) {
          compilerCtx.fs.clearFileCache(moduleFilePath);
          compilerCtx.moduleMap.delete(moduleFilePath);
          compilerCtx.changedFiles.add(moduleFilePath);
          break;
        }
        moduleAncestorDir = dirname(moduleAncestorDir);
      }
    });
  }
};

class Cache {
  constructor(config, cacheFs) {
    this.config = config;
    this.cacheFs = cacheFs;
    this.failed = 0;
    this.skip = false;
    this.sys = config.sys;
    this.logger = config.logger;
  }
  async initCacheDir() {
    if (this.config._isTesting || !this.config.cacheDir) {
      return;
    }
    if (!this.config.enableCache || !this.cacheFs) {
      this.config.logger.info(`cache optimizations disabled`);
      this.clearDiskCache();
      return;
    }
    this.config.logger.debug(`cache enabled, cacheDir: ${this.config.cacheDir}`);
    try {
      const readmeFilePath = join(this.config.cacheDir, '_README.log');
      await this.cacheFs.writeFile(readmeFilePath, CACHE_DIR_README);
    }
    catch (e) {
      this.logger.error(`Cache, initCacheDir: ${e}`);
      this.config.enableCache = false;
    }
  }
  async get(key) {
    if (!this.config.enableCache || this.skip) {
      return null;
    }
    if (this.failed >= MAX_FAILED) {
      if (!this.skip) {
        this.skip = true;
        this.logger.debug(`cache had ${this.failed} failed ops, skip disk ops for remander of build`);
      }
      return null;
    }
    let result;
    try {
      result = await this.cacheFs.readFile(this.getCacheFilePath(key));
      this.failed = 0;
      this.skip = false;
    }
    catch (e) {
      this.failed++;
      result = null;
    }
    return result;
  }
  async put(key, value) {
    if (!this.config.enableCache) {
      return false;
    }
    let result;
    try {
      await this.cacheFs.writeFile(this.getCacheFilePath(key), value);
      result = true;
    }
    catch (e) {
      this.failed++;
      result = false;
    }
    return result;
  }
  async has(key) {
    const val = await this.get(key);
    return typeof val === 'string';
  }
  async createKey(domain, ...args) {
    if (!this.config.enableCache) {
      return domain + Math.random() * 9999999;
    }
    const hash = await this.sys.generateContentHash(JSON.stringify(args), 32);
    return domain + '_' + hash;
  }
  async commit() {
    if (this.config.enableCache) {
      this.skip = false;
      this.failed = 0;
      await this.cacheFs.commit();
      await this.clearExpiredCache();
    }
  }
  clear() {
    if (this.cacheFs != null) {
      this.cacheFs.clearCache();
    }
  }
  async clearExpiredCache() {
    if (this.cacheFs == null || this.sys.cacheStorage == null) {
      return;
    }
    const now = Date.now();
    const lastClear = (await this.sys.cacheStorage.get(EXP_STORAGE_KEY));
    if (lastClear != null) {
      const diff = now - lastClear;
      if (diff < ONE_DAY) {
        return;
      }
      const fs = this.cacheFs.sys;
      const cachedFileNames = await fs.readDir(this.config.cacheDir);
      const cachedFilePaths = cachedFileNames.map((f) => join(this.config.cacheDir, f));
      let totalCleared = 0;
      const promises = cachedFilePaths.map(async (filePath) => {
        const stat = await fs.stat(filePath);
        const lastModified = stat.mtimeMs;
        const diff = now - lastModified;
        if (diff > ONE_WEEK) {
          await fs.removeFile(filePath);
          totalCleared++;
        }
      });
      await Promise.all(promises);
      this.logger.debug(`clearExpiredCache, cachedFileNames: ${cachedFileNames.length}, totalCleared: ${totalCleared}`);
    }
    this.logger.debug(`clearExpiredCache, set last clear`);
    await this.sys.cacheStorage.set(EXP_STORAGE_KEY, now);
  }
  async clearDiskCache() {
    if (this.cacheFs != null) {
      const hasAccess = await this.cacheFs.access(this.config.cacheDir);
      if (hasAccess) {
        await this.cacheFs.remove(this.config.cacheDir);
        await this.cacheFs.commit();
      }
    }
  }
  getCacheFilePath(key) {
    return join(this.config.cacheDir, key) + '.log';
  }
  getMemoryStats() {
    if (this.cacheFs != null) {
      return this.cacheFs.getMemoryStats();
    }
    return null;
  }
}
const MAX_FAILED = 100;
const ONE_DAY = 1000 * 60 * 60 * 24;
const ONE_WEEK = ONE_DAY * 7;
const EXP_STORAGE_KEY = `last_clear_expired_cache`;
const CACHE_DIR_README = `# Stencil Cache Directory

This directory contains files which the compiler has
cached for faster builds. To disable caching, please set
"enableCache: false" within the stencil config.

To change the cache directory, please update the
"cacheDir" property within the stencil config.
`;

/**
 * All the Boolean options supported by the Stencil CLI
 */
/**
 * Helper function for initializing a `ConfigFlags` object. Provide any overrides
 * for default values and off you go!
 *
 * @param init an object with any overrides for default values
 * @returns a complete CLI flag object
 */
const createConfigFlags = (init = {}) => {
  const flags = {
    task: null,
    args: [],
    knownArgs: [],
    unknownArgs: [],
    ...init,
  };
  return flags;
};

const getConfig = (userConfig) => {
  var _a, _b, _c, _d, _e;
  const logger = (_a = userConfig.logger) !== null && _a !== void 0 ? _a : createLogger();
  const config = {
    ...userConfig,
    flags: createConfigFlags((_b = userConfig.flags) !== null && _b !== void 0 ? _b : {}),
    logger,
    outputTargets: (_c = userConfig.outputTargets) !== null && _c !== void 0 ? _c : [],
    rootDir: (_d = userConfig.rootDir) !== null && _d !== void 0 ? _d : '/',
    sys: (_e = userConfig.sys) !== null && _e !== void 0 ? _e : createSystem({ logger }),
    testing: userConfig !== null && userConfig !== void 0 ? userConfig : {},
  };
  setPlatformPath(config.sys.platformPath);
  if (config.flags.debug || config.flags.verbose) {
    config.logLevel = 'debug';
  }
  else if (config.flags.logLevel) {
    config.logLevel = config.flags.logLevel;
  }
  else if (typeof config.logLevel !== 'string') {
    config.logLevel = 'info';
  }
  config.logger.setLevel(config.logLevel);
  return config;
};

const patchFs = (userSys) => {
  const fsObj = fs$3;
  Object.assign(fsObj.__sys, userSys);
};

/**
 * Create an in-memory FS which proxies the underlying OS filesystem using an
 * in-memory cache. FS writes can accumulate on the in-memory system, using an
 * API similar to Node.js' `"fs"` module, and then be committed to disk as a
 * unit.
 *
 * Files written to the in-memory system can be edited, deleted, and so on.
 * This allows the compiler to proceed freely as if it is modifying the
 * filesystem, modifying the world in whatever way suits it, while deferring
 * actual FS writes until the end of the compilation process, making actual
 * changes to the filesystem on disk contingent on an error-free build or any
 * other condition.
 *
 * @param sys a compiler system object
 * @returns an in-memory filesystem interface
 */
const createInMemoryFs = (sys) => {
  /**
   * Map to hold the items in the in-memory cache which proxies the underlying
   * OS filesystem.
   */
  const items = new Map();
  const outputTargetTypes = new Map();
  /**
   * Check if a file exists at a provided path. This function will attempt to
   * use the in-memory cache before performing a blocking read. In the event of
   * a cache hit, the content from the cache will be returned and the read skipped.
   *
   * @param filePath the path to the file to read
   * @returns `true` if the file exists, `false` otherwise
   */
  const access = async (filePath) => {
    const item = getItem(filePath);
    if (typeof item.exists !== 'boolean') {
      const stats = await stat(filePath);
      return stats.exists;
    }
    return item.exists;
  };
  /**
   * **Synchronous!!! Do not use!!!**
   * (Only typescript transpiling is allowed to use)
   *
   * Synchronously get information about a file from a provided path. This
   * function will attempt to use an in-memory cache before performing a
   * blocking read.
   *
   * In the event of a cache hit, the content from the cache will be returned
   * and skip the read.
   *
   * @param filePath the path to the file to read
   * @returns `true` if the file exists, `false` otherwise
   */
  const accessSync = (filePath) => {
    const item = getItem(filePath);
    if (typeof item.exists !== 'boolean') {
      const stats = statSync(filePath);
      return stats.exists;
    }
    return item.exists;
  };
  /**
   * Copy a file from `src` to `dest`. Note that this merely queues the file
   * for copying, the copy isn't actually committed.
   *
   * @param src the path to the source file
   * @param dest the destination the source file should be copied to
   */
  const copyFile = async (src, dest) => {
    const item = getItem(src);
    item.queueCopyFileToDest = dest;
  };
  /**
   * Empty a series of directories of their contents
   *
   * @param dirs a set of directories to empty
   * @returns an empty Promise
   */
  const emptyDirs = async (dirs) => {
    dirs = dirs
      .filter(isString$1)
      .map(normalizePath$2)
      .reduce((dirs, dir) => {
      if (!dirs.includes(dir)) {
        dirs.push(dir);
      }
      return dirs;
    }, []);
    const allFsItems = await Promise.all(dirs.map((dir) => readdir(dir, { recursive: true })));
    const reducedItems = [];
    for (const fsItems of allFsItems) {
      for (const f of fsItems) {
        if (!reducedItems.includes(f.absPath)) {
          reducedItems.push(f.absPath);
        }
      }
    }
    reducedItems.sort((a, b) => {
      const partsA = a.split('/').length;
      const partsB = b.split('/').length;
      if (partsA < partsB)
        return 1;
      if (partsA > partsB)
        return -1;
      return 0;
    });
    await Promise.all(reducedItems.map(removeItem));
    dirs.forEach((dir) => {
      const item = getItem(dir);
      item.isFile = false;
      item.isDirectory = true;
      item.queueWriteToDisk = true;
      item.queueDeleteFromDisk = false;
    });
  };
  /**
   * Get the contents of a directory on the in-memory filesystem
   *
   * @param dirPath the path to the directory of interest
   * @param opts an optional object containing configuration options
   * @returns a Promise wrapping a list of directory contents
   */
  const readdir = async (dirPath, opts = {}) => {
    dirPath = normalizePath$2(dirPath);
    const collectedPaths = [];
    if (opts.inMemoryOnly === true) {
      let inMemoryDir = dirPath;
      if (!inMemoryDir.endsWith('/')) {
        inMemoryDir += '/';
      }
      const inMemoryDirs = dirPath.split('/');
      items.forEach((dir, filePath) => {
        if (!filePath.startsWith(dirPath)) {
          return;
        }
        const parts = filePath.split('/');
        if (parts.length === inMemoryDirs.length + 1 || (opts.recursive && parts.length > inMemoryDirs.length)) {
          if (dir.exists) {
            const item = {
              absPath: filePath,
              relPath: parts[inMemoryDirs.length],
              isDirectory: dir.isDirectory,
              isFile: dir.isFile,
            };
            if (!shouldExcludeFromReaddir(opts, item)) {
              collectedPaths.push(item);
            }
          }
        }
      });
    }
    else {
      // always a disk read
      await readDirectory(dirPath, dirPath, opts, collectedPaths);
    }
    return collectedPaths.sort((a, b) => {
      if (a.absPath < b.absPath)
        return -1;
      if (a.absPath > b.absPath)
        return 1;
      return 0;
    });
  };
  /**
   * A directory read function which _always_ reads from the disk and so is
   * only used internally.
   *
   * @param initPath an initial path used for computing relative paths
   * @param dirPath the path of the directory to look at
   * @param opts options for read operations
   * @param collectedPaths an out param to which directory entries will be
   * added
   */
  const readDirectory = async (initPath, dirPath, opts, collectedPaths) => {
    // used internally only so we could easily recursively drill down
    // loop through this directory and sub directories
    // always a disk read!!removeDir
    const dirItems = await sys.readDir(dirPath);
    if (dirItems.length > 0) {
      // cache some facts about this path
      const item = getItem(dirPath);
      item.exists = true;
      item.isFile = false;
      item.isDirectory = true;
      await Promise.all(dirItems.map(async (dirItem) => {
        // let's loop through each of the files we've found so far
        // create an absolute path of the item inside of this directory
        const absPath = normalizePath$2(dirItem);
        const relPath = normalizePath$2(relative$1(initPath, absPath));
        // get the fs stats for the item, could be either a file or directory
        const stats = await stat(absPath);
        const childItem = {
          absPath: absPath,
          relPath: relPath,
          isDirectory: stats.isDirectory,
          isFile: stats.isFile,
        };
        if (shouldExcludeFromReaddir(opts, childItem)) {
          return;
        }
        collectedPaths.push(childItem);
        if (opts.recursive === true && stats.isDirectory === true) {
          // looks like it's yet another directory
          // let's keep drilling down
          await readDirectory(initPath, absPath, opts, collectedPaths);
        }
      }));
    }
  };
  /**
   * Check whether a given item should be excluded from readdir results
   *
   * @param opts options for fs read operations
   * @param item the item in question
   * @returns whether the item should be excluded or not
   */
  const shouldExcludeFromReaddir = (opts, item) => {
    if (item.isDirectory) {
      if (Array.isArray(opts.excludeDirNames)) {
        const base = basename(item.absPath);
        if (opts.excludeDirNames.some((dir) => base === dir)) {
          return true;
        }
      }
    }
    else {
      if (Array.isArray(opts.excludeExtensions)) {
        const p = item.relPath.toLowerCase();
        if (opts.excludeExtensions.some((ext) => p.endsWith(ext))) {
          return true;
        }
      }
    }
    return false;
  };
  /**
   * Read a file on the in-memory filesystem. By default, this will look at
   * the in-memory FS proxy first and then, if nothing is found at the provided
   * path, it will then look at the real FS.
   *
   * This behavior can be disabled by setting the `useCache` option to `false`
   * on the provided options object. When this option is set the actual FS will
   * be checked directly without looking at the in-memory FS first.
   *
   * @param filePath the filepath of interest
   * @param opts an optional object containing options for reading files
   * @returns a promise wrapping either the contents of the file (if found) or
   * undefined if it's not found
   */
  const readFile = async (filePath, opts) => {
    // default to looking at the in-memory FS first (we will only *not* do
    // so if `opts.useCache === false`)
    if (opts == null || opts.useCache === true || opts.useCache === undefined) {
      const item = getItem(filePath);
      if (item.exists && typeof item.fileText === 'string') {
        return item.fileText;
      }
    }
    const fileText = await sys.readFile(filePath);
    const item = getItem(filePath);
    if (typeof fileText === 'string') {
      if (fileText.length < MAX_TEXT_CACHE) {
        item.exists = true;
        item.isFile = true;
        item.isDirectory = false;
        item.fileText = fileText;
      }
    }
    else {
      item.exists = false;
    }
    return fileText;
  };
  /**
   * **Synchronous!!! Do not use!!!**
   * (Only typescript transpiling is allowed to use)
   *
   * Synchronously read a file from a provided path. This function will attempt
   * to use an in-memory cache before performing a blocking read in the
   * following circumstances:
   *
   * - no `opts` are provided
   * - the `useCache` member on `opts` is set to `true`, or is not set
   *
   * In the event of a cache hit, the content from the cache will be returned
   * and skip the read.
   *
   * @param filePath the path to the file to read
   * @param opts a configuration to use when reading a file
   * @returns the contents of the file (read from either disk or the cache).
   */
  const readFileSync = (filePath, opts) => {
    if (opts == null || opts.useCache === true || opts.useCache === undefined) {
      const item = getItem(filePath);
      if (item.exists && typeof item.fileText === 'string') {
        return item.fileText;
      }
    }
    const fileText = sys.readFileSync(filePath);
    const item = getItem(filePath);
    if (typeof fileText === 'string') {
      if (fileText.length < MAX_TEXT_CACHE) {
        item.exists = true;
        item.isFile = true;
        item.isDirectory = false;
        item.fileText = fileText;
      }
    }
    else {
      item.exists = false;
    }
    return fileText;
  };
  /**
   * Remove an item from the in-memory FS
   *
   * This is done by marking it for deletion. The item will remain in memory
   * until the queued changes are committed. This function handles both files
   * and directories.
   *
   * @param itemPath the path to the item to be deleted
   * @returns an empty promise
   */
  const remove = async (itemPath) => {
    const stats = await stat(itemPath);
    if (stats.isDirectory === true) {
      await removeDir(itemPath);
    }
    else if (stats.isFile === true) {
      await removeItem(itemPath);
    }
  };
  /**
   * Remove an item from the in-memory FS by marking it to be deleted
   *
   * @param dirPath the path to the item to be deleted
   * @returns an empty promise
   */
  const removeDir = async (dirPath) => {
    const item = getItem(dirPath);
    item.isFile = false;
    item.isDirectory = true;
    if (!item.queueWriteToDisk) {
      item.queueDeleteFromDisk = true;
    }
    try {
      const dirItems = await readdir(dirPath, { recursive: true });
      await Promise.all(dirItems.map((item) => {
        if (item.relPath.endsWith('.gitkeep')) {
          return null;
        }
        return removeItem(item.absPath);
      }));
    }
    catch (e) {
      // do not throw error if the directory never existed
    }
  };
  /**
   * Remove an item from the in-memory FS by marking it to be deleted
   *
   * @param filePath the path to the item to be deleted
   * @returns an empty promise
   */
  const removeItem = async (filePath) => {
    const item = getItem(filePath);
    if (!item.queueWriteToDisk) {
      item.queueDeleteFromDisk = true;
    }
  };
  /**
   * Get statistics and information about a filepath in the in-memory FS.
   *
   * This function is fairly similar to the `stat` function in node's
   * `fs` module. If an item exists at the path in question this will return
   * information including whether it's a file or a directory, filesize, etc.
   * If it does not exist the `exists` property will be set accordingly.
   *
   * @param itemPath the path to the item in question
   * @returns a Promise wrapping an object with information about the item
   */
  const stat = async (itemPath) => {
    const item = getItem(itemPath);
    if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
      const stat = await sys.stat(itemPath);
      if (!stat.error) {
        item.exists = true;
        if (stat.isFile) {
          item.isFile = true;
          item.isDirectory = false;
          item.size = stat.size;
        }
        else if (stat.isDirectory) {
          item.isFile = false;
          item.isDirectory = true;
          item.size = stat.size;
        }
        else {
          item.isFile = false;
          item.isDirectory = false;
          item.size = null;
        }
      }
      else {
        item.exists = false;
      }
    }
    return {
      exists: !!item.exists,
      isFile: !!item.isFile,
      isDirectory: !!item.isDirectory,
      size: typeof item.size === 'number' ? item.size : 0,
    };
  };
  /**
   * **Synchronous!!! Do not use!!!**
   * (Only typescript transpiling is allowed to use)
   *
   * Searches an in-memory cache for an item at the provided path. Always
   * returns an object, **does not throw errors**.
   *
   * @param itemPath the path to the file to read
   * @returns an object describing the item found at the provided `itemPath`
   */
  const statSync = (itemPath) => {
    const item = getItem(itemPath);
    if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
      const stat = sys.statSync(itemPath);
      if (!stat.error) {
        item.exists = true;
        if (stat.isFile) {
          item.isFile = true;
          item.isDirectory = false;
          item.size = stat.size;
        }
        else if (stat.isDirectory) {
          item.isFile = false;
          item.isDirectory = true;
          item.size = stat.size;
        }
        else {
          item.isFile = false;
          item.isDirectory = false;
          item.size = null;
        }
      }
      else {
        item.exists = false;
      }
    }
    return {
      exists: !!item.exists,
      isFile: !!item.isFile,
      isDirectory: !!item.isDirectory,
      size: item.size,
    };
  };
  /**
   * Write a file to the in-memory filesystem. The behavior of this function
   * can be modified in several ways by passing different parameters in the
   * options object.
   *
   * Supported options and their effects:
   *
   * - `useCache`: specify that the cache should be used
   * - `inMemoryOnly`: only use the in-memory cache and do not write the file
   *   to disk
   * - `immediateWrite`: flush the write to disk immediately, skipping the
   *   in-memory cache
   *
   * This function will additionally check before it writes anything to disk
   * to see if the content to be written is different than what already exists
   * on disk.
   *
   * @param filePath the filePath to write to
   * @param content what to write!
   * @param opts an optional object which controls how the file is written
   * @return a Promise wrapping a write result object
   */
  const writeFile = async (filePath, content, opts) => {
    if (typeof filePath !== 'string') {
      throw new Error(`writeFile, invalid filePath: ${filePath}`);
    }
    if (typeof content !== 'string') {
      throw new Error(`writeFile, invalid content: ${filePath}`);
    }
    const results = {
      ignored: false,
      changedContent: false,
      queuedWrite: false,
    };
    if (shouldIgnore(filePath) === true) {
      results.ignored = true;
      return results;
    }
    const item = getItem(filePath);
    item.exists = true;
    item.isFile = true;
    item.isDirectory = false;
    item.queueDeleteFromDisk = false;
    if (typeof item.fileText === 'string') {
      // compare strings but replace Windows CR to rule out any
      // insignificant new line differences
      results.changedContent = item.fileText.replace(/\r/g, '') !== content.replace(/\r/g, '');
    }
    else {
      results.changedContent = true;
    }
    item.fileText = content;
    results.queuedWrite = false;
    if (opts != null) {
      if (typeof opts.outputTargetType === 'string') {
        outputTargetTypes.set(filePath, opts.outputTargetType);
      }
      if (opts.useCache === false) {
        item.useCache = false;
      }
    }
    if (opts != null && opts.inMemoryOnly === true) {
      // we don't want to actually write this to disk
      // just keep it in memory
      if (item.queueWriteToDisk) {
        // we already queued this file to write to disk
        // in that case we still need to do it
        results.queuedWrite = true;
      }
      else {
        // we only want this in memory and
        // it wasn't already queued to be written
        item.queueWriteToDisk = false;
      }
      // ensure in-memory directories are created
      await ensureDir(filePath, true);
    }
    else if (opts != null && opts.immediateWrite === true) {
      // if this is an immediate write then write the file
      // now and do not add it to the queue
      if (results.changedContent || opts.useCache !== true) {
        // writing the file to disk is a big deal and kicks off fs watchers
        // so let's just double check that the file is actually different first
        const existingFile = await sys.readFile(filePath);
        if (typeof existingFile === 'string') {
          results.changedContent = item.fileText.replace(/\r/g, '') !== existingFile.replace(/\r/g, '');
        }
        if (results.changedContent) {
          await ensureDir(filePath, false);
          await sys.writeFile(filePath, item.fileText);
        }
      }
    }
    else {
      // we want to write this to disk (eventually)
      // but only if the content is different
      // from our existing cached content
      if (!item.queueWriteToDisk && results.changedContent === true) {
        // not already queued to be written
        // and the content is different
        item.queueWriteToDisk = true;
        results.queuedWrite = true;
      }
    }
    return results;
  };
  /**
   * Write a series of files to the in-memory filesystem
   *
   * @param files a data structure mapping filepath -> content
   * @param opts an optional set of options passed to `writeFile`
   * @returns a Promise wrapping all write result objects for all the files
   */
  const writeFiles = (files, opts) => {
    const writes = [];
    if (isIterable(files)) {
      files.forEach((content, filePath) => {
        writes.push(writeFile(filePath, content, opts));
      });
    }
    else {
      Object.keys(files).map((filePath) => {
        writes.push(writeFile(filePath, files[filePath], opts));
      });
    }
    return Promise.all(writes);
  };
  /**
   * Commit all pending FS operations to disk
   *
   * FS operations like writes, copies, and deletes which are done to the
   * in-memory FS are deferred and only recorded in the in-memory cache. This
   * method takes all of the deferred FS actions and commits them to the FS,
   * writing and copying files, creating directories, etc.
   *
   * @returns a Promise wrapping a summary of what was done
   */
  const commit = async () => {
    const instructions = getCommitInstructions(items);
    // ensure directories we need exist
    const dirsAdded = await commitEnsureDirs(instructions.dirsToEnsure, false);
    // write all queued the files
    const filesWritten = await commitWriteFiles(instructions.filesToWrite);
    // write all queued the files to copy
    const filesCopied = await commitCopyFiles(instructions.filesToCopy);
    // remove all the queued files to be deleted
    const filesDeleted = await commitDeleteFiles(instructions.filesToDelete);
    // remove all the queued dirs to be deleted
    const dirsDeleted = await commitDeleteDirs(instructions.dirsToDelete);
    instructions.filesToDelete.forEach(clearFileCache);
    instructions.dirsToDelete.forEach(clearDirCache);
    // return only the files that were
    return {
      filesCopied,
      filesWritten,
      filesDeleted,
      dirsDeleted,
      dirsAdded,
    };
  };
  /**
   * Ensure that a directory exists
   *
   * @param path the path to ensure exists
   * @param inMemoryOnly don't commit any changes to the filesystem, instead
   * only change the in-memory cache
   */
  const ensureDir = async (path, inMemoryOnly) => {
    const allDirs = [];
    while (true) {
      path = dirname(path);
      if (typeof path === 'string' &&
        path.length > 0 &&
        path !== '/' &&
        path.endsWith(':/') === false &&
        path.endsWith(':\\') === false) {
        allDirs.push(path);
      }
      else {
        break;
      }
    }
    allDirs.reverse();
    await commitEnsureDirs(allDirs, inMemoryOnly);
  };
  /**
   * Ensure that a series of directories are created.
   *
   * If `inMemoryOnly` is true this will not touch the disk but will only
   * modify the in-memory filesystem cache. Otherwise it will create directories
   * in the real FS.
   *
   * @param dirsToEnsure directories we want to ensure exist
   * @param inMemoryOnly whether directory creation should be confined to the
   * in-memory cache
   * @returns a Promise wrapping a list of directories created
   */
  const commitEnsureDirs = async (dirsToEnsure, inMemoryOnly) => {
    const dirsAdded = [];
    for (const dirPath of dirsToEnsure) {
      const item = getItem(dirPath);
      if (item.exists === true && item.isDirectory === true) {
        // already cached that this path is indeed an existing directory
        continue;
      }
      try {
        // cache that we know this is a directory on disk
        item.exists = true;
        item.isDirectory = true;
        item.isFile = false;
        if (!inMemoryOnly) {
          await sys.createDir(dirPath);
        }
        dirsAdded.push(dirPath);
      }
      catch (e) { }
    }
    return dirsAdded;
  };
  /**
   * Commit copy file operations to disk
   *
   * @param filesToCopy a list of [src, dest] tuples
   * @returns an array of copied file types
   */
  const commitCopyFiles = (filesToCopy) => {
    const copiedFiles = Promise.all(filesToCopy.map(async (data) => {
      const [src, dest] = data;
      await sys.copyFile(src, dest);
      return [src, dest];
    }));
    return copiedFiles;
  };
  /**
   * Commit file write operations to disk
   *
   * @param filesToWrite a list of files to write
   * @returns a Promise wrapping the files written
   *
   */
  const commitWriteFiles = (filesToWrite) => {
    const writtenFiles = Promise.all(filesToWrite.map(async (filePath) => {
      if (typeof filePath !== 'string') {
        throw new Error(`unable to writeFile without filePath`);
      }
      return commitWriteFile(filePath);
    }));
    return writtenFiles;
  };
  /**
   * Commit a file write operation to disk
   *
   * @param filePath the filepath to write
   * @returns a Promise wrapping the written path
   */
  const commitWriteFile = async (filePath) => {
    const item = getItem(filePath);
    if (item.fileText == null) {
      throw new Error(`unable to find item fileText to write: ${filePath}`);
    }
    await sys.writeFile(filePath, item.fileText);
    if (item.useCache === false) {
      clearFileCache(filePath);
    }
    return filePath;
  };
  /**
   * Commit file delete operations to disk
   *
   * @param filesToDelete a set of files to delete
   * @returns a Promise wrapping the set of files deleted
   */
  const commitDeleteFiles = async (filesToDelete) => {
    const deletedFiles = await Promise.all(filesToDelete.map(async (filePath) => {
      if (typeof filePath !== 'string') {
        throw new Error(`unable to unlink without filePath`);
      }
      await sys.removeFile(filePath);
      return filePath;
    }));
    return deletedFiles;
  };
  /**
   * Commit directory delete operations to disk
   *
   * @param dirsToDelete a set of directories to delete
   * @returns a Promise wrapping the set of directories deleted
   */
  const commitDeleteDirs = async (dirsToDelete) => {
    const dirsDeleted = [];
    for (const dirPath of dirsToDelete) {
      await sys.removeDir(dirPath);
      dirsDeleted.push(dirPath);
    }
    return dirsDeleted;
  };
  /**
   * Clear all items within a given dir from the in-memory FS cache
   *
   * @param dirPath the path for the item to remove
   */
  const clearDirCache = (dirPath) => {
    dirPath = normalizePath$2(dirPath);
    items.forEach((_, f) => {
      const filePath = relative$1(dirPath, f).split('/')[0];
      if (!filePath.startsWith('.') && !filePath.startsWith('/')) {
        clearFileCache(f);
      }
    });
  };
  /**
   * Remove an item from the in-memory FS cache, checking first that it is
   * not currently queued for a write operation.
   *
   * @param filePath the path for the item to remove
   */
  const clearFileCache = (filePath) => {
    filePath = normalizePath$2(filePath);
    const item = items.get(filePath);
    if (item != null && !item.queueWriteToDisk) {
      items.delete(filePath);
    }
  };
  /**
   * Cancel pending delete operations on files cached in the in-memory FS.
   * This will not reverse a delete operation if it has already been committed
   * to disk, but will cancel any pending delete operations that have not yet
   * been committed.
   *
   * Note that this will silently **not cancel delete operations on directories**!
   *
   * @param filePaths a list of filepaths which should not be deleted
   */
  const cancelDeleteFilesFromDisk = (filePaths) => {
    for (const filePath of filePaths) {
      const item = getItem(filePath);
      if (item.isFile === true && item.queueDeleteFromDisk === true) {
        item.queueDeleteFromDisk = false;
      }
    }
  };
  /**
   * Cancel a pending delete operations on directories cached in the in-memory
   * FS. This will not reverse a delete operation if it has already been
   * committed to disk, but will cancel any pending delete operations that
   * have not yet been committed.
   *
   * @param dirPaths a list of filepaths whose delete ops should be canceled
   */
  const cancelDeleteDirectoriesFromDisk = (dirPaths) => {
    for (const dirPath of dirPaths) {
      const item = getItem(dirPath);
      if (item.queueDeleteFromDisk === true) {
        item.queueDeleteFromDisk = false;
      }
    }
  };
  /**
   * Getter method for the in-memory FS cache / proxy.
   *
   * This will return an item if found or, if it's not present in the cache,
   * will create an 'empty' filesystem item and set it in the cache.
   *
   * @param itemPath the filepath for the item in question
   * @returns an object with information about the item in question
   */
  const getItem = (itemPath) => {
    itemPath = normalizePath$2(itemPath);
    let item = items.get(itemPath);
    if (item != null) {
      return item;
    }
    items.set(itemPath, (item = {
      exists: null,
      fileText: null,
      size: null,
      mtimeMs: null,
      isDirectory: null,
      isFile: null,
      queueCopyFileToDest: null,
      queueDeleteFromDisk: null,
      queueWriteToDisk: null,
      useCache: null,
    }));
    return item;
  };
  /**
   * Clear all items out of the in-memory cache
   */
  const clearCache = () => {
    items.clear();
  };
  /**
   * Get some very basic usage statistics for the in-memory cache
   *
   * @returns a formatted description of cache usage
   */
  const getMemoryStats = () => `data length: ${items.size}`;
  /**
   * Get information about the files built for output type
   *
   * @returns a list of build output records
   */
  const getBuildOutputs = () => {
    const outputs = [];
    outputTargetTypes.forEach((outputTargetType, filePath) => {
      const output = outputs.find((o) => o.type === outputTargetType);
      if (output) {
        output.files.push(filePath);
      }
      else {
        outputs.push({
          type: outputTargetType,
          files: [filePath],
        });
      }
    });
    outputs.forEach((output) => output.files.sort());
    return outputs.sort((a, b) => {
      if (a.type < b.type)
        return -1;
      if (a.type > b.type)
        return 1;
      return 0;
    });
  };
  // only cache if it's less than 5MB-ish (using .length as a rough guess)
  // why 5MB? idk, seems like a good number for source text
  // it's pretty darn large to cover almost ALL legitimate source files
  // and anything larger is probably a REALLY large file and a rare case
  // which we don't need to eat up memory for
  const MAX_TEXT_CACHE = 5242880;
  return {
    access,
    accessSync,
    cancelDeleteDirectoriesFromDisk,
    cancelDeleteFilesFromDisk,
    clearCache,
    clearDirCache,
    clearFileCache,
    commit,
    copyFile,
    emptyDirs,
    getBuildOutputs,
    getItem,
    getMemoryStats,
    readFile,
    readFileSync,
    readdir,
    remove,
    stat,
    statSync,
    sys,
    writeFile,
    writeFiles,
  };
};
/**
 * Given the current state of the in-memory proxy filesystem, collect all of
 * the changes that need to be made in order to commit the currently-pending
 * operations (e.g. write, copy, delete) to the OS filesystem.
 *
 * @param items the storage data structure for the in-memory FS cache
 * @returns a collection of all the operations that need to be done
 */
const getCommitInstructions = (items) => {
  const instructions = {
    filesToDelete: [],
    filesToWrite: [],
    filesToCopy: [],
    dirsToDelete: [],
    dirsToEnsure: [],
  };
  items.forEach((item, itemPath) => {
    if (item.queueWriteToDisk === true) {
      if (item.isFile === true) {
        instructions.filesToWrite.push(itemPath);
        const dir = normalizePath$2(dirname(itemPath));
        if (!instructions.dirsToEnsure.includes(dir)) {
          instructions.dirsToEnsure.push(dir);
        }
        const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
        if (dirDeleteIndex > -1) {
          instructions.dirsToDelete.splice(dirDeleteIndex, 1);
        }
        const fileDeleteIndex = instructions.filesToDelete.indexOf(itemPath);
        if (fileDeleteIndex > -1) {
          instructions.filesToDelete.splice(fileDeleteIndex, 1);
        }
      }
      else if (item.isDirectory === true) {
        if (!instructions.dirsToEnsure.includes(itemPath)) {
          instructions.dirsToEnsure.push(itemPath);
        }
        const dirDeleteIndex = instructions.dirsToDelete.indexOf(itemPath);
        if (dirDeleteIndex > -1) {
          instructions.dirsToDelete.splice(dirDeleteIndex, 1);
        }
      }
    }
    else if (item.queueDeleteFromDisk === true) {
      if (item.isDirectory && !instructions.dirsToEnsure.includes(itemPath)) {
        instructions.dirsToDelete.push(itemPath);
      }
      else if (item.isFile && !instructions.filesToWrite.includes(itemPath)) {
        instructions.filesToDelete.push(itemPath);
      }
    }
    else if (typeof item.queueCopyFileToDest === 'string') {
      const src = itemPath;
      const dest = item.queueCopyFileToDest;
      instructions.filesToCopy.push([src, dest]);
      const dir = normalizePath$2(dirname(dest));
      if (!instructions.dirsToEnsure.includes(dir)) {
        instructions.dirsToEnsure.push(dir);
      }
      const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
      if (dirDeleteIndex > -1) {
        instructions.dirsToDelete.splice(dirDeleteIndex, 1);
      }
      const fileDeleteIndex = instructions.filesToDelete.indexOf(dest);
      if (fileDeleteIndex > -1) {
        instructions.filesToDelete.splice(fileDeleteIndex, 1);
      }
    }
    item.queueDeleteFromDisk = false;
    item.queueWriteToDisk = false;
  });
  // add all the ancestor directories for each directory too
  for (let i = 0, ilen = instructions.dirsToEnsure.length; i < ilen; i++) {
    const segments = instructions.dirsToEnsure[i].split('/');
    for (let j = 2; j < segments.length; j++) {
      const dir = segments.slice(0, j).join('/');
      if (instructions.dirsToEnsure.includes(dir) === false) {
        instructions.dirsToEnsure.push(dir);
      }
    }
  }
  // sort directories so shortest paths are ensured first
  instructions.dirsToEnsure.sort((a, b) => {
    const segmentsA = a.split('/').length;
    const segmentsB = b.split('/').length;
    if (segmentsA < segmentsB)
      return -1;
    if (segmentsA > segmentsB)
      return 1;
    if (a.length < b.length)
      return -1;
    if (a.length > b.length)
      return 1;
    return 0;
  });
  // sort directories so longest paths are removed first
  instructions.dirsToDelete.sort((a, b) => {
    const segmentsA = a.split('/').length;
    const segmentsB = b.split('/').length;
    if (segmentsA < segmentsB)
      return 1;
    if (segmentsA > segmentsB)
      return -1;
    if (a.length < b.length)
      return 1;
    if (a.length > b.length)
      return -1;
    return 0;
  });
  for (const dirToEnsure of instructions.dirsToEnsure) {
    const i = instructions.dirsToDelete.indexOf(dirToEnsure);
    if (i > -1) {
      instructions.dirsToDelete.splice(i, 1);
    }
  }
  instructions.dirsToDelete = instructions.dirsToDelete.filter((dir) => {
    if (dir === '/' || dir.endsWith(':/') === true) {
      return false;
    }
    return true;
  });
  instructions.dirsToEnsure = instructions.dirsToEnsure.filter((dir) => {
    const item = items.get(dir);
    if (item != null && item.exists === true && item.isDirectory === true) {
      return false;
    }
    if (dir === '/' || dir.endsWith(':/')) {
      return false;
    }
    return true;
  });
  return instructions;
};
/**
 * Check whether a given filepath should be ignored
 *
 * We have a little ignore list, and we just check whether the
 * filepath ends with any of the strings on the ignore list.
 *
 * @param filePath the filepath to check!
 * @returns whether we should ignore it or not
 */
const shouldIgnore = (filePath) => {
  filePath = filePath.trim().toLowerCase();
  return IGNORE.some((ignoreFile) => filePath.endsWith(ignoreFile));
};
/**
 * Ignore list for files which we don't want to write.
 */
const IGNORE = ['.ds_store', '.gitignore', 'desktop.ini', 'thumbs.db'];

const createWorkerMainContext = (workerCtrl) => ({
  optimizeCss: workerCtrl.handler('optimizeCss'),
  prepareModule: workerCtrl.handler('prepareModule'),
  prerenderWorker: workerCtrl.handler('prerenderWorker'),
  transformCssToEsm: workerCtrl.handler('transformCssToEsm'),
});

const createSysWorker = (config) => {
  if (isFunction(config.sys.createWorkerController) &&
    config.maxConcurrentWorkers > 0 &&
    config.sys.hardwareConcurrency > 1) {
    const workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
    config.sys.addDestory(() => workerCtrl.destroy());
    config.logger.debug(`create workers, maxWorkers: ${workerCtrl.maxWorkers}`);
    return createWorkerMainContext(workerCtrl);
  }
  config.logger.debug(`no workers, maxConcurrentWorkers: ${config.maxConcurrentWorkers}, hardwareConcurrency: ${config.sys.hardwareConcurrency}`);
  return createWorkerContext(config.sys);
};

/**
 * Generate a Stencil compiler instance
 * @param userConfig a user-provided Stencil configuration to apply to the compiler instance
 * @returns a new instance of a Stencil compiler
 * @public
 */
const createCompiler = async (userConfig) => {
  // actual compiler code
  // could be in a web worker on the browser
  // or the main thread in node
  const config = getConfig(userConfig);
  const diagnostics = [];
  const sys = config.sys;
  const compilerCtx = new CompilerContext();
  if (isFunction(config.sys.setupCompiler)) {
    config.sys.setupCompiler({ ts: t });
  }
  patchFs(sys);
  compilerCtx.fs = createInMemoryFs(sys);
  compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
  await compilerCtx.cache.initCacheDir();
  sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, compilerCtx.fs, opts);
  compilerCtx.worker = createSysWorker(config);
  if (sys.events) {
    // Pipe events from sys.events to compilerCtx
    sys.events.on(compilerCtx.events.emit);
  }
  patchTypescript(config, compilerCtx.fs);
  const build = () => createFullBuild(config, compilerCtx);
  const createWatcher = () => createWatchBuild(config, compilerCtx);
  const destroy = async () => {
    compilerCtx.reset();
    compilerCtx.events.unsubscribeAll();
    await sys.destroy();
  };
  const compiler = {
    build,
    createWatcher,
    destroy,
    sys,
  };
  config.logger.printDiagnostics(diagnostics);
  return compiler;
};

const validateTsConfig = async (config, sys, init) => {
  var _a;
  const tsconfig = {
    path: null,
    compilerOptions: null,
    files: null,
    include: null,
    exclude: null,
    extends: null,
    diagnostics: [],
  };
  try {
    const readTsConfig = await getTsConfigPath(config, sys, init);
    if (!readTsConfig) {
      const diagnostic = buildError(tsconfig.diagnostics);
      diagnostic.header = `Missing tsconfig.json`;
      diagnostic.messageText = `Unable to load TypeScript config file. Please create a "tsconfig.json" file within the "${config.rootDir}" directory.`;
    }
    else {
      tsconfig.path = readTsConfig.path;
      const host = {
        ...t.sys,
        readFile: (p) => {
          if (p === tsconfig.path) {
            return readTsConfig.content;
          }
          return sys.readFileSync(p);
        },
        readDirectory: (p) => sys.readDirSync(p),
        fileExists: (p) => sys.accessSync(p),
        onUnRecoverableConfigFileDiagnostic: (e) => console.error(e),
      };
      const results = t.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
      if (results.errors && results.errors.length > 0) {
        results.errors.forEach((configErr) => {
          const tsDiagnostic = loadTypeScriptDiagnostic(configErr);
          if (tsDiagnostic.code === '18003') {
            // "No inputs were found in config file"
            // fine to just "warn" rather than "error" even before starting
            tsDiagnostic.level = 'warn';
          }
          tsDiagnostic.absFilePath = tsconfig.path;
          tsconfig.diagnostics.push(tsDiagnostic);
        });
      }
      else {
        if (results.raw) {
          const srcDir = relative$1(config.rootDir, config.srcDir);
          if (!hasSrcDirectoryInclude(results.raw.include, srcDir)) {
            const warn = buildWarn(tsconfig.diagnostics);
            warn.header = `tsconfig.json "include" required`;
            warn.messageText = `In order for TypeScript to improve watch performance, it's recommended the "tsconfig.json" file should have the "include" property, with at least the app's "${srcDir}" directory listed. For example: "include": ["${srcDir}"]`;
          }
          if (hasStencilConfigInclude(results.raw.include)) {
            const warn = buildWarn(tsconfig.diagnostics);
            warn.header = `tsconfig.json should not reference stencil.config.ts`;
            warn.messageText = `stencil.config.ts is not part of the output build, it should not be included.`;
          }
          if (Array.isArray(results.raw.files)) {
            tsconfig.files = results.raw.files.slice();
          }
          if (Array.isArray(results.raw.include)) {
            tsconfig.include = results.raw.include.slice();
          }
          if (Array.isArray(results.raw.exclude)) {
            tsconfig.exclude = results.raw.exclude.slice();
          }
          if (isString$1(results.raw.extends)) {
            tsconfig.extends = results.raw.extends;
          }
        }
        if (results.options) {
          tsconfig.compilerOptions = results.options;
          const target = (_a = tsconfig.compilerOptions.target) !== null && _a !== void 0 ? _a : t.ScriptTarget.ES5;
          if ([t.ScriptTarget.ES3, t.ScriptTarget.ES5, t.ScriptTarget.ES2015, t.ScriptTarget.ES2016].includes(target)) {
            const warn = buildWarn(tsconfig.diagnostics);
            warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “target” setting to "es2017". Note that the compiler will automatically handle transpilation for ES5-only browsers.`;
          }
          if (tsconfig.compilerOptions.module !== t.ModuleKind.ESNext && !config._isTesting) {
            const warn = buildWarn(tsconfig.diagnostics);
            warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “module” setting to “esnext”. Note that the compiler will automatically handle bundling both modern and legacy builds.`;
          }
          tsconfig.compilerOptions.sourceMap = config.sourceMap;
          tsconfig.compilerOptions.inlineSources = config.sourceMap;
        }
      }
    }
  }
  catch (e) {
    catchError(tsconfig.diagnostics, e);
  }
  return tsconfig;
};
const getTsConfigPath = async (config, sys, init) => {
  const tsconfig = {
    path: null,
    content: null,
  };
  if (isString$1(config.tsconfig)) {
    if (!isAbsolute$1(config.tsconfig)) {
      tsconfig.path = join(config.rootDir, config.tsconfig);
    }
    else {
      tsconfig.path = config.tsconfig;
    }
  }
  else {
    tsconfig.path = join(config.rootDir, 'tsconfig.json');
  }
  tsconfig.content = await sys.readFile(tsconfig.path);
  if (!isString$1(tsconfig.content)) {
    if (!init.initTsConfig) {
      // not set to automatically generate a default tsconfig
      return null;
    }
    // create a default tsconfig
    tsconfig.path = join(config.rootDir, 'tsconfig.json');
    tsconfig.content = createDefaultTsConfig(config);
    await sys.writeFile(tsconfig.path, tsconfig.content);
  }
  tsconfig.path = normalizePath$2(tsconfig.path);
  return tsconfig;
};
const createDefaultTsConfig = (config) => JSON.stringify({
  compilerOptions: {
    allowSyntheticDefaultImports: true,
    experimentalDecorators: true,
    lib: ['dom', 'es2015'],
    moduleResolution: 'node',
    module: 'esnext',
    target: 'es2017',
    jsx: 'react',
    jsxFactory: 'h',
    jsxFragmentFactory: 'Fragment',
    sourceMap: config.sourceMap,
    inlineSources: config.sourceMap,
  },
  include: [relative$1(config.rootDir, config.srcDir)],
}, null, 2);
const hasSrcDirectoryInclude = (includeProp, src) => Array.isArray(includeProp) && includeProp.includes(src);
const hasStencilConfigInclude = (includeProp) => Array.isArray(includeProp) && includeProp.includes('stencil.config.ts');

const getAbsolutePath = (config, dir) => {
  if (!isAbsolute$1(dir)) {
    dir = join(config.rootDir, dir);
  }
  return dir;
};
/**
 * This function does two things:
 *
 * 1. If you pass a `flagName`, it will hoist that `flagName` out of the
 *  `ConfigFlags` object and onto the 'root' level (if you will) of the
 *  `config` under the `configName` (`keyof d.Config`) that you pass.
 * 2. If you _don't_  pass a `flagName` it will just set the value you supply
 *  on the config.
 *
 * @param config the config that we want to update
 * @param configName the key we're setting on the config
 * @param flagName either the name of a ConfigFlag prop we want to hoist up or null
 * @param defaultValue the default value we should set!
 */
const setBooleanConfig = (config, configName, flagName, defaultValue) => {
  var _a;
  if (flagName) {
    const flagValue = (_a = config.flags) === null || _a === void 0 ? void 0 : _a[flagName];
    if (isBoolean$1(flagValue)) {
      config[configName] = flagValue;
    }
  }
  const userConfigName = getUserConfigName(config, configName);
  if (typeof config[userConfigName] === 'function') {
    config[userConfigName] = !!config[userConfigName]();
  }
  if (isBoolean$1(config[userConfigName])) {
    config[configName] = config[userConfigName];
  }
  else {
    config[configName] = defaultValue;
  }
};
/**
 * Find any possibly mis-capitalized configuration names on the config, logging
 * and warning if one is found.
 *
 * @param config the user-supplied config that we're dealing with
 * @param correctConfigName the configuration name that we're checking for right now
 * @returns a string container a mis-capitalized config name found on the
 * config object, if any.
 */
const getUserConfigName = (config, correctConfigName) => {
  var _a;
  const userConfigNames = Object.keys(config);
  for (const userConfigName of userConfigNames) {
    if (userConfigName.toLowerCase() === correctConfigName.toLowerCase()) {
      if (userConfigName !== correctConfigName) {
        (_a = config.logger) === null || _a === void 0 ? void 0 : _a.warn(`config "${userConfigName}" should be "${correctConfigName}"`);
        return userConfigName;
      }
      break;
    }
  }
  return correctConfigName;
};

const validateAngular = (config, userOutputs) => {
  const angularOutputTargets = userOutputs.filter(isOutputTargetAngular);
  return angularOutputTargets.map((outputTarget) => {
    let directivesProxyFile = outputTarget.directivesProxyFile;
    if (directivesProxyFile && !isAbsolute$1(directivesProxyFile)) {
      directivesProxyFile = join(config.rootDir, directivesProxyFile);
    }
    let directivesArrayFile = outputTarget.directivesArrayFile;
    if (directivesArrayFile && !isAbsolute$1(directivesArrayFile)) {
      directivesArrayFile = join(config.rootDir, directivesArrayFile);
    }
    let directivesUtilsFile = outputTarget.directivesUtilsFile;
    if (directivesUtilsFile && !isAbsolute$1(directivesUtilsFile)) {
      directivesUtilsFile = join(config.rootDir, directivesUtilsFile);
    }
    return {
      type: 'angular',
      componentCorePackage: outputTarget.componentCorePackage,
      directivesProxyFile,
      directivesArrayFile,
      directivesUtilsFile,
      excludeComponents: outputTarget.excludeComponents || [],
    };
  });
};

/**
 * Validate and return DIST_COLLECTION output targets, ensuring that the `dir`
 * property is set on them.
 *
 * @param config a validated configuration object
 * @param userOutputs an array of output targets
 * @returns an array of validated DIST_COLLECTION output targets
 */
const validateCollection = (config, userOutputs) => {
  return userOutputs.filter(isOutputTargetDistCollection).map((outputTarget) => {
    var _a, _b;
    return {
      ...outputTarget,
      transformAliasedImportPaths: (_a = outputTarget.transformAliasedImportPaths) !== null && _a !== void 0 ? _a : false,
      dir: getAbsolutePath(config, (_b = outputTarget.dir) !== null && _b !== void 0 ? _b : 'dist/collection'),
    };
  });
};

/**
 * Validate a series of {@link d.CopyTask}s
 * @param copy the copy tasks to validate, or a boolean to specify if copy tasks are enabled
 * @param defaultCopy default copy tasks to add to the returned validated list if not present in the first argument
 * @returns the validated copy tasks
 */
const validateCopy = (copy, defaultCopy = []) => {
  if (copy === null || copy === false) {
    return [];
  }
  if (!Array.isArray(copy)) {
    copy = [];
  }
  copy = copy.slice();
  for (const task of defaultCopy) {
    if (copy.every((t) => t.src !== task.src)) {
      copy.push(task);
    }
  }
  return unique(copy, (task) => `${task.src}:${task.dest}:${task.keepDirStructure}`);
};

/**
 * Validate one or more `dist-custom-elements` output targets. Validation of an output target may involve back-filling
 * fields that are omitted with sensible defaults and/or creating additional supporting output targets that were not
 * explicitly defined by the user
 * @param config the Stencil configuration associated with the project being compiled
 * @param userOutputs the output target(s) specified by the user
 * @returns the validated output target(s)
 */
const validateCustomElement = (config, userOutputs) => {
  const defaultDir = 'dist';
  return userOutputs.filter(isOutputTargetDistCustomElements).reduce((outputs, o) => {
    const outputTarget = {
      ...o,
      dir: getAbsolutePath(config, o.dir || join(defaultDir, 'components')),
    };
    if (!isBoolean$1(outputTarget.empty)) {
      outputTarget.empty = true;
    }
    if (!isBoolean$1(outputTarget.externalRuntime)) {
      outputTarget.externalRuntime = true;
    }
    // unlike other output targets, Stencil does not allow users to define the output location of types at this time
    if (outputTarget.generateTypeDeclarations) {
      const typesDirectory = getAbsolutePath(config, join(defaultDir, 'types'));
      outputs.push({
        type: DIST_TYPES,
        dir: outputTarget.dir,
        typesDir: typesDirectory,
      });
    }
    outputTarget.copy = validateCopy(outputTarget.copy, []);
    if (outputTarget.copy.length > 0) {
      outputs.push({
        type: COPY,
        dir: config.rootDir,
        copy: [...outputTarget.copy],
      });
    }
    outputs.push(outputTarget);
    return outputs;
  }, []);
};

const validateCustomElementBundle = (config, userOutputs) => {
  return userOutputs.filter(isOutputTargetDistCustomElementsBundle).reduce((arr, o) => {
    const outputTarget = {
      ...o,
      dir: getAbsolutePath(config, o.dir || 'dist/custom-elements'),
    };
    if (!isBoolean$1(outputTarget.empty)) {
      outputTarget.empty = true;
    }
    if (!isBoolean$1(outputTarget.externalRuntime)) {
      outputTarget.externalRuntime = true;
    }
    outputTarget.copy = validateCopy(outputTarget.copy, []);
    if (outputTarget.copy.length > 0) {
      arr.push({
        type: COPY,
        dir: config.rootDir,
        copy: [...outputTarget.copy],
      });
    }
    arr.push(outputTarget);
    return arr;
  }, []);
};

const validateCustomOutput = (config, diagnostics, userOutputs) => {
  return userOutputs.filter(isOutputTargetCustom).map((o) => {
    if (o.validate) {
      const localDiagnostics = [];
      try {
        o.validate(config, diagnostics);
      }
      catch (e) {
        catchError(localDiagnostics, e);
      }
      if (o.copy && o.copy.length > 0) {
        config.outputTargets.push({
          type: COPY,
          dir: config.rootDir,
          copy: [...o.copy],
        });
      }
      diagnostics.push(...localDiagnostics);
    }
    return o;
  });
};

/**
 * Validate that the "dist" output targets are valid and ready to go.
 *
 * This function will also add in additional output targets to its output, based on the input supplied.
 *
 * @param config the compiler config, what else?
 * @param userOutputs a user-supplied list of output targets.
 * @returns a list of OutputTargets which have been validated for us.
 */
const validateDist = (config, userOutputs) => {
  const distOutputTargets = userOutputs.filter(isOutputTargetDist);
  return distOutputTargets.reduce((outputs, o) => {
    var _a;
    const distOutputTarget = validateOutputTargetDist(config, o);
    outputs.push(distOutputTarget);
    const namespace = config.fsNamespace || 'app';
    const lazyDir = join(distOutputTarget.buildDir, namespace);
    // Lazy build for CDN in dist
    outputs.push({
      type: DIST_LAZY,
      esmDir: lazyDir,
      systemDir: config.buildEs5 ? lazyDir : undefined,
      systemLoaderFile: config.buildEs5 ? join(lazyDir, namespace + '.js') : undefined,
      legacyLoaderFile: join(distOutputTarget.buildDir, namespace + '.js'),
      polyfills: distOutputTarget.polyfills !== undefined ? !!distOutputTarget.polyfills : true,
      isBrowserBuild: true,
      empty: distOutputTarget.empty,
    });
    outputs.push({
      type: COPY,
      dir: lazyDir,
      copyAssets: 'dist',
      copy: ((_a = distOutputTarget.copy) !== null && _a !== void 0 ? _a : []).concat(),
    });
    outputs.push({
      type: DIST_GLOBAL_STYLES,
      file: join(lazyDir, `${config.fsNamespace}.css`),
    });
    outputs.push({
      type: DIST_TYPES,
      dir: distOutputTarget.dir,
      typesDir: distOutputTarget.typesDir,
    });
    if (config.buildDist) {
      if (distOutputTarget.collectionDir) {
        outputs.push({
          type: DIST_COLLECTION,
          dir: distOutputTarget.dir,
          collectionDir: distOutputTarget.collectionDir,
          empty: distOutputTarget.empty,
          transformAliasedImportPaths: distOutputTarget.transformAliasedImportPathsInCollection,
        });
        outputs.push({
          type: COPY,
          dir: distOutputTarget.collectionDir,
          copyAssets: 'collection',
          copy: [...distOutputTarget.copy, { src: '**/*.svg' }, { src: '**/*.js' }],
        });
      }
      const esmDir = join(distOutputTarget.dir, 'esm');
      const esmEs5Dir = config.buildEs5 ? join(distOutputTarget.dir, 'esm-es5') : undefined;
      const cjsDir = join(distOutputTarget.dir, 'cjs');
      // Create lazy output-target
      outputs.push({
        type: DIST_LAZY,
        esmDir,
        esmEs5Dir,
        cjsDir,
        cjsIndexFile: join(distOutputTarget.dir, 'index.cjs.js'),
        esmIndexFile: join(distOutputTarget.dir, 'index.js'),
        polyfills: true,
        empty: distOutputTarget.empty,
      });
      // Create output target that will generate the /loader entry-point
      outputs.push({
        type: DIST_LAZY_LOADER,
        dir: distOutputTarget.esmLoaderPath,
        esmDir,
        esmEs5Dir,
        cjsDir,
        componentDts: getComponentsDtsTypesFilePath(distOutputTarget),
        empty: distOutputTarget.empty,
      });
    }
    return outputs;
  }, []);
};
/**
 * Validate that an OutputTargetDist object has what it needs to do it's job.
 * To enforce this, we have this function return
 * `Required<d.OutputTargetDist>`, giving us a compile-time check that all
 * properties are defined (with either user-supplied or default values).
 *
 * @param config the current config
 * @param o the OutputTargetDist object we want to validate
 * @returns `Required<d.OutputTargetDist>`, i.e. `d.OutputTargetDist` with all
 * optional properties rendered un-optional.
 */
const validateOutputTargetDist = (config, o) => {
  var _a, _b;
  // we need to create an object with a bunch of default values here so that
  // the typescript compiler can infer their types correctly
  const outputTarget = {
    ...o,
    dir: getAbsolutePath(config, o.dir || DEFAULT_DIR),
    buildDir: isString$1(o.buildDir) ? o.buildDir : DEFAULT_BUILD_DIR,
    collectionDir: o.collectionDir !== undefined ? o.collectionDir : DEFAULT_COLLECTION_DIR,
    typesDir: o.typesDir || DEFAULT_TYPES_DIR,
    esmLoaderPath: o.esmLoaderPath || DEFAULT_ESM_LOADER_DIR,
    copy: validateCopy((_a = o.copy) !== null && _a !== void 0 ? _a : [], []),
    polyfills: isBoolean$1(o.polyfills) ? o.polyfills : undefined,
    empty: isBoolean$1(o.empty) ? o.empty : true,
    transformAliasedImportPathsInCollection: (_b = o.transformAliasedImportPathsInCollection) !== null && _b !== void 0 ? _b : false,
  };
  if (!isAbsolute$1(outputTarget.buildDir)) {
    outputTarget.buildDir = join(outputTarget.dir, outputTarget.buildDir);
  }
  if (outputTarget.collectionDir && !isAbsolute$1(outputTarget.collectionDir)) {
    outputTarget.collectionDir = join(outputTarget.dir, outputTarget.collectionDir);
  }
  if (!isAbsolute$1(outputTarget.esmLoaderPath)) {
    outputTarget.esmLoaderPath = resolve$3(outputTarget.dir, outputTarget.esmLoaderPath);
  }
  if (!isAbsolute$1(outputTarget.typesDir)) {
    outputTarget.typesDir = join(outputTarget.dir, outputTarget.typesDir);
  }
  return outputTarget;
};
const DEFAULT_DIR = 'dist';
const DEFAULT_BUILD_DIR = '';
const DEFAULT_COLLECTION_DIR = 'collection';
const DEFAULT_TYPES_DIR = 'types';
const DEFAULT_ESM_LOADER_DIR = 'loader';

const validateDocs = (config, diagnostics, userOutputs) => {
  const docsOutputs = [];
  // json docs flag
  if (isString$1(config.flags.docsJson)) {
    docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, {
      type: 'docs-json',
      file: config.flags.docsJson,
    }));
  }
  // json docs
  const jsonDocsOutputs = userOutputs.filter(isOutputTargetDocsJson);
  jsonDocsOutputs.forEach((jsonDocsOutput) => {
    docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, jsonDocsOutput));
  });
  // readme docs flag
  if (config.flags.docs || config.flags.task === 'docs') {
    if (!userOutputs.some(isOutputTargetDocsReadme)) {
      // didn't provide a docs config, so let's add one
      docsOutputs.push(validateReadmeOutputTarget(config, { type: 'docs-readme' }));
    }
  }
  // readme docs
  const readmeDocsOutputs = userOutputs.filter(isOutputTargetDocsReadme);
  readmeDocsOutputs.forEach((readmeDocsOutput) => {
    docsOutputs.push(validateReadmeOutputTarget(config, readmeDocsOutput));
  });
  // custom docs
  const customDocsOutputs = userOutputs.filter(isOutputTargetDocsCustom);
  customDocsOutputs.forEach((jsonDocsOutput) => {
    docsOutputs.push(validateCustomDocsOutputTarget(diagnostics, jsonDocsOutput));
  });
  // vscode docs
  const vscodeDocsOutputs = userOutputs.filter(isOutputTargetDocsVscode);
  vscodeDocsOutputs.forEach((vscodeDocsOutput) => {
    docsOutputs.push(validateVScodeDocsOutputTarget(diagnostics, vscodeDocsOutput));
  });
  return docsOutputs;
};
const validateReadmeOutputTarget = (config, outputTarget) => {
  if (!isString$1(outputTarget.dir)) {
    outputTarget.dir = config.srcDir;
  }
  if (!isAbsolute$1(outputTarget.dir)) {
    outputTarget.dir = join(config.rootDir, outputTarget.dir);
  }
  if (outputTarget.footer == null) {
    outputTarget.footer = NOTE;
  }
  outputTarget.strict = !!outputTarget.strict;
  return outputTarget;
};
const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
  if (!isString$1(outputTarget.file)) {
    const err = buildError(diagnostics);
    err.messageText = `docs-json outputTarget missing the "file" option`;
  }
  outputTarget.file = join(config.rootDir, outputTarget.file);
  if (isString$1(outputTarget.typesFile)) {
    outputTarget.typesFile = join(config.rootDir, outputTarget.typesFile);
  }
  else if (outputTarget.typesFile !== null && outputTarget.file.endsWith('.json')) {
    outputTarget.typesFile = outputTarget.file.replace(/\.json$/, '.d.ts');
  }
  outputTarget.strict = !!outputTarget.strict;
  return outputTarget;
};
const validateCustomDocsOutputTarget = (diagnostics, outputTarget) => {
  if (!isFunction(outputTarget.generator)) {
    const err = buildError(diagnostics);
    err.messageText = `docs-custom outputTarget missing the "generator" function`;
  }
  outputTarget.strict = !!outputTarget.strict;
  return outputTarget;
};
const validateVScodeDocsOutputTarget = (diagnostics, outputTarget) => {
  if (!isString$1(outputTarget.file)) {
    const err = buildError(diagnostics);
    err.messageText = `docs-vscode outputTarget missing the "file" path`;
  }
  return outputTarget;
};

const validateHydrateScript = (config, userOutputs) => {
  const output = [];
  const hasHydrateOutputTarget = userOutputs.some(isOutputTargetHydrate);
  if (!hasHydrateOutputTarget) {
    // we don't already have a hydrate output target
    // let's still see if we require one because of other output targets
    const hasWwwOutput = userOutputs.filter(isOutputTargetWww).some((o) => isString$1(o.indexHtml));
    const shouldBuildHydrate = config.flags.prerender || config.flags.ssr;
    if (hasWwwOutput && shouldBuildHydrate) {
      // we're prerendering a www output target, so we'll need a hydrate app
      let hydrateDir;
      const distOutput = userOutputs.find(isOutputTargetDist);
      if (distOutput != null && isString$1(distOutput.dir)) {
        hydrateDir = join(distOutput.dir, 'hydrate');
      }
      else {
        hydrateDir = 'dist/hydrate';
      }
      const hydrateForWwwOutputTarget = {
        type: DIST_HYDRATE_SCRIPT,
        dir: hydrateDir,
      };
      userOutputs.push(hydrateForWwwOutputTarget);
    }
  }
  const hydrateOutputTargets = userOutputs.filter(isOutputTargetHydrate);
  hydrateOutputTargets.forEach((outputTarget) => {
    if (!isString$1(outputTarget.dir)) {
      // no directory given, see if we've got a dist to go off of
      outputTarget.dir = 'hydrate';
    }
    if (!isAbsolute$1(outputTarget.dir)) {
      outputTarget.dir = join(config.rootDir, outputTarget.dir);
    }
    if (!isBoolean$1(outputTarget.empty)) {
      outputTarget.empty = true;
    }
    outputTarget.external = outputTarget.external || [];
    outputTarget.external.push(...NODE_BUILTINS);
    output.push(outputTarget);
  });
  return output;
};

const validateLazy = (config, userOutputs) => {
  return userOutputs.filter(isOutputTargetDistLazy).map((o) => {
    const dir = getAbsolutePath(config, o.dir || join('dist', config.fsNamespace));
    const lazyOutput = {
      type: DIST_LAZY,
      esmDir: dir,
      systemDir: config.buildEs5 ? dir : undefined,
      systemLoaderFile: config.buildEs5 ? join(dir, `${config.fsNamespace}.js`) : undefined,
      polyfills: !!o.polyfills,
      isBrowserBuild: true,
      empty: isBoolean$1(o.empty) ? o.empty : true,
    };
    return lazyOutput;
  });
};

const validateStats = (userConfig, userOutputs) => {
  const outputTargets = [];
  if (userConfig.flags.stats) {
    const hasOutputTarget = userOutputs.some(isOutputTargetStats);
    if (!hasOutputTarget) {
      outputTargets.push({
        type: STATS,
      });
    }
  }
  outputTargets.push(...userOutputs.filter(isOutputTargetStats));
  outputTargets.forEach((outputTarget) => {
    if (!outputTarget.file) {
      outputTarget.file = 'stencil-stats.json';
    }
    if (!isAbsolute$1(outputTarget.file)) {
      outputTarget.file = join(userConfig.rootDir, outputTarget.file);
    }
  });
  return outputTargets;
};

const validatePrerender = (config, diagnostics, outputTarget) => {
  if (!config.flags.ssr && !config.flags.prerender && config.flags.task !== 'prerender') {
    return;
  }
  outputTarget.baseUrl = normalizePath$2(outputTarget.baseUrl);
  if (!outputTarget.baseUrl.startsWith('http://') && !outputTarget.baseUrl.startsWith('https://')) {
    const err = buildError(diagnostics);
    err.messageText = `When prerendering, the "baseUrl" output target config must be a full URL and start with either "http://" or "https://". The config can be updated in the "www" output target within the stencil config.`;
  }
  try {
    new URL(outputTarget.baseUrl);
  }
  catch (e) {
    const err = buildError(diagnostics);
    err.messageText = `invalid "baseUrl": ${e}`;
  }
  if (!outputTarget.baseUrl.endsWith('/')) {
    outputTarget.baseUrl += '/';
  }
  if (isString$1(outputTarget.prerenderConfig)) {
    if (!isAbsolute$1(outputTarget.prerenderConfig)) {
      outputTarget.prerenderConfig = join(config.rootDir, outputTarget.prerenderConfig);
    }
  }
};

const validateServiceWorker = (config, outputTarget) => {
  if (outputTarget.serviceWorker === false) {
    return;
  }
  if (config.devMode && !config.flags.serviceWorker) {
    outputTarget.serviceWorker = null;
    return;
  }
  if (outputTarget.serviceWorker === null) {
    outputTarget.serviceWorker = null;
    return;
  }
  if (!outputTarget.serviceWorker && config.devMode) {
    outputTarget.serviceWorker = null;
    return;
  }
  if (typeof outputTarget.serviceWorker !== 'object') {
    // what was passed in could have been a boolean
    // in that case let's just turn it into an empty obj so Object.assign doesn't crash
    outputTarget.serviceWorker = {};
  }
  if (!Array.isArray(outputTarget.serviceWorker.globPatterns)) {
    if (typeof outputTarget.serviceWorker.globPatterns === 'string') {
      outputTarget.serviceWorker.globPatterns = [outputTarget.serviceWorker.globPatterns];
    }
    else if (typeof outputTarget.serviceWorker.globPatterns !== 'string') {
      outputTarget.serviceWorker.globPatterns = DEFAULT_GLOB_PATTERNS.slice();
    }
  }
  if (typeof outputTarget.serviceWorker.globDirectory !== 'string') {
    outputTarget.serviceWorker.globDirectory = outputTarget.appDir;
  }
  if (typeof outputTarget.serviceWorker.globIgnores === 'string') {
    outputTarget.serviceWorker.globIgnores = [outputTarget.serviceWorker.globIgnores];
  }
  outputTarget.serviceWorker.globIgnores = outputTarget.serviceWorker.globIgnores || [];
  addGlobIgnores(config, outputTarget.serviceWorker.globIgnores);
  outputTarget.serviceWorker.dontCacheBustURLsMatching = /p-\w{8}/;
  if (isString$1(outputTarget.serviceWorker.swSrc) && !isAbsolute$1(outputTarget.serviceWorker.swSrc)) {
    outputTarget.serviceWorker.swSrc = join(config.rootDir, outputTarget.serviceWorker.swSrc);
  }
  if (!isString$1(outputTarget.serviceWorker.swDest)) {
    outputTarget.serviceWorker.swDest = join(outputTarget.appDir, DEFAULT_FILENAME);
  }
  if (!isAbsolute$1(outputTarget.serviceWorker.swDest)) {
    outputTarget.serviceWorker.swDest = join(outputTarget.appDir, outputTarget.serviceWorker.swDest);
  }
};
const addGlobIgnores = (config, globIgnores) => {
  globIgnores.push(`**/host.config.json`, // the filename of the host configuration
  `**/*.system.entry.js`, `**/*.system.js`, `**/${config.fsNamespace}.js`, `**/${config.fsNamespace}.esm.js`, `**/${config.fsNamespace}.css`);
};
const DEFAULT_GLOB_PATTERNS = ['*.html', '**/*.{js,css,json}'];
const DEFAULT_FILENAME = 'sw.js';

const validateWww = (config, diagnostics, userOutputs) => {
  const hasOutputTargets = userOutputs.length > 0;
  const hasE2eTests = !!config.flags.e2e;
  const userWwwOutputs = userOutputs.filter(isOutputTargetWww);
  if (!hasOutputTargets ||
    (hasE2eTests && !userOutputs.some(isOutputTargetWww) && !userOutputs.some(isOutputTargetDist))) {
    userWwwOutputs.push({ type: WWW });
  }
  if (config.flags.prerender && userWwwOutputs.length === 0) {
    const err = buildError(diagnostics);
    err.messageText = `You need at least one "www" output target configured in your stencil.config.ts, when the "--prerender" flag is used`;
  }
  return userWwwOutputs.reduce((outputs, o) => {
    const outputTarget = validateWwwOutputTarget(config, o, diagnostics);
    outputs.push(outputTarget);
    // Add dist-lazy output target
    const buildDir = outputTarget.buildDir;
    outputs.push({
      type: DIST_LAZY,
      dir: buildDir,
      esmDir: buildDir,
      systemDir: config.buildEs5 ? buildDir : undefined,
      systemLoaderFile: config.buildEs5 ? join(buildDir, `${config.fsNamespace}.js`) : undefined,
      polyfills: outputTarget.polyfills,
      isBrowserBuild: true,
    });
    // Copy for dist
    outputs.push({
      type: COPY,
      dir: buildDir,
      copyAssets: 'dist',
    });
    // Copy for www
    outputs.push({
      type: COPY,
      dir: outputTarget.appDir,
      copy: validateCopy(outputTarget.copy, [
        { src: 'assets', warn: false },
        { src: 'manifest.json', warn: false },
      ]),
    });
    // Generate global style with original name
    outputs.push({
      type: DIST_GLOBAL_STYLES,
      file: join(buildDir, `${config.fsNamespace}.css`),
    });
    return outputs;
  }, []);
};
const validateWwwOutputTarget = (config, outputTarget, diagnostics) => {
  if (!isString$1(outputTarget.baseUrl)) {
    outputTarget.baseUrl = '/';
  }
  if (!outputTarget.baseUrl.endsWith('/')) {
    // Make sure the baseUrl always finish with "/"
    outputTarget.baseUrl += '/';
  }
  outputTarget.dir = getAbsolutePath(config, outputTarget.dir || 'www');
  // Fix "dir" to account
  const pathname = new URL(outputTarget.baseUrl, 'http://localhost/').pathname;
  outputTarget.appDir = join(outputTarget.dir, pathname);
  if (outputTarget.appDir.endsWith('/') || outputTarget.appDir.endsWith('\\')) {
    outputTarget.appDir = outputTarget.appDir.substring(0, outputTarget.appDir.length - 1);
  }
  if (!isString$1(outputTarget.buildDir)) {
    outputTarget.buildDir = 'build';
  }
  if (!isAbsolute$1(outputTarget.buildDir)) {
    outputTarget.buildDir = join(outputTarget.appDir, outputTarget.buildDir);
  }
  if (!isString$1(outputTarget.indexHtml)) {
    outputTarget.indexHtml = 'index.html';
  }
  if (!isAbsolute$1(outputTarget.indexHtml)) {
    outputTarget.indexHtml = join(outputTarget.appDir, outputTarget.indexHtml);
  }
  if (!isBoolean$1(outputTarget.empty)) {
    outputTarget.empty = true;
  }
  validatePrerender(config, diagnostics, outputTarget);
  validateServiceWorker(config, outputTarget);
  if (outputTarget.polyfills === undefined) {
    outputTarget.polyfills = true;
  }
  outputTarget.polyfills = !!outputTarget.polyfills;
  return outputTarget;
};

const validateOutputTargets = (config, diagnostics) => {
  const userOutputs = (config.outputTargets || []).slice();
  userOutputs.forEach((outputTarget) => {
    if (!isValidConfigOutputTarget(outputTarget.type)) {
      const err = buildError(diagnostics);
      err.messageText = `Invalid outputTarget type "${outputTarget.type}". Valid outputTarget types include: ${VALID_CONFIG_OUTPUT_TARGETS.map((t) => `"${t}"`).join(', ')}`;
    }
    else if (outputTarget.type === DIST_CUSTOM_ELEMENTS_BUNDLE) {
      // TODO(STENCIL-260): Remove this check when the 'dist-custom-elements-bundle' is removed
      const warning = buildWarn(diagnostics);
      warning.messageText = `dist-custom-elements-bundle is deprecated and will be removed in a future major version release. Use "dist-custom-elements" instead. If "dist-custom-elements" does not meet your needs, please add a comment to https://github.com/ionic-team/stencil/issues/3136.`;
    }
  });
  config.outputTargets = [
    ...validateCollection(config, userOutputs),
    ...validateCustomElement(config, userOutputs),
    ...validateCustomElementBundle(config, userOutputs),
    ...validateCustomOutput(config, diagnostics, userOutputs),
    ...validateLazy(config, userOutputs),
    ...validateWww(config, diagnostics, userOutputs),
    ...validateDist(config, userOutputs),
    ...validateDocs(config, diagnostics, userOutputs),
    ...validateAngular(config, userOutputs),
    ...validateStats(config, userOutputs),
  ];
  // hydrate also gets info from the www output
  config.outputTargets = [
    ...config.outputTargets,
    ...validateHydrateScript(config, [...userOutputs, ...config.outputTargets]),
  ];
};

const validateDevServer = (config, diagnostics) => {
  var _a, _b, _c, _d, _e;
  if ((config.devServer === null || config.devServer) === false) {
    return undefined;
  }
  const { flags } = config;
  const devServer = { ...config.devServer };
  if (flags.address && isString$1(flags.address)) {
    devServer.address = flags.address;
  }
  else if (!isString$1(devServer.address)) {
    devServer.address = '0.0.0.0';
  }
  // default to http for localdev
  let addressProtocol = 'http';
  if (devServer.address.toLowerCase().startsWith('http://')) {
    devServer.address = devServer.address.substring(7);
    addressProtocol = 'http';
  }
  else if (devServer.address.toLowerCase().startsWith('https://')) {
    devServer.address = devServer.address.substring(8);
    addressProtocol = 'https';
  }
  devServer.address = devServer.address.split('/')[0];
  // split on `:` to get the domain and the (possibly present) port
  // separately. we've already sliced off the protocol (if present) above
  // so we can safely split on `:` here.
  const addressSplit = devServer.address.split(':');
  const isLocalhost = addressSplit[0] === 'localhost' || !isNaN(addressSplit[0].split('.')[0]);
  // if localhost we use 3333 as a default port
  let addressPort = isLocalhost ? 3333 : undefined;
  if (addressSplit.length > 1) {
    if (!isNaN(addressSplit[1])) {
      devServer.address = addressSplit[0];
      addressPort = parseInt(addressSplit[1], 10);
    }
  }
  if (isNumber$1(flags.port)) {
    devServer.port = flags.port;
  }
  else if (devServer.port !== null && !isNumber$1(devServer.port)) {
    if (isNumber$1(addressPort)) {
      devServer.port = addressPort;
    }
  }
  if (devServer.reloadStrategy === undefined) {
    devServer.reloadStrategy = 'hmr';
  }
  else if (devServer.reloadStrategy !== 'hmr' &&
    devServer.reloadStrategy !== 'pageReload' &&
    devServer.reloadStrategy !== null) {
    const err = buildError(diagnostics);
    err.messageText = `Invalid devServer reloadStrategy "${devServer.reloadStrategy}". Valid configs include "hmr", "pageReload" and null.`;
  }
  if (!isBoolean$1(devServer.gzip)) {
    devServer.gzip = true;
  }
  if (!isBoolean$1(devServer.openBrowser)) {
    devServer.openBrowser = true;
  }
  if (!isBoolean$1(devServer.websocket)) {
    devServer.websocket = true;
  }
  if (flags.ssr) {
    devServer.ssr = true;
  }
  else {
    devServer.ssr = !!devServer.ssr;
  }
  if (devServer.ssr) {
    const wwwOutput = ((_a = config.outputTargets) !== null && _a !== void 0 ? _a : []).find(isOutputTargetWww);
    devServer.prerenderConfig = wwwOutput === null || wwwOutput === void 0 ? void 0 : wwwOutput.prerenderConfig;
  }
  if (isString$1(config.srcIndexHtml)) {
    devServer.srcIndexHtml = normalizePath$2(config.srcIndexHtml);
  }
  if (devServer.protocol !== 'http' && devServer.protocol !== 'https') {
    devServer.protocol = devServer.https ? 'https' : addressProtocol ? addressProtocol : 'http';
  }
  if (devServer.historyApiFallback !== null) {
    if (Array.isArray(devServer.historyApiFallback) || typeof devServer.historyApiFallback !== 'object') {
      devServer.historyApiFallback = {};
    }
    if (!isString$1(devServer.historyApiFallback.index)) {
      devServer.historyApiFallback.index = 'index.html';
    }
    if (!isBoolean$1(devServer.historyApiFallback.disableDotRule)) {
      devServer.historyApiFallback.disableDotRule = false;
    }
  }
  if (flags.open === false) {
    devServer.openBrowser = false;
  }
  else if (flags.prerender && !config.watch) {
    devServer.openBrowser = false;
  }
  let serveDir;
  let basePath;
  const wwwOutputTarget = ((_b = config.outputTargets) !== null && _b !== void 0 ? _b : []).find(isOutputTargetWww);
  if (wwwOutputTarget) {
    const baseUrl = new URL((_c = wwwOutputTarget.baseUrl) !== null && _c !== void 0 ? _c : '', 'http://config.stenciljs.com');
    basePath = baseUrl.pathname;
    serveDir = (_d = wwwOutputTarget.appDir) !== null && _d !== void 0 ? _d : '';
  }
  else {
    basePath = '';
    serveDir = (_e = config.rootDir) !== null && _e !== void 0 ? _e : '';
  }
  if (!isString$1(basePath) || basePath.trim() === '') {
    basePath = `/`;
  }
  basePath = normalizePath$2(basePath);
  if (!basePath.startsWith('/')) {
    basePath = '/' + basePath;
  }
  if (!basePath.endsWith('/')) {
    basePath += '/';
  }
  if (!isBoolean$1(devServer.logRequests)) {
    devServer.logRequests = config.logLevel === 'debug';
  }
  if (!isString$1(devServer.root)) {
    devServer.root = serveDir;
  }
  if (!isString$1(devServer.basePath)) {
    devServer.basePath = basePath;
  }
  if (isString$1(devServer.baseUrl)) {
    const err = buildError(diagnostics);
    err.messageText = `devServer config "baseUrl" has been renamed to "basePath", and should not include a domain or protocol.`;
  }
  if (!isAbsolute$1(devServer.root)) {
    devServer.root = join(config.rootDir, devServer.root);
  }
  devServer.root = normalizePath$2(devServer.root);
  if (devServer.excludeHmr) {
    if (!Array.isArray(devServer.excludeHmr)) {
      const err = buildError(diagnostics);
      err.messageText = `dev server excludeHmr must be an array of glob strings`;
    }
  }
  else {
    devServer.excludeHmr = [];
  }
  if (!config.devMode || config.buildEs5) {
    devServer.experimentalDevModules = false;
  }
  else {
    devServer.experimentalDevModules = !!devServer.experimentalDevModules;
  }
  return devServer;
};

/**
 * Check the provided `.hydratedFlag` prop and return a properly-validated value.
 *
 * @param config the configuration we're examining
 * @returns a suitable value for the hydratedFlag property
 */
const validateHydrated = (config) => {
  /**
   * If `config.hydratedFlag` is set to `null` that is an explicit signal that we
   * should _not_ create a default configuration when validating and should instead
   * just return `undefined`. It may also have been set to `false`; this is an invalid
   * value as far as the type system is concerned, but users may ignore this.
   *
   * See {@link HydratedFlag} for more details.
   */
  if (config.hydratedFlag === null || config.hydratedFlag === false) {
    return undefined;
  }
  // Here we start building up a default config since `.hydratedFlag` wasn't set to
  // `null` on the provided config.
  const hydratedFlag = { ...config.hydratedFlag };
  if (!isString$1(hydratedFlag.name) || hydratedFlag.property === '') {
    hydratedFlag.name = `hydrated`;
  }
  if (hydratedFlag.selector === 'attribute') {
    hydratedFlag.selector = `attribute`;
  }
  else {
    hydratedFlag.selector = `class`;
  }
  if (!isString$1(hydratedFlag.property) || hydratedFlag.property === '') {
    hydratedFlag.property = `visibility`;
  }
  if (!isString$1(hydratedFlag.initialValue) && hydratedFlag.initialValue !== null) {
    hydratedFlag.initialValue = `hidden`;
  }
  if (!isString$1(hydratedFlag.hydratedValue) && hydratedFlag.initialValue !== null) {
    hydratedFlag.hydratedValue = `inherit`;
  }
  return hydratedFlag;
};

const validateNamespace = (c, diagnostics) => {
  c.namespace = isString$1(c.namespace) ? c.namespace : DEFAULT_NAMESPACE;
  c.namespace = c.namespace.trim();
  const invalidNamespaceChars = c.namespace.replace(/(\w)|(\-)|(\$)/g, '');
  if (invalidNamespaceChars !== '') {
    const err = buildError(diagnostics);
    err.messageText = `Namespace "${c.namespace}" contains invalid characters: ${invalidNamespaceChars}`;
  }
  if (c.namespace.length < 3) {
    const err = buildError(diagnostics);
    err.messageText = `Namespace "${c.namespace}" must be at least 3 characters`;
  }
  if (/^\d+$/.test(c.namespace.charAt(0))) {
    const err = buildError(diagnostics);
    err.messageText = `Namespace "${c.namespace}" cannot have a number for the first character`;
  }
  if (c.namespace.charAt(0) === '-') {
    const err = buildError(diagnostics);
    err.messageText = `Namespace "${c.namespace}" cannot have a dash for the first character`;
  }
  if (c.namespace.charAt(c.namespace.length - 1) === '-') {
    const err = buildError(diagnostics);
    err.messageText = `Namespace "${c.namespace}" cannot have a dash for the last character`;
  }
  // the file system namespace is the one
  // used in filenames and seen in the url
  if (!isString$1(c.fsNamespace)) {
    c.fsNamespace = c.namespace.toLowerCase().trim();
  }
  if (c.namespace.includes('-')) {
    // convert to PascalCase
    c.namespace = dashToPascalCase$1(c.namespace);
  }
};
const validateDistNamespace = (config, diagnostics) => {
  var _a;
  const hasDist = ((_a = config.outputTargets) !== null && _a !== void 0 ? _a : []).some(isOutputTargetDist);
  if (hasDist) {
    if (!isString$1(config.namespace) || config.namespace.toLowerCase() === 'app') {
      const err = buildError(diagnostics);
      err.messageText = `When generating a distribution it is recommended to choose a unique namespace rather than the default setting "App". Please updated the "namespace" config property within the stencil config.`;
    }
  }
};
const DEFAULT_NAMESPACE = 'App';

/**
 * Do logical-level validation (as opposed to type-level validation)
 * for various properties in the user-supplied config which represent
 * filesystem paths.
 *
 * @param config a validated user-supplied configuration
 */
const validatePaths = (config) => {
  if (typeof config.rootDir !== 'string') {
    config.rootDir = '/';
  }
  if (typeof config.srcDir !== 'string') {
    config.srcDir = DEFAULT_SRC_DIR;
  }
  if (!isAbsolute$1(config.srcDir)) {
    config.srcDir = join(config.rootDir, config.srcDir);
  }
  if (typeof config.cacheDir !== 'string') {
    config.cacheDir = DEFAULT_CACHE_DIR;
  }
  if (!isAbsolute$1(config.cacheDir)) {
    config.cacheDir = join(config.rootDir, config.cacheDir);
  }
  if (typeof config.srcIndexHtml !== 'string') {
    config.srcIndexHtml = join(config.srcDir, DEFAULT_INDEX_HTML);
  }
  if (!isAbsolute$1(config.srcIndexHtml)) {
    config.srcIndexHtml = join(config.rootDir, config.srcIndexHtml);
  }
  if (typeof config.globalScript === 'string' && !isAbsolute$1(config.globalScript)) {
    if (!isAbsolute$1(config.globalScript)) {
      config.globalScript = join(config.rootDir, config.globalScript);
    }
  }
  if (typeof config.globalStyle === 'string') {
    if (!isAbsolute$1(config.globalStyle)) {
      config.globalStyle = join(config.rootDir, config.globalStyle);
    }
  }
  if (config.writeLog) {
    if (typeof config.buildLogFilePath !== 'string') {
      config.buildLogFilePath = DEFAULT_BUILD_LOG_FILE_NAME;
    }
    if (!isAbsolute$1(config.buildLogFilePath)) {
      config.buildLogFilePath = join(config.rootDir, config.buildLogFilePath);
    }
  }
  config.packageJsonFilePath = join(config.rootDir, 'package.json');
};
const DEFAULT_BUILD_LOG_FILE_NAME = 'stencil-build.log';
const DEFAULT_CACHE_DIR = '.stencil';
const DEFAULT_INDEX_HTML = 'index.html';
const DEFAULT_SRC_DIR = 'src';

const validatePlugins = (config, diagnostics) => {
  const userPlugins = config.plugins;
  if (!config.rollupPlugins) {
    config.rollupPlugins = {};
  }
  if (!Array.isArray(userPlugins)) {
    config.plugins = [];
    return;
  }
  const rollupPlugins = userPlugins.filter((plugin) => {
    return !!(plugin && typeof plugin === 'object' && !plugin.pluginType);
  });
  const hasResolveNode = rollupPlugins.some((p) => p.name === 'node-resolve');
  const hasCommonjs = rollupPlugins.some((p) => p.name === 'commonjs');
  if (hasCommonjs) {
    const warn = buildWarn(diagnostics);
    warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
  You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
  }
  if (hasResolveNode) {
    const warn = buildWarn(diagnostics);
    warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
  You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
  }
  config.rollupPlugins.before = [
    ...(config.rollupPlugins.before || []),
    ...rollupPlugins.filter(({ name }) => name !== 'node-resolve' && name !== 'commonjs'),
  ];
  config.plugins = userPlugins.filter((plugin) => {
    return !!(plugin && typeof plugin === 'object' && plugin.pluginType);
  });
};

const validateRollupConfig = (config) => {
  const cleanRollupConfig = getCleanRollupConfig(config.rollupConfig);
  config.rollupConfig = cleanRollupConfig;
};
const getCleanRollupConfig = (rollupConfig) => {
  let cleanRollupConfig = DEFAULT_ROLLUP_CONFIG;
  if (!rollupConfig || !isObject$5(rollupConfig)) {
    return cleanRollupConfig;
  }
  if (rollupConfig.inputOptions && isObject$5(rollupConfig.inputOptions)) {
    cleanRollupConfig = {
      ...cleanRollupConfig,
      inputOptions: pluck(rollupConfig.inputOptions, ['context', 'moduleContext', 'treeshake']),
    };
  }
  if (rollupConfig.outputOptions && isObject$5(rollupConfig.outputOptions)) {
    cleanRollupConfig = {
      ...cleanRollupConfig,
      outputOptions: pluck(rollupConfig.outputOptions, ['globals']),
    };
  }
  return cleanRollupConfig;
};
const DEFAULT_ROLLUP_CONFIG = {
  inputOptions: {},
  outputOptions: {},
};

const validateTesting = (config, diagnostics) => {
  var _a;
  const testing = (config.testing = Object.assign({}, config.testing || {}));
  if (!config.flags.e2e && !config.flags.spec) {
    return;
  }
  let configPathDir = config.configPath;
  if (isString$1(configPathDir)) {
    if (basename(configPathDir).includes('.')) {
      configPathDir = dirname(configPathDir);
    }
  }
  else {
    configPathDir = config.rootDir;
  }
  if (typeof config.flags.headless === 'boolean') {
    testing.browserHeadless = config.flags.headless;
  }
  else if (typeof testing.browserHeadless !== 'boolean') {
    testing.browserHeadless = true;
  }
  if (!testing.browserWaitUntil) {
    testing.browserWaitUntil = 'load';
  }
  testing.browserArgs = testing.browserArgs || [];
  addTestingConfigOption(testing.browserArgs, '--font-render-hinting=medium');
  addTestingConfigOption(testing.browserArgs, '--incognito');
  if (config.flags.ci) {
    addTestingConfigOption(testing.browserArgs, '--no-sandbox');
    addTestingConfigOption(testing.browserArgs, '--disable-setuid-sandbox');
    addTestingConfigOption(testing.browserArgs, '--disable-dev-shm-usage');
    testing.browserHeadless = true;
  }
  if (typeof testing.rootDir === 'string') {
    if (!isAbsolute$1(testing.rootDir)) {
      testing.rootDir = join(config.rootDir, testing.rootDir);
    }
  }
  else {
    testing.rootDir = config.rootDir;
  }
  if (typeof config.flags.screenshotConnector === 'string') {
    testing.screenshotConnector = config.flags.screenshotConnector;
  }
  if (typeof testing.screenshotConnector === 'string') {
    if (!isAbsolute$1(testing.screenshotConnector)) {
      testing.screenshotConnector = join(config.rootDir, testing.screenshotConnector);
    }
  }
  else {
    testing.screenshotConnector = join(config.sys.getCompilerExecutingPath(), '..', '..', 'screenshot', 'local-connector.js');
  }
  if (!Array.isArray(testing.testPathIgnorePatterns)) {
    testing.testPathIgnorePatterns = DEFAULT_IGNORE_PATTERNS.map((ignorePattern) => {
      return join(testing.rootDir, ignorePattern);
    });
    ((_a = config.outputTargets) !== null && _a !== void 0 ? _a : [])
      .filter((o) => (isOutputTargetDist(o) || isOutputTargetWww(o)) && !!o.dir)
      .forEach((outputTarget) => {
      var _a;
      (_a = testing.testPathIgnorePatterns) === null || _a === void 0 ? void 0 : _a.push(outputTarget.dir);
    });
  }
  if (typeof testing.preset !== 'string') {
    testing.preset = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing');
  }
  else if (!isAbsolute$1(testing.preset)) {
    testing.preset = join(configPathDir, testing.preset);
  }
  if (!Array.isArray(testing.setupFilesAfterEnv)) {
    testing.setupFilesAfterEnv = [];
  }
  testing.setupFilesAfterEnv.unshift(join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-setuptestframework.js'));
  if (isString$1(testing.testEnvironment)) {
    if (!isAbsolute$1(testing.testEnvironment) && isLocalModule(testing.testEnvironment)) {
      testing.testEnvironment = join(configPathDir, testing.testEnvironment);
    }
  }
  if (typeof testing.allowableMismatchedPixels === 'number') {
    if (testing.allowableMismatchedPixels < 0) {
      const err = buildError(diagnostics);
      err.messageText = `allowableMismatchedPixels must be a value that is 0 or greater`;
    }
  }
  else {
    testing.allowableMismatchedPixels = DEFAULT_ALLOWABLE_MISMATCHED_PIXELS;
  }
  if (typeof testing.allowableMismatchedRatio === 'number') {
    if (testing.allowableMismatchedRatio < 0 || testing.allowableMismatchedRatio > 1) {
      const err = buildError(diagnostics);
      err.messageText = `allowableMismatchedRatio must be a value ranging from 0 to 1`;
    }
  }
  if (typeof testing.pixelmatchThreshold === 'number') {
    if (testing.pixelmatchThreshold < 0 || testing.pixelmatchThreshold > 1) {
      const err = buildError(diagnostics);
      err.messageText = `pixelmatchThreshold must be a value ranging from 0 to 1`;
    }
  }
  else {
    testing.pixelmatchThreshold = DEFAULT_PIXEL_MATCH_THRESHOLD;
  }
  if (testing.testRegex === undefined) {
    /**
     * The test regex covers cases of:
     * - files under a `__tests__` directory
     * - the case where a test file has a name such as `test.ts`, `spec.ts` or `e2e.ts`.
     *   - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
     *   - this regex only handles the entire path of a file, e.g. `/some/path/e2e.ts`
     * - the case where a test file ends with `.test.ts`, `.spec.ts`, or `.e2e.ts`.
     *   - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
     *   - this regex case shall match file names such as `my-cmp.spec.ts`, `test.spec.ts`
     *   - this regex case shall not match file names such as `attest.ts`, `bespec.ts`
     */
    testing.testRegex = '(/__tests__/.*|(\\.|/)(test|spec|e2e))\\.[jt]sx?$';
  }
  if (Array.isArray(testing.testMatch)) {
    delete testing.testRegex;
  }
  else if (typeof testing.testRegex === 'string') {
    delete testing.testMatch;
  }
  if (typeof testing.runner !== 'string') {
    testing.runner = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-runner.js');
  }
  if (typeof testing.waitBeforeScreenshot === 'number') {
    if (testing.waitBeforeScreenshot < 0) {
      const err = buildError(diagnostics);
      err.messageText = `waitBeforeScreenshot must be a value that is 0 or greater`;
    }
  }
  else {
    testing.waitBeforeScreenshot = 10;
  }
  if (!Array.isArray(testing.emulate) || testing.emulate.length === 0) {
    testing.emulate = [
      {
        userAgent: 'default',
        viewport: {
          width: 600,
          height: 600,
          deviceScaleFactor: 1,
          isMobile: false,
          hasTouch: false,
          isLandscape: false,
        },
      },
    ];
  }
};
const addTestingConfigOption = (setArray, option) => {
  if (!setArray.includes(option)) {
    setArray.push(option);
  }
};
const DEFAULT_ALLOWABLE_MISMATCHED_PIXELS = 100;
const DEFAULT_PIXEL_MATCH_THRESHOLD = 0.1;
const DEFAULT_IGNORE_PATTERNS = ['.vscode', '.stencil', 'node_modules'];

const validateWorkers = (config) => {
  if (typeof config.maxConcurrentWorkers !== 'number') {
    config.maxConcurrentWorkers = 8;
  }
  if (typeof config.flags.maxWorkers === 'number') {
    config.maxConcurrentWorkers = config.flags.maxWorkers;
  }
  else if (config.flags.ci) {
    config.maxConcurrentWorkers = 4;
  }
  config.maxConcurrentWorkers = Math.max(Math.min(config.maxConcurrentWorkers, 16), 0);
  if (config.devServer) {
    config.devServer.worker = config.maxConcurrentWorkers > 0;
  }
};

/**
 * Validate a Config object, ensuring that all its field are present and
 * consistent with our expectations. This function transforms an
 * `UnvalidatedConfig` to a `Config`.
 *
 * @param userConfig an unvalidated config that we've gotten from a user
 * @param bootstrapConfig the initial configuration provided by the user (or generated by Stencil) used to bootstrap
 * configuration loading and validation
 * @returns an object with config and diagnostics props
 */
const validateConfig = (userConfig = {}, bootstrapConfig) => {
  var _a, _b, _c, _d;
  const config = Object.assign({}, userConfig); // not positive it's json safe
  const diagnostics = [];
  const logger = bootstrapConfig.logger || config.logger || createLogger();
  const validatedConfig = {
    ...config,
    // flags _should_ be JSON safe
    flags: JSON.parse(JSON.stringify(config.flags || {})),
    logger,
    outputTargets: (_a = config.outputTargets) !== null && _a !== void 0 ? _a : [],
    rootDir: typeof config.rootDir === 'string' ? config.rootDir : '/',
    sys: (_c = (_b = config.sys) !== null && _b !== void 0 ? _b : bootstrapConfig.sys) !== null && _c !== void 0 ? _c : createSystem({ logger }),
    testing: (_d = config.testing) !== null && _d !== void 0 ? _d : {},
  };
  // default devMode false
  if (validatedConfig.flags.prod) {
    validatedConfig.devMode = false;
  }
  else if (validatedConfig.flags.dev) {
    validatedConfig.devMode = true;
  }
  else if (!isBoolean$1(validatedConfig.devMode)) {
    validatedConfig.devMode = DEFAULT_DEV_MODE;
  }
  validatedConfig.extras = validatedConfig.extras || {};
  validatedConfig.extras.appendChildSlotFix = !!validatedConfig.extras.appendChildSlotFix;
  validatedConfig.extras.cloneNodeFix = !!validatedConfig.extras.cloneNodeFix;
  validatedConfig.extras.cssVarsShim = !!validatedConfig.extras.cssVarsShim;
  validatedConfig.extras.dynamicImportShim = !!validatedConfig.extras.dynamicImportShim;
  validatedConfig.extras.lifecycleDOMEvents = !!validatedConfig.extras.lifecycleDOMEvents;
  validatedConfig.extras.safari10 = !!validatedConfig.extras.safari10;
  validatedConfig.extras.scriptDataOpts = !!validatedConfig.extras.scriptDataOpts;
  validatedConfig.extras.shadowDomShim = !!validatedConfig.extras.shadowDomShim;
  validatedConfig.extras.slotChildNodesFix = !!validatedConfig.extras.slotChildNodesFix;
  validatedConfig.extras.initializeNextTick = !!validatedConfig.extras.initializeNextTick;
  validatedConfig.extras.tagNameTransform = !!validatedConfig.extras.tagNameTransform;
  validatedConfig.buildEs5 =
    validatedConfig.buildEs5 === true || (!validatedConfig.devMode && validatedConfig.buildEs5 === 'prod');
  setBooleanConfig(validatedConfig, 'minifyCss', null, !validatedConfig.devMode);
  setBooleanConfig(validatedConfig, 'minifyJs', null, !validatedConfig.devMode);
  setBooleanConfig(validatedConfig, 'sourceMap', null, typeof validatedConfig.sourceMap === 'undefined' ? false : validatedConfig.sourceMap);
  setBooleanConfig(validatedConfig, 'watch', 'watch', false);
  setBooleanConfig(validatedConfig, 'buildDocs', 'docs', !validatedConfig.devMode);
  setBooleanConfig(validatedConfig, 'buildDist', 'esm', !validatedConfig.devMode || validatedConfig.buildEs5);
  setBooleanConfig(validatedConfig, 'profile', 'profile', validatedConfig.devMode);
  setBooleanConfig(validatedConfig, 'writeLog', 'log', false);
  setBooleanConfig(validatedConfig, 'buildAppCore', null, true);
  setBooleanConfig(validatedConfig, 'autoprefixCss', null, validatedConfig.buildEs5);
  setBooleanConfig(validatedConfig, 'validateTypes', null, !validatedConfig._isTesting);
  setBooleanConfig(validatedConfig, 'allowInlineScripts', null, true);
  if (!isString$1(validatedConfig.taskQueue)) {
    validatedConfig.taskQueue = 'async';
  }
  // hash file names
  if (!isBoolean$1(validatedConfig.hashFileNames)) {
    validatedConfig.hashFileNames = !validatedConfig.devMode;
  }
  if (!isNumber$1(validatedConfig.hashedFileNameLength)) {
    validatedConfig.hashedFileNameLength = DEFAULT_HASHED_FILENAME_LENTH;
  }
  if (validatedConfig.hashedFileNameLength < MIN_HASHED_FILENAME_LENTH) {
    const err = buildError(diagnostics);
    err.messageText = `validatedConfig.hashedFileNameLength must be at least ${MIN_HASHED_FILENAME_LENTH} characters`;
  }
  if (validatedConfig.hashedFileNameLength > MAX_HASHED_FILENAME_LENTH) {
    const err = buildError(diagnostics);
    err.messageText = `validatedConfig.hashedFileNameLength cannot be more than ${MAX_HASHED_FILENAME_LENTH} characters`;
  }
  if (!validatedConfig.env) {
    validatedConfig.env = {};
  }
  // get a good namespace
  validateNamespace(validatedConfig, diagnostics);
  // figure out all of the config paths and absolute paths
  validatePaths(validatedConfig);
  // outputTargets
  validateOutputTargets(validatedConfig, diagnostics);
  // plugins
  validatePlugins(validatedConfig, diagnostics);
  // rollup config
  validateRollupConfig(validatedConfig);
  // dev server
  validatedConfig.devServer = validateDevServer(validatedConfig, diagnostics);
  // testing
  validateTesting(validatedConfig, diagnostics);
  // hydrate flag
  validatedConfig.hydratedFlag = validateHydrated(validatedConfig);
  // bundles
  if (Array.isArray(validatedConfig.bundles)) {
    validatedConfig.bundles = sortBy(validatedConfig.bundles, (a) => a.components.length);
  }
  else {
    validatedConfig.bundles = [];
  }
  // validate how many workers we can use
  validateWorkers(validatedConfig);
  // default devInspector to whatever devMode is
  setBooleanConfig(validatedConfig, 'devInspector', null, validatedConfig.devMode);
  if (!validatedConfig._isTesting) {
    validateDistNamespace(validatedConfig, diagnostics);
  }
  setBooleanConfig(validatedConfig, 'enableCache', 'cache', true);
  if (!Array.isArray(validatedConfig.watchIgnoredRegex) && validatedConfig.watchIgnoredRegex != null) {
    validatedConfig.watchIgnoredRegex = [validatedConfig.watchIgnoredRegex];
  }
  validatedConfig.watchIgnoredRegex = (validatedConfig.watchIgnoredRegex || []).reduce((arr, reg) => {
    if (reg instanceof RegExp) {
      arr.push(reg);
    }
    return arr;
  }, []);
  return {
    config: validatedConfig,
    diagnostics,
  };
};
const DEFAULT_DEV_MODE = false;
const DEFAULT_HASHED_FILENAME_LENTH = 8;
const MIN_HASHED_FILENAME_LENTH = 4;
const MAX_HASHED_FILENAME_LENTH = 32;

/**
 * Load and validate a configuration to use throughout the lifetime of any Stencil task (build, test, etc.).
 *
 * Users can provide configurations multiple ways simultaneously:
 * - as an object of the `init` argument to this function
 * - through a path to a configuration file that exists on disk
 *
 * In the case of both being present, the two configurations will be merged. The fields of the former will take precedence
 * over the fields of the latter.
 *
 * @param init the initial configuration provided by the user (or generated by Stencil) used to bootstrap configuration
 * loading and validation
 * @returns the results of loading a configuration
 * @public
 */
const loadConfig = async (init = {}) => {
  var _a;
  const results = {
    config: null,
    diagnostics: [],
    tsconfig: {
      path: null,
      compilerOptions: null,
      files: null,
      include: null,
      exclude: null,
      extends: null,
    },
  };
  const unknownConfig = {};
  try {
    const config = init.config || {};
    let configPath = init.configPath || config.configPath;
    // Pull the {@link CompilerSystem} out of the initialization object, or create one if it does not exist.
    // This entity is needed to load the project's configuration (and therefore needs to be created before it can be
    // attached to a configuration entity, validated or otherwise)
    const sys = (_a = init.sys) !== null && _a !== void 0 ? _a : createSystem();
    const loadedConfigFile = await loadConfigFile(sys, results.diagnostics, configPath);
    if (hasError(results.diagnostics)) {
      return results;
    }
    if (loadedConfigFile !== null) {
      // merge the user's config object into their loaded config file
      configPath = loadedConfigFile.configPath;
      unknownConfig.config = { ...loadedConfigFile, ...config };
      unknownConfig.config.configPath = configPath;
      unknownConfig.config.rootDir = normalizePath$2(dirname(configPath));
    }
    else {
      // no stencil.config.ts or .js file, which is fine
      unknownConfig.config = { ...config };
      unknownConfig.config.configPath = null;
      unknownConfig.config.rootDir = normalizePath$2(sys.getCurrentDirectory());
    }
    unknownConfig.config.sys = sys;
    const validated = validateConfig(unknownConfig.config, init);
    results.diagnostics.push(...validated.diagnostics);
    if (hasError(results.diagnostics)) {
      return results;
    }
    results.config = validated.config;
    if (results.config.flags.debug || results.config.flags.verbose) {
      results.config.logLevel = 'debug';
    }
    else if (results.config.flags.logLevel) {
      results.config.logLevel = results.config.flags.logLevel;
    }
    else if (typeof results.config.logLevel !== 'string') {
      results.config.logLevel = 'info';
    }
    results.config.logger.setLevel(results.config.logLevel);
    if (!hasError(results.diagnostics)) {
      const tsConfigResults = await validateTsConfig(results.config, sys, init);
      results.diagnostics.push(...tsConfigResults.diagnostics);
      results.config.tsconfig = tsConfigResults.path;
      results.config.tsCompilerOptions = tsConfigResults.compilerOptions;
      results.tsconfig.path = tsConfigResults.path;
      results.tsconfig.compilerOptions = JSON.parse(JSON.stringify(tsConfigResults.compilerOptions));
      results.tsconfig.files = tsConfigResults.files;
      results.tsconfig.include = tsConfigResults.include;
      results.tsconfig.exclude = tsConfigResults.exclude;
      results.tsconfig.extends = tsConfigResults.extends;
    }
  }
  catch (e) {
    catchError(results.diagnostics, e);
  }
  return results;
};
/**
 * Load a Stencil configuration file from disk
 * @param sys the underlying System entity to use to interact with the operating system
 * @param diagnostics a series of diagnostics used to track errors & warnings throughout the loading process. Entries
 * may be added to this list in the event of an error.
 * @param configPath the path to the configuration file to load
 * @returns an unvalidated configuration. In the event of an error, additional diagnostics may be pushed to the
 * provided `diagnostics` argument and `null` will be returned.
 */
const loadConfigFile = async (sys, diagnostics, configPath) => {
  let config = null;
  if (isString$1(configPath)) {
    // the passed in config was a string, so it's probably a path to the config we need to load
    const configFileData = await evaluateConfigFile(sys, diagnostics, configPath);
    if (hasError(diagnostics)) {
      return config;
    }
    if (!configFileData.config) {
      const err = buildError(diagnostics);
      err.messageText = `Invalid Stencil configuration file "${configPath}". Missing "config" property.`;
      err.absFilePath = configPath;
      return config;
    }
    config = configFileData.config;
    config.configPath = normalizePath$2(configPath);
  }
  return config;
};
/**
 * Load the configuration file, based on the environment that Stencil is being run in
 * @param sys the underlying System entity to use to interact with the operating system
 * @param diagnostics a series of diagnostics used to track errors & warnings throughout the loading process. Entries
 * may be added to this list in the event of an error.
 * @param configFilePath the path to the configuration file to load
 * @returns an unvalidated configuration. In the event of an error, additional diagnostics may be pushed to the
 * provided `diagnostics` argument and `null` will be returned.
 */
const evaluateConfigFile = async (sys, diagnostics, configFilePath) => {
  let configFileData = null;
  try {
    if (IS_NODE_ENV) {
      const results = nodeRequire(configFilePath);
      diagnostics.push(...results.diagnostics);
      configFileData = results.module;
    }
    else {
      // browser environment, can't use node's require() to evaluate
      let sourceText = await sys.readFile(configFilePath);
      sourceText = transpileTypedConfig(diagnostics, sourceText, configFilePath);
      if (hasError(diagnostics)) {
        return configFileData;
      }
      const evalConfig = new Function(`const exports = {}; ${sourceText}; return exports;`);
      configFileData = evalConfig();
    }
  }
  catch (e) {
    catchError(diagnostics, e);
  }
  return configFileData;
};
/**
 * Transpiles the provided TypeScript source text into JavaScript.
 *
 * This function is intended to be used on a `stencil.config.ts` file
 *
 * @param diagnostics a collection of compiler diagnostics to check as a part of the compilation process
 * @param sourceText the text to transpile
 * @param filePath the name of the file to transpile
 * @returns the transpiled text. If there are any diagnostics in the provided collection, the provided source is returned
 */
const transpileTypedConfig = (diagnostics, sourceText, filePath) => {
  // let's transpile an awesome stencil.config.ts file into
  // a boring stencil.config.js file
  if (hasError(diagnostics)) {
    return sourceText;
  }
  const opts = {
    fileName: filePath,
    compilerOptions: {
      module: t.ModuleKind.CommonJS,
      moduleResolution: t.ModuleResolutionKind.NodeJs,
      esModuleInterop: true,
      target: t.ScriptTarget.ES2015,
      allowJs: true,
    },
    reportDiagnostics: false,
  };
  const output = t.transpileModule(sourceText, opts);
  return output.outputText;
};

const createHydrateBuildId = () => {
  // should be case insensitive because it could be in a URL
  // and shouldn't start with a number cuz we might use it as a js prop
  let chars = 'abcdefghijklmnopqrstuvwxyz';
  let buildId = '';
  while (buildId.length < 8) {
    const char = chars[Math.floor(Math.random() * chars.length)];
    buildId += char;
    if (buildId.length === 1) {
      chars += '0123456789';
    }
  }
  return buildId;
};

const getWriteFilePathFromUrlPath = (manager, inputHref) => {
  const baseUrl = new URL(manager.outputTarget.baseUrl, manager.devServerHostUrl);
  const basePathname = baseUrl.pathname.toLowerCase();
  const inputUrl = new URL(inputHref, manager.devServerHostUrl);
  const inputPathname = inputUrl.pathname.toLowerCase();
  const basePathParts = basePathname.split('/');
  const inputPathParts = inputPathname.split('/');
  const isPrerrenderRoot = basePathname === inputPathname;
  let fileName;
  if (isPrerrenderRoot) {
    fileName = path$5.basename(manager.outputTarget.indexHtml);
  }
  else {
    fileName = 'index.html';
  }
  const pathParts = [];
  for (let i = 0; i < inputPathParts.length; i++) {
    const basePathPart = basePathParts[i];
    const inputPathPart = inputPathParts[i];
    if (typeof basePathPart === 'string' && basePathPart === inputPathPart) {
      continue;
    }
    if (i === inputPathParts.length - 1) {
      const lastPart = inputPathParts[i].toLowerCase();
      if (lastPart.endsWith('.html') || lastPart.endsWith('.htm')) {
        fileName = inputPathParts[i];
        break;
      }
    }
    pathParts.push(inputPathPart);
  }
  pathParts.push(fileName);
  // figure out the directory where this file will be saved
  return path$5.join(manager.outputTarget.appDir, ...pathParts);
};

const initializePrerenderEntryUrls = (results, manager) => {
  const entryAnchors = [];
  if (Array.isArray(manager.prerenderConfig.entryUrls)) {
    for (const entryUrl of manager.prerenderConfig.entryUrls) {
      const entryAnchor = {
        href: entryUrl,
      };
      entryAnchors.push(entryAnchor);
    }
  }
  else {
    const entryAnchor = {
      href: manager.outputTarget.baseUrl,
    };
    entryAnchors.push(entryAnchor);
  }
  for (const entryAnchor of entryAnchors) {
    // ensure each entry url is valid
    // and has a domain
    try {
      new URL(entryAnchor.href, manager.outputTarget.baseUrl);
    }
    catch (e) {
      const diagnostic = buildError(results.diagnostics);
      diagnostic.header = `Invalid Prerender Entry Url: ${entryAnchor.href}`;
      diagnostic.messageText = `Entry Urls must include the protocol and domain of the site being prerendered.`;
      return;
    }
  }
  const base = new URL(manager.outputTarget.baseUrl);
  const hrefs = crawlAnchorsForNextUrls(manager.prerenderConfig, results.diagnostics, base, base, entryAnchors);
  for (const href of hrefs) {
    addUrlToPendingQueue(manager, href, '#entryUrl');
  }
};
const addUrlToPendingQueue = (manager, queueUrl, fromUrl) => {
  if (!isString$1(queueUrl) || queueUrl === '') {
    return;
  }
  if (manager.urlsPending.has(queueUrl)) {
    return;
  }
  if (manager.urlsProcessing.has(queueUrl)) {
    return;
  }
  if (manager.urlsCompleted.has(queueUrl)) {
    return;
  }
  manager.urlsPending.add(queueUrl);
  if (manager.isDebug) {
    const url = new URL(queueUrl, manager.outputTarget.baseUrl).pathname;
    const from = fromUrl.startsWith('#') ? fromUrl : new URL(fromUrl, manager.outputTarget.baseUrl).pathname;
    manager.config.logger.debug(`prerender queue: ${url} (from ${from})`);
  }
};
const drainPrerenderQueue = (results, manager) => {
  const nextUrl = manager.urlsPending.values().next();
  if (!nextUrl.done) {
    if (manager.urlsProcessing.size > manager.maxConcurrency) {
      // slow it down there buddy, too many at one time
      setTimeout(() => drainPrerenderQueue(results, manager));
    }
    else {
      const url = nextUrl.value;
      // looks like we're ready to prerender more
      // remove from pending
      manager.urlsPending.delete(url);
      // move to processing
      manager.urlsProcessing.add(url);
      // kick off async prerendering
      prerenderUrl(results, manager, url);
      if (manager.urlsProcessing.size < manager.maxConcurrency) {
        // could be more ready for prerendering
        // let's check again after a tick
        manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
      }
    }
  }
  if (manager.urlsProcessing.size === 0 && manager.urlsPending.size === 0) {
    if (isFunction(manager.resolve)) {
      // we're not actively processing anything
      // and there aren't anymore urls in the queue to be prerendered
      // so looks like our job here is done, good work team
      manager.resolve();
      manager.resolve = null;
    }
  }
};
const prerenderUrl = async (results, manager, url) => {
  let previewUrl = url;
  try {
    previewUrl = new URL(url).pathname;
    let timespan;
    if (manager.isDebug) {
      timespan = manager.config.logger.createTimeSpan(`prerender start: ${previewUrl}`, true);
    }
    const prerenderRequest = {
      appDir: manager.outputTarget.appDir,
      baseUrl: manager.outputTarget.baseUrl,
      buildId: results.buildId,
      componentGraphPath: manager.componentGraphPath,
      devServerHostUrl: manager.devServerHostUrl,
      hydrateAppFilePath: manager.hydrateAppFilePath,
      isDebug: manager.isDebug,
      prerenderConfigPath: manager.prerenderConfigPath,
      staticSite: manager.staticSite,
      templateId: manager.templateId,
      url: url,
      writeToFilePath: getWriteFilePathFromUrlPath(manager, url),
    };
    // prender this path and wait on the results
    const urlResults = await manager.prerenderUrlWorker(prerenderRequest);
    if (manager.isDebug) {
      const filePath = relative$1(manager.config.rootDir, urlResults.filePath);
      const hasError = urlResults.diagnostics.some((d) => d.level === 'error');
      if (hasError) {
        timespan.finish(`prerender failed: ${previewUrl}, ${filePath}`, 'red');
      }
      else {
        timespan.finish(`prerender finish: ${previewUrl}, ${filePath}`);
      }
    }
    manager.diagnostics.push(...urlResults.diagnostics);
    if (Array.isArray(urlResults.anchorUrls)) {
      for (const anchorUrl of urlResults.anchorUrls) {
        addUrlToPendingQueue(manager, anchorUrl, url);
      }
    }
  }
  catch (e) {
    // darn, idk, bad news
    catchError(manager.diagnostics, e);
  }
  manager.urlsProcessing.delete(url);
  manager.urlsCompleted.add(url);
  results.urls++;
  const urlsCompletedSize = manager.urlsCompleted.size;
  if (manager.progressLogger && urlsCompletedSize > 1) {
    manager.progressLogger.update(`       prerendered ${urlsCompletedSize} urls: ${manager.config.logger.dim(previewUrl)}`);
  }
  // let's try to drain the queue again and let this
  // next call figure out if we're actually done or not
  manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
};

const generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
  try {
    if (!isString$1(srcIndexHtmlPath)) {
      srcIndexHtmlPath = outputTarget.indexHtml;
    }
    let templateHtml;
    if (isFunction(prerenderConfig.loadTemplate)) {
      const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
      if (isPromise(loadTemplateResult)) {
        templateHtml = await loadTemplateResult;
      }
      else {
        templateHtml = loadTemplateResult;
      }
    }
    else {
      templateHtml = await config.sys.readFile(srcIndexHtmlPath);
    }
    let doc = createDocument(templateHtml);
    let staticSite = false;
    if (prerenderConfig.staticSite) {
      // purposely do not want any clientside JS
      // go through the document and remove only stencil's scripts
      removeStencilScripts(doc);
      staticSite = true;
    }
    else {
      // config didn't set if it's a staticSite only,
      // but the HTML may not have any stencil scripts at all,
      // so we'll need to know that so we don't add preload modules
      // if there isn't at least one stencil script then it's a static site
      staticSite = !hasStencilScript(doc);
    }
    doc.documentElement.classList.add('hydrated');
    if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
      try {
        await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
      }
      catch (e) {
        catchError(diagnostics, e);
      }
    }
    if (hydrateOpts.minifyScriptElements && !isDebug) {
      try {
        await minifyScriptElements(doc, true);
      }
      catch (e) {
        catchError(diagnostics, e);
      }
    }
    if (hydrateOpts.minifyStyleElements && !isDebug) {
      try {
        const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
        await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
      }
      catch (e) {
        catchError(diagnostics, e);
      }
    }
    if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
      const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
      if (isPromise(beforeSerializeResults)) {
        doc = await beforeSerializeResults;
      }
      else {
        doc = beforeSerializeResults;
      }
    }
    let html = serializeNodeToHtml(doc);
    if (isFunction(prerenderConfig.afterSerializeTemplate)) {
      const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
      if (isPromise(afterSerializeResults)) {
        html = await afterSerializeResults;
      }
      else {
        html = afterSerializeResults;
      }
    }
    return {
      html,
      staticSite,
    };
  }
  catch (e) {
    catchError(diagnostics, e);
  }
  return undefined;
};

const generateSitemapXml = async (manager) => {
  if (manager.prerenderConfig.sitemapXml === null) {
    // if it's set to null then let's not create a sitemap.xml file
    return null;
  }
  try {
    if (typeof manager.prerenderConfig.sitemapXml !== 'function') {
      // not set to null, but also no config.sitemapXml(), so let's make a default
      manager.prerenderConfig.sitemapXml = function sitemapXml(opts) {
        const content = [];
        content.push(`<?xml version="1.0" encoding="UTF-8"?>`);
        content.push(`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`);
        for (const url of opts.urls) {
          content.push(`<url><loc>${url}</loc></url>`);
        }
        content.push(`</urlset>`);
        return content.join('\n');
      };
    }
    const opts = {
      urls: getSitemapUrls(manager),
      baseUrl: manager.outputTarget.baseUrl,
      dir: manager.outputTarget.appDir,
    };
    const userResults = manager.prerenderConfig.sitemapXml(opts);
    if (userResults == null) {
      return null;
    }
    const results = {
      content: null,
      filePath: null,
      url: null,
    };
    if (typeof userResults === 'string') {
      results.content = userResults;
    }
    else {
      results.content = userResults.content;
      results.filePath = userResults.filePath;
    }
    if (typeof results.content !== 'string') {
      return null;
    }
    if (typeof results.filePath !== 'string') {
      results.filePath = join(manager.outputTarget.appDir, `sitemap.xml`);
    }
    if (typeof results.url !== 'string') {
      const sitemapUrl = new URL(`sitemap.xml`, manager.outputTarget.baseUrl);
      results.url = sitemapUrl.href;
    }
    await manager.config.sys.writeFile(results.filePath, results.content);
    return results;
  }
  catch (e) {
    catchError(manager.diagnostics, e);
    return null;
  }
};
const getSitemapUrls = (manager) => {
  const urls = [];
  if (typeof manager.prerenderConfig.canonicalUrl === 'function') {
    // user provide a canonicalUrl() function
    // use that to normalize the urls for the sitemap.xml
    // if it returned null then don't add it to the sitemap
    for (const url of manager.urlsCompleted) {
      const canonicalUrl = manager.prerenderConfig.canonicalUrl(new URL(url));
      if (typeof canonicalUrl === 'string' && canonicalUrl.trim() !== '') {
        urls.push(canonicalUrl);
      }
    }
  }
  else {
    for (const url of manager.urlsCompleted) {
      if (typeof url === 'string') {
        urls.push(url);
      }
    }
  }
  return urls.sort(sortUrls);
};
const sortUrls = (a, b) => {
  const partsA = a.split('/').length;
  const partsB = b.split('/').length;
  if (partsA < partsB)
    return -1;
  if (partsA > partsB)
    return 1;
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
};

const generateRobotsTxt = async (manager, sitemapResults) => {
  if (manager.prerenderConfig.robotsTxt === null) {
    // if it's set to null then let's not create a robots.txt file
    return null;
  }
  try {
    if (typeof manager.prerenderConfig.robotsTxt !== 'function') {
      // not set to null, but also no config.robotsTxt(), so let's make a default
      manager.prerenderConfig.robotsTxt = function robotsTxt(opts) {
        const content = [`User-agent: *`, `Disallow:`];
        if (typeof opts.sitemapUrl === 'string') {
          content.push(`Sitemap: ${opts.sitemapUrl}`);
        }
        return content.join('\n');
      };
    }
    const opts = {
      urls: getSitemapUrls(manager),
      baseUrl: manager.outputTarget.baseUrl,
      sitemapUrl: sitemapResults ? sitemapResults.url : null,
      dir: manager.outputTarget.dir,
    };
    const userResults = manager.prerenderConfig.robotsTxt(opts);
    if (userResults == null) {
      return null;
    }
    const results = {
      content: null,
      filePath: null,
      url: null,
    };
    if (typeof userResults === 'string') {
      results.content = userResults;
    }
    else {
      results.content = userResults.content;
      results.filePath = userResults.filePath;
    }
    if (typeof results.content !== 'string') {
      return null;
    }
    const lines = results.content.replace(/\r/g, '\n').split('\n');
    results.content = lines.map((l) => l.trim()).join('\n');
    if (typeof results.filePath !== 'string') {
      results.filePath = join(manager.outputTarget.dir, `robots.txt`);
    }
    if (typeof results.url !== 'string') {
      const robotsTxtUrl = new URL(`/robots.txt`, manager.outputTarget.baseUrl);
      results.url = robotsTxtUrl.href;
    }
    await manager.config.sys.writeFile(results.filePath, results.content);
    return results;
  }
  catch (e) {
    catchError(manager.diagnostics, e);
    return null;
  }
};

const createPrerenderer = async (config) => {
  const start = (opts) => {
    return runPrerender(config, opts.hydrateAppFilePath, opts.componentGraph, opts.srcIndexHtmlPath, opts.buildId);
  };
  return {
    start,
  };
};
const runPrerender = async (config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, buildId) => {
  const startTime = Date.now();
  const diagnostics = [];
  const results = {
    buildId,
    diagnostics,
    urls: 0,
    duration: 0,
    average: 0,
  };
  const outputTargets = config.outputTargets.filter(isOutputTargetWww).filter((o) => isString$1(o.indexHtml));
  if (!isString$1(results.buildId)) {
    results.buildId = createHydrateBuildId();
  }
  if (outputTargets.length === 0) {
    return results;
  }
  if (!isString$1(hydrateAppFilePath)) {
    const diagnostic = buildError(diagnostics);
    diagnostic.header = `Prerender Error`;
    diagnostic.messageText = `Build results missing "hydrateAppFilePath"`;
  }
  else {
    if (!isAbsolute$1(hydrateAppFilePath)) {
      hydrateAppFilePath = join(config.sys.getCurrentDirectory(), hydrateAppFilePath);
    }
    const hydrateAppExists = await config.sys.access(hydrateAppFilePath);
    if (!hydrateAppExists) {
      const diagnostic = buildError(diagnostics);
      diagnostic.header = `Prerender Error`;
      diagnostic.messageText = `Unable to open "hydrateAppFilePath": ${hydrateAppFilePath}`;
    }
  }
  if (!hasError(diagnostics)) {
    let workerCtx;
    let workerCtrl;
    if (config.sys.createWorkerController == null || config.maxConcurrentWorkers < 1) {
      workerCtx = createWorkerContext(config.sys);
    }
    else {
      workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
      workerCtx = createWorkerMainContext(workerCtrl);
    }
    const devServerConfig = { ...config.devServer };
    devServerConfig.openBrowser = false;
    devServerConfig.gzip = false;
    devServerConfig.logRequests = false;
    devServerConfig.reloadStrategy = null;
    const devServerPath = config.sys.getDevServerExecutingPath();
    const { start } = await config.sys.dynamicImport(devServerPath);
    const devServer = await start(devServerConfig, config.logger);
    try {
      await Promise.all(outputTargets.map((outputTarget) => {
        return runPrerenderOutputTarget(workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget);
      }));
    }
    catch (e) {
      catchError(diagnostics, e);
    }
    if (workerCtrl) {
      workerCtrl.destroy();
    }
    if (devServer) {
      await devServer.close();
    }
  }
  results.duration = Date.now() - startTime;
  if (results.urls > 0) {
    results.average = results.duration / results.urls;
  }
  return results;
};
const runPrerenderOutputTarget = async (workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget) => {
  try {
    const timeSpan = config.logger.createTimeSpan(`prerendering started`);
    const devServerBaseUrl = new URL(devServer.browserUrl);
    const devServerHostUrl = devServerBaseUrl.origin;
    const prerenderConfig = getPrerenderConfig(diagnostics, outputTarget.prerenderConfig);
    const hydrateOpts = getHydrateOptions(prerenderConfig, devServerBaseUrl, diagnostics);
    config.logger.debug(`prerender hydrate app: ${hydrateAppFilePath}`);
    config.logger.debug(`prerender dev server: ${devServerHostUrl}`);
    if (hasError(diagnostics)) {
      return;
    }
    // get the prerender urls to queue up
    const prerenderDiagnostics = [];
    const manager = {
      prerenderUrlWorker: (prerenderRequest) => workerCtx.prerenderWorker(prerenderRequest),
      componentGraphPath: null,
      config: config,
      diagnostics: prerenderDiagnostics,
      devServerHostUrl: devServerHostUrl,
      hydrateAppFilePath: hydrateAppFilePath,
      isDebug: config.logLevel === 'debug',
      logCount: 0,
      maxConcurrency: Math.max(20, config.maxConcurrentWorkers * 10),
      outputTarget: outputTarget,
      prerenderConfig: prerenderConfig,
      prerenderConfigPath: outputTarget.prerenderConfig,
      staticSite: false,
      templateId: null,
      urlsCompleted: new Set(),
      urlsPending: new Set(),
      urlsProcessing: new Set(),
      resolve: null,
    };
    if (!config.flags.ci && !manager.isDebug) {
      manager.progressLogger = await config.logger.createLineUpdater();
    }
    initializePrerenderEntryUrls(results, manager);
    if (manager.urlsPending.size === 0) {
      const err = buildError(diagnostics);
      err.messageText = `prerendering failed: no urls found in the prerender config`;
      return;
    }
    const templateData = await generateTemplateHtml(config, prerenderConfig, diagnostics, manager.isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager);
    if (diagnostics.length > 0 || !templateData || !isString$1(templateData.html)) {
      return;
    }
    manager.templateId = await createPrerenderTemplate(config, templateData.html);
    manager.staticSite = templateData.staticSite;
    manager.componentGraphPath = await createComponentGraphPath(config, componentGraph, outputTarget);
    await new Promise((resolve) => {
      manager.resolve = resolve;
      config.sys.nextTick(() => drainPrerenderQueue(results, manager));
    });
    if (manager.isDebug) {
      const debugDiagnostics = prerenderDiagnostics.filter((d) => d.level === 'debug');
      if (debugDiagnostics.length > 0) {
        config.logger.printDiagnostics(debugDiagnostics);
      }
    }
    const duration = timeSpan.duration();
    const sitemapResults = await generateSitemapXml(manager);
    await generateRobotsTxt(manager, sitemapResults);
    const prerenderBuildErrors = prerenderDiagnostics.filter((d) => d.level === 'error');
    const prerenderRuntimeErrors = prerenderDiagnostics.filter((d) => d.type === 'runtime');
    if (prerenderBuildErrors.length > 0) {
      // convert to just runtime errors so the other build files still write
      // but the CLI knows an error occurred and should have an exit code 1
      for (const diagnostic of prerenderBuildErrors) {
        diagnostic.type = 'runtime';
      }
      diagnostics.push(...prerenderBuildErrors);
    }
    diagnostics.push(...prerenderRuntimeErrors);
    // Clear progress logger
    if (manager.progressLogger) {
      await manager.progressLogger.stop();
    }
    const totalUrls = manager.urlsCompleted.size;
    if (totalUrls > 1) {
      const average = Math.round(duration / totalUrls);
      config.logger.info(`prerendered ${totalUrls} urls, averaging ${average} ms per url`);
    }
    const statusMessage = prerenderBuildErrors.length > 0 ? 'failed' : 'finished';
    const statusColor = prerenderBuildErrors.length > 0 ? 'red' : 'green';
    timeSpan.finish(`prerendering ${statusMessage}`, statusColor, true);
  }
  catch (e) {
    catchError(diagnostics, e);
  }
};
const createPrerenderTemplate = async (config, templateHtml) => {
  const hash = await config.sys.generateContentHash(templateHtml, 12);
  const templateFileName = `prerender-${hash}.html`;
  const templateId = join(config.sys.tmpDirSync(), templateFileName);
  config.logger.debug(`prerender template: ${templateId}`);
  config.sys.writeFileSync(templateId, templateHtml);
  return templateId;
};
const createComponentGraphPath = async (config, componentGraph, outputTarget) => {
  if (componentGraph) {
    const content = getComponentPathContent(componentGraph, outputTarget);
    const hash = await config.sys.generateContentHash(content);
    const fileName = `prerender-component-graph-${hash}.json`;
    const componentGraphPath = join(config.sys.tmpDirSync(), fileName);
    config.sys.writeFileSync(componentGraphPath, content);
    return componentGraphPath;
  }
  return null;
};
const getComponentPathContent = (componentGraph, outputTarget) => {
  const buildDir = getAbsoluteBuildDir(outputTarget);
  const object = {};
  const entries = Object.entries(componentGraph);
  for (const [key, chunks] of entries) {
    object[key] = chunks.map((filename) => join(buildDir, filename));
  }
  return JSON.stringify(object);
};

const dependencies = [
	{
		name: "@stencil/core",
		version: "2.22.3",
		main: "compiler/stencil.js",
		resources: [
			"package.json",
			"compiler/lib.d.ts",
			"compiler/lib.dom.d.ts",
			"compiler/lib.dom.iterable.d.ts",
			"compiler/lib.es2015.collection.d.ts",
			"compiler/lib.es2015.core.d.ts",
			"compiler/lib.es2015.d.ts",
			"compiler/lib.es2015.generator.d.ts",
			"compiler/lib.es2015.iterable.d.ts",
			"compiler/lib.es2015.promise.d.ts",
			"compiler/lib.es2015.proxy.d.ts",
			"compiler/lib.es2015.reflect.d.ts",
			"compiler/lib.es2015.symbol.d.ts",
			"compiler/lib.es2015.symbol.wellknown.d.ts",
			"compiler/lib.es2016.array.include.d.ts",
			"compiler/lib.es2016.d.ts",
			"compiler/lib.es2016.full.d.ts",
			"compiler/lib.es2017.d.ts",
			"compiler/lib.es2017.full.d.ts",
			"compiler/lib.es2017.intl.d.ts",
			"compiler/lib.es2017.object.d.ts",
			"compiler/lib.es2017.sharedmemory.d.ts",
			"compiler/lib.es2017.string.d.ts",
			"compiler/lib.es2017.typedarrays.d.ts",
			"compiler/lib.es2018.asyncgenerator.d.ts",
			"compiler/lib.es2018.asynciterable.d.ts",
			"compiler/lib.es2018.d.ts",
			"compiler/lib.es2018.full.d.ts",
			"compiler/lib.es2018.intl.d.ts",
			"compiler/lib.es2018.promise.d.ts",
			"compiler/lib.es2018.regexp.d.ts",
			"compiler/lib.es2019.array.d.ts",
			"compiler/lib.es2019.d.ts",
			"compiler/lib.es2019.full.d.ts",
			"compiler/lib.es2019.intl.d.ts",
			"compiler/lib.es2019.object.d.ts",
			"compiler/lib.es2019.string.d.ts",
			"compiler/lib.es2019.symbol.d.ts",
			"compiler/lib.es2020.bigint.d.ts",
			"compiler/lib.es2020.d.ts",
			"compiler/lib.es2020.date.d.ts",
			"compiler/lib.es2020.full.d.ts",
			"compiler/lib.es2020.intl.d.ts",
			"compiler/lib.es2020.number.d.ts",
			"compiler/lib.es2020.promise.d.ts",
			"compiler/lib.es2020.sharedmemory.d.ts",
			"compiler/lib.es2020.string.d.ts",
			"compiler/lib.es2020.symbol.wellknown.d.ts",
			"compiler/lib.es2021.d.ts",
			"compiler/lib.es2021.full.d.ts",
			"compiler/lib.es2021.intl.d.ts",
			"compiler/lib.es2021.promise.d.ts",
			"compiler/lib.es2021.string.d.ts",
			"compiler/lib.es2021.weakref.d.ts",
			"compiler/lib.es2022.array.d.ts",
			"compiler/lib.es2022.d.ts",
			"compiler/lib.es2022.error.d.ts",
			"compiler/lib.es2022.full.d.ts",
			"compiler/lib.es2022.intl.d.ts",
			"compiler/lib.es2022.object.d.ts",
			"compiler/lib.es2022.sharedmemory.d.ts",
			"compiler/lib.es2022.string.d.ts",
			"compiler/lib.es5.d.ts",
			"compiler/lib.es6.d.ts",
			"compiler/lib.esnext.d.ts",
			"compiler/lib.esnext.full.d.ts",
			"compiler/lib.esnext.intl.d.ts",
			"compiler/lib.esnext.promise.d.ts",
			"compiler/lib.esnext.string.d.ts",
			"compiler/lib.esnext.weakref.d.ts",
			"compiler/lib.scripthost.d.ts",
			"compiler/lib.webworker.d.ts",
			"compiler/lib.webworker.importscripts.d.ts",
			"compiler/lib.webworker.iterable.d.ts",
			"internal/index.d.ts",
			"internal/index.js",
			"internal/package.json",
			"internal/stencil-ext-modules.d.ts",
			"internal/stencil-private.d.ts",
			"internal/stencil-public-compiler.d.ts",
			"internal/stencil-public-docs.d.ts",
			"internal/stencil-public-runtime.d.ts",
			"mock-doc/index.js",
			"mock-doc/package.json",
			"internal/client/css-shim.js",
			"internal/client/dom.js",
			"internal/client/index.js",
			"internal/client/package.json",
			"internal/client/patch-browser.js",
			"internal/client/patch-esm.js",
			"internal/client/shadow-css.js",
			"internal/hydrate/index.js",
			"internal/hydrate/package.json",
			"internal/hydrate/runner.js",
			"internal/hydrate/shadow-css.js",
			"internal/stencil-core/index.d.ts",
			"internal/stencil-core/index.js"
		]
	},
	{
		name: "rollup",
		version: "2.42.3",
		main: "dist/es/rollup.browser.js"
	},
	{
		name: "terser",
		version: "5.16.1",
		main: "dist/bundle.min.js"
	},
	{
		name: "typescript",
		version: "4.9.4",
		main: "lib/typescript.js"
	}
];

const getTranspileResults = (code, input) => {
  if (!isString$1(input.file)) {
    input.file = 'module.tsx';
  }
  const parsedImport = parseImportPath(input.file);
  const results = {
    code: typeof code === 'string' ? code : '',
    data: [],
    diagnostics: [],
    inputFileExtension: parsedImport.ext,
    inputFilePath: input.file,
    imports: [],
    map: null,
    outputFilePath: null,
  };
  return {
    importData: parsedImport.data,
    results,
  };
};
const transpileCtx = { sys: null };
const getTranspileConfig = (input) => {
  if (input.sys) {
    transpileCtx.sys = input.sys;
  }
  else if (!transpileCtx.sys) {
    if (IS_NODE_ENV) {
      transpileCtx.sys = requireFunc('../sys/node/index.js').createNodeSys();
    }
    else {
      transpileCtx.sys = createSystem();
    }
  }
  const compileOpts = {
    componentExport: getTranspileConfigOpt(input.componentExport, VALID_EXPORT, 'customelement'),
    componentMetadata: getTranspileConfigOpt(input.componentMetadata, VALID_METADATA, null),
    coreImportPath: isString$1(input.coreImportPath) ? input.coreImportPath : STENCIL_INTERNAL_CLIENT_ID,
    currentDirectory: isString$1(input.currentDirectory)
      ? input.currentDirectory
      : transpileCtx.sys.getCurrentDirectory(),
    file: input.file,
    proxy: getTranspileConfigOpt(input.proxy, VALID_PROXY, 'defineproperty'),
    module: getTranspileConfigOpt(input.module, VALID_MODULE, 'esm'),
    sourceMap: input.sourceMap === 'inline' ? 'inline' : input.sourceMap !== false,
    style: getTranspileConfigOpt(input.style, VALID_STYLE, 'static'),
    styleImportData: getTranspileConfigOpt(input.styleImportData, VALID_STYLE_IMPORT_DATA, 'queryparams'),
    target: getTranspileConfigOpt(input.target, VALID_TARGET, 'latest'),
  };
  const tsCompilerOptions = {
    // best we always set this to true
    allowSyntheticDefaultImports: true,
    // best we always set this to true
    esModuleInterop: true,
    // always get source maps
    sourceMap: compileOpts.sourceMap !== false,
    // isolated per file transpiling
    isolatedModules: true,
    // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths.
    suppressOutputPathCheck: true,
    // Filename can be non-ts file.
    allowNonTsExtensions: true,
    // We are not returning a sourceFile for lib file when asked by the program,
    // so pass --noLib to avoid reporting a file not found error.
    noLib: true,
    noResolve: true,
    // NOTE: "module" and "target" configs will be set later
    // after the "ts" object has been loaded
  };
  if (isString$1(input.baseUrl)) {
    compileOpts.baseUrl = input.baseUrl;
    tsCompilerOptions.baseUrl = compileOpts.baseUrl;
  }
  if (input.paths) {
    compileOpts.paths = { ...input.paths };
    tsCompilerOptions.paths = { ...compileOpts.paths };
  }
  const transformOpts = {
    coreImportPath: compileOpts.coreImportPath,
    componentExport: compileOpts.componentExport,
    componentMetadata: compileOpts.componentMetadata,
    currentDirectory: compileOpts.currentDirectory,
    isolatedModules: true,
    module: compileOpts.module,
    proxy: compileOpts.proxy,
    file: compileOpts.file,
    style: compileOpts.style,
    styleImportData: compileOpts.styleImportData,
    target: compileOpts.target,
  };
  const config = {
    rootDir: compileOpts.currentDirectory,
    srcDir: compileOpts.currentDirectory,
    devMode: true,
    minifyCss: true,
    minifyJs: false,
    _isTesting: true,
    validateTypes: false,
    enableCache: false,
    sys: transpileCtx.sys,
    tsCompilerOptions,
  };
  return {
    compileOpts,
    config,
    transformOpts,
  };
};
const getTranspileCssConfig = (compileOpts, importData, results) => {
  const transformInput = {
    file: results.inputFilePath,
    input: results.code,
    tag: importData && importData.tag,
    encapsulation: importData && importData.encapsulation,
    mode: importData && importData.mode,
    sourceMap: compileOpts.sourceMap !== false,
    commentOriginalSelector: false,
    minify: false,
    autoprefixer: false,
    module: compileOpts.module,
    styleImportData: compileOpts.styleImportData,
  };
  return transformInput;
};
const getTranspileConfigOpt = (value, validValues, defaultValue) => {
  if (value === null || value === 'null') {
    return null;
  }
  value = isString$1(value) ? value.toLowerCase().trim() : null;
  if (validValues.has(value)) {
    return value;
  }
  return defaultValue;
};
const VALID_EXPORT = new Set(['customelement', 'module']);
const VALID_METADATA = new Set(['compilerstatic', null]);
const VALID_MODULE = new Set(['cjs', 'esm']);
const VALID_PROXY = new Set(['defineproperty', null]);
const VALID_STYLE = new Set(['static']);
const VALID_STYLE_IMPORT_DATA = new Set(['queryparams']);
const VALID_TARGET = new Set(['latest', 'esnext', 'es2020', 'es2019', 'es2018', 'es2017', 'es2016', 'es2015', 'es5']);

const convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
  return (transformCtx) => {
    let dirPath;
    let moduleFile;
    const visitNode = (node) => {
      if (t.isClassDeclaration(node)) {
        return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, transformOpts);
      }
      else if (t.isImportDeclaration(node)) {
        parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
      }
      else if (t.isCallExpression(node)) {
        parseCallExpression(moduleFile, node);
      }
      else if (t.isStringLiteral(node)) {
        parseStringLiteral(moduleFile, node);
      }
      return t.visitEachChild(node, visitNode, transformCtx);
    };
    return (tsSourceFile) => {
      dirPath = dirname(tsSourceFile.fileName);
      moduleFile = getModuleLegacy(config, compilerCtx, tsSourceFile.fileName);
      resetModuleLegacy(moduleFile);
      if (collection != null) {
        moduleFile.isCollectionDependency = true;
        moduleFile.collectionName = collection.collectionName;
        collection.moduleFiles.push(moduleFile);
      }
      else {
        moduleFile.isCollectionDependency = false;
        moduleFile.collectionName = null;
      }
      return visitNode(tsSourceFile);
    };
  };
};

/**
 * Stand-alone compiling of a single string
 * @param config the Stencil configuration to use in the compilation process
 * @param input the string to compile
 * @param transformOpts a configuration object for how the string is compiled
 * @returns the results of compiling the provided input string
 */
const transpileModule = (config, input, transformOpts) => {
  if (!config.logger) {
    config = {
      ...config,
      logger: createLogger(),
    };
  }
  const compilerCtx = new CompilerContext();
  const buildCtx = new BuildContext(config, compilerCtx);
  const tsCompilerOptions = {
    ...config.tsCompilerOptions,
  };
  let sourceFilePath = transformOpts.file;
  if (isString$1(sourceFilePath)) {
    sourceFilePath = normalizePath$2(sourceFilePath);
  }
  else {
    sourceFilePath = tsCompilerOptions.jsx ? `module.tsx` : `module.ts`;
  }
  const results = {
    sourceFilePath: sourceFilePath,
    code: null,
    map: null,
    diagnostics: [],
    moduleFile: null,
  };
  if (transformOpts.module === 'cjs') {
    tsCompilerOptions.module = t.ModuleKind.CommonJS;
  }
  else {
    tsCompilerOptions.module = t.ModuleKind.ESNext;
  }
  tsCompilerOptions.target = getScriptTargetKind(transformOpts);
  if ((sourceFilePath.endsWith('.tsx') || sourceFilePath.endsWith('.jsx')) && tsCompilerOptions.jsx == null) {
    // ensure we're setup for JSX in typescript
    tsCompilerOptions.jsx = t.JsxEmit.React;
  }
  if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFactory)) {
    tsCompilerOptions.jsxFactory = 'h';
  }
  if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFragmentFactory)) {
    tsCompilerOptions.jsxFragmentFactory = 'Fragment';
  }
  if (tsCompilerOptions.paths && !isString$1(tsCompilerOptions.baseUrl)) {
    tsCompilerOptions.baseUrl = '.';
  }
  const sourceFile = t.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
  // Create a compilerHost object to allow the compiler to read and write files
  const compilerHost = {
    getSourceFile: (fileName) => {
      return normalizePath$2(fileName) === normalizePath$2(sourceFilePath) ? sourceFile : undefined;
    },
    writeFile: (name, text) => {
      if (name.endsWith('.js.map')) {
        results.map = text;
      }
      else if (name.endsWith('.js')) {
        results.code = text;
      }
    },
    getDefaultLibFileName: () => `lib.d.ts`,
    useCaseSensitiveFileNames: () => false,
    getCanonicalFileName: (fileName) => fileName,
    getCurrentDirectory: () => transformOpts.currentDirectory || getCurrentDirectory(),
    getNewLine: () => t.sys.newLine || '\n',
    fileExists: (fileName) => normalizePath$2(fileName) === normalizePath$2(sourceFilePath),
    readFile: () => '',
    directoryExists: () => true,
    getDirectories: () => [],
  };
  const program = t.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
  const typeChecker = program.getTypeChecker();
  const after = [
    convertStaticToMeta(config, compilerCtx, buildCtx, typeChecker, null, transformOpts),
  ];
  if (transformOpts.componentExport === 'customelement' || transformOpts.componentExport === 'module') {
    after.push(nativeComponentTransform(compilerCtx, transformOpts));
  }
  else {
    after.push(lazyComponentTransform(compilerCtx, transformOpts));
  }
  program.emit(undefined, undefined, undefined, false, {
    before: [
      convertDecoratorsToStatic(config, buildCtx.diagnostics, typeChecker),
      updateStencilCoreImports(transformOpts.coreImportPath),
    ],
    after,
  });
  const tsDiagnostics = [...program.getSyntacticDiagnostics()];
  if (config.validateTypes) {
    tsDiagnostics.push(...program.getOptionsDiagnostics());
  }
  buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(tsDiagnostics));
  results.diagnostics.push(...buildCtx.diagnostics);
  results.moduleFile = compilerCtx.moduleMap.get(results.sourceFilePath);
  return results;
};
const getScriptTargetKind = (transformOpts) => {
  const target = transformOpts.target && transformOpts.target.toUpperCase();
  if (isNumber$1(t.ScriptTarget[target])) {
    return t.ScriptTarget[target];
  }
  // ESNext and Latest are the same
  return t.ScriptTarget.Latest;
};

/**
 * The `transpile()` function inputs source code as a string, with various options
 * within the second argument. The function is stateless and returns a `Promise` of the
 * results, including diagnostics and the transpiled code. The `transpile()` function
 * does not handle any bundling, minifying, or precompiling any CSS preprocessing like
 * Sass or Less. The `transpileSync()` equivalent is available so the same function
 * it can be called synchronously. However, TypeScript must be already loaded within
 * the global for it to work, where as the async `transpile()` function will load
 * TypeScript automatically.
 *
 * Since TypeScript is used, the source code will transpile from TypeScript to JavaScript,
 * and does not require Babel presets. Additionally, the results includes an `imports`
 * array of all the import paths found in the source file. The transpile options can be
 * used to set the `module` format, such as `cjs`, and JavaScript `target` version, such
 * as `es2017`.
 *
 * @param code the code to transpile
 * @param opts options for the transpilation process
 * @returns a Promise wrapping the results of the transpilation
 */
const transpile = async (code, opts = {}) => {
  const { importData, results } = getTranspileResults(code, opts);
  try {
    if (shouldTranspileModule(results.inputFileExtension)) {
      const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
      patchTypescript(config, null);
      transpileCode(config, compileOpts, transformOpts, results);
    }
    else if (results.inputFileExtension === 'd.ts') {
      results.code = '';
    }
    else if (results.inputFileExtension === 'css') {
      const transformInput = getTranspileCssConfig(opts, importData, results);
      await transpileCss(transformInput, results);
    }
    else if (results.inputFileExtension === 'json') {
      transpileJson(results);
    }
  }
  catch (e) {
    catchError(results.diagnostics, e);
  }
  return results;
};
/**
 * Synchronous equivalent of the `transpile()` function. When used in a browser
 * environment, TypeScript must already be available globally, where as the async
 * `transpile()` function will load TypeScript automatically.
 *
 * @param code the code to transpile
 * @param opts options for the transpilation process
 * @returns the results of the transpilation
 */
const transpileSync = (code, opts = {}) => {
  const { importData, results } = getTranspileResults(code, opts);
  try {
    if (shouldTranspileModule(results.inputFileExtension)) {
      const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
      patchTypescript(config, null);
      transpileCode(config, compileOpts, transformOpts, results);
    }
    else if (results.inputFileExtension === 'd.ts') {
      results.code = '';
    }
    else if (results.inputFileExtension === 'css') {
      const transformInput = getTranspileCssConfig(opts, importData, results);
      transpileCssSync(transformInput, results);
    }
    else if (results.inputFileExtension === 'json') {
      transpileJson(results);
    }
  }
  catch (e) {
    catchError(results.diagnostics, e);
  }
  return results;
};
const transpileCode = (config, transpileOpts, transformOpts, results) => {
  const transpileResults = transpileModule(config, results.code, transformOpts);
  results.diagnostics.push(...transpileResults.diagnostics);
  if (typeof transpileResults.code === 'string') {
    results.code = transpileResults.code;
    results.map = transpileResults.map;
    if (transpileOpts.sourceMap === 'inline') {
      try {
        const mapObject = JSON.parse(transpileResults.map);
        mapObject.file = transpileOpts.file;
        mapObject.sources = [transpileOpts.file];
        delete mapObject.sourceRoot;
        const sourceMapComment = results.code.lastIndexOf('//#');
        results.code =
          results.code.slice(0, sourceMapComment) + getInlineSourceMappingUrlLinker(JSON.stringify(mapObject));
      }
      catch (e) {
        console.error(e);
      }
    }
  }
  if (isString$1(transpileResults.sourceFilePath)) {
    results.inputFilePath = transpileResults.sourceFilePath;
  }
  const moduleFile = transpileResults.moduleFile;
  if (moduleFile) {
    results.outputFilePath = moduleFile.jsFilePath;
    moduleFile.cmps.forEach((cmp) => {
      results.data.push(getPublicCompilerMeta(cmp));
    });
    moduleFile.originalImports.forEach((originalImport) => {
      results.imports.push({
        path: originalImport,
      });
    });
  }
};
const transpileCss = async (transformInput, results) => {
  const cssResults = await transformCssToEsm(transformInput);
  results.code = cssResults.output;
  results.map = cssResults.map;
  results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
  results.diagnostics.push(...cssResults.diagnostics);
};
const transpileCssSync = (transformInput, results) => {
  const cssResults = transformCssToEsmSync(transformInput);
  results.code = cssResults.output;
  results.map = cssResults.map;
  results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
  results.diagnostics.push(...cssResults.diagnostics);
};
const transpileJson = (results) => {
  results.code = index.dataToEsm(JSON.parse(results.code), {
    preferConst: true,
    compact: false,
    indent: '  ',
  });
  results.map = { mappings: '' };
};
// NOTE: if you change this, also change scripts/bundles/helpers/jest/jest-preset.js
const shouldTranspileModule = (ext) => ['tsx', 'ts', 'mjs', 'jsx', 'js'].includes(ext);

if (IS_WEB_WORKER_ENV) {
  initWebWorkerThread(createWorkerMessageHandler(createSystem()));
}

exports.buildId = buildId;
exports.createCompiler = createCompiler;
exports.createPrerenderer = createPrerenderer;
exports.createSystem = createSystem;
exports.createWorkerContext = createWorkerContext;
exports.createWorkerMessageHandler = createWorkerMessageHandler;
exports.dependencies = dependencies;
exports.loadConfig = loadConfig;
exports.nodeRequire = nodeRequire;
exports.optimizeCss = optimizeCss$1;
exports.optimizeJs = optimizeJs;
exports.path = path$5;
exports.transpile = transpile;
exports.transpileSync = transpileSync;
exports.ts = t;
exports.vermoji = vermoji;
exports.version = version$3;
exports.versions = versions;

if (typeof module !== 'undefined' && module.exports) {
  module.exports = exports;
}
globalThis.stencil = exports;
})({});
//# sourceMappingURL=stencil.js.map
