(self["webpackChunkbrowser_extension"] = self["webpackChunkbrowser_extension"] || []).push([[53],{

/***/ 67362:
/***/ ((__unused_webpack_module, exports) => {

"use strict";


exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray

var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array

var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
  lookup[i] = code[i]
  revLookup[code.charCodeAt(i)] = i
}

// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63

function getLens (b64) {
  var len = b64.length

  if (len % 4 > 0) {
    throw new Error('Invalid string. Length must be a multiple of 4')
  }

  // Trim off extra bytes after placeholder bytes are found
  // See: https://github.com/beatgammit/base64-js/issues/42
  var validLen = b64.indexOf('=')
  if (validLen === -1) validLen = len

  var placeHoldersLen = validLen === len
    ? 0
    : 4 - (validLen % 4)

  return [validLen, placeHoldersLen]
}

// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function _byteLength (b64, validLen, placeHoldersLen) {
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function toByteArray (b64) {
  var tmp
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]

  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))

  var curByte = 0

  // if there are placeholders, only get up to the last complete 4 chars
  var len = placeHoldersLen > 0
    ? validLen - 4
    : validLen

  var i
  for (i = 0; i < len; i += 4) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 18) |
      (revLookup[b64.charCodeAt(i + 1)] << 12) |
      (revLookup[b64.charCodeAt(i + 2)] << 6) |
      revLookup[b64.charCodeAt(i + 3)]
    arr[curByte++] = (tmp >> 16) & 0xFF
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 2) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 2) |
      (revLookup[b64.charCodeAt(i + 1)] >> 4)
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 1) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 10) |
      (revLookup[b64.charCodeAt(i + 1)] << 4) |
      (revLookup[b64.charCodeAt(i + 2)] >> 2)
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  return arr
}

function tripletToBase64 (num) {
  return lookup[num >> 18 & 0x3F] +
    lookup[num >> 12 & 0x3F] +
    lookup[num >> 6 & 0x3F] +
    lookup[num & 0x3F]
}

function encodeChunk (uint8, start, end) {
  var tmp
  var output = []
  for (var i = start; i < end; i += 3) {
    tmp =
      ((uint8[i] << 16) & 0xFF0000) +
      ((uint8[i + 1] << 8) & 0xFF00) +
      (uint8[i + 2] & 0xFF)
    output.push(tripletToBase64(tmp))
  }
  return output.join('')
}

function fromByteArray (uint8) {
  var tmp
  var len = uint8.length
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  var parts = []
  var maxChunkLength = 16383 // must be multiple of 3

  // go through the array every three bytes, we'll deal with trailing stuff later
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  }

  // pad the end with zeros, but make sure to not forget the extra bytes
  if (extraBytes === 1) {
    tmp = uint8[len - 1]
    parts.push(
      lookup[tmp >> 2] +
      lookup[(tmp << 4) & 0x3F] +
      '=='
    )
  } else if (extraBytes === 2) {
    tmp = (uint8[len - 2] << 8) + uint8[len - 1]
    parts.push(
      lookup[tmp >> 10] +
      lookup[(tmp >> 4) & 0x3F] +
      lookup[(tmp << 2) & 0x3F] +
      '='
    )
  }

  return parts.join('')
}


/***/ }),

/***/ 46660:
/***/ (function(module) {

!function(e,t){ true?module.exports=t():0}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(r),a=Math.max(i,s),o=0,u=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(o=a-Math.min(i,s)),a-=1;a>=o;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===o)return 0;a-=1}else if(u[0][a]<u[1][a])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var o=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=s.length;t<r;t+=1)o();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0;t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"};t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"};t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"};t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"};t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},s=r(18);function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(r=null)&&a(t.prototype,r),n&&a(t,n),e}();t.default=o,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=u(r(92)),i=u(r(93)),s=u(r(94)),a=u(r(95)),o=u(r(17));function u(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=o.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=o.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=o.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return o.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},s=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,s+=1):"object"==typeof a&&(r[t]=a,n+=1)})),n>0){var a=Object.keys(r),u=o.default.find(a,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=o.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(s>0){var l=Object.keys(i),h=o.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=o.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(o.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n};var s=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})}));

/***/ }),

/***/ 78378:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var __webpack_unused_export__;
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
/* eslint-disable no-proto */



const base64 = __webpack_require__(67362)
const ieee754 = __webpack_require__(98319)
const customInspectSymbol =
  (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
    ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
    : null

exports.Buffer = Buffer
__webpack_unused_export__ = SlowBuffer
exports.INSPECT_MAX_BYTES = 50

const K_MAX_LENGTH = 0x7fffffff
__webpack_unused_export__ = K_MAX_LENGTH

/**
 * If `Buffer.TYPED_ARRAY_SUPPORT`:
 *   === true    Use Uint8Array implementation (fastest)
 *   === false   Print warning and recommend using `buffer` v4.x which has an Object
 *               implementation (most compatible, even IE6)
 *
 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
 * Opera 11.6+, iOS 4.2+.
 *
 * We report that the browser does not support typed arrays if the are not subclassable
 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
 * for __proto__ and has a buggy typed array implementation.
 */
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()

if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
    typeof console.error === 'function') {
  console.error(
    'This browser lacks typed array (Uint8Array) support which is required by ' +
    '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
  )
}

function typedArraySupport () {
  // Can typed array instances can be augmented?
  try {
    const arr = new Uint8Array(1)
    const proto = { foo: function () { return 42 } }
    Object.setPrototypeOf(proto, Uint8Array.prototype)
    Object.setPrototypeOf(arr, proto)
    return arr.foo() === 42
  } catch (e) {
    return false
  }
}

Object.defineProperty(Buffer.prototype, 'parent', {
  enumerable: true,
  get: function () {
    if (!Buffer.isBuffer(this)) return undefined
    return this.buffer
  }
})

Object.defineProperty(Buffer.prototype, 'offset', {
  enumerable: true,
  get: function () {
    if (!Buffer.isBuffer(this)) return undefined
    return this.byteOffset
  }
})

function createBuffer (length) {
  if (length > K_MAX_LENGTH) {
    throw new RangeError('The value "' + length + '" is invalid for option "size"')
  }
  // Return an augmented `Uint8Array` instance
  const buf = new Uint8Array(length)
  Object.setPrototypeOf(buf, Buffer.prototype)
  return buf
}

/**
 * The Buffer constructor returns instances of `Uint8Array` that have their
 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
 * returns a single octet.
 *
 * The `Uint8Array` prototype remains unmodified.
 */

function Buffer (arg, encodingOrOffset, length) {
  // Common case.
  if (typeof arg === 'number') {
    if (typeof encodingOrOffset === 'string') {
      throw new TypeError(
        'The "string" argument must be of type string. Received type number'
      )
    }
    return allocUnsafe(arg)
  }
  return from(arg, encodingOrOffset, length)
}

Buffer.poolSize = 8192 // not used by this implementation

function from (value, encodingOrOffset, length) {
  if (typeof value === 'string') {
    return fromString(value, encodingOrOffset)
  }

  if (ArrayBuffer.isView(value)) {
    return fromArrayView(value)
  }

  if (value == null) {
    throw new TypeError(
      'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
      'or Array-like Object. Received type ' + (typeof value)
    )
  }

  if (isInstance(value, ArrayBuffer) ||
      (value && isInstance(value.buffer, ArrayBuffer))) {
    return fromArrayBuffer(value, encodingOrOffset, length)
  }

  if (typeof SharedArrayBuffer !== 'undefined' &&
      (isInstance(value, SharedArrayBuffer) ||
      (value && isInstance(value.buffer, SharedArrayBuffer)))) {
    return fromArrayBuffer(value, encodingOrOffset, length)
  }

  if (typeof value === 'number') {
    throw new TypeError(
      'The "value" argument must not be of type number. Received type number'
    )
  }

  const valueOf = value.valueOf && value.valueOf()
  if (valueOf != null && valueOf !== value) {
    return Buffer.from(valueOf, encodingOrOffset, length)
  }

  const b = fromObject(value)
  if (b) return b

  if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
      typeof value[Symbol.toPrimitive] === 'function') {
    return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)
  }

  throw new TypeError(
    'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
    'or Array-like Object. Received type ' + (typeof value)
  )
}

/**
 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
 * if value is a number.
 * Buffer.from(str[, encoding])
 * Buffer.from(array)
 * Buffer.from(buffer)
 * Buffer.from(arrayBuffer[, byteOffset[, length]])
 **/
Buffer.from = function (value, encodingOrOffset, length) {
  return from(value, encodingOrOffset, length)
}

// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
Object.setPrototypeOf(Buffer, Uint8Array)

function assertSize (size) {
  if (typeof size !== 'number') {
    throw new TypeError('"size" argument must be of type number')
  } else if (size < 0) {
    throw new RangeError('The value "' + size + '" is invalid for option "size"')
  }
}

function alloc (size, fill, encoding) {
  assertSize(size)
  if (size <= 0) {
    return createBuffer(size)
  }
  if (fill !== undefined) {
    // Only pay attention to encoding if it's a string. This
    // prevents accidentally sending in a number that would
    // be interpreted as a start offset.
    return typeof encoding === 'string'
      ? createBuffer(size).fill(fill, encoding)
      : createBuffer(size).fill(fill)
  }
  return createBuffer(size)
}

/**
 * Creates a new filled Buffer instance.
 * alloc(size[, fill[, encoding]])
 **/
Buffer.alloc = function (size, fill, encoding) {
  return alloc(size, fill, encoding)
}

function allocUnsafe (size) {
  assertSize(size)
  return createBuffer(size < 0 ? 0 : checked(size) | 0)
}

/**
 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
 * */
Buffer.allocUnsafe = function (size) {
  return allocUnsafe(size)
}
/**
 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
 */
Buffer.allocUnsafeSlow = function (size) {
  return allocUnsafe(size)
}

function fromString (string, encoding) {
  if (typeof encoding !== 'string' || encoding === '') {
    encoding = 'utf8'
  }

  if (!Buffer.isEncoding(encoding)) {
    throw new TypeError('Unknown encoding: ' + encoding)
  }

  const length = byteLength(string, encoding) | 0
  let buf = createBuffer(length)

  const actual = buf.write(string, encoding)

  if (actual !== length) {
    // Writing a hex string, for example, that contains invalid characters will
    // cause everything after the first invalid character to be ignored. (e.g.
    // 'abxxcd' will be treated as 'ab')
    buf = buf.slice(0, actual)
  }

  return buf
}

function fromArrayLike (array) {
  const length = array.length < 0 ? 0 : checked(array.length) | 0
  const buf = createBuffer(length)
  for (let i = 0; i < length; i += 1) {
    buf[i] = array[i] & 255
  }
  return buf
}

function fromArrayView (arrayView) {
  if (isInstance(arrayView, Uint8Array)) {
    const copy = new Uint8Array(arrayView)
    return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
  }
  return fromArrayLike(arrayView)
}

function fromArrayBuffer (array, byteOffset, length) {
  if (byteOffset < 0 || array.byteLength < byteOffset) {
    throw new RangeError('"offset" is outside of buffer bounds')
  }

  if (array.byteLength < byteOffset + (length || 0)) {
    throw new RangeError('"length" is outside of buffer bounds')
  }

  let buf
  if (byteOffset === undefined && length === undefined) {
    buf = new Uint8Array(array)
  } else if (length === undefined) {
    buf = new Uint8Array(array, byteOffset)
  } else {
    buf = new Uint8Array(array, byteOffset, length)
  }

  // Return an augmented `Uint8Array` instance
  Object.setPrototypeOf(buf, Buffer.prototype)

  return buf
}

function fromObject (obj) {
  if (Buffer.isBuffer(obj)) {
    const len = checked(obj.length) | 0
    const buf = createBuffer(len)

    if (buf.length === 0) {
      return buf
    }

    obj.copy(buf, 0, 0, len)
    return buf
  }

  if (obj.length !== undefined) {
    if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
      return createBuffer(0)
    }
    return fromArrayLike(obj)
  }

  if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
    return fromArrayLike(obj.data)
  }
}

function checked (length) {
  // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
  // length is NaN (which is otherwise coerced to zero.)
  if (length >= K_MAX_LENGTH) {
    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                         'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
  }
  return length | 0
}

function SlowBuffer (length) {
  if (+length != length) { // eslint-disable-line eqeqeq
    length = 0
  }
  return Buffer.alloc(+length)
}

Buffer.isBuffer = function isBuffer (b) {
  return b != null && b._isBuffer === true &&
    b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}

Buffer.compare = function compare (a, b) {
  if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
  if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
    throw new TypeError(
      'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
    )
  }

  if (a === b) return 0

  let x = a.length
  let y = b.length

  for (let 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
}

Buffer.isEncoding = function isEncoding (encoding) {
  switch (String(encoding).toLowerCase()) {
    case 'hex':
    case 'utf8':
    case 'utf-8':
    case 'ascii':
    case 'latin1':
    case 'binary':
    case 'base64':
    case 'ucs2':
    case 'ucs-2':
    case 'utf16le':
    case 'utf-16le':
      return true
    default:
      return false
  }
}

Buffer.concat = function concat (list, length) {
  if (!Array.isArray(list)) {
    throw new TypeError('"list" argument must be an Array of Buffers')
  }

  if (list.length === 0) {
    return Buffer.alloc(0)
  }

  let i
  if (length === undefined) {
    length = 0
    for (i = 0; i < list.length; ++i) {
      length += list[i].length
    }
  }

  const buffer = Buffer.allocUnsafe(length)
  let pos = 0
  for (i = 0; i < list.length; ++i) {
    let buf = list[i]
    if (isInstance(buf, Uint8Array)) {
      if (pos + buf.length > buffer.length) {
        if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
        buf.copy(buffer, pos)
      } else {
        Uint8Array.prototype.set.call(
          buffer,
          buf,
          pos
        )
      }
    } else if (!Buffer.isBuffer(buf)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    } else {
      buf.copy(buffer, pos)
    }
    pos += buf.length
  }
  return buffer
}

function byteLength (string, encoding) {
  if (Buffer.isBuffer(string)) {
    return string.length
  }
  if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
    return string.byteLength
  }
  if (typeof string !== 'string') {
    throw new TypeError(
      'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
      'Received type ' + typeof string
    )
  }

  const len = string.length
  const mustMatch = (arguments.length > 2 && arguments[2] === true)
  if (!mustMatch && len === 0) return 0

  // Use a for loop to avoid recursion
  let loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'ascii':
      case 'latin1':
      case 'binary':
        return len
      case 'utf8':
      case 'utf-8':
        return utf8ToBytes(string).length
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return len * 2
      case 'hex':
        return len >>> 1
      case 'base64':
        return base64ToBytes(string).length
      default:
        if (loweredCase) {
          return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
        }
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}
Buffer.byteLength = byteLength

function slowToString (encoding, start, end) {
  let loweredCase = false

  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  // property of a typed array.

  // This behaves neither like String nor Uint8Array in that we set start/end
  // to their upper/lower bounds if the value passed is out of range.
  // undefined is handled specially as per ECMA-262 6th Edition,
  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  if (start === undefined || start < 0) {
    start = 0
  }
  // Return early if start > this.length. Done here to prevent potential uint32
  // coercion fail below.
  if (start > this.length) {
    return ''
  }

  if (end === undefined || end > this.length) {
    end = this.length
  }

  if (end <= 0) {
    return ''
  }

  // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
  end >>>= 0
  start >>>= 0

  if (end <= start) {
    return ''
  }

  if (!encoding) encoding = 'utf8'

  while (true) {
    switch (encoding) {
      case 'hex':
        return hexSlice(this, start, end)

      case 'utf8':
      case 'utf-8':
        return utf8Slice(this, start, end)

      case 'ascii':
        return asciiSlice(this, start, end)

      case 'latin1':
      case 'binary':
        return latin1Slice(this, start, end)

      case 'base64':
        return base64Slice(this, start, end)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return utf16leSlice(this, start, end)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = (encoding + '').toLowerCase()
        loweredCase = true
    }
  }
}

// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true

function swap (b, n, m) {
  const i = b[n]
  b[n] = b[m]
  b[m] = i
}

Buffer.prototype.swap16 = function swap16 () {
  const len = this.length
  if (len % 2 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 16-bits')
  }
  for (let i = 0; i < len; i += 2) {
    swap(this, i, i + 1)
  }
  return this
}

Buffer.prototype.swap32 = function swap32 () {
  const len = this.length
  if (len % 4 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 32-bits')
  }
  for (let i = 0; i < len; i += 4) {
    swap(this, i, i + 3)
    swap(this, i + 1, i + 2)
  }
  return this
}

Buffer.prototype.swap64 = function swap64 () {
  const len = this.length
  if (len % 8 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 64-bits')
  }
  for (let i = 0; i < len; i += 8) {
    swap(this, i, i + 7)
    swap(this, i + 1, i + 6)
    swap(this, i + 2, i + 5)
    swap(this, i + 3, i + 4)
  }
  return this
}

Buffer.prototype.toString = function toString () {
  const length = this.length
  if (length === 0) return ''
  if (arguments.length === 0) return utf8Slice(this, 0, length)
  return slowToString.apply(this, arguments)
}

Buffer.prototype.toLocaleString = Buffer.prototype.toString

Buffer.prototype.equals = function equals (b) {
  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  if (this === b) return true
  return Buffer.compare(this, b) === 0
}

Buffer.prototype.inspect = function inspect () {
  let str = ''
  const max = exports.INSPECT_MAX_BYTES
  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
  if (this.length > max) str += ' ... '
  return '<Buffer ' + str + '>'
}
if (customInspectSymbol) {
  Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
}

Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  if (isInstance(target, Uint8Array)) {
    target = Buffer.from(target, target.offset, target.byteLength)
  }
  if (!Buffer.isBuffer(target)) {
    throw new TypeError(
      'The "target" argument must be one of type Buffer or Uint8Array. ' +
      'Received type ' + (typeof target)
    )
  }

  if (start === undefined) {
    start = 0
  }
  if (end === undefined) {
    end = target ? target.length : 0
  }
  if (thisStart === undefined) {
    thisStart = 0
  }
  if (thisEnd === undefined) {
    thisEnd = this.length
  }

  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
    throw new RangeError('out of range index')
  }

  if (thisStart >= thisEnd && start >= end) {
    return 0
  }
  if (thisStart >= thisEnd) {
    return -1
  }
  if (start >= end) {
    return 1
  }

  start >>>= 0
  end >>>= 0
  thisStart >>>= 0
  thisEnd >>>= 0

  if (this === target) return 0

  let x = thisEnd - thisStart
  let y = end - start
  const len = Math.min(x, y)

  const thisCopy = this.slice(thisStart, thisEnd)
  const targetCopy = target.slice(start, end)

  for (let i = 0; i < len; ++i) {
    if (thisCopy[i] !== targetCopy[i]) {
      x = thisCopy[i]
      y = targetCopy[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  // Empty buffer means no match
  if (buffer.length === 0) return -1

  // Normalize byteOffset
  if (typeof byteOffset === 'string') {
    encoding = byteOffset
    byteOffset = 0
  } else if (byteOffset > 0x7fffffff) {
    byteOffset = 0x7fffffff
  } else if (byteOffset < -0x80000000) {
    byteOffset = -0x80000000
  }
  byteOffset = +byteOffset // Coerce to Number.
  if (numberIsNaN(byteOffset)) {
    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
    byteOffset = dir ? 0 : (buffer.length - 1)
  }

  // Normalize byteOffset: negative offsets start from the end of the buffer
  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  if (byteOffset >= buffer.length) {
    if (dir) return -1
    else byteOffset = buffer.length - 1
  } else if (byteOffset < 0) {
    if (dir) byteOffset = 0
    else return -1
  }

  // Normalize val
  if (typeof val === 'string') {
    val = Buffer.from(val, encoding)
  }

  // Finally, search either indexOf (if dir is true) or lastIndexOf
  if (Buffer.isBuffer(val)) {
    // Special case: looking for empty string/buffer always fails
    if (val.length === 0) {
      return -1
    }
    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  } else if (typeof val === 'number') {
    val = val & 0xFF // Search for a byte value [0-255]
    if (typeof Uint8Array.prototype.indexOf === 'function') {
      if (dir) {
        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
      } else {
        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
      }
    }
    return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
  }

  throw new TypeError('val must be string, number or Buffer')
}

function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  let indexSize = 1
  let arrLength = arr.length
  let valLength = val.length

  if (encoding !== undefined) {
    encoding = String(encoding).toLowerCase()
    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
        encoding === 'utf16le' || encoding === 'utf-16le') {
      if (arr.length < 2 || val.length < 2) {
        return -1
      }
      indexSize = 2
      arrLength /= 2
      valLength /= 2
      byteOffset /= 2
    }
  }

  function read (buf, i) {
    if (indexSize === 1) {
      return buf[i]
    } else {
      return buf.readUInt16BE(i * indexSize)
    }
  }

  let i
  if (dir) {
    let foundIndex = -1
    for (i = byteOffset; i < arrLength; i++) {
      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
        if (foundIndex === -1) foundIndex = i
        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
      } else {
        if (foundIndex !== -1) i -= i - foundIndex
        foundIndex = -1
      }
    }
  } else {
    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
    for (i = byteOffset; i >= 0; i--) {
      let found = true
      for (let j = 0; j < valLength; j++) {
        if (read(arr, i + j) !== read(val, j)) {
          found = false
          break
        }
      }
      if (found) return i
    }
  }

  return -1
}

Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  return this.indexOf(val, byteOffset, encoding) !== -1
}

Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}

Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}

function hexWrite (buf, string, offset, length) {
  offset = Number(offset) || 0
  const remaining = buf.length - offset
  if (!length) {
    length = remaining
  } else {
    length = Number(length)
    if (length > remaining) {
      length = remaining
    }
  }

  const strLen = string.length

  if (length > strLen / 2) {
    length = strLen / 2
  }
  let i
  for (i = 0; i < length; ++i) {
    const parsed = parseInt(string.substr(i * 2, 2), 16)
    if (numberIsNaN(parsed)) return i
    buf[offset + i] = parsed
  }
  return i
}

function utf8Write (buf, string, offset, length) {
  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}

function asciiWrite (buf, string, offset, length) {
  return blitBuffer(asciiToBytes(string), buf, offset, length)
}

function base64Write (buf, string, offset, length) {
  return blitBuffer(base64ToBytes(string), buf, offset, length)
}

function ucs2Write (buf, string, offset, length) {
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8'
    length = this.length
    offset = 0
  // Buffer#write(string, encoding)
  } else if (length === undefined && typeof offset === 'string') {
    encoding = offset
    length = this.length
    offset = 0
  // Buffer#write(string, offset[, length][, encoding])
  } else if (isFinite(offset)) {
    offset = offset >>> 0
    if (isFinite(length)) {
      length = length >>> 0
      if (encoding === undefined) encoding = 'utf8'
    } else {
      encoding = length
      length = undefined
    }
  } else {
    throw new Error(
      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
    )
  }

  const remaining = this.length - offset
  if (length === undefined || length > remaining) length = remaining

  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
    throw new RangeError('Attempt to write outside buffer bounds')
  }

  if (!encoding) encoding = 'utf8'

  let loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'hex':
        return hexWrite(this, string, offset, length)

      case 'utf8':
      case 'utf-8':
        return utf8Write(this, string, offset, length)

      case 'ascii':
      case 'latin1':
      case 'binary':
        return asciiWrite(this, string, offset, length)

      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        return base64Write(this, string, offset, length)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return ucs2Write(this, string, offset, length)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}

Buffer.prototype.toJSON = function toJSON () {
  return {
    type: 'Buffer',
    data: Array.prototype.slice.call(this._arr || this, 0)
  }
}

function base64Slice (buf, start, end) {
  if (start === 0 && end === buf.length) {
    return base64.fromByteArray(buf)
  } else {
    return base64.fromByteArray(buf.slice(start, end))
  }
}

function utf8Slice (buf, start, end) {
  end = Math.min(buf.length, end)
  const res = []

  let i = start
  while (i < end) {
    const firstByte = buf[i]
    let codePoint = null
    let bytesPerSequence = (firstByte > 0xEF)
      ? 4
      : (firstByte > 0xDF)
          ? 3
          : (firstByte > 0xBF)
              ? 2
              : 1

    if (i + bytesPerSequence <= end) {
      let secondByte, thirdByte, fourthByte, tempCodePoint

      switch (bytesPerSequence) {
        case 1:
          if (firstByte < 0x80) {
            codePoint = firstByte
          }
          break
        case 2:
          secondByte = buf[i + 1]
          if ((secondByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
            if (tempCodePoint > 0x7F) {
              codePoint = tempCodePoint
            }
          }
          break
        case 3:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
              codePoint = tempCodePoint
            }
          }
          break
        case 4:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          fourthByte = buf[i + 3]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
              codePoint = tempCodePoint
            }
          }
      }
    }

    if (codePoint === null) {
      // we did not generate a valid codePoint so insert a
      // replacement char (U+FFFD) and advance only 1 byte
      codePoint = 0xFFFD
      bytesPerSequence = 1
    } else if (codePoint > 0xFFFF) {
      // encode to utf16 (surrogate pair dance)
      codePoint -= 0x10000
      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
      codePoint = 0xDC00 | codePoint & 0x3FF
    }

    res.push(codePoint)
    i += bytesPerSequence
  }

  return decodeCodePointsArray(res)
}

// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
const MAX_ARGUMENTS_LENGTH = 0x1000

function decodeCodePointsArray (codePoints) {
  const len = codePoints.length
  if (len <= MAX_ARGUMENTS_LENGTH) {
    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  }

  // Decode in chunks to avoid "call stack size exceeded".
  let res = ''
  let i = 0
  while (i < len) {
    res += String.fromCharCode.apply(
      String,
      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
    )
  }
  return res
}

function asciiSlice (buf, start, end) {
  let ret = ''
  end = Math.min(buf.length, end)

  for (let i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i] & 0x7F)
  }
  return ret
}

function latin1Slice (buf, start, end) {
  let ret = ''
  end = Math.min(buf.length, end)

  for (let i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i])
  }
  return ret
}

function hexSlice (buf, start, end) {
  const len = buf.length

  if (!start || start < 0) start = 0
  if (!end || end < 0 || end > len) end = len

  let out = ''
  for (let i = start; i < end; ++i) {
    out += hexSliceLookupTable[buf[i]]
  }
  return out
}

function utf16leSlice (buf, start, end) {
  const bytes = buf.slice(start, end)
  let res = ''
  // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
  for (let i = 0; i < bytes.length - 1; i += 2) {
    res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
  }
  return res
}

Buffer.prototype.slice = function slice (start, end) {
  const len = this.length
  start = ~~start
  end = end === undefined ? len : ~~end

  if (start < 0) {
    start += len
    if (start < 0) start = 0
  } else if (start > len) {
    start = len
  }

  if (end < 0) {
    end += len
    if (end < 0) end = 0
  } else if (end > len) {
    end = len
  }

  if (end < start) end = start

  const newBuf = this.subarray(start, end)
  // Return an augmented `Uint8Array` instance
  Object.setPrototypeOf(newBuf, Buffer.prototype)

  return newBuf
}

/*
 * Need to make sure that buffer isn't trying to write out of bounds.
 */
function checkOffset (offset, ext, length) {
  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}

Buffer.prototype.readUintLE =
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let val = this[offset]
  let mul = 1
  let i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }

  return val
}

Buffer.prototype.readUintBE =
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    checkOffset(offset, byteLength, this.length)
  }

  let val = this[offset + --byteLength]
  let mul = 1
  while (byteLength > 0 && (mul *= 0x100)) {
    val += this[offset + --byteLength] * mul
  }

  return val
}

Buffer.prototype.readUint8 =
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 1, this.length)
  return this[offset]
}

Buffer.prototype.readUint16LE =
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  return this[offset] | (this[offset + 1] << 8)
}

Buffer.prototype.readUint16BE =
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  return (this[offset] << 8) | this[offset + 1]
}

Buffer.prototype.readUint32LE =
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return ((this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16)) +
      (this[offset + 3] * 0x1000000)
}

Buffer.prototype.readUint32BE =
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] * 0x1000000) +
    ((this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    this[offset + 3])
}

Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const lo = first +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 24

  const hi = this[++offset] +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    last * 2 ** 24

  return BigInt(lo) + (BigInt(hi) << BigInt(32))
})

Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const hi = first * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    this[++offset]

  const lo = this[++offset] * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    last

  return (BigInt(hi) << BigInt(32)) + BigInt(lo)
})

Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let val = this[offset]
  let mul = 1
  let i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let i = byteLength
  let mul = 1
  let val = this[offset + --i]
  while (i > 0 && (mul *= 0x100)) {
    val += this[offset + --i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 1, this.length)
  if (!(this[offset] & 0x80)) return (this[offset])
  return ((0xff - this[offset] + 1) * -1)
}

Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  const val = this[offset] | (this[offset + 1] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  const val = this[offset + 1] | (this[offset] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset]) |
    (this[offset + 1] << 8) |
    (this[offset + 2] << 16) |
    (this[offset + 3] << 24)
}

Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] << 24) |
    (this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    (this[offset + 3])
}

Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const val = this[offset + 4] +
    this[offset + 5] * 2 ** 8 +
    this[offset + 6] * 2 ** 16 +
    (last << 24) // Overflow

  return (BigInt(val) << BigInt(32)) +
    BigInt(first +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 24)
})

Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const val = (first << 24) + // Overflow
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    this[++offset]

  return (BigInt(val) << BigInt(32)) +
    BigInt(this[++offset] * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    last)
})

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, true, 23, 4)
}

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, false, 23, 4)
}

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, true, 52, 8)
}

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, false, 52, 8)
}

function checkInt (buf, value, offset, ext, max, min) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Buffer.prototype.writeUintLE =
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    const maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  let mul = 1
  let i = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUintBE =
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    const maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  let i = byteLength - 1
  let mul = 1
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUint8 =
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeUint16LE =
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  return offset + 2
}

Buffer.prototype.writeUint16BE =
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  this[offset] = (value >>> 8)
  this[offset + 1] = (value & 0xff)
  return offset + 2
}

Buffer.prototype.writeUint32LE =
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  this[offset + 3] = (value >>> 24)
  this[offset + 2] = (value >>> 16)
  this[offset + 1] = (value >>> 8)
  this[offset] = (value & 0xff)
  return offset + 4
}

Buffer.prototype.writeUint32BE =
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  this[offset] = (value >>> 24)
  this[offset + 1] = (value >>> 16)
  this[offset + 2] = (value >>> 8)
  this[offset + 3] = (value & 0xff)
  return offset + 4
}

function wrtBigUInt64LE (buf, value, offset, min, max) {
  checkIntBI(value, min, max, buf, offset, 7)

  let lo = Number(value & BigInt(0xffffffff))
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  return offset
}

function wrtBigUInt64BE (buf, value, offset, min, max) {
  checkIntBI(value, min, max, buf, offset, 7)

  let lo = Number(value & BigInt(0xffffffff))
  buf[offset + 7] = lo
  lo = lo >> 8
  buf[offset + 6] = lo
  lo = lo >> 8
  buf[offset + 5] = lo
  lo = lo >> 8
  buf[offset + 4] = lo
  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
  buf[offset + 3] = hi
  hi = hi >> 8
  buf[offset + 2] = hi
  hi = hi >> 8
  buf[offset + 1] = hi
  hi = hi >> 8
  buf[offset] = hi
  return offset + 8
}

Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {
  return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})

Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {
  return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})

Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    const limit = Math.pow(2, (8 * byteLength) - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  let i = 0
  let mul = 1
  let sub = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    const limit = Math.pow(2, (8 * byteLength) - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  let i = byteLength - 1
  let mul = 1
  let sub = 0
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  if (value < 0) value = 0xff + value + 1
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  return offset + 2
}

Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  this[offset] = (value >>> 8)
  this[offset + 1] = (value & 0xff)
  return offset + 2
}

Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  this[offset + 2] = (value >>> 16)
  this[offset + 3] = (value >>> 24)
  return offset + 4
}

Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (value < 0) value = 0xffffffff + value + 1
  this[offset] = (value >>> 24)
  this[offset + 1] = (value >>> 16)
  this[offset + 2] = (value >>> 8)
  this[offset + 3] = (value & 0xff)
  return offset + 4
}

Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {
  return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})

Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {
  return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})

function checkIEEE754 (buf, value, offset, ext, max, min) {
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
  if (offset < 0) throw new RangeError('Index out of range')
}

function writeFloat (buf, value, offset, littleEndian, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  }
  ieee754.write(buf, value, offset, littleEndian, 23, 4)
  return offset + 4
}

Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  return writeFloat(this, value, offset, true, noAssert)
}

Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  return writeFloat(this, value, offset, false, noAssert)
}

function writeDouble (buf, value, offset, littleEndian, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  }
  ieee754.write(buf, value, offset, littleEndian, 52, 8)
  return offset + 8
}

Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  return writeDouble(this, value, offset, true, noAssert)
}

Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  return writeDouble(this, value, offset, false, noAssert)
}

// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
  if (!start) start = 0
  if (!end && end !== 0) end = this.length
  if (targetStart >= target.length) targetStart = target.length
  if (!targetStart) targetStart = 0
  if (end > 0 && end < start) end = start

  // Copy 0 bytes; we're done
  if (end === start) return 0
  if (target.length === 0 || this.length === 0) return 0

  // Fatal error conditions
  if (targetStart < 0) {
    throw new RangeError('targetStart out of bounds')
  }
  if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
  if (end < 0) throw new RangeError('sourceEnd out of bounds')

  // Are we oob?
  if (end > this.length) end = this.length
  if (target.length - targetStart < end - start) {
    end = target.length - targetStart + start
  }

  const len = end - start

  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
    // Use built-in when available, missing from IE11
    this.copyWithin(targetStart, start, end)
  } else {
    Uint8Array.prototype.set.call(
      target,
      this.subarray(start, end),
      targetStart
    )
  }

  return len
}

// Usage:
//    buffer.fill(number[, offset[, end]])
//    buffer.fill(buffer[, offset[, end]])
//    buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
  // Handle string cases:
  if (typeof val === 'string') {
    if (typeof start === 'string') {
      encoding = start
      start = 0
      end = this.length
    } else if (typeof end === 'string') {
      encoding = end
      end = this.length
    }
    if (encoding !== undefined && typeof encoding !== 'string') {
      throw new TypeError('encoding must be a string')
    }
    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
      throw new TypeError('Unknown encoding: ' + encoding)
    }
    if (val.length === 1) {
      const code = val.charCodeAt(0)
      if ((encoding === 'utf8' && code < 128) ||
          encoding === 'latin1') {
        // Fast path: If `val` fits into a single byte, use that numeric value.
        val = code
      }
    }
  } else if (typeof val === 'number') {
    val = val & 255
  } else if (typeof val === 'boolean') {
    val = Number(val)
  }

  // Invalid ranges are not set to a default, so can range check early.
  if (start < 0 || this.length < start || this.length < end) {
    throw new RangeError('Out of range index')
  }

  if (end <= start) {
    return this
  }

  start = start >>> 0
  end = end === undefined ? this.length : end >>> 0

  if (!val) val = 0

  let i
  if (typeof val === 'number') {
    for (i = start; i < end; ++i) {
      this[i] = val
    }
  } else {
    const bytes = Buffer.isBuffer(val)
      ? val
      : Buffer.from(val, encoding)
    const len = bytes.length
    if (len === 0) {
      throw new TypeError('The value "' + val +
        '" is invalid for argument "value"')
    }
    for (i = 0; i < end - start; ++i) {
      this[i + start] = bytes[i % len]
    }
  }

  return this
}

// CUSTOM ERRORS
// =============

// Simplified versions from Node, changed for Buffer-only usage
const errors = {}
function E (sym, getMessage, Base) {
  errors[sym] = class NodeError extends Base {
    constructor () {
      super()

      Object.defineProperty(this, 'message', {
        value: getMessage.apply(this, arguments),
        writable: true,
        configurable: true
      })

      // Add the error code to the name to include it in the stack trace.
      this.name = `${this.name} [${sym}]`
      // Access the stack to generate the error message including the error code
      // from the name.
      this.stack // eslint-disable-line no-unused-expressions
      // Reset the name to the actual name.
      delete this.name
    }

    get code () {
      return sym
    }

    set code (value) {
      Object.defineProperty(this, 'code', {
        configurable: true,
        enumerable: true,
        value,
        writable: true
      })
    }

    toString () {
      return `${this.name} [${sym}]: ${this.message}`
    }
  }
}

E('ERR_BUFFER_OUT_OF_BOUNDS',
  function (name) {
    if (name) {
      return `${name} is outside of buffer bounds`
    }

    return 'Attempt to access memory outside buffer bounds'
  }, RangeError)
E('ERR_INVALID_ARG_TYPE',
  function (name, actual) {
    return `The "${name}" argument must be of type number. Received type ${typeof actual}`
  }, TypeError)
E('ERR_OUT_OF_RANGE',
  function (str, range, input) {
    let msg = `The value of "${str}" is out of range.`
    let received = input
    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
      received = addNumericalSeparator(String(input))
    } else if (typeof input === 'bigint') {
      received = String(input)
      if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
        received = addNumericalSeparator(received)
      }
      received += 'n'
    }
    msg += ` It must be ${range}. Received ${received}`
    return msg
  }, RangeError)

function addNumericalSeparator (val) {
  let res = ''
  let i = val.length
  const start = val[0] === '-' ? 1 : 0
  for (; i >= start + 4; i -= 3) {
    res = `_${val.slice(i - 3, i)}${res}`
  }
  return `${val.slice(0, i)}${res}`
}

// CHECK FUNCTIONS
// ===============

function checkBounds (buf, offset, byteLength) {
  validateNumber(offset, 'offset')
  if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
    boundsError(offset, buf.length - (byteLength + 1))
  }
}

function checkIntBI (value, min, max, buf, offset, byteLength) {
  if (value > max || value < min) {
    const n = typeof min === 'bigint' ? 'n' : ''
    let range
    if (byteLength > 3) {
      if (min === 0 || min === BigInt(0)) {
        range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`
      } else {
        range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +
                `${(byteLength + 1) * 8 - 1}${n}`
      }
    } else {
      range = `>= ${min}${n} and <= ${max}${n}`
    }
    throw new errors.ERR_OUT_OF_RANGE('value', range, value)
  }
  checkBounds(buf, offset, byteLength)
}

function validateNumber (value, name) {
  if (typeof value !== 'number') {
    throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)
  }
}

function boundsError (value, length, type) {
  if (Math.floor(value) !== value) {
    validateNumber(value, type)
    throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)
  }

  if (length < 0) {
    throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()
  }

  throw new errors.ERR_OUT_OF_RANGE(type || 'offset',
                                    `>= ${type ? 1 : 0} and <= ${length}`,
                                    value)
}

// HELPER FUNCTIONS
// ================

const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g

function base64clean (str) {
  // Node takes equal signs as end of the Base64 encoding
  str = str.split('=')[0]
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
  str = str.trim().replace(INVALID_BASE64_RE, '')
  // Node converts strings with length < 2 to ''
  if (str.length < 2) return ''
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  while (str.length % 4 !== 0) {
    str = str + '='
  }
  return str
}

function utf8ToBytes (string, units) {
  units = units || Infinity
  let codePoint
  const length = string.length
  let leadSurrogate = null
  const bytes = []

  for (let i = 0; i < length; ++i) {
    codePoint = string.charCodeAt(i)

    // is surrogate component
    if (codePoint > 0xD7FF && codePoint < 0xE000) {
      // last char was a lead
      if (!leadSurrogate) {
        // no lead yet
        if (codePoint > 0xDBFF) {
          // unexpected trail
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        } else if (i + 1 === length) {
          // unpaired lead
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        }

        // valid lead
        leadSurrogate = codePoint

        continue
      }

      // 2 leads in a row
      if (codePoint < 0xDC00) {
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
        leadSurrogate = codePoint
        continue
      }

      // valid surrogate pair
      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
    } else if (leadSurrogate) {
      // valid bmp char, but last char was a lead
      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
    }

    leadSurrogate = null

    // encode utf8
    if (codePoint < 0x80) {
      if ((units -= 1) < 0) break
      bytes.push(codePoint)
    } else if (codePoint < 0x800) {
      if ((units -= 2) < 0) break
      bytes.push(
        codePoint >> 0x6 | 0xC0,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x10000) {
      if ((units -= 3) < 0) break
      bytes.push(
        codePoint >> 0xC | 0xE0,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x110000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else {
      throw new Error('Invalid code point')
    }
  }

  return bytes
}

function asciiToBytes (str) {
  const byteArray = []
  for (let i = 0; i < str.length; ++i) {
    // Node's code seems to be doing this and not & 0x7F..
    byteArray.push(str.charCodeAt(i) & 0xFF)
  }
  return byteArray
}

function utf16leToBytes (str, units) {
  let c, hi, lo
  const byteArray = []
  for (let i = 0; i < str.length; ++i) {
    if ((units -= 2) < 0) break

    c = str.charCodeAt(i)
    hi = c >> 8
    lo = c % 256
    byteArray.push(lo)
    byteArray.push(hi)
  }

  return byteArray
}

function base64ToBytes (str) {
  return base64.toByteArray(base64clean(str))
}

function blitBuffer (src, dst, offset, length) {
  let i
  for (i = 0; i < length; ++i) {
    if ((i + offset >= dst.length) || (i >= src.length)) break
    dst[i + offset] = src[i]
  }
  return i
}

// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
  return obj instanceof type ||
    (obj != null && obj.constructor != null && obj.constructor.name != null &&
      obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
  // For IE11 support
  return obj !== obj // eslint-disable-line no-self-compare
}

// Create lookup table for `toString('hex')`
// See: https://github.com/feross/buffer/issues/219
const hexSliceLookupTable = (function () {
  const alphabet = '0123456789abcdef'
  const table = new Array(256)
  for (let i = 0; i < 16; ++i) {
    const i16 = i * 16
    for (let j = 0; j < 16; ++j) {
      table[i16 + j] = alphabet[i] + alphabet[j]
    }
  }
  return table
})()

// Return not function with Error if BigInt not supported
function defineBigIntMethod (fn) {
  return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn
}

function BufferBigIntNotDefined () {
  throw new Error('BigInt not supported')
}


/***/ }),

/***/ 50608:
/***/ (function(module) {

(function webpackUniversalModuleDefinition(root, factory) {
/* istanbul ignore next */
	if(true)
		module.exports = factory();
	else {}
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __nested_webpack_require_583__(moduleId) {

/******/ 		// Check if module is in cache
/* istanbul ignore if */
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_583__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__nested_webpack_require_583__.m = modules;

/******/ 	// expose the module cache
/******/ 	__nested_webpack_require_583__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__nested_webpack_require_583__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __nested_webpack_require_583__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __nested_webpack_require_1808__) {

	"use strict";
	/*
	  Copyright JS Foundation and other contributors, https://js.foundation/

	  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.

	  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 <COPYRIGHT HOLDER> 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.
	*/
	Object.defineProperty(exports, "__esModule", { value: true });
	var comment_handler_1 = __nested_webpack_require_1808__(1);
	var jsx_parser_1 = __nested_webpack_require_1808__(3);
	var parser_1 = __nested_webpack_require_1808__(8);
	var tokenizer_1 = __nested_webpack_require_1808__(15);
	function parse(code, options, delegate) {
	    var commentHandler = null;
	    var proxyDelegate = function (node, metadata) {
	        if (delegate) {
	            delegate(node, metadata);
	        }
	        if (commentHandler) {
	            commentHandler.visit(node, metadata);
	        }
	    };
	    var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
	    var collectComment = false;
	    if (options) {
	        collectComment = (typeof options.comment === 'boolean' && options.comment);
	        var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
	        if (collectComment || attachComment) {
	            commentHandler = new comment_handler_1.CommentHandler();
	            commentHandler.attach = attachComment;
	            options.comment = true;
	            parserDelegate = proxyDelegate;
	        }
	    }
	    var isModule = false;
	    if (options && typeof options.sourceType === 'string') {
	        isModule = (options.sourceType === 'module');
	    }
	    var parser;
	    if (options && typeof options.jsx === 'boolean' && options.jsx) {
	        parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
	    }
	    else {
	        parser = new parser_1.Parser(code, options, parserDelegate);
	    }
	    var program = isModule ? parser.parseModule() : parser.parseScript();
	    var ast = program;
	    if (collectComment && commentHandler) {
	        ast.comments = commentHandler.comments;
	    }
	    if (parser.config.tokens) {
	        ast.tokens = parser.tokens;
	    }
	    if (parser.config.tolerant) {
	        ast.errors = parser.errorHandler.errors;
	    }
	    return ast;
	}
	exports.parse = parse;
	function parseModule(code, options, delegate) {
	    var parsingOptions = options || {};
	    parsingOptions.sourceType = 'module';
	    return parse(code, parsingOptions, delegate);
	}
	exports.parseModule = parseModule;
	function parseScript(code, options, delegate) {
	    var parsingOptions = options || {};
	    parsingOptions.sourceType = 'script';
	    return parse(code, parsingOptions, delegate);
	}
	exports.parseScript = parseScript;
	function tokenize(code, options, delegate) {
	    var tokenizer = new tokenizer_1.Tokenizer(code, options);
	    var tokens;
	    tokens = [];
	    try {
	        while (true) {
	            var token = tokenizer.getNextToken();
	            if (!token) {
	                break;
	            }
	            if (delegate) {
	                token = delegate(token);
	            }
	            tokens.push(token);
	        }
	    }
	    catch (e) {
	        tokenizer.errorHandler.tolerate(e);
	    }
	    if (tokenizer.errorHandler.tolerant) {
	        tokens.errors = tokenizer.errors();
	    }
	    return tokens;
	}
	exports.tokenize = tokenize;
	var syntax_1 = __nested_webpack_require_1808__(2);
	exports.Syntax = syntax_1.Syntax;
	// Sync with *.json manifests.
	exports.version = '4.0.1';


/***/ },
/* 1 */
/***/ function(module, exports, __nested_webpack_require_6456__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var syntax_1 = __nested_webpack_require_6456__(2);
	var CommentHandler = (function () {
	    function CommentHandler() {
	        this.attach = false;
	        this.comments = [];
	        this.stack = [];
	        this.leading = [];
	        this.trailing = [];
	    }
	    CommentHandler.prototype.insertInnerComments = function (node, metadata) {
	        //  innnerComments for properties empty block
	        //  `function a() {/** comments **\/}`
	        if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
	            var innerComments = [];
	            for (var i = this.leading.length - 1; i >= 0; --i) {
	                var entry = this.leading[i];
	                if (metadata.end.offset >= entry.start) {
	                    innerComments.unshift(entry.comment);
	                    this.leading.splice(i, 1);
	                    this.trailing.splice(i, 1);
	                }
	            }
	            if (innerComments.length) {
	                node.innerComments = innerComments;
	            }
	        }
	    };
	    CommentHandler.prototype.findTrailingComments = function (metadata) {
	        var trailingComments = [];
	        if (this.trailing.length > 0) {
	            for (var i = this.trailing.length - 1; i >= 0; --i) {
	                var entry_1 = this.trailing[i];
	                if (entry_1.start >= metadata.end.offset) {
	                    trailingComments.unshift(entry_1.comment);
	                }
	            }
	            this.trailing.length = 0;
	            return trailingComments;
	        }
	        var entry = this.stack[this.stack.length - 1];
	        if (entry && entry.node.trailingComments) {
	            var firstComment = entry.node.trailingComments[0];
	            if (firstComment && firstComment.range[0] >= metadata.end.offset) {
	                trailingComments = entry.node.trailingComments;
	                delete entry.node.trailingComments;
	            }
	        }
	        return trailingComments;
	    };
	    CommentHandler.prototype.findLeadingComments = function (metadata) {
	        var leadingComments = [];
	        var target;
	        while (this.stack.length > 0) {
	            var entry = this.stack[this.stack.length - 1];
	            if (entry && entry.start >= metadata.start.offset) {
	                target = entry.node;
	                this.stack.pop();
	            }
	            else {
	                break;
	            }
	        }
	        if (target) {
	            var count = target.leadingComments ? target.leadingComments.length : 0;
	            for (var i = count - 1; i >= 0; --i) {
	                var comment = target.leadingComments[i];
	                if (comment.range[1] <= metadata.start.offset) {
	                    leadingComments.unshift(comment);
	                    target.leadingComments.splice(i, 1);
	                }
	            }
	            if (target.leadingComments && target.leadingComments.length === 0) {
	                delete target.leadingComments;
	            }
	            return leadingComments;
	        }
	        for (var i = this.leading.length - 1; i >= 0; --i) {
	            var entry = this.leading[i];
	            if (entry.start <= metadata.start.offset) {
	                leadingComments.unshift(entry.comment);
	                this.leading.splice(i, 1);
	            }
	        }
	        return leadingComments;
	    };
	    CommentHandler.prototype.visitNode = function (node, metadata) {
	        if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
	            return;
	        }
	        this.insertInnerComments(node, metadata);
	        var trailingComments = this.findTrailingComments(metadata);
	        var leadingComments = this.findLeadingComments(metadata);
	        if (leadingComments.length > 0) {
	            node.leadingComments = leadingComments;
	        }
	        if (trailingComments.length > 0) {
	            node.trailingComments = trailingComments;
	        }
	        this.stack.push({
	            node: node,
	            start: metadata.start.offset
	        });
	    };
	    CommentHandler.prototype.visitComment = function (node, metadata) {
	        var type = (node.type[0] === 'L') ? 'Line' : 'Block';
	        var comment = {
	            type: type,
	            value: node.value
	        };
	        if (node.range) {
	            comment.range = node.range;
	        }
	        if (node.loc) {
	            comment.loc = node.loc;
	        }
	        this.comments.push(comment);
	        if (this.attach) {
	            var entry = {
	                comment: {
	                    type: type,
	                    value: node.value,
	                    range: [metadata.start.offset, metadata.end.offset]
	                },
	                start: metadata.start.offset
	            };
	            if (node.loc) {
	                entry.comment.loc = node.loc;
	            }
	            node.type = type;
	            this.leading.push(entry);
	            this.trailing.push(entry);
	        }
	    };
	    CommentHandler.prototype.visit = function (node, metadata) {
	        if (node.type === 'LineComment') {
	            this.visitComment(node, metadata);
	        }
	        else if (node.type === 'BlockComment') {
	            this.visitComment(node, metadata);
	        }
	        else if (this.attach) {
	            this.visitNode(node, metadata);
	        }
	    };
	    return CommentHandler;
	}());
	exports.CommentHandler = CommentHandler;


/***/ },
/* 2 */
/***/ function(module, exports) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Syntax = {
	    AssignmentExpression: 'AssignmentExpression',
	    AssignmentPattern: 'AssignmentPattern',
	    ArrayExpression: 'ArrayExpression',
	    ArrayPattern: 'ArrayPattern',
	    ArrowFunctionExpression: 'ArrowFunctionExpression',
	    AwaitExpression: 'AwaitExpression',
	    BlockStatement: 'BlockStatement',
	    BinaryExpression: 'BinaryExpression',
	    BreakStatement: 'BreakStatement',
	    CallExpression: 'CallExpression',
	    CatchClause: 'CatchClause',
	    ClassBody: 'ClassBody',
	    ClassDeclaration: 'ClassDeclaration',
	    ClassExpression: 'ClassExpression',
	    ConditionalExpression: 'ConditionalExpression',
	    ContinueStatement: 'ContinueStatement',
	    DoWhileStatement: 'DoWhileStatement',
	    DebuggerStatement: 'DebuggerStatement',
	    EmptyStatement: 'EmptyStatement',
	    ExportAllDeclaration: 'ExportAllDeclaration',
	    ExportDefaultDeclaration: 'ExportDefaultDeclaration',
	    ExportNamedDeclaration: 'ExportNamedDeclaration',
	    ExportSpecifier: 'ExportSpecifier',
	    ExpressionStatement: 'ExpressionStatement',
	    ForStatement: 'ForStatement',
	    ForOfStatement: 'ForOfStatement',
	    ForInStatement: 'ForInStatement',
	    FunctionDeclaration: 'FunctionDeclaration',
	    FunctionExpression: 'FunctionExpression',
	    Identifier: 'Identifier',
	    IfStatement: 'IfStatement',
	    ImportDeclaration: 'ImportDeclaration',
	    ImportDefaultSpecifier: 'ImportDefaultSpecifier',
	    ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
	    ImportSpecifier: 'ImportSpecifier',
	    Literal: 'Literal',
	    LabeledStatement: 'LabeledStatement',
	    LogicalExpression: 'LogicalExpression',
	    MemberExpression: 'MemberExpression',
	    MetaProperty: 'MetaProperty',
	    MethodDefinition: 'MethodDefinition',
	    NewExpression: 'NewExpression',
	    ObjectExpression: 'ObjectExpression',
	    ObjectPattern: 'ObjectPattern',
	    Program: 'Program',
	    Property: 'Property',
	    RestElement: 'RestElement',
	    ReturnStatement: 'ReturnStatement',
	    SequenceExpression: 'SequenceExpression',
	    SpreadElement: 'SpreadElement',
	    Super: 'Super',
	    SwitchCase: 'SwitchCase',
	    SwitchStatement: 'SwitchStatement',
	    TaggedTemplateExpression: 'TaggedTemplateExpression',
	    TemplateElement: 'TemplateElement',
	    TemplateLiteral: 'TemplateLiteral',
	    ThisExpression: 'ThisExpression',
	    ThrowStatement: 'ThrowStatement',
	    TryStatement: 'TryStatement',
	    UnaryExpression: 'UnaryExpression',
	    UpdateExpression: 'UpdateExpression',
	    VariableDeclaration: 'VariableDeclaration',
	    VariableDeclarator: 'VariableDeclarator',
	    WhileStatement: 'WhileStatement',
	    WithStatement: 'WithStatement',
	    YieldExpression: 'YieldExpression'
	};


/***/ },
/* 3 */
/***/ function(module, exports, __nested_webpack_require_15019__) {

	"use strict";
/* istanbul ignore next */
	var __extends = (this && this.__extends) || (function () {
	    var extendStatics = Object.setPrototypeOf ||
	        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
	        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
	    return function (d, b) {
	        extendStatics(d, b);
	        function __() { this.constructor = d; }
	        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	    };
	})();
	Object.defineProperty(exports, "__esModule", { value: true });
	var character_1 = __nested_webpack_require_15019__(4);
	var JSXNode = __nested_webpack_require_15019__(5);
	var jsx_syntax_1 = __nested_webpack_require_15019__(6);
	var Node = __nested_webpack_require_15019__(7);
	var parser_1 = __nested_webpack_require_15019__(8);
	var token_1 = __nested_webpack_require_15019__(13);
	var xhtml_entities_1 = __nested_webpack_require_15019__(14);
	token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
	token_1.TokenName[101 /* Text */] = 'JSXText';
	// Fully qualified element name, e.g. <svg:path> returns "svg:path"
	function getQualifiedElementName(elementName) {
	    var qualifiedName;
	    switch (elementName.type) {
	        case jsx_syntax_1.JSXSyntax.JSXIdentifier:
	            var id = elementName;
	            qualifiedName = id.name;
	            break;
	        case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
	            var ns = elementName;
	            qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
	                getQualifiedElementName(ns.name);
	            break;
	        case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
	            var expr = elementName;
	            qualifiedName = getQualifiedElementName(expr.object) + '.' +
	                getQualifiedElementName(expr.property);
	            break;
	        /* istanbul ignore next */
	        default:
	            break;
	    }
	    return qualifiedName;
	}
	var JSXParser = (function (_super) {
	    __extends(JSXParser, _super);
	    function JSXParser(code, options, delegate) {
	        return _super.call(this, code, options, delegate) || this;
	    }
	    JSXParser.prototype.parsePrimaryExpression = function () {
	        return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
	    };
	    JSXParser.prototype.startJSX = function () {
	        // Unwind the scanner before the lookahead token.
	        this.scanner.index = this.startMarker.index;
	        this.scanner.lineNumber = this.startMarker.line;
	        this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
	    };
	    JSXParser.prototype.finishJSX = function () {
	        // Prime the next lookahead.
	        this.nextToken();
	    };
	    JSXParser.prototype.reenterJSX = function () {
	        this.startJSX();
	        this.expectJSX('}');
	        // Pop the closing '}' added from the lookahead.
	        if (this.config.tokens) {
	            this.tokens.pop();
	        }
	    };
	    JSXParser.prototype.createJSXNode = function () {
	        this.collectComments();
	        return {
	            index: this.scanner.index,
	            line: this.scanner.lineNumber,
	            column: this.scanner.index - this.scanner.lineStart
	        };
	    };
	    JSXParser.prototype.createJSXChildNode = function () {
	        return {
	            index: this.scanner.index,
	            line: this.scanner.lineNumber,
	            column: this.scanner.index - this.scanner.lineStart
	        };
	    };
	    JSXParser.prototype.scanXHTMLEntity = function (quote) {
	        var result = '&';
	        var valid = true;
	        var terminated = false;
	        var numeric = false;
	        var hex = false;
	        while (!this.scanner.eof() && valid && !terminated) {
	            var ch = this.scanner.source[this.scanner.index];
	            if (ch === quote) {
	                break;
	            }
	            terminated = (ch === ';');
	            result += ch;
	            ++this.scanner.index;
	            if (!terminated) {
	                switch (result.length) {
	                    case 2:
	                        // e.g. '&#123;'
	                        numeric = (ch === '#');
	                        break;
	                    case 3:
	                        if (numeric) {
	                            // e.g. '&#x41;'
	                            hex = (ch === 'x');
	                            valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
	                            numeric = numeric && !hex;
	                        }
	                        break;
	                    default:
	                        valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
	                        valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
	                        break;
	                }
	            }
	        }
	        if (valid && terminated && result.length > 2) {
	            // e.g. '&#x41;' becomes just '#x41'
	            var str = result.substr(1, result.length - 2);
	            if (numeric && str.length > 1) {
	                result = String.fromCharCode(parseInt(str.substr(1), 10));
	            }
	            else if (hex && str.length > 2) {
	                result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
	            }
	            else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
	                result = xhtml_entities_1.XHTMLEntities[str];
	            }
	        }
	        return result;
	    };
	    // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
	    JSXParser.prototype.lexJSX = function () {
	        var cp = this.scanner.source.charCodeAt(this.scanner.index);
	        // < > / : = { }
	        if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
	            var value = this.scanner.source[this.scanner.index++];
	            return {
	                type: 7 /* Punctuator */,
	                value: value,
	                lineNumber: this.scanner.lineNumber,
	                lineStart: this.scanner.lineStart,
	                start: this.scanner.index - 1,
	                end: this.scanner.index
	            };
	        }
	        // " '
	        if (cp === 34 || cp === 39) {
	            var start = this.scanner.index;
	            var quote = this.scanner.source[this.scanner.index++];
	            var str = '';
	            while (!this.scanner.eof()) {
	                var ch = this.scanner.source[this.scanner.index++];
	                if (ch === quote) {
	                    break;
	                }
	                else if (ch === '&') {
	                    str += this.scanXHTMLEntity(quote);
	                }
	                else {
	                    str += ch;
	                }
	            }
	            return {
	                type: 8 /* StringLiteral */,
	                value: str,
	                lineNumber: this.scanner.lineNumber,
	                lineStart: this.scanner.lineStart,
	                start: start,
	                end: this.scanner.index
	            };
	        }
	        // ... or .
	        if (cp === 46) {
	            var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
	            var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
	            var value = (n1 === 46 && n2 === 46) ? '...' : '.';
	            var start = this.scanner.index;
	            this.scanner.index += value.length;
	            return {
	                type: 7 /* Punctuator */,
	                value: value,
	                lineNumber: this.scanner.lineNumber,
	                lineStart: this.scanner.lineStart,
	                start: start,
	                end: this.scanner.index
	            };
	        }
	        // `
	        if (cp === 96) {
	            // Only placeholder, since it will be rescanned as a real assignment expression.
	            return {
	                type: 10 /* Template */,
	                value: '',
	                lineNumber: this.scanner.lineNumber,
	                lineStart: this.scanner.lineStart,
	                start: this.scanner.index,
	                end: this.scanner.index
	            };
	        }
	        // Identifer can not contain backslash (char code 92).
	        if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
	            var start = this.scanner.index;
	            ++this.scanner.index;
	            while (!this.scanner.eof()) {
	                var ch = this.scanner.source.charCodeAt(this.scanner.index);
	                if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
	                    ++this.scanner.index;
	                }
	                else if (ch === 45) {
	                    // Hyphen (char code 45) can be part of an identifier.
	                    ++this.scanner.index;
	                }
	                else {
	                    break;
	                }
	            }
	            var id = this.scanner.source.slice(start, this.scanner.index);
	            return {
	                type: 100 /* Identifier */,
	                value: id,
	                lineNumber: this.scanner.lineNumber,
	                lineStart: this.scanner.lineStart,
	                start: start,
	                end: this.scanner.index
	            };
	        }
	        return this.scanner.lex();
	    };
	    JSXParser.prototype.nextJSXToken = function () {
	        this.collectComments();
	        this.startMarker.index = this.scanner.index;
	        this.startMarker.line = this.scanner.lineNumber;
	        this.startMarker.column = this.scanner.index - this.scanner.lineStart;
	        var token = this.lexJSX();
	        this.lastMarker.index = this.scanner.index;
	        this.lastMarker.line = this.scanner.lineNumber;
	        this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
	        if (this.config.tokens) {
	            this.tokens.push(this.convertToken(token));
	        }
	        return token;
	    };
	    JSXParser.prototype.nextJSXText = function () {
	        this.startMarker.index = this.scanner.index;
	        this.startMarker.line = this.scanner.lineNumber;
	        this.startMarker.column = this.scanner.index - this.scanner.lineStart;
	        var start = this.scanner.index;
	        var text = '';
	        while (!this.scanner.eof()) {
	            var ch = this.scanner.source[this.scanner.index];
	            if (ch === '{' || ch === '<') {
	                break;
	            }
	            ++this.scanner.index;
	            text += ch;
	            if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                ++this.scanner.lineNumber;
	                if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
	                    ++this.scanner.index;
	                }
	                this.scanner.lineStart = this.scanner.index;
	            }
	        }
	        this.lastMarker.index = this.scanner.index;
	        this.lastMarker.line = this.scanner.lineNumber;
	        this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
	        var token = {
	            type: 101 /* Text */,
	            value: text,
	            lineNumber: this.scanner.lineNumber,
	            lineStart: this.scanner.lineStart,
	            start: start,
	            end: this.scanner.index
	        };
	        if ((text.length > 0) && this.config.tokens) {
	            this.tokens.push(this.convertToken(token));
	        }
	        return token;
	    };
	    JSXParser.prototype.peekJSXToken = function () {
	        var state = this.scanner.saveState();
	        this.scanner.scanComments();
	        var next = this.lexJSX();
	        this.scanner.restoreState(state);
	        return next;
	    };
	    // Expect the next JSX token to match the specified punctuator.
	    // If not, an exception will be thrown.
	    JSXParser.prototype.expectJSX = function (value) {
	        var token = this.nextJSXToken();
	        if (token.type !== 7 /* Punctuator */ || token.value !== value) {
	            this.throwUnexpectedToken(token);
	        }
	    };
	    // Return true if the next JSX token matches the specified punctuator.
	    JSXParser.prototype.matchJSX = function (value) {
	        var next = this.peekJSXToken();
	        return next.type === 7 /* Punctuator */ && next.value === value;
	    };
	    JSXParser.prototype.parseJSXIdentifier = function () {
	        var node = this.createJSXNode();
	        var token = this.nextJSXToken();
	        if (token.type !== 100 /* Identifier */) {
	            this.throwUnexpectedToken(token);
	        }
	        return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
	    };
	    JSXParser.prototype.parseJSXElementName = function () {
	        var node = this.createJSXNode();
	        var elementName = this.parseJSXIdentifier();
	        if (this.matchJSX(':')) {
	            var namespace = elementName;
	            this.expectJSX(':');
	            var name_1 = this.parseJSXIdentifier();
	            elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
	        }
	        else if (this.matchJSX('.')) {
	            while (this.matchJSX('.')) {
	                var object = elementName;
	                this.expectJSX('.');
	                var property = this.parseJSXIdentifier();
	                elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
	            }
	        }
	        return elementName;
	    };
	    JSXParser.prototype.parseJSXAttributeName = function () {
	        var node = this.createJSXNode();
	        var attributeName;
	        var identifier = this.parseJSXIdentifier();
	        if (this.matchJSX(':')) {
	            var namespace = identifier;
	            this.expectJSX(':');
	            var name_2 = this.parseJSXIdentifier();
	            attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
	        }
	        else {
	            attributeName = identifier;
	        }
	        return attributeName;
	    };
	    JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
	        var node = this.createJSXNode();
	        var token = this.nextJSXToken();
	        if (token.type !== 8 /* StringLiteral */) {
	            this.throwUnexpectedToken(token);
	        }
	        var raw = this.getTokenRaw(token);
	        return this.finalize(node, new Node.Literal(token.value, raw));
	    };
	    JSXParser.prototype.parseJSXExpressionAttribute = function () {
	        var node = this.createJSXNode();
	        this.expectJSX('{');
	        this.finishJSX();
	        if (this.match('}')) {
	            this.tolerateError('JSX attributes must only be assigned a non-empty expression');
	        }
	        var expression = this.parseAssignmentExpression();
	        this.reenterJSX();
	        return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
	    };
	    JSXParser.prototype.parseJSXAttributeValue = function () {
	        return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
	            this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
	    };
	    JSXParser.prototype.parseJSXNameValueAttribute = function () {
	        var node = this.createJSXNode();
	        var name = this.parseJSXAttributeName();
	        var value = null;
	        if (this.matchJSX('=')) {
	            this.expectJSX('=');
	            value = this.parseJSXAttributeValue();
	        }
	        return this.finalize(node, new JSXNode.JSXAttribute(name, value));
	    };
	    JSXParser.prototype.parseJSXSpreadAttribute = function () {
	        var node = this.createJSXNode();
	        this.expectJSX('{');
	        this.expectJSX('...');
	        this.finishJSX();
	        var argument = this.parseAssignmentExpression();
	        this.reenterJSX();
	        return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
	    };
	    JSXParser.prototype.parseJSXAttributes = function () {
	        var attributes = [];
	        while (!this.matchJSX('/') && !this.matchJSX('>')) {
	            var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
	                this.parseJSXNameValueAttribute();
	            attributes.push(attribute);
	        }
	        return attributes;
	    };
	    JSXParser.prototype.parseJSXOpeningElement = function () {
	        var node = this.createJSXNode();
	        this.expectJSX('<');
	        var name = this.parseJSXElementName();
	        var attributes = this.parseJSXAttributes();
	        var selfClosing = this.matchJSX('/');
	        if (selfClosing) {
	            this.expectJSX('/');
	        }
	        this.expectJSX('>');
	        return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
	    };
	    JSXParser.prototype.parseJSXBoundaryElement = function () {
	        var node = this.createJSXNode();
	        this.expectJSX('<');
	        if (this.matchJSX('/')) {
	            this.expectJSX('/');
	            var name_3 = this.parseJSXElementName();
	            this.expectJSX('>');
	            return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
	        }
	        var name = this.parseJSXElementName();
	        var attributes = this.parseJSXAttributes();
	        var selfClosing = this.matchJSX('/');
	        if (selfClosing) {
	            this.expectJSX('/');
	        }
	        this.expectJSX('>');
	        return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
	    };
	    JSXParser.prototype.parseJSXEmptyExpression = function () {
	        var node = this.createJSXChildNode();
	        this.collectComments();
	        this.lastMarker.index = this.scanner.index;
	        this.lastMarker.line = this.scanner.lineNumber;
	        this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
	        return this.finalize(node, new JSXNode.JSXEmptyExpression());
	    };
	    JSXParser.prototype.parseJSXExpressionContainer = function () {
	        var node = this.createJSXNode();
	        this.expectJSX('{');
	        var expression;
	        if (this.matchJSX('}')) {
	            expression = this.parseJSXEmptyExpression();
	            this.expectJSX('}');
	        }
	        else {
	            this.finishJSX();
	            expression = this.parseAssignmentExpression();
	            this.reenterJSX();
	        }
	        return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
	    };
	    JSXParser.prototype.parseJSXChildren = function () {
	        var children = [];
	        while (!this.scanner.eof()) {
	            var node = this.createJSXChildNode();
	            var token = this.nextJSXText();
	            if (token.start < token.end) {
	                var raw = this.getTokenRaw(token);
	                var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
	                children.push(child);
	            }
	            if (this.scanner.source[this.scanner.index] === '{') {
	                var container = this.parseJSXExpressionContainer();
	                children.push(container);
	            }
	            else {
	                break;
	            }
	        }
	        return children;
	    };
	    JSXParser.prototype.parseComplexJSXElement = function (el) {
	        var stack = [];
	        while (!this.scanner.eof()) {
	            el.children = el.children.concat(this.parseJSXChildren());
	            var node = this.createJSXChildNode();
	            var element = this.parseJSXBoundaryElement();
	            if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
	                var opening = element;
	                if (opening.selfClosing) {
	                    var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
	                    el.children.push(child);
	                }
	                else {
	                    stack.push(el);
	                    el = { node: node, opening: opening, closing: null, children: [] };
	                }
	            }
	            if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
	                el.closing = element;
	                var open_1 = getQualifiedElementName(el.opening.name);
	                var close_1 = getQualifiedElementName(el.closing.name);
	                if (open_1 !== close_1) {
	                    this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
	                }
	                if (stack.length > 0) {
	                    var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
	                    el = stack[stack.length - 1];
	                    el.children.push(child);
	                    stack.pop();
	                }
	                else {
	                    break;
	                }
	            }
	        }
	        return el;
	    };
	    JSXParser.prototype.parseJSXElement = function () {
	        var node = this.createJSXNode();
	        var opening = this.parseJSXOpeningElement();
	        var children = [];
	        var closing = null;
	        if (!opening.selfClosing) {
	            var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
	            children = el.children;
	            closing = el.closing;
	        }
	        return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
	    };
	    JSXParser.prototype.parseJSXRoot = function () {
	        // Pop the opening '<' added from the lookahead.
	        if (this.config.tokens) {
	            this.tokens.pop();
	        }
	        this.startJSX();
	        var element = this.parseJSXElement();
	        this.finishJSX();
	        return element;
	    };
	    JSXParser.prototype.isStartOfExpression = function () {
	        return _super.prototype.isStartOfExpression.call(this) || this.match('<');
	    };
	    return JSXParser;
	}(parser_1.Parser));
	exports.JSXParser = JSXParser;


/***/ },
/* 4 */
/***/ function(module, exports) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	// See also tools/generate-unicode-regex.js.
	var Regex = {
	    // Unicode v8.0.0 NonAsciiIdentifierStart:
	    NonAsciiIdentifierStart: /[\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]/,
	    // Unicode v8.0.0 NonAsciiIdentifierPart:
	    NonAsciiIdentifierPart: /[\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]/
	};
	exports.Character = {
	    /* tslint:disable:no-bitwise */
	    fromCodePoint: function (cp) {
	        return (cp < 0x10000) ? String.fromCharCode(cp) :
	            String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
	                String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
	    },
	    // https://tc39.github.io/ecma262/#sec-white-space
	    isWhiteSpace: function (cp) {
	        return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
	            (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
	    },
	    // https://tc39.github.io/ecma262/#sec-line-terminators
	    isLineTerminator: function (cp) {
	        return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
	    },
	    // https://tc39.github.io/ecma262/#sec-names-and-keywords
	    isIdentifierStart: function (cp) {
	        return (cp === 0x24) || (cp === 0x5F) ||
	            (cp >= 0x41 && cp <= 0x5A) ||
	            (cp >= 0x61 && cp <= 0x7A) ||
	            (cp === 0x5C) ||
	            ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
	    },
	    isIdentifierPart: function (cp) {
	        return (cp === 0x24) || (cp === 0x5F) ||
	            (cp >= 0x41 && cp <= 0x5A) ||
	            (cp >= 0x61 && cp <= 0x7A) ||
	            (cp >= 0x30 && cp <= 0x39) ||
	            (cp === 0x5C) ||
	            ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
	    },
	    // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
	    isDecimalDigit: function (cp) {
	        return (cp >= 0x30 && cp <= 0x39); // 0..9
	    },
	    isHexDigit: function (cp) {
	        return (cp >= 0x30 && cp <= 0x39) ||
	            (cp >= 0x41 && cp <= 0x46) ||
	            (cp >= 0x61 && cp <= 0x66); // a..f
	    },
	    isOctalDigit: function (cp) {
	        return (cp >= 0x30 && cp <= 0x37); // 0..7
	    }
	};


/***/ },
/* 5 */
/***/ function(module, exports, __nested_webpack_require_54354__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var jsx_syntax_1 = __nested_webpack_require_54354__(6);
	/* tslint:disable:max-classes-per-file */
	var JSXClosingElement = (function () {
	    function JSXClosingElement(name) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
	        this.name = name;
	    }
	    return JSXClosingElement;
	}());
	exports.JSXClosingElement = JSXClosingElement;
	var JSXElement = (function () {
	    function JSXElement(openingElement, children, closingElement) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXElement;
	        this.openingElement = openingElement;
	        this.children = children;
	        this.closingElement = closingElement;
	    }
	    return JSXElement;
	}());
	exports.JSXElement = JSXElement;
	var JSXEmptyExpression = (function () {
	    function JSXEmptyExpression() {
	        this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
	    }
	    return JSXEmptyExpression;
	}());
	exports.JSXEmptyExpression = JSXEmptyExpression;
	var JSXExpressionContainer = (function () {
	    function JSXExpressionContainer(expression) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
	        this.expression = expression;
	    }
	    return JSXExpressionContainer;
	}());
	exports.JSXExpressionContainer = JSXExpressionContainer;
	var JSXIdentifier = (function () {
	    function JSXIdentifier(name) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
	        this.name = name;
	    }
	    return JSXIdentifier;
	}());
	exports.JSXIdentifier = JSXIdentifier;
	var JSXMemberExpression = (function () {
	    function JSXMemberExpression(object, property) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
	        this.object = object;
	        this.property = property;
	    }
	    return JSXMemberExpression;
	}());
	exports.JSXMemberExpression = JSXMemberExpression;
	var JSXAttribute = (function () {
	    function JSXAttribute(name, value) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
	        this.name = name;
	        this.value = value;
	    }
	    return JSXAttribute;
	}());
	exports.JSXAttribute = JSXAttribute;
	var JSXNamespacedName = (function () {
	    function JSXNamespacedName(namespace, name) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
	        this.namespace = namespace;
	        this.name = name;
	    }
	    return JSXNamespacedName;
	}());
	exports.JSXNamespacedName = JSXNamespacedName;
	var JSXOpeningElement = (function () {
	    function JSXOpeningElement(name, selfClosing, attributes) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
	        this.name = name;
	        this.selfClosing = selfClosing;
	        this.attributes = attributes;
	    }
	    return JSXOpeningElement;
	}());
	exports.JSXOpeningElement = JSXOpeningElement;
	var JSXSpreadAttribute = (function () {
	    function JSXSpreadAttribute(argument) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
	        this.argument = argument;
	    }
	    return JSXSpreadAttribute;
	}());
	exports.JSXSpreadAttribute = JSXSpreadAttribute;
	var JSXText = (function () {
	    function JSXText(value, raw) {
	        this.type = jsx_syntax_1.JSXSyntax.JSXText;
	        this.value = value;
	        this.raw = raw;
	    }
	    return JSXText;
	}());
	exports.JSXText = JSXText;


/***/ },
/* 6 */
/***/ function(module, exports) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.JSXSyntax = {
	    JSXAttribute: 'JSXAttribute',
	    JSXClosingElement: 'JSXClosingElement',
	    JSXElement: 'JSXElement',
	    JSXEmptyExpression: 'JSXEmptyExpression',
	    JSXExpressionContainer: 'JSXExpressionContainer',
	    JSXIdentifier: 'JSXIdentifier',
	    JSXMemberExpression: 'JSXMemberExpression',
	    JSXNamespacedName: 'JSXNamespacedName',
	    JSXOpeningElement: 'JSXOpeningElement',
	    JSXSpreadAttribute: 'JSXSpreadAttribute',
	    JSXText: 'JSXText'
	};


/***/ },
/* 7 */
/***/ function(module, exports, __nested_webpack_require_58416__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var syntax_1 = __nested_webpack_require_58416__(2);
	/* tslint:disable:max-classes-per-file */
	var ArrayExpression = (function () {
	    function ArrayExpression(elements) {
	        this.type = syntax_1.Syntax.ArrayExpression;
	        this.elements = elements;
	    }
	    return ArrayExpression;
	}());
	exports.ArrayExpression = ArrayExpression;
	var ArrayPattern = (function () {
	    function ArrayPattern(elements) {
	        this.type = syntax_1.Syntax.ArrayPattern;
	        this.elements = elements;
	    }
	    return ArrayPattern;
	}());
	exports.ArrayPattern = ArrayPattern;
	var ArrowFunctionExpression = (function () {
	    function ArrowFunctionExpression(params, body, expression) {
	        this.type = syntax_1.Syntax.ArrowFunctionExpression;
	        this.id = null;
	        this.params = params;
	        this.body = body;
	        this.generator = false;
	        this.expression = expression;
	        this.async = false;
	    }
	    return ArrowFunctionExpression;
	}());
	exports.ArrowFunctionExpression = ArrowFunctionExpression;
	var AssignmentExpression = (function () {
	    function AssignmentExpression(operator, left, right) {
	        this.type = syntax_1.Syntax.AssignmentExpression;
	        this.operator = operator;
	        this.left = left;
	        this.right = right;
	    }
	    return AssignmentExpression;
	}());
	exports.AssignmentExpression = AssignmentExpression;
	var AssignmentPattern = (function () {
	    function AssignmentPattern(left, right) {
	        this.type = syntax_1.Syntax.AssignmentPattern;
	        this.left = left;
	        this.right = right;
	    }
	    return AssignmentPattern;
	}());
	exports.AssignmentPattern = AssignmentPattern;
	var AsyncArrowFunctionExpression = (function () {
	    function AsyncArrowFunctionExpression(params, body, expression) {
	        this.type = syntax_1.Syntax.ArrowFunctionExpression;
	        this.id = null;
	        this.params = params;
	        this.body = body;
	        this.generator = false;
	        this.expression = expression;
	        this.async = true;
	    }
	    return AsyncArrowFunctionExpression;
	}());
	exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
	var AsyncFunctionDeclaration = (function () {
	    function AsyncFunctionDeclaration(id, params, body) {
	        this.type = syntax_1.Syntax.FunctionDeclaration;
	        this.id = id;
	        this.params = params;
	        this.body = body;
	        this.generator = false;
	        this.expression = false;
	        this.async = true;
	    }
	    return AsyncFunctionDeclaration;
	}());
	exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
	var AsyncFunctionExpression = (function () {
	    function AsyncFunctionExpression(id, params, body) {
	        this.type = syntax_1.Syntax.FunctionExpression;
	        this.id = id;
	        this.params = params;
	        this.body = body;
	        this.generator = false;
	        this.expression = false;
	        this.async = true;
	    }
	    return AsyncFunctionExpression;
	}());
	exports.AsyncFunctionExpression = AsyncFunctionExpression;
	var AwaitExpression = (function () {
	    function AwaitExpression(argument) {
	        this.type = syntax_1.Syntax.AwaitExpression;
	        this.argument = argument;
	    }
	    return AwaitExpression;
	}());
	exports.AwaitExpression = AwaitExpression;
	var BinaryExpression = (function () {
	    function BinaryExpression(operator, left, right) {
	        var logical = (operator === '||' || operator === '&&');
	        this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
	        this.operator = operator;
	        this.left = left;
	        this.right = right;
	    }
	    return BinaryExpression;
	}());
	exports.BinaryExpression = BinaryExpression;
	var BlockStatement = (function () {
	    function BlockStatement(body) {
	        this.type = syntax_1.Syntax.BlockStatement;
	        this.body = body;
	    }
	    return BlockStatement;
	}());
	exports.BlockStatement = BlockStatement;
	var BreakStatement = (function () {
	    function BreakStatement(label) {
	        this.type = syntax_1.Syntax.BreakStatement;
	        this.label = label;
	    }
	    return BreakStatement;
	}());
	exports.BreakStatement = BreakStatement;
	var CallExpression = (function () {
	    function CallExpression(callee, args) {
	        this.type = syntax_1.Syntax.CallExpression;
	        this.callee = callee;
	        this.arguments = args;
	    }
	    return CallExpression;
	}());
	exports.CallExpression = CallExpression;
	var CatchClause = (function () {
	    function CatchClause(param, body) {
	        this.type = syntax_1.Syntax.CatchClause;
	        this.param = param;
	        this.body = body;
	    }
	    return CatchClause;
	}());
	exports.CatchClause = CatchClause;
	var ClassBody = (function () {
	    function ClassBody(body) {
	        this.type = syntax_1.Syntax.ClassBody;
	        this.body = body;
	    }
	    return ClassBody;
	}());
	exports.ClassBody = ClassBody;
	var ClassDeclaration = (function () {
	    function ClassDeclaration(id, superClass, body) {
	        this.type = syntax_1.Syntax.ClassDeclaration;
	        this.id = id;
	        this.superClass = superClass;
	        this.body = body;
	    }
	    return ClassDeclaration;
	}());
	exports.ClassDeclaration = ClassDeclaration;
	var ClassExpression = (function () {
	    function ClassExpression(id, superClass, body) {
	        this.type = syntax_1.Syntax.ClassExpression;
	        this.id = id;
	        this.superClass = superClass;
	        this.body = body;
	    }
	    return ClassExpression;
	}());
	exports.ClassExpression = ClassExpression;
	var ComputedMemberExpression = (function () {
	    function ComputedMemberExpression(object, property) {
	        this.type = syntax_1.Syntax.MemberExpression;
	        this.computed = true;
	        this.object = object;
	        this.property = property;
	    }
	    return ComputedMemberExpression;
	}());
	exports.ComputedMemberExpression = ComputedMemberExpression;
	var ConditionalExpression = (function () {
	    function ConditionalExpression(test, consequent, alternate) {
	        this.type = syntax_1.Syntax.ConditionalExpression;
	        this.test = test;
	        this.consequent = consequent;
	        this.alternate = alternate;
	    }
	    return ConditionalExpression;
	}());
	exports.ConditionalExpression = ConditionalExpression;
	var ContinueStatement = (function () {
	    function ContinueStatement(label) {
	        this.type = syntax_1.Syntax.ContinueStatement;
	        this.label = label;
	    }
	    return ContinueStatement;
	}());
	exports.ContinueStatement = ContinueStatement;
	var DebuggerStatement = (function () {
	    function DebuggerStatement() {
	        this.type = syntax_1.Syntax.DebuggerStatement;
	    }
	    return DebuggerStatement;
	}());
	exports.DebuggerStatement = DebuggerStatement;
	var Directive = (function () {
	    function Directive(expression, directive) {
	        this.type = syntax_1.Syntax.ExpressionStatement;
	        this.expression = expression;
	        this.directive = directive;
	    }
	    return Directive;
	}());
	exports.Directive = Directive;
	var DoWhileStatement = (function () {
	    function DoWhileStatement(body, test) {
	        this.type = syntax_1.Syntax.DoWhileStatement;
	        this.body = body;
	        this.test = test;
	    }
	    return DoWhileStatement;
	}());
	exports.DoWhileStatement = DoWhileStatement;
	var EmptyStatement = (function () {
	    function EmptyStatement() {
	        this.type = syntax_1.Syntax.EmptyStatement;
	    }
	    return EmptyStatement;
	}());
	exports.EmptyStatement = EmptyStatement;
	var ExportAllDeclaration = (function () {
	    function ExportAllDeclaration(source) {
	        this.type = syntax_1.Syntax.ExportAllDeclaration;
	        this.source = source;
	    }
	    return ExportAllDeclaration;
	}());
	exports.ExportAllDeclaration = ExportAllDeclaration;
	var ExportDefaultDeclaration = (function () {
	    function ExportDefaultDeclaration(declaration) {
	        this.type = syntax_1.Syntax.ExportDefaultDeclaration;
	        this.declaration = declaration;
	    }
	    return ExportDefaultDeclaration;
	}());
	exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
	var ExportNamedDeclaration = (function () {
	    function ExportNamedDeclaration(declaration, specifiers, source) {
	        this.type = syntax_1.Syntax.ExportNamedDeclaration;
	        this.declaration = declaration;
	        this.specifiers = specifiers;
	        this.source = source;
	    }
	    return ExportNamedDeclaration;
	}());
	exports.ExportNamedDeclaration = ExportNamedDeclaration;
	var ExportSpecifier = (function () {
	    function ExportSpecifier(local, exported) {
	        this.type = syntax_1.Syntax.ExportSpecifier;
	        this.exported = exported;
	        this.local = local;
	    }
	    return ExportSpecifier;
	}());
	exports.ExportSpecifier = ExportSpecifier;
	var ExpressionStatement = (function () {
	    function ExpressionStatement(expression) {
	        this.type = syntax_1.Syntax.ExpressionStatement;
	        this.expression = expression;
	    }
	    return ExpressionStatement;
	}());
	exports.ExpressionStatement = ExpressionStatement;
	var ForInStatement = (function () {
	    function ForInStatement(left, right, body) {
	        this.type = syntax_1.Syntax.ForInStatement;
	        this.left = left;
	        this.right = right;
	        this.body = body;
	        this.each = false;
	    }
	    return ForInStatement;
	}());
	exports.ForInStatement = ForInStatement;
	var ForOfStatement = (function () {
	    function ForOfStatement(left, right, body) {
	        this.type = syntax_1.Syntax.ForOfStatement;
	        this.left = left;
	        this.right = right;
	        this.body = body;
	    }
	    return ForOfStatement;
	}());
	exports.ForOfStatement = ForOfStatement;
	var ForStatement = (function () {
	    function ForStatement(init, test, update, body) {
	        this.type = syntax_1.Syntax.ForStatement;
	        this.init = init;
	        this.test = test;
	        this.update = update;
	        this.body = body;
	    }
	    return ForStatement;
	}());
	exports.ForStatement = ForStatement;
	var FunctionDeclaration = (function () {
	    function FunctionDeclaration(id, params, body, generator) {
	        this.type = syntax_1.Syntax.FunctionDeclaration;
	        this.id = id;
	        this.params = params;
	        this.body = body;
	        this.generator = generator;
	        this.expression = false;
	        this.async = false;
	    }
	    return FunctionDeclaration;
	}());
	exports.FunctionDeclaration = FunctionDeclaration;
	var FunctionExpression = (function () {
	    function FunctionExpression(id, params, body, generator) {
	        this.type = syntax_1.Syntax.FunctionExpression;
	        this.id = id;
	        this.params = params;
	        this.body = body;
	        this.generator = generator;
	        this.expression = false;
	        this.async = false;
	    }
	    return FunctionExpression;
	}());
	exports.FunctionExpression = FunctionExpression;
	var Identifier = (function () {
	    function Identifier(name) {
	        this.type = syntax_1.Syntax.Identifier;
	        this.name = name;
	    }
	    return Identifier;
	}());
	exports.Identifier = Identifier;
	var IfStatement = (function () {
	    function IfStatement(test, consequent, alternate) {
	        this.type = syntax_1.Syntax.IfStatement;
	        this.test = test;
	        this.consequent = consequent;
	        this.alternate = alternate;
	    }
	    return IfStatement;
	}());
	exports.IfStatement = IfStatement;
	var ImportDeclaration = (function () {
	    function ImportDeclaration(specifiers, source) {
	        this.type = syntax_1.Syntax.ImportDeclaration;
	        this.specifiers = specifiers;
	        this.source = source;
	    }
	    return ImportDeclaration;
	}());
	exports.ImportDeclaration = ImportDeclaration;
	var ImportDefaultSpecifier = (function () {
	    function ImportDefaultSpecifier(local) {
	        this.type = syntax_1.Syntax.ImportDefaultSpecifier;
	        this.local = local;
	    }
	    return ImportDefaultSpecifier;
	}());
	exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
	var ImportNamespaceSpecifier = (function () {
	    function ImportNamespaceSpecifier(local) {
	        this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
	        this.local = local;
	    }
	    return ImportNamespaceSpecifier;
	}());
	exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
	var ImportSpecifier = (function () {
	    function ImportSpecifier(local, imported) {
	        this.type = syntax_1.Syntax.ImportSpecifier;
	        this.local = local;
	        this.imported = imported;
	    }
	    return ImportSpecifier;
	}());
	exports.ImportSpecifier = ImportSpecifier;
	var LabeledStatement = (function () {
	    function LabeledStatement(label, body) {
	        this.type = syntax_1.Syntax.LabeledStatement;
	        this.label = label;
	        this.body = body;
	    }
	    return LabeledStatement;
	}());
	exports.LabeledStatement = LabeledStatement;
	var Literal = (function () {
	    function Literal(value, raw) {
	        this.type = syntax_1.Syntax.Literal;
	        this.value = value;
	        this.raw = raw;
	    }
	    return Literal;
	}());
	exports.Literal = Literal;
	var MetaProperty = (function () {
	    function MetaProperty(meta, property) {
	        this.type = syntax_1.Syntax.MetaProperty;
	        this.meta = meta;
	        this.property = property;
	    }
	    return MetaProperty;
	}());
	exports.MetaProperty = MetaProperty;
	var MethodDefinition = (function () {
	    function MethodDefinition(key, computed, value, kind, isStatic) {
	        this.type = syntax_1.Syntax.MethodDefinition;
	        this.key = key;
	        this.computed = computed;
	        this.value = value;
	        this.kind = kind;
	        this.static = isStatic;
	    }
	    return MethodDefinition;
	}());
	exports.MethodDefinition = MethodDefinition;
	var Module = (function () {
	    function Module(body) {
	        this.type = syntax_1.Syntax.Program;
	        this.body = body;
	        this.sourceType = 'module';
	    }
	    return Module;
	}());
	exports.Module = Module;
	var NewExpression = (function () {
	    function NewExpression(callee, args) {
	        this.type = syntax_1.Syntax.NewExpression;
	        this.callee = callee;
	        this.arguments = args;
	    }
	    return NewExpression;
	}());
	exports.NewExpression = NewExpression;
	var ObjectExpression = (function () {
	    function ObjectExpression(properties) {
	        this.type = syntax_1.Syntax.ObjectExpression;
	        this.properties = properties;
	    }
	    return ObjectExpression;
	}());
	exports.ObjectExpression = ObjectExpression;
	var ObjectPattern = (function () {
	    function ObjectPattern(properties) {
	        this.type = syntax_1.Syntax.ObjectPattern;
	        this.properties = properties;
	    }
	    return ObjectPattern;
	}());
	exports.ObjectPattern = ObjectPattern;
	var Property = (function () {
	    function Property(kind, key, computed, value, method, shorthand) {
	        this.type = syntax_1.Syntax.Property;
	        this.key = key;
	        this.computed = computed;
	        this.value = value;
	        this.kind = kind;
	        this.method = method;
	        this.shorthand = shorthand;
	    }
	    return Property;
	}());
	exports.Property = Property;
	var RegexLiteral = (function () {
	    function RegexLiteral(value, raw, pattern, flags) {
	        this.type = syntax_1.Syntax.Literal;
	        this.value = value;
	        this.raw = raw;
	        this.regex = { pattern: pattern, flags: flags };
	    }
	    return RegexLiteral;
	}());
	exports.RegexLiteral = RegexLiteral;
	var RestElement = (function () {
	    function RestElement(argument) {
	        this.type = syntax_1.Syntax.RestElement;
	        this.argument = argument;
	    }
	    return RestElement;
	}());
	exports.RestElement = RestElement;
	var ReturnStatement = (function () {
	    function ReturnStatement(argument) {
	        this.type = syntax_1.Syntax.ReturnStatement;
	        this.argument = argument;
	    }
	    return ReturnStatement;
	}());
	exports.ReturnStatement = ReturnStatement;
	var Script = (function () {
	    function Script(body) {
	        this.type = syntax_1.Syntax.Program;
	        this.body = body;
	        this.sourceType = 'script';
	    }
	    return Script;
	}());
	exports.Script = Script;
	var SequenceExpression = (function () {
	    function SequenceExpression(expressions) {
	        this.type = syntax_1.Syntax.SequenceExpression;
	        this.expressions = expressions;
	    }
	    return SequenceExpression;
	}());
	exports.SequenceExpression = SequenceExpression;
	var SpreadElement = (function () {
	    function SpreadElement(argument) {
	        this.type = syntax_1.Syntax.SpreadElement;
	        this.argument = argument;
	    }
	    return SpreadElement;
	}());
	exports.SpreadElement = SpreadElement;
	var StaticMemberExpression = (function () {
	    function StaticMemberExpression(object, property) {
	        this.type = syntax_1.Syntax.MemberExpression;
	        this.computed = false;
	        this.object = object;
	        this.property = property;
	    }
	    return StaticMemberExpression;
	}());
	exports.StaticMemberExpression = StaticMemberExpression;
	var Super = (function () {
	    function Super() {
	        this.type = syntax_1.Syntax.Super;
	    }
	    return Super;
	}());
	exports.Super = Super;
	var SwitchCase = (function () {
	    function SwitchCase(test, consequent) {
	        this.type = syntax_1.Syntax.SwitchCase;
	        this.test = test;
	        this.consequent = consequent;
	    }
	    return SwitchCase;
	}());
	exports.SwitchCase = SwitchCase;
	var SwitchStatement = (function () {
	    function SwitchStatement(discriminant, cases) {
	        this.type = syntax_1.Syntax.SwitchStatement;
	        this.discriminant = discriminant;
	        this.cases = cases;
	    }
	    return SwitchStatement;
	}());
	exports.SwitchStatement = SwitchStatement;
	var TaggedTemplateExpression = (function () {
	    function TaggedTemplateExpression(tag, quasi) {
	        this.type = syntax_1.Syntax.TaggedTemplateExpression;
	        this.tag = tag;
	        this.quasi = quasi;
	    }
	    return TaggedTemplateExpression;
	}());
	exports.TaggedTemplateExpression = TaggedTemplateExpression;
	var TemplateElement = (function () {
	    function TemplateElement(value, tail) {
	        this.type = syntax_1.Syntax.TemplateElement;
	        this.value = value;
	        this.tail = tail;
	    }
	    return TemplateElement;
	}());
	exports.TemplateElement = TemplateElement;
	var TemplateLiteral = (function () {
	    function TemplateLiteral(quasis, expressions) {
	        this.type = syntax_1.Syntax.TemplateLiteral;
	        this.quasis = quasis;
	        this.expressions = expressions;
	    }
	    return TemplateLiteral;
	}());
	exports.TemplateLiteral = TemplateLiteral;
	var ThisExpression = (function () {
	    function ThisExpression() {
	        this.type = syntax_1.Syntax.ThisExpression;
	    }
	    return ThisExpression;
	}());
	exports.ThisExpression = ThisExpression;
	var ThrowStatement = (function () {
	    function ThrowStatement(argument) {
	        this.type = syntax_1.Syntax.ThrowStatement;
	        this.argument = argument;
	    }
	    return ThrowStatement;
	}());
	exports.ThrowStatement = ThrowStatement;
	var TryStatement = (function () {
	    function TryStatement(block, handler, finalizer) {
	        this.type = syntax_1.Syntax.TryStatement;
	        this.block = block;
	        this.handler = handler;
	        this.finalizer = finalizer;
	    }
	    return TryStatement;
	}());
	exports.TryStatement = TryStatement;
	var UnaryExpression = (function () {
	    function UnaryExpression(operator, argument) {
	        this.type = syntax_1.Syntax.UnaryExpression;
	        this.operator = operator;
	        this.argument = argument;
	        this.prefix = true;
	    }
	    return UnaryExpression;
	}());
	exports.UnaryExpression = UnaryExpression;
	var UpdateExpression = (function () {
	    function UpdateExpression(operator, argument, prefix) {
	        this.type = syntax_1.Syntax.UpdateExpression;
	        this.operator = operator;
	        this.argument = argument;
	        this.prefix = prefix;
	    }
	    return UpdateExpression;
	}());
	exports.UpdateExpression = UpdateExpression;
	var VariableDeclaration = (function () {
	    function VariableDeclaration(declarations, kind) {
	        this.type = syntax_1.Syntax.VariableDeclaration;
	        this.declarations = declarations;
	        this.kind = kind;
	    }
	    return VariableDeclaration;
	}());
	exports.VariableDeclaration = VariableDeclaration;
	var VariableDeclarator = (function () {
	    function VariableDeclarator(id, init) {
	        this.type = syntax_1.Syntax.VariableDeclarator;
	        this.id = id;
	        this.init = init;
	    }
	    return VariableDeclarator;
	}());
	exports.VariableDeclarator = VariableDeclarator;
	var WhileStatement = (function () {
	    function WhileStatement(test, body) {
	        this.type = syntax_1.Syntax.WhileStatement;
	        this.test = test;
	        this.body = body;
	    }
	    return WhileStatement;
	}());
	exports.WhileStatement = WhileStatement;
	var WithStatement = (function () {
	    function WithStatement(object, body) {
	        this.type = syntax_1.Syntax.WithStatement;
	        this.object = object;
	        this.body = body;
	    }
	    return WithStatement;
	}());
	exports.WithStatement = WithStatement;
	var YieldExpression = (function () {
	    function YieldExpression(argument, delegate) {
	        this.type = syntax_1.Syntax.YieldExpression;
	        this.argument = argument;
	        this.delegate = delegate;
	    }
	    return YieldExpression;
	}());
	exports.YieldExpression = YieldExpression;


/***/ },
/* 8 */
/***/ function(module, exports, __nested_webpack_require_80491__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var assert_1 = __nested_webpack_require_80491__(9);
	var error_handler_1 = __nested_webpack_require_80491__(10);
	var messages_1 = __nested_webpack_require_80491__(11);
	var Node = __nested_webpack_require_80491__(7);
	var scanner_1 = __nested_webpack_require_80491__(12);
	var syntax_1 = __nested_webpack_require_80491__(2);
	var token_1 = __nested_webpack_require_80491__(13);
	var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
	var Parser = (function () {
	    function Parser(code, options, delegate) {
	        if (options === void 0) { options = {}; }
	        this.config = {
	            range: (typeof options.range === 'boolean') && options.range,
	            loc: (typeof options.loc === 'boolean') && options.loc,
	            source: null,
	            tokens: (typeof options.tokens === 'boolean') && options.tokens,
	            comment: (typeof options.comment === 'boolean') && options.comment,
	            tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
	        };
	        if (this.config.loc && options.source && options.source !== null) {
	            this.config.source = String(options.source);
	        }
	        this.delegate = delegate;
	        this.errorHandler = new error_handler_1.ErrorHandler();
	        this.errorHandler.tolerant = this.config.tolerant;
	        this.scanner = new scanner_1.Scanner(code, this.errorHandler);
	        this.scanner.trackComment = this.config.comment;
	        this.operatorPrecedence = {
	            ')': 0,
	            ';': 0,
	            ',': 0,
	            '=': 0,
	            ']': 0,
	            '||': 1,
	            '&&': 2,
	            '|': 3,
	            '^': 4,
	            '&': 5,
	            '==': 6,
	            '!=': 6,
	            '===': 6,
	            '!==': 6,
	            '<': 7,
	            '>': 7,
	            '<=': 7,
	            '>=': 7,
	            '<<': 8,
	            '>>': 8,
	            '>>>': 8,
	            '+': 9,
	            '-': 9,
	            '*': 11,
	            '/': 11,
	            '%': 11
	        };
	        this.lookahead = {
	            type: 2 /* EOF */,
	            value: '',
	            lineNumber: this.scanner.lineNumber,
	            lineStart: 0,
	            start: 0,
	            end: 0
	        };
	        this.hasLineTerminator = false;
	        this.context = {
	            isModule: false,
	            await: false,
	            allowIn: true,
	            allowStrictDirective: true,
	            allowYield: true,
	            firstCoverInitializedNameError: null,
	            isAssignmentTarget: false,
	            isBindingElement: false,
	            inFunctionBody: false,
	            inIteration: false,
	            inSwitch: false,
	            labelSet: {},
	            strict: false
	        };
	        this.tokens = [];
	        this.startMarker = {
	            index: 0,
	            line: this.scanner.lineNumber,
	            column: 0
	        };
	        this.lastMarker = {
	            index: 0,
	            line: this.scanner.lineNumber,
	            column: 0
	        };
	        this.nextToken();
	        this.lastMarker = {
	            index: this.scanner.index,
	            line: this.scanner.lineNumber,
	            column: this.scanner.index - this.scanner.lineStart
	        };
	    }
	    Parser.prototype.throwError = function (messageFormat) {
	        var values = [];
	        for (var _i = 1; _i < arguments.length; _i++) {
	            values[_i - 1] = arguments[_i];
	        }
	        var args = Array.prototype.slice.call(arguments, 1);
	        var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
	            assert_1.assert(idx < args.length, 'Message reference must be in range');
	            return args[idx];
	        });
	        var index = this.lastMarker.index;
	        var line = this.lastMarker.line;
	        var column = this.lastMarker.column + 1;
	        throw this.errorHandler.createError(index, line, column, msg);
	    };
	    Parser.prototype.tolerateError = function (messageFormat) {
	        var values = [];
	        for (var _i = 1; _i < arguments.length; _i++) {
	            values[_i - 1] = arguments[_i];
	        }
	        var args = Array.prototype.slice.call(arguments, 1);
	        var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
	            assert_1.assert(idx < args.length, 'Message reference must be in range');
	            return args[idx];
	        });
	        var index = this.lastMarker.index;
	        var line = this.scanner.lineNumber;
	        var column = this.lastMarker.column + 1;
	        this.errorHandler.tolerateError(index, line, column, msg);
	    };
	    // Throw an exception because of the token.
	    Parser.prototype.unexpectedTokenError = function (token, message) {
	        var msg = message || messages_1.Messages.UnexpectedToken;
	        var value;
	        if (token) {
	            if (!message) {
	                msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
	                    (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
	                        (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
	                            (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
	                                (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
	                                    messages_1.Messages.UnexpectedToken;
	                if (token.type === 4 /* Keyword */) {
	                    if (this.scanner.isFutureReservedWord(token.value)) {
	                        msg = messages_1.Messages.UnexpectedReserved;
	                    }
	                    else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
	                        msg = messages_1.Messages.StrictReservedWord;
	                    }
	                }
	            }
	            value = token.value;
	        }
	        else {
	            value = 'ILLEGAL';
	        }
	        msg = msg.replace('%0', value);
	        if (token && typeof token.lineNumber === 'number') {
	            var index = token.start;
	            var line = token.lineNumber;
	            var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
	            var column = token.start - lastMarkerLineStart + 1;
	            return this.errorHandler.createError(index, line, column, msg);
	        }
	        else {
	            var index = this.lastMarker.index;
	            var line = this.lastMarker.line;
	            var column = this.lastMarker.column + 1;
	            return this.errorHandler.createError(index, line, column, msg);
	        }
	    };
	    Parser.prototype.throwUnexpectedToken = function (token, message) {
	        throw this.unexpectedTokenError(token, message);
	    };
	    Parser.prototype.tolerateUnexpectedToken = function (token, message) {
	        this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
	    };
	    Parser.prototype.collectComments = function () {
	        if (!this.config.comment) {
	            this.scanner.scanComments();
	        }
	        else {
	            var comments = this.scanner.scanComments();
	            if (comments.length > 0 && this.delegate) {
	                for (var i = 0; i < comments.length; ++i) {
	                    var e = comments[i];
	                    var node = void 0;
	                    node = {
	                        type: e.multiLine ? 'BlockComment' : 'LineComment',
	                        value: this.scanner.source.slice(e.slice[0], e.slice[1])
	                    };
	                    if (this.config.range) {
	                        node.range = e.range;
	                    }
	                    if (this.config.loc) {
	                        node.loc = e.loc;
	                    }
	                    var metadata = {
	                        start: {
	                            line: e.loc.start.line,
	                            column: e.loc.start.column,
	                            offset: e.range[0]
	                        },
	                        end: {
	                            line: e.loc.end.line,
	                            column: e.loc.end.column,
	                            offset: e.range[1]
	                        }
	                    };
	                    this.delegate(node, metadata);
	                }
	            }
	        }
	    };
	    // From internal representation to an external structure
	    Parser.prototype.getTokenRaw = function (token) {
	        return this.scanner.source.slice(token.start, token.end);
	    };
	    Parser.prototype.convertToken = function (token) {
	        var t = {
	            type: token_1.TokenName[token.type],
	            value: this.getTokenRaw(token)
	        };
	        if (this.config.range) {
	            t.range = [token.start, token.end];
	        }
	        if (this.config.loc) {
	            t.loc = {
	                start: {
	                    line: this.startMarker.line,
	                    column: this.startMarker.column
	                },
	                end: {
	                    line: this.scanner.lineNumber,
	                    column: this.scanner.index - this.scanner.lineStart
	                }
	            };
	        }
	        if (token.type === 9 /* RegularExpression */) {
	            var pattern = token.pattern;
	            var flags = token.flags;
	            t.regex = { pattern: pattern, flags: flags };
	        }
	        return t;
	    };
	    Parser.prototype.nextToken = function () {
	        var token = this.lookahead;
	        this.lastMarker.index = this.scanner.index;
	        this.lastMarker.line = this.scanner.lineNumber;
	        this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
	        this.collectComments();
	        if (this.scanner.index !== this.startMarker.index) {
	            this.startMarker.index = this.scanner.index;
	            this.startMarker.line = this.scanner.lineNumber;
	            this.startMarker.column = this.scanner.index - this.scanner.lineStart;
	        }
	        var next = this.scanner.lex();
	        this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
	        if (next && this.context.strict && next.type === 3 /* Identifier */) {
	            if (this.scanner.isStrictModeReservedWord(next.value)) {
	                next.type = 4 /* Keyword */;
	            }
	        }
	        this.lookahead = next;
	        if (this.config.tokens && next.type !== 2 /* EOF */) {
	            this.tokens.push(this.convertToken(next));
	        }
	        return token;
	    };
	    Parser.prototype.nextRegexToken = function () {
	        this.collectComments();
	        var token = this.scanner.scanRegExp();
	        if (this.config.tokens) {
	            // Pop the previous token, '/' or '/='
	            // This is added from the lookahead token.
	            this.tokens.pop();
	            this.tokens.push(this.convertToken(token));
	        }
	        // Prime the next lookahead.
	        this.lookahead = token;
	        this.nextToken();
	        return token;
	    };
	    Parser.prototype.createNode = function () {
	        return {
	            index: this.startMarker.index,
	            line: this.startMarker.line,
	            column: this.startMarker.column
	        };
	    };
	    Parser.prototype.startNode = function (token, lastLineStart) {
	        if (lastLineStart === void 0) { lastLineStart = 0; }
	        var column = token.start - token.lineStart;
	        var line = token.lineNumber;
	        if (column < 0) {
	            column += lastLineStart;
	            line--;
	        }
	        return {
	            index: token.start,
	            line: line,
	            column: column
	        };
	    };
	    Parser.prototype.finalize = function (marker, node) {
	        if (this.config.range) {
	            node.range = [marker.index, this.lastMarker.index];
	        }
	        if (this.config.loc) {
	            node.loc = {
	                start: {
	                    line: marker.line,
	                    column: marker.column,
	                },
	                end: {
	                    line: this.lastMarker.line,
	                    column: this.lastMarker.column
	                }
	            };
	            if (this.config.source) {
	                node.loc.source = this.config.source;
	            }
	        }
	        if (this.delegate) {
	            var metadata = {
	                start: {
	                    line: marker.line,
	                    column: marker.column,
	                    offset: marker.index
	                },
	                end: {
	                    line: this.lastMarker.line,
	                    column: this.lastMarker.column,
	                    offset: this.lastMarker.index
	                }
	            };
	            this.delegate(node, metadata);
	        }
	        return node;
	    };
	    // Expect the next token to match the specified punctuator.
	    // If not, an exception will be thrown.
	    Parser.prototype.expect = function (value) {
	        var token = this.nextToken();
	        if (token.type !== 7 /* Punctuator */ || token.value !== value) {
	            this.throwUnexpectedToken(token);
	        }
	    };
	    // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
	    Parser.prototype.expectCommaSeparator = function () {
	        if (this.config.tolerant) {
	            var token = this.lookahead;
	            if (token.type === 7 /* Punctuator */ && token.value === ',') {
	                this.nextToken();
	            }
	            else if (token.type === 7 /* Punctuator */ && token.value === ';') {
	                this.nextToken();
	                this.tolerateUnexpectedToken(token);
	            }
	            else {
	                this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
	            }
	        }
	        else {
	            this.expect(',');
	        }
	    };
	    // Expect the next token to match the specified keyword.
	    // If not, an exception will be thrown.
	    Parser.prototype.expectKeyword = function (keyword) {
	        var token = this.nextToken();
	        if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
	            this.throwUnexpectedToken(token);
	        }
	    };
	    // Return true if the next token matches the specified punctuator.
	    Parser.prototype.match = function (value) {
	        return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
	    };
	    // Return true if the next token matches the specified keyword
	    Parser.prototype.matchKeyword = function (keyword) {
	        return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
	    };
	    // Return true if the next token matches the specified contextual keyword
	    // (where an identifier is sometimes a keyword depending on the context)
	    Parser.prototype.matchContextualKeyword = function (keyword) {
	        return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
	    };
	    // Return true if the next token is an assignment operator
	    Parser.prototype.matchAssign = function () {
	        if (this.lookahead.type !== 7 /* Punctuator */) {
	            return false;
	        }
	        var op = this.lookahead.value;
	        return op === '=' ||
	            op === '*=' ||
	            op === '**=' ||
	            op === '/=' ||
	            op === '%=' ||
	            op === '+=' ||
	            op === '-=' ||
	            op === '<<=' ||
	            op === '>>=' ||
	            op === '>>>=' ||
	            op === '&=' ||
	            op === '^=' ||
	            op === '|=';
	    };
	    // Cover grammar support.
	    //
	    // When an assignment expression position starts with an left parenthesis, the determination of the type
	    // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
	    // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
	    //
	    // There are three productions that can be parsed in a parentheses pair that needs to be determined
	    // after the outermost pair is closed. They are:
	    //
	    //   1. AssignmentExpression
	    //   2. BindingElements
	    //   3. AssignmentTargets
	    //
	    // In order to avoid exponential backtracking, we use two flags to denote if the production can be
	    // binding element or assignment target.
	    //
	    // The three productions have the relationship:
	    //
	    //   BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
	    //
	    // with a single exception that CoverInitializedName when used directly in an Expression, generates
	    // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
	    // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
	    //
	    // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
	    // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
	    // the CoverInitializedName check is conducted.
	    //
	    // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
	    // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
	    // pattern. The CoverInitializedName check is deferred.
	    Parser.prototype.isolateCoverGrammar = function (parseFunction) {
	        var previousIsBindingElement = this.context.isBindingElement;
	        var previousIsAssignmentTarget = this.context.isAssignmentTarget;
	        var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
	        this.context.isBindingElement = true;
	        this.context.isAssignmentTarget = true;
	        this.context.firstCoverInitializedNameError = null;
	        var result = parseFunction.call(this);
	        if (this.context.firstCoverInitializedNameError !== null) {
	            this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
	        }
	        this.context.isBindingElement = previousIsBindingElement;
	        this.context.isAssignmentTarget = previousIsAssignmentTarget;
	        this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
	        return result;
	    };
	    Parser.prototype.inheritCoverGrammar = function (parseFunction) {
	        var previousIsBindingElement = this.context.isBindingElement;
	        var previousIsAssignmentTarget = this.context.isAssignmentTarget;
	        var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
	        this.context.isBindingElement = true;
	        this.context.isAssignmentTarget = true;
	        this.context.firstCoverInitializedNameError = null;
	        var result = parseFunction.call(this);
	        this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
	        this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
	        this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
	        return result;
	    };
	    Parser.prototype.consumeSemicolon = function () {
	        if (this.match(';')) {
	            this.nextToken();
	        }
	        else if (!this.hasLineTerminator) {
	            if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
	                this.throwUnexpectedToken(this.lookahead);
	            }
	            this.lastMarker.index = this.startMarker.index;
	            this.lastMarker.line = this.startMarker.line;
	            this.lastMarker.column = this.startMarker.column;
	        }
	    };
	    // https://tc39.github.io/ecma262/#sec-primary-expression
	    Parser.prototype.parsePrimaryExpression = function () {
	        var node = this.createNode();
	        var expr;
	        var token, raw;
	        switch (this.lookahead.type) {
	            case 3 /* Identifier */:
	                if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
	                    this.tolerateUnexpectedToken(this.lookahead);
	                }
	                expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
	                break;
	            case 6 /* NumericLiteral */:
	            case 8 /* StringLiteral */:
	                if (this.context.strict && this.lookahead.octal) {
	                    this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
	                }
	                this.context.isAssignmentTarget = false;
	                this.context.isBindingElement = false;
	                token = this.nextToken();
	                raw = this.getTokenRaw(token);
	                expr = this.finalize(node, new Node.Literal(token.value, raw));
	                break;
	            case 1 /* BooleanLiteral */:
	                this.context.isAssignmentTarget = false;
	                this.context.isBindingElement = false;
	                token = this.nextToken();
	                raw = this.getTokenRaw(token);
	                expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
	                break;
	            case 5 /* NullLiteral */:
	                this.context.isAssignmentTarget = false;
	                this.context.isBindingElement = false;
	                token = this.nextToken();
	                raw = this.getTokenRaw(token);
	                expr = this.finalize(node, new Node.Literal(null, raw));
	                break;
	            case 10 /* Template */:
	                expr = this.parseTemplateLiteral();
	                break;
	            case 7 /* Punctuator */:
	                switch (this.lookahead.value) {
	                    case '(':
	                        this.context.isBindingElement = false;
	                        expr = this.inheritCoverGrammar(this.parseGroupExpression);
	                        break;
	                    case '[':
	                        expr = this.inheritCoverGrammar(this.parseArrayInitializer);
	                        break;
	                    case '{':
	                        expr = this.inheritCoverGrammar(this.parseObjectInitializer);
	                        break;
	                    case '/':
	                    case '/=':
	                        this.context.isAssignmentTarget = false;
	                        this.context.isBindingElement = false;
	                        this.scanner.index = this.startMarker.index;
	                        token = this.nextRegexToken();
	                        raw = this.getTokenRaw(token);
	                        expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
	                        break;
	                    default:
	                        expr = this.throwUnexpectedToken(this.nextToken());
	                }
	                break;
	            case 4 /* Keyword */:
	                if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
	                    expr = this.parseIdentifierName();
	                }
	                else if (!this.context.strict && this.matchKeyword('let')) {
	                    expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
	                }
	                else {
	                    this.context.isAssignmentTarget = false;
	                    this.context.isBindingElement = false;
	                    if (this.matchKeyword('function')) {
	                        expr = this.parseFunctionExpression();
	                    }
	                    else if (this.matchKeyword('this')) {
	                        this.nextToken();
	                        expr = this.finalize(node, new Node.ThisExpression());
	                    }
	                    else if (this.matchKeyword('class')) {
	                        expr = this.parseClassExpression();
	                    }
	                    else {
	                        expr = this.throwUnexpectedToken(this.nextToken());
	                    }
	                }
	                break;
	            default:
	                expr = this.throwUnexpectedToken(this.nextToken());
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-array-initializer
	    Parser.prototype.parseSpreadElement = function () {
	        var node = this.createNode();
	        this.expect('...');
	        var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
	        return this.finalize(node, new Node.SpreadElement(arg));
	    };
	    Parser.prototype.parseArrayInitializer = function () {
	        var node = this.createNode();
	        var elements = [];
	        this.expect('[');
	        while (!this.match(']')) {
	            if (this.match(',')) {
	                this.nextToken();
	                elements.push(null);
	            }
	            else if (this.match('...')) {
	                var element = this.parseSpreadElement();
	                if (!this.match(']')) {
	                    this.context.isAssignmentTarget = false;
	                    this.context.isBindingElement = false;
	                    this.expect(',');
	                }
	                elements.push(element);
	            }
	            else {
	                elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
	                if (!this.match(']')) {
	                    this.expect(',');
	                }
	            }
	        }
	        this.expect(']');
	        return this.finalize(node, new Node.ArrayExpression(elements));
	    };
	    // https://tc39.github.io/ecma262/#sec-object-initializer
	    Parser.prototype.parsePropertyMethod = function (params) {
	        this.context.isAssignmentTarget = false;
	        this.context.isBindingElement = false;
	        var previousStrict = this.context.strict;
	        var previousAllowStrictDirective = this.context.allowStrictDirective;
	        this.context.allowStrictDirective = params.simple;
	        var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
	        if (this.context.strict && params.firstRestricted) {
	            this.tolerateUnexpectedToken(params.firstRestricted, params.message);
	        }
	        if (this.context.strict && params.stricted) {
	            this.tolerateUnexpectedToken(params.stricted, params.message);
	        }
	        this.context.strict = previousStrict;
	        this.context.allowStrictDirective = previousAllowStrictDirective;
	        return body;
	    };
	    Parser.prototype.parsePropertyMethodFunction = function () {
	        var isGenerator = false;
	        var node = this.createNode();
	        var previousAllowYield = this.context.allowYield;
	        this.context.allowYield = true;
	        var params = this.parseFormalParameters();
	        var method = this.parsePropertyMethod(params);
	        this.context.allowYield = previousAllowYield;
	        return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
	    };
	    Parser.prototype.parsePropertyMethodAsyncFunction = function () {
	        var node = this.createNode();
	        var previousAllowYield = this.context.allowYield;
	        var previousAwait = this.context.await;
	        this.context.allowYield = false;
	        this.context.await = true;
	        var params = this.parseFormalParameters();
	        var method = this.parsePropertyMethod(params);
	        this.context.allowYield = previousAllowYield;
	        this.context.await = previousAwait;
	        return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
	    };
	    Parser.prototype.parseObjectPropertyKey = function () {
	        var node = this.createNode();
	        var token = this.nextToken();
	        var key;
	        switch (token.type) {
	            case 8 /* StringLiteral */:
	            case 6 /* NumericLiteral */:
	                if (this.context.strict && token.octal) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
	                }
	                var raw = this.getTokenRaw(token);
	                key = this.finalize(node, new Node.Literal(token.value, raw));
	                break;
	            case 3 /* Identifier */:
	            case 1 /* BooleanLiteral */:
	            case 5 /* NullLiteral */:
	            case 4 /* Keyword */:
	                key = this.finalize(node, new Node.Identifier(token.value));
	                break;
	            case 7 /* Punctuator */:
	                if (token.value === '[') {
	                    key = this.isolateCoverGrammar(this.parseAssignmentExpression);
	                    this.expect(']');
	                }
	                else {
	                    key = this.throwUnexpectedToken(token);
	                }
	                break;
	            default:
	                key = this.throwUnexpectedToken(token);
	        }
	        return key;
	    };
	    Parser.prototype.isPropertyKey = function (key, value) {
	        return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
	            (key.type === syntax_1.Syntax.Literal && key.value === value);
	    };
	    Parser.prototype.parseObjectProperty = function (hasProto) {
	        var node = this.createNode();
	        var token = this.lookahead;
	        var kind;
	        var key = null;
	        var value = null;
	        var computed = false;
	        var method = false;
	        var shorthand = false;
	        var isAsync = false;
	        if (token.type === 3 /* Identifier */) {
	            var id = token.value;
	            this.nextToken();
	            computed = this.match('[');
	            isAsync = !this.hasLineTerminator && (id === 'async') &&
	                !this.match(':') && !this.match('(') && !this.match('*') && !this.match(',');
	            key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
	        }
	        else if (this.match('*')) {
	            this.nextToken();
	        }
	        else {
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	        }
	        var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
	        if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
	            kind = 'get';
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            this.context.allowYield = false;
	            value = this.parseGetterMethod();
	        }
	        else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
	            kind = 'set';
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            value = this.parseSetterMethod();
	        }
	        else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
	            kind = 'init';
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            value = this.parseGeneratorMethod();
	            method = true;
	        }
	        else {
	            if (!key) {
	                this.throwUnexpectedToken(this.lookahead);
	            }
	            kind = 'init';
	            if (this.match(':') && !isAsync) {
	                if (!computed && this.isPropertyKey(key, '__proto__')) {
	                    if (hasProto.value) {
	                        this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
	                    }
	                    hasProto.value = true;
	                }
	                this.nextToken();
	                value = this.inheritCoverGrammar(this.parseAssignmentExpression);
	            }
	            else if (this.match('(')) {
	                value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
	                method = true;
	            }
	            else if (token.type === 3 /* Identifier */) {
	                var id = this.finalize(node, new Node.Identifier(token.value));
	                if (this.match('=')) {
	                    this.context.firstCoverInitializedNameError = this.lookahead;
	                    this.nextToken();
	                    shorthand = true;
	                    var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
	                    value = this.finalize(node, new Node.AssignmentPattern(id, init));
	                }
	                else {
	                    shorthand = true;
	                    value = id;
	                }
	            }
	            else {
	                this.throwUnexpectedToken(this.nextToken());
	            }
	        }
	        return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
	    };
	    Parser.prototype.parseObjectInitializer = function () {
	        var node = this.createNode();
	        this.expect('{');
	        var properties = [];
	        var hasProto = { value: false };
	        while (!this.match('}')) {
	            properties.push(this.parseObjectProperty(hasProto));
	            if (!this.match('}')) {
	                this.expectCommaSeparator();
	            }
	        }
	        this.expect('}');
	        return this.finalize(node, new Node.ObjectExpression(properties));
	    };
	    // https://tc39.github.io/ecma262/#sec-template-literals
	    Parser.prototype.parseTemplateHead = function () {
	        assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
	        var node = this.createNode();
	        var token = this.nextToken();
	        var raw = token.value;
	        var cooked = token.cooked;
	        return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
	    };
	    Parser.prototype.parseTemplateElement = function () {
	        if (this.lookahead.type !== 10 /* Template */) {
	            this.throwUnexpectedToken();
	        }
	        var node = this.createNode();
	        var token = this.nextToken();
	        var raw = token.value;
	        var cooked = token.cooked;
	        return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
	    };
	    Parser.prototype.parseTemplateLiteral = function () {
	        var node = this.createNode();
	        var expressions = [];
	        var quasis = [];
	        var quasi = this.parseTemplateHead();
	        quasis.push(quasi);
	        while (!quasi.tail) {
	            expressions.push(this.parseExpression());
	            quasi = this.parseTemplateElement();
	            quasis.push(quasi);
	        }
	        return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
	    };
	    // https://tc39.github.io/ecma262/#sec-grouping-operator
	    Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
	        switch (expr.type) {
	            case syntax_1.Syntax.Identifier:
	            case syntax_1.Syntax.MemberExpression:
	            case syntax_1.Syntax.RestElement:
	            case syntax_1.Syntax.AssignmentPattern:
	                break;
	            case syntax_1.Syntax.SpreadElement:
	                expr.type = syntax_1.Syntax.RestElement;
	                this.reinterpretExpressionAsPattern(expr.argument);
	                break;
	            case syntax_1.Syntax.ArrayExpression:
	                expr.type = syntax_1.Syntax.ArrayPattern;
	                for (var i = 0; i < expr.elements.length; i++) {
	                    if (expr.elements[i] !== null) {
	                        this.reinterpretExpressionAsPattern(expr.elements[i]);
	                    }
	                }
	                break;
	            case syntax_1.Syntax.ObjectExpression:
	                expr.type = syntax_1.Syntax.ObjectPattern;
	                for (var i = 0; i < expr.properties.length; i++) {
	                    this.reinterpretExpressionAsPattern(expr.properties[i].value);
	                }
	                break;
	            case syntax_1.Syntax.AssignmentExpression:
	                expr.type = syntax_1.Syntax.AssignmentPattern;
	                delete expr.operator;
	                this.reinterpretExpressionAsPattern(expr.left);
	                break;
	            default:
	                // Allow other node type for tolerant parsing.
	                break;
	        }
	    };
	    Parser.prototype.parseGroupExpression = function () {
	        var expr;
	        this.expect('(');
	        if (this.match(')')) {
	            this.nextToken();
	            if (!this.match('=>')) {
	                this.expect('=>');
	            }
	            expr = {
	                type: ArrowParameterPlaceHolder,
	                params: [],
	                async: false
	            };
	        }
	        else {
	            var startToken = this.lookahead;
	            var params = [];
	            if (this.match('...')) {
	                expr = this.parseRestElement(params);
	                this.expect(')');
	                if (!this.match('=>')) {
	                    this.expect('=>');
	                }
	                expr = {
	                    type: ArrowParameterPlaceHolder,
	                    params: [expr],
	                    async: false
	                };
	            }
	            else {
	                var arrow = false;
	                this.context.isBindingElement = true;
	                expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
	                if (this.match(',')) {
	                    var expressions = [];
	                    this.context.isAssignmentTarget = false;
	                    expressions.push(expr);
	                    while (this.lookahead.type !== 2 /* EOF */) {
	                        if (!this.match(',')) {
	                            break;
	                        }
	                        this.nextToken();
	                        if (this.match(')')) {
	                            this.nextToken();
	                            for (var i = 0; i < expressions.length; i++) {
	                                this.reinterpretExpressionAsPattern(expressions[i]);
	                            }
	                            arrow = true;
	                            expr = {
	                                type: ArrowParameterPlaceHolder,
	                                params: expressions,
	                                async: false
	                            };
	                        }
	                        else if (this.match('...')) {
	                            if (!this.context.isBindingElement) {
	                                this.throwUnexpectedToken(this.lookahead);
	                            }
	                            expressions.push(this.parseRestElement(params));
	                            this.expect(')');
	                            if (!this.match('=>')) {
	                                this.expect('=>');
	                            }
	                            this.context.isBindingElement = false;
	                            for (var i = 0; i < expressions.length; i++) {
	                                this.reinterpretExpressionAsPattern(expressions[i]);
	                            }
	                            arrow = true;
	                            expr = {
	                                type: ArrowParameterPlaceHolder,
	                                params: expressions,
	                                async: false
	                            };
	                        }
	                        else {
	                            expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
	                        }
	                        if (arrow) {
	                            break;
	                        }
	                    }
	                    if (!arrow) {
	                        expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
	                    }
	                }
	                if (!arrow) {
	                    this.expect(')');
	                    if (this.match('=>')) {
	                        if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') {
	                            arrow = true;
	                            expr = {
	                                type: ArrowParameterPlaceHolder,
	                                params: [expr],
	                                async: false
	                            };
	                        }
	                        if (!arrow) {
	                            if (!this.context.isBindingElement) {
	                                this.throwUnexpectedToken(this.lookahead);
	                            }
	                            if (expr.type === syntax_1.Syntax.SequenceExpression) {
	                                for (var i = 0; i < expr.expressions.length; i++) {
	                                    this.reinterpretExpressionAsPattern(expr.expressions[i]);
	                                }
	                            }
	                            else {
	                                this.reinterpretExpressionAsPattern(expr);
	                            }
	                            var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]);
	                            expr = {
	                                type: ArrowParameterPlaceHolder,
	                                params: parameters,
	                                async: false
	                            };
	                        }
	                    }
	                    this.context.isBindingElement = false;
	                }
	            }
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions
	    Parser.prototype.parseArguments = function () {
	        this.expect('(');
	        var args = [];
	        if (!this.match(')')) {
	            while (true) {
	                var expr = this.match('...') ? this.parseSpreadElement() :
	                    this.isolateCoverGrammar(this.parseAssignmentExpression);
	                args.push(expr);
	                if (this.match(')')) {
	                    break;
	                }
	                this.expectCommaSeparator();
	                if (this.match(')')) {
	                    break;
	                }
	            }
	        }
	        this.expect(')');
	        return args;
	    };
	    Parser.prototype.isIdentifierName = function (token) {
	        return token.type === 3 /* Identifier */ ||
	            token.type === 4 /* Keyword */ ||
	            token.type === 1 /* BooleanLiteral */ ||
	            token.type === 5 /* NullLiteral */;
	    };
	    Parser.prototype.parseIdentifierName = function () {
	        var node = this.createNode();
	        var token = this.nextToken();
	        if (!this.isIdentifierName(token)) {
	            this.throwUnexpectedToken(token);
	        }
	        return this.finalize(node, new Node.Identifier(token.value));
	    };
	    Parser.prototype.parseNewExpression = function () {
	        var node = this.createNode();
	        var id = this.parseIdentifierName();
	        assert_1.assert(id.name === 'new', 'New expression must start with `new`');
	        var expr;
	        if (this.match('.')) {
	            this.nextToken();
	            if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') {
	                var property = this.parseIdentifierName();
	                expr = new Node.MetaProperty(id, property);
	            }
	            else {
	                this.throwUnexpectedToken(this.lookahead);
	            }
	        }
	        else {
	            var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
	            var args = this.match('(') ? this.parseArguments() : [];
	            expr = new Node.NewExpression(callee, args);
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	        }
	        return this.finalize(node, expr);
	    };
	    Parser.prototype.parseAsyncArgument = function () {
	        var arg = this.parseAssignmentExpression();
	        this.context.firstCoverInitializedNameError = null;
	        return arg;
	    };
	    Parser.prototype.parseAsyncArguments = function () {
	        this.expect('(');
	        var args = [];
	        if (!this.match(')')) {
	            while (true) {
	                var expr = this.match('...') ? this.parseSpreadElement() :
	                    this.isolateCoverGrammar(this.parseAsyncArgument);
	                args.push(expr);
	                if (this.match(')')) {
	                    break;
	                }
	                this.expectCommaSeparator();
	                if (this.match(')')) {
	                    break;
	                }
	            }
	        }
	        this.expect(')');
	        return args;
	    };
	    Parser.prototype.parseLeftHandSideExpressionAllowCall = function () {
	        var startToken = this.lookahead;
	        var maybeAsync = this.matchContextualKeyword('async');
	        var previousAllowIn = this.context.allowIn;
	        this.context.allowIn = true;
	        var expr;
	        if (this.matchKeyword('super') && this.context.inFunctionBody) {
	            expr = this.createNode();
	            this.nextToken();
	            expr = this.finalize(expr, new Node.Super());
	            if (!this.match('(') && !this.match('.') && !this.match('[')) {
	                this.throwUnexpectedToken(this.lookahead);
	            }
	        }
	        else {
	            expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
	        }
	        while (true) {
	            if (this.match('.')) {
	                this.context.isBindingElement = false;
	                this.context.isAssignmentTarget = true;
	                this.expect('.');
	                var property = this.parseIdentifierName();
	                expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
	            }
	            else if (this.match('(')) {
	                var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber);
	                this.context.isBindingElement = false;
	                this.context.isAssignmentTarget = false;
	                var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
	                expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
	                if (asyncArrow && this.match('=>')) {
	                    for (var i = 0; i < args.length; ++i) {
	                        this.reinterpretExpressionAsPattern(args[i]);
	                    }
	                    expr = {
	                        type: ArrowParameterPlaceHolder,
	                        params: args,
	                        async: true
	                    };
	                }
	            }
	            else if (this.match('[')) {
	                this.context.isBindingElement = false;
	                this.context.isAssignmentTarget = true;
	                this.expect('[');
	                var property = this.isolateCoverGrammar(this.parseExpression);
	                this.expect(']');
	                expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
	            }
	            else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
	                var quasi = this.parseTemplateLiteral();
	                expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
	            }
	            else {
	                break;
	            }
	        }
	        this.context.allowIn = previousAllowIn;
	        return expr;
	    };
	    Parser.prototype.parseSuper = function () {
	        var node = this.createNode();
	        this.expectKeyword('super');
	        if (!this.match('[') && !this.match('.')) {
	            this.throwUnexpectedToken(this.lookahead);
	        }
	        return this.finalize(node, new Node.Super());
	    };
	    Parser.prototype.parseLeftHandSideExpression = function () {
	        assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
	        var node = this.startNode(this.lookahead);
	        var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
	            this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
	        while (true) {
	            if (this.match('[')) {
	                this.context.isBindingElement = false;
	                this.context.isAssignmentTarget = true;
	                this.expect('[');
	                var property = this.isolateCoverGrammar(this.parseExpression);
	                this.expect(']');
	                expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
	            }
	            else if (this.match('.')) {
	                this.context.isBindingElement = false;
	                this.context.isAssignmentTarget = true;
	                this.expect('.');
	                var property = this.parseIdentifierName();
	                expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
	            }
	            else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
	                var quasi = this.parseTemplateLiteral();
	                expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
	            }
	            else {
	                break;
	            }
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-update-expressions
	    Parser.prototype.parseUpdateExpression = function () {
	        var expr;
	        var startToken = this.lookahead;
	        if (this.match('++') || this.match('--')) {
	            var node = this.startNode(startToken);
	            var token = this.nextToken();
	            expr = this.inheritCoverGrammar(this.parseUnaryExpression);
	            if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
	                this.tolerateError(messages_1.Messages.StrictLHSPrefix);
	            }
	            if (!this.context.isAssignmentTarget) {
	                this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
	            }
	            var prefix = true;
	            expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	        }
	        else {
	            expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
	            if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) {
	                if (this.match('++') || this.match('--')) {
	                    if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
	                        this.tolerateError(messages_1.Messages.StrictLHSPostfix);
	                    }
	                    if (!this.context.isAssignmentTarget) {
	                        this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
	                    }
	                    this.context.isAssignmentTarget = false;
	                    this.context.isBindingElement = false;
	                    var operator = this.nextToken().value;
	                    var prefix = false;
	                    expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
	                }
	            }
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-unary-operators
	    Parser.prototype.parseAwaitExpression = function () {
	        var node = this.createNode();
	        this.nextToken();
	        var argument = this.parseUnaryExpression();
	        return this.finalize(node, new Node.AwaitExpression(argument));
	    };
	    Parser.prototype.parseUnaryExpression = function () {
	        var expr;
	        if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
	            this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
	            var node = this.startNode(this.lookahead);
	            var token = this.nextToken();
	            expr = this.inheritCoverGrammar(this.parseUnaryExpression);
	            expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
	            if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) {
	                this.tolerateError(messages_1.Messages.StrictDelete);
	            }
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	        }
	        else if (this.context.await && this.matchContextualKeyword('await')) {
	            expr = this.parseAwaitExpression();
	        }
	        else {
	            expr = this.parseUpdateExpression();
	        }
	        return expr;
	    };
	    Parser.prototype.parseExponentiationExpression = function () {
	        var startToken = this.lookahead;
	        var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
	        if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) {
	            this.nextToken();
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	            var left = expr;
	            var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
	            expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right));
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-exp-operator
	    // https://tc39.github.io/ecma262/#sec-multiplicative-operators
	    // https://tc39.github.io/ecma262/#sec-additive-operators
	    // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators
	    // https://tc39.github.io/ecma262/#sec-relational-operators
	    // https://tc39.github.io/ecma262/#sec-equality-operators
	    // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators
	    // https://tc39.github.io/ecma262/#sec-binary-logical-operators
	    Parser.prototype.binaryPrecedence = function (token) {
	        var op = token.value;
	        var precedence;
	        if (token.type === 7 /* Punctuator */) {
	            precedence = this.operatorPrecedence[op] || 0;
	        }
	        else if (token.type === 4 /* Keyword */) {
	            precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0;
	        }
	        else {
	            precedence = 0;
	        }
	        return precedence;
	    };
	    Parser.prototype.parseBinaryExpression = function () {
	        var startToken = this.lookahead;
	        var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
	        var token = this.lookahead;
	        var prec = this.binaryPrecedence(token);
	        if (prec > 0) {
	            this.nextToken();
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	            var markers = [startToken, this.lookahead];
	            var left = expr;
	            var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
	            var stack = [left, token.value, right];
	            var precedences = [prec];
	            while (true) {
	                prec = this.binaryPrecedence(this.lookahead);
	                if (prec <= 0) {
	                    break;
	                }
	                // Reduce: make a binary expression from the three topmost entries.
	                while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) {
	                    right = stack.pop();
	                    var operator = stack.pop();
	                    precedences.pop();
	                    left = stack.pop();
	                    markers.pop();
	                    var node = this.startNode(markers[markers.length - 1]);
	                    stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
	                }
	                // Shift.
	                stack.push(this.nextToken().value);
	                precedences.push(prec);
	                markers.push(this.lookahead);
	                stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
	            }
	            // Final reduce to clean-up the stack.
	            var i = stack.length - 1;
	            expr = stack[i];
	            var lastMarker = markers.pop();
	            while (i > 1) {
	                var marker = markers.pop();
	                var lastLineStart = lastMarker && lastMarker.lineStart;
	                var node = this.startNode(marker, lastLineStart);
	                var operator = stack[i - 1];
	                expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
	                i -= 2;
	                lastMarker = marker;
	            }
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-conditional-operator
	    Parser.prototype.parseConditionalExpression = function () {
	        var startToken = this.lookahead;
	        var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
	        if (this.match('?')) {
	            this.nextToken();
	            var previousAllowIn = this.context.allowIn;
	            this.context.allowIn = true;
	            var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
	            this.context.allowIn = previousAllowIn;
	            this.expect(':');
	            var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
	            expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
	            this.context.isAssignmentTarget = false;
	            this.context.isBindingElement = false;
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-assignment-operators
	    Parser.prototype.checkPatternParam = function (options, param) {
	        switch (param.type) {
	            case syntax_1.Syntax.Identifier:
	                this.validateParam(options, param, param.name);
	                break;
	            case syntax_1.Syntax.RestElement:
	                this.checkPatternParam(options, param.argument);
	                break;
	            case syntax_1.Syntax.AssignmentPattern:
	                this.checkPatternParam(options, param.left);
	                break;
	            case syntax_1.Syntax.ArrayPattern:
	                for (var i = 0; i < param.elements.length; i++) {
	                    if (param.elements[i] !== null) {
	                        this.checkPatternParam(options, param.elements[i]);
	                    }
	                }
	                break;
	            case syntax_1.Syntax.ObjectPattern:
	                for (var i = 0; i < param.properties.length; i++) {
	                    this.checkPatternParam(options, param.properties[i].value);
	                }
	                break;
	            default:
	                break;
	        }
	        options.simple = options.simple && (param instanceof Node.Identifier);
	    };
	    Parser.prototype.reinterpretAsCoverFormalsList = function (expr) {
	        var params = [expr];
	        var options;
	        var asyncArrow = false;
	        switch (expr.type) {
	            case syntax_1.Syntax.Identifier:
	                break;
	            case ArrowParameterPlaceHolder:
	                params = expr.params;
	                asyncArrow = expr.async;
	                break;
	            default:
	                return null;
	        }
	        options = {
	            simple: true,
	            paramSet: {}
	        };
	        for (var i = 0; i < params.length; ++i) {
	            var param = params[i];
	            if (param.type === syntax_1.Syntax.AssignmentPattern) {
	                if (param.right.type === syntax_1.Syntax.YieldExpression) {
	                    if (param.right.argument) {
	                        this.throwUnexpectedToken(this.lookahead);
	                    }
	                    param.right.type = syntax_1.Syntax.Identifier;
	                    param.right.name = 'yield';
	                    delete param.right.argument;
	                    delete param.right.delegate;
	                }
	            }
	            else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') {
	                this.throwUnexpectedToken(this.lookahead);
	            }
	            this.checkPatternParam(options, param);
	            params[i] = param;
	        }
	        if (this.context.strict || !this.context.allowYield) {
	            for (var i = 0; i < params.length; ++i) {
	                var param = params[i];
	                if (param.type === syntax_1.Syntax.YieldExpression) {
	                    this.throwUnexpectedToken(this.lookahead);
	                }
	            }
	        }
	        if (options.message === messages_1.Messages.StrictParamDupe) {
	            var token = this.context.strict ? options.stricted : options.firstRestricted;
	            this.throwUnexpectedToken(token, options.message);
	        }
	        return {
	            simple: options.simple,
	            params: params,
	            stricted: options.stricted,
	            firstRestricted: options.firstRestricted,
	            message: options.message
	        };
	    };
	    Parser.prototype.parseAssignmentExpression = function () {
	        var expr;
	        if (!this.context.allowYield && this.matchKeyword('yield')) {
	            expr = this.parseYieldExpression();
	        }
	        else {
	            var startToken = this.lookahead;
	            var token = startToken;
	            expr = this.parseConditionalExpression();
	            if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') {
	                if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) {
	                    var arg = this.parsePrimaryExpression();
	                    this.reinterpretExpressionAsPattern(arg);
	                    expr = {
	                        type: ArrowParameterPlaceHolder,
	                        params: [arg],
	                        async: true
	                    };
	                }
	            }
	            if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) {
	                // https://tc39.github.io/ecma262/#sec-arrow-function-definitions
	                this.context.isAssignmentTarget = false;
	                this.context.isBindingElement = false;
	                var isAsync = expr.async;
	                var list = this.reinterpretAsCoverFormalsList(expr);
	                if (list) {
	                    if (this.hasLineTerminator) {
	                        this.tolerateUnexpectedToken(this.lookahead);
	                    }
	                    this.context.firstCoverInitializedNameError = null;
	                    var previousStrict = this.context.strict;
	                    var previousAllowStrictDirective = this.context.allowStrictDirective;
	                    this.context.allowStrictDirective = list.simple;
	                    var previousAllowYield = this.context.allowYield;
	                    var previousAwait = this.context.await;
	                    this.context.allowYield = true;
	                    this.context.await = isAsync;
	                    var node = this.startNode(startToken);
	                    this.expect('=>');
	                    var body = void 0;
	                    if (this.match('{')) {
	                        var previousAllowIn = this.context.allowIn;
	                        this.context.allowIn = true;
	                        body = this.parseFunctionSourceElements();
	                        this.context.allowIn = previousAllowIn;
	                    }
	                    else {
	                        body = this.isolateCoverGrammar(this.parseAssignmentExpression);
	                    }
	                    var expression = body.type !== syntax_1.Syntax.BlockStatement;
	                    if (this.context.strict && list.firstRestricted) {
	                        this.throwUnexpectedToken(list.firstRestricted, list.message);
	                    }
	                    if (this.context.strict && list.stricted) {
	                        this.tolerateUnexpectedToken(list.stricted, list.message);
	                    }
	                    expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) :
	                        this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
	                    this.context.strict = previousStrict;
	                    this.context.allowStrictDirective = previousAllowStrictDirective;
	                    this.context.allowYield = previousAllowYield;
	                    this.context.await = previousAwait;
	                }
	            }
	            else {
	                if (this.matchAssign()) {
	                    if (!this.context.isAssignmentTarget) {
	                        this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
	                    }
	                    if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
	                        var id = expr;
	                        if (this.scanner.isRestrictedWord(id.name)) {
	                            this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
	                        }
	                        if (this.scanner.isStrictModeReservedWord(id.name)) {
	                            this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
	                        }
	                    }
	                    if (!this.match('=')) {
	                        this.context.isAssignmentTarget = false;
	                        this.context.isBindingElement = false;
	                    }
	                    else {
	                        this.reinterpretExpressionAsPattern(expr);
	                    }
	                    token = this.nextToken();
	                    var operator = token.value;
	                    var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
	                    expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
	                    this.context.firstCoverInitializedNameError = null;
	                }
	            }
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-comma-operator
	    Parser.prototype.parseExpression = function () {
	        var startToken = this.lookahead;
	        var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
	        if (this.match(',')) {
	            var expressions = [];
	            expressions.push(expr);
	            while (this.lookahead.type !== 2 /* EOF */) {
	                if (!this.match(',')) {
	                    break;
	                }
	                this.nextToken();
	                expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
	            }
	            expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
	        }
	        return expr;
	    };
	    // https://tc39.github.io/ecma262/#sec-block
	    Parser.prototype.parseStatementListItem = function () {
	        var statement;
	        this.context.isAssignmentTarget = true;
	        this.context.isBindingElement = true;
	        if (this.lookahead.type === 4 /* Keyword */) {
	            switch (this.lookahead.value) {
	                case 'export':
	                    if (!this.context.isModule) {
	                        this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
	                    }
	                    statement = this.parseExportDeclaration();
	                    break;
	                case 'import':
	                    if (!this.context.isModule) {
	                        this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
	                    }
	                    statement = this.parseImportDeclaration();
	                    break;
	                case 'const':
	                    statement = this.parseLexicalDeclaration({ inFor: false });
	                    break;
	                case 'function':
	                    statement = this.parseFunctionDeclaration();
	                    break;
	                case 'class':
	                    statement = this.parseClassDeclaration();
	                    break;
	                case 'let':
	                    statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
	                    break;
	                default:
	                    statement = this.parseStatement();
	                    break;
	            }
	        }
	        else {
	            statement = this.parseStatement();
	        }
	        return statement;
	    };
	    Parser.prototype.parseBlock = function () {
	        var node = this.createNode();
	        this.expect('{');
	        var block = [];
	        while (true) {
	            if (this.match('}')) {
	                break;
	            }
	            block.push(this.parseStatementListItem());
	        }
	        this.expect('}');
	        return this.finalize(node, new Node.BlockStatement(block));
	    };
	    // https://tc39.github.io/ecma262/#sec-let-and-const-declarations
	    Parser.prototype.parseLexicalBinding = function (kind, options) {
	        var node = this.createNode();
	        var params = [];
	        var id = this.parsePattern(params, kind);
	        if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
	            if (this.scanner.isRestrictedWord(id.name)) {
	                this.tolerateError(messages_1.Messages.StrictVarName);
	            }
	        }
	        var init = null;
	        if (kind === 'const') {
	            if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) {
	                if (this.match('=')) {
	                    this.nextToken();
	                    init = this.isolateCoverGrammar(this.parseAssignmentExpression);
	                }
	                else {
	                    this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const');
	                }
	            }
	        }
	        else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) {
	            this.expect('=');
	            init = this.isolateCoverGrammar(this.parseAssignmentExpression);
	        }
	        return this.finalize(node, new Node.VariableDeclarator(id, init));
	    };
	    Parser.prototype.parseBindingList = function (kind, options) {
	        var list = [this.parseLexicalBinding(kind, options)];
	        while (this.match(',')) {
	            this.nextToken();
	            list.push(this.parseLexicalBinding(kind, options));
	        }
	        return list;
	    };
	    Parser.prototype.isLexicalDeclaration = function () {
	        var state = this.scanner.saveState();
	        this.scanner.scanComments();
	        var next = this.scanner.lex();
	        this.scanner.restoreState(state);
	        return (next.type === 3 /* Identifier */) ||
	            (next.type === 7 /* Punctuator */ && next.value === '[') ||
	            (next.type === 7 /* Punctuator */ && next.value === '{') ||
	            (next.type === 4 /* Keyword */ && next.value === 'let') ||
	            (next.type === 4 /* Keyword */ && next.value === 'yield');
	    };
	    Parser.prototype.parseLexicalDeclaration = function (options) {
	        var node = this.createNode();
	        var kind = this.nextToken().value;
	        assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
	        var declarations = this.parseBindingList(kind, options);
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
	    };
	    // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
	    Parser.prototype.parseBindingRestElement = function (params, kind) {
	        var node = this.createNode();
	        this.expect('...');
	        var arg = this.parsePattern(params, kind);
	        return this.finalize(node, new Node.RestElement(arg));
	    };
	    Parser.prototype.parseArrayPattern = function (params, kind) {
	        var node = this.createNode();
	        this.expect('[');
	        var elements = [];
	        while (!this.match(']')) {
	            if (this.match(',')) {
	                this.nextToken();
	                elements.push(null);
	            }
	            else {
	                if (this.match('...')) {
	                    elements.push(this.parseBindingRestElement(params, kind));
	                    break;
	                }
	                else {
	                    elements.push(this.parsePatternWithDefault(params, kind));
	                }
	                if (!this.match(']')) {
	                    this.expect(',');
	                }
	            }
	        }
	        this.expect(']');
	        return this.finalize(node, new Node.ArrayPattern(elements));
	    };
	    Parser.prototype.parsePropertyPattern = function (params, kind) {
	        var node = this.createNode();
	        var computed = false;
	        var shorthand = false;
	        var method = false;
	        var key;
	        var value;
	        if (this.lookahead.type === 3 /* Identifier */) {
	            var keyToken = this.lookahead;
	            key = this.parseVariableIdentifier();
	            var init = this.finalize(node, new Node.Identifier(keyToken.value));
	            if (this.match('=')) {
	                params.push(keyToken);
	                shorthand = true;
	                this.nextToken();
	                var expr = this.parseAssignmentExpression();
	                value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
	            }
	            else if (!this.match(':')) {
	                params.push(keyToken);
	                shorthand = true;
	                value = init;
	            }
	            else {
	                this.expect(':');
	                value = this.parsePatternWithDefault(params, kind);
	            }
	        }
	        else {
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            this.expect(':');
	            value = this.parsePatternWithDefault(params, kind);
	        }
	        return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
	    };
	    Parser.prototype.parseObjectPattern = function (params, kind) {
	        var node = this.createNode();
	        var properties = [];
	        this.expect('{');
	        while (!this.match('}')) {
	            properties.push(this.parsePropertyPattern(params, kind));
	            if (!this.match('}')) {
	                this.expect(',');
	            }
	        }
	        this.expect('}');
	        return this.finalize(node, new Node.ObjectPattern(properties));
	    };
	    Parser.prototype.parsePattern = function (params, kind) {
	        var pattern;
	        if (this.match('[')) {
	            pattern = this.parseArrayPattern(params, kind);
	        }
	        else if (this.match('{')) {
	            pattern = this.parseObjectPattern(params, kind);
	        }
	        else {
	            if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
	                this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
	            }
	            params.push(this.lookahead);
	            pattern = this.parseVariableIdentifier(kind);
	        }
	        return pattern;
	    };
	    Parser.prototype.parsePatternWithDefault = function (params, kind) {
	        var startToken = this.lookahead;
	        var pattern = this.parsePattern(params, kind);
	        if (this.match('=')) {
	            this.nextToken();
	            var previousAllowYield = this.context.allowYield;
	            this.context.allowYield = true;
	            var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
	            this.context.allowYield = previousAllowYield;
	            pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
	        }
	        return pattern;
	    };
	    // https://tc39.github.io/ecma262/#sec-variable-statement
	    Parser.prototype.parseVariableIdentifier = function (kind) {
	        var node = this.createNode();
	        var token = this.nextToken();
	        if (token.type === 4 /* Keyword */ && token.value === 'yield') {
	            if (this.context.strict) {
	                this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
	            }
	            else if (!this.context.allowYield) {
	                this.throwUnexpectedToken(token);
	            }
	        }
	        else if (token.type !== 3 /* Identifier */) {
	            if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
	                this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
	            }
	            else {
	                if (this.context.strict || token.value !== 'let' || kind !== 'var') {
	                    this.throwUnexpectedToken(token);
	                }
	            }
	        }
	        else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
	            this.tolerateUnexpectedToken(token);
	        }
	        return this.finalize(node, new Node.Identifier(token.value));
	    };
	    Parser.prototype.parseVariableDeclaration = function (options) {
	        var node = this.createNode();
	        var params = [];
	        var id = this.parsePattern(params, 'var');
	        if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
	            if (this.scanner.isRestrictedWord(id.name)) {
	                this.tolerateError(messages_1.Messages.StrictVarName);
	            }
	        }
	        var init = null;
	        if (this.match('=')) {
	            this.nextToken();
	            init = this.isolateCoverGrammar(this.parseAssignmentExpression);
	        }
	        else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
	            this.expect('=');
	        }
	        return this.finalize(node, new Node.VariableDeclarator(id, init));
	    };
	    Parser.prototype.parseVariableDeclarationList = function (options) {
	        var opt = { inFor: options.inFor };
	        var list = [];
	        list.push(this.parseVariableDeclaration(opt));
	        while (this.match(',')) {
	            this.nextToken();
	            list.push(this.parseVariableDeclaration(opt));
	        }
	        return list;
	    };
	    Parser.prototype.parseVariableStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('var');
	        var declarations = this.parseVariableDeclarationList({ inFor: false });
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
	    };
	    // https://tc39.github.io/ecma262/#sec-empty-statement
	    Parser.prototype.parseEmptyStatement = function () {
	        var node = this.createNode();
	        this.expect(';');
	        return this.finalize(node, new Node.EmptyStatement());
	    };
	    // https://tc39.github.io/ecma262/#sec-expression-statement
	    Parser.prototype.parseExpressionStatement = function () {
	        var node = this.createNode();
	        var expr = this.parseExpression();
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.ExpressionStatement(expr));
	    };
	    // https://tc39.github.io/ecma262/#sec-if-statement
	    Parser.prototype.parseIfClause = function () {
	        if (this.context.strict && this.matchKeyword('function')) {
	            this.tolerateError(messages_1.Messages.StrictFunction);
	        }
	        return this.parseStatement();
	    };
	    Parser.prototype.parseIfStatement = function () {
	        var node = this.createNode();
	        var consequent;
	        var alternate = null;
	        this.expectKeyword('if');
	        this.expect('(');
	        var test = this.parseExpression();
	        if (!this.match(')') && this.config.tolerant) {
	            this.tolerateUnexpectedToken(this.nextToken());
	            consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
	        }
	        else {
	            this.expect(')');
	            consequent = this.parseIfClause();
	            if (this.matchKeyword('else')) {
	                this.nextToken();
	                alternate = this.parseIfClause();
	            }
	        }
	        return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
	    };
	    // https://tc39.github.io/ecma262/#sec-do-while-statement
	    Parser.prototype.parseDoWhileStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('do');
	        var previousInIteration = this.context.inIteration;
	        this.context.inIteration = true;
	        var body = this.parseStatement();
	        this.context.inIteration = previousInIteration;
	        this.expectKeyword('while');
	        this.expect('(');
	        var test = this.parseExpression();
	        if (!this.match(')') && this.config.tolerant) {
	            this.tolerateUnexpectedToken(this.nextToken());
	        }
	        else {
	            this.expect(')');
	            if (this.match(';')) {
	                this.nextToken();
	            }
	        }
	        return this.finalize(node, new Node.DoWhileStatement(body, test));
	    };
	    // https://tc39.github.io/ecma262/#sec-while-statement
	    Parser.prototype.parseWhileStatement = function () {
	        var node = this.createNode();
	        var body;
	        this.expectKeyword('while');
	        this.expect('(');
	        var test = this.parseExpression();
	        if (!this.match(')') && this.config.tolerant) {
	            this.tolerateUnexpectedToken(this.nextToken());
	            body = this.finalize(this.createNode(), new Node.EmptyStatement());
	        }
	        else {
	            this.expect(')');
	            var previousInIteration = this.context.inIteration;
	            this.context.inIteration = true;
	            body = this.parseStatement();
	            this.context.inIteration = previousInIteration;
	        }
	        return this.finalize(node, new Node.WhileStatement(test, body));
	    };
	    // https://tc39.github.io/ecma262/#sec-for-statement
	    // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
	    Parser.prototype.parseForStatement = function () {
	        var init = null;
	        var test = null;
	        var update = null;
	        var forIn = true;
	        var left, right;
	        var node = this.createNode();
	        this.expectKeyword('for');
	        this.expect('(');
	        if (this.match(';')) {
	            this.nextToken();
	        }
	        else {
	            if (this.matchKeyword('var')) {
	                init = this.createNode();
	                this.nextToken();
	                var previousAllowIn = this.context.allowIn;
	                this.context.allowIn = false;
	                var declarations = this.parseVariableDeclarationList({ inFor: true });
	                this.context.allowIn = previousAllowIn;
	                if (declarations.length === 1 && this.matchKeyword('in')) {
	                    var decl = declarations[0];
	                    if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
	                        this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
	                    }
	                    init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
	                    this.nextToken();
	                    left = init;
	                    right = this.parseExpression();
	                    init = null;
	                }
	                else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
	                    init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
	                    this.nextToken();
	                    left = init;
	                    right = this.parseAssignmentExpression();
	                    init = null;
	                    forIn = false;
	                }
	                else {
	                    init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
	                    this.expect(';');
	                }
	            }
	            else if (this.matchKeyword('const') || this.matchKeyword('let')) {
	                init = this.createNode();
	                var kind = this.nextToken().value;
	                if (!this.context.strict && this.lookahead.value === 'in') {
	                    init = this.finalize(init, new Node.Identifier(kind));
	                    this.nextToken();
	                    left = init;
	                    right = this.parseExpression();
	                    init = null;
	                }
	                else {
	                    var previousAllowIn = this.context.allowIn;
	                    this.context.allowIn = false;
	                    var declarations = this.parseBindingList(kind, { inFor: true });
	                    this.context.allowIn = previousAllowIn;
	                    if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
	                        init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
	                        this.nextToken();
	                        left = init;
	                        right = this.parseExpression();
	                        init = null;
	                    }
	                    else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
	                        init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
	                        this.nextToken();
	                        left = init;
	                        right = this.parseAssignmentExpression();
	                        init = null;
	                        forIn = false;
	                    }
	                    else {
	                        this.consumeSemicolon();
	                        init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
	                    }
	                }
	            }
	            else {
	                var initStartToken = this.lookahead;
	                var previousAllowIn = this.context.allowIn;
	                this.context.allowIn = false;
	                init = this.inheritCoverGrammar(this.parseAssignmentExpression);
	                this.context.allowIn = previousAllowIn;
	                if (this.matchKeyword('in')) {
	                    if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
	                        this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
	                    }
	                    this.nextToken();
	                    this.reinterpretExpressionAsPattern(init);
	                    left = init;
	                    right = this.parseExpression();
	                    init = null;
	                }
	                else if (this.matchContextualKeyword('of')) {
	                    if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
	                        this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
	                    }
	                    this.nextToken();
	                    this.reinterpretExpressionAsPattern(init);
	                    left = init;
	                    right = this.parseAssignmentExpression();
	                    init = null;
	                    forIn = false;
	                }
	                else {
	                    if (this.match(',')) {
	                        var initSeq = [init];
	                        while (this.match(',')) {
	                            this.nextToken();
	                            initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
	                        }
	                        init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
	                    }
	                    this.expect(';');
	                }
	            }
	        }
	        if (typeof left === 'undefined') {
	            if (!this.match(';')) {
	                test = this.parseExpression();
	            }
	            this.expect(';');
	            if (!this.match(')')) {
	                update = this.parseExpression();
	            }
	        }
	        var body;
	        if (!this.match(')') && this.config.tolerant) {
	            this.tolerateUnexpectedToken(this.nextToken());
	            body = this.finalize(this.createNode(), new Node.EmptyStatement());
	        }
	        else {
	            this.expect(')');
	            var previousInIteration = this.context.inIteration;
	            this.context.inIteration = true;
	            body = this.isolateCoverGrammar(this.parseStatement);
	            this.context.inIteration = previousInIteration;
	        }
	        return (typeof left === 'undefined') ?
	            this.finalize(node, new Node.ForStatement(init, test, update, body)) :
	            forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
	                this.finalize(node, new Node.ForOfStatement(left, right, body));
	    };
	    // https://tc39.github.io/ecma262/#sec-continue-statement
	    Parser.prototype.parseContinueStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('continue');
	        var label = null;
	        if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
	            var id = this.parseVariableIdentifier();
	            label = id;
	            var key = '$' + id.name;
	            if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
	                this.throwError(messages_1.Messages.UnknownLabel, id.name);
	            }
	        }
	        this.consumeSemicolon();
	        if (label === null && !this.context.inIteration) {
	            this.throwError(messages_1.Messages.IllegalContinue);
	        }
	        return this.finalize(node, new Node.ContinueStatement(label));
	    };
	    // https://tc39.github.io/ecma262/#sec-break-statement
	    Parser.prototype.parseBreakStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('break');
	        var label = null;
	        if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
	            var id = this.parseVariableIdentifier();
	            var key = '$' + id.name;
	            if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
	                this.throwError(messages_1.Messages.UnknownLabel, id.name);
	            }
	            label = id;
	        }
	        this.consumeSemicolon();
	        if (label === null && !this.context.inIteration && !this.context.inSwitch) {
	            this.throwError(messages_1.Messages.IllegalBreak);
	        }
	        return this.finalize(node, new Node.BreakStatement(label));
	    };
	    // https://tc39.github.io/ecma262/#sec-return-statement
	    Parser.prototype.parseReturnStatement = function () {
	        if (!this.context.inFunctionBody) {
	            this.tolerateError(messages_1.Messages.IllegalReturn);
	        }
	        var node = this.createNode();
	        this.expectKeyword('return');
	        var hasArgument = (!this.match(';') && !this.match('}') &&
	            !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) ||
	            this.lookahead.type === 8 /* StringLiteral */ ||
	            this.lookahead.type === 10 /* Template */;
	        var argument = hasArgument ? this.parseExpression() : null;
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.ReturnStatement(argument));
	    };
	    // https://tc39.github.io/ecma262/#sec-with-statement
	    Parser.prototype.parseWithStatement = function () {
	        if (this.context.strict) {
	            this.tolerateError(messages_1.Messages.StrictModeWith);
	        }
	        var node = this.createNode();
	        var body;
	        this.expectKeyword('with');
	        this.expect('(');
	        var object = this.parseExpression();
	        if (!this.match(')') && this.config.tolerant) {
	            this.tolerateUnexpectedToken(this.nextToken());
	            body = this.finalize(this.createNode(), new Node.EmptyStatement());
	        }
	        else {
	            this.expect(')');
	            body = this.parseStatement();
	        }
	        return this.finalize(node, new Node.WithStatement(object, body));
	    };
	    // https://tc39.github.io/ecma262/#sec-switch-statement
	    Parser.prototype.parseSwitchCase = function () {
	        var node = this.createNode();
	        var test;
	        if (this.matchKeyword('default')) {
	            this.nextToken();
	            test = null;
	        }
	        else {
	            this.expectKeyword('case');
	            test = this.parseExpression();
	        }
	        this.expect(':');
	        var consequent = [];
	        while (true) {
	            if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
	                break;
	            }
	            consequent.push(this.parseStatementListItem());
	        }
	        return this.finalize(node, new Node.SwitchCase(test, consequent));
	    };
	    Parser.prototype.parseSwitchStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('switch');
	        this.expect('(');
	        var discriminant = this.parseExpression();
	        this.expect(')');
	        var previousInSwitch = this.context.inSwitch;
	        this.context.inSwitch = true;
	        var cases = [];
	        var defaultFound = false;
	        this.expect('{');
	        while (true) {
	            if (this.match('}')) {
	                break;
	            }
	            var clause = this.parseSwitchCase();
	            if (clause.test === null) {
	                if (defaultFound) {
	                    this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
	                }
	                defaultFound = true;
	            }
	            cases.push(clause);
	        }
	        this.expect('}');
	        this.context.inSwitch = previousInSwitch;
	        return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
	    };
	    // https://tc39.github.io/ecma262/#sec-labelled-statements
	    Parser.prototype.parseLabelledStatement = function () {
	        var node = this.createNode();
	        var expr = this.parseExpression();
	        var statement;
	        if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
	            this.nextToken();
	            var id = expr;
	            var key = '$' + id.name;
	            if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
	                this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
	            }
	            this.context.labelSet[key] = true;
	            var body = void 0;
	            if (this.matchKeyword('class')) {
	                this.tolerateUnexpectedToken(this.lookahead);
	                body = this.parseClassDeclaration();
	            }
	            else if (this.matchKeyword('function')) {
	                var token = this.lookahead;
	                var declaration = this.parseFunctionDeclaration();
	                if (this.context.strict) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
	                }
	                else if (declaration.generator) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
	                }
	                body = declaration;
	            }
	            else {
	                body = this.parseStatement();
	            }
	            delete this.context.labelSet[key];
	            statement = new Node.LabeledStatement(id, body);
	        }
	        else {
	            this.consumeSemicolon();
	            statement = new Node.ExpressionStatement(expr);
	        }
	        return this.finalize(node, statement);
	    };
	    // https://tc39.github.io/ecma262/#sec-throw-statement
	    Parser.prototype.parseThrowStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('throw');
	        if (this.hasLineTerminator) {
	            this.throwError(messages_1.Messages.NewlineAfterThrow);
	        }
	        var argument = this.parseExpression();
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.ThrowStatement(argument));
	    };
	    // https://tc39.github.io/ecma262/#sec-try-statement
	    Parser.prototype.parseCatchClause = function () {
	        var node = this.createNode();
	        this.expectKeyword('catch');
	        this.expect('(');
	        if (this.match(')')) {
	            this.throwUnexpectedToken(this.lookahead);
	        }
	        var params = [];
	        var param = this.parsePattern(params);
	        var paramMap = {};
	        for (var i = 0; i < params.length; i++) {
	            var key = '$' + params[i].value;
	            if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
	                this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
	            }
	            paramMap[key] = true;
	        }
	        if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
	            if (this.scanner.isRestrictedWord(param.name)) {
	                this.tolerateError(messages_1.Messages.StrictCatchVariable);
	            }
	        }
	        this.expect(')');
	        var body = this.parseBlock();
	        return this.finalize(node, new Node.CatchClause(param, body));
	    };
	    Parser.prototype.parseFinallyClause = function () {
	        this.expectKeyword('finally');
	        return this.parseBlock();
	    };
	    Parser.prototype.parseTryStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('try');
	        var block = this.parseBlock();
	        var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
	        var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
	        if (!handler && !finalizer) {
	            this.throwError(messages_1.Messages.NoCatchOrFinally);
	        }
	        return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
	    };
	    // https://tc39.github.io/ecma262/#sec-debugger-statement
	    Parser.prototype.parseDebuggerStatement = function () {
	        var node = this.createNode();
	        this.expectKeyword('debugger');
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.DebuggerStatement());
	    };
	    // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations
	    Parser.prototype.parseStatement = function () {
	        var statement;
	        switch (this.lookahead.type) {
	            case 1 /* BooleanLiteral */:
	            case 5 /* NullLiteral */:
	            case 6 /* NumericLiteral */:
	            case 8 /* StringLiteral */:
	            case 10 /* Template */:
	            case 9 /* RegularExpression */:
	                statement = this.parseExpressionStatement();
	                break;
	            case 7 /* Punctuator */:
	                var value = this.lookahead.value;
	                if (value === '{') {
	                    statement = this.parseBlock();
	                }
	                else if (value === '(') {
	                    statement = this.parseExpressionStatement();
	                }
	                else if (value === ';') {
	                    statement = this.parseEmptyStatement();
	                }
	                else {
	                    statement = this.parseExpressionStatement();
	                }
	                break;
	            case 3 /* Identifier */:
	                statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
	                break;
	            case 4 /* Keyword */:
	                switch (this.lookahead.value) {
	                    case 'break':
	                        statement = this.parseBreakStatement();
	                        break;
	                    case 'continue':
	                        statement = this.parseContinueStatement();
	                        break;
	                    case 'debugger':
	                        statement = this.parseDebuggerStatement();
	                        break;
	                    case 'do':
	                        statement = this.parseDoWhileStatement();
	                        break;
	                    case 'for':
	                        statement = this.parseForStatement();
	                        break;
	                    case 'function':
	                        statement = this.parseFunctionDeclaration();
	                        break;
	                    case 'if':
	                        statement = this.parseIfStatement();
	                        break;
	                    case 'return':
	                        statement = this.parseReturnStatement();
	                        break;
	                    case 'switch':
	                        statement = this.parseSwitchStatement();
	                        break;
	                    case 'throw':
	                        statement = this.parseThrowStatement();
	                        break;
	                    case 'try':
	                        statement = this.parseTryStatement();
	                        break;
	                    case 'var':
	                        statement = this.parseVariableStatement();
	                        break;
	                    case 'while':
	                        statement = this.parseWhileStatement();
	                        break;
	                    case 'with':
	                        statement = this.parseWithStatement();
	                        break;
	                    default:
	                        statement = this.parseExpressionStatement();
	                        break;
	                }
	                break;
	            default:
	                statement = this.throwUnexpectedToken(this.lookahead);
	        }
	        return statement;
	    };
	    // https://tc39.github.io/ecma262/#sec-function-definitions
	    Parser.prototype.parseFunctionSourceElements = function () {
	        var node = this.createNode();
	        this.expect('{');
	        var body = this.parseDirectivePrologues();
	        var previousLabelSet = this.context.labelSet;
	        var previousInIteration = this.context.inIteration;
	        var previousInSwitch = this.context.inSwitch;
	        var previousInFunctionBody = this.context.inFunctionBody;
	        this.context.labelSet = {};
	        this.context.inIteration = false;
	        this.context.inSwitch = false;
	        this.context.inFunctionBody = true;
	        while (this.lookahead.type !== 2 /* EOF */) {
	            if (this.match('}')) {
	                break;
	            }
	            body.push(this.parseStatementListItem());
	        }
	        this.expect('}');
	        this.context.labelSet = previousLabelSet;
	        this.context.inIteration = previousInIteration;
	        this.context.inSwitch = previousInSwitch;
	        this.context.inFunctionBody = previousInFunctionBody;
	        return this.finalize(node, new Node.BlockStatement(body));
	    };
	    Parser.prototype.validateParam = function (options, param, name) {
	        var key = '$' + name;
	        if (this.context.strict) {
	            if (this.scanner.isRestrictedWord(name)) {
	                options.stricted = param;
	                options.message = messages_1.Messages.StrictParamName;
	            }
	            if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
	                options.stricted = param;
	                options.message = messages_1.Messages.StrictParamDupe;
	            }
	        }
	        else if (!options.firstRestricted) {
	            if (this.scanner.isRestrictedWord(name)) {
	                options.firstRestricted = param;
	                options.message = messages_1.Messages.StrictParamName;
	            }
	            else if (this.scanner.isStrictModeReservedWord(name)) {
	                options.firstRestricted = param;
	                options.message = messages_1.Messages.StrictReservedWord;
	            }
	            else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
	                options.stricted = param;
	                options.message = messages_1.Messages.StrictParamDupe;
	            }
	        }
	        /* istanbul ignore next */
	        if (typeof Object.defineProperty === 'function') {
	            Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
	        }
	        else {
	            options.paramSet[key] = true;
	        }
	    };
	    Parser.prototype.parseRestElement = function (params) {
	        var node = this.createNode();
	        this.expect('...');
	        var arg = this.parsePattern(params);
	        if (this.match('=')) {
	            this.throwError(messages_1.Messages.DefaultRestParameter);
	        }
	        if (!this.match(')')) {
	            this.throwError(messages_1.Messages.ParameterAfterRestParameter);
	        }
	        return this.finalize(node, new Node.RestElement(arg));
	    };
	    Parser.prototype.parseFormalParameter = function (options) {
	        var params = [];
	        var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
	        for (var i = 0; i < params.length; i++) {
	            this.validateParam(options, params[i], params[i].value);
	        }
	        options.simple = options.simple && (param instanceof Node.Identifier);
	        options.params.push(param);
	    };
	    Parser.prototype.parseFormalParameters = function (firstRestricted) {
	        var options;
	        options = {
	            simple: true,
	            params: [],
	            firstRestricted: firstRestricted
	        };
	        this.expect('(');
	        if (!this.match(')')) {
	            options.paramSet = {};
	            while (this.lookahead.type !== 2 /* EOF */) {
	                this.parseFormalParameter(options);
	                if (this.match(')')) {
	                    break;
	                }
	                this.expect(',');
	                if (this.match(')')) {
	                    break;
	                }
	            }
	        }
	        this.expect(')');
	        return {
	            simple: options.simple,
	            params: options.params,
	            stricted: options.stricted,
	            firstRestricted: options.firstRestricted,
	            message: options.message
	        };
	    };
	    Parser.prototype.matchAsyncFunction = function () {
	        var match = this.matchContextualKeyword('async');
	        if (match) {
	            var state = this.scanner.saveState();
	            this.scanner.scanComments();
	            var next = this.scanner.lex();
	            this.scanner.restoreState(state);
	            match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function');
	        }
	        return match;
	    };
	    Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) {
	        var node = this.createNode();
	        var isAsync = this.matchContextualKeyword('async');
	        if (isAsync) {
	            this.nextToken();
	        }
	        this.expectKeyword('function');
	        var isGenerator = isAsync ? false : this.match('*');
	        if (isGenerator) {
	            this.nextToken();
	        }
	        var message;
	        var id = null;
	        var firstRestricted = null;
	        if (!identifierIsOptional || !this.match('(')) {
	            var token = this.lookahead;
	            id = this.parseVariableIdentifier();
	            if (this.context.strict) {
	                if (this.scanner.isRestrictedWord(token.value)) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
	                }
	            }
	            else {
	                if (this.scanner.isRestrictedWord(token.value)) {
	                    firstRestricted = token;
	                    message = messages_1.Messages.StrictFunctionName;
	                }
	                else if (this.scanner.isStrictModeReservedWord(token.value)) {
	                    firstRestricted = token;
	                    message = messages_1.Messages.StrictReservedWord;
	                }
	            }
	        }
	        var previousAllowAwait = this.context.await;
	        var previousAllowYield = this.context.allowYield;
	        this.context.await = isAsync;
	        this.context.allowYield = !isGenerator;
	        var formalParameters = this.parseFormalParameters(firstRestricted);
	        var params = formalParameters.params;
	        var stricted = formalParameters.stricted;
	        firstRestricted = formalParameters.firstRestricted;
	        if (formalParameters.message) {
	            message = formalParameters.message;
	        }
	        var previousStrict = this.context.strict;
	        var previousAllowStrictDirective = this.context.allowStrictDirective;
	        this.context.allowStrictDirective = formalParameters.simple;
	        var body = this.parseFunctionSourceElements();
	        if (this.context.strict && firstRestricted) {
	            this.throwUnexpectedToken(firstRestricted, message);
	        }
	        if (this.context.strict && stricted) {
	            this.tolerateUnexpectedToken(stricted, message);
	        }
	        this.context.strict = previousStrict;
	        this.context.allowStrictDirective = previousAllowStrictDirective;
	        this.context.await = previousAllowAwait;
	        this.context.allowYield = previousAllowYield;
	        return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) :
	            this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
	    };
	    Parser.prototype.parseFunctionExpression = function () {
	        var node = this.createNode();
	        var isAsync = this.matchContextualKeyword('async');
	        if (isAsync) {
	            this.nextToken();
	        }
	        this.expectKeyword('function');
	        var isGenerator = isAsync ? false : this.match('*');
	        if (isGenerator) {
	            this.nextToken();
	        }
	        var message;
	        var id = null;
	        var firstRestricted;
	        var previousAllowAwait = this.context.await;
	        var previousAllowYield = this.context.allowYield;
	        this.context.await = isAsync;
	        this.context.allowYield = !isGenerator;
	        if (!this.match('(')) {
	            var token = this.lookahead;
	            id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier();
	            if (this.context.strict) {
	                if (this.scanner.isRestrictedWord(token.value)) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
	                }
	            }
	            else {
	                if (this.scanner.isRestrictedWord(token.value)) {
	                    firstRestricted = token;
	                    message = messages_1.Messages.StrictFunctionName;
	                }
	                else if (this.scanner.isStrictModeReservedWord(token.value)) {
	                    firstRestricted = token;
	                    message = messages_1.Messages.StrictReservedWord;
	                }
	            }
	        }
	        var formalParameters = this.parseFormalParameters(firstRestricted);
	        var params = formalParameters.params;
	        var stricted = formalParameters.stricted;
	        firstRestricted = formalParameters.firstRestricted;
	        if (formalParameters.message) {
	            message = formalParameters.message;
	        }
	        var previousStrict = this.context.strict;
	        var previousAllowStrictDirective = this.context.allowStrictDirective;
	        this.context.allowStrictDirective = formalParameters.simple;
	        var body = this.parseFunctionSourceElements();
	        if (this.context.strict && firstRestricted) {
	            this.throwUnexpectedToken(firstRestricted, message);
	        }
	        if (this.context.strict && stricted) {
	            this.tolerateUnexpectedToken(stricted, message);
	        }
	        this.context.strict = previousStrict;
	        this.context.allowStrictDirective = previousAllowStrictDirective;
	        this.context.await = previousAllowAwait;
	        this.context.allowYield = previousAllowYield;
	        return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) :
	            this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
	    };
	    // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive
	    Parser.prototype.parseDirective = function () {
	        var token = this.lookahead;
	        var node = this.createNode();
	        var expr = this.parseExpression();
	        var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null;
	        this.consumeSemicolon();
	        return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
	    };
	    Parser.prototype.parseDirectivePrologues = function () {
	        var firstRestricted = null;
	        var body = [];
	        while (true) {
	            var token = this.lookahead;
	            if (token.type !== 8 /* StringLiteral */) {
	                break;
	            }
	            var statement = this.parseDirective();
	            body.push(statement);
	            var directive = statement.directive;
	            if (typeof directive !== 'string') {
	                break;
	            }
	            if (directive === 'use strict') {
	                this.context.strict = true;
	                if (firstRestricted) {
	                    this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
	                }
	                if (!this.context.allowStrictDirective) {
	                    this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
	                }
	            }
	            else {
	                if (!firstRestricted && token.octal) {
	                    firstRestricted = token;
	                }
	            }
	        }
	        return body;
	    };
	    // https://tc39.github.io/ecma262/#sec-method-definitions
	    Parser.prototype.qualifiedPropertyName = function (token) {
	        switch (token.type) {
	            case 3 /* Identifier */:
	            case 8 /* StringLiteral */:
	            case 1 /* BooleanLiteral */:
	            case 5 /* NullLiteral */:
	            case 6 /* NumericLiteral */:
	            case 4 /* Keyword */:
	                return true;
	            case 7 /* Punctuator */:
	                return token.value === '[';
	            default:
	                break;
	        }
	        return false;
	    };
	    Parser.prototype.parseGetterMethod = function () {
	        var node = this.createNode();
	        var isGenerator = false;
	        var previousAllowYield = this.context.allowYield;
	        this.context.allowYield = !isGenerator;
	        var formalParameters = this.parseFormalParameters();
	        if (formalParameters.params.length > 0) {
	            this.tolerateError(messages_1.Messages.BadGetterArity);
	        }
	        var method = this.parsePropertyMethod(formalParameters);
	        this.context.allowYield = previousAllowYield;
	        return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
	    };
	    Parser.prototype.parseSetterMethod = function () {
	        var node = this.createNode();
	        var isGenerator = false;
	        var previousAllowYield = this.context.allowYield;
	        this.context.allowYield = !isGenerator;
	        var formalParameters = this.parseFormalParameters();
	        if (formalParameters.params.length !== 1) {
	            this.tolerateError(messages_1.Messages.BadSetterArity);
	        }
	        else if (formalParameters.params[0] instanceof Node.RestElement) {
	            this.tolerateError(messages_1.Messages.BadSetterRestParameter);
	        }
	        var method = this.parsePropertyMethod(formalParameters);
	        this.context.allowYield = previousAllowYield;
	        return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
	    };
	    Parser.prototype.parseGeneratorMethod = function () {
	        var node = this.createNode();
	        var isGenerator = true;
	        var previousAllowYield = this.context.allowYield;
	        this.context.allowYield = true;
	        var params = this.parseFormalParameters();
	        this.context.allowYield = false;
	        var method = this.parsePropertyMethod(params);
	        this.context.allowYield = previousAllowYield;
	        return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
	    };
	    // https://tc39.github.io/ecma262/#sec-generator-function-definitions
	    Parser.prototype.isStartOfExpression = function () {
	        var start = true;
	        var value = this.lookahead.value;
	        switch (this.lookahead.type) {
	            case 7 /* Punctuator */:
	                start = (value === '[') || (value === '(') || (value === '{') ||
	                    (value === '+') || (value === '-') ||
	                    (value === '!') || (value === '~') ||
	                    (value === '++') || (value === '--') ||
	                    (value === '/') || (value === '/='); // regular expression literal
	                break;
	            case 4 /* Keyword */:
	                start = (value === 'class') || (value === 'delete') ||
	                    (value === 'function') || (value === 'let') || (value === 'new') ||
	                    (value === 'super') || (value === 'this') || (value === 'typeof') ||
	                    (value === 'void') || (value === 'yield');
	                break;
	            default:
	                break;
	        }
	        return start;
	    };
	    Parser.prototype.parseYieldExpression = function () {
	        var node = this.createNode();
	        this.expectKeyword('yield');
	        var argument = null;
	        var delegate = false;
	        if (!this.hasLineTerminator) {
	            var previousAllowYield = this.context.allowYield;
	            this.context.allowYield = false;
	            delegate = this.match('*');
	            if (delegate) {
	                this.nextToken();
	                argument = this.parseAssignmentExpression();
	            }
	            else if (this.isStartOfExpression()) {
	                argument = this.parseAssignmentExpression();
	            }
	            this.context.allowYield = previousAllowYield;
	        }
	        return this.finalize(node, new Node.YieldExpression(argument, delegate));
	    };
	    // https://tc39.github.io/ecma262/#sec-class-definitions
	    Parser.prototype.parseClassElement = function (hasConstructor) {
	        var token = this.lookahead;
	        var node = this.createNode();
	        var kind = '';
	        var key = null;
	        var value = null;
	        var computed = false;
	        var method = false;
	        var isStatic = false;
	        var isAsync = false;
	        if (this.match('*')) {
	            this.nextToken();
	        }
	        else {
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            var id = key;
	            if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) {
	                token = this.lookahead;
	                isStatic = true;
	                computed = this.match('[');
	                if (this.match('*')) {
	                    this.nextToken();
	                }
	                else {
	                    key = this.parseObjectPropertyKey();
	                }
	            }
	            if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) {
	                var punctuator = this.lookahead.value;
	                if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
	                    isAsync = true;
	                    token = this.lookahead;
	                    key = this.parseObjectPropertyKey();
	                    if (token.type === 3 /* Identifier */ && token.value === 'constructor') {
	                        this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
	                    }
	                }
	            }
	        }
	        var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
	        if (token.type === 3 /* Identifier */) {
	            if (token.value === 'get' && lookaheadPropertyKey) {
	                kind = 'get';
	                computed = this.match('[');
	                key = this.parseObjectPropertyKey();
	                this.context.allowYield = false;
	                value = this.parseGetterMethod();
	            }
	            else if (token.value === 'set' && lookaheadPropertyKey) {
	                kind = 'set';
	                computed = this.match('[');
	                key = this.parseObjectPropertyKey();
	                value = this.parseSetterMethod();
	            }
	        }
	        else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
	            kind = 'init';
	            computed = this.match('[');
	            key = this.parseObjectPropertyKey();
	            value = this.parseGeneratorMethod();
	            method = true;
	        }
	        if (!kind && key && this.match('(')) {
	            kind = 'init';
	            value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
	            method = true;
	        }
	        if (!kind) {
	            this.throwUnexpectedToken(this.lookahead);
	        }
	        if (kind === 'init') {
	            kind = 'method';
	        }
	        if (!computed) {
	            if (isStatic && this.isPropertyKey(key, 'prototype')) {
	                this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
	            }
	            if (!isStatic && this.isPropertyKey(key, 'constructor')) {
	                if (kind !== 'method' || !method || (value && value.generator)) {
	                    this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
	                }
	                if (hasConstructor.value) {
	                    this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
	                }
	                else {
	                    hasConstructor.value = true;
	                }
	                kind = 'constructor';
	            }
	        }
	        return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
	    };
	    Parser.prototype.parseClassElementList = function () {
	        var body = [];
	        var hasConstructor = { value: false };
	        this.expect('{');
	        while (!this.match('}')) {
	            if (this.match(';')) {
	                this.nextToken();
	            }
	            else {
	                body.push(this.parseClassElement(hasConstructor));
	            }
	        }
	        this.expect('}');
	        return body;
	    };
	    Parser.prototype.parseClassBody = function () {
	        var node = this.createNode();
	        var elementList = this.parseClassElementList();
	        return this.finalize(node, new Node.ClassBody(elementList));
	    };
	    Parser.prototype.parseClassDeclaration = function (identifierIsOptional) {
	        var node = this.createNode();
	        var previousStrict = this.context.strict;
	        this.context.strict = true;
	        this.expectKeyword('class');
	        var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier();
	        var superClass = null;
	        if (this.matchKeyword('extends')) {
	            this.nextToken();
	            superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
	        }
	        var classBody = this.parseClassBody();
	        this.context.strict = previousStrict;
	        return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
	    };
	    Parser.prototype.parseClassExpression = function () {
	        var node = this.createNode();
	        var previousStrict = this.context.strict;
	        this.context.strict = true;
	        this.expectKeyword('class');
	        var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null;
	        var superClass = null;
	        if (this.matchKeyword('extends')) {
	            this.nextToken();
	            superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
	        }
	        var classBody = this.parseClassBody();
	        this.context.strict = previousStrict;
	        return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
	    };
	    // https://tc39.github.io/ecma262/#sec-scripts
	    // https://tc39.github.io/ecma262/#sec-modules
	    Parser.prototype.parseModule = function () {
	        this.context.strict = true;
	        this.context.isModule = true;
	        this.scanner.isModule = true;
	        var node = this.createNode();
	        var body = this.parseDirectivePrologues();
	        while (this.lookahead.type !== 2 /* EOF */) {
	            body.push(this.parseStatementListItem());
	        }
	        return this.finalize(node, new Node.Module(body));
	    };
	    Parser.prototype.parseScript = function () {
	        var node = this.createNode();
	        var body = this.parseDirectivePrologues();
	        while (this.lookahead.type !== 2 /* EOF */) {
	            body.push(this.parseStatementListItem());
	        }
	        return this.finalize(node, new Node.Script(body));
	    };
	    // https://tc39.github.io/ecma262/#sec-imports
	    Parser.prototype.parseModuleSpecifier = function () {
	        var node = this.createNode();
	        if (this.lookahead.type !== 8 /* StringLiteral */) {
	            this.throwError(messages_1.Messages.InvalidModuleSpecifier);
	        }
	        var token = this.nextToken();
	        var raw = this.getTokenRaw(token);
	        return this.finalize(node, new Node.Literal(token.value, raw));
	    };
	    // import {<foo as bar>} ...;
	    Parser.prototype.parseImportSpecifier = function () {
	        var node = this.createNode();
	        var imported;
	        var local;
	        if (this.lookahead.type === 3 /* Identifier */) {
	            imported = this.parseVariableIdentifier();
	            local = imported;
	            if (this.matchContextualKeyword('as')) {
	                this.nextToken();
	                local = this.parseVariableIdentifier();
	            }
	        }
	        else {
	            imported = this.parseIdentifierName();
	            local = imported;
	            if (this.matchContextualKeyword('as')) {
	                this.nextToken();
	                local = this.parseVariableIdentifier();
	            }
	            else {
	                this.throwUnexpectedToken(this.nextToken());
	            }
	        }
	        return this.finalize(node, new Node.ImportSpecifier(local, imported));
	    };
	    // {foo, bar as bas}
	    Parser.prototype.parseNamedImports = function () {
	        this.expect('{');
	        var specifiers = [];
	        while (!this.match('}')) {
	            specifiers.push(this.parseImportSpecifier());
	            if (!this.match('}')) {
	                this.expect(',');
	            }
	        }
	        this.expect('}');
	        return specifiers;
	    };
	    // import <foo> ...;
	    Parser.prototype.parseImportDefaultSpecifier = function () {
	        var node = this.createNode();
	        var local = this.parseIdentifierName();
	        return this.finalize(node, new Node.ImportDefaultSpecifier(local));
	    };
	    // import <* as foo> ...;
	    Parser.prototype.parseImportNamespaceSpecifier = function () {
	        var node = this.createNode();
	        this.expect('*');
	        if (!this.matchContextualKeyword('as')) {
	            this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
	        }
	        this.nextToken();
	        var local = this.parseIdentifierName();
	        return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
	    };
	    Parser.prototype.parseImportDeclaration = function () {
	        if (this.context.inFunctionBody) {
	            this.throwError(messages_1.Messages.IllegalImportDeclaration);
	        }
	        var node = this.createNode();
	        this.expectKeyword('import');
	        var src;
	        var specifiers = [];
	        if (this.lookahead.type === 8 /* StringLiteral */) {
	            // import 'foo';
	            src = this.parseModuleSpecifier();
	        }
	        else {
	            if (this.match('{')) {
	                // import {bar}
	                specifiers = specifiers.concat(this.parseNamedImports());
	            }
	            else if (this.match('*')) {
	                // import * as foo
	                specifiers.push(this.parseImportNamespaceSpecifier());
	            }
	            else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) {
	                // import foo
	                specifiers.push(this.parseImportDefaultSpecifier());
	                if (this.match(',')) {
	                    this.nextToken();
	                    if (this.match('*')) {
	                        // import foo, * as foo
	                        specifiers.push(this.parseImportNamespaceSpecifier());
	                    }
	                    else if (this.match('{')) {
	                        // import foo, {bar}
	                        specifiers = specifiers.concat(this.parseNamedImports());
	                    }
	                    else {
	                        this.throwUnexpectedToken(this.lookahead);
	                    }
	                }
	            }
	            else {
	                this.throwUnexpectedToken(this.nextToken());
	            }
	            if (!this.matchContextualKeyword('from')) {
	                var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
	                this.throwError(message, this.lookahead.value);
	            }
	            this.nextToken();
	            src = this.parseModuleSpecifier();
	        }
	        this.consumeSemicolon();
	        return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
	    };
	    // https://tc39.github.io/ecma262/#sec-exports
	    Parser.prototype.parseExportSpecifier = function () {
	        var node = this.createNode();
	        var local = this.parseIdentifierName();
	        var exported = local;
	        if (this.matchContextualKeyword('as')) {
	            this.nextToken();
	            exported = this.parseIdentifierName();
	        }
	        return this.finalize(node, new Node.ExportSpecifier(local, exported));
	    };
	    Parser.prototype.parseExportDeclaration = function () {
	        if (this.context.inFunctionBody) {
	            this.throwError(messages_1.Messages.IllegalExportDeclaration);
	        }
	        var node = this.createNode();
	        this.expectKeyword('export');
	        var exportDeclaration;
	        if (this.matchKeyword('default')) {
	            // export default ...
	            this.nextToken();
	            if (this.matchKeyword('function')) {
	                // export default function foo () {}
	                // export default function () {}
	                var declaration = this.parseFunctionDeclaration(true);
	                exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
	            }
	            else if (this.matchKeyword('class')) {
	                // export default class foo {}
	                var declaration = this.parseClassDeclaration(true);
	                exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
	            }
	            else if (this.matchContextualKeyword('async')) {
	                // export default async function f () {}
	                // export default async function () {}
	                // export default async x => x
	                var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
	                exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
	            }
	            else {
	                if (this.matchContextualKeyword('from')) {
	                    this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
	                }
	                // export default {};
	                // export default [];
	                // export default (1 + 2);
	                var declaration = this.match('{') ? this.parseObjectInitializer() :
	                    this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression();
	                this.consumeSemicolon();
	                exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
	            }
	        }
	        else if (this.match('*')) {
	            // export * from 'foo';
	            this.nextToken();
	            if (!this.matchContextualKeyword('from')) {
	                var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
	                this.throwError(message, this.lookahead.value);
	            }
	            this.nextToken();
	            var src = this.parseModuleSpecifier();
	            this.consumeSemicolon();
	            exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
	        }
	        else if (this.lookahead.type === 4 /* Keyword */) {
	            // export var f = 1;
	            var declaration = void 0;
	            switch (this.lookahead.value) {
	                case 'let':
	                case 'const':
	                    declaration = this.parseLexicalDeclaration({ inFor: false });
	                    break;
	                case 'var':
	                case 'class':
	                case 'function':
	                    declaration = this.parseStatementListItem();
	                    break;
	                default:
	                    this.throwUnexpectedToken(this.lookahead);
	            }
	            exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
	        }
	        else if (this.matchAsyncFunction()) {
	            var declaration = this.parseFunctionDeclaration();
	            exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
	        }
	        else {
	            var specifiers = [];
	            var source = null;
	            var isExportFromIdentifier = false;
	            this.expect('{');
	            while (!this.match('}')) {
	                isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default');
	                specifiers.push(this.parseExportSpecifier());
	                if (!this.match('}')) {
	                    this.expect(',');
	                }
	            }
	            this.expect('}');
	            if (this.matchContextualKeyword('from')) {
	                // export {default} from 'foo';
	                // export {foo} from 'foo';
	                this.nextToken();
	                source = this.parseModuleSpecifier();
	                this.consumeSemicolon();
	            }
	            else if (isExportFromIdentifier) {
	                // export {default}; // missing fromClause
	                var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
	                this.throwError(message, this.lookahead.value);
	            }
	            else {
	                // export {foo};
	                this.consumeSemicolon();
	            }
	            exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
	        }
	        return exportDeclaration;
	    };
	    return Parser;
	}());
	exports.Parser = Parser;


/***/ },
/* 9 */
/***/ function(module, exports) {

	"use strict";
	// Ensure the condition is true, otherwise throw an error.
	// This is only to have a better contract semantic, i.e. another safety net
	// to catch a logic error. The condition shall be fulfilled in normal case.
	// Do NOT use this to enforce a certain condition on any user input.
	Object.defineProperty(exports, "__esModule", { value: true });
	function assert(condition, message) {
	    /* istanbul ignore if */
	    if (!condition) {
	        throw new Error('ASSERT: ' + message);
	    }
	}
	exports.assert = assert;


/***/ },
/* 10 */
/***/ function(module, exports) {

	"use strict";
	/* tslint:disable:max-classes-per-file */
	Object.defineProperty(exports, "__esModule", { value: true });
	var ErrorHandler = (function () {
	    function ErrorHandler() {
	        this.errors = [];
	        this.tolerant = false;
	    }
	    ErrorHandler.prototype.recordError = function (error) {
	        this.errors.push(error);
	    };
	    ErrorHandler.prototype.tolerate = function (error) {
	        if (this.tolerant) {
	            this.recordError(error);
	        }
	        else {
	            throw error;
	        }
	    };
	    ErrorHandler.prototype.constructError = function (msg, column) {
	        var error = new Error(msg);
	        try {
	            throw error;
	        }
	        catch (base) {
	            /* istanbul ignore else */
	            if (Object.create && Object.defineProperty) {
	                error = Object.create(base);
	                Object.defineProperty(error, 'column', { value: column });
	            }
	        }
	        /* istanbul ignore next */
	        return error;
	    };
	    ErrorHandler.prototype.createError = function (index, line, col, description) {
	        var msg = 'Line ' + line + ': ' + description;
	        var error = this.constructError(msg, col);
	        error.index = index;
	        error.lineNumber = line;
	        error.description = description;
	        return error;
	    };
	    ErrorHandler.prototype.throwError = function (index, line, col, description) {
	        throw this.createError(index, line, col, description);
	    };
	    ErrorHandler.prototype.tolerateError = function (index, line, col, description) {
	        var error = this.createError(index, line, col, description);
	        if (this.tolerant) {
	            this.recordError(error);
	        }
	        else {
	            throw error;
	        }
	    };
	    return ErrorHandler;
	}());
	exports.ErrorHandler = ErrorHandler;


/***/ },
/* 11 */
/***/ function(module, exports) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	// Error messages should be identical to V8.
	exports.Messages = {
	    BadGetterArity: 'Getter must not have any formal parameters',
	    BadSetterArity: 'Setter must have exactly one formal parameter',
	    BadSetterRestParameter: 'Setter function argument must not be a rest parameter',
	    ConstructorIsAsync: 'Class constructor may not be an async method',
	    ConstructorSpecialMethod: 'Class constructor may not be an accessor',
	    DeclarationMissingInitializer: 'Missing initializer in %0 declaration',
	    DefaultRestParameter: 'Unexpected token =',
	    DuplicateBinding: 'Duplicate binding %0',
	    DuplicateConstructor: 'A class may only have one constructor',
	    DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
	    ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer',
	    GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts',
	    IllegalBreak: 'Illegal break statement',
	    IllegalContinue: 'Illegal continue statement',
	    IllegalExportDeclaration: 'Unexpected token',
	    IllegalImportDeclaration: 'Unexpected token',
	    IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list',
	    IllegalReturn: 'Illegal return statement',
	    InvalidEscapedReservedWord: 'Keyword must not contain escaped characters',
	    InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence',
	    InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
	    InvalidLHSInForIn: 'Invalid left-hand side in for-in',
	    InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
	    InvalidModuleSpecifier: 'Unexpected token',
	    InvalidRegExp: 'Invalid regular expression',
	    LetInLexicalBinding: 'let is disallowed as a lexically bound name',
	    MissingFromClause: 'Unexpected token',
	    MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
	    NewlineAfterThrow: 'Illegal newline after throw',
	    NoAsAfterImportNamespace: 'Unexpected token',
	    NoCatchOrFinally: 'Missing catch or finally after try',
	    ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
	    Redeclaration: '%0 \'%1\' has already been declared',
	    StaticPrototype: 'Classes may not have static property named prototype',
	    StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
	    StrictDelete: 'Delete of an unqualified identifier in strict mode.',
	    StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block',
	    StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
	    StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
	    StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
	    StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
	    StrictModeWith: 'Strict mode code may not include a with statement',
	    StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
	    StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
	    StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
	    StrictReservedWord: 'Use of future reserved word in strict mode',
	    StrictVarName: 'Variable name may not be eval or arguments in strict mode',
	    TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
	    UnexpectedEOS: 'Unexpected end of input',
	    UnexpectedIdentifier: 'Unexpected identifier',
	    UnexpectedNumber: 'Unexpected number',
	    UnexpectedReserved: 'Unexpected reserved word',
	    UnexpectedString: 'Unexpected string',
	    UnexpectedTemplate: 'Unexpected quasi %0',
	    UnexpectedToken: 'Unexpected token %0',
	    UnexpectedTokenIllegal: 'Unexpected token ILLEGAL',
	    UnknownLabel: 'Undefined label \'%0\'',
	    UnterminatedRegExp: 'Invalid regular expression: missing /'
	};


/***/ },
/* 12 */
/***/ function(module, exports, __nested_webpack_require_226595__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var assert_1 = __nested_webpack_require_226595__(9);
	var character_1 = __nested_webpack_require_226595__(4);
	var messages_1 = __nested_webpack_require_226595__(11);
	function hexValue(ch) {
	    return '0123456789abcdef'.indexOf(ch.toLowerCase());
	}
	function octalValue(ch) {
	    return '01234567'.indexOf(ch);
	}
	var Scanner = (function () {
	    function Scanner(code, handler) {
	        this.source = code;
	        this.errorHandler = handler;
	        this.trackComment = false;
	        this.isModule = false;
	        this.length = code.length;
	        this.index = 0;
	        this.lineNumber = (code.length > 0) ? 1 : 0;
	        this.lineStart = 0;
	        this.curlyStack = [];
	    }
	    Scanner.prototype.saveState = function () {
	        return {
	            index: this.index,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart
	        };
	    };
	    Scanner.prototype.restoreState = function (state) {
	        this.index = state.index;
	        this.lineNumber = state.lineNumber;
	        this.lineStart = state.lineStart;
	    };
	    Scanner.prototype.eof = function () {
	        return this.index >= this.length;
	    };
	    Scanner.prototype.throwUnexpectedToken = function (message) {
	        if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
	        return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
	    };
	    Scanner.prototype.tolerateUnexpectedToken = function (message) {
	        if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
	        this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
	    };
	    // https://tc39.github.io/ecma262/#sec-comments
	    Scanner.prototype.skipSingleLineComment = function (offset) {
	        var comments = [];
	        var start, loc;
	        if (this.trackComment) {
	            comments = [];
	            start = this.index - offset;
	            loc = {
	                start: {
	                    line: this.lineNumber,
	                    column: this.index - this.lineStart - offset
	                },
	                end: {}
	            };
	        }
	        while (!this.eof()) {
	            var ch = this.source.charCodeAt(this.index);
	            ++this.index;
	            if (character_1.Character.isLineTerminator(ch)) {
	                if (this.trackComment) {
	                    loc.end = {
	                        line: this.lineNumber,
	                        column: this.index - this.lineStart - 1
	                    };
	                    var entry = {
	                        multiLine: false,
	                        slice: [start + offset, this.index - 1],
	                        range: [start, this.index - 1],
	                        loc: loc
	                    };
	                    comments.push(entry);
	                }
	                if (ch === 13 && this.source.charCodeAt(this.index) === 10) {
	                    ++this.index;
	                }
	                ++this.lineNumber;
	                this.lineStart = this.index;
	                return comments;
	            }
	        }
	        if (this.trackComment) {
	            loc.end = {
	                line: this.lineNumber,
	                column: this.index - this.lineStart
	            };
	            var entry = {
	                multiLine: false,
	                slice: [start + offset, this.index],
	                range: [start, this.index],
	                loc: loc
	            };
	            comments.push(entry);
	        }
	        return comments;
	    };
	    Scanner.prototype.skipMultiLineComment = function () {
	        var comments = [];
	        var start, loc;
	        if (this.trackComment) {
	            comments = [];
	            start = this.index - 2;
	            loc = {
	                start: {
	                    line: this.lineNumber,
	                    column: this.index - this.lineStart - 2
	                },
	                end: {}
	            };
	        }
	        while (!this.eof()) {
	            var ch = this.source.charCodeAt(this.index);
	            if (character_1.Character.isLineTerminator(ch)) {
	                if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) {
	                    ++this.index;
	                }
	                ++this.lineNumber;
	                ++this.index;
	                this.lineStart = this.index;
	            }
	            else if (ch === 0x2A) {
	                // Block comment ends with '*/'.
	                if (this.source.charCodeAt(this.index + 1) === 0x2F) {
	                    this.index += 2;
	                    if (this.trackComment) {
	                        loc.end = {
	                            line: this.lineNumber,
	                            column: this.index - this.lineStart
	                        };
	                        var entry = {
	                            multiLine: true,
	                            slice: [start + 2, this.index - 2],
	                            range: [start, this.index],
	                            loc: loc
	                        };
	                        comments.push(entry);
	                    }
	                    return comments;
	                }
	                ++this.index;
	            }
	            else {
	                ++this.index;
	            }
	        }
	        // Ran off the end of the file - the whole thing is a comment
	        if (this.trackComment) {
	            loc.end = {
	                line: this.lineNumber,
	                column: this.index - this.lineStart
	            };
	            var entry = {
	                multiLine: true,
	                slice: [start + 2, this.index],
	                range: [start, this.index],
	                loc: loc
	            };
	            comments.push(entry);
	        }
	        this.tolerateUnexpectedToken();
	        return comments;
	    };
	    Scanner.prototype.scanComments = function () {
	        var comments;
	        if (this.trackComment) {
	            comments = [];
	        }
	        var start = (this.index === 0);
	        while (!this.eof()) {
	            var ch = this.source.charCodeAt(this.index);
	            if (character_1.Character.isWhiteSpace(ch)) {
	                ++this.index;
	            }
	            else if (character_1.Character.isLineTerminator(ch)) {
	                ++this.index;
	                if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) {
	                    ++this.index;
	                }
	                ++this.lineNumber;
	                this.lineStart = this.index;
	                start = true;
	            }
	            else if (ch === 0x2F) {
	                ch = this.source.charCodeAt(this.index + 1);
	                if (ch === 0x2F) {
	                    this.index += 2;
	                    var comment = this.skipSingleLineComment(2);
	                    if (this.trackComment) {
	                        comments = comments.concat(comment);
	                    }
	                    start = true;
	                }
	                else if (ch === 0x2A) {
	                    this.index += 2;
	                    var comment = this.skipMultiLineComment();
	                    if (this.trackComment) {
	                        comments = comments.concat(comment);
	                    }
	                }
	                else {
	                    break;
	                }
	            }
	            else if (start && ch === 0x2D) {
	                // U+003E is '>'
	                if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) {
	                    // '-->' is a single-line comment
	                    this.index += 3;
	                    var comment = this.skipSingleLineComment(3);
	                    if (this.trackComment) {
	                        comments = comments.concat(comment);
	                    }
	                }
	                else {
	                    break;
	                }
	            }
	            else if (ch === 0x3C && !this.isModule) {
	                if (this.source.slice(this.index + 1, this.index + 4) === '!--') {
	                    this.index += 4; // `<!--`
	                    var comment = this.skipSingleLineComment(4);
	                    if (this.trackComment) {
	                        comments = comments.concat(comment);
	                    }
	                }
	                else {
	                    break;
	                }
	            }
	            else {
	                break;
	            }
	        }
	        return comments;
	    };
	    // https://tc39.github.io/ecma262/#sec-future-reserved-words
	    Scanner.prototype.isFutureReservedWord = function (id) {
	        switch (id) {
	            case 'enum':
	            case 'export':
	            case 'import':
	            case 'super':
	                return true;
	            default:
	                return false;
	        }
	    };
	    Scanner.prototype.isStrictModeReservedWord = function (id) {
	        switch (id) {
	            case 'implements':
	            case 'interface':
	            case 'package':
	            case 'private':
	            case 'protected':
	            case 'public':
	            case 'static':
	            case 'yield':
	            case 'let':
	                return true;
	            default:
	                return false;
	        }
	    };
	    Scanner.prototype.isRestrictedWord = function (id) {
	        return id === 'eval' || id === 'arguments';
	    };
	    // https://tc39.github.io/ecma262/#sec-keywords
	    Scanner.prototype.isKeyword = function (id) {
	        switch (id.length) {
	            case 2:
	                return (id === 'if') || (id === 'in') || (id === 'do');
	            case 3:
	                return (id === 'var') || (id === 'for') || (id === 'new') ||
	                    (id === 'try') || (id === 'let');
	            case 4:
	                return (id === 'this') || (id === 'else') || (id === 'case') ||
	                    (id === 'void') || (id === 'with') || (id === 'enum');
	            case 5:
	                return (id === 'while') || (id === 'break') || (id === 'catch') ||
	                    (id === 'throw') || (id === 'const') || (id === 'yield') ||
	                    (id === 'class') || (id === 'super');
	            case 6:
	                return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
	                    (id === 'switch') || (id === 'export') || (id === 'import');
	            case 7:
	                return (id === 'default') || (id === 'finally') || (id === 'extends');
	            case 8:
	                return (id === 'function') || (id === 'continue') || (id === 'debugger');
	            case 10:
	                return (id === 'instanceof');
	            default:
	                return false;
	        }
	    };
	    Scanner.prototype.codePointAt = function (i) {
	        var cp = this.source.charCodeAt(i);
	        if (cp >= 0xD800 && cp <= 0xDBFF) {
	            var second = this.source.charCodeAt(i + 1);
	            if (second >= 0xDC00 && second <= 0xDFFF) {
	                var first = cp;
	                cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
	            }
	        }
	        return cp;
	    };
	    Scanner.prototype.scanHexEscape = function (prefix) {
	        var len = (prefix === 'u') ? 4 : 2;
	        var code = 0;
	        for (var i = 0; i < len; ++i) {
	            if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
	                code = code * 16 + hexValue(this.source[this.index++]);
	            }
	            else {
	                return null;
	            }
	        }
	        return String.fromCharCode(code);
	    };
	    Scanner.prototype.scanUnicodeCodePointEscape = function () {
	        var ch = this.source[this.index];
	        var code = 0;
	        // At least, one hex digit is required.
	        if (ch === '}') {
	            this.throwUnexpectedToken();
	        }
	        while (!this.eof()) {
	            ch = this.source[this.index++];
	            if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) {
	                break;
	            }
	            code = code * 16 + hexValue(ch);
	        }
	        if (code > 0x10FFFF || ch !== '}') {
	            this.throwUnexpectedToken();
	        }
	        return character_1.Character.fromCodePoint(code);
	    };
	    Scanner.prototype.getIdentifier = function () {
	        var start = this.index++;
	        while (!this.eof()) {
	            var ch = this.source.charCodeAt(this.index);
	            if (ch === 0x5C) {
	                // Blackslash (U+005C) marks Unicode escape sequence.
	                this.index = start;
	                return this.getComplexIdentifier();
	            }
	            else if (ch >= 0xD800 && ch < 0xDFFF) {
	                // Need to handle surrogate pairs.
	                this.index = start;
	                return this.getComplexIdentifier();
	            }
	            if (character_1.Character.isIdentifierPart(ch)) {
	                ++this.index;
	            }
	            else {
	                break;
	            }
	        }
	        return this.source.slice(start, this.index);
	    };
	    Scanner.prototype.getComplexIdentifier = function () {
	        var cp = this.codePointAt(this.index);
	        var id = character_1.Character.fromCodePoint(cp);
	        this.index += id.length;
	        // '\u' (U+005C, U+0075) denotes an escaped character.
	        var ch;
	        if (cp === 0x5C) {
	            if (this.source.charCodeAt(this.index) !== 0x75) {
	                this.throwUnexpectedToken();
	            }
	            ++this.index;
	            if (this.source[this.index] === '{') {
	                ++this.index;
	                ch = this.scanUnicodeCodePointEscape();
	            }
	            else {
	                ch = this.scanHexEscape('u');
	                if (ch === null || ch === '\\' || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) {
	                    this.throwUnexpectedToken();
	                }
	            }
	            id = ch;
	        }
	        while (!this.eof()) {
	            cp = this.codePointAt(this.index);
	            if (!character_1.Character.isIdentifierPart(cp)) {
	                break;
	            }
	            ch = character_1.Character.fromCodePoint(cp);
	            id += ch;
	            this.index += ch.length;
	            // '\u' (U+005C, U+0075) denotes an escaped character.
	            if (cp === 0x5C) {
	                id = id.substr(0, id.length - 1);
	                if (this.source.charCodeAt(this.index) !== 0x75) {
	                    this.throwUnexpectedToken();
	                }
	                ++this.index;
	                if (this.source[this.index] === '{') {
	                    ++this.index;
	                    ch = this.scanUnicodeCodePointEscape();
	                }
	                else {
	                    ch = this.scanHexEscape('u');
	                    if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
	                        this.throwUnexpectedToken();
	                    }
	                }
	                id += ch;
	            }
	        }
	        return id;
	    };
	    Scanner.prototype.octalToDecimal = function (ch) {
	        // \0 is not octal escape sequence
	        var octal = (ch !== '0');
	        var code = octalValue(ch);
	        if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
	            octal = true;
	            code = code * 8 + octalValue(this.source[this.index++]);
	            // 3 digits are only allowed when string starts
	            // with 0, 1, 2, 3
	            if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
	                code = code * 8 + octalValue(this.source[this.index++]);
	            }
	        }
	        return {
	            code: code,
	            octal: octal
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-names-and-keywords
	    Scanner.prototype.scanIdentifier = function () {
	        var type;
	        var start = this.index;
	        // Backslash (U+005C) starts an escaped character.
	        var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
	        // There is no keyword or literal with only one character.
	        // Thus, it must be an identifier.
	        if (id.length === 1) {
	            type = 3 /* Identifier */;
	        }
	        else if (this.isKeyword(id)) {
	            type = 4 /* Keyword */;
	        }
	        else if (id === 'null') {
	            type = 5 /* NullLiteral */;
	        }
	        else if (id === 'true' || id === 'false') {
	            type = 1 /* BooleanLiteral */;
	        }
	        else {
	            type = 3 /* Identifier */;
	        }
	        if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
	            var restore = this.index;
	            this.index = start;
	            this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
	            this.index = restore;
	        }
	        return {
	            type: type,
	            value: id,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-punctuators
	    Scanner.prototype.scanPunctuator = function () {
	        var start = this.index;
	        // Check for most common single-character punctuators.
	        var str = this.source[this.index];
	        switch (str) {
	            case '(':
	            case '{':
	                if (str === '{') {
	                    this.curlyStack.push('{');
	                }
	                ++this.index;
	                break;
	            case '.':
	                ++this.index;
	                if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
	                    // Spread operator: ...
	                    this.index += 2;
	                    str = '...';
	                }
	                break;
	            case '}':
	                ++this.index;
	                this.curlyStack.pop();
	                break;
	            case ')':
	            case ';':
	            case ',':
	            case '[':
	            case ']':
	            case ':':
	            case '?':
	            case '~':
	                ++this.index;
	                break;
	            default:
	                // 4-character punctuator.
	                str = this.source.substr(this.index, 4);
	                if (str === '>>>=') {
	                    this.index += 4;
	                }
	                else {
	                    // 3-character punctuators.
	                    str = str.substr(0, 3);
	                    if (str === '===' || str === '!==' || str === '>>>' ||
	                        str === '<<=' || str === '>>=' || str === '**=') {
	                        this.index += 3;
	                    }
	                    else {
	                        // 2-character punctuators.
	                        str = str.substr(0, 2);
	                        if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
	                            str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
	                            str === '++' || str === '--' || str === '<<' || str === '>>' ||
	                            str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
	                            str === '<=' || str === '>=' || str === '=>' || str === '**') {
	                            this.index += 2;
	                        }
	                        else {
	                            // 1-character punctuators.
	                            str = this.source[this.index];
	                            if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
	                                ++this.index;
	                            }
	                        }
	                    }
	                }
	        }
	        if (this.index === start) {
	            this.throwUnexpectedToken();
	        }
	        return {
	            type: 7 /* Punctuator */,
	            value: str,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
	    Scanner.prototype.scanHexLiteral = function (start) {
	        var num = '';
	        while (!this.eof()) {
	            if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
	                break;
	            }
	            num += this.source[this.index++];
	        }
	        if (num.length === 0) {
	            this.throwUnexpectedToken();
	        }
	        if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
	            this.throwUnexpectedToken();
	        }
	        return {
	            type: 6 /* NumericLiteral */,
	            value: parseInt('0x' + num, 16),
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    Scanner.prototype.scanBinaryLiteral = function (start) {
	        var num = '';
	        var ch;
	        while (!this.eof()) {
	            ch = this.source[this.index];
	            if (ch !== '0' && ch !== '1') {
	                break;
	            }
	            num += this.source[this.index++];
	        }
	        if (num.length === 0) {
	            // only 0b or 0B
	            this.throwUnexpectedToken();
	        }
	        if (!this.eof()) {
	            ch = this.source.charCodeAt(this.index);
	            /* istanbul ignore else */
	            if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
	                this.throwUnexpectedToken();
	            }
	        }
	        return {
	            type: 6 /* NumericLiteral */,
	            value: parseInt(num, 2),
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    Scanner.prototype.scanOctalLiteral = function (prefix, start) {
	        var num = '';
	        var octal = false;
	        if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
	            octal = true;
	            num = '0' + this.source[this.index++];
	        }
	        else {
	            ++this.index;
	        }
	        while (!this.eof()) {
	            if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
	                break;
	            }
	            num += this.source[this.index++];
	        }
	        if (!octal && num.length === 0) {
	            // only 0o or 0O
	            this.throwUnexpectedToken();
	        }
	        if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	            this.throwUnexpectedToken();
	        }
	        return {
	            type: 6 /* NumericLiteral */,
	            value: parseInt(num, 8),
	            octal: octal,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    Scanner.prototype.isImplicitOctalLiteral = function () {
	        // Implicit octal, unless there is a non-octal digit.
	        // (Annex B.1.1 on Numeric Literals)
	        for (var i = this.index + 1; i < this.length; ++i) {
	            var ch = this.source[i];
	            if (ch === '8' || ch === '9') {
	                return false;
	            }
	            if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
	                return true;
	            }
	        }
	        return true;
	    };
	    Scanner.prototype.scanNumericLiteral = function () {
	        var start = this.index;
	        var ch = this.source[start];
	        assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
	        var num = '';
	        if (ch !== '.') {
	            num = this.source[this.index++];
	            ch = this.source[this.index];
	            // Hex number starts with '0x'.
	            // Octal number starts with '0'.
	            // Octal number in ES6 starts with '0o'.
	            // Binary number in ES6 starts with '0b'.
	            if (num === '0') {
	                if (ch === 'x' || ch === 'X') {
	                    ++this.index;
	                    return this.scanHexLiteral(start);
	                }
	                if (ch === 'b' || ch === 'B') {
	                    ++this.index;
	                    return this.scanBinaryLiteral(start);
	                }
	                if (ch === 'o' || ch === 'O') {
	                    return this.scanOctalLiteral(ch, start);
	                }
	                if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
	                    if (this.isImplicitOctalLiteral()) {
	                        return this.scanOctalLiteral(ch, start);
	                    }
	                }
	            }
	            while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	                num += this.source[this.index++];
	            }
	            ch = this.source[this.index];
	        }
	        if (ch === '.') {
	            num += this.source[this.index++];
	            while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	                num += this.source[this.index++];
	            }
	            ch = this.source[this.index];
	        }
	        if (ch === 'e' || ch === 'E') {
	            num += this.source[this.index++];
	            ch = this.source[this.index];
	            if (ch === '+' || ch === '-') {
	                num += this.source[this.index++];
	            }
	            if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	                while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	                    num += this.source[this.index++];
	                }
	            }
	            else {
	                this.throwUnexpectedToken();
	            }
	        }
	        if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
	            this.throwUnexpectedToken();
	        }
	        return {
	            type: 6 /* NumericLiteral */,
	            value: parseFloat(num),
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-literals-string-literals
	    Scanner.prototype.scanStringLiteral = function () {
	        var start = this.index;
	        var quote = this.source[start];
	        assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
	        ++this.index;
	        var octal = false;
	        var str = '';
	        while (!this.eof()) {
	            var ch = this.source[this.index++];
	            if (ch === quote) {
	                quote = '';
	                break;
	            }
	            else if (ch === '\\') {
	                ch = this.source[this.index++];
	                if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                    switch (ch) {
	                        case 'u':
	                            if (this.source[this.index] === '{') {
	                                ++this.index;
	                                str += this.scanUnicodeCodePointEscape();
	                            }
	                            else {
	                                var unescaped_1 = this.scanHexEscape(ch);
	                                if (unescaped_1 === null) {
	                                    this.throwUnexpectedToken();
	                                }
	                                str += unescaped_1;
	                            }
	                            break;
	                        case 'x':
	                            var unescaped = this.scanHexEscape(ch);
	                            if (unescaped === null) {
	                                this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
	                            }
	                            str += unescaped;
	                            break;
	                        case 'n':
	                            str += '\n';
	                            break;
	                        case 'r':
	                            str += '\r';
	                            break;
	                        case 't':
	                            str += '\t';
	                            break;
	                        case 'b':
	                            str += '\b';
	                            break;
	                        case 'f':
	                            str += '\f';
	                            break;
	                        case 'v':
	                            str += '\x0B';
	                            break;
	                        case '8':
	                        case '9':
	                            str += ch;
	                            this.tolerateUnexpectedToken();
	                            break;
	                        default:
	                            if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
	                                var octToDec = this.octalToDecimal(ch);
	                                octal = octToDec.octal || octal;
	                                str += String.fromCharCode(octToDec.code);
	                            }
	                            else {
	                                str += ch;
	                            }
	                            break;
	                    }
	                }
	                else {
	                    ++this.lineNumber;
	                    if (ch === '\r' && this.source[this.index] === '\n') {
	                        ++this.index;
	                    }
	                    this.lineStart = this.index;
	                }
	            }
	            else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                break;
	            }
	            else {
	                str += ch;
	            }
	        }
	        if (quote !== '') {
	            this.index = start;
	            this.throwUnexpectedToken();
	        }
	        return {
	            type: 8 /* StringLiteral */,
	            value: str,
	            octal: octal,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
	    Scanner.prototype.scanTemplate = function () {
	        var cooked = '';
	        var terminated = false;
	        var start = this.index;
	        var head = (this.source[start] === '`');
	        var tail = false;
	        var rawOffset = 2;
	        ++this.index;
	        while (!this.eof()) {
	            var ch = this.source[this.index++];
	            if (ch === '`') {
	                rawOffset = 1;
	                tail = true;
	                terminated = true;
	                break;
	            }
	            else if (ch === '$') {
	                if (this.source[this.index] === '{') {
	                    this.curlyStack.push('${');
	                    ++this.index;
	                    terminated = true;
	                    break;
	                }
	                cooked += ch;
	            }
	            else if (ch === '\\') {
	                ch = this.source[this.index++];
	                if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                    switch (ch) {
	                        case 'n':
	                            cooked += '\n';
	                            break;
	                        case 'r':
	                            cooked += '\r';
	                            break;
	                        case 't':
	                            cooked += '\t';
	                            break;
	                        case 'u':
	                            if (this.source[this.index] === '{') {
	                                ++this.index;
	                                cooked += this.scanUnicodeCodePointEscape();
	                            }
	                            else {
	                                var restore = this.index;
	                                var unescaped_2 = this.scanHexEscape(ch);
	                                if (unescaped_2 !== null) {
	                                    cooked += unescaped_2;
	                                }
	                                else {
	                                    this.index = restore;
	                                    cooked += ch;
	                                }
	                            }
	                            break;
	                        case 'x':
	                            var unescaped = this.scanHexEscape(ch);
	                            if (unescaped === null) {
	                                this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
	                            }
	                            cooked += unescaped;
	                            break;
	                        case 'b':
	                            cooked += '\b';
	                            break;
	                        case 'f':
	                            cooked += '\f';
	                            break;
	                        case 'v':
	                            cooked += '\v';
	                            break;
	                        default:
	                            if (ch === '0') {
	                                if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
	                                    // Illegal: \01 \02 and so on
	                                    this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
	                                }
	                                cooked += '\0';
	                            }
	                            else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
	                                // Illegal: \1 \2
	                                this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
	                            }
	                            else {
	                                cooked += ch;
	                            }
	                            break;
	                    }
	                }
	                else {
	                    ++this.lineNumber;
	                    if (ch === '\r' && this.source[this.index] === '\n') {
	                        ++this.index;
	                    }
	                    this.lineStart = this.index;
	                }
	            }
	            else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                ++this.lineNumber;
	                if (ch === '\r' && this.source[this.index] === '\n') {
	                    ++this.index;
	                }
	                this.lineStart = this.index;
	                cooked += '\n';
	            }
	            else {
	                cooked += ch;
	            }
	        }
	        if (!terminated) {
	            this.throwUnexpectedToken();
	        }
	        if (!head) {
	            this.curlyStack.pop();
	        }
	        return {
	            type: 10 /* Template */,
	            value: this.source.slice(start + 1, this.index - rawOffset),
	            cooked: cooked,
	            head: head,
	            tail: tail,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
	    Scanner.prototype.testRegExp = function (pattern, flags) {
	        // The BMP character to use as a replacement for astral symbols when
	        // translating an ES6 "u"-flagged pattern to an ES5-compatible
	        // approximation.
	        // Note: replacing with '\uFFFF' enables false positives in unlikely
	        // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
	        // pattern that would not be detected by this substitution.
	        var astralSubstitute = '\uFFFF';
	        var tmp = pattern;
	        var self = this;
	        if (flags.indexOf('u') >= 0) {
	            tmp = tmp
	                .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
	                var codePoint = parseInt($1 || $2, 16);
	                if (codePoint > 0x10FFFF) {
	                    self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
	                }
	                if (codePoint <= 0xFFFF) {
	                    return String.fromCharCode(codePoint);
	                }
	                return astralSubstitute;
	            })
	                .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
	        }
	        // First, detect invalid regular expressions.
	        try {
	            RegExp(tmp);
	        }
	        catch (e) {
	            this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
	        }
	        // Return a regular expression object for this pattern-flag pair, or
	        // `null` in case the current environment doesn't support the flags it
	        // uses.
	        try {
	            return new RegExp(pattern, flags);
	        }
	        catch (exception) {
	            /* istanbul ignore next */
	            return null;
	        }
	    };
	    Scanner.prototype.scanRegExpBody = function () {
	        var ch = this.source[this.index];
	        assert_1.assert(ch === '/', 'Regular expression literal must start with a slash');
	        var str = this.source[this.index++];
	        var classMarker = false;
	        var terminated = false;
	        while (!this.eof()) {
	            ch = this.source[this.index++];
	            str += ch;
	            if (ch === '\\') {
	                ch = this.source[this.index++];
	                // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
	                if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                    this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
	                }
	                str += ch;
	            }
	            else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
	                this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
	            }
	            else if (classMarker) {
	                if (ch === ']') {
	                    classMarker = false;
	                }
	            }
	            else {
	                if (ch === '/') {
	                    terminated = true;
	                    break;
	                }
	                else if (ch === '[') {
	                    classMarker = true;
	                }
	            }
	        }
	        if (!terminated) {
	            this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
	        }
	        // Exclude leading and trailing slash.
	        return str.substr(1, str.length - 2);
	    };
	    Scanner.prototype.scanRegExpFlags = function () {
	        var str = '';
	        var flags = '';
	        while (!this.eof()) {
	            var ch = this.source[this.index];
	            if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
	                break;
	            }
	            ++this.index;
	            if (ch === '\\' && !this.eof()) {
	                ch = this.source[this.index];
	                if (ch === 'u') {
	                    ++this.index;
	                    var restore = this.index;
	                    var char = this.scanHexEscape('u');
	                    if (char !== null) {
	                        flags += char;
	                        for (str += '\\u'; restore < this.index; ++restore) {
	                            str += this.source[restore];
	                        }
	                    }
	                    else {
	                        this.index = restore;
	                        flags += 'u';
	                        str += '\\u';
	                    }
	                    this.tolerateUnexpectedToken();
	                }
	                else {
	                    str += '\\';
	                    this.tolerateUnexpectedToken();
	                }
	            }
	            else {
	                flags += ch;
	                str += ch;
	            }
	        }
	        return flags;
	    };
	    Scanner.prototype.scanRegExp = function () {
	        var start = this.index;
	        var pattern = this.scanRegExpBody();
	        var flags = this.scanRegExpFlags();
	        var value = this.testRegExp(pattern, flags);
	        return {
	            type: 9 /* RegularExpression */,
	            value: '',
	            pattern: pattern,
	            flags: flags,
	            regex: value,
	            lineNumber: this.lineNumber,
	            lineStart: this.lineStart,
	            start: start,
	            end: this.index
	        };
	    };
	    Scanner.prototype.lex = function () {
	        if (this.eof()) {
	            return {
	                type: 2 /* EOF */,
	                value: '',
	                lineNumber: this.lineNumber,
	                lineStart: this.lineStart,
	                start: this.index,
	                end: this.index
	            };
	        }
	        var cp = this.source.charCodeAt(this.index);
	        if (character_1.Character.isIdentifierStart(cp)) {
	            return this.scanIdentifier();
	        }
	        // Very common: ( and ) and ;
	        if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
	            return this.scanPunctuator();
	        }
	        // String literal starts with single quote (U+0027) or double quote (U+0022).
	        if (cp === 0x27 || cp === 0x22) {
	            return this.scanStringLiteral();
	        }
	        // Dot (.) U+002E can also start a floating-point number, hence the need
	        // to check the next character.
	        if (cp === 0x2E) {
	            if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
	                return this.scanNumericLiteral();
	            }
	            return this.scanPunctuator();
	        }
	        if (character_1.Character.isDecimalDigit(cp)) {
	            return this.scanNumericLiteral();
	        }
	        // Template literals start with ` (U+0060) for template head
	        // or } (U+007D) for template middle or template tail.
	        if (cp === 0x60 || (cp === 0x7D && this.curlyStack[this.curlyStack.length - 1] === '${')) {
	            return this.scanTemplate();
	        }
	        // Possible identifier start in a surrogate pair.
	        if (cp >= 0xD800 && cp < 0xDFFF) {
	            if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
	                return this.scanIdentifier();
	            }
	        }
	        return this.scanPunctuator();
	    };
	    return Scanner;
	}());
	exports.Scanner = Scanner;


/***/ },
/* 13 */
/***/ function(module, exports) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.TokenName = {};
	exports.TokenName[1 /* BooleanLiteral */] = 'Boolean';
	exports.TokenName[2 /* EOF */] = '<end>';
	exports.TokenName[3 /* Identifier */] = 'Identifier';
	exports.TokenName[4 /* Keyword */] = 'Keyword';
	exports.TokenName[5 /* NullLiteral */] = 'Null';
	exports.TokenName[6 /* NumericLiteral */] = 'Numeric';
	exports.TokenName[7 /* Punctuator */] = 'Punctuator';
	exports.TokenName[8 /* StringLiteral */] = 'String';
	exports.TokenName[9 /* RegularExpression */] = 'RegularExpression';
	exports.TokenName[10 /* Template */] = 'Template';


/***/ },
/* 14 */
/***/ function(module, exports) {

	"use strict";
	// Generated by generate-xhtml-entities.js. DO NOT MODIFY!
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.XHTMLEntities = {
	    quot: '\u0022',
	    amp: '\u0026',
	    apos: '\u0027',
	    gt: '\u003E',
	    nbsp: '\u00A0',
	    iexcl: '\u00A1',
	    cent: '\u00A2',
	    pound: '\u00A3',
	    curren: '\u00A4',
	    yen: '\u00A5',
	    brvbar: '\u00A6',
	    sect: '\u00A7',
	    uml: '\u00A8',
	    copy: '\u00A9',
	    ordf: '\u00AA',
	    laquo: '\u00AB',
	    not: '\u00AC',
	    shy: '\u00AD',
	    reg: '\u00AE',
	    macr: '\u00AF',
	    deg: '\u00B0',
	    plusmn: '\u00B1',
	    sup2: '\u00B2',
	    sup3: '\u00B3',
	    acute: '\u00B4',
	    micro: '\u00B5',
	    para: '\u00B6',
	    middot: '\u00B7',
	    cedil: '\u00B8',
	    sup1: '\u00B9',
	    ordm: '\u00BA',
	    raquo: '\u00BB',
	    frac14: '\u00BC',
	    frac12: '\u00BD',
	    frac34: '\u00BE',
	    iquest: '\u00BF',
	    Agrave: '\u00C0',
	    Aacute: '\u00C1',
	    Acirc: '\u00C2',
	    Atilde: '\u00C3',
	    Auml: '\u00C4',
	    Aring: '\u00C5',
	    AElig: '\u00C6',
	    Ccedil: '\u00C7',
	    Egrave: '\u00C8',
	    Eacute: '\u00C9',
	    Ecirc: '\u00CA',
	    Euml: '\u00CB',
	    Igrave: '\u00CC',
	    Iacute: '\u00CD',
	    Icirc: '\u00CE',
	    Iuml: '\u00CF',
	    ETH: '\u00D0',
	    Ntilde: '\u00D1',
	    Ograve: '\u00D2',
	    Oacute: '\u00D3',
	    Ocirc: '\u00D4',
	    Otilde: '\u00D5',
	    Ouml: '\u00D6',
	    times: '\u00D7',
	    Oslash: '\u00D8',
	    Ugrave: '\u00D9',
	    Uacute: '\u00DA',
	    Ucirc: '\u00DB',
	    Uuml: '\u00DC',
	    Yacute: '\u00DD',
	    THORN: '\u00DE',
	    szlig: '\u00DF',
	    agrave: '\u00E0',
	    aacute: '\u00E1',
	    acirc: '\u00E2',
	    atilde: '\u00E3',
	    auml: '\u00E4',
	    aring: '\u00E5',
	    aelig: '\u00E6',
	    ccedil: '\u00E7',
	    egrave: '\u00E8',
	    eacute: '\u00E9',
	    ecirc: '\u00EA',
	    euml: '\u00EB',
	    igrave: '\u00EC',
	    iacute: '\u00ED',
	    icirc: '\u00EE',
	    iuml: '\u00EF',
	    eth: '\u00F0',
	    ntilde: '\u00F1',
	    ograve: '\u00F2',
	    oacute: '\u00F3',
	    ocirc: '\u00F4',
	    otilde: '\u00F5',
	    ouml: '\u00F6',
	    divide: '\u00F7',
	    oslash: '\u00F8',
	    ugrave: '\u00F9',
	    uacute: '\u00FA',
	    ucirc: '\u00FB',
	    uuml: '\u00FC',
	    yacute: '\u00FD',
	    thorn: '\u00FE',
	    yuml: '\u00FF',
	    OElig: '\u0152',
	    oelig: '\u0153',
	    Scaron: '\u0160',
	    scaron: '\u0161',
	    Yuml: '\u0178',
	    fnof: '\u0192',
	    circ: '\u02C6',
	    tilde: '\u02DC',
	    Alpha: '\u0391',
	    Beta: '\u0392',
	    Gamma: '\u0393',
	    Delta: '\u0394',
	    Epsilon: '\u0395',
	    Zeta: '\u0396',
	    Eta: '\u0397',
	    Theta: '\u0398',
	    Iota: '\u0399',
	    Kappa: '\u039A',
	    Lambda: '\u039B',
	    Mu: '\u039C',
	    Nu: '\u039D',
	    Xi: '\u039E',
	    Omicron: '\u039F',
	    Pi: '\u03A0',
	    Rho: '\u03A1',
	    Sigma: '\u03A3',
	    Tau: '\u03A4',
	    Upsilon: '\u03A5',
	    Phi: '\u03A6',
	    Chi: '\u03A7',
	    Psi: '\u03A8',
	    Omega: '\u03A9',
	    alpha: '\u03B1',
	    beta: '\u03B2',
	    gamma: '\u03B3',
	    delta: '\u03B4',
	    epsilon: '\u03B5',
	    zeta: '\u03B6',
	    eta: '\u03B7',
	    theta: '\u03B8',
	    iota: '\u03B9',
	    kappa: '\u03BA',
	    lambda: '\u03BB',
	    mu: '\u03BC',
	    nu: '\u03BD',
	    xi: '\u03BE',
	    omicron: '\u03BF',
	    pi: '\u03C0',
	    rho: '\u03C1',
	    sigmaf: '\u03C2',
	    sigma: '\u03C3',
	    tau: '\u03C4',
	    upsilon: '\u03C5',
	    phi: '\u03C6',
	    chi: '\u03C7',
	    psi: '\u03C8',
	    omega: '\u03C9',
	    thetasym: '\u03D1',
	    upsih: '\u03D2',
	    piv: '\u03D6',
	    ensp: '\u2002',
	    emsp: '\u2003',
	    thinsp: '\u2009',
	    zwnj: '\u200C',
	    zwj: '\u200D',
	    lrm: '\u200E',
	    rlm: '\u200F',
	    ndash: '\u2013',
	    mdash: '\u2014',
	    lsquo: '\u2018',
	    rsquo: '\u2019',
	    sbquo: '\u201A',
	    ldquo: '\u201C',
	    rdquo: '\u201D',
	    bdquo: '\u201E',
	    dagger: '\u2020',
	    Dagger: '\u2021',
	    bull: '\u2022',
	    hellip: '\u2026',
	    permil: '\u2030',
	    prime: '\u2032',
	    Prime: '\u2033',
	    lsaquo: '\u2039',
	    rsaquo: '\u203A',
	    oline: '\u203E',
	    frasl: '\u2044',
	    euro: '\u20AC',
	    image: '\u2111',
	    weierp: '\u2118',
	    real: '\u211C',
	    trade: '\u2122',
	    alefsym: '\u2135',
	    larr: '\u2190',
	    uarr: '\u2191',
	    rarr: '\u2192',
	    darr: '\u2193',
	    harr: '\u2194',
	    crarr: '\u21B5',
	    lArr: '\u21D0',
	    uArr: '\u21D1',
	    rArr: '\u21D2',
	    dArr: '\u21D3',
	    hArr: '\u21D4',
	    forall: '\u2200',
	    part: '\u2202',
	    exist: '\u2203',
	    empty: '\u2205',
	    nabla: '\u2207',
	    isin: '\u2208',
	    notin: '\u2209',
	    ni: '\u220B',
	    prod: '\u220F',
	    sum: '\u2211',
	    minus: '\u2212',
	    lowast: '\u2217',
	    radic: '\u221A',
	    prop: '\u221D',
	    infin: '\u221E',
	    ang: '\u2220',
	    and: '\u2227',
	    or: '\u2228',
	    cap: '\u2229',
	    cup: '\u222A',
	    int: '\u222B',
	    there4: '\u2234',
	    sim: '\u223C',
	    cong: '\u2245',
	    asymp: '\u2248',
	    ne: '\u2260',
	    equiv: '\u2261',
	    le: '\u2264',
	    ge: '\u2265',
	    sub: '\u2282',
	    sup: '\u2283',
	    nsub: '\u2284',
	    sube: '\u2286',
	    supe: '\u2287',
	    oplus: '\u2295',
	    otimes: '\u2297',
	    perp: '\u22A5',
	    sdot: '\u22C5',
	    lceil: '\u2308',
	    rceil: '\u2309',
	    lfloor: '\u230A',
	    rfloor: '\u230B',
	    loz: '\u25CA',
	    spades: '\u2660',
	    clubs: '\u2663',
	    hearts: '\u2665',
	    diams: '\u2666',
	    lang: '\u27E8',
	    rang: '\u27E9'
	};


/***/ },
/* 15 */
/***/ function(module, exports, __nested_webpack_require_277122__) {

	"use strict";
	Object.defineProperty(exports, "__esModule", { value: true });
	var error_handler_1 = __nested_webpack_require_277122__(10);
	var scanner_1 = __nested_webpack_require_277122__(12);
	var token_1 = __nested_webpack_require_277122__(13);
	var Reader = (function () {
	    function Reader() {
	        this.values = [];
	        this.curly = this.paren = -1;
	    }
	    // A function following one of those tokens is an expression.
	    Reader.prototype.beforeFunctionExpression = function (t) {
	        return ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
	            'return', 'case', 'delete', 'throw', 'void',
	            // assignment operators
	            '=', '+=', '-=', '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=',
	            '&=', '|=', '^=', ',',
	            // binary/unary operators
	            '+', '-', '*', '**', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
	            '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
	            '<=', '<', '>', '!=', '!=='].indexOf(t) >= 0;
	    };
	    // Determine if forward slash (/) is an operator or part of a regular expression
	    // https://github.com/mozilla/sweet.js/wiki/design
	    Reader.prototype.isRegexStart = function () {
	        var previous = this.values[this.values.length - 1];
	        var regex = (previous !== null);
	        switch (previous) {
	            case 'this':
	            case ']':
	                regex = false;
	                break;
	            case ')':
	                var keyword = this.values[this.paren - 1];
	                regex = (keyword === 'if' || keyword === 'while' || keyword === 'for' || keyword === 'with');
	                break;
	            case '}':
	                // Dividing a function by anything makes little sense,
	                // but we have to check for that.
	                regex = false;
	                if (this.values[this.curly - 3] === 'function') {
	                    // Anonymous function, e.g. function(){} /42
	                    var check = this.values[this.curly - 4];
	                    regex = check ? !this.beforeFunctionExpression(check) : false;
	                }
	                else if (this.values[this.curly - 4] === 'function') {
	                    // Named function, e.g. function f(){} /42/
	                    var check = this.values[this.curly - 5];
	                    regex = check ? !this.beforeFunctionExpression(check) : true;
	                }
	                break;
	            default:
	                break;
	        }
	        return regex;
	    };
	    Reader.prototype.push = function (token) {
	        if (token.type === 7 /* Punctuator */ || token.type === 4 /* Keyword */) {
	            if (token.value === '{') {
	                this.curly = this.values.length;
	            }
	            else if (token.value === '(') {
	                this.paren = this.values.length;
	            }
	            this.values.push(token.value);
	        }
	        else {
	            this.values.push(null);
	        }
	    };
	    return Reader;
	}());
	var Tokenizer = (function () {
	    function Tokenizer(code, config) {
	        this.errorHandler = new error_handler_1.ErrorHandler();
	        this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
	        this.scanner = new scanner_1.Scanner(code, this.errorHandler);
	        this.scanner.trackComment = config ? (typeof config.comment === 'boolean' && config.comment) : false;
	        this.trackRange = config ? (typeof config.range === 'boolean' && config.range) : false;
	        this.trackLoc = config ? (typeof config.loc === 'boolean' && config.loc) : false;
	        this.buffer = [];
	        this.reader = new Reader();
	    }
	    Tokenizer.prototype.errors = function () {
	        return this.errorHandler.errors;
	    };
	    Tokenizer.prototype.getNextToken = function () {
	        if (this.buffer.length === 0) {
	            var comments = this.scanner.scanComments();
	            if (this.scanner.trackComment) {
	                for (var i = 0; i < comments.length; ++i) {
	                    var e = comments[i];
	                    var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
	                    var comment = {
	                        type: e.multiLine ? 'BlockComment' : 'LineComment',
	                        value: value
	                    };
	                    if (this.trackRange) {
	                        comment.range = e.range;
	                    }
	                    if (this.trackLoc) {
	                        comment.loc = e.loc;
	                    }
	                    this.buffer.push(comment);
	                }
	            }
	            if (!this.scanner.eof()) {
	                var loc = void 0;
	                if (this.trackLoc) {
	                    loc = {
	                        start: {
	                            line: this.scanner.lineNumber,
	                            column: this.scanner.index - this.scanner.lineStart
	                        },
	                        end: {}
	                    };
	                }
	                var startRegex = (this.scanner.source[this.scanner.index] === '/') && this.reader.isRegexStart();
	                var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
	                this.reader.push(token);
	                var entry = {
	                    type: token_1.TokenName[token.type],
	                    value: this.scanner.source.slice(token.start, token.end)
	                };
	                if (this.trackRange) {
	                    entry.range = [token.start, token.end];
	                }
	                if (this.trackLoc) {
	                    loc.end = {
	                        line: this.scanner.lineNumber,
	                        column: this.scanner.index - this.scanner.lineStart
	                    };
	                    entry.loc = loc;
	                }
	                if (token.type === 9 /* RegularExpression */) {
	                    var pattern = token.pattern;
	                    var flags = token.flags;
	                    entry.regex = { pattern: pattern, flags: flags };
	                }
	                this.buffer.push(entry);
	            }
	        }
	        return this.buffer.shift();
	    };
	    return Tokenizer;
	}());
	exports.Tokenizer = Tokenizer;


/***/ }
/******/ ])
});
;

/***/ }),

/***/ 98319:
/***/ ((__unused_webpack_module, exports) => {

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  var e, m
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var nBits = -7
  var i = isLE ? (nBytes - 1) : 0
  var d = isLE ? -1 : 1
  var s = buffer[offset + i]

  i += d

  e = s & ((1 << (-nBits)) - 1)
  s >>= (-nBits)
  nBits += eLen
  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  m = e & ((1 << (-nBits)) - 1)
  e >>= (-nBits)
  nBits += mLen
  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  if (e === 0) {
    e = 1 - eBias
  } else if (e === eMax) {
    return m ? NaN : ((s ? -1 : 1) * Infinity)
  } else {
    m = m + Math.pow(2, mLen)
    e = e - eBias
  }
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}

exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  var i = isLE ? 0 : (nBytes - 1)
  var d = isLE ? 1 : -1
  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0

  value = Math.abs(value)

  if (isNaN(value) || value === Infinity) {
    m = isNaN(value) ? 1 : 0
    e = eMax
  } else {
    e = Math.floor(Math.log(value) / Math.LN2)
    if (value * (c = Math.pow(2, -e)) < 1) {
      e--
      c *= 2
    }
    if (e + eBias >= 1) {
      value += rt / c
    } else {
      value += rt * Math.pow(2, 1 - eBias)
    }
    if (value * c >= 2) {
      e++
      c /= 2
    }

    if (e + eBias >= eMax) {
      m = 0
      e = eMax
    } else if (e + eBias >= 1) {
      m = ((value * c) - 1) * Math.pow(2, mLen)
      e = e + eBias
    } else {
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
      e = 0
    }
  }

  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

  e = (e << mLen) | m
  eLen += mLen
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

  buffer[offset + i - d] |= s * 128
}


/***/ }),

/***/ 97420:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";



var yaml = __webpack_require__(61169);


module.exports = yaml;


/***/ }),

/***/ 61169:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";



var loader = __webpack_require__(36279);
var dumper = __webpack_require__(99897);


function deprecated(name) {
  return function () {
    throw new Error('Function ' + name + ' is deprecated and cannot be used.');
  };
}


module.exports.Type = __webpack_require__(26136);
module.exports.Schema = __webpack_require__(92915);
module.exports.FAILSAFE_SCHEMA = __webpack_require__(29899);
module.exports.JSON_SCHEMA = __webpack_require__(33460);
module.exports.CORE_SCHEMA = __webpack_require__(76421);
module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(41893);
module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(41413);
module.exports.load                = loader.load;
module.exports.loadAll             = loader.loadAll;
module.exports.safeLoad            = loader.safeLoad;
module.exports.safeLoadAll         = loader.safeLoadAll;
module.exports.dump                = dumper.dump;
module.exports.safeDump            = dumper.safeDump;
module.exports.YAMLException = __webpack_require__(9643);

// Deprecated schema names from JS-YAML 2.0.x
module.exports.MINIMAL_SCHEMA = __webpack_require__(29899);
module.exports.SAFE_SCHEMA = __webpack_require__(41893);
module.exports.DEFAULT_SCHEMA = __webpack_require__(41413);

// Deprecated functions from JS-YAML 1.x.x
module.exports.scan           = deprecated('scan');
module.exports.parse          = deprecated('parse');
module.exports.compose        = deprecated('compose');
module.exports.addConstructor = deprecated('addConstructor');


/***/ }),

/***/ 19333:
/***/ ((module) => {

"use strict";



function isNothing(subject) {
  return (typeof subject === 'undefined') || (subject === null);
}


function isObject(subject) {
  return (typeof subject === 'object') && (subject !== null);
}


function toArray(sequence) {
  if (Array.isArray(sequence)) return sequence;
  else if (isNothing(sequence)) return [];

  return [ sequence ];
}


function extend(target, source) {
  var index, length, key, sourceKeys;

  if (source) {
    sourceKeys = Object.keys(source);

    for (index = 0, length = sourceKeys.length; index < length; index += 1) {
      key = sourceKeys[index];
      target[key] = source[key];
    }
  }

  return target;
}


function repeat(string, count) {
  var result = '', cycle;

  for (cycle = 0; cycle < count; cycle += 1) {
    result += string;
  }

  return result;
}


function isNegativeZero(number) {
  return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
}


module.exports.isNothing      = isNothing;
module.exports.isObject       = isObject;
module.exports.toArray        = toArray;
module.exports.repeat         = repeat;
module.exports.isNegativeZero = isNegativeZero;
module.exports.extend         = extend;


/***/ }),

/***/ 99897:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/*eslint-disable no-use-before-define*/

var common              = __webpack_require__(19333);
var YAMLException       = __webpack_require__(9643);
var DEFAULT_FULL_SCHEMA = __webpack_require__(41413);
var DEFAULT_SAFE_SCHEMA = __webpack_require__(41893);

var _toString       = Object.prototype.toString;
var _hasOwnProperty = Object.prototype.hasOwnProperty;

var CHAR_TAB                  = 0x09; /* Tab */
var CHAR_LINE_FEED            = 0x0A; /* LF */
var CHAR_CARRIAGE_RETURN      = 0x0D; /* CR */
var CHAR_SPACE                = 0x20; /* Space */
var CHAR_EXCLAMATION          = 0x21; /* ! */
var CHAR_DOUBLE_QUOTE         = 0x22; /* " */
var CHAR_SHARP                = 0x23; /* # */
var CHAR_PERCENT              = 0x25; /* % */
var CHAR_AMPERSAND            = 0x26; /* & */
var CHAR_SINGLE_QUOTE         = 0x27; /* ' */
var CHAR_ASTERISK             = 0x2A; /* * */
var CHAR_COMMA                = 0x2C; /* , */
var CHAR_MINUS                = 0x2D; /* - */
var CHAR_COLON                = 0x3A; /* : */
var CHAR_EQUALS               = 0x3D; /* = */
var CHAR_GREATER_THAN         = 0x3E; /* > */
var CHAR_QUESTION             = 0x3F; /* ? */
var CHAR_COMMERCIAL_AT        = 0x40; /* @ */
var CHAR_LEFT_SQUARE_BRACKET  = 0x5B; /* [ */
var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
var CHAR_GRAVE_ACCENT         = 0x60; /* ` */
var CHAR_LEFT_CURLY_BRACKET   = 0x7B; /* { */
var CHAR_VERTICAL_LINE        = 0x7C; /* | */
var CHAR_RIGHT_CURLY_BRACKET  = 0x7D; /* } */

var ESCAPE_SEQUENCES = {};

ESCAPE_SEQUENCES[0x00]   = '\\0';
ESCAPE_SEQUENCES[0x07]   = '\\a';
ESCAPE_SEQUENCES[0x08]   = '\\b';
ESCAPE_SEQUENCES[0x09]   = '\\t';
ESCAPE_SEQUENCES[0x0A]   = '\\n';
ESCAPE_SEQUENCES[0x0B]   = '\\v';
ESCAPE_SEQUENCES[0x0C]   = '\\f';
ESCAPE_SEQUENCES[0x0D]   = '\\r';
ESCAPE_SEQUENCES[0x1B]   = '\\e';
ESCAPE_SEQUENCES[0x22]   = '\\"';
ESCAPE_SEQUENCES[0x5C]   = '\\\\';
ESCAPE_SEQUENCES[0x85]   = '\\N';
ESCAPE_SEQUENCES[0xA0]   = '\\_';
ESCAPE_SEQUENCES[0x2028] = '\\L';
ESCAPE_SEQUENCES[0x2029] = '\\P';

var DEPRECATED_BOOLEANS_SYNTAX = [
  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
];

function compileStyleMap(schema, map) {
  var result, keys, index, length, tag, style, type;

  if (map === null) return {};

  result = {};
  keys = Object.keys(map);

  for (index = 0, length = keys.length; index < length; index += 1) {
    tag = keys[index];
    style = String(map[tag]);

    if (tag.slice(0, 2) === '!!') {
      tag = 'tag:yaml.org,2002:' + tag.slice(2);
    }
    type = schema.compiledTypeMap['fallback'][tag];

    if (type && _hasOwnProperty.call(type.styleAliases, style)) {
      style = type.styleAliases[style];
    }

    result[tag] = style;
  }

  return result;
}

function encodeHex(character) {
  var string, handle, length;

  string = character.toString(16).toUpperCase();

  if (character <= 0xFF) {
    handle = 'x';
    length = 2;
  } else if (character <= 0xFFFF) {
    handle = 'u';
    length = 4;
  } else if (character <= 0xFFFFFFFF) {
    handle = 'U';
    length = 8;
  } else {
    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
  }

  return '\\' + handle + common.repeat('0', length - string.length) + string;
}

function State(options) {
  this.schema        = options['schema'] || DEFAULT_FULL_SCHEMA;
  this.indent        = Math.max(1, (options['indent'] || 2));
  this.noArrayIndent = options['noArrayIndent'] || false;
  this.skipInvalid   = options['skipInvalid'] || false;
  this.flowLevel     = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
  this.styleMap      = compileStyleMap(this.schema, options['styles'] || null);
  this.sortKeys      = options['sortKeys'] || false;
  this.lineWidth     = options['lineWidth'] || 80;
  this.noRefs        = options['noRefs'] || false;
  this.noCompatMode  = options['noCompatMode'] || false;
  this.condenseFlow  = options['condenseFlow'] || false;

  this.implicitTypes = this.schema.compiledImplicit;
  this.explicitTypes = this.schema.compiledExplicit;

  this.tag = null;
  this.result = '';

  this.duplicates = [];
  this.usedDuplicates = null;
}

// Indents every line in a string. Empty lines (\n only) are not indented.
function indentString(string, spaces) {
  var ind = common.repeat(' ', spaces),
      position = 0,
      next = -1,
      result = '',
      line,
      length = string.length;

  while (position < length) {
    next = string.indexOf('\n', position);
    if (next === -1) {
      line = string.slice(position);
      position = length;
    } else {
      line = string.slice(position, next + 1);
      position = next + 1;
    }

    if (line.length && line !== '\n') result += ind;

    result += line;
  }

  return result;
}

function generateNextLine(state, level) {
  return '\n' + common.repeat(' ', state.indent * level);
}

function testImplicitResolving(state, str) {
  var index, length, type;

  for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
    type = state.implicitTypes[index];

    if (type.resolve(str)) {
      return true;
    }
  }

  return false;
}

// [33] s-white ::= s-space | s-tab
function isWhitespace(c) {
  return c === CHAR_SPACE || c === CHAR_TAB;
}

// Returns true if the character can be printed without escaping.
// From YAML 1.2: "any allowed characters known to be non-printable
// should also be escaped. [However,] This isn’t mandatory"
// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
function isPrintable(c) {
  return  (0x00020 <= c && c <= 0x00007E)
      || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
      || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
      ||  (0x10000 <= c && c <= 0x10FFFF);
}

// [34] ns-char ::= nb-char - s-white
// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
// [26] b-char  ::= b-line-feed | b-carriage-return
// [24] b-line-feed       ::=     #xA    /* LF */
// [25] b-carriage-return ::=     #xD    /* CR */
// [3]  c-byte-order-mark ::=     #xFEFF
function isNsChar(c) {
  return isPrintable(c) && !isWhitespace(c)
    // byte-order-mark
    && c !== 0xFEFF
    // b-char
    && c !== CHAR_CARRIAGE_RETURN
    && c !== CHAR_LINE_FEED;
}

// Simplified test for values allowed after the first character in plain style.
function isPlainSafe(c, prev) {
  // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
  // where nb-char ::= c-printable - b-char - c-byte-order-mark.
  return isPrintable(c) && c !== 0xFEFF
    // - c-flow-indicator
    && c !== CHAR_COMMA
    && c !== CHAR_LEFT_SQUARE_BRACKET
    && c !== CHAR_RIGHT_SQUARE_BRACKET
    && c !== CHAR_LEFT_CURLY_BRACKET
    && c !== CHAR_RIGHT_CURLY_BRACKET
    // - ":" - "#"
    // /* An ns-char preceding */ "#"
    && c !== CHAR_COLON
    && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
}

// Simplified test for values allowed as the first character in plain style.
function isPlainSafeFirst(c) {
  // Uses a subset of ns-char - c-indicator
  // where ns-char = nb-char - s-white.
  return isPrintable(c) && c !== 0xFEFF
    && !isWhitespace(c) // - s-white
    // - (c-indicator ::=
    // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
    && c !== CHAR_MINUS
    && c !== CHAR_QUESTION
    && c !== CHAR_COLON
    && c !== CHAR_COMMA
    && c !== CHAR_LEFT_SQUARE_BRACKET
    && c !== CHAR_RIGHT_SQUARE_BRACKET
    && c !== CHAR_LEFT_CURLY_BRACKET
    && c !== CHAR_RIGHT_CURLY_BRACKET
    // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
    && c !== CHAR_SHARP
    && c !== CHAR_AMPERSAND
    && c !== CHAR_ASTERISK
    && c !== CHAR_EXCLAMATION
    && c !== CHAR_VERTICAL_LINE
    && c !== CHAR_EQUALS
    && c !== CHAR_GREATER_THAN
    && c !== CHAR_SINGLE_QUOTE
    && c !== CHAR_DOUBLE_QUOTE
    // | “%” | “@” | “`”)
    && c !== CHAR_PERCENT
    && c !== CHAR_COMMERCIAL_AT
    && c !== CHAR_GRAVE_ACCENT;
}

// Determines whether block indentation indicator is required.
function needIndentIndicator(string) {
  var leadingSpaceRe = /^\n* /;
  return leadingSpaceRe.test(string);
}

var STYLE_PLAIN   = 1,
    STYLE_SINGLE  = 2,
    STYLE_LITERAL = 3,
    STYLE_FOLDED  = 4,
    STYLE_DOUBLE  = 5;

// Determines which scalar styles are possible and returns the preferred style.
// lineWidth = -1 => no limit.
// Pre-conditions: str.length > 0.
// Post-conditions:
//    STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
  var i;
  var char, prev_char;
  var hasLineBreak = false;
  var hasFoldableLine = false; // only checked if shouldTrackWidth
  var shouldTrackWidth = lineWidth !== -1;
  var previousLineBreak = -1; // count the first line correctly
  var plain = isPlainSafeFirst(string.charCodeAt(0))
          && !isWhitespace(string.charCodeAt(string.length - 1));

  if (singleLineOnly) {
    // Case: no block styles.
    // Check for disallowed characters to rule out plain and single.
    for (i = 0; i < string.length; i++) {
      char = string.charCodeAt(i);
      if (!isPrintable(char)) {
        return STYLE_DOUBLE;
      }
      prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
      plain = plain && isPlainSafe(char, prev_char);
    }
  } else {
    // Case: block styles permitted.
    for (i = 0; i < string.length; i++) {
      char = string.charCodeAt(i);
      if (char === CHAR_LINE_FEED) {
        hasLineBreak = true;
        // Check if any line can be folded.
        if (shouldTrackWidth) {
          hasFoldableLine = hasFoldableLine ||
            // Foldable line = too long, and not more-indented.
            (i - previousLineBreak - 1 > lineWidth &&
             string[previousLineBreak + 1] !== ' ');
          previousLineBreak = i;
        }
      } else if (!isPrintable(char)) {
        return STYLE_DOUBLE;
      }
      prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
      plain = plain && isPlainSafe(char, prev_char);
    }
    // in case the end is missing a \n
    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
      (i - previousLineBreak - 1 > lineWidth &&
       string[previousLineBreak + 1] !== ' '));
  }
  // Although every style can represent \n without escaping, prefer block styles
  // for multiline, since they're more readable and they don't add empty lines.
  // Also prefer folding a super-long line.
  if (!hasLineBreak && !hasFoldableLine) {
    // Strings interpretable as another type have to be quoted;
    // e.g. the string 'true' vs. the boolean true.
    return plain && !testAmbiguousType(string)
      ? STYLE_PLAIN : STYLE_SINGLE;
  }
  // Edge case: block indentation indicator can only have one digit.
  if (indentPerLevel > 9 && needIndentIndicator(string)) {
    return STYLE_DOUBLE;
  }
  // At this point we know block styles are valid.
  // Prefer literal style unless we want to fold.
  return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
}

// Note: line breaking/folding is implemented for only the folded style.
// NB. We drop the last trailing newline (if any) of a returned block scalar
//  since the dumper adds its own newline. This always works:
//    • No ending newline => unaffected; already using strip "-" chomping.
//    • Ending newline    => removed then restored.
//  Importantly, this keeps the "+" chomp indicator from gaining an extra line.
function writeScalar(state, string, level, iskey) {
  state.dump = (function () {
    if (string.length === 0) {
      return "''";
    }
    if (!state.noCompatMode &&
        DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
      return "'" + string + "'";
    }

    var indent = state.indent * Math.max(1, level); // no 0-indent scalars
    // As indentation gets deeper, let the width decrease monotonically
    // to the lower bound min(state.lineWidth, 40).
    // Note that this implies
    //  state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
    //  state.lineWidth > 40 + state.indent: width decreases until the lower bound.
    // This behaves better than a constant minimum width which disallows narrower options,
    // or an indent threshold which causes the width to suddenly increase.
    var lineWidth = state.lineWidth === -1
      ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);

    // Without knowing if keys are implicit/explicit, assume implicit for safety.
    var singleLineOnly = iskey
      // No block styles in flow mode.
      || (state.flowLevel > -1 && level >= state.flowLevel);
    function testAmbiguity(string) {
      return testImplicitResolving(state, string);
    }

    switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
      case STYLE_PLAIN:
        return string;
      case STYLE_SINGLE:
        return "'" + string.replace(/'/g, "''") + "'";
      case STYLE_LITERAL:
        return '|' + blockHeader(string, state.indent)
          + dropEndingNewline(indentString(string, indent));
      case STYLE_FOLDED:
        return '>' + blockHeader(string, state.indent)
          + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
      case STYLE_DOUBLE:
        return '"' + escapeString(string, lineWidth) + '"';
      default:
        throw new YAMLException('impossible error: invalid scalar style');
    }
  }());
}

// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
function blockHeader(string, indentPerLevel) {
  var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';

  // note the special case: the string '\n' counts as a "trailing" empty line.
  var clip =          string[string.length - 1] === '\n';
  var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
  var chomp = keep ? '+' : (clip ? '' : '-');

  return indentIndicator + chomp + '\n';
}

// (See the note for writeScalar.)
function dropEndingNewline(string) {
  return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
}

// Note: a long line without a suitable break point will exceed the width limit.
// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
function foldString(string, width) {
  // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
  // unless they're before or after a more-indented line, or at the very
  // beginning or end, in which case $k$ maps to $k$.
  // Therefore, parse each chunk as newline(s) followed by a content line.
  var lineRe = /(\n+)([^\n]*)/g;

  // first line (possibly an empty line)
  var result = (function () {
    var nextLF = string.indexOf('\n');
    nextLF = nextLF !== -1 ? nextLF : string.length;
    lineRe.lastIndex = nextLF;
    return foldLine(string.slice(0, nextLF), width);
  }());
  // If we haven't reached the first content line yet, don't add an extra \n.
  var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
  var moreIndented;

  // rest of the lines
  var match;
  while ((match = lineRe.exec(string))) {
    var prefix = match[1], line = match[2];
    moreIndented = (line[0] === ' ');
    result += prefix
      + (!prevMoreIndented && !moreIndented && line !== ''
        ? '\n' : '')
      + foldLine(line, width);
    prevMoreIndented = moreIndented;
  }

  return result;
}

// Greedy line breaking.
// Picks the longest line under the limit each time,
// otherwise settles for the shortest line over the limit.
// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
function foldLine(line, width) {
  if (line === '' || line[0] === ' ') return line;

  // Since a more-indented line adds a \n, breaks can't be followed by a space.
  var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
  var match;
  // start is an inclusive index. end, curr, and next are exclusive.
  var start = 0, end, curr = 0, next = 0;
  var result = '';

  // Invariants: 0 <= start <= length-1.
  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.
  // Inside the loop:
  //   A match implies length >= 2, so curr and next are <= length-2.
  while ((match = breakRe.exec(line))) {
    next = match.index;
    // maintain invariant: curr - start <= width
    if (next - start > width) {
      end = (curr > start) ? curr : next; // derive end <= length-2
      result += '\n' + line.slice(start, end);
      // skip the space that was output as \n
      start = end + 1;                    // derive start <= length-1
    }
    curr = next;
  }

  // By the invariants, start <= length-1, so there is something left over.
  // It is either the whole string or a part starting from non-whitespace.
  result += '\n';
  // Insert a break if the remainder is too long and there is a break available.
  if (line.length - start > width && curr > start) {
    result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
  } else {
    result += line.slice(start);
  }

  return result.slice(1); // drop extra \n joiner
}

// Escapes a double-quoted string.
function escapeString(string) {
  var result = '';
  var char, nextChar;
  var escapeSeq;

  for (var i = 0; i < string.length; i++) {
    char = string.charCodeAt(i);
    // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
    if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
      nextChar = string.charCodeAt(i + 1);
      if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
        // Combine the surrogate pair and store it escaped.
        result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
        // Advance index one extra since we already used that char here.
        i++; continue;
      }
    }
    escapeSeq = ESCAPE_SEQUENCES[char];
    result += !escapeSeq && isPrintable(char)
      ? string[i]
      : escapeSeq || encodeHex(char);
  }

  return result;
}

function writeFlowSequence(state, level, object) {
  var _result = '',
      _tag    = state.tag,
      index,
      length;

  for (index = 0, length = object.length; index < length; index += 1) {
    // Write only valid elements.
    if (writeNode(state, level, object[index], false, false)) {
      if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
      _result += state.dump;
    }
  }

  state.tag = _tag;
  state.dump = '[' + _result + ']';
}

function writeBlockSequence(state, level, object, compact) {
  var _result = '',
      _tag    = state.tag,
      index,
      length;

  for (index = 0, length = object.length; index < length; index += 1) {
    // Write only valid elements.
    if (writeNode(state, level + 1, object[index], true, true)) {
      if (!compact || index !== 0) {
        _result += generateNextLine(state, level);
      }

      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
        _result += '-';
      } else {
        _result += '- ';
      }

      _result += state.dump;
    }
  }

  state.tag = _tag;
  state.dump = _result || '[]'; // Empty sequence if no valid values.
}

function writeFlowMapping(state, level, object) {
  var _result       = '',
      _tag          = state.tag,
      objectKeyList = Object.keys(object),
      index,
      length,
      objectKey,
      objectValue,
      pairBuffer;

  for (index = 0, length = objectKeyList.length; index < length; index += 1) {

    pairBuffer = '';
    if (index !== 0) pairBuffer += ', ';

    if (state.condenseFlow) pairBuffer += '"';

    objectKey = objectKeyList[index];
    objectValue = object[objectKey];

    if (!writeNode(state, level, objectKey, false, false)) {
      continue; // Skip this pair because of invalid key;
    }

    if (state.dump.length > 1024) pairBuffer += '? ';

    pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');

    if (!writeNode(state, level, objectValue, false, false)) {
      continue; // Skip this pair because of invalid value.
    }

    pairBuffer += state.dump;

    // Both key and value are valid.
    _result += pairBuffer;
  }

  state.tag = _tag;
  state.dump = '{' + _result + '}';
}

function writeBlockMapping(state, level, object, compact) {
  var _result       = '',
      _tag          = state.tag,
      objectKeyList = Object.keys(object),
      index,
      length,
      objectKey,
      objectValue,
      explicitPair,
      pairBuffer;

  // Allow sorting keys so that the output file is deterministic
  if (state.sortKeys === true) {
    // Default sorting
    objectKeyList.sort();
  } else if (typeof state.sortKeys === 'function') {
    // Custom sort function
    objectKeyList.sort(state.sortKeys);
  } else if (state.sortKeys) {
    // Something is wrong
    throw new YAMLException('sortKeys must be a boolean or a function');
  }

  for (index = 0, length = objectKeyList.length; index < length; index += 1) {
    pairBuffer = '';

    if (!compact || index !== 0) {
      pairBuffer += generateNextLine(state, level);
    }

    objectKey = objectKeyList[index];
    objectValue = object[objectKey];

    if (!writeNode(state, level + 1, objectKey, true, true, true)) {
      continue; // Skip this pair because of invalid key.
    }

    explicitPair = (state.tag !== null && state.tag !== '?') ||
                   (state.dump && state.dump.length > 1024);

    if (explicitPair) {
      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
        pairBuffer += '?';
      } else {
        pairBuffer += '? ';
      }
    }

    pairBuffer += state.dump;

    if (explicitPair) {
      pairBuffer += generateNextLine(state, level);
    }

    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
      continue; // Skip this pair because of invalid value.
    }

    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
      pairBuffer += ':';
    } else {
      pairBuffer += ': ';
    }

    pairBuffer += state.dump;

    // Both key and value are valid.
    _result += pairBuffer;
  }

  state.tag = _tag;
  state.dump = _result || '{}'; // Empty mapping if no valid pairs.
}

function detectType(state, object, explicit) {
  var _result, typeList, index, length, type, style;

  typeList = explicit ? state.explicitTypes : state.implicitTypes;

  for (index = 0, length = typeList.length; index < length; index += 1) {
    type = typeList[index];

    if ((type.instanceOf  || type.predicate) &&
        (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
        (!type.predicate  || type.predicate(object))) {

      state.tag = explicit ? type.tag : '?';

      if (type.represent) {
        style = state.styleMap[type.tag] || type.defaultStyle;

        if (_toString.call(type.represent) === '[object Function]') {
          _result = type.represent(object, style);
        } else if (_hasOwnProperty.call(type.represent, style)) {
          _result = type.represent[style](object, style);
        } else {
          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
        }

        state.dump = _result;
      }

      return true;
    }
  }

  return false;
}

// Serializes `object` and writes it to global `result`.
// Returns true on success, or false on invalid object.
//
function writeNode(state, level, object, block, compact, iskey) {
  state.tag = null;
  state.dump = object;

  if (!detectType(state, object, false)) {
    detectType(state, object, true);
  }

  var type = _toString.call(state.dump);

  if (block) {
    block = (state.flowLevel < 0 || state.flowLevel > level);
  }

  var objectOrArray = type === '[object Object]' || type === '[object Array]',
      duplicateIndex,
      duplicate;

  if (objectOrArray) {
    duplicateIndex = state.duplicates.indexOf(object);
    duplicate = duplicateIndex !== -1;
  }

  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
    compact = false;
  }

  if (duplicate && state.usedDuplicates[duplicateIndex]) {
    state.dump = '*ref_' + duplicateIndex;
  } else {
    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
      state.usedDuplicates[duplicateIndex] = true;
    }
    if (type === '[object Object]') {
      if (block && (Object.keys(state.dump).length !== 0)) {
        writeBlockMapping(state, level, state.dump, compact);
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + state.dump;
        }
      } else {
        writeFlowMapping(state, level, state.dump);
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
        }
      }
    } else if (type === '[object Array]') {
      var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
      if (block && (state.dump.length !== 0)) {
        writeBlockSequence(state, arrayLevel, state.dump, compact);
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + state.dump;
        }
      } else {
        writeFlowSequence(state, arrayLevel, state.dump);
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
        }
      }
    } else if (type === '[object String]') {
      if (state.tag !== '?') {
        writeScalar(state, state.dump, level, iskey);
      }
    } else {
      if (state.skipInvalid) return false;
      throw new YAMLException('unacceptable kind of an object to dump ' + type);
    }

    if (state.tag !== null && state.tag !== '?') {
      state.dump = '!<' + state.tag + '> ' + state.dump;
    }
  }

  return true;
}

function getDuplicateReferences(object, state) {
  var objects = [],
      duplicatesIndexes = [],
      index,
      length;

  inspectNode(object, objects, duplicatesIndexes);

  for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
    state.duplicates.push(objects[duplicatesIndexes[index]]);
  }
  state.usedDuplicates = new Array(length);
}

function inspectNode(object, objects, duplicatesIndexes) {
  var objectKeyList,
      index,
      length;

  if (object !== null && typeof object === 'object') {
    index = objects.indexOf(object);
    if (index !== -1) {
      if (duplicatesIndexes.indexOf(index) === -1) {
        duplicatesIndexes.push(index);
      }
    } else {
      objects.push(object);

      if (Array.isArray(object)) {
        for (index = 0, length = object.length; index < length; index += 1) {
          inspectNode(object[index], objects, duplicatesIndexes);
        }
      } else {
        objectKeyList = Object.keys(object);

        for (index = 0, length = objectKeyList.length; index < length; index += 1) {
          inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
        }
      }
    }
  }
}

function dump(input, options) {
  options = options || {};

  var state = new State(options);

  if (!state.noRefs) getDuplicateReferences(input, state);

  if (writeNode(state, 0, input, true, true)) return state.dump + '\n';

  return '';
}

function safeDump(input, options) {
  return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
}

module.exports.dump     = dump;
module.exports.safeDump = safeDump;


/***/ }),

/***/ 9643:
/***/ ((module) => {

"use strict";
// YAML error class. http://stackoverflow.com/questions/8458984
//


function YAMLException(reason, mark) {
  // Super constructor
  Error.call(this);

  this.name = 'YAMLException';
  this.reason = reason;
  this.mark = mark;
  this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');

  // Include stack trace in error object
  if (Error.captureStackTrace) {
    // Chrome and NodeJS
    Error.captureStackTrace(this, this.constructor);
  } else {
    // FF, IE 10+ and Safari 6+. Fallback for others
    this.stack = (new Error()).stack || '';
  }
}


// Inherit from Error
YAMLException.prototype = Object.create(Error.prototype);
YAMLException.prototype.constructor = YAMLException;


YAMLException.prototype.toString = function toString(compact) {
  var result = this.name + ': ';

  result += this.reason || '(unknown reason)';

  if (!compact && this.mark) {
    result += ' ' + this.mark.toString();
  }

  return result;
};


module.exports = YAMLException;


/***/ }),

/***/ 36279:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/*eslint-disable max-len,no-use-before-define*/

var common              = __webpack_require__(19333);
var YAMLException       = __webpack_require__(9643);
var Mark                = __webpack_require__(21617);
var DEFAULT_SAFE_SCHEMA = __webpack_require__(41893);
var DEFAULT_FULL_SCHEMA = __webpack_require__(41413);


var _hasOwnProperty = Object.prototype.hasOwnProperty;


var CONTEXT_FLOW_IN   = 1;
var CONTEXT_FLOW_OUT  = 2;
var CONTEXT_BLOCK_IN  = 3;
var CONTEXT_BLOCK_OUT = 4;


var CHOMPING_CLIP  = 1;
var CHOMPING_STRIP = 2;
var CHOMPING_KEEP  = 3;


var PATTERN_NON_PRINTABLE         = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
var PATTERN_FLOW_INDICATORS       = /[,\[\]\{\}]/;
var PATTERN_TAG_HANDLE            = /^(?:!|!!|![a-z\-]+!)$/i;
var PATTERN_TAG_URI               = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;


function _class(obj) { return Object.prototype.toString.call(obj); }

function is_EOL(c) {
  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
}

function is_WHITE_SPACE(c) {
  return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
}

function is_WS_OR_EOL(c) {
  return (c === 0x09/* Tab */) ||
         (c === 0x20/* Space */) ||
         (c === 0x0A/* LF */) ||
         (c === 0x0D/* CR */);
}

function is_FLOW_INDICATOR(c) {
  return c === 0x2C/* , */ ||
         c === 0x5B/* [ */ ||
         c === 0x5D/* ] */ ||
         c === 0x7B/* { */ ||
         c === 0x7D/* } */;
}

function fromHexCode(c) {
  var lc;

  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
    return c - 0x30;
  }

  /*eslint-disable no-bitwise*/
  lc = c | 0x20;

  if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
    return lc - 0x61 + 10;
  }

  return -1;
}

function escapedHexLen(c) {
  if (c === 0x78/* x */) { return 2; }
  if (c === 0x75/* u */) { return 4; }
  if (c === 0x55/* U */) { return 8; }
  return 0;
}

function fromDecimalCode(c) {
  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
    return c - 0x30;
  }

  return -1;
}

function simpleEscapeSequence(c) {
  /* eslint-disable indent */
  return (c === 0x30/* 0 */) ? '\x00' :
        (c === 0x61/* a */) ? '\x07' :
        (c === 0x62/* b */) ? '\x08' :
        (c === 0x74/* t */) ? '\x09' :
        (c === 0x09/* Tab */) ? '\x09' :
        (c === 0x6E/* n */) ? '\x0A' :
        (c === 0x76/* v */) ? '\x0B' :
        (c === 0x66/* f */) ? '\x0C' :
        (c === 0x72/* r */) ? '\x0D' :
        (c === 0x65/* e */) ? '\x1B' :
        (c === 0x20/* Space */) ? ' ' :
        (c === 0x22/* " */) ? '\x22' :
        (c === 0x2F/* / */) ? '/' :
        (c === 0x5C/* \ */) ? '\x5C' :
        (c === 0x4E/* N */) ? '\x85' :
        (c === 0x5F/* _ */) ? '\xA0' :
        (c === 0x4C/* L */) ? '\u2028' :
        (c === 0x50/* P */) ? '\u2029' : '';
}

function charFromCodepoint(c) {
  if (c <= 0xFFFF) {
    return String.fromCharCode(c);
  }
  // Encode UTF-16 surrogate pair
  // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
  return String.fromCharCode(
    ((c - 0x010000) >> 10) + 0xD800,
    ((c - 0x010000) & 0x03FF) + 0xDC00
  );
}

var simpleEscapeCheck = new Array(256); // integer, for fast access
var simpleEscapeMap = new Array(256);
for (var i = 0; i < 256; i++) {
  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
  simpleEscapeMap[i] = simpleEscapeSequence(i);
}


function State(input, options) {
  this.input = input;

  this.filename  = options['filename']  || null;
  this.schema    = options['schema']    || DEFAULT_FULL_SCHEMA;
  this.onWarning = options['onWarning'] || null;
  this.legacy    = options['legacy']    || false;
  this.json      = options['json']      || false;
  this.listener  = options['listener']  || null;

  this.implicitTypes = this.schema.compiledImplicit;
  this.typeMap       = this.schema.compiledTypeMap;

  this.length     = input.length;
  this.position   = 0;
  this.line       = 0;
  this.lineStart  = 0;
  this.lineIndent = 0;

  this.documents = [];

  /*
  this.version;
  this.checkLineBreaks;
  this.tagMap;
  this.anchorMap;
  this.tag;
  this.anchor;
  this.kind;
  this.result;*/

}


function generateError(state, message) {
  return new YAMLException(
    message,
    new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
}

function throwError(state, message) {
  throw generateError(state, message);
}

function throwWarning(state, message) {
  if (state.onWarning) {
    state.onWarning.call(null, generateError(state, message));
  }
}


var directiveHandlers = {

  YAML: function handleYamlDirective(state, name, args) {

    var match, major, minor;

    if (state.version !== null) {
      throwError(state, 'duplication of %YAML directive');
    }

    if (args.length !== 1) {
      throwError(state, 'YAML directive accepts exactly one argument');
    }

    match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);

    if (match === null) {
      throwError(state, 'ill-formed argument of the YAML directive');
    }

    major = parseInt(match[1], 10);
    minor = parseInt(match[2], 10);

    if (major !== 1) {
      throwError(state, 'unacceptable YAML version of the document');
    }

    state.version = args[0];
    state.checkLineBreaks = (minor < 2);

    if (minor !== 1 && minor !== 2) {
      throwWarning(state, 'unsupported YAML version of the document');
    }
  },

  TAG: function handleTagDirective(state, name, args) {

    var handle, prefix;

    if (args.length !== 2) {
      throwError(state, 'TAG directive accepts exactly two arguments');
    }

    handle = args[0];
    prefix = args[1];

    if (!PATTERN_TAG_HANDLE.test(handle)) {
      throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
    }

    if (_hasOwnProperty.call(state.tagMap, handle)) {
      throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
    }

    if (!PATTERN_TAG_URI.test(prefix)) {
      throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
    }

    state.tagMap[handle] = prefix;
  }
};


function captureSegment(state, start, end, checkJson) {
  var _position, _length, _character, _result;

  if (start < end) {
    _result = state.input.slice(start, end);

    if (checkJson) {
      for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
        _character = _result.charCodeAt(_position);
        if (!(_character === 0x09 ||
              (0x20 <= _character && _character <= 0x10FFFF))) {
          throwError(state, 'expected valid JSON character');
        }
      }
    } else if (PATTERN_NON_PRINTABLE.test(_result)) {
      throwError(state, 'the stream contains non-printable characters');
    }

    state.result += _result;
  }
}

function mergeMappings(state, destination, source, overridableKeys) {
  var sourceKeys, key, index, quantity;

  if (!common.isObject(source)) {
    throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
  }

  sourceKeys = Object.keys(source);

  for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
    key = sourceKeys[index];

    if (!_hasOwnProperty.call(destination, key)) {
      destination[key] = source[key];
      overridableKeys[key] = true;
    }
  }
}

function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
  var index, quantity;

  // The output is a plain object here, so keys can only be strings.
  // We need to convert keyNode to a string, but doing so can hang the process
  // (deeply nested arrays that explode exponentially using aliases).
  if (Array.isArray(keyNode)) {
    keyNode = Array.prototype.slice.call(keyNode);

    for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
      if (Array.isArray(keyNode[index])) {
        throwError(state, 'nested arrays are not supported inside keys');
      }

      if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
        keyNode[index] = '[object Object]';
      }
    }
  }

  // Avoid code execution in load() via toString property
  // (still use its own toString for arrays, timestamps,
  // and whatever user schema extensions happen to have @@toStringTag)
  if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
    keyNode = '[object Object]';
  }


  keyNode = String(keyNode);

  if (_result === null) {
    _result = {};
  }

  if (keyTag === 'tag:yaml.org,2002:merge') {
    if (Array.isArray(valueNode)) {
      for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
        mergeMappings(state, _result, valueNode[index], overridableKeys);
      }
    } else {
      mergeMappings(state, _result, valueNode, overridableKeys);
    }
  } else {
    if (!state.json &&
        !_hasOwnProperty.call(overridableKeys, keyNode) &&
        _hasOwnProperty.call(_result, keyNode)) {
      state.line = startLine || state.line;
      state.position = startPos || state.position;
      throwError(state, 'duplicated mapping key');
    }
    _result[keyNode] = valueNode;
    delete overridableKeys[keyNode];
  }

  return _result;
}

function readLineBreak(state) {
  var ch;

  ch = state.input.charCodeAt(state.position);

  if (ch === 0x0A/* LF */) {
    state.position++;
  } else if (ch === 0x0D/* CR */) {
    state.position++;
    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
      state.position++;
    }
  } else {
    throwError(state, 'a line break is expected');
  }

  state.line += 1;
  state.lineStart = state.position;
}

function skipSeparationSpace(state, allowComments, checkIndent) {
  var lineBreaks = 0,
      ch = state.input.charCodeAt(state.position);

  while (ch !== 0) {
    while (is_WHITE_SPACE(ch)) {
      ch = state.input.charCodeAt(++state.position);
    }

    if (allowComments && ch === 0x23/* # */) {
      do {
        ch = state.input.charCodeAt(++state.position);
      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
    }

    if (is_EOL(ch)) {
      readLineBreak(state);

      ch = state.input.charCodeAt(state.position);
      lineBreaks++;
      state.lineIndent = 0;

      while (ch === 0x20/* Space */) {
        state.lineIndent++;
        ch = state.input.charCodeAt(++state.position);
      }
    } else {
      break;
    }
  }

  if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
    throwWarning(state, 'deficient indentation');
  }

  return lineBreaks;
}

function testDocumentSeparator(state) {
  var _position = state.position,
      ch;

  ch = state.input.charCodeAt(_position);

  // Condition state.position === state.lineStart is tested
  // in parent on each call, for efficiency. No needs to test here again.
  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
      ch === state.input.charCodeAt(_position + 1) &&
      ch === state.input.charCodeAt(_position + 2)) {

    _position += 3;

    ch = state.input.charCodeAt(_position);

    if (ch === 0 || is_WS_OR_EOL(ch)) {
      return true;
    }
  }

  return false;
}

function writeFoldedLines(state, count) {
  if (count === 1) {
    state.result += ' ';
  } else if (count > 1) {
    state.result += common.repeat('\n', count - 1);
  }
}


function readPlainScalar(state, nodeIndent, withinFlowCollection) {
  var preceding,
      following,
      captureStart,
      captureEnd,
      hasPendingContent,
      _line,
      _lineStart,
      _lineIndent,
      _kind = state.kind,
      _result = state.result,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (is_WS_OR_EOL(ch)      ||
      is_FLOW_INDICATOR(ch) ||
      ch === 0x23/* # */    ||
      ch === 0x26/* & */    ||
      ch === 0x2A/* * */    ||
      ch === 0x21/* ! */    ||
      ch === 0x7C/* | */    ||
      ch === 0x3E/* > */    ||
      ch === 0x27/* ' */    ||
      ch === 0x22/* " */    ||
      ch === 0x25/* % */    ||
      ch === 0x40/* @ */    ||
      ch === 0x60/* ` */) {
    return false;
  }

  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
    following = state.input.charCodeAt(state.position + 1);

    if (is_WS_OR_EOL(following) ||
        withinFlowCollection && is_FLOW_INDICATOR(following)) {
      return false;
    }
  }

  state.kind = 'scalar';
  state.result = '';
  captureStart = captureEnd = state.position;
  hasPendingContent = false;

  while (ch !== 0) {
    if (ch === 0x3A/* : */) {
      following = state.input.charCodeAt(state.position + 1);

      if (is_WS_OR_EOL(following) ||
          withinFlowCollection && is_FLOW_INDICATOR(following)) {
        break;
      }

    } else if (ch === 0x23/* # */) {
      preceding = state.input.charCodeAt(state.position - 1);

      if (is_WS_OR_EOL(preceding)) {
        break;
      }

    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
               withinFlowCollection && is_FLOW_INDICATOR(ch)) {
      break;

    } else if (is_EOL(ch)) {
      _line = state.line;
      _lineStart = state.lineStart;
      _lineIndent = state.lineIndent;
      skipSeparationSpace(state, false, -1);

      if (state.lineIndent >= nodeIndent) {
        hasPendingContent = true;
        ch = state.input.charCodeAt(state.position);
        continue;
      } else {
        state.position = captureEnd;
        state.line = _line;
        state.lineStart = _lineStart;
        state.lineIndent = _lineIndent;
        break;
      }
    }

    if (hasPendingContent) {
      captureSegment(state, captureStart, captureEnd, false);
      writeFoldedLines(state, state.line - _line);
      captureStart = captureEnd = state.position;
      hasPendingContent = false;
    }

    if (!is_WHITE_SPACE(ch)) {
      captureEnd = state.position + 1;
    }

    ch = state.input.charCodeAt(++state.position);
  }

  captureSegment(state, captureStart, captureEnd, false);

  if (state.result) {
    return true;
  }

  state.kind = _kind;
  state.result = _result;
  return false;
}

function readSingleQuotedScalar(state, nodeIndent) {
  var ch,
      captureStart, captureEnd;

  ch = state.input.charCodeAt(state.position);

  if (ch !== 0x27/* ' */) {
    return false;
  }

  state.kind = 'scalar';
  state.result = '';
  state.position++;
  captureStart = captureEnd = state.position;

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    if (ch === 0x27/* ' */) {
      captureSegment(state, captureStart, state.position, true);
      ch = state.input.charCodeAt(++state.position);

      if (ch === 0x27/* ' */) {
        captureStart = state.position;
        state.position++;
        captureEnd = state.position;
      } else {
        return true;
      }

    } else if (is_EOL(ch)) {
      captureSegment(state, captureStart, captureEnd, true);
      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
      captureStart = captureEnd = state.position;

    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
      throwError(state, 'unexpected end of the document within a single quoted scalar');

    } else {
      state.position++;
      captureEnd = state.position;
    }
  }

  throwError(state, 'unexpected end of the stream within a single quoted scalar');
}

function readDoubleQuotedScalar(state, nodeIndent) {
  var captureStart,
      captureEnd,
      hexLength,
      hexResult,
      tmp,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch !== 0x22/* " */) {
    return false;
  }

  state.kind = 'scalar';
  state.result = '';
  state.position++;
  captureStart = captureEnd = state.position;

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    if (ch === 0x22/* " */) {
      captureSegment(state, captureStart, state.position, true);
      state.position++;
      return true;

    } else if (ch === 0x5C/* \ */) {
      captureSegment(state, captureStart, state.position, true);
      ch = state.input.charCodeAt(++state.position);

      if (is_EOL(ch)) {
        skipSeparationSpace(state, false, nodeIndent);

        // TODO: rework to inline fn with no type cast?
      } else if (ch < 256 && simpleEscapeCheck[ch]) {
        state.result += simpleEscapeMap[ch];
        state.position++;

      } else if ((tmp = escapedHexLen(ch)) > 0) {
        hexLength = tmp;
        hexResult = 0;

        for (; hexLength > 0; hexLength--) {
          ch = state.input.charCodeAt(++state.position);

          if ((tmp = fromHexCode(ch)) >= 0) {
            hexResult = (hexResult << 4) + tmp;

          } else {
            throwError(state, 'expected hexadecimal character');
          }
        }

        state.result += charFromCodepoint(hexResult);

        state.position++;

      } else {
        throwError(state, 'unknown escape sequence');
      }

      captureStart = captureEnd = state.position;

    } else if (is_EOL(ch)) {
      captureSegment(state, captureStart, captureEnd, true);
      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
      captureStart = captureEnd = state.position;

    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
      throwError(state, 'unexpected end of the document within a double quoted scalar');

    } else {
      state.position++;
      captureEnd = state.position;
    }
  }

  throwError(state, 'unexpected end of the stream within a double quoted scalar');
}

function readFlowCollection(state, nodeIndent) {
  var readNext = true,
      _line,
      _tag     = state.tag,
      _result,
      _anchor  = state.anchor,
      following,
      terminator,
      isPair,
      isExplicitPair,
      isMapping,
      overridableKeys = {},
      keyNode,
      keyTag,
      valueNode,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch === 0x5B/* [ */) {
    terminator = 0x5D;/* ] */
    isMapping = false;
    _result = [];
  } else if (ch === 0x7B/* { */) {
    terminator = 0x7D;/* } */
    isMapping = true;
    _result = {};
  } else {
    return false;
  }

  if (state.anchor !== null) {
    state.anchorMap[state.anchor] = _result;
  }

  ch = state.input.charCodeAt(++state.position);

  while (ch !== 0) {
    skipSeparationSpace(state, true, nodeIndent);

    ch = state.input.charCodeAt(state.position);

    if (ch === terminator) {
      state.position++;
      state.tag = _tag;
      state.anchor = _anchor;
      state.kind = isMapping ? 'mapping' : 'sequence';
      state.result = _result;
      return true;
    } else if (!readNext) {
      throwError(state, 'missed comma between flow collection entries');
    }

    keyTag = keyNode = valueNode = null;
    isPair = isExplicitPair = false;

    if (ch === 0x3F/* ? */) {
      following = state.input.charCodeAt(state.position + 1);

      if (is_WS_OR_EOL(following)) {
        isPair = isExplicitPair = true;
        state.position++;
        skipSeparationSpace(state, true, nodeIndent);
      }
    }

    _line = state.line;
    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
    keyTag = state.tag;
    keyNode = state.result;
    skipSeparationSpace(state, true, nodeIndent);

    ch = state.input.charCodeAt(state.position);

    if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
      isPair = true;
      ch = state.input.charCodeAt(++state.position);
      skipSeparationSpace(state, true, nodeIndent);
      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
      valueNode = state.result;
    }

    if (isMapping) {
      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
    } else if (isPair) {
      _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
    } else {
      _result.push(keyNode);
    }

    skipSeparationSpace(state, true, nodeIndent);

    ch = state.input.charCodeAt(state.position);

    if (ch === 0x2C/* , */) {
      readNext = true;
      ch = state.input.charCodeAt(++state.position);
    } else {
      readNext = false;
    }
  }

  throwError(state, 'unexpected end of the stream within a flow collection');
}

function readBlockScalar(state, nodeIndent) {
  var captureStart,
      folding,
      chomping       = CHOMPING_CLIP,
      didReadContent = false,
      detectedIndent = false,
      textIndent     = nodeIndent,
      emptyLines     = 0,
      atMoreIndented = false,
      tmp,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch === 0x7C/* | */) {
    folding = false;
  } else if (ch === 0x3E/* > */) {
    folding = true;
  } else {
    return false;
  }

  state.kind = 'scalar';
  state.result = '';

  while (ch !== 0) {
    ch = state.input.charCodeAt(++state.position);

    if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
      if (CHOMPING_CLIP === chomping) {
        chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
      } else {
        throwError(state, 'repeat of a chomping mode identifier');
      }

    } else if ((tmp = fromDecimalCode(ch)) >= 0) {
      if (tmp === 0) {
        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
      } else if (!detectedIndent) {
        textIndent = nodeIndent + tmp - 1;
        detectedIndent = true;
      } else {
        throwError(state, 'repeat of an indentation width identifier');
      }

    } else {
      break;
    }
  }

  if (is_WHITE_SPACE(ch)) {
    do { ch = state.input.charCodeAt(++state.position); }
    while (is_WHITE_SPACE(ch));

    if (ch === 0x23/* # */) {
      do { ch = state.input.charCodeAt(++state.position); }
      while (!is_EOL(ch) && (ch !== 0));
    }
  }

  while (ch !== 0) {
    readLineBreak(state);
    state.lineIndent = 0;

    ch = state.input.charCodeAt(state.position);

    while ((!detectedIndent || state.lineIndent < textIndent) &&
           (ch === 0x20/* Space */)) {
      state.lineIndent++;
      ch = state.input.charCodeAt(++state.position);
    }

    if (!detectedIndent && state.lineIndent > textIndent) {
      textIndent = state.lineIndent;
    }

    if (is_EOL(ch)) {
      emptyLines++;
      continue;
    }

    // End of the scalar.
    if (state.lineIndent < textIndent) {

      // Perform the chomping.
      if (chomping === CHOMPING_KEEP) {
        state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
      } else if (chomping === CHOMPING_CLIP) {
        if (didReadContent) { // i.e. only if the scalar is not empty.
          state.result += '\n';
        }
      }

      // Break this `while` cycle and go to the funciton's epilogue.
      break;
    }

    // Folded style: use fancy rules to handle line breaks.
    if (folding) {

      // Lines starting with white space characters (more-indented lines) are not folded.
      if (is_WHITE_SPACE(ch)) {
        atMoreIndented = true;
        // except for the first content line (cf. Example 8.1)
        state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);

      // End of more-indented block.
      } else if (atMoreIndented) {
        atMoreIndented = false;
        state.result += common.repeat('\n', emptyLines + 1);

      // Just one line break - perceive as the same line.
      } else if (emptyLines === 0) {
        if (didReadContent) { // i.e. only if we have already read some scalar content.
          state.result += ' ';
        }

      // Several line breaks - perceive as different lines.
      } else {
        state.result += common.repeat('\n', emptyLines);
      }

    // Literal style: just add exact number of line breaks between content lines.
    } else {
      // Keep all line breaks except the header line break.
      state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
    }

    didReadContent = true;
    detectedIndent = true;
    emptyLines = 0;
    captureStart = state.position;

    while (!is_EOL(ch) && (ch !== 0)) {
      ch = state.input.charCodeAt(++state.position);
    }

    captureSegment(state, captureStart, state.position, false);
  }

  return true;
}

function readBlockSequence(state, nodeIndent) {
  var _line,
      _tag      = state.tag,
      _anchor   = state.anchor,
      _result   = [],
      following,
      detected  = false,
      ch;

  if (state.anchor !== null) {
    state.anchorMap[state.anchor] = _result;
  }

  ch = state.input.charCodeAt(state.position);

  while (ch !== 0) {

    if (ch !== 0x2D/* - */) {
      break;
    }

    following = state.input.charCodeAt(state.position + 1);

    if (!is_WS_OR_EOL(following)) {
      break;
    }

    detected = true;
    state.position++;

    if (skipSeparationSpace(state, true, -1)) {
      if (state.lineIndent <= nodeIndent) {
        _result.push(null);
        ch = state.input.charCodeAt(state.position);
        continue;
      }
    }

    _line = state.line;
    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
    _result.push(state.result);
    skipSeparationSpace(state, true, -1);

    ch = state.input.charCodeAt(state.position);

    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
      throwError(state, 'bad indentation of a sequence entry');
    } else if (state.lineIndent < nodeIndent) {
      break;
    }
  }

  if (detected) {
    state.tag = _tag;
    state.anchor = _anchor;
    state.kind = 'sequence';
    state.result = _result;
    return true;
  }
  return false;
}

function readBlockMapping(state, nodeIndent, flowIndent) {
  var following,
      allowCompact,
      _line,
      _pos,
      _tag          = state.tag,
      _anchor       = state.anchor,
      _result       = {},
      overridableKeys = {},
      keyTag        = null,
      keyNode       = null,
      valueNode     = null,
      atExplicitKey = false,
      detected      = false,
      ch;

  if (state.anchor !== null) {
    state.anchorMap[state.anchor] = _result;
  }

  ch = state.input.charCodeAt(state.position);

  while (ch !== 0) {
    following = state.input.charCodeAt(state.position + 1);
    _line = state.line; // Save the current line.
    _pos = state.position;

    //
    // Explicit notation case. There are two separate blocks:
    // first for the key (denoted by "?") and second for the value (denoted by ":")
    //
    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {

      if (ch === 0x3F/* ? */) {
        if (atExplicitKey) {
          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
          keyTag = keyNode = valueNode = null;
        }

        detected = true;
        atExplicitKey = true;
        allowCompact = true;

      } else if (atExplicitKey) {
        // i.e. 0x3A/* : */ === character after the explicit key.
        atExplicitKey = false;
        allowCompact = true;

      } else {
        throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
      }

      state.position += 1;
      ch = following;

    //
    // Implicit notation case. Flow-style node as the key first, then ":", and the value.
    //
    } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {

      if (state.line === _line) {
        ch = state.input.charCodeAt(state.position);

        while (is_WHITE_SPACE(ch)) {
          ch = state.input.charCodeAt(++state.position);
        }

        if (ch === 0x3A/* : */) {
          ch = state.input.charCodeAt(++state.position);

          if (!is_WS_OR_EOL(ch)) {
            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
          }

          if (atExplicitKey) {
            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
            keyTag = keyNode = valueNode = null;
          }

          detected = true;
          atExplicitKey = false;
          allowCompact = false;
          keyTag = state.tag;
          keyNode = state.result;

        } else if (detected) {
          throwError(state, 'can not read an implicit mapping pair; a colon is missed');

        } else {
          state.tag = _tag;
          state.anchor = _anchor;
          return true; // Keep the result of `composeNode`.
        }

      } else if (detected) {
        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');

      } else {
        state.tag = _tag;
        state.anchor = _anchor;
        return true; // Keep the result of `composeNode`.
      }

    } else {
      break; // Reading is done. Go to the epilogue.
    }

    //
    // Common reading code for both explicit and implicit notations.
    //
    if (state.line === _line || state.lineIndent > nodeIndent) {
      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
        if (atExplicitKey) {
          keyNode = state.result;
        } else {
          valueNode = state.result;
        }
      }

      if (!atExplicitKey) {
        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
        keyTag = keyNode = valueNode = null;
      }

      skipSeparationSpace(state, true, -1);
      ch = state.input.charCodeAt(state.position);
    }

    if (state.lineIndent > nodeIndent && (ch !== 0)) {
      throwError(state, 'bad indentation of a mapping entry');
    } else if (state.lineIndent < nodeIndent) {
      break;
    }
  }

  //
  // Epilogue.
  //

  // Special case: last mapping's node contains only the key in explicit notation.
  if (atExplicitKey) {
    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  }

  // Expose the resulting mapping.
  if (detected) {
    state.tag = _tag;
    state.anchor = _anchor;
    state.kind = 'mapping';
    state.result = _result;
  }

  return detected;
}

function readTagProperty(state) {
  var _position,
      isVerbatim = false,
      isNamed    = false,
      tagHandle,
      tagName,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch !== 0x21/* ! */) return false;

  if (state.tag !== null) {
    throwError(state, 'duplication of a tag property');
  }

  ch = state.input.charCodeAt(++state.position);

  if (ch === 0x3C/* < */) {
    isVerbatim = true;
    ch = state.input.charCodeAt(++state.position);

  } else if (ch === 0x21/* ! */) {
    isNamed = true;
    tagHandle = '!!';
    ch = state.input.charCodeAt(++state.position);

  } else {
    tagHandle = '!';
  }

  _position = state.position;

  if (isVerbatim) {
    do { ch = state.input.charCodeAt(++state.position); }
    while (ch !== 0 && ch !== 0x3E/* > */);

    if (state.position < state.length) {
      tagName = state.input.slice(_position, state.position);
      ch = state.input.charCodeAt(++state.position);
    } else {
      throwError(state, 'unexpected end of the stream within a verbatim tag');
    }
  } else {
    while (ch !== 0 && !is_WS_OR_EOL(ch)) {

      if (ch === 0x21/* ! */) {
        if (!isNamed) {
          tagHandle = state.input.slice(_position - 1, state.position + 1);

          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
            throwError(state, 'named tag handle cannot contain such characters');
          }

          isNamed = true;
          _position = state.position + 1;
        } else {
          throwError(state, 'tag suffix cannot contain exclamation marks');
        }
      }

      ch = state.input.charCodeAt(++state.position);
    }

    tagName = state.input.slice(_position, state.position);

    if (PATTERN_FLOW_INDICATORS.test(tagName)) {
      throwError(state, 'tag suffix cannot contain flow indicator characters');
    }
  }

  if (tagName && !PATTERN_TAG_URI.test(tagName)) {
    throwError(state, 'tag name cannot contain such characters: ' + tagName);
  }

  if (isVerbatim) {
    state.tag = tagName;

  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
    state.tag = state.tagMap[tagHandle] + tagName;

  } else if (tagHandle === '!') {
    state.tag = '!' + tagName;

  } else if (tagHandle === '!!') {
    state.tag = 'tag:yaml.org,2002:' + tagName;

  } else {
    throwError(state, 'undeclared tag handle "' + tagHandle + '"');
  }

  return true;
}

function readAnchorProperty(state) {
  var _position,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch !== 0x26/* & */) return false;

  if (state.anchor !== null) {
    throwError(state, 'duplication of an anchor property');
  }

  ch = state.input.charCodeAt(++state.position);
  _position = state.position;

  while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
    ch = state.input.charCodeAt(++state.position);
  }

  if (state.position === _position) {
    throwError(state, 'name of an anchor node must contain at least one character');
  }

  state.anchor = state.input.slice(_position, state.position);
  return true;
}

function readAlias(state) {
  var _position, alias,
      ch;

  ch = state.input.charCodeAt(state.position);

  if (ch !== 0x2A/* * */) return false;

  ch = state.input.charCodeAt(++state.position);
  _position = state.position;

  while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
    ch = state.input.charCodeAt(++state.position);
  }

  if (state.position === _position) {
    throwError(state, 'name of an alias node must contain at least one character');
  }

  alias = state.input.slice(_position, state.position);

  if (!_hasOwnProperty.call(state.anchorMap, alias)) {
    throwError(state, 'unidentified alias "' + alias + '"');
  }

  state.result = state.anchorMap[alias];
  skipSeparationSpace(state, true, -1);
  return true;
}

function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
  var allowBlockStyles,
      allowBlockScalars,
      allowBlockCollections,
      indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
      atNewLine  = false,
      hasContent = false,
      typeIndex,
      typeQuantity,
      type,
      flowIndent,
      blockIndent;

  if (state.listener !== null) {
    state.listener('open', state);
  }

  state.tag    = null;
  state.anchor = null;
  state.kind   = null;
  state.result = null;

  allowBlockStyles = allowBlockScalars = allowBlockCollections =
    CONTEXT_BLOCK_OUT === nodeContext ||
    CONTEXT_BLOCK_IN  === nodeContext;

  if (allowToSeek) {
    if (skipSeparationSpace(state, true, -1)) {
      atNewLine = true;

      if (state.lineIndent > parentIndent) {
        indentStatus = 1;
      } else if (state.lineIndent === parentIndent) {
        indentStatus = 0;
      } else if (state.lineIndent < parentIndent) {
        indentStatus = -1;
      }
    }
  }

  if (indentStatus === 1) {
    while (readTagProperty(state) || readAnchorProperty(state)) {
      if (skipSeparationSpace(state, true, -1)) {
        atNewLine = true;
        allowBlockCollections = allowBlockStyles;

        if (state.lineIndent > parentIndent) {
          indentStatus = 1;
        } else if (state.lineIndent === parentIndent) {
          indentStatus = 0;
        } else if (state.lineIndent < parentIndent) {
          indentStatus = -1;
        }
      } else {
        allowBlockCollections = false;
      }
    }
  }

  if (allowBlockCollections) {
    allowBlockCollections = atNewLine || allowCompact;
  }

  if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
      flowIndent = parentIndent;
    } else {
      flowIndent = parentIndent + 1;
    }

    blockIndent = state.position - state.lineStart;

    if (indentStatus === 1) {
      if (allowBlockCollections &&
          (readBlockSequence(state, blockIndent) ||
           readBlockMapping(state, blockIndent, flowIndent)) ||
          readFlowCollection(state, flowIndent)) {
        hasContent = true;
      } else {
        if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
            readSingleQuotedScalar(state, flowIndent) ||
            readDoubleQuotedScalar(state, flowIndent)) {
          hasContent = true;

        } else if (readAlias(state)) {
          hasContent = true;

          if (state.tag !== null || state.anchor !== null) {
            throwError(state, 'alias node should not have any properties');
          }

        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
          hasContent = true;

          if (state.tag === null) {
            state.tag = '?';
          }
        }

        if (state.anchor !== null) {
          state.anchorMap[state.anchor] = state.result;
        }
      }
    } else if (indentStatus === 0) {
      // Special case: block sequences are allowed to have same indentation level as the parent.
      // http://www.yaml.org/spec/1.2/spec.html#id2799784
      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
    }
  }

  if (state.tag !== null && state.tag !== '!') {
    if (state.tag === '?') {
      // Implicit resolving is not allowed for non-scalar types, and '?'
      // non-specific tag is only automatically assigned to plain scalars.
      //
      // We only need to check kind conformity in case user explicitly assigns '?'
      // tag, for example like this: "!<?> [0]"
      //
      if (state.result !== null && state.kind !== 'scalar') {
        throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
      }

      for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
        type = state.implicitTypes[typeIndex];

        if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
          state.result = type.construct(state.result);
          state.tag = type.tag;
          if (state.anchor !== null) {
            state.anchorMap[state.anchor] = state.result;
          }
          break;
        }
      }
    } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
      type = state.typeMap[state.kind || 'fallback'][state.tag];

      if (state.result !== null && type.kind !== state.kind) {
        throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
      }

      if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
        throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
      } else {
        state.result = type.construct(state.result);
        if (state.anchor !== null) {
          state.anchorMap[state.anchor] = state.result;
        }
      }
    } else {
      throwError(state, 'unknown tag !<' + state.tag + '>');
    }
  }

  if (state.listener !== null) {
    state.listener('close', state);
  }
  return state.tag !== null ||  state.anchor !== null || hasContent;
}

function readDocument(state) {
  var documentStart = state.position,
      _position,
      directiveName,
      directiveArgs,
      hasDirectives = false,
      ch;

  state.version = null;
  state.checkLineBreaks = state.legacy;
  state.tagMap = {};
  state.anchorMap = {};

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    skipSeparationSpace(state, true, -1);

    ch = state.input.charCodeAt(state.position);

    if (state.lineIndent > 0 || ch !== 0x25/* % */) {
      break;
    }

    hasDirectives = true;
    ch = state.input.charCodeAt(++state.position);
    _position = state.position;

    while (ch !== 0 && !is_WS_OR_EOL(ch)) {
      ch = state.input.charCodeAt(++state.position);
    }

    directiveName = state.input.slice(_position, state.position);
    directiveArgs = [];

    if (directiveName.length < 1) {
      throwError(state, 'directive name must not be less than one character in length');
    }

    while (ch !== 0) {
      while (is_WHITE_SPACE(ch)) {
        ch = state.input.charCodeAt(++state.position);
      }

      if (ch === 0x23/* # */) {
        do { ch = state.input.charCodeAt(++state.position); }
        while (ch !== 0 && !is_EOL(ch));
        break;
      }

      if (is_EOL(ch)) break;

      _position = state.position;

      while (ch !== 0 && !is_WS_OR_EOL(ch)) {
        ch = state.input.charCodeAt(++state.position);
      }

      directiveArgs.push(state.input.slice(_position, state.position));
    }

    if (ch !== 0) readLineBreak(state);

    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
      directiveHandlers[directiveName](state, directiveName, directiveArgs);
    } else {
      throwWarning(state, 'unknown document directive "' + directiveName + '"');
    }
  }

  skipSeparationSpace(state, true, -1);

  if (state.lineIndent === 0 &&
      state.input.charCodeAt(state.position)     === 0x2D/* - */ &&
      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
      state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
    state.position += 3;
    skipSeparationSpace(state, true, -1);

  } else if (hasDirectives) {
    throwError(state, 'directives end mark is expected');
  }

  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
  skipSeparationSpace(state, true, -1);

  if (state.checkLineBreaks &&
      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
    throwWarning(state, 'non-ASCII line breaks are interpreted as content');
  }

  state.documents.push(state.result);

  if (state.position === state.lineStart && testDocumentSeparator(state)) {

    if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
      state.position += 3;
      skipSeparationSpace(state, true, -1);
    }
    return;
  }

  if (state.position < (state.length - 1)) {
    throwError(state, 'end of the stream or a document separator is expected');
  } else {
    return;
  }
}


function loadDocuments(input, options) {
  input = String(input);
  options = options || {};

  if (input.length !== 0) {

    // Add tailing `\n` if not exists
    if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
        input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
      input += '\n';
    }

    // Strip BOM
    if (input.charCodeAt(0) === 0xFEFF) {
      input = input.slice(1);
    }
  }

  var state = new State(input, options);

  var nullpos = input.indexOf('\0');

  if (nullpos !== -1) {
    state.position = nullpos;
    throwError(state, 'null byte is not allowed in input');
  }

  // Use 0 as string terminator. That significantly simplifies bounds check.
  state.input += '\0';

  while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
    state.lineIndent += 1;
    state.position += 1;
  }

  while (state.position < (state.length - 1)) {
    readDocument(state);
  }

  return state.documents;
}


function loadAll(input, iterator, options) {
  if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
    options = iterator;
    iterator = null;
  }

  var documents = loadDocuments(input, options);

  if (typeof iterator !== 'function') {
    return documents;
  }

  for (var index = 0, length = documents.length; index < length; index += 1) {
    iterator(documents[index]);
  }
}


function load(input, options) {
  var documents = loadDocuments(input, options);

  if (documents.length === 0) {
    /*eslint-disable no-undefined*/
    return undefined;
  } else if (documents.length === 1) {
    return documents[0];
  }
  throw new YAMLException('expected a single document in the stream, but found more');
}


function safeLoadAll(input, iterator, options) {
  if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
    options = iterator;
    iterator = null;
  }

  return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
}


function safeLoad(input, options) {
  return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
}


module.exports.loadAll     = loadAll;
module.exports.load        = load;
module.exports.safeLoadAll = safeLoadAll;
module.exports.safeLoad    = safeLoad;


/***/ }),

/***/ 21617:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";



var common = __webpack_require__(19333);


function Mark(name, buffer, position, line, column) {
  this.name     = name;
  this.buffer   = buffer;
  this.position = position;
  this.line     = line;
  this.column   = column;
}


Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
  var head, start, tail, end, snippet;

  if (!this.buffer) return null;

  indent = indent || 4;
  maxLength = maxLength || 75;

  head = '';
  start = this.position;

  while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
    start -= 1;
    if (this.position - start > (maxLength / 2 - 1)) {
      head = ' ... ';
      start += 5;
      break;
    }
  }

  tail = '';
  end = this.position;

  while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
    end += 1;
    if (end - this.position > (maxLength / 2 - 1)) {
      tail = ' ... ';
      end -= 5;
      break;
    }
  }

  snippet = this.buffer.slice(start, end);

  return common.repeat(' ', indent) + head + snippet + tail + '\n' +
         common.repeat(' ', indent + this.position - start + head.length) + '^';
};


Mark.prototype.toString = function toString(compact) {
  var snippet, where = '';

  if (this.name) {
    where += 'in "' + this.name + '" ';
  }

  where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);

  if (!compact) {
    snippet = this.getSnippet();

    if (snippet) {
      where += ':\n' + snippet;
    }
  }

  return where;
};


module.exports = Mark;


/***/ }),

/***/ 92915:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/*eslint-disable max-len*/

var common        = __webpack_require__(19333);
var YAMLException = __webpack_require__(9643);
var Type          = __webpack_require__(26136);


function compileList(schema, name, result) {
  var exclude = [];

  schema.include.forEach(function (includedSchema) {
    result = compileList(includedSchema, name, result);
  });

  schema[name].forEach(function (currentType) {
    result.forEach(function (previousType, previousIndex) {
      if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
        exclude.push(previousIndex);
      }
    });

    result.push(currentType);
  });

  return result.filter(function (type, index) {
    return exclude.indexOf(index) === -1;
  });
}


function compileMap(/* lists... */) {
  var result = {
        scalar: {},
        sequence: {},
        mapping: {},
        fallback: {}
      }, index, length;

  function collectType(type) {
    result[type.kind][type.tag] = result['fallback'][type.tag] = type;
  }

  for (index = 0, length = arguments.length; index < length; index += 1) {
    arguments[index].forEach(collectType);
  }
  return result;
}


function Schema(definition) {
  this.include  = definition.include  || [];
  this.implicit = definition.implicit || [];
  this.explicit = definition.explicit || [];

  this.implicit.forEach(function (type) {
    if (type.loadKind && type.loadKind !== 'scalar') {
      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
    }
  });

  this.compiledImplicit = compileList(this, 'implicit', []);
  this.compiledExplicit = compileList(this, 'explicit', []);
  this.compiledTypeMap  = compileMap(this.compiledImplicit, this.compiledExplicit);
}


Schema.DEFAULT = null;


Schema.create = function createSchema() {
  var schemas, types;

  switch (arguments.length) {
    case 1:
      schemas = Schema.DEFAULT;
      types = arguments[0];
      break;

    case 2:
      schemas = arguments[0];
      types = arguments[1];
      break;

    default:
      throw new YAMLException('Wrong number of arguments for Schema.create function');
  }

  schemas = common.toArray(schemas);
  types = common.toArray(types);

  if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
    throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
  }

  if (!types.every(function (type) { return type instanceof Type; })) {
    throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
  }

  return new Schema({
    include: schemas,
    explicit: types
  });
};


module.exports = Schema;


/***/ }),

/***/ 76421:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
// Standard YAML's Core schema.
// http://www.yaml.org/spec/1.2/spec.html#id2804923
//
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
// So, Core schema has no distinctions from JSON schema is JS-YAML.





var Schema = __webpack_require__(92915);


module.exports = new Schema({
  include: [
    __webpack_require__(33460)
  ]
});


/***/ }),

/***/ 41413:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
// JS-YAML's default schema for `load` function.
// It is not described in the YAML specification.
//
// This schema is based on JS-YAML's default safe schema and includes
// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
//
// Also this schema is used as default base schema at `Schema.create` function.





var Schema = __webpack_require__(92915);


module.exports = Schema.DEFAULT = new Schema({
  include: [
    __webpack_require__(41893)
  ],
  explicit: [
    __webpack_require__(34415),
    __webpack_require__(52578),
    __webpack_require__(33611)
  ]
});


/***/ }),

/***/ 41893:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
// JS-YAML's default schema for `safeLoad` function.
// It is not described in the YAML specification.
//
// This schema is based on standard YAML's Core schema and includes most of
// extra types described at YAML tag repository. (http://yaml.org/type/)





var Schema = __webpack_require__(92915);


module.exports = new Schema({
  include: [
    __webpack_require__(76421)
  ],
  implicit: [
    __webpack_require__(45803),
    __webpack_require__(61327)
  ],
  explicit: [
    __webpack_require__(10898),
    __webpack_require__(89582),
    __webpack_require__(47650),
    __webpack_require__(73707)
  ]
});


/***/ }),

/***/ 29899:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
// Standard YAML's Failsafe schema.
// http://www.yaml.org/spec/1.2/spec.html#id2802346





var Schema = __webpack_require__(92915);


module.exports = new Schema({
  explicit: [
    __webpack_require__(84824),
    __webpack_require__(41816),
    __webpack_require__(95757)
  ]
});


/***/ }),

/***/ 33460:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
// Standard YAML's JSON schema.
// http://www.yaml.org/spec/1.2/spec.html#id2803231
//
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
// So, this schema is not such strict as defined in the YAML specification.
// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.





var Schema = __webpack_require__(92915);


module.exports = new Schema({
  include: [
    __webpack_require__(29899)
  ],
  implicit: [
    __webpack_require__(31930),
    __webpack_require__(54043),
    __webpack_require__(61142),
    __webpack_require__(81289)
  ]
});


/***/ }),

/***/ 26136:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var YAMLException = __webpack_require__(9643);

var TYPE_CONSTRUCTOR_OPTIONS = [
  'kind',
  'resolve',
  'construct',
  'instanceOf',
  'predicate',
  'represent',
  'defaultStyle',
  'styleAliases'
];

var YAML_NODE_KINDS = [
  'scalar',
  'sequence',
  'mapping'
];

function compileStyleAliases(map) {
  var result = {};

  if (map !== null) {
    Object.keys(map).forEach(function (style) {
      map[style].forEach(function (alias) {
        result[String(alias)] = style;
      });
    });
  }

  return result;
}

function Type(tag, options) {
  options = options || {};

  Object.keys(options).forEach(function (name) {
    if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
      throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
    }
  });

  // TODO: Add tag format check.
  this.tag          = tag;
  this.kind         = options['kind']         || null;
  this.resolve      = options['resolve']      || function () { return true; };
  this.construct    = options['construct']    || function (data) { return data; };
  this.instanceOf   = options['instanceOf']   || null;
  this.predicate    = options['predicate']    || null;
  this.represent    = options['represent']    || null;
  this.defaultStyle = options['defaultStyle'] || null;
  this.styleAliases = compileStyleAliases(options['styleAliases'] || null);

  if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
    throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
  }
}

module.exports = Type;


/***/ }),

/***/ 10898:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/*eslint-disable no-bitwise*/

var NodeBuffer;

try {
  // A trick for browserified version, to not include `Buffer` shim
  var _require = undefined;
  NodeBuffer = (__webpack_require__(78378).Buffer);
} catch (__) {}

var Type       = __webpack_require__(26136);


// [ 64, 65, 66 ] -> [ padding, CR, LF ]
var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';


function resolveYamlBinary(data) {
  if (data === null) return false;

  var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;

  // Convert one by one.
  for (idx = 0; idx < max; idx++) {
    code = map.indexOf(data.charAt(idx));

    // Skip CR/LF
    if (code > 64) continue;

    // Fail on illegal characters
    if (code < 0) return false;

    bitlen += 6;
  }

  // If there are any bits left, source was corrupted
  return (bitlen % 8) === 0;
}

function constructYamlBinary(data) {
  var idx, tailbits,
      input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
      max = input.length,
      map = BASE64_MAP,
      bits = 0,
      result = [];

  // Collect by 6*4 bits (3 bytes)

  for (idx = 0; idx < max; idx++) {
    if ((idx % 4 === 0) && idx) {
      result.push((bits >> 16) & 0xFF);
      result.push((bits >> 8) & 0xFF);
      result.push(bits & 0xFF);
    }

    bits = (bits << 6) | map.indexOf(input.charAt(idx));
  }

  // Dump tail

  tailbits = (max % 4) * 6;

  if (tailbits === 0) {
    result.push((bits >> 16) & 0xFF);
    result.push((bits >> 8) & 0xFF);
    result.push(bits & 0xFF);
  } else if (tailbits === 18) {
    result.push((bits >> 10) & 0xFF);
    result.push((bits >> 2) & 0xFF);
  } else if (tailbits === 12) {
    result.push((bits >> 4) & 0xFF);
  }

  // Wrap into Buffer for NodeJS and leave Array for browser
  if (NodeBuffer) {
    // Support node 6.+ Buffer API when available
    return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
  }

  return result;
}

function representYamlBinary(object /*, style*/) {
  var result = '', bits = 0, idx, tail,
      max = object.length,
      map = BASE64_MAP;

  // Convert every three bytes to 4 ASCII characters.

  for (idx = 0; idx < max; idx++) {
    if ((idx % 3 === 0) && idx) {
      result += map[(bits >> 18) & 0x3F];
      result += map[(bits >> 12) & 0x3F];
      result += map[(bits >> 6) & 0x3F];
      result += map[bits & 0x3F];
    }

    bits = (bits << 8) + object[idx];
  }

  // Dump tail

  tail = max % 3;

  if (tail === 0) {
    result += map[(bits >> 18) & 0x3F];
    result += map[(bits >> 12) & 0x3F];
    result += map[(bits >> 6) & 0x3F];
    result += map[bits & 0x3F];
  } else if (tail === 2) {
    result += map[(bits >> 10) & 0x3F];
    result += map[(bits >> 4) & 0x3F];
    result += map[(bits << 2) & 0x3F];
    result += map[64];
  } else if (tail === 1) {
    result += map[(bits >> 2) & 0x3F];
    result += map[(bits << 4) & 0x3F];
    result += map[64];
    result += map[64];
  }

  return result;
}

function isBinary(object) {
  return NodeBuffer && NodeBuffer.isBuffer(object);
}

module.exports = new Type('tag:yaml.org,2002:binary', {
  kind: 'scalar',
  resolve: resolveYamlBinary,
  construct: constructYamlBinary,
  predicate: isBinary,
  represent: representYamlBinary
});


/***/ }),

/***/ 54043:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

function resolveYamlBoolean(data) {
  if (data === null) return false;

  var max = data.length;

  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
}

function constructYamlBoolean(data) {
  return data === 'true' ||
         data === 'True' ||
         data === 'TRUE';
}

function isBoolean(object) {
  return Object.prototype.toString.call(object) === '[object Boolean]';
}

module.exports = new Type('tag:yaml.org,2002:bool', {
  kind: 'scalar',
  resolve: resolveYamlBoolean,
  construct: constructYamlBoolean,
  predicate: isBoolean,
  represent: {
    lowercase: function (object) { return object ? 'true' : 'false'; },
    uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
    camelcase: function (object) { return object ? 'True' : 'False'; }
  },
  defaultStyle: 'lowercase'
});


/***/ }),

/***/ 81289:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var common = __webpack_require__(19333);
var Type   = __webpack_require__(26136);

var YAML_FLOAT_PATTERN = new RegExp(
  // 2.5e4, 2.5 and integers
  '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
  // .2e4, .2
  // special case, seems not from spec
  '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
  // 20:59
  '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
  // .inf
  '|[-+]?\\.(?:inf|Inf|INF)' +
  // .nan
  '|\\.(?:nan|NaN|NAN))$');

function resolveYamlFloat(data) {
  if (data === null) return false;

  if (!YAML_FLOAT_PATTERN.test(data) ||
      // Quick hack to not allow integers end with `_`
      // Probably should update regexp & check speed
      data[data.length - 1] === '_') {
    return false;
  }

  return true;
}

function constructYamlFloat(data) {
  var value, sign, base, digits;

  value  = data.replace(/_/g, '').toLowerCase();
  sign   = value[0] === '-' ? -1 : 1;
  digits = [];

  if ('+-'.indexOf(value[0]) >= 0) {
    value = value.slice(1);
  }

  if (value === '.inf') {
    return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;

  } else if (value === '.nan') {
    return NaN;

  } else if (value.indexOf(':') >= 0) {
    value.split(':').forEach(function (v) {
      digits.unshift(parseFloat(v, 10));
    });

    value = 0.0;
    base = 1;

    digits.forEach(function (d) {
      value += d * base;
      base *= 60;
    });

    return sign * value;

  }
  return sign * parseFloat(value, 10);
}


var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;

function representYamlFloat(object, style) {
  var res;

  if (isNaN(object)) {
    switch (style) {
      case 'lowercase': return '.nan';
      case 'uppercase': return '.NAN';
      case 'camelcase': return '.NaN';
    }
  } else if (Number.POSITIVE_INFINITY === object) {
    switch (style) {
      case 'lowercase': return '.inf';
      case 'uppercase': return '.INF';
      case 'camelcase': return '.Inf';
    }
  } else if (Number.NEGATIVE_INFINITY === object) {
    switch (style) {
      case 'lowercase': return '-.inf';
      case 'uppercase': return '-.INF';
      case 'camelcase': return '-.Inf';
    }
  } else if (common.isNegativeZero(object)) {
    return '-0.0';
  }

  res = object.toString(10);

  // JS stringifier can build scientific format without dots: 5e-100,
  // while YAML requres dot: 5.e-100. Fix it with simple hack

  return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
}

function isFloat(object) {
  return (Object.prototype.toString.call(object) === '[object Number]') &&
         (object % 1 !== 0 || common.isNegativeZero(object));
}

module.exports = new Type('tag:yaml.org,2002:float', {
  kind: 'scalar',
  resolve: resolveYamlFloat,
  construct: constructYamlFloat,
  predicate: isFloat,
  represent: representYamlFloat,
  defaultStyle: 'lowercase'
});


/***/ }),

/***/ 61142:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var common = __webpack_require__(19333);
var Type   = __webpack_require__(26136);

function isHexCode(c) {
  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
         ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
         ((0x61/* a */ <= c) && (c <= 0x66/* f */));
}

function isOctCode(c) {
  return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
}

function isDecCode(c) {
  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
}

function resolveYamlInteger(data) {
  if (data === null) return false;

  var max = data.length,
      index = 0,
      hasDigits = false,
      ch;

  if (!max) return false;

  ch = data[index];

  // sign
  if (ch === '-' || ch === '+') {
    ch = data[++index];
  }

  if (ch === '0') {
    // 0
    if (index + 1 === max) return true;
    ch = data[++index];

    // base 2, base 8, base 16

    if (ch === 'b') {
      // base 2
      index++;

      for (; index < max; index++) {
        ch = data[index];
        if (ch === '_') continue;
        if (ch !== '0' && ch !== '1') return false;
        hasDigits = true;
      }
      return hasDigits && ch !== '_';
    }


    if (ch === 'x') {
      // base 16
      index++;

      for (; index < max; index++) {
        ch = data[index];
        if (ch === '_') continue;
        if (!isHexCode(data.charCodeAt(index))) return false;
        hasDigits = true;
      }
      return hasDigits && ch !== '_';
    }

    // base 8
    for (; index < max; index++) {
      ch = data[index];
      if (ch === '_') continue;
      if (!isOctCode(data.charCodeAt(index))) return false;
      hasDigits = true;
    }
    return hasDigits && ch !== '_';
  }

  // base 10 (except 0) or base 60

  // value should not start with `_`;
  if (ch === '_') return false;

  for (; index < max; index++) {
    ch = data[index];
    if (ch === '_') continue;
    if (ch === ':') break;
    if (!isDecCode(data.charCodeAt(index))) {
      return false;
    }
    hasDigits = true;
  }

  // Should have digits and should not end with `_`
  if (!hasDigits || ch === '_') return false;

  // if !base60 - done;
  if (ch !== ':') return true;

  // base60 almost not used, no needs to optimize
  return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
}

function constructYamlInteger(data) {
  var value = data, sign = 1, ch, base, digits = [];

  if (value.indexOf('_') !== -1) {
    value = value.replace(/_/g, '');
  }

  ch = value[0];

  if (ch === '-' || ch === '+') {
    if (ch === '-') sign = -1;
    value = value.slice(1);
    ch = value[0];
  }

  if (value === '0') return 0;

  if (ch === '0') {
    if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
    if (value[1] === 'x') return sign * parseInt(value, 16);
    return sign * parseInt(value, 8);
  }

  if (value.indexOf(':') !== -1) {
    value.split(':').forEach(function (v) {
      digits.unshift(parseInt(v, 10));
    });

    value = 0;
    base = 1;

    digits.forEach(function (d) {
      value += (d * base);
      base *= 60;
    });

    return sign * value;

  }

  return sign * parseInt(value, 10);
}

function isInteger(object) {
  return (Object.prototype.toString.call(object)) === '[object Number]' &&
         (object % 1 === 0 && !common.isNegativeZero(object));
}

module.exports = new Type('tag:yaml.org,2002:int', {
  kind: 'scalar',
  resolve: resolveYamlInteger,
  construct: constructYamlInteger,
  predicate: isInteger,
  represent: {
    binary:      function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
    octal:       function (obj) { return obj >= 0 ? '0'  + obj.toString(8) : '-0'  + obj.toString(8).slice(1); },
    decimal:     function (obj) { return obj.toString(10); },
    /* eslint-disable max-len */
    hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() :  '-0x' + obj.toString(16).toUpperCase().slice(1); }
  },
  defaultStyle: 'decimal',
  styleAliases: {
    binary:      [ 2,  'bin' ],
    octal:       [ 8,  'oct' ],
    decimal:     [ 10, 'dec' ],
    hexadecimal: [ 16, 'hex' ]
  }
});


/***/ }),

/***/ 33611:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var esprima;

// Browserified version does not have esprima
//
// 1. For node.js just require module as deps
// 2. For browser try to require mudule via external AMD system.
//    If not found - try to fallback to window.esprima. If not
//    found too - then fail to parse.
//
try {
  // workaround to exclude package from browserify list.
  var _require = undefined;
  esprima = __webpack_require__(50608);
} catch (_) {
  /* eslint-disable no-redeclare */
  /* global window */
  if (typeof window !== 'undefined') esprima = window.esprima;
}

var Type = __webpack_require__(26136);

function resolveJavascriptFunction(data) {
  if (data === null) return false;

  try {
    var source = '(' + data + ')',
        ast    = esprima.parse(source, { range: true });

    if (ast.type                    !== 'Program'             ||
        ast.body.length             !== 1                     ||
        ast.body[0].type            !== 'ExpressionStatement' ||
        (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
          ast.body[0].expression.type !== 'FunctionExpression')) {
      return false;
    }

    return true;
  } catch (err) {
    return false;
  }
}

function constructJavascriptFunction(data) {
  /*jslint evil:true*/

  var source = '(' + data + ')',
      ast    = esprima.parse(source, { range: true }),
      params = [],
      body;

  if (ast.type                    !== 'Program'             ||
      ast.body.length             !== 1                     ||
      ast.body[0].type            !== 'ExpressionStatement' ||
      (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
        ast.body[0].expression.type !== 'FunctionExpression')) {
    throw new Error('Failed to resolve function');
  }

  ast.body[0].expression.params.forEach(function (param) {
    params.push(param.name);
  });

  body = ast.body[0].expression.body.range;

  // Esprima's ranges include the first '{' and the last '}' characters on
  // function expressions. So cut them out.
  if (ast.body[0].expression.body.type === 'BlockStatement') {
    /*eslint-disable no-new-func*/
    return new Function(params, source.slice(body[0] + 1, body[1] - 1));
  }
  // ES6 arrow functions can omit the BlockStatement. In that case, just return
  // the body.
  /*eslint-disable no-new-func*/
  return new Function(params, 'return ' + source.slice(body[0], body[1]));
}

function representJavascriptFunction(object /*, style*/) {
  return object.toString();
}

function isFunction(object) {
  return Object.prototype.toString.call(object) === '[object Function]';
}

module.exports = new Type('tag:yaml.org,2002:js/function', {
  kind: 'scalar',
  resolve: resolveJavascriptFunction,
  construct: constructJavascriptFunction,
  predicate: isFunction,
  represent: representJavascriptFunction
});


/***/ }),

/***/ 52578:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

function resolveJavascriptRegExp(data) {
  if (data === null) return false;
  if (data.length === 0) return false;

  var regexp = data,
      tail   = /\/([gim]*)$/.exec(data),
      modifiers = '';

  // if regexp starts with '/' it can have modifiers and must be properly closed
  // `/foo/gim` - modifiers tail can be maximum 3 chars
  if (regexp[0] === '/') {
    if (tail) modifiers = tail[1];

    if (modifiers.length > 3) return false;
    // if expression starts with /, is should be properly terminated
    if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
  }

  return true;
}

function constructJavascriptRegExp(data) {
  var regexp = data,
      tail   = /\/([gim]*)$/.exec(data),
      modifiers = '';

  // `/foo/gim` - tail can be maximum 4 chars
  if (regexp[0] === '/') {
    if (tail) modifiers = tail[1];
    regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
  }

  return new RegExp(regexp, modifiers);
}

function representJavascriptRegExp(object /*, style*/) {
  var result = '/' + object.source + '/';

  if (object.global) result += 'g';
  if (object.multiline) result += 'm';
  if (object.ignoreCase) result += 'i';

  return result;
}

function isRegExp(object) {
  return Object.prototype.toString.call(object) === '[object RegExp]';
}

module.exports = new Type('tag:yaml.org,2002:js/regexp', {
  kind: 'scalar',
  resolve: resolveJavascriptRegExp,
  construct: constructJavascriptRegExp,
  predicate: isRegExp,
  represent: representJavascriptRegExp
});


/***/ }),

/***/ 34415:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

function resolveJavascriptUndefined() {
  return true;
}

function constructJavascriptUndefined() {
  /*eslint-disable no-undefined*/
  return undefined;
}

function representJavascriptUndefined() {
  return '';
}

function isUndefined(object) {
  return typeof object === 'undefined';
}

module.exports = new Type('tag:yaml.org,2002:js/undefined', {
  kind: 'scalar',
  resolve: resolveJavascriptUndefined,
  construct: constructJavascriptUndefined,
  predicate: isUndefined,
  represent: representJavascriptUndefined
});


/***/ }),

/***/ 95757:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

module.exports = new Type('tag:yaml.org,2002:map', {
  kind: 'mapping',
  construct: function (data) { return data !== null ? data : {}; }
});


/***/ }),

/***/ 61327:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

function resolveYamlMerge(data) {
  return data === '<<' || data === null;
}

module.exports = new Type('tag:yaml.org,2002:merge', {
  kind: 'scalar',
  resolve: resolveYamlMerge
});


/***/ }),

/***/ 31930:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

function resolveYamlNull(data) {
  if (data === null) return true;

  var max = data.length;

  return (max === 1 && data === '~') ||
         (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
}

function constructYamlNull() {
  return null;
}

function isNull(object) {
  return object === null;
}

module.exports = new Type('tag:yaml.org,2002:null', {
  kind: 'scalar',
  resolve: resolveYamlNull,
  construct: constructYamlNull,
  predicate: isNull,
  represent: {
    canonical: function () { return '~';    },
    lowercase: function () { return 'null'; },
    uppercase: function () { return 'NULL'; },
    camelcase: function () { return 'Null'; }
  },
  defaultStyle: 'lowercase'
});


/***/ }),

/***/ 89582:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

var _hasOwnProperty = Object.prototype.hasOwnProperty;
var _toString       = Object.prototype.toString;

function resolveYamlOmap(data) {
  if (data === null) return true;

  var objectKeys = [], index, length, pair, pairKey, pairHasKey,
      object = data;

  for (index = 0, length = object.length; index < length; index += 1) {
    pair = object[index];
    pairHasKey = false;

    if (_toString.call(pair) !== '[object Object]') return false;

    for (pairKey in pair) {
      if (_hasOwnProperty.call(pair, pairKey)) {
        if (!pairHasKey) pairHasKey = true;
        else return false;
      }
    }

    if (!pairHasKey) return false;

    if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
    else return false;
  }

  return true;
}

function constructYamlOmap(data) {
  return data !== null ? data : [];
}

module.exports = new Type('tag:yaml.org,2002:omap', {
  kind: 'sequence',
  resolve: resolveYamlOmap,
  construct: constructYamlOmap
});


/***/ }),

/***/ 47650:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

var _toString = Object.prototype.toString;

function resolveYamlPairs(data) {
  if (data === null) return true;

  var index, length, pair, keys, result,
      object = data;

  result = new Array(object.length);

  for (index = 0, length = object.length; index < length; index += 1) {
    pair = object[index];

    if (_toString.call(pair) !== '[object Object]') return false;

    keys = Object.keys(pair);

    if (keys.length !== 1) return false;

    result[index] = [ keys[0], pair[keys[0]] ];
  }

  return true;
}

function constructYamlPairs(data) {
  if (data === null) return [];

  var index, length, pair, keys, result,
      object = data;

  result = new Array(object.length);

  for (index = 0, length = object.length; index < length; index += 1) {
    pair = object[index];

    keys = Object.keys(pair);

    result[index] = [ keys[0], pair[keys[0]] ];
  }

  return result;
}

module.exports = new Type('tag:yaml.org,2002:pairs', {
  kind: 'sequence',
  resolve: resolveYamlPairs,
  construct: constructYamlPairs
});


/***/ }),

/***/ 41816:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

module.exports = new Type('tag:yaml.org,2002:seq', {
  kind: 'sequence',
  construct: function (data) { return data !== null ? data : []; }
});


/***/ }),

/***/ 73707:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

var _hasOwnProperty = Object.prototype.hasOwnProperty;

function resolveYamlSet(data) {
  if (data === null) return true;

  var key, object = data;

  for (key in object) {
    if (_hasOwnProperty.call(object, key)) {
      if (object[key] !== null) return false;
    }
  }

  return true;
}

function constructYamlSet(data) {
  return data !== null ? data : {};
}

module.exports = new Type('tag:yaml.org,2002:set', {
  kind: 'mapping',
  resolve: resolveYamlSet,
  construct: constructYamlSet
});


/***/ }),

/***/ 84824:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

module.exports = new Type('tag:yaml.org,2002:str', {
  kind: 'scalar',
  construct: function (data) { return data !== null ? data : ''; }
});


/***/ }),

/***/ 45803:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var Type = __webpack_require__(26136);

var YAML_DATE_REGEXP = new RegExp(
  '^([0-9][0-9][0-9][0-9])'          + // [1] year
  '-([0-9][0-9])'                    + // [2] month
  '-([0-9][0-9])$');                   // [3] day

var YAML_TIMESTAMP_REGEXP = new RegExp(
  '^([0-9][0-9][0-9][0-9])'          + // [1] year
  '-([0-9][0-9]?)'                   + // [2] month
  '-([0-9][0-9]?)'                   + // [3] day
  '(?:[Tt]|[ \\t]+)'                 + // ...
  '([0-9][0-9]?)'                    + // [4] hour
  ':([0-9][0-9])'                    + // [5] minute
  ':([0-9][0-9])'                    + // [6] second
  '(?:\\.([0-9]*))?'                 + // [7] fraction
  '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
  '(?::([0-9][0-9]))?))?$');           // [11] tz_minute

function resolveYamlTimestamp(data) {
  if (data === null) return false;
  if (YAML_DATE_REGEXP.exec(data) !== null) return true;
  if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
  return false;
}

function constructYamlTimestamp(data) {
  var match, year, month, day, hour, minute, second, fraction = 0,
      delta = null, tz_hour, tz_minute, date;

  match = YAML_DATE_REGEXP.exec(data);
  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);

  if (match === null) throw new Error('Date resolve error');

  // match: [1] year [2] month [3] day

  year = +(match[1]);
  month = +(match[2]) - 1; // JS month starts with 0
  day = +(match[3]);

  if (!match[4]) { // no hour
    return new Date(Date.UTC(year, month, day));
  }

  // match: [4] hour [5] minute [6] second [7] fraction

  hour = +(match[4]);
  minute = +(match[5]);
  second = +(match[6]);

  if (match[7]) {
    fraction = match[7].slice(0, 3);
    while (fraction.length < 3) { // milli-seconds
      fraction += '0';
    }
    fraction = +fraction;
  }

  // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute

  if (match[9]) {
    tz_hour = +(match[10]);
    tz_minute = +(match[11] || 0);
    delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
    if (match[9] === '-') delta = -delta;
  }

  date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));

  if (delta) date.setTime(date.getTime() - delta);

  return date;
}

function representYamlTimestamp(object /*, style*/) {
  return object.toISOString();
}

module.exports = new Type('tag:yaml.org,2002:timestamp', {
  kind: 'scalar',
  resolve: resolveYamlTimestamp,
  construct: constructYamlTimestamp,
  instanceOf: Date,
  represent: representYamlTimestamp
});


/***/ }),

/***/ 7967:
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
		__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
		(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else { var mod; }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (module) {
  /* webextension-polyfill - v0.12.0 - Tue May 14 2024 18:01:29 */
  /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
  /* vim: set sts=2 sw=2 et tw=80: */
  /* This Source Code Form is subject to the terms of the Mozilla Public
   * License, v. 2.0. If a copy of the MPL was not distributed with this
   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  "use strict";

  if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id)) {
    throw new Error("This script should only be loaded in a browser extension.");
  }
  if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
    const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received.";

    // Wrapping the bulk of this polyfill in a one-time-use function is a minor
    // optimization for Firefox. Since Spidermonkey does not fully parse the
    // contents of a function until the first time it's called, and since it will
    // never actually need to be called, this allows the polyfill to be included
    // in Firefox nearly for free.
    const wrapAPIs = extensionAPIs => {
      // NOTE: apiMetadata is associated to the content of the api-metadata.json file
      // at build time by replacing the following "include" with the content of the
      // JSON file.
      const apiMetadata = {
        "alarms": {
          "clear": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "clearAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "get": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "bookmarks": {
          "create": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getChildren": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getRecent": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getSubTree": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTree": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "move": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeTree": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "browserAction": {
          "disable": {
            "minArgs": 0,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "enable": {
            "minArgs": 0,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "getBadgeBackgroundColor": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getBadgeText": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getPopup": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTitle": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "openPopup": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "setBadgeBackgroundColor": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setBadgeText": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setIcon": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "setPopup": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setTitle": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "browsingData": {
          "remove": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "removeCache": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeCookies": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeDownloads": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeFormData": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeHistory": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeLocalStorage": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removePasswords": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removePluginData": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "settings": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "commands": {
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "contextMenus": {
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "cookies": {
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAllCookieStores": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "set": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "devtools": {
          "inspectedWindow": {
            "eval": {
              "minArgs": 1,
              "maxArgs": 2,
              "singleCallbackArg": false
            }
          },
          "panels": {
            "create": {
              "minArgs": 3,
              "maxArgs": 3,
              "singleCallbackArg": true
            },
            "elements": {
              "createSidebarPane": {
                "minArgs": 1,
                "maxArgs": 1
              }
            }
          }
        },
        "downloads": {
          "cancel": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "download": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "erase": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getFileIcon": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "open": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "pause": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeFile": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "resume": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "show": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "extension": {
          "isAllowedFileSchemeAccess": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "isAllowedIncognitoAccess": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "history": {
          "addUrl": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "deleteAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "deleteRange": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "deleteUrl": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getVisits": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "i18n": {
          "detectLanguage": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAcceptLanguages": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "identity": {
          "launchWebAuthFlow": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "idle": {
          "queryState": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "management": {
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getSelf": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "setEnabled": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "uninstallSelf": {
            "minArgs": 0,
            "maxArgs": 1
          }
        },
        "notifications": {
          "clear": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "create": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getPermissionLevel": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "pageAction": {
          "getPopup": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTitle": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "hide": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setIcon": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "setPopup": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setTitle": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "show": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "permissions": {
          "contains": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "request": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "runtime": {
          "getBackgroundPage": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getPlatformInfo": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "openOptionsPage": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "requestUpdateCheck": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "sendMessage": {
            "minArgs": 1,
            "maxArgs": 3
          },
          "sendNativeMessage": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "setUninstallURL": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "sessions": {
          "getDevices": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getRecentlyClosed": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "restore": {
            "minArgs": 0,
            "maxArgs": 1
          }
        },
        "storage": {
          "local": {
            "clear": {
              "minArgs": 0,
              "maxArgs": 0
            },
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "remove": {
              "minArgs": 1,
              "maxArgs": 1
            },
            "set": {
              "minArgs": 1,
              "maxArgs": 1
            }
          },
          "managed": {
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            }
          },
          "sync": {
            "clear": {
              "minArgs": 0,
              "maxArgs": 0
            },
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "remove": {
              "minArgs": 1,
              "maxArgs": 1
            },
            "set": {
              "minArgs": 1,
              "maxArgs": 1
            }
          }
        },
        "tabs": {
          "captureVisibleTab": {
            "minArgs": 0,
            "maxArgs": 2
          },
          "create": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "detectLanguage": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "discard": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "duplicate": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "executeScript": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getCurrent": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getZoom": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getZoomSettings": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "goBack": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "goForward": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "highlight": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "insertCSS": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "move": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "query": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "reload": {
            "minArgs": 0,
            "maxArgs": 2
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeCSS": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "sendMessage": {
            "minArgs": 2,
            "maxArgs": 3
          },
          "setZoom": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "setZoomSettings": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "update": {
            "minArgs": 1,
            "maxArgs": 2
          }
        },
        "topSites": {
          "get": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "webNavigation": {
          "getAllFrames": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getFrame": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "webRequest": {
          "handlerBehaviorChanged": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "windows": {
          "create": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getCurrent": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getLastFocused": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        }
      };
      if (Object.keys(apiMetadata).length === 0) {
        throw new Error("api-metadata.json has not been included in browser-polyfill");
      }

      /**
       * A WeakMap subclass which creates and stores a value for any key which does
       * not exist when accessed, but behaves exactly as an ordinary WeakMap
       * otherwise.
       *
       * @param {function} createItem
       *        A function which will be called in order to create the value for any
       *        key which does not exist, the first time it is accessed. The
       *        function receives, as its only argument, the key being created.
       */
      class DefaultWeakMap extends WeakMap {
        constructor(createItem, items = undefined) {
          super(items);
          this.createItem = createItem;
        }
        get(key) {
          if (!this.has(key)) {
            this.set(key, this.createItem(key));
          }
          return super.get(key);
        }
      }

      /**
       * Returns true if the given object is an object with a `then` method, and can
       * therefore be assumed to behave as a Promise.
       *
       * @param {*} value The value to test.
       * @returns {boolean} True if the value is thenable.
       */
      const isThenable = value => {
        return value && typeof value === "object" && typeof value.then === "function";
      };

      /**
       * Creates and returns a function which, when called, will resolve or reject
       * the given promise based on how it is called:
       *
       * - If, when called, `chrome.runtime.lastError` contains a non-null object,
       *   the promise is rejected with that value.
       * - If the function is called with exactly one argument, the promise is
       *   resolved to that value.
       * - Otherwise, the promise is resolved to an array containing all of the
       *   function's arguments.
       *
       * @param {object} promise
       *        An object containing the resolution and rejection functions of a
       *        promise.
       * @param {function} promise.resolve
       *        The promise's resolution function.
       * @param {function} promise.reject
       *        The promise's rejection function.
       * @param {object} metadata
       *        Metadata about the wrapped method which has created the callback.
       * @param {boolean} metadata.singleCallbackArg
       *        Whether or not the promise is resolved with only the first
       *        argument of the callback, alternatively an array of all the
       *        callback arguments is resolved. By default, if the callback
       *        function is invoked with only a single argument, that will be
       *        resolved to the promise, while all arguments will be resolved as
       *        an array if multiple are given.
       *
       * @returns {function}
       *        The generated callback function.
       */
      const makeCallback = (promise, metadata) => {
        return (...callbackArgs) => {
          if (extensionAPIs.runtime.lastError) {
            promise.reject(new Error(extensionAPIs.runtime.lastError.message));
          } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) {
            promise.resolve(callbackArgs[0]);
          } else {
            promise.resolve(callbackArgs);
          }
        };
      };
      const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments";

      /**
       * Creates a wrapper function for a method with the given name and metadata.
       *
       * @param {string} name
       *        The name of the method which is being wrapped.
       * @param {object} metadata
       *        Metadata about the method being wrapped.
       * @param {integer} metadata.minArgs
       *        The minimum number of arguments which must be passed to the
       *        function. If called with fewer than this number of arguments, the
       *        wrapper will raise an exception.
       * @param {integer} metadata.maxArgs
       *        The maximum number of arguments which may be passed to the
       *        function. If called with more than this number of arguments, the
       *        wrapper will raise an exception.
       * @param {boolean} metadata.singleCallbackArg
       *        Whether or not the promise is resolved with only the first
       *        argument of the callback, alternatively an array of all the
       *        callback arguments is resolved. By default, if the callback
       *        function is invoked with only a single argument, that will be
       *        resolved to the promise, while all arguments will be resolved as
       *        an array if multiple are given.
       *
       * @returns {function(object, ...*)}
       *       The generated wrapper function.
       */
      const wrapAsyncFunction = (name, metadata) => {
        return function asyncFunctionWrapper(target, ...args) {
          if (args.length < metadata.minArgs) {
            throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
          }
          if (args.length > metadata.maxArgs) {
            throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
          }
          return new Promise((resolve, reject) => {
            if (metadata.fallbackToNoCallback) {
              // This API method has currently no callback on Chrome, but it return a promise on Firefox,
              // and so the polyfill will try to call it with a callback first, and it will fallback
              // to not passing the callback if the first call fails.
              try {
                target[name](...args, makeCallback({
                  resolve,
                  reject
                }, metadata));
              } catch (cbError) {
                console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError);
                target[name](...args);

                // Update the API method metadata, so that the next API calls will not try to
                // use the unsupported callback anymore.
                metadata.fallbackToNoCallback = false;
                metadata.noCallback = true;
                resolve();
              }
            } else if (metadata.noCallback) {
              target[name](...args);
              resolve();
            } else {
              target[name](...args, makeCallback({
                resolve,
                reject
              }, metadata));
            }
          });
        };
      };

      /**
       * Wraps an existing method of the target object, so that calls to it are
       * intercepted by the given wrapper function. The wrapper function receives,
       * as its first argument, the original `target` object, followed by each of
       * the arguments passed to the original method.
       *
       * @param {object} target
       *        The original target object that the wrapped method belongs to.
       * @param {function} method
       *        The method being wrapped. This is used as the target of the Proxy
       *        object which is created to wrap the method.
       * @param {function} wrapper
       *        The wrapper function which is called in place of a direct invocation
       *        of the wrapped method.
       *
       * @returns {Proxy<function>}
       *        A Proxy object for the given method, which invokes the given wrapper
       *        method in its place.
       */
      const wrapMethod = (target, method, wrapper) => {
        return new Proxy(method, {
          apply(targetMethod, thisObj, args) {
            return wrapper.call(thisObj, target, ...args);
          }
        });
      };
      let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);

      /**
       * Wraps an object in a Proxy which intercepts and wraps certain methods
       * based on the given `wrappers` and `metadata` objects.
       *
       * @param {object} target
       *        The target object to wrap.
       *
       * @param {object} [wrappers = {}]
       *        An object tree containing wrapper functions for special cases. Any
       *        function present in this object tree is called in place of the
       *        method in the same location in the `target` object tree. These
       *        wrapper methods are invoked as described in {@see wrapMethod}.
       *
       * @param {object} [metadata = {}]
       *        An object tree containing metadata used to automatically generate
       *        Promise-based wrapper functions for asynchronous. Any function in
       *        the `target` object tree which has a corresponding metadata object
       *        in the same location in the `metadata` tree is replaced with an
       *        automatically-generated wrapper function, as described in
       *        {@see wrapAsyncFunction}
       *
       * @returns {Proxy<object>}
       */
      const wrapObject = (target, wrappers = {}, metadata = {}) => {
        let cache = Object.create(null);
        let handlers = {
          has(proxyTarget, prop) {
            return prop in target || prop in cache;
          },
          get(proxyTarget, prop, receiver) {
            if (prop in cache) {
              return cache[prop];
            }
            if (!(prop in target)) {
              return undefined;
            }
            let value = target[prop];
            if (typeof value === "function") {
              // This is a method on the underlying object. Check if we need to do
              // any wrapping.

              if (typeof wrappers[prop] === "function") {
                // We have a special-case wrapper for this method.
                value = wrapMethod(target, target[prop], wrappers[prop]);
              } else if (hasOwnProperty(metadata, prop)) {
                // This is an async method that we have metadata for. Create a
                // Promise wrapper for it.
                let wrapper = wrapAsyncFunction(prop, metadata[prop]);
                value = wrapMethod(target, target[prop], wrapper);
              } else {
                // This is a method that we don't know or care about. Return the
                // original method, bound to the underlying object.
                value = value.bind(target);
              }
            } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) {
              // This is an object that we need to do some wrapping for the children
              // of. Create a sub-object wrapper for it with the appropriate child
              // metadata.
              value = wrapObject(value, wrappers[prop], metadata[prop]);
            } else if (hasOwnProperty(metadata, "*")) {
              // Wrap all properties in * namespace.
              value = wrapObject(value, wrappers[prop], metadata["*"]);
            } else {
              // We don't need to do any wrapping for this property,
              // so just forward all access to the underlying object.
              Object.defineProperty(cache, prop, {
                configurable: true,
                enumerable: true,
                get() {
                  return target[prop];
                },
                set(value) {
                  target[prop] = value;
                }
              });
              return value;
            }
            cache[prop] = value;
            return value;
          },
          set(proxyTarget, prop, value, receiver) {
            if (prop in cache) {
              cache[prop] = value;
            } else {
              target[prop] = value;
            }
            return true;
          },
          defineProperty(proxyTarget, prop, desc) {
            return Reflect.defineProperty(cache, prop, desc);
          },
          deleteProperty(proxyTarget, prop) {
            return Reflect.deleteProperty(cache, prop);
          }
        };

        // Per contract of the Proxy API, the "get" proxy handler must return the
        // original value of the target if that value is declared read-only and
        // non-configurable. For this reason, we create an object with the
        // prototype set to `target` instead of using `target` directly.
        // Otherwise we cannot return a custom object for APIs that
        // are declared read-only and non-configurable, such as `chrome.devtools`.
        //
        // The proxy handlers themselves will still use the original `target`
        // instead of the `proxyTarget`, so that the methods and properties are
        // dereferenced via the original targets.
        let proxyTarget = Object.create(target);
        return new Proxy(proxyTarget, handlers);
      };

      /**
       * Creates a set of wrapper functions for an event object, which handles
       * wrapping of listener functions that those messages are passed.
       *
       * A single wrapper is created for each listener function, and stored in a
       * map. Subsequent calls to `addListener`, `hasListener`, or `removeListener`
       * retrieve the original wrapper, so that  attempts to remove a
       * previously-added listener work as expected.
       *
       * @param {DefaultWeakMap<function, function>} wrapperMap
       *        A DefaultWeakMap object which will create the appropriate wrapper
       *        for a given listener function when one does not exist, and retrieve
       *        an existing one when it does.
       *
       * @returns {object}
       */
      const wrapEvent = wrapperMap => ({
        addListener(target, listener, ...args) {
          target.addListener(wrapperMap.get(listener), ...args);
        },
        hasListener(target, listener) {
          return target.hasListener(wrapperMap.get(listener));
        },
        removeListener(target, listener) {
          target.removeListener(wrapperMap.get(listener));
        }
      });
      const onRequestFinishedWrappers = new DefaultWeakMap(listener => {
        if (typeof listener !== "function") {
          return listener;
        }

        /**
         * Wraps an onRequestFinished listener function so that it will return a
         * `getContent()` property which returns a `Promise` rather than using a
         * callback API.
         *
         * @param {object} req
         *        The HAR entry object representing the network request.
         */
        return function onRequestFinished(req) {
          const wrappedReq = wrapObject(req, {} /* wrappers */, {
            getContent: {
              minArgs: 0,
              maxArgs: 0
            }
          });
          listener(wrappedReq);
        };
      });
      const onMessageWrappers = new DefaultWeakMap(listener => {
        if (typeof listener !== "function") {
          return listener;
        }

        /**
         * Wraps a message listener function so that it may send responses based on
         * its return value, rather than by returning a sentinel value and calling a
         * callback. If the listener function returns a Promise, the response is
         * sent when the promise either resolves or rejects.
         *
         * @param {*} message
         *        The message sent by the other end of the channel.
         * @param {object} sender
         *        Details about the sender of the message.
         * @param {function(*)} sendResponse
         *        A callback which, when called with an arbitrary argument, sends
         *        that value as a response.
         * @returns {boolean}
         *        True if the wrapped listener returned a Promise, which will later
         *        yield a response. False otherwise.
         */
        return function onMessage(message, sender, sendResponse) {
          let didCallSendResponse = false;
          let wrappedSendResponse;
          let sendResponsePromise = new Promise(resolve => {
            wrappedSendResponse = function (response) {
              didCallSendResponse = true;
              resolve(response);
            };
          });
          let result;
          try {
            result = listener(message, sender, wrappedSendResponse);
          } catch (err) {
            result = Promise.reject(err);
          }
          const isResultThenable = result !== true && isThenable(result);

          // If the listener didn't returned true or a Promise, or called
          // wrappedSendResponse synchronously, we can exit earlier
          // because there will be no response sent from this listener.
          if (result !== true && !isResultThenable && !didCallSendResponse) {
            return false;
          }

          // A small helper to send the message if the promise resolves
          // and an error if the promise rejects (a wrapped sendMessage has
          // to translate the message into a resolved promise or a rejected
          // promise).
          const sendPromisedResult = promise => {
            promise.then(msg => {
              // send the message value.
              sendResponse(msg);
            }, error => {
              // Send a JSON representation of the error if the rejected value
              // is an instance of error, or the object itself otherwise.
              let message;
              if (error && (error instanceof Error || typeof error.message === "string")) {
                message = error.message;
              } else {
                message = "An unexpected error occurred";
              }
              sendResponse({
                __mozWebExtensionPolyfillReject__: true,
                message
              });
            }).catch(err => {
              // Print an error on the console if unable to send the response.
              console.error("Failed to send onMessage rejected reply", err);
            });
          };

          // If the listener returned a Promise, send the resolved value as a
          // result, otherwise wait the promise related to the wrappedSendResponse
          // callback to resolve and send it as a response.
          if (isResultThenable) {
            sendPromisedResult(result);
          } else {
            sendPromisedResult(sendResponsePromise);
          }

          // Let Chrome know that the listener is replying.
          return true;
        };
      });
      const wrappedSendMessageCallback = ({
        reject,
        resolve
      }, reply) => {
        if (extensionAPIs.runtime.lastError) {
          // Detect when none of the listeners replied to the sendMessage call and resolve
          // the promise to undefined as in Firefox.
          // See https://github.com/mozilla/webextension-polyfill/issues/130
          if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) {
            resolve();
          } else {
            reject(new Error(extensionAPIs.runtime.lastError.message));
          }
        } else if (reply && reply.__mozWebExtensionPolyfillReject__) {
          // Convert back the JSON representation of the error into
          // an Error instance.
          reject(new Error(reply.message));
        } else {
          resolve(reply);
        }
      };
      const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => {
        if (args.length < metadata.minArgs) {
          throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
        }
        if (args.length > metadata.maxArgs) {
          throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
        }
        return new Promise((resolve, reject) => {
          const wrappedCb = wrappedSendMessageCallback.bind(null, {
            resolve,
            reject
          });
          args.push(wrappedCb);
          apiNamespaceObj.sendMessage(...args);
        });
      };
      const staticWrappers = {
        devtools: {
          network: {
            onRequestFinished: wrapEvent(onRequestFinishedWrappers)
          }
        },
        runtime: {
          onMessage: wrapEvent(onMessageWrappers),
          onMessageExternal: wrapEvent(onMessageWrappers),
          sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
            minArgs: 1,
            maxArgs: 3
          })
        },
        tabs: {
          sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
            minArgs: 2,
            maxArgs: 3
          })
        }
      };
      const settingMetadata = {
        clear: {
          minArgs: 1,
          maxArgs: 1
        },
        get: {
          minArgs: 1,
          maxArgs: 1
        },
        set: {
          minArgs: 1,
          maxArgs: 1
        }
      };
      apiMetadata.privacy = {
        network: {
          "*": settingMetadata
        },
        services: {
          "*": settingMetadata
        },
        websites: {
          "*": settingMetadata
        }
      };
      return wrapObject(extensionAPIs, staticWrappers, apiMetadata);
    };

    // The build process adds a UMD wrapper around this file, which makes the
    // `module` variable available.
    module.exports = wrapAPIs(chrome);
  } else {
    module.exports = globalThis.browser;
  }
});


/***/ }),

/***/ 38200:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ LogLevel),
/* harmony export */   V: () => (/* binding */ Logger)
/* harmony export */ });
/**
 * Checks if error has message.
 *
 * @param error Error object.
 * @returns True if error has message.
 */
function isErrorWithMessage(error) {
    return (typeof error === 'object'
        && error !== null
        && 'message' in error
        && typeof error.message === 'string');
}
/**
 * Converts error to the error with a message.
 *
 * @param maybeError Possible error.
 * @returns Error with a message.
 */
function toErrorWithMessage(maybeError) {
    if (isErrorWithMessage(maybeError)) {
        return maybeError;
    }
    try {
        return new Error(JSON.stringify(maybeError));
    }
    catch {
        // fallback in case there's an error stringifying the maybeError
        // like with circular references, for example.
        return new Error(String(maybeError));
    }
}
/**
 * Converts an error object to an error with a message. This method might be helpful to handle thrown errors.
 *
 * @param error Error object.
 *
 * @returns Message of the error.
 */
function getErrorMessage(error) {
    return toErrorWithMessage(error).message;
}

/**
 * Pads a number with leading zeros.
 * @param num The number to pad.
 * @param size The number of digits to pad to.
 * @returns The padded number.
 */
const pad = (num, size = 2) => {
    return num.toString().padStart(size, '0');
};
/**
 * Formats a date into an ISO 8601-like string with milliseconds.
 *
 * @param {Date|number} date The date object or timestamp to format.
 * @returns {string} The formatted date string.
 */
const formatTime = (date) => {
    const d = (date instanceof Date) ? date : new Date(date);
    const year = d.getFullYear();
    const month = pad(d.getMonth() + 1); // Months are 0-based
    const day = pad(d.getDate());
    const hour = pad(d.getHours());
    const minute = pad(d.getMinutes());
    const second = pad(d.getSeconds());
    const millisecond = pad(d.getMilliseconds(), 3); // Milliseconds are 3 digits
    return `${year}-${month}-${day}T${hour}:${minute}:${second}:${millisecond}`;
};

/**
 * String presentation of log levels, for convenient users usage.
 */
var LogLevel;
(function (LogLevel) {
    LogLevel["Error"] = "error";
    LogLevel["Warn"] = "warn";
    LogLevel["Info"] = "info";
    LogLevel["Debug"] = "debug";
    LogLevel["Trace"] = "trace";
})(LogLevel || (LogLevel = {}));
/**
 * Log levels map, which maps number level to string level.
 */
const levelMapNumToString = {
    [1 /* LogLevelNumeric.Error */]: LogLevel.Error,
    [2 /* LogLevelNumeric.Warn */]: LogLevel.Warn,
    [3 /* LogLevelNumeric.Info */]: LogLevel.Info,
    [4 /* LogLevelNumeric.Debug */]: LogLevel.Debug,
    [5 /* LogLevelNumeric.Trace */]: LogLevel.Trace,
};
/**
 * Log levels map, which maps string level to number level.
 */
const levelMapStringToNum = Object.entries(levelMapNumToString)
    .reduce((acc, [key, value]) => {
    // Here, key is originally a string since Object.entries() returns [string, string][].
    // We need to cast the key to LogLevelNumeric correctly without causing type mismatches.
    const numericKey = Number(key);
    if (!Number.isNaN(numericKey)) {
        acc[value] = numericKey;
    }
    return acc;
}, {});
/**
 * Simple logger with log levels.
 */
class Logger {
    currentLevelValue = 3 /* LogLevelNumeric.Info */;
    writer;
    /**
     * Constructor.
     * @param writer Writer object.
     */
    constructor(writer = console) {
        this.writer = writer;
        // bind the logging methods to avoid losing context
        this.debug = this.debug.bind(this);
        this.info = this.info.bind(this);
        this.warn = this.warn.bind(this);
        this.error = this.error.bind(this);
    }
    /**
     * Print debug messages. Usually used for technical information.
     * Will be printed in 'log' channel.
     *
     * @param args Printed arguments.
     */
    debug(...args) {
        this.print(4 /* LogLevelNumeric.Debug */, "log" /* LogMethod.Log */, args);
    }
    /**
     * Print messages you want to disclose to users.
     *
     * @param args Printed arguments.
     */
    info(...args) {
        this.print(3 /* LogLevelNumeric.Info */, "info" /* LogMethod.Info */, args);
    }
    /**
     * Print warn messages.
     * NOTE: We do not use 'warn' channel, since in the extensions warn is
     * counted as error. Instead of this we use 'info' channel.
     *
     * @param args Printed arguments.
     */
    warn(...args) {
        this.print(2 /* LogLevelNumeric.Warn */, "info" /* LogMethod.Info */, args);
    }
    /**
     * Print error messages.
     *
     * @param args Printed arguments.
     */
    error(...args) {
        this.print(1 /* LogLevelNumeric.Error */, "error" /* LogMethod.Error */, args);
    }
    /**
     * Getter for log level.
     * @returns Logger level.
     */
    get currentLevel() {
        return levelMapNumToString[this.currentLevelValue];
    }
    /**
     * Setter for log level. With this method log level can be updated dynamically.
     *
     * @param logLevel Logger level.
     * @throws Error if log level is not supported.
     */
    set currentLevel(logLevel) {
        const level = levelMapStringToNum[logLevel];
        if (level === undefined) {
            throw new Error(`Logger supports only the following levels: ${[Object.values(LogLevel).join(', ')]}`);
        }
        this.currentLevelValue = level;
    }
    /**
     * Converts error to string, and adds stack trace.
     *
     * @param error Error to print.
     * @private
     * @returns Error message.
     */
    static errorToString(error) {
        const message = getErrorMessage(error);
        return `${message}\nStack trace:\n${error.stack}`;
    }
    /**
     * Wrapper over log methods.
     *
     * @param level Logger level.
     * @param method Logger method.
     * @param args Printed arguments.
     * @private
     */
    print(level, method, args) {
        // skip writing if the basic conditions are not met
        if (this.currentLevelValue < level) {
            return;
        }
        if (!args || args.length === 0 || !args[0]) {
            return;
        }
        const formattedArgs = args.map((value) => {
            if (value instanceof Error) {
                return Logger.errorToString(value);
            }
            if (value && typeof value.message === 'string') {
                return value.message;
            }
            if (typeof value === 'object' && value !== null) {
                return JSON.stringify(value);
            }
            return String(value);
        });
        const formattedTime = `${formatTime(new Date())}:`;
        /**
         * Conditions in which trace can happen:
         * 1. Method is not error (because console.error provides call stack trace)
         * 2. Log level is equal or higher that `LogLevel.Trace`.
         * 3. Writer has `trace` method.
         */
        if (method === "error" /* LogMethod.Error */
            || this.currentLevelValue < levelMapStringToNum[LogLevel.Trace]
            || !this.writer.trace) {
            // Print with regular method
            this.writer[method](formattedTime, ...formattedArgs);
            return;
        }
        if (!this.writer.groupCollapsed || !this.writer.groupEnd) {
            // Print expanded trace
            this.writer.trace(formattedTime, ...formattedArgs);
            return;
        }
        // Print collapsed trace
        this.writer.groupCollapsed(formattedTime, ...formattedArgs);
        this.writer.trace();
        this.writer.groupEnd();
    }
}




/***/ }),

/***/ 42636:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ Redirects),
/* harmony export */   E: () => (/* binding */ getRedirectFilename)
/* harmony export */ });
/* harmony import */ var js_yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97420);


function _typeof(o) {
    "@babel/helpers - typeof";
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
        return typeof o;
    } : function(o) {
        return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
    }, _typeof(o);
}

function toPrimitive(t, r) {
    if ("object" != _typeof(t) || !t) return t;
    var e = t[Symbol.toPrimitive];
    if (void 0 !== e) {
        var i = e.call(t, r || "default");
        if ("object" != _typeof(i)) return i;
        throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r ? String : Number)(t);
}

function toPropertyKey(t) {
    var i = toPrimitive(t, "string");
    return "symbol" == _typeof(i) ? i : i + "";
}

function _defineProperty(e, r, t) {
    return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
        value: t,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[r] = t, e;
}

var getErrorMessage = function getErrorMessage(error) {
    var isErrorWithMessage = function isErrorWithMessage(e) {
        return typeof e === "object" && e !== null && "message" in e && typeof e.message === "string";
    };
    if (isErrorWithMessage(error)) {
        return error.message;
    }
    try {
        return new Error(JSON.stringify(error)).message;
    } catch (_unused) {
        return new Error(String(error)).message;
    }
};

function ownKeys(e, r) {
    var t = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
        var o = Object.getOwnPropertySymbols(e);
        r && (o = o.filter((function(r) {
            return Object.getOwnPropertyDescriptor(e, r).enumerable;
        }))), t.push.apply(t, o);
    }
    return t;
}

function _objectSpread(e) {
    for (var r = 1; r < arguments.length; r++) {
        var t = null != arguments[r] ? arguments[r] : {};
        r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
            _defineProperty(e, r, t[r]);
        })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
            Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
        }));
    }
    return e;
}

class Redirects {
    constructor(rawYaml) {
        try {
            var arrOfRedirects = js_yaml__WEBPACK_IMPORTED_MODULE_0__.safeLoad(rawYaml);
            this.redirects = arrOfRedirects.reduce((function(acc, redirect) {
                return _objectSpread(_objectSpread({}, acc), {}, {
                    [redirect.title]: redirect
                });
            }), {});
        } catch (e) {
            console.log(`Unable to load YAML into JavaScript: ${getErrorMessage(e)}`);
            throw e;
        }
    }
    getRedirect(title) {
        var _this = this;
        if (Object.prototype.hasOwnProperty.call(this.redirects, title)) {
            return this.redirects[title];
        }
        var values = Object.keys(this.redirects).map((function(key) {
            return _this.redirects[key];
        }));
        return values.find((function(redirect) {
            var {aliases: aliases} = redirect;
            if (!aliases) {
                return false;
            }
            return aliases.includes(title);
        }));
    }
    isBlocking(title) {
        var redirect = this.redirects[title];
        if (redirect) {
            return !!redirect.isBlocking;
        }
        return false;
    }
}

var redirectsMap = {
    "1x1-transparent.gif": "1x1-transparent.gif",
    "1x1.gif": "1x1-transparent.gif",
    "1x1-transparent-gif": "1x1-transparent.gif",
    "2x2-transparent.png": "2x2-transparent.png",
    "2x2.png": "2x2-transparent.png",
    "2x2-transparent-png": "2x2-transparent.png",
    "3x2-transparent.png": "3x2-transparent.png",
    "3x2.png": "3x2-transparent.png",
    "3x2-transparent-png": "3x2-transparent.png",
    "32x32-transparent.png": "32x32-transparent.png",
    "32x32.png": "32x32-transparent.png",
    "32x32-transparent-png": "32x32-transparent.png",
    noopframe: "noopframe.html",
    "noop.html": "noopframe.html",
    "blank-html": "noopframe.html",
    noopcss: "noopcss.css",
    "noop.css": "noopcss.css",
    "blank-css": "noopcss.css",
    noopjs: "noopjs.js",
    "noop.js": "noopjs.js",
    "blank-js": "noopjs.js",
    noopjson: "noopjson.json",
    "noop.json": "noopjson.json",
    nooptext: "nooptext.js",
    "noop.txt": "nooptext.js",
    "blank-text": "nooptext.js",
    empty: "nooptext.js",
    "noopvmap-1.0": "noopvmap01.xml",
    "noop-vmap1.xml": "noopvmap01.xml",
    "noop-vmap1.0.xml": "noopvmap01.xml",
    "noopvast-2.0": "noopvast02.xml",
    "noop-vast2.xml": "noopvast02.xml",
    "noopvast-3.0": "noopvast03.xml",
    "noop-vast3.xml": "noopvast03.xml",
    "noopvast-4.0": "noopvast04.xml",
    "noop-vast4.xml": "noopvast04.xml",
    "noopmp3-0.1s": "noopmp3.mp3",
    "blank-mp3": "noopmp3.mp3",
    "noopmp4-1s": "noopmp4.mp4",
    "noop-1s.mp4": "noopmp4.mp4",
    "blank-mp4": "noopmp4.mp4",
    "click2load.html": "click2load.html",
    "ubo-click2load.html": "click2load.html",
    "amazon-apstag": "amazon-apstag.js",
    "ubo-amazon_apstag.js": "amazon-apstag.js",
    "amazon_apstag.js": "amazon-apstag.js",
    "ati-smarttag": "ati-smarttag.js",
    "didomi-loader": "didomi-loader.js",
    fingerprintjs2: "fingerprintjs2.js",
    "ubo-fingerprint2.js": "fingerprintjs2.js",
    "fingerprint2.js": "fingerprintjs2.js",
    fingerprintjs3: "fingerprintjs3.js",
    "ubo-fingerprint3.js": "fingerprintjs3.js",
    "fingerprint3.js": "fingerprintjs3.js",
    gemius: "gemius.js",
    "google-analytics-ga": "google-analytics-ga.js",
    "ubo-google-analytics_ga.js": "google-analytics-ga.js",
    "google-analytics_ga.js": "google-analytics-ga.js",
    "google-analytics": "google-analytics.js",
    "ubo-google-analytics_analytics.js": "google-analytics.js",
    "google-analytics_analytics.js": "google-analytics.js",
    "googletagmanager-gtm": "google-analytics.js",
    "ubo-googletagmanager_gtm.js": "google-analytics.js",
    "googletagmanager_gtm.js": "google-analytics.js",
    "google-ima3": "google-ima3.js",
    "ubo-google-ima.js": "google-ima3.js",
    "google-ima.js": "google-ima3.js",
    "googlesyndication-adsbygoogle": "googlesyndication-adsbygoogle.js",
    "ubo-googlesyndication_adsbygoogle.js": "googlesyndication-adsbygoogle.js",
    "googlesyndication_adsbygoogle.js": "googlesyndication-adsbygoogle.js",
    "googletagservices-gpt": "googletagservices-gpt.js",
    "ubo-googletagservices_gpt.js": "googletagservices-gpt.js",
    "googletagservices_gpt.js": "googletagservices-gpt.js",
    matomo: "matomo.js",
    "metrika-yandex-tag": "metrika-yandex-tag.js",
    "metrika-yandex-watch": "metrika-yandex-watch.js",
    "naver-wcslog": "naver-wcslog.js",
    noeval: "noeval.js",
    "noeval.js": "noeval.js",
    "silent-noeval.js": "noeval.js",
    "ubo-noeval.js": "noeval.js",
    "ubo-silent-noeval.js": "noeval.js",
    "ubo-noeval": "noeval.js",
    "ubo-silent-noeval": "noeval.js",
    "pardot-1.0": "pardot-1.0.js",
    "prebid-ads": "prebid-ads.js",
    "ubo-prebid-ads.js": "prebid-ads.js",
    "prebid-ads.js": "prebid-ads.js",
    prebid: "prebid.js",
    "prevent-bab": "prevent-bab.js",
    "nobab.js": "prevent-bab.js",
    "ubo-nobab.js": "prevent-bab.js",
    "bab-defuser.js": "prevent-bab.js",
    "ubo-bab-defuser.js": "prevent-bab.js",
    "ubo-nobab": "prevent-bab.js",
    "ubo-bab-defuser": "prevent-bab.js",
    "prevent-bab2": "prevent-bab2.js",
    "nobab2.js": "prevent-bab2.js",
    "prevent-fab-3.2.0": "prevent-fab-3.2.0.js",
    "nofab.js": "prevent-fab-3.2.0.js",
    "ubo-nofab.js": "prevent-fab-3.2.0.js",
    "fuckadblock.js-3.2.0": "prevent-fab-3.2.0.js",
    "ubo-fuckadblock.js-3.2.0": "prevent-fab-3.2.0.js",
    "ubo-nofab": "prevent-fab-3.2.0.js",
    "prevent-popads-net": "prevent-popads-net.js",
    "popads.net.js": "prevent-popads-net.js",
    "ubo-popads.net.js": "prevent-popads-net.js",
    "ubo-popads.net": "prevent-popads-net.js",
    "scorecardresearch-beacon": "scorecardresearch-beacon.js",
    "ubo-scorecardresearch_beacon.js": "scorecardresearch-beacon.js",
    "scorecardresearch_beacon.js": "scorecardresearch-beacon.js",
    "set-popads-dummy": "set-popads-dummy.js",
    "popads-dummy.js": "set-popads-dummy.js",
    "ubo-popads-dummy.js": "set-popads-dummy.js",
    "ubo-popads-dummy": "set-popads-dummy.js"
};

var getRedirectFilename = function getRedirectFilename(name) {
    return redirectsMap[name];
};




/***/ }),

/***/ 26948:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ Allowlist$1),
/* harmony export */   B: () => (/* binding */ BrowserStorage),
/* harmony export */   C: () => (/* binding */ CommonAssistant),
/* harmony export */   D: () => (/* binding */ DocumentLifecycle),
/* harmony export */   E: () => (/* binding */ ExtensionStorage),
/* harmony export */   F: () => (/* binding */ FrameCommon),
/* harmony export */   G: () => (/* binding */ getErrorMessage),
/* harmony export */   H: () => (/* binding */ basicFilterValidator),
/* harmony export */   I: () => (/* binding */ configurationValidator),
/* harmony export */   M: () => (/* binding */ MemoryStorage),
/* harmony export */   P: () => (/* binding */ ParsedCookie),
/* harmony export */   S: () => (/* binding */ StealthActions),
/* harmony export */   T: () => (/* binding */ TabContextCommon),
/* harmony export */   a: () => (/* binding */ getDomain),
/* harmony export */   b: () => (/* binding */ getUpperLevelDomain),
/* harmony export */   c: () => (/* binding */ isHttpOrWsRequest),
/* harmony export */   d: () => (/* binding */ defaultFilteringLog),
/* harmony export */   e: () => (/* binding */ TabsApiCommon),
/* harmony export */   f: () => (/* binding */ createExtensionStorageDecorator),
/* harmony export */   g: () => (/* binding */ getHost),
/* harmony export */   h: () => (/* binding */ CosmeticApiCommon),
/* harmony export */   i: () => (/* binding */ isHttpRequest),
/* harmony export */   j: () => (/* binding */ createFrameMatchQuery),
/* harmony export */   k: () => (/* binding */ companiesDbService),
/* harmony export */   l: () => (/* binding */ FilteringEventType),
/* harmony export */   m: () => (/* binding */ CookieUtils$1),
/* harmony export */   n: () => (/* binding */ getRequestType),
/* harmony export */   o: () => (/* binding */ isThirdPartyRequest),
/* harmony export */   p: () => (/* binding */ BrowserCookieApi),
/* harmony export */   q: () => (/* binding */ findHeaderByName),
/* harmony export */   r: () => (/* binding */ CookieRulesFinder),
/* harmony export */   s: () => (/* binding */ ContentType),
/* harmony export */   t: () => (/* binding */ messageValidator),
/* harmony export */   u: () => (/* binding */ processShouldCollapsePayloadValidator),
/* harmony export */   v: () => (/* binding */ getExtendedCssPayloadValidator),
/* harmony export */   w: () => (/* binding */ getCookieRulesPayloadValidator),
/* harmony export */   x: () => (/* binding */ getSaveCookieLogEventPayloadValidator),
/* harmony export */   y: () => (/* binding */ getAssistantCreateRulePayloadValidator),
/* harmony export */   z: () => (/* binding */ removeHeader)
/* harmony export */ });
/* unused harmony exports J, K, L, N, O, Q, R, U, V, W, X */
/* harmony import */ var _adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84333);
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11911);
/* harmony import */ var webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7967);
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68916);
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74985);
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(38088);
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(19820);
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(94309);
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3290);
/* harmony import */ var _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55712);
/* harmony import */ var _message_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21737);
/* harmony import */ var _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(64638);
/* harmony import */ var tldts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13548);
/* harmony import */ var nanoid_non_secure__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(15547);
/* harmony import */ var _trackers_min_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9680);
/* harmony import */ var _adguard_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38200);














/**
 * Simple pub-sub implementation.
 */
class EventChannel {
    listeners = [];
    /**
     * Dispatch event.
     *
     * @param data Event data.
     */
    dispatch(data) {
        this.listeners.forEach((listener) => listener(data));
    }
    /**
     * Subscribe to events channel.
     *
     * @param listener Callback to be called on event.
     */
    subscribe(listener) {
        this.listeners.push(listener);
    }
    /**
     * Unsubscribe from events channel.
     *
     * @param listener Callback to be removed from listeners.
     */
    unsubscribe(listener) {
        const index = this.listeners.indexOf(listener);
        if (index !== -1) {
            this.listeners.splice(index, 1);
        }
    }
}

// TODO: Add 'is' prefix to cssRule, scriptRule and contentRule properties.
/**
 * Types of filtering events that can occur during request processing.
 */
var FilteringEventType;
(function (FilteringEventType) {
    FilteringEventType["SendRequest"] = "sendRequest";
    FilteringEventType["TabReload"] = "tabReload";
    FilteringEventType["ApplyBasicRule"] = "applyBasicRule";
    FilteringEventType["ApplyCosmeticRule"] = "applyCosmeticRule";
    FilteringEventType["ApplyCspRule"] = "applyCspRule";
    FilteringEventType["ApplyPermissionsRule"] = "applyPermissionsRule";
    FilteringEventType["ReceiveResponse"] = "receiveResponse";
    FilteringEventType["Cookie"] = "cookie";
    FilteringEventType["RemoveHeader"] = "removeHeader";
    FilteringEventType["RemoveParam"] = "removeParam";
    FilteringEventType["ReplaceRuleApply"] = "replaceRuleApply";
    FilteringEventType["ContentFilteringStart"] = "contentFilteringStart";
    FilteringEventType["ContentFilteringFinish"] = "contentFilteringFinish";
    FilteringEventType["StealthAction"] = "stealthAction";
    FilteringEventType["StealthAllowlistAction"] = "stealthAllowlistAction";
    FilteringEventType["JsInject"] = "jsInject";
    FilteringEventType["CspReportBlocked"] = "cspReportBlocked";
    /**
     * Used only in unpacked MV3.
     */
    FilteringEventType["MatchedDeclarativeRule"] = "matchedDeclarativeRule";
})(FilteringEventType || (FilteringEventType = {}));
/**
 * {@link FilteringLogInterface} Default implementation.
 */
class FilteringLog {
    onLogEvent = new EventChannel();
    channels = [];
    /**
     * Registers listener for specified {@link FilteringLogEvent}.
     *
     * @param type Filtering log type.
     * @param listener Filtering log listener.
     */
    addEventListener(type, listener) {
        const channel = { type, listener };
        this.channels.push(channel);
    }
    /**
     * Publishes event to attached listeners.
     *
     * @param event Filtering log event.
     */
    publishEvent(event) {
        const listeners = this.channels
            .filter(({ type }) => type === event.type)
            .map(({ listener }) => listener);
        for (const listener of listeners) {
            listener(event);
        }
        this.onLogEvent.dispatch(event);
    }
}
/**
 * Shared {@link FilteringLog} instance.
 */
const defaultFilteringLog = new FilteringLog();

/**
 * The allowlist is used to exclude certain websites from filtering.
 * Blocking rules are not applied to the sites in the list.
 * The allow list can also be inverted.
 * In inverted mode, the application will unblock ads everywhere except for the
 * sites added to this list.
 */
let Allowlist$1 = class Allowlist {
    /**
     * Indicates whether the allowlist is enabled.
     */
    enabled = false;
    /**
     * If true, ads will be blocked only on sites listed in the allowlist,
     * like "blocklist" mode.
     */
    inverted = false;
    /**
     * List of domains which are allowed (by default)
     * or blocked (if the allowlist is inverted).
     */
    domains = [];
    /**
     * Configures allowlist state based on app configuration.
     *
     * @param configuration App configuration.
     */
    configure(configuration) {
        const { allowlist, settings, } = configuration;
        const { allowlistEnabled, allowlistInverted, } = settings;
        this.enabled = allowlistEnabled;
        this.inverted = allowlistInverted;
        this.domains = allowlist.map((hostname) => {
            return hostname.startsWith('www.') ? hostname.substring(4).trim() : hostname.trim();
        });
    }
    /**
     * Returns a list of rules to be loaded into the engine based on allowlist state.
     *
     * @returns List of allowlist rules or null.
     */
    getAllowlistRules() {
        if (!this.enabled || this.inverted) {
            return null;
        }
        return (0,_adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .createAllowlistRuleList */ .kn)(_constants_js__WEBPACK_IMPORTED_MODULE_4__.A, this.domains);
    }
    /**
     * Creates an allowlist rule for a domain which will be passed to our engine
     * to unblock requests. In MV3 we will pass this rule to TsUrlFilter engine,
     * because it do work with cosmetic rules.
     *
     * @param domain Domain name.
     *
     * @returns Allowlist rule or null.
     */
    static createAllowlistRule(domain) {
        if (!domain) {
            return null;
        }
        return _adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .RuleFactory */ .Vf.createAllowlistRule(domain, _constants_js__WEBPACK_IMPORTED_MODULE_4__.A);
    }
};

/**
 * Checks if url is http request.
 *
 * @param url Request url.
 *
 * @returns True if url starts with http{s?}.
 */
function isHttpRequest(url) {
    return typeof url === 'string' && !!url && url.startsWith('http');
}
/**
 * Checks if url is http or websocket.
 *
 * @param url Request url.
 *
 * @returns True if url starts with http{s?} or ws.
 */
function isHttpOrWsRequest(url) {
    return !!url && (url.startsWith('http') || url.startsWith('ws'));
}
/**
 * Extract host from url.
 *
 * @param url Url.
 *
 * @returns Host of the url or null.
 */
function getHost(url) {
    let firstIdx = url.indexOf('//');
    if (firstIdx === -1) {
        /**
         * It's non-hierarchical structured URL (stun: or turn:).
         *
         * @see {@link https://tools.ietf.org/html/rfc4395#section-2.2}
         * @see {@link https://tools.ietf.org/html/draft-nandakumar-rtcweb-stun-uri-08#appendix-B}
         */
        firstIdx = url.indexOf(':');
        if (firstIdx === -1) {
            return null;
        }
        firstIdx -= 1;
    }
    const nextSlashIdx = url.indexOf('/', firstIdx + 2);
    const startParamsIdx = url.indexOf('?', firstIdx + 2);
    let lastIdx = nextSlashIdx;
    if (startParamsIdx > 0 && (startParamsIdx < nextSlashIdx || nextSlashIdx < 0)) {
        lastIdx = startParamsIdx;
    }
    let host = lastIdx === -1 ? url.substring(firstIdx + 2) : url.substring(firstIdx + 2, lastIdx);
    const portIndex = host.indexOf(':');
    host = portIndex === -1 ? host : host.substring(0, portIndex);
    const lastChar = host.charAt(host.length - 1);
    if (lastChar === '.') {
        host = host.slice(0, -1);
    }
    return host;
}
/**
 * Extracts domain name from url.
 *
 * @param url Url.
 *
 * @returns Domain name or null.
 */
function getDomain(url) {
    const host = getHost(url);
    if (!host) {
        return null;
    }
    return host.startsWith('www.') ? host.substring(4) : host;
}
/**
 * If referrer of request contains full url of extension, then this request is considered as extension's own request.
 * Example: request for filter downloading.
 * Related issue: @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1437}.
 *
 * @param url Request url.
 *
 * @returns True if request is extension's own.
 */
function isExtensionUrl(url) {
    return url.indexOf(browser.runtime.getURL('')) === 0;
}
/**
 * Checks third party relation.
 *
 * @param requestUrl Request url.
 * @param referrer Referrer url.
 *
 * @returns True if request is third-party.
 */
function isThirdPartyRequest(requestUrl, referrer) {
    const tldResult = (0,tldts__WEBPACK_IMPORTED_MODULE_1__/* .parse */ .qg)(requestUrl);
    const sourceTldResult = (0,tldts__WEBPACK_IMPORTED_MODULE_1__/* .parse */ .qg)(referrer);
    return tldResult.domain !== sourceTldResult.domain;
}
/**
 * Extracts upper level domain from domain.
 *
 * @param domain Domain.
 *
 * @returns Upper level domain.
 *
 * @example
 * ```
 * getUpperLevelDomain('www.example.com') => `example.com`
 * getUpperLevelDomain('test.pages.dev') => `pages.dev`
 * getUpperLevelDomain('allowlist.test.pages.dev') => `test.pages.dev`
 * ```
 */
function getUpperLevelDomain(domain) {
    const parts = domain.split('.');
    parts.shift();
    return parts.join('.');
}

/**
 * Wrapper around a map for frames.
 */
class Frames {
    /**
     * A map where the key is the frame ID and the value is the frame object.
     */
    framesMap = new Map();
    /**
     * Sets frame by id.
     *
     * @param frameId Frame id.
     * @param frame Frame to save.
     */
    set(frameId, frame) {
        this.framesMap.set(frameId, frame);
    }
    /**
     * Returns frame by id.
     *
     * @param frameId Frame id.
     *
     * @returns Frame or undefined if frame not found.
     */
    get(frameId) {
        return this.framesMap.get(frameId);
    }
    /**
     * Clears all frames.
     */
    clear() {
        this.framesMap.clear();
    }
    /**
     * Deletes frame by id.
     *
     * @param frameId Frame id.
     */
    delete(frameId) {
        this.framesMap.delete(frameId);
    }
    /**
     * Returns all frames.
     *
     * @returns Array of frames.
     */
    values() {
        return [...this.framesMap.values()];
    }
}

/**
 * Tab context common class.
 */
class TabContextCommon {
    info;
    filteringLog;
    /**
     * Frames context.
     *
     * NOTE: this is temporary storage for frames data.
     * Each frame context is deleted after navigation is complete.
     * Storage is cleared on tab reload.
     * Do not use it as a data source out of request or navigation processing.
     */
    frames = new Frames();
    /**
     * Document IDs map.
     * Used to get frame context by document ID.
     */
    documentIdsMap = new Map();
    /**
     * Blocked request count.
     */
    blockedRequestCount = 0;
    /**
     * Document level rule, applied to the tab.
     */
    mainFrameRule = null;
    // TODO: remove later.
    /**
     * @deprecated
     * This field is used in the extension, and mv2 version uses it,
     * but it is not used anymore in mv3, so it is deprecated here.
     *
     * We mark these tabs as synthetic because they may not actually exist.
     */
    isSyntheticTab = false;
    /**
     * Timestamp of the assistant initialization.
     *
     * Needed to avoid cosmetic rules injection into the assistant frame.
     *
     * @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1848}
     */
    assistantInitTimestamp = null;
    /**
     * Tab creation timestamp in milliseconds.
     */
    createdAtMs;
    /**
     * Tab context constructor.
     *
     * @param info Tab info.
     * @param filteringLog Filtering log.
     */
    constructor(info, filteringLog = defaultFilteringLog) {
        this.info = info;
        this.filteringLog = filteringLog;
        this.createdAtMs = Date.now();
    }
    /**
     * Updates tab info.
     *
     * @param tabInfo Tab info.
     */
    updateTabInfo(tabInfo) {
        this.info = tabInfo;
    }
    /**
     * Updates main frame data.
     *
     * Note: this method will be called on tab reload before the first {@link browser.tabs.onUpdated} event
     * and {@link handleTabUpdate} calls.
     *
     * @param tabId Tab ID.
     * @param url Url.
     */
    updateMainFrameData(tabId, url) {
        this.info.url = url;
        this.info.id = tabId;
    }
    /**
     * Increments blocked requests count.
     */
    incrementBlockedRequestCount() {
        this.blockedRequestCount += 1;
    }
    /**
     * Resets blocked requests count.
     */
    resetBlockedRequestsCount() {
        this.blockedRequestCount = 0;
    }
    /**
     * Checks if passed {@link Tabs.Tab} details represent a browser tab.
     *
     * @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab#type
     * @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/TAB_ID_NONE
     *
     * @param tab Tab details.
     *
     * @returns True if the tab is a browser tab, otherwise returns false.
     */
    static isBrowserTab(tab) {
        return typeof tab.id === 'number' && tab.id !== webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.TAB_ID_NONE;
    }
    /**
     * Get frame context.
     *
     * @param frameId Frame id.
     *
     * @returns Frame context.
     */
    getFrameContext(frameId) {
        return this.frames.get(frameId);
    }
    /**
     * Set frame context.
     *
     * @param frameId Frame id.
     * @param frameContext Frame context.
     */
    setFrameContext(frameId, frameContext) {
        this.frames.set(frameId, frameContext);
    }
    /**
     * Set document id.
     *
     * @param documentId Unique identifier of the frame.
     * @param frameId Frame id.
     */
    setDocumentId(documentId, frameId) {
        this.documentIdsMap.set(documentId, frameId);
    }
    /**
     * Get frame context by document id.
     *
     * @param documentId Unique identifier of the frame.
     *
     * @returns Frame context.
     */
    getFrameContextByDocumentId(documentId) {
        const frameId = this.documentIdsMap.get(documentId);
        // frameId might be 0, do not use falsy check
        if (frameId !== undefined) {
            return this.frames.get(frameId);
        }
        return undefined;
    }
    /**
     * Deletes the frame context.
     *
     * @param frameId The ID of the frame to delete.
     * @param maxFrameAgeMs The maximum allowed frame age in milliseconds.
     */
    deleteFrameContext(frameId, maxFrameAgeMs) {
        // The main frame should only be deleted when the tab is closed,
        // as it may be needed for sub frames created during the page's lifetime
        // or for retrieving the main frame rule.
        if (frameId === _constants_js__WEBPACK_IMPORTED_MODULE_4__.M) {
            return;
        }
        const frame = this.frames.get(frameId);
        if (!frame) {
            return;
        }
        // Do not delete frames that are not stale, as they may still be needed.
        if (frame.timeStamp && frame.timeStamp > Date.now() - maxFrameAgeMs) {
            return;
        }
        // Clear the document ID map if the frame has a document ID.
        if (frame.documentId) {
            this.documentIdsMap.delete(frame.documentId);
        }
        this.frames.delete(frameId);
    }
    /**
     * Since document frames are not removed, but rather updated, document IDs can become stale.
     * This method clears stale document IDs.
     */
    clearStaleDocumentIds() {
        const documentIdsLeft = this.frames.values()
            .map((frame) => frame.documentId)
            .filter(lodash_es__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A);
        const documentIdsLeftSet = new Set(documentIdsLeft);
        const documentIds = [...this.documentIdsMap.keys()];
        for (const documentId of documentIds) {
            if (!documentIdsLeftSet.has(documentId)) {
                this.documentIdsMap.delete(documentId);
            }
        }
    }
    /**
     * Clears stale frames.
     *
     * @param maxFrameAgeMs The maximum allowed frame age in milliseconds.
     */
    clearStaleFrames(maxFrameAgeMs) {
        const values = this.frames.values();
        for (const value of values) {
            this.deleteFrameContext(value.frameId, maxFrameAgeMs);
        }
        this.clearStaleDocumentIds();
    }
}

/**
 * Tabs API common class.
 */
class TabsApiCommon {
    documentApi;
    context = new Map();
    onCreate = new EventChannel();
    onUpdate = new EventChannel();
    onDelete = new EventChannel();
    onActivate = new EventChannel();
    onReplace = new EventChannel();
    /**
     * Tabs API constructor.
     *
     * @param documentApi Optional, Document API instance. Needed for MV2.
     */
    constructor(documentApi) {
        this.documentApi = documentApi;
        this.handleTabCreate = this.handleTabCreate.bind(this);
        this.handleTabUpdate = this.handleTabUpdate.bind(this);
        this.handleTabActivate = this.handleTabActivate.bind(this);
        this.handleTabReplace = this.handleTabReplace.bind(this);
        this.handleTabDelete = this.handleTabDelete.bind(this);
        this.onWindowFocusChanged = this.onWindowFocusChanged.bind(this);
        this.getTabContext = this.getTabContext.bind(this);
        this.getTabFrameRule = this.getTabFrameRule.bind(this);
        this.getTabFrame = this.getTabFrame.bind(this);
        this.getTabMainFrame = this.getTabMainFrame.bind(this);
        this.getMainFrameUrl = this.getMainFrameUrl.bind(this);
    }
    /**
     * Starts recording the main frame URLs for the tabs.
     */
    async start() {
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onCreated.addListener(this.handleTabCreate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onRemoved.addListener(this.handleTabDelete);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onUpdated.addListener(this.handleTabUpdate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onActivated.addListener(this.handleTabActivate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onReplaced.addListener(this.handleTabReplace);
        // Firefox for android doesn't support windows API
        // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows#browser_compatibility
        if (webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.windows) {
            webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.windows.onFocusChanged.addListener(this.onWindowFocusChanged);
        }
    }
    /**
     * Stops recording the main frame URLs for the tabs.
     */
    stop() {
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onCreated.removeListener(this.handleTabCreate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onRemoved.removeListener(this.handleTabDelete);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onUpdated.removeListener(this.handleTabUpdate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onActivated.removeListener(this.handleTabActivate);
        webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.onReplaced.removeListener(this.handleTabReplace);
        // Firefox for android doesn't support windows API
        if (webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.windows) {
            webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.windows.onFocusChanged.removeListener(this.onWindowFocusChanged);
        }
        this.context.clear();
    }
    /**
     * Updates tab context data on tab update.
     *
     * If the tab context is not found, creates a new tab context.
     *
     * If the tab context is not found, creates a new tab context.
     *
     * @param tabId Tab ID.
     * @param changeInfo Tab change info.
     * @param tabInfo Tab info.
     */
    handleTabUpdate(tabId, changeInfo, tabInfo) {
        if (!TabContextCommon.isBrowserTab(tabInfo)) {
            return;
        }
        // Skip updates for non-http requests.
        if (changeInfo.url && !isHttpRequest(changeInfo.url)) {
            return;
        }
        // TODO: we can ignore some events (favicon url update etc.)
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return;
        }
        tabContext.updateTabInfo(tabInfo);
        this.onUpdate.dispatch(tabContext);
    }
    /**
     * Dispatches tab on activated event.
     *
     * @param tab Tab info.
     */
    handleTabActivate(tab) {
        const tabContext = this.context.get(tab.tabId);
        if (!tabContext) {
            return;
        }
        this.onActivate.dispatch(tabContext);
    }
    /**
     * The browser tab may be replaced by another when the discarded tab wakes up.
     * We handle this case on {@link browser.tabs.onReplaced} event.
     * It fires before the tab details are updated,
     * so we just move the existing tab context to the new key.
     *
     * @param addedTabId Id of the new tab context moved to.
     * @param removedTabId Id of removed tab.
     */
    handleTabReplace(addedTabId, removedTabId) {
        const tabContext = this.context.get(removedTabId);
        if (!tabContext) {
            return;
        }
        this.context.delete(removedTabId);
        this.context.set(addedTabId, tabContext);
        this.onReplace.dispatch(tabContext);
    }
    /**
     * Removes tab context by tab ID.
     *
     * @param tabId Tab ID.
     */
    handleTabDelete(tabId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return;
        }
        this.context.delete(tabId);
        this.onDelete.dispatch(tabContext);
    }
    /**
     * Called when focus state of window changed.
     *
     * @param windowId Window ID.
     */
    async onWindowFocusChanged(windowId) {
        // If all browser windows have lost focus.
        if (windowId === webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.windows.WINDOW_ID_NONE) {
            return;
        }
        const [activeTab] = await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.query({
            active: true,
            windowId,
        });
        if (!activeTab || !activeTab.id) {
            return;
        }
        const tabContext = this.context.get(activeTab.id);
        if (!tabContext) {
            return;
        }
        this.onActivate.dispatch(tabContext);
    }
    /**
     * Retrieves tab context by tab ID.
     *
     * @param tabId Tab ID.
     *
     * @returns Tab context or undefined if not found.
     */
    getTabContext(tabId) {
        return this.context.get(tabId);
    }
    /**
     * Retrieves frame rule for the tab context.
     *
     * @param tabId Tab ID.
     *
     * @returns Frame rule or null if not found.
     */
    getTabFrameRule(tabId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return null;
        }
        return tabContext.mainFrameRule;
    }
    /**
     * Retrieves frame data for the frame in the tab context.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     *
     * @returns Frame data or null if not found.
     */
    getTabFrame(tabId, frameId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return null;
        }
        const frame = tabContext.frames.get(frameId);
        if (!frame) {
            return null;
        }
        return frame;
    }
    /**
     * Retrieves main frame data for the tab context.
     *
     * @param tabId Tab ID.
     *
     * @returns Frame data or null if not found.
     */
    getTabMainFrame(tabId) {
        return this.getTabFrame(tabId, _constants_js__WEBPACK_IMPORTED_MODULE_4__.M);
    }
    /**
     * Returns main frame URL for provided tab ID.
     *
     * @param tabId Tab ID.
     *
     * @returns Main frame URL for provided tab ID.
     */
    getMainFrameUrl(tabId) {
        return this.getTabMainFrame(tabId)?.url;
    }
    /**
     * Checks if the frame is a document-level frame by checking its parent frame ID.
     *
     * @param parentFrameId Parent frame ID.
     *
     * @returns True if the parent frame is a document-level frame.
     */
    static isDocumentLevelFrame(parentFrameId) {
        return parentFrameId === _constants_js__WEBPACK_IMPORTED_MODULE_4__.N;
    }
    /**
     * Checks whether the tab with the specified ID is open
     * in incognito mode or not.
     *
     * @param tabId Tab ID.
     *
     * @returns True if the tab is open in incognito mode, false otherwise.
     */
    isIncognitoTab(tabId) {
        const tabContext = this.getTabContext(tabId);
        if (!tabContext) {
            return false;
        }
        return tabContext.info.incognito;
    }
    /**
     * Increments tab context blocked request count.
     *
     * @param tabId Tab ID.
     * @param referrerUrl Request initiator url.
     */
    incrementTabBlockedRequestCount(tabId, referrerUrl) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return;
        }
        const tabUrl = tabContext.info?.url;
        /**
         * Only increment count for requests that are initiated from the same domain as the tab.
         *
         * This prevents count 'leaks' when moving between main frames due to async nature of
         * {@link browser.webRequest.onBeforeRequest} and {@link browser.tabs.onUpdated} events.
         */
        if (!tabUrl
            || !referrerUrl
            || getDomain(tabUrl) !== getDomain(referrerUrl)) {
            return;
        }
        tabContext.incrementBlockedRequestCount();
    }
    /**
     * Resets blocked requests count for the tab.
     *
     * @param tabId Tab ID.
     */
    resetBlockedRequestsCount(tabId) {
        const tabContext = this.getTabContext(tabId);
        if (!tabContext) {
            return;
        }
        tabContext.resetBlockedRequestsCount();
    }
    /**
     * Sets a current timestamp as `assistantInitTimestamp` of the tab context.
     *
     * Needed to determine later if a newly created frame is an assistant frame.
     *
     * @param tabId Tab id.
     */
    setAssistantInitTimestamp(tabId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return;
        }
        tabContext.assistantInitTimestamp = Date.now();
    }
    /**
     * Resets tab context's `assistantInitTimestamp` to null.
     *
     * @param tabId Tab id.
     */
    resetAssistantInitTimestamp(tabId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext) {
            return;
        }
        tabContext.assistantInitTimestamp = null;
    }
    /**
     * Sets frame context.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     * @param frameContext Frame context.
     *
     * @throws Error if the tab context is not found, as this should not occur at this point.
     */
    setFrameContext(tabId, frameId, frameContext) {
        const tabContext = this.getTabContext(tabId);
        if (!tabContext) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.debug('At this point tab context should already exist');
            return;
        }
        tabContext.setFrameContext(frameId, frameContext);
    }
    /**
     * Returns frame context by tabId and frameId.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     *
     * @returns Frame context.
     */
    getFrameContext(tabId, frameId) {
        const tabContext = this.getTabContext(tabId);
        const frameContext = tabContext?.getFrameContext(frameId);
        return frameContext;
    }
    /**
     * Updates the frame context with additional data.
     *
     * @param tabId The ID of the tab.
     * @param frameId The ID of the frame.
     * @param partialFrameContext The details to be added to the frame context.
     *
     * @throws Error if the tab context or frame context is not found, as this should not occur at this point.
     */
    updateFrameContext(tabId, frameId, partialFrameContext) {
        const tabContext = this.getTabContext(tabId);
        if (!tabContext) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.debug('At this point tab context should already exist');
            return;
        }
        const frameContext = tabContext?.getFrameContext(frameId);
        if (!frameContext) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.debug('At this point frame context should already exist');
            return;
        }
        Object.assign(frameContext, partialFrameContext);
        if (frameContext.documentId) {
            tabContext.setDocumentId(frameContext.documentId, frameId);
        }
    }
    /**
     * Deletes the frame context.
     * Also clears frames older than the specified maxFrameAgeMs.
     *
     * @param tabId The ID of the tab.
     * @param frameId The ID of the frame.
     * @param maxFrameAgeMs The maximum allowed age for frames, in milliseconds.
     */
    deleteFrameContext(tabId, frameId, maxFrameAgeMs) {
        const tabContext = this.getTabContext(tabId);
        if (!tabContext) {
            return;
        }
        tabContext.deleteFrameContext(frameId, maxFrameAgeMs);
        tabContext.clearStaleFrames(maxFrameAgeMs);
    }
    /**
     * Returns frame context by documentId.
     *
     * @param tabId Tab ID.
     * @param documentId Unique identifier assigned to the frame on onCommitted event.
     *
     * @returns Frame context.
     */
    getByDocumentId(tabId, documentId) {
        const tabContext = this.getTabContext(tabId);
        return tabContext?.getFrameContextByDocumentId(documentId);
    }
    /**
     * Sets main frame rule for the tab context and for the frame context.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     * @param frameRule Frame rule.
     */
    setMainFrameRule(tabId, frameId, frameRule) {
        const tabContext = this.getTabContext(tabId);
        if (tabContext && frameId === _constants_js__WEBPACK_IMPORTED_MODULE_4__.M) {
            tabContext.mainFrameRule = frameRule;
        }
        if (frameRule) {
            this.updateFrameContext(tabId, frameId, { frameRule });
        }
        else {
            this.updateFrameContext(tabId, frameId, { frameRule: undefined });
        }
    }
}

/**
 * Frame context data.
 *
 * We store {@link MatchingResult} and {@link CosmeticResult} in the frame context
 * to apply rules that cannot be handled during request processing.
 * The frame data is deleted after the {@link browser.webNavigation.onCompleted} event.
 *
 * @see {@link WebRequestApi.deleteFrameContext}
 *
 * The class is abstract because FrameMV2 and FrameMV3 extend it.
 */
class FrameCommon {
    /**
     * Frame url.
     */
    url;
    /**
     * Main frame url.
     */
    mainFrameUrl;
    /**
     * Tab id.
     */
    tabId;
    /**
     * Frame id.
     */
    frameId;
    /**
     * Parent frame id.
     */
    parentFrameId;
    /**
     * Frame creation time.
     */
    timeStamp;
    /**
     * Frame rule. Needed in the case of allowlist rules for the tab.
     */
    frameRule;
    /**
     * Parent document id.
     */
    parentDocumentId;
    /**
     * The cosmetic result for the frame.
     *
     * This data is stored in the frame because it is required for logging script and scriptlet rules.
     */
    cosmeticResult;
    /**
     * Matching result for the frame.
     *
     * This data is saved in frame, because we need for access it for script rules injection
     * after deleting request context data.
     */
    matchingResult;
    /**
     * Unique identifier for the frame.
     */
    documentId;
    /**
     * Creates frame instance.
     *
     * @param props Frame constructor properties.
     */
    constructor(props) {
        const { url, tabId, parentFrameId, frameId, timeStamp, parentDocumentId, documentId, } = props;
        this.url = url;
        this.tabId = tabId;
        this.frameId = frameId;
        this.parentFrameId = parentFrameId;
        this.timeStamp = timeStamp;
        this.parentDocumentId = parentDocumentId;
        this.documentId = documentId;
    }
}

/**
 * @file
 * This file contains validation schemas and inferred types for message data.
 */
/**
 * Message DTO validation schema.
 */
const messageValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    handlerName: zod__WEBPACK_IMPORTED_MODULE_7__.z.literal(_message_constants_js__WEBPACK_IMPORTED_MODULE_8__.a),
    type: zod__WEBPACK_IMPORTED_MODULE_7__.z.nativeEnum(_message_constants_js__WEBPACK_IMPORTED_MODULE_8__.M),
    payload: zod__WEBPACK_IMPORTED_MODULE_7__.z.unknown(),
}).strict();
/**
 * {@link MessageType.ProcessShouldCollapse} Message payload validation schema.
 */
const processShouldCollapsePayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    elementUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    documentUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    requestType: zod__WEBPACK_IMPORTED_MODULE_7__.z.nativeEnum(_adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y),
}).strict();
/**
 * {@link MessageType.GetCosmeticData} Message payload validation schema.
 */
const getExtendedCssPayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    documentUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
}).strict();
/**
 * {@link MessageType.GetCosmeticData} Message payload validation schema.
 */
const getCosmeticDataPayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    documentUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
}).strict();
/**
 * {@link MessageType.GetCookieRules} Message payload validation schema.
 */
const getCookieRulesPayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    documentUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
}).strict();
/**
 * {@link MessageType.SaveCookieLogEvent} Message payload validation schema.
 */
const getSaveCookieLogEventPayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    cookieName: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    cookieDomain: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    cookieValue: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    filterId: zod__WEBPACK_IMPORTED_MODULE_7__.z.number(),
    ruleIndex: zod__WEBPACK_IMPORTED_MODULE_7__.z.number(),
    thirdParty: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    isAllowlist: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    isImportant: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    isDocumentLevel: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    isCsp: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    isCookie: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    advancedModifier: zod__WEBPACK_IMPORTED_MODULE_7__.z.string().nullable(),
}).strict();
/**
 * {@link MessageType.InitAssistant} Message payload validation schema.
 */
const getAssistantCreateRulePayloadValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    ruleText: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
}).strict();

/**
 * Request content type.
 *
 * NOTE: Do not use `const enum`,
 * because this enum is imported in extension frontend writing in js.
 */
var ContentType;
(function (ContentType) {
    ContentType["Document"] = "document";
    ContentType["Subdocument"] = "subdocument";
    ContentType["Script"] = "script";
    ContentType["Stylesheet"] = "stylesheet";
    ContentType["Object"] = "object";
    ContentType["Image"] = "image";
    ContentType["XmlHttpRequest"] = "xmlHttpRequest";
    ContentType["Media"] = "media";
    ContentType["Font"] = "font";
    ContentType["Websocket"] = "websocket";
    ContentType["WebRtc"] = "webRtc";
    ContentType["Other"] = "other";
    ContentType["Csp"] = "csp";
    ContentType["PermissionsPolicy"] = "permissionsPolicy";
    ContentType["Cookie"] = "cookie";
    ContentType["Ping"] = "ping";
    ContentType["CspReport"] = "cspReport";
})(ContentType || (ContentType = {}));
/**
 * Returns request type and content type by resource type.
 *
 * @param resourceType Resource type.
 *
 * @returns Request type and content type.
 */
function getRequestType(resourceType) {
    switch (resourceType) {
        case 'main_frame':
            return {
                contentType: ContentType.Document,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Document,
            };
        case 'sub_frame':
            return {
                contentType: ContentType.Subdocument,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.SubDocument,
            };
        case 'stylesheet':
            return {
                contentType: ContentType.Stylesheet,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Stylesheet,
            };
        case 'script':
            return {
                contentType: ContentType.Script,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Script,
            };
        case 'image':
        case 'imageset':
            return {
                contentType: ContentType.Image,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Image,
            };
        case 'object':
            return {
                contentType: ContentType.Object,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Object,
            };
        case 'xmlhttprequest':
            return {
                contentType: ContentType.XmlHttpRequest,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.XmlHttpRequest,
            };
        case 'ping':
        case 'beacon':
            return {
                contentType: ContentType.Ping,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Ping,
            };
        case 'font':
            return {
                contentType: ContentType.Font,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Font,
            };
        case 'media':
            return {
                contentType: ContentType.Media,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Media,
            };
        case 'websocket':
            return {
                contentType: ContentType.Websocket,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.WebSocket,
            };
        case 'csp_report':
            return {
                contentType: ContentType.CspReport,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.CspReport,
            };
        default:
            return {
                contentType: ContentType.Other,
                requestType: _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Other,
            };
    }
}

/**
 * @file
 * In the content script, we need access to @adguard/assistant only when
 * the user clicks 'block ad manually'.
 * Therefore, we exclude @adguard/assistant from the bundled content-script code
 * and load it on-demand. We also added a required field to the configuration
 * object to ensure the assistant is bundled inside the final extension,
 * allowing tswebextension to load it on-demand.
 *
 * Schema:
 * - Buildtime:
 *  -- [tswebext]  Script to inject assistant from the URL provided by the extension.
 *  -- [tswebext]  Assistant controller script for interacting with the assistant. <--- current file.
 *  -- [tswebext]  Assistant messages listener on the content-script side.
 *  -- [extension] Entry point script for injecting the assistant
 * - Runtime:
 *  -- [tswebext] Content script injects into every new tab without the assistant.
 *  -- [tswebext] On-demand content script dynamically injects the assistant.
 *  -- [tswebext] After injection, the content script interacts with the assistant.
 *
 * Reference code: ASSISTANT_INJECT.
 */
/**
 * Abstract assistant class is the handler of messages and events related
 * to AdGuard assistant.
 * Should be extended by the specific assistant implementation for executing
 * script for injecting assistant.
 */
class CommonAssistant {
    /**
     * Maximum time delay in milliseconds between the assistant frame creation and the assistant initialization.
     */
    static FRAME_CREATION_LIMIT_MS = 200;
    /**
     * Assistant frame URL.
     */
    static FRAME_URL = 'about:blank';
    /**
     * Fires when a rule has been created from the AdGuard assistant.
     */
    static onCreateRule = new EventChannel();
    /**
     * Path to assembled @adguard/assistant module. Necessary for lazy on-demand
     * loading of the assistant.
     */
    static assistantUrl = '';
    /**
     * Sets assistant url to the static variable. This method needs because we
     * currently use extended assistant class in both MV2 and MV3 and via directly set
     * CommonAssistant.assistantUrl it will not set filed inside super class itself.
     *
     * @param url Path to assistant, see {@link CommonAssistant.assistantUrl}.
     */
    static setAssistantUrl(url) {
        CommonAssistant.assistantUrl = url;
    }
    /**
     * Dynamically inject AdGuard assistant to the tab and after it opens it.
     *
     * @param tabId The ID of the tab where is needed to inject and open
     * the AdGuard assistant.
     */
    async openAssistant(tabId) {
        if (!CommonAssistant.assistantUrl) {
            throw new Error('Path to bundled assistant-inject file is not set up.');
        }
        // Inject assistant to the frame, before accessing it.
        await this.injectAssistant(tabId, CommonAssistant.assistantUrl);
        // After injection we can request opening it.
        await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.sendMessage(tabId, {
            type: _message_constants_js__WEBPACK_IMPORTED_MODULE_8__.M.InitAssistant,
        });
    }
    /**
     * Closes the AdGuard Assistant frame in the specified tab.
     *
     * @param tabId The ID of the tab where is needed to close
     * the AdGuard assistant.
     */
    static async closeAssistant(tabId) {
        await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.tabs.sendMessage(tabId, {
            type: _message_constants_js__WEBPACK_IMPORTED_MODULE_8__.M.CloseAssistant,
        });
    }
    /**
     * Checks whether the frame is an assistant frame. Two conditions must be met:
     * 1. The frame was created less than {@link CommonAssistant.FRAME_CREATION_LIMIT_MS}
     *    after the assistant initialization.
     * 2. The frame is a child of the main frame.
     *
     * @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1848}
     *
     * @param details Frame details of the onDomContentLoaded event.
     * @param tabContext Tab context.
     *
     * @returns True if the frame is an assistant frame, false otherwise.
     */
    static isAssistantFrame(details, tabContext) {
        if (!tabContext || !tabContext.assistantInitTimestamp) {
            return false;
        }
        const { frameId, url, timeStamp, } = details;
        const frameContext = tabContext.getFrameContext(frameId);
        if (!frameContext) {
            return false;
        }
        const timeSinceFrameCreatedMs = timeStamp - tabContext.assistantInitTimestamp;
        return timeSinceFrameCreatedMs < CommonAssistant.FRAME_CREATION_LIMIT_MS
            && frameContext.parentFrameId === _constants_js__WEBPACK_IMPORTED_MODULE_4__.M
            && url === CommonAssistant.FRAME_URL;
    }
}

/**
 * CosmeticApiCommon contains common logic about building css for hiding elements.
 */
class CosmeticApiCommon {
    static LINE_BREAK = '\r\n';
    /**
     * Number of selectors in grouped selector list.
     */
    static CSS_SELECTORS_PER_LINE = 50;
    /**
     * Element hiding CSS style beginning.
     */
    static ELEMHIDE_HIT_START = " { display: none !important; content: 'adguard";
    /**
     * CSS style declaration for hit stats.
     */
    static INJECT_HIT_START = " content: 'adguard";
    /**
     * Separator for hit stats.
     */
    static HIT_SEP = encodeURIComponent(_constants_js__WEBPACK_IMPORTED_MODULE_4__.S);
    /**
     * Element hiding CSS style ending.
     */
    static HIT_END = "' !important; }";
    /**
     * Regular expression to find content attribute in css rule.
     */
    static CONTENT_ATTR_RE = /[{;"(]\s*content\s*:/gi;
    /**
     * Builds stylesheets from rules.
     * If `groupElemhideSelectors` is set,
     * element hiding selector are to be combined into selector lists of {@link CosmeticApi.CSS_SELECTORS_PER_LINE}.
     *
     * @param elemhideRules List of elemhide rules.
     * @param injectRules List of inject css rules.
     * @param groupElemhideSelectors Flag for elemhide selectors grouping.
     *
     * @returns List of stylesheet expressions.
     */
    static buildStyleSheets(elemhideRules, injectRules, groupElemhideSelectors) {
        const styles = [];
        const elemHideStyles = CosmeticApiCommon.buildElemhideStyles(elemhideRules, groupElemhideSelectors);
        if (elemHideStyles.length > 0) {
            if (groupElemhideSelectors) {
                styles.push(elemHideStyles.join(CosmeticApiCommon.LINE_BREAK));
            }
            else {
                styles.push(...elemHideStyles);
            }
        }
        const cssStyles = injectRules.map((x) => x.getContent());
        if (cssStyles.length > 0) {
            if (groupElemhideSelectors) {
                styles.push(cssStyles.join(CosmeticApiCommon.LINE_BREAK));
            }
            else {
                styles.push(...cssStyles);
            }
        }
        return styles;
    }
    /**
     * Builds element hiding stylesheet from rules.
     * If `groupElemhideSelectors` is set,
     * selector are to be combined into selector lists of {@link CosmeticApi.CSS_SELECTORS_PER_LINE}.
     *
     * @param elemhideRules List of elemhide rules.
     * @param groupElemhideSelectors Flag for elemhide selectors grouping.
     *
     * @returns Array of styles.
     */
    static buildElemhideStyles(elemhideRules, groupElemhideSelectors) {
        // TODO: refactor constants as ELEMHIDE_CSS_STYLE and ELEMHIDE_HIT_START are duplicates partly
        const ELEMHIDE_CSS_STYLE = ' { display: none !important; }';
        const elemhideSelectors = [];
        for (const selector of elemhideRules) {
            elemhideSelectors.push(selector.getContent());
        }
        // if selector should not be grouped,
        // add element hiding style to each of them
        if (!groupElemhideSelectors) {
            return elemhideSelectors.map((selector) => {
                return `${selector}${ELEMHIDE_CSS_STYLE}`;
            });
        }
        // otherwise selectors should be grouped into selector lists
        const elemhideStyles = [];
        for (let i = 0; i < elemhideSelectors.length; i += CosmeticApiCommon.CSS_SELECTORS_PER_LINE) {
            const selectorList = elemhideSelectors
                .slice(i, i + CosmeticApiCommon.CSS_SELECTORS_PER_LINE)
                .join(', ');
            elemhideStyles.push(`${selectorList}${ELEMHIDE_CSS_STYLE}`);
        }
        return elemhideStyles;
    }
    /**
     * Patches rule selector adding adguard mark rule info in the content attribute.
     *
     * @param rule Elemhide cosmetic rule.
     *
     * @returns Rule with modified stylesheet, containing content marker.
     *
     * @example
     * `.selector` -> `.selector { content: 'adguard{filterId};{ruleText} !important;}`
     */
    static addMarkerToElemhideRule(rule) {
        const result = [];
        result.push(rule.getContent());
        result.push(CosmeticApiCommon.ELEMHIDE_HIT_START);
        result.push(String(rule.getFilterListId()));
        result.push(CosmeticApiCommon.HIT_SEP);
        result.push(String(rule.getIndex()));
        result.push(CosmeticApiCommon.HIT_END);
        return result.join('');
    }
    /**
     * Patches rule selector adding adguard mark and rule info in the content style attribute.
     * Example:
     * .selector { color: red } -> .selector { color: red, content: 'adguard{filterId};{ruleText} !important;}.
     *
     * @param rule Inject cosmetic rule.
     *
     * @returns Modified rule with injected content marker into stylesheet.
     */
    static addMarkerToInjectRule(rule) {
        const result = [];
        const ruleContent = rule.getContent();
        // if rule text has content attribute we don't add rule marker
        if (CosmeticApiCommon.CONTENT_ATTR_RE.test(ruleContent)) {
            return ruleContent;
        }
        // remove closing brace
        const ruleTextWithoutCloseBrace = ruleContent.slice(0, -1).trim();
        // check semicolon
        const ruleTextWithSemicolon = ruleTextWithoutCloseBrace.endsWith(_constants_js__WEBPACK_IMPORTED_MODULE_4__.S)
            ? ruleTextWithoutCloseBrace
            : `${ruleTextWithoutCloseBrace}${_constants_js__WEBPACK_IMPORTED_MODULE_4__.S}`;
        result.push(ruleTextWithSemicolon);
        result.push(CosmeticApiCommon.INJECT_HIT_START);
        result.push(String(rule.getFilterListId()));
        result.push(CosmeticApiCommon.HIT_SEP);
        result.push(String(rule.getIndex()));
        result.push(CosmeticApiCommon.HIT_END);
        return result.join('');
    }
    /**
     * Builds stylesheets with css-hits marker.
     *
     * @param elemhideRules Elemhide css rules.
     * @param injectRules Inject css rules.
     *
     * @returns List of stylesheet expressions.
     */
    static buildStyleSheetsWithHits(elemhideRules, injectRules) {
        const elemhideStyles = elemhideRules.map((x) => CosmeticApiCommon.addMarkerToElemhideRule(x));
        const injectStyles = injectRules.map((x) => CosmeticApiCommon.addMarkerToInjectRule(x));
        return [...elemhideStyles, ...injectStyles];
    }
    /**
     * Builds extended css rules from cosmetic result.
     *
     * @param cosmeticResult Cosmetic result.
     * @param collectingCosmeticRulesHits Flag to collect cosmetic rules hits.
     *
     * @returns Array of extended css rules or null.
     */
    static getExtCssRules(cosmeticResult, collectingCosmeticRulesHits = false) {
        const { elementHiding, CSS } = cosmeticResult;
        const elemhideExtCss = elementHiding.genericExtCss.concat(elementHiding.specificExtCss);
        const injectExtCss = CSS.genericExtCss.concat(CSS.specificExtCss);
        let extCssRules;
        if (collectingCosmeticRulesHits) {
            extCssRules = CosmeticApiCommon.buildStyleSheetsWithHits(elemhideExtCss, injectExtCss);
        }
        else {
            extCssRules = CosmeticApiCommon.buildStyleSheets(elemhideExtCss, injectExtCss, false);
        }
        return extCssRules.length > 0
            ? extCssRules
            : null;
    }
    /**
     * Retrieves CSS styles from the cosmetic result.
     *
     * @param cosmeticResult Cosmetic result.
     * @param collectingCosmeticRulesHits Flag to collect cosmetic rules hits.
     *
     * @returns Css styles as string, or `undefined` if no styles found.
     */
    static getCssText(cosmeticResult, collectingCosmeticRulesHits = false) {
        const { elementHiding, CSS } = cosmeticResult;
        const elemhideCss = elementHiding.generic.concat(elementHiding.specific);
        const injectCss = CSS.generic.concat(CSS.specific);
        let styles;
        if (collectingCosmeticRulesHits) {
            styles = CosmeticApiCommon.buildStyleSheetsWithHits(elemhideCss, injectCss);
        }
        else {
            styles = CosmeticApiCommon.buildStyleSheets(elemhideCss, injectCss, true);
        }
        if (styles.length > 0) {
            return styles.join(CosmeticApiCommon.LINE_BREAK);
        }
        return undefined;
    }
    /**
     * Wraps the given JavaScript code in a self-invoking function for safe execution
     * and appends a source URL comment for debugging purposes.
     *
     * @param scriptText The JavaScript code to wrap.
     *
     * @returns The wrapped script code, or an empty string if the input is falsy.
     */
    static wrapScriptText(scriptText) {
        if (!scriptText) {
            return '';
        }
        // The "//# sourceURL=ag-scripts.js" line is necessary to ensure the script always has the same URL,
        // making it possible to debug consistently.
        return `
        (function () {
            try {
                ${scriptText}
            } catch (ex) {
                console.error('Error executing AG js: ' + ex);
            }
        })();
        //# sourceURL=ag-scripts.js
        `;
    }
    /**
     * Combines unique script strings into a single script text.
     *
     * Script string is being trimmed and a semicolon is added if it is missing.
     *
     * @param uniqueScriptStrings Set of unique script strings to combine.
     *
     * @returns Combined script string.
     */
    static combineScripts(uniqueScriptStrings) {
        let scriptText = '';
        uniqueScriptStrings.forEach((rawScriptStr) => {
            const script = rawScriptStr.trim();
            scriptText += script.endsWith(_constants_js__WEBPACK_IMPORTED_MODULE_4__.S)
                ? `${script}${_constants_js__WEBPACK_IMPORTED_MODULE_4__.L}`
                : `${script}${_constants_js__WEBPACK_IMPORTED_MODULE_4__.S}${_constants_js__WEBPACK_IMPORTED_MODULE_4__.L}`;
        });
        return scriptText;
    }
    /**
     * Logs js rules applied to a specific frame.
     *
     * @param params Data for js rule logging.
     * @param predicate Function to filter script rules before logging, e.g. check if the script rule is local.
     */
    static logScriptRules(params, predicate) {
        const { tabId, cosmeticResult, url, contentType, timestamp, } = params;
        const scriptRules = cosmeticResult.getScriptRules().filter(predicate);
        for (const scriptRule of scriptRules) {
            if (scriptRule.isGeneric()) {
                continue;
            }
            const ruleType = scriptRule.getType();
            defaultFilteringLog.publishEvent({
                type: FilteringEventType.JsInject,
                data: {
                    script: true,
                    tabId,
                    // for proper filtering log request info rule displaying
                    // event id should be unique for each event, not copied from request
                    // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2341
                    eventId: (0,nanoid_non_secure__WEBPACK_IMPORTED_MODULE_10__/* .nanoid */ .A)(),
                    requestUrl: url,
                    frameUrl: url,
                    frameDomain: getDomain(url),
                    requestType: contentType,
                    timestamp,
                    filterId: scriptRule.getFilterListId(),
                    ruleIndex: scriptRule.getIndex(),
                    cssRule: ruleType === _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__/* .CosmeticRuleType */ .k9.ElementHidingRule
                        || ruleType === _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__/* .CosmeticRuleType */ .k9.CssInjectionRule,
                    scriptRule: ruleType === _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__/* .CosmeticRuleType */ .k9.ScriptletInjectionRule
                        || ruleType === _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__/* .CosmeticRuleType */ .k9.JsInjectionRule,
                    contentRule: ruleType === _adguard_agtree__WEBPACK_IMPORTED_MODULE_11__/* .CosmeticRuleType */ .k9.HtmlFilteringRule,
                },
            });
        }
    }
}

/**
 * Check if the frame URL is about:blank or about:srcdoc.
 *
 * @param frameUrl Frame URL.
 *
 * @returns True if frame URL is about:blank or about:srcdoc, otherwise false.
 */
const isEmptySrcFrame = (frameUrl) => {
    return frameUrl === 'about:blank'
        || frameUrl === 'about:srcdoc';
};

/**
 * Checks if iframe has same source as main frame or if src is about:blank, javascript:, etc.
 * We don't include frames with 'src=data:' because Chrome and Firefox
 * do not allow data to be injected into frames with this type of src,
 * this bug is reported here https://bugs.chromium.org/p/chromium/issues/detail?id=55084.
 *
 * @param frameUrl Frame url.
 * @param frameId Unique id of frame in the tab.
 * @param mainFrameUrl Url of tab where iframe exists.
 *
 * @returns True if frame without src, else returns false.
 */
function isLocalFrame(frameUrl, frameId, mainFrameUrl) {
    return frameId !== _constants_js__WEBPACK_IMPORTED_MODULE_4__.M
        && (frameUrl === mainFrameUrl
            || isEmptySrcFrame(frameUrl)
            // eslint-disable-next-line no-script-url
            || frameUrl.indexOf('javascript:') > -1);
}

/**
 * Creates match query for frame based on content script data and background tab context.
 * Used in {@link CosmeticApi} and {@link CookieFiltering} to match rules for content scripts.
 *
 * @param frameUrl Frame url. Received from content script.
 * @param frameId Frame id. Received from content script.
 * @param tabContext Tab context. Received from background script.
 *
 * @returns Match query for {@link EngineApi}.
 *
 * @throws Error if tab context url is not defined.
 */
function createFrameMatchQuery(frameUrl, frameId, tabContext) {
    const { info } = tabContext;
    if (!info.url) {
        throw new Error('Tab url is required');
    }
    const mainFrameUrl = info.url;
    const isLocal = isLocalFrame(frameUrl, frameId, mainFrameUrl);
    const requestUrl = isLocal ? mainFrameUrl : frameUrl;
    let requestType;
    // if frame is Local, then apply main frame rules.
    if (isLocal) {
        requestType = _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Document;
    }
    else if (frameId === _constants_js__WEBPACK_IMPORTED_MODULE_4__.M) {
        requestType = _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.Document;
    }
    else {
        requestType = _adguard_tsurlfilter_es_request_type__WEBPACK_IMPORTED_MODULE_9__/* .RequestType */ .Y.SubDocument;
    }
    return {
        requestUrl,
        frameUrl: requestUrl,
        requestType,
        frameRule: tabContext.mainFrameRule,
    };
}

/**
 * Wrapper for StorageArea with dev-friendly interface.
 *
 * @template Data The type of the value stored in the storage.
 */
class BrowserStorage {
    storage;
    /**
     * Constructs an instance of the BrowserStorage class.
     *
     * @param storage The storage area to use.
     */
    constructor(storage) {
        this.storage = storage;
    }
    /**
     * Sets data to storage.
     *
     * @param key Storage key.
     * @param value Storage value.
     */
    async set(key, value) {
        await this.storage.set({ [key]: value });
    }
    /**
     * Returns data from storage.
     *
     * @param key Storage key.
     *
     * @returns Storage value.
     */
    async get(key) {
        return this.storage.get(key).then((data) => data[key]);
    }
    /**
     * Removes data from storage.
     *
     * @param key Storage key.
     */
    async remove(key) {
        await this.storage.remove(key);
    }
    /**
     * Sets multiple key-value pairs in the storage.
     *
     * @param data The key-value pairs to set.
     *
     * @returns True if all operations were successful, false otherwise.
     *
     * @example
     * ```ts
     * const storage = new Storage();
     * await storage.setMultiple({
     *    key1: 'value1',
     *    key2: 'value2',
     * });
     * ```
     */
    // TODO: Implement some kind of transaction to ensure atomicity, if possible
    // Note: We only use this method for Firefox if "Never Remember History" is enabled
    async setMultiple(data) {
        try {
            await this.storage.set(data);
            return true;
        }
        catch (e) {
            return false;
        }
    }
    /**
     * Removes multiple key-value pairs from the storage.
     *
     * @param keys The keys to remove.
     *
     * @returns True if all operations were successful, false otherwise.
     */
    async removeMultiple(keys) {
        await this.storage.remove(keys);
        return true;
    }
    /**
     * Get the entire contents of the storage.
     *
     * @returns Promise that resolves with the entire contents of the storage.
     */
    async entries() {
        return this.storage.get(null);
    }
    /**
     * Get all keys from the storage.
     *
     * @returns Promise that resolves with all keys from the storage.
     */
    async keys() {
        return Object.keys(await this.entries());
    }
    /**
     * Checks if the storage has a key.
     *
     * @param key The key to check.
     *
     * @returns True if the key exists, false otherwise.
     */
    async has(key) {
        return this.storage.get(key).then((data) => key in data);
    }
    /**
     * Clears the storage.
     */
    async clear() {
        await this.storage.clear();
    }
}

/**
 * @file Memory storage implementation with async operations.
 */
/**
 * Provides a simple in-memory storage implementation.
 * This class implements the ExtendedStorageInterface with asynchronous methods.
 *
 * @template Data The type of the value stored in the storage.
 */
class MemoryStorage {
    /**
     * Internal map to hold the key-value pairs.
     */
    store;
    /**
     * Constructs an instance of the MemoryStorage class.
     */
    constructor() {
        this.store = new Map();
    }
    /**
     * Retrieves a value by key from the storage.
     *
     * @param key The key of the value to retrieve.
     *
     * @returns A promise that resolves with the value associated with the key.
     */
    async get(key) {
        return Promise.resolve(this.store.get(key));
    }
    /**
     * Sets a value in the storage with the specified key.
     *
     * @param key The key under which to store the value.
     * @param value The value to store.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    async set(key, value) {
        this.store.set(key, (0,lodash_es__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(value));
        return Promise.resolve();
    }
    /**
     * Removes a value from the storage by key.
     *
     * @param key The key of the value to remove.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    async remove(key) {
        this.store.delete(key);
        return Promise.resolve();
    }
    /**
     * Sets multiple key-value pairs in the storage.
     *
     * @param data The key-value pairs to set.
     *
     * @returns A promise that resolves with true if all operations were successful.
     */
    async setMultiple(data) {
        try {
            // Create a deep copy of each value
            const clonedData = (0,lodash_es__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(data);
            // Set each key-value pair into the store using Object.assign
            Object.assign(this.store, Object.entries(clonedData).reduce((acc, [key, value]) => {
                acc[key] = value;
                return acc;
            }, {}));
            return await Promise.resolve(true);
        }
        catch (error) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.error('Error in setMultiple:', error);
            return Promise.resolve(false);
        }
    }
    /**
     * Removes multiple key-value pairs from the storage.
     *
     * @param keys The keys to remove.
     *
     * @returns A promise that resolves with true if all operations were successful.
     */
    async removeMultiple(keys) {
        try {
            keys.forEach((key) => this.store.delete(key));
            return await Promise.resolve(true);
        }
        catch (error) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.error('Error in removeMultiple:', error);
            return Promise.resolve(false);
        }
    }
    /**
     * Retrieves all entries in the storage.
     *
     * @returns A promise that resolves with an object containing all key-value pairs in the storage.
     */
    async entries() {
        return Promise.resolve(Object.fromEntries(this.store.entries()));
    }
    /**
     * Retrieves all keys in the storage.
     *
     * @returns A promise that resolves with an array of all keys in the storage.
     */
    async keys() {
        return Promise.resolve(Array.from(this.store.keys()));
    }
    /**
     * Checks if a key exists in the storage.
     *
     * @param key The key to check.
     *
     * @returns A promise that resolves with true if the key exists, false otherwise.
     */
    async has(key) {
        return Promise.resolve(this.store.has(key));
    }
    /**
     * Clears the storage.
     *
     * @returns A promise that resolves when the storage is cleared.
     */
    async clear() {
        this.store.clear();
        return Promise.resolve();
    }
}

/**
 * API to store a persistent value with debounced synchronization to the specified storage key.
 *
 * After the container is created, we initialize it asynchronously to get the actual value from the storage.
 * The Init method is guarded against multiple initializations to avoid unnecessary reads from the memory.
 * Get/set methods are protected from uninitialized storage to ensure that actual data is used.
 *
 * We declare the sync get/set methods to update the cached value. This allows us to use containers in accessors.
 *
 * Set method updates the cached value and schedules the save operation to the storage via a debounce function to
 * avoid unnecessary writes to the storage.
 *
 * This container saves the data to storage using the specified key to avoid collisions with other instances.
 * It helps to avoid reading the data from the storage that is not related to the current instance.
 */
class PersistentValueContainer {
    static #IS_BACKGROUND_PERSISTENT = PersistentValueContainer.#isBackgroundPersistent();
    #storage; // Using the async StorageInterface
    #key;
    #value;
    #save;
    #isInitialized = false;
    /**
     * Creates {@link PersistentValueContainer} instance.
     *
     * @param key The key to use for storing the data.
     * @param storage The storage interface implementation.
     * @param debounceMs The debounce time in milliseconds to save the data to the storage.
     * Optional. Default is 300ms.
     */
    constructor(key, storage, // Accepts a StorageInterface implementation
    debounceMs = 300) {
        this.#key = key;
        this.#storage = storage;
        // Configure the #save method to decide dynamically between debounce or direct call
        this.#save = PersistentValueContainer.#IS_BACKGROUND_PERSISTENT
            ? () => {
                this.#storage.set(this.#key, this.#value); // Save directly
            }
            : (0,lodash_es__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(() => {
                this.#storage.set(this.#key, this.#value); // Save using debounce
            }, debounceMs);
    }
    /**
     * Initializes the value.
     *
     * @param value The initial value.
     *
     * @returns Promise that resolves when the value is initialized.
     *
     * @throws Error, if storage already initialized.
     */
    async init(value) {
        if (this.#isInitialized) {
            throw new Error('Storage already initialized');
        }
        if (PersistentValueContainer.#IS_BACKGROUND_PERSISTENT) {
            this.#value = value;
        }
        else {
            const storedValue = await this.#storage.get(this.#key);
            this.#value = storedValue !== undefined ? storedValue : value; // Use stored value or fallback to default
        }
        this.#isInitialized = true;
    }
    /**
     * Gets the value.
     *
     * @returns The value stored by the specified key.
     *
     * @throws Error, if storage not initialized.
     */
    get() {
        this.#checkIsInitialized();
        return this.#value;
    }
    /**
     * Sets the value.
     *
     * @param value Value to be stored in the specified key.
     *
     * @throws Error, if storage not initialized.
     */
    set(value) {
        this.#checkIsInitialized();
        this.#value = value;
        this.#save();
    }
    /**
     * Checks if the storage is initialized.
     *
     * @throws Error, if storage not initialized.
     */
    #checkIsInitialized() {
        if (!this.#isInitialized) {
            throw new Error('Storage not initialized');
        }
    }
    /**
     * TODO: remove this method after the migration to event-driven background.
     * Checks if the background script is persistent.
     *
     * @returns True if the background script is persistent.
     */
    static #isBackgroundPersistent() {
        const manifest = webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.runtime.getManifest();
        if (manifest.manifest_version === 3) {
            return false;
        }
        if (!manifest.background) {
            return true;
        }
        const background = manifest.background;
        return background.persistent ?? true;
    }
}

/**
 * API for storing persistent key-value data with debounced sync using a specified storage key.
 * Storage synchronization is described in the {@link PersistentValueContainer} class.
 */
class ExtensionStorage {
    /**
     * API for storing persistent value with debounced sync using the specified storage key.
     */
    #container;
    /**
     * Creates {@link ExtensionStorage} instance.
     *
     * @param key The key to use for storing the data.
     * @param storage Storage interface implementation (replacing WebExtension API storage).
     */
    constructor(key, storage) {
        this.#container = new PersistentValueContainer(key, storage);
    }
    /**
     * Initializes the storage.
     *
     * @param data The initial data.
     *
     * @returns Promise that resolves when the storage is initialized.
     *
     * @throws Error, if storage already initialized.
     */
    init(data) {
        return this.#container.init(data);
    }
    /**
     * Gets the value by the specified key.
     *
     * @param key The key to retrieve the value.
     *
     * @returns The data stored by the specified key.
     *
     * @throws Error, if storage not initialized.
     */
    get(key) {
        return this.#container.get()[key];
    }
    /**
     * Sets the value by the specified key.
     *
     * @param key The key for the value to be stored.
     * @param value The new value.
     *
     * @throws Error, if storage not initialized.
     */
    set(key, value) {
        const data = this.#container.get();
        data[key] = value;
        this.#container.set(data);
    }
    /**
     * Deletes the value by the specified key.
     *
     * @param key The key for the value to be deleted.
     *
     * @throws Error, if storage not initialized.
     */
    delete(key) {
        const data = this.#container.get();
        delete data[key];
        this.#container.set(data);
    }
}

/**
 * Creates accessor decorator for the specified storage.
 *
 * @see https://github.com/tc39/proposal-decorators
 *
 * @param storage The extension storage API to use.
 *
 * @returns Accessor decorator for the specified storage.
 */
function createExtensionStorageDecorator(storage) {
    const fields = new Set();
    /**
     * Creates accessor decorator for the specified storage field.
     *
     * NOTE: You should not set the initial value to the accessor via assignment,
     * because the decorator overwrites accessor methods and doesn't use a private property, created on initialization.
     * Use Non-null assertion operator instead.
     *
     * @param field Storage field name.
     *
     * @returns Decorator for access to specified storage {@link field}.
     *
     * @throws Error if the decorator is already registered for {@link field}
     * or the decorator is applied to a class member other than an accessor.
     *
     * @example `@storage('foo') accessor bar!: string`;
     */
    return function createFieldDecorator(field) {
        // Prevent the use of multiple decorators on a single storage field
        if (fields.has(field)) {
            throw new Error(`Decorator for ${String(field)} field is already registered`);
        }
        fields.add(field);
        return function fieldDecorator(_target, context) {
            // Ensure the class member is an accessor
            if (context.kind !== 'accessor') {
                throw new Error('Class member is not an accessor');
            }
            // Provide getter and setter using the ExtensionStorage methods
            return {
                get() {
                    return storage.get(field);
                },
                set(value) {
                    storage.set(field, value);
                },
            };
        };
    };
}

/**
 * Service for working with companies database.
 */
class CompaniesDbService {
    /**
     * Category name for unknown domains.
     *
     * @see {@link https://github.com/AdguardTeam/companiesdb/blob/6a8fbfc3bff4fdffc4c8bae30756530afc2635bd/dist/trackers.json#L15}
     */
    static UNKNOWN_CATEGORY_NAME = 'unknown';
    /**
     * Dot symbol.
     */
    static DOT = '.';
    /**
     * Companies database.
     */
    companiesDb = _trackers_min_js__WEBPACK_IMPORTED_MODULE_14__.r;
    /**
     * Returns categories from the companiesdb data where
     * - key — numeric category id
     * - value — category name.
     *
     * @returns Categories from the companiesdb data.
     *
     * @throws Error if companies database is not loaded.
     */
    getCompaniesDbCategories() {
        if (!this.companiesDb) {
            throw new Error('[CompaniesDbService] Companies database is not loaded');
        }
        return this.companiesDb.categories;
    }
    /**
     * Recursively tries to match a company category id for a `domainToCheck`.
     *
     * If the category is not found for an input `domainToCheck`,
     * slices the first subdomain and tries to check a category for a new domain,
     * e.g. `test1.sub.example.com` -> `sub.example.com` -> `example.com`,
     * and returns the category if found.
     *
     * @param domainToCheck Domain to check.
     * @param rootDomain Root domain.
     *
     * @returns Matched company category id or `null` if not found.
     */
    matchCompanyCategoryId(domainToCheck, rootDomain) {
        if (!domainToCheck || !rootDomain) {
            return null;
        }
        if (domainToCheck === rootDomain) {
            return this.companiesDb.trackerDomains[rootDomain] || null;
        }
        const categoryId = this.companiesDb.trackerDomains[domainToCheck];
        if (!categoryId) {
            const firstDotIndex = domainToCheck.indexOf(CompaniesDbService.DOT);
            const nextDomainToCheck = domainToCheck.slice(firstDotIndex + 1);
            return this.matchCompanyCategoryId(nextDomainToCheck, rootDomain);
        }
        return categoryId;
    }
    /**
     * Matches a URL to a tracker category id.
     *
     * List of categories ids can be found in {@link companiesDb.categories}.
     *
     * @param url Request URL to match.
     *
     * @returns Matched company category name,
     * or {@link CompaniesDbService.UNKNOWN_CATEGORY_NAME} if the category is unknown.
     */
    match(url) {
        if (!this.companiesDb || !this.companiesDb.trackerDomains) {
            return CompaniesDbService.UNKNOWN_CATEGORY_NAME;
        }
        const companyCategoryId = this.matchCompanyCategoryId((0,tldts__WEBPACK_IMPORTED_MODULE_1__/* .getHostname */ .EW)(url), 
        // getDomain with no allowPrivateDomains flag set returns root domain,
        // e.g. 'test-public.s3.amazonaws.com' -> 'amazonaws.com'
        (0,tldts__WEBPACK_IMPORTED_MODULE_1__/* .getDomain */ .FB)(url));
        if (!companyCategoryId) {
            return CompaniesDbService.UNKNOWN_CATEGORY_NAME;
        }
        const companyCategoryName = this.companiesDb.categories[companyCategoryId];
        if (!companyCategoryName) {
            return CompaniesDbService.UNKNOWN_CATEGORY_NAME;
        }
        return companyCategoryName;
    }
}
const companiesDbService = new CompaniesDbService();

/**
 * Synthetic Cookie-like object parsed from headers.
 */
class ParsedCookie {
    /**
     * The request-URI to associate with the setting of the cookie.
     */
    url;
    /**
     * Defines the host to which the cookie will be sent.
     * Only the current domain can be set as the value, or a domain of a higher
     * order, unless it is a public suffix. Setting the domain will make
     * the cookie available to it, as well as to all its subdomains.
     *
     * Can be empty. And actually should be empty for `__Host-` cookies.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes}
     */
    domain;
    /**
     * The name of the cookie.
     */
    name;
    /**
     * The value of the cookie.
     */
    value;
    /**
     * The expiration date of the cookie.
     */
    expires;
    /**
     * The parsed max-age value in seconds.
     */
    maxAge;
    /**
     * True if the cookie is marked as Secure.
     */
    secure;
    /**
     * Whether the cookie should be marked as HttpOnly.
     */
    httpOnly;
    /**
     * Cookie's same-site status.
     */
    sameSite;
    /**
     * Cookies path. Defaults to the path portion of the url parameter.
     */
    path;
    /**
     * Priority chrome only specs.
     * Isn't affected. Let it be here just in case.
     *
     * @see {@link https://bugs.chromium.org/p/chromium/issues/detail?id=232693}
     */
    priority;
    /**
     * Cookie's third-party status.
     */
    thirdParty = false;
    /**
     * Constructor.
     *
     * @param name Cookie name.
     * @param value Cookie value.
     * @param url Url.
     */
    constructor(name, value, url) {
        this.name = name;
        this.value = value;
        this.url = url;
        this.path = new URL(url).pathname;
    }
    /**
     * Creates new {@link ParsedCookie} from provided {@link Cookies.Cookie}.
     *
     * @param cookie Item of {@link Cookies.Cookie}.
     * @param url String URL relative to this cookie.
     *
     * @returns New {@link ParsedCookie}.
     */
    static fromBrowserCookie(cookie, url) {
        const parsedCookie = new ParsedCookie(cookie.name, cookie.value, url);
        parsedCookie.thirdParty = !cookie.firstPartyDomain;
        parsedCookie.httpOnly = cookie.httpOnly;
        parsedCookie.secure = cookie.secure;
        parsedCookie.sameSite = cookie.sameSite;
        // For hostOnly cookie domain should be empty and path should be '/'.
        if (cookie.hostOnly) {
            parsedCookie.path = '/';
        }
        else {
            parsedCookie.domain = cookie.domain;
            parsedCookie.path = cookie.path;
        }
        if (cookie.expirationDate) {
            // cookie.expirationDate is a number of seconds that's why it should be multiplied
            parsedCookie.expires = new Date(cookie.expirationDate * 1000);
        }
        return parsedCookie;
    }
}

/**
 * Cookie Utils.
 */
let CookieUtils$1 = class CookieUtils {
    /**
     * RegExp to match field-content in RFC 7230 sec 3.2.
     *
     * Example:
     * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
     * field-vchar   = VCHAR / obs-text
     * obs-text      = %x80-FF.
     */
    // eslint-disable-next-line no-control-regex
    static FIELD_CONTENT_REGEX = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
    /**
     * Parses set-cookie header from http response header.
     *
     * @param header HTTP response header.
     * @param url Request URL.
     *
     * @returns Parsed cookie or null if it failed to parse the header.
     */
    static parseSetCookieHeader(header, url) {
        if (!header.name || header.name.toLowerCase() !== 'set-cookie') {
            return null;
        }
        if (!header.value) {
            return null;
        }
        return CookieUtils.parseSetCookie(header.value, url);
    }
    /**
     * Parses set-cookie headers for cookie objects.
     *
     * @param responseHeaders HTTP response headers.
     * @param url Request URL.
     *
     * @returns Array of parsed cookies.
     */
    static parseSetCookieHeaders(responseHeaders, url) {
        const result = [];
        let iResponseHeaders = responseHeaders.length;
        while (iResponseHeaders > 0) {
            iResponseHeaders -= 1;
            const header = responseHeaders[iResponseHeaders];
            const setCookie = CookieUtils.parseSetCookieHeader(header, url);
            if (setCookie) {
                result.push(setCookie);
            }
        }
        return result;
    }
    /**
     * Parse an HTTP Cookie header string and return an object with all cookie name-value pairs.
     *
     * @param cookieValue HTTP Cookie value.
     * @param url Request URL.
     *
     * @returns Array of cookie name-value pairs.
     */
    static parseCookies(cookieValue, url) {
        const cookies = [];
        // Split Cookie values
        const pairs = cookieValue.split(/; */);
        for (let i = 0; i < pairs.length; i += 1) {
            const pair = pairs[i];
            const eqIdx = pair.indexOf('=');
            // skip things that don't look like key=value
            if (eqIdx < 0) {
                continue;
            }
            const key = pair.substring(0, eqIdx).trim();
            const value = pair.substring(eqIdx + 1, pair.length).trim();
            const parsedCookie = new ParsedCookie(key, value, url);
            /**
             * Not obviously there are few special name prefixes.
             *
             * @see {@link https://developer.cdn.mozilla.net/pt-BR/docs/Web/HTTP/Headers/Set-Cookie}
             */
            if (key.startsWith('__Secure-') || key.startsWith('__Host-')) {
                parsedCookie.secure = true;
            }
            cookies.push(parsedCookie);
        }
        return cookies;
    }
    /**
     * Parses "Set-Cookie" header value and returns a cookie object with its properties.
     *
     * @param setCookieValue "Set-Cookie" header value to parse.
     * @param url Request URL.
     *
     * @returns Parsed cookie or null if it failed to parse the value.
     */
    static parseSetCookie(setCookieValue, url) {
        const parts = setCookieValue.split(';').filter((s) => !!s);
        const nameValuePart = parts.shift();
        if (!nameValuePart) {
            // eslint-disable-next-line max-len
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.debug(`[tswebextension.parseSetCookie]: cannot shift first name-value pair from Set-Cookie header '${setCookieValue}'.`);
            return null;
        }
        const nameValue = nameValuePart.split('=');
        const name = nameValue.shift();
        if (!name) {
            // eslint-disable-next-line max-len
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.debug(`[tswebextension.parseSetCookie]: cannot extract name from first name-value pair from Set-Cookie header '${setCookieValue}'.`);
            return null;
        }
        // Everything after the first =, joined by a "=" if there was more
        // than one part.
        const value = nameValue.join('=');
        const cookie = new ParsedCookie(name, value, url);
        parts.forEach((part) => {
            const sides = part.split('=');
            const key = sides
                .shift()
                .trimStart()
                .toLowerCase();
            const optionValue = sides.join('=');
            if (key === 'expires') {
                cookie.expires = new Date(optionValue);
            }
            else if (key === 'max-age') {
                cookie.maxAge = parseInt(optionValue, 10);
            }
            else if (key === 'secure') {
                cookie.secure = true;
            }
            else if (key === 'httponly') {
                cookie.httpOnly = true;
            }
            else if (key === 'samesite') {
                cookie.sameSite = optionValue;
            }
            else if (key === 'path') {
                cookie.path = optionValue;
            }
            else if (key === 'domain') {
                cookie.domain = optionValue;
            }
        });
        return cookie;
    }
    /**
     * Updates cookie maxAge value.
     *
     * @param cookie Cookie to modify.
     * @param maxAge New maxAge value.
     *
     * @returns True if cookie was modified.
     */
    static updateCookieMaxAge(cookie, maxAge) {
        const currentTimeSec = Date.now() / 1000;
        let cookieExpiresTimeSec = null;
        if (cookie.maxAge) {
            cookieExpiresTimeSec = currentTimeSec + cookie.maxAge;
        }
        else if (cookie.expires) {
            cookieExpiresTimeSec = cookie.expires.getTime() / 1000;
        }
        const newCookieExpiresTimeSec = currentTimeSec + maxAge;
        if (cookieExpiresTimeSec === null || cookieExpiresTimeSec > newCookieExpiresTimeSec) {
            // eslint-disable-next-line no-param-reassign
            cookie.expires = new Date(newCookieExpiresTimeSec * 1000);
            // eslint-disable-next-line no-param-reassign
            cookie.maxAge = maxAge;
            return true;
        }
        return false;
    }
    /**
     * Serializes cookie data into a string suitable for Set-Cookie header.
     *
     * @param cookie A cookie object.
     *
     * @returns Set-Cookie string or null if it failed to serialize object.
     *
     * @throws `TypeError` if input data is invalid.
     */
    static serializeCookieToResponseHeader(cookie) {
        if (!cookie) {
            throw new TypeError('empty cookie data');
        }
        // 1. Validate fields
        if (!CookieUtils.FIELD_CONTENT_REGEX.test(cookie.name)) {
            throw new TypeError(`Cookie name is invalid: ${cookie.name}`);
        }
        if (cookie.value && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.value)) {
            throw new TypeError(`Cookie value is invalid: ${cookie.value}`);
        }
        if (cookie.domain && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.domain)) {
            throw new TypeError(`Cookie domain is invalid: ${cookie.domain}`);
        }
        if (cookie.path && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.path)) {
            throw new TypeError(`Cookie path is invalid: ${cookie.path}`);
        }
        if (cookie.expires && typeof cookie.expires.toUTCString !== 'function') {
            throw new TypeError(`Cookie expires is invalid: ${cookie.expires}`);
        }
        // 2. Build Set-Cookie header value
        let setCookieValue = `${cookie.name}=${cookie.value}`;
        if (typeof cookie.maxAge === 'number' && !Number.isNaN(cookie.maxAge)) {
            setCookieValue += `; Max-Age=${Math.floor(cookie.maxAge)}`;
        }
        if (cookie.domain) {
            setCookieValue += `; Domain=${cookie.domain}`;
        }
        if (cookie.path) {
            setCookieValue += `; Path=${cookie.path}`;
        }
        if (cookie.expires) {
            setCookieValue += `; Expires=${cookie.expires.toUTCString()}`;
        }
        if (cookie.httpOnly) {
            setCookieValue += '; HttpOnly';
        }
        if (cookie.secure) {
            setCookieValue += '; Secure';
        }
        if (cookie.sameSite) {
            const sameSite = cookie.sameSite.toLowerCase();
            switch (sameSite) {
                case 'lax':
                    setCookieValue += '; SameSite=Lax';
                    break;
                case 'strict':
                    setCookieValue += '; SameSite=Strict';
                    break;
                case 'none':
                    setCookieValue += '; SameSite=None';
                    break;
                default:
                    throw new TypeError(`Cookie sameSite is invalid: ${cookie.sameSite}`);
            }
        }
        // Not affected. Let it be here just in case
        // https://bugs.chromium.org/p/chromium/issues/detail?id=232693
        if (cookie.priority) {
            setCookieValue += `; Priority=${cookie.priority}`;
        }
        return setCookieValue;
    }
    /**
     * Serializes cookie data into a string suitable for Cookie header.
     *
     * @param cookies Array with {@link ParsedCookie}.
     *
     * @returns Cookie string or null if it failed to serialize object.
     */
    static serializeCookieToRequestHeader(cookies) {
        return cookies
            .map((cookie) => `${cookie.name}=${cookie.value}`)
            .join('; ');
    }
};

/**
 * See {@link https://developer.chrome.com/docs/web-platform/prerender-pages#how_is_a_page_prerendered}.
 */
var DocumentLifecycle;
(function (DocumentLifecycle) {
    DocumentLifecycle["Prerender"] = "prerender";
    DocumentLifecycle["Active"] = "active";
    DocumentLifecycle["Cached"] = "cached";
    DocumentLifecycle["PendingDeletion"] = "pending_deletion";
})(DocumentLifecycle || (DocumentLifecycle = {}));

/**
 * Finds a header object by its name (case-insensitive).
 *
 * @param headers Headers collection.
 * @param headerName Name of the header.
 *
 * @returns The header object if found, or null otherwise.
 */
function findHeaderByName(headers, headerName) {
    const targetName = headerName.toLowerCase();
    return headers.find((header) => header.name.toLowerCase() === targetName) || null;
}
/**
 * Checks if a header with the given name exists in the headers collection (case-insensitive).
 *
 * @param headers Headers collection.
 * @param headerName Name of the header to search.
 *
 * @returns True if the header exists, false otherwise.
 */
function hasHeaderByName(headers, headerName) {
    return findHeaderByName(headers, headerName) !== null;
}
/**
 * Checks if a specific header (name and value) exists in the headers collection.
 *
 * @param headers Headers collection.
 * @param header The header object to match.
 *
 * @returns True if an exact match for the header exists, false otherwise.
 */
function hasHeader(headers, header) {
    const foundHeader = findHeaderByName(headers, header.name);
    return !!foundHeader && foundHeader.value === header.value;
}
/**
 * Removes a header by name from the headers collection (case-insensitive).
 *
 * @param headers Headers collection.
 * @param headerName Name of the header to remove.
 *
 * @returns True if any headers were removed, false otherwise.
 */
function removeHeader(headers, headerName) {
    const targetName = headerName.toLowerCase();
    return (0,lodash_es__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(headers, (header) => header.name.toLowerCase() === targetName).length > 0;
}

/**
 * Cookie rules manager class.
 */
class CookieRulesFinder {
    /**
     * Filters blocking rules.
     * Used in content scripts.
     *
     * @param url Request url.
     * @param rules List of rules.
     *
     * @returns Blocking rules.
     */
    static getBlockingRules(url, rules) {
        return rules.filter((rule) => !CookieRulesFinder.isModifyingRule(rule));
    }
    /**
     * Finds a rule that doesn't modify cookie:
     *  i.e.: this rule cancels cookie or if it's an allowlist rule.
     *
     * @param cookieName Cookie name.
     * @param rules List of network rules.
     * @param isThirdPartyCookie Flag that indicates if cookie is third-party.
     *
     * @returns Found rule or null.
     */
    static lookupNotModifyingRule(cookieName, rules, isThirdPartyCookie) {
        const blockingRules = [];
        const allowlistRules = [];
        for (let i = 0; i < rules.length; i += 1) {
            const rule = rules[i];
            if (!CookieRulesFinder.matchThirdParty(rule, isThirdPartyCookie)) {
                continue;
            }
            const cookieModifier = rule.getAdvancedModifier();
            if (cookieModifier.matches(cookieName) && !CookieRulesFinder.isModifyingRule(rule)) {
                if (rule.isAllowlist()) {
                    allowlistRules.push(rule);
                }
                else {
                    blockingRules.push(rule);
                }
            }
        }
        if (allowlistRules.length > 0) {
            return allowlistRules[0];
        }
        if (blockingRules.length > 0) {
            return blockingRules[0];
        }
        return null;
    }
    /**
     * Finds rules that modify cookie.
     *
     * @param cookieName Cookie name.
     * @param rules Matching rules.
     * @param isThirdPartyCookie Flag that indicates if cookie is third-party.
     *
     * @returns Modifying rules.
     */
    static lookupModifyingRules(cookieName, rules, isThirdPartyCookie) {
        const result = [];
        const allowlistRules = [];
        if (rules && rules.length > 0) {
            for (let i = 0; i < rules.length; i += 1) {
                const rule = rules[i];
                if (!CookieRulesFinder.matchThirdParty(rule, isThirdPartyCookie)) {
                    continue;
                }
                const cookieModifier = rule.getAdvancedModifier();
                if (!cookieModifier.matches(cookieName)) {
                    continue;
                }
                if (!rule.isAllowlist() && !CookieRulesFinder.isModifyingRule(rule)) {
                    return [];
                }
                if (rule.isAllowlist()) {
                    allowlistRules.push(rule);
                }
                else {
                    result.push(rule);
                }
            }
        }
        if (allowlistRules.length > 0) {
            return allowlistRules;
        }
        return result;
    }
    /**
     * Checks if rule and third party flag matches.
     *
     * @param rule Rule.
     * @param isThirdParty Flag that indicates if cookie is third-party.
     *
     * @returns True if rule and third party flag matches.
     */
    static matchThirdParty(rule, isThirdParty) {
        if (!rule.isOptionEnabled(_adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .NetworkRuleOption */ .iR.ThirdParty)) {
            return true;
        }
        return isThirdParty === rule.isOptionEnabled(_adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .NetworkRuleOption */ .iR.ThirdParty);
    }
    /**
     * Checks if $cookie rule is modifying.
     *
     * @param rule $cookie rule.
     *
     * @returns True if rule is modifying.
     */
    static isModifyingRule(rule) {
        const cookieModifier = rule.getAdvancedModifier();
        return cookieModifier.getSameSite() !== null
            || (cookieModifier.getMaxAge() !== null && cookieModifier.getMaxAge() > 0);
    }
}

/* eslint-disable class-methods-use-this */
/**
 * Cookie api implementation.
 */
class BrowserCookieApi {
    /**
     * Removes cookie.
     *
     * @param name Cookie name.
     * @param url Request url.
     *
     * @returns True if cookie was removed.
     */
    async removeCookie(name, url) {
        try {
            await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.cookies.remove({ name, url });
            return true;
        }
        catch (e) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.error('[tswebextension.removeCookie]: error on removing cookie via browser.cookies.remove: ', e);
        }
        return false;
    }
    /**
     * Updates cookie.
     *
     * @param cookie Cookie for update.
     *
     * @returns Promise resolved with true if cookie was updated, false otherwise.
     */
    async modifyCookie(cookie) {
        try {
            const update = BrowserCookieApi.convertToSetDetailsType(cookie);
            await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.cookies.set(update);
            return true;
        }
        catch (e) {
            // If `domain` contains the `path` part, the cookie cannot be saved,
            // since `domain` can only contain hostname.
            if (cookie.domain?.includes('/')
                // if url is not matched with domain, cookie cannot be set
                // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2683
                || (cookie.domain && !BrowserCookieApi.doesDomainMatchUrl(cookie.domain, cookie.url))) {
                _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.info('[tswebextension.modifyCookie]: error on modifying cookie via browser.cookies.set: ', e);
            }
            else {
                _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.error('[tswebextension.modifyCookie]: error on modifying cookie via browser.cookies.set: ', e);
            }
        }
        return false;
    }
    /**
     * Search for cookies that match a given pattern.
     *
     * @param pattern Pattern of cookies to find.
     *
     * @returns List of found cookies.
     */
    async findCookies(pattern) {
        try {
            const found = await webextension_polyfill__WEBPACK_IMPORTED_MODULE_0__.cookies.getAll(pattern);
            return found;
        }
        catch (e) {
            _logger_js__WEBPACK_IMPORTED_MODULE_6__.l.error('[tswebextension.findCookies]: error on finding cookies via browser.cookies.getAll: ', e);
        }
        return [];
    }
    /**
     * Checks whether the cookie domain matches the url.
     *
     * @param rawCookieDomain Cookie domain.
     * @param url Request url.
     *
     * @returns True if domain matches the url, false otherwise.
     */
    static doesDomainMatchUrl(rawCookieDomain, url) {
        let cookieDomain = rawCookieDomain;
        // cookie domain can be '.example.com'
        if (cookieDomain.startsWith('.')) {
            cookieDomain = cookieDomain.slice(1);
        }
        const urlDomain = (0,tldts__WEBPACK_IMPORTED_MODULE_1__/* .getDomain */ .FB)(url);
        return !!urlDomain && cookieDomain.includes(urlDomain);
    }
    /**
     * Converts cookie to SetDetailsType.
     *
     * @param cookie Cookie for convert.
     *
     * @returns SetDetailsType.
     */
    static convertToSetDetailsType(cookie) {
        return {
            /**
             * The request-URI to associate with the setting of the cookie.
             * This value can affect the default domain and path values of the created cookie.
             * If host permissions for this URL are not specified in the manifest file, the API call will fail.
             */
            url: cookie.url,
            /**
             * The name of the cookie. Empty by default if omitted.
             */
            name: cookie.name,
            /**
             * The value of the cookie. Empty by default if omitted.
             */
            value: cookie.value,
            /**
             * The domain of the cookie. If omitted, the cookie becomes a host-only cookie.
             */
            domain: cookie.domain,
            /**
             * Whether the cookie should be marked as Secure. Defaults to false.
             */
            secure: cookie.secure,
            /**
             * Whether the cookie should be marked as HttpOnly. Defaults to false.
             */
            httpOnly: cookie.httpOnly,
            /**
             * The cookie's same-site status.
             */
            sameSite: BrowserCookieApi.getSameSiteStatus(cookie.sameSite),
            /**
             * The expiration date of the cookie as the number of seconds since the UNIX epoch.
             * If omitted, the cookie becomes a session cookie.
             */
            expirationDate: cookie.expires
                ? Math.floor(cookie.expires.getTime() / 1000)
                : undefined,
            /**
             * The path of the cookie. Defaults to the path portion of the url parameter.
             */
            path: cookie.path,
        };
    }
    /**
     * Returns same-site type.
     *
     * @param sameSite Same-site string.
     *
     * @returns Same-site status or undefined if same-site is not specified.
     */
    static getSameSiteStatus(sameSite) {
        if (sameSite) {
            if (sameSite.toLowerCase() === 'lax') {
                return 'lax';
            }
            if (sameSite.toLowerCase() === 'strict') {
                return 'strict';
            }
        }
        return undefined;
    }
}

/**
 * Checks if error has message.
 *
 * @param error Error object.
 *
 * @returns If param is error.
 */
function isErrorWithMessage(error) {
    return (typeof error === 'object'
        && error !== null
        && 'message' in error
        && typeof error.message === 'string');
}
/**
 * Converts error to the error with message.
 *
 * @param maybeError Possible error.
 *
 * @returns Error with message.
 */
function toErrorWithMessage(maybeError) {
    if (isErrorWithMessage(maybeError)) {
        return maybeError;
    }
    try {
        return new Error(JSON.stringify(maybeError));
    }
    catch {
        // fallback in case there's an error stringifying the maybeError
        // like with circular references for example.
        return new Error(String(maybeError));
    }
}
/**
 * Converts error object to error with message. This method might be helpful to handle thrown errors.
 *
 * @param error Error object.
 *
 * @returns Message of the error.
 */
function getErrorMessage(error) {
    return toErrorWithMessage(error).message;
}

/**
 * Stealth action bitwise masks used on the background page and on the filtering log page.
 */
var StealthActions;
(function (StealthActions) {
    StealthActions[StealthActions["None"] = 0] = "None";
    StealthActions[StealthActions["HideReferrer"] = 1] = "HideReferrer";
    StealthActions[StealthActions["HideSearchQueries"] = 2] = "HideSearchQueries";
    StealthActions[StealthActions["BlockChromeClientData"] = 4] = "BlockChromeClientData";
    StealthActions[StealthActions["SendDoNotTrack"] = 8] = "SendDoNotTrack";
    // TODO check where this enums are used, and add comments
    StealthActions[StealthActions["FirstPartyCookies"] = 16] = "FirstPartyCookies";
    StealthActions[StealthActions["ThirdPartyCookies"] = 32] = "ThirdPartyCookies";
})(StealthActions || (StealthActions = {}));

var version = "3.1.0-alpha.3";
var packageJson = {
	version: version};

/**
 * Re-export needed to print the library version on the extension About page.
 * NOTE: We are directly re-exporting `version` from `package.json` to prevent
 * environment runtime errors, like call `window.console`, which is not available
 * in the service worker in MV3. And also to avoid bundle size getting larger.
 */
const TSWEBEXTENSION_VERSION = packageJson.version;
/**
 * Stealth mode configuration schema.
 */
const stealthConfigValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    /**
     * Should the application set a fixed lifetime from
     * {@link StealthConfig.selfDestructFirstPartyCookiesTime} for first-party
     * cookies.
     */
    selfDestructFirstPartyCookies: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Time in minutes to delete first-party cookies.
     */
    selfDestructFirstPartyCookiesTime: zod__WEBPACK_IMPORTED_MODULE_7__.z.number(),
    /**
     * Should the application set a fixed lifetime from
     * {@link StealthConfig.selfDestructThirdPartyCookiesTime} for third-party
     * cookies.
     */
    selfDestructThirdPartyCookies: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Time in minutes to delete third-party cookies.
     */
    selfDestructThirdPartyCookiesTime: zod__WEBPACK_IMPORTED_MODULE_7__.z.number(),
    /**
     * Should the application hide the origin referrer in third-party requests
     * by replacing the referrer url with the request url.
     */
    hideReferrer: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Should the application hide the original referrer from the search page
     * containing the search query in third-party queries, replacing
     * the referrer url with the request url.
     */
    hideSearchQueries: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * For Google Chrome, it removes the 'X-Client-Data' header from
     * the requests, which contains information about the browser version
     * and modifications.
     */
    blockChromeClientData: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Includes HTTP headers 'DNT' and 'Sec-GPC' in all requests.
     *
     * @see https://en.wikipedia.org/wiki/Do_Not_Track
     * @see https://globalprivacycontrol.org
     */
    sendDoNotTrack: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Blocks the possibility of leaking your IP address through WebRTC, even if
     * you use a proxy server or VPN.
     */
    blockWebRTC: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
}).strict();
/**
 * Filter list configuration validator for MV2.
 */
const basicFilterValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    /**
     * Filter list text content.
     */
    content: _adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .filterListChunksValidator */ .B8,
    /**
     * Source map.
     */
    sourceMap: _adguard_tsurlfilter__WEBPACK_IMPORTED_MODULE_3__/* .filterListSourceMapValidator */ .kA.optional(),
});
/**
 * Settings configuration schema.
 */
const settingsConfigValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    /**
     * If this flag is true, the application will work ONLY with domains
     * from the {@link Configuration.allowlist},
     * otherwise it will work everywhere EXCLUDING domains from the list.
     */
    allowlistInverted: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Flag specifying {@link Configuration.allowlist} enable state.
     * We don't use allowlist array length condition for calculate enable state,
     * because it's not cover case with empty list in inverted mode.
     */
    allowlistEnabled: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Enables css hits counter if true.
     */
    collectStats: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Enables verbose scriptlets logging if true.
     */
    debugScriptlets: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean().default(false),
    /**
     * Enables stealth mode if true.
     */
    stealthModeEnabled: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Enables filtering if true.
     */
    filteringEnabled: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean(),
    /**
     * Redirect url for $document rules.
     */
    documentBlockingPageUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string().optional(),
    /**
     * Path to the assembled @adguard/assistant module. Necessary for lazy
     * on-demand loading of the assistant.
     */
    assistantUrl: zod__WEBPACK_IMPORTED_MODULE_7__.z.string(),
    /**
     * Stealth mode options.
     */
    stealth: stealthConfigValidator,
});
/**
 * Generic app configuration schema.
 */
const configurationValidator = zod__WEBPACK_IMPORTED_MODULE_7__.z.object({
    /**
     * List of hostnames or domains of sites, which should be excluded
     * from blocking or which should be included in blocking
     * depending on the value of {@link SettingsConfig.allowlistInverted} setting value.
     */
    allowlist: zod__WEBPACK_IMPORTED_MODULE_7__.z.string().array(),
    /**
     * List of rules added by user.
     */
    userrules: basicFilterValidator,
    /**
     * Flag responsible for logging.
     *
     * @deprecated  Will be removed in the next minor version.
     * Use {@link Configuration.logLevel} instead.
     */
    verbose: zod__WEBPACK_IMPORTED_MODULE_7__.z.boolean().optional(),
    /**
     * Logging level.
     */
    logLevel: zod__WEBPACK_IMPORTED_MODULE_7__.z.enum([
        _adguard_logger__WEBPACK_IMPORTED_MODULE_2__/* .LogLevel */ .$.Error,
        _adguard_logger__WEBPACK_IMPORTED_MODULE_2__/* .LogLevel */ .$.Warn,
        _adguard_logger__WEBPACK_IMPORTED_MODULE_2__/* .LogLevel */ .$.Info,
        _adguard_logger__WEBPACK_IMPORTED_MODULE_2__/* .LogLevel */ .$.Debug,
        _adguard_logger__WEBPACK_IMPORTED_MODULE_2__/* .LogLevel */ .$.Trace,
    ]).optional(),
    settings: settingsConfigValidator,
}).strict();




/***/ }),

/***/ 11911:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ ALLOWLIST_FILTER_ID),
/* harmony export */   L: () => (/* binding */ LF),
/* harmony export */   M: () => (/* binding */ MAIN_FRAME_ID),
/* harmony export */   N: () => (/* binding */ NO_PARENT_FRAME_ID),
/* harmony export */   S: () => (/* binding */ SEMICOLON),
/* harmony export */   U: () => (/* binding */ USER_FILTER_ID)
/* harmony export */ });
/* unused harmony exports B, C, F, Q */
/**
 * Filter ID which is used for User rules.
 */
const USER_FILTER_ID = 0;
/**
 * Filter ID which is used for Allowlist.
 */
const ALLOWLIST_FILTER_ID = 100;
/**
 * Custom filters identifiers starts from this number.
 */
const CUSTOM_FILTERS_START_ID = 1000;
/**
 * Filter ID for AdGuard Quick Fixes filter.
 *
 * @see {@link https://github.com/AdguardTeam/FiltersRegistry/blob/master/filters/filter_24_QuickFixes/metadata.json}
 */
const QUICK_FIXES_FILTER_ID = 24;
/**
 * Tab ID for background page.
 */
const BACKGROUND_TAB_ID = (/* unused pure expression or super */ null && (-1));
/**
 * Line feed character.
 */
const LF = '\n';
/**
 * Semicolon character.
 */
const SEMICOLON = ';';
/**
 * Timeout used for deletion of request context data and frame context data from the storage.
 */
const FRAME_DELETION_TIMEOUT_MS = 3000;
/**
 * Document level frame id.
 */
const MAIN_FRAME_ID = 0;
/**
 * Value of the parent frame id if no parent frame exists.
 *
 * @see {@link https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest#parentframeid}
 */
const NO_PARENT_FRAME_ID = -1;




/***/ }),

/***/ 68916:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   l: () => (/* binding */ logger)
/* harmony export */ });
/* unused harmony export s */
/* harmony import */ var _adguard_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38200);


/**
 * Export logger implementation.
 */
const logger = new _adguard_logger__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V(console);
/**
 * Stringify object via JSON.stringify without specified keys.
 *
 * @param obj Object to stringify.
 * @param excludedKeys Keys to exclude.
 *
 * @returns Stringified object without excludedKeys (checking nested keys too).
 */
const stringifyObjectWithoutKeys = (obj, excludedKeys) => {
    return JSON.stringify(obj, (key, value) => (excludedKeys.includes(key) ? undefined : value), 2);
};




/***/ }),

/***/ 21737:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ MessageType),
/* harmony export */   a: () => (/* binding */ MESSAGE_HANDLER_NAME)
/* harmony export */ });
/**
 * @file
 * This file contains constants for communication between background and content scripts.
 * This constants are separated from message.ts to reduce bundle size,
 * because rollup cannot tree-shake tswebextension library code.
 */
/**
 * Name of the message handler.
 * It is needed for determining specific tswebextension message from other messages.
 */
const MESSAGE_HANDLER_NAME = 'tsWebExtension';
/**
 * Message types for communication between background and content scripts.
 */
var MessageType;
(function (MessageType) {
    MessageType["ProcessShouldCollapse"] = "processShouldCollapse";
    MessageType["GetCosmeticData"] = "getCosmeticData";
    MessageType["GetCookieRules"] = "getCookieRules";
    MessageType["SaveCookieLogEvent"] = "saveCookieLogEvent";
    MessageType["InitAssistant"] = "initAssistant";
    MessageType["CloseAssistant"] = "closeAssistant";
    MessageType["AssistantCreateRule"] = "assistantCreateRule";
    MessageType["SaveCssHitsStats"] = "saveCssHitsStats";
})(MessageType || (MessageType = {}));




/***/ }),

/***/ 9680:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   r: () => (/* binding */ rawCompaniesDb)
/* harmony export */ });
const rawCompaniesDb = {
    "timeUpdated": "2025-05-19T10:05:12.099Z",
    "categories": {
        "0": "audio_video_player",
        "1": "comments",
        "2": "customer_interaction",
        "3": "pornvertising",
        "4": "advertising",
        "5": "essential",
        "6": "site_analytics",
        "7": "social_media",
        "8": "misc",
        "9": "cdn",
        "10": "hosting",
        "11": "unknown",
        "12": "extensions",
        "13": "email",
        "14": "consent",
        "15": "telemetry",
        "101": "mobile_analytics"
    },
    "trackerDomains": {
        "mmtro.com": 6,
        "creative-serving.com": 4,
        "p161.net": 4,
        "analytics.163.com": 4,
        "1822direkt.de": 8,
        "1dmp.io": 4,
        "opecloud.com": 6,
        "1sponsor.com": 4,
        "tm.dentsu.de": 6,
        "1and1.com": 8,
        "1und1.de": 8,
        "uicdn.com": 8,
        "website-start.de": 8,
        "24-ads.com": 4,
        "247-inc.net": 2,
        "d1af033869koo7.cloudfront.net": 2,
        "counter.24log.ru": 6,
        "24smi.net": 8,
        "24smi.org": 8,
        "2leep.com": 4,
        "33across.com": 4,
        "3dstats.com": 6,
        "3gpp.org": 5,
        "3gppnetwork.org": 5,
        "4cdn.org": 8,
        "4finance.com": 2,
        "4wnet.com": 4,
        "d3aa0ztdn3oibi.cloudfront.net": 2,
        "51.la": 6,
        "5min.com": 0,
        "d1lm7kd3bd3yo9.cloudfront.net": 6,
        "grepdata.com": 6,
        "77tracking.com": 6,
        "swm.digital": 0,
        "7tv.de": 0,
        "888media.net": 4,
        "hit.8digits.com": 6,
        "94j7afz2nr.xyz": 12,
        "statsanalytics.com": 6,
        "a3cloud.net": 11,
        "a8.net": 4,
        "aaxads.com": 4,
        "abtasty.com": 6,
        "d1447tq2m68ekg.cloudfront.net": 6,
        "ab.co": 8,
        "abc-cdn.net.au": 8,
        "abc-host.net": 8,
        "abc-host.net.au": 8,
        "abc-prod.net.au": 8,
        "abc-stage.net.au": 8,
        "abc-test.net.au": 8,
        "abc.net.au": 8,
        "abcaustralia.net.au": 8,
        "abcradio.net.au": 8,
        "ablida.de": 4,
        "ablida.net": 4,
        "durasite.net": 4,
        "accengage.net": 4,
        "ax.xrea.com": 6,
        "accesstrade.net": 4,
        "agcdn.com": 4,
        "accmgr.com": 4,
        "p-td.com": 4,
        "acestream.net": 12,
        "acint.net": 6,
        "acloudimages.com": 4,
        "acpm.fr": 6,
        "acquia.com": 6,
        "ziyu.net": 7,
        "actionpay.ru": 4,
        "adnwb.ru": 4,
        "adonweb.ru": 4,
        "active-agent.com": 4,
        "trackcmp.net": 6,
        "active-srv02.de": 4,
        "active-tracking.de": 4,
        "activeconversion.com": 4,
        "a-cast.jp": 6,
        "activemeter.com": 4,
        "go.activengage.com": 2,
        "actonsoftware.com": 4,
        "acuityplatform.com": 4,
        "acxiom-online.com": 4,
        "acxiom.com": 4,
        "ad-blocker.org": 11,
        "ads.ad-center.com": 6,
        "ad-delivery.net": 11,
        "ad-sys.com": 4,
        "adagionet.com": 4,
        "ad2click.go2cloud.org": 4,
        "ad2games.com": 4,
        "ad360.vn": 4,
        "ads.ad4game.com": 4,
        "ad4mat.ar": 4,
        "ad4mat.at": 4,
        "ad4mat.be": 4,
        "ad4mat.bg": 4,
        "ad4mat.br": 4,
        "ad4mat.ch": 4,
        "ad4mat.co.uk": 4,
        "ad4mat.cz": 4,
        "ad4mat.de": 4,
        "ad4mat.dk": 4,
        "ad4mat.es": 4,
        "ad4mat.fi": 4,
        "ad4mat.fr": 4,
        "ad4mat.gr": 4,
        "ad4mat.hu": 4,
        "ad4mat.it": 4,
        "ad4mat.mx": 4,
        "ad4mat.net": 4,
        "ad4mat.nl": 4,
        "ad4mat.no": 4,
        "ad4mat.pl": 4,
        "ad4mat.ro": 4,
        "ad4mat.ru": 4,
        "ad4mat.se": 4,
        "ad4mat.tr": 4,
        "ad6.fr": 4,
        "ad6media.co.uk": 4,
        "ad6media.com": 4,
        "ad6media.es": 4,
        "ad6media.fr": 4,
        "a2dfp.net": 4,
        "addynamo.net": 4,
        "ebis.ne.jp": 4,
        "adlightning.com": 4,
        "admagnet.net": 4,
        "amimg.net": 4,
        "adspirit.de": 4,
        "adspirit.net": 4,
        "adac.de": 8,
        "adacado.com": 4,
        "ozonemedia.com": 4,
        "adrtx.net": 4,
        "adalliance.io": 4,
        "adalyser.com": 6,
        "adaos-ads.net": 4,
        "adap.tv": 4,
        "smrtlnks.com": 2,
        "yieldoptimizer.com": 4,
        "adnetwork.adasiaholdings.com": 4,
        "adbetclickin.pink": 4,
        "adbetnet.com": 4,
        "adblade.com": 4,
        "adbooth.com": 4,
        "adbooth.net": 4,
        "adbox.lv": 4,
        "adbrn.com": 6,
        "adbrite.com": 4,
        "adbull.com": 4,
        "adbutler.com": 4,
        "adc-serv.net": 4,
        "adc-srv.net": 4,
        "adcash.com": 4,
        "vuroll.in": 6,
        "acs86.com": 4,
        "csbew.com": 4,
        "irs09.com": 4,
        "adcito.com": 4,
        "adcitomedia.com": 4,
        "adclear.net": 4,
        "swift.adclerks.com": 4,
        "adclickmedia.com": 4,
        "adclickzone.go2cloud.org": 4,
        "ad-cloud.jp": 4,
        "admarvel.s3.amazonaws.com": 4,
        "ads.admarvel.com": 4,
        "adcolony.com": 4,
        "adrdgt.com": 4,
        "amgdgt.com": 4,
        "adcrowd.com": 4,
        "shop2market.com": 4,
        "addtocalendar.com": 2,
        "dpmsrv.com": 4,
        "yagiay.com": 4,
        "addfreestats.com": 6,
        "addinto.com": 2,
        "addshoppers.com": 7,
        "shop.pe": 7,
        "addthis.com": 4,
        "addthiscdn.com": 4,
        "addthisedge.com": 4,
        "b2btracking.addvalue.de": 6,
        "addyon.com": 4,
        "adeasy.ru": 4,
        "ipredictive.com": 6,
        "adengage.com": 4,
        "adespresso.com": 4,
        "adexcite.com": 4,
        "adextent.com": 4,
        "adf.ly": 4,
        "adfalcon.com": 4,
        "adfoc.us": 4,
        "js.adforgames.com": 4,
        "adform.net": 4,
        "adformdsp.net": 4,
        "seadform.net": 4,
        "adfox.ru": 4,
        "adwolf.ru": 4,
        "adfreestyle.pl": 4,
        "adfront.org": 4,
        "adfrontiers.com": 4,
        "adgebra.co.in": 4,
        "adgenie.co.uk": 4,
        "ad.adgile.com": 4,
        "ad.antventure.com": 4,
        "adglare.net": 4,
        "adsafety.net": 4,
        "smartadcheck.de": 4,
        "smartredirect.de": 4,
        "adgorithms.com": 4,
        "adgoto.com": 4,
        "adguard.com": 8,
        "adguard.app": 8,
        "adguard.info": 8,
        "adguard.io": 8,
        "adguard.org": 8,
        "adtidy.org": 8,
        "agrd.io": 8,
        "agrd.eu": 8,
        "adguard-dns.com": 8,
        "adguard-dns.io": 8,
        "adguard-vpn.com": 8,
        "adguard-vpn.online": 8,
        "adguardvpn.com": 8,
        "adhands.ru": 4,
        "adhese.be": 4,
        "adhese.com": 4,
        "adhese.net": 4,
        "adhitzads.com": 4,
        "adhood.com": 4,
        "afy11.net": 4,
        "cdn.adikteev.com": 4,
        "adimpact.com": 4,
        "adinch.com": 4,
        "adition.com": 4,
        "adjal.com": 4,
        "cdn.adjs.net": 4,
        "adjug.com": 4,
        "adjust.com": 101,
        "adj.st": 101,
        "adjust.io": 101,
        "adjust.net.in": 101,
        "adjust.world": 101,
        "apptrace.com": 101,
        "adk2.com": 4,
        "cdn.adsrvmedia.com": 4,
        "cdn.cdnrl.com": 4,
        "adklip.com": 4,
        "adkengage.com": 4,
        "adknowledge.com": 4,
        "bidsystem.com": 4,
        "blogads.com": 4,
        "cubics.com": 4,
        "yarpp.org": 4,
        "adsearch.adkontekst.pl": 4,
        "netsprint.eu": 4,
        "adlabs.ru": 4,
        "clickiocdn.com": 4,
        "luxup.ru": 4,
        "mixmarket.biz": 4,
        "ad-serverparc.nl": 4,
        "adimg.net": 4,
        "adlantis.jp": 4,
        "cdn.adless.io": 4,
        "api.publishers.adlive.io": 4,
        "adlooxtracking.com": 4,
        "adx1.com": 4,
        "adman.gr": 4,
        "adman.in.gr": 4,
        "admanmedia.com": 4,
        "admantx.com": 4,
        "admaster.net": 4,
        "cdnmaster.com": 4,
        "admaster.com.cn": 4,
        "admasterapi.com": 4,
        "admatic.com.tr": 4,
        "ads5.admatic.com.tr": 4,
        "cdn2.admatic.com.tr": 4,
        "lib-3pas.admatrix.jp": 4,
        "admaxserver.com": 4,
        "admaxim.com": 4,
        "admaya.in": 4,
        "admedia.com": 4,
        "adizio.com": 4,
        "admedo.com": 4,
        "admeira.ch": 4,
        "admeld.com": 4,
        "admeo.ru": 4,
        "admaym.com": 4,
        "atemda.com": 4,
        "admicro.vn": 4,
        "vcmedia.vn": 4,
        "admitad.com": 4,
        "admixer.net": 4,
        "admixer.com": 4,
        "admized.com": 8,
        "admo.tv": 4,
        "a.admob.com": 4,
        "mm.admob.com": 4,
        "mmv.admob.com": 4,
        "p.admob.com": 4,
        "run.admost.com": 4,
        "dmmotion.com": 4,
        "nspmotion.com": 4,
        "admulti.com": 4,
        "adnegah.net": 4,
        "adnet.vn": 4,
        "adnet.biz": 4,
        "adnet.de": 4,
        "adclick.lt": 4,
        "adnet.lt": 4,
        "ad.adnetwork.net": 4,
        "adnetworkperformance.com": 11,
        "adserver.adnexio.com": 4,
        "adnium.com": 4,
        "heias.com": 4,
        "smaclick.com": 4,
        "st-n.ads3-adnow.com": 4,
        "adnymics.com": 4,
        "adobe.com": 4,
        "demdex.net": 4,
        "everestjs.net": 4,
        "everesttech.net": 4,
        "adobe.io": 8,
        "scene7.com": 4,
        "adobedtm.com": 5,
        "2o7.net": 6,
        "du8783wkf05yr.cloudfront.net": 6,
        "hitbox.com": 6,
        "imageg.net": 6,
        "nedstat.com": 6,
        "omtrdc.net": 6,
        "sitestat.com": 6,
        "adobedc.net": 6,
        "adobelogin.com": 2,
        "adobetag.com": 4,
        "typekit.com": 5,
        "typekit.net": 5,
        "adocean.pl": 4,
        "dmtry.com": 4,
        "adomik.com": 4,
        "adcde.com": 4,
        "addlvr.com": 4,
        "adfeedstrk.com": 4,
        "adtrgt.com": 4,
        "bannertgt.com": 4,
        "cptgt.com": 4,
        "cpvfeed.com": 4,
        "cpvtgt.com": 4,
        "mygeek.com": 4,
        "popcde.com": 4,
        "sdfje.com": 4,
        "urtbk.com": 4,
        "adonion.com": 4,
        "t.adonly.com": 4,
        "adoperator.com": 4,
        "adoric.com": 6,
        "adorika.com": 4,
        "adorika.net": 4,
        "adosia.com": 4,
        "adotmob.com": 4,
        "adotube.com": 4,
        "adparlor.com": 4,
        "adparlour.com": 4,
        "a4p.adpartner.pro": 4,
        "adpeepshosted.com": 4,
        "adperfect.com": 4,
        "adperium.com": 4,
        "adpilot.at": 4,
        "erne.co": 4,
        "adplan-ds.com": 4,
        "advg.jp": 4,
        "c.p-advg.com": 4,
        "adplus.co.id": 4,
        "adprofex.com": 4,
        "ads2.bid": 4,
        "adframesrc.com": 4,
        "adserve.adpulse.ir": 4,
        "ads.adpv.com": 4,
        "adreactor.com": 4,
        "adrecord.com": 4,
        "adrecover.com": 4,
        "ad.vcm.jp": 4,
        "adresult.jp": 4,
        "adriver.ru": 4,
        "adroll.com": 4,
        "adrom.net": 4,
        "txt.eu": 4,
        "adru.net": 4,
        "adrunnr.com": 4,
        "adsame.com": 4,
        "adsbookie.com": 4,
        "adscale.de": 4,
        "adscience.nl": 4,
        "adsco.re": 4,
        "adsensecamp.com": 4,
        "adserverpub.com": 4,
        "online.adservicemedia.dk": 4,
        "adsfactor.net": 4,
        "ads.doclix.com": 4,
        "adskeeper.co.uk": 4,
        "ssp.adskom.com": 4,
        "adslot.com": 4,
        "adsnative.com": 4,
        "adsniper.ru": 4,
        "adspeed.com": 4,
        "adspeed.net": 4,
        "o333o.com": 4,
        "adstage-analytics.herokuapp.com": 4,
        "code.adstanding.com": 4,
        "adstars.co.id": 4,
        "ad-stir.com": 4,
        "4dsply.com": 4,
        "cdn.engine.adsupply.com": 4,
        "trklnks.com": 4,
        "adswizz.com": 4,
        "adtaily.com": 4,
        "adtaily.pl": 4,
        "adtarget.me": 4,
        "adtech.de": 6,
        "adtechus.com": 6,
        "adtegrity.net": 4,
        "adtpix.com": 4,
        "adtelligence.de": 4,
        "adentifi.com": 4,
        "adthink.com": 4,
        "advertstream.com": 4,
        "audienceinsights.net": 4,
        "adtiger.de": 4,
        "adtimaserver.vn": 4,
        "adtng.com": 3,
        "adtoma.com": 4,
        "adtomafusion.com": 4,
        "adtr02.com": 11,
        "track.adtraction.com": 4,
        "adtraxx.de": 4,
        "adtriba.com": 6,
        "adtrue.com": 4,
        "adtrustmedia.com": 4,
        "ad.adtube.ir": 4,
        "awempire.com": 3,
        "dditscdn.com": 3,
        "livejasmin.com": 3,
        "adultadworld.com": 3,
        "adworldmedia.com": 3,
        "adup-tech.com": 4,
        "advaction.ru": 4,
        "aucourant.info": 4,
        "schetu.net": 4,
        "dqfw2hlp4tfww.cloudfront.net": 4,
        "ahcdn.com": 9,
        "pix-cdn.org": 9,
        "s3.advarkads.com": 4,
        "adventori.com": 8,
        "adnext.fr": 4,
        "adverline.com": 4,
        "surinter.net": 4,
        "adversaldisplay.com": 4,
        "adversalservers.com": 4,
        "go.adversal.com": 4,
        "adverserve.net": 4,
        "ad.adverteerdirect.nl": 4,
        "adverticum.net": 4,
        "advertise.com": 4,
        "advertisespace.com": 4,
        "adsdk.com": 4,
        "advertising.com": 4,
        "aol.com": 4,
        "atwola.com": 4,
        "pictela.net": 4,
        "verizonmedia.com": 4,
        "advertlets.com": 4,
        "advertserve.com": 4,
        "advidi.com": 4,
        "am10.ru": 4,
        "am15.net": 4,
        "advolution.de": 4,
        "adwebster.com": 4,
        "ads.adwitserver.com": 4,
        "adworx.at": 4,
        "adworxs.net": 4,
        "adxion.com": 4,
        "adxpansion.com": 3,
        "ads.adxpose.com": 4,
        "event.adxpose.com": 4,
        "servedby.adxpose.com": 4,
        "adxprtz.com": 4,
        "adyoulike.com": 4,
        "omnitagjs.com": 4,
        "adzerk.net": 4,
        "adzly.com": 4,
        "aemediatraffic.com": 6,
        "hprofits.com": 6,
        "amxdt.com": 4,
        "aerisapi.com": 2,
        "aerisweather.com": 2,
        "affectv.com": 4,
        "go.affec.tv": 4,
        "hybridtheory.com": 4,
        "affilbox.com": 4,
        "affilbox.cz": 4,
        "track.affiliate-b.com": 4,
        "affiliate4you.nl": 4,
        "ads.affbuzzads.com": 4,
        "affiliatefuture.com": 4,
        "affiliatelounge.com": 4,
        "affiliation-france.com": 4,
        "affiliator.com": 4,
        "affiliaweb.fr": 4,
        "banner-rotation.com": 4,
        "webmasterplan.com": 4,
        "affimax.de": 4,
        "affinity.com": 4,
        "countby.com": 4,
        "affiz.net": 4,
        "pml.afftrack.com": 6,
        "afgr2.com": 3,
        "v2.afilio.com.br": 6,
        "afsanalytics.com": 6,
        "ads.aftonbladet.se": 4,
        "aftv-serving.bid": 4,
        "agkn.com": 4,
        "agilone.com": 6,
        "adview.pl": 4,
        "pingagenow.com": 7,
        "aimediagroup.com": 4,
        "advombat.ru": 4,
        "aidata.io": 4,
        "aim4media.com": 4,
        "muscache.com": 6,
        "musthird.com": 6,
        "airbrake.io": 4,
        "airpr.com": 6,
        "ab.airpush.com": 4,
        "abmr.net": 9,
        "akamai.net": 9,
        "akamaihd.net": 9,
        "akamaized.net": 9,
        "akstat.io": 9,
        "edgekey.net": 9,
        "edgesuite.net": 9,
        "imiclk.com": 9,
        "akadns.net": 9,
        "akamaiedge.net": 9,
        "akaquill.net": 9,
        "akamoihd.net": 12,
        "adn-d.sp.gmossp-sp.jp": 4,
        "akanoo.com": 6,
        "akavita.com": 4,
        "ads.albawaba.com": 4,
        "serve.albacross.com": 4,
        "aldi-international.com": 8,
        "alenty.com": 4,
        "alephd.com": 4,
        "alexametrics.com": 6,
        "d31qbv1cthcecs.cloudfront.net": 6,
        "d5nxst8fruw4z.cloudfront.net": 6,
        "alexa.com": 4,
        "algolia.com": 4,
        "algolia.net": 4,
        "algovid.com": 11,
        "alibaba.com": 8,
        "alicdn.com": 8,
        "aliapp.org": 8,
        "alibabachengdun.com": 8,
        "alibabausercontent.com": 8,
        "aliexpress.com": 8,
        "alikunlun.com": 8,
        "aliyuncs.com": 8,
        "alibabacloud.com": 10,
        "alibabadns.com": 10,
        "aliyun.com": 10,
        "ucweb.com": 8,
        "alipay.com": 2,
        "alipayobjects.com": 2,
        "websitealive.com": 2,
        "allegroimg.com": 8,
        "allegrostatic.com": 8,
        "allegrostatic.pl": 8,
        "ngacm.com": 8,
        "ngastatic.com": 8,
        "i.btg360.com.br": 6,
        "allo-pages.fr": 2,
        "allotraffic.com": 4,
        "edge.alluremedia.com.au": 4,
        "allyes.com": 4,
        "inputs.alooma.com": 4,
        "arena.altitude-arena.com": 4,
        "amadesa.com": 4,
        "amap.com": 2,
        "amazon.ca": 8,
        "amazon.co.jp": 8,
        "amazon.co.uk": 8,
        "amazon.com": 8,
        "amazon.de": 8,
        "amazon.es": 8,
        "amazon.fr": 8,
        "amazon.it": 8,
        "d3io1k5o0zdpqr.cloudfront.net": 8,
        "a2z.com": 8,
        "aamazoncognito.com": 8,
        "amazon-corp.com": 8,
        "amazon-dss.com": 8,
        "amazon.com.au": 8,
        "amazon.com.mx": 8,
        "amazon.dev": 8,
        "amazon.in": 8,
        "amazon.nl": 8,
        "amazon.sa": 8,
        "amazonbrowserapp.co.uk": 8,
        "amazonbrowserapp.es": 8,
        "amazoncrl.com": 8,
        "firetvcaptiveportal.com": 8,
        "ntp-fireos.com": 8,
        "amazon-adsystem.com": 4,
        "serving-sys.com": 4,
        "sizmek.com": 4,
        "assoc-amazon.ca": 4,
        "assoc-amazon.co.uk": 4,
        "assoc-amazon.com": 4,
        "assoc-amazon.de": 4,
        "assoc-amazon.fr": 4,
        "assoc-amazon.jp": 4,
        "images-amazon.com": 9,
        "media-amazon.com": 9,
        "ssl-images-amazon.com": 9,
        "amazontrust.com": 9,
        "associates-amazon.com": 9,
        "cloudfront.net": 10,
        "ota-cloudfront.net": 10,
        "axx-eu.amazon-adsystem.com": 4,
        "amazonpay.com": 2,
        "payments-amazon.com": 2,
        "amazonpay.in": 2,
        "aiv-cdn.net": 0,
        "aiv-delivery.net": 0,
        "amazonvideo.com": 0,
        "pv-cdn.net": 0,
        "primevideo.com": 0,
        "amazonaws.com": 10,
        "amazonwebservices.com": 10,
        "awsstatic.com": 10,
        "adnetwork.net.vn": 4,
        "adnetwork.vn": 4,
        "ambientplatform.vn": 4,
        "amgload.net": 11,
        "amoad.com": 4,
        "ad.amgdgt.com": 4,
        "ads.amgdgt.com": 4,
        "amobee.com": 4,
        "collective-media.net": 4,
        "amplitude.com": 6,
        "d24n15hnbwhuhn.cloudfront.net": 6,
        "ampproject.org": 8,
        "anametrix.net": 6,
        "ancestrycdn.com": 9,
        "ancoraplatform.com": 6,
        "android.com": 101,
        "anetwork.ir": 4,
        "aniview.com": 4,
        "a-ads.com": 4,
        "anormal-tracker.de": 6,
        "answerscloud.com": 1,
        "anthill.vn": 7,
        "ants.vn": 7,
        "rt.analytics.anvato.net": 0,
        "tkx2-prod.anvato.net": 0,
        "w3.cdn.anvato.net": 0,
        "player.anyclip.com": 0,
        "video-loader.com": 4,
        "aolcdn.com": 6,
        "isp.netscape.com": 6,
        "apa.at": 8,
        "apester.com": 4,
        "apicit.net": 4,
        "carrierzone.com": 6,
        "appcenter.ms": 5,
        "appcues.com": 2,
        "appdynamics.com": 6,
        "de8of677fyt0b.cloudfront.net": 6,
        "eum-appdynamics.com": 6,
        "jscdn.appier.net": 4,
        "apple.com": 8,
        "aaplimg.com": 8,
        "apple-cloudkit.com": 8,
        "apple-dns.net": 8,
        "apple-livephotoskit.com": 8,
        "apple-mapkit.com": 8,
        "apple.news": 8,
        "apzones.com": 8,
        "cdn-apple.com": 8,
        "icloud-content.com": 8,
        "icloud.com": 8,
        "icons.axm-usercontent-apple.com": 8,
        "itunes.com": 8,
        "me.com": 8,
        "mzstatic.com": 8,
        "safebrowsing.apple": 8,
        "safebrowsing.g.applimg.com": 8,
        "iadsdk.apple.com": 4,
        "applifier.com": 4,
        "assets.applovin.com": 4,
        "applovin.com": 4,
        "applvn.com": 4,
        "appmetrx.com": 4,
        "adnxs.com": 4,
        "adnxs.net": 4,
        "appsflyer.com": 101,
        "appsflyersdk.com": 101,
        "adne.tv": 4,
        "readserver.net": 4,
        "www.apture.com": 2,
        "arcpublishing.com": 6,
        "ard.de": 0,
        "areyouahuman.com": 6,
        "arkoselabs.com": 6,
        "art19.com": 4,
        "banners.advsnx.net": 4,
        "artlebedev.ru": 8,
        "ammadv.it": 4,
        "arubamediamarketing.it": 4,
        "cya2.net": 6,
        "asambeauty.com": 8,
        "ask.com": 7,
        "aspnetcdn.com": 9,
        "ads.assemblyexchange.com": 4,
        "cdn.astronomer.io": 6,
        "ati-host.net": 6,
        "aticdn.net": 6,
        "xiti.com": 6,
        "atedra.com": 4,
        "oadts.com": 4,
        "as00.estara.com": 4,
        "atgsvcs.com": 4,
        "adbureau.net": 4,
        "atdmt.com": 4,
        "atlassbx.com": 4,
        "track.roiservice.com": 4,
        "atl-paas.net": 2,
        "atlassian.com": 2,
        "atlassian.net": 2,
        "d12ramskps3070.cloudfront.net": 2,
        "bitbucket.org": 2,
        "jira.com": 2,
        "ss-inf.net": 2,
        "d1xfq2052q7thw.cloudfront.net": 9,
        "marketplace.atlassian.com": 9,
        "atomz.com": 2,
        "atsfi.de": 11,
        "cdn.attracta.com": 4,
        "locayta.com": 6,
        "ads.audience2media.com": 4,
        "qwobl.net": 4,
        "revsci.net": 4,
        "wunderloop.net": 4,
        "12mlbe.com": 4,
        "audiencesquare.com": 4,
        "ad.gt": 4,
        "audigent.com": 4,
        "hadronid.net": 4,
        "auditude.com": 0,
        "audtd.com": 4,
        "cdn.augur.io": 6,
        "aumago.com": 4,
        "clicktracks.com": 4,
        "ausgezeichnet.org": 2,
        "advertising.gov.au": 4,
        "auth0.com": 6,
        "ai.autoid.com": 6,
        "optimost.com": 4,
        "oc-track.autonomycloud.com": 4,
        "track.yieldsoftware.com": 4,
        "api.autopilothq.com": 4,
        "autoscout24.com": 8,
        "autoscout24.net": 8,
        "avail.net": 4,
        "analytics.avanser.com.au": 2,
        "avmws.com": 6,
        "avantlink.com": 4,
        "ads.avazu.net": 4,
        "avenseo.com": 4,
        "adspdbl.com": 0,
        "avocet.io": 8,
        "aweber.com": 4,
        "awin.com": 4,
        "awin1.com": 4,
        "perfb.com": 4,
        "ad.globe7.com": 4,
        "azadify.com": 4,
        "azure.com": 10,
        "azure.net": 10,
        "azurefd.net": 10,
        "trafficmanager.net": 10,
        "blob.core.windows.net": 8,
        "azureedge.net": 9,
        "b2bcontext.ru": 4,
        "b2bvideo.ru": 4,
        "babator.com": 6,
        "backbeatmedia.com": 4,
        "widgets.backtype.com": 4,
        "bahn.de": 8,
        "img-bahn.de": 8,
        "baidu.com": 4,
        "baidustatic.com": 4,
        "bdimg.com": 8,
        "bdstatic.com": 8,
        "baletingo.com": 11,
        "bangdom.com": 3,
        "widgets.bankrate.com": 4,
        "bannerconnect.net": 4,
        "bannerflow.com": 4,
        "bannerplay.com": 4,
        "cdn.bannersnack.com": 4,
        "dn3y71tq7jf07.cloudfront.net": 4,
        "getbarometer.s3.amazonaws.com": 2,
        "basilic.io": 6,
        "batanga.com": 4,
        "t4ft.de": 4,
        "bauernative.com": 4,
        "baur.de": 8,
        "baynote.net": 4,
        "bazaarvoice.com": 2,
        "bbci.co.uk": 10,
        "tracking.bd4travel.com": 4,
        "beopinion.com": 2,
        "bfmio.com": 4,
        "beaconads.com": 4,
        "beampulse.com": 4,
        "beanstalkdata.com": 4,
        "bebi.com": 4,
        "beeketing.com": 4,
        "beeline.ru": 4,
        "bidr.io": 4,
        "tracker.beezup.com": 4,
        "begun.ru": 4,
        "behavioralengine.com": 4,
        "belboon.de": 8,
        "cdn.belco.io": 2,
        "belstat.be": 6,
        "belstat.com": 6,
        "belstat.de": 6,
        "belstat.fr": 6,
        "belstat.nl": 6,
        "bemobile.ua": 10,
        "tag.benchplatform.com": 4,
        "betterttv.net": 7,
        "betweendigital.com": 4,
        "intencysrv.com": 4,
        "bid.run": 4,
        "bidgear.com": 6,
        "bidswitch.net": 4,
        "exe.bid": 4,
        "bttrack.com": 4,
        "bidtheatre.com": 4,
        "bidvertiser.com": 4,
        "bigmobileads.com": 4,
        "bigcommerce.com": 6,
        "bigmir.net": 6,
        "bigpoint-payment.com": 8,
        "bigpoint.com": 8,
        "bigpoint.net": 8,
        "bpcdn.net": 8,
        "bpsecure.com": 8,
        "bildstatic.de": 8,
        "ad-cdn.bilgin.pro": 4,
        "pixel.bilinmedia.net": 4,
        "bat.r.msn.com": 4,
        "bing.com": 4,
        "bing.net": 4,
        "virtualearth.net": 2,
        "binge.com.au": 0,
        "view.binlayer.com": 4,
        "widgets.binotel.com": 4,
        "esendra.fi": 4,
        "bitcoinplus.com": 2,
        "bit.ly": 6,
        "bitrix.de": 4,
        "bitrix.info": 4,
        "bitrix.ru": 4,
        "bitrix24.com": 4,
        "bitrix24.com.br": 4,
        "bitwarden.com": 8,
        "traffic.adxprts.com": 4,
        "jssr.jd.com": 4,
        "blau.de": 8,
        "bnmla.com": 4,
        "blismedia.com": 6,
        "blogad.com.tw": 4,
        "blogbang.com": 4,
        "www.blogcatalog.com": 2,
        "track.blogcounter.de": 6,
        "blogfoster.com": 8,
        "bloggerads.net": 4,
        "blogher.com": 4,
        "blogherads.com": 4,
        "blogimg.jp": 9,
        "blogsmithmedia.com": 8,
        "blogblog.com": 8,
        "blogger.com": 8,
        "blogspot.com": 8,
        "brcdn.com": 4,
        "brsrvr.com": 4,
        "brtstats.com": 4,
        "offerpoint.net": 4,
        "blueserving.com": 4,
        "blueconic.net": 6,
        "bluecore.com": 4,
        "triggeredmail.appspot.com": 4,
        "bkrtx.com": 4,
        "bluekai.com": 4,
        "adrevolver.com": 4,
        "bluelithium.com": 4,
        "bmmetrix.com": 4,
        "japanmetrix.jp": 4,
        "bluenewsupdate.info": 11,
        "bluestreak.com": 4,
        "bluetriangletech.com": 6,
        "btttag.com": 6,
        "bodelen.com": 4,
        "tracking.bol.com": 4,
        "qb.boldapps.net": 4,
        "secure.apps.shappify.com": 4,
        "boldchat.com": 2,
        "boltdns.net": 11,
        "bom.gov.au": 9,
        "ml314.com": 6,
        "bongacams.com": 3,
        "bonial.com": 2,
        "bonialconnect.com": 2,
        "bonialserviceswidget.de": 2,
        "boo-box.com": 4,
        "booking.com": 8,
        "bstatic.com": 8,
        "boostbox.com.br": 6,
        "boostervideo.ru": 0,
        "bootstrapcdn.com": 9,
        "borrango.com": 11,
        "scan.botscanner.com": 6,
        "boudja.com": 11,
        "bounceexchange.com": 4,
        "bouncex.com": 4,
        "bouncex.net": 4,
        "j.clickdensity.com": 6,
        "boxever.com": 4,
        "brainient.com": 4,
        "brainsins.com": 4,
        "d2xkqxdy6ewr93.cloudfront.net": 4,
        "mobileapptracking.com": 101,
        "app.link": 4,
        "branch.io": 4,
        "brandaffinity.net": 4,
        "go.cpmadvisors.com": 4,
        "optorb.com": 4,
        "brandmetrics.com": 4,
        "brandreachsys.com": 4,
        "rtbidder.net": 4,
        "brandwire.tv": 4,
        "branica.com": 4,
        "appboycdn.com": 6,
        "braze.com": 6,
        "brealtime.com": 4,
        "bridgetrack.com": 4,
        "brightcove.com": 0,
        "brightcove.net": 0,
        "analytics.brightedge.com": 4,
        "munchkin.brightfunnel.com": 6,
        "brightonclick.com": 4,
        "btrll.com": 4,
        "p.brilig.com": 4,
        "brillen.de": 8,
        "broadstreetads.com": 4,
        "bm23.com": 4,
        "brow.si": 4,
        "browser-statistik.de": 6,
        "browser-update.org": 2,
        "btncdn.com": 9,
        "in.bubblestat.com": 4,
        "brighteroption.com": 7,
        "bufferapp.com": 7,
        "bugherd.com": 2,
        "bugsnag.com": 6,
        "d2wy8f7a9ursnm.cloudfront.net": 6,
        "bulkhentai.com": 3,
        "bumlam.com": 11,
        "bunchbox.co": 6,
        "bf-ad.net": 4,
        "bf-tools.net": 4,
        "bstatic.de": 4,
        "burstbeacon.com": 4,
        "burstnet.com": 4,
        "burt.io": 4,
        "d3q6px0y2suh5n.cloudfront.net": 4,
        "rich-agent.s3.amazonaws.com": 4,
        "richmetrics.com": 4,
        "stats.businessol.com": 6,
        "bttn.io": 4,
        "buysellads.com": 4,
        "servedby-buysellads.com": 4,
        "buzzadexchange.com": 4,
        "buzzador.com": 7,
        "buzzfed.com": 2,
        "bwbx.io": 9,
        "bypass.jp": 4,
        "c1exchange.com": 4,
        "c3metrics.com": 6,
        "c3tag.com": 6,
        "c8.net.ua": 4,
        "cackle.me": 3,
        "d1cerpgff739r9.cloudfront.net": 4,
        "d1qpxk1wfeh8v1.cloudfront.net": 4,
        "callpage.io": 2,
        "callbackhunter.com": 2,
        "callmeasurement.com": 2,
        "callibri.ru": 4,
        "callrail.com": 2,
        "calltracking.ru": 2,
        "caltat.com": 2,
        "cam-content.com": 3,
        "camakaroda.com": 11,
        "s.edkay.com": 6,
        "canddi.com": 6,
        "canonical.com": 8,
        "canvas.net": 2,
        "canvasnetwork.com": 2,
        "du11hjcvx0uqb.cloudfront.net": 2,
        "kdata.fr": 6,
        "captora.com": 4,
        "edge.capturemedia.network": 4,
        "cdn.capturly.com": 6,
        "route.carambo.la": 4,
        "carbonads.com": 4,
        "carbonads.net": 4,
        "fusionads.net": 4,
        "cardinalcommerce.com": 6,
        "cardlytics.com": 6,
        "cdn.carrotquest.io": 6,
        "api.cartstack.com": 2,
        "caspion.com": 6,
        "t.castle.io": 2,
        "3gl.net": 6,
        "cbox.ws": 2,
        "adlog.com.com": 0,
        "cbsinteractive.com": 0,
        "dw.com.com": 0,
        "ccmbg.com": 4,
        "admission.net": 4,
        "cdn-net.com": 11,
        "cdn13.com": 8,
        "cdn77.com": 9,
        "cdn77.org": 9,
        "cdnetworks.com": 9,
        "cdnetworks.net": 9,
        "cdnnetwok.xyz": 12,
        "cdnondemand.org": 11,
        "cdnsure.com": 11,
        "cdnvideo.com": 9,
        "cdnwidget.com": 9,
        "cedexis-radar.net": 6,
        "cedexis-test.com": 6,
        "cedexis.com": 6,
        "cedexis.fastlylb.net": 6,
        "cedexis.net": 6,
        "celebrus.com": 6,
        "celtra.com": 0,
        "cendyn.adtrack.calls.net": 4,
        "centraltag.com": 4,
        "brand-server.com": 4,
        "speed-trap.nl": 6,
        "link.ixs1.net": 4,
        "hits.e.cl": 4,
        "certona.net": 4,
        "res-x.com": 4,
        "gsn.chameleon.ad": 4,
        "chango.ca": 4,
        "chango.com": 4,
        "channelintelligence.com": 4,
        "cptrack.de": 6,
        "channeladvisor.com": 4,
        "searchmarketing.com": 4,
        "channelfinder.net": 4,
        "chaordicsystems.com": 4,
        "chartbeat.com": 6,
        "chartbeat.net": 6,
        "chartboost.com": 4,
        "chaser.ru": 2,
        "cloud.chatbeacon.io": 2,
        "chatango.com": 2,
        "call.chatra.io": 2,
        "chaturbate.com": 3,
        "chatwing.com": 2,
        "checkmystats.com.au": 4,
        "chefkoch-cdn.de": 8,
        "chefkoch.de": 8,
        "tracker.chinmedia.vn": 4,
        "chinesean.com": 4,
        "chitika.net": 4,
        "choicestream.com": 4,
        "api.getchute.com": 5,
        "media.chute.io": 5,
        "iqcontentplatform.de": 6,
        "data.circulate.com": 6,
        "p.cityspark.com": 4,
        "cityads.ru": 4,
        "gameleads.ru": 4,
        "ciuvo.com": 12,
        "widget.civey.com": 2,
        "civicscience.com": 6,
        "ciweb.ciwebgroup.com": 4,
        "clcknads.pro": 3,
        "pulseradius.com": 4,
        "clearbit.com": 6,
        "clearsale.com.br": 4,
        "tag.clrstm.com": 4,
        "api.clerk.io": 4,
        "cleverpush.com": 6,
        "wzrkt.com": 6,
        "cleversite.ru": 2,
        "script.click360.io": 6,
        "clickandchat.com": 2,
        "software.clickback.com": 4,
        "hit.clickaider.com": 4,
        "clickaine.com": 4,
        "clickbank.net": 4,
        "cbproads.com": 4,
        "adtoll.com": 4,
        "clickbooth.com": 4,
        "clickboothlnk.com": 4,
        "clickcease.com": 2,
        "clickcertain.com": 4,
        "remarketstats.com": 4,
        "clickdesk.com": 2,
        "analytics.clickdimensions.com": 4,
        "clickequations.net": 4,
        "clickexperts.net": 4,
        "doublemax.net": 4,
        "clickinc.com": 4,
        "clickintext.net": 4,
        "clickky.biz": 4,
        "9nl.be": 4,
        "9nl.com": 4,
        "9nl.eu": 4,
        "9nl.it": 4,
        "9nl.me": 4,
        "clickmeter.com": 4,
        "clickonometrics.pl": 4,
        "clickpoint.com": 4,
        "clickpoint.it": 4,
        "clickprotector.com": 6,
        "clickreport.com": 6,
        "doogleonduty.com": 6,
        "ctn.go2cloud.org": 4,
        "clicksor.com": 4,
        "hatid.com": 4,
        "lzjl.com": 4,
        "myroitracking.com": 4,
        "clicktale.com": 6,
        "clicktale.net": 6,
        "clicktale.pantherssl.com": 6,
        "clicktalecdn.sslcs.cdngc.net": 6,
        "clicktripz.com": 4,
        "clickwinks.com": 4,
        "getclicky.com": 6,
        "staticstuff.net": 6,
        "clickyab.com": 4,
        "clicmanager.fr": 4,
        "eplayer.clipsyndicate.com": 4,
        "www.is1.clixgalore.com": 4,
        "clixmetrix.com": 4,
        "clixsense.com": 4,
        "cloud-media.fr": 4,
        "cloudflare.com": 9,
        "cloudflare.net": 9,
        "cloudflare-dm-cmpimg.com": 9,
        "cloudflare-dns.com": 9,
        "cloudflare-ipfs.com": 9,
        "cloudflare-quic.com": 9,
        "cloudflare-terms-of-service-abuse.com": 9,
        "cloudflare.tv": 9,
        "cloudflareaccess.com": 9,
        "cloudflareclient.com": 9,
        "cloudflareinsights.com": 9,
        "cloudflareok.com": 9,
        "cloudflareportal.com": 9,
        "cloudflareresolve.com": 9,
        "cloudflaressl.com": 9,
        "cloudflarestatus.com": 9,
        "cloudflarestream.com": 9,
        "pacloudflare.com": 9,
        "sn-cloudflare.com": 9,
        "videodelivery.net": 9,
        "cloudimg.io": 9,
        "cloudinary.com": 9,
        "clovenetwork.com": 4,
        "clustrmaps.com": 4,
        "cnbc.com": 8,
        "cnetcontent.com": 8,
        "cnstats.ru": 6,
        "cnzz.com": 6,
        "umeng.com": 6,
        "acc-hd.de": 4,
        "client.cobrowser.net": 2,
        "codeonclick.com": 11,
        "cogocast.net": 4,
        "coin-have.com": 4,
        "appsha1.cointraffic.io": 2,
        "authedmine.com": 8,
        "coin-hive.com": 8,
        "coinhive.com": 8,
        "coinurl.com": 4,
        "coll1onf.com": 11,
        "coll2onf.com": 11,
        "service.collarity.com": 4,
        "static.clmbtech.com": 4,
        "combotag.com": 4,
        "pdk.theplatform.com": 0,
        "theplatform.com": 0,
        "comm100.cn": 2,
        "comm100.com": 2,
        "cdn-cs.com": 4,
        "cdn.mercent.com": 4,
        "link.mercent.com": 4,
        "commercialvalue.org": 11,
        "afcyhf.com": 4,
        "anrdoezrs.net": 4,
        "apmebf.com": 4,
        "awltovhc.com": 4,
        "emjcd.com": 4,
        "ftjcfx.com": 4,
        "lduhtrp.net": 4,
        "qksz.net": 4,
        "tkqlhce.com": 4,
        "tqlkg.com": 4,
        "yceml.net": 4,
        "communicatorcorp.com": 4,
        "wowanalytics.co.uk": 6,
        "c-col.com": 6,
        "c.compete.com": 6,
        "complex.com": 4,
        "complexmedianetwork.com": 4,
        "comprigo.com": 12,
        "comscore.com": 6,
        "zqtk.net": 6,
        "conative.de": 4,
        "condenast.com": 8,
        "conduit-banners.com": 4,
        "conduit-data.com": 4,
        "conduit.com": 4,
        "confirmit.com": 4,
        "congstar.de": 4,
        "connatix.com": 4,
        "connected-by.connectad.io": 4,
        "cdn.connecto.io": 6,
        "connexity.net": 4,
        "cxt.ms": 4,
        "connextra.com": 4,
        "rs6.net": 4,
        "serverbid.com": 4,
        "contactatonce.com": 2,
        "adrolays.de": 4,
        "c-i.as": 4,
        "df-srv.de": 4,
        "d1uwd25yvxu96k.cloudfront.net": 4,
        "static.contactme.com": 4,
        "contaxe.com": 5,
        "content.ad": 4,
        "ingestion.contentinsights.com": 6,
        "contentexchange.me": 6,
        "ctfassets.net": 9,
        "contentpass.de": 6,
        "contentpass.net": 6,
        "contentsquare.net": 4,
        "d1aug3dv5magti.cloudfront.net": 6,
        "d39se0h2uvfakd.cloudfront.net": 6,
        "c-on-text.com": 4,
        "intext.contextad.pl": 4,
        "continum.net": 10,
        "s2.contribusourcesyndication.com": 4,
        "hits.convergetrack.com": 6,
        "fastclick.net": 4,
        "mediaplex.com": 4,
        "mplxtms.com": 4,
        "cm-commerce.com": 6,
        "media.conversio.com": 6,
        "c.conversionlogic.net": 6,
        "conversionruler.com": 4,
        "conversionsbox.com": 7,
        "conversionsondemand.com": 5,
        "ant.conversive.nl": 4,
        "convertexperiments.com": 6,
        "d3sjgucddk68ji.cloudfront.net": 2,
        "convertro.com": 4,
        "d1ivexoxmp59q7.cloudfront.net": 4,
        "conviva.com": 6,
        "cookieconsent.silktide.com": 5,
        "cookie-script.com": 5,
        "cookiebot.com": 5,
        "cookieq.com": 5,
        "lite.piclens.com": 2,
        "copacet.com": 4,
        "raasnet.com": 4,
        "coremotives.com": 4,
        "coull.com": 4,
        "cpmrocket.com": 4,
        "cpmprofit.com": 4,
        "cpmstar.com": 4,
        "captifymedia.com": 4,
        "cpx.to": 4,
        "cqcounter.com": 6,
        "cqq5id8n.com": 11,
        "cquotient.com": 6,
        "craftkeys.com": 4,
        "ads.crakmedia.com": 4,
        "craktraffic.com": 4,
        "crankyads.com": 4,
        "crashlytics.com": 101,
        "cetrk.com": 6,
        "crazyegg.com": 6,
        "dnn506yrbagrg.cloudfront.net": 6,
        "creafi-online-media.com": 4,
        "createjs.com": 9,
        "creativecommons.org": 8,
        "brandwatch.com": 6,
        "crimsonhexagon.com": 6,
        "hexagon-analytics.com": 6,
        "ctnsnet.com": 4,
        "crisp.chat": 2,
        "crisp.im": 2,
        "criteo.com": 4,
        "criteo.net": 4,
        "p.crm4d.com": 6,
        "crossengage.io": 6,
        "crosspixel.net": 4,
        "crsspxl.com": 4,
        "crosssell.info": 4,
        "crossss.com": 4,
        "widget.crowdignite.com": 4,
        "static.crowdscience.com": 4,
        "ss.crowdprocess.com": 2,
        "our.glossip.nl": 7,
        "widget.breakingburner.com": 7,
        "widget.crowdynews.com": 7,
        "searchg2.crownpeak.net": 5,
        "snippet.omm.crownpeak.com": 5,
        "cryptoloot.pro": 4,
        "ctnetwork.hu": 4,
        "adzhub.com": 4,
        "data.withcubed.com": 6,
        "cuelinks.com": 4,
        "cdn.cupinteractive.com": 4,
        "curse.com": 8,
        "cursecdn.com": 9,
        "assets.customer.io": 2,
        "widget.customerly.io": 2,
        "cxense.com": 4,
        "cxo.name": 6,
        "cyberwing.co.jp": 4,
        "cybersource.com": 6,
        "cygnus.com": 4,
        "da-ads.com": 4,
        "dailymail.co.uk": 8,
        "dailymotion.com": 8,
        "dailymotionbus.com": 8,
        "dm-event.net": 8,
        "dmcdn.net": 8,
        "dmxleo.com": 4,
        "ds1.nl": 4,
        "dantrack.net": 4,
        "dmclick.cn": 4,
        "tags.dashboardad.net": 4,
        "datacaciques.com": 6,
        "datacoral.com": 4,
        "abandonaid.com": 6,
        "datacrushers.com": 6,
        "datadome.co": 6,
        "optimahub.com": 6,
        "supert.ag": 5,
        "inextaction.net": 4,
        "nexac.com": 4,
        "datamind.ru": 4,
        "datatables.net": 2,
        "adunits.datawrkz.com": 4,
        "dataxpand.script.ag": 4,
        "tc.dataxpand.com": 4,
        "w55c.net": 4,
        "datds.net": 12,
        "pro-market.net": 4,
        "displaymarketplace.com": 4,
        "davebestdeals.com": 12,
        "dawandastatic.com": 8,
        "dc-storm.com": 4,
        "h4k5.com": 4,
        "stormcontainertag.com": 4,
        "stormiq.com": 4,
        "dcbap.com": 12,
        "dcmn.com": 4,
        "statslogger.rocket.persgroep.cloud": 4,
        "deadlinefunnel.com": 6,
        "cc2.dealer.com": 6,
        "d9lq0o81skkdj.cloudfront.net": 6,
        "esm1.net": 6,
        "static.dealer.com": 6,
        "decibelinsight.net": 6,
        "ads.dedicatedmedia.com": 4,
        "api.deep.bi": 6,
        "deepintent.com": 4,
        "defpush.com": 11,
        "deichmann.com": 4,
        "vxml4.delacon.com.au": 6,
        "tracking.percentmobile.com": 6,
        "adaction.se": 4,
        "de17a.com": 4,
        "deluxe.script.ag": 6,
        "delvenetworks.com": 7,
        "company-target.com": 4,
        "demandbase.com": 4,
        "dmd53.com": 4,
        "dmtracker.com": 4,
        "deqwas.net": 6,
        "devatics.com": 2,
        "developermedia.com": 4,
        "dapxl.com": 8,
        "deviantart.net": 8,
        "my.blueadvertise.com": 4,
        "dgm-au.com": 4,
        "s2d6.com": 4,
        "d31y97ze264gaa.cloudfront.net": 6,
        "d3von6il1wr7wo.cloudfront.net": 4,
        "dianomi.com": 4,
        "dianomioffers.co.uk": 4,
        "tag.didit.com": 4,
        "track.did-it.com": 4,
        "privacy-center.org": 5,
        "digg.com": 2,
        "digicert.com": 5,
        "phicdn.net": 5,
        "digidip.net": 4,
        "digiglitzmarketing.go2cloud.org": 6,
        "wtp101.com": 4,
        "digioh.com": 4,
        "lightboxcdn.com": 4,
        "digitalgov.gov": 6,
        "cookiereports.com": 5,
        "adtag.cc": 4,
        "adready.com": 4,
        "adreadytractions.com": 4,
        "cpxinteractive.com": 4,
        "directtrack.com": 4,
        "onenetworkdirect.net": 4,
        "track.digitalriver.com": 4,
        "dwin1.com": 4,
        "digiteka.net": 4,
        "ultimedia.com": 4,
        "digitru.st": 4,
        "widget.dihitt.com.br": 7,
        "dimml.io": 8,
        "keywordsconnect.com": 4,
        "directadvert.ru": 4,
        "directrev.com": 4,
        "discordapp.com": 2,
        "disneyplus.com": 0,
        "bamgrid.com": 0,
        "dssedge.com": 0,
        "dssott.com": 0,
        "d81mfvml8p5ml.cloudfront.net": 4,
        "disqus.com": 1,
        "disquscdn.com": 1,
        "disqusads.com": 4,
        "distiltag.com": 5,
        "districtm.ca": 4,
        "districtm.io": 4,
        "jsrdn.com": 6,
        "div.show": 12,
        "stats.vertriebsassistent.de": 6,
        "tag.divvit.com": 6,
        "d-msquared.com": 4,
        "and.co.uk": 8,
        "dmm.co.jp": 3,
        "ctret.de": 8,
        "toolbar.dockvine.com": 2,
        "awecr.com": 0,
        "fwbntw.com": 0,
        "s.dogannet.tv": 4,
        "domain.glass": 8,
        "www.domodomain.com": 6,
        "donation-tools.org": 12,
        "doofinder.com": 2,
        "embed.doorbell.io": 5,
        "dotandad.com": 4,
        "trackedlink.net": 2,
        "dotmetrics.net": 6,
        "dotomi.com": 4,
        "dtmc.com": 4,
        "dtmpub.com": 4,
        "double.net": 4,
        "2mdn.net": 4,
        "doublepimp.com": 3,
        "doublepimpssl.com": 3,
        "redcourtside.com": 3,
        "xeontopa.com": 3,
        "zerezas.com": 3,
        "doubleverify.com": 4,
        "wrating.com": 6,
        "adsymptotic.com": 4,
        "dreame.tech": 8,
        "dreametech.com": 8,
        "dreamlab.pl": 4,
        "drift.com": 2,
        "js.driftt.com": 2,
        "getdrip.com": 2,
        "dropbox.com": 2,
        "dropboxstatic.com": 2,
        "z5x.net": 4,
        "dsp-rambler.ru": 4,
        "m6d.com": 4,
        "media6degrees.com": 4,
        "dtscout.com": 4,
        "dd-cdn.multiscreensite.com": 4,
        "px.multiscreensite.com": 4,
        "cdn-0.d41.co": 6,
        "cn01.dwstat.cn": 6,
        "dynad.net": 4,
        "dyntrk.com": 4,
        "dyntracker.de": 8,
        "media01.eu": 8,
        "content.dl-rms.com": 4,
        "dlqm.net": 4,
        "questionmarket.com": 4,
        "dynamicyield.com": 5,
        "beacons.hottraffic.nl": 4,
        "dynatrace.com": 6,
        "dyncdn.me": 11,
        "e-planning.net": 4,
        "eadv.it": 4,
        "eanalyzer.de": 11,
        "early-birds.fr": 4,
        "cdn.earnify.com": 4,
        "earnify.com": 6,
        "easyads.bg": 4,
        "easylist.club": 11,
        "classistatic.de": 4,
        "ebay-us.com": 4,
        "ebay.com": 4,
        "ebay.de": 4,
        "ebayclassifiedsgroup.com": 4,
        "ebaycommercenetwork.com": 4,
        "ebaydesc.com": 4,
        "ebayimg.com": 4,
        "ebayrtm.com": 4,
        "ebaystatic.com": 4,
        "ad.about.co.kr": 4,
        "adcheck.about.co.kr": 4,
        "adn.ebay.com": 4,
        "beead.co.uk": 4,
        "beead.fr": 4,
        "beead.net": 4,
        "ebuzzing.com": 4,
        "ebz.io": 4,
        "echoenabled.com": 4,
        "eclick.vn": 4,
        "econda-monitor.de": 6,
        "eco-tag.jp": 4,
        "alphacdn.net": 9,
        "edg.io": 9,
        "edgecast.com": 9,
        "edgecastcdn.net": 9,
        "edgecastdns.net": 9,
        "sigmacdn.net": 9,
        "ecustomeropinions.com": 4,
        "effectivemeasure.net": 4,
        "effiliation.com": 4,
        "egain.net": 2,
        "cloud-emea.analytics-egain.com": 6,
        "ehi-siegel.de": 2,
        "ekmpinpoint.com": 6,
        "ekomi.de": 1,
        "elasticad.net": 4,
        "elasticbeanstalk.com": 6,
        "cloudcell.com": 2,
        "ea.com": 2,
        "eamobile.com": 2,
        "element.io": 7,
        "riot.im": 7,
        "elicitapp.com": 4,
        "eloqua.com": 4,
        "en25.com": 4,
        "eluxer.net": 12,
        "tracker.emailaptitude.com": 4,
        "tag.email-attitude.com": 4,
        "app.emarketeer.com": 4,
        "embed.ly": 6,
        "embedly.com": 6,
        "emediate.dk": 4,
        "emediate.eu": 4,
        "emediate.se": 4,
        "emetriq.de": 4,
        "e2ma.net": 4,
        "adinsight.co.kr": 4,
        "colbenson.es": 4,
        "emsmobile.de": 8,
        "sitecompass.com": 4,
        "enectoanalytics.com": 6,
        "trk.enecto.com": 6,
        "track.engagesciences.com": 6,
        "widget.engageya.com": 4,
        "engagio.com": 6,
        "engineseeker.com": 4,
        "enquisite.com": 4,
        "adtlgc.com": 4,
        "ats.tumri.net": 4,
        "ensighten.com": 5,
        "envolve.com": 2,
        "cdn.callbackkiller.com": 2,
        "email-reflex.com": 4,
        "epicgameads.com": 4,
        "trafficmp.com": 4,
        "adshost1.com": 4,
        "adshost2.com": 4,
        "epom.com": 4,
        "epoq.de": 2,
        "banzaiadv.it": 4,
        "eproof.com": 6,
        "equitystory.com": 6,
        "eqads.com": 4,
        "ero-advertising.com": 3,
        "eroadvertising.com": 3,
        "d15qhc0lu1ghnk.cloudfront.net": 6,
        "errorception.com": 6,
        "eshopcomp.com": 12,
        "espncdn.com": 9,
        "esprit.de": 8,
        "cybermonitor.com": 6,
        "estat.com": 6,
        "teste-s3-maycon.s3.amazonaws.com": 4,
        "etahub.com": 11,
        "etargetnet.com": 4,
        "ethn.io": 4,
        "pages.etology.com": 4,
        "sa.etp-prod.com": 6,
        "etracker.com": 6,
        "etracker.de": 6,
        "sedotracker.com": 6,
        "etrigue.com": 4,
        "etsystatic.com": 9,
        "eulerian.net": 6,
        "eultech.fnac.com": 6,
        "ew3.io": 6,
        "euroads.dk": 4,
        "euroads.fi": 4,
        "euroads.no": 4,
        "newpromo.europacash.com": 4,
        "tracker.euroweb.net": 4,
        "apptegic.com": 2,
        "evergage.com": 2,
        "listener.everstring.com": 6,
        "waterfrontmedia.com": 7,
        "betrad.com": 5,
        "evidon.com": 5,
        "evisitanalyst.com": 4,
        "evisitcs.com": 4,
        "websiteperform.com": 4,
        "ads.exactdrive.com": 4,
        "exactag.com": 6,
        "exelator.com": 4,
        "dynamicoxygen.com": 4,
        "exitjunction.com": 4,
        "exdynsrv.com": 3,
        "exoclick.com": 3,
        "exosrv.com": 3,
        "exoticads.com": 3,
        "expedia.com": 8,
        "trvl-px.com": 8,
        "eccmp.com": 8,
        "audienceiq.com": 4,
        "techlightenment.com": 4,
        "expo-max.com": 4,
        "server.exposebox.com": 4,
        "sf.exposebox.com": 2,
        "express.co.uk": 8,
        "d1lp05q4sghme9.cloudfront.net": 2,
        "extreme-dm.com": 6,
        "eyenewton.ru": 2,
        "eyeota.net": 4,
        "eyereturn.com": 4,
        "eyeviewads.com": 4,
        "ezakus.net": 4,
        "f11-ads.com": 4,
        "facebook.com": 4,
        "facebook.net": 4,
        "graph.facebook.com": 4,
        "fbcdn.net": 9,
        "fbsbx.com": 9,
        "facetz.net": 4,
        "adsfac.eu": 4,
        "adsfac.net": 4,
        "adsfac.sg": 4,
        "adsfac.us": 4,
        "faktor.io": 6,
        "thefancy.com": 7,
        "d1q7pknmpq2wkm.cloudfront.net": 4,
        "fap.to": 8,
        "farlightgames.com": 8,
        "fastly-insights.com": 6,
        "fastly.net": 9,
        "fastlylb.net": 9,
        "fastly-edge.com": 9,
        "fastly-masque.net": 9,
        "fastpic.ru": 10,
        "fmpub.net": 4,
        "fby.s3.amazonaws.com": 2,
        "feedbackify.com": 2,
        "feedburner.com": 4,
        "feedify.de": 7,
        "feedjit.com": 4,
        "log.feedjit.com": 4,
        "tracking.feedperfect.com": 4,
        "feedsportal.com": 4,
        "feefo.com": 2,
        "fidelity-media.com": 4,
        "fiksu.com": 4,
        "filamentapp.s3.amazonaws.com": 4,
        "fileserve.xyz": 10,
        "tools.financeads.net": 4,
        "tracker.financialcontent.com": 4,
        "findizer.fr": 8,
        "findologic.com": 2,
        "app-measurement.com": 101,
        "fcm.googleapis.com": 101,
        "firebase.com": 101,
        "firebase.google.com": 101,
        "firebase.googleapis.com": 101,
        "firebaseapp.com": 101,
        "firebaseappcheck.googleapis.com": 101,
        "firebasedynamiclinks-ipv4.googleapis.com": 101,
        "firebasedynamiclinks-ipv6.googleapis.com": 101,
        "firebasedynamiclinks.googleapis.com": 101,
        "firebaseinappmessaging.googleapis.com": 101,
        "firebaseinstallations.googleapis.com": 101,
        "firebaselogging-pa.googleapis.com": 101,
        "firebaselogging.googleapis.com": 101,
        "firebaseperusertopics-pa.googleapis.com": 101,
        "firebaseremoteconfig.googleapis.com": 101,
        "firebaseio.com": 8,
        "firstimpression.io": 4,
        "fitanalytics.com": 6,
        "fivetran.com": 6,
        "flagads.net": 4,
        "flagcounter.com": 4,
        "flashnews.com.au": 0,
        "flashtalking.com": 4,
        "flattr.com": 7,
        "flexlinks.com": 4,
        "linkoffers.net": 4,
        "flickr.com": 7,
        "staticflickr.com": 7,
        "lflipboard.com": 6,
        "flipboard.com": 6,
        "flite.com": 4,
        "flixcdn.com": 9,
        "flix360.com": 8,
        "flixcar.com": 8,
        "flocktory.com": 6,
        "flowplayer.org": 4,
        "adingo.jp": 4,
        "clicken.us": 4,
        "strcst.net": 4,
        "fluidads.co": 4,
        "fluidsurveys.com": 2,
        "cdn.flurry.com": 101,
        "data.flurry.com": 101,
        "flurry.com": 101,
        "flx1.com": 4,
        "flxpxl.com": 4,
        "api.flyertown.ca": 6,
        "adservinghost.com": 4,
        "adservinginternational.com": 4,
        "special.matchtv.ru": 6,
        "kavijaseuranta.fi": 2,
        "fontawesome.com": 9,
        "foodieblogroll.com": 7,
        "footprintlive.com": 4,
        "footprintdns.com": 11,
        "forcetrac.com": 2,
        "fqsecure.com": 4,
        "fqtag.com": 4,
        "securepaths.com": 4,
        "4seeresults.com": 5,
        "foresee.com": 5,
        "cdn-static.formisimo.com": 4,
        "forter.com": 4,
        "fortlachanhecksof.info": 11,
        "platform.foursquare.com": 4,
        "fout.jp": 4,
        "fimserve.com": 4,
        "foxsports.com.au": 0,
        "fncstatic.com": 9,
        "cdn.foxpush.net": 4,
        "foxpush.com": 4,
        "foxtel.com.au": 0,
        "foxtelgroupcdn.net.au": 0,
        "foxydeal.com": 12,
        "yabidos.com": 4,
        "besucherstatistiken.com": 6,
        "compteurdevisite.com": 6,
        "contadorvisitasgratis.com": 6,
        "contatoreaccessi.com": 6,
        "freecounterstat.com": 6,
        "statcounterfree.com": 6,
        "webcontadores.com": 6,
        "fastonlineusers.com": 6,
        "fastwebcounter.com": 6,
        "freeonlineusers.com": 6,
        "atoomic.com": 6,
        "free-pagerank.com": 6,
        "freedom.com": 6,
        "freegeoip.net": 6,
        "freenet.de": 4,
        "freent.de": 4,
        "freeview.com": 0,
        "freeview.com.au": 0,
        "freeviewaustralia.tv": 0,
        "fwmrm.net": 4,
        "heimdall.fresh8.co": 6,
        "d36mpcpuzc4ztk.cloudfront.net": 2,
        "freshdesk.com": 2,
        "freshplum.com": 4,
        "friendbuy.com": 6,
        "friendfeed.com": 7,
        "adultfriendfinder.com": 3,
        "amigos.com": 3,
        "board-books.com": 3,
        "cams.com": 3,
        "facebookofsex.com": 3,
        "getiton.com": 3,
        "nostringsattached.com": 3,
        "pop6.com": 3,
        "streamray.com": 3,
        "inpref.com": 4,
        "inpref.s3-external-3.amazonaws.com": 4,
        "inpref.s3.amazonaws.com": 4,
        "adflan.com": 4,
        "fruitflan.com": 4,
        "fstrk.net": 6,
        "cookie.fuel451.com": 4,
        "fullstory.com": 6,
        "track.funnelytics.io": 6,
        "angsrvr.com": 4,
        "fyber.com": 4,
        "game-advertising-online.com": 4,
        "gameanalytics.com": 101,
        "gamedistribution.com": 8,
        "gamerdna.com": 7,
        "gannett-cdn.com": 0,
        "gaug.es": 6,
        "gpm-digital.com": 0,
        "js.gb-world.net": 7,
        "gdeslon.ru": 4,
        "gdmdigital.com": 4,
        "gntm.geeen.co.jp": 6,
        "lpomax.net": 6,
        "gemius.pl": 4,
        "generaltracking.de": 11,
        "genesismedia.com": 4,
        "gssprt.jp": 4,
        "rsvpgenius.com": 6,
        "genoo.com": 4,
        "js.geoads.com": 4,
        "geolify.com": 4,
        "geoplugin.net": 6,
        "geotrust.com": 5,
        "geovisite.com": 6,
        "gestionpub.com": 4,
        "app.getresponse.com": 2,
        "getsitecontrol.com": 4,
        "getconversion.net": 2,
        "widgets.getglue.com": 0,
        "adhigh.net": 4,
        "static.getkudos.me": 1,
        "yottos.com": 4,
        "gsfn.us": 1,
        "gettyimages.com": 8,
        "sensic.net": 4,
        "gfycat.com": 7,
        "a.giantrealm.com": 4,
        "videostat.com": 4,
        "gigaonclick.com": 4,
        "analytics.gigyahosting1.com": 6,
        "gigcount.com": 6,
        "gigya.com": 6,
        "service.giosg.com": 6,
        "giphy.com": 7,
        "giraff.io": 4,
        "github.com": 2,
        "githubassets.com": 2,
        "githubusercontent.com": 2,
        "ghcr.io": 2,
        "github.blog": 2,
        "github.dev": 2,
        "octocaptcha.com": 2,
        "githubapp.com": 2,
        "github.io": 10,
        "aff3.gittigidiyor.com": 4,
        "gittip.com": 2,
        "sitest.jp": 6,
        "glganltcs.space": 12,
        "globalwebindex.net": 6,
        "globalnotifier.com": 11,
        "globalsign.com": 8,
        "ad.globaltakeoff.net": 4,
        "glomex.cloud": 0,
        "glomex.com": 0,
        "glotgrx.com": 11,
        "a.gmdelivery.com": 4,
        "gmail.com": 13,
        "ad.atown.jp": 4,
        "gmx.net": 8,
        "gmxpro.net": 8,
        "go.com": 8,
        "affiliate.godaddy.com": 4,
        "trafficfacts.com": 6,
        "seal.godaddy.com": 5,
        "tracking.godatafeed.com": 6,
        "counter.goingup.com": 6,
        "axf8.net": 6,
        "goodadvert.ru": 4,
        "google.at": 4,
        "google.be": 4,
        "google.ca": 4,
        "google.ch": 4,
        "google.co.id": 4,
        "google.co.in": 4,
        "google.co.jp": 4,
        "google.co.ma": 4,
        "google.co.th": 4,
        "google.co.uk": 4,
        "google.com": 4,
        "google.com.ar": 4,
        "google.com.au": 4,
        "google.com.br": 4,
        "google.com.mx": 4,
        "google.com.tr": 4,
        "google.com.tw": 4,
        "google.com.ua": 4,
        "google.cz": 4,
        "google.de": 4,
        "google.dk": 4,
        "google.dz": 4,
        "google.es": 4,
        "google.fi": 4,
        "google.fr": 4,
        "google.gr": 4,
        "google.hu": 4,
        "google.ie": 4,
        "google.it": 4,
        "google.nl": 4,
        "google.no": 4,
        "google.pl": 4,
        "google.pt": 4,
        "google.ro": 4,
        "google.rs": 4,
        "google.ru": 4,
        "google.se": 4,
        "google.tn": 4,
        "1e100.net": 4,
        "agnss.goog": 4,
        "channel.status.request.url": 4,
        "g.cn": 4,
        "g.co": 4,
        "google.ad": 4,
        "google.ae": 4,
        "google.al": 4,
        "google.am": 4,
        "google.as": 4,
        "google.az": 4,
        "google.ba": 4,
        "google.bf": 4,
        "google.bg": 4,
        "google.bi": 4,
        "google.bj": 4,
        "google.bs": 4,
        "google.bt": 4,
        "google.by": 4,
        "google.cat": 4,
        "google.cd": 4,
        "google.cf": 4,
        "google.cg": 4,
        "google.ci": 4,
        "google.cl": 4,
        "google.cm": 4,
        "google.cn": 4,
        "google.co.ao": 4,
        "google.co.bw": 4,
        "google.co.ck": 4,
        "google.co.cr": 4,
        "google.co.il": 4,
        "google.co.ke": 4,
        "google.co.kr": 4,
        "google.co.ls": 4,
        "google.co.mz": 4,
        "google.co.nz": 4,
        "google.co.tz": 4,
        "google.co.ug": 4,
        "google.co.uz": 4,
        "google.co.ve": 4,
        "google.co.vi": 4,
        "google.co.za": 4,
        "google.co.zm": 4,
        "google.co.zw": 4,
        "google.com.af": 4,
        "google.com.ag": 4,
        "google.com.ai": 4,
        "google.com.bd": 4,
        "google.com.bh": 4,
        "google.com.bn": 4,
        "google.com.bo": 4,
        "google.com.bz": 4,
        "google.com.co": 4,
        "google.com.cu": 4,
        "google.com.cy": 4,
        "google.com.ec": 4,
        "google.com.eg": 4,
        "google.com.et": 4,
        "google.com.fj": 4,
        "google.com.gh": 4,
        "google.com.gi": 4,
        "google.com.gt": 4,
        "google.com.hk": 4,
        "google.com.jm": 4,
        "google.com.kh": 4,
        "google.com.kw": 4,
        "google.com.lb": 4,
        "google.com.my": 4,
        "google.com.na": 4,
        "google.com.nf": 4,
        "google.com.ng": 4,
        "google.com.ni": 4,
        "google.com.np": 4,
        "google.com.om": 4,
        "google.com.pa": 4,
        "google.com.pe": 4,
        "google.com.pg": 4,
        "google.com.ph": 4,
        "google.com.pk": 4,
        "google.com.pr": 4,
        "google.com.py": 4,
        "google.com.qa": 4,
        "google.com.sa": 4,
        "google.com.sb": 4,
        "google.com.sg": 4,
        "google.com.sl": 4,
        "google.com.sv": 4,
        "google.com.tj": 4,
        "google.com.uy": 4,
        "google.com.vc": 4,
        "google.com.vn": 4,
        "google.cv": 4,
        "google.dj": 4,
        "google.dm": 4,
        "google.ee": 4,
        "google.fm": 4,
        "google.ga": 4,
        "google.ge": 4,
        "google.gg": 4,
        "google.gl": 4,
        "google.gm": 4,
        "google.gp": 4,
        "google.gy": 4,
        "google.hn": 4,
        "google.hr": 4,
        "google.ht": 4,
        "google.im": 4,
        "google.in": 4,
        "google.iq": 4,
        "google.is": 4,
        "google.je": 4,
        "google.jo": 4,
        "google.kg": 4,
        "google.ki": 4,
        "google.kz": 4,
        "google.la": 4,
        "google.li": 4,
        "google.lk": 4,
        "google.lt": 4,
        "google.lu": 4,
        "google.lv": 4,
        "google.md": 4,
        "google.me": 4,
        "google.mg": 4,
        "google.mk": 4,
        "google.ml": 4,
        "google.mn": 4,
        "google.ms": 4,
        "google.mu": 4,
        "google.mv": 4,
        "google.mw": 4,
        "google.ne": 4,
        "google.net": 4,
        "google.nr": 4,
        "google.nu": 4,
        "google.org": 4,
        "google.pn": 4,
        "google.ps": 4,
        "google.rw": 4,
        "google.sc": 4,
        "google.sh": 4,
        "google.si": 4,
        "google.sk": 4,
        "google.sm": 4,
        "google.sn": 4,
        "google.so": 4,
        "google.sr": 4,
        "google.st": 4,
        "google.td": 4,
        "google.tg": 4,
        "google.tk": 4,
        "google.tl": 4,
        "google.tm": 4,
        "google.to": 4,
        "google.tt": 4,
        "google.us": 4,
        "google.vg": 4,
        "google.vu": 4,
        "google.ws": 4,
        "googleapis.cn": 4,
        "googlecode.com": 4,
        "googledownloads.cn": 4,
        "googleoptimize.com": 4,
        "googleweblight.in": 4,
        "googlezip.net": 4,
        "gstatic.cn": 4,
        "news.google.com": 4,
        "oo.gl": 4,
        "withgoogle.com": 4,
        "googleadservices.com": 4,
        "google-analytics.com": 6,
        "app-analytics-services.com": 6,
        "ssl-google-analytics.l.google.com": 6,
        "www-googletagmanager.l.google.com": 6,
        "appspot.com": 10,
        "googlehosted.com": 10,
        "accounts.google.com": 2,
        "myaccount.google.com": 2,
        "oauth2.googleapis.com": 2,
        "ogs.google.com": 2,
        "securetoken.googleapis.com": 2,
        "beacons-google.com": 6,
        "alt1-mtalk.google.com": 7,
        "alt2-mtalk.google.com": 7,
        "alt3-mtalk.google.com": 7,
        "alt4-mtalk.google.com": 7,
        "alt5-mtalk.google.com": 7,
        "alt6-mtalk.google.com": 7,
        "alt7-mtalk.google.com": 7,
        "alt8-mtalk.google.com": 7,
        "chat.google.com": 7,
        "mobile-gtalk.l.google.com": 7,
        "mobile-gtalk4.l.google.com": 7,
        "mtalk.google.com": 7,
        "mtalk4.google.com": 7,
        "talk.google.com": 7,
        "talk.l.google.com": 7,
        "talkx.l.google.com": 7,
        "cloud.google.com": 10,
        "gcp.gvt2.com": 10,
        "storage.googleapis.com": 10,
        "adsensecustomsearchads.com": 4,
        "dns.google": 10,
        "dns.google.com": 10,
        "google-public-dns-a.google.com": 10,
        "google-public-dns-b.google.com": 10,
        "domains.google": 10,
        "googledomains.com": 10,
        "nic.google": 10,
        "registry.google": 10,
        "edge.google.com": 9,
        "mail-ads.google.com": 13,
        "fonts.googleapis.com": 9,
        "cloudfunctions.net": 10,
        "ghs.googlehosted.com": 10,
        "ghs4.googlehosted.com": 10,
        "ghs46.googlehosted.com": 10,
        "ghs6.googlehosted.com": 10,
        "googlehosted.l.googleusercontent.com": 10,
        "run.app": 10,
        "supl.google.com": 8,
        "earth.app.goo.gl": 2,
        "geo0.ggpht.com": 2,
        "geo1.ggpht.com": 2,
        "geo2.ggpht.com": 2,
        "geo3.ggpht.com": 2,
        "kh.google.com": 2,
        "maps.app.goo.gl": 2,
        "maps.google.ca": 2,
        "maps.google.ch": 2,
        "maps.google.co.jp": 2,
        "maps.google.co.uk": 2,
        "maps.google.com": 2,
        "maps.google.com.mx": 2,
        "maps.google.es": 2,
        "maps.google.se": 2,
        "maps.gstatic.com": 2,
        "doubleclick.net": 4,
        "invitemedia.com": 4,
        "adsense.google.com": 4,
        "adservice.google.ca": 4,
        "adservice.google.co.in": 4,
        "adservice.google.co.kr": 4,
        "adservice.google.co.uk": 4,
        "adservice.google.co.za": 4,
        "adservice.google.com": 4,
        "adservice.google.com.ar": 4,
        "adservice.google.com.au": 4,
        "adservice.google.com.br": 4,
        "adservice.google.com.co": 4,
        "adservice.google.com.gt": 4,
        "adservice.google.com.mx": 4,
        "adservice.google.com.pe": 4,
        "adservice.google.com.ph": 4,
        "adservice.google.com.pk": 4,
        "adservice.google.com.tr": 4,
        "adservice.google.com.tw": 4,
        "adservice.google.com.vn": 4,
        "adservice.google.de": 4,
        "adservice.google.dk": 4,
        "adservice.google.es": 4,
        "adservice.google.fr": 4,
        "adservice.google.nl": 4,
        "adservice.google.no": 4,
        "adservice.google.pl": 4,
        "adservice.google.ru": 4,
        "adservice.google.vg": 4,
        "adtrafficquality.google": 4,
        "dai.google.com": 4,
        "doubleclick.com": 4,
        "doubleclickbygoogle.com": 4,
        "googlesyndication-cn.com": 4,
        "duo.google.com": 2,
        "hangouts.clients6.google.com": 2,
        "hangouts.google.com": 2,
        "hangouts.googleapis.com": 2,
        "meet.google.com": 2,
        "meetings.googleapis.com": 2,
        "stun.l.google.com": 2,
        "stun1.l.google.com": 2,
        "ggpht.com": 9,
        "play-fe.googleapis.com": 8,
        "play-lh.googleusercontent.com": 8,
        "play.google.com": 8,
        "play.googleapis.com": 8,
        "1e100cdn.net": 8,
        "gvt1.com": 8,
        "gvt2.com": 8,
        "gvt3.com": 8,
        "googlesyndication.com": 4,
        "googletagmanager.com": 5,
        "googletagservices.com": 5,
        "translate.google.com": 2,
        "googletraveladservices.com": 4,
        "pki.goog": 5,
        "googlecommerce.com": 6,
        "googleusercontent.com": 9,
        "telephony.goog": 2,
        "voice.google.com": 2,
        "gmodules.com": 2,
        "calendar.google.com": 2,
        "contacts.google.com": 2,
        "currents.google.com": 2,
        "docs.google.com": 2,
        "drive.google.com": 2,
        "forms.google.com": 2,
        "gsuite.google.com": 2,
        "jamboard.google.com": 2,
        "keep.google.com": 2,
        "plus.google.com": 2,
        "sheets.google.com": 2,
        "slides.google.com": 2,
        "spreadsheets.google.com": 2,
        "googleapis.com": 9,
        "gooal.herokuapp.com": 6,
        "gooo.al": 6,
        "cdn.triggertag.gorillanation.com": 4,
        "evolvemediametrics.com": 4,
        "d1l6p2sc9645hc.cloudfront.net": 6,
        "gosquared.com": 6,
        "gostats.com": 6,
        "govmetric.com": 6,
        "servmetric.com": 6,
        "b.grabo.bg": 4,
        "trw12.com": 4,
        "tuberewards.com": 4,
        "d2bw638ufki166.cloudfront.net": 6,
        "granify.com": 6,
        "grapeshot.co.uk": 4,
        "gscontxt.net": 4,
        "graphcomment.com": 5,
        "gravatar.com": 7,
        "cdn.gravitec.net": 6,
        "gravity.com": 6,
        "grvcdn.com": 6,
        "greatviews.de": 4,
        "gandrad.org": 4,
        "green-red.com": 4,
        "co2stats.com": 2,
        "greenstory.ca": 6,
        "greentube.com": 7,
        "gt-cdn.net": 7,
        "greystripe.com": 4,
        "groovehq.com": 2,
        "groovinads.com": 4,
        "bidagent.xad.com": 4,
        "gmads.net": 4,
        "grmtech.net": 4,
        "media.gsimedia.net": 4,
        "gstatic.com": 9,
        "fx.gtop.ro": 6,
        "fx.gtopstats.com": 6,
        "gubagootracking.com": 4,
        "guj.de": 4,
        "emsservice.de": 4,
        "gumgum.com": 4,
        "gumroad.com": 7,
        "gunggo.com": 4,
        "h12-media.com": 4,
        "h12-media.net": 4,
        "hnbutton.appspot.com": 7,
        "haendlerbund.de": 2,
        "halogennetwork.com": 7,
        "d1l7z5ofrj6ab8.cloudfront.net": 2,
        "ad.harrenmedianetwork.com": 4,
        "ads.networkhm.com": 4,
        "app.hatchbuck.com": 6,
        "hhcdn.ru": 6,
        "healte.de": 11,
        "d36lvucg9kzous.cloudfront.net": 6,
        "heapanalytics.com": 6,
        "heatmap.it": 6,
        "weltsport.net": 8,
        "hellobar.com": 7,
        "hellosociety.com": 6,
        "here.com": 8,
        "herokuapp.com": 10,
        "heureka.cz": 4,
        "heybubble.com": 2,
        "heyos.com": 4,
        "adlink.net": 4,
        "comclick.com": 4,
        "hi-mediaserver.com": 4,
        "himediads.com": 4,
        "himediadx.com": 4,
        "hiconversion.com": 4,
        "highwebmedia.com": 3,
        "hwcdn.net": 6,
        "hiiir.com": 4,
        "hiro.tv": 4,
        "histats.com": 4,
        "hit-parade.com": 4,
        "hit.ua": 4,
        "hitslink.com": 4,
        "hitsprocessor.com": 4,
        "hitsniffer.com": 4,
        "hittail.com": 4,
        "hivedx.com": 4,
        "ads.thehiveworks.com": 4,
        "hockeyapp.net": 101,
        "hoholikik.club": 12,
        "h-cdn.com": 0,
        "homeaway.com": 8,
        "honeybadger.io": 6,
        "hlserve.com": 4,
        "apiae.hopscore.com": 4,
        "hotdogsandads.com": 11,
        "hotjar.com": 6,
        "hotkeys.com": 4,
        "hotlog.ru": 4,
        "hotwords.com": 4,
        "hotwords.es": 4,
        "howtank.com": 7,
        "hqentertainmentnetwork.com": 4,
        "justservingfiles.net": 4,
        "hsoub.com": 4,
        "hstrck.com": 8,
        "httpool.com": 4,
        "toboads.com": 4,
        "hubrus.com": 4,
        "hs-analytics.net": 6,
        "hs-scripts.com": 6,
        "hsleadflows.net": 6,
        "hubapi.com": 6,
        "hubspot.com": 6,
        "forms.hubspot.com": 2,
        "hubvisor.io": 4,
        "files.hucksterbot.com": 4,
        "hupso.com": 7,
        "hurra.com": 4,
        "hybrid.ai": 4,
        "targetix.net": 4,
        "hypeads.org": 4,
        "hypercomments.com": 1,
        "hyves.nl": 4,
        "hyvyd.com": 8,
        "ib-ibi.com": 4,
        "i-mobile.co.jp": 4,
        "r.i.ua": 4,
        "i10c.net": 11,
        "i2i.jp": 6,
        "i2idata.com": 6,
        "consensu.org": 5,
        "iadvize.com": 2,
        "cmcore.com": 6,
        "coremetrics.com": 6,
        "coremetrics.eu": 6,
        "tracker.icerocket.com": 7,
        "nsimg.net": 2,
        "optimix.asia": 4,
        "ic-live.com": 4,
        "icstats.nl": 6,
        "icuazeczpeoohx.com": 11,
        "id-news.net": 4,
        "idcdn.de": 4,
        "eu-1-id5-sync.com": 4,
        "id5-sync.com": 4,
        "id5.io": 4,
        "cdn.id.services": 6,
        "e-generator.com": 4,
        "idealo.com": 4,
        "identrust.com": 5,
        "ideoclick.com": 4,
        "s.idio.co": 4,
        "ie8eamus.com": 11,
        "600z.com": 4,
        "api.iflychat.com": 2,
        "ignitionone.com": 6,
        "knotice.net": 6,
        "igodigital.com": 2,
        "ad.wsod.com": 6,
        "collserve.com": 6,
        "ihvmcqojoj.com": 11,
        "iias.eu": 3,
        "ijento.com": 6,
        "adv.imadrep.co.kr": 4,
        "worthathousandwords.com": 4,
        "picadmedia.com": 4,
        "imgix.net": 9,
        "imgur.com": 8,
        "vidigital.ru": 4,
        "immanalytics.com": 2,
        "immobilienscout24.de": 8,
        "static-immobilienscout24.de": 8,
        "imonomy.com": 6,
        "7eer.net": 5,
        "d3cxv97fi8q177.cloudfront.net": 5,
        "evyy.net": 5,
        "impactradius-event.com": 5,
        "impactradius-tag.com": 5,
        "impactradius.com": 5,
        "ojrq.net": 5,
        "r7ls.net": 5,
        "impresionesweb.com": 4,
        "360yield.com": 4,
        "iljmp.com": 6,
        "inbenta.com": 6,
        "inboxsdk.com": 8,
        "indeed.com": 4,
        "casalemedia.com": 4,
        "indexww.com": 4,
        "indieclick.com": 4,
        "industrybrains.com": 4,
        "impdesk.com": 4,
        "impressiondesk.com": 4,
        "zachysprod.infiniteanalytics.com": 6,
        "infinity-tracking.net": 6,
        "engine.influads.com": 4,
        "infolinks.com": 4,
        "intextscript.com": 4,
        "ioam.de": 6,
        "iocnt.net": 6,
        "ivwbox.de": 6,
        "informer.com": 6,
        "infusionsoft.com": 4,
        "keap.com": 4,
        "innity.com": 4,
        "innity.net": 4,
        "innogames.com": 8,
        "innogames.de": 8,
        "innogamescdn.com": 8,
        "innovid.com": 4,
        "inside-graph.com": 7,
        "useinsider.com": 6,
        "insightexpressai.com": 6,
        "inskinad.com": 4,
        "inskinmedia.com": 4,
        "inspectlet.com": 6,
        "inspsearchapi.com": 4,
        "cdninstagram.com": 8,
        "instagram.com": 8,
        "tcgtrkr.com": 2,
        "sdad.guru": 4,
        "insticator.com": 4,
        "load.instinctiveads.com": 4,
        "intango.com": 4,
        "adsafeprotected.com": 4,
        "iasds01.com": 4,
        "integral-marketing.com": 4,
        "intelliad.com": 6,
        "intelliad.de": 6,
        "saas.intelligencefocus.com": 6,
        "ist-track.com": 4,
        "intensedebate.com": 2,
        "intentiq.com": 4,
        "intentmedia.net": 4,
        "intercom.com": 2,
        "intercom.io": 2,
        "intercomassets.com": 2,
        "intercomcdn.com": 2,
        "interedy.info": 11,
        "ads.intergi.com": 4,
        "intermarkets.net": 4,
        "intermundomedia.com": 4,
        "bbelements.com": 4,
        "goadservices.com": 4,
        "ibillboard.com": 4,
        "mediainter.net": 4,
        "voice2page.com": 0,
        "ibpxl.com": 7,
        "ibsrv.net": 7,
        "interpolls.com": 4,
        "ps7894.com": 4,
        "intilery-analytics.com": 6,
        "im-apps.net": 6,
        "investingchannel.com": 8,
        "inviziads.com": 4,
        "js12.invoca.net": 4,
        "ringrevenue.com": 4,
        "invodo.com": 6,
        "ionicframework.com": 8,
        "dsp.io": 4,
        "iesnare.com": 5,
        "iovation.com": 5,
        "ip-label.net": 6,
        "eltoro.com": 6,
        "iptargeting.com": 6,
        "ip-tracker.org": 6,
        "iptrack.io": 6,
        "iperceptions.com": 2,
        "dust.ipfingerprint.com": 6,
        "mbww.com": 4,
        "ipify.org": 8,
        "ipinfo.io": 2,
        "iplogger.ru": 6,
        "centraliprom.com": 4,
        "iprom.net": 4,
        "ipromote.com": 4,
        "clickmanage.com": 4,
        "iq.com": 0,
        "iqiyi.com": 0,
        "qy.net": 0,
        "addelive.com": 4,
        "afdads.com": 4,
        "delivery47.com": 4,
        "ironsrc.com": 4,
        "ironsrc.net": 4,
        "is.com": 4,
        "soom.la": 4,
        "supersonicads.com": 4,
        "tapjoy.com": 4,
        "adsbyisocket.com": 4,
        "isocket.com": 4,
        "isolarcloud.com": 6,
        "isolarcloud.com.a.lahuashanbx.com": 6,
        "isolarcloud.com.w.cdngslb.com": 6,
        "isolarcloud.com.w.kunlunsl.com": 6,
        "ispot.tv": 4,
        "itineraire.info": 2,
        "autolinkmaker.itunes.apple.com": 4,
        "ity.im": 4,
        "iubenda.com": 5,
        "ivcbrasil.org.br": 6,
        "ivitrack.com": 4,
        "iwiw.hu": 2,
        "ixiaa.com": 4,
        "ixquick.com": 8,
        "cdn.izooto.com": 6,
        "jlist.com": 4,
        "getjaco.com": 6,
        "janrainbackplane.com": 6,
        "rpxnow.com": 6,
        "jeeng.com": 4,
        "api.jeeng.com": 4,
        "phone-analytics.com": 6,
        "grazie.ai": 8,
        "intellij.net": 8,
        "jb.gg": 8,
        "jetbrains.ai": 8,
        "jetbrains.com": 8,
        "jetbrains.com.cn": 8,
        "jetbrains.dev": 8,
        "jetbrains.net": 8,
        "jetbrains.org": 8,
        "jetbrains.ru": 8,
        "jetbrains.space": 8,
        "kotl.in": 8,
        "kotlinconf.com": 8,
        "kotlinlang.org": 8,
        "myjetbrains.com": 8,
        "talkingkotlin.com": 8,
        "jetlore.com": 6,
        "pixel.wp.com": 6,
        "stats.wp.com": 6,
        "jetpackdigital.com": 6,
        "jimcdn.com": 10,
        "jimdo.com": 10,
        "jimstatic.com": 10,
        "ads.jinkads.com": 4,
        "jirafe.com": 6,
        "jivosite.com": 2,
        "jivox.com": 4,
        "jobs2careers.com": 4,
        "joinhoney.com": 8,
        "create.leadid.com": 6,
        "d1tprjo2w7krrh.cloudfront.net": 6,
        "cdnjquery.com": 9,
        "jquery.com": 9,
        "cjmooter.xcache.kinxcdn.com": 4,
        "jsdelivr.net": 9,
        "jsecoin.com": 4,
        "jsuol.com.br": 4,
        "contentabc.com": 3,
        "mofos.com": 3,
        "juiceadv.com": 4,
        "juicyads.com": 3,
        "cdn.jumplead.com": 6,
        "jumpstarttaggingsolutions.com": 6,
        "jumptap.com": 4,
        "jump-time.net": 6,
        "jumptime.com": 6,
        "components.justanswer.com": 2,
        "justpremium.com": 4,
        "justpremium.nl": 4,
        "justrelevant.com": 4,
        "jvc.gg": 9,
        "d21rhj7n383afu.cloudfront.net": 0,
        "jwpcdn.com": 0,
        "jwplatform.com": 0,
        "jwplayer.com": 0,
        "jwpltx.com": 0,
        "jwpsrv.com": 0,
        "ltassrv.com": 4,
        "kaeufersiegel.de": 2,
        "kairion.de": 4,
        "kctag.net": 4,
        "kaloo.ga": 4,
        "kaltura.com": 0,
        "kameleoon.com": 6,
        "kameleoon.eu": 6,
        "kampyle.com": 2,
        "kanoodle.com": 4,
        "kmi-us.com": 4,
        "tnsinternet.be": 4,
        "karambasecurity.com": 8,
        "kargo.com": 4,
        "kaspersky-labs.com": 12,
        "kataweb.it": 4,
        "cen.katchup.fr": 4,
        "kau.li": 4,
        "kavanga.ru": 4,
        "kayosports.com.au": 0,
        "dc8na2hxrj29i.cloudfront.net": 6,
        "keen.io": 6,
        "widget.kelkoo.com": 4,
        "xg4ken.com": 6,
        "keymetric.net": 6,
        "lb.keytiles.com": 6,
        "keywee.co": 6,
        "keywordmax.com": 4,
        "massrelevance.com": 7,
        "tweetriver.com": 7,
        "khzbeucrltin.com": 11,
        "ping.kickfactory.com": 4,
        "sa-as.com": 4,
        "sniff.visistat.com": 4,
        "stats.visistat.com": 4,
        "apikik.com": 7,
        "kik-gateway-use1.meetme.com": 7,
        "kik-live.com": 7,
        "kik-stream.meetme.com": 7,
        "kik.com": 7,
        "king.com": 4,
        "midasplayer.com": 8,
        "kinja-img.com": 6,
        "kinja-static.com": 6,
        "kinja.com": 6,
        "kiosked.com": 4,
        "doug1izaerwt3.cloudfront.net": 6,
        "kissmetrics.com": 6,
        "ad.103092804.com": 4,
        "kmdisplay.com": 4,
        "kixer.com": 4,
        "klarna.com": 2,
        "a.klaviyo.com": 6,
        "klaviyo.com": 6,
        "klikki.com": 4,
        "scr.kliksaya.com": 4,
        "mediapeo2.com": 4,
        "knoopstat.nl": 6,
        "knotch.it": 2,
        "komoona.com": 4,
        "kona.kontera.com": 4,
        "ktxtr.com": 4,
        "kontextua.com": 4,
        "cleanrm.net": 4,
        "korrelate.net": 4,
        "trackit.ktxlytics.io": 6,
        "kaptcha.com": 6,
        "krxd.net": 4,
        "d31bfnnwekbny6.cloudfront.net": 4,
        "kpcustomer.de": 4,
        "q-sis.de": 4,
        "kxcdn.com": 9,
        "cdn.kyto.com": 6,
        "cd-ladsp-com.s3.amazonaws.com": 4,
        "ladmp.com": 4,
        "ladsp.com": 4,
        "lanistaads.com": 4,
        "latimes.com": 8,
        "events.launchdarkly.com": 5,
        "launchdarkly.com": 5,
        "launchbit.com": 4,
        "launchpad.net": 8,
        "launchpadcontent.net": 8,
        "layer-ad.org": 4,
        "ph-live.slatic.net": 4,
        "slatic.net": 4,
        "lcxdigital.com": 4,
        "lemde.fr": 8,
        "t1.llanalytics.com": 6,
        "leadback.ru": 6,
        "leaddyno.com": 4,
        "123-tracker.com": 4,
        "55-trk-srv.com": 4,
        "business-path-55.com": 4,
        "click-to-trace.com": 4,
        "cloud-exploration.com": 4,
        "cloud-journey.com": 4,
        "cloud-trail.com": 4,
        "cloudpath82.com": 4,
        "cloudtracer101.com": 4,
        "discover-path.com": 4,
        "discovertrail.net": 4,
        "domainanalytics.net": 4,
        "dthvdr9.com": 4,
        "explore-123.com": 4,
        "finger-info.net": 4,
        "forensics1000.com": 4,
        "ip-route.net": 4,
        "ipadd-path.com": 4,
        "iproute66.com": 4,
        "lead-123.com": 4,
        "lead-analytics-1000.com": 4,
        "lead-watcher.com": 4,
        "leadforensics.com": 4,
        "ledradn.com": 4,
        "letterbox-path.com": 4,
        "letterboxtrail.com": 4,
        "network-handle.com": 4,
        "path-follower.com": 4,
        "path-trail.com": 4,
        "scan-trail.com": 4,
        "site-research.net": 4,
        "srv1010elan.com": 4,
        "the-lead-tracker.com": 4,
        "trace-2000.com": 4,
        "track-web.net": 4,
        "trackdiscovery.net": 4,
        "trackercloud.net": 4,
        "trackinvestigate.net": 4,
        "trail-viewer.com": 4,
        "trail-web.com": 4,
        "trailbox.net": 4,
        "trailinvestigator.com": 4,
        "web-path.com": 4,
        "webforensics.co.uk": 4,
        "websiteexploration.com": 4,
        "www-path.com": 4,
        "gate.leadgenic.com": 4,
        "leadhit.ru": 2,
        "js.leadin.com": 6,
        "io.leadingreports.de": 4,
        "js.leadinspector.de": 6,
        "formalyzer.com": 6,
        "trackalyzer.com": 6,
        "analytics.leadlifesolutions.net": 2,
        "my.leadpages.net": 6,
        "leadplace.fr": 6,
        "scorecard.wspisp.net": 4,
        "www.leadscoreapp.dk": 2,
        "tracker.leadsius.com": 4,
        "leady.com": 4,
        "leady.cz": 4,
        "leiki.com": 4,
        "lengow.com": 4,
        "lenmit.com": 11,
        "lentainform.com": 8,
        "lenua.de": 4,
        "letreach.com": 2,
        "lencr.org": 5,
        "letsencrypt.org": 5,
        "js.letvcdn.com": 6,
        "footprint.net": 8,
        "alphonso.tv": 4,
        "lgads.tv": 4,
        "lg.com": 8,
        "lge.com": 8,
        "lgsmartad.com": 8,
        "lgtvcommon.com": 8,
        "lgtvsdp.com": 8,
        "licensebuttons.net": 9,
        "lfstmedia.com": 4,
        "content-recommendation.net": 4,
        "ligadx.com": 4,
        "ligatus.com": 4,
        "ligatus.de": 4,
        "veeseo.com": 4,
        "limk.com": 4,
        "line-apps.com": 6,
        "line-scdn.net": 6,
        "line.me": 6,
        "tongji.linezing.com": 4,
        "linkbucks.com": 4,
        "linkconnector.com": 4,
        "bizo.com": 8,
        "licdn.com": 8,
        "linkedin.com": 8,
        "lynda.com": 8,
        "ads.linkedin.com": 4,
        "snap.licdn.com": 6,
        "bizographics.com": 4,
        "platform.linkedin.com": 7,
        "linker.hr": 4,
        "linkprice.com": 4,
        "lp4.io": 6,
        "linksalpha.com": 7,
        "erovinmo.com": 4,
        "linksmart.com": 4,
        "linkstorm.net": 2,
        "linksynergy.com": 4,
        "linkup.com": 6,
        "linkwi.se": 4,
        "linkwithin.com": 7,
        "lqm.io": 4,
        "lqmcdn.com": 4,
        "liqwid.net": 4,
        "list.ru": 7,
        "listrakbi.com": 2,
        "live2support.com": 2,
        "live800.com": 2,
        "ladesk.com": 2,
        "livehelpnow.net": 2,
        "liadm.com": 6,
        "l-stat.livejournal.net": 6,
        "liveadexchanger.com": 11,
        "livechat.s3.amazonaws.com": 2,
        "livechatinc.com": 2,
        "livechatinc.net": 2,
        "livechatnow.com": 2,
        "livechatnow.net": 2,
        "liveclicker.net": 2,
        "livecounter.dk": 6,
        "fyre.co": 1,
        "livefyre.com": 1,
        "yadro.ru": 1,
        "liveperson.net": 2,
        "lpsnmedia.net": 2,
        "pippio.com": 4,
        "rapleaf.com": 4,
        "rlcdn.com": 4,
        "livere.co.kr": 7,
        "livere.co.kr.cizion.ixcloud.net": 7,
        "livesportmedia.eu": 8,
        "analytics.livestream.com": 0,
        "livetex.ru": 2,
        "lkqd.net": 4,
        "loadbee.com": 4,
        "loadercdn.com": 11,
        "loadsource.org": 11,
        "web.localytics.com": 101,
        "localytics.com": 101,
        "cdn2.lockerdome.com": 7,
        "addtoany.com": 7,
        "pixel.loganmedia.mobi": 6,
        "ping.answerbook.com": 4,
        "loggly.com": 6,
        "logly.co.jp": 6,
        "logsss.com": 11,
        "lomadee.com": 4,
        "assets.loomia.com": 4,
        "loop11.com": 6,
        "lfov.net": 4,
        "crwdcntrl.net": 4,
        "vidcpm.com": 11,
        "tracker.samplicio.us": 4,
        "lucidmedia.com": 4,
        "lead.adsender.us": 4,
        "livestatserver.com": 6,
        "luckyorange.com": 6,
        "luckyorange.net": 6,
        "luckypushh.com": 11,
        "adelixir.com": 4,
        "lypn.com": 4,
        "lypn.net": 4,
        "lytics.io": 6,
        "lyuoaxruaqdo.com": 11,
        "m-pathy.com": 4,
        "mpnrs.com": 4,
        "m4n.nl": 4,
        "madadsmedia.com": 4,
        "madeleine.de": 4,
        "dinclinx.com": 4,
        "madisonlogic.com": 4,
        "madnet.ru": 4,
        "eu2.madsone.com": 4,
        "magna.ru": 4,
        "d3ezl4ajpp2zy8.cloudfront.net": 4,
        "domdex.com": 4,
        "domdex.net": 4,
        "magnetisemedia.com": 4,
        "magnify360.com": 6,
        "magnuum.com": 11,
        "ad.mail.ru": 4,
        "imgsmail.ru": 7,
        "mail.ru": 7,
        "mradx.net": 7,
        "odnoklassniki.ru": 7,
        "ok.ru": 7,
        "chimpstatic.com": 4,
        "list-manage.com": 4,
        "mailchimp.com": 4,
        "mailerlite.com": 10,
        "mailtrack.io": 4,
        "mainadv.com": 4,
        "makazi.com": 4,
        "makeappdev.xyz": 12,
        "makesource.cool": 11,
        "widgets.mango-office.ru": 4,
        "manycontacts.com": 4,
        "mapandroute.de": 2,
        "mapbox.com": 2,
        "www.maploco.com": 4,
        "px.marchex.io": 4,
        "voicestar.com": 4,
        "mmadsgadget.com": 4,
        "qadabra.com": 4,
        "qadserve.com": 4,
        "qadservice.com": 4,
        "marinsm.com": 4,
        "markandmini.com": 4,
        "ak-cdn.placelocal.com": 4,
        "dt00.net": 4,
        "dt07.net": 4,
        "marketgid.com": 4,
        "mgid.com": 4,
        "marketingautomation.si": 4,
        "marketo.com": 4,
        "marketo.net": 4,
        "mktoresp.com": 4,
        "caanalytics.com": 4,
        "mmstat.com": 4,
        "markmonitor.com": 4,
        "netscope.data.marktest.pt": 4,
        "marshadow.io": 4,
        "martiniadnetwork.com": 4,
        "edigitalsurvey.com": 2,
        "marvellousmachine.net": 6,
        "mbn.com.ua": 4,
        "mastertarget.ru": 4,
        "rns.matelso.de": 6,
        "matheranalytics.com": 6,
        "mathjax.org": 9,
        "nzaza.com": 6,
        "matomo.cloud": 6,
        "matomo.org": 6,
        "piwik.org": 6,
        "adsmarket.com": 4,
        "m2pub.com": 4,
        "matrix.org": 5,
        "mb01.com": 5,
        "maxcdn.com": 9,
        "netdna-cdn.com": 9,
        "netdna-ssl.com": 9,
        "maxlab.ru": 4,
        "maxmind.com": 4,
        "maxonclick.com": 11,
        "mxptint.net": 4,
        "maxymiser.hs.llnwd.net": 4,
        "maxymiser.net": 4,
        "m6r.eu": 4,
        "pixel.adbuyer.com": 4,
        "mcabi.mcloudglobal.com": 4,
        "scanalert.com": 5,
        "ywxi.net": 5,
        "mconet.biz": 4,
        "mdotlabs.com": 4,
        "media-clic.com": 4,
        "media-imdb.com": 9,
        "media.net": 4,
        "mediaimpact.de": 4,
        "mookie1.com": 4,
        "idntfy.ru": 4,
        "s1.mediaad.org": 4,
        "mlnadvertising.com": 4,
        "fhserve.com": 4,
        "media-lab.ai": 8,
        "medialab.la": 8,
        "adnet.ru": 4,
        "medialand.ru": 4,
        "medialead.de": 4,
        "mathads.com": 4,
        "mathtag.com": 4,
        "mediametrics.ru": 7,
        "audit.median.hu": 4,
        "mediapass.com": 4,
        "mt.mediapostcommunication.net": 6,
        "mediarithmics.com": 4,
        "tns-counter.ru": 6,
        "ad.media-servers.net": 4,
        "adsvc1107131.net": 4,
        "mediator.media": 6,
        "mediav.com": 4,
        "adnetinteractive.com": 4,
        "adnetinteractive.net": 4,
        "mediego.com": 4,
        "medleyads.com": 4,
        "adnet.com.tr": 4,
        "e-kolay.net": 4,
        "medyanetads.com": 4,
        "cim.meebo.com": 7,
        "meetrics.net": 4,
        "mxcdn.net": 4,
        "research.de.com": 4,
        "counter.megaindex.ru": 4,
        "mega.co.nz": 8,
        "mega.io": 8,
        "mega.nz": 8,
        "mein-bmi.com": 12,
        "webvisitor.melissadata.net": 6,
        "meltdsp.com": 4,
        "mlt01.com": 4,
        "mentad.com": 4,
        "mercadoclics.com": 4,
        "mercadolivre.com.br": 4,
        "mlstatic.com": 4,
        "merchantadvantage.com": 4,
        "merchenta.com": 4,
        "roia.biz": 4,
        "cdn.merklesearch.com": 6,
        "rkdms.com": 6,
        "messenger.com": 7,
        "ad.metanetwork.com": 7,
        "metaffiliation.com": 4,
        "netaffiliation.com": 4,
        "metalyzer.com": 4,
        "mlsat02.de": 4,
        "metrigo.com": 4,
        "metriweb.be": 4,
        "miaozhen.com": 4,
        "microad.co.jp": 4,
        "microad.jp": 4,
        "microad.net": 4,
        "microadinc.com": 4,
        "azurewebsites.net": 8,
        "cloudapp.net": 8,
        "gfx.ms": 8,
        "microsoft.com": 8,
        "microsoftonline-p.com": 8,
        "microsoftonline.com": 8,
        "microsofttranslator.com": 8,
        "msecnd.net": 8,
        "msedge.net": 8,
        "msocdn.com": 8,
        "onestore.ms": 8,
        "s-microsoft.com": 8,
        "trouter.io": 8,
        "windows.net": 8,
        "aka.ms": 8,
        "microsoftazuread-sso.com": 8,
        "bingapis.com": 8,
        "msauth.net": 8,
        "msauthimages.net": 8,
        "msftauth.net": 8,
        "msftstatic.com": 8,
        "msidentity.com": 8,
        "nelreports.net": 8,
        "windowscentral.com": 8,
        "analytics.live.com": 4,
        "a.clarity.ms": 6,
        "b.clarity.ms": 6,
        "c.clarity.ms": 6,
        "d.clarity.ms": 6,
        "e.clarity.ms": 6,
        "f.clarity.ms": 6,
        "g.clarity.ms": 6,
        "h.clarity.ms": 6,
        "i.clarity.ms": 6,
        "j.clarity.ms": 6,
        "log.clarity.ms": 6,
        "www.clarity.ms": 6,
        "mmismm.com": 4,
        "imgfarm.com": 6,
        "mindspark.com": 6,
        "staticimgfarm.com": 6,
        "mvtracker.com": 4,
        "minewhat.com": 4,
        "mintsapp.io": 2,
        "snackly.co": 0,
        "snippet.minute.ly": 0,
        "apv.configuration.minute.ly": 0,
        "get.mirando.de": 4,
        "mirtesen.ru": 7,
        "misterbell.com": 4,
        "mixi.jp": 7,
        "mixpanel.com": 6,
        "mxpnl.com": 6,
        "mxpnl.net": 6,
        "swf.mixpo.com": 4,
        "app.mluvii.com": 2,
        "mncdn.com": 9,
        "moatads.com": 4,
        "moatpixel.com": 4,
        "mobicow.com": 4,
        "a.mobify.com": 4,
        "mobtrks.com": 11,
        "ads.mocean.mobi": 4,
        "ads.moceanads.com": 4,
        "chat.mochapp.com": 2,
        "intelligentpixel.modernimpact.com": 4,
        "teljari.is": 6,
        "modulepush.com": 4,
        "mogointeractive.com": 4,
        "mokonocdn.com": 4,
        "devappgrant.space": 8,
        "monetate.net": 6,
        "monetize-me.com": 4,
        "ads.themoneytizer.com": 4,
        "mongoosemetrics.com": 4,
        "track.monitis.com": 6,
        "monitus.net": 6,
        "fonts.net": 9,
        "fonts.com": 2,
        "cdn.monsido.com": 6,
        "monster.com": 4,
        "mooxar.com": 4,
        "mopinion.com": 2,
        "mopub.com": 4,
        "ad.ad-arata.com": 4,
        "moras.jp": 4,
        "nedstatbasic.net": 7,
        "webstats.motigo.com": 7,
        "analytics.convertlanguage.com": 6,
        "mouseflow.com": 6,
        "mousestats.com": 4,
        "s.mousetrace.com": 6,
        "movad.de": 8,
        "movad.net": 8,
        "micpn.com": 2,
        "mvb.me": 4,
        "moz.com": 8,
        "firefox.com": 8,
        "mozaws.net": 8,
        "mozgcp.net": 8,
        "mozilla.com": 8,
        "mozilla.net": 8,
        "mozilla.org": 8,
        "storage.mozoo.com": 4,
        "tracker.mrpfd.com": 4,
        "mrpdata.com": 6,
        "mrpdata.net": 6,
        "mrskincash.com": 3,
        "a-msedge.net": 8,
        "b-msedge.net": 8,
        "dual-s-msedge.net": 8,
        "e-msedge.net": 8,
        "k-msedge.net": 8,
        "l-msedge.net": 8,
        "s-msedge.net": 8,
        "spo-msedge.net": 8,
        "t-msedge.net": 8,
        "wac-msedge.net": 8,
        "msn.com": 8,
        "s-msn.com": 8,
        "musculahq.appspot.com": 4,
        "litix.io": 0,
        "mybloglog.com": 7,
        "t.p.mybuys.com": 4,
        "mycdn.me": 9,
        "mycliplister.com": 2,
        "mycounter.com.ua": 6,
        "mycounter.ua": 6,
        "myfonts.net": 6,
        "mypagerank.net": 6,
        "stat.mystat.hu": 7,
        "mythings.com": 4,
        "mystat-in.net": 7,
        "nab.com": 8,
        "nab.com.au": 8,
        "nab.net": 8,
        "nabgroup.com": 8,
        "national.com.au": 8,
        "nationalaustraliabank.com.au": 8,
        "nationalbank.com.au": 8,
        "nakanohito.jp": 4,
        "namogoo.coom": 4,
        "nanigans.com": 4,
        "audiencemanager.de": 4,
        "nanorep.com": 2,
        "narando.com": 0,
        "static.bam-x.com": 4,
        "narrative.io": 6,
        "p1.ntvk1.ru": 4,
        "nativeads.com": 4,
        "cdn01.nativeroll.tv": 0,
        "ntv.io": 4,
        "postrelease.com": 4,
        "navdmp.com": 6,
        "naver.com": 4,
        "naver.net": 4,
        "s-nbcnews.com": 8,
        "richmedia247.com": 4,
        "needle.com": 2,
        "nekudo.com": 2,
        "neodatagroup.com": 4,
        "ad-srv.net": 4,
        "contentspread.net": 4,
        "neory-tm.com": 4,
        "simptrack.com": 4,
        "nerfherdersolo.com": 8,
        "wemfbox.ch": 6,
        "cdnma.com": 4,
        "nr7.us": 4,
        "netavenir.com": 4,
        "netcommunities.com": 4,
        "visibility-stats.com": 4,
        "netbiscuits.net": 6,
        "bbtrack.net": 4,
        "netbooster.com": 4,
        "netflix.com": 0,
        "nflxext.com": 0,
        "nflximg.net": 0,
        "nflxso.net": 0,
        "nflxvideo.net": 0,
        "flxvpn.net": 0,
        "netflix.ca": 0,
        "netflix.com.au": 0,
        "netflix.net": 0,
        "netflixdnstest1.com": 0,
        "netflixdnstest10.com": 0,
        "netflixdnstest2.com": 0,
        "netflixdnstest3.com": 0,
        "netflixdnstest4.com": 0,
        "netflixdnstest5.com": 0,
        "netflixdnstest6.com": 0,
        "netflixdnstest7.com": 0,
        "netflixdnstest8.com": 0,
        "netflixdnstest9.com": 0,
        "netflixinvestor.com": 0,
        "netflixstudios.com": 0,
        "netflixtechblog.com": 0,
        "nflximg.com": 0,
        "netify.ai": 8,
        "netzathleten-media.de": 4,
        "netminers.dk": 6,
        "netmining.com": 4,
        "netmng.com": 4,
        "stat.netmonitor.fi": 6,
        "glanceguide.com": 4,
        "imrworldwide.com": 4,
        "vizu.com": 4,
        "netrk.net": 6,
        "netseer.com": 4,
        "netshelter.net": 4,
        "nsaudience.pl": 6,
        "nwidget.networkedblogs.com": 7,
        "adadvisor.net": 4,
        "d1ros97qkrwjf5.cloudfront.net": 6,
        "newrelic.com": 6,
        "nr-data.net": 6,
        "codestream.com": 6,
        "newscgp.com": 4,
        "nmcdn.us": 4,
        "newstogram.com": 4,
        "newsupdatedir.info": 11,
        "newsupdatewe.info": 12,
        "ads.newtention.net": 4,
        "ads.newtentionassets.net": 4,
        "nexage.com": 4,
        "nexeps.com": 4,
        "nxtck.com": 4,
        "track.nextuser.com": 4,
        "imgsrv.nextag.com": 4,
        "nextclick.pl": 4,
        "nextstat.com": 6,
        "d1d8vn0fpluuz7.cloudfront.net": 6,
        "ads.ngageinc.com": 6,
        "nice264.com": 0,
        "nimblecommerce.com": 4,
        "nineanalytics.io": 4,
        "cho-chin.com": 6,
        "donburako.com": 6,
        "hishaku.com": 6,
        "shinobi.jp": 6,
        "static.nirror.com": 6,
        "nitropay.com": 4,
        "nk.pl": 4,
        "noaa.gov": 8,
        "track.noddus.com": 4,
        "contextbar.ru": 4,
        "nonli.com": 4,
        "non.li": 4,
        "trkme.net": 4,
        "noop.style": 11,
        "nosto.com": 6,
        "adleadevent.com": 4,
        "notifyfox.com": 6,
        "notion.so": 8,
        "nowinteract.com": 6,
        "npario-inc.net": 6,
        "nplexmedia.com": 4,
        "nrelate.com": 2,
        "ns8.com": 4,
        "nt.vc": 8,
        "featurelink.com": 4,
        "ntp.org": 5,
        "ntppool.org": 5,
        "tracer.jp": 6,
        "nuffnang.com": 4,
        "nuggad.net": 4,
        "rotator.adjuggler.com": 4,
        "numbers.md": 6,
        "channeliq.com": 5,
        "nyacampwk.com": 11,
        "nyetm2mkch.com": 11,
        "nyt.com": 8,
        "nytimes.com": 8,
        "o12zs3u2n.com": 11,
        "o2.pl": 8,
        "o2online.de": 8,
        "oath.com": 8,
        "observerapp.com": 4,
        "ocioso.com.br": 7,
        "oclasrv.com": 11,
        "octapi.net": 11,
        "service.octavius.rocks": 4,
        "office.com": 8,
        "office.net": 8,
        "office365.com": 8,
        "oghub.io": 11,
        "ohmystats.com": 6,
        "adohana.com": 4,
        "photorank.me": 4,
        "olark.com": 2,
        "olx-st.com": 8,
        "onap.io": 8,
        "omarsys.com": 4,
        "ometria.com": 4,
        "omgpm.com": 7,
        "omniconvert.com": 4,
        "omnidsp.com": 4,
        "oms.eu": 4,
        "omsnative.de": 4,
        "onaudience.com": 4,
        "btc-echode.api.oneall.com": 7,
        "tracking.onefeed.co.uk": 6,
        "onesignal.com": 5,
        "os.tc": 5,
        "stat.onestat.com": 6,
        "ocdn.eu": 8,
        "onet.pl": 8,
        "onetag.com": 4,
        "s-onetag.com": 4,
        "onetrust.com": 5,
        "fogl1onf.com": 4,
        "onfocus.io": 4,
        "onlinewebstat.com": 6,
        "onlinewebstats.com": 6,
        "onswipe.com": 4,
        "onthe.io": 6,
        "moon-ray.com": 4,
        "moonraymarketing.com": 4,
        "ooyala.com": 0,
        "openadex.dk": 4,
        "247realmedia.com": 4,
        "oaserve.com": 4,
        "realmedia.com": 4,
        "realmediadigital.com": 4,
        "opensharecount.com": 4,
        "chatgpt.com": 8,
        "oaistatic.com": 8,
        "oaiusercontent.com": 8,
        "openai.com": 8,
        "oloadcdn.net": 9,
        "openload.co": 9,
        "openstat.net": 6,
        "spylog.com": 6,
        "spylog.ru": 6,
        "opentracker.net": 6,
        "openwebanalytics.com": 6,
        "odnxs.net": 4,
        "openx.net": 4,
        "openx.org": 4,
        "openxenterprise.com": 4,
        "servedbyopenx.com": 4,
        "adsummos.net": 4,
        "opinary.com": 2,
        "opinionbar.com": 2,
        "emagazines.com": 6,
        "allawnos.com": 101,
        "allawntech.com": 101,
        "heytapdl.com": 101,
        "heytapmobi.com": 101,
        "heytapmobile.com": 101,
        "oppomobile.com": 101,
        "opta.net": 6,
        "optaim.com": 4,
        "cookielaw.org": 5,
        "service.optify.net": 4,
        "optimatic.com": 0,
        "optmd.com": 4,
        "optimicdn.com": 9,
        "optimizely.com": 6,
        "episerver.net": 6,
        "optimonk.com": 6,
        "mstrlytcs.com": 2,
        "optmnstr.com": 2,
        "optmstr.com": 2,
        "optnmstr.com": 2,
        "optincollect.com": 4,
        "volvelle.tech": 4,
        "ora.tv": 4,
        "oracleinfinity.io": 6,
        "instantservice.com": 2,
        "ts.istrack.com": 2,
        "rightnowtech.com": 8,
        "rnengage.com": 8,
        "orange.fr": 4,
        "orangeads.fr": 4,
        "ads.orange142.com": 4,
        "wanadoo.fr": 8,
        "otracking.com": 4,
        "emxdgt.com": 4,
        "static.ordergroove.com": 4,
        "orelsite.ru": 2,
        "otclick-adv.ru": 4,
        "othersearch.info": 8,
        "otm-r.com": 4,
        "otto.de": 8,
        "ottogroup.media": 8,
        "outbrain.com": 4,
        "outbrainimg.com": 4,
        "live.com": 13,
        "cloud.microsoft": 13,
        "hotmail.com": 13,
        "outlook.com": 13,
        "svc.ms": 13,
        "overheat.it": 6,
        "oewabox.at": 6,
        "owneriq.net": 4,
        "ownpage.fr": 2,
        "owox.com": 6,
        "adconnexa.com": 2,
        "adsbwm.com": 2,
        "oxomi.com": 4,
        "oztam.com.au": 8,
        "pageanalytics.space": 11,
        "blockmetrics.com": 2,
        "pagefair.com": 2,
        "pagefair.net": 2,
        "btloader.com": 2,
        "ghmedia.com": 4,
        "777seo.com": 4,
        "paid-to-promote.net": 4,
        "ptp22.com": 4,
        "ptp33.com": 4,
        "paperg.com": 4,
        "pardot.com": 6,
        "d1z2jf7jlzjs58.cloudfront.net": 6,
        "parsely.com": 6,
        "partner-ads.com": 4,
        "passionfruitads.com": 4,
        "pathful.com": 6,
        "pay-hit.com": 4,
        "payclick.it": 4,
        "app.paykickstart.com": 6,
        "paypal.com": 2,
        "paypalobjects.com": 2,
        "pcvark.com": 11,
        "peer39.com": 4,
        "peer39.net": 4,
        "peer5.com": 9,
        "peerius.com": 2,
        "pendo.io": 6,
        "pepper.com": 4,
        "gopjn.com": 4,
        "pjatr.com": 4,
        "pjtra.com": 4,
        "pntra.com": 4,
        "pntrac.com": 4,
        "pntrs.com": 4,
        "player.pepsia.com": 6,
        "perfdrive.com": 11,
        "perfectaudience.com": 4,
        "prfct.co": 4,
        "perfectmarket.com": 4,
        "perfops.io": 6,
        "performgroup.com": 5,
        "analytics.performable.com": 6,
        "performancing.com": 6,
        "performax.cz": 4,
        "perimeterx.net": 6,
        "permutive.com": 4,
        "persgroep.net": 4,
        "persianstat.com": 6,
        "code.pers.io": 4,
        "counter.personyze.com": 2,
        "petametrics.com": 2,
        "ads.pheedo.com": 4,
        "app.phonalytics.com": 2,
        "d2bgg7rjywcwsy.cloudfront.net": 4,
        "piguiqproxy.com": 11,
        "trgt.eu": 6,
        "pingdom.net": 6,
        "pinimg.com": 7,
        "pinterest.com": 7,
        "app.pipz.io": 4,
        "disabled.invalid": 6,
        "piwik.pro": 6,
        "adrta.com": 4,
        "app.pixelpop.co": 4,
        "pixfuture.net": 4,
        "vast1.pixfuture.com": 4,
        "piximedia.com": 4,
        "pizzaandads.com": 11,
        "ads.placester.net": 4,
        "d3uemyw1e5n0jw.cloudfront.net": 4,
        "pladform.com": 4,
        "tag.bi.serviceplan.com": 6,
        "pfrm.co": 4,
        "impact-ad.jp": 4,
        "loveadvert.ru": 4,
        "playbuzz.com": 2,
        "pof.com": 6,
        "plex.bz": 0,
        "plex.direct": 0,
        "plex.tv": 0,
        "analytics.plex.tv": 6,
        "metrics.plex.tv": 6,
        "plista.com": 4,
        "plugrush.com": 4,
        "pluso.ru": 7,
        "plutusads.com": 4,
        "pmddby.com": 12,
        "pnamic.com": 12,
        "po.st": 7,
        "widgets.getpocket.com": 6,
        "pocketcents.com": 4,
        "pointificsecure.com": 6,
        "pointroll.com": 4,
        "poirreleast.club": 11,
        "mediavoice.com": 4,
        "polar.me": 4,
        "polarmobile.com": 4,
        "polldaddy.com": 2,
        "polyad.net": 4,
        "polyfill.io": 8,
        "popads.net": 4,
        "popadscdn.net": 4,
        "popcash.net": 4,
        "popcashjs.b-cdn.net": 4,
        "desv383oqqc0.cloudfront.net": 6,
        "popin.cc": 7,
        "cdn.popmyads.com": 4,
        "poponclick.com": 4,
        "populis.com": 4,
        "populisengage.com": 4,
        "phncdn.com": 3,
        "pornhub.com": 3,
        "prscripts.com": 3,
        "prstatics.com": 3,
        "prwidgets.com": 3,
        "barra.brasil.gov.br": 4,
        "postaffiliatepro.com": 4,
        "powerlinks.com": 4,
        "powerreviews.com": 2,
        "powr.io": 6,
        "api.pozvonim.com": 4,
        "prebid.org": 4,
        "precisionclick.com": 4,
        "adserver.com.br": 4,
        "predicta.net": 4,
        "prnx.net": 4,
        "ppjol.com": 4,
        "ppjol.net": 4,
        "api.pressly.com": 4,
        "pricegrabber.com": 4,
        "cdn.pricespider.com": 4,
        "pmdrecrute.com": 4,
        "prismamediadigital.com": 4,
        "privy.com": 2,
        "pswec.com": 4,
        "prodperfect.com": 6,
        "lib.productsup.io": 4,
        "proadsnet.com": 6,
        "profitshare.ro": 6,
        "tracking.proformics.com": 6,
        "programattik.com": 4,
        "projectwonderful.com": 4,
        "propelmarketing.com": 4,
        "oclaserver.com": 4,
        "onclasrv.com": 4,
        "onclickads.net": 4,
        "onclkds.com": 4,
        "propellerads.com": 4,
        "propellerpops.com": 4,
        "proper.io": 4,
        "st-a.props.id": 4,
        "propvideo.net": 11,
        "tr.prospecteye.com": 4,
        "prosperent.com": 4,
        "prostor-lite.ru": 4,
        "reports.proton.me": 2,
        "providesupport.com": 2,
        "proximic.com": 4,
        "proxistore.com": 4,
        "pscp.tv": 7,
        "pstatic.net": 9,
        "psyma.com": 4,
        "ptengine.jp": 6,
        "pub-fit.com": 4,
        "pub.network": 4,
        "learnpipe.com": 2,
        "pubble.co": 2,
        "pubdirecte.com": 4,
        "pubgears.com": 4,
        "publicidees.com": 4,
        "publicidad.net": 4,
        "intgr.net": 4,
        "pubmatic.com": 4,
        "pubnub.com": 8,
        "puboclic.com": 4,
        "pulpix.com": 4,
        "tentaculos.net": 4,
        "pulse360.com": 4,
        "pulseinsights.com": 6,
        "contextweb.com": 4,
        "pulsepoint.com": 4,
        "punchtab.com": 4,
        "purch.com": 4,
        "servebom.com": 4,
        "purechat.com": 2,
        "cdn.pprl.io": 6,
        "oopt.fr": 4,
        "puserving.com": 11,
        "push.world": 2,
        "pushengage.com": 2,
        "pushame.com": 11,
        "zebra.pushbullet.com": 2,
        "pushcrew.com": 2,
        "pusher.com": 6,
        "pusherapp.com": 6,
        "pushnative.com": 11,
        "cdn.pushnews.eu": 4,
        "pushno.com": 11,
        "pushwhy.com": 11,
        "pushwoosh.com": 2,
        "pvclouds.com": 11,
        "ads.q1media.com": 4,
        "q1mediahydraplatform.com": 4,
        "q-divisioncdn.de": 4,
        "qbaka.net": 6,
        "track.qcri.org": 6,
        "collect.qeado.com": 6,
        "s.lianmeng.360.cn": 6,
        "qq.com": 2,
        "qrius.me": 7,
        "qualaroo.com": 6,
        "qualcomm.com": 8,
        "gpsonextra.net": 15,
        "izatcloud.net": 15,
        "xtracloud.net": 15,
        "bluecava.com": 4,
        "qualtrics.com": 6,
        "quantcast.com": 4,
        "quantserve.com": 4,
        "quantcount.com": 6,
        "quantummetric.com": 6,
        "quartic.pl": 6,
        "quarticon.com": 6,
        "d3c3cq33003psk.cloudfront.net": 6,
        "qubit.com": 6,
        "easyresearch.se": 2,
        "queue-it.net": 6,
        "quick-counter.net": 6,
        "adsonar.com": 4,
        "qnsr.com": 4,
        "quinstreet.com": 4,
        "thecounter.com": 4,
        "quintelligence.com": 6,
        "qservz.com": 4,
        "quisma.com": 4,
        "quora.com": 7,
        "ads-digitalkeys.com": 4,
        "rackcdn.com": 9,
        "radarurl.com": 6,
        "dsa.csdata1.com": 4,
        "gwallet.com": 4,
        "r1-cdn.net": 4,
        "widget.raisenow.com": 6,
        "mediaforge.com": 4,
        "rmtag.com": 4,
        "rakuten.co.jp": 4,
        "trafficgate.net": 4,
        "mtwidget04.affiliate.rakuten.co.jp": 4,
        "xml.affilliate.rakuten.co.jp": 4,
        "rambler.ru": 6,
        "top100.ru": 6,
        "rapidspike.com": 6,
        "ravelin.com": 6,
        "rawgit.com": 9,
        "raygun.io": 4,
        "count.rbc.ru": 6,
        "rcs.it": 4,
        "rcsmediagroup.it": 4,
        "d335luupugsy2.cloudfront.net": 6,
        "rea-group.com": 4,
        "reagroupdata.com.au": 4,
        "reastatic.net": 4,
        "d12ulf131zb0yj.cloudfront.net": 6,
        "reachforce.com": 6,
        "reachjunction.com": 4,
        "cdn.rlets.com": 4,
        "reachlocal.com": 4,
        "reachlocallivechat.com": 4,
        "rlcdn.net": 4,
        "plugin.reactful.com": 4,
        "reactivpub.fr": 6,
        "skinected.com": 4,
        "readrboard.com": 7,
        "readme.com": 6,
        "readme.io": 6,
        "readspeaker.com": 2,
        "realclick.co.kr": 4,
        "realestate.com.au": 4,
        "realperson.de": 2,
        "powermarketing.com": 2,
        "realtime.co": 2,
        "webspectator.com": 2,
        "dcniko1cv0rz.cloudfront.net": 6,
        "realytics.io": 6,
        "static.rbl.ms": 6,
        "recaptcha.net": 8,
        "recettes.net": 8,
        "static.recopick.com": 4,
        "recreativ.ru": 4,
        "analytics.recruitics.com": 6,
        "analytics.cohesionapps.com": 6,
        "cdn.cohesionapps.com": 6,
        "redblue.de": 6,
        "atendesoftware.pl": 9,
        "redd.it": 7,
        "reddit-image.s3.amazonaws.com": 7,
        "reddit.com": 7,
        "redditmedia.com": 7,
        "redditstatic.com": 7,
        "redhelper.ru": 2,
        "pixelinteractivemedia.com": 4,
        "triggit.com": 4,
        "grt01.com": 4,
        "grt02.com": 4,
        "redtram.com": 4,
        "rdtcdn.com": 9,
        "redtube.com": 9,
        "reduxmedia.com": 4,
        "reduxmediagroup.com": 4,
        "reedbusiness.net": 6,
        "reembed.com": 0,
        "reevoo.com": 4,
        "refericon.pl": 4,
        "ads.referlocal.com": 4,
        "refersion.com": 4,
        "refinedads.com": 4,
        "product.reflektion.com": 4,
        "reformal.ru": 2,
        "reinvigorate.net": 6,
        "convertglobal.com": 4,
        "convertglobal.s3.amazonaws.com": 4,
        "dnhgz729v27ca.cloudfront.net": 4,
        "reklamstore.com": 4,
        "ad.reklamport.com": 4,
        "delivery.reklamz.com": 4,
        "adimg.rekmob.com": 4,
        "relap.io": 4,
        "svtrd.com": 5,
        "synovite-scripts.com": 5,
        "tdn.r42tag.com": 5,
        "relestar.com": 6,
        "relevant4.com": 8,
        "remintrex.com": 4,
        "remove.video": 12,
        "rp-api.com": 4,
        "republer.com": 4,
        "resmeter.respublica.al": 6,
        "researchnow.com": 4,
        "reson8.com": 4,
        "respondhq.com": 4,
        "adinsight.com": 4,
        "adinsight.eu": 4,
        "responsetap.com": 4,
        "data.resultlinks.com": 4,
        "sli-system.com": 6,
        "retailrocket.net": 4,
        "retailrocket.ru": 4,
        "shopify.retargetapp.com": 4,
        "retargeter.com": 4,
        "retargeting.cl": 4,
        "d1stxfv94hrhia.cloudfront.net": 4,
        "waves.retentionscience.com": 4,
        "reutersmedia.net": 9,
        "revcontent.com": 4,
        "socialtwist.com": 4,
        "revenue.com": 4,
        "clkads.com": 4,
        "clkmon.com": 4,
        "clkrev.com": 4,
        "clksite.com": 4,
        "eclkspbn.com": 4,
        "imageshack.host": 4,
        "revenuemantra.com": 4,
        "revive-adserver.com": 4,
        "revolvermaps.com": 6,
        "cts.tradepub.com": 4,
        "revresponse.com": 4,
        "incontext.pl": 4,
        "pl-engine.intextad.net": 4,
        "addesktop.com": 4,
        "1rx.io": 4,
        "ria.ru": 8,
        "rmbn.ru": 4,
        "ics0.com": 2,
        "richrelevance.com": 2,
        "ringier.ch": 6,
        "meteorsolutions.com": 7,
        "riskified.com": 2,
        "rncdn3.com": 9,
        "ro2.biz": 4,
        "rbxcdn.com": 8,
        "getrockerbox.com": 6,
        "rocket.la": 4,
        "trk.sodoit.com": 4,
        "collector.roistat.com": 6,
        "rollad.ru": 4,
        "d37gvrvc0wt4s1.cloudfront.net": 6,
        "get.roost.me": 6,
        "getrooster.com": 6,
        "rqtrk.eu": 4,
        "rotaban.ru": 4,
        "routenplaner-karten.com": 2,
        "rovion.com": 4,
        "rsspump.com": 2,
        "creativecdn.com": 4,
        "rvty.net": 4,
        "rtbsuperhub.com": 4,
        "rtl.de": 8,
        "static-fra.de": 8,
        "technical-service.net": 8,
        "rtmark.net": 4,
        "dpclk.com": 4,
        "mobsmith.com": 4,
        "nearbyad.com": 4,
        "rubiconproject.com": 4,
        "tracker.ruhrgebiet-onlineservices.de": 4,
        "click.rummycircle.com": 4,
        "runadtag.com": 4,
        "rundsp.com": 4,
        "un-syndicate.com": 4,
        "cdn.secretrune.com": 6,
        "runmewivel.com": 10,
        "rhythmxchange.com": 0,
        "s24.com": 4,
        "s3xified.com": 11,
        "camp.sabavision.com": 4,
        "sageanalyst.net": 4,
        "sail-horizon.com": 4,
        "sail-personalize.com": 4,
        "sailthru.com": 4,
        "d16fk4ms6rqz1v.cloudfront.net": 4,
        "salecycle.com": 4,
        "api.salesfeed.com": 4,
        "salesmanago.com": 6,
        "salesmanago.pl": 6,
        "force.com": 4,
        "salesforce.com": 4,
        "liveagentforsalesforce.com": 2,
        "salesforceliveagent.com": 2,
        "msgapp.com": 4,
        "salespidermedia.com": 4,
        "salesviewer.com": 6,
        "samba.tv": 4,
        "game-mode.net": 8,
        "gos-gsp.io": 8,
        "lldns.net": 8,
        "pavv.co.kr": 8,
        "remotesamsung.com": 8,
        "samsung-gamelauncher.com": 8,
        "samsung.co.kr": 8,
        "samsung.com": 8,
        "samsung.com.cn": 8,
        "samsungcloud.com": 8,
        "samsungcloudcdn.com": 8,
        "samsungcloudprint.com": 8,
        "samsungcloudsolution.com": 8,
        "samsungcloudsolution.net": 8,
        "samsungelectronics.com": 8,
        "samsunghealth.com": 8,
        "samsungiotcloud.com": 8,
        "samsungknox.com": 8,
        "samsungnyc.com": 8,
        "samsungosp.com": 8,
        "samsungotn.net": 8,
        "samsungpositioning.com": 8,
        "samsungqbe.com": 8,
        "samsungrm.net": 8,
        "samsungrs.com": 8,
        "samsungsemi.com": 8,
        "samsungsetup.com": 8,
        "samsungusa.com": 8,
        "secb2b.com": 8,
        "smartthings.com": 8,
        "adgear.com": 4,
        "adgrx.com": 4,
        "samsungacr.com": 4,
        "samsungadhub.com": 4,
        "samsungads.com": 4,
        "samsungtifa.com": 4,
        "aibixby.com": 101,
        "findmymobile.samsung.com": 101,
        "samsapps.cust.lldns.net": 101,
        "samsung-omc.com": 101,
        "samsungapps.com": 101,
        "samsungdiroute.net": 101,
        "samsungdive.com": 101,
        "samsungdm.com": 101,
        "samsungdmroute.com": 101,
        "samsungmdec.com": 101,
        "samsungvisioncloud.com": 101,
        "sbixby.com": 101,
        "ospserver.net": 101,
        "samsungdms.net": 101,
        "samsungmax.com": 101,
        "samsungmobile.com": 101,
        "secmobilesvc.com": 101,
        "push.samsungosp.com": 8,
        "pushmessage.samsung.com": 8,
        "scs.samsungqbe.com": 8,
        "ssp.samsung.com": 8,
        "samsungsds.com": 10,
        "internetat.tv": 15,
        "samsungcloud.tv": 15,
        "tizenservice.com": 15,
        "ilsemedia.nl": 4,
        "sanoma.fi": 4,
        "d13im3ek7neeqp.cloudfront.net": 6,
        "d28ethi6slcjbm.cloudfront.net": 6,
        "d2uevgmgh16uk4.cloudfront.net": 6,
        "d3m83gvgzupli.cloudfront.net": 6,
        "saas.seewhy.com": 6,
        "leadforce1.com": 2,
        "vlog.leadformix.com": 2,
        "sap-xm.org": 4,
        "sape.ru": 6,
        "js.sl.pt": 4,
        "aimatch.com": 6,
        "sas.com": 6,
        "say.ac": 4,
        "ads.saymedia.com": 4,
        "srv.sayyac.net": 6,
        "scarabresearch.com": 4,
        "schibsted.com": 8,
        "schibsted.io": 8,
        "schneevonmorgen.com": 0,
        "svonm.com": 0,
        "rockabox.co": 4,
        "scorecardresearch.com": 6,
        "scoreresearch.com": 6,
        "scrsrch.com": 6,
        "securestudies.com": 6,
        "scout.scoutanalytics.net": 4,
        "scribblelive.com": 8,
        "scribol.com": 4,
        "analytics.snidigital.com": 6,
        "scroll.com": 5,
        "scupio.com": 4,
        "search123.uk.com": 4,
        "searchforce.net": 4,
        "searchignite.com": 4,
        "srtk.net": 4,
        "tacticalrepublic.com": 4,
        "sectigo.com": 5,
        "securedtouch.com": 6,
        "securedvisit.com": 4,
        "bacontent.de": 4,
        "nativendo.de": 4,
        "seedtag.com": 4,
        "svlu.net": 6,
        "d2dq2ahtl5zl1z.cloudfront.net": 6,
        "d47xnnr8b1rki.cloudfront.net": 6,
        "segment.com": 6,
        "segment.io": 6,
        "rutarget.ru": 4,
        "segmint.net": 6,
        "sekindo.com": 4,
        "sellpoint.net": 4,
        "sellpoints.com": 4,
        "semantiqo.com": 4,
        "semasio.net": 4,
        "semilo.com": 4,
        "semknox.com": 5,
        "sibautomation.com": 4,
        "sendpulse.com": 3,
        "sendsay.ru": 2,
        "track.sensedigital.in": 6,
        "static.sensorsdata.cn": 6,
        "sentifi.com": 6,
        "d3nslu0hdya83q.cloudfront.net": 6,
        "getsentry.com": 6,
        "ravenjs.com": 6,
        "sentry.io": 6,
        "sepyra.com": 4,
        "d2oh4tlt9mrke9.cloudfront.net": 6,
        "sessioncam.com": 6,
        "sessionly.io": 2,
        "71i.de": 4,
        "sexad.net": 3,
        "ads.sexinyourcity.com": 3,
        "sextracker.com": 3,
        "sexypartners.net": 3,
        "im.cz": 6,
        "imedia.cz": 6,
        "szn.cz": 6,
        "dtym7iokkjlif.cloudfront.net": 6,
        "shareaholic.com": 6,
        "shareasale.com": 4,
        "quintrics.nl": 2,
        "sharecompany.nl": 2,
        "sharepointonline.com": 8,
        "onmicrosoft.com": 8,
        "sharepoint.com": 8,
        "sharethis.com": 4,
        "shareth.ru": 4,
        "sharethrough.com": 4,
        "marketingautomation.services": 6,
        "sharpspring.com": 6,
        "sheego.de": 8,
        "services.sheerid.com": 4,
        "shinystat.com": 6,
        "shinystat.it": 6,
        "app.shoptarget.com.br": 4,
        "retargeter.com.br": 4,
        "shopauskunft.de": 2,
        "shopgate.com": 2,
        "shopify.com": 2,
        "shopifycdn.com": 2,
        "cdn.shopify.com": 2,
        "myshopify.com": 2,
        "shop.app": 2,
        "shopify.co.za": 2,
        "shopify.com.au": 2,
        "shopify.com.mx": 2,
        "shopify.dev": 2,
        "shopifyapps.com": 2,
        "shopifycdn.net": 2,
        "shopifynetwork.com": 2,
        "shopifypreview.com": 2,
        "shopifysvc.com": 6,
        "stats.shopify.com": 6,
        "v.shopify.com": 6,
        "shopifycloud.com": 2,
        "shopperapproved.com": 2,
        "shoppingshadow.com": 4,
        "tracking.shopping-flux.com": 6,
        "shoprunner.com": 2,
        "shopsocially.com": 2,
        "shopzilla.com": 4,
        "shortnews.de": 8,
        "showrss.info": 8,
        "shink.in": 2,
        "shutterstock.com": 8,
        "siblesectiveal.club": 11,
        "d3v27wwd40f0xu.cloudfront.net": 6,
        "getsidecar.com": 6,
        "dtlilztwypawv.cloudfront.net": 6,
        "siftscience.com": 6,
        "btstatic.com": 5,
        "signal.co": 5,
        "thebrighttag.com": 5,
        "cdn-scripts.signifyd.com": 6,
        "signifyd.com": 6,
        "gw-services.vtrenz.net": 2,
        "mkt51.net": 2,
        "mkt912.com": 2,
        "mkt922.com": 2,
        "mkt941.com": 2,
        "pages01.net": 2,
        "pages02.net": 2,
        "pages04.net": 2,
        "pages05.net": 2,
        "similardeals.net": 8,
        "similarweb.com": 6,
        "similarweb.io": 6,
        "d8rk54i4mohrb.cloudfront.net": 6,
        "simplereach.com": 6,
        "simpli.fi": 4,
        "sina.com.cn": 6,
        "sinaimg.cn": 9,
        "reporting.singlefeed.com": 4,
        "sddan.com": 6,
        "site24x7rum.com": 6,
        "site24x7rum.eu": 6,
        "sitebooster-fjfmworld-production.azureedge.net": 7,
        "a5.ogt.jp": 4,
        "siteapps.com": 2,
        "sitebro.com": 6,
        "sitebro.com.tw": 6,
        "sitebro.net": 6,
        "sitebro.tw": 6,
        "siteheart.com": 2,
        "siteimprove.com": 6,
        "siteimproveanalytics.com": 6,
        "sitelabweb.com": 11,
        "sitemeter.com": 6,
        "pixel.ad": 4,
        "sitescout.com": 4,
        "ad.sitemaji.com": 2,
        "sitetag.us": 2,
        "analytics.sitewit.com": 4,
        "ads.sixapart.com": 4,
        "sixt-neuwagen.de": 8,
        "skadtec.com": 6,
        "redirectingat.com": 4,
        "skimlinks.com": 4,
        "skimresources.com": 4,
        "analytics.skroutz.gr": 6,
        "skyglue.com": 6,
        "skype.com": 2,
        "skypeassets.com": 2,
        "skysa.com": 2,
        "skyscnr.com": 9,
        "slack-edge.com": 8,
        "slack-imgs.com": 8,
        "slack.com": 8,
        "slackb.com": 8,
        "slashdot.org": 2,
        "sleeknotestaticcontent.sleeknote.com": 2,
        "resultspage.com": 2,
        "builder.extensionfactory.com": 2,
        "freeskreen.com": 6,
        "slingpic.com": 4,
        "smaato.net": 4,
        "smart4ads.com": 4,
        "sascdn.com": 4,
        "smartadserver.com": 4,
        "styria-digital.com": 4,
        "yoc-adserver.com": 4,
        "smartcall.kz": 2,
        "getsmartcontent.com": 4,
        "smartdevicemedia.com": 4,
        "x.cnt.my": 4,
        "tracking.smartselling.cz": 2,
        "bepolite.eu": 4,
        "smartbn.ru": 4,
        "smartclick.net": 4,
        "smartclip.net": 4,
        "smartcontext.pl": 4,
        "d1n00d49gkbray.cloudfront.net": 4,
        "dhxtx5wtu812h.cloudfront.net": 4,
        "smartertravel.com": 4,
        "travelsmarter.net": 4,
        "smct.co": 4,
        "smartertrack.com": 4,
        "smartlink.cool": 11,
        "getsmartlook.com": 2,
        "smartlook.com": 2,
        "smartstream.tv": 4,
        "smartsuppchat.com": 2,
        "smi2.net": 6,
        "smi2.ru": 6,
        "stat.media": 6,
        "cdn.smooch.io": 2,
        "smowtion.com": 4,
        "smxindia.in": 6,
        "smyte.com": 6,
        "snacktv.de": 6,
        "snap.com": 2,
        "addlive.io": 2,
        "feelinsonice.com": 2,
        "sc-cdn.net": 2,
        "sc-corp.net": 2,
        "sc-gw.com": 2,
        "sc-jpl.com": 2,
        "sc-prod.net": 2,
        "snap-dev.net": 2,
        "snapads.com": 2,
        "snapkit.com": 2,
        "snapengage.com": 2,
        "sc-static.net": 4,
        "snapchat.com": 4,
        "snapcraft.io": 8,
        "snapcraftcontent.com": 8,
        "h-bid.com": 4,
        "eu2.snoobi.eu": 6,
        "snoobi.com": 6,
        "d346whrrklhco7.cloudfront.net": 6,
        "d78fikflryjgj.cloudfront.net": 6,
        "dc8xl0ndzn2cb.cloudfront.net": 6,
        "playwire.com": 6,
        "snplow.net": 6,
        "go-mpulse.net": 6,
        "mpstat.us": 6,
        "tiaa-cref.org": 6,
        "sociablelabs.com": 4,
        "socialamp.com": 4,
        "socialannex.com": 4,
        "soclminer.com.br": 7,
        "duu8lzqdm8tsz.cloudfront.net": 4,
        "ratevoice.com": 7,
        "sociaplus.com": 6,
        "sociomantic.com": 4,
        "images.sohu.com": 7,
        "sojern.com": 4,
        "sokrati.com": 4,
        "solads.media": 4,
        "solaredge.com": 8,
        "solidopinion.com": 2,
        "pixel.solvemedia.com": 4,
        "soma2.de": 4,
        "mobileadtrading.com": 4,
        "sonobi.com": 4,
        "sonos.com": 8,
        "sophus3.com": 4,
        "deployads.com": 4,
        "sndcdn.com": 0,
        "soundcloud.com": 0,
        "provenpixel.com": 4,
        "decenthat.com": 4,
        "summerhamster.com": 4,
        "d3pkae9owd2lcf.cloudfront.net": 4,
        "lijit.com": 4,
        "onscroll.com": 4,
        "rts.sparkstudios.com": 0,
        "sparkasse.de": 8,
        "speakpipe.com": 2,
        "adviva.net": 4,
        "specificclick.net": 4,
        "specificmedia.com": 4,
        "spectate.com": 6,
        "speedshiftmedia.com": 4,
        "speedcurve.com": 6,
        "admarket.entireweb.com": 4,
        "affiliate.entireweb.com": 4,
        "sa.entireweb.com": 4,
        "speee-ad.akamaized.net": 4,
        "sphere.com": 4,
        "surphace.com": 4,
        "api.spheremall.com": 6,
        "zdwidget3-bs.sphereup.com": 2,
        "static.sspicy.ru": 4,
        "spider.ad": 4,
        "metrics.spiderads.eu": 4,
        "spn.ee": 6,
        "embed.spokenlayer.com": 0,
        "spongecell.com": 4,
        "sponsorads.de": 4,
        "sportsbetaffiliates.com.au": 4,
        "spot.im": 7,
        "spoteffects.net": 6,
        "scdn.co": 0,
        "spotify.com": 0,
        "pscdn.co": 0,
        "spotifycdn.com": 0,
        "spotifycdn.net": 0,
        "spotilocal.com": 0,
        "embed.spotify.com": 0,
        "spotscenered.info": 11,
        "spotx.tv": 4,
        "spotxcdn.com": 4,
        "spotxchange.com": 4,
        "spoutable.com": 4,
        "cdn.springboardplatform.com": 4,
        "springserve.com": 4,
        "pixel.sprinklr.com": 4,
        "stat.sputnik.ru": 6,
        "email-match.com": 4,
        "squarespace.com": 6,
        "srvtrck.com": 12,
        "srvvtrk.com": 11,
        "sstatic.net": 9,
        "hatena.ne.jp": 7,
        "st-hatena.com": 7,
        "stackadapt.com": 4,
        "stackpathdns.com": 9,
        "stailamedia.com": 4,
        "stalluva.pro": 11,
        "startappservice.com": 4,
        "hit.stat24.com": 6,
        "adstat.4u.pl": 6,
        "stat.4u.pl": 6,
        "statcounter.com": 6,
        "stathat.com": 6,
        "statisfy.net": 6,
        "statsy.net": 11,
        "statuscake.com": 6,
        "statuspage.io": 2,
        "stspg-customer.com": 2,
        "stayfriends.de": 8,
        "steelhousemedia.com": 4,
        "steepto.com": 4,
        "stepstone.com": 8,
        "4stats.de": 6,
        "stetic.com": 6,
        "stickyadstv.com": 4,
        "stocktwits.com": 2,
        "storify.com": 4,
        "storygize.net": 4,
        "bizsolutions.strands.com": 4,
        "strava.com": 6,
        "mailfoogae.appspot.com": 2,
        "streamotion.com.au": 0,
        "streamrail.com": 4,
        "streamrail.net": 4,
        "stridespark.com": 6,
        "stripcdn.com": 3,
        "stripchat.com": 3,
        "stripe.com": 2,
        "stripe.network": 2,
        "stripst.com": 3,
        "interactivemedia.net": 4,
        "stroeerdigitalgroup.de": 4,
        "stroeerdigitalmedia.de": 4,
        "stroeerdp.de": 4,
        "stroeermediabrands.de": 4,
        "spklw.com": 4,
        "sprinklecontent.com": 4,
        "strossle.it": 4,
        "struq.com": 4,
        "stumble-upon.com": 7,
        "stumbleupon.com": 7,
        "su.pr": 7,
        "sub2tech.com": 4,
        "ayads.co": 4,
        "suggest.io": 4,
        "sumologic.com": 6,
        "sumo.com": 6,
        "sumome.com": 6,
        "sundaysky.com": 4,
        "supercell.com": 2,
        "supercellsupport.com": 2,
        "supercounters.com": 6,
        "superfastcdn.com": 11,
        "socdm.com": 4,
        "supplyframe.com": 4,
        "surfingbird.ru": 2,
        "px.surveywall-api.survata.com": 4,
        "cdn.sweettooth.io": 2,
        "swiftypecdn.com": 9,
        "swisscom.ch": 8,
        "myswitchads.com": 4,
        "switchadhub.com": 4,
        "switchads.com": 4,
        "switchafrica.com": 4,
        "switch.tv": 8,
        "shopximity.com": 4,
        "swoop.com": 4,
        "analytics-cdn.sykescottages.co.uk": 6,
        "norton.com": 5,
        "seal.verisign.com": 5,
        "symantec.com": 5,
        "d.hodes.com": 2,
        "technorati.com": 4,
        "technoratimedia.com": 4,
        "cn.clickable.net": 4,
        "synergy-e.com": 4,
        "sdp-campaign.de": 8,
        "t-online.de": 8,
        "telekom-dienste.de": 8,
        "telekom.com": 8,
        "telekom.de": 8,
        "toi.de": 8,
        "t8cdn.com": 11,
        "tableteducation.com": 11,
        "basebanner.com": 4,
        "taboola.com": 4,
        "taboolasyndication.com": 4,
        "tacoda.net": 4,
        "commander1.com": 5,
        "tagcommander.com": 5,
        "tags.tagcade.com": 4,
        "taggify.net": 4,
        "taggyad.jp": 4,
        "levexis.com": 5,
        "tailtarget.com": 6,
        "tailsweep.com": 4,
        "tamedia.ch": 4,
        "tanx.com": 4,
        "alipcsec.com": 4,
        "taobao.com": 4,
        "tapad.com": 4,
        "theblogfrog.com": 4,
        "tarafdari.com": 4,
        "target2sell.com": 4,
        "trackmytarget.com": 6,
        "cdn.targetfuel.com": 6,
        "tawk.to": 2,
        "tbn.ru": 4,
        "tchibo-content.de": 8,
        "tchibo.de": 8,
        "tdsrmbl.net": 8,
        "teads.tv": 4,
        "tealeaf.ibmcloud.com": 6,
        "tealium.com": 5,
        "tealium.hs.llnwd.net": 5,
        "tealiumiq.com": 5,
        "tiqcdn.com": 5,
        "teaser.cc": 4,
        "emailretargeting.com": 4,
        "tracking.dsmmadvantage.com": 4,
        "telstra.com": 8,
        "telstra.com.au": 8,
        "tenderapp.com": 2,
        "tensitionschoo.club": 11,
        "watch.teroti.com": 4,
        "webterren.com": 4,
        "teufel.de": 8,
        "theadex.com": 4,
        "connect.decknetwork.net": 4,
        "gu-web.net": 8,
        "guardianapps.co.uk": 8,
        "guim.co.uk": 8,
        "deepthought.online": 4,
        "reachgroup.com": 4,
        "redintelligence.net": 4,
        "thesearchagency.net": 4,
        "thesun.co.uk": 8,
        "w-x.co": 4,
        "weather.com": 4,
        "wfxtriggers.com": 4,
        "tmdb.org": 8,
        "thinglink.com": 4,
        "online-metrix.net": 6,
        "tidbit.co.in": 2,
        "code.tidio.co": 2,
        "widget-v4.tidiochat.com": 2,
        "analytics.tiktok.com": 6,
        "optimized.by.tiller.co": 4,
        "vip.timezonedb.com": 4,
        "npttech.com": 5,
        "tinypass.com": 5,
        "tisoomi-services.com": 4,
        "ad.tlvmedia.com": 4,
        "ads.tlvmedia.com": 4,
        "tag.tlvmedia.com": 4,
        "research-int.se": 6,
        "sesamestats.com": 6,
        "spring-tns.net": 6,
        "statistik-gallup.net": 6,
        "tns-cs.net": 6,
        "tns-gallup.dk": 6,
        "tomnewsupdate.info": 12,
        "tfag.de": 4,
        "srv.clickfuse.com": 4,
        "toplist.cz": 11,
        "toponclick.com": 11,
        "topsy.com": 4,
        "insight.torbit.com": 6,
        "toro-tags.com": 4,
        "toroadvertising.com": 4,
        "toroadvertisingmedia.com": 4,
        "tororango.com": 11,
        "i.total-media.net": 4,
        "inq.com": 2,
        "tovarro.com": 4,
        "rialpay.com": 4,
        "tp-cdn.com": 4,
        "kiwe.io": 6,
        "tracc.it": 6,
        "ipnoid.com": 4,
        "tracemyip.org": 4,
        "d2gfdmu30u15x7.cloudfront.net": 6,
        "tracelytics.com": 6,
        "cdn.trackduck.com": 6,
        "d2zah9y47r7bi2.cloudfront.net": 6,
        "dl1d2m8ri9v3j.cloudfront.net": 6,
        "trackjs.com": 6,
        "conversionlab.trackset.com": 4,
        "trackuity.com": 2,
        "adsrvr.org": 4,
        "tradedoubler.com": 4,
        "tradelab.fr": 4,
        "tradetracker.net": 4,
        "cdntrf.com": 4,
        "traffective.com": 4,
        "my.trafficfuel.com": 4,
        "trafficrevenue.net": 4,
        "trafficstars.com": 3,
        "tsyndicate.com": 3,
        "trafficbroker.com": 4,
        "trafficfabrik.com": 3,
        "trafficfactory.biz": 4,
        "trafficforce.com": 4,
        "traffichaus.com": 3,
        "trafficjunky.net": 3,
        "traffiliate.com": 4,
        "storage.trafic.ro": 6,
        "trafmag.com": 4,
        "api.transcend.io": 14,
        "cdn.transcend.io": 14,
        "sync-transcend-cdn.com": 14,
        "transcend-cdn.com": 14,
        "transcend.io": 14,
        "telemetry.transcend.io": 6,
        "backoffice.transmatico.com": 6,
        "travelaudience.com": 6,
        "trbo.com": 4,
        "treasuredata.com": 6,
        "scanscout.com": 0,
        "tremorhub.com": 0,
        "tremormedia.com": 0,
        "tremorvideo.com": 0,
        "videohub.tv": 0,
        "s.tcimg.com": 6,
        "tcimg.com": 6,
        "trendemon.com": 6,
        "exponential.com": 4,
        "tribalfusion.com": 4,
        "tribl.io": 6,
        "api.temails.com": 4,
        "t.myvisitors.se": 2,
        "jscache.com": 8,
        "tacdn.com": 8,
        "tamgrt.com": 8,
        "tripadvisor.co.uk": 8,
        "tripadvisor.com": 8,
        "tripadvisor.de": 8,
        "3lift.com": 4,
        "d3iwjrnl4m67rd.cloudfront.net": 4,
        "triplelift.com": 4,
        "static.triptease.io": 2,
        "andomedia.com": 0,
        "tritondigital.com": 0,
        "revelations.trovus.co.uk": 4,
        "trsv3.com": 11,
        "truefitcorp.com": 4,
        "tru.am": 4,
        "adlegend.com": 4,
        "addoer.com": 6,
        "truehits.in.th": 6,
        "truehits.net": 6,
        "trumba.com": 4,
        "truoptik.com": 6,
        "trustarc.com": 5,
        "truste.com": 5,
        "consent.truste.com": 5,
        "choices-or.truste.com": 5,
        "choices.truste.com": 5,
        "privacy-policy.truste.com": 5,
        "trustedshops.com": 5,
        "trustev.com": 6,
        "secure.comodo.net": 5,
        "trustlogo.com": 5,
        "usertrust.com": 5,
        "trustpilot.com": 2,
        "trustwave.com": 8,
        "tubecorporate.com": 3,
        "tubecup.org": 3,
        "tubemogul.com": 4,
        "sre-perim.com": 6,
        "txmblr.com": 6,
        "platform.tumblr.com": 7,
        "lib.tunein.com": 0,
        "adagio.turboadv.com": 4,
        "turn.com": 4,
        "ngtv.io": 6,
        "turner.com": 6,
        "warnermedia.com": 6,
        "turnsocial.com": 7,
        "turnto.com": 2,
        "tvsquared.com": 4,
        "tweetboard.com": 7,
        "tweetmeme.com": 7,
        "c4tw.net": 4,
        "twiago.com": 4,
        "twinedigital.go2cloud.org": 6,
        "ext-twitch.tv": 0,
        "twitch.tv": 0,
        "jtvnw.net": 0,
        "ttvnw.net": 0,
        "twitchcdn.net": 0,
        "twitchsvc.net": 0,
        "t.co": 7,
        "twimg.com": 7,
        "twitter.com": 7,
        "twttr.com": 7,
        "x.com": 7,
        "ads-twitter.com": 4,
        "analytics.twitter.com": 6,
        "tellapart.com": 4,
        "syndication.twitter.com": 7,
        "twittercounter.com": 6,
        "twyn.com": 4,
        "txxx.com": 8,
        "tynt.com": 4,
        "typeform.com": 2,
        "typepad.com": 6,
        "typography.com": 9,
        "tyroodirect.com": 7,
        "tyroodr.com": 7,
        "tzetze.it": 2,
        "ubersetzung-app.com": 12,
        "ubuntu.com": 8,
        "ubuntucompanyservices.co.za": 8,
        "aralego.net": 4,
        "ucfunnel.com": 4,
        "at.ua": 6,
        "do.am": 6,
        "ucoz.net": 6,
        "ad-api-v01.uliza.jp": 4,
        "api.umbel.com": 6,
        "umebiggestern.club": 11,
        "unanimis.co.uk": 4,
        "d3pkntwtp2ukl5.cloudfront.net": 6,
        "t.unbounce.com": 6,
        "d21gpk1vhmjuf5.cloudfront.net": 6,
        "tracker.unbxdapi.com": 6,
        "under-box.com": 12,
        "undercomputer.com": 11,
        "udmserve.net": 4,
        "undertone.com": 4,
        "roitesting.com": 2,
        "unica.com": 2,
        "unister-adservices.com": 6,
        "unister-gmbh.de": 6,
        "uadx.com": 4,
        "nonstoppartner.net": 4,
        "tifbs.net": 4,
        "ui-portal.de": 4,
        "uimserv.net": 4,
        "unity.com": 8,
        "unity3d.com": 8,
        "unity3dusercontent.com": 8,
        "unityads.unity3d.com": 4,
        "univide.com": 4,
        "unpkg.com": 9,
        "unrulymedia.com": 4,
        "src.kitcode.net": 6,
        "s.clickability.com": 4,
        "uppr.de": 4,
        "upravel.com": 11,
        "upsellit.com": 2,
        "kontagent.net": 6,
        "app.uptain.de": 6,
        "uptolike.com": 7,
        "uptrends.com": 6,
        "urban-media.com": 4,
        "urbanairship.com": 6,
        "mobile.usabilitytools.com": 6,
        "usabilla.com": 2,
        "usemax.de": 4,
        "usemaxserver.de": 4,
        "usemessages.com": 11,
        "api.usercycle.com": 6,
        "userdive.com": 6,
        "userecho.com": 2,
        "dq4irj27fs462.cloudfront.net": 2,
        "userlike-cdn-widgets.s3-eu-west-1.amazonaws.com": 2,
        "userlike.com": 2,
        "contactusplus.com": 2,
        "user-pulse.appspot.com": 2,
        "userpulse.com": 2,
        "userreplay.net": 6,
        "sdsbucket.s3.amazonaws.com": 2,
        "userreport.com": 2,
        "dtkm4pd19nw6z.cloudfront.net": 2,
        "api.usersnap.com": 2,
        "d3mvnvhjmkxpjz.cloudfront.net": 2,
        "uservoice.com": 2,
        "userzoom.com": 2,
        "usocial.pro": 7,
        "utarget.ru": 4,
        "uuidksinc.net": 11,
        "v12group.com": 6,
        "vacaneedasap.com": 11,
        "ads.brand.net": 4,
        "vdrn.redplum.com": 4,
        "api.searchlinks.com": 4,
        "js.searchlinks.com": 4,
        "vinsight.de": 4,
        "valueclick.net": 4,
        "valuecommerce.com": 4,
        "valuedopinions.co.uk": 4,
        "buzzparadise.com": 4,
        "vmmpxl.com": 4,
        "vcita.com": 6,
        "tracking.vcommission.com": 4,
        "vdopia.com": 4,
        "veinteractive.com": 4,
        "vee24.com": 0,
        "velocecdn.com": 11,
        "mdcn.mobi": 4,
        "velti.com": 4,
        "vendemore.com": 1,
        "venturead.com": 11,
        "api.venyoo.ru": 2,
        "veoxa.com": 4,
        "vergic.com": 1,
        "d3qxef4rp70elm.cloudfront.net": 4,
        "getvero.com": 4,
        "verticalacuity.com": 4,
        "roi.vertical-leap.co.uk": 4,
        "cts.vresp.com": 4,
        "verticalscope.com": 4,
        "ads.vertoz.com": 4,
        "banner.vrtzads.com": 4,
        "veruta.com": 4,
        "vrvm.com": 4,
        "vgwort.de": 6,
        "digitaltarget.ru": 4,
        "btg.mtvnservices.com": 4,
        "viafoura.com": 4,
        "viafoura.net": 4,
        "intellitxt.com": 4,
        "vicomi.com": 6,
        "vidazoo.com": 4,
        "module-videodesk.com": 0,
        "vidtok.ru": 0,
        "videoadex.com": 4,
        "tidaltv.com": 4,
        "videonow.ru": 4,
        "videoplayerhub.com": 11,
        "videoplaza.tv": 4,
        "kweb.videostep.com": 4,
        "content.vidgyor.com": 0,
        "vidible.tv": 4,
        "assets.vidora.com": 0,
        "vietad.vn": 4,
        "viglink.com": 4,
        "vigo.one": 6,
        "vigo.ru": 6,
        "vimeo.com": 0,
        "vimeocdn.com": 0,
        "vindicosuite.com": 4,
        "vinted.net": 8,
        "viraladnetwork.net": 4,
        "app.viral-loops.com": 2,
        "viralgains.com": 4,
        "viralmint.com": 7,
        "virgul.com": 4,
        "ssp.virool.com": 4,
        "virtusize.com": 5,
        "viewablemedia.net": 4,
        "visiblemeasures.com": 4,
        "visioncriticalpanels.com": 6,
        "visitstreamer.com": 6,
        "visitortracklog.com": 4,
        "visitorville.com": 6,
        "d2hkbi3gan6yg6.cloudfront.net": 4,
        "myvisualiq.net": 6,
        "visualrevenue.com": 6,
        "d5phz18u4wuww.cloudfront.net": 6,
        "visualwebsiteoptimizer.com": 6,
        "wingify.com": 6,
        "vdna-assets.com": 4,
        "visualdna.com": 4,
        "visualstudio.com": 8,
        "id-visitors.com": 6,
        "vi-tag.net": 4,
        "vivistats.com": 6,
        "vizury.com": 4,
        "vizzit.se": 4,
        "cdn-vk.com": 7,
        "vk-analytics.com": 7,
        "vkuservideo.net": 7,
        "userapi.com": 7,
        "vk.com": 7,
        "vkontakte.ru": 7,
        "vntsm.com": 4,
        "vodafone.de": 8,
        "voicefive.com": 6,
        "volusion.com": 2,
        "cwkuki.com": 4,
        "volumtrk.com": 4,
        "voluumtrk3.com": 4,
        "vooxe.com": 8,
        "vorwerk.de": 8,
        "vox-cdn.com": 2,
        "embed.voxus.tv": 4,
        "voxus-targeting-voxusmidia.netdna-ssl.com": 4,
        "c-dsp.vpadn.com": 4,
        "tools.vpscash.nl": 4,
        "vsassets.io": 8,
        "exp-tas.com": 8,
        "v0cdn.net": 8,
        "vscode-cdn.net": 8,
        "vscode-unpkg.net": 8,
        "vtracy.de": 11,
        "liftoff.io": 4,
        "vungle.com": 4,
        "vuukle.com": 6,
        "view.vzaar.com": 0,
        "w3counter.com": 6,
        "w3roi.com": 6,
        "contentwidgets.net": 2,
        "wahoha.com": 2,
        "walkme.com": 2,
        "wsod.com": 4,
        "walmart.com": 8,
        "wamcash.com": 3,
        "cdn-saveit.wanelo.com": 2,
        "static.warp.ly": 6,
        "way2traffic.com": 4,
        "wayfair.com": 8,
        "wdr.de": 8,
        "web-stat.com": 6,
        "web.de": 8,
        "webde.de": 8,
        "webstat.net": 6,
        "ssl.webserviceaward.com": 6,
        "webtraxs.com": 6,
        "wipe.de": 6,
        "webads.nl": 4,
        "tr.webantenna.info": 6,
        "webclicks24.com": 11,
        "webclose.net": 12,
        "webcollage.net": 2,
        "goutee.top": 4,
        "mediaathay.org.uk": 4,
        "wbdx.fr": 4,
        "webeffective.keynote.com": 6,
        "widgets.webengage.com": 2,
        "webgains.com": 8,
        "webgozar.com": 6,
        "webgozar.ir": 6,
        "webhelpje.be": 2,
        "webhelpje.nl": 2,
        "webleads-tracker.com": 6,
        "automation.webmecanik.com": 6,
        "adrcdn.com": 4,
        "adrcntr.com": 4,
        "weborama.com": 4,
        "weborama.fr": 4,
        "webprospector.de": 6,
        "webstat.com": 6,
        "webstat.se": 6,
        "stat.webtrack.biz": 6,
        "webtraffic.no": 6,
        "webtraffic.se": 6,
        "d1r27qvpjiaqj3.cloudfront.net": 6,
        "mateti.net": 6,
        "wbtrk.net": 6,
        "wcfbc.net": 6,
        "webtrekk-asia.net": 6,
        "webtrekk.com": 6,
        "webtrekk.de": 6,
        "webtrekk.net": 6,
        "wt-eu02.net": 6,
        "wt-safetag.com": 6,
        "webtrends.com": 6,
        "webtrendslive.com": 6,
        "rd.clickshift.com": 4,
        "web-visor.com": 6,
        "weebly.com": 4,
        "widget.weibo.com": 4,
        "westlotto.com": 8,
        "wetter.com": 8,
        "wettercomassets.com": 8,
        "whatsbroadcast.com": 2,
        "whatsapp.com": 8,
        "whatsapp.net": 8,
        "whisper.onelink.me": 7,
        "whisper.sh": 7,
        "amung.us": 6,
        "whoson.com": 6,
        "api.wibbitz.com": 0,
        "cdn4.wibbitz.com": 0,
        "cdn.wibiya.com": 7,
        "predictad.com": 2,
        "widerplanet.com": 4,
        "widespace.com": 4,
        "widgetserver.com": 2,
        "3c45d848d99.se": 4,
        "wigetmedia.com": 4,
        "tracker.wigzopush.com": 4,
        "wikia-services.com": 8,
        "wikia-beacon.com": 6,
        "nocookie.net": 9,
        "wikimedia.org": 9,
        "wikipedia.org": 9,
        "wikiquote.org": 9,
        "tracking.winaffiliates.com": 6,
        "maps.windows.com": 8,
        "client.wns.windows.com": 8,
        "time.windows.com": 8,
        "windowsupdate.com": 9,
        "api.wipmania.com": 6,
        "col1.wiqhit.com": 6,
        "wirecard.com": 2,
        "wirecard.de": 2,
        "leadlab.click": 6,
        "wiredminds.com": 6,
        "wiredminds.de": 6,
        "adtotal.pl": 4,
        "wisepops.com": 4,
        "cdn.wishpond.net": 2,
        "wistia.com": 6,
        "wistia.net": 6,
        "parastorage.com": 8,
        "wix.com": 8,
        "public.wixab-cloud.com": 6,
        "wixmp.com": 9,
        "wnzmauurgol.com": 11,
        "wonderpush.com": 2,
        "woopic.com": 8,
        "woopra.com": 6,
        "pubmine.com": 4,
        "w.org": 6,
        "wordpress.com": 6,
        "wp.com": 6,
        "tracker.wordstream.com": 6,
        "worldnaturenet.xyz": 12,
        "wp.pl": 4,
        "wpimg.pl": 4,
        "wpengine.com": 5,
        "clickanalyzer.jp": 6,
        "wurfl.io": 6,
        "wwwpromoter.com": 4,
        "imgwykop.pl": 7,
        "wykop.pl": 7,
        "wysistat.com": 6,
        "wysistat.net": 6,
        "wywy.com": 4,
        "wywyuserservice.com": 4,
        "cdn.x-lift.jp": 4,
        "xapads.com": 4,
        "xen-media.com": 11,
        "xfreeservice.com": 11,
        "xhamster.com": 3,
        "xhamsterlive.com": 3,
        "xhamsterpremium.com": 3,
        "xhcdn.com": 3,
        "huami.com": 8,
        "mi-img.com": 8,
        "mi.com": 8,
        "miui.com": 8,
        "xiaomi.com": 8,
        "xiaomi.net": 8,
        "xiaomiyoupin.com": 8,
        "xing-share.com": 6,
        "xing.com": 6,
        "xmediaclicks.com": 3,
        "xnxx-cdn.com": 9,
        "xplosion.de": 4,
        "xtendmedia.com": 4,
        "xvideos-cdn.com": 8,
        "xvideos.com": 8,
        "xxxlshop.de": 8,
        "xxxlutz.de": 8,
        "adx.com.ru": 4,
        "yabbi.me": 4,
        "yabuka.com": 4,
        "tumblr.com": 6,
        "yahoo.com": 6,
        "yahooapis.com": 6,
        "yimg.com": 6,
        "oath.cloud": 6,
        "yahoo.net": 6,
        "yahooinc.com": 6,
        "yahoodns.net": 6,
        "yads.yahoo.com": 4,
        "yieldmanager.com": 4,
        "pr-bh.ybp.yahoo.com": 4,
        "ads.yahoo.com": 4,
        "adtech.yahooinc.com": 4,
        "analytics.yahoo.com": 6,
        "np.lexity.com": 4,
        "storage-yahoo.jp": 4,
        "yahoo.co.jp": 4,
        "yahooapis.jp": 4,
        "yimg.jp": 4,
        "yjtag.jp": 4,
        "ov.yahoo.co.jp": 4,
        "overture.com": 4,
        "search.yahooinc.com": 4,
        "luminate.com": 4,
        "pixazza.com": 4,
        "awaps.yandex.ru": 4,
        "d31j93rd8oukbv.cloudfront.net": 4,
        "webvisor.org": 4,
        "yandex.net": 4,
        "yandex.ru": 4,
        "yastatic.net": 4,
        "ya.ru": 4,
        "yandex.by": 4,
        "yandex.com": 4,
        "yandex.com.tr": 4,
        "yandex.fr": 4,
        "yandex.kz": 4,
        "yandex.st": 2,
        "yandexadexchange.net": 4,
        "metabar.ru": 12,
        "appmetrica.yandex.com": 101,
        "an.webvisor.org": 6,
        "an.yandex.ru": 6,
        "bs.yandex.ru": 6,
        "mc.yandex.ru": 6,
        "passport.yandex.ru": 2,
        "yapfiles.ru": 8,
        "yashi.com": 4,
        "ad.adserverplus.com": 4,
        "player.sambaads.com": 0,
        "cdn.yektanet.com": 4,
        "fetch.yektanet.com": 4,
        "yengo.com": 4,
        "yengointernational.com": 4,
        "link.p0.com": 4,
        "adsrevenue.net": 4,
        "infinityads.com": 4,
        "momentsharing.com": 4,
        "multipops.com": 4,
        "onlineadultadvertising.com": 4,
        "paypopup.com": 4,
        "popupxxx.com": 4,
        "xtargeting.com": 4,
        "xxxwebtraffic.com": 4,
        "app.yesware.com": 2,
        "yldbt.com": 6,
        "yieldify.com": 4,
        "yieldlab.net": 4,
        "yieldlove-ad-serving.net": 4,
        "yieldlove.com": 4,
        "yieldmo.com": 4,
        "254a.com": 4,
        "collect.yldr.io": 6,
        "yieldsquare.com": 4,
        "analytics-sdk.yle.fi": 6,
        "yllix.com": 4,
        "ymetrica1.com": 11,
        "ymzrrizntbhde.com": 11,
        "yoapp.s3.amazonaws.com": 2,
        "natpal.com": 4,
        "analytics.yola.net": 6,
        "pixel.yola.net": 6,
        "delivery.yomedia.vn": 4,
        "yoochoose.net": 4,
        "yotpo.com": 1,
        "yottaa.net": 6,
        "yottlyscript.com": 4,
        "api.youcanbook.me": 2,
        "youcanbook.me": 2,
        "player.youku.com": 0,
        "youporn.com": 3,
        "ypncdn.com": 3,
        "googlevideo.com": 0,
        "youtube-nocookie.com": 0,
        "youtube.com": 0,
        "ytimg.com": 0,
        "c.ypcdn.com": 4,
        "i1.ypcdn.com": 4,
        "yellowpages.com": 4,
        "prod-js.aws.y-track.com": 4,
        "y-track.com": 4,
        "yume.com": 4,
        "yumenetworks.com": 4,
        "gravityrd-services.com": 6,
        "api.zadarma.com": 2,
        "zalan.do": 8,
        "zalando.de": 8,
        "ztat.net": 8,
        "zaloapp.com": 2,
        "zanox-affiliate.de": 4,
        "zanox.com": 4,
        "zanox.ws": 4,
        "zaparena.com": 4,
        "zapunited.com": 4,
        "track.zappos.com": 4,
        "zdassets.com": 8,
        "zebestof.com": 4,
        "zedo.com": 4,
        "zemanta.com": 2,
        "zencdn.net": 0,
        "zendesk.com": 2,
        "zergnet.com": 2,
        "zero.kz": 6,
        "app.insightgrit.com": 2,
        "app.ubertags.com": 2,
        "cdn.boomtrain.com": 2,
        "events.api.boomtrain.com": 2,
        "rfihub.com": 2,
        "rfihub.net": 2,
        "ru4.com": 2,
        "xplusone.com": 2,
        "zeusclicks.com": 4,
        "webtest.net": 4,
        "zdbb.net": 4,
        "ziffdavis.com": 4,
        "ziffdavisinternational.com": 4,
        "ziffprod.com": 4,
        "ziffstatic.com": 4,
        "analytics.ziftsolutions.com": 6,
        "zimbio.com": 8,
        "api.zippyshare.com": 2,
        "zmags.com": 6,
        "zmctrack.net": 11,
        "zog.link": 11,
        "js.zohostatic.eu": 6,
        "zononi.com": 3,
        "zopim.com": 2,
        "zukxd6fkxqn.com": 11,
        "zwaar.net": 4,
        "zwaar.org": 4,
        "extend.tv": 4
    }
};




/***/ }),

/***/ 72199:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// UNUSED EXPORTS: ALLOWLIST_FILTER_ID, BACKGROUND_TAB_ID, BrowserStorage, CUSTOM_FILTERS_START_ID, ContentType, CosmeticRule, EXTENDED_CSS_VERSION, EventChannel, ExtSessionStorage, ExtensionStorage, FRAME_DELETION_TIMEOUT_MS, FilterListPreprocessor, FilteringEventType, FilteringLog, LF, MAIN_FRAME_ID, MESSAGE_HANDLER_NAME, MemoryStorage, MessageType, NO_PARENT_FRAME_ID, NetworkRule, NetworkRuleOption, PersistentValueContainer, QUICK_FIXES_FILTER_ID, RequestBlockingApi, RequestContextStorage, RequestEvent, RequestEvents, SEMICOLON, StealthActions, StealthHelper, TSWEBEXTENSION_VERSION, TabContext, TabsApi, TabsCosmeticInjector, TsWebExtension, USER_FILTER_ID, allowlist, basicFilterValidator, companiesDbService, configurationMV2Validator, configurationValidator, cosmeticFrameProcessor, createExtensionStorageDecorator, createTsWebExtension, defaultFilteringLog, documentApi, documentBlockingService, engineApi, extSessionStorage, filterMV2Validator, getAssistantCreateRulePayloadValidator, getCookieRulesPayloadValidator, getCosmeticDataPayloadValidator, getDomain, getErrorMessage, getExtendedCssPayloadValidator, getRequestType, getRuleSourceIndex, getRuleSourceText, getSaveCookieLogEventPayloadValidator, hideRequestInitiatorElement, isExtensionUrl, isHttpOrWsRequest, isHttpRequest, messageValidator, messagesApi, processShouldCollapsePayloadValidator, redirectsService, requestContextStorage, resourcesService, sendAppMessage, sessionDecorator, settingsConfigValidator, stealthConfigValidator, tabsApi

// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tsurlfilter@3.3.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tsurlfilter/dist/es/index.js + 32 modules
var es = __webpack_require__(84333);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tsurlfilter@3.3.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tsurlfilter/dist/es/request-type.js
var request_type = __webpack_require__(55712);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tsurlfilter@3.3.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tsurlfilter/dist/es/simple-regex-Dw3J24Ss.js
var simple_regex_Dw3J24Ss = __webpack_require__(12389);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/common/configuration.js
var common_configuration = __webpack_require__(26948);
// EXTERNAL MODULE: ./node_modules/.pnpm/webextension-polyfill@0.12.0/node_modules/webextension-polyfill/dist/browser-polyfill.js
var browser_polyfill = __webpack_require__(7967);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/common/constants.js
var constants = __webpack_require__(11911);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/common/message-constants.js
var message_constants = __webpack_require__(21737);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/common/logger.js
var common_logger = __webpack_require__(68916);
;// ./node_modules/.pnpm/tslib@2.5.3/node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
  extendStatics = Object.setPrototypeOf ||
      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  return extendStatics(d, b);
};

function __extends(d, b) {
  if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() { this.constructor = d; }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
  __assign = Object.assign || function __assign(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
      return t;
  }
  return __assign.apply(this, arguments);
}

function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
              t[p[i]] = s[p[i]];
      }
  return t;
}

function __decorate(decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  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;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __param(paramIndex, decorator) {
  return function (target, key) { decorator(target, key, paramIndex); }
}

function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
      var context = {};
      for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
      for (var p in contextIn.access) context.access[p] = contextIn.access[p];
      context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
      var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
      if (kind === "accessor") {
          if (result === void 0) continue;
          if (result === null || typeof result !== "object") throw new TypeError("Object expected");
          if (_ = accept(result.get)) descriptor.get = _;
          if (_ = accept(result.set)) descriptor.set = _;
          if (_ = accept(result.init)) initializers.unshift(_);
      }
      else if (_ = accept(result)) {
          if (kind === "field") initializers.unshift(_);
          else descriptor[key] = _;
      }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};

function __runInitializers(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};

function __propKey(x) {
  return typeof x === "symbol" ? x : "".concat(x);
};

function __setFunctionName(f, name, prefix) {
  if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  return new (P || (P = Promise))(function (resolve, reject) {
      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
      function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}

function __generator(thisArg, body) {
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  function verb(n) { return function (v) { return step([n, v]); }; }
  function step(op) {
      if (f) throw new TypeError("Generator is already executing.");
      while (g && (g = 0, op[0] && (_ = 0)), _) try {
          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;
          if (y = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
              case 0: case 1: t = op; break;
              case 4: _.label++; return { value: op[1], done: false };
              case 5: _.label++; y = op[1]; op = [0]; continue;
              case 7: op = _.ops.pop(); _.trys.pop(); continue;
              default:
                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                  if (t[2]) _.ops.pop();
                  _.trys.pop(); continue;
          }
          op = body.call(thisArg, _);
      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  }
}

var __createBinding = Object.create ? (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  var desc = Object.getOwnPropertyDescriptor(m, k);
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
  }
  Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  o[k2] = m[k];
});

function __exportStar(m, o) {
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
      next: function () {
          if (o && i >= o.length) o = void 0;
          return { value: o && o[i++], done: !o };
      }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m) return o;
  var i = m.call(o), r, ar = [], e;
  try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  }
  catch (error) { e = { error: error }; }
  finally {
      try {
          if (r && !r.done && (m = i["return"])) m.call(i);
      }
      finally { if (e) throw e.error; }
  }
  return ar;
}

/** @deprecated */
function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++)
      ar = ar.concat(__read(arguments[i]));
  return ar;
}

/** @deprecated */
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
          r[k] = a[j];
  return r;
}

function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
          if (!ar) ar = Array.prototype.slice.call(from, 0, i);
          ar[i] = from[i];
      }
  }
  return to.concat(ar || Array.prototype.slice.call(from));
}

function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}

function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  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); }); }; }
  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  function fulfill(value) { resume("next", value); }
  function reject(value) { resume("throw", value); }
  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator], i;
  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);
  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); }); }; }
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
  Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
  o["default"] = v;
};

function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  __setModuleDefault(result, mod);
  return result;
}

function __importDefault(mod) {
  return (mod && mod.__esModule) ? mod : { default: mod };
}

function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  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");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

function __classPrivateFieldSet(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  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");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

function __classPrivateFieldIn(state, receiver) {
  if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state === "function" ? receiver === state : state.has(receiver);
}

/* harmony default export */ const tslib_es6 = ({
  __extends,
  __assign,
  __rest,
  __decorate,
  __param,
  __metadata,
  __awaiter,
  __generator,
  __createBinding,
  __exportStar,
  __values,
  __read,
  __spread,
  __spreadArrays,
  __spreadArray,
  __await,
  __asyncGenerator,
  __asyncDelegator,
  __asyncValues,
  __makeTemplateObject,
  __importStar,
  __importDefault,
  __classPrivateFieldGet,
  __classPrivateFieldSet,
  __classPrivateFieldIn,
});

// EXTERNAL MODULE: ./node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/es5.js
var es5 = __webpack_require__(46660);
// EXTERNAL MODULE: ./node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/non-secure/index.js
var non_secure = __webpack_require__(15547);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js
var _arraySome = __webpack_require__(81261);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js + 22 modules
var _baseIteratee = __webpack_require__(37037);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js + 4 modules
var _baseEach = __webpack_require__(57914);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSome.js


/**
 * The base implementation of `_.some` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function baseSome(collection, predicate) {
  var result;

  (0,_baseEach/* default */.A)(collection, function(value, index, collection) {
    result = predicate(value, index, collection);
    return !result;
  });
  return !!result;
}

/* harmony default export */ const _baseSome = (baseSome);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
var isArray = __webpack_require__(68058);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js
var _isIterateeCall = __webpack_require__(86971);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/some.js






/**
 * Checks if `predicate` returns truthy for **any** element of `collection`.
 * Iteration is stopped once `predicate` returns truthy. The predicate is
 * invoked with three arguments: (value, index|key, collection).
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 * @example
 *
 * _.some([null, 0, 'yes', false], Boolean);
 * // => true
 *
 * var users = [
 *   { 'user': 'barney', 'active': true },
 *   { 'user': 'fred',   'active': false }
 * ];
 *
 * // The `_.matches` iteratee shorthand.
 * _.some(users, { 'user': 'barney', 'active': false });
 * // => false
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.some(users, ['active', false]);
 * // => true
 *
 * // The `_.property` iteratee shorthand.
 * _.some(users, 'active');
 * // => true
 */
function some(collection, predicate, guard) {
  var func = (0,isArray/* default */.A)(collection) ? _arraySome/* default */.A : _baseSome;
  if (guard && (0,_isIterateeCall/* default */.A)(collection, predicate, guard)) {
    predicate = undefined;
  }
  return func(collection, (0,_baseIteratee/* default */.A)(predicate, 3));
}

/* harmony default export */ const lodash_es_some = (some);

// EXTERNAL MODULE: ./node_modules/.pnpm/tldts@5.7.112/node_modules/tldts/dist/es6/index.js + 12 modules
var es6 = __webpack_require__(13548);
;// ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/common/stealth-helper.js
// Disable vi coverage for this file, because it will insert
// line comments, and code to count lines covered by tests, for example:
// /* istanbul ignore next */
// cov_uqm40oh03().f[0]++;
// cov_uqm40oh03().s[2]++;
// And we cannot test these strings correctly, because the names of these
// functions with counters are generated at runtime
/* istanbul ignore file */
/**
 * This module applies stealth actions in page context.
 */
class StealthHelper {
    /**
     * Sends a Global Privacy Control DOM signal.
     */
    static setDomSignal() {
        try {
            if ('globalPrivacyControl' in Navigator.prototype) {
                return;
            }
            Object.defineProperty(Navigator.prototype, 'globalPrivacyControl', {
                get: () => true,
                configurable: true,
                enumerable: true,
            });
        }
        catch (ex) {
            // Ignore
        }
    }
    /**
     * Hides document referrer.
     */
    static hideDocumentReferrer() {
        const origDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'referrer');
        if (!origDescriptor || !origDescriptor.get || !origDescriptor.configurable) {
            return;
        }
        const returnEmptyReferrerFunc = () => '';
        // Protect getter from native code check
        returnEmptyReferrerFunc.toString = origDescriptor.get.toString.bind(origDescriptor.get);
        Object.defineProperty(Document.prototype, 'referrer', {
            get: returnEmptyReferrerFunc,
        });
    }
}



// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+logger@1.1.1/node_modules/@adguard/logger/dist/es/index.mjs
var dist_es = __webpack_require__(38200);
// EXTERNAL MODULE: ./node_modules/.pnpm/zod@3.24.4/node_modules/zod/lib/index.mjs
var lib = __webpack_require__(3290);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@3.2.0/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(64638);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+text-encoding@0.8.3/node_modules/@adguard/text-encoding/index.js
var text_encoding = __webpack_require__(36616);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+scriptlets@2.1.6/node_modules/@adguard/scriptlets/dist/redirects/index.js
var redirects = __webpack_require__(42636);
// EXTERNAL MODULE: ./node_modules/.pnpm/lru-cache@11.0.2/node_modules/lru-cache/dist/esm/index.js
var esm = __webpack_require__(38037);
;// ./node_modules/.pnpm/@adguard+tswebextension@3.1.0-alpha.3_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/index.js




























/**
 * The allowlist is used to exclude certain websites from filtering.
 * Blocking rules are not applied to the sites in the list.
 * The allow list can also be inverted.
 * In inverted mode, the application will unblock ads everywhere except for the sites added to this list.
 */
class Allowlist extends common_configuration.A {
}

/**
 * TSUrlFilter Engine wrapper.
 */
class EngineApi {
    allowlist;
    appContext;
    stealthApi;
    static ASYNC_LOAD_CHINK_SIZE = 5000;
    engine;
    /**
     * Gets app filtering status.
     *
     * @returns True if filtering is enabled, otherwise returns false.
     */
    get isFilteringEnabled() {
        // TODO: Remove this check after moving call of storage initialization in extension code.
        // Check this flag before access storage values, because engine methods
        // can by triggered before initialization by content script requests.
        if (!this.appContext.isStorageInitialized) {
            return false;
        }
        return Boolean(this.appContext.configuration?.settings.filteringEnabled);
    }
    /**
     * Creates Engine Api instance.
     *
     * @param allowlist Allowlist.
     * @param appContext App context.
     * @param stealthApi Stealth Api.
     */
    constructor(allowlist, appContext, stealthApi) {
        this.allowlist = allowlist;
        this.appContext = appContext;
        this.stealthApi = stealthApi;
    }
    /**
     * Starts engine.
     *
     * @param configuration Engine configuration.
     */
    async startEngine(configuration) {
        const { filters, userrules, verbose, } = configuration;
        this.allowlist.configure(configuration);
        const lists = [];
        for (let i = 0; i < filters.length; i += 1) {
            const { filterId, content, trusted, sourceMap, } = filters[i];
            lists.push(new es/* BufferRuleList */.zV(filterId, content, false, !trusted, !trusted, sourceMap));
        }
        if (userrules.content.length > 0) {
            lists.push(new es/* BufferRuleList */.zV(constants.U, userrules.content, false, false, false, userrules.sourceMap));
        }
        const allowlistRulesList = this.allowlist.getAllowlistRules();
        if (allowlistRulesList) {
            lists.push(allowlistRulesList);
        }
        const stealthModeList = this.stealthApi.getStealthModeRuleList();
        if (stealthModeList) {
            lists.push(stealthModeList);
        }
        const ruleStorage = new es/* RuleStorage */._6(lists);
        (0,es/* setConfiguration */.xN)({
            engine: 'extension',
            version: browser_polyfill.runtime.getManifest().version,
            verbose,
            compatibility: es/* CompatibilityTypes */.YD.Extension,
        });
        /*
         * UI thread becomes blocked on the options page while request filter is created
         * that's why we create filter rules using chunks of the specified length
         * Request filter creation is rather slow operation so we should
         * use setTimeout calls to give UI thread some time.
        */
        const engine = new es/* Engine */.N$(ruleStorage, true);
        await engine.loadRulesAsync(EngineApi.ASYNC_LOAD_CHINK_SIZE);
        this.engine = engine;
    }
    /**
     * Searched for rules by match query.
     *
     * @param matchQuery Query against which the request would be matched.
     *
     * @returns Matching result or null.
     */
    matchRequest(matchQuery) {
        if (!this.engine || !this.isFilteringEnabled) {
            return null;
        }
        const { requestUrl, frameUrl, requestType, method, } = matchQuery;
        let { frameRule } = matchQuery;
        const request = new es/* Request */.Kd(requestUrl, frameUrl, requestType, method);
        if (!frameRule) {
            frameRule = null;
        }
        return this.engine.matchRequest(request, frameRule);
    }
    /**
     * Searched for cosmetic rules by match query.
     *
     * @param matchQuery Query against which the request would be matched.
     *
     * @returns Cosmetic result.
     */
    matchCosmetic(matchQuery) {
        if (!this.engine || !this.isFilteringEnabled || !(0,common_configuration.i)(matchQuery.frameUrl)) {
            return new es/* CosmeticResult */.jw();
        }
        const matchingResult = this.matchRequest(matchQuery);
        if (!matchingResult) {
            return new es/* CosmeticResult */.jw();
        }
        const cosmeticOption = matchingResult.getCosmeticOption();
        return this.getCosmeticResult(matchQuery.requestUrl, cosmeticOption);
    }
    /**
     * Matches current frame url and returns rule if found.
     *
     * @param frameUrl Frame url.
     *
     * @returns NetworkRule or null.
     */
    matchFrame(frameUrl) {
        if (!this.engine || !this.isFilteringEnabled || !(0,common_configuration.i)(frameUrl)) {
            return null;
        }
        return this.engine.matchFrame(frameUrl);
    }
    /**
     * Gets cosmetic result for the specified hostname and cosmetic options.
     *
     * @param url Request url.
     * @param option Cosmetic options.
     *
     * @returns Cosmetic result.
     */
    getCosmeticResult(url, option) {
        if (!this.engine || !this.isFilteringEnabled) {
            return new es/* CosmeticResult */.jw();
        }
        const frameUrl = (0,common_configuration.g)(url);
        const request = new es/* Request */.Kd(url, frameUrl, request_type/* RequestType */.Y.Document);
        return this.engine.getCosmeticResult(request, option);
    }
    /**
     * Retrieves a rule node by its filter list identifier and rule index.
     *
     * If there's no rule by that index or the rule structure is invalid, it will return null.
     *
     * @param filterId Filter list identifier.
     * @param ruleIndex Rule index.
     *
     * @returns Rule node or `null`.
     */
    retrieveRuleNode(filterId, ruleIndex) {
        if (!this.engine) {
            return null;
        }
        return this.engine.retrieveRuleNode(filterId, ruleIndex);
    }
    /**
     * Simple getter for rules count.
     *
     * @returns Number of rules in the engine.
     */
    getRulesCount() {
        return this.engine ? this.engine.getRulesCount() : 0;
    }
}

/**
 * Matches rules from {@link EngineApi} based on current {@link Allowlist} state.
 */
class DocumentApi {
    allowlist;
    engineApi;
    /**
     * Creates new DocumentApi instance.
     *
     * @param allowlist Allowlist API.
     * @param engineApi Engine API.
     */
    constructor(allowlist, engineApi) {
        this.allowlist = allowlist;
        this.engineApi = engineApi;
    }
    /**
     * Match frame rule based on allowlist state.
     *
     * @param frameUrl Frame url.
     *
     * @returns Matched rule or null.
     */
    matchFrame(frameUrl) {
        const { enabled, inverted } = this.allowlist;
        /**
         * If inverted allowlist enabled, use specific matching strategy.
         */
        if (enabled && inverted) {
            return this.matchFrameInverted(frameUrl);
        }
        /**
         * If allowlist mode is default, request rule from engine.
         * If allowlist is enabled, rules have already loaded.
         */
        return this.engineApi.matchFrame(frameUrl);
    }
    /**
     * Creates allowlist rule for domains that are not in the inverted list.
     * In other cases returns engine matched rule.
     *
     * @param frameUrl Frame url.
     *
     * @returns Matched rule or null.
     */
    matchFrameInverted(frameUrl) {
        const domain = (0,common_configuration.a)(frameUrl);
        if (!domain) {
            return null;
        }
        const upperDomain = (0,common_configuration.b)(domain);
        if (!this.allowlist.domains.includes(domain) && !this.allowlist.domains.includes(`*.${upperDomain}`)) {
            return Allowlist.createAllowlistRule(domain);
        }
        return this.engineApi.matchFrame(frameUrl);
    }
}

/**
 * Frame context data for MV2.
 *
 * @see {@link FrameCommon} description.
 */
class FrameMV2 extends common_configuration.F {
    /**
     * Prepared cosmetic result for the frame in MV2.
     *
     * This data is saved in the frame because it is needed for injecting cosmetic rules into the frames.
     */
    preparedCosmeticResult;
}

/**
 * Tab context for MV2.
 */
class TabContext extends common_configuration.T {
    info;
    documentApi;
    filteringLog;
    /**
     * Context constructor.
     *
     * @param info Webextension API tab data.
     * @param documentApi Document API.
     * @param filteringLog Filtering Log API.
     */
    constructor(info, documentApi, filteringLog = common_configuration.d) {
        super(info, filteringLog);
        this.info = info;
        this.documentApi = documentApi;
        this.filteringLog = filteringLog;
    }
    // TODO: consider moving to common class AG-39552.
    /**
     * Creates context for new tab.
     *
     * @param tab Webextension API tab data.
     * @param documentApi Document API.
     *
     * @returns Tab context for new tab.
     */
    static createNewTabContext(tab, documentApi) {
        const tabContext = new TabContext(tab, documentApi);
        // In some cases, tab is created while browser navigation processing.
        // For example: when you navigate outside the browser or create new empty tab.
        // `pendingUrl` represent url navigated to. We check it first.
        // If server returns redirect, new main frame url will be processed in WebRequestApi.
        const url = tab.pendingUrl || tab.url;
        if (url && (0,common_configuration.c)(url)) {
            tabContext.mainFrameRule = documentApi.matchFrame(url);
            tabContext.frames.set(constants.M, new FrameMV2({
                tabId: tab.id,
                frameId: constants.M,
                parentFrameId: constants.N,
                url,
                // timestamp is 0, so that it will be recalculated in the next event
                timeStamp: 0,
            }));
        }
        return tabContext;
    }
}

/**
 * TabsApi works with {@link browser.tabs} to record tabs' URLs - they are
 * needed for work domain-specific blocking/allowing cosmetic rules.
 */
class TabsApi extends common_configuration.e {
    documentApi;
    /**
     * Timeout for popup tabs in milliseconds. We consider a tab as a popup if it was created within this time period.
     */
    static POPUP_TAB_TIMEOUT_MS = 250;
    /**
     * Tabs API constructor.
     *
     * @param documentApi Document API instance.
     */
    constructor(documentApi) {
        super(documentApi);
        this.documentApi = documentApi;
    }
    /**
     * @inheritdoc
     */
    handleTabCreate(tab) {
        if (!TabContext.isBrowserTab(tab)) {
            return null;
        }
        const tabContext = TabContext.createNewTabContext(tab, this.documentApi);
        this.context.set(tab.id, tabContext);
        this.onCreate.dispatch(tabContext);
        return tabContext;
    }
    /**
     * Updates tab's main frame rule.
     *
     * @param tabId Tab ID.
     */
    updateTabMainFrameRule(tabId) {
        const tabContext = this.context.get(tabId);
        if (!tabContext?.info.url || !(0,common_configuration.c)(tabContext.info.url)) {
            return;
        }
        tabContext.mainFrameRule = this.documentApi.matchFrame(tabContext.info.url);
    }
    /**
     * Updates tab context data after filter engine load.
     */
    async updateCurrentTabsMainFrameRules() {
        const currentTabs = await browser_polyfill.tabs.query({});
        if (!Array.isArray(currentTabs)) {
            return;
        }
        for (const tab of currentTabs) {
            if (typeof tab.id === 'number') {
                this.updateTabMainFrameRule(tab.id);
            }
        }
    }
    /**
     * Checks if tab is a new tab.
     *
     * TODO: Change in AG-22715: if the lifetime of the tab is less than N
     * seconds (for example 5 seconds), then it is a popup and we close it. If
     * the opposite is true, then we block it with a stub.
     *
     * @param tabId Tab ID.
     *
     * @returns True if tab is a new tab.
     */
    isNewPopupTab(tabId) {
        const tab = this.context.get(tabId);
        if (!tab) {
            return false;
        }
        const createdAt = tab.createdAtMs;
        const tabAgeMs = Date.now() - createdAt;
        return tabAgeMs < TabsApi.POPUP_TAB_TIMEOUT_MS;
    }
    /**
     * Generates a "synthetic document id".
     *
     * Important: This workaround is needed for Firefox where `parentDocumentId` and `documentId` are not supported,
     * so a unique document ID is generated based on tab and frame IDs.
     * And in some cases it may not help, for example, frame's document can change (e.g. by navigating),
     * but the frame ID remains the same, so the *generated* document ID will be the same.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     *
     * @returns ID as a string based on tab and frame IDs.
     */
    static generateId(tabId, frameId) {
        return `${tabId}-${frameId}`;
    }
    /**
     * Injects script code to the frame by tab id and frame id.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     * @param code Script text to be injected.
     *
     * @throws Error if the script injection fails.
     */
    static async injectScript(tabId, frameId, code) {
        const injectDetails = {
            code,
            frameId,
            runAt: 'document_start',
            matchAboutBlank: true,
        };
        await browser_polyfill.tabs.executeScript(tabId, injectDetails);
    }
    /**
     * Injects css styles to the frame by tab id and frame id.
     *
     * @param tabId Tab ID.
     * @param frameId Frame ID.
     * @param code CSS styles to be injected.
     *
     * @throws Error if the css injection fails.
     */
    static async injectCss(tabId, frameId, code) {
        const injectDetails = {
            code,
            frameId,
            runAt: 'document_start',
            matchAboutBlank: true,
            cssOrigin: 'user',
        };
        await browser_polyfill.tabs.insertCSS(tabId, injectDetails);
    }
}

/**
 * Assistant class is the handler of messages and events related
 * to AdGuard assistant with extended detection of assistant frame.
 */
class Assistant extends common_configuration.C {
    /**
     * @inheritdoc
     */
    // eslint-disable-next-line class-methods-use-this
    injectAssistant(tabId, fileUrl) {
        return browser_polyfill.tabs.executeScript(tabId, { file: fileUrl });
    }
}
const assistant = new Assistant();

/**
 * API for storing data described by {@link SessionStorageSchema} in the {@link browser.storage.session}.
 */
class ExtSessionStorage extends common_configuration.E {
    static #DOMAIN = 'tswebextension';
    static #DEFAULT_DATA = {
        isAppStarted: false,
        configuration: undefined,
        startTimeMs: undefined,
        cosmeticsInjectedOnStartup: false,
    };
    /**
     * Creates {@link SessionStorage} instance.
     */
    constructor() {
        // Use memory storage as a fallback for old browsers.
        super(ExtSessionStorage.#DOMAIN, browser_polyfill.storage.session
            ? new common_configuration.B(browser_polyfill.storage.session)
            : new common_configuration.M());
    }
    /** @inheritdoc */
    init() {
        return super.init(ExtSessionStorage.#DEFAULT_DATA);
    }
}
const extSessionStorage = new ExtSessionStorage();
const sessionDecorator = (0,common_configuration.f)(extSessionStorage);

/**
 * Top level app context storage.
 *
 * This context is needed to share data between other modules without cyclic dependencies.
 *
 * TODO (v.zhelvis) delete this context after DI is implemented.
 */
let AppContext = (() => {
    let _isAppStarted_decorators;
    let _isAppStarted_initializers = [];
    let _isAppStarted_extraInitializers = [];
    let _configuration_decorators;
    let _configuration_initializers = [];
    let _configuration_extraInitializers = [];
    let _startTimeMs_decorators;
    let _startTimeMs_initializers = [];
    let _startTimeMs_extraInitializers = [];
    let _cosmeticsInjectedOnStartup_decorators;
    let _cosmeticsInjectedOnStartup_initializers = [];
    let _cosmeticsInjectedOnStartup_extraInitializers = [];
    return class AppContext {
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
            _isAppStarted_decorators = [sessionDecorator("isAppStarted" /* SessionStorageKey.IsAppStarted */)];
            _configuration_decorators = [sessionDecorator("configuration" /* SessionStorageKey.Configuration */)];
            _startTimeMs_decorators = [sessionDecorator("startTimeMs" /* SessionStorageKey.StartTimeMs */)];
            _cosmeticsInjectedOnStartup_decorators = [sessionDecorator("cosmeticsInjectedOnStartup" /* SessionStorageKey.CosmeticsInjectedOnStartup */)];
            __esDecorate(this, null, _isAppStarted_decorators, { kind: "accessor", name: "isAppStarted", static: false, private: false, access: { has: obj => "isAppStarted" in obj, get: obj => obj.isAppStarted, set: (obj, value) => { obj.isAppStarted = value; } }, metadata: _metadata }, _isAppStarted_initializers, _isAppStarted_extraInitializers);
            __esDecorate(this, null, _configuration_decorators, { kind: "accessor", name: "configuration", static: false, private: false, access: { has: obj => "configuration" in obj, get: obj => obj.configuration, set: (obj, value) => { obj.configuration = value; } }, metadata: _metadata }, _configuration_initializers, _configuration_extraInitializers);
            __esDecorate(this, null, _startTimeMs_decorators, { kind: "accessor", name: "startTimeMs", static: false, private: false, access: { has: obj => "startTimeMs" in obj, get: obj => obj.startTimeMs, set: (obj, value) => { obj.startTimeMs = value; } }, metadata: _metadata }, _startTimeMs_initializers, _startTimeMs_extraInitializers);
            __esDecorate(this, null, _cosmeticsInjectedOnStartup_decorators, { kind: "accessor", name: "cosmeticsInjectedOnStartup", static: false, private: false, access: { has: obj => "cosmeticsInjectedOnStartup" in obj, get: obj => obj.cosmeticsInjectedOnStartup, set: (obj, value) => { obj.cosmeticsInjectedOnStartup = value; } }, metadata: _metadata }, _cosmeticsInjectedOnStartup_initializers, _cosmeticsInjectedOnStartup_extraInitializers);
            if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        /**
         * Is storage initialized.
         * This flag is used to prevent access to persistent storage data on
         * request from content script, before app is started.
         */
        isStorageInitialized = false;
        #isAppStarted_accessor_storage = __runInitializers(this, _isAppStarted_initializers, void 0);
        /**
         * Is app started.
         */
        get isAppStarted() { return this.#isAppStarted_accessor_storage; }
        set isAppStarted(value) { this.#isAppStarted_accessor_storage = value; }
        #configuration_accessor_storage = (__runInitializers(this, _isAppStarted_extraInitializers), __runInitializers(this, _configuration_initializers, void 0));
        /**
         * MV2 ConfigurationMV2 excludes heavyweight fields with rules.
         */
        get configuration() { return this.#configuration_accessor_storage; }
        set configuration(value) { this.#configuration_accessor_storage = value; }
        #startTimeMs_accessor_storage = (__runInitializers(this, _configuration_extraInitializers), __runInitializers(this, _startTimeMs_initializers, void 0));
        /**
         * Start time of the app.
         */
        get startTimeMs() { return this.#startTimeMs_accessor_storage; }
        set startTimeMs(value) { this.#startTimeMs_accessor_storage = value; }
        #cosmeticsInjectedOnStartup_accessor_storage = (__runInitializers(this, _startTimeMs_extraInitializers), __runInitializers(this, _cosmeticsInjectedOnStartup_initializers, void 0));
        /**
         * Flag that indicates that cosmetics were injected on startup.
         */
        get cosmeticsInjectedOnStartup() { return this.#cosmeticsInjectedOnStartup_accessor_storage; }
        set cosmeticsInjectedOnStartup(value) { this.#cosmeticsInjectedOnStartup_accessor_storage = value; }
        constructor() {
            __runInitializers(this, _cosmeticsInjectedOnStartup_extraInitializers);
        }
    };
})();
const appContext = new AppContext();

const browserDetector = es5.getParser(window.navigator.userAgent);
const browserDetails = browserDetector.getBrowser();
const engineDetails = browserDetector.getEngine();
const isOpera = browserDetails.name === 'Opera';
const isFirefox = browserDetails.name === 'Firefox';
const isChromium = engineDetails.name === 'Blink';

/**
 * Taken from:
 * {@link https://github.com/seanl-adg/InlineResourceLiteral/blob/master/index.js#L136} and
 * {@link https://github.com/joliss/js-string-escape/blob/master/index.js}.
 */
const reJsEscape = /["'\\\n\r\u2028\u2029]/g;
const escapeJs = (match) => {
    switch (match) {
        case '"':
        case "'":
        case '\\':
            return `\\${match}`;
        case '\n':
            /**
             * Line continuation character for ease of reading inlined resource.
             */
            return '\\n\\\n';
        case '\r':
            /**
             * Carriage returns won't have any semantic meaning in JS.
             */
            return '';
        case '\u2028':
            return '\\u2028';
        case '\u2029':
            return '\\u2029';
        default:
            return match;
    }
};
/**
 * Builds script to inject in a safe way for Firefox.
 *
 * @param scriptText Script text to execute.
 * @param variableName Variable name to check if script was executed.
 *
 * @returns Wrapped script text to inject on the page.
 */
const buildScriptTextForFirefox = (scriptText, variableName) => {
    /**
     * Unique guard ID to check if a script was executed at the first attempt.
     *
     * `window.wrappedJSObject` is available only in Firefox
     * and it provides access to the page's window object context from the content script.
     * It is used to check whether the first script injection attempt was successful.
     * So if the script was not executed, tries to use `script.src + blob`
     * as a workaround for {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1733 | CSP issue}.
     *
     * @see {@link https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts}
     */
    const guardId = (0,non_secure/* nanoid */.A)();
    const scriptWithGuard = `window['${guardId}'] = true;\n${scriptText}`;
    const preparedScriptText = `${scriptWithGuard.replace(reJsEscape, escapeJs)}`;
    return `(function() {\
        if (window.${variableName} || document instanceof XMLDocument) {\
            return;\
        }\
        var script;\
        var blob;\
        var url;\
        var FRAME_REQUESTS_LIMIT = 500;\
        var frameRequests = 0;\
        function waitParent () {\
            frameRequests += 1;\
            var parent = document.head || document.documentElement;\
            if (!parent) {\
                return;\
            }\
            try {\
                script = document.createElement("script");\
                var textNode = document.createTextNode("${preparedScriptText}");\
                script.appendChild(textNode);\
                parent.appendChild(script);\
            } catch (e) {\
            }\
            if (script) {\
                script.remove();\
            }\
            if (window.wrappedJSObject["${guardId}"]) {\
                delete window.wrappedJSObject["${guardId}"];\
                window.${variableName} = true;\
                return true;\
            }
            try {\
                script = document.createElement("script");\
                blob = new Blob(["${preparedScriptText}"], { type: "text/javascript; charset=utf-8" });\
                url = URL.createObjectURL(blob);\
                script.async = false;\
                script.src = url;\
                parent.appendChild(script);\
            } catch (e) {\
                script.setAttribute("type", "text/javascript");\
                script.textContent = "${preparedScriptText}";\
            }\
            if (script) {\
                if (url) {\
                    URL.revokeObjectURL(url);\
                }\
                script.remove();\
                window.${variableName} = true;\
                return true;\
            }\
            if(frameRequests < FRAME_REQUESTS_LIMIT) {\
                requestAnimationFrame(waitParent);\
            } else {\
                console.log("AdGuard: document.head or document.documentElement were unavailable too long");\
            }\
        }\
        waitParent();\
    })()`;
};
/**
 * Builds script to inject in a safe way for browsers other than Firefox.
 *
 * @param scriptText Script text to execute.
 * @param variableName Variable name to check if script was executed.
 *
 * @returns Wrapped script text to inject on the page.
 */
const buildScriptTextCommon = (scriptText, variableName) => {
    const preparedScriptText = scriptText.replace(reJsEscape, escapeJs);
    return `(function() {\
        if (window.${variableName} || document instanceof XMLDocument) {\
            return;\
        }\
        var script = document.createElement("script");\
        var blob;\
        var url;\
        try {\
            var textNode = document.createTextNode("${preparedScriptText}");\
            script.appendChild(textNode);\
        } catch (e) {\
            script.setAttribute("type", "text/javascript");\
            script.textContent = "${preparedScriptText}";\
        }\
        var FRAME_REQUESTS_LIMIT = 500;\
        var frameRequests = 0;\
        function waitParent () {\
            frameRequests += 1;\
            var parent = document.head || document.documentElement;\
            if (!parent) {\
                return;\
            }\
            try {\
                parent.appendChild(script);\
                if (url) {\
                    URL.revokeObjectURL(url);\
                }\
                script.remove();\
            } catch (e) {\
            } finally {\
                window.${variableName} = true;\
                return true;\
            }\
            if(frameRequests < FRAME_REQUESTS_LIMIT) {\
                requestAnimationFrame(waitParent);\
            } else {\
                console.log("AdGuard: document.head or document.documentElement were unavailable too long");\
            }\
        }\
        waitParent();\
    })()`;
};
/**
 * Builds script to inject in a safe way.
 *
 * @see {@link LocalScriptRulesService} for details about script source.
 *
 * @param scriptText Script text.
 * @param startTimeMs App start time in milliseconds.
 *
 * @returns Script to inject.
 *
 * @throws Error if start time is not defined.
 */
const buildScriptText = (scriptText, startTimeMs) => {
    if (!startTimeMs) {
        throw new Error('Start time is not defined');
    }
    /**
     * We use changing variable name because global properties can be modified across isolated worlds of extension
     * content page and tab page.
     *
     * Issue: @see {@link https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6}.
     */
    const variableName = `scriptExecuted${startTimeMs}`;
    /**
     * Executes scripts in a scope of the page, but the `window` fields are in
     * an isolated scope, e.g. `window.${variableName}` will only be visible in
     * this scope of the script, but not in the original scope of the page.
     * In order to prevent multiple script execution checks if script was already executed.
     *
     * Sometimes in Firefox when content-filtering is applied to the page race condition happens.
     * This causes an issue when the page doesn't have its document.head or document.documentElement at the moment of
     * injection. So script waits for them. But if a quantity of frame-requests reaches FRAME_REQUESTS_LIMIT then
     * script stops waiting with the error.
     * Description of the issue: @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1004}.
     *
     * Injecting content-script, which appends a script tag, breaks Firefox's pretty printer for xml documents.
     * Description of the issue: @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2194}.
     *
     * IMPORTANT: Injecting script via a text node or textContent property is crucial for the injection speed.
     * That's why it should be used as a primary way.
     *
     * CSP may prevent script execution in Firefox but script.src + blob is a workaround for this issue.
     * Description of the issue: @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1733}.
     * So for Firefox:
     * 1) text node as a script child is used as a primary way,
     * 2) script.src + blob is used as a secondary way,
     * 3) script.textContent is used as a final fallback.
     *
     * There is no such CSP issue in Chromium, so for Chromium:
     * 1) text node as a script child is a primary way,
     * 2) script.textContent is used as a fallback.
     */
    return isFirefox
        ? buildScriptTextForFirefox(scriptText, variableName)
        : buildScriptTextCommon(scriptText, variableName);
};

/**
 * By the rules of AMO we cannot use remote scripts (and our JS rules can be counted as such).
 * Because of that we use the following approach (that was accepted by AMO reviewers):
 *
 * 1. We pre-build JS rules from AdGuard filters into the JSON file.
 * 2. At runtime we check every JS rule if it's included into JSON.
 *    If it is included, we allow this rule to work since it's pre-built. Other rules are discarded.
 * 3. We also allow "User rules" to work since those rules are added manually by the user.
 *    This way filters maintainers can test new rules before including them in the filters.
 */
class LocalScriptRulesService {
    /**
     * If {@link setLocalScriptRules} was called (for example, it should be
     * called in Firefox AMO), this set will contain a list of prebuilt JSON
     * with scriptlets and JS rules allowed to run.
     * Otherwise it will remain undefined.
     * Key is the scriptlet call (e.g.: `example.com#%#//scriptlet('foo')` it will be `#%#//scriptlet('foo')`)
     * and the value is the list of domains from the rule.
     */
    localScripts;
    /**
     * Saves local script rules to object.
     *
     * @param json JSON object with pre-build JS rules.
     */
    setLocalScriptRules(json) {
        this.localScripts = new Map(Object.entries(json.rules));
    }
    /**
     * Checks if ruleText is in the pre-built JSON with JS rules.
     *
     * @param rule Rule text.
     *
     * @returns True, if rule is local, else returns false.
     */
    isLocal(rule) {
        if (this.localScripts === undefined) {
            return true;
        }
        // Key can be checked quickly
        const scriptDomains = this.localScripts.get(rule.getContent());
        if (scriptDomains === undefined) {
            return false;
        }
        return lodash_es_some(scriptDomains, {
            permittedDomains: rule.getPermittedDomains() ?? [],
            restrictedDomains: rule.getRestrictedDomains() ?? [],
        });
    }
}
const localScriptRulesService = new LocalScriptRulesService();

/**
 * Cosmetic api class.
 * Used to prepare and inject javascript and css into pages.
 */
class CosmeticApi extends common_configuration.h {
    /**
     * Timeout for cosmetic injection retry on failure.
     */
    static INJECTION_RETRY_TIMEOUT_MS = 10;
    /**
     * Max number of tries to inject cosmetic rules.
     *
     * Script or style injection may fail in Firefox,
     * e.g. "Error: Missing host permission for the tab",
     * so we need to retry the injection.
     */
    static INJECTION_MAX_TRIES = 100;
    /**
     * Applies scripts from a cosmetic result. It is possible inject a script
     * only once, because after the first inject, we set a flag in an isolated
     * copy of the window and all next calls to `buildScriptText` will return
     * nothing.
     *
     * @see {@link buildScriptText} for details about multiple injects.
     * @see {@link LocalScriptRulesService} for details about script source.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     * @param scriptText Script text.
     *
     * @returns Promise that resolves when the script is injected.
     *
     * @throws Error if the script is not injected due to one of the following reasons:
     * - TabsApi.injectScript() execution error;
     * - app start time is not defined yet.
     */
    static async injectScript(tabId, frameId, scriptText) {
        return TabsApi.injectScript(tabId, frameId, buildScriptText(scriptText, appContext.startTimeMs));
    }
    /**
     * Applies css from cosmetic result.
     *
     * Patches rule selector adding adguard mark rule info in the content attribute.
     * Example:
     * .selector -> .selector { content: 'adguard{filterId};{ruleText} !important;}.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     * @param cssText Css text.
     *
     * @returns Promise that will be fulfilled with no arguments when all the CSS has been inserted.
     * If any error occurs, the promise will be rejected with an error message.
     *
     * @throws Error if the css is not injected due TabsApi.injectCss() execution error.
     */
    static async injectCss(tabId, frameId, cssText) {
        return TabsApi.injectCss(tabId, frameId, cssText);
    }
    /**
     * Builds scripts from cosmetic rules.
     *
     * @param rules Cosmetic rules.
     * @param frameUrl Frame url.
     *
     * @returns Script text or empty string if no script rules are passed.
     */
    static getScriptText(rules, frameUrl) {
        const permittedRules = CosmeticApi.sanitizeScriptRules(rules);
        if (permittedRules.length === 0) {
            return '';
        }
        const uniqueScriptStrings = new Set();
        let debug = false;
        const { configuration } = appContext;
        if (configuration) {
            const { settings } = configuration;
            if (settings) {
                // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2584
                debug = settings.debugScriptlets;
            }
        }
        const scriptParams = {
            debug,
            frameUrl,
        };
        permittedRules.forEach((rule) => {
            const scriptStr = rule.getScript(scriptParams);
            if (scriptStr) {
                uniqueScriptStrings.add(scriptStr);
            }
        });
        const scriptText = CosmeticApi.combineScripts(uniqueScriptStrings);
        return CosmeticApi.wrapScriptText(scriptText);
    }
    /**
     * Generates script text for JS and scriptlet rules from the cosmetic result.
     *
     * @param cosmeticResult Object containing cosmetic rules.
     * @param frameUrl Frame url.
     *
     * @returns An object with `scriptText` — aggregated script text, wrapped for safe execution.
     */
    static getScriptsAndScriptletsData(cosmeticResult, frameUrl) {
        const scriptRules = cosmeticResult.getScriptRules();
        const scriptText = CosmeticApi.getScriptText(scriptRules, frameUrl);
        return { scriptText };
    }
    /**
     * Returns content script data for applying cosmetic.
     *
     * @param frameUrl Frame url.
     * @param tabId Tab id.
     * @param frameId Frame id.
     *
     * @returns Content script data for applying cosmetic.
     */
    static getContentScriptData(frameUrl, tabId, frameId) {
        const { isStorageInitialized } = appContext;
        const data = {
            isAppStarted: false,
            areHitsStatsCollected: false,
            extCssRules: null,
        };
        // if storage is not initialized, then app is not ready yet.
        if (!isStorageInitialized) {
            return data;
        }
        const { isAppStarted, configuration } = appContext;
        const areHitsStatsCollected = configuration?.settings.collectStats || false;
        data.isAppStarted = isAppStarted;
        data.areHitsStatsCollected = areHitsStatsCollected;
        const tabContext = tabsApi.getTabContext(tabId);
        if (!tabContext?.info.url) {
            return data;
        }
        let cosmeticResult;
        const frameContext = tabsApi.getFrameContext(tabId, frameId);
        if (!frameContext || !frameContext.cosmeticResult) {
            const matchQuery = (0,common_configuration.j)(frameUrl, frameId, tabContext);
            cosmeticResult = engineApi.matchCosmetic(matchQuery);
            tabsApi.updateFrameContext(tabId, frameId, { cosmeticResult });
        }
        else {
            cosmeticResult = frameContext.cosmeticResult;
        }
        data.extCssRules = CosmeticApi.getExtCssRules(cosmeticResult, areHitsStatsCollected);
        return data;
    }
    /**
     * Logs js rules applied to specific frame.
     *
     * We need a separate function for logging because script rules can be logged before injection
     * to avoid duplicate logs while the js rule is being applied.
     *
     * See {@link WebRequestApi.onBeforeRequest} for details.
     *
     * @param params Data for js rule logging.
     */
    static logScriptRules(params) {
        super.logScriptRules(params, CosmeticApi.shouldSanitizeScriptRule);
    }
    /**
     * Injects cosmetic rules to the specified tab and frame.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     */
    static injectCosmetic(tabId, frameId) {
        // Note: this is an async function, but we will not await it
        // because events (where it is used) do not support async listeners.
        Promise.all([
            CosmeticApi.applyJsByTabAndFrame(tabId, frameId),
            CosmeticApi.applyCssByTabAndFrame(tabId, frameId),
        ]).catch((e) => common_logger.l.error(e));
    }
    /**
     * Injects both js and scriptlet rules to specified tab and frame in MV2.
     *
     * Please note that a separate method is used for scriptlet rules injection in MV3,
     * but in MV2, both js and scriptlet rules are injected together.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     * @param tries Number of tries for the injection in case of failure.
     */
    static async applyJsByTabAndFrame(tabId, frameId, tries = 0) {
        const frameContext = tabsApi.getFrameContext(tabId, frameId);
        const scriptText = frameContext?.preparedCosmeticResult?.scriptText;
        if (!scriptText) {
            return;
        }
        try {
            await CosmeticApi.injectScript(tabId, frameId, scriptText);
        }
        catch (e) {
            // Retry injection if it fails
            if (tries < CosmeticApi.INJECTION_MAX_TRIES) {
                setTimeout(() => {
                    CosmeticApi.applyJsByTabAndFrame(tabId, frameId, tries + 1);
                }, CosmeticApi.INJECTION_RETRY_TIMEOUT_MS);
            }
            else {
                common_logger.l.debug('[applyJsByTabAndFrame] error occurred during injection', e);
            }
        }
    }
    /**
     * Filters insecure scripts from remote sources.
     *
     * @param rules Cosmetic rules.
     *
     * @returns Permitted script rules.
     */
    static sanitizeScriptRules(rules) {
        return rules.filter(CosmeticApi.shouldSanitizeScriptRule);
    }
    /**
     * Predicate to filter out non-local script rules.
     *
     * @param rule Cosmetic rule.
     *
     * @returns True if the rule is a local script rule, otherwise false.
     */
    static shouldSanitizeScriptRule(rule) {
        // Scriptlets should not be excluded for remote filters
        if (rule.isScriptlet) {
            return true;
        }
        // User rules should not be excluded
        const filterId = rule.getFilterListId();
        if (filterId === constants.U) {
            return true;
        }
        /**
         * @see {@link LocalScriptRulesService} for details about script source
         */
        return localScriptRulesService.isLocal(rule);
    }
    /**
     * Injects css to specified tab id and frame id.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     * @param tries Number of tries for the injection in case of failure.
     */
    static async applyCssByTabAndFrame(tabId, frameId, tries = 0) {
        const frameContext = tabsApi.getFrameContext(tabId, frameId);
        const cssText = frameContext?.preparedCosmeticResult?.cssText;
        if (!cssText) {
            return;
        }
        try {
            await CosmeticApi.injectCss(tabId, frameId, cssText);
        }
        catch (e) {
            // Retry injection if it fails
            if (tries < CosmeticApi.INJECTION_MAX_TRIES) {
                setTimeout(() => {
                    CosmeticApi.applyCssByTabAndFrame(tabId, frameId, tries + 1);
                }, CosmeticApi.INJECTION_RETRY_TIMEOUT_MS);
            }
            else {
                common_logger.l.debug('[applyCssByTabAndFrame] error occurred during injection', e);
            }
        }
    }
}

/**
 * Implementation of the request context storage.
 */
class RequestContextStorage extends Map {
    /**
     * The request storage cleanup timeout.
     */
    static CLEANUP_TIMEOUT_MS = 60_000; // 1 min
    /**
     * The request context data lifetime.
     * It is based on the default browser 5 minutes request idle timeout + 1 second.
     *
     * @see https://source.chromium.org/chromium/chromium/src/+/main:net/socket/client_socket_pool.cc;l=41
     */
    static REQUEST_CONTEXT_LIFETIME_MS = 301_000;
    cleanupTimerId;
    /** @inheritdoc */
    constructor() {
        super();
        this.scheduleCleanup = this.scheduleCleanup.bind(this);
    }
    /**
     * Create new request context.
     *
     * @param requestId Request id.
     * @param data Request context with a omitted eventId field. It is automatically generated.
     *
     * @returns Request context storage instance.
     */
    create(requestId, data) {
        const requestContext = {
            eventId: (0,non_secure/* nanoid */.A)(),
            ...data,
        };
        super.set(requestId, requestContext);
        return requestContext;
    }
    /**
     * Update request context fields. Can be done partially.
     *
     * @param requestId Request id.
     * @param data Partial request context.
     *
     * @returns Updated request context.
     */
    update(requestId, data) {
        const requestContext = super.get(requestId);
        if (requestContext) {
            Object.assign(requestContext, data);
            return requestContext;
        }
        if (!data.timestamp) {
            // Incomplete event. Adding timestamp so that the clean up logic could work for it.
            data.timestamp = Date.now();
        }
        // TODO: Throws error if request context not found after RequestEvents refactoring.
        common_logger.l.error(`Request context not found for requestId: ${requestId}`);
        super.set(requestId, data);
        return undefined;
    }
    /**
     * Some requests may not trigger the onCompleted event and therefore will not be removed from the store.
     * This can occur, for example, with program redirects in the {@link ResourcesService}.
     * To solve this issue, we clean up the store by checking the records timestamps every
     * {@link CLEANUP_TIMEOUT_MS} milliseconds and deleting the expired records.
     */
    scheduleCleanup() {
        // If cleanup has already scheduled, clear previous timer.
        this.clearCleanupTimer();
        this.cleanupTimerId = window.setTimeout(() => {
            const now = Date.now();
            super.forEach(({ timestamp }, key) => {
                if (now > timestamp + RequestContextStorage.REQUEST_CONTEXT_LIFETIME_MS) {
                    super.delete(key);
                }
            });
            this.scheduleCleanup();
        }, RequestContextStorage.CLEANUP_TIMEOUT_MS);
    }
    /**
     * Clears cleanup timer, if it exists.
     */
    clearCleanupTimer() {
        if (this.cleanupTimerId) {
            window.clearTimeout(this.cleanupTimerId);
            this.cleanupTimerId = undefined;
        }
    }
}
// TODO: do not create global instance of storage.
const requestContextStorage = new RequestContextStorage();
requestContextStorage.scheduleCleanup();

/**
 * Get relative path of first-party request for resource `src` attribute.
 *
 * @param requestUrl Resource url.
 * @param documentUrl Url of the document in which the resource will be loaded.
 *
 * @returns Relative path of resource `src` attribute for css selector.
 */
function getRelativeSrcPath(requestUrl, documentUrl) {
    const requestUrlData = new URL(requestUrl);
    const documentUrlData = new URL(documentUrl);
    const documentPathname = documentUrlData.pathname;
    const requestPathname = requestUrlData.pathname;
    const requestUrlTail = requestUrlData.search + requestUrlData.hash;
    if (documentPathname === '/') {
        return requestPathname + requestUrlTail;
    }
    // Check that partial pathnames match
    const requestUrlPathParts = requestPathname.split('/').filter((part) => !!part);
    const documentUrlPathParts = documentPathname.split('/').filter((part) => !!part);
    const commonParts = [];
    for (let i = 0; i < Math.min(requestUrlPathParts.length, documentUrlPathParts.length); i += 1) {
        if (requestUrlPathParts[i] !== documentUrlPathParts[i]) {
            const path = requestUrlPathParts.slice(i).join('/') + requestUrlTail;
            // If first parts are matched, return path relative to document page
            // else return path relative to host
            return i > 0 ? path : `/${path}`;
        }
        commonParts.push(requestUrlPathParts[i]);
    }
    const commonPath = `/${commonParts.join('/')}`;
    return requestPathname.substring(commonPath.length + 1) + requestUrlTail;
}
/**
 * Returns network request initiator tag by request type.
 *
 * @param requestType Request type.
 *
 * @returns Initiator tag.
 */
function getRequestInitiatorTag(requestType) {
    switch (requestType) {
        case RequestType$1.SubDocument:
            return ["iframe" /* InitiatorTag.Iframe */, "frame" /* InitiatorTag.Frame */];
        case RequestType$1.Image:
            return ["img" /* InitiatorTag.Image */];
        default:
            return null;
    }
}
/**
 * Inject css for element hiding by tabs.injectCss.
 *
 * @param tabId Tab id.
 * @param requestFrameId Request frame id.
 * @param requestUrl Request url.
 * @param documentUrl Document url.
 * @param requestType Request type.
 * @param isThirdParty Flag telling if request is third-party.
 */
function hideRequestInitiatorElement(tabId, requestFrameId, requestUrl, documentUrl, requestType, isThirdParty) {
    const initiatorTags = getRequestInitiatorTag(requestType);
    if (!initiatorTags || tabId === BACKGROUND_TAB_ID) {
        return;
    }
    let src;
    let matching;
    if (isThirdParty) {
        src = requestUrl.substring(requestUrl.indexOf('//'));
        matching = "$=" /* AttributeMatching.Suffix */;
    }
    else {
        src = getRelativeSrcPath(requestUrl, documentUrl);
        matching = "=" /* AttributeMatching.Strict */;
    }
    let code = '';
    for (let i = 0; i < initiatorTags.length; i += 1) {
        code += createHidingCssRule(initiatorTags[i], src, matching);
    }
    CosmeticApi.injectCss(tabId, requestFrameId, code);
}

/**
 * Api for processing request filtering.
 *
 * Method {@link getBlockingResponse} processes rule applying for request and computes response
 * for {@link WebRequestApi.onBeforeRequest} listener.
 *
 * Method {@link shouldCollapseElement} checks, if initializer for request should be collapsed by content-script.
 *
 * This class also provides method {@link isRequestBlockedByRule} for checking, if rule is blocking rule.
 */
class RequestBlockingApi {
    /**
     * In some cases request blocking breaks images and frames on page.
     * We match rule from content-script and decide if DOM element should be hidden via css.
     *
     * @param tabId Tab id.
     * @param url Request url.
     * @param referrerUrl Request initializer frame url.
     * @param requestType Type of request.
     *
     * @returns True, if element should be collapsed, else returns false.
     */
    static shouldCollapseElement(tabId, url, referrerUrl, requestType) {
        const result = engineApi.matchRequest({
            requestUrl: url,
            frameUrl: referrerUrl,
            requestType,
            frameRule: tabsApi.getTabFrameRule(tabId),
        });
        if (!result) {
            return false;
        }
        const basicRule = result.getBasicResult();
        const popupRule = result.getPopupRule();
        // we do not want to block the main page if the rule has only $popup modifier
        if (basicRule === popupRule) {
            return false;
        }
        return RequestBlockingApi.isRequestBlockedByRule(result.getBasicResult());
    }
    /**
     * Checks if request rule is blocked.
     *
     * @param requestRule Request network rule or null.
     *
     * @returns True, if rule is request blocking, else returns false.
     */
    static isRequestBlockedByRule(requestRule) {
        return !!requestRule
            && !requestRule.isAllowlist()
            && !requestRule.isOptionEnabled(es/* NetworkRuleOption */.iR.Replace)
            && !requestRule.isOptionEnabled(es/* NetworkRuleOption */.iR.Redirect);
    }
    /**
     * Closes the tab which considered as a popup.
     *
     * @param data Needed data for logging closing of tab.
     * @param appliedRule Network rule which was applied to request. This field
     * is needed because data contains two rules: one for the request and
     * one for the popup. And we should log only the rule which was applied
     * to the request.
     *
     * @returns Response for {@link WebRequestApi.onBeforeRequest} listener.
     */
    static closeTab(data, appliedRule) {
        RequestBlockingApi.logRuleApplying(data, appliedRule);
        browser_polyfill.tabs.remove(data.tabId);
        return { cancel: true };
    }
    /**
     * Processes rule applying for request and compute response for {@link WebRequestApi.onBeforeRequest} listener.
     *
     * @param data Data for request processing.
     *
     * @returns Response for {@link WebRequestApi.onBeforeRequest} listener.
     */
    static getBlockingResponse(data) {
        const { rule, popupRule, requestType, tabId, eventId, requestUrl, requestId, referrerUrl, } = data;
        if (!rule) {
            return undefined;
        }
        // popup rule will be handled in the condition with RequestType === document below
        if (popupRule === rule && requestType !== request_type/* RequestType */.Y.Document) {
            return undefined;
        }
        if (rule.isAllowlist()) {
            RequestBlockingApi.logRuleApplying(data, rule);
            return undefined;
        }
        if (rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Redirect)) {
            const redirectUrl = redirectsService.createRedirectUrl(rule.getAdvancedModifierValue(), requestUrl);
            if (redirectUrl) {
                RequestBlockingApi.logRuleApplying(data, rule);
                // redirects should be considered as blocked for the tab blocked request count
                // which is displayed on the extension badge
                // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2443
                tabsApi.incrementTabBlockedRequestCount(tabId, referrerUrl);
                return { redirectUrl };
            }
        }
        // Basic rules for blocking requests are applied only to sub-requests
        // so `||example.com^` will not block the main page
        // https://adguard.com/kb/general/ad-filtering/create-own-filters/#basic-rules
        // For document requests we need to show blocking page or close tab.
        if (requestType === request_type/* RequestType */.Y.Document) {
            // Blocking rule can be with $popup modifier - in this case we need
            // to close the tab as soon as possible.
            // https://adguard.com/kb/general/ad-filtering/create-own-filters/#popup-modifier
            if (popupRule && tabsApi.isNewPopupTab(tabId)) {
                return RequestBlockingApi.closeTab(data, popupRule);
            }
            // to handle rules with $all modifier, where popup was added implicitly
            if (rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Popup) && tabsApi.isNewPopupTab(tabId)) {
                return RequestBlockingApi.closeTab(data, rule);
            }
            // we do not want to block the main page if rule has only $popup modifier
            if (rule === popupRule && !tabsApi.isNewPopupTab(tabId)) {
                return undefined;
            }
            // but if the blocking rule has $document modifier, blocking page should be shown
            // e.g. `||example.com^$document`
            if ((rule.getPermittedRequestTypes() & request_type/* RequestType */.Y.Document) === request_type/* RequestType */.Y.Document) {
                return documentBlockingService.getDocumentBlockingResponse({
                    eventId,
                    requestUrl,
                    requestId,
                    referrerUrl,
                    rule,
                    tabId,
                });
            }
            return undefined;
        }
        RequestBlockingApi.logRuleApplying(data, rule);
        return { cancel: true };
    }
    /**
     * Processes rule applying for request and compute response for {@link WebRequestApi.onHeadersReceived} listener.
     *
     * @param responseHeaders Response headers.
     * @param data Data for request processing.
     *
     * @returns Response for {@link WebRequestApi.onHeadersReceived} listener.
     */
    static getResponseOnHeadersReceived(responseHeaders, data) {
        if (!data.rule || !responseHeaders) {
            return undefined;
        }
        RequestBlockingApi.logRuleApplying(data, data.rule);
        return data.rule.isAllowlist() ? undefined : { cancel: true };
    }
    /**
     * Creates {@link FilteringLog} event of rule applying for processed request.
     *
     * @param data Data for request processing.
     * @param appliedRule Network rule which was applied to request.
     */
    static logRuleApplying(data, appliedRule) {
        const { tabId, eventId, requestId, referrerUrl, requestUrl, contentType, } = data;
        if (!appliedRule) {
            return;
        }
        const companyCategoryName = common_configuration.k.match(requestUrl);
        common_configuration.d.publishEvent({
            type: common_configuration.l.ApplyBasicRule,
            data: {
                tabId,
                eventId,
                requestType: contentType,
                frameUrl: referrerUrl,
                requestId,
                requestUrl,
                companyCategoryName,
                filterId: appliedRule.getFilterListId(),
                ruleIndex: appliedRule.getIndex(),
                isAllowlist: appliedRule.isAllowlist(),
                isImportant: appliedRule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                isDocumentLevel: appliedRule.isDocumentLevelAllowlistRule(),
                isCsp: appliedRule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                isCookie: appliedRule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                advancedModifier: appliedRule.getAdvancedModifierValue(),
            },
        });
    }
}

// TODO: use named export
/**
 * Cookie Utils.
 */
class CookieUtils extends common_configuration.m {
    /**
     * Set-Cookie header name.
     */
    static SET_COOKIE_HEADER_NAME = 'set-cookie';
    /**
     * Line feed character.
     */
    static LINE_FEED = '\n';
    /**
     * Splits a single `set-cookie` header with multiline cookies into
     * multiple `set-cookie` headers with single-line cookies.
     *
     * Mutates `responseHeaders`.
     *
     * @param responseHeaders HTTP response headers.
     */
    static splitMultilineCookies(responseHeaders) {
        for (let i = responseHeaders.length - 1; i >= 0; i -= 1) {
            const { name, value } = responseHeaders[i];
            if (name.toLowerCase() !== CookieUtils.SET_COOKIE_HEADER_NAME
                || !value
                || !value.includes(CookieUtils.LINE_FEED)) {
                continue;
            }
            const values = value.split(CookieUtils.LINE_FEED);
            // Remove the original header, iteration won't be broken
            // as the array is being modified from the end
            responseHeaders.splice(i, 1);
            // eslint-disable-next-line @typescript-eslint/no-shadow
            values.forEach((value) => {
                responseHeaders.push({ name: CookieUtils.SET_COOKIE_HEADER_NAME, value });
            });
        }
    }
    /**
     * Serializes cookie data into a string suitable for Set-Cookie header.
     *
     * @param cookie A cookie object.
     *
     * @returns Set-Cookie string or null if it failed to serialize object.
     *
     * @throws {TypeError} Thrown in case of invalid input data.
     */
    static serializeCookieToResponseHeader(cookie) {
        if (!cookie) {
            throw new TypeError('empty cookie data');
        }
        // 1. Validate fields
        if (!CookieUtils.FIELD_CONTENT_REGEX.test(cookie.name)) {
            throw new TypeError(`Cookie name is invalid: ${cookie.name}`);
        }
        if (cookie.value && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.value)) {
            throw new TypeError(`Cookie value is invalid: ${cookie.value}`);
        }
        if (cookie.domain && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.domain)) {
            throw new TypeError(`Cookie domain is invalid: ${cookie.domain}`);
        }
        if (cookie.path && !CookieUtils.FIELD_CONTENT_REGEX.test(cookie.path)) {
            throw new TypeError(`Cookie path is invalid: ${cookie.path}`);
        }
        if (cookie.expires && typeof cookie.expires.toUTCString !== 'function') {
            throw new TypeError(`Cookie expires is invalid: ${cookie.expires}`);
        }
        // 2. Build Set-Cookie header value
        let setCookieValue = `${cookie.name}=${cookie.value}`;
        if (typeof cookie.maxAge === 'number' && !Number.isNaN(cookie.maxAge)) {
            setCookieValue += `; Max-Age=${Math.floor(cookie.maxAge)}`;
        }
        if (cookie.domain) {
            setCookieValue += `; Domain=${cookie.domain}`;
        }
        if (cookie.path) {
            setCookieValue += `; Path=${cookie.path}`;
        }
        if (cookie.expires) {
            setCookieValue += `; Expires=${cookie.expires.toUTCString()}`;
        }
        if (cookie.httpOnly) {
            setCookieValue += '; HttpOnly';
        }
        if (cookie.secure) {
            setCookieValue += '; Secure';
        }
        if (cookie.sameSite) {
            const sameSite = cookie.sameSite.toLowerCase();
            switch (sameSite) {
                case 'lax':
                    setCookieValue += '; SameSite=Lax';
                    break;
                case 'strict':
                    setCookieValue += '; SameSite=Strict';
                    break;
                case 'none':
                    setCookieValue += '; SameSite=None';
                    break;
                default:
                    throw new TypeError(`Cookie sameSite is invalid: ${cookie.sameSite}`);
            }
        }
        // Not affected. Let it be here just in case
        // https://bugs.chromium.org/p/chromium/issues/detail?id=232693
        if (cookie.priority) {
            setCookieValue += `; Priority=${cookie.priority}`;
        }
        return setCookieValue;
    }
    /**
     * Serializes cookie data into a string suitable for Cookie header.
     *
     * @param cookies Array with {@link ParsedCookie}.
     *
     * @returns Cookie string or null if it failed to serialize object.
     */
    static serializeCookieToRequestHeader(cookies) {
        return cookies
            .map((cookie) => `${cookie.name}=${cookie.value}`)
            .join('; ');
    }
}

/**
 * Generic wrapper for browser.webRequest with custom event implementation.
 */
class RequestEvent {
    listeners = [];
    /**
     * Register listener for the browser.webRequest events.
     *
     * @param event WebRequest event name.
     * @param handler Handler to register.
     * @param filter Filter of the events.
     * @param extraInfoSpec Extra info spec.
     */
    init(event, handler, filter, extraInfoSpec) {
        const handleBrowserEvent = (details) => {
            const data = handler(details);
            /**
             * Execute all registered listeners one by one until a non-empty value is returned.
             */
            for (let i = 0; i < this.listeners.length; i += 1) {
                const res = this.listeners[i](data);
                if (res) {
                    return res;
                }
            }
            return undefined;
        };
        if (extraInfoSpec) {
            event.addListener(handleBrowserEvent, filter, extraInfoSpec);
        }
        else {
            event.addListener(handleBrowserEvent, filter);
        }
    }
    /**
     * Register listener for the browser.webRequest events.
     *
     * @param listener Event callback.
     */
    addListener(listener) {
        this.listeners.push(listener);
    }
    /**
     * Remove listener from the browser.webRequest events.
     *
     * @param listener Event callback.
     */
    removeListener(listener) {
        const index = this.listeners.indexOf(listener);
        if (index !== -1) {
            this.listeners.splice(index, 1);
        }
    }
}

const MAX_URL_LENGTH = 1024 * 16;
/**
 * Request events class.
 */
class RequestEvents {
    static onBeforeRequest = new RequestEvent();
    static onBeforeSendHeaders = new RequestEvent();
    static onSendHeaders = new RequestEvent();
    static onHeadersReceived = new RequestEvent();
    static onAuthRequired = new RequestEvent();
    static onBeforeRedirect = new RequestEvent();
    static onResponseStarted = new RequestEvent();
    static onCompleted = new RequestEvent();
    static onErrorOccurred = new RequestEvent();
    /**
     * Initializes request events service.
     */
    static init() {
        RequestEvents.onBeforeRequest.init(browser_polyfill.webRequest.onBeforeRequest, RequestEvents.handleOnBeforeRequest, { urls: ['<all_urls>'] }, ['blocking', 'requestBody']);
        const onBeforeSendHeadersOptions = ['requestHeaders', 'blocking'];
        const onBeforeSendHeadersOptionTypes = browser_polyfill.webRequest.OnBeforeSendHeadersOptions;
        if (typeof onBeforeSendHeadersOptionTypes !== 'undefined'
            && Object.prototype.hasOwnProperty.call(onBeforeSendHeadersOptionTypes, 'EXTRA_HEADERS')) {
            onBeforeSendHeadersOptions.push('extraHeaders');
        }
        RequestEvents.onBeforeSendHeaders.init(browser_polyfill.webRequest.onBeforeSendHeaders, RequestEvents.handleOnBeforeSendHeaders, { urls: ['<all_urls>'] }, onBeforeSendHeadersOptions);
        RequestEvents.onSendHeaders.init(browser_polyfill.webRequest.onSendHeaders, RequestEvents.handleSendHeaders, { urls: ['<all_urls>'] });
        const onHeadersReceivedOptions = ['responseHeaders', 'blocking'];
        const onHeadersReceivedOptionTypes = browser_polyfill.webRequest.OnHeadersReceivedOptions;
        if (typeof onHeadersReceivedOptionTypes !== 'undefined'
            && Object.prototype.hasOwnProperty.call(onBeforeSendHeadersOptionTypes, 'EXTRA_HEADERS')) {
            onHeadersReceivedOptions.push('extraHeaders');
        }
        RequestEvents.onHeadersReceived.init(browser_polyfill.webRequest.onHeadersReceived, RequestEvents.handleOnHeadersReceived, { urls: ['<all_urls>'] }, onHeadersReceivedOptions);
        RequestEvents.onAuthRequired.init(browser_polyfill.webRequest.onAuthRequired, RequestEvents.handleOnAuthRequired, { urls: ['<all_urls>'] });
        RequestEvents.onBeforeRedirect.init(browser_polyfill.webRequest.onBeforeRedirect, RequestEvents.handleOnBeforeRedirect, { urls: ['<all_urls>'] });
        RequestEvents.onResponseStarted.init(browser_polyfill.webRequest.onResponseStarted, RequestEvents.handleOnResponseStarted, { urls: ['<all_urls>'] });
        RequestEvents.onCompleted.init(browser_polyfill.webRequest.onCompleted, RequestEvents.handleOnCompleted, { urls: ['<all_urls>'] }, ['responseHeaders']);
        RequestEvents.onErrorOccurred.init(browser_polyfill.webRequest.onErrorOccurred, RequestEvents.handleOnErrorOccurred, { urls: ['<all_urls>'] });
    }
    /**
     * Handles onBeforeRequest event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data.
     */
    static handleOnBeforeRequest(details) {
        const { requestId, type, tabId, parentFrameId, originUrl, initiator, method, timeStamp, documentLifecycle, } = details;
        let { url, frameId } = details;
        /**
         * Truncate too long urls.
         *
         * @see {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1493}
         */
        if (url.length > MAX_URL_LENGTH) {
            url = url.slice(0, MAX_URL_LENGTH);
        }
        /**
         * FF sends http instead of ws protocol at the http-listeners layer
         * Although this is expected, as the Upgrade request is indeed an HTTP request,
         * we use a chromium based approach in this case.
         */
        if (type === 'websocket' && (0,common_configuration.i)(url)) {
            url = url.replace(/^http(s)?:/, 'ws$1:');
        }
        const { requestType, contentType } = (0,common_configuration.n)(type);
        const isDocumentRequest = requestType === request_type/* RequestType */.Y.Document;
        const isPrerenderRequest = documentLifecycle === common_configuration.D.Prerender;
        // Pre-rendered documents can have a frame ID other than zero
        frameId = isDocumentRequest ? constants.M : details.frameId;
        let requestFrameId = isDocumentRequest ? frameId : parentFrameId;
        // Relate request to main_frame
        if (requestFrameId === -1) {
            requestFrameId = 0;
        }
        // To mark requests started via navigation from the address bar (real
        // request or pre-render, it does not matter) as first-party requests,
        // we get only part of the request context to record only the tab and
        // frame information before calculating the request referrer.
        const tabFrameRequestContext = {
            requestUrl: url,
            requestType,
            requestId,
            frameId,
            tabId,
        };
        // Do not reload filtering log on requests that are being redirected by $removeparam
        if (isDocumentRequest && !requestContextStorage.has(requestId)) {
            // dispatch filtering log reload event
            common_configuration.d.publishEvent({
                type: common_configuration.l.TabReload,
                data: { tabId },
            });
        }
        // We rely on browser-provided values as the source of truth
        let referrerUrl = originUrl
            || initiator
            || '';
        /**
         * For prerender document requests, use the request URL itself, because
         * for prerender request `originUrl` and `initiator` are both undefined.
         */
        if (!referrerUrl && isPrerenderRequest && isDocumentRequest) {
            referrerUrl = url;
        }
        /**
         * If we still do not determine referrerUrl, try to extract url from the
         * tab context or fallback to the request URL.
         */
        if (!referrerUrl) {
            // Try to get referrer from tab state during address bar navigation.
            referrerUrl = tabsApi.getTabMainFrame(tabId)?.url
                || tabsApi.getTabFrame(tabId, requestFrameId)?.url
                || url;
        }
        // Retrieve the rest part of the request context for record all fields.
        const requestContext = requestContextStorage.create(requestId, {
            ...tabFrameRequestContext,
            requestFrameId,
            state: "beforeRequest" /* RequestContextState.BeforeRequest */,
            timestamp: timeStamp,
            thirdParty: (0,common_configuration.o)(url, referrerUrl),
            referrerUrl,
            contentType,
            method: method,
        });
        return { details, context: requestContext };
    }
    /**
     * Handles onBeforeSendHeaders event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data.
     */
    static handleOnBeforeSendHeaders(details) {
        const { requestId, timeStamp, requestHeaders } = details;
        const context = requestContextStorage.update(requestId, {
            state: "beforeSendHeaders" /* RequestContextState.BeforeSendHeaders */,
            timestamp: timeStamp,
            requestHeaders,
        });
        return { details, context };
    }
    /**
     * Handles onSendHeaders event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleSendHeaders(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "sendHeaders" /* RequestContextState.SendHeaders */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
    /**
     * Handles onHeadersReceived event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnHeadersReceived(details) {
        const { requestId, responseHeaders, statusCode, } = details;
        /**
         * Firefox packs all cookies in a single set-cookie header concatenated with `\n`
         * https://bugzilla.mozilla.org/show_bug.cgi?id=1349151#c1.
         */
        if (responseHeaders && isFirefox) {
            CookieUtils.splitMultilineCookies(responseHeaders);
        }
        const context = requestContextStorage.update(requestId, {
            state: "headersReceived" /* RequestContextState.HeadersReceived */,
            responseHeaders,
            statusCode,
        });
        return { details, context };
    }
    /**
     * Handles onAuthRequired event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnAuthRequired(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "authRequired" /* RequestContextState.AuthRequired */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
    /**
     * Handles onBeforeRedirect event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnBeforeRedirect(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "beforeRedirect" /* RequestContextState.BeforeRedirect */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
    /**
     * Handles onResponseStarted event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnResponseStarted(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "responseStarted" /* RequestContextState.ResponseStarted */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
    /**
     * Handles onCompleted event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnCompleted(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "completed" /* RequestContextState.Completed */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
    /**
     * Handles onErrorOccurred event.
     *
     * @param details WebRequest details.
     *
     * @returns Request data with context.
     */
    static handleOnErrorOccurred(details) {
        const { requestId, timeStamp } = details;
        const context = requestContextStorage.update(requestId, {
            state: "error" /* RequestContextState.Error */,
            timestamp: timeStamp,
        });
        return { details, context };
    }
}

/**
 * Cookie filtering.
 *
 * The following public methods should be set as suitable webRequest events listeners, check sample extension in this
 * repo for an example.
 *
 * Logic introduction:
 *  CookieFiltering.onBeforeSendHeaders:
 *  - get all cookies for request url;
 *  - store cookies (first-party);
 *  - apply rules via modifying or removing them from headers
 *    and modifying or removing them with browser.cookies api;
 *
 *  CookieFiltering.onHeadersReceived:
 *  - parse set-cookie header, only to detect if the cookie in header will be set from third-party request;
 *  - save third-party flag for this cookie cookie.thirdParty=request.thirdParty;
 *  - apply rules via modifying or removing them from headers
 *    and modifying or removing them with browser.cookies api;
 *
 *  CookieFiltering.onCompleted:
 *  - apply rules via content script
 *  In content-scripts (check /src/content-script/cookie-controller.ts):
 *  - get matching cookie rules;
 *  - apply.
 */
class CookieFiltering {
    filteringLog;
    browserCookieApi = new common_configuration.p();
    /**
     * Constructor.
     *
     * @param filteringLog Filtering log.
     */
    constructor(filteringLog) {
        this.filteringLog = filteringLog;
    }
    /**
     * Parses cookies from headers.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    onBeforeSendHeaders(context) {
        const { requestHeaders, requestUrl, requestId } = context;
        if (!requestHeaders || !requestUrl) {
            return false;
        }
        const cookieHeader = (0,common_configuration.q)(requestHeaders, 'Cookie');
        if (!cookieHeader?.value) {
            return false;
        }
        const cookies = CookieUtils.parseCookies(cookieHeader.value, requestUrl);
        if (cookies.length === 0) {
            return false;
        }
        // Saves cookies to context
        requestContextStorage.update(requestId, { cookies });
        // Removes cookies from browser with browser.cookies api, but not
        // removing them from context to correct process them in headers.
        // IMPORTANT: This method reads cookies from context, so it should be
        // called before method that change headers, since that method will
        // remove or change headers in context.
        this.applyRules(context)
            .catch((e) => {
            common_logger.l.error(e.message);
        });
        // Removes cookie from headers and updates context.
        // Note: this method won't work in the extension build with manifest v3.
        const headersModified = this.applyRulesToRequestCookieHeaders(context);
        return headersModified;
    }
    /**
     * Applies cookies to request headers.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    applyRulesToRequestCookieHeaders(context) {
        let headersModified = false;
        const { requestHeaders, cookies, matchingResult, requestUrl, thirdParty, tabId, requestId, } = context;
        if (!requestHeaders
            || !matchingResult
            || !requestUrl
            || typeof thirdParty !== 'boolean'
            || !cookies) {
            return headersModified;
        }
        const cookieRules = matchingResult.getCookieRules();
        for (let i = 0; i < cookies.length; i += 1) {
            const cookie = cookies[i];
            if (!cookie) {
                continue;
            }
            const bRule = common_configuration.r.lookupNotModifyingRule(cookie.name, cookieRules, thirdParty);
            if (bRule) {
                if (!bRule.isAllowlist()) {
                    // Remove from cookies array.
                    cookies.splice(i, 1);
                    // Move the loop counter back because we removed one element
                    // from the iterated array.
                    i -= 1;
                    headersModified = true;
                }
                this.recordCookieEvent(tabId, cookie, requestUrl, bRule, false, thirdParty);
            }
            const mRules = common_configuration.r.lookupModifyingRules(cookie.name, cookieRules, thirdParty);
            if (mRules.length > 0) {
                const appliedRules = CookieFiltering.applyRuleToBrowserCookie(cookie, mRules);
                if (appliedRules.length > 0) {
                    headersModified = true;
                }
                appliedRules.forEach((r) => {
                    this.recordCookieEvent(tabId, cookie, requestUrl, r, true, thirdParty);
                });
            }
        }
        if (headersModified) {
            const cookieHeaderIndex = requestHeaders.findIndex((header) => header.name.toLowerCase() === 'cookie');
            if (cookieHeaderIndex !== -1) {
                if (cookies.length > 0) {
                    // Update "cookie" header before send request to server.
                    requestHeaders[cookieHeaderIndex].value = CookieUtils.serializeCookieToRequestHeader(cookies);
                }
                else {
                    // Empty cookies, delete header "Cookie".
                    requestHeaders.splice(cookieHeaderIndex, 1);
                }
            }
            // Update headers and cookies in context.
            requestContextStorage.update(requestId, { requestHeaders, cookies });
        }
        return headersModified;
    }
    /**
     * Applies cookies to response headers.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    applyRulesToResponseCookieHeaders(context) {
        let headersModified = false;
        const { responseHeaders, matchingResult, requestUrl, thirdParty, tabId, requestId, } = context;
        if (!responseHeaders
            || !matchingResult
            || !requestUrl
            || typeof thirdParty !== 'boolean') {
            return headersModified;
        }
        const cookieRules = matchingResult.getCookieRules();
        for (let i = responseHeaders.length - 1; i >= 0; i -= 1) {
            const header = responseHeaders[i];
            const cookie = CookieUtils.parseSetCookieHeader(header, requestUrl);
            if (!cookie) {
                continue;
            }
            const bRule = common_configuration.r.lookupNotModifyingRule(cookie.name, cookieRules, thirdParty);
            if (bRule) {
                if (!bRule.isAllowlist()) {
                    responseHeaders.splice(i, 1);
                    headersModified = true;
                }
                this.recordCookieEvent(tabId, cookie, requestUrl, bRule, false, thirdParty);
            }
            const mRules = common_configuration.r.lookupModifyingRules(cookie.name, cookieRules, thirdParty);
            // Only apply if there is at least one non-allowlist rule
            if (mRules.length > 0 && mRules.some((r) => !r.isAllowlist())) {
                const appliedRules = CookieFiltering.applyRuleToBrowserCookie(cookie, mRules);
                if (appliedRules.length > 0) {
                    headersModified = true;
                    responseHeaders[i] = {
                        name: 'set-cookie',
                        value: CookieUtils.serializeCookieToResponseHeader(cookie),
                    };
                    appliedRules.forEach((r) => {
                        this.recordCookieEvent(tabId, cookie, requestUrl, r, true, thirdParty);
                    });
                }
            }
        }
        if (headersModified) {
            requestContextStorage.update(requestId, { responseHeaders });
        }
        return headersModified;
    }
    /**
     * Parses set-cookie header and looks up third-party cookies.
     * This callback won't work for mv3 extensions.
     * TODO separate or rewrite to mv2 and mv3 methods.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    onHeadersReceived(context) {
        const { responseHeaders, requestUrl, thirdParty, requestId, } = context;
        /**
         * Full context can be created in onBeforeRequest, partial context can
         * be created on every requestContextStorage.update method call and
         * because of that case - we explicitly checks fields in object.
         * TODO: Improve in AG-24428.
         */
        if (responseHeaders && requestUrl && typeof thirdParty !== 'undefined') {
            const cookies = CookieUtils.parseSetCookieHeaders(responseHeaders, requestUrl);
            const newCookies = cookies.filter((c) => !context.cookies?.includes(c));
            for (const cookie of newCookies) {
                cookie.thirdParty = thirdParty;
            }
            requestContextStorage.update(requestId, {
                cookies: context.cookies ? [...context.cookies, ...newCookies] : newCookies,
            });
        }
        // Removes cookies from browser with browser.cookies api, but not
        // removing them from context to correct process them in headers.
        // IMPORTANT: This method reads cookies from context, so it should be
        // called before method that change headers, since that method will
        // remove or change headers in context.
        this.applyRules(context)
            .catch((e) => {
            common_logger.l.error(e.message);
        });
        // Remove cookie headers.
        // This method won't work in the extension build with manifest v3.
        const headersModified = this.applyRulesToResponseCookieHeaders(context);
        return headersModified;
    }
    /**
     * TODO: Use isAppStarted with interval to re-request cookie rules if engine
     * is not started, as it implemented in CosmeticController.
     *
     * Looks up blocking rules for content-script.
     *
     * @param frameUrl Frame url.
     * @param tabId Tab id.
     * @param frameId Frame id.
     *
     * @returns List of blocking rules.
     */
    // eslint-disable-next-line class-methods-use-this
    getBlockingRules(frameUrl, tabId, frameId) {
        const tabContext = tabsApi.getTabContext(tabId);
        if (!tabContext?.info.url) {
            return [];
        }
        const matchQuery = (0,common_configuration.j)(frameUrl, frameId, tabContext);
        const matchingResult = engineApi.matchRequest(matchQuery);
        if (!matchingResult) {
            return [];
        }
        const cookieRules = matchingResult.getCookieRules();
        return common_configuration.r.getBlockingRules(matchQuery.requestUrl, cookieRules);
    }
    /**
     * Applies rules.
     *
     * @param context Request context.
     */
    async applyRules(context) {
        const { matchingResult, cookies, requestUrl, tabId, } = context;
        if (!matchingResult || !cookies) {
            return;
        }
        const cookieRules = matchingResult.getCookieRules();
        const promises = cookies.map(async (cookie) => {
            await this.applyRulesToCookie(cookie, cookieRules, requestUrl, tabId);
        });
        await Promise.all(promises);
    }
    /**
     * Attempts to find a "parent" cookie with a wider "path" field,
     * the scope of which includes the specified cookie from
     * the function parameters.
     *
     * This needs to prevent create of multiple "child"-cookies
     * and only modified expiration of general "parent"-cookie,
     * which covered "children"-cookies by 'path' value.
     *
     * @param cookie Cookie, for which need to find the "parent" cookie.
     *
     * @returns Item of parent cookie {@link ParsedCookie} or null if not found.
     */
    async findParentCookie(cookie) {
        const pattern = {
            url: cookie.url,
            name: cookie.name,
            domain: cookie.domain,
            secure: cookie.secure,
        };
        const parentCookies = await this.browserCookieApi.findCookies(pattern);
        const sortedParentCookies = parentCookies.sort((a, b) => a.path.length - b.path.length);
        for (let i = 0; i < sortedParentCookies.length; i += 1) {
            const parentCookie = sortedParentCookies[i];
            if (cookie.path?.startsWith(parentCookie.path)) {
                return common_configuration.P.fromBrowserCookie(parentCookie, cookie.url);
            }
        }
        return null;
    }
    /**
     * Applies rules to cookie.
     *
     * @param cookie Cookie.
     * @param cookieRules Cookie rules.
     * @param requestUrl Request URL, needs to record filtering event.
     * @param tabId Tab id.
     */
    async applyRulesToCookie(cookie, cookieRules, requestUrl, tabId) {
        const cookieName = cookie.name;
        const isThirdPartyCookie = cookie.thirdParty;
        const bRule = common_configuration.r.lookupNotModifyingRule(cookieName, cookieRules, isThirdPartyCookie);
        if (bRule) {
            if (bRule.isAllowlist() || await this.browserCookieApi.removeCookie(cookie.name, cookie.url)) {
                this.recordCookieEvent(tabId, cookie, requestUrl, bRule, false, isThirdPartyCookie);
            }
            return;
        }
        const mRules = common_configuration.r.lookupModifyingRules(cookieName, cookieRules, isThirdPartyCookie);
        if (mRules.length > 0) {
            // Try to find "parent" cookie and modify it instead of creating
            // "child copy" cookie.
            const parentCookie = await this.findParentCookie(cookie);
            const cookieToModify = parentCookie || cookie;
            const appliedRules = CookieFiltering.applyRuleToBrowserCookie(cookieToModify, mRules);
            if (appliedRules.length > 0) {
                if (await this.browserCookieApi.modifyCookie(cookieToModify)) {
                    appliedRules.forEach((r) => {
                        this.recordCookieEvent(tabId, cookieToModify, requestUrl, r, true, isThirdPartyCookie);
                    });
                }
            }
        }
    }
    /**
     * Modifies instance of {@link ParsedCookie} with provided rules.
     *
     * @param cookie Cookie modify.
     * @param rules Cookie matching rules.
     *
     * @returns Applied rules.
     */
    static applyRuleToBrowserCookie(cookie, rules) {
        const appliedRules = [];
        for (let i = 0; i < rules.length; i += 1) {
            const rule = rules[i];
            if (rule.isAllowlist()) {
                appliedRules.push(rule);
                continue;
            }
            const cookieModifier = rule.getAdvancedModifier();
            let modified = false;
            const sameSite = cookieModifier.getSameSite();
            if (sameSite && cookie.sameSite !== sameSite) {
                // eslint-disable-next-line no-param-reassign
                cookie.sameSite = sameSite;
                modified = true;
            }
            const maxAge = cookieModifier.getMaxAge();
            if (maxAge) {
                if (CookieUtils.updateCookieMaxAge(cookie, maxAge)) {
                    modified = true;
                }
            }
            if (modified) {
                appliedRules.push(rule);
            }
        }
        return appliedRules;
    }
    /**
     * Records cookie event to filtering log.
     *
     * @param tabId Id of the tab.
     * @param cookie Item of {@link ParsedCookie}.
     * @param requestUrl URL of the request.
     * @param rule Applied modifying or deleting rule.
     * @param isModifyingCookieRule Is applied rule modifying or not.
     * @param requestThirdParty Whether request third party or not.
     */
    recordCookieEvent(tabId, cookie, requestUrl, rule, isModifyingCookieRule, requestThirdParty) {
        this.filteringLog.publishEvent({
            type: common_configuration.l.Cookie,
            data: {
                eventId: (0,non_secure/* nanoid */.A)(),
                tabId,
                cookieName: cookie.name,
                cookieValue: cookie.value,
                frameDomain: (0,es6/* getDomain */.FB)(requestUrl) || requestUrl,
                filterId: rule.getFilterListId(),
                ruleIndex: rule.getIndex(),
                isModifyingCookieRule,
                requestThirdParty,
                timestamp: Date.now(),
                requestType: common_configuration.s.Cookie,
                isAllowlist: rule.isAllowlist(),
                isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                advancedModifier: rule.getAdvancedModifierValue(),
            },
        });
    }
}
const cookieFiltering = new CookieFiltering(common_configuration.d);

// TODO: add long live connection
// TODO: CollectHitStats
// TODO: Move to common folder
/**
 * Messages API implementation. It is used to communicate with content scripts.
 */
class MessagesApi {
    tabsApi;
    filteringLog;
    /**
     * Messages API constructor.
     *
     * @param tabsApi Tabs API.
     * @param filteringLog Filtering log.
     */
    constructor(tabsApi, filteringLog) {
        this.tabsApi = tabsApi;
        this.filteringLog = filteringLog;
        this.handleMessage = this.handleMessage.bind(this);
    }
    /**
     * Messages handler.
     *
     * @param message Message object.
     * @param sender Tab which sent the message.
     *
     * @returns Promise resolved with response to the message.
     */
    async handleMessage(message, sender) {
        try {
            message = common_configuration.t.parse(message);
        }
        catch (e) {
            // ignore
            return undefined;
        }
        const { type } = message;
        switch (type) {
            case message_constants.M.ProcessShouldCollapse: {
                return this.handleProcessShouldCollapseMessage(sender, message.payload);
            }
            case message_constants.M.GetCosmeticData: {
                return this.handleGetCosmeticData(sender, message.payload);
            }
            case message_constants.M.GetCookieRules: {
                return this.handleGetCookieRulesMessage(sender, message.payload);
            }
            case message_constants.M.SaveCookieLogEvent: {
                return this.handleSaveCookieLogEvent(sender, message.payload);
            }
            case message_constants.M.AssistantCreateRule: {
                return this.handleAssistantCreateRuleMessage(sender, message.payload);
            }
            case message_constants.M.SaveCssHitsStats: {
                return this.handleSaveCssHitsStats(sender, message.payload);
            }
        }
        return undefined;
    }
    /**
     * Handles should collapse element message.
     *
     * @param sender Tab, which sent message.
     * @param payload Message payload.
     *
     * @returns True if element should be collapsed.
     */
    handleProcessShouldCollapseMessage(sender, payload) {
        if (!payload || !sender?.tab?.id) {
            return false;
        }
        const res = common_configuration.u.safeParse(payload);
        if (!res.success) {
            return false;
        }
        const tabId = sender.tab.id;
        const { elementUrl, documentUrl, requestType } = res.data;
        return RequestBlockingApi.shouldCollapseElement(tabId, elementUrl, documentUrl, requestType);
    }
    /**
     * Handles get cosmetic message.
     *
     * @param sender Tab which sent message.
     * @param payload Message payload.
     *
     * @returns Content script data for applying cosmetic rules or null if no data.
     */
    handleGetCosmeticData(sender, payload) {
        common_logger.l.debug('[tswebextension.handleGetCosmeticData]: received call: ', payload);
        if (!payload || !sender?.tab?.id) {
            return null;
        }
        const res = common_configuration.v.safeParse(payload);
        if (!res.success) {
            common_logger.l.error('[tswebextension.handleGetCosmeticData]: cannot parse payload: ', payload, res.error);
            return null;
        }
        const tabId = sender.tab.id;
        let { frameId } = sender;
        if (!frameId) {
            frameId = constants.M;
        }
        return CosmeticApi.getContentScriptData(res.data.documentUrl, tabId, frameId);
    }
    /**
     * Handles messages.
     * Returns cookie rules data for content script.
     *
     * @param sender Tab, which sent message.
     * @param payload Message payload.
     *
     * @returns Cookie rules data.
     */
    handleGetCookieRulesMessage(sender, payload) {
        if (!payload || !sender?.tab?.id) {
            return [];
        }
        const res = common_configuration.w.safeParse(payload);
        if (!res.success) {
            return [];
        }
        const tabId = sender.tab.id;
        let { frameId } = sender;
        if (!frameId) {
            frameId = constants.M;
        }
        const cookieRules = cookieFiltering.getBlockingRules(res.data.documentUrl, tabId, frameId);
        return cookieRules.map((rule) => ({
            ruleIndex: rule.getIndex(),
            match: rule.getAdvancedModifierValue(),
            isThirdParty: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.ThirdParty),
            filterId: rule.getFilterListId(),
            isAllowlist: rule.isAllowlist(),
            isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
            isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
            isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
            isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
            advancedModifier: rule.getAdvancedModifierValue(),
        }));
    }
    /**
     * Calls filtering to add an event from cookie-controller content-script.
     *
     * @param sender Tab which sent the message.
     * @param payload Message payload.
     *
     * @returns True if event was published to filtering log.
     */
    handleSaveCookieLogEvent(sender, payload) {
        if (!payload || !sender?.tab?.id) {
            return false;
        }
        const res = common_configuration.x.safeParse(payload);
        if (!res.success) {
            return false;
        }
        const { data } = res;
        this.filteringLog.publishEvent({
            type: common_configuration.l.Cookie,
            data: {
                eventId: (0,non_secure/* nanoid */.A)(),
                tabId: sender.tab.id,
                cookieName: data.cookieName,
                frameDomain: data.cookieDomain,
                cookieValue: data.cookieValue,
                filterId: data.filterId,
                ruleIndex: data.ruleIndex,
                isModifyingCookieRule: false,
                requestThirdParty: data.thirdParty,
                timestamp: Date.now(),
                requestType: common_configuration.s.Cookie,
                // Additional rule properties
                isAllowlist: data.isAllowlist,
                isImportant: data.isImportant,
                isDocumentLevel: data.isDocumentLevel,
                isCsp: data.isCsp,
                isCookie: data.isCookie,
                advancedModifier: data.advancedModifier,
            },
        });
        return true;
    }
    /**
     * Handles message with new rule from assistant content script.
     *
     * @param sender Tab, which sent message.
     * @param payload Message payload.
     *
     * @returns True if rule was dispatched.
     */
    handleAssistantCreateRuleMessage(sender, payload) {
        if (!payload || !sender?.tab?.id) {
            return false;
        }
        const res = common_configuration.y.safeParse(payload);
        if (!res.success) {
            return false;
        }
        const { ruleText } = res.data;
        Assistant.onCreateRule.dispatch(ruleText);
        return true;
    }
    /**
     * Handle message about saving css hits stats.
     *
     * @param sender Tab, which sent message.
     * @param payload Message payload.
     *
     * @returns True if stats was saved.
     */
    handleSaveCssHitsStats(sender, 
    // TODO add payload type
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    payload) {
        if (!payload || !sender?.tab?.id) {
            return false;
        }
        const tabId = sender.tab.id;
        const tabContext = this.tabsApi.getTabContext(tabId);
        if (!tabContext?.info.url) {
            return false;
        }
        const { url } = tabContext.info;
        let published = false;
        for (let i = 0; i < payload.length; i += 1) {
            const stat = payload[i];
            this.filteringLog.publishEvent({
                type: common_configuration.l.ApplyCosmeticRule,
                data: {
                    tabId,
                    eventId: (0,non_secure/* nanoid */.A)(),
                    filterId: stat.filterId,
                    ruleIndex: stat.ruleIndex,
                    element: stat.element,
                    frameUrl: url,
                    frameDomain: (0,common_configuration.a)(url),
                    requestType: common_configuration.s.Document,
                    timestamp: Date.now(),
                    cssRule: true,
                    scriptRule: false,
                    contentRule: false,
                },
            });
            published = true;
        }
        return published;
    }
}

/**
 * Stealth service module.
 */
class StealthService {
    /**
     * Headers.
     */
    static HEADERS = {
        REFERRER: 'Referer',
        X_CLIENT_DATA: 'X-Client-Data',
        DO_NOT_TRACK: 'DNT',
    };
    /**
     * Header values.
     */
    static HEADER_VALUES = {
        DO_NOT_TRACK: {
            name: 'DNT',
            value: '1',
        },
        GLOBAL_PRIVACY_CONTROL: {
            name: 'Sec-GPC',
            value: '1',
        },
    };
    /**
     * Search engines regexps.
     */
    static SEARCH_ENGINES = [
        /https?:\/\/(www\.)?google\./i,
        /https?:\/\/(www\.)?yandex\./i,
        /https?:\/\/(www\.)?bing\./i,
        /https?:\/\/(www\.)?yahoo\./i,
        /https?:\/\/(www\.)?go\.mail\.ru/i,
        /https?:\/\/(www\.)?ask\.com/i,
        /https?:\/\/(www\.)?aol\.com/i,
        /https?:\/\/(www\.)?baidu\.com/i,
        /https?:\/\/(www\.)?seznam\.cz/i,
    ];
    /**
     * Filtering logger.
     */
    filteringLog;
    /**
     * App context.
     */
    appContext;
    /**
     * Configuration.
     *
     * @returns App Stealth configuration or undefined.
     */
    get config() {
        return this.appContext.configuration?.settings.stealth;
    }
    /**
     * Constructor.
     *
     * @param appContext App context.
     * @param filteringLog Filtering log.
     */
    constructor(appContext, filteringLog) {
        this.appContext = appContext;
        this.filteringLog = filteringLog;
    }
    /**
     * Returns synthetic set of rules matching the specified request.
     *
     * @returns Strings of cookie rules.
     */
    // TODO (David): Change to AST-based rule creation.
    getCookieRulesTexts() {
        const result = [];
        if (this.config?.selfDestructFirstPartyCookies) {
            result.push(StealthService.generateCookieRuleText(this.config.selfDestructFirstPartyCookiesTime));
        }
        if (this.config?.selfDestructThirdPartyCookies) {
            result.push(StealthService.generateCookieRuleText(this.config.selfDestructThirdPartyCookiesTime, true));
        }
        return result;
    }
    /**
     * Applies stealth actions to request headers.
     *
     * @param context Request context.
     *
     * @returns Stealth actions bitmask.
     */
    processRequestHeaders(context) {
        let stealthActions = common_configuration.S.None;
        if (!this.config) {
            return stealthActions;
        }
        const { requestUrl, requestHeaders, matchingResult, requestType, tabId, eventId, referrerUrl, contentType, timestamp, } = context;
        if (!requestHeaders || matchingResult?.documentRule) {
            return stealthActions;
        }
        /**
         * Regarding stealth rule modifier, stealth options can be disabled on two occasions:
         * - stealth modifier does not have specific values, thus disabling stealth entirely
         * - stealth modifier has specific options to disable.
         */
        const stealthDisablingRule = matchingResult?.getStealthRule();
        if (stealthDisablingRule) {
            // $stealth rule without options is not being published to the filtering log
            // to conform with desktop application behavior
            return stealthActions;
        }
        // Collect applied allowlist rules in a set to only publish
        // one filtering event per applied allowlist rule
        const appliedAllowlistRules = new Set();
        // Remove referrer for third-party requests
        if (this.config?.hideReferrer) {
            const disablingRule = matchingResult?.getStealthRule(es/* StealthOptionName */._L.HideReferrer);
            if (disablingRule) {
                appliedAllowlistRules.add(disablingRule);
            }
            else if (StealthService.removeReferrer(requestHeaders, requestUrl)) {
                stealthActions |= common_configuration.S.HideReferrer;
            }
        }
        // Hide referrer in case of search engine is referrer
        const isMainFrame = requestType === request_type/* RequestType */.Y.Document;
        if (isMainFrame && this.config?.hideSearchQueries) {
            const disablingRule = matchingResult?.getStealthRule(es/* StealthOptionName */._L.HideSearchQueries);
            if (disablingRule) {
                appliedAllowlistRules.add(disablingRule);
            }
            else if (StealthService.hideSearchQueries(requestHeaders, requestUrl)) {
                stealthActions |= common_configuration.S.HideSearchQueries;
            }
        }
        // Remove X-Client-Data header
        if (this.config?.blockChromeClientData) {
            const disablingRule = matchingResult?.getStealthRule(es/* StealthOptionName */._L.XClientData);
            if (disablingRule) {
                appliedAllowlistRules.add(disablingRule);
            }
            else if (StealthService.removeXClientData(requestHeaders)) {
                stealthActions |= common_configuration.S.BlockChromeClientData;
            }
        }
        // Adding Do-Not-Track (DNT) header
        if (this.config?.sendDoNotTrack) {
            const disablingRule = matchingResult?.getStealthRule(es/* StealthOptionName */._L.DoNotTrack);
            if (disablingRule) {
                appliedAllowlistRules.add(disablingRule);
            }
            else if (StealthService.sendDoNotTrack(requestHeaders)) {
                stealthActions |= common_configuration.S.SendDoNotTrack;
            }
        }
        if (appliedAllowlistRules.size > 0) {
            this.filteringLog.publishEvent({
                type: common_configuration.l.StealthAllowlistAction,
                data: {
                    tabId,
                    eventId,
                    rules: Array.from(appliedAllowlistRules).map((rule) => ({
                        filterId: rule.getFilterListId(),
                        ruleIndex: rule.getIndex(),
                        isAllowlist: rule.isAllowlist(),
                        isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                        isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                        isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                        isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                        advancedModifier: rule.getAdvancedModifierValue(),
                    })),
                    requestUrl,
                    frameUrl: referrerUrl,
                    requestType: contentType,
                    timestamp,
                },
            });
        }
        if (stealthActions > 0) {
            this.filteringLog.publishEvent({
                type: common_configuration.l.StealthAction,
                data: {
                    tabId,
                    eventId,
                    stealthActions,
                },
            });
        }
        return stealthActions;
    }
    /**
     * Removes referrer from request headers.
     *
     * @param requestHeaders Request headers.
     * @param requestUrl Request URL.
     *
     * @returns True if referrer was removed.
     */
    static removeReferrer(requestHeaders, requestUrl) {
        const refHeader = (0,common_configuration.q)(requestHeaders, StealthService.HEADERS.REFERRER);
        if (refHeader
            && refHeader.value
            && (0,common_configuration.o)(requestUrl, refHeader.value)) {
            refHeader.value = StealthService.createMockRefHeaderUrl(requestUrl);
            return true;
        }
        return false;
    }
    /**
     * Hides search queries from referrer.
     *
     * @param requestHeaders Request headers.
     * @param requestUrl Request URL.
     *
     * @returns True if search queries were hidden.
     */
    static hideSearchQueries(requestHeaders, requestUrl) {
        const refHeader = (0,common_configuration.q)(requestHeaders, StealthService.HEADERS.REFERRER);
        if (refHeader
            && refHeader.value
            && StealthService.isSearchEngine(refHeader.value)
            && (0,common_configuration.o)(requestUrl, refHeader.value)) {
            refHeader.value = StealthService.createMockRefHeaderUrl(requestUrl);
            return true;
        }
        return false;
    }
    /**
     * Removes X-Client-Data header.
     *
     * @param requestHeaders Request headers.
     *
     * @returns True if X-Client-Data header was removed.
     */
    static removeXClientData(requestHeaders) {
        return (0,common_configuration.z)(requestHeaders, StealthService.HEADERS.X_CLIENT_DATA);
    }
    /**
     * Adds Do-Not-Track (DNT) and Global Privacy Control (GPC) headers.
     *
     * @param requestHeaders Request headers.
     *
     * @returns True if DNT and GPC headers were added.
     */
    static sendDoNotTrack(requestHeaders) {
        requestHeaders.push(StealthService.HEADER_VALUES.DO_NOT_TRACK);
        requestHeaders.push(StealthService.HEADER_VALUES.GLOBAL_PRIVACY_CONTROL);
        return true;
    }
    /**
     * Returns set dom signal script if sendDoNotTrack enabled, otherwise empty string.
     *
     * @returns Dom signal script.
     */
    getSetDomSignalScript() {
        if (this.config?.sendDoNotTrack) {
            return `;(function ${StealthHelper.setDomSignal.toString()})();`;
        }
        return '';
    }
    /**
     * Returns hide document referrer script if hideReferrer enabled, otherwise empty string.
     *
     * @returns Hide referrer script.
     */
    getHideDocumentReferrerScript() {
        if (this.config?.hideReferrer) {
            return `;(function ${StealthHelper.hideDocumentReferrer.toString()})();`;
        }
        return '';
    }
    /**
     * Generates rule removing cookies.
     *
     * @param maxAgeMinutes Cookie maxAge in minutes.
     * @param isThirdParty Flag for generating third-party rule texts.
     *
     * @returns Rule text.
     */
    static generateCookieRuleText(maxAgeMinutes, isThirdParty = false) {
        const maxAgeOption = maxAgeMinutes > 0 ? `;maxAge=${maxAgeMinutes * 60}` : '';
        const thirdPartyOption = isThirdParty ? ',third-party' : '';
        const ruleText = `$cookie=/.+/${maxAgeOption}${thirdPartyOption}`;
        return ruleText;
    }
    /**
     * Crops url path.
     *
     * @param url URL.
     *
     * @returns URL without path.
     */
    static createMockRefHeaderUrl(url) {
        const host = (0,common_configuration.g)(url);
        return `${(url.indexOf('https') === 0 ? 'https://' : 'http://') + host}/`;
    }
    /**
     * Is url search engine.
     *
     * @param url Url for check.
     *
     * @returns True if url is search engine.
     */
    static isSearchEngine(url) {
        return StealthService.SEARCH_ENGINES.some((searchEngineRegex) => searchEngineRegex.test(url));
    }
}

/**
 * Stealth api implementation.
 */
class StealthApi {
    /**
     * Privacy permission for block webrtc stealth setting.
     */
    static PRIVACY_PERMISSIONS = {
        permissions: ['privacy'],
    };
    /**
     * Stealth service.
     */
    stealthService;
    /**
     * Filtering log.
     */
    filteringLog;
    /**
     * App context.
     */
    appContext;
    /**
     * Stealth configuration.
     *
     * @returns App Stealth configuration or undefined.
     */
    get configuration() {
        return this.appContext.configuration?.settings.stealth;
    }
    /**
     * Gets app stealth mode status.
     *
     * @returns True if stealth mode is enabled, otherwise returns false.
     */
    get isStealthModeEnabled() {
        return Boolean(this.appContext.configuration?.settings.stealthModeEnabled);
    }
    /**
     * Gets app filtering status.
     *
     * TODO: This method is duplicated in {@link EngineApi}. Consider moving it to {@link appContext}
     *  itself (DRY). But appContext supposed to be deleted (v.zhelvis).
     *
     * @returns True if filtering is enabled, otherwise returns false.
     */
    get isFilteringEnabled() {
        return Boolean(this.appContext.configuration?.settings.filteringEnabled);
    }
    /**
     * Checks if both stealth mode and filtering are enabled.
     *
     * @returns True if stealth mode and filtering are enabled.
     */
    get isStealthAllowed() {
        return this.isStealthModeEnabled && this.isFilteringEnabled;
    }
    /**
     * Stealth API constructor.
     *
     * @param appContextInstance App context.
     * @param filteringLog Filtering log.
     */
    constructor(appContextInstance, filteringLog) {
        this.appContext = appContextInstance;
        this.filteringLog = filteringLog;
        this.stealthService = new StealthService(this.appContext, this.filteringLog);
    }
    /**
     * Requires privacy permissions and updates browser privacy.network
     * settings depending on blocking WebRTC or not.
     */
    async updateWebRtcPrivacyPermissions() {
        if (!StealthApi.canBlockWebRTC()) {
            return;
        }
        try {
            const isPermissionsGranted = await browser_polyfill.permissions.contains(StealthApi.PRIVACY_PERMISSIONS);
            if (isPermissionsGranted) {
                await this.handleBlockWebRTC();
            }
        }
        catch (e) {
            common_logger.l.error((0,common_configuration.G)(e));
        }
    }
    /**
     * Returns rule list with stealth mode rules.
     *
     * @returns String rule list or null.
     */
    getStealthModeRuleList() {
        if (!this.isStealthAllowed) {
            return null;
        }
        // TODO (David): Change to AST generation
        const rulesTexts = this.stealthService.getCookieRulesTexts().join('\n');
        return new es/* BufferRuleList */.zV(es/* STEALTH_MODE_FILTER_ID */.IE, es/* FilterListPreprocessor */.aQ.preprocess(rulesTexts).filterList, false, false);
    }
    /**
     * Stealth api onBeforeRequest handler.
     *
     * @param context Request context.
     *
     * @returns True if the headers have been changed.
     */
    onBeforeSendHeaders(context) {
        if (!context) {
            return false;
        }
        if (!this.isStealthAllowed) {
            return false;
        }
        const stealthActions = this.stealthService.processRequestHeaders(context);
        return stealthActions !== common_configuration.S.None;
    }
    /**
     * Returns stealth script to apply to the frame.
     *
     * TODO this should be expanded for v2.3 to accommodate for $stealth values feature,
     * i.e checking specific stealth options (dnt and referrer)
     * https://github.com/AdguardTeam/tsurlfilter/issues/100.
     *
     * @param mainFrameRule Main frame rule to use if no matching result provided.
     * @param matchingResult Matching result.
     *
     * @returns Stealth script.
     */
    getStealthScript(mainFrameRule, matchingResult) {
        if (!this.isStealthAllowed) {
            return '';
        }
        let documentRule = null;
        // Matching result may be missing in case of dynamically created frames without url
        if (matchingResult) {
            documentRule = matchingResult.documentRule || matchingResult.getStealthRule();
        }
        else {
            documentRule = mainFrameRule;
        }
        if (documentRule) {
            return '';
        }
        let stealthScript = '';
        if (!matchingResult?.getStealthRule(es/* StealthOptionName */._L.DoNotTrack)) {
            stealthScript += this.getSetDomSignalScript();
        }
        if (!matchingResult?.getStealthRule(es/* StealthOptionName */._L.HideReferrer)) {
            stealthScript += this.getHideDocumentReferrerScript();
        }
        return stealthScript;
    }
    /**
     * Returns set dom signal script if sendDoNotTrack enabled, otherwise empty string.
     *
     * @returns Dom signal script.
     */
    getSetDomSignalScript() {
        return this.isStealthAllowed
            ? this.stealthService.getSetDomSignalScript()
            : '';
    }
    /**
     * Returns hide document referrer script if hideDocumentReferrer enabled, otherwise empty string.
     *
     * @returns Hide referrer script.
     */
    getHideDocumentReferrerScript() {
        return this.isStealthAllowed
            ? this.stealthService.getHideDocumentReferrerScript()
            : '';
    }
    /**
     * Updates browser privacy.network settings depending on blocking WebRTC or not.
     */
    async handleBlockWebRTC() {
        if (!this.configuration) {
            return;
        }
        const isWebRTCDisabled = this.configuration.blockWebRTC && this.isStealthAllowed;
        try {
            if (isWebRTCDisabled) {
                await browser_polyfill.privacy.network.webRTCIPHandlingPolicy.set({
                    value: 'disable_non_proxied_udp',
                    scope: 'regular',
                });
            }
            else {
                await browser_polyfill.privacy.network.webRTCIPHandlingPolicy.clear({
                    scope: 'regular',
                });
            }
        }
        catch (e) {
            common_logger.l.error(`Error updating privacy.network settings: ${(0,common_configuration.G)(e)}`);
        }
        // privacy.network.peerConnectionEnabled is currently only supported in Firefox
        if (typeof browser_polyfill.privacy.network.peerConnectionEnabled === 'object') {
            try {
                if (isWebRTCDisabled) {
                    await browser_polyfill.privacy.network.peerConnectionEnabled.set({
                        value: false,
                        scope: 'regular',
                    });
                }
                else {
                    await browser_polyfill.privacy.network.peerConnectionEnabled.clear({
                        scope: 'regular',
                    });
                }
            }
            catch (e) {
                common_logger.l.error(`Error updating privacy.network settings: ${(0,common_configuration.G)(e)}`);
            }
        }
    }
    /**
     * // TODO consider deprecating this method as edge browser is built on chromium now.
     * Checks if there is browser.privacy permission is granted.
     *
     * @returns True if there is browser.privacy permission.
     */
    static canBlockWebRTC() {
        // Edge doesn't support privacy api
        // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/privacy
        return !!browser_polyfill.privacy;
    }
}
const stealthApi = new StealthApi(appContext, common_configuration.d);

/**
 * Cosmetic frame processor.
 *
 * Needed to properly handle cosmetic rules for frames, especially for 'about:blank' frames.
 */
class CosmeticFrameProcessor {
    engineApi;
    tabsApi;
    /**
     * Time threshold to consider two events as part of the same frame.
     * The value is chosen experimentally; in most cases, 100 ms is sufficient to consider the onBeforeNavigate
     * and onBeforeRequest events as related to the same frame. It is also small enough to ignore manual page
     * reloads by the user.
     */
    static SAME_FRAME_THRESHOLD_MS = 100;
    /**
     * Initializes a new instance of the {@link CosmeticFrameProcessor} class.
     *
     * @param engineApi Engine API instance.
     * @param tabsApi Tabs API instance.
     */
    constructor(engineApi, tabsApi) {
        this.engineApi = engineApi;
        this.tabsApi = tabsApi;
    }
    /**
     * Check if recalculation should be skipped.
     * If the time passed between two events is less than the threshold,
     * we consider it part of the same frame and do not recalculate.
     * Additionally, we check if the URL has changed.
     *
     * @param tabId Tab id.
     * @param frameId Frame id.
     * @param url Url.
     * @param timeStamp Event timestamp.
     *
     * @returns True if recalculation should be skipped.
     */
    shouldSkipRecalculation(tabId, frameId, url, timeStamp) {
        const frameContext = this.tabsApi.getFrameContext(tabId, frameId);
        if (!frameContext) {
            return false;
        }
        // do not skip recalculation if the URL has changed
        if (frameContext.url !== url) {
            return false;
        }
        const timeDiff = Math.abs(frameContext.timeStamp - timeStamp);
        return timeDiff < CosmeticFrameProcessor.SAME_FRAME_THRESHOLD_MS;
    }
    /**
     * Handle sub frame without url.
     *
     * @param props Handle sub frame without url props.
     */
    handleSubFrameWithoutUrl(props) {
        const { tabId, frameId, mainFrameUrl, parentDocumentId, } = props;
        let parentFrame;
        let tempParentDocumentId = parentDocumentId;
        while (tempParentDocumentId) {
            parentFrame = this.tabsApi.getByDocumentId(tabId, tempParentDocumentId);
            tempParentDocumentId = parentFrame?.parentDocumentId;
            if ((0,common_configuration.i)(parentFrame?.url)) {
                break;
            }
        }
        if (parentFrame) {
            this.tabsApi.updateFrameContext(tabId, frameId, {
                preparedCosmeticResult: parentFrame.preparedCosmeticResult,
                mainFrameUrl,
            });
        }
    }
    /**
     * Handle sub frame with url.
     *
     * @param props Handle sub frame with url props.
     */
    handleSubFrameWithUrl(props) {
        const { url, tabId, frameId, mainFrameUrl, mainFrameRule, } = props;
        const result = this.engineApi.matchRequest({
            requestUrl: url,
            frameUrl: mainFrameUrl || url,
            requestType: request_type/* RequestType */.Y.SubDocument,
            frameRule: mainFrameRule,
        });
        if (!result) {
            return;
        }
        const cosmeticResult = this.engineApi.getCosmeticResult(url, result.getCosmeticOption());
        const { configuration } = appContext;
        const areHitsStatsCollected = configuration?.settings.collectStats || false;
        const cssText = CosmeticApi.getCssText(cosmeticResult, areHitsStatsCollected);
        const { scriptText } = CosmeticApi.getScriptsAndScriptletsData(cosmeticResult, url);
        const stealthScriptText = stealthApi.getStealthScript(mainFrameRule, result);
        let combinedScriptText = '';
        if (stealthScriptText.length > 0) {
            combinedScriptText += `${stealthScriptText}${constants.L}`;
        }
        combinedScriptText += scriptText;
        this.tabsApi.updateFrameContext(tabId, frameId, {
            mainFrameUrl,
            matchingResult: result,
            cosmeticResult,
            preparedCosmeticResult: {
                scriptText: combinedScriptText,
                cssText,
            },
        });
    }
    /**
     * Handle main frame.
     *
     * @param props Handle main frame props.
     */
    handleMainFrame(props) {
        const { url, tabId, frameId, } = props;
        if (!(0,common_configuration.i)(url)) {
            return;
        }
        this.tabsApi.resetBlockedRequestsCount(tabId);
        const mainFrameRule = documentApi.matchFrame(url);
        this.tabsApi.setMainFrameRule(tabId, frameId, mainFrameRule);
        const result = this.engineApi.matchRequest({
            requestUrl: url,
            frameUrl: url,
            requestType: request_type/* RequestType */.Y.Document,
            frameRule: mainFrameRule,
        });
        if (!result) {
            return;
        }
        const cosmeticResult = this.engineApi.getCosmeticResult(url, result.getCosmeticOption());
        const { configuration } = appContext;
        const areHitsStatsCollected = configuration?.settings.collectStats || false;
        const cssText = CosmeticApi.getCssText(cosmeticResult, areHitsStatsCollected);
        const { scriptText } = CosmeticApi.getScriptsAndScriptletsData(cosmeticResult, url);
        const stealthScriptText = stealthApi.getStealthScript(mainFrameRule, result);
        let combinedScriptText = '';
        if (stealthScriptText.length > 0) {
            combinedScriptText += `${stealthScriptText}${constants.L}`;
        }
        combinedScriptText += scriptText;
        this.tabsApi.updateFrameContext(tabId, frameId, {
            matchingResult: result,
            cosmeticResult,
            preparedCosmeticResult: {
                scriptText: combinedScriptText,
                cssText,
            },
        });
    }
    /**
     * Handles frames used here and in the {@link TabsCosmeticInjector}.
     *
     * @param props Precalculate cosmetic props.
     */
    handleFrame(props) {
        const { tabId, frameId, url, parentDocumentId, documentLifecycle, } = props;
        // Prerender main frame request can have other that 0 id.
        const isMainFrame = (!parentDocumentId && documentLifecycle === common_configuration.D.Prerender)
            || frameId === constants.M;
        if (isMainFrame) {
            this.handleMainFrame({
                url,
                tabId,
                frameId,
            });
        }
        else {
            const mainFrame = this.tabsApi.getFrameContext(tabId, constants.M);
            const mainFrameRule = mainFrame?.frameRule;
            const mainFrameUrl = mainFrame?.url;
            if (!(0,common_configuration.i)(url)) {
                this.handleSubFrameWithoutUrl({
                    tabId,
                    frameId,
                    mainFrameUrl,
                    parentDocumentId,
                });
            }
            else {
                this.handleSubFrameWithUrl({
                    url,
                    tabId,
                    frameId,
                    mainFrameUrl,
                    mainFrameRule,
                });
            }
        }
    }
    /**
     * Precalculate cosmetic rules for the request.
     *
     * This method used in the webNavigation.onBeforeNavigate event and webRequest.onBeforeRequest event —
     * as sooner as possible to calculate cosmetic rules for the request,
     * so after that they can be applied on further events without additional calculations.
     *
     * @param props Precalculate cosmetic props.
     */
    precalculateCosmetics(props) {
        const { tabId, frameId, parentFrameId, url, timeStamp, parentDocumentId, documentId, } = props;
        if (this.shouldSkipRecalculation(tabId, frameId, url, timeStamp)) {
            return;
        }
        // Set in the beginning to let other events know that cosmetic result
        // will be calculated in this event to avoid double calculation.
        this.tabsApi.setFrameContext(tabId, frameId, new FrameMV2({
            tabId,
            frameId,
            parentFrameId,
            url,
            timeStamp,
            documentId,
            parentDocumentId,
        }));
        this.handleFrame(props);
    }
}

/**
 * Injects cosmetic rules into tabs, opened before app initialization.
 */
class TabsCosmeticInjector {
    documentApi;
    tabsApi;
    cosmeticFrameProcessor;
    /**
     * Create instance of TabsCosmeticInjector.
     *
     * @param documentApi Document API.
     * @param tabsApi Tabs API.
     * @param engineApi Engine API.
     */
    constructor(documentApi, tabsApi, engineApi) {
        this.documentApi = documentApi;
        this.tabsApi = tabsApi;
        this.cosmeticFrameProcessor = new CosmeticFrameProcessor(engineApi, tabsApi);
    }
    /**
     * Creates contexts for tabs opened before api initialization and
     * applies cosmetic rules for each frame.
     */
    async processOpenTabs() {
        const currentTabs = await browser.tabs.query({});
        const tasks = currentTabs.map((tab) => this.processOpenTab(tab));
        const promises = await Promise.allSettled(tasks);
        // Handles errors
        promises.forEach((promise) => {
            if (promise.status === 'rejected') {
                logger.error(promise.reason);
            }
        });
        appContext.cosmeticsInjectedOnStartup = true;
    }
    /**
     * Creates context for tab opened before api initialization and
     * applies cosmetic rules for each frame.
     *
     * @param tab Tab details.
     */
    async processOpenTab(tab) {
        if (!TabContext.isBrowserTab(tab)) {
            return;
        }
        const tabContext = TabContext.createNewTabContext(tab, this.documentApi);
        const tabId = tab.id;
        this.tabsApi.context.set(tabId, tabContext);
        this.tabsApi.updateTabMainFrameRule(tabId);
        const frames = await browser.webNavigation.getAllFrames({ tabId });
        if (!frames) {
            return;
        }
        const currentTime = Date.now();
        frames.forEach((frameDetails) => {
            const { url, frameId, parentFrameId, 
            // both parentDocumentId and documentId supported by Chrome 106+
            // but not supported by Firefox so it is calculated based on tabId and frameId
            // @ts-ignore
            parentDocumentId, 
            // @ts-ignore
            documentId, } = frameDetails;
            /**
             * Use parentDocumentId if it is defined, otherwise:
             * - if parent frame is a document-level frame, use undefined
             * - else generate parentDocumentId based on tabId and parentFrameId.
             */
            const calculatedParentDocumentId = parentDocumentId
                || (TabsApi.isDocumentLevelFrame(parentFrameId)
                    ? undefined
                    : TabsApi.generateId(tabId, parentFrameId));
            const calculatedDocumentId = documentId || TabsApi.generateId(tabId, frameId);
            this.tabsApi.setFrameContext(tabId, frameId, new FrameMV2({
                tabId,
                frameId,
                parentFrameId,
                url,
                timeStamp: currentTime,
                parentDocumentId: calculatedParentDocumentId,
                documentId: calculatedDocumentId,
            }));
            this.cosmeticFrameProcessor.handleFrame({
                tabId,
                frameId,
                parentFrameId,
                url,
                timeStamp: currentTime,
                parentDocumentId: calculatedParentDocumentId,
                documentId: calculatedDocumentId,
            });
            // TODO: Instead of this, it’s better to use the runtime.onStartup and runtime.onInstalled
            // events to inject cosmetics once during the extension's initialization
            // and browser startup without flags.
            // However, this would require big refactoring of the extension.
            /**
             * This condition prevents applying cosmetic rules to the tab multiple times.
             * Applying them once after the extension's initialization is enough.
             */
            if (appContext.cosmeticsInjectedOnStartup) {
                return;
            }
            CosmeticApi.applyJsByTabAndFrame(tabId, frameId);
            CosmeticApi.applyCssByTabAndFrame(tabId, frameId);
            const frameContext = this.tabsApi.getFrameContext(tabId, frameId);
            if (!frameContext?.cosmeticResult) {
                // eslint-disable-next-line max-len
                logger.debug(`[tswebextension.processOpenTab]: cannot log script rules due to not having cosmetic result for tabId: ${tabId}, frameId: ${frameId}.`);
                return;
            }
            const isMainFrame = frameId === MAIN_FRAME_ID;
            CosmeticApi.logScriptRules({
                url,
                tabId,
                cosmeticResult: frameContext.cosmeticResult,
                timestamp: currentTime,
                contentType: isMainFrame
                    ? ContentType.Document
                    : ContentType.Subdocument,
            });
        });
    }
}

/**
 * Filter list configuration validator for MV2.
 */
const filterMV2Validator = common_configuration.H.extend({
    /**
     * Filter identifier.
     */
    filterId: lib/* number */.ai(),
    /**
     * Filter trusted flag. If true, js rules from list can be executed.
     */
    trusted: lib/* boolean */.zM(),
});
/**
 * Configuration validator for MV2.
 */
const configurationMV2Validator = common_configuration.I.extend({
    /**
     * List of domain names of sites, which should be temporary excluded from document blocking.
     */
    trustedDomains: lib/* string */.Yj().array(),
    filters: filterMV2Validator.array(),
});

/**
 * Handles HTML entities.
 * This is a workaround for the following issue:
 * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2249
 * website was broken because win-1251 charset doesn't support some entities, e.g., ❤,
 * which initially in the html string was &#10084 and after parsing became ❤.
 */
class EntityHandler {
    /**
     * Escapes specific entities in an HTML string.
     *
     * @param html String to escape.
     *
     * @returns Escaped string.
     */
    static escapeEntities(html) {
        return html.replace(/&#x([A-Fa-f0-9]{4});/g, '&amp;#x$1;');
    }
    /**
     * Reverts escaped entities back to their original form.
     *
     * @param html String to revert.
     *
     * @returns Reverted string.
     */
    static revertEntities(html) {
        return html.replace(/&amp;#x([A-Fa-f0-9]{4});/g, '&#x$1;');
    }
}

/**
 * Document parser wrapper.
 */
class DocumentParser {
    parser;
    parsererrorNS;
    /**
     * Constructor.
     */
    constructor() {
        // eslint-disable-next-line no-undef
        this.parser = new DOMParser();
        const errorneousParse = this.parser.parseFromString('<', 'text/xml');
        this.parsererrorNS = errorneousParse.getElementsByTagName('parsererror')[0].namespaceURI;
    }
    /**
     * Checks for parse errors.
     * {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Error_handling}.
     *
     * @param parsedDocument Parsed document.
     *
     * @returns True if document cannot be parsed.
     */
    isParseError(parsedDocument) {
        if (this.parsererrorNS === 'http://www.w3.org/1999/xhtml') {
            return parsedDocument.getElementsByTagName('parsererror').length > 0;
        }
        return parsedDocument.getElementsByTagNameNS(this.parsererrorNS, 'parsererror').length > 0;
    }
    /**
     * Parse html to document.
     *
     * @param html HTML content.
     *
     * @returns Document or null if parse error occurred.
     */
    parse(html) {
        const doc = this.parser.parseFromString(EntityHandler.escapeEntities(html), 'text/html');
        if (this.isParseError(doc)) {
            return null;
        }
        return doc;
    }
}
const documentParser = new DocumentParser();

/**
 * Html rule wildcard.
 */
class Wildcard {
    regexp;
    shortcut;
    /**
     * Constructor.
     *
     * @param pattern Wildcard pattern.
     */
    constructor(pattern) {
        this.regexp = new RegExp(Wildcard.wildcardToRegex(pattern), 'i');
        this.shortcut = Wildcard.extractShortcut(pattern);
    }
    /**
     * Returns 'true' if input text is matching wildcard.
     * This method first checking shortcut -- if shortcut exists in input string -- than it checks regexp.
     *
     * @param input Input string.
     *
     * @returns Boolean if input string matches wildcard.
     */
    matches(input) {
        if (!input) {
            return false;
        }
        if (input.toLowerCase().indexOf(this.shortcut) < 0) {
            return false;
        }
        return this.regexp.test(input);
    }
    /**
     * Converts wildcard to regular expression.
     *
     * @param pattern The wildcard pattern to convert.
     *
     * @returns A regex equivalent of the given wildcard.
     */
    static wildcardToRegex(pattern) {
        const specials = [
            '\\', '*', '+', '?', '|', '{', '}', '[', ']', '(', ')', '^', '$', '.', '#',
        ];
        const specialsRegex = new RegExp(`[${specials.join('\\')}]`, 'g');
        let result = pattern.replace(specialsRegex, '\\$&');
        result = (0,simple_regex_Dw3J24Ss.r)(result, '\\*', '[\\s\\S]*');
        result = (0,simple_regex_Dw3J24Ss.r)(result, '\\?', '.');
        return `^${result}$`;
    }
    /**
     * Extracts the longest string that does not contain "*" or "?" symbols.
     *
     * @param pattern Wildcard pattern.
     *
     * @returns Longest string without special symbols.
     */
    static extractShortcut(pattern) {
        const wildcardChars = ['*', '?'];
        let startIndex = 0;
        let endIndex = (0,simple_regex_Dw3J24Ss.k)(pattern, wildcardChars);
        if (endIndex < 0) {
            return pattern.toLowerCase();
        }
        let shortcut = endIndex === startIndex ? '' : pattern.substring(startIndex, endIndex - startIndex);
        while (endIndex >= 0) {
            startIndex = startIndex + endIndex + 1;
            if (pattern.length <= startIndex) {
                break;
            }
            endIndex = (0,simple_regex_Dw3J24Ss.k)(pattern.substring(startIndex), wildcardChars);
            // eslint-disable-next-line max-len
            const tmpShortcut = endIndex < 0 ? pattern.substring(startIndex) : pattern.substring(startIndex, endIndex + startIndex);
            if (tmpShortcut.length > shortcut.length) {
                shortcut = tmpShortcut;
            }
        }
        return shortcut.toLowerCase();
    }
}

/**
 * Html rule attributes.
 *
 * @example
 * rule = [domains] "$$" tagName [attributes]
 * domains = [domain0, domain1[, ...[, domainN]]]
 * attributes = "[" name0 = value0 "]" "[" name1 = value2 "]" ... "[" nameN = valueN "]"
 *
 * https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#html-filtering-rules-syntax-1
 */
class HtmlRuleAttributes {
    /**
     * Tag name attribute.
     */
    tagName;
    /**
     * Composed selector.
     * Parsed [attributes] excepting special attributes are joined here to be a valid css selector string.
     * Example:
     * For "example.org$$div[id="ad_text"][tag-content="teas""ernet"]" rule, css selector will be "div[id*="ad_text"]".
     */
    selector;
    /**
     * Parent search level attribute.
     */
    parentSearchLevel;
    /**
     * Max length attribute
     * Specifies the maximum length for content of HTML element.
     * If this parameter is set and the content length exceeds the value - a rule does not apply to the element.
     */
    maxLength;
    /**
     * This is the most frequently used special attribute.
     * It limits selection with those elements whose innerHTML code contains the specified substring.
     */
    tagContentFilter;
    /**
     * This special attribute works almost like tag-content and allows you to check the innerHTML code of the document.
     * Rule will check if HTML code of the element fits to the search pattern.
     */
    wildcard;
    /**
     * Specifies the minimum length for content of HTML element.
     * If this parameter is set and the content length is less than preset value - a rule does not apply to the element.
     */
    minLength;
    /**
     * Parent elements attributes.
     */
    parentElements;
}

/**
 * Encapsulates html rule attributes parsing.
 */
class HtmlRuleParser {
    static ATTRIBUTE_START_MARK = '[';
    static ATTRIBUTE_END_MARK = ']';
    static QUOTES = '"';
    static TAG_CONTENT_MASK = 'tag-content';
    static WILDCARD_MASK = 'wildcard';
    static TAG_CONTENT_MAX_LENGTH = 'max-length';
    static TAG_CONTENT_MIN_LENGTH = 'min-length';
    static PARENT_ELEMENTS = 'parent-elements';
    static PARENT_SEARCH_LEVEL = 'parent-search-level';
    static DEFAULT_PARENT_SEARCH_LEVEL = 3;
    static DEFAULT_MAX_LENGTH = 8192;
    /**
     * Parses html rule.
     *
     * @param rule Rule to parse.
     *
     * @returns Parsed rule attributes.
     */
    static parse(rule) {
        const result = new HtmlRuleAttributes();
        result.parentSearchLevel = HtmlRuleParser.DEFAULT_PARENT_SEARCH_LEVEL;
        result.maxLength = HtmlRuleParser.DEFAULT_MAX_LENGTH;
        const ruleContent = rule.getContent();
        let htmlAttributesStartIndex = ruleContent.indexOf(HtmlRuleParser.ATTRIBUTE_START_MARK);
        // Cutting tag name from string
        if (htmlAttributesStartIndex === -1) {
            result.tagName = ruleContent;
        }
        else {
            result.tagName = ruleContent.substring(0, htmlAttributesStartIndex);
        }
        const selector = [result.tagName];
        // Loading attributes filter
        while (htmlAttributesStartIndex !== -1) {
            const equalityIndex = ruleContent.indexOf('=', htmlAttributesStartIndex + 1);
            const quoteStartIndex = ruleContent.indexOf(HtmlRuleParser.QUOTES, equalityIndex + 1);
            const quoteEndIndex = HtmlRuleParser.getClosingQuoteIndex(ruleContent, quoteStartIndex + 1);
            if (quoteStartIndex === -1 || quoteEndIndex === -1) {
                break;
            }
            const ruleEndIndex = ruleContent.indexOf(HtmlRuleParser.ATTRIBUTE_END_MARK, quoteEndIndex + 1);
            const attributeName = ruleContent.substring(htmlAttributesStartIndex + 1, equalityIndex);
            let attributeValue = ruleContent.substring(quoteStartIndex + 1, quoteEndIndex);
            attributeValue = (0,simple_regex_Dw3J24Ss.r)(attributeValue, '""', '"');
            switch (attributeName) {
                case HtmlRuleParser.TAG_CONTENT_MASK:
                    result.tagContentFilter = attributeValue;
                    break;
                case HtmlRuleParser.WILDCARD_MASK:
                    result.wildcard = new Wildcard(attributeValue);
                    break;
                case HtmlRuleParser.TAG_CONTENT_MAX_LENGTH:
                    result.maxLength = parseInt(attributeValue, 10);
                    break;
                case HtmlRuleParser.TAG_CONTENT_MIN_LENGTH:
                    result.minLength = parseInt(attributeValue, 10);
                    break;
                case HtmlRuleParser.PARENT_ELEMENTS:
                    result.parentElements = attributeValue.split(',');
                    break;
                case HtmlRuleParser.PARENT_SEARCH_LEVEL:
                    result.parentSearchLevel = parseInt(attributeValue, 10);
                    break;
                default:
                    selector.push('[');
                    selector.push(attributeName);
                    selector.push('*="');
                    selector.push(attributeValue);
                    selector.push('"]');
                    break;
            }
            if (ruleEndIndex === -1) {
                break;
            }
            htmlAttributesStartIndex = ruleContent.indexOf(HtmlRuleParser.ATTRIBUTE_START_MARK, ruleEndIndex + 1);
        }
        result.selector = selector.join('');
        // Validates selector immediately
        // eslint-disable-next-line no-undef
        if (typeof window !== 'undefined') {
            window.document.querySelectorAll(result.selector);
        }
        return result;
    }
    /**
     * Looks up next closing quotation starting from start index.
     * Skips double quotes in text like:
     *  [tag-content="teas""ernet"].
     *
     * @param text Text to search.
     * @param startIndex Start index.
     *
     * @returns Index of closing double quotation `"` found, or `-1` if not found.
     */
    static getClosingQuoteIndex(text, startIndex) {
        let nextChar = HtmlRuleParser.QUOTES;
        let quoteIndex = startIndex - 2;
        while (nextChar === '"') {
            quoteIndex = text.indexOf(HtmlRuleParser.QUOTES, quoteIndex + 2);
            if (quoteIndex === -1) {
                return -1;
            }
            nextChar = text.length === (quoteIndex + 1) ? '0' : text.charAt(quoteIndex + 1);
        }
        return quoteIndex;
    }
}

/**
 * Encapsulates document element matching.
 */
class HtmlRuleSelector {
    /**
     * Html Rule parse result.
     */
    ruleAttributes;
    /**
     * Constructor.
     *
     * @param parsedHtmlRule Html rule attributes.
     */
    constructor(parsedHtmlRule) {
        this.ruleAttributes = parsedHtmlRule;
    }
    /**
     * Returns elements matched by provided html rule.
     *
     * @param doc Document object.
     *
     * @returns Array of elements or null.
     */
    getMatchedElements(doc) {
        const elements = doc.querySelectorAll(this.ruleAttributes.selector);
        let result = null;
        for (let i = 0; i < elements.length; i += 1) {
            const element = elements[i];
            let elementToDelete = null;
            if (this.isFiltered(element)) {
                if (this.ruleAttributes.parentElements) {
                    const parentElement = this.searchForParentElement(element);
                    if (parentElement) {
                        elementToDelete = parentElement;
                    }
                }
                else {
                    elementToDelete = element;
                }
                if (elementToDelete) {
                    if (result === null) {
                        result = [];
                    }
                    result.push(elementToDelete);
                }
            }
        }
        return result;
    }
    /**
     * Checks if element is filtered by provided rule.
     *
     * @param element Element to check.
     *
     * @returns True if element is filtered.
     */
    isFiltered(element) {
        // Checking tag content length limits
        const content = element.innerHTML || '';
        if (this.ruleAttributes.maxLength && this.ruleAttributes.maxLength > 0) {
            // If max-length is set - checking content length (it should be lesser than max length)
            if (content.length > this.ruleAttributes.maxLength) {
                return false;
            }
        }
        if (this.ruleAttributes.minLength && this.ruleAttributes.minLength > 0) {
            // If min-length is set - checking content length (it should be greater than min length)
            if (content.length < this.ruleAttributes.minLength) {
                return false;
            }
        }
        if (!this.ruleAttributes.tagContentFilter && !this.ruleAttributes.wildcard) {
            // Rule does not depend on content
            return true;
        }
        if (!content) {
            return false;
        }
        // Checking tag content against filter
        if (this.ruleAttributes.tagContentFilter && content.indexOf(this.ruleAttributes.tagContentFilter) < 0) {
            return false;
        }
        // Checking tag content against the wildcard
        if (this.ruleAttributes.wildcard && !this.ruleAttributes.wildcard.matches(content)) {
            return false;
        }
        // All filters are passed, tag is filtered
        return true;
    }
    /**
     * Searches for parent element.
     * Suitable parent elements are set by 'parent-elements' attribute.
     * If suitable element found - returns it. Otherwise - returns null.
     *
     * @param element Element evaluated against this rule.
     *
     * @returns Parent element.
     */
    searchForParentElement(element) {
        let parentElement = element.parentNode;
        for (let i = 0; i < this.ruleAttributes.parentSearchLevel; i += 1) {
            if (!parentElement) {
                return null;
            }
            if (this.ruleAttributes.parentElements.indexOf(parentElement.tagName.toLowerCase()) > 0) {
                return parentElement;
            }
            parentElement = parentElement.parentNode;
        }
        return null;
    }
}

/**
 * Content string filter.
 */
class ContentStringFilter {
    context;
    htmlRules;
    replaceRules;
    filteringLog;
    /**
     * Creates an instance of ContentStringFilter.
     *
     * @param context Request context.
     * @param htmlRules Html rules.
     * @param replaceRules Replace rules.
     * @param filteringLog Filtering log.
     */
    constructor(context, htmlRules, replaceRules, filteringLog) {
        this.context = context;
        this.htmlRules = htmlRules;
        this.replaceRules = replaceRules;
        this.filteringLog = filteringLog;
    }
    /**
     * Applies Html and Replace rules to content string.
     *
     * @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#html-filtering-rules}
     * @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#replace-modifier}
     *
     * @param content Content string.
     *
     * @returns Modified content string.
     */
    applyRules(content) {
        if (this.htmlRules && this.htmlRules.length > 0) {
            content = this.applyHtmlRules(content);
        }
        if (this.replaceRules
            && this.replaceRules.length > 0
            // response content is over 3MB, ignore it
            && content.length <= 3 * 1024 * 1024) {
            content = this.applyReplaceRules(content);
        }
        return content;
    }
    /**
     * Applies Html rules to content string.
     *
     * @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#html-filtering-rules}
     *
     * @param content Content string.
     *
     * @returns Modified content string.
     */
    applyHtmlRules(content) {
        const doc = documentParser.parse(content);
        if (!doc) {
            return content;
        }
        const deleted = [];
        for (let i = 0; i < this.htmlRules.length; i += 1) {
            const rule = this.htmlRules[i];
            const parsed = HtmlRuleParser.parse(rule);
            const elements = new HtmlRuleSelector(parsed).getMatchedElements(doc);
            if (elements) {
                for (let j = 0; j < elements.length; j += 1) {
                    const element = elements[j];
                    if (element.parentNode && deleted.indexOf(element) < 0) {
                        element.parentNode.removeChild(element);
                        const { tabId, requestUrl, timestamp, contentType, } = this.context;
                        const ruleType = rule.getType();
                        this.filteringLog.publishEvent({
                            type: common_configuration.l.ApplyCosmeticRule,
                            data: {
                                tabId,
                                eventId: (0,non_secure/* nanoid */.A)(),
                                element: element.innerHTML,
                                frameUrl: requestUrl,
                                filterId: rule.getFilterListId(),
                                ruleIndex: rule.getIndex(),
                                frameDomain: (0,common_configuration.a)(requestUrl),
                                requestType: contentType,
                                timestamp,
                                cssRule: ruleType === nodes/* CosmeticRuleType */.k9.ElementHidingRule
                                    || ruleType === nodes/* CosmeticRuleType */.k9.CssInjectionRule,
                                scriptRule: ruleType === nodes/* CosmeticRuleType */.k9.ScriptletInjectionRule
                                    || ruleType === nodes/* CosmeticRuleType */.k9.JsInjectionRule,
                                contentRule: ruleType === nodes/* CosmeticRuleType */.k9.HtmlFilteringRule,
                            },
                        });
                        deleted.push(element);
                    }
                }
            }
        }
        // Add <!DOCTYPE html ... >
        // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/959
        // XMLSerializer is used to serialize doctype object
        // eslint-disable-next-line no-undef
        const doctype = doc.doctype ? `${new XMLSerializer().serializeToString(doc.doctype)}\r\n` : '';
        if (deleted.length > 0) {
            return doctype + EntityHandler.revertEntities(doc.documentElement.outerHTML);
        }
        return content;
    }
    /**
     * Applies "replace" rules to content string.
     *
     * @param content Content string.
     *
     * @returns Modified content string.
     */
    applyReplaceRules(content) {
        const appliedRules = [];
        let modifiedContent = content;
        for (let i = 0; i < this.replaceRules.length; i += 1) {
            const replaceRule = this.replaceRules[i];
            const replaceRuleInfo = {
                filterId: replaceRule.getFilterListId(),
                ruleIndex: replaceRule.getIndex(),
            };
            if (replaceRule.isAllowlist()) {
                appliedRules.push(replaceRuleInfo);
            }
            else {
                const advancedModifier = replaceRule.getAdvancedModifier();
                modifiedContent = advancedModifier.getApplyFunc()(modifiedContent);
                appliedRules.push(replaceRuleInfo);
            }
        }
        const { tabId, eventId } = this.context;
        if (appliedRules.length > 0) {
            this.filteringLog.publishEvent({
                type: common_configuration.l.ReplaceRuleApply,
                data: {
                    tabId,
                    eventId,
                    rules: appliedRules,
                },
            });
        }
        return modifiedContent;
    }
}

const DEFAULT_CHARSET = 'utf-8';
const LATIN_1 = 'iso-8859-1';
const WIN_1251 = 'windows-1251';
const WIN_1252 = 'windows-1252';
/**
 * Supported charsets array.
 */
const SUPPORTED_CHARSETS = [DEFAULT_CHARSET, WIN_1251, WIN_1252, LATIN_1];
/**
 * Parses charset from content-type header.
 *
 * @param contentType Content-type header.
 *
 * @returns Charset string or null.
 */
function parseCharsetFromHeader(contentType) {
    if (!contentType) {
        return null;
    }
    const match = /charset="?(.*?)"?$/.exec(contentType.toLowerCase());
    if (match && match.length > 1) {
        return match[1].toLowerCase();
    }
    return null;
}
/**
 * Parses charset from html, looking for:
 * <meta charset="utf-8" />
 * <meta charset=utf-8 />
 * <meta charset=utf-8>
 * <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 * <meta content="text/html; charset=utf-8" http-equiv="content-type" />.
 *
 * @param text Html content.
 *
 * @returns Charset string or null.
 */
function parseCharsetFromHtml(text) {
    let match = /<meta\s*charset\s*=\s*['"]?(.*?)['"]?\s*\/?>/.exec(text.toLowerCase());
    if (match && match.length > 1) {
        return match[1].trim().toLowerCase();
    }
    // eslint-disable-next-line max-len
    match = /<meta\s*http-equiv\s*=\s*['"]?content-type['"]?\s*content\s*=\s*[\\]?['"]text\/html;\s*charset=(.*?)[\\]?['"]/.exec(text.toLowerCase());
    if (match && match.length > 1) {
        return match[1].trim().toLowerCase();
    }
    // eslint-disable-next-line max-len
    match = /<meta\s*content\s*=\s*[\\]?['"]text\/html;\s*charset=(.*?)[\\]?['"]\s*http-equiv\s*=\s*['"]?content-type['"]?/.exec(text.toLowerCase());
    if (match && match.length > 1) {
        return match[1].trim().toLowerCase();
    }
    return null;
}
/**
 * Parses charset from css.
 *
 * @param text Css content.
 *
 * @returns Charset string or null.
 */
function parseCharsetFromCss(text) {
    const match = /^@charset\s*['"](.*?)['"]/.exec(text.toLowerCase());
    if (match && match.length > 1) {
        return match[1].trim().toLowerCase();
    }
    return null;
}

// Do not destruct inside import, because it somehow breaks build in browser
// extension via "ReferenceError: TextDecoder is not defined".
const { TextEncoder, TextDecoder } = text_encoding;
/**
 * Content Stream Filter class.
 *
 * Encapsulates response data stream filtering logic
 * https://mail.mozilla.org/pipermail/dev-addons/2017-April/002729.html.
 */
class ContentStream {
    /**
     * Request context.
     *
     * This object is mutated during request processing.
     */
    context;
    /**
     * Content filter.
     *
     * Modifies content with specified rules.
     */
    contentStringFilter;
    /**
     * Web request filter.
     */
    filter;
    /**
     * Request charset.
     */
    charset;
    /**
     * Content.
     */
    content;
    /**
     * Decoder instance.
     */
    decoder;
    /**
     * Encoder instance.
     */
    encoder;
    /**
     * Filtering log.
     */
    filteringLog;
    /**
     * Contains collection of accepted content types for stream filtering.
     */
    allowedContentTypes = [
        'text/',
        'application/json',
        'application/xml',
        'application/xhtml+xml',
        'application/javascript',
        'application/x-javascript',
    ];
    /**
     * Content stream constructor.
     *
     * @param context Request context.
     * @param contentStringFilter Content filter.
     * @param streamFilterCreator Stream filter creator.
     * @param filteringLog Filtering log.
     */
    constructor(context, contentStringFilter, streamFilterCreator, filteringLog) {
        this.content = '';
        this.context = context;
        this.contentStringFilter = contentStringFilter;
        this.filteringLog = filteringLog;
        this.filter = streamFilterCreator(context.requestId);
        this.onResponseData = this.onResponseData.bind(this);
        this.onResponseFinish = this.onResponseFinish.bind(this);
        this.onResponseError = this.onResponseError.bind(this);
    }
    /**
     * Initializes encoders and filter.
     */
    init() {
        this.initEncoders();
        this.initFilter();
    }
    /**
     * Writes data to stream.
     *
     * @param content Content to write.
     */
    write(content) {
        this.filter.write(this.encoder.encode(content));
        this.filter.close();
    }
    /**
     * Sets charset.
     *
     * @param charset Charset.
     */
    setCharset(charset) {
        if (charset) {
            this.charset = charset;
            this.initEncoders();
        }
    }
    /**
     * Disconnects filter from stream.
     *
     * @param data Data to write.
     */
    disconnect(data) {
        this.filter.write(data);
        this.filter.disconnect();
    }
    /**
     * Initializes encoders.
     */
    initEncoders() {
        let set = this.charset ? this.charset : DEFAULT_CHARSET;
        // Redefining it as TextDecoder does not understand the iso- name
        if (set === LATIN_1) {
            set = WIN_1252;
        }
        this.decoder = new TextDecoder(set);
        if (set === DEFAULT_CHARSET) {
            this.encoder = new TextEncoder();
        }
        else {
            this.encoder = new TextEncoder(set, { NONSTANDARD_allowLegacyEncoding: true });
        }
    }
    /**
     * Initializes filter.
     */
    initFilter() {
        this.filter.ondata = this.onResponseData;
        this.filter.onstop = this.onResponseFinish;
        this.filter.onerror = this.onResponseError;
    }
    /**
     * We do not support stream filtering for some content types.
     *
     * @returns True if content type is supported.
     */
    shouldProcessFiltering() {
        const { requestType, contentTypeHeader } = this.context;
        if (requestType === request_type/* RequestType */.Y.Other || requestType === request_type/* RequestType */.Y.XmlHttpRequest) {
            return !!contentTypeHeader && this.allowedContentTypes.some((contentType) => {
                return contentTypeHeader.indexOf(contentType) === 0;
            });
        }
        return true;
    }
    /**
     * Handler for response data.
     *
     * @param event Stream filter event.
     */
    onResponseData(event) {
        if (!this.shouldProcessFiltering()) {
            this.disconnect(event.data);
            return;
        }
        if (!this.charset) {
            try {
                let charset;
                /**
                 * If this.charset is undefined and requestType is Document or Subdocument, we try to detect charset
                 * from page <meta> tags.
                 */
                if (this.context.requestType === request_type/* RequestType */.Y.SubDocument
                    || this.context.requestType === request_type/* RequestType */.Y.Document) {
                    charset = ContentStream.parseHtmlCharset(event.data);
                }
                /**
                 * If this.charset is undefined and requestType is Stylesheet, we try to detect charset from css
                 * directive.
                 */
                if (this.context.requestType === request_type/* RequestType */.Y.Stylesheet) {
                    charset = ContentStream.parseCssCharset(event.data);
                }
                if (!charset) {
                    charset = DEFAULT_CHARSET;
                }
                if (charset && SUPPORTED_CHARSETS.indexOf(charset) >= 0) {
                    this.charset = charset;
                    this.initEncoders();
                    this.content += this.decoder.decode(event.data, { stream: true });
                }
                else {
                    // Charset is not supported
                    this.disconnect(event.data);
                }
            }
            catch (e) {
                common_logger.l.warn(e.message);
                // on error we disconnect the filter from the request
                this.disconnect(event.data);
            }
        }
        else {
            this.content += this.decoder.decode(event.data, { stream: true });
        }
    }
    /**
     * Handler for response error.
     */
    onResponseError() {
        if (this.filter.error && this.filter.error) {
            common_logger.l.info(this.filter.error);
        }
    }
    /**
     * Handler for the end of response data.
     */
    onResponseFinish() {
        this.content += this.decoder.decode(); // finish stream
        this.filteringLog.publishEvent({
            type: common_configuration.l.ContentFilteringStart,
            data: {
                requestId: this.context.requestId,
            },
        });
        const { contentTypeHeader, statusCode } = this.context;
        if (statusCode !== 200) {
            this.write(this.content);
            return;
        }
        const charset = parseCharsetFromHeader(contentTypeHeader);
        if (charset) {
            if (SUPPORTED_CHARSETS.indexOf(charset) < 0) {
                // Charset is detected and it is not supported
                // eslint-disable-next-line max-len
                common_logger.l.warn(`Skipping request ${this.context.requestId} with Content-Type ${this.context.contentTypeHeader}`);
                this.write(this.content);
                return;
            }
            this.setCharset(charset);
        }
        this.content = this.contentStringFilter.applyRules(this.content);
        this.write(this.content);
        this.filteringLog.publishEvent({
            type: common_configuration.l.ContentFilteringFinish,
            data: {
                requestId: this.context.requestId,
            },
        });
    }
    /**
     * Parses charset from html.
     *
     * @param data Data to parse.
     *
     * @returns Parsed charset or null.
     */
    static parseHtmlCharset(data) {
        const decoded = new TextDecoder('utf-8').decode(data).toLowerCase();
        return parseCharsetFromHtml(decoded);
    }
    /**
     * Parses charset from css.
     *
     * @param data Data to parse.
     *
     * @returns Parsed charset or null.
     */
    static parseCssCharset(data) {
        const decoded = new TextDecoder('utf-8').decode(data).toLowerCase();
        return parseCharsetFromCss(decoded);
    }
}

/**
 * Content filtering module.
 * Handles Html filtering and replace rules.
 */
class ContentFiltering {
    /**
     * Contains collection of supported request types for replace rules.
     */
    static supportedReplaceRulesRequestTypes = [
        request_type/* RequestType */.Y.Document,
        request_type/* RequestType */.Y.SubDocument,
        request_type/* RequestType */.Y.Script,
        request_type/* RequestType */.Y.Stylesheet,
        request_type/* RequestType */.Y.XmlHttpRequest,
        request_type/* RequestType */.Y.Other,
    ];
    /**
     * Retrieves html rules.
     *
     * @param context Request context.
     *
     * @returns Html rules or null.
     */
    static getHtmlRules(context) {
        const { cosmeticResult } = context;
        /**
         * "cosmeticResult" is defined only for Document and Subdocument request types
         * do not need extra request type checking.
         */
        if (!cosmeticResult) {
            return null;
        }
        const htmlRules = cosmeticResult.Html.getRules();
        if (htmlRules.length === 0) {
            return null;
        }
        return htmlRules;
    }
    /**
     * Retrieves replace rules and sorts them alphabetically.
     *
     * @param context Request context.
     *
     * @returns Replace rules or null.
     */
    static getReplaceRules(context) {
        const { requestType, matchingResult } = context;
        if (!requestType
            || !matchingResult
            || !ContentFiltering.supportedReplaceRulesRequestTypes.includes(requestType)) {
            return null;
        }
        const replaceRules = matchingResult.getReplaceRules();
        if (replaceRules.length === 0) {
            return null;
        }
        // Sort replace rules alphabetically as noted here
        // https://github.com/AdguardTeam/CoreLibs/issues/45
        return replaceRules.sort((prev, next) => {
            if (prev.getText() > next.getText()) {
                return 1;
            }
            if (prev.getText() < next.getText()) {
                return -1;
            }
            return 0;
        });
    }
    /**
     * Checks if request content filtering disabled by exception rule with $content modifier.
     *
     * @param context Request context.
     *
     * @returns `true`, if content filtering disabled by exception rule with $content modifier,
     * overwise returns `false`.
     */
    static hasContentExceptionRule(context) {
        const { matchingResult } = context;
        if (!matchingResult) {
            return false;
        }
        const rule = matchingResult.getBasicResult();
        if (!rule) {
            return false;
        }
        // The $content modifier only applies with the exception rule.
        // We don't need additional `rule.isAllowlist()` check.
        return rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Content);
    }
    /**
     * Checks if request method is supported.
     *
     * @param context Request context.
     *
     * @returns `true`, if request method is supported,
     * overwise returns `false`.
     */
    static isRequestMethodSupported(context) {
        const { method } = context;
        return method === 'GET' || method === 'POST';
    }
    /**
     * On before request event handler.
     *
     * @param context Request context.
     */
    static onBeforeRequest(context) {
        if (!browser_polyfill.webRequest.filterResponseData
            || !ContentFiltering.isRequestMethodSupported(context)
            || ContentFiltering.hasContentExceptionRule(context)) {
            return;
        }
        const htmlRules = ContentFiltering.getHtmlRules(context);
        const replaceRules = ContentFiltering.getReplaceRules(context);
        if (htmlRules || replaceRules) {
            const contentStringFilter = new ContentStringFilter(context, htmlRules, replaceRules, common_configuration.d);
            const contentStream = new ContentStream(context, contentStringFilter, browser_polyfill.webRequest.filterResponseData, common_configuration.d);
            contentStream.init();
        }
    }
}

/**
 * Content Security Policy Headers filtering service module.
 */
class CspService {
    /**
     * Filtering log.
     */
    filteringLog;
    /**
     * Constructor.
     *
     * @param filteringLog Filtering log.
     */
    constructor(filteringLog) {
        this.filteringLog = filteringLog;
    }
    /**
     * Applies CSP rules to response headers and returns modified headers.
     * It is applied when webRequest.onHeadersReceived event is fired.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    onHeadersReceived(context) {
        const { matchingResult, responseHeaders, requestId, tabId, requestUrl, referrerUrl, } = context;
        if (!matchingResult) {
            return false;
        }
        const cspHeaders = [];
        const cspRules = matchingResult.getCspRules();
        for (let i = 0; i < cspRules.length; i += 1) {
            const rule = cspRules[i];
            if (rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Header)) {
                const responseHeaderMatch = rule.matchResponseHeaders(responseHeaders);
                if (!responseHeaderMatch || rule.isAllowlist()) {
                    continue;
                }
            }
            // Don't forget: getCspRules returns all $csp rules, we must directly check that the rule is blocking.
            if (RequestBlockingApi.isRequestBlockedByRule(rule)) {
                const cspHeaderValue = rule.getAdvancedModifierValue();
                if (cspHeaderValue) {
                    cspHeaders.push({
                        name: es/* CSP_HEADER_NAME */.B$,
                        value: cspHeaderValue,
                    });
                }
            }
            this.filteringLog.publishEvent({
                type: common_configuration.l.ApplyCspRule,
                data: {
                    tabId,
                    eventId: (0,non_secure/* nanoid */.A)(),
                    requestUrl,
                    frameUrl: referrerUrl,
                    frameDomain: (0,es6/* getDomain */.FB)(referrerUrl),
                    requestType: common_configuration.s.Csp,
                    filterId: rule.getFilterListId(),
                    ruleIndex: rule.getIndex(),
                    timestamp: Date.now(),
                    isAllowlist: rule.isAllowlist(),
                    isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                    isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                    isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                    isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                    advancedModifier: rule.getAdvancedModifierValue(),
                },
            });
        }
        if (cspHeaders.length > 0) {
            requestContextStorage.update(requestId, {
                responseHeaders: responseHeaders ? [...responseHeaders, ...cspHeaders] : cspHeaders,
            });
            return true;
        }
        return false;
    }
}
const cspService = new CspService(common_configuration.d);

/**
 * Params filtering service module.
 */
class ParamsService {
    filteringLog;
    /**
     * Constructor.
     *
     * @param filteringLog Filtering log.
     */
    constructor(filteringLog) {
        this.filteringLog = filteringLog;
    }
    static SupportedMethods = ['GET', 'POST', 'OPTIONS', 'HEAD'];
    /**
     * Removes request params from url, stored in request context.
     *
     * @param requestId Request id.
     *
     * @returns Modified url or null.
     */
    getPurgedUrl(requestId) {
        const context = requestContextStorage.get(requestId);
        if (!context) {
            return null;
        }
        const { matchingResult, method, requestUrl, contentType, timestamp, } = context;
        if (!matchingResult || !ParamsService.isMethodSupported(method)) {
            return null;
        }
        const removeParamRules = matchingResult.getRemoveParamRules();
        if (removeParamRules.length === 0) {
            return null;
        }
        const purgedUrl = removeParamRules.reduce((url, rule) => {
            if (rule.isAllowlist()) {
                this.filteringLog.publishEvent({
                    type: common_configuration.l.RemoveParam,
                    data: {
                        removeParam: true,
                        eventId: (0,non_secure/* nanoid */.A)(),
                        tabId: context.tabId,
                        requestUrl: url,
                        frameUrl: url,
                        frameDomain: (0,common_configuration.a)(url),
                        requestType: contentType,
                        filterId: rule.getFilterListId(),
                        ruleIndex: rule.getIndex(),
                        timestamp,
                        isAllowlist: rule.isAllowlist(),
                        isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                        isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                        isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                        isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                        advancedModifier: rule.getAdvancedModifierValue(),
                    },
                });
                return url;
            }
            const modifier = rule.getAdvancedModifier();
            const modifiedUrl = modifier.removeParameters(url);
            const hasUrlChanged = modifiedUrl !== url;
            if (hasUrlChanged) {
                context.isRemoveparamRedirect = true;
                this.filteringLog.publishEvent({
                    type: common_configuration.l.RemoveParam,
                    data: {
                        removeParam: true,
                        eventId: (0,non_secure/* nanoid */.A)(),
                        tabId: context.tabId,
                        requestUrl: modifiedUrl,
                        frameUrl: modifiedUrl,
                        frameDomain: (0,common_configuration.a)(modifiedUrl),
                        requestType: contentType,
                        filterId: rule.getFilterListId(),
                        ruleIndex: rule.getIndex(),
                        timestamp,
                        isAllowlist: rule.isAllowlist(),
                        isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                        isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                        isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                        isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                        advancedModifier: rule.getAdvancedModifierValue(),
                    },
                });
            }
            return modifier.removeParameters(url);
        }, requestUrl);
        if (purgedUrl === requestUrl) {
            return null;
        }
        return purgedUrl;
    }
    /**
     * Checks if we support requests for specified method.
     *
     * @param method Request method.
     *
     * @returns True if method supported.
     */
    static isMethodSupported(method) {
        return ParamsService.SupportedMethods.includes(method.toUpperCase());
    }
}
const paramsService = new ParamsService(common_configuration.d);

/**
 * Permissions Policy service.
 */
class PermissionsPolicyService {
    /**
     * Filtering log.
     */
    filteringLog;
    /**
     * Request context storage.
     */
    contextStorage;
    /**
     * Constructor.
     *
     * @param contextStorage Request context storage.
     * @param filteringLog Filtering log.
     */
    constructor(contextStorage, filteringLog) {
        this.filteringLog = filteringLog;
        this.contextStorage = contextStorage;
    }
    /**
     * Checks if a network rule is sub document rule.
     *
     * @param rule Rule to check.
     *
     * @returns `true` if the rule is sub document rule.
     */
    static isSubDocumentRule(rule) {
        return (rule.getPermittedRequestTypes() & request_type/* RequestType */.Y.SubDocument) === request_type/* RequestType */.Y.SubDocument;
    }
    /**
     * Applies permissions policy directives to the response headers.
     *
     * @param context Request context.
     *
     * @returns True if policies were set successfully.
     */
    onHeadersReceived(context) {
        const { matchingResult, responseHeaders, requestId, requestType, tabId, requestUrl, referrerUrl, } = context;
        if (!matchingResult) {
            return false;
        }
        const permissionsPolicyRules = matchingResult.getPermissionsPolicyRules();
        const permissionsPolicyHeaders = [];
        if (permissionsPolicyRules.length === 0) {
            return false;
        }
        // Check if a global allowlist rule is present.
        if (permissionsPolicyRules.some((rule) => rule.isAllowlist()
            && !rule.getAdvancedModifierValue()
            && !PermissionsPolicyService.isSubDocumentRule(rule))) {
            return false;
        }
        for (let i = 0; i < permissionsPolicyRules.length; i += 1) {
            const rule = permissionsPolicyRules[i];
            // Sub frames can only be affected by a rule where the $subdocument modifier has been set.
            if (PermissionsPolicyService.isSubDocumentRule(rule) !== (requestType === request_type/* RequestType */.Y.SubDocument)) {
                continue;
            }
            const directives = rule.getAdvancedModifierValue();
            if (directives) {
                if (!rule.isAllowlist()) {
                    permissionsPolicyHeaders.push({
                        name: es/* PERMISSIONS_POLICY_HEADER_NAME */.iw,
                        value: directives,
                    });
                }
                this.filteringLog.publishEvent({
                    type: common_configuration.l.ApplyPermissionsRule,
                    data: {
                        tabId,
                        // for proper filtering log request info rule displaying
                        // event id should be unique for each event, not copied from request
                        // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2341
                        eventId: (0,non_secure/* nanoid */.A)(),
                        requestUrl,
                        frameUrl: referrerUrl,
                        frameDomain: (0,es6/* getDomain */.FB)(referrerUrl),
                        requestType: common_configuration.s.PermissionsPolicy,
                        filterId: rule.getFilterListId(),
                        ruleIndex: rule.getIndex(),
                        timestamp: Date.now(),
                        isAllowlist: rule.isAllowlist(),
                        isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                        isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                        isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                        isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                        advancedModifier: rule.getAdvancedModifierValue(),
                    },
                });
            }
        }
        this.contextStorage.update(requestId, {
            responseHeaders: responseHeaders ? [
                ...responseHeaders,
                ...permissionsPolicyHeaders,
            ] : permissionsPolicyHeaders,
        });
        return true;
    }
}
const permissionsPolicyService = new PermissionsPolicyService(requestContextStorage, common_configuration.d);

/**
 * CSP Trusted Types service module.
 */
class TrustedTypesService {
    static SPACE = ' ';
    static CSP_DIRECTIVE_VALUES_SEPARATOR = TrustedTypesService.SPACE;
    /**
     * Content Security Policy header name.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy}
     */
    static CSP_HEADER_NAME = 'content-security-policy';
    /**
     * Content Security Policy Report-Only header name.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only}
     */
    static CSP_REPORT_ONLY_HEADER_NAME = 'content-security-policy-report-only';
    /**
     * TrustedTypes directive.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types}
     */
    static CSP_TRUSTED_TYPES_DIRECTIVE_NAME = 'trusted-types';
    /**
     * TrustedTypes directive value that disallows creating any trusted types policy.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types}
     */
    static NONE_TRUSTED_TYPES_POLICY_VALUE = "'none'";
    /**
     * Allows for creating Trusted Types policies with a name that was already used.
     *
     * Related: @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types}.
     */
    static ALLOW_DUPLICATES_POLICY_VALUE = "'allow-duplicates'";
    /**
     * Trusted Types policy name for AdGuard scripts.
     *
     * Related issues:
     * {@link https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2068 | #2068},
     * AG-3320,
     * AG-18204.
     */
    static AG_POLICY_NAME = 'AGPolicy';
    /**
     * Checks whether the CSP header should be modified at all.
     * It is required if there are any scriptlet rules in the cosmetic result.
     *
     * Important: trusted types policy with name `AGPolicy` is being created only in scriptlets now,
     * so if some other dependency will do the same — this method should be updated.
     *
     * @param cosmeticResult Cosmetic result.
     *
     * @returns True if the CSP header should be modified, false otherwise.
     */
    static isModifyingRequired(cosmeticResult) {
        const scriptRules = cosmeticResult.getScriptRules();
        if (scriptRules.length === 0) {
            return false;
        }
        // simply check if there are any scriptlet rules
        return scriptRules.some((rule) => rule.isScriptlet);
    }
    /**
     * Checks whether the header is a CSP header.
     * CSP headers are `Content-Security-Policy` and `Content-Security-Policy-Report-Only`.
     *
     * @param header Header.
     *
     * @returns True if the header is a CSP header, false otherwise.
     */
    static isCspHeader(header) {
        // header names are case-insensitive
        // https://datatracker.ietf.org/doc/html/rfc2616#section-4.2
        return header.name.toLowerCase() === TrustedTypesService.CSP_HEADER_NAME
            || header.name.toLowerCase() === TrustedTypesService.CSP_REPORT_ONLY_HEADER_NAME;
    }
    /**
     * Modifies the value of CSP directive:
     * 1. If there are no `value` or if `value` contains only `'none'` —
     *    returns `AGPolicy` and `'allow-duplicates'` combined;
     * 2. Otherwise — adds `AGPolicy` and `'allow-duplicates'` to the directive value..
     *
     * @param value CSP directive value.
     *
     * @returns CSP directive value.
     */
    static modifyDirectiveValue(value) {
        const valueChunks = value
            .split(TrustedTypesService.CSP_DIRECTIVE_VALUES_SEPARATOR)
            .map((chunk) => chunk.trim())
            .filter((chunk) => !!chunk);
        const modifiedValueChunks = [];
        if (valueChunks.length > 0
            && !valueChunks.includes(TrustedTypesService.NONE_TRUSTED_TYPES_POLICY_VALUE)) {
            // copy `trusted-types` policy names from the directive value
            modifiedValueChunks.push(...valueChunks);
        }
        // add `AGPolicy` to the directive value if there is no such policy yet
        if (!modifiedValueChunks.includes(TrustedTypesService.AG_POLICY_NAME)) {
            modifiedValueChunks.push(TrustedTypesService.AG_POLICY_NAME);
        }
        // make sure that `'allow-duplicates'` is present
        if (!modifiedValueChunks.includes(TrustedTypesService.ALLOW_DUPLICATES_POLICY_VALUE)) {
            modifiedValueChunks.push(TrustedTypesService.ALLOW_DUPLICATES_POLICY_VALUE);
        }
        return modifiedValueChunks.join(TrustedTypesService.CSP_DIRECTIVE_VALUES_SEPARATOR);
    }
    /**
     * Modifies CSP header — checks whether it has a `trusted-types` directive,
     * and if so — adds `AGPolicy` and `'allow-duplicates'` to the directive value if needed.
     *
     * @param header Content Security Policy header.
     *
     * @returns Modified header.
     */
    static modifyCspHeader(header) {
        const { value } = header;
        if (!value) {
            return header;
        }
        const directives = value.split(constants.S);
        const resultDirectives = [];
        for (let i = 0; i < directives.length; i += 1) {
            const directive = directives[i].trim();
            if (!directive) {
                continue;
            }
            const separatorIndex = directive.indexOf(TrustedTypesService.CSP_DIRECTIVE_VALUES_SEPARATOR);
            const directiveName = separatorIndex === -1
                ? directive
                : directive.slice(0, separatorIndex);
            if (directiveName !== TrustedTypesService.CSP_TRUSTED_TYPES_DIRECTIVE_NAME) {
                // do nothing if it is not a `trusted-types` directive
                resultDirectives.push(directive);
                continue;
            }
            const directiveValue = separatorIndex === -1
                ? ''
                : directive.slice(separatorIndex + 1);
            const modifiedDirectiveValue = TrustedTypesService.modifyDirectiveValue(directiveValue);
            resultDirectives.push(`${directiveName}${TrustedTypesService.CSP_DIRECTIVE_VALUES_SEPARATOR}${modifiedDirectiveValue}`);
        }
        return {
            name: header.name,
            value: `${resultDirectives.join(`${constants.S}${TrustedTypesService.SPACE}`)}`,
        };
    }
    /**
     * TODO: Should we log it for filtering log?
     * Modifies CSP header of response headers —
     * adds `AGPolicy` and `'allow-duplicates'` to CSP header if there is a `trusted-types` directive,
     * and returns modified headers.
     *
     * It happens only if `context.cosmeticResult` contain any scriptlets.
     *
     * It is applied when webRequest.onHeadersReceived event is fired.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    static onHeadersReceived(context) {
        const { responseHeaders, cosmeticResult } = context;
        if (!responseHeaders || responseHeaders.length === 0) {
            return false;
        }
        // no need to modify CSP header if there is no cosmetic result
        if (!cosmeticResult) {
            return false;
        }
        if (!TrustedTypesService.isModifyingRequired(cosmeticResult)) {
            return false;
        }
        const anyCspHeaders = [];
        const notCspHeaders = [];
        responseHeaders.forEach((header) => {
            // separate CSP headers from others
            if (TrustedTypesService.isCspHeader(header)) {
                anyCspHeaders.push(header);
            }
            else {
                notCspHeaders.push(header);
            }
        });
        // nothing to do if there are no CSP headers
        if (anyCspHeaders.length === 0) {
            return false;
        }
        // flag that indicates whether any of CSP header value was modified
        let isModified = false;
        const modifiedCspHeaders = [];
        anyCspHeaders.forEach((header) => {
            const modifiedHeader = TrustedTypesService.modifyCspHeader(header);
            // check if header value was modified
            if (modifiedHeader.value !== header.value) {
                isModified = isModified || true;
            }
            modifiedCspHeaders.push(modifiedHeader);
        });
        if (!isModified) {
            return false;
        }
        requestContextStorage.update(context.requestId, {
            responseHeaders: [
                ...notCspHeaders,
                ...modifiedCspHeaders,
            ],
        });
        return true;
    }
}

/**
 * Headers filtering service module.
 */
class RemoveHeadersService {
    filteringLog;
    /**
     * Constructor.
     *
     * @param filteringLog Filtering log.
     */
    constructor(filteringLog) {
        this.filteringLog = filteringLog;
    }
    /**
     * Modifies headers by applying $removeheader rules.
     *
     * @param context Request context.
     * @param isRequestHeaders Is headers are _request_ headers, i.e. `false`
     * for _response_ headers.
     * @param headersToModify Headers to modify.
     *
     * @returns True if headers were modified.
     */
    modifyHeaders(context, isRequestHeaders, headersToModify) {
        const { matchingResult, tabId, requestUrl, contentType, timestamp, } = context;
        if (!headersToModify || !matchingResult) {
            return false;
        }
        const rules = matchingResult.getRemoveHeaderRules();
        if (rules.length === 0) {
            return false;
        }
        let isModified = false;
        rules.forEach((rule) => {
            let isAppliedRule = false;
            if (rule.isAllowlist()) {
                // Allowlist rules must be applicable by header name to be logged
                isAppliedRule = RemoveHeadersService
                    .isApplicableRemoveHeaderRule(headersToModify, rule, isRequestHeaders);
            }
            else {
                isAppliedRule = RemoveHeadersService.applyRule(headersToModify, rule, isRequestHeaders);
                if (!isModified && isAppliedRule) {
                    isModified = true;
                }
            }
            if (isAppliedRule) {
                this.filteringLog.publishEvent({
                    type: common_configuration.l.RemoveHeader,
                    data: {
                        removeHeader: true,
                        headerName: rule.getAdvancedModifierValue(),
                        eventId: (0,non_secure/* nanoid */.A)(),
                        tabId,
                        requestUrl,
                        frameUrl: requestUrl,
                        frameDomain: (0,common_configuration.a)(requestUrl),
                        requestType: contentType,
                        timestamp,
                        filterId: rule.getFilterListId(),
                        ruleIndex: rule.getIndex(),
                        isAllowlist: rule.isAllowlist(),
                        isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                        isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                        isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                        isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                        advancedModifier: rule.getAdvancedModifierValue(),
                    },
                });
            }
        });
        return isModified;
    }
    /**
     * On before send headers handler.
     * Removes request headers.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    onBeforeSendHeaders(context) {
        const { requestHeaders, requestId } = context;
        const isModified = this.modifyHeaders(context, true, requestHeaders);
        if (isModified) {
            requestContextStorage.update(requestId, { requestHeaders });
        }
        return isModified;
    }
    /**
     * On headers received handler.
     * Removes response headers.
     *
     * @param context Request context.
     *
     * @returns True if headers were modified.
     */
    onHeadersReceived(context) {
        const { responseHeaders, requestId } = context;
        const isModified = this.modifyHeaders(context, false, responseHeaders);
        if (isModified) {
            requestContextStorage.update(requestId, { responseHeaders });
        }
        return isModified;
    }
    /**
     * Applies rule to headers. Removes header from headers if rule matches.
     * Important: this method modifies headers array as they are passed by reference.
     *
     * @param headers Headers.
     * @param rule Rule to apply if it has remove header modifier.
     * @param isRequestHeaders Is headers are _request_ headers, i.e. `false`
     * for _response_ headers.
     *
     * @returns True if headers removed by rule.
     */
    static applyRule(headers, rule, isRequestHeaders) {
        const headerName = RemoveHeadersService.getApplicableHeaderName(rule, isRequestHeaders);
        if (!headerName) {
            return false;
        }
        return (0,common_configuration.z)(headers, headerName);
    }
    /**
     * Checks if rule is applicable to headers.
     *
     * @param headers   Headers.
     * @param rule  Rule with $removeheader modifier.
     * @param isRequestHeaders Is headers are _request_ headers, i.e. `false`
     * for _response_ headers.
     *
     * @returns True if rule is applicable.
     */
    static isApplicableRemoveHeaderRule(headers, rule, isRequestHeaders) {
        const headerName = RemoveHeadersService.getApplicableHeaderName(rule, isRequestHeaders);
        if (!headerName) {
            return false;
        }
        return !!(0,common_configuration.q)(headers, headerName);
    }
    /**
     * Returns header name if rule has remove header modifier and it is applicable.
     *
     * @param rule Rule with $removeheader modifier.
     * @param isRequestHeaders Is headers are _request_ headers, i.e. `false`
     * for _response_ headers.
     *
     * @returns Header name or null if rule is not applicable.
     */
    static getApplicableHeaderName(rule, isRequestHeaders) {
        const modifier = rule.getAdvancedModifier();
        if (!modifier) {
            return null;
        }
        const headerName = modifier.getApplicableHeaderName(isRequestHeaders);
        if (!headerName) {
            return null;
        }
        return headerName;
    }
}
const removeHeadersService = new RemoveHeadersService(common_configuration.d);

/**
 * This API is used to remove traceable data from requests initiated by the background extension.
 */
class SanitizeApi {
    /**
     * Removes Cookie headers from background extension's requests.
     *
     * @param context Request context.
     *
     * @returns Blocking response or null.
     */
    static onBeforeSendHeaders(context) {
        const { requestHeaders, referrerUrl, tabId, } = context;
        if (tabId !== BACKGROUND_TAB_ID || !requestHeaders) {
            return null;
        }
        // removeHeader modifies 'context.requestHeaders'
        if (isExtensionUrl(referrerUrl) && removeHeader(requestHeaders, 'Cookie')) {
            return { requestHeaders };
        }
        return null;
    }
}

/**
 * @file
 * API for applying rules from background service
 * by handling web Request API and web navigation events.
 *
 * This scheme describes flow for MV2.
 *
 * Event data is aggregated into two contexts: {@link RequestContext},
 * which contains data about the specified request
 * and {@link TabContext} which contains data about the specified tab and frames inside it.
 *
 * Applying {@link NetworkRule} from the background page:
 *
 * The {@link MatchingResult} of specified request is calculated and stored in tab context storage,
 * at the time {@link RequestEvents.onBeforeRequest} or {@link WebNavigation.onBeforeNavigate} is processed.
 * In the most cases the onBeforeNavigate event is processed before onBeforeRequest.
 *
 * The handler for this event also computes the response based on {@link MatchingResult}
 * via {@link RequestBlockingApi.getBlockingResponse}.
 * If the rule is blocking rule, the request will be cancelled, otherwise it will be handled by the next handlers.
 * If content filtering is supported, it will be initialized for non-blocking requests.
 *
 * At {@link RequestEvents.onBeforeSendHeaders}, the request headers are modified or deleted
 * based on the {@link MatchingResult} stored in {@link requestContextStorage}.
 * At {@link RequestEvents.onHeadersReceived}, the response headers are handled in the same way,
 * and also the 'trusted-types' directive is modified for CSP headers, @see {@link TrustedTypesService}.
 *
 * At {@link RequestEvents.onCompleted}, cosmetics are injected for subdocuments in Firefox.
 *
 * The specified {@link RequestContext} will be removed from {@link requestContextStorage}
 * on {@link RequestEvents.onCompleted} or {@link RequestEvents.onErrorOccurred} events.
 *
 *
 *  Applying {@link CosmeticRule} from the background page.
 *
 * We pre-calculate cosmetics for the request as soon as possible —
 * on {@link browser.webNavigation.onBeforeNavigate} or {@link RequestEvents.onBeforeRequest} events,
 * depending on which event is processed first, (there is a guard clause for this).
 * Pre-calculated cosmetics are stored in the context of frames.
 *
 * To get the scripts up and running as quickly as possible
 * we try to inject them the first time during the {@link RequestEvents.onResponseStarted}.
 *
 * All cosmetic rules are then injected on the {@link browser.webNavigation.onCommitted}
 * or {@link browser.webNavigation.onDOMContentLoaded} events.
 *
 * The frame data will be removed from the specified {@link TabContext} on {@link browser.webNavigation.onCompleted} or
 * {@link browser.webNavigation.onErrorOccurred } events.
 *
 *  Web Request API Event Handling:
 *
 *                                       ┌─────────────────────────────┐
 * Matches {@link MatchingResult}        │                             │
 * for the request.                      │       onBeforeRequest       ◄─┐
 * If this is a frame request, also      │                             │ │
 * pre-calculates {@link CosmeticResult} └──────────────┬──────────────┘ │
 * for the specified frame,                             │                │
 * and stores it in the frame context.                  │                │
 *                                                      │                │
 * If the request is neither blocked                    │                │
 * nor redirected, apply the                            │                │
 * $removeparam rules.                                  │                │
 * In Firefox, if the request                           │                │
 * is not blocked,                                      │                │
 * initialize content filtering.                        │                │
 * After that, check if a request is                    │                │
 * third-party and has type CSP_REPORT                  │                │
 * - then block it.                                     │                │
 *                                                      │                │
 *                                                      │                │
 *                                       ┌──────────────▼──────────────┐ │
 * Removes or modifies request           │                             │ │
 * headers based on                      │      onBeforeSendHeaders    ◄─┼─┐
 * {@link MatchingResult}.               │                             │ │ │
 *                                       └──────────────┬──────────────┘ │ │
 *                                                      │                │ │
 *                                       ┌──────────────▼──────────────┐ │ │
 *                                       │                             │ │ │
 *                                       │        onSendHeaders        │ │ │
 *                                       │                             │ │ │
 *                                       └──────────────┬──────────────┘ │ │
 *                                                      │                │ │
 *                                       ┌──────────────▼──────────────┐ │ │
 * Removes or modifies response          │                             │ │ │
 * headers based on                    ┌─┤      onHeadersReceived      │ │ │
 * {@link MatchingResult}.             │ │                             │ │ │
 * Modifies 'trusted-types' directive  │ └─────────────────────────────┘ │ │
 * for CSP headers                     │                                 │ │
 * via {@link TrustedTypesService}.    │                                 │ │
 *                                     │                                 │ │
 *                                     │                                 │ │
 *                                     │ ┌─────────────────────────────┐ │ │
 *                                     │ │                             │ │ │
 *                                     ├─►       onBeforeRedirect      ├─┘ │
 *                                     │ │                             │   │
 *                                     │ └─────────────────────────────┘   │
 *                                     │                                   │
 *                                     │ ┌─────────────────────────────┐   │
 *                                     │ │                             │   │
 *                                     ├─►        onAuthRequired       ├───┘
 *                                     │ │                             │
 *                                     │ └─────────────────────────────┘
 *                                     │
 *                                     │ ┌─────────────────────────────┐
 * Tries injecting JS rules into the   │ │                             │
 * frame based on pre-calculate        └─►      onResponseStarted      │
 * cosmetic result.                      │                             │
 *                                       └──────────────┬──────────────┘
 *                                                      │
 *                                       ┌──────────────▼──────────────┐
 * Injects cosmetics for subdocuments    │                             │
 * in Firefox (AG-40169). Logs script    │         onCompleted         │
 * rules for main and sub frames.        │                             │
 * Removes the request information       └─────────────────────────────┘
 * from {@link requestContextStorage}.
 *
 *                                       ┌─────────────────────────────┐
 * Remove the request information        │                             │
 * from {@link requestContextStorage}.   │       onErrorOccurred       │
 *                                       │                             │
 *                                       └─────────────────────────────┘.
 *
 *
 * Web Navigation API Event Handling:
 *
 *                                       ┌─────────────────────────────┐
 *                                       │                             │
 *                                       │  onCreatedNavigationTarget  │
 *                                       │                             │
 *                                       └──────────────┬──────────────┘
 *                                                      │
 *                                       ┌──────────────▼──────────────┐
 * Update main frame data with           │                             │
 * {@link updateMainFrameData}           │       onBeforeNavigate      │
 * and pre-calculate cosmetics           │                             │
 * so it can be applied later.           └──────────────┬──────────────┘
 *                                                      │
 *                                                      │
 *                                       ┌──────────────▼──────────────┐
 * Try injecting CSS and JS rules        │                             │
 * into the frame with source based on   │         onCommitted         │
 * pre-calculated cosmetic result.       │                             │
 *                                       └──────────────┬──────────────┘
 *                                                      │
 *                                       ┌──────────────▼──────────────┐
 * Try injecting CSS and JS rules        │                             │
 * into the subdocument frame without    │      onDOMContentLoaded     ├─┐
 * source based on pre-calculated        │                             │ │
 * cosmetic result.                      └──────────────┬──────────────┘ │
 *                                                      │                │
 *                                       ┌──────────────▼──────────────┐ │
 * Remove the frame data                 │                             │ │
 * from {@link TabContext}.            ┌─┤         onCompleted         │ │
 *                                     │ │                             │ │
 *                                     │ └─────────────────────────────┘ │
 *                                     │                                 │
 *                                     │ ┌─────────────────────────────┐ │
 *                                     │ │                             │ │
 *                                     ├─►    onHistoryStateUpdated    ◄─┤
 *                                     │ │                             │ │
 *                                     │ └─────────────────────────────┘ │
 *                                     │                                 │
 *                                     │ ┌─────────────────────────────┐ │
 *                                     │ │                             │ │
 *                                     └─►  onReferenceFragmentUpdated ◄─┘
 *                                       │                             │
 *                                       └─────────────────────────────┘.
 *
 *                                       ┌─────────────────────────────┐
 * Remove the frame data                 │                             │
 * from {@link TabContext}.              │       onErrorOccurred       │
 *                                       │                             │
 *                                       └─────────────────────────────┘.
 */
/**
 * API for applying rules from background service by handling
 * Web Request API and web navigation events.
 */
class WebRequestApi {
    /**
     * Adds listeners to web request events.
     */
    static start() {
        // browser.webRequest Events
        RequestEvents.onBeforeRequest.addListener(WebRequestApi.onBeforeRequest);
        // Note: onBeforeCspReport should be registered after onBeforeRequest
        // because it depends on the MatchingResult calculation for the request
        // that is performed in onBeforeRequest, and in WebRequestApi all
        // request handlers will be called in the order of registration.
        RequestEvents.onBeforeRequest.addListener(WebRequestApi.onBeforeCspReport);
        RequestEvents.onBeforeSendHeaders.addListener(WebRequestApi.onBeforeSendHeaders);
        RequestEvents.onHeadersReceived.addListener(WebRequestApi.onHeadersReceived);
        RequestEvents.onResponseStarted.addListener(WebRequestApi.onResponseStarted);
        RequestEvents.onErrorOccurred.addListener(WebRequestApi.onErrorOccurred);
        RequestEvents.onCompleted.addListener(WebRequestApi.onCompleted);
        // browser.webNavigation Events
        // Note: We need to force set matching result in Opera before run `WebRequestApi.onCommitted`
        // TODO: remove this when Opera bug is fixed.
        browser.webNavigation.onCommitted.addListener(WebRequestApi.onCommittedOperaHook);
        browser.webNavigation.onCommitted.addListener(WebRequestApi.onCommitted);
        browser.webNavigation.onBeforeNavigate.addListener(WebRequestApi.onBeforeNavigate);
        browser.webNavigation.onDOMContentLoaded.addListener(WebRequestApi.onDomContentLoaded);
        browser.webNavigation.onCompleted.addListener(WebRequestApi.deleteFrameContext);
        browser.webNavigation.onErrorOccurred.addListener(WebRequestApi.deleteFrameContext);
    }
    /**
     * Removes web request event handlers.
     */
    static stop() {
        RequestEvents.onBeforeRequest.removeListener(WebRequestApi.onBeforeRequest);
        RequestEvents.onBeforeRequest.removeListener(WebRequestApi.onBeforeCspReport);
        RequestEvents.onBeforeSendHeaders.removeListener(WebRequestApi.onBeforeSendHeaders);
        RequestEvents.onHeadersReceived.removeListener(WebRequestApi.onHeadersReceived);
        RequestEvents.onResponseStarted.removeListener(WebRequestApi.onResponseStarted);
        RequestEvents.onErrorOccurred.removeListener(WebRequestApi.onErrorOccurred);
        RequestEvents.onCompleted.removeListener(WebRequestApi.onCompleted);
        browser.webNavigation.onCommitted.removeListener(WebRequestApi.onCommitted);
        browser.webNavigation.onCommitted.removeListener(WebRequestApi.onCommittedOperaHook);
        browser.webNavigation.onBeforeNavigate.removeListener(WebRequestApi.onBeforeNavigate);
        browser.webNavigation.onDOMContentLoaded.removeListener(WebRequestApi.onDomContentLoaded);
        browser.webNavigation.onCompleted.removeListener(WebRequestApi.deleteFrameContext);
        browser.webNavigation.onErrorOccurred.removeListener(WebRequestApi.deleteFrameContext);
    }
    /**
     * Flush browser in-memory cache.
     *
     * This function is called after an engine update or filtering switch to ensure
     * that new rules are applied to requests that may have been cached by the browser.
     */
    static async flushMemoryCache() {
        try {
            await browser.webRequest.handlerBehaviorChanged();
        }
        catch (e) {
            // TODO: use getErrorMessage instead
            const message = e instanceof Error ? e.message : String(e);
            logger.error(message);
        }
    }
    /**
     * On before request event handler. This is the earliest event in the chain of the web request events.
     *
     * @param data Request data.
     * @param data.context Request context.
     * @param data.details Event details.
     *
     * @returns Web request response or void if there is nothing to do.
     */
    static onBeforeRequest({ context, details }) {
        if (!context) {
            return undefined;
        }
        const { requestType, tabId, frameId, requestUrl, referrerUrl, eventId, requestId, contentType, timestamp, thirdParty, method, requestFrameId, } = context;
        if (!isHttpOrWsRequest(requestUrl)) {
            return undefined;
        }
        /**
         * We use here referrerUrl as frameUrl for all type of requests, because
         * we have pre-process for this in {@link RequestEvents.handleOnBeforeRequest},
         * where we can set `referrerUrl` to `requestUrl` for prerender requests.
         */
        const frameUrl = referrerUrl;
        defaultFilteringLog.publishEvent({
            type: FilteringEventType.SendRequest,
            data: {
                tabId,
                eventId,
                requestUrl,
                requestDomain: getDomain(requestUrl),
                frameUrl,
                frameDomain: getDomain(frameUrl),
                requestType: contentType,
                timestamp,
                requestThirdParty: thirdParty,
                method,
            },
        });
        let frameRule;
        /**
         * For Document and Subdocument requests, we match frame, because
         * these requests are first (in page lifecycle), but for other requests
         * we get the frame rule from tabsApi, assuming the frame rule is
         * already in the tab context.
         */
        if (requestType === RequestType$1.Document || requestType === RequestType$1.SubDocument) {
            frameRule = documentApi.matchFrame(frameUrl);
        }
        else {
            frameRule = tabsApi.getTabFrameRule(tabId);
        }
        const matchingResult = engineApi.matchRequest({
            requestUrl,
            frameUrl,
            requestType,
            frameRule,
            method,
        });
        if (!matchingResult) {
            return undefined;
        }
        requestContextStorage.update(requestId, { matchingResult });
        if (requestType === RequestType$1.Document || requestType === RequestType$1.SubDocument) {
            const { parentFrameId } = details;
            cosmeticFrameProcessor.precalculateCosmetics({
                tabId,
                frameId,
                parentFrameId,
                documentId: details.documentId,
                url: requestUrl,
                timeStamp: timestamp,
            });
        }
        // For a $replace rule, response will be undefined since we need to get
        // the response in order to actually apply $replace rules to it.
        const response = RequestBlockingApi.getBlockingResponse({
            rule: matchingResult.getBasicResult(),
            popupRule: matchingResult.getPopupRule(),
            eventId,
            requestId,
            requestUrl,
            referrerUrl,
            requestType,
            contentType,
            tabId,
        });
        if (!response) {
            /*
             Strip url by $removeparam rules
             $removeparam rules are applied after URL blocking rules
             https://github.com/AdguardTeam/CoreLibs/issues/1462
            */
            const purgedUrl = paramsService.getPurgedUrl(requestId);
            if (purgedUrl) {
                return { redirectUrl: purgedUrl };
            }
        }
        if (response?.cancel) {
            tabsApi.incrementTabBlockedRequestCount(tabId, referrerUrl);
            const mainFrameUrl = tabsApi.getTabMainFrame(tabId)?.url;
            hideRequestInitiatorElement(tabId, requestFrameId, requestUrl, mainFrameUrl || referrerUrl, requestType, thirdParty);
        }
        else {
            const frameContext = tabsApi.getFrameContext(tabId, frameId);
            // Note: In the code above, we pre-calculate cosmetics for the request,
            // which may update the frame context with the cosmetic result,
            // but it does not update the request context.
            // So we need to update the request context with the cosmetic result from the frame context, if needed.
            if (frameContext) {
                context.cosmeticResult = frameContext.cosmeticResult;
            }
            ContentFiltering.onBeforeRequest(context);
        }
        return response;
    }
    /**
     * On before send headers event handler.
     *
     * !IMPORTANT! This method modifies headers in the context. This non-pure action needs
     * to increase performance: exclude copying of headers for each service.
     *
     * @param details On before send headers details.
     * @param details.context Details context.
     *
     * @returns Web request event response.
     */
    static onBeforeSendHeaders({ context, }) {
        if (!context) {
            return undefined;
        }
        // If current request from the background - we don't need to modify headers,
        // only remove Cookie and immediately return modified headers
        const sanitizedRequest = SanitizeApi.onBeforeSendHeaders(context);
        if (sanitizedRequest) {
            return sanitizedRequest;
        }
        let requestHeadersModified = false;
        if (stealthApi.onBeforeSendHeaders(context)) {
            requestHeadersModified = true;
        }
        // If the current request does not comply with any rules - we do not
        // need to call any other processing services (e.g. cookie, header)
        if (context?.matchingResult) {
            if (cookieFiltering.onBeforeSendHeaders(context)) {
                requestHeadersModified = true;
            }
            if (removeHeadersService.onBeforeSendHeaders(context)) {
                requestHeadersModified = true;
            }
        }
        if (requestHeadersModified) {
            return { requestHeaders: context.requestHeaders };
        }
        return undefined;
    }
    /**
     * On headers received event handler.
     *
     * @param event On headers received event.
     * @param event.context Event context.
     * @param event.details On headers received details.
     *
     * @returns Web request event response.
     */
    static onHeadersReceived({ context, details, }) {
        if (!context) {
            return undefined;
        }
        defaultFilteringLog.publishEvent({
            type: FilteringEventType.ReceiveResponse,
            data: {
                tabId: context.tabId,
                eventId: context.eventId,
                statusCode: details.statusCode,
            },
        });
        if (!context?.matchingResult || context.matchingResult.getBasicResult()?.isFilteringDisabled()) {
            return undefined;
        }
        const { requestId, requestUrl, referrerUrl, requestType, contentType, responseHeaders, matchingResult, requestFrameId, thirdParty, tabId, } = context;
        const headerResult = matchingResult.getResponseHeadersResult(responseHeaders);
        const response = RequestBlockingApi.getResponseOnHeadersReceived(responseHeaders, {
            tabId,
            eventId: context.eventId,
            rule: headerResult,
            referrerUrl,
            requestUrl,
            requestId,
            requestType,
            contentType,
        });
        if (response?.cancel) {
            tabsApi.incrementTabBlockedRequestCount(tabId, referrerUrl);
            const mainFrameUrl = tabsApi.getTabMainFrame(tabId)?.url;
            hideRequestInitiatorElement(tabId, requestFrameId, requestUrl, mainFrameUrl || referrerUrl, requestType, thirdParty);
            return response;
        }
        const contentTypeHeader = findHeaderByName(responseHeaders, 'content-type')?.value;
        if (contentTypeHeader) {
            requestContextStorage.update(requestId, { contentTypeHeader });
        }
        let responseHeadersModified = false;
        if (requestUrl && (requestType === RequestType$1.Document || requestType === RequestType$1.SubDocument)) {
            if (cspService.onHeadersReceived(context)) {
                responseHeadersModified = true;
            }
            if (permissionsPolicyService.onHeadersReceived(context)) {
                responseHeadersModified = true;
            }
            if (TrustedTypesService.onHeadersReceived(context)) {
                responseHeadersModified = true;
            }
        }
        if (cookieFiltering.onHeadersReceived(context)) {
            responseHeadersModified = true;
        }
        if (removeHeadersService.onHeadersReceived(context)) {
            responseHeadersModified = true;
        }
        if (responseHeadersModified) {
            return { responseHeaders: context.responseHeaders };
        }
        return undefined;
    }
    /**
     * On response started event handler.
     *
     * @param event On response started event.
     * @param event.context Event context.
     */
    static onResponseStarted({ context, }) {
        if (!context) {
            return;
        }
        const { tabId, frameId, requestType } = context;
        if (requestType !== RequestType$1.Document && requestType !== RequestType$1.SubDocument) {
            return;
        }
        CosmeticApi.applyJsByTabAndFrame(tabId, frameId);
    }
    /**
     * Handler for the last event in the request lifecycle.
     *
     * @param event The event that occurred upon completion of the request.
     * @param event.context The context of the completed event.
     * @param event.details The details of the completed event.
     */
    static onCompleted({ context, details, }) {
        if (!context) {
            return;
        }
        const { requestType, tabId, frameId, requestUrl, timestamp, contentType, } = context;
        /**
         * Trying to inject cosmetics for sub frames in Firefox as soon as possible
         * because webNavigation events (where we also inject cosmetics) can be fired too late. AG-40169.
         */
        if (isFirefox || requestType === RequestType$1.SubDocument) {
            WebRequestApi.injectCosmetic(details);
        }
        if (requestType === RequestType$1.Document || requestType === RequestType$1.SubDocument) {
            const frameContext = tabsApi.getFrameContext(tabId, frameId);
            if (!frameContext?.cosmeticResult) {
                // eslint-disable-next-line max-len
                logger.debug(`[RequestEvents.onCompleted]: cannot log script rules due to not having cosmetic result for tabId: ${tabId}, frameId: ${frameId}.`);
                return;
            }
            CosmeticApi.logScriptRules({
                tabId,
                cosmeticResult: frameContext.cosmeticResult,
                url: requestUrl,
                contentType,
                timestamp,
            });
        }
        WebRequestApi.deleteRequestContext(context.requestId);
    }
    /**
     * Deletes the request context immediately.
     *
     * @param requestId The ID of the request.
     */
    static deleteRequestContext(requestId) {
        requestContextStorage.delete(requestId);
    }
    /**
     * Event handler for onErrorOccurred event. It fires when an error occurs.
     *
     * @param event On error occurred event.
     * @param event.details On error occurred event details.
     */
    static onErrorOccurred({ details, }) {
        WebRequestApi.deleteRequestContext(details.requestId);
    }
    /**
     * Injects cosmetic rules to specified frame based on tab id and frame id.
     *
     * @param details Event details.
     */
    static injectCosmetic(details) {
        const { tabId, frameId, } = details;
        if (WebRequestApi.isAssistantFrame(tabId, details)) {
            logger.debug(`Assistant frame detected, skipping cosmetics injection for tabId ${tabId} and frameId: ${frameId}`);
            return;
        }
        CosmeticApi.injectCosmetic(tabId, frameId);
    }
    /**
     * On before navigate web navigation event handler.
     *
     * @param details Event details.
     */
    static onBeforeNavigate(details) {
        const { frameId, tabId, timeStamp, url, documentId, documentLifecycle, parentFrameId, 
        // supported by Chrome 106+
        // but not supported by Firefox so it is calculated based on tabId and frameId
        // @ts-ignore
        parentDocumentId, } = details;
        // TODO: Check, should we record this event for filtering log.
        cosmeticFrameProcessor.precalculateCosmetics({
            tabId,
            frameId,
            parentFrameId,
            url,
            timeStamp,
            documentLifecycle,
            documentId,
            /**
             * Use parentDocumentId if it is defined, otherwise:
             * - if parent frame is a document-level frame, use undefined
             * - else generate parentDocumentId based on tabId and parentFrameId.
             */
            parentDocumentId: parentDocumentId
                || (TabsApi.isDocumentLevelFrame(parentFrameId)
                    ? undefined
                    : TabsApi.generateId(tabId, parentFrameId)),
        });
    }
    /**
     * On committed web navigation event handler.
     *
     * Injects necessary CSS and scripts into the web page.
     *
     * @param details Event details.
     */
    static onCommitted(details) {
        const { tabId, frameId, 
        // supported by Chrome 106+
        // but not supported by Firefox so it is calculated based on tabId and frameId
        // @ts-ignore
        documentId, } = details;
        // This is necessary mainly to update documentId
        tabsApi.updateFrameContext(tabId, frameId, {
            documentId: documentId || TabsApi.generateId(tabId, frameId),
        });
        WebRequestApi.injectCosmetic(details);
    }
    /**
     * Checks whether the frame is an assistant frame.
     *
     * Needed to prevent cosmetic rules injection into the assistant frame.
     *
     * @param tabId Tab id.
     * @param details Event details.
     *
     * @returns True if the frame is an assistant frame, false otherwise.
     */
    static isAssistantFrame(tabId, details) {
        const tabContext = tabsApi.getTabContext(tabId);
        return CommonAssistant.isAssistantFrame(details, tabContext);
    }
    /**
     * On DOM content loaded web navigation event handler.
     *
     * This method injects css and js code in all frames, particularly in iframes without remote source.
     * Usual webRequest callbacks don't fire for frames without remote source.
     * Also urls in these frames may be "about:blank", "about:srcdoc", etc.
     *
     * @see https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1046
     *
     * @param details Event details.
     */
    static onDomContentLoaded(details) {
        const { tabId, frameId, 
        // supported by Chrome 106+
        // but not supported by Firefox so it is calculated based on tabId and frameId
        // @ts-ignore
        documentId, } = details;
        // This is necessary mainly to update documentId
        tabsApi.updateFrameContext(tabId, frameId, {
            documentId: documentId || TabsApi.generateId(tabId, frameId),
        });
        WebRequestApi.injectCosmetic(details);
    }
    /**
     * Intercepts csp_report requests.
     * Check the URL of the report.
     * For chromium and firefox:
     * If it's sent to a third party, block it right away.
     * For firefox only:
     * If it contains moz://extension with our extension ID, block it as well.
     *
     * @see https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1792.
     *
     * @param details Request details.
     * @param details.context Request context.
     *
     * @returns Web request response or void if there is nothing to do.
     */
    static onBeforeCspReport({ context }) {
        // If filtering is disabled - skip process request.
        if (!engineApi.isFilteringEnabled) {
            return undefined;
        }
        if (!context) {
            return undefined;
        }
        const { requestType, matchingResult, tabId, eventId, referrerUrl, thirdParty, } = context;
        /**
         * Checks request type here instead of creating two event listener with
         * different filter types via {@link RequestEvent.init} to simplify
         * event handlers flow and create only one {@link RequestEvents.onBeforeRequest}
         * listener and two WebRequest listeners: {@link WebRequestApi.onBeforeCspReport}
         * and {@link WebRequestApi.onBeforeRequest}.
         */
        if (requestType !== RequestType$1.CspReport) {
            return undefined;
        }
        // If filtering disabled for this request.
        if (matchingResult?.getBasicResult()?.isFilteringDisabled()) {
            return undefined;
        }
        if (thirdParty) {
            defaultFilteringLog.publishEvent({
                type: FilteringEventType.CspReportBlocked,
                data: {
                    tabId,
                    eventId,
                    cspReportBlocked: true,
                },
            });
            tabsApi.incrementTabBlockedRequestCount(tabId, referrerUrl);
            return { cancel: true };
        }
        // Don't check for moz://extension because it was fixed in
        // https://bugzilla.mozilla.org/show_bug.cgi?id=1588957#c10.
        return undefined;
    }
    /**
     * Delete frame data from tab context when navigation is finished.
     *
     * @param details Navigation event details.
     */
    static deleteFrameContext(details) {
        const { tabId, frameId } = details;
        setTimeout(() => {
            tabsApi.deleteFrameContext(tabId, frameId, FRAME_DELETION_TIMEOUT_MS);
        }, FRAME_DELETION_TIMEOUT_MS);
    }
    /**
     * On committed web navigation event handler only for Opera.
     *
     * There is Opera bug that prevents firing WebRequest events for document
     * and subdocument requests.
     * We now handle this by checking if matching result exists for main frame
     * and if not - we force create it.
     *
     * TODO: remove this when Opera bug is fixed.
     *
     * @param details Event details.
     */
    static onCommittedOperaHook(details) {
        const { frameId, tabId, url, } = details;
        if (isOpera && frameId === MAIN_FRAME_ID) {
            const tabContext = tabsApi.getTabContext(tabId);
            if (!tabContext) {
                return;
            }
            const frame = tabContext.frames.get(frameId);
            if (!frame || frame.matchingResult) {
                return;
            }
            const matchingResult = engineApi.matchRequest({
                requestUrl: url,
                frameUrl: url,
                requestType: RequestType$1.Document,
                frameRule: tabContext.mainFrameRule,
            });
            frame.matchingResult = matchingResult;
        }
    }
}

/* eslint-disable class-methods-use-this */
/**
 * App implementation for MV2.
 */
class TsWebExtension {
    appContext;
    tabsApi;
    engineApi;
    stealthApi;
    messagesApi;
    tabCosmeticInjector;
    redirectsService;
    documentBlockingService;
    filteringLog;
    extSessionStorage;
    /**
     * Fires on filtering log event.
     */
    onFilteringLogEvent;
    /**
     * Fires when a rule has been created from the helper.
     */
    onAssistantCreateRule = Assistant.onCreateRule;
    /**
     * Gets app running status.
     *
     * @returns True if app started, else false.
     */
    get isStarted() {
        // TODO: Remove this check after moving call of storage initialization in extension code.
        // Check this flag before access storage values, because engine methods
        // can be triggered before initialization by extension `onCheckRequestFilterReady` method.
        if (!this.appContext.isStorageInitialized) {
            return false;
        }
        return this.appContext.isAppStarted;
    }
    /**
     * Sets app running status.
     *
     * @param value Status value.
     */
    set isStarted(value) {
        this.appContext.isAppStarted = value;
    }
    /**
     * Gets app configuration context.
     *
     * @returns True if app started, else false.
     *
     * @throws Error if value not set.
     */
    get configuration() {
        if (!this.appContext.configuration) {
            throw new Error('Configuration not set!');
        }
        return this.appContext.configuration;
    }
    /**
     * Sets app configuration context.
     *
     * @param value Status value.
     */
    set configuration(value) {
        this.appContext.configuration = value;
    }
    /**
     * Creates new instance of {@link TsWebExtension}.
     *
     * @param appContext Top level app context storage.
     * @param tabsApi Wrapper around browser.tabs API.
     * @param engineApi TSUrlFilter Engine wrapper.
     * @param stealthApi Stealth api implementation.
     * @param messagesApi Wrapper around browser.runtime API.
     * @param tabCosmeticInjector Used to inject cosmetic rules into opened tabs on extension start.
     * @param redirectsService Service for working with redirects.
     * @param documentBlockingService Service encapsulate processing of $document modifier rules.
     * @param filteringLog Filtering log API.
     * @param extSessionStorage API for storing data described by SessionStorageSchema in the browser.storage.session.
     */
    constructor(appContext, tabsApi, engineApi, stealthApi, messagesApi, tabCosmeticInjector, redirectsService, documentBlockingService, filteringLog, extSessionStorage) {
        this.appContext = appContext;
        this.tabsApi = tabsApi;
        this.engineApi = engineApi;
        this.stealthApi = stealthApi;
        this.messagesApi = messagesApi;
        this.tabCosmeticInjector = tabCosmeticInjector;
        this.redirectsService = redirectsService;
        this.documentBlockingService = documentBlockingService;
        this.filteringLog = filteringLog;
        this.extSessionStorage = extSessionStorage;
        this.onFilteringLogEvent = this.filteringLog.onLogEvent;
        this.getMessageHandler = this.getMessageHandler.bind(this);
    }
    /**
     * Initialize app persistent data.
     * This method called as soon as possible and allows access
     * to the actual context before the app is started.
     */
    async initStorage() {
        await this.extSessionStorage.init();
        this.appContext.isStorageInitialized = true;
    }
    /**
     * Initializes {@link EngineApi} with passed {@link configuration}.
     * Starts request processing via {@link WebRequestApi} and tab tracking via {@link tabsApi}.
     *
     * Also updates webRTC privacy.network settings on demand and flushes browser in-memory request cache.
     *
     * @param configuration App configuration.
     *
     * @throws Error if configuration is not valid.
     */
    async start(configuration) {
        if (!this.appContext.startTimeMs) {
            this.appContext.startTimeMs = Date.now();
        }
        configurationMV2Validator.parse(configuration);
        this.configuration = TsWebExtension.createConfigurationMV2Context(configuration);
        TsWebExtension.updateLogLevel(configuration.logLevel);
        RequestEvents.init();
        await this.redirectsService.start();
        this.documentBlockingService.configure(configuration);
        await this.engineApi.startEngine(configuration);
        await this.tabCosmeticInjector.processOpenTabs();
        await this.tabsApi.start();
        WebRequestApi.start();
        Assistant.setAssistantUrl(configuration.settings.assistantUrl);
        await WebRequestApi.flushMemoryCache();
        await this.stealthApi.updateWebRtcPrivacyPermissions();
        this.isStarted = true;
    }
    /**
     * Fully stop request and tab processing.
     */
    async stop() {
        WebRequestApi.stop();
        this.tabsApi.stop();
        this.isStarted = false;
    }
    /**
     * Re-initializes {@link EngineApi} with passed {@link configuration}
     * and update tabs main frame rules based on new engine state.
     *
     * Also updates webRTC privacy.network settings on demand and flushes browser in-memory request cache.
     *
     * Requires app is started.
     *
     * @param configuration App configuration.
     *
     * @throws Error if app is not started or configuration is not valid.
     */
    async configure(configuration) {
        if (!this.isStarted) {
            throw new Error('App is not started!');
        }
        configurationMV2Validator.parse(configuration);
        TsWebExtension.updateLogLevel(configuration.logLevel);
        this.configuration = TsWebExtension.createConfigurationMV2Context(configuration);
        this.documentBlockingService.configure(configuration);
        await this.engineApi.startEngine(configuration);
        await this.tabsApi.updateCurrentTabsMainFrameRules();
        await WebRequestApi.flushMemoryCache();
        await this.stealthApi.updateWebRtcPrivacyPermissions();
    }
    /**
     * Opens assistant in the tab.
     *
     * @param tabId Tab id where assistant will be opened.
     */
    async openAssistant(tabId) {
        this.tabsApi.setAssistantInitTimestamp(tabId);
        await assistant.openAssistant(tabId);
    }
    /**
     * Close assistant in the required tab.
     *
     * @param tabId Tab id.
     */
    async closeAssistant(tabId) {
        this.tabsApi.resetAssistantInitTimestamp(tabId);
        await Assistant.closeAssistant(tabId);
    }
    /**
     * Return rules count for current configuration.
     *
     * @returns Rules count.
     */
    getRulesCount() {
        return this.engineApi.getRulesCount();
    }
    /**
     * Returns a message handler that will listen to internal messages,
     * for example: message for get computed css for content-script.
     *
     * @returns Messages handler.
     */
    getMessageHandler() {
        return this.messagesApi.handleMessage;
    }
    /**
     * It is possible to follow all places using this logic by searching JS_RULES_EXECUTION.
     *
     * This is STEP 2.2: Local script rules are passed to the engine via this API method.
     */
    /**
     * Sets prebuild local script rules.
     *
     * @param localScriptRules JSON object with pre-build JS rules. @see {@link LocalScriptRulesService}.
     */
    setLocalScriptRules(localScriptRules) {
        localScriptRulesService.setLocalScriptRules(localScriptRules);
    }
    /**
     * Updates `filteringEnabled` configuration value without re-initialization of engine.
     *
     * Also updates webRTC privacy.network settings on demand and flushes browser in-memory request cache.
     *
     * @param isFilteringEnabled `filteringEnabled` config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    async setFilteringEnabled(isFilteringEnabled) {
        this.configuration.settings.filteringEnabled = isFilteringEnabled;
        await WebRequestApi.flushMemoryCache();
        await this.stealthApi.updateWebRtcPrivacyPermissions();
    }
    /**
     * Updates `collectStats` configuration value without re-initialization of engine.
     *
     * @param isCollectStats `collectStats` config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setCollectHitStats(isCollectStats) {
        this.configuration.settings.collectStats = isCollectStats;
    }
    /**
     * Updates `debugScriptlets` configuration value without re-initialization of engine.
     *
     * @param isDebugScriptlets `debugScriptlets` config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setDebugScriptlets(isDebugScriptlets) {
        this.configuration.settings.debugScriptlets = isDebugScriptlets;
    }
    /**
     * Updates `stealthModeEnabled` configuration value without re-initialization of engine.
     * Also updates webRTC privacy.network settings on demand.
     *
     * @param isStealthModeEnabled `stealthModeEnabled` config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    async setStealthModeEnabled(isStealthModeEnabled) {
        this.configuration.settings.stealthModeEnabled = isStealthModeEnabled;
        await this.stealthApi.updateWebRtcPrivacyPermissions();
    }
    /**
     * Updates `selfDestructFirstPartyCookies` stealth config value without re-initialization of engine.
     *
     * @param isSelfDestructFirstPartyCookies `selfDestructFirstPartyCookies` stealth config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setSelfDestructFirstPartyCookies(isSelfDestructFirstPartyCookies) {
        this.configuration.settings.stealth.selfDestructFirstPartyCookies = isSelfDestructFirstPartyCookies;
    }
    /**
     * Updates `selfDestructThirdPartyCookies` stealth config value without re-initialization of engine.
     *
     * @param isSelfDestructThirdPartyCookies `selfDestructThirdPartyCookies` stealth config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setSelfDestructThirdPartyCookies(isSelfDestructThirdPartyCookies) {
        this.configuration.settings.stealth.selfDestructThirdPartyCookies = isSelfDestructThirdPartyCookies;
    }
    /**
     * Updates `selfDestructFirstPartyCookiesTime` stealth config value without re-initialization of engine.
     *
     * @param selfDestructFirstPartyCookiesTime `selfDestructFirstPartyCookiesTime` stealth config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setSelfDestructFirstPartyCookiesTime(selfDestructFirstPartyCookiesTime) {
        this.configuration.settings.stealth.selfDestructFirstPartyCookiesTime = selfDestructFirstPartyCookiesTime;
    }
    /**
     * Updates `selfDestructThirdPartyCookiesTime` stealth config value without re-initialization of engine.
     *
     * @param selfDestructThirdPartyCookiesTime `selfDestructThirdPartyCookiesTime` stealth config value.
     *
     * @throws Error if {@link configuration} not set.
     */
    setSelfDestructThirdPartyCookiesTime(selfDestructThirdPartyCookiesTime) {
        this.configuration.settings.stealth.selfDestructThirdPartyCookiesTime = selfDestructThirdPartyCookiesTime;
    }
    /**
     * Updates `hideReferrer` stealth config value without re-initialization of engine.
     *
     * @param isHideReferrer `isHideReferrer` stealth config value.
     *
     * @returns Applied value for compatibility with MV3 interface.
     *
     * @throws Error if {@link configuration} not set.
     */
    setHideReferrer(isHideReferrer) {
        this.configuration.settings.stealth.hideReferrer = isHideReferrer;
        return isHideReferrer;
    }
    /**
     * Updates `hideSearchQueries` stealth config value without re-initialization of engine.
     *
     * @param isHideSearchQueries `hideSearchQueries` stealth config value.
     *
     * @returns Applied value for compatibility with MV3 interface.
     *
     * @throws Error if {@link configuration} not set.
     */
    setHideSearchQueries(isHideSearchQueries) {
        this.configuration.settings.stealth.hideSearchQueries = isHideSearchQueries;
        return isHideSearchQueries;
    }
    /**
     * Updates `blockChromeClientData` stealth config value without re-initialization of engine.
     *
     * @param isBlockChromeClientData `blockChromeClientData` stealth config value.
     *
     * @returns Applied value for compatibility with MV3 interface.
     *
     * @throws Error if {@link configuration} not set.
     */
    setBlockChromeClientData(isBlockChromeClientData) {
        this.configuration.settings.stealth.blockChromeClientData = isBlockChromeClientData;
        return isBlockChromeClientData;
    }
    /**
     * Updates `sendDoNotTrack` stealth config value without re-initialization of engine.
     *
     * @param isSendDoNotTrack `sendDoNotTrack` stealth config value.
     *
     * @returns Applied value for compatibility with MV3 interface.
     *
     * @throws Error if {@link configuration} not set.
     */
    setSendDoNotTrack(isSendDoNotTrack) {
        this.configuration.settings.stealth.sendDoNotTrack = isSendDoNotTrack;
        return isSendDoNotTrack;
    }
    /**
     * Updates `blockWebRTC` stealth config value without re-initialization of engine.
     * Also updates webRTC privacy.network settings on demand.
     *
     * @param isBlockWebRTC `blockWebRTC` stealth config value.
     *
     * @returns Applied value for compatibility with MV3 interface.
     *
     * @throws Error if {@link configuration} not set.
     */
    async setBlockWebRTC(isBlockWebRTC) {
        this.configuration.settings.stealth.blockWebRTC = isBlockWebRTC;
        await this.stealthApi.updateWebRtcPrivacyPermissions();
        return isBlockWebRTC;
    }
    /**
     * Retrieves a rule node by its filter list identifier and rule index.
     *
     * If there's no rule by that index or the rule structure is invalid, it will return null.
     *
     * @param filterId Filter list identifier.
     * @param ruleIndex Rule index.
     *
     * @returns Rule node or `null`.
     */
    retrieveRuleNode(filterId, ruleIndex) {
        return this.engineApi.retrieveRuleNode(filterId, ruleIndex);
    }
    /**
     * Creates configuration context.
     *
     * @param configuration Configuration.
     *
     * @returns Configuration context.
     */
    static createConfigurationMV2Context(configuration) {
        const { filters, verbose, logLevel, settings, } = configuration;
        return {
            filters: filters.map(({ filterId }) => filterId),
            verbose,
            logLevel,
            settings,
        };
    }
    /**
     * Updates the log level.
     *
     * @param logLevel Log level.
     */
    static updateLogLevel(logLevel) {
        try {
            logger.currentLevel = logLevel || LogLevel.Info;
        }
        catch (e) {
            logger.currentLevel = LogLevel.Info;
        }
    }
}

/**
 * Prevent web pages to identify extension through its web accessible resources.
 *
 * Inspired by:
 *  https://github.com/gorhill/uBlock/blob/7f999b759fe540e457e297363f55b25d9860dd3e/platform/chromium/vapi-background.
 */
class ResourcesService {
    secrets = [];
    root = browser_polyfill.runtime.getURL('/');
    lastSecretTime = 0;
    warDir;
    generateSecretKey;
    /**
     * Constructor.
     *
     * @param generateSecretKey Function to generate secret key.
     */
    constructor(generateSecretKey) {
        this.generateSecretKey = generateSecretKey;
        this.guardWar = this.guardWar.bind(this);
    }
    /**
     * Init service.
     *
     * @param warDir Web accessible resources directory.
     */
    init(warDir) {
        this.warDir = warDir;
        const filter = {
            urls: [`${this.root}${this.warDir}/*`],
        };
        const extraInfoSpec = ['blocking'];
        browser_polyfill.webRequest.onBeforeRequest.addListener(this.guardWar, filter, extraInfoSpec);
    }
    /**
     * Stops service.
     */
    stop() {
        this.warDir = undefined;
        this.secrets = [];
        browser_polyfill.webRequest.onBeforeRequest.removeListener(this.guardWar);
    }
    /**
     * Creates url for war file.
     *
     * @param path Resource relative path.
     * @param params Additional params appended to url, by default empty.
     *
     * @returns Url to resource with secret param.
     *
     * @throws Error, if web accessible resources path is not defined.
     */
    createResourceUrl(path, params = new URLSearchParams()) {
        if (!this.warDir) {
            throw new Error('Resources path is not defined. Did you init the service?');
        }
        const secretParams = new URLSearchParams(this.createSecretParam());
        const resultParams = new URLSearchParams([...secretParams, ...params]);
        return browser_polyfill.runtime.getURL(`/${this.warDir}/${path}?${resultParams.toString()}`);
    }
    /**
     * Loads war resource by path.
     *
     * @param path Resource relative path.
     *
     * @returns Promise resolved with resource content as a string.
     */
    async loadResource(path) {
        const url = this.createResourceUrl(path);
        const response = await fetch(url);
        // redefine url property of the response
        // https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2278
        Object.defineProperty(response, 'url', { value: path });
        return response.text();
    }
    /**
     * Generates secret key, persists it in the secrets array and formats querystring.
     *
     * @returns Querystring with secret.
     */
    createSecretParam() {
        if (this.secrets.length !== 0) {
            // TODO move magic numbers to constants
            if ((Date.now() - this.lastSecretTime) > 5000) {
                this.secrets.splice(0);
            }
            else if (this.secrets.length > 256) {
                this.secrets.splice(0, this.secrets.length - 192);
            }
        }
        this.lastSecretTime = Date.now();
        const secret = this.generateSecretKey();
        this.secrets.push(secret);
        return `?secret=${secret}`;
    }
    /**
     * If secret is not found redirects to the main url of extension, otherwise removes secret from the stored values.
     *
     * @param details Web request details.
     *
     * @returns Redirect or nothing.
     */
    guardWar(details) {
        const { url } = details;
        const pos = this.secrets.findIndex((secret) => url.lastIndexOf(`?secret=${secret}`) !== -1);
        if (pos === -1) {
            return { redirectUrl: this.root };
        }
        this.secrets.splice(pos, 1);
        return undefined;
    }
}

/**
 * RedirectsCache is used for new type of blocking redirects, like click2load.html.
 * Here we save redirected urls to check later for being able to view hidden frame after user
 * clicked on button "click to load".
 */
class RedirectsCache {
    /**
     * LRU Cache for URLs.
     */
    cache;
    /**
     * Constructor.
     */
    constructor() {
        this.cache = new esm/* LRUCache */.q({ max: 100 });
    }
    /**
     * Adds url to the cache.
     *
     * @param url Url added to cache.
     */
    add = (url) => {
        this.cache.set(url, true);
    };
    /**
     * Checks if url is in the cache.
     *
     * @param url Url to check.
     *
     * @returns True if url is in the cache.
     */
    hasUrl = (url) => {
        return this.cache.has(url);
    };
}
const redirectsCache = new RedirectsCache();

/**
 * Used for new type of redirects, i.e.: click2load.html.
 * This tokens are transferred to redirect and used later to unblock page after user clicked button
 * "click to load".
 */
class RedirectsTokensCache {
    /**
     * LRU Cache for tokens.
     */
    cache;
    /**
     * Constructor.
     */
    constructor() {
        this.cache = new esm/* LRUCache */.q({ max: 1000 });
    }
    /**
     * Generates random unblock token for url and saves it to cache.
     * Used for blocking redirect params creation {@link resourcesService.blockingUrlParams}.
     *
     * @returns Generated random string.
     */
    generateToken = () => {
        const token = (0,non_secure/* nanoid */.A)();
        this.cache.set(token, true);
        return token;
    };
    /**
     * Checks whether token exist in cache.
     * Used when redirect is checked in {@link resourcesService.shouldCreateRedirectUrl}.
     *
     * @param token Some string or null.
     *
     * @returns True if cache has such token.
     */
    hasToken = (token) => {
        if (!token) {
            return false;
        }
        return this.cache.has(token);
    };
}
const redirectsTokensCache = new RedirectsTokensCache();

/**
 * Service for working with redirects.
 */
class RedirectsService {
    resourcesService;
    redirects = null;
    /**
     * Creates {@link RedirectsService} instance.
     *
     * @param resourcesService Prevent web pages to identify extension through its web accessible resources.
     */
    constructor(resourcesService) {
        this.resourcesService = resourcesService;
    }
    /**
     * Starts redirects service.
     */
    async start() {
        try {
            const rawYaml = await this.resourcesService.loadResource('redirects.yml');
            this.redirects = new redirects/* Redirects */.A(rawYaml);
        }
        catch (e) {
            throw new Error(e.message);
        }
    }
    /**
     * Returns redirect url for the specified title.
     *
     * @param title Redirect title or null.
     * @param requestUrl Request url.
     *
     * @returns Redirect url or null if redirect is not found.
     */
    createRedirectUrl(title, requestUrl) {
        if (!title) {
            return null;
        }
        if (!this.redirects) {
            return null;
        }
        const redirectSource = this.redirects.getRedirect(title);
        if (!redirectSource) {
            common_logger.l.debug(`There is no redirect source with title: "${title}"`);
            return null;
        }
        const shouldRedirect = this.shouldCreateRedirectUrl(title, requestUrl);
        if (!shouldRedirect) {
            return null;
        }
        // For blocking redirects we generate additional search params.
        const params = this.blockingUrlParams(title, requestUrl);
        return this.resourcesService.createResourceUrl(`redirects/${redirectSource.file}`, params);
    }
    /**
     * Check whether redirect creating is needed i.e.: for click2load.html it's not needed after
     * button click.
     *
     * @param redirectTitle A name of the redirect.
     * @param requestUrl Request url.
     *
     * @returns True if should create redirect url.
     */
    shouldCreateRedirectUrl = (redirectTitle, requestUrl) => {
        // if no redirects loaded we won't be able to create redirect url;
        if (!this.redirects) {
            return false;
        }
        // no further checking is needed for most of the redirects
        // except blocking redirects, i.e. click2load.html
        if (!this.redirects.isBlocking(redirectTitle)) {
            return true;
        }
        // unblock token passed to redirect by createRedirectFileUrl and returned back.
        // it should be last parameter in url
        const UNBLOCK_TOKEN_PARAM = '__unblock';
        let cleanRequestUrl = requestUrl;
        const url = new URL(requestUrl);
        const params = new URLSearchParams(url.search);
        const unblockToken = params.get(UNBLOCK_TOKEN_PARAM);
        if (unblockToken) {
            // if redirect has returned unblock token back,
            // add url to cache for no further redirecting on button click;
            // save cleaned origin url so unblock token parameter should be cut off
            params.delete(UNBLOCK_TOKEN_PARAM);
            cleanRequestUrl = `${url.origin}${url.pathname}?${params.toString()}`;
            redirectsCache.add(cleanRequestUrl);
        }
        return !redirectsCache.hasUrl(cleanRequestUrl)
            || !redirectsTokensCache.hasToken(unblockToken);
    };
    /**
     * Builds blocking url search params.
     *
     * @param redirectTitle Title of the redirect.
     * @param requestUrl Request url.
     *
     * @returns Url search params.
     *
     * @throws Error if this method called before redirects where set.
     *
     * @private
     */
    blockingUrlParams(redirectTitle, requestUrl) {
        if (!this.redirects) {
            throw new Error('This method should be called after redirects are loaded');
        }
        const params = new URLSearchParams();
        if (this.redirects.isBlocking(redirectTitle)) {
            const unblockToken = redirectsTokensCache.generateToken();
            params.set('__unblock', unblockToken);
            params.set('__origin', requestUrl);
        }
        return params;
    }
}

/**
 * This service encapsulate processing of $document modifier rules.
 *
 * Service is initialized in {@link configure} method, called from {@link EngineApi#startEngine}.
 *
 * Request rule is processed in {@link getDocumentBlockingResponse} method, called
 * from {@link RequestBlockingApi.getBlockingResponse}.
 *
 * Request rule is processed following scenario:
 * - if domain is trusted, ignore request
 * - if rule is document blocking and {@link documentBlockingPageUrl} is undefined, return
 * {@link WebRequestApi.onBeforeRequest} blocking response
 * - if rule is document blocking and {@link documentBlockingPageUrl} is defined, return redirect response with
 * required params.
 * - if browser is Firefox, update page url by {@link browser.tabs} API, because FF doesn't support redirects to
 * extension pages.
 */
class DocumentBlockingService {
    tabsApi;
    // base url of document blocking page
    documentBlockingPageUrl;
    // list of domain names of sites, which should be excluded from document blocking
    trustedDomains = [];
    /**
     * Creates instance of {@link DocumentBlockingService}.
     *
     * @param tabsApi Wrapper around browser.tabs API.
     */
    constructor(tabsApi) {
        this.tabsApi = tabsApi;
    }
    /**
     * Configures service instance {@link documentBlockingPageUrl}.
     *
     * @param configuration App {@link Configuration}.
     */
    configure(configuration) {
        const { settings, trustedDomains } = configuration;
        this.documentBlockingPageUrl = settings?.documentBlockingPageUrl;
        this.trustedDomains = trustedDomains;
    }
    /**
     * Processes $document modifier rule matched request in {@link RequestBlockingApi.getBlockingResponse}.
     *
     * @param data Data for document request processing.
     *
     * @returns Blocking response or null {@link WebRequestApi.onBeforeRequest}.
     */
    getDocumentBlockingResponse(data) {
        const { tabId, eventId, rule, referrerUrl, requestId, requestUrl, } = data;
        // if request url domain is trusted, ignore document blocking rule
        if (this.isTrustedDomain(requestUrl)) {
            return undefined;
        }
        // public filtering log event
        common_configuration.d.publishEvent({
            type: common_configuration.l.ApplyBasicRule,
            data: {
                eventId,
                tabId,
                filterId: rule.getFilterListId(),
                ruleIndex: rule.getIndex(),
                requestUrl,
                requestId,
                frameUrl: referrerUrl,
                requestType: common_configuration.s.Document,
                isAllowlist: rule.isAllowlist(),
                isImportant: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Important),
                isDocumentLevel: rule.isDocumentLevelAllowlistRule(),
                isCsp: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Csp),
                isCookie: rule.isOptionEnabled(es/* NetworkRuleOption */.iR.Cookie),
                advancedModifier: rule.getAdvancedModifierValue(),
            },
        });
        // if documentBlockingPage is undefined, block request
        if (!this.documentBlockingPageUrl) {
            return { cancel: true };
        }
        // get document blocking url with required params
        const blockingUrl = DocumentBlockingService.createBlockingUrl(this.documentBlockingPageUrl, requestUrl, rule.getText());
        // Chrome doesn't allow to show extension pages in incognito mode
        if (isChromium && this.tabsApi.isIncognitoTab(tabId)) {
            // Closing tab before opening a new one may lead to browser crash (Chromium)
            browser_polyfill.tabs.create({ url: blockingUrl })
                .then(() => {
                browser_polyfill.tabs.remove(tabId);
            })
                .catch((e) => {
                common_logger.l.warn(`Can't open info page about blocked domain. Err: ${e}`);
            });
        }
        else {
            // Browser doesn't allow redirects to extension pages which are not listed in web
            // accessible resources. We set blocking page url via browser.tabs
            // api for bypassing this limitation.
            this.reloadTabWithBlockingPage(tabId, blockingUrl);
        }
        return { cancel: true };
    }
    /**
     * Checks if request url domain is trusted.
     *
     * @param url Request url.
     *
     * @returns True, if request url domain is trusted, else false.
     */
    isTrustedDomain(url) {
        const domain = (0,es6/* getHostname */.EW)(url);
        if (domain) {
            return this.trustedDomains.includes(domain);
        }
        return false;
    }
    /**
     * Updates tab with document blocking page url.
     *
     * @param tabId Tab id.
     * @param url Blocking page url.
     */
    reloadTabWithBlockingPage(tabId, url) {
        const tabContext = this.tabsApi.getTabContext(tabId);
        if (!tabContext) {
            return;
        }
        browser_polyfill.tabs.update(tabId, { url });
    }
    /**
     * Sets required url and rule query params to document-blocking page url.
     *
     * @param  documentBlockingPageUrl Url of document-blocking page.
     * @param  requestUrl Processed request url.
     * @param  ruleText Matched rule text.
     *
     * @returns Document blocking page url with required params.
     */
    static createBlockingUrl(documentBlockingPageUrl, requestUrl, ruleText) {
        const url = new URL(documentBlockingPageUrl);
        url.searchParams.set('url', requestUrl);
        url.searchParams.set('rule', ruleText);
        return url.toString();
    }
}

/**
 * @file Temporary entry point for global background submodule instances.
 * Needed for backward compatibility during internal API updates.
 * Will be removed in the future.
 */
const allowlist = new Allowlist();
const engineApi = new EngineApi(allowlist, appContext, stealthApi);
const documentApi = new DocumentApi(allowlist, engineApi);
const tabsApi = new TabsApi(documentApi);
const cosmeticFrameProcessor = new CosmeticFrameProcessor(engineApi, tabsApi);
const documentBlockingService = new DocumentBlockingService(tabsApi);
const messagesApi = new MessagesApi(tabsApi, common_configuration.d);
const resourcesService = new ResourcesService(() => {
    return Math.floor(Math.random() * 982451653 + 982451653).toString(36);
});
const redirectsService = new RedirectsService(resourcesService);
/**
 * Creates new instance of {@link TsWebExtension}.
 *
 * @param webAccessibleResourcesPath Path to web accessible resources for {@link resourcesService}.
 *
 * @returns New instance of {@link TsWebExtension}.
 */
function createTsWebExtension(webAccessibleResourcesPath) {
    resourcesService.init(webAccessibleResourcesPath);
    const tabCosmeticInjector = new TabsCosmeticInjector(documentApi, tabsApi, engineApi);
    return new TsWebExtension(appContext, tabsApi, engineApi, stealthApi, messagesApi, tabCosmeticInjector, redirectsService, documentBlockingService, defaultFilteringLog, extSessionStorage);
}




/***/ }),

/***/ 48339:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65970);



/* Built-in method references that are verified to be native. */
var DataView = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, 'DataView');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DataView);


/***/ }),

/***/ 78070:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86013);
/* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33853);
/* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14276);
/* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83472);
/* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55040);






/**
 * Creates a hash object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Hash(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `Hash`.
Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;
Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;
Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;
Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A;
Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Hash);


/***/ }),

/***/ 118:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40765);
/* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78269);
/* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30308);
/* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58928);
/* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13600);






/**
 * Creates an list cache object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function ListCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `ListCache`.
ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;
ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;
ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;
ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A;
ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ListCache);


/***/ }),

/***/ 59062:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65970);



/* Built-in method references that are verified to be native. */
var Map = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, 'Map');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Map);


/***/ }),

/***/ 22694:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30381);
/* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2157);
/* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99028);
/* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79360);
/* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45328);






/**
 * Creates a map cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function MapCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `MapCache`.
MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;
MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;
MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;
MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A;
MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MapCache);


/***/ }),

/***/ 87793:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65970);



/* Built-in method references that are verified to be native. */
var Promise = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, 'Promise');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Promise);


/***/ }),

/***/ 84356:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65970);



/* Built-in method references that are verified to be native. */
var Set = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, 'Set');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Set);


/***/ }),

/***/ 6920:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(118);
/* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18283);
/* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76719);
/* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65118);
/* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9226);
/* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18994);







/**
 * Creates a stack cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Stack(entries) {
  var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A(entries);
  this.size = data.size;
}

// Add methods to `Stack`.
Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;
Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;
Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A;
Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A;
Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Stack);


/***/ }),

/***/ 26710:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);


/** Built-in value references. */
var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Symbol;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Symbol);


/***/ }),

/***/ 28011:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);


/** Built-in value references. */
var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Uint8Array;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Uint8Array);


/***/ }),

/***/ 79826:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65970);



/* Built-in method references that are verified to be native. */
var WeakMap = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_root_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, 'WeakMap');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WeakMap);


/***/ }),

/***/ 91644:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.forEach` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns `array`.
 */
function arrayEach(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayEach);


/***/ }),

/***/ 24443:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.filter` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {Array} Returns the new filtered array.
 */
function arrayFilter(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length,
      resIndex = 0,
      result = [];

  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result[resIndex++] = value;
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayFilter);


/***/ }),

/***/ 30274:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78013);
/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63479);
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68058);
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1561);
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50556);
/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76686);







/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Creates an array of the enumerable property names of the array-like `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @param {boolean} inherited Specify returning inherited property names.
 * @returns {Array} Returns the array of property names.
 */
function arrayLikeKeys(value, inherited) {
  var isArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value),
      isArg = !isArr && (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value),
      isBuff = !isArr && !isArg && (0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value),
      isType = !isArr && !isArg && !isBuff && (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(value),
      skipIndexes = isArr || isArg || isBuff || isType,
      result = skipIndexes ? (0,_baseTimes_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(value.length, String) : [],
      length = result.length;

  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) &&
        !(skipIndexes && (
           // Safari 9 has enumerable `arguments.length` in strict mode.
           key == 'length' ||
           // Node.js 0.10 has enumerable non-index properties on buffers.
           (isBuff && (key == 'offset' || key == 'parent')) ||
           // PhantomJS 2 has enumerable non-index properties on typed arrays.
           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
           // Skip index properties.
           (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(key, length)
        ))) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayLikeKeys);


/***/ }),

/***/ 3323:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.map` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the new mapped array.
 */
function arrayMap(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length,
      result = Array(length);

  while (++index < length) {
    result[index] = iteratee(array[index], index, array);
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayMap);


/***/ }),

/***/ 56069:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Appends the elements of `values` to `array`.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {Array} values The values to append.
 * @returns {Array} Returns `array`.
 */
function arrayPush(array, values) {
  var index = -1,
      length = values.length,
      offset = array.length;

  while (++index < length) {
    array[offset + index] = values[index];
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayPush);


/***/ }),

/***/ 81261:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.some` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function arraySome(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (predicate(array[index], index, array)) {
      return true;
    }
  }
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arraySome);


/***/ }),

/***/ 84434:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18829);
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29105);



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Assigns `value` to `key` of `object` if the existing value is not equivalent
 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * for equality comparisons.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function assignValue(object, key, value) {
  var objValue = object[key];
  if (!(hasOwnProperty.call(object, key) && (0,_eq_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(objValue, value)) ||
      (value === undefined && !(key in object))) {
    (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object, key, value);
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assignValue);


/***/ }),

/***/ 3654:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29105);


/**
 * Gets the index at which the `key` is found in `array` of key-value pairs.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} key The key to search for.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function assocIndexOf(array, key) {
  var length = array.length;
  while (length--) {
    if ((0,_eq_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(array[length][0], key)) {
      return length;
    }
  }
  return -1;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assocIndexOf);


/***/ }),

/***/ 18382:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62612);
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13391);



/**
 * The base implementation of `_.assign` without support for multiple sources
 * or `customizer` functions.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @returns {Object} Returns `object`.
 */
function baseAssign(object, source) {
  return object && (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(source, (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssign);


/***/ }),

/***/ 9721:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62612);
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(180);



/**
 * The base implementation of `_.assignIn` without support for multiple sources
 * or `customizer` functions.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @returns {Object} Returns `object`.
 */
function baseAssignIn(object, source) {
  return object && (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(source, (0,_keysIn_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssignIn);


/***/ }),

/***/ 18829:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30864);


/**
 * The base implementation of `assignValue` and `assignMergeValue` without
 * value checks.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A) {
    (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssignValue);


/***/ }),

/***/ 37826:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6920);
/* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(91644);
/* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(84434);
/* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18382);
/* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9721);
/* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75039);
/* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80766);
/* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2830);
/* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13657);
/* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(69493);
/* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(43238);
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4714);
/* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67986);
/* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(76148);
/* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44136);
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68058);
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1561);
/* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(31197);
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);
/* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(29947);
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(13391);
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(180);























/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
    CLONE_FLAT_FLAG = 2,
    CLONE_SYMBOLS_FLAG = 4;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;

/**
 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
 * traversed objects.
 *
 * @private
 * @param {*} value The value to clone.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Deep clone
 *  2 - Flatten inherited properties
 *  4 - Clone symbols
 * @param {Function} [customizer] The function to customize cloning.
 * @param {string} [key] The key of `value`.
 * @param {Object} [object] The parent object of `value`.
 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
 * @returns {*} Returns the cloned value.
 */
function baseClone(value, bitmask, customizer, key, object, stack) {
  var result,
      isDeep = bitmask & CLONE_DEEP_FLAG,
      isFlat = bitmask & CLONE_FLAT_FLAG,
      isFull = bitmask & CLONE_SYMBOLS_FLAG;

  if (customizer) {
    result = object ? customizer(value, key, object, stack) : customizer(value);
  }
  if (result !== undefined) {
    return result;
  }
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return value;
  }
  var isArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value);
  if (isArr) {
    result = (0,_initCloneArray_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value);
    if (!isDeep) {
      return (0,_copyArray_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(value, result);
    }
  } else {
    var tag = (0,_getTag_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(value),
        isFunc = tag == funcTag || tag == genTag;

    if ((0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(value)) {
      return (0,_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(value, isDeep);
    }
    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
      result = (isFlat || isFunc) ? {} : (0,_initCloneObject_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)(value);
      if (!isDeep) {
        return isFlat
          ? (0,_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(value, (0,_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(result, value))
          : (0,_copySymbols_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A)(value, (0,_baseAssign_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(result, value));
      }
    } else {
      if (!cloneableTags[tag]) {
        return object ? value : {};
      }
      result = (0,_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(value, tag, isDeep);
    }
  }
  // Check for circular references and return its corresponding clone.
  stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A);
  var stacked = stack.get(value);
  if (stacked) {
    return stacked;
  }
  stack.set(value, result);

  if ((0,_isSet_js__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(value)) {
    value.forEach(function(subValue) {
      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
    });
  } else if ((0,_isMap_js__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(value)) {
    value.forEach(function(subValue, key) {
      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
    });
  }

  var keysFunc = isFull
    ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .A)
    : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .A : _keys_js__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .A);

  var props = isArr ? undefined : keysFunc(value);
  (0,_arrayEach_js__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .A)(props || value, function(subValue, key) {
    if (props) {
      key = subValue;
      subValue = value[key];
    }
    // Recursively populate clone (susceptible to call stack limits).
    (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_21__/* ["default"] */ .A)(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  });
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseClone);


/***/ }),

/***/ 91247:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);


/** Built-in value references. */
var objectCreate = Object.create;

/**
 * The base implementation of `_.create` without support for assigning
 * properties to the created object.
 *
 * @private
 * @param {Object} proto The object to inherit from.
 * @returns {Object} Returns the new object.
 */
var baseCreate = (function() {
  function object() {}
  return function(proto) {
    if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(proto)) {
      return {};
    }
    if (objectCreate) {
      return objectCreate(proto);
    }
    object.prototype = proto;
    var result = new object;
    object.prototype = undefined;
    return result;
  };
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseCreate);


/***/ }),

/***/ 57914:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: () => (/* binding */ _baseEach)
});

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js
/**
 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
 *
 * @private
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new base function.
 */
function createBaseFor(fromRight) {
  return function(object, iteratee, keysFunc) {
    var index = -1,
        iterable = Object(object),
        props = keysFunc(object),
        length = props.length;

    while (length--) {
      var key = props[fromRight ? length : ++index];
      if (iteratee(iterable[key], key, iterable) === false) {
        break;
      }
    }
    return object;
  };
}

/* harmony default export */ const _createBaseFor = (createBaseFor);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js


/**
 * The base implementation of `baseForOwn` which iterates over `object`
 * properties returned by `keysFunc` and invokes `iteratee` for each property.
 * Iteratee functions may exit iteration early by explicitly returning `false`.
 *
 * @private
 * @param {Object} object The object to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @returns {Object} Returns `object`.
 */
var baseFor = _createBaseFor();

/* harmony default export */ const _baseFor = (baseFor);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
var keys = __webpack_require__(13391);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js



/**
 * The base implementation of `_.forOwn` without support for iteratee shorthands.
 *
 * @private
 * @param {Object} object The object to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Object} Returns `object`.
 */
function baseForOwn(object, iteratee) {
  return object && _baseFor(object, iteratee, keys/* default */.A);
}

/* harmony default export */ const _baseForOwn = (baseForOwn);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js
var isArrayLike = __webpack_require__(89413);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js


/**
 * Creates a `baseEach` or `baseEachRight` function.
 *
 * @private
 * @param {Function} eachFunc The function to iterate over a collection.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new base function.
 */
function createBaseEach(eachFunc, fromRight) {
  return function(collection, iteratee) {
    if (collection == null) {
      return collection;
    }
    if (!(0,isArrayLike/* default */.A)(collection)) {
      return eachFunc(collection, iteratee);
    }
    var length = collection.length,
        index = fromRight ? length : -1,
        iterable = Object(collection);

    while ((fromRight ? index-- : ++index < length)) {
      if (iteratee(iterable[index], index, iterable) === false) {
        break;
      }
    }
    return collection;
  };
}

/* harmony default export */ const _createBaseEach = (createBaseEach);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js



/**
 * The base implementation of `_.forEach` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array|Object} Returns `collection`.
 */
var baseEach = _createBaseEach(_baseForOwn);

/* harmony default export */ const _baseEach = (baseEach);


/***/ }),

/***/ 9047:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93266);
/* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65732);



/**
 * The base implementation of `_.get` without support for default values.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @returns {*} Returns the resolved value.
 */
function baseGet(object, path) {
  path = (0,_castPath_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(path, object);

  var index = 0,
      length = path.length;

  while (object != null && index < length) {
    object = object[(0,_toKey_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(path[index++])];
  }
  return (index && index == length) ? object : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGet);


/***/ }),

/***/ 86712:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56069);
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68058);



/**
 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @param {Function} symbolsFunc The function to get the symbols of `object`.
 * @returns {Array} Returns the array of property names and symbols.
 */
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  var result = keysFunc(object);
  return (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object) ? result : (0,_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(result, symbolsFunc(object));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGetAllKeys);


/***/ }),

/***/ 95:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26710);
/* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20330);
/* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15097);




/** `Object#toString` result references. */
var nullTag = '[object Null]',
    undefinedTag = '[object Undefined]';

/** Built-in value references. */
var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.toStringTag : undefined;

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? (0,_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value)
    : (0,_objectToString_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGetTag);


/***/ }),

/***/ 54071:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50119);



/** `Object#toString` result references. */
var argsTag = '[object Arguments]';

/**
 * The base implementation of `_.isArguments`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 */
function baseIsArguments(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) && (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) == argsTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsArguments);


/***/ }),

/***/ 80509:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4714);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50119);



/** `Object#toString` result references. */
var mapTag = '[object Map]';

/**
 * The base implementation of `_.isMap` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
 */
function baseIsMap(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) && (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) == mapTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsMap);


/***/ }),

/***/ 97260:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86931);
/* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55307);
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);
/* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72070);





/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) || (0,_isMasked_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value)) {
    return false;
  }
  var pattern = (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value) ? reIsNative : reIsHostCtor;
  return pattern.test((0,_toSource_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(value));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsNative);


/***/ }),

/***/ 39739:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4714);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50119);



/** `Object#toString` result references. */
var setTag = '[object Set]';

/**
 * The base implementation of `_.isSet` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
 */
function baseIsSet(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) && (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) == setTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsSet);


/***/ }),

/***/ 34414:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95);
/* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24863);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50119);




/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;

/**
 * The base implementation of `_.isTypedArray` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 */
function baseIsTypedArray(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) &&
    (0,_isLength_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value.length) && !!typedArrayTags[(0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value)];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsTypedArray);


/***/ }),

/***/ 37037:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: () => (/* binding */ _baseIteratee)
});

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
var _Stack = __webpack_require__(6920);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
var _MapCache = __webpack_require__(22694);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Adds `value` to the array cache.
 *
 * @private
 * @name add
 * @memberOf SetCache
 * @alias push
 * @param {*} value The value to cache.
 * @returns {Object} Returns the cache instance.
 */
function setCacheAdd(value) {
  this.__data__.set(value, HASH_UNDEFINED);
  return this;
}

/* harmony default export */ const _setCacheAdd = (setCacheAdd);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js
/**
 * Checks if `value` is in the array cache.
 *
 * @private
 * @name has
 * @memberOf SetCache
 * @param {*} value The value to search for.
 * @returns {number} Returns `true` if `value` is found, else `false`.
 */
function setCacheHas(value) {
  return this.__data__.has(value);
}

/* harmony default export */ const _setCacheHas = (setCacheHas);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js




/**
 *
 * Creates an array cache object to store unique values.
 *
 * @private
 * @constructor
 * @param {Array} [values] The values to cache.
 */
function SetCache(values) {
  var index = -1,
      length = values == null ? 0 : values.length;

  this.__data__ = new _MapCache/* default */.A;
  while (++index < length) {
    this.add(values[index]);
  }
}

// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
SetCache.prototype.has = _setCacheHas;

/* harmony default export */ const _SetCache = (SetCache);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js
var _arraySome = __webpack_require__(81261);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js
/**
 * Checks if a `cache` value for `key` exists.
 *
 * @private
 * @param {Object} cache The cache to query.
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function cacheHas(cache, key) {
  return cache.has(key);
}

/* harmony default export */ const _cacheHas = (cacheHas);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js




/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * A specialized version of `baseIsEqualDeep` for arrays with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Array} array The array to compare.
 * @param {Array} other The other array to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `array` and `other` objects.
 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
 */
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      arrLength = array.length,
      othLength = other.length;

  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
    return false;
  }
  // Check that cyclic values are equal.
  var arrStacked = stack.get(array);
  var othStacked = stack.get(other);
  if (arrStacked && othStacked) {
    return arrStacked == other && othStacked == array;
  }
  var index = -1,
      result = true,
      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache : undefined;

  stack.set(array, other);
  stack.set(other, array);

  // Ignore non-index properties.
  while (++index < arrLength) {
    var arrValue = array[index],
        othValue = other[index];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, arrValue, index, other, array, stack)
        : customizer(arrValue, othValue, index, array, other, stack);
    }
    if (compared !== undefined) {
      if (compared) {
        continue;
      }
      result = false;
      break;
    }
    // Recursively compare arrays (susceptible to call stack limits).
    if (seen) {
      if (!(0,_arraySome/* default */.A)(other, function(othValue, othIndex) {
            if (!_cacheHas(seen, othIndex) &&
                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
        result = false;
        break;
      }
    } else if (!(
          arrValue === othValue ||
            equalFunc(arrValue, othValue, bitmask, customizer, stack)
        )) {
      result = false;
      break;
    }
  }
  stack['delete'](array);
  stack['delete'](other);
  return result;
}

/* harmony default export */ const _equalArrays = (equalArrays);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
var _Symbol = __webpack_require__(26710);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js
var _Uint8Array = __webpack_require__(28011);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js
var eq = __webpack_require__(29105);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js
/**
 * Converts `map` to its key-value pairs.
 *
 * @private
 * @param {Object} map The map to convert.
 * @returns {Array} Returns the key-value pairs.
 */
function mapToArray(map) {
  var index = -1,
      result = Array(map.size);

  map.forEach(function(value, key) {
    result[++index] = [key, value];
  });
  return result;
}

/* harmony default export */ const _mapToArray = (mapToArray);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js
/**
 * Converts `set` to an array of its values.
 *
 * @private
 * @param {Object} set The set to convert.
 * @returns {Array} Returns the values.
 */
function setToArray(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function(value) {
    result[++index] = value;
  });
  return result;
}

/* harmony default export */ const _setToArray = (setToArray);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js







/** Used to compose bitmasks for value comparisons. */
var _equalByTag_COMPARE_PARTIAL_FLAG = 1,
    _equalByTag_COMPARE_UNORDERED_FLAG = 2;

/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]';

/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol/* default */.A ? _Symbol/* default */.A.prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * A specialized version of `baseIsEqualDeep` for comparing objects of
 * the same `toStringTag`.
 *
 * **Note:** This function only supports comparing values with tags of
 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {string} tag The `toStringTag` of the objects to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  switch (tag) {
    case dataViewTag:
      if ((object.byteLength != other.byteLength) ||
          (object.byteOffset != other.byteOffset)) {
        return false;
      }
      object = object.buffer;
      other = other.buffer;

    case arrayBufferTag:
      if ((object.byteLength != other.byteLength) ||
          !equalFunc(new _Uint8Array/* default */.A(object), new _Uint8Array/* default */.A(other))) {
        return false;
      }
      return true;

    case boolTag:
    case dateTag:
    case numberTag:
      // Coerce booleans to `1` or `0` and dates to milliseconds.
      // Invalid dates are coerced to `NaN`.
      return (0,eq/* default */.A)(+object, +other);

    case errorTag:
      return object.name == other.name && object.message == other.message;

    case regexpTag:
    case stringTag:
      // Coerce regexes to strings and treat strings, primitives and objects,
      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
      // for more details.
      return object == (other + '');

    case mapTag:
      var convert = _mapToArray;

    case setTag:
      var isPartial = bitmask & _equalByTag_COMPARE_PARTIAL_FLAG;
      convert || (convert = _setToArray);

      if (object.size != other.size && !isPartial) {
        return false;
      }
      // Assume cyclic values are equal.
      var stacked = stack.get(object);
      if (stacked) {
        return stacked == other;
      }
      bitmask |= _equalByTag_COMPARE_UNORDERED_FLAG;

      // Recursively compare objects (susceptible to call stack limits).
      stack.set(object, other);
      var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
      stack['delete'](object);
      return result;

    case symbolTag:
      if (symbolValueOf) {
        return symbolValueOf.call(object) == symbolValueOf.call(other);
      }
  }
  return false;
}

/* harmony default export */ const _equalByTag = (equalByTag);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js
var _getAllKeys = __webpack_require__(69493);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js


/** Used to compose bitmasks for value comparisons. */
var _equalObjects_COMPARE_PARTIAL_FLAG = 1;

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var _equalObjects_hasOwnProperty = objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqualDeep` for objects with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & _equalObjects_COMPARE_PARTIAL_FLAG,
      objProps = (0,_getAllKeys/* default */.A)(object),
      objLength = objProps.length,
      othProps = (0,_getAllKeys/* default */.A)(other),
      othLength = othProps.length;

  if (objLength != othLength && !isPartial) {
    return false;
  }
  var index = objLength;
  while (index--) {
    var key = objProps[index];
    if (!(isPartial ? key in other : _equalObjects_hasOwnProperty.call(other, key))) {
      return false;
    }
  }
  // Check that cyclic values are equal.
  var objStacked = stack.get(object);
  var othStacked = stack.get(other);
  if (objStacked && othStacked) {
    return objStacked == other && othStacked == object;
  }
  var result = true;
  stack.set(object, other);
  stack.set(other, object);

  var skipCtor = isPartial;
  while (++index < objLength) {
    key = objProps[index];
    var objValue = object[key],
        othValue = other[key];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, objValue, key, other, object, stack)
        : customizer(objValue, othValue, key, object, other, stack);
    }
    // Recursively compare objects (susceptible to call stack limits).
    if (!(compared === undefined
          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
          : compared
        )) {
      result = false;
      break;
    }
    skipCtor || (skipCtor = key == 'constructor');
  }
  if (result && !skipCtor) {
    var objCtor = object.constructor,
        othCtor = other.constructor;

    // Non `Object` object instances with different constructors are not equal.
    if (objCtor != othCtor &&
        ('constructor' in object && 'constructor' in other) &&
        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
          typeof othCtor == 'function' && othCtor instanceof othCtor)) {
      result = false;
    }
  }
  stack['delete'](object);
  stack['delete'](other);
  return result;
}

/* harmony default export */ const _equalObjects = (equalObjects);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js
var _getTag = __webpack_require__(4714);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
var isArray = __webpack_require__(68058);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
var isBuffer = __webpack_require__(1561);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js
var isTypedArray = __webpack_require__(76686);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js









/** Used to compose bitmasks for value comparisons. */
var _baseIsEqualDeep_COMPARE_PARTIAL_FLAG = 1;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    objectTag = '[object Object]';

/** Used for built-in method references. */
var _baseIsEqualDeep_objectProto = Object.prototype;

/** Used to check objects for own properties. */
var _baseIsEqualDeep_hasOwnProperty = _baseIsEqualDeep_objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqual` for arrays and objects which performs
 * deep comparisons and tracks traversed objects enabling objects with circular
 * references to be compared.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = (0,isArray/* default */.A)(object),
      othIsArr = (0,isArray/* default */.A)(other),
      objTag = objIsArr ? arrayTag : (0,_getTag/* default */.A)(object),
      othTag = othIsArr ? arrayTag : (0,_getTag/* default */.A)(other);

  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;

  var objIsObj = objTag == objectTag,
      othIsObj = othTag == objectTag,
      isSameTag = objTag == othTag;

  if (isSameTag && (0,isBuffer/* default */.A)(object)) {
    if (!(0,isBuffer/* default */.A)(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new _Stack/* default */.A);
    return (objIsArr || (0,isTypedArray/* default */.A)(object))
      ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
      : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & _baseIsEqualDeep_COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && _baseIsEqualDeep_hasOwnProperty.call(object, '__wrapped__'),
        othIsWrapped = othIsObj && _baseIsEqualDeep_hasOwnProperty.call(other, '__wrapped__');

    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object,
          othUnwrapped = othIsWrapped ? other.value() : other;

      stack || (stack = new _Stack/* default */.A);
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new _Stack/* default */.A);
  return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}

/* harmony default export */ const _baseIsEqualDeep = (baseIsEqualDeep);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
var isObjectLike = __webpack_require__(50119);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js



/**
 * The base implementation of `_.isEqual` which supports partial comparisons
 * and tracks traversed objects.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Unordered comparison
 *  2 - Partial comparison
 * @param {Function} [customizer] The function to customize comparisons.
 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 */
function baseIsEqual(value, other, bitmask, customizer, stack) {
  if (value === other) {
    return true;
  }
  if (value == null || other == null || (!(0,isObjectLike/* default */.A)(value) && !(0,isObjectLike/* default */.A)(other))) {
    return value !== value && other !== other;
  }
  return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}

/* harmony default export */ const _baseIsEqual = (baseIsEqual);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js



/** Used to compose bitmasks for value comparisons. */
var _baseIsMatch_COMPARE_PARTIAL_FLAG = 1,
    _baseIsMatch_COMPARE_UNORDERED_FLAG = 2;

/**
 * The base implementation of `_.isMatch` without support for iteratee shorthands.
 *
 * @private
 * @param {Object} object The object to inspect.
 * @param {Object} source The object of property values to match.
 * @param {Array} matchData The property names, values, and compare flags to match.
 * @param {Function} [customizer] The function to customize comparisons.
 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
 */
function baseIsMatch(object, source, matchData, customizer) {
  var index = matchData.length,
      length = index,
      noCustomizer = !customizer;

  if (object == null) {
    return !length;
  }
  object = Object(object);
  while (index--) {
    var data = matchData[index];
    if ((noCustomizer && data[2])
          ? data[1] !== object[data[0]]
          : !(data[0] in object)
        ) {
      return false;
    }
  }
  while (++index < length) {
    data = matchData[index];
    var key = data[0],
        objValue = object[key],
        srcValue = data[1];

    if (noCustomizer && data[2]) {
      if (objValue === undefined && !(key in object)) {
        return false;
      }
    } else {
      var stack = new _Stack/* default */.A;
      if (customizer) {
        var result = customizer(objValue, srcValue, key, object, source, stack);
      }
      if (!(result === undefined
            ? _baseIsEqual(srcValue, objValue, _baseIsMatch_COMPARE_PARTIAL_FLAG | _baseIsMatch_COMPARE_UNORDERED_FLAG, customizer, stack)
            : result
          )) {
        return false;
      }
    }
  }
  return true;
}

/* harmony default export */ const _baseIsMatch = (baseIsMatch);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
var isObject = __webpack_require__(75344);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js


/**
 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` if suitable for strict
 *  equality comparisons, else `false`.
 */
function isStrictComparable(value) {
  return value === value && !(0,isObject/* default */.A)(value);
}

/* harmony default export */ const _isStrictComparable = (isStrictComparable);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
var keys = __webpack_require__(13391);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js



/**
 * Gets the property names, values, and compare flags of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the match data of `object`.
 */
function getMatchData(object) {
  var result = (0,keys/* default */.A)(object),
      length = result.length;

  while (length--) {
    var key = result[length],
        value = object[key];

    result[length] = [key, value, _isStrictComparable(value)];
  }
  return result;
}

/* harmony default export */ const _getMatchData = (getMatchData);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js
/**
 * A specialized version of `matchesProperty` for source values suitable
 * for strict equality comparisons, i.e. `===`.
 *
 * @private
 * @param {string} key The key of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 */
function matchesStrictComparable(key, srcValue) {
  return function(object) {
    if (object == null) {
      return false;
    }
    return object[key] === srcValue &&
      (srcValue !== undefined || (key in Object(object)));
  };
}

/* harmony default export */ const _matchesStrictComparable = (matchesStrictComparable);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js




/**
 * The base implementation of `_.matches` which doesn't clone `source`.
 *
 * @private
 * @param {Object} source The object of property values to match.
 * @returns {Function} Returns the new spec function.
 */
function baseMatches(source) {
  var matchData = _getMatchData(source);
  if (matchData.length == 1 && matchData[0][2]) {
    return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
  }
  return function(object) {
    return object === source || _baseIsMatch(object, source, matchData);
  };
}

/* harmony default export */ const _baseMatches = (baseMatches);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js
var get = __webpack_require__(76119);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js
/**
 * The base implementation of `_.hasIn` without support for deep paths.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {Array|string} key The key to check.
 * @returns {boolean} Returns `true` if `key` exists, else `false`.
 */
function baseHasIn(object, key) {
  return object != null && key in Object(object);
}

/* harmony default export */ const _baseHasIn = (baseHasIn);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
var _castPath = __webpack_require__(93266);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
var isArguments = __webpack_require__(63479);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js
var _isIndex = __webpack_require__(50556);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js
var isLength = __webpack_require__(24863);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js
var _toKey = __webpack_require__(65732);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js







/**
 * Checks if `path` exists on `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @param {Function} hasFunc The function to check properties.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 */
function hasPath(object, path, hasFunc) {
  path = (0,_castPath/* default */.A)(path, object);

  var index = -1,
      length = path.length,
      result = false;

  while (++index < length) {
    var key = (0,_toKey/* default */.A)(path[index]);
    if (!(result = object != null && hasFunc(object, key))) {
      break;
    }
    object = object[key];
  }
  if (result || ++index != length) {
    return result;
  }
  length = object == null ? 0 : object.length;
  return !!length && (0,isLength/* default */.A)(length) && (0,_isIndex/* default */.A)(key, length) &&
    ((0,isArray/* default */.A)(object) || (0,isArguments/* default */.A)(object));
}

/* harmony default export */ const _hasPath = (hasPath);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js



/**
 * Checks if `path` is a direct or inherited property of `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 * @example
 *
 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
 *
 * _.hasIn(object, 'a');
 * // => true
 *
 * _.hasIn(object, 'a.b');
 * // => true
 *
 * _.hasIn(object, ['a', 'b']);
 * // => true
 *
 * _.hasIn(object, 'b');
 * // => false
 */
function hasIn(object, path) {
  return object != null && _hasPath(object, path, _baseHasIn);
}

/* harmony default export */ const lodash_es_hasIn = (hasIn);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
var _isKey = __webpack_require__(50255);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js








/** Used to compose bitmasks for value comparisons. */
var _baseMatchesProperty_COMPARE_PARTIAL_FLAG = 1,
    _baseMatchesProperty_COMPARE_UNORDERED_FLAG = 2;

/**
 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
 *
 * @private
 * @param {string} path The path of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 */
function baseMatchesProperty(path, srcValue) {
  if ((0,_isKey/* default */.A)(path) && _isStrictComparable(srcValue)) {
    return _matchesStrictComparable((0,_toKey/* default */.A)(path), srcValue);
  }
  return function(object) {
    var objValue = (0,get/* default */.A)(object, path);
    return (objValue === undefined && objValue === srcValue)
      ? lodash_es_hasIn(object, path)
      : _baseIsEqual(srcValue, objValue, _baseMatchesProperty_COMPARE_PARTIAL_FLAG | _baseMatchesProperty_COMPARE_UNORDERED_FLAG);
  };
}

/* harmony default export */ const _baseMatchesProperty = (baseMatchesProperty);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js
var identity = __webpack_require__(74985);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js
var _baseProperty = __webpack_require__(44646);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
var _baseGet = __webpack_require__(9047);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js


/**
 * A specialized version of `baseProperty` which supports deep paths.
 *
 * @private
 * @param {Array|string} path The path of the property to get.
 * @returns {Function} Returns the new accessor function.
 */
function basePropertyDeep(path) {
  return function(object) {
    return (0,_baseGet/* default */.A)(object, path);
  };
}

/* harmony default export */ const _basePropertyDeep = (basePropertyDeep);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js





/**
 * Creates a function that returns the value at `path` of a given object.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {Array|string} path The path of the property to get.
 * @returns {Function} Returns the new accessor function.
 * @example
 *
 * var objects = [
 *   { 'a': { 'b': 2 } },
 *   { 'a': { 'b': 1 } }
 * ];
 *
 * _.map(objects, _.property('a.b'));
 * // => [2, 1]
 *
 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
 * // => [1, 2]
 */
function property(path) {
  return (0,_isKey/* default */.A)(path) ? (0,_baseProperty/* default */.A)((0,_toKey/* default */.A)(path)) : _basePropertyDeep(path);
}

/* harmony default export */ const lodash_es_property = (property);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js






/**
 * The base implementation of `_.iteratee`.
 *
 * @private
 * @param {*} [value=_.identity] The value to convert to an iteratee.
 * @returns {Function} Returns the iteratee.
 */
function baseIteratee(value) {
  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  if (typeof value == 'function') {
    return value;
  }
  if (value == null) {
    return identity/* default */.A;
  }
  if (typeof value == 'object') {
    return (0,isArray/* default */.A)(value)
      ? _baseMatchesProperty(value[0], value[1])
      : _baseMatches(value);
  }
  return lodash_es_property(value);
}

/* harmony default export */ const _baseIteratee = (baseIteratee);


/***/ }),

/***/ 66543:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3342);
/* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36717);



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeys(object) {
  if (!(0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object)) {
    return (0,_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object);
  }
  var result = [];
  for (var key in Object(object)) {
    if (hasOwnProperty.call(object, key) && key != 'constructor') {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseKeys);


/***/ }),

/***/ 27892:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3342);
/* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69886);




/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeysIn(object) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object)) {
    return (0,_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object);
  }
  var isProto = (0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object),
      result = [];

  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseKeysIn);


/***/ }),

/***/ 44646:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.property` without support for deep paths.
 *
 * @private
 * @param {string} key The key of the property to get.
 * @returns {Function} Returns the new accessor function.
 */
function baseProperty(key) {
  return function(object) {
    return object == null ? undefined : object[key];
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseProperty);


/***/ }),

/***/ 15961:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.slice` without an iteratee call guard.
 *
 * @private
 * @param {Array} array The array to slice.
 * @param {number} [start=0] The start position.
 * @param {number} [end=array.length] The end position.
 * @returns {Array} Returns the slice of `array`.
 */
function baseSlice(array, start, end) {
  var index = -1,
      length = array.length;

  if (start < 0) {
    start = -start > length ? 0 : (length + start);
  }
  end = end > length ? length : end;
  if (end < 0) {
    end += length;
  }
  length = start > end ? 0 : ((end - start) >>> 0);
  start >>>= 0;

  var result = Array(length);
  while (++index < length) {
    result[index] = array[index + start];
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseSlice);


/***/ }),

/***/ 78013:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);

  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseTimes);


/***/ }),

/***/ 36991:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26710);
/* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3323);
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68058);
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13911);





/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.prototype : undefined,
    symbolToString = symbolProto ? symbolProto.toString : undefined;

/**
 * The base implementation of `_.toString` which doesn't convert nullish
 * values to empty strings.
 *
 * @private
 * @param {*} value The value to process.
 * @returns {string} Returns the string.
 */
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return (0,_arrayMap_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value, baseToString) + '';
  }
  if ((0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseToString);


/***/ }),

/***/ 67623:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65581);


/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/**
 * The base implementation of `_.trim`.
 *
 * @private
 * @param {string} string The string to trim.
 * @returns {string} Returns the trimmed string.
 */
function baseTrim(string) {
  return string
    ? string.slice(0, (0,_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(string) + 1).replace(reTrimStart, '')
    : string;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseTrim);


/***/ }),

/***/ 82752:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.unary` without support for storing metadata.
 *
 * @private
 * @param {Function} func The function to cap arguments for.
 * @returns {Function} Returns the new capped function.
 */
function baseUnary(func) {
  return function(value) {
    return func(value);
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseUnary);


/***/ }),

/***/ 93266:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68058);
/* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50255);
/* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29209);
/* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92287);





/**
 * Casts `value` to a path array if it's not one.
 *
 * @private
 * @param {*} value The value to inspect.
 * @param {Object} [object] The object to query keys on.
 * @returns {Array} Returns the cast property path array.
 */
function castPath(value, object) {
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return value;
  }
  return (0,_isKey_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value, object) ? [value] : (0,_stringToPath_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)((0,_toString_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(value));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (castPath);


/***/ }),

/***/ 30206:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28011);


/**
 * Creates a clone of `arrayBuffer`.
 *
 * @private
 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
 * @returns {ArrayBuffer} Returns the cloned array buffer.
 */
function cloneArrayBuffer(arrayBuffer) {
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A(result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A(arrayBuffer));
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneArrayBuffer);


/***/ }),

/***/ 75039:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);


/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Buffer : undefined,
    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;

/**
 * Creates a clone of  `buffer`.
 *
 * @private
 * @param {Buffer} buffer The buffer to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Buffer} Returns the cloned buffer.
 */
function cloneBuffer(buffer, isDeep) {
  if (isDeep) {
    return buffer.slice();
  }
  var length = buffer.length,
      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);

  buffer.copy(result);
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneBuffer);


/***/ }),

/***/ 39964:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30206);


/**
 * Creates a clone of `dataView`.
 *
 * @private
 * @param {Object} dataView The data view to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the cloned data view.
 */
function cloneDataView(dataView, isDeep) {
  var buffer = isDeep ? (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(dataView.buffer) : dataView.buffer;
  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneDataView);


/***/ }),

/***/ 5232:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;

/**
 * Creates a clone of `regexp`.
 *
 * @private
 * @param {Object} regexp The regexp to clone.
 * @returns {Object} Returns the cloned regexp.
 */
function cloneRegExp(regexp) {
  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  result.lastIndex = regexp.lastIndex;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneRegExp);


/***/ }),

/***/ 75169:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26710);


/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * Creates a clone of the `symbol` object.
 *
 * @private
 * @param {Object} symbol The symbol object to clone.
 * @returns {Object} Returns the cloned symbol object.
 */
function cloneSymbol(symbol) {
  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneSymbol);


/***/ }),

/***/ 1060:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30206);


/**
 * Creates a clone of `typedArray`.
 *
 * @private
 * @param {Object} typedArray The typed array to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the cloned typed array.
 */
function cloneTypedArray(typedArray, isDeep) {
  var buffer = isDeep ? (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(typedArray.buffer) : typedArray.buffer;
  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneTypedArray);


/***/ }),

/***/ 80766:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Copies the values of `source` to `array`.
 *
 * @private
 * @param {Array} source The array to copy values from.
 * @param {Array} [array=[]] The array to copy values to.
 * @returns {Array} Returns `array`.
 */
function copyArray(source, array) {
  var index = -1,
      length = source.length;

  array || (array = Array(length));
  while (++index < length) {
    array[index] = source[index];
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyArray);


/***/ }),

/***/ 62612:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84434);
/* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18829);



/**
 * Copies properties of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy properties from.
 * @param {Array} props The property identifiers to copy.
 * @param {Object} [object={}] The object to copy properties to.
 * @param {Function} [customizer] The function to customize copied values.
 * @returns {Object} Returns `object`.
 */
function copyObject(source, props, object, customizer) {
  var isNew = !object;
  object || (object = {});

  var index = -1,
      length = props.length;

  while (++index < length) {
    var key = props[index];

    var newValue = customizer
      ? customizer(object[key], source[key], key, object, source)
      : undefined;

    if (newValue === undefined) {
      newValue = source[key];
    }
    if (isNew) {
      (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, key, newValue);
    } else {
      (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object, key, newValue);
    }
  }
  return object;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyObject);


/***/ }),

/***/ 2830:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62612);
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18439);



/**
 * Copies own symbols of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy symbols from.
 * @param {Object} [object={}] The object to copy symbols to.
 * @returns {Object} Returns `object`.
 */
function copySymbols(source, object) {
  return (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(source, (0,_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copySymbols);


/***/ }),

/***/ 13657:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62612);
/* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80588);



/**
 * Copies own and inherited symbols of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy symbols from.
 * @param {Object} [object={}] The object to copy symbols to.
 * @returns {Object} Returns `object`.
 */
function copySymbolsIn(source, object) {
  return (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(source, (0,_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copySymbolsIn);


/***/ }),

/***/ 42666:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);


/** Used to detect overreaching core-js shims. */
var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A['__core-js_shared__'];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (coreJsData);


/***/ }),

/***/ 30864:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);


var defineProperty = (function() {
  try {
    var func = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(Object, 'defineProperty');
    func({}, '', {});
    return func;
  } catch (e) {}
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defineProperty);


/***/ }),

/***/ 90811:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (freeGlobal);


/***/ }),

/***/ 69493:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86712);
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18439);
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13391);




/**
 * Creates an array of own enumerable property names and symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeys(object) {
  return (0,_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, _keys_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getAllKeys);


/***/ }),

/***/ 43238:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86712);
/* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80588);
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(180);




/**
 * Creates an array of own and inherited enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeysIn(object) {
  return (0,_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getAllKeysIn);


/***/ }),

/***/ 27528:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41783);


/**
 * Gets the data for `map`.
 *
 * @private
 * @param {Object} map The map to query.
 * @param {string} key The reference key.
 * @returns {*} Returns the map data.
 */
function getMapData(map, key) {
  var data = map.__data__;
  return (0,_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(key)
    ? data[typeof key == 'string' ? 'string' : 'hash']
    : data.map;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getMapData);


/***/ }),

/***/ 35319:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97260);
/* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24671);



/**
 * Gets the native function at `key` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the method to get.
 * @returns {*} Returns the function if it's native, else `undefined`.
 */
function getNative(object, key) {
  var value = (0,_getValue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, key);
  return (0,_baseIsNative_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) ? value : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getNative);


/***/ }),

/***/ 93196:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81770);


/** Built-in value references. */
var getPrototype = (0,_overArg_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(Object.getPrototypeOf, Object);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getPrototype);


/***/ }),

/***/ 20330:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26710);


/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Built-in value references. */
var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.toStringTag : undefined;

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getRawTag);


/***/ }),

/***/ 18439:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24443);
/* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40206);



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;

/**
 * Creates an array of the own enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A : function(object) {
  if (object == null) {
    return [];
  }
  object = Object(object);
  return (0,_arrayFilter_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(nativeGetSymbols(object), function(symbol) {
    return propertyIsEnumerable.call(object, symbol);
  });
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSymbols);


/***/ }),

/***/ 80588:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56069);
/* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93196);
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18439);
/* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40206);





/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;

/**
 * Creates an array of the own and inherited enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A : function(object) {
  var result = [];
  while (object) {
    (0,_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(result, (0,_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object));
    object = (0,_getPrototype_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(object);
  }
  return result;
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSymbolsIn);


/***/ }),

/***/ 4714:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48339);
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59062);
/* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(87793);
/* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84356);
/* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79826);
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95);
/* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72070);








/** `Object#toString` result references. */
var mapTag = '[object Map]',
    objectTag = '[object Object]',
    promiseTag = '[object Promise]',
    setTag = '[object Set]',
    weakMapTag = '[object WeakMap]';

var dataViewTag = '[object DataView]';

/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_DataView_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A),
    mapCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_Map_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A),
    promiseCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_Promise_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A),
    setCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_Set_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A),
    weakMapCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_WeakMap_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A);

/**
 * Gets the `toStringTag` of `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A;

// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((_DataView_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A(new ArrayBuffer(1))) != dataViewTag) ||
    (_Map_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A) != mapTag) ||
    (_Promise_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.resolve()) != promiseTag) ||
    (_Set_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A) != setTag) ||
    (_WeakMap_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A) != weakMapTag)) {
  getTag = function(value) {
    var result = (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(value),
        Ctor = result == objectTag ? value.constructor : undefined,
        ctorString = Ctor ? (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(Ctor) : '';

    if (ctorString) {
      switch (ctorString) {
        case dataViewCtorString: return dataViewTag;
        case mapCtorString: return mapTag;
        case promiseCtorString: return promiseTag;
        case setCtorString: return setTag;
        case weakMapCtorString: return weakMapTag;
      }
    }
    return result;
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getTag);


/***/ }),

/***/ 24671:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Gets the value at `key` of `object`.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function getValue(object, key) {
  return object == null ? undefined : object[key];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getValue);


/***/ }),

/***/ 86013:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91893);


/**
 * Removes all key-value entries from the hash.
 *
 * @private
 * @name clear
 * @memberOf Hash
 */
function hashClear() {
  this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? (0,_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(null) : {};
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashClear);


/***/ }),

/***/ 33853:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes `key` and its value from the hash.
 *
 * @private
 * @name delete
 * @memberOf Hash
 * @param {Object} hash The hash to modify.
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function hashDelete(key) {
  var result = this.has(key) && delete this.__data__[key];
  this.size -= result ? 1 : 0;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashDelete);


/***/ }),

/***/ 14276:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91893);


/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Gets the hash value for `key`.
 *
 * @private
 * @name get
 * @memberOf Hash
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function hashGet(key) {
  var data = this.__data__;
  if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A) {
    var result = data[key];
    return result === HASH_UNDEFINED ? undefined : result;
  }
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashGet);


/***/ }),

/***/ 83472:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91893);


/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Checks if a hash value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Hash
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function hashHas(key) {
  var data = this.__data__;
  return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashHas);


/***/ }),

/***/ 55040:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91893);


/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Sets the hash `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Hash
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the hash instance.
 */
function hashSet(key, value) {
  var data = this.__data__;
  this.size += this.has(key) ? 0 : 1;
  data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A && value === undefined) ? HASH_UNDEFINED : value;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashSet);


/***/ }),

/***/ 67986:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Initializes an array clone.
 *
 * @private
 * @param {Array} array The array to clone.
 * @returns {Array} Returns the initialized clone.
 */
function initCloneArray(array) {
  var length = array.length,
      result = new array.constructor(length);

  // Add properties assigned by `RegExp#exec`.
  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
    result.index = array.index;
    result.input = array.input;
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneArray);


/***/ }),

/***/ 76148:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30206);
/* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39964);
/* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5232);
/* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75169);
/* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1060);






/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/**
 * Initializes an object clone based on its `toStringTag`.
 *
 * **Note:** This function only supports cloning values with tags of
 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
 *
 * @private
 * @param {Object} object The object to clone.
 * @param {string} tag The `toStringTag` of the object to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the initialized clone.
 */
function initCloneByTag(object, tag, isDeep) {
  var Ctor = object.constructor;
  switch (tag) {
    case arrayBufferTag:
      return (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object);

    case boolTag:
    case dateTag:
      return new Ctor(+object);

    case dataViewTag:
      return (0,_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object, isDeep);

    case float32Tag: case float64Tag:
    case int8Tag: case int16Tag: case int32Tag:
    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
      return (0,_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object, isDeep);

    case mapTag:
      return new Ctor;

    case numberTag:
    case stringTag:
      return new Ctor(object);

    case regexpTag:
      return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(object);

    case setTag:
      return new Ctor;

    case symbolTag:
      return (0,_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(object);
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneByTag);


/***/ }),

/***/ 44136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91247);
/* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93196);
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3342);




/**
 * Initializes an object clone.
 *
 * @private
 * @param {Object} object The object to clone.
 * @returns {Object} Returns the initialized clone.
 */
function initCloneObject(object) {
  return (typeof object.constructor == 'function' && !(0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object))
    ? (0,_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)((0,_getPrototype_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object))
    : {};
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneObject);


/***/ }),

/***/ 50556:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIndex);


/***/ }),

/***/ 86971:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29105);
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89413);
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50556);
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);





/**
 * Checks if the given arguments are from an iteratee call.
 *
 * @private
 * @param {*} value The potential iteratee value argument.
 * @param {*} index The potential iteratee index or key argument.
 * @param {*} object The potential iteratee object argument.
 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
 *  else `false`.
 */
function isIterateeCall(value, index, object) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number'
        ? ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object) && (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(index, object.length))
        : (type == 'string' && index in object)
      ) {
    return (0,_eq_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(object[index], value);
  }
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIterateeCall);


/***/ }),

/***/ 50255:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68058);
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13911);



/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
    reIsPlainProp = /^\w*$/;

/**
 * Checks if `value` is a property name and not a property path.
 *
 * @private
 * @param {*} value The value to check.
 * @param {Object} [object] The object to query keys on.
 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
 */
function isKey(value, object) {
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return false;
  }
  var type = typeof value;
  if (type == 'number' || type == 'symbol' || type == 'boolean' ||
      value == null || (0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value)) {
    return true;
  }
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
    (object != null && value in Object(object));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isKey);


/***/ }),

/***/ 41783:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is suitable for use as unique object key.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
 */
function isKeyable(value) {
  var type = typeof value;
  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
    ? (value !== '__proto__')
    : (value === null);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isKeyable);


/***/ }),

/***/ 55307:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42666);


/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
  var uid = /[^.]+$/.exec(_coreJsData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.keys && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.keys.IE_PROTO || '');
  return uid ? ('Symbol(src)_1.' + uid) : '';
}());

/**
 * Checks if `func` has its source masked.
 *
 * @private
 * @param {Function} func The function to check.
 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
 */
function isMasked(func) {
  return !!maskSrcKey && (maskSrcKey in func);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isMasked);


/***/ }),

/***/ 3342:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Checks if `value` is likely a prototype object.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 */
function isPrototype(value) {
  var Ctor = value && value.constructor,
      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

  return value === proto;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPrototype);


/***/ }),

/***/ 40765:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes all key-value entries from the list cache.
 *
 * @private
 * @name clear
 * @memberOf ListCache
 */
function listCacheClear() {
  this.__data__ = [];
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheClear);


/***/ }),

/***/ 78269:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);


/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * Removes `key` and its value from the list cache.
 *
 * @private
 * @name delete
 * @memberOf ListCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function listCacheDelete(key) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(data, key);

  if (index < 0) {
    return false;
  }
  var lastIndex = data.length - 1;
  if (index == lastIndex) {
    data.pop();
  } else {
    splice.call(data, index, 1);
  }
  --this.size;
  return true;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheDelete);


/***/ }),

/***/ 30308:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);


/**
 * Gets the list cache value for `key`.
 *
 * @private
 * @name get
 * @memberOf ListCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function listCacheGet(key) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(data, key);

  return index < 0 ? undefined : data[index][1];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheGet);


/***/ }),

/***/ 58928:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);


/**
 * Checks if a list cache value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf ListCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function listCacheHas(key) {
  return (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(this.__data__, key) > -1;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheHas);


/***/ }),

/***/ 13600:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);


/**
 * Sets the list cache `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf ListCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the list cache instance.
 */
function listCacheSet(key, value) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(data, key);

  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheSet);


/***/ }),

/***/ 30381:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78070);
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(118);
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59062);




/**
 * Removes all key-value entries from the map.
 *
 * @private
 * @name clear
 * @memberOf MapCache
 */
function mapCacheClear() {
  this.size = 0;
  this.__data__ = {
    'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A,
    'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A || _ListCache_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A),
    'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheClear);


/***/ }),

/***/ 2157:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27528);


/**
 * Removes `key` and its value from the map.
 *
 * @private
 * @name delete
 * @memberOf MapCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function mapCacheDelete(key) {
  var result = (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(this, key)['delete'](key);
  this.size -= result ? 1 : 0;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheDelete);


/***/ }),

/***/ 99028:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27528);


/**
 * Gets the map value for `key`.
 *
 * @private
 * @name get
 * @memberOf MapCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function mapCacheGet(key) {
  return (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(this, key).get(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheGet);


/***/ }),

/***/ 79360:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27528);


/**
 * Checks if a map value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf MapCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function mapCacheHas(key) {
  return (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(this, key).has(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheHas);


/***/ }),

/***/ 45328:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27528);


/**
 * Sets the map `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf MapCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the map cache instance.
 */
function mapCacheSet(key, value) {
  var data = (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(this, key),
      size = data.size;

  data.set(key, value);
  this.size += data.size == size ? 0 : 1;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheSet);


/***/ }),

/***/ 15457:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44191);


/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;

/**
 * A specialized version of `_.memoize` which clears the memoized function's
 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
 *
 * @private
 * @param {Function} func The function to have its output memoized.
 * @returns {Function} Returns the new memoized function.
 */
function memoizeCapped(func) {
  var result = (0,_memoize_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(func, function(key) {
    if (cache.size === MAX_MEMOIZE_SIZE) {
      cache.clear();
    }
    return key;
  });

  var cache = result.cache;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeCapped);


/***/ }),

/***/ 91893:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35319);


/* Built-in method references that are verified to be native. */
var nativeCreate = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(Object, 'create');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeCreate);


/***/ }),

/***/ 36717:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81770);


/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = (0,_overArg_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(Object.keys, Object);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeKeys);


/***/ }),

/***/ 69886:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This function is like
 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * except that it includes inherited enumerable properties.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function nativeKeysIn(object) {
  var result = [];
  if (object != null) {
    for (var key in Object(object)) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeKeysIn);


/***/ }),

/***/ 80182:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90811);


/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
  try {
    // Use `util.types` for Node.js 10+.
    var types = freeModule && freeModule.require && freeModule.require('util').types;

    if (types) {
      return types;
    }

    // Legacy `process.binding('util')` for Node.js < 10.
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nodeUtil);


/***/ }),

/***/ 15097:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (objectToString);


/***/ }),

/***/ 81770:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Creates a unary function that invokes `func` with its argument transformed.
 *
 * @private
 * @param {Function} func The function to wrap.
 * @param {Function} transform The argument transform.
 * @returns {Function} Returns the new function.
 */
function overArg(func, transform) {
  return function(arg) {
    return func(transform(arg));
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (overArg);


/***/ }),

/***/ 65970:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90811);


/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A || freeSelf || Function('return this')();

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (root);


/***/ }),

/***/ 18283:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(118);


/**
 * Removes all key-value entries from the stack.
 *
 * @private
 * @name clear
 * @memberOf Stack
 */
function stackClear() {
  this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackClear);


/***/ }),

/***/ 76719:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes `key` and its value from the stack.
 *
 * @private
 * @name delete
 * @memberOf Stack
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function stackDelete(key) {
  var data = this.__data__,
      result = data['delete'](key);

  this.size = data.size;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackDelete);


/***/ }),

/***/ 65118:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Gets the stack value for `key`.
 *
 * @private
 * @name get
 * @memberOf Stack
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function stackGet(key) {
  return this.__data__.get(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackGet);


/***/ }),

/***/ 9226:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if a stack value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Stack
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function stackHas(key) {
  return this.__data__.has(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackHas);


/***/ }),

/***/ 18994:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(118);
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59062);
/* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22694);




/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/**
 * Sets the stack `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Stack
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the stack cache instance.
 */
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A) {
    var pairs = data.__data__;
    if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A(pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackSet);


/***/ }),

/***/ 29209:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15457);


/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;

/**
 * Converts `string` to a property path array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the property path array.
 */
var stringToPath = (0,_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(function(string) {
  var result = [];
  if (string.charCodeAt(0) === 46 /* . */) {
    result.push('');
  }
  string.replace(rePropName, function(match, number, quote, subString) {
    result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  });
  return result;
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringToPath);


/***/ }),

/***/ 65732:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13911);


/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/**
 * Converts `value` to a string key if it's not a string or symbol.
 *
 * @private
 * @param {*} value The value to inspect.
 * @returns {string|symbol} Returns the key.
 */
function toKey(value) {
  if (typeof value == 'string' || (0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return value;
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toKey);


/***/ }),

/***/ 72070:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var funcProto = Function.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/**
 * Converts `func` to its source code.
 *
 * @private
 * @param {Function} func The function to convert.
 * @returns {string} Returns the source code.
 */
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return (func + '');
    } catch (e) {}
  }
  return '';
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toSource);


/***/ }),

/***/ 65581:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/**
 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
 * character of `string`.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {number} Returns the index of the last non-whitespace character.
 */
function trimmedEndIndex(string) {
  var index = string.length;

  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (trimmedEndIndex);


/***/ }),

/***/ 38088:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37826);


/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
    CLONE_SYMBOLS_FLAG = 4;

/**
 * This method is like `_.clone` except that it recursively clones `value`.
 *
 * @static
 * @memberOf _
 * @since 1.0.0
 * @category Lang
 * @param {*} value The value to recursively clone.
 * @returns {*} Returns the deep cloned value.
 * @see _.clone
 * @example
 *
 * var objects = [{ 'a': 1 }, { 'b': 2 }];
 *
 * var deep = _.cloneDeep(objects);
 * console.log(deep[0] === objects[0]);
 * // => false
 */
function cloneDeep(value) {
  return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneDeep);


/***/ }),

/***/ 19820:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(75344);
/* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93691);
/* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98639);




/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
    nativeMin = Math.min;

/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */
function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  wait = (0,_toNumber_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(wait) || 0;
  if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax((0,_toNumber_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;

    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time;
    // Start the timer for the trailing edge.
    timerId = setTimeout(timerExpired, wait);
    // Invoke the leading edge.
    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        timeWaiting = wait - timeSinceLastCall;

    return maxing
      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
      : timeWaiting;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime;

    // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.
    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  }

  function timerExpired() {
    var time = (0,_now_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    // Restart the timer.
    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined;

    // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge((0,_now_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)());
  }

  function debounced() {
    var time = (0,_now_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(),
        isInvoking = shouldInvoke(time);

    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        // Handle invocations in a tight loop.
        clearTimeout(timerId);
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (debounce);


/***/ }),

/***/ 29105:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Performs a
 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * comparison between two values to determine if they are equivalent.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.eq(object, object);
 * // => true
 *
 * _.eq(object, other);
 * // => false
 *
 * _.eq('a', 'a');
 * // => true
 *
 * _.eq('a', Object('a'));
 * // => false
 *
 * _.eq(NaN, NaN);
 * // => true
 */
function eq(value, other) {
  return value === other || (value !== value && other !== other);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (eq);


/***/ }),

/***/ 76119:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9047);


/**
 * Gets the value at `path` of `object`. If the resolved value is
 * `undefined`, the `defaultValue` is returned in its place.
 *
 * @static
 * @memberOf _
 * @since 3.7.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
 * @returns {*} Returns the resolved value.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
 *
 * _.get(object, 'a[0].b.c');
 * // => 3
 *
 * _.get(object, ['a', '0', 'b', 'c']);
 * // => 3
 *
 * _.get(object, 'a.b.c', 'default');
 * // => 'default'
 */
function get(object, path, defaultValue) {
  var result = object == null ? undefined : (0,_baseGet_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object, path);
  return result === undefined ? defaultValue : result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (get);


/***/ }),

/***/ 74985:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns the first argument it receives.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Util
 * @param {*} value Any value.
 * @returns {*} Returns `value`.
 * @example
 *
 * var object = { 'a': 1 };
 *
 * console.log(_.identity(object) === object);
 * // => true
 */
function identity(value) {
  return value;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (identity);


/***/ }),

/***/ 63479:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54071);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50119);



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/**
 * Checks if `value` is likely an `arguments` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 *  else `false`.
 * @example
 *
 * _.isArguments(function() { return arguments; }());
 * // => true
 *
 * _.isArguments([1, 2, 3]);
 * // => false
 */
var isArguments = (0,_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A : function(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) && hasOwnProperty.call(value, 'callee') &&
    !propertyIsEnumerable.call(value, 'callee');
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArguments);


/***/ }),

/***/ 68058:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
 * @example
 *
 * _.isArray([1, 2, 3]);
 * // => true
 *
 * _.isArray(document.body.children);
 * // => false
 *
 * _.isArray('abc');
 * // => false
 *
 * _.isArray(_.noop);
 * // => false
 */
var isArray = Array.isArray;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArray);


/***/ }),

/***/ 89413:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86931);
/* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24863);



/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && (0,_isLength_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value.length) && !(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArrayLike);


/***/ }),

/***/ 1561:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);
/* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79728);



/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Buffer : undefined;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;

/**
 * Checks if `value` is a buffer.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 * @example
 *
 * _.isBuffer(new Buffer(2));
 * // => true
 *
 * _.isBuffer(new Uint8Array(2));
 * // => false
 */
var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isBuffer);


/***/ }),

/***/ 86931:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75344);



/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    proxyTag = '[object Proxy]';

/**
 * Checks if `value` is classified as a `Function` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
 * @example
 *
 * _.isFunction(_);
 * // => true
 *
 * _.isFunction(/abc/);
 * // => false
 */
function isFunction(value) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return false;
  }
  // The use of `Object#toString` avoids issues with the `typeof` operator
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
  var tag = (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFunction);


/***/ }),

/***/ 24863:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isLength);


/***/ }),

/***/ 31197:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80509);
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82752);
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80182);




/* Node.js helper references. */
var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isMap;

/**
 * Checks if `value` is classified as a `Map` object.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
 * @example
 *
 * _.isMap(new Map);
 * // => true
 *
 * _.isMap(new WeakMap);
 * // => false
 */
var isMap = nodeIsMap ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isMap);


/***/ }),

/***/ 75344:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObject);


/***/ }),

/***/ 50119:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObjectLike);


/***/ }),

/***/ 29947:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39739);
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82752);
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80182);




/* Node.js helper references. */
var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isSet;

/**
 * Checks if `value` is classified as a `Set` object.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
 * @example
 *
 * _.isSet(new Set);
 * // => true
 *
 * _.isSet(new WeakSet);
 * // => false
 */
var isSet = nodeIsSet ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isSet);


/***/ }),

/***/ 13911:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50119);



/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    ((0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value) && (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value) == symbolTag);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isSymbol);


/***/ }),

/***/ 76686:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34414);
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82752);
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80182);




/* Node.js helper references. */
var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isTypedArray;

/**
 * Checks if `value` is classified as a typed array.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 * @example
 *
 * _.isTypedArray(new Uint8Array);
 * // => true
 *
 * _.isTypedArray([]);
 * // => false
 */
var isTypedArray = nodeIsTypedArray ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isTypedArray);


/***/ }),

/***/ 13391:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30274);
/* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66543);
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89413);




/**
 * Creates an array of the own enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects. See the
 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * for more details.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keys(new Foo);
 * // => ['a', 'b'] (iteration order is not guaranteed)
 *
 * _.keys('hi');
 * // => ['0', '1']
 */
function keys(object) {
  return (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object) ? (0,_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object) : (0,_baseKeys_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keys);


/***/ }),

/***/ 180:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30274);
/* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27892);
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89413);




/**
 * Creates an array of the own and inherited enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keysIn(new Foo);
 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
 */
function keysIn(object) {
  return (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(object) ? (0,_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(object, true) : (0,_baseKeysIn_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keysIn);


/***/ }),

/***/ 44191:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22694);


/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/**
 * Creates a function that memoizes the result of `func`. If `resolver` is
 * provided, it determines the cache key for storing the result based on the
 * arguments provided to the memoized function. By default, the first argument
 * provided to the memoized function is used as the map cache key. The `func`
 * is invoked with the `this` binding of the memoized function.
 *
 * **Note:** The cache is exposed as the `cache` property on the memoized
 * function. Its creation may be customized by replacing the `_.memoize.Cache`
 * constructor with one whose instances implement the
 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to have its output memoized.
 * @param {Function} [resolver] The function to resolve the cache key.
 * @returns {Function} Returns the new memoized function.
 * @example
 *
 * var object = { 'a': 1, 'b': 2 };
 * var other = { 'c': 3, 'd': 4 };
 *
 * var values = _.memoize(_.values);
 * values(object);
 * // => [1, 2]
 *
 * values(other);
 * // => [3, 4]
 *
 * object.a = 2;
 * values(object);
 * // => [1, 2]
 *
 * // Modify the result cache.
 * values.cache.set(object, ['a', 'b']);
 * values(object);
 * // => ['a', 'b']
 *
 * // Replace `_.memoize.Cache`.
 * _.memoize.Cache = WeakMap;
 */
function memoize(func, resolver) {
  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  var memoized = function() {
    var args = arguments,
        key = resolver ? resolver.apply(this, args) : args[0],
        cache = memoized.cache;

    if (cache.has(key)) {
      return cache.get(key);
    }
    var result = func.apply(this, args);
    memoized.cache = cache.set(key, result) || cache;
    return result;
  };
  memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);
  return memoized;
}

// Expose `MapCache`.
memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);


/***/ }),

/***/ 93691:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65970);


/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */
var now = function() {
  return _root_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now();
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (now);


/***/ }),

/***/ 94309:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: () => (/* binding */ lodash_es_remove)
});

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js + 22 modules
var _baseIteratee = __webpack_require__(37037);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
var _castPath = __webpack_require__(93266);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js
/**
 * Gets the last element of `array`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Array
 * @param {Array} array The array to query.
 * @returns {*} Returns the last element of `array`.
 * @example
 *
 * _.last([1, 2, 3]);
 * // => 3
 */
function last(array) {
  var length = array == null ? 0 : array.length;
  return length ? array[length - 1] : undefined;
}

/* harmony default export */ const lodash_es_last = (last);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
var _baseGet = __webpack_require__(9047);
// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
var _baseSlice = __webpack_require__(15961);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_parent.js



/**
 * Gets the parent value at `path` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array} path The path to get the parent value of.
 * @returns {*} Returns the parent value.
 */
function _parent_parent(object, path) {
  return path.length < 2 ? object : (0,_baseGet/* default */.A)(object, (0,_baseSlice/* default */.A)(path, 0, -1));
}

/* harmony default export */ const _parent = (_parent_parent);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js
var _toKey = __webpack_require__(65732);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnset.js





/**
 * The base implementation of `_.unset`.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {Array|string} path The property path to unset.
 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
 */
function baseUnset(object, path) {
  path = (0,_castPath/* default */.A)(path, object);
  object = _parent(object, path);
  return object == null || delete object[(0,_toKey/* default */.A)(lodash_es_last(path))];
}

/* harmony default export */ const _baseUnset = (baseUnset);

// EXTERNAL MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js
var _isIndex = __webpack_require__(50556);
;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePullAt.js



/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * The base implementation of `_.pullAt` without support for individual
 * indexes or capturing the removed elements.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {number[]} indexes The indexes of elements to remove.
 * @returns {Array} Returns `array`.
 */
function basePullAt(array, indexes) {
  var length = array ? indexes.length : 0,
      lastIndex = length - 1;

  while (length--) {
    var index = indexes[length];
    if (length == lastIndex || index !== previous) {
      var previous = index;
      if ((0,_isIndex/* default */.A)(index)) {
        splice.call(array, index, 1);
      } else {
        _baseUnset(array, index);
      }
    }
  }
  return array;
}

/* harmony default export */ const _basePullAt = (basePullAt);

;// ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/remove.js



/**
 * Removes all elements from `array` that `predicate` returns truthy for
 * and returns an array of the removed elements. The predicate is invoked
 * with three arguments: (value, index, array).
 *
 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
 * to pull elements from an array by value.
 *
 * @static
 * @memberOf _
 * @since 2.0.0
 * @category Array
 * @param {Array} array The array to modify.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @returns {Array} Returns the new array of removed elements.
 * @example
 *
 * var array = [1, 2, 3, 4];
 * var evens = _.remove(array, function(n) {
 *   return n % 2 == 0;
 * });
 *
 * console.log(array);
 * // => [1, 3]
 *
 * console.log(evens);
 * // => [2, 4]
 */
function remove(array, predicate) {
  var result = [];
  if (!(array && array.length)) {
    return result;
  }
  var index = -1,
      indexes = [],
      length = array.length;

  predicate = (0,_baseIteratee/* default */.A)(predicate, 3);
  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result.push(value);
      indexes.push(index);
    }
  }
  _basePullAt(array, indexes);
  return result;
}

/* harmony default export */ const lodash_es_remove = (remove);


/***/ }),

/***/ 40206:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns a new empty array.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {Array} Returns the new empty array.
 * @example
 *
 * var arrays = _.times(2, _.stubArray);
 *
 * console.log(arrays);
 * // => [[], []]
 *
 * console.log(arrays[0] === arrays[1]);
 * // => false
 */
function stubArray() {
  return [];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stubArray);


/***/ }),

/***/ 79728:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns `false`.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {boolean} Returns `false`.
 * @example
 *
 * _.times(2, _.stubFalse);
 * // => [false, false]
 */
function stubFalse() {
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stubFalse);


/***/ }),

/***/ 98639:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67623);
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(75344);
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13911);




/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;

/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;

/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;

/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if ((0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value)) {
    return NAN;
  }
  if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = (0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(other) ? (other + '') : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = (0,_baseTrim_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(value);
  var isBinary = reIsBinary.test(value);
  return (isBinary || reIsOctal.test(value))
    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
    : (reIsBadHex.test(value) ? NAN : +value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toNumber);


/***/ }),

/***/ 92287:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36991);


/**
 * Converts `value` to a string. An empty string is returned for `null`
 * and `undefined` values. The sign of `-0` is preserved.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 * @example
 *
 * _.toString(null);
 * // => ''
 *
 * _.toString(-0);
 * // => '-0'
 *
 * _.toString([1, 2, 3]);
 * // => '1,2,3'
 */
function toString(value) {
  return value == null ? '' : (0,_baseToString_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toString);


/***/ }),

/***/ 15547:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ nanoid)
/* harmony export */ });
/* unused harmony export customAlphabet */
/* @ts-self-types="./index.d.ts" */
let urlAlphabet =
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
let customAlphabet = (alphabet, defaultSize = 21) => {
  return (size = defaultSize) => {
    let id = ''
    let i = size | 0
    while (i--) {
      id += alphabet[(Math.random() * alphabet.length) | 0]
    }
    return id
  }
}
let nanoid = (size = 21) => {
  let id = ''
  let i = size | 0
  while (i--) {
    id += urlAlphabet[(Math.random() * 64) | 0]
  }
  return id
}


/***/ })

},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ __webpack_require__.O(0, [728,737,436,859,940], () => (__webpack_exec__(72199)));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);